aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acmacros.h6
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/asm-arm/plat-s3c/debug-macro.S75
-rw-r--r--include/asm-arm/plat-s3c/map.h40
-rw-r--r--include/asm-arm/plat-s3c/regs-adc.h60
-rw-r--r--include/asm-arm/plat-s3c/regs-serial.h232
-rw-r--r--include/asm-arm/plat-s3c/regs-timer.h115
-rw-r--r--include/asm-arm/plat-s3c/uncompress.h155
-rw-r--r--include/asm-arm/plat-s3c24xx/clock.h64
-rw-r--r--include/asm-arm/plat-s3c24xx/common-smdk.h15
-rw-r--r--include/asm-arm/plat-s3c24xx/cpu.h54
-rw-r--r--include/asm-arm/plat-s3c24xx/devs.h49
-rw-r--r--include/asm-arm/plat-s3c24xx/dma.h82
-rw-r--r--include/asm-arm/plat-s3c24xx/irq.h109
-rw-r--r--include/asm-arm/plat-s3c24xx/pm.h73
-rw-r--r--include/asm-arm/plat-s3c24xx/s3c2400.h31
-rw-r--r--include/asm-arm/plat-s3c24xx/s3c2410.h31
-rw-r--r--include/asm-arm/plat-s3c24xx/s3c2412.h29
-rw-r--r--include/asm-arm/plat-s3c24xx/s3c2440.h17
-rw-r--r--include/asm-arm/plat-s3c24xx/s3c2442.h17
-rw-r--r--include/asm-arm/plat-s3c24xx/s3c2443.h32
-rw-r--r--include/asm-blackfin/.gitignore1
-rw-r--r--include/asm-blackfin/Kbuild3
-rw-r--r--include/asm-blackfin/a.out.h19
-rw-r--r--include/asm-blackfin/atomic.h144
-rw-r--r--include/asm-blackfin/auxvec.h4
-rw-r--r--include/asm-blackfin/bfin-global.h117
-rw-r--r--include/asm-blackfin/bfin5xx_spi.h137
-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.h218
-rw-r--r--include/asm-blackfin/blackfin.h92
-rw-r--r--include/asm-blackfin/bug.h17
-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.h100
-rw-r--r--include/asm-blackfin/cplb-mpu.h61
-rw-r--r--include/asm-blackfin/cplb.h110
-rw-r--r--include/asm-blackfin/cplbinit.h95
-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.h62
-rw-r--r--include/asm-blackfin/device.h7
-rw-r--r--include/asm-blackfin/div64.h1
-rw-r--r--include/asm-blackfin/dma-mapping.h83
-rw-r--r--include/asm-blackfin/dma.h205
-rw-r--r--include/asm-blackfin/dpmc.h57
-rw-r--r--include/asm-blackfin/early_printk.h28
-rw-r--r--include/asm-blackfin/elf.h127
-rw-r--r--include/asm-blackfin/emergency-restart.h6
-rw-r--r--include/asm-blackfin/entry.h61
-rw-r--r--include/asm-blackfin/errno.h6
-rw-r--r--include/asm-blackfin/fb.h12
-rw-r--r--include/asm-blackfin/fcntl.h13
-rw-r--r--include/asm-blackfin/fixed_code.h46
-rw-r--r--include/asm-blackfin/flat.h58
-rw-r--r--include/asm-blackfin/futex.h6
-rw-r--r--include/asm-blackfin/gpio.h456
-rw-r--r--include/asm-blackfin/gptimers.h191
-rw-r--r--include/asm-blackfin/hardirq.h45
-rw-r--r--include/asm-blackfin/hw_irq.h6
-rw-r--r--include/asm-blackfin/io.h212
-rw-r--r--include/asm-blackfin/ioctl.h1
-rw-r--r--include/asm-blackfin/ioctls.h87
-rw-r--r--include/asm-blackfin/ipcbuf.h30
-rw-r--r--include/asm-blackfin/irq.h72
-rw-r--r--include/asm-blackfin/irq_handler.h33
-rw-r--r--include/asm-blackfin/irq_regs.h1
-rw-r--r--include/asm-blackfin/kdebug.h1
-rw-r--r--include/asm-blackfin/kgdb.h184
-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-bf527/anomaly.h104
-rw-r--r--include/asm-blackfin/mach-bf527/bf527.h127
-rw-r--r--include/asm-blackfin/mach-bf527/bfin_serial_5xx.h195
-rw-r--r--include/asm-blackfin/mach-bf527/bfin_sir.h142
-rw-r--r--include/asm-blackfin/mach-bf527/blackfin.h93
-rw-r--r--include/asm-blackfin/mach-bf527/cdefBF522.h46
-rw-r--r--include/asm-blackfin/mach-bf527/cdefBF525.h461
-rw-r--r--include/asm-blackfin/mach-bf527/cdefBF527.h626
-rw-r--r--include/asm-blackfin/mach-bf527/cdefBF52x_base.h1204
-rw-r--r--include/asm-blackfin/mach-bf527/defBF522.h42
-rw-r--r--include/asm-blackfin/mach-bf527/defBF525.h713
-rw-r--r--include/asm-blackfin/mach-bf527/defBF527.h1090
-rw-r--r--include/asm-blackfin/mach-bf527/defBF52x_base.h2014
-rw-r--r--include/asm-blackfin/mach-bf527/dma.h62
-rw-r--r--include/asm-blackfin/mach-bf527/irq.h259
-rw-r--r--include/asm-blackfin/mach-bf527/mem_init.h310
-rw-r--r--include/asm-blackfin/mach-bf527/mem_map.h102
-rw-r--r--include/asm-blackfin/mach-bf527/portmux.h207
-rw-r--r--include/asm-blackfin/mach-bf533/anomaly.h272
-rw-r--r--include/asm-blackfin/mach-bf533/bf533.h161
-rw-r--r--include/asm-blackfin/mach-bf533/bfin_serial_5xx.h164
-rw-r--r--include/asm-blackfin/mach-bf533/bfin_sir.h125
-rw-r--r--include/asm-blackfin/mach-bf533/blackfin.h60
-rw-r--r--include/asm-blackfin/mach-bf533/cdefBF532.h767
-rw-r--r--include/asm-blackfin/mach-bf533/defBF532.h1266
-rw-r--r--include/asm-blackfin/mach-bf533/dma.h54
-rw-r--r--include/asm-blackfin/mach-bf533/irq.h173
-rw-r--r--include/asm-blackfin/mach-bf533/mem_init.h297
-rw-r--r--include/asm-blackfin/mach-bf533/mem_map.h171
-rw-r--r--include/asm-blackfin/mach-bf533/portmux.h67
-rw-r--r--include/asm-blackfin/mach-bf537/anomaly.h163
-rw-r--r--include/asm-blackfin/mach-bf537/bf537.h141
-rw-r--r--include/asm-blackfin/mach-bf537/bfin_serial_5xx.h195
-rw-r--r--include/asm-blackfin/mach-bf537/bfin_sir.h142
-rw-r--r--include/asm-blackfin/mach-bf537/blackfin.h165
-rw-r--r--include/asm-blackfin/mach-bf537/cdefBF534.h1819
-rw-r--r--include/asm-blackfin/mach-bf537/cdefBF537.h206
-rw-r--r--include/asm-blackfin/mach-bf537/defBF534.h2527
-rw-r--r--include/asm-blackfin/mach-bf537/defBF537.h405
-rw-r--r--include/asm-blackfin/mach-bf537/dma.h55
-rw-r--r--include/asm-blackfin/mach-bf537/irq.h214
-rw-r--r--include/asm-blackfin/mach-bf537/mem_init.h303
-rw-r--r--include/asm-blackfin/mach-bf537/mem_map.h179
-rw-r--r--include/asm-blackfin/mach-bf537/portmux.h144
-rw-r--r--include/asm-blackfin/mach-bf548/anomaly.h100
-rw-r--r--include/asm-blackfin/mach-bf548/bf548.h127
-rw-r--r--include/asm-blackfin/mach-bf548/bf54x-lq043.h30
-rw-r--r--include/asm-blackfin/mach-bf548/bf54x_keys.h17
-rw-r--r--include/asm-blackfin/mach-bf548/bfin_serial_5xx.h220
-rw-r--r--include/asm-blackfin/mach-bf548/bfin_sir.h166
-rw-r--r--include/asm-blackfin/mach-bf548/blackfin.h190
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF542.h590
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF544.h945
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF547.h832
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF548.h1577
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF549.h1863
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF54x_base.h2750
-rw-r--r--include/asm-blackfin/mach-bf548/defBF542.h925
-rw-r--r--include/asm-blackfin/mach-bf548/defBF544.h707
-rw-r--r--include/asm-blackfin/mach-bf548/defBF547.h1244
-rw-r--r--include/asm-blackfin/mach-bf548/defBF548.h1627
-rw-r--r--include/asm-blackfin/mach-bf548/defBF549.h2737
-rw-r--r--include/asm-blackfin/mach-bf548/defBF54x_base.h3956
-rw-r--r--include/asm-blackfin/mach-bf548/dma.h76
-rw-r--r--include/asm-blackfin/mach-bf548/gpio.h219
-rw-r--r--include/asm-blackfin/mach-bf548/irq.h501
-rw-r--r--include/asm-blackfin/mach-bf548/mem_init.h255
-rw-r--r--include/asm-blackfin/mach-bf548/mem_map.h111
-rw-r--r--include/asm-blackfin/mach-bf548/portmux.h286
-rw-r--r--include/asm-blackfin/mach-bf561/anomaly.h274
-rw-r--r--include/asm-blackfin/mach-bf561/bf561.h223
-rw-r--r--include/asm-blackfin/mach-bf561/bfin_serial_5xx.h164
-rw-r--r--include/asm-blackfin/mach-bf561/bfin_sir.h125
-rw-r--r--include/asm-blackfin/mach-bf561/blackfin.h87
-rw-r--r--include/asm-blackfin/mach-bf561/cdefBF561.h1579
-rw-r--r--include/asm-blackfin/mach-bf561/defBF561.h1758
-rw-r--r--include/asm-blackfin/mach-bf561/dma.h35
-rw-r--r--include/asm-blackfin/mach-bf561/irq.h447
-rw-r--r--include/asm-blackfin/mach-bf561/mem_init.h295
-rw-r--r--include/asm-blackfin/mach-bf561/mem_map.h78
-rw-r--r--include/asm-blackfin/mach-bf561/portmux.h89
-rw-r--r--include/asm-blackfin/mach-common/cdef_LPBlackfin.h328
-rw-r--r--include/asm-blackfin/mach-common/clocks.h70
-rw-r--r--include/asm-blackfin/mach-common/context.S355
-rw-r--r--include/asm-blackfin/mach-common/def_LPBlackfin.h712
-rw-r--r--include/asm-blackfin/mem_map.h12
-rw-r--r--include/asm-blackfin/mman.h43
-rw-r--r--include/asm-blackfin/mmu.h32
-rw-r--r--include/asm-blackfin/mmu_context.h181
-rw-r--r--include/asm-blackfin/module.h20
-rw-r--r--include/asm-blackfin/msgbuf.h31
-rw-r--r--include/asm-blackfin/mutex.h9
-rw-r--r--include/asm-blackfin/nand.h47
-rw-r--r--include/asm-blackfin/page.h88
-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/portmux.h1188
-rw-r--r--include/asm-blackfin/posix_types.h61
-rw-r--r--include/asm-blackfin/processor.h158
-rw-r--r--include/asm-blackfin/ptrace.h168
-rw-r--r--include/asm-blackfin/reboot.h20
-rw-r--r--include/asm-blackfin/resource.h6
-rw-r--r--include/asm-blackfin/scatterlist.h28
-rw-r--r--include/asm-blackfin/sections.h7
-rw-r--r--include/asm-blackfin/segment.h7
-rw-r--r--include/asm-blackfin/sembuf.h25
-rw-r--r--include/asm-blackfin/serial.h5
-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.h56
-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.h137
-rw-r--r--include/asm-blackfin/system.h221
-rw-r--r--include/asm-blackfin/termbits.h198
-rw-r--r--include/asm-blackfin/termios.h94
-rw-r--r--include/asm-blackfin/thread_info.h135
-rw-r--r--include/asm-blackfin/time.h40
-rw-r--r--include/asm-blackfin/timex.h23
-rw-r--r--include/asm-blackfin/tlb.h16
-rw-r--r--include/asm-blackfin/tlbflush.h56
-rw-r--r--include/asm-blackfin/topology.h6
-rw-r--r--include/asm-blackfin/trace.h94
-rw-r--r--include/asm-blackfin/traps.h131
-rw-r--r--include/asm-blackfin/types.h36
-rw-r--r--include/asm-blackfin/uaccess.h271
-rw-r--r--include/asm-blackfin/ucontext.h17
-rw-r--r--include/asm-blackfin/unaligned.h11
-rw-r--r--include/asm-blackfin/unistd.h438
-rw-r--r--include/asm-blackfin/user.h89
-rw-r--r--include/asm-cris/a.out.h26
-rw-r--r--include/asm-cris/elf.h2
-rw-r--r--include/asm-frv/elf.h2
-rw-r--r--include/asm-frv/unaligned.h2
-rw-r--r--include/asm-generic/Kbuild.asm6
-rw-r--r--include/asm-generic/bug.h12
-rw-r--r--include/asm-generic/gpio.h18
-rw-r--r--include/asm-generic/rtc.h12
-rw-r--r--include/asm-generic/sections.h6
-rw-r--r--include/asm-generic/siginfo.h2
-rw-r--r--include/asm-generic/statfs.h65
-rw-r--r--include/asm-generic/syscall.h2
-rw-r--r--include/asm-generic/vmlinux.lds.h11
-rw-r--r--include/asm-h8300/timer.h25
-rw-r--r--include/asm-m32r/a.out.h20
-rw-r--r--include/asm-m32r/elf.h2
-rw-r--r--include/asm-m68k/atarihw.h1
-rw-r--r--include/asm-m68k/dma-mapping.h16
-rw-r--r--include/asm-m68k/dma.h4
-rw-r--r--include/asm-m68k/elf.h2
-rw-r--r--include/asm-m68k/entry.h2
-rw-r--r--include/asm-m68k/io.h66
-rw-r--r--include/asm-m68k/pci.h47
-rw-r--r--include/asm-m68k/virtconvert.h6
-rw-r--r--include/asm-mips/Kbuild3
-rw-r--r--include/asm-mips/a.out.h35
-rw-r--r--include/asm-mips/abi.h25
-rw-r--r--include/asm-mips/addrspace.h154
-rw-r--r--include/asm-mips/asm.h409
-rw-r--r--include/asm-mips/asmmacro-32.h158
-rw-r--r--include/asm-mips/asmmacro-64.h139
-rw-r--r--include/asm-mips/asmmacro.h82
-rw-r--r--include/asm-mips/atomic.h801
-rw-r--r--include/asm-mips/auxvec.h4
-rw-r--r--include/asm-mips/barrier.h155
-rw-r--r--include/asm-mips/bcache.h60
-rw-r--r--include/asm-mips/bitops.h672
-rw-r--r--include/asm-mips/bootinfo.h110
-rw-r--r--include/asm-mips/branch.h38
-rw-r--r--include/asm-mips/break.h34
-rw-r--r--include/asm-mips/bug.h33
-rw-r--r--include/asm-mips/bugs.h53
-rw-r--r--include/asm-mips/byteorder.h76
-rw-r--r--include/asm-mips/cache.h20
-rw-r--r--include/asm-mips/cachectl.h26
-rw-r--r--include/asm-mips/cacheflush.h115
-rw-r--r--include/asm-mips/cacheops.h85
-rw-r--r--include/asm-mips/checksum.h260
-rw-r--r--include/asm-mips/cmp.h18
-rw-r--r--include/asm-mips/cmpxchg.h124
-rw-r--r--include/asm-mips/compat-signal.h119
-rw-r--r--include/asm-mips/compat.h221
-rw-r--r--include/asm-mips/compiler.h19
-rw-r--r--include/asm-mips/cpu-features.h219
-rw-r--r--include/asm-mips/cpu-info.h84
-rw-r--r--include/asm-mips/cpu.h267
-rw-r--r--include/asm-mips/cputime.h6
-rw-r--r--include/asm-mips/current.h23
-rw-r--r--include/asm-mips/debug.h48
-rw-r--r--include/asm-mips/dec/ecc.h55
-rw-r--r--include/asm-mips/dec/interrupts.h126
-rw-r--r--include/asm-mips/dec/ioasic.h38
-rw-r--r--include/asm-mips/dec/ioasic_addrs.h152
-rw-r--r--include/asm-mips/dec/ioasic_ints.h74
-rw-r--r--include/asm-mips/dec/kn01.h90
-rw-r--r--include/asm-mips/dec/kn02.h91
-rw-r--r--include/asm-mips/dec/kn02ba.h67
-rw-r--r--include/asm-mips/dec/kn02ca.h79
-rw-r--r--include/asm-mips/dec/kn02xa.h84
-rw-r--r--include/asm-mips/dec/kn03.h74
-rw-r--r--include/asm-mips/dec/kn05.h76
-rw-r--r--include/asm-mips/dec/kn230.h26
-rw-r--r--include/asm-mips/dec/machtype.h27
-rw-r--r--include/asm-mips/dec/prom.h174
-rw-r--r--include/asm-mips/dec/system.h19
-rw-r--r--include/asm-mips/delay.h112
-rw-r--r--include/asm-mips/device.h7
-rw-r--r--include/asm-mips/div64.h110
-rw-r--r--include/asm-mips/dma-mapping.h81
-rw-r--r--include/asm-mips/dma.h315
-rw-r--r--include/asm-mips/ds1286.h15
-rw-r--r--include/asm-mips/ds1287.h27
-rw-r--r--include/asm-mips/dsp.h85
-rw-r--r--include/asm-mips/edac.h34
-rw-r--r--include/asm-mips/elf.h371
-rw-r--r--include/asm-mips/emergency-restart.h6
-rw-r--r--include/asm-mips/emma2rh/emma2rh.h333
-rw-r--r--include/asm-mips/emma2rh/markeins.h75
-rw-r--r--include/asm-mips/errno.h131
-rw-r--r--include/asm-mips/fb.h19
-rw-r--r--include/asm-mips/fcntl.h61
-rw-r--r--include/asm-mips/fixmap.h118
-rw-r--r--include/asm-mips/floppy.h56
-rw-r--r--include/asm-mips/fpregdef.h99
-rw-r--r--include/asm-mips/fpu.h153
-rw-r--r--include/asm-mips/fpu_emulator.h37
-rw-r--r--include/asm-mips/futex.h203
-rw-r--r--include/asm-mips/fw/arc/hinv.h175
-rw-r--r--include/asm-mips/fw/arc/types.h86
-rw-r--r--include/asm-mips/fw/cfe/cfe_api.h122
-rw-r--r--include/asm-mips/fw/cfe/cfe_error.h80
-rw-r--r--include/asm-mips/gcmpregs.h117
-rw-r--r--include/asm-mips/gic.h487
-rw-r--r--include/asm-mips/gpio.h6
-rw-r--r--include/asm-mips/gt64120.h580
-rw-r--r--include/asm-mips/hardirq.h24
-rw-r--r--include/asm-mips/hazards.h271
-rw-r--r--include/asm-mips/highmem.h67
-rw-r--r--include/asm-mips/hw_irq.h20
-rw-r--r--include/asm-mips/i8253.h21
-rw-r--r--include/asm-mips/i8259.h86
-rw-r--r--include/asm-mips/ide.h13
-rw-r--r--include/asm-mips/inst.h394
-rw-r--r--include/asm-mips/io.h589
-rw-r--r--include/asm-mips/ioctl.h94
-rw-r--r--include/asm-mips/ioctls.h109
-rw-r--r--include/asm-mips/ip32/crime.h158
-rw-r--r--include/asm-mips/ip32/ip32_ints.h114
-rw-r--r--include/asm-mips/ip32/mace.h365
-rw-r--r--include/asm-mips/ipcbuf.h28
-rw-r--r--include/asm-mips/irq.h163
-rw-r--r--include/asm-mips/irq_cpu.h20
-rw-r--r--include/asm-mips/irq_gt641xx.h60
-rw-r--r--include/asm-mips/irq_regs.h21
-rw-r--r--include/asm-mips/irqflags.h263
-rw-r--r--include/asm-mips/isadep.h34
-rw-r--r--include/asm-mips/jazz.h310
-rw-r--r--include/asm-mips/jazzdma.h95
-rw-r--r--include/asm-mips/kdebug.h13
-rw-r--r--include/asm-mips/kexec.h30
-rw-r--r--include/asm-mips/kgdb.h44
-rw-r--r--include/asm-mips/kmap_types.h30
-rw-r--r--include/asm-mips/kspd.h36
-rw-r--r--include/asm-mips/lasat/ds1603.h18
-rw-r--r--include/asm-mips/lasat/eeprom.h17
-rw-r--r--include/asm-mips/lasat/head.h22
-rw-r--r--include/asm-mips/lasat/lasat.h258
-rw-r--r--include/asm-mips/lasat/lasatint.h14
-rw-r--r--include/asm-mips/lasat/picvue.h15
-rw-r--r--include/asm-mips/lasat/serial.h13
-rw-r--r--include/asm-mips/linkage.h10
-rw-r--r--include/asm-mips/local.h221
-rw-r--r--include/asm-mips/m48t35.h27
-rw-r--r--include/asm-mips/m48t37.h35
-rw-r--r--include/asm-mips/mach-au1x00/au1000.h1772
-rw-r--r--include/asm-mips/mach-au1x00/au1000_dma.h458
-rw-r--r--include/asm-mips/mach-au1x00/au1000_gpio.h56
-rw-r--r--include/asm-mips/mach-au1x00/au1100_mmc.h208
-rw-r--r--include/asm-mips/mach-au1x00/au1550_spi.h15
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx.h43
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_dbdma.h386
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h194
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_psc.h505
-rw-r--r--include/asm-mips/mach-au1x00/gpio.h69
-rw-r--r--include/asm-mips/mach-au1x00/ioremap.h42
-rw-r--r--include/asm-mips/mach-au1x00/prom.h13
-rw-r--r--include/asm-mips/mach-au1x00/war.h25
-rw-r--r--include/asm-mips/mach-bcm47xx/bcm47xx.h25
-rw-r--r--include/asm-mips/mach-bcm47xx/gpio.h59
-rw-r--r--include/asm-mips/mach-bcm47xx/war.h25
-rw-r--r--include/asm-mips/mach-cobalt/cobalt.h22
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h56
-rw-r--r--include/asm-mips/mach-cobalt/irq.h57
-rw-r--r--include/asm-mips/mach-cobalt/mach-gt64120.h27
-rw-r--r--include/asm-mips/mach-cobalt/war.h25
-rw-r--r--include/asm-mips/mach-db1x00/db1200.h230
-rw-r--r--include/asm-mips/mach-db1x00/db1x00.h179
-rw-r--r--include/asm-mips/mach-dec/mc146818rtc.h43
-rw-r--r--include/asm-mips/mach-dec/war.h25
-rw-r--r--include/asm-mips/mach-emma2rh/irq.h15
-rw-r--r--include/asm-mips/mach-emma2rh/war.h25
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h48
-rw-r--r--include/asm-mips/mach-excite/excite.h154
-rw-r--r--include/asm-mips/mach-excite/excite_fpga.h80
-rw-r--r--include/asm-mips/mach-excite/excite_nandflash.h7
-rw-r--r--include/asm-mips/mach-excite/rm9k_eth.h23
-rw-r--r--include/asm-mips/mach-excite/rm9k_wdt.h12
-rw-r--r--include/asm-mips/mach-excite/rm9k_xicap.h16
-rw-r--r--include/asm-mips/mach-excite/war.h25
-rw-r--r--include/asm-mips/mach-generic/cpu-feature-overrides.h13
-rw-r--r--include/asm-mips/mach-generic/dma-coherence.h45
-rw-r--r--include/asm-mips/mach-generic/floppy.h139
-rw-r--r--include/asm-mips/mach-generic/gpio.h21
-rw-r--r--include/asm-mips/mach-generic/ide.h167
-rw-r--r--include/asm-mips/mach-generic/ioremap.h34
-rw-r--r--include/asm-mips/mach-generic/irq.h45
-rw-r--r--include/asm-mips/mach-generic/kernel-entry-init.h25
-rw-r--r--include/asm-mips/mach-generic/kmalloc.h13
-rw-r--r--include/asm-mips/mach-generic/mangle-port.h52
-rw-r--r--include/asm-mips/mach-generic/mc146818rtc.h36
-rw-r--r--include/asm-mips/mach-generic/spaces.h85
-rw-r--r--include/asm-mips/mach-generic/topology.h1
-rw-r--r--include/asm-mips/mach-ip22/cpu-feature-overrides.h44
-rw-r--r--include/asm-mips/mach-ip22/ds1286.h18
-rw-r--r--include/asm-mips/mach-ip22/spaces.h27
-rw-r--r--include/asm-mips/mach-ip22/war.h29
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h54
-rw-r--r--include/asm-mips/mach-ip27/dma-coherence.h50
-rw-r--r--include/asm-mips/mach-ip27/irq.h22
-rw-r--r--include/asm-mips/mach-ip27/kernel-entry-init.h59
-rw-r--r--include/asm-mips/mach-ip27/kmalloc.h8
-rw-r--r--include/asm-mips/mach-ip27/mangle-port.h25
-rw-r--r--include/asm-mips/mach-ip27/mmzone.h36
-rw-r--r--include/asm-mips/mach-ip27/spaces.h30
-rw-r--r--include/asm-mips/mach-ip27/topology.h59
-rw-r--r--include/asm-mips/mach-ip27/war.h25
-rw-r--r--include/asm-mips/mach-ip28/cpu-feature-overrides.h50
-rw-r--r--include/asm-mips/mach-ip28/ds1286.h4
-rw-r--r--include/asm-mips/mach-ip28/spaces.h22
-rw-r--r--include/asm-mips/mach-ip28/war.h25
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h50
-rw-r--r--include/asm-mips/mach-ip32/dma-coherence.h72
-rw-r--r--include/asm-mips/mach-ip32/kmalloc.h11
-rw-r--r--include/asm-mips/mach-ip32/mangle-port.h26
-rw-r--r--include/asm-mips/mach-ip32/mc146818rtc.h36
-rw-r--r--include/asm-mips/mach-ip32/war.h25
-rw-r--r--include/asm-mips/mach-jazz/dma-coherence.h40
-rw-r--r--include/asm-mips/mach-jazz/floppy.h135
-rw-r--r--include/asm-mips/mach-jazz/mc146818rtc.h38
-rw-r--r--include/asm-mips/mach-jazz/war.h25
-rw-r--r--include/asm-mips/mach-lasat/irq.h13
-rw-r--r--include/asm-mips/mach-lasat/mach-gt64120.h27
-rw-r--r--include/asm-mips/mach-lasat/war.h25
-rw-r--r--include/asm-mips/mach-lemote/dma-coherence.h42
-rw-r--r--include/asm-mips/mach-lemote/mc146818rtc.h36
-rw-r--r--include/asm-mips/mach-lemote/war.h25
-rw-r--r--include/asm-mips/mach-malta/cpu-feature-overrides.h72
-rw-r--r--include/asm-mips/mach-malta/irq.h9
-rw-r--r--include/asm-mips/mach-malta/kernel-entry-init.h52
-rw-r--r--include/asm-mips/mach-malta/mach-gt64120.h19
-rw-r--r--include/asm-mips/mach-malta/mc146818rtc.h48
-rw-r--r--include/asm-mips/mach-malta/war.h25
-rw-r--r--include/asm-mips/mach-mipssim/cpu-feature-overrides.h65
-rw-r--r--include/asm-mips/mach-mipssim/war.h25
-rw-r--r--include/asm-mips/mach-pb1x00/mc146818rtc.h34
-rw-r--r--include/asm-mips/mach-pb1x00/pb1000.h87
-rw-r--r--include/asm-mips/mach-pb1x00/pb1100.h85
-rw-r--r--include/asm-mips/mach-pb1x00/pb1200.h259
-rw-r--r--include/asm-mips/mach-pb1x00/pb1500.h49
-rw-r--r--include/asm-mips/mach-pb1x00/pb1550.h177
-rw-r--r--include/asm-mips/mach-pnx8550/cm.h43
-rw-r--r--include/asm-mips/mach-pnx8550/glb.h86
-rw-r--r--include/asm-mips/mach-pnx8550/int.h140
-rw-r--r--include/asm-mips/mach-pnx8550/kernel-entry-init.h262
-rw-r--r--include/asm-mips/mach-pnx8550/nand.h121
-rw-r--r--include/asm-mips/mach-pnx8550/pci.h185
-rw-r--r--include/asm-mips/mach-pnx8550/uart.h30
-rw-r--r--include/asm-mips/mach-pnx8550/usb.h32
-rw-r--r--include/asm-mips/mach-pnx8550/war.h25
-rw-r--r--include/asm-mips/mach-rc32434/cpu-feature-overrides.h81
-rw-r--r--include/asm-mips/mach-rc32434/ddr.h141
-rw-r--r--include/asm-mips/mach-rc32434/dma.h103
-rw-r--r--include/asm-mips/mach-rc32434/dma_v.h52
-rw-r--r--include/asm-mips/mach-rc32434/eth.h220
-rw-r--r--include/asm-mips/mach-rc32434/gpio.h126
-rw-r--r--include/asm-mips/mach-rc32434/integ.h59
-rw-r--r--include/asm-mips/mach-rc32434/irq.h8
-rw-r--r--include/asm-mips/mach-rc32434/pci.h481
-rw-r--r--include/asm-mips/mach-rc32434/prom.h44
-rw-r--r--include/asm-mips/mach-rc32434/rb.h81
-rw-r--r--include/asm-mips/mach-rc32434/rc32434.h61
-rw-r--r--include/asm-mips/mach-rc32434/timer.h65
-rw-r--r--include/asm-mips/mach-rc32434/war.h25
-rw-r--r--include/asm-mips/mach-rm/cpu-feature-overrides.h43
-rw-r--r--include/asm-mips/mach-rm/mc146818rtc.h21
-rw-r--r--include/asm-mips/mach-rm/war.h29
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h47
-rw-r--r--include/asm-mips/mach-sibyte/war.h37
-rw-r--r--include/asm-mips/mach-tx39xx/ioremap.h38
-rw-r--r--include/asm-mips/mach-tx39xx/mangle-port.h23
-rw-r--r--include/asm-mips/mach-tx39xx/war.h25
-rw-r--r--include/asm-mips/mach-tx49xx/cpu-feature-overrides.h23
-rw-r--r--include/asm-mips/mach-tx49xx/ioremap.h43
-rw-r--r--include/asm-mips/mach-tx49xx/kmalloc.h8
-rw-r--r--include/asm-mips/mach-tx49xx/war.h25
-rw-r--r--include/asm-mips/mach-vr41xx/irq.h8
-rw-r--r--include/asm-mips/mach-vr41xx/war.h25
-rw-r--r--include/asm-mips/mach-wrppmc/mach-gt64120.h83
-rw-r--r--include/asm-mips/mach-wrppmc/war.h25
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h47
-rw-r--r--include/asm-mips/mach-yosemite/war.h25
-rw-r--r--include/asm-mips/mc146818-time.h119
-rw-r--r--include/asm-mips/mc146818rtc.h16
-rw-r--r--include/asm-mips/mips-boards/bonito64.h436
-rw-r--r--include/asm-mips/mips-boards/generic.h104
-rw-r--r--include/asm-mips/mips-boards/launch.h35
-rw-r--r--include/asm-mips/mips-boards/malta.h102
-rw-r--r--include/asm-mips/mips-boards/maltaint.h110
-rw-r--r--include/asm-mips/mips-boards/msc01_pci.h258
-rw-r--r--include/asm-mips/mips-boards/piix4.h80
-rw-r--r--include/asm-mips/mips-boards/prom.h47
-rw-r--r--include/asm-mips/mips-boards/sim.h40
-rw-r--r--include/asm-mips/mips-boards/simint.h31
-rw-r--r--include/asm-mips/mips_mt.h26
-rw-r--r--include/asm-mips/mipsmtregs.h395
-rw-r--r--include/asm-mips/mipsprom.h76
-rw-r--r--include/asm-mips/mipsregs.h1526
-rw-r--r--include/asm-mips/mman.h77
-rw-r--r--include/asm-mips/mmu.h6
-rw-r--r--include/asm-mips/mmu_context.h297
-rw-r--r--include/asm-mips/mmzone.h17
-rw-r--r--include/asm-mips/module.h136
-rw-r--r--include/asm-mips/msc01_ic.h148
-rw-r--r--include/asm-mips/msgbuf.h47
-rw-r--r--include/asm-mips/mutex.h9
-rw-r--r--include/asm-mips/nile4.h310
-rw-r--r--include/asm-mips/paccess.h112
-rw-r--r--include/asm-mips/page.h191
-rw-r--r--include/asm-mips/param.h31
-rw-r--r--include/asm-mips/parport.h15
-rw-r--r--include/asm-mips/pci.h179
-rw-r--r--include/asm-mips/pci/bridge.h854
-rw-r--r--include/asm-mips/percpu.h6
-rw-r--r--include/asm-mips/pgalloc.h143
-rw-r--r--include/asm-mips/pgtable-32.h234
-rw-r--r--include/asm-mips/pgtable-64.h253
-rw-r--r--include/asm-mips/pgtable-bits.h137
-rw-r--r--include/asm-mips/pgtable.h383
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h151
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_int.h43
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_pci.h205
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_prom.h176
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_regops.h236
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_regs.h663
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h141
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/war.h28
-rw-r--r--include/asm-mips/pmon.h46
-rw-r--r--include/asm-mips/poll.h9
-rw-r--r--include/asm-mips/posix_types.h144
-rw-r--r--include/asm-mips/prefetch.h87
-rw-r--r--include/asm-mips/processor.h263
-rw-r--r--include/asm-mips/ptrace.h99
-rw-r--r--include/asm-mips/r4k-timer.h30
-rw-r--r--include/asm-mips/r4kcache.h443
-rw-r--r--include/asm-mips/reboot.h15
-rw-r--r--include/asm-mips/reg.h128
-rw-r--r--include/asm-mips/regdef.h100
-rw-r--r--include/asm-mips/resource.h35
-rw-r--r--include/asm-mips/rm9k-ocd.h56
-rw-r--r--include/asm-mips/rtlx.h65
-rw-r--r--include/asm-mips/scatterlist.h28
-rw-r--r--include/asm-mips/seccomp.h37
-rw-r--r--include/asm-mips/sections.h6
-rw-r--r--include/asm-mips/segment.h6
-rw-r--r--include/asm-mips/sembuf.h22
-rw-r--r--include/asm-mips/serial.h22
-rw-r--r--include/asm-mips/setup.h10
-rw-r--r--include/asm-mips/sgi/gio.h86
-rw-r--r--include/asm-mips/sgi/hpc3.h317
-rw-r--r--include/asm-mips/sgi/ioc.h200
-rw-r--r--include/asm-mips/sgi/ip22.h78
-rw-r--r--include/asm-mips/sgi/mc.h231
-rw-r--r--include/asm-mips/sgi/pi1.h71
-rw-r--r--include/asm-mips/sgi/seeq.h21
-rw-r--r--include/asm-mips/sgi/sgi.h47
-rw-r--r--include/asm-mips/sgi/wd.h20
-rw-r--r--include/asm-mips/sgialib.h124
-rw-r--r--include/asm-mips/sgiarcs.h548
-rw-r--r--include/asm-mips/sgidefs.h44
-rw-r--r--include/asm-mips/shmbuf.h38
-rw-r--r--include/asm-mips/shmparam.h13
-rw-r--r--include/asm-mips/sibyte/bcm1480_int.h312
-rw-r--r--include/asm-mips/sibyte/bcm1480_l2c.h176
-rw-r--r--include/asm-mips/sibyte/bcm1480_mc.h984
-rw-r--r--include/asm-mips/sibyte/bcm1480_regs.h902
-rw-r--r--include/asm-mips/sibyte/bcm1480_scd.h406
-rw-r--r--include/asm-mips/sibyte/bigsur.h49
-rw-r--r--include/asm-mips/sibyte/board.h68
-rw-r--r--include/asm-mips/sibyte/carmel.h58
-rw-r--r--include/asm-mips/sibyte/sb1250.h68
-rw-r--r--include/asm-mips/sibyte/sb1250_defs.h259
-rw-r--r--include/asm-mips/sibyte/sb1250_dma.h594
-rw-r--r--include/asm-mips/sibyte/sb1250_genbus.h474
-rw-r--r--include/asm-mips/sibyte/sb1250_int.h248
-rw-r--r--include/asm-mips/sibyte/sb1250_l2c.h131
-rw-r--r--include/asm-mips/sibyte/sb1250_ldt.h423
-rw-r--r--include/asm-mips/sibyte/sb1250_mac.h656
-rw-r--r--include/asm-mips/sibyte/sb1250_mc.h550
-rw-r--r--include/asm-mips/sibyte/sb1250_regs.h893
-rw-r--r--include/asm-mips/sibyte/sb1250_scd.h654
-rw-r--r--include/asm-mips/sibyte/sb1250_smbus.h204
-rw-r--r--include/asm-mips/sibyte/sb1250_syncser.h146
-rw-r--r--include/asm-mips/sibyte/sb1250_uart.h362
-rw-r--r--include/asm-mips/sibyte/sentosa.h40
-rw-r--r--include/asm-mips/sibyte/swarm.h64
-rw-r--r--include/asm-mips/sigcontext.h100
-rw-r--r--include/asm-mips/siginfo.h130
-rw-r--r--include/asm-mips/signal.h139
-rw-r--r--include/asm-mips/sim.h82
-rw-r--r--include/asm-mips/smp-ops.h57
-rw-r--r--include/asm-mips/smp.h63
-rw-r--r--include/asm-mips/smtc.h69
-rw-r--r--include/asm-mips/smtc_ipi.h128
-rw-r--r--include/asm-mips/smtc_proc.h23
-rw-r--r--include/asm-mips/smvp.h19
-rw-r--r--include/asm-mips/sn/addrs.h430
-rw-r--r--include/asm-mips/sn/agent.h46
-rw-r--r--include/asm-mips/sn/arch.h64
-rw-r--r--include/asm-mips/sn/fru.h44
-rw-r--r--include/asm-mips/sn/gda.h107
-rw-r--r--include/asm-mips/sn/hub.h16
-rw-r--r--include/asm-mips/sn/intr.h129
-rw-r--r--include/asm-mips/sn/io.h59
-rw-r--r--include/asm-mips/sn/ioc3.h663
-rw-r--r--include/asm-mips/sn/klconfig.h898
-rw-r--r--include/asm-mips/sn/kldir.h217
-rw-r--r--include/asm-mips/sn/klkernvars.h29
-rw-r--r--include/asm-mips/sn/launch.h106
-rw-r--r--include/asm-mips/sn/mapped_kernel.h54
-rw-r--r--include/asm-mips/sn/nmi.h125
-rw-r--r--include/asm-mips/sn/sn0/addrs.h288
-rw-r--r--include/asm-mips/sn/sn0/arch.h72
-rw-r--r--include/asm-mips/sn/sn0/hub.h40
-rw-r--r--include/asm-mips/sn/sn0/hubio.h972
-rw-r--r--include/asm-mips/sn/sn0/hubmd.h789
-rw-r--r--include/asm-mips/sn/sn0/hubni.h255
-rw-r--r--include/asm-mips/sn/sn0/hubpi.h409
-rw-r--r--include/asm-mips/sn/sn0/ip27.h85
-rw-r--r--include/asm-mips/sn/sn_private.h19
-rw-r--r--include/asm-mips/sn/types.h26
-rw-r--r--include/asm-mips/sni.h244
-rw-r--r--include/asm-mips/socket.h117
-rw-r--r--include/asm-mips/sockios.h26
-rw-r--r--include/asm-mips/sparsemem.h14
-rw-r--r--include/asm-mips/spinlock.h376
-rw-r--r--include/asm-mips/spinlock_types.h20
-rw-r--r--include/asm-mips/stackframe.h524
-rw-r--r--include/asm-mips/stacktrace.h48
-rw-r--r--include/asm-mips/stat.h132
-rw-r--r--include/asm-mips/statfs.h96
-rw-r--r--include/asm-mips/string.h143
-rw-r--r--include/asm-mips/suspend.h6
-rw-r--r--include/asm-mips/sysmips.h25
-rw-r--r--include/asm-mips/system.h220
-rw-r--r--include/asm-mips/termbits.h226
-rw-r--r--include/asm-mips/termios.h132
-rw-r--r--include/asm-mips/thread_info.h151
-rw-r--r--include/asm-mips/time.h79
-rw-r--r--include/asm-mips/timex.h43
-rw-r--r--include/asm-mips/titan_dep.h231
-rw-r--r--include/asm-mips/tlb.h23
-rw-r--r--include/asm-mips/tlbdebug.h16
-rw-r--r--include/asm-mips/tlbflush.h47
-rw-r--r--include/asm-mips/topology.h17
-rw-r--r--include/asm-mips/traps.h28
-rw-r--r--include/asm-mips/txx9/generic.h62
-rw-r--r--include/asm-mips/txx9/jmr3927.h180
-rw-r--r--include/asm-mips/txx9/pci.h39
-rw-r--r--include/asm-mips/txx9/rbtx4927.h89
-rw-r--r--include/asm-mips/txx9/rbtx4938.h145
-rw-r--r--include/asm-mips/txx9/smsc_fdc37m81x.h67
-rw-r--r--include/asm-mips/txx9/spi.h19
-rw-r--r--include/asm-mips/txx9/tx3927.h339
-rw-r--r--include/asm-mips/txx9/tx4927.h255
-rw-r--r--include/asm-mips/txx9/tx4927pcic.h203
-rw-r--r--include/asm-mips/txx9/tx4938.h293
-rw-r--r--include/asm-mips/txx9irq.h34
-rw-r--r--include/asm-mips/txx9pio.h29
-rw-r--r--include/asm-mips/txx9tmr.h67
-rw-r--r--include/asm-mips/types.h54
-rw-r--r--include/asm-mips/uaccess.h852
-rw-r--r--include/asm-mips/ucontext.h21
-rw-r--r--include/asm-mips/unaligned.h28
-rw-r--r--include/asm-mips/unistd.h1019
-rw-r--r--include/asm-mips/user.h58
-rw-r--r--include/asm-mips/vga.h47
-rw-r--r--include/asm-mips/vpe.h37
-rw-r--r--include/asm-mips/vr41xx/capcella.h43
-rw-r--r--include/asm-mips/vr41xx/giu.h78
-rw-r--r--include/asm-mips/vr41xx/irq.h101
-rw-r--r--include/asm-mips/vr41xx/mpc30x.h37
-rw-r--r--include/asm-mips/vr41xx/pci.h90
-rw-r--r--include/asm-mips/vr41xx/siu.h58
-rw-r--r--include/asm-mips/vr41xx/tb0219.h42
-rw-r--r--include/asm-mips/vr41xx/tb0226.h43
-rw-r--r--include/asm-mips/vr41xx/tb0287.h43
-rw-r--r--include/asm-mips/vr41xx/vr41xx.h152
-rw-r--r--include/asm-mips/war.h244
-rw-r--r--include/asm-mips/wbflush.h34
-rw-r--r--include/asm-mips/xor.h1
-rw-r--r--include/asm-mips/xtalk/xtalk.h52
-rw-r--r--include/asm-mips/xtalk/xwidget.h167
-rw-r--r--include/asm-mn10300/elf.h2
-rw-r--r--include/asm-parisc/a.out.h20
-rw-r--r--include/asm-parisc/elf.h2
-rw-r--r--include/asm-parisc/sections.h5
-rw-r--r--include/asm-parisc/siginfo.h5
-rw-r--r--include/asm-parisc/statfs.h55
-rw-r--r--include/asm-um/dma-mapping.h7
-rw-r--r--include/asm-um/elf-i386.h2
-rw-r--r--include/asm-um/elf-ppc.h2
-rw-r--r--include/asm-um/elf-x86_64.h2
-rw-r--r--include/asm-x86/a.out-core.h6
-rw-r--r--include/asm-x86/a.out.h6
-rw-r--r--include/asm-x86/acpi.h8
-rw-r--r--include/asm-x86/agp.h6
-rw-r--r--include/asm-x86/alternative.h6
-rw-r--r--include/asm-x86/amd_iommu.h9
-rw-r--r--include/asm-x86/amd_iommu_types.h70
-rw-r--r--include/asm-x86/apic.h80
-rw-r--r--include/asm-x86/apicdef.h9
-rw-r--r--include/asm-x86/arch_hooks.h8
-rw-r--r--include/asm-x86/asm.h13
-rw-r--r--include/asm-x86/atomic_32.h6
-rw-r--r--include/asm-x86/atomic_64.h6
-rw-r--r--include/asm-x86/auxvec.h6
-rw-r--r--include/asm-x86/bigsmp/apic.h (renamed from include/asm-x86/mach-bigsmp/mach_apic.h)4
-rw-r--r--include/asm-x86/bigsmp/apicdef.h (renamed from include/asm-x86/mach-bigsmp/mach_apicdef.h)6
-rw-r--r--include/asm-x86/bigsmp/ipi.h (renamed from include/asm-x86/mach-bigsmp/mach_ipi.h)0
-rw-r--r--include/asm-x86/bios_ebda.h23
-rw-r--r--include/asm-x86/bitops.h16
-rw-r--r--include/asm-x86/boot.h8
-rw-r--r--include/asm-x86/bootparam.h6
-rw-r--r--include/asm-x86/bug.h6
-rw-r--r--include/asm-x86/bugs.h11
-rw-r--r--include/asm-x86/byteorder.h6
-rw-r--r--include/asm-x86/cache.h6
-rw-r--r--include/asm-x86/cacheflush.h13
-rw-r--r--include/asm-x86/calgary.h6
-rw-r--r--include/asm-x86/checksum_32.h6
-rw-r--r--include/asm-x86/checksum_64.h6
-rw-r--r--include/asm-x86/cmpxchg_32.h6
-rw-r--r--include/asm-x86/cmpxchg_64.h6
-rw-r--r--include/asm-x86/compat.h6
-rw-r--r--include/asm-x86/cpu.h6
-rw-r--r--include/asm-x86/cpufeature.h130
-rw-r--r--include/asm-x86/current.h6
-rw-r--r--include/asm-x86/debugreg.h6
-rw-r--r--include/asm-x86/delay.h6
-rw-r--r--include/asm-x86/desc.h35
-rw-r--r--include/asm-x86/desc_defs.h6
-rw-r--r--include/asm-x86/device.h6
-rw-r--r--include/asm-x86/div64.h6
-rw-r--r--include/asm-x86/dma-mapping.h89
-rw-r--r--include/asm-x86/dma.h6
-rw-r--r--include/asm-x86/dmi.h6
-rw-r--r--include/asm-x86/ds.h266
-rw-r--r--include/asm-x86/dwarf2.h6
-rw-r--r--include/asm-x86/e820.h9
-rw-r--r--include/asm-x86/edac.h6
-rw-r--r--include/asm-x86/efi.h6
-rw-r--r--include/asm-x86/elf.h15
-rw-r--r--include/asm-x86/emergency-restart.h6
-rw-r--r--include/asm-x86/es7000/apic.h (renamed from include/asm-x86/mach-es7000/mach_apic.h)34
-rw-r--r--include/asm-x86/es7000/apicdef.h13
-rw-r--r--include/asm-x86/es7000/ipi.h (renamed from include/asm-x86/mach-es7000/mach_ipi.h)6
-rw-r--r--include/asm-x86/es7000/mpparse.h (renamed from include/asm-x86/mach-es7000/mach_mpparse.h)5
-rw-r--r--include/asm-x86/es7000/wakecpu.h (renamed from include/asm-x86/mach-es7000/mach_wakecpu.h)6
-rw-r--r--include/asm-x86/fb.h6
-rw-r--r--include/asm-x86/fixmap.h6
-rw-r--r--include/asm-x86/fixmap_32.h10
-rw-r--r--include/asm-x86/fixmap_64.h18
-rw-r--r--include/asm-x86/floppy.h6
-rw-r--r--include/asm-x86/ftrace.h6
-rw-r--r--include/asm-x86/futex.h12
-rw-r--r--include/asm-x86/gart.h14
-rw-r--r--include/asm-x86/genapic_32.h7
-rw-r--r--include/asm-x86/genapic_64.h15
-rw-r--r--include/asm-x86/geode.h6
-rw-r--r--include/asm-x86/gpio.h2
-rw-r--r--include/asm-x86/hardirq_32.h6
-rw-r--r--include/asm-x86/hardirq_64.h6
-rw-r--r--include/asm-x86/highmem.h6
-rw-r--r--include/asm-x86/hpet.h6
-rw-r--r--include/asm-x86/hugetlb.h6
-rw-r--r--include/asm-x86/hw_irq.h29
-rw-r--r--include/asm-x86/hypertransport.h6
-rw-r--r--include/asm-x86/i387.h91
-rw-r--r--include/asm-x86/i8253.h6
-rw-r--r--include/asm-x86/i8259.h9
-rw-r--r--include/asm-x86/ia32.h6
-rw-r--r--include/asm-x86/ia32_unistd.h6
-rw-r--r--include/asm-x86/idle.h8
-rw-r--r--include/asm-x86/intel_arch_perfmon.h6
-rw-r--r--include/asm-x86/io.h23
-rw-r--r--include/asm-x86/io_32.h6
-rw-r--r--include/asm-x86/io_64.h10
-rw-r--r--include/asm-x86/io_apic.h26
-rw-r--r--include/asm-x86/ioctls.h12
-rw-r--r--include/asm-x86/iommu.h9
-rw-r--r--include/asm-x86/ipcbuf.h6
-rw-r--r--include/asm-x86/ipi.h22
-rw-r--r--include/asm-x86/irq.h6
-rw-r--r--include/asm-x86/irq_regs_32.h6
-rw-r--r--include/asm-x86/irq_remapping.h8
-rw-r--r--include/asm-x86/irq_vectors.h7
-rw-r--r--include/asm-x86/irqflags.h21
-rw-r--r--include/asm-x86/ist.h6
-rw-r--r--include/asm-x86/k8.h6
-rw-r--r--include/asm-x86/kdebug.h9
-rw-r--r--include/asm-x86/kexec.h6
-rw-r--r--include/asm-x86/kgdb.h30
-rw-r--r--include/asm-x86/kmap_types.h6
-rw-r--r--include/asm-x86/kprobes.h15
-rw-r--r--include/asm-x86/kvm.h28
-rw-r--r--include/asm-x86/kvm_host.h92
-rw-r--r--include/asm-x86/kvm_para.h6
-rw-r--r--include/asm-x86/kvm_x86_emulate.h6
-rw-r--r--include/asm-x86/ldt.h6
-rw-r--r--include/asm-x86/lguest.h6
-rw-r--r--include/asm-x86/lguest_hcall.h6
-rw-r--r--include/asm-x86/linkage.h6
-rw-r--r--include/asm-x86/local.h6
-rw-r--r--include/asm-x86/mach-default/apm.h6
-rw-r--r--include/asm-x86/mach-default/mach_apic.h10
-rw-r--r--include/asm-x86/mach-default/mach_apicdef.h12
-rw-r--r--include/asm-x86/mach-default/mach_ipi.h6
-rw-r--r--include/asm-x86/mach-default/mach_mpparse.h6
-rw-r--r--include/asm-x86/mach-default/mach_mpspec.h6
-rw-r--r--include/asm-x86/mach-default/mach_timer.h6
-rw-r--r--include/asm-x86/mach-default/mach_traps.h12
-rw-r--r--include/asm-x86/mach-default/mach_wakecpu.h6
-rw-r--r--include/asm-x86/mach-es7000/mach_apicdef.h13
-rw-r--r--include/asm-x86/mach-generic/gpio.h6
-rw-r--r--include/asm-x86/mach-generic/irq_vectors_limits.h6
-rw-r--r--include/asm-x86/mach-generic/mach_apic.h6
-rw-r--r--include/asm-x86/mach-generic/mach_apicdef.h6
-rw-r--r--include/asm-x86/mach-generic/mach_ipi.h6
-rw-r--r--include/asm-x86/mach-generic/mach_mpparse.h6
-rw-r--r--include/asm-x86/mach-generic/mach_mpspec.h6
-rw-r--r--include/asm-x86/mach-rdc321x/gpio.h9
-rw-r--r--include/asm-x86/mach-summit/mach_apicdef.h13
-rw-r--r--include/asm-x86/math_emu.h6
-rw-r--r--include/asm-x86/mc146818rtc.h6
-rw-r--r--include/asm-x86/mca.h6
-rw-r--r--include/asm-x86/mca_dma.h6
-rw-r--r--include/asm-x86/mce.h7
-rw-r--r--include/asm-x86/microcode.h47
-rw-r--r--include/asm-x86/mman.h6
-rw-r--r--include/asm-x86/mmconfig.h6
-rw-r--r--include/asm-x86/mmu.h11
-rw-r--r--include/asm-x86/mmu_context.h6
-rw-r--r--include/asm-x86/mmu_context_32.h6
-rw-r--r--include/asm-x86/mmu_context_64.h6
-rw-r--r--include/asm-x86/mmx.h6
-rw-r--r--include/asm-x86/mmzone_32.h6
-rw-r--r--include/asm-x86/mmzone_64.h9
-rw-r--r--include/asm-x86/module.h8
-rw-r--r--include/asm-x86/mpspec.h9
-rw-r--r--include/asm-x86/mpspec_def.h6
-rw-r--r--include/asm-x86/msgbuf.h6
-rw-r--r--include/asm-x86/msidef.h10
-rw-r--r--include/asm-x86/msr-index.h25
-rw-r--r--include/asm-x86/msr.h50
-rw-r--r--include/asm-x86/mtrr.h6
-rw-r--r--include/asm-x86/mutex_32.h6
-rw-r--r--include/asm-x86/mutex_64.h6
-rw-r--r--include/asm-x86/nmi.h11
-rw-r--r--include/asm-x86/nops.h6
-rw-r--r--include/asm-x86/numa_32.h6
-rw-r--r--include/asm-x86/numa_64.h6
-rw-r--r--include/asm-x86/numaq.h6
-rw-r--r--include/asm-x86/numaq/apic.h (renamed from include/asm-x86/mach-numaq/mach_apic.h)6
-rw-r--r--include/asm-x86/numaq/apicdef.h (renamed from include/asm-x86/mach-numaq/mach_apicdef.h)4
-rw-r--r--include/asm-x86/numaq/ipi.h (renamed from include/asm-x86/mach-numaq/mach_ipi.h)6
-rw-r--r--include/asm-x86/numaq/mpparse.h (renamed from include/asm-x86/mach-numaq/mach_mpparse.h)6
-rw-r--r--include/asm-x86/numaq/wakecpu.h (renamed from include/asm-x86/mach-numaq/mach_wakecpu.h)6
-rw-r--r--include/asm-x86/olpc.h6
-rw-r--r--include/asm-x86/page.h15
-rw-r--r--include/asm-x86/page_32.h25
-rw-r--r--include/asm-x86/page_64.h8
-rw-r--r--include/asm-x86/param.h6
-rw-r--r--include/asm-x86/paravirt.h87
-rw-r--r--include/asm-x86/parport.h6
-rw-r--r--include/asm-x86/pat.h6
-rw-r--r--include/asm-x86/pci-direct.h6
-rw-r--r--include/asm-x86/pci.h6
-rw-r--r--include/asm-x86/pci_32.h6
-rw-r--r--include/asm-x86/pci_64.h6
-rw-r--r--include/asm-x86/pda.h6
-rw-r--r--include/asm-x86/percpu.h6
-rw-r--r--include/asm-x86/pgalloc.h6
-rw-r--r--include/asm-x86/pgtable-2level-defs.h6
-rw-r--r--include/asm-x86/pgtable-2level.h8
-rw-r--r--include/asm-x86/pgtable-3level-defs.h6
-rw-r--r--include/asm-x86/pgtable-3level.h13
-rw-r--r--include/asm-x86/pgtable.h49
-rw-r--r--include/asm-x86/pgtable_32.h12
-rw-r--r--include/asm-x86/pgtable_64.h8
-rw-r--r--include/asm-x86/posix_types_32.h6
-rw-r--r--include/asm-x86/posix_types_64.h6
-rw-r--r--include/asm-x86/prctl.h6
-rw-r--r--include/asm-x86/processor-cyrix.h8
-rw-r--r--include/asm-x86/processor-flags.h7
-rw-r--r--include/asm-x86/processor.h84
-rw-r--r--include/asm-x86/proto.h6
-rw-r--r--include/asm-x86/ptrace-abi.h20
-rw-r--r--include/asm-x86/ptrace.h58
-rw-r--r--include/asm-x86/pvclock-abi.h6
-rw-r--r--include/asm-x86/pvclock.h7
-rw-r--r--include/asm-x86/reboot.h6
-rw-r--r--include/asm-x86/reboot_fixups.h6
-rw-r--r--include/asm-x86/required-features.h14
-rw-r--r--include/asm-x86/resume-trace.h8
-rw-r--r--include/asm-x86/rio.h6
-rw-r--r--include/asm-x86/rwlock.h6
-rw-r--r--include/asm-x86/rwsem.h6
-rw-r--r--include/asm-x86/scatterlist.h6
-rw-r--r--include/asm-x86/seccomp_32.h6
-rw-r--r--include/asm-x86/seccomp_64.h6
-rw-r--r--include/asm-x86/segment.h12
-rw-r--r--include/asm-x86/sembuf.h6
-rw-r--r--include/asm-x86/serial.h6
-rw-r--r--include/asm-x86/setup.h8
-rw-r--r--include/asm-x86/shmbuf.h6
-rw-r--r--include/asm-x86/shmparam.h6
-rw-r--r--include/asm-x86/sigcontext.h93
-rw-r--r--include/asm-x86/sigcontext32.h12
-rw-r--r--include/asm-x86/siginfo.h6
-rw-r--r--include/asm-x86/signal.h9
-rw-r--r--include/asm-x86/smp.h67
-rw-r--r--include/asm-x86/socket.h6
-rw-r--r--include/asm-x86/sockios.h6
-rw-r--r--include/asm-x86/sparsemem.h6
-rw-r--r--include/asm-x86/spinlock.h79
-rw-r--r--include/asm-x86/spinlock_types.h6
-rw-r--r--include/asm-x86/srat.h6
-rw-r--r--include/asm-x86/stacktrace.h6
-rw-r--r--include/asm-x86/stat.h6
-rw-r--r--include/asm-x86/statfs.h67
-rw-r--r--include/asm-x86/string_32.h6
-rw-r--r--include/asm-x86/string_64.h6
-rw-r--r--include/asm-x86/summit/apic.h (renamed from include/asm-x86/mach-summit/mach_apic.h)26
-rw-r--r--include/asm-x86/summit/apicdef.h13
-rw-r--r--include/asm-x86/summit/ipi.h (renamed from include/asm-x86/mach-summit/mach_ipi.h)6
-rw-r--r--include/asm-x86/summit/irq_vectors_limits.h (renamed from include/asm-x86/mach-summit/irq_vectors_limits.h)0
-rw-r--r--include/asm-x86/summit/mpparse.h (renamed from include/asm-x86/mach-summit/mach_mpparse.h)13
-rw-r--r--include/asm-x86/suspend_32.h6
-rw-r--r--include/asm-x86/suspend_64.h6
-rw-r--r--include/asm-x86/swiotlb.h6
-rw-r--r--include/asm-x86/sync_bitops.h6
-rw-r--r--include/asm-x86/syscall.h211
-rw-r--r--include/asm-x86/syscalls.h93
-rw-r--r--include/asm-x86/system.h11
-rw-r--r--include/asm-x86/system_64.h6
-rw-r--r--include/asm-x86/tce.h6
-rw-r--r--include/asm-x86/termbits.h6
-rw-r--r--include/asm-x86/termios.h6
-rw-r--r--include/asm-x86/therm_throt.h6
-rw-r--r--include/asm-x86/thread_info.h11
-rw-r--r--include/asm-x86/time.h8
-rw-r--r--include/asm-x86/timer.h11
-rw-r--r--include/asm-x86/timex.h6
-rw-r--r--include/asm-x86/tlb.h6
-rw-r--r--include/asm-x86/tlbflush.h16
-rw-r--r--include/asm-x86/topology.h6
-rw-r--r--include/asm-x86/trampoline.h6
-rw-r--r--include/asm-x86/traps.h87
-rw-r--r--include/asm-x86/tsc.h6
-rw-r--r--include/asm-x86/types.h6
-rw-r--r--include/asm-x86/uaccess.h6
-rw-r--r--include/asm-x86/uaccess_32.h6
-rw-r--r--include/asm-x86/uaccess_64.h7
-rw-r--r--include/asm-x86/ucontext.h12
-rw-r--r--include/asm-x86/unaligned.h6
-rw-r--r--include/asm-x86/unistd_32.h6
-rw-r--r--include/asm-x86/unistd_64.h6
-rw-r--r--include/asm-x86/unwind.h6
-rw-r--r--include/asm-x86/user32.h6
-rw-r--r--include/asm-x86/user_32.h6
-rw-r--r--include/asm-x86/user_64.h6
-rw-r--r--include/asm-x86/uv/bios.h6
-rw-r--r--include/asm-x86/uv/uv_bau.h11
-rw-r--r--include/asm-x86/uv/uv_hub.h6
-rw-r--r--include/asm-x86/uv/uv_mmrs.h6
-rw-r--r--include/asm-x86/vdso.h6
-rw-r--r--include/asm-x86/vga.h6
-rw-r--r--include/asm-x86/vgtod.h6
-rw-r--r--include/asm-x86/visws/cobalt.h6
-rw-r--r--include/asm-x86/visws/lithium.h6
-rw-r--r--include/asm-x86/visws/piix4.h6
-rw-r--r--include/asm-x86/vm86.h6
-rw-r--r--include/asm-x86/vmi_time.h6
-rw-r--r--include/asm-x86/vsyscall.h6
-rw-r--r--include/asm-x86/xcr.h49
-rw-r--r--include/asm-x86/xen/events.h6
-rw-r--r--include/asm-x86/xen/grant_table.h6
-rw-r--r--include/asm-x86/xen/hypercall.h6
-rw-r--r--include/asm-x86/xen/hypervisor.h21
-rw-r--r--include/asm-x86/xen/interface.h6
-rw-r--r--include/asm-x86/xen/interface_32.h6
-rw-r--r--include/asm-x86/xen/interface_64.h6
-rw-r--r--include/asm-x86/xen/page.h10
-rw-r--r--include/asm-x86/xsave.h118
-rw-r--r--include/asm-xtensa/a.out.h29
-rw-r--r--include/asm-xtensa/elf.h2
-rw-r--r--include/crypto/internal/rng.h26
-rw-r--r--include/crypto/internal/skcipher.h6
-rw-r--r--include/crypto/rng.h75
-rw-r--r--include/drm/drm.h63
-rw-r--r--include/drm/drmP.h249
-rw-r--r--include/drm/drm_pciids.h54
-rw-r--r--include/drm/i915_drm.h333
-rw-r--r--include/linux/Kbuild11
-rw-r--r--include/linux/aio.h9
-rw-r--r--include/linux/ata.h129
-rw-r--r--include/linux/auto_dev-ioctl.h157
-rw-r--r--include/linux/auto_fs4.h7
-rw-r--r--include/linux/binfmts.h5
-rw-r--r--include/linux/bio.h129
-rw-r--r--include/linux/blkdev.h187
-rw-r--r--include/linux/blktrace_api.h94
-rw-r--r--include/linux/cgroup.h3
-rw-r--r--include/linux/clk.h4
-rw-r--r--include/linux/clockchips.h2
-rw-r--r--include/linux/cnt32_to_63.h80
-rw-r--r--include/linux/compat.h6
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/linux/completion.h41
-rw-r--r--include/linux/console_struct.h1
-rw-r--r--include/linux/cpu.h1
-rw-r--r--include/linux/cpufreq.h7
-rw-r--r--include/linux/cpuset.h2
-rw-r--r--include/linux/crypto.h35
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/device-mapper.h18
-rw-r--r--include/linux/device.h37
-rw-r--r--include/linux/devpts_fs.h31
-rw-r--r--include/linux/dlm.h5
-rw-r--r--include/linux/dlm_device.h2
-rw-r--r--include/linux/dma-mapping.h12
-rw-r--r--include/linux/dma_remapping.h157
-rw-r--r--include/linux/dmar.h127
-rw-r--r--include/linux/dmi.h41
-rw-r--r--include/linux/ds1286.h2
-rw-r--r--include/linux/dvb/frontend.h112
-rw-r--r--include/linux/dvb/version.h4
-rw-r--r--include/linux/dynamic_printk.h93
-rw-r--r--include/linux/elevator.h9
-rw-r--r--include/linux/elf.h1
-rw-r--r--include/linux/ext2_fs.h2
-rw-r--r--include/linux/ext3_fs.h6
-rw-r--r--include/linux/ext3_jbd.h14
-rw-r--r--include/linux/fd.h8
-rw-r--r--include/linux/fiemap.h64
-rw-r--r--include/linux/firewire-cdev.h9
-rw-r--r--include/linux/fs.h95
-rw-r--r--include/linux/fs_uart_pd.h1
-rw-r--r--include/linux/gameport.h7
-rw-r--r--include/linux/genhd.h355
-rw-r--r--include/linux/gfs2_ondisk.h6
-rw-r--r--include/linux/gpio.h3
-rw-r--r--include/linux/hid.h373
-rw-r--r--include/linux/hiddev.h46
-rw-r--r--include/linux/hpet.h14
-rw-r--r--include/linux/hrtimer.h28
-rw-r--r--include/linux/i2c-id.h3
-rw-r--r--include/linux/i2c.h12
-rw-r--r--include/linux/i2o.h292
-rw-r--r--include/linux/icmpv6.h6
-rw-r--r--include/linux/ide.h906
-rw-r--r--include/linux/ieee80211.h36
-rw-r--r--include/linux/if.h1
-rw-r--r--include/linux/if_ether.h8
-rw-r--r--include/linux/if_fddi.h2
-rw-r--r--include/linux/if_hippi.h2
-rw-r--r--include/linux/if_link.h1
-rw-r--r--include/linux/if_phonet.h19
-rw-r--r--include/linux/if_tunnel.h19
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/inetdevice.h1
-rw-r--r--include/linux/init.h4
-rw-r--r--include/linux/input.h15
-rw-r--r--include/linux/intel-iommu.h327
-rw-r--r--include/linux/interrupt.h23
-rw-r--r--include/linux/iommu-helper.h19
-rw-r--r--include/linux/ioport.h16
-rw-r--r--include/linux/iova.h52
-rw-r--r--include/linux/ip_vs.h160
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/isdn_ppp.h2
-rw-r--r--include/linux/ivtv.h1
-rw-r--r--include/linux/jbd.h4
-rw-r--r--include/linux/jbd2.h21
-rw-r--r--include/linux/journal-head.h2
-rw-r--r--include/linux/kallsyms.h8
-rw-r--r--include/linux/kernel.h38
-rw-r--r--include/linux/kernel_stat.h1
-rw-r--r--include/linux/key.h1
-rw-r--r--include/linux/klist.h3
-rw-r--r--include/linux/kmod.h3
-rw-r--r--include/linux/kvm.h74
-rw-r--r--include/linux/kvm_host.h82
-rw-r--r--include/linux/lcd.h3
-rw-r--r--include/linux/libata.h90
-rw-r--r--include/linux/list.h13
-rw-r--r--include/linux/lockd/bind.h11
-rw-r--r--include/linux/lockd/lockd.h137
-rw-r--r--include/linux/lockd/xdr.h2
-rw-r--r--include/linux/magic.h4
-rw-r--r--include/linux/major.h2
-rw-r--r--include/linux/map_to_7segment.h187
-rw-r--r--include/linux/memstick.h97
-rw-r--r--include/linux/mfd/tmio.h19
-rw-r--r--include/linux/mfd/wm8350/audio.h598
-rw-r--r--include/linux/mfd/wm8350/comparator.h167
-rw-r--r--include/linux/mfd/wm8350/core.h631
-rw-r--r--include/linux/mfd/wm8350/gpio.h342
-rw-r--r--include/linux/mfd/wm8350/pmic.h741
-rw-r--r--include/linux/mfd/wm8350/rtc.h266
-rw-r--r--include/linux/mfd/wm8350/supply.h111
-rw-r--r--include/linux/mfd/wm8350/wdt.h28
-rw-r--r--include/linux/mfd/wm8400-audio.h1186
-rw-r--r--include/linux/mfd/wm8400-private.h936
-rw-r--r--include/linux/mfd/wm8400.h40
-rw-r--r--include/linux/mlx4/device.h4
-rw-r--r--include/linux/mm.h13
-rw-r--r--include/linux/mm_types.h10
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/mmdebug.h18
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/mod_devicetable.h59
-rw-r--r--include/linux/module.h1
-rw-r--r--include/linux/mount.h2
-rw-r--r--include/linux/mroute.h2
-rw-r--r--include/linux/mroute6.h1
-rw-r--r--include/linux/mtd/blktrans.h2
-rw-r--r--include/linux/mv643xx_eth.h13
-rw-r--r--include/linux/net.h14
-rw-r--r--include/linux/netdevice.h33
-rw-r--r--include/linux/netfilter.h97
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_proto_gre.h2
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/x_tables.h161
-rw-r--r--include/linux/netfilter/xt_TPROXY.h14
-rw-r--r--include/linux/netfilter/xt_recent.h26
-rw-r--r--include/linux/netfilter_bridge/ebtables.h76
-rw-r--r--include/linux/netfilter_ipv4/ipt_recent.h28
-rw-r--r--include/linux/nfs_fs.h19
-rw-r--r--include/linux/nfs_fs_sb.h1
-rw-r--r--include/linux/nfs_mount.h4
-rw-r--r--include/linux/nfs_xdr.h11
-rw-r--r--include/linux/nfsd/nfsd.h3
-rw-r--r--include/linux/nl80211.h133
-rw-r--r--include/linux/notifier.h10
-rw-r--r--include/linux/of.h3
-rw-r--r--include/linux/oprofile.h2
-rw-r--r--include/linux/parport.h2
-rw-r--r--include/linux/parser.h2
-rw-r--r--include/linux/pci.h8
-rw-r--r--include/linux/pci_ids.h28
-rw-r--r--include/linux/percpu.h7
-rw-r--r--include/linux/percpu_counter.h12
-rw-r--r--include/linux/pfkeyv2.h13
-rw-r--r--include/linux/pfn.h6
-rw-r--r--include/linux/phonet.h170
-rw-r--r--include/linux/phy.h52
-rw-r--r--include/linux/pid_namespace.h6
-rw-r--r--include/linux/pim.h18
-rw-r--r--include/linux/pkt_sched.h7
-rw-r--r--include/linux/platform_device.h2
-rw-r--r--include/linux/pm.h2
-rw-r--r--include/linux/pnp.h11
-rw-r--r--include/linux/posix-timers.h4
-rw-r--r--include/linux/proc_fs.h1
-rw-r--r--include/linux/profile.h8
-rw-r--r--include/linux/proportions.h2
-rw-r--r--include/linux/quicklist.h7
-rw-r--r--include/linux/quota.h2
-rw-r--r--include/linux/quotaops.h3
-rw-r--r--include/linux/raid/linear.h10
-rw-r--r--include/linux/raid/md.h32
-rw-r--r--include/linux/ramfs.h1
-rw-r--r--include/linux/rcuclassic.h37
-rw-r--r--include/linux/rculist.h14
-rw-r--r--include/linux/rcupdate.h20
-rw-r--r--include/linux/rcupreempt.h11
-rw-r--r--include/linux/regulator/driver.h10
-rw-r--r--include/linux/regulator/machine.h30
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/res_counter.h2
-rw-r--r--include/linux/rfkill.h7
-rw-r--r--include/linux/rtc/m48t59.h47
-rw-r--r--include/linux/rtmutex.h2
-rw-r--r--include/linux/rtnetlink.h4
-rw-r--r--include/linux/sched.h103
-rw-r--r--include/linux/security.h54
-rw-r--r--include/linux/serial.h16
-rw-r--r--include/linux/serial_core.h2
-rw-r--r--include/linux/skbuff.h175
-rw-r--r--include/linux/smb.h2
-rw-r--r--include/linux/smc91x.h11
-rw-r--r--include/linux/smp.h4
-rw-r--r--include/linux/socket.h5
-rw-r--r--include/linux/spi/ads7846.h3
-rw-r--r--include/linux/spi/corgi_lcd.h20
-rw-r--r--include/linux/spi/orion_spi.h1
-rw-r--r--include/linux/ssb/ssb_regs.h19
-rw-r--r--include/linux/stacktrace.h2
-rw-r--r--include/linux/stop_machine.h19
-rw-r--r--include/linux/string_helpers.h16
-rw-r--r--include/linux/sunrpc/clnt.h5
-rw-r--r--include/linux/sunrpc/svc.h19
-rw-r--r--include/linux/sunrpc/svc_rdma.h28
-rw-r--r--include/linux/sunrpc/svcsock.h5
-rw-r--r--include/linux/sunrpc/xprtrdma.h4
-rw-r--r--include/linux/swiotlb.h83
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/sysfs.h36
-rw-r--r--include/linux/task_io_accounting.h2
-rw-r--r--include/linux/tc_act/Kbuild1
-rw-r--r--include/linux/tc_act/tc_skbedit.h44
-rw-r--r--include/linux/tcp.h12
-rw-r--r--include/linux/telephony.h4
-rw-r--r--include/linux/termios.h15
-rw-r--r--include/linux/tick.h14
-rw-r--r--include/linux/time.h5
-rw-r--r--include/linux/timex.h11
-rw-r--r--include/linux/tracehook.h2
-rw-r--r--include/linux/tty.h45
-rw-r--r--include/linux/tty_driver.h56
-rw-r--r--include/linux/types.h8
-rw-r--r--include/linux/ucb1400.h161
-rw-r--r--include/linux/usb.h10
-rw-r--r--include/linux/usb/Kbuild3
-rw-r--r--include/linux/usb/cdc.h9
-rw-r--r--include/linux/usb/composite.h11
-rw-r--r--include/linux/usb/ehci_def.h160
-rw-r--r--include/linux/usb/serial.h2
-rw-r--r--include/linux/usb/tmc.h43
-rw-r--r--include/linux/usb/vstusb.h71
-rw-r--r--include/linux/videodev2.h32
-rw-r--r--include/linux/vt_kern.h2
-rw-r--r--include/linux/wait.h9
-rw-r--r--include/linux/wm97xx_batt.h26
-rw-r--r--include/linux/writeback.h10
-rw-r--r--include/linux/xfrm.h10
-rw-r--r--include/math-emu/op-2.h2
-rw-r--r--include/math-emu/op-common.h12
-rw-r--r--include/math-emu/soft-fp.h19
-rw-r--r--include/media/ir-common.h11
-rw-r--r--include/media/saa7115.h19
-rw-r--r--include/media/saa7146.h4
-rw-r--r--include/media/sh_mobile_ceu.h2
-rw-r--r--include/media/soc_camera.h3
-rw-r--r--include/media/soc_camera_platform.h11
-rw-r--r--include/media/tuner.h4
-rw-r--r--include/media/v4l2-chip-ident.h5
-rw-r--r--include/media/v4l2-common.h15
-rw-r--r--include/media/v4l2-dev.h75
-rw-r--r--include/media/v4l2-i2c-drv-legacy.h11
-rw-r--r--include/media/v4l2-i2c-drv.h11
-rw-r--r--include/media/v4l2-ioctl.h5
-rw-r--r--include/media/videobuf-dvb.h29
-rw-r--r--include/net/9p/9p.h5
-rw-r--r--include/net/9p/transport.h9
-rw-r--r--include/net/bluetooth/bluetooth.h4
-rw-r--r--include/net/bluetooth/hci_core.h3
-rw-r--r--include/net/cfg80211.h89
-rw-r--r--include/net/cipso_ipv4.h55
-rw-r--r--include/net/dsa.h37
-rw-r--r--include/net/flow.h2
-rw-r--r--include/net/ieee80211.h6
-rw-r--r--include/net/inet6_hashtables.h15
-rw-r--r--include/net/inet_connection_sock.h2
-rw-r--r--include/net/inet_hashtables.h18
-rw-r--r--include/net/inet_sock.h20
-rw-r--r--include/net/inet_timewait_sock.h6
-rw-r--r--include/net/ip.h15
-rw-r--r--include/net/ip_vs.h315
-rw-r--r--include/net/ipip.h2
-rw-r--r--include/net/ipv6.h47
-rw-r--r--include/net/irda/irda.h2
-rw-r--r--include/net/mac80211.h242
-rw-r--r--include/net/ndisc.h5
-rw-r--r--include/net/net_namespace.h6
-rw-r--r--include/net/netfilter/ipv4/nf_defrag_ipv4.h6
-rw-r--r--include/net/netfilter/nf_conntrack.h34
-rw-r--r--include/net/netfilter/nf_conntrack_acct.h10
-rw-r--r--include/net/netfilter/nf_conntrack_core.h11
-rw-r--r--include/net/netfilter/nf_conntrack_ecache.h29
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h22
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h21
-rw-r--r--include/net/netfilter/nf_log.h8
-rw-r--r--include/net/netfilter/nf_nat_core.h8
-rw-r--r--include/net/netfilter/nf_queue.h6
-rw-r--r--include/net/netfilter/nf_tproxy_core.h32
-rw-r--r--include/net/netlabel.h51
-rw-r--r--include/net/netlink.h84
-rw-r--r--include/net/netns/conntrack.h30
-rw-r--r--include/net/netns/ipv4.h3
-rw-r--r--include/net/netns/mib.h9
-rw-r--r--include/net/phonet/gprs.h38
-rw-r--r--include/net/phonet/pep.h160
-rw-r--r--include/net/phonet/phonet.h112
-rw-r--r--include/net/phonet/pn_dev.h50
-rw-r--r--include/net/pkt_sched.h6
-rw-r--r--include/net/route.h11
-rw-r--r--include/net/sch_generic.h18
-rw-r--r--include/net/sctp/constants.h4
-rw-r--r--include/net/sctp/sctp.h12
-rw-r--r--include/net/sctp/sm.h3
-rw-r--r--include/net/sctp/structs.h34
-rw-r--r--include/net/sctp/tsnmap.h53
-rw-r--r--include/net/sock.h19
-rw-r--r--include/net/tc_act/tc_skbedit.h34
-rw-r--r--include/net/tcp.h52
-rw-r--r--include/net/udp.h21
-rw-r--r--include/net/wireless.h65
-rw-r--r--include/net/xfrm.h104
-rw-r--r--include/pcmcia/ciscode.h2
-rw-r--r--include/pcmcia/cistpl.h38
-rw-r--r--include/pcmcia/cs.h165
-rw-r--r--include/pcmcia/cs_types.h8
-rw-r--r--include/pcmcia/device_id.h18
-rw-r--r--include/pcmcia/ds.h411
-rw-r--r--include/pcmcia/ss.h202
-rw-r--r--include/scsi/iscsi_if.h2
-rw-r--r--include/scsi/libiscsi.h15
-rw-r--r--include/scsi/scsi.h20
-rw-r--r--include/scsi/scsi_cmnd.h3
-rw-r--r--include/scsi/scsi_device.h31
-rw-r--r--include/scsi/scsi_host.h9
-rw-r--r--include/scsi/scsi_netlink.h62
-rw-r--r--include/scsi/scsi_transport.h3
-rw-r--r--include/scsi/scsi_transport_fc.h31
-rw-r--r--include/scsi/scsi_transport_iscsi.h5
-rw-r--r--include/sound/ad1848.h218
-rw-r--r--include/sound/asound.h52
-rw-r--r--include/sound/asoundef.h89
-rw-r--r--include/sound/core.h35
-rw-r--r--include/sound/cs4231.h175
-rw-r--r--include/sound/jack.h75
-rw-r--r--include/sound/memalloc.h18
-rw-r--r--include/sound/minors.h2
-rw-r--r--include/sound/pcm.h39
-rw-r--r--include/sound/pxa2xx-lib.h45
-rw-r--r--include/sound/sb.h5
-rw-r--r--include/sound/snd_wavefront.h1
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--include/sound/soc-of-simple.h25
-rw-r--r--include/sound/soc.h74
-rw-r--r--include/sound/tea575x-tuner.h1
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/vx_core.h9
-rw-r--r--include/sound/wss.h235
-rw-r--r--include/video/atmel_lcdc.h1
-rw-r--r--include/video/cyblafb.h2
-rw-r--r--include/video/metronomefb.h31
-rw-r--r--include/video/neomagic.h1
-rw-r--r--include/video/radeon.h23
-rw-r--r--include/video/s1d13xxxfb.h3
-rw-r--r--include/xen/balloon.h61
-rw-r--r--include/xen/events.h2
1364 files changed, 17841 insertions, 122804 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 57ab9e9d7593..74a9617776a8 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -467,7 +467,7 @@ struct acpi_integer_overlay {
467/* 467/*
468 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, 468 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
469 * define it now. This is the case where there the compiler does not support 469 * define it now. This is the case where there the compiler does not support
470 * a __FUNCTION__ macro or equivalent. 470 * a __func__ macro or equivalent.
471 */ 471 */
472#ifndef ACPI_GET_FUNCTION_NAME 472#ifndef ACPI_GET_FUNCTION_NAME
473#define ACPI_GET_FUNCTION_NAME _acpi_function_name 473#define ACPI_GET_FUNCTION_NAME _acpi_function_name
@@ -475,12 +475,12 @@ struct acpi_integer_overlay {
475 * The Name parameter should be the procedure name as a quoted string. 475 * The Name parameter should be the procedure name as a quoted string.
476 * The function name is also used by the function exit macros below. 476 * The function name is also used by the function exit macros below.
477 * Note: (const char) is used to be compatible with the debug interfaces 477 * Note: (const char) is used to be compatible with the debug interfaces
478 * and macros such as __FUNCTION__. 478 * and macros such as __func__.
479 */ 479 */
480#define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name; 480#define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name;
481 481
482#else 482#else
483/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ 483/* Compiler supports __func__ (or equivalent) -- Ignore this macro */
484 484
485#define ACPI_FUNCTION_NAME(name) 485#define ACPI_FUNCTION_NAME(name)
486#endif 486#endif
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 8996dba90cd9..8e2cdc57b197 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -46,7 +46,7 @@
46 46
47/* Function name is used for debug output. Non-ANSI, compiler-dependent */ 47/* Function name is used for debug output. Non-ANSI, compiler-dependent */
48 48
49#define ACPI_GET_FUNCTION_NAME __FUNCTION__ 49#define ACPI_GET_FUNCTION_NAME __func__
50 50
51/* 51/*
52 * This macro is used to tag functions as "printf-like" because 52 * This macro is used to tag functions as "printf-like" because
diff --git a/include/asm-arm/plat-s3c/debug-macro.S b/include/asm-arm/plat-s3c/debug-macro.S
deleted file mode 100644
index 84c40b847da8..000000000000
--- a/include/asm-arm/plat-s3c/debug-macro.S
+++ /dev/null
@@ -1,75 +0,0 @@
1/* linux/include/asm-arm/plat-s3c/debug-macro.S
2 *
3 * Copyright 2005, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
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 version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <asm/plat-s3c/regs-serial.h>
13
14/* The S3C2440 implementations are used by default as they are the
15 * most widely re-used */
16
17 .macro fifo_level_s3c2440 rd, rx
18 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
19 and \rd, \rd, #S3C2440_UFSTAT_TXMASK
20 .endm
21
22#ifndef fifo_level
23#define fifo_level fifo_level_s3c2410
24#endif
25
26 .macro fifo_full_s3c2440 rd, rx
27 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
28 tst \rd, #S3C2440_UFSTAT_TXFULL
29 .endm
30
31#ifndef fifo_full
32#define fifo_full fifo_full_s3c2440
33#endif
34
35 .macro senduart,rd,rx
36 strb \rd, [\rx, # S3C2410_UTXH ]
37 .endm
38
39 .macro busyuart, rd, rx
40 ldr \rd, [ \rx, # S3C2410_UFCON ]
41 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
42 beq 1001f @
43 @ FIFO enabled...
441003:
45 fifo_full \rd, \rx
46 bne 1003b
47 b 1002f
48
491001:
50 @ busy waiting for non fifo
51 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
52 tst \rd, #S3C2410_UTRSTAT_TXFE
53 beq 1001b
54
551002: @ exit busyuart
56 .endm
57
58 .macro waituart,rd,rx
59 ldr \rd, [ \rx, # S3C2410_UFCON ]
60 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
61 beq 1001f @
62 @ FIFO enabled...
631003:
64 fifo_level \rd, \rx
65 teq \rd, #0
66 bne 1003b
67 b 1002f
681001:
69 @ idle waiting for non fifo
70 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
71 tst \rd, #S3C2410_UTRSTAT_TXFE
72 beq 1001b
73
741002: @ exit busyuart
75 .endm
diff --git a/include/asm-arm/plat-s3c/map.h b/include/asm-arm/plat-s3c/map.h
deleted file mode 100644
index b84289d32a54..000000000000
--- a/include/asm-arm/plat-s3c/map.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/* linux/include/asm-arm/plat-s3c/map.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - Memory map definitions (virtual addresses)
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_PLAT_MAP_H
15#define __ASM_PLAT_MAP_H __FILE__
16
17/* Fit all our registers in at 0xF4000000 upwards, trying to use as
18 * little of the VA space as possible so vmalloc and friends have a
19 * better chance of getting memory.
20 *
21 * we try to ensure stuff like the IRQ registers are available for
22 * an single MOVS instruction (ie, only 8 bits of set data)
23 */
24
25#define S3C_ADDR_BASE (0xF4000000)
26
27#ifndef __ASSEMBLY__
28#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))
29#else
30#define S3C_ADDR(x) (S3C_ADDR_BASE + (x))
31#endif
32
33#define S3C_VA_IRQ S3C_ADDR(0x00000000) /* irq controller(s) */
34#define S3C_VA_SYS S3C_ADDR(0x00100000) /* system control */
35#define S3C_VA_MEM S3C_ADDR(0x00200000) /* system control */
36#define S3C_VA_TIMER S3C_ADDR(0x00300000) /* timer block */
37#define S3C_VA_WATCHDOG S3C_ADDR(0x00400000) /* watchdog */
38#define S3C_VA_UART S3C_ADDR(0x01000000) /* UART */
39
40#endif /* __ASM_PLAT_MAP_H */
diff --git a/include/asm-arm/plat-s3c/regs-adc.h b/include/asm-arm/plat-s3c/regs-adc.h
deleted file mode 100644
index 4323cccc86cd..000000000000
--- a/include/asm-arm/plat-s3c/regs-adc.h
+++ /dev/null
@@ -1,60 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-adc.h
2 *
3 * Copyright (c) 2004 Shannon Holland <holland@loser.net>
4 *
5 * This program is free software; yosu can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C2410 ADC registers
10*/
11
12#ifndef __ASM_ARCH_REGS_ADC_H
13#define __ASM_ARCH_REGS_ADC_H "regs-adc.h"
14
15#define S3C2410_ADCREG(x) (x)
16
17#define S3C2410_ADCCON S3C2410_ADCREG(0x00)
18#define S3C2410_ADCTSC S3C2410_ADCREG(0x04)
19#define S3C2410_ADCDLY S3C2410_ADCREG(0x08)
20#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C)
21#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10)
22
23
24/* ADCCON Register Bits */
25#define S3C2410_ADCCON_ECFLG (1<<15)
26#define S3C2410_ADCCON_PRSCEN (1<<14)
27#define S3C2410_ADCCON_PRSCVL(x) (((x)&0xFF)<<6)
28#define S3C2410_ADCCON_PRSCVLMASK (0xFF<<6)
29#define S3C2410_ADCCON_SELMUX(x) (((x)&0x7)<<3)
30#define S3C2410_ADCCON_MUXMASK (0x7<<3)
31#define S3C2410_ADCCON_STDBM (1<<2)
32#define S3C2410_ADCCON_READ_START (1<<1)
33#define S3C2410_ADCCON_ENABLE_START (1<<0)
34#define S3C2410_ADCCON_STARTMASK (0x3<<0)
35
36
37/* ADCTSC Register Bits */
38#define S3C2410_ADCTSC_YM_SEN (1<<7)
39#define S3C2410_ADCTSC_YP_SEN (1<<6)
40#define S3C2410_ADCTSC_XM_SEN (1<<5)
41#define S3C2410_ADCTSC_XP_SEN (1<<4)
42#define S3C2410_ADCTSC_PULL_UP_DISABLE (1<<3)
43#define S3C2410_ADCTSC_AUTO_PST (1<<2)
44#define S3C2410_ADCTSC_XY_PST(x) (((x)&0x3)<<0)
45
46/* ADCDAT0 Bits */
47#define S3C2410_ADCDAT0_UPDOWN (1<<15)
48#define S3C2410_ADCDAT0_AUTO_PST (1<<14)
49#define S3C2410_ADCDAT0_XY_PST (0x3<<12)
50#define S3C2410_ADCDAT0_XPDATA_MASK (0x03FF)
51
52/* ADCDAT1 Bits */
53#define S3C2410_ADCDAT1_UPDOWN (1<<15)
54#define S3C2410_ADCDAT1_AUTO_PST (1<<14)
55#define S3C2410_ADCDAT1_XY_PST (0x3<<12)
56#define S3C2410_ADCDAT1_YPDATA_MASK (0x03FF)
57
58#endif /* __ASM_ARCH_REGS_ADC_H */
59
60
diff --git a/include/asm-arm/plat-s3c/regs-serial.h b/include/asm-arm/plat-s3c/regs-serial.h
deleted file mode 100644
index a0daa647b92c..000000000000
--- a/include/asm-arm/plat-s3c/regs-serial.h
+++ /dev/null
@@ -1,232 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-serial.h
2 *
3 * From linux/include/asm-arm/hardware/serial_s3c2410.h
4 *
5 * Internal header file for Samsung S3C2410 serial ports (UART0-2)
6 *
7 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
8 *
9 * Additional defines, (c) 2003 Simtec Electronics (linux@simtec.co.uk)
10 *
11 * Adapted from:
12 *
13 * Internal header file for MX1ADS serial ports (UART1 & 2)
14 *
15 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
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 of the License, or
20 * (at your option) 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; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30*/
31
32#ifndef __ASM_ARM_REGS_SERIAL_H
33#define __ASM_ARM_REGS_SERIAL_H
34
35#define S3C24XX_VA_UART0 (S3C_VA_UART)
36#define S3C24XX_VA_UART1 (S3C_VA_UART + 0x4000 )
37#define S3C24XX_VA_UART2 (S3C_VA_UART + 0x8000 )
38#define S3C24XX_VA_UART3 (S3C_VA_UART + 0xC000 )
39
40#define S3C2410_PA_UART0 (S3C24XX_PA_UART)
41#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 )
42#define S3C2410_PA_UART2 (S3C24XX_PA_UART + 0x8000 )
43#define S3C2443_PA_UART3 (S3C24XX_PA_UART + 0xC000 )
44
45#define S3C2410_URXH (0x24)
46#define S3C2410_UTXH (0x20)
47#define S3C2410_ULCON (0x00)
48#define S3C2410_UCON (0x04)
49#define S3C2410_UFCON (0x08)
50#define S3C2410_UMCON (0x0C)
51#define S3C2410_UBRDIV (0x28)
52#define S3C2410_UTRSTAT (0x10)
53#define S3C2410_UERSTAT (0x14)
54#define S3C2410_UFSTAT (0x18)
55#define S3C2410_UMSTAT (0x1C)
56
57#define S3C2410_LCON_CFGMASK ((0xF<<3)|(0x3))
58
59#define S3C2410_LCON_CS5 (0x0)
60#define S3C2410_LCON_CS6 (0x1)
61#define S3C2410_LCON_CS7 (0x2)
62#define S3C2410_LCON_CS8 (0x3)
63#define S3C2410_LCON_CSMASK (0x3)
64
65#define S3C2410_LCON_PNONE (0x0)
66#define S3C2410_LCON_PEVEN (0x5 << 3)
67#define S3C2410_LCON_PODD (0x4 << 3)
68#define S3C2410_LCON_PMASK (0x7 << 3)
69
70#define S3C2410_LCON_STOPB (1<<2)
71#define S3C2410_LCON_IRM (1<<6)
72
73#define S3C2440_UCON_CLKMASK (3<<10)
74#define S3C2440_UCON_PCLK (0<<10)
75#define S3C2440_UCON_UCLK (1<<10)
76#define S3C2440_UCON_PCLK2 (2<<10)
77#define S3C2440_UCON_FCLK (3<<10)
78#define S3C2443_UCON_EPLL (3<<10)
79
80#define S3C2440_UCON2_FCLK_EN (1<<15)
81#define S3C2440_UCON0_DIVMASK (15 << 12)
82#define S3C2440_UCON1_DIVMASK (15 << 12)
83#define S3C2440_UCON2_DIVMASK (7 << 12)
84#define S3C2440_UCON_DIVSHIFT (12)
85
86#define S3C2412_UCON_CLKMASK (3<<10)
87#define S3C2412_UCON_UCLK (1<<10)
88#define S3C2412_UCON_USYSCLK (3<<10)
89#define S3C2412_UCON_PCLK (0<<10)
90#define S3C2412_UCON_PCLK2 (2<<10)
91
92#define S3C2410_UCON_UCLK (1<<10)
93#define S3C2410_UCON_SBREAK (1<<4)
94
95#define S3C2410_UCON_TXILEVEL (1<<9)
96#define S3C2410_UCON_RXILEVEL (1<<8)
97#define S3C2410_UCON_TXIRQMODE (1<<2)
98#define S3C2410_UCON_RXIRQMODE (1<<0)
99#define S3C2410_UCON_RXFIFO_TOI (1<<7)
100#define S3C2443_UCON_RXERR_IRQEN (1<<6)
101#define S3C2443_UCON_LOOPBACK (1<<5)
102
103#define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
104 S3C2410_UCON_RXILEVEL | \
105 S3C2410_UCON_TXIRQMODE | \
106 S3C2410_UCON_RXIRQMODE | \
107 S3C2410_UCON_RXFIFO_TOI)
108
109#define S3C2410_UFCON_FIFOMODE (1<<0)
110#define S3C2410_UFCON_TXTRIG0 (0<<6)
111#define S3C2410_UFCON_RXTRIG8 (1<<4)
112#define S3C2410_UFCON_RXTRIG12 (2<<4)
113
114/* S3C2440 FIFO trigger levels */
115#define S3C2440_UFCON_RXTRIG1 (0<<4)
116#define S3C2440_UFCON_RXTRIG8 (1<<4)
117#define S3C2440_UFCON_RXTRIG16 (2<<4)
118#define S3C2440_UFCON_RXTRIG32 (3<<4)
119
120#define S3C2440_UFCON_TXTRIG0 (0<<6)
121#define S3C2440_UFCON_TXTRIG16 (1<<6)
122#define S3C2440_UFCON_TXTRIG32 (2<<6)
123#define S3C2440_UFCON_TXTRIG48 (3<<6)
124
125#define S3C2410_UFCON_RESETBOTH (3<<1)
126#define S3C2410_UFCON_RESETTX (1<<2)
127#define S3C2410_UFCON_RESETRX (1<<1)
128
129#define S3C2410_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
130 S3C2410_UFCON_TXTRIG0 | \
131 S3C2410_UFCON_RXTRIG8 )
132
133#define S3C2410_UMCOM_AFC (1<<4)
134#define S3C2410_UMCOM_RTS_LOW (1<<0)
135
136#define S3C2412_UMCON_AFC_63 (0<<5) /* same as s3c2443 */
137#define S3C2412_UMCON_AFC_56 (1<<5)
138#define S3C2412_UMCON_AFC_48 (2<<5)
139#define S3C2412_UMCON_AFC_40 (3<<5)
140#define S3C2412_UMCON_AFC_32 (4<<5)
141#define S3C2412_UMCON_AFC_24 (5<<5)
142#define S3C2412_UMCON_AFC_16 (6<<5)
143#define S3C2412_UMCON_AFC_8 (7<<5)
144
145#define S3C2410_UFSTAT_TXFULL (1<<9)
146#define S3C2410_UFSTAT_RXFULL (1<<8)
147#define S3C2410_UFSTAT_TXMASK (15<<4)
148#define S3C2410_UFSTAT_TXSHIFT (4)
149#define S3C2410_UFSTAT_RXMASK (15<<0)
150#define S3C2410_UFSTAT_RXSHIFT (0)
151
152/* UFSTAT S3C2443 same as S3C2440 */
153#define S3C2440_UFSTAT_TXFULL (1<<14)
154#define S3C2440_UFSTAT_RXFULL (1<<6)
155#define S3C2440_UFSTAT_TXSHIFT (8)
156#define S3C2440_UFSTAT_RXSHIFT (0)
157#define S3C2440_UFSTAT_TXMASK (63<<8)
158#define S3C2440_UFSTAT_RXMASK (63)
159
160#define S3C2410_UTRSTAT_TXE (1<<2)
161#define S3C2410_UTRSTAT_TXFE (1<<1)
162#define S3C2410_UTRSTAT_RXDR (1<<0)
163
164#define S3C2410_UERSTAT_OVERRUN (1<<0)
165#define S3C2410_UERSTAT_FRAME (1<<2)
166#define S3C2410_UERSTAT_BREAK (1<<3)
167#define S3C2443_UERSTAT_PARITY (1<<1)
168
169#define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \
170 S3C2410_UERSTAT_FRAME | \
171 S3C2410_UERSTAT_BREAK)
172
173#define S3C2410_UMSTAT_CTS (1<<0)
174#define S3C2410_UMSTAT_DeltaCTS (1<<2)
175
176#define S3C2443_DIVSLOT (0x2C)
177
178#ifndef __ASSEMBLY__
179
180/* struct s3c24xx_uart_clksrc
181 *
182 * this structure defines a named clock source that can be used for the
183 * uart, so that the best clock can be selected for the requested baud
184 * rate.
185 *
186 * min_baud and max_baud define the range of baud-rates this clock is
187 * acceptable for, if they are both zero, it is assumed any baud rate that
188 * can be generated from this clock will be used.
189 *
190 * divisor gives the divisor from the clock to the one seen by the uart
191*/
192
193struct s3c24xx_uart_clksrc {
194 const char *name;
195 unsigned int divisor;
196 unsigned int min_baud;
197 unsigned int max_baud;
198};
199
200/* configuration structure for per-machine configurations for the
201 * serial port
202 *
203 * the pointer is setup by the machine specific initialisation from the
204 * arch/arm/mach-s3c2410/ directory.
205*/
206
207struct s3c2410_uartcfg {
208 unsigned char hwport; /* hardware port number */
209 unsigned char unused;
210 unsigned short flags;
211 upf_t uart_flags; /* default uart flags */
212
213 unsigned long ucon; /* value of ucon for port */
214 unsigned long ulcon; /* value of ulcon for port */
215 unsigned long ufcon; /* value of ufcon for port */
216
217 struct s3c24xx_uart_clksrc *clocks;
218 unsigned int clocks_size;
219};
220
221/* s3c24xx_uart_devs
222 *
223 * this is exported from the core as we cannot use driver_register(),
224 * or platform_add_device() before the console_initcall()
225*/
226
227extern struct platform_device *s3c24xx_uart_devs[3];
228
229#endif /* __ASSEMBLY__ */
230
231#endif /* __ASM_ARM_REGS_SERIAL_H */
232
diff --git a/include/asm-arm/plat-s3c/regs-timer.h b/include/asm-arm/plat-s3c/regs-timer.h
deleted file mode 100644
index cc0eedd53e38..000000000000
--- a/include/asm-arm/plat-s3c/regs-timer.h
+++ /dev/null
@@ -1,115 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-timer.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * S3C2410 Timer configuration
11*/
12
13
14#ifndef __ASM_ARCH_REGS_TIMER_H
15#define __ASM_ARCH_REGS_TIMER_H
16
17#define S3C_TIMERREG(x) (S3C_VA_TIMER + (x))
18#define S3C_TIMERREG2(tmr,reg) S3C_TIMERREG((reg)+0x0c+((tmr)*0x0c))
19
20#define S3C2410_TCFG0 S3C_TIMERREG(0x00)
21#define S3C2410_TCFG1 S3C_TIMERREG(0x04)
22#define S3C2410_TCON S3C_TIMERREG(0x08)
23
24#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
25#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
26#define S3C2410_TCFG_PRESCALER1_SHIFT (8)
27#define S3C2410_TCFG_DEADZONE_MASK (255<<16)
28#define S3C2410_TCFG_DEADZONE_SHIFT (16)
29
30#define S3C2410_TCFG1_MUX4_DIV2 (0<<16)
31#define S3C2410_TCFG1_MUX4_DIV4 (1<<16)
32#define S3C2410_TCFG1_MUX4_DIV8 (2<<16)
33#define S3C2410_TCFG1_MUX4_DIV16 (3<<16)
34#define S3C2410_TCFG1_MUX4_TCLK1 (4<<16)
35#define S3C2410_TCFG1_MUX4_MASK (15<<16)
36#define S3C2410_TCFG1_MUX4_SHIFT (16)
37
38#define S3C2410_TCFG1_MUX3_DIV2 (0<<12)
39#define S3C2410_TCFG1_MUX3_DIV4 (1<<12)
40#define S3C2410_TCFG1_MUX3_DIV8 (2<<12)
41#define S3C2410_TCFG1_MUX3_DIV16 (3<<12)
42#define S3C2410_TCFG1_MUX3_TCLK1 (4<<12)
43#define S3C2410_TCFG1_MUX3_MASK (15<<12)
44
45
46#define S3C2410_TCFG1_MUX2_DIV2 (0<<8)
47#define S3C2410_TCFG1_MUX2_DIV4 (1<<8)
48#define S3C2410_TCFG1_MUX2_DIV8 (2<<8)
49#define S3C2410_TCFG1_MUX2_DIV16 (3<<8)
50#define S3C2410_TCFG1_MUX2_TCLK1 (4<<8)
51#define S3C2410_TCFG1_MUX2_MASK (15<<8)
52
53
54#define S3C2410_TCFG1_MUX1_DIV2 (0<<4)
55#define S3C2410_TCFG1_MUX1_DIV4 (1<<4)
56#define S3C2410_TCFG1_MUX1_DIV8 (2<<4)
57#define S3C2410_TCFG1_MUX1_DIV16 (3<<4)
58#define S3C2410_TCFG1_MUX1_TCLK0 (4<<4)
59#define S3C2410_TCFG1_MUX1_MASK (15<<4)
60
61#define S3C2410_TCFG1_MUX0_DIV2 (0<<0)
62#define S3C2410_TCFG1_MUX0_DIV4 (1<<0)
63#define S3C2410_TCFG1_MUX0_DIV8 (2<<0)
64#define S3C2410_TCFG1_MUX0_DIV16 (3<<0)
65#define S3C2410_TCFG1_MUX0_TCLK0 (4<<0)
66#define S3C2410_TCFG1_MUX0_MASK (15<<0)
67
68#define S3C2410_TCFG1_MUX_DIV2 (0<<0)
69#define S3C2410_TCFG1_MUX_DIV4 (1<<0)
70#define S3C2410_TCFG1_MUX_DIV8 (2<<0)
71#define S3C2410_TCFG1_MUX_DIV16 (3<<0)
72#define S3C2410_TCFG1_MUX_TCLK (4<<0)
73#define S3C2410_TCFG1_MUX_MASK (15<<0)
74
75#define S3C2410_TCFG1_SHIFT(x) ((x) * 4)
76
77/* for each timer, we have an count buffer, an compare buffer and
78 * an observation buffer
79*/
80
81/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */
82
83#define S3C2410_TCNTB(tmr) S3C_TIMERREG2(tmr, 0x00)
84#define S3C2410_TCMPB(tmr) S3C_TIMERREG2(tmr, 0x04)
85#define S3C2410_TCNTO(tmr) S3C_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
86
87#define S3C2410_TCON_T4RELOAD (1<<22)
88#define S3C2410_TCON_T4MANUALUPD (1<<21)
89#define S3C2410_TCON_T4START (1<<20)
90
91#define S3C2410_TCON_T3RELOAD (1<<19)
92#define S3C2410_TCON_T3INVERT (1<<18)
93#define S3C2410_TCON_T3MANUALUPD (1<<17)
94#define S3C2410_TCON_T3START (1<<16)
95
96#define S3C2410_TCON_T2RELOAD (1<<15)
97#define S3C2410_TCON_T2INVERT (1<<14)
98#define S3C2410_TCON_T2MANUALUPD (1<<13)
99#define S3C2410_TCON_T2START (1<<12)
100
101#define S3C2410_TCON_T1RELOAD (1<<11)
102#define S3C2410_TCON_T1INVERT (1<<10)
103#define S3C2410_TCON_T1MANUALUPD (1<<9)
104#define S3C2410_TCON_T1START (1<<8)
105
106#define S3C2410_TCON_T0DEADZONE (1<<4)
107#define S3C2410_TCON_T0RELOAD (1<<3)
108#define S3C2410_TCON_T0INVERT (1<<2)
109#define S3C2410_TCON_T0MANUALUPD (1<<1)
110#define S3C2410_TCON_T0START (1<<0)
111
112#endif /* __ASM_ARCH_REGS_TIMER_H */
113
114
115
diff --git a/include/asm-arm/plat-s3c/uncompress.h b/include/asm-arm/plat-s3c/uncompress.h
deleted file mode 100644
index 19b9eda39485..000000000000
--- a/include/asm-arm/plat-s3c/uncompress.h
+++ /dev/null
@@ -1,155 +0,0 @@
1/* linux/include/asm-arm/plat-s3c/uncompress.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - uncompress code
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_PLAT_UNCOMPRESS_H
15#define __ASM_PLAT_UNCOMPRESS_H
16
17typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
18
19/* uart setup */
20
21static unsigned int fifo_mask;
22static unsigned int fifo_max;
23
24/* forward declerations */
25
26static void arch_detect_cpu(void);
27
28/* defines for UART registers */
29
30#include <asm/plat-s3c/regs-serial.h>
31#include <asm/plat-s3c/regs-watchdog.h>
32
33/* working in physical space... */
34#undef S3C2410_WDOGREG
35#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
36
37/* how many bytes we allow into the FIFO at a time in FIFO mode */
38#define FIFO_MAX (14)
39
40#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C_LOWLEVEL_UART_PORT)
41
42static __inline__ void
43uart_wr(unsigned int reg, unsigned int val)
44{
45 volatile unsigned int *ptr;
46
47 ptr = (volatile unsigned int *)(reg + uart_base);
48 *ptr = val;
49}
50
51static __inline__ unsigned int
52uart_rd(unsigned int reg)
53{
54 volatile unsigned int *ptr;
55
56 ptr = (volatile unsigned int *)(reg + uart_base);
57 return *ptr;
58}
59
60/* we can deal with the case the UARTs are being run
61 * in FIFO mode, so that we don't hold up our execution
62 * waiting for tx to happen...
63*/
64
65static void putc(int ch)
66{
67 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
68 int level;
69
70 while (1) {
71 level = uart_rd(S3C2410_UFSTAT);
72 level &= fifo_mask;
73
74 if (level < fifo_max)
75 break;
76 }
77
78 } else {
79 /* not using fifos */
80
81 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
82 barrier();
83 }
84
85 /* write byte to transmission register */
86 uart_wr(S3C2410_UTXH, ch);
87}
88
89static inline void flush(void)
90{
91}
92
93#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
94
95/* CONFIG_S3C_BOOT_WATCHDOG
96 *
97 * Simple boot-time watchdog setup, to reboot the system if there is
98 * any problem with the boot process
99*/
100
101#ifdef CONFIG_S3C_BOOT_WATCHDOG
102
103#define WDOG_COUNT (0xff00)
104
105static inline void arch_decomp_wdog(void)
106{
107 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
108}
109
110static void arch_decomp_wdog_start(void)
111{
112 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
113 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
114 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
115}
116
117#else
118#define arch_decomp_wdog_start()
119#define arch_decomp_wdog()
120#endif
121
122#ifdef CONFIG_S3C_BOOT_ERROR_RESET
123
124static void arch_decomp_error(const char *x)
125{
126 putstr("\n\n");
127 putstr(x);
128 putstr("\n\n -- System resetting\n");
129
130 __raw_writel(0x4000, S3C2410_WTDAT);
131 __raw_writel(0x4000, S3C2410_WTCNT);
132 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
133
134 while(1);
135}
136
137#define arch_error arch_decomp_error
138#endif
139
140static void error(char *err);
141
142static void
143arch_decomp_setup(void)
144{
145 /* we may need to setup the uart(s) here if we are not running
146 * on an BAST... the BAST will have left the uarts configured
147 * after calling linux.
148 */
149
150 arch_detect_cpu();
151 arch_decomp_wdog_start();
152}
153
154
155#endif /* __ASM_PLAT_UNCOMPRESS_H */
diff --git a/include/asm-arm/plat-s3c24xx/clock.h b/include/asm-arm/plat-s3c24xx/clock.h
deleted file mode 100644
index 235b753cd877..000000000000
--- a/include/asm-arm/plat-s3c24xx/clock.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/clock.h
2 * linux/arch/arm/mach-s3c2410/clock.h
3 *
4 * Copyright (c) 2004-2005 Simtec Electronics
5 * http://www.simtec.co.uk/products/SWLINUX/
6 * Written by Ben Dooks, <ben@simtec.co.uk>
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
13struct clk {
14 struct list_head list;
15 struct module *owner;
16 struct clk *parent;
17 const char *name;
18 int id;
19 int usage;
20 unsigned long rate;
21 unsigned long ctrlbit;
22
23 int (*enable)(struct clk *, int enable);
24 int (*set_rate)(struct clk *c, unsigned long rate);
25 unsigned long (*get_rate)(struct clk *c);
26 unsigned long (*round_rate)(struct clk *c, unsigned long rate);
27 int (*set_parent)(struct clk *c, struct clk *parent);
28};
29
30/* other clocks which may be registered by board support */
31
32extern struct clk s3c24xx_dclk0;
33extern struct clk s3c24xx_dclk1;
34extern struct clk s3c24xx_clkout0;
35extern struct clk s3c24xx_clkout1;
36extern struct clk s3c24xx_uclk;
37
38extern struct clk clk_usb_bus;
39
40/* core clock support */
41
42extern struct clk clk_f;
43extern struct clk clk_h;
44extern struct clk clk_p;
45extern struct clk clk_mpll;
46extern struct clk clk_upll;
47extern struct clk clk_xtal;
48
49/* exports for arch/arm/mach-s3c2410
50 *
51 * Please DO NOT use these outside of arch/arm/mach-s3c2410
52*/
53
54extern struct mutex clocks_mutex;
55
56extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
57
58extern int s3c24xx_register_clock(struct clk *clk);
59extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
60
61extern int s3c24xx_setup_clocks(unsigned long xtal,
62 unsigned long fclk,
63 unsigned long hclk,
64 unsigned long pclk);
diff --git a/include/asm-arm/plat-s3c24xx/common-smdk.h b/include/asm-arm/plat-s3c24xx/common-smdk.h
deleted file mode 100644
index 58d9094c935c..000000000000
--- a/include/asm-arm/plat-s3c24xx/common-smdk.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/common-smdk.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Common code for SMDK2410 and SMDK2440 boards
7 *
8 * http://www.fluff.org/ben/smdk2440/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15extern void smdk_machine_init(void);
diff --git a/include/asm-arm/plat-s3c24xx/cpu.h b/include/asm-arm/plat-s3c24xx/cpu.h
deleted file mode 100644
index 23e420e8bd5b..000000000000
--- a/include/asm-arm/plat-s3c24xx/cpu.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/cpu.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C24XX CPU support
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/* todo - fix when rmk changes iodescs to use `void __iomem *` */
14
15#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
16
17#ifndef MHZ
18#define MHZ (1000*1000)
19#endif
20
21#define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000)
22
23/* forward declaration */
24struct s3c24xx_uart_resources;
25struct platform_device;
26struct s3c2410_uartcfg;
27struct map_desc;
28
29/* core initialisation functions */
30
31extern void s3c24xx_init_irq(void);
32
33extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
34
35extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
36
37extern void s3c24xx_init_clocks(int xtal);
38
39extern void s3c24xx_init_uartdevs(char *name,
40 struct s3c24xx_uart_resources *res,
41 struct s3c2410_uartcfg *cfg, int no);
42
43/* timer for 2410/2440 */
44
45struct sys_timer;
46extern struct sys_timer s3c24xx_timer;
47
48/* system device classes */
49
50extern struct sysdev_class s3c2410_sysclass;
51extern struct sysdev_class s3c2412_sysclass;
52extern struct sysdev_class s3c2440_sysclass;
53extern struct sysdev_class s3c2442_sysclass;
54extern struct sysdev_class s3c2443_sysclass;
diff --git a/include/asm-arm/plat-s3c24xx/devs.h b/include/asm-arm/plat-s3c24xx/devs.h
deleted file mode 100644
index badaac9d64a8..000000000000
--- a/include/asm-arm/plat-s3c24xx/devs.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/devs.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2410 standard platform devices
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#include <linux/platform_device.h>
13
14struct s3c24xx_uart_resources {
15 struct resource *resources;
16 unsigned long nr_resources;
17};
18
19extern struct s3c24xx_uart_resources s3c2410_uart_resources[];
20
21extern struct platform_device *s3c24xx_uart_devs[];
22extern struct platform_device *s3c24xx_uart_src[];
23
24extern struct platform_device s3c_device_timer[];
25
26extern struct platform_device s3c_device_usb;
27extern struct platform_device s3c_device_lcd;
28extern struct platform_device s3c_device_wdt;
29extern struct platform_device s3c_device_i2c;
30extern struct platform_device s3c_device_iis;
31extern struct platform_device s3c_device_rtc;
32extern struct platform_device s3c_device_adc;
33extern struct platform_device s3c_device_sdi;
34extern struct platform_device s3c_device_hsmmc;
35
36extern struct platform_device s3c_device_spi0;
37extern struct platform_device s3c_device_spi1;
38
39extern struct platform_device s3c_device_nand;
40
41extern struct platform_device s3c_device_usbgadget;
42
43/* s3c2440 specific devices */
44
45#ifdef CONFIG_CPU_S3C2440
46
47extern struct platform_device s3c_device_camif;
48
49#endif
diff --git a/include/asm-arm/plat-s3c24xx/dma.h b/include/asm-arm/plat-s3c24xx/dma.h
deleted file mode 100644
index c78efe316fc8..000000000000
--- a/include/asm-arm/plat-s3c24xx/dma.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/dma.h
2 *
3 * Copyright (C) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C24XX DMA support
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
13extern struct sysdev_class dma_sysclass;
14extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
15
16#define DMA_CH_VALID (1<<31)
17#define DMA_CH_NEVER (1<<30)
18
19struct s3c24xx_dma_addr {
20 unsigned long from;
21 unsigned long to;
22};
23
24/* struct s3c24xx_dma_map
25 *
26 * this holds the mapping information for the channel selected
27 * to be connected to the specified device
28*/
29
30struct s3c24xx_dma_map {
31 const char *name;
32 struct s3c24xx_dma_addr hw_addr;
33
34 unsigned long channels[S3C2410_DMA_CHANNELS];
35 unsigned long channels_rx[S3C2410_DMA_CHANNELS];
36};
37
38struct s3c24xx_dma_selection {
39 struct s3c24xx_dma_map *map;
40 unsigned long map_size;
41 unsigned long dcon_mask;
42
43 void (*select)(struct s3c2410_dma_chan *chan,
44 struct s3c24xx_dma_map *map);
45
46 void (*direction)(struct s3c2410_dma_chan *chan,
47 struct s3c24xx_dma_map *map,
48 enum s3c2410_dmasrc dir);
49};
50
51extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel);
52
53/* struct s3c24xx_dma_order_ch
54 *
55 * channel map for one of the `enum dma_ch` dma channels. the list
56 * entry contains a set of low-level channel numbers, orred with
57 * DMA_CH_VALID, which are checked in the order in the array.
58*/
59
60struct s3c24xx_dma_order_ch {
61 unsigned int list[S3C2410_DMA_CHANNELS]; /* list of channels */
62 unsigned int flags; /* flags */
63};
64
65/* struct s3c24xx_dma_order
66 *
67 * information provided by either the core or the board to give the
68 * dma system a hint on how to allocate channels
69*/
70
71struct s3c24xx_dma_order {
72 struct s3c24xx_dma_order_ch channels[DMACH_MAX];
73};
74
75extern int s3c24xx_dma_order_set(struct s3c24xx_dma_order *map);
76
77/* DMA init code, called from the cpu support code */
78
79extern int s3c2410_dma_init(void);
80
81extern int s3c24xx_dma_init(unsigned int channels, unsigned int irq,
82 unsigned int stride);
diff --git a/include/asm-arm/plat-s3c24xx/irq.h b/include/asm-arm/plat-s3c24xx/irq.h
deleted file mode 100644
index 45746a995343..000000000000
--- a/include/asm-arm/plat-s3c24xx/irq.h
+++ /dev/null
@@ -1,109 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/irq.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C24XX CPU IRQ support
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#define irqdbf(x...)
14#define irqdbf2(x...)
15
16#define EXTINT_OFF (IRQ_EINT4 - 4)
17
18/* these are exported for arch/arm/mach-* usage */
19extern struct irq_chip s3c_irq_level_chip;
20extern struct irq_chip s3c_irq_chip;
21
22static inline void
23s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
24 int subcheck)
25{
26 unsigned long mask;
27 unsigned long submask;
28
29 submask = __raw_readl(S3C2410_INTSUBMSK);
30 mask = __raw_readl(S3C2410_INTMSK);
31
32 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
33
34 /* check to see if we need to mask the parent IRQ */
35
36 if ((submask & subcheck) == subcheck) {
37 __raw_writel(mask | parentbit, S3C2410_INTMSK);
38 }
39
40 /* write back masks */
41 __raw_writel(submask, S3C2410_INTSUBMSK);
42
43}
44
45static inline void
46s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
47{
48 unsigned long mask;
49 unsigned long submask;
50
51 submask = __raw_readl(S3C2410_INTSUBMSK);
52 mask = __raw_readl(S3C2410_INTMSK);
53
54 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
55 mask &= ~parentbit;
56
57 /* write back masks */
58 __raw_writel(submask, S3C2410_INTSUBMSK);
59 __raw_writel(mask, S3C2410_INTMSK);
60}
61
62
63static inline void
64s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
65{
66 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
67
68 s3c_irqsub_mask(irqno, parentmask, group);
69
70 __raw_writel(bit, S3C2410_SUBSRCPND);
71
72 /* only ack parent if we've got all the irqs (seems we must
73 * ack, all and hope that the irq system retriggers ok when
74 * the interrupt goes off again)
75 */
76
77 if (1) {
78 __raw_writel(parentmask, S3C2410_SRCPND);
79 __raw_writel(parentmask, S3C2410_INTPND);
80 }
81}
82
83static inline void
84s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
85{
86 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
87
88 __raw_writel(bit, S3C2410_SUBSRCPND);
89
90 /* only ack parent if we've got all the irqs (seems we must
91 * ack, all and hope that the irq system retriggers ok when
92 * the interrupt goes off again)
93 */
94
95 if (1) {
96 __raw_writel(parentmask, S3C2410_SRCPND);
97 __raw_writel(parentmask, S3C2410_INTPND);
98 }
99}
100
101/* exported for use in arch/arm/mach-s3c2410 */
102
103#ifdef CONFIG_PM
104extern int s3c_irq_wake(unsigned int irqno, unsigned int state);
105#else
106#define s3c_irq_wake NULL
107#endif
108
109extern int s3c_irqext_type(unsigned int irq, unsigned int type);
diff --git a/include/asm-arm/plat-s3c24xx/pm.h b/include/asm-arm/plat-s3c24xx/pm.h
deleted file mode 100644
index cc623667e48a..000000000000
--- a/include/asm-arm/plat-s3c24xx/pm.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/pm.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Written by Ben Dooks, <ben@simtec.co.uk>
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 version 2 as
8 * published by the Free Software Foundation.
9*/
10
11/* s3c2410_pm_init
12 *
13 * called from board at initialisation time to setup the power
14 * management
15*/
16
17#ifdef CONFIG_PM
18
19extern __init int s3c2410_pm_init(void);
20
21#else
22
23static inline int s3c2410_pm_init(void)
24{
25 return 0;
26}
27#endif
28
29/* configuration for the IRQ mask over sleep */
30extern unsigned long s3c_irqwake_intmask;
31extern unsigned long s3c_irqwake_eintmask;
32
33/* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
34extern unsigned long s3c_irqwake_intallow;
35extern unsigned long s3c_irqwake_eintallow;
36
37/* per-cpu sleep functions */
38
39extern void (*pm_cpu_prep)(void);
40extern void (*pm_cpu_sleep)(void);
41
42/* Flags for PM Control */
43
44extern unsigned long s3c_pm_flags;
45
46/* from sleep.S */
47
48extern int s3c2410_cpu_save(unsigned long *saveblk);
49extern void s3c2410_cpu_suspend(void);
50extern void s3c2410_cpu_resume(void);
51
52extern unsigned long s3c2410_sleep_save_phys;
53
54/* sleep save info */
55
56struct sleep_save {
57 void __iomem *reg;
58 unsigned long val;
59};
60
61#define SAVE_ITEM(x) \
62 { .reg = (x) }
63
64extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count);
65extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count);
66
67#ifdef CONFIG_PM
68extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
69extern int s3c24xx_irq_resume(struct sys_device *dev);
70#else
71#define s3c24xx_irq_suspend NULL
72#define s3c24xx_irq_resume NULL
73#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2400.h b/include/asm-arm/plat-s3c24xx/s3c2400.h
deleted file mode 100644
index 3a5a16821af8..000000000000
--- a/include/asm-arm/plat-s3c24xx/s3c2400.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2400.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C2400 cpu support
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 * Modifications:
13 * 09-Fev-2006 LCVR First version, based on s3c2410.h
14*/
15
16#ifdef CONFIG_CPU_S3C2400
17
18extern int s3c2400_init(void);
19
20extern void s3c2400_map_io(struct map_desc *mach_desc, int size);
21
22extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no);
23
24extern void s3c2400_init_clocks(int xtal);
25
26#else
27#define s3c2400_init_clocks NULL
28#define s3c2400_init_uarts NULL
29#define s3c2400_map_io NULL
30#define s3c2400_init NULL
31#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2410.h b/include/asm-arm/plat-s3c24xx/s3c2410.h
deleted file mode 100644
index 3cd1ec677b3f..000000000000
--- a/include/asm-arm/plat-s3c24xx/s3c2410.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2410.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2410 machine directory
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#ifdef CONFIG_CPU_S3C2410
15
16extern int s3c2410_init(void);
17
18extern void s3c2410_map_io(struct map_desc *mach_desc, int size);
19
20extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no);
21
22extern void s3c2410_init_clocks(int xtal);
23
24#else
25#define s3c2410_init_clocks NULL
26#define s3c2410_init_uarts NULL
27#define s3c2410_map_io NULL
28#define s3c2410_init NULL
29#endif
30
31extern int s3c2410_baseclk_add(void);
diff --git a/include/asm-arm/plat-s3c24xx/s3c2412.h b/include/asm-arm/plat-s3c24xx/s3c2412.h
deleted file mode 100644
index 3ec97685e781..000000000000
--- a/include/asm-arm/plat-s3c24xx/s3c2412.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2412.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2412 cpu support
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#ifdef CONFIG_CPU_S3C2412
14
15extern int s3c2412_init(void);
16
17extern void s3c2412_map_io(struct map_desc *mach_desc, int size);
18
19extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no);
20
21extern void s3c2412_init_clocks(int xtal);
22
23extern int s3c2412_baseclk_add(void);
24#else
25#define s3c2412_init_clocks NULL
26#define s3c2412_init_uarts NULL
27#define s3c2412_map_io NULL
28#define s3c2412_init NULL
29#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2440.h b/include/asm-arm/plat-s3c24xx/s3c2440.h
deleted file mode 100644
index 107853bf9481..000000000000
--- a/include/asm-arm/plat-s3c24xx/s3c2440.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2440.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2440 cpu support
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#ifdef CONFIG_CPU_S3C2440
14extern int s3c2440_init(void);
15#else
16#define s3c2440_init NULL
17#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2442.h b/include/asm-arm/plat-s3c24xx/s3c2442.h
deleted file mode 100644
index 451a23a2092a..000000000000
--- a/include/asm-arm/plat-s3c24xx/s3c2442.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2442.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2442 cpu support
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#ifdef CONFIG_CPU_S3C2442
14extern int s3c2442_init(void);
15#else
16#define s3c2442_init NULL
17#endif
diff --git a/include/asm-arm/plat-s3c24xx/s3c2443.h b/include/asm-arm/plat-s3c24xx/s3c2443.h
deleted file mode 100644
index 11d83b5c84e6..000000000000
--- a/include/asm-arm/plat-s3c24xx/s3c2443.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2443.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2443 cpu support
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#ifdef CONFIG_CPU_S3C2443
14
15struct s3c2410_uartcfg;
16
17extern int s3c2443_init(void);
18
19extern void s3c2443_map_io(struct map_desc *mach_desc, int size);
20
21extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no);
22
23extern void s3c2443_init_clocks(int xtal);
24
25extern int s3c2443_baseclk_add(void);
26
27#else
28#define s3c2443_init_clocks NULL
29#define s3c2443_init_uarts NULL
30#define s3c2443_map_io NULL
31#define s3c2443_init NULL
32#endif
diff --git a/include/asm-blackfin/.gitignore b/include/asm-blackfin/.gitignore
deleted file mode 100644
index 7858564a4466..000000000000
--- a/include/asm-blackfin/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1+mach
diff --git a/include/asm-blackfin/Kbuild b/include/asm-blackfin/Kbuild
deleted file mode 100644
index 606ecfdcc962..000000000000
--- a/include/asm-blackfin/Kbuild
+++ /dev/null
@@ -1,3 +0,0 @@
1include include/asm-generic/Kbuild.asm
2
3unifdef-y += fixed_code.h
diff --git a/include/asm-blackfin/a.out.h b/include/asm-blackfin/a.out.h
deleted file mode 100644
index 6c3d652ebd33..000000000000
--- a/include/asm-blackfin/a.out.h
+++ /dev/null
@@ -1,19 +0,0 @@
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#endif /* __BFIN_A_OUT_H__ */
diff --git a/include/asm-blackfin/atomic.h b/include/asm-blackfin/atomic.h
deleted file mode 100644
index 7cf508718605..000000000000
--- a/include/asm-blackfin/atomic.h
+++ /dev/null
@@ -1,144 +0,0 @@
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
deleted file mode 100644
index 215506cd87b7..000000000000
--- a/include/asm-blackfin/auxvec.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __ASMBFIN_AUXVEC_H
2#define __ASMBFIN_AUXVEC_H
3
4#endif
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h
deleted file mode 100644
index 7ba70de66f2b..000000000000
--- a/include/asm-blackfin/bfin-global.h
+++ /dev/null
@@ -1,117 +0,0 @@
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_4M)
41# define DMA_UNCACHED_REGION (4 * 1024 * 1024)
42#elif defined(CONFIG_DMA_UNCACHED_2M)
43# define DMA_UNCACHED_REGION (2 * 1024 * 1024)
44#elif defined(CONFIG_DMA_UNCACHED_1M)
45# define DMA_UNCACHED_REGION (1024 * 1024)
46#else
47# define DMA_UNCACHED_REGION (0)
48#endif
49
50extern unsigned long get_cclk(void);
51extern unsigned long get_sclk(void);
52extern unsigned long sclk_to_usecs(unsigned long sclk);
53extern unsigned long usecs_to_sclk(unsigned long usecs);
54
55extern void dump_bfin_process(struct pt_regs *regs);
56extern void dump_bfin_mem(struct pt_regs *regs);
57extern void dump_bfin_trace_buffer(void);
58
59/* init functions only */
60extern int init_arch_irq(void);
61extern void bfin_icache_init(void);
62extern void bfin_dcache_init(void);
63extern void init_exception_vectors(void);
64extern void program_IAR(void);
65
66extern void bfin_reset(void);
67extern asmlinkage void lower_to_irq14(void);
68extern asmlinkage void bfin_return_from_exception(void);
69extern asmlinkage void evt14_softirq(void);
70extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
71extern int bfin_internal_set_wake(unsigned int irq, unsigned int state);
72
73extern void *l1_data_A_sram_alloc(size_t);
74extern void *l1_data_B_sram_alloc(size_t);
75extern void *l1_inst_sram_alloc(size_t);
76extern void *l1_data_sram_alloc(size_t);
77extern void *l1_data_sram_zalloc(size_t);
78extern void *l2_sram_alloc(size_t);
79extern void *l2_sram_zalloc(size_t);
80extern int l1_data_A_sram_free(const void*);
81extern int l1_data_B_sram_free(const void*);
82extern int l1_inst_sram_free(const void*);
83extern int l1_data_sram_free(const void*);
84extern int l2_sram_free(const void *);
85extern int sram_free(const void*);
86
87#define L1_INST_SRAM 0x00000001
88#define L1_DATA_A_SRAM 0x00000002
89#define L1_DATA_B_SRAM 0x00000004
90#define L1_DATA_SRAM 0x00000006
91#define L2_SRAM 0x00000008
92extern void *sram_alloc_with_lsl(size_t, unsigned long);
93extern int sram_free_with_lsl(const void*);
94
95extern const char bfin_board_name[];
96
97extern unsigned long bfin_sic_iwr[];
98extern unsigned vr_wakeup;
99extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
100extern unsigned long _ramstart, _ramend, _rambase;
101extern unsigned long memory_start, memory_end, physical_mem_end;
102extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
103 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[],
104 _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
105 _ebss_l2[], _l2_lma_start[];
106
107/* only used when CONFIG_MTD_UCLINUX */
108extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
109
110#ifdef CONFIG_BFIN_ICACHE_LOCK
111extern void cache_grab_lock(int way);
112extern void cache_lock(int way);
113#endif
114
115#endif
116
117#endif /* _BLACKFIN_H_ */
diff --git a/include/asm-blackfin/bfin5xx_spi.h b/include/asm-blackfin/bfin5xx_spi.h
deleted file mode 100644
index 9fa19158e38d..000000000000
--- a/include/asm-blackfin/bfin5xx_spi.h
+++ /dev/null
@@ -1,137 +0,0 @@
1/************************************************************
2
3* Copyright (C) 2006-2008, 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 SPI_READ 0
25#define SPI_WRITE 1
26
27#define SPI_CTRL_OFF 0x0
28#define SPI_FLAG_OFF 0x4
29#define SPI_STAT_OFF 0x8
30#define SPI_TXBUFF_OFF 0xc
31#define SPI_RXBUFF_OFF 0x10
32#define SPI_BAUD_OFF 0x14
33#define SPI_SHAW_OFF 0x18
34
35
36#define BIT_CTL_ENABLE 0x4000
37#define BIT_CTL_OPENDRAIN 0x2000
38#define BIT_CTL_MASTER 0x1000
39#define BIT_CTL_POLAR 0x0800
40#define BIT_CTL_PHASE 0x0400
41#define BIT_CTL_BITORDER 0x0200
42#define BIT_CTL_WORDSIZE 0x0100
43#define BIT_CTL_MISOENABLE 0x0020
44#define BIT_CTL_RXMOD 0x0000
45#define BIT_CTL_TXMOD 0x0001
46#define BIT_CTL_TIMOD_DMA_TX 0x0003
47#define BIT_CTL_TIMOD_DMA_RX 0x0002
48#define BIT_CTL_SENDOPT 0x0004
49#define BIT_CTL_TIMOD 0x0003
50
51#define BIT_STAT_SPIF 0x0001
52#define BIT_STAT_MODF 0x0002
53#define BIT_STAT_TXE 0x0004
54#define BIT_STAT_TXS 0x0008
55#define BIT_STAT_RBSY 0x0010
56#define BIT_STAT_RXS 0x0020
57#define BIT_STAT_TXCOL 0x0040
58#define BIT_STAT_CLR 0xFFFF
59
60#define BIT_STU_SENDOVER 0x0001
61#define BIT_STU_RECVFULL 0x0020
62
63#define CFG_SPI_ENABLE 1
64#define CFG_SPI_DISABLE 0
65
66#define CFG_SPI_OUTENABLE 1
67#define CFG_SPI_OUTDISABLE 0
68
69#define CFG_SPI_ACTLOW 1
70#define CFG_SPI_ACTHIGH 0
71
72#define CFG_SPI_PHASESTART 1
73#define CFG_SPI_PHASEMID 0
74
75#define CFG_SPI_MASTER 1
76#define CFG_SPI_SLAVE 0
77
78#define CFG_SPI_SENELAST 0
79#define CFG_SPI_SENDZERO 1
80
81#define CFG_SPI_RCVFLUSH 1
82#define CFG_SPI_RCVDISCARD 0
83
84#define CFG_SPI_LSBFIRST 1
85#define CFG_SPI_MSBFIRST 0
86
87#define CFG_SPI_WORDSIZE16 1
88#define CFG_SPI_WORDSIZE8 0
89
90#define CFG_SPI_MISOENABLE 1
91#define CFG_SPI_MISODISABLE 0
92
93#define CFG_SPI_READ 0x00
94#define CFG_SPI_WRITE 0x01
95#define CFG_SPI_DMAREAD 0x02
96#define CFG_SPI_DMAWRITE 0x03
97
98#define CFG_SPI_CSCLEARALL 0
99#define CFG_SPI_CHIPSEL1 1
100#define CFG_SPI_CHIPSEL2 2
101#define CFG_SPI_CHIPSEL3 3
102#define CFG_SPI_CHIPSEL4 4
103#define CFG_SPI_CHIPSEL5 5
104#define CFG_SPI_CHIPSEL6 6
105#define CFG_SPI_CHIPSEL7 7
106
107#define CFG_SPI_CS1VALUE 1
108#define CFG_SPI_CS2VALUE 2
109#define CFG_SPI_CS3VALUE 3
110#define CFG_SPI_CS4VALUE 4
111#define CFG_SPI_CS5VALUE 5
112#define CFG_SPI_CS6VALUE 6
113#define CFG_SPI_CS7VALUE 7
114
115#define CMD_SPI_SET_BAUDRATE 2
116#define CMD_SPI_GET_SYSTEMCLOCK 25
117#define CMD_SPI_SET_WRITECONTINUOUS 26
118
119/* device.platform_data for SSP controller devices */
120struct bfin5xx_spi_master {
121 u16 num_chipselect;
122 u8 enable_dma;
123 u16 pin_req[4];
124};
125
126/* spi_board_info.controller_data for SPI slave devices,
127 * copied to spi_device.platform_data ... mostly for dma tuning
128 */
129struct bfin5xx_spi_chip {
130 u16 ctl_reg;
131 u8 enable_dma;
132 u8 bits_per_word;
133 u8 cs_change_per_word;
134 u16 cs_chg_udelay; /* Some devices require 16-bit delays */
135};
136
137#endif /* _SPI_CHANNEL_H_ */
diff --git a/include/asm-blackfin/bfin_simple_timer.h b/include/asm-blackfin/bfin_simple_timer.h
deleted file mode 100644
index fccbb595464a..000000000000
--- a/include/asm-blackfin/bfin_simple_timer.h
+++ /dev/null
@@ -1,13 +0,0 @@
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
deleted file mode 100644
index c76ed8def302..000000000000
--- a/include/asm-blackfin/bfin_sport.h
+++ /dev/null
@@ -1,175 +0,0 @@
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
deleted file mode 100644
index b39a175c79c1..000000000000
--- a/include/asm-blackfin/bitops.h
+++ /dev/null
@@ -1,218 +0,0 @@
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#ifndef _LINUX_BITOPS_H
15#error only <linux/bitops.h> can be included directly
16#endif
17
18#include <asm-generic/bitops/ffs.h>
19#include <asm-generic/bitops/__ffs.h>
20#include <asm-generic/bitops/sched.h>
21#include <asm-generic/bitops/ffz.h>
22
23static __inline__ void set_bit(int nr, volatile unsigned long *addr)
24{
25 int *a = (int *)addr;
26 int mask;
27 unsigned long flags;
28
29 a += nr >> 5;
30 mask = 1 << (nr & 0x1f);
31 local_irq_save(flags);
32 *a |= mask;
33 local_irq_restore(flags);
34}
35
36static __inline__ void __set_bit(int nr, volatile unsigned long *addr)
37{
38 int *a = (int *)addr;
39 int mask;
40
41 a += nr >> 5;
42 mask = 1 << (nr & 0x1f);
43 *a |= mask;
44}
45
46/*
47 * clear_bit() doesn't provide any barrier for the compiler.
48 */
49#define smp_mb__before_clear_bit() barrier()
50#define smp_mb__after_clear_bit() barrier()
51
52static __inline__ void clear_bit(int nr, volatile unsigned long *addr)
53{
54 int *a = (int *)addr;
55 int mask;
56 unsigned long flags;
57 a += nr >> 5;
58 mask = 1 << (nr & 0x1f);
59 local_irq_save(flags);
60 *a &= ~mask;
61 local_irq_restore(flags);
62}
63
64static __inline__ void __clear_bit(int nr, volatile unsigned long *addr)
65{
66 int *a = (int *)addr;
67 int mask;
68
69 a += nr >> 5;
70 mask = 1 << (nr & 0x1f);
71 *a &= ~mask;
72}
73
74static __inline__ void change_bit(int nr, volatile unsigned long *addr)
75{
76 int mask, flags;
77 unsigned long *ADDR = (unsigned long *)addr;
78
79 ADDR += nr >> 5;
80 mask = 1 << (nr & 31);
81 local_irq_save(flags);
82 *ADDR ^= mask;
83 local_irq_restore(flags);
84}
85
86static __inline__ void __change_bit(int nr, volatile unsigned long *addr)
87{
88 int mask;
89 unsigned long *ADDR = (unsigned long *)addr;
90
91 ADDR += nr >> 5;
92 mask = 1 << (nr & 31);
93 *ADDR ^= mask;
94}
95
96static __inline__ int test_and_set_bit(int nr, void *addr)
97{
98 int mask, retval;
99 volatile unsigned int *a = (volatile unsigned int *)addr;
100 unsigned long flags;
101
102 a += nr >> 5;
103 mask = 1 << (nr & 0x1f);
104 local_irq_save(flags);
105 retval = (mask & *a) != 0;
106 *a |= mask;
107 local_irq_restore(flags);
108
109 return retval;
110}
111
112static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr)
113{
114 int mask, retval;
115 volatile unsigned int *a = (volatile unsigned int *)addr;
116
117 a += nr >> 5;
118 mask = 1 << (nr & 0x1f);
119 retval = (mask & *a) != 0;
120 *a |= mask;
121 return retval;
122}
123
124static __inline__ int test_and_clear_bit(int nr, volatile unsigned long *addr)
125{
126 int mask, retval;
127 volatile unsigned int *a = (volatile unsigned int *)addr;
128 unsigned long flags;
129
130 a += nr >> 5;
131 mask = 1 << (nr & 0x1f);
132 local_irq_save(flags);
133 retval = (mask & *a) != 0;
134 *a &= ~mask;
135 local_irq_restore(flags);
136
137 return retval;
138}
139
140static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
141{
142 int mask, retval;
143 volatile unsigned int *a = (volatile unsigned int *)addr;
144
145 a += nr >> 5;
146 mask = 1 << (nr & 0x1f);
147 retval = (mask & *a) != 0;
148 *a &= ~mask;
149 return retval;
150}
151
152static __inline__ int test_and_change_bit(int nr, volatile unsigned long *addr)
153{
154 int mask, retval;
155 volatile unsigned int *a = (volatile unsigned int *)addr;
156 unsigned long flags;
157
158 a += nr >> 5;
159 mask = 1 << (nr & 0x1f);
160 local_irq_save(flags);
161 retval = (mask & *a) != 0;
162 *a ^= mask;
163 local_irq_restore(flags);
164 return retval;
165}
166
167static __inline__ int __test_and_change_bit(int nr,
168 volatile unsigned long *addr)
169{
170 int mask, retval;
171 volatile unsigned int *a = (volatile unsigned int *)addr;
172
173 a += nr >> 5;
174 mask = 1 << (nr & 0x1f);
175 retval = (mask & *a) != 0;
176 *a ^= mask;
177 return retval;
178}
179
180/*
181 * This routine doesn't need to be atomic.
182 */
183static __inline__ int __constant_test_bit(int nr, const void *addr)
184{
185 return ((1UL << (nr & 31)) &
186 (((const volatile unsigned int *)addr)[nr >> 5])) != 0;
187}
188
189static __inline__ int __test_bit(int nr, const void *addr)
190{
191 int *a = (int *)addr;
192 int mask;
193
194 a += nr >> 5;
195 mask = 1 << (nr & 0x1f);
196 return ((mask & *a) != 0);
197}
198
199#define test_bit(nr,addr) \
200(__builtin_constant_p(nr) ? \
201 __constant_test_bit((nr),(addr)) : \
202 __test_bit((nr),(addr)))
203
204#include <asm-generic/bitops/find.h>
205#include <asm-generic/bitops/hweight.h>
206#include <asm-generic/bitops/lock.h>
207
208#include <asm-generic/bitops/ext2-atomic.h>
209#include <asm-generic/bitops/ext2-non-atomic.h>
210
211#include <asm-generic/bitops/minix.h>
212
213#endif /* __KERNEL__ */
214
215#include <asm-generic/bitops/fls.h>
216#include <asm-generic/bitops/fls64.h>
217
218#endif /* _BLACKFIN_BITOPS_H */
diff --git a/include/asm-blackfin/blackfin.h b/include/asm-blackfin/blackfin.h
deleted file mode 100644
index 984b74f0a2ec..000000000000
--- a/include/asm-blackfin/blackfin.h
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * Common header file for blackfin family of processors.
3 *
4 */
5
6#ifndef _BLACKFIN_H_
7#define _BLACKFIN_H_
8
9#define LO(con32) ((con32) & 0xFFFF)
10#define lo(con32) ((con32) & 0xFFFF)
11#define HI(con32) (((con32) >> 16) & 0xFFFF)
12#define hi(con32) (((con32) >> 16) & 0xFFFF)
13
14#include <asm/mach/anomaly.h>
15
16#ifndef __ASSEMBLY__
17
18/* SSYNC implementation for C file */
19static inline void SSYNC(void)
20{
21 int _tmp;
22 if (ANOMALY_05000312)
23 __asm__ __volatile__(
24 "cli %0;"
25 "nop;"
26 "nop;"
27 "ssync;"
28 "sti %0;"
29 : "=d" (_tmp)
30 );
31 else if (ANOMALY_05000244)
32 __asm__ __volatile__(
33 "nop;"
34 "nop;"
35 "nop;"
36 "ssync;"
37 );
38 else
39 __asm__ __volatile__("ssync;");
40}
41
42/* CSYNC implementation for C file */
43static inline void CSYNC(void)
44{
45 int _tmp;
46 if (ANOMALY_05000312)
47 __asm__ __volatile__(
48 "cli %0;"
49 "nop;"
50 "nop;"
51 "csync;"
52 "sti %0;"
53 : "=d" (_tmp)
54 );
55 else if (ANOMALY_05000244)
56 __asm__ __volatile__(
57 "nop;"
58 "nop;"
59 "nop;"
60 "csync;"
61 );
62 else
63 __asm__ __volatile__("csync;");
64}
65
66#else /* __ASSEMBLY__ */
67
68/* SSYNC & CSYNC implementations for assembly files */
69
70#define ssync(x) SSYNC(x)
71#define csync(x) CSYNC(x)
72
73#if ANOMALY_05000312
74#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
75#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
76
77#elif ANOMALY_05000244
78#define SSYNC(scratch) nop; nop; nop; SSYNC;
79#define CSYNC(scratch) nop; nop; nop; CSYNC;
80
81#else
82#define SSYNC(scratch) SSYNC;
83#define CSYNC(scratch) CSYNC;
84
85#endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
86
87#endif /* __ASSEMBLY__ */
88
89#include <asm/mach/blackfin.h>
90#include <asm/bfin-global.h>
91
92#endif /* _BLACKFIN_H_ */
diff --git a/include/asm-blackfin/bug.h b/include/asm-blackfin/bug.h
deleted file mode 100644
index 6d3e11b1fc57..000000000000
--- a/include/asm-blackfin/bug.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _BLACKFIN_BUG_H
2#define _BLACKFIN_BUG_H
3
4#ifdef CONFIG_BUG
5#define HAVE_ARCH_BUG
6
7#define BUG() do { \
8 dump_bfin_trace_buffer(); \
9 printk(KERN_EMERG "BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
10 panic("BUG!"); \
11} while (0)
12
13#endif
14
15#include <asm-generic/bug.h>
16
17#endif
diff --git a/include/asm-blackfin/bugs.h b/include/asm-blackfin/bugs.h
deleted file mode 100644
index 9093c9c1fb81..000000000000
--- a/include/asm-blackfin/bugs.h
+++ /dev/null
@@ -1,16 +0,0 @@
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
deleted file mode 100644
index 6a673d42da18..000000000000
--- a/include/asm-blackfin/byteorder.h
+++ /dev/null
@@ -1,48 +0,0 @@
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
deleted file mode 100644
index 023d72133b5a..000000000000
--- a/include/asm-blackfin/cache.h
+++ /dev/null
@@ -1,29 +0,0 @@
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
deleted file mode 100644
index d81a77545a04..000000000000
--- a/include/asm-blackfin/cacheflush.h
+++ /dev/null
@@ -1,90 +0,0 @@
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_BFIN_DCACHE) && defined(CONFIG_BFIN_ICACHE)
52
53# if defined(CONFIG_BFIN_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_BFIN_ICACHE)
62 blackfin_icache_flush_range((start), (end));
63# endif
64# if defined(CONFIG_BFIN_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_BFIN_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_BFIN_DCACHE) && defined(CONFIG_BFIN_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_ICACHEFLUSH_H */
diff --git a/include/asm-blackfin/checksum.h b/include/asm-blackfin/checksum.h
deleted file mode 100644
index 6f6af2b8e9e0..000000000000
--- a/include/asm-blackfin/checksum.h
+++ /dev/null
@@ -1,100 +0,0 @@
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 */
18__wsum csum_partial(const void *buff, int len, __wsum 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
28__wsum csum_partial_copy(const void *src, void *dst,
29 int len, __wsum 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 __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
39 int len, __wsum sum, int *csum_err);
40
41#define csum_partial_copy_nocheck(src, dst, len, sum) \
42 csum_partial_copy((src), (dst), (len), (sum))
43
44__sum16 ip_fast_csum(unsigned char *iph, unsigned int ihl);
45
46/*
47 * Fold a partial checksum
48 */
49
50static inline __sum16 csum_fold(__wsum sum)
51{
52 while (sum >> 16)
53 sum = (sum & 0xffff) + (sum >> 16);
54 return ((~(sum << 16)) >> 16);
55}
56
57/*
58 * computes the checksum of the TCP/UDP pseudo-header
59 * returns a 16-bit checksum, already complemented
60 */
61
62static inline __wsum
63csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
64 unsigned short proto, __wsum sum)
65{
66
67 __asm__ ("%0 = %0 + %1;\n\t"
68 "CC = AC0;\n\t"
69 "if !CC jump 4;\n\t"
70 "%0 = %0 + %4;\n\t"
71 "%0 = %0 + %2;\n\t"
72 "CC = AC0;\n\t"
73 "if !CC jump 4;\n\t"
74 "%0 = %0 + %4;\n\t"
75 "%0 = %0 + %3;\n\t"
76 "CC = AC0;\n\t"
77 "if !CC jump 4;\n\t"
78 "%0 = %0 + %4;\n\t"
79 "NOP;\n\t"
80 : "=d" (sum)
81 : "d" (daddr), "d" (saddr), "d" ((ntohs(len)<<16)+proto*256), "d" (1), "0"(sum));
82
83 return (sum);
84}
85
86static inline __sum16
87csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
88 unsigned short proto, __wsum sum)
89{
90 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
91}
92
93/*
94 * this routine is used for miscellaneous IP-like checksums, mainly
95 * in icmp.c
96 */
97
98extern __sum16 ip_compute_csum(const void *buff, int len);
99
100#endif /* _BFIN_CHECKSUM_H */
diff --git a/include/asm-blackfin/cplb-mpu.h b/include/asm-blackfin/cplb-mpu.h
deleted file mode 100644
index 75c67b99d607..000000000000
--- a/include/asm-blackfin/cplb-mpu.h
+++ /dev/null
@@ -1,61 +0,0 @@
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#ifndef __ASM_BFIN_CPLB_MPU_H
30#define __ASM_BFIN_CPLB_MPU_H
31
32struct cplb_entry {
33 unsigned long data, addr;
34};
35
36struct mem_region {
37 unsigned long start, end;
38 unsigned long dcplb_data;
39 unsigned long icplb_data;
40};
41
42extern struct cplb_entry dcplb_tbl[MAX_CPLBS];
43extern struct cplb_entry icplb_tbl[MAX_CPLBS];
44extern int first_switched_icplb;
45extern int first_mask_dcplb;
46extern int first_switched_dcplb;
47
48extern int nr_dcplb_miss, nr_icplb_miss, nr_icplb_supv_miss, nr_dcplb_prot;
49extern int nr_cplb_flush;
50
51extern int page_mask_order;
52extern int page_mask_nelts;
53
54extern unsigned long *current_rwx_mask;
55
56extern void flush_switched_cplbs(void);
57extern void set_mask_dcplbs(unsigned long *);
58
59extern void __noreturn panic_cplb_error(int seqstat, struct pt_regs *);
60
61#endif /* __ASM_BFIN_CPLB_MPU_H */
diff --git a/include/asm-blackfin/cplb.h b/include/asm-blackfin/cplb.h
deleted file mode 100644
index 5b0da9a69b67..000000000000
--- a/include/asm-blackfin/cplb.h
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * File: include/asm-blackfin/cplb.h
3 * Based on: include/asm-blackfin/mach-bf537/bf537.h
4 * Author: Robin Getz <rgetz@blackfin.uclinux.org>
5 *
6 * Created: 2000
7 * Description: Common CPLB definitions for CPLB init
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#ifndef _CPLB_H
31#define _CPLB_H
32
33#include <asm/blackfin.h>
34#include <asm/mach/anomaly.h>
35
36#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
37#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
38#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
39#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
40
41/*Use the menuconfig cache policy here - CONFIG_BFIN_WT/CONFIG_BFIN_WB*/
42
43#if ANOMALY_05000158
44#define ANOMALY_05000158_WORKAROUND 0x200
45#else
46#define ANOMALY_05000158_WORKAROUND 0x0
47#endif
48
49#define CPLB_COMMON (CPLB_DIRTY | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
50
51#ifdef CONFIG_BFIN_WB /*Write Back Policy */
52#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_COMMON)
53#else /*Write Through */
54#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON)
55#endif
56
57#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON)
58#define L2_MEMORY (CPLB_COMMON)
59#define SDRAM_DNON_CHBL (CPLB_COMMON)
60#define SDRAM_EBIU (CPLB_COMMON)
61#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
62
63#define SIZE_1K 0x00000400 /* 1K */
64#define SIZE_4K 0x00001000 /* 4K */
65#define SIZE_1M 0x00100000 /* 1M */
66#define SIZE_4M 0x00400000 /* 4M */
67
68#ifdef CONFIG_MPU
69#define MAX_CPLBS 16
70#else
71#define MAX_CPLBS (16 * 2)
72#endif
73
74#define ASYNC_MEMORY_CPLB_COVERAGE ((ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \
75 ASYNC_BANK2_SIZE + ASYNC_BANK3_SIZE) / SIZE_4M)
76
77#define CPLB_ENABLE_ICACHE_P 0
78#define CPLB_ENABLE_DCACHE_P 1
79#define CPLB_ENABLE_DCACHE2_P 2
80#define CPLB_ENABLE_CPLBS_P 3 /* Deprecated! */
81#define CPLB_ENABLE_ICPLBS_P 4
82#define CPLB_ENABLE_DCPLBS_P 5
83
84#define CPLB_ENABLE_ICACHE (1<<CPLB_ENABLE_ICACHE_P)
85#define CPLB_ENABLE_DCACHE (1<<CPLB_ENABLE_DCACHE_P)
86#define CPLB_ENABLE_DCACHE2 (1<<CPLB_ENABLE_DCACHE2_P)
87#define CPLB_ENABLE_CPLBS (1<<CPLB_ENABLE_CPLBS_P)
88#define CPLB_ENABLE_ICPLBS (1<<CPLB_ENABLE_ICPLBS_P)
89#define CPLB_ENABLE_DCPLBS (1<<CPLB_ENABLE_DCPLBS_P)
90#define CPLB_ENABLE_ANY_CPLBS CPLB_ENABLE_CPLBS | \
91 CPLB_ENABLE_ICPLBS | \
92 CPLB_ENABLE_DCPLBS
93
94#define CPLB_RELOADED 0x0000
95#define CPLB_NO_UNLOCKED 0x0001
96#define CPLB_NO_ADDR_MATCH 0x0002
97#define CPLB_PROT_VIOL 0x0003
98#define CPLB_UNKNOWN_ERR 0x0004
99
100#define CPLB_DEF_CACHE CPLB_L1_CHBL | CPLB_WT
101#define CPLB_CACHE_ENABLED CPLB_L1_CHBL | CPLB_DIRTY
102
103#define CPLB_I_PAGE_MGMT CPLB_LOCK | CPLB_VALID
104#define CPLB_D_PAGE_MGMT CPLB_LOCK | CPLB_ALL_ACCESS | CPLB_VALID
105#define CPLB_DNOCACHE CPLB_ALL_ACCESS | CPLB_VALID
106#define CPLB_DDOCACHE CPLB_DNOCACHE | CPLB_DEF_CACHE
107#define CPLB_INOCACHE CPLB_USER_RD | CPLB_VALID
108#define CPLB_IDOCACHE CPLB_INOCACHE | CPLB_L1_CHBL
109
110#endif /* _CPLB_H */
diff --git a/include/asm-blackfin/cplbinit.h b/include/asm-blackfin/cplbinit.h
deleted file mode 100644
index 0eb1c1b685a7..000000000000
--- a/include/asm-blackfin/cplbinit.h
+++ /dev/null
@@ -1,95 +0,0 @@
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#ifndef __ASM_CPLBINIT_H__
31#define __ASM_CPLBINIT_H__
32
33#include <asm/blackfin.h>
34#include <asm/cplb.h>
35
36#ifdef CONFIG_MPU
37
38#include <asm/cplb-mpu.h>
39
40#else
41
42#define INITIAL_T 0x1
43#define SWITCH_T 0x2
44#define I_CPLB 0x4
45#define D_CPLB 0x8
46
47#define IN_KERNEL 1
48
49enum
50{ZERO_P, L1I_MEM, L1D_MEM, SDRAM_KERN , SDRAM_RAM_MTD, SDRAM_DMAZ, RES_MEM, ASYNC_MEM, L2_MEM};
51
52struct cplb_desc {
53 u32 start; /* start address */
54 u32 end; /* end address */
55 u32 psize; /* prefered size if any otherwise 1MB or 4MB*/
56 u16 attr;/* attributes */
57 u16 i_conf;/* I-CPLB DATA */
58 u16 d_conf;/* D-CPLB DATA */
59 u16 valid;/* valid */
60 const s8 name[30];/* name */
61};
62
63struct cplb_tab {
64 u_long *tab;
65 u16 pos;
66 u16 size;
67};
68
69extern u_long icplb_table[];
70extern u_long dcplb_table[];
71
72/* Till here we are discussing about the static memory management model.
73 * However, the operating envoronments commonly define more CPLB
74 * descriptors to cover the entire addressable memory than will fit into
75 * the available on-chip 16 CPLB MMRs. When this happens, the below table
76 * will be used which will hold all the potentially required CPLB descriptors
77 *
78 * This is how Page descriptor Table is implemented in uClinux/Blackfin.
79 */
80
81extern u_long ipdt_table[];
82extern u_long dpdt_table[];
83#ifdef CONFIG_CPLB_INFO
84extern u_long ipdt_swapcount_table[];
85extern u_long dpdt_swapcount_table[];
86#endif
87
88#endif /* CONFIG_MPU */
89
90extern unsigned long reserved_mem_dcache_on;
91extern unsigned long reserved_mem_icache_on;
92
93extern void generate_cpl_tables(void);
94
95#endif
diff --git a/include/asm-blackfin/cpumask.h b/include/asm-blackfin/cpumask.h
deleted file mode 100644
index b20a8e9012cb..000000000000
--- a/include/asm-blackfin/cpumask.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index 2b19705f9885..000000000000
--- a/include/asm-blackfin/cputime.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index 31918d29122c..000000000000
--- a/include/asm-blackfin/current.h
+++ /dev/null
@@ -1,23 +0,0 @@
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
deleted file mode 100644
index 473a8113277f..000000000000
--- a/include/asm-blackfin/delay.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * delay.h - delay functions
3 *
4 * Copyright (c) 2004-2007 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __ASM_DELAY_H__
10#define __ASM_DELAY_H__
11
12#include <asm/mach/anomaly.h>
13
14static inline void __delay(unsigned long loops)
15{
16 if (ANOMALY_05000312) {
17 /* Interrupted loads to loop registers -> bad */
18 unsigned long tmp;
19 __asm__ __volatile__(
20 "[--SP] = LC0;"
21 "[--SP] = LT0;"
22 "[--SP] = LB0;"
23 "LSETUP (1f,1f) LC0 = %1;"
24 "1: NOP;"
25 /* We take advantage of the fact that LC0 is 0 at
26 * the end of the loop. Otherwise we'd need some
27 * NOPs after the CLI here.
28 */
29 "CLI %0;"
30 "LB0 = [SP++];"
31 "LT0 = [SP++];"
32 "LC0 = [SP++];"
33 "STI %0;"
34 : "=d" (tmp)
35 : "a" (loops)
36 );
37 } else
38 __asm__ __volatile__ (
39 "LSETUP(1f, 1f) LC0 = %0;"
40 "1: NOP;"
41 :
42 : "a" (loops)
43 : "LT0", "LB0", "LC0"
44 );
45}
46
47#include <linux/param.h> /* needed for HZ */
48
49/*
50 * Use only for very small delays ( < 1 msec). Should probably use a
51 * lookup table, really, as the multiplications take much too long with
52 * short delays. This is a "reasonable" implementation, though (and the
53 * first constant multiplications gets optimized away if the delay is
54 * a constant)
55 */
56static inline void udelay(unsigned long usecs)
57{
58 extern unsigned long loops_per_jiffy;
59 __delay(usecs * loops_per_jiffy / (1000000 / HZ));
60}
61
62#endif
diff --git a/include/asm-blackfin/device.h b/include/asm-blackfin/device.h
deleted file mode 100644
index d8f9872b0e2d..000000000000
--- a/include/asm-blackfin/device.h
+++ /dev/null
@@ -1,7 +0,0 @@
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
deleted file mode 100644
index 6cd978cefb28..000000000000
--- a/include/asm-blackfin/div64.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/div64.h>
diff --git a/include/asm-blackfin/dma-mapping.h b/include/asm-blackfin/dma-mapping.h
deleted file mode 100644
index 1a13c2fc3667..000000000000
--- a/include/asm-blackfin/dma-mapping.h
+++ /dev/null
@@ -1,83 +0,0 @@
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#define dma_mapping_error
19
20/*
21 * Map a single buffer of the indicated size for DMA in streaming mode.
22 * The 32-bit bus address to use is returned.
23 *
24 * Once the device is given the dma address, the device owns this memory
25 * until either pci_unmap_single or pci_dma_sync_single is performed.
26 */
27extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
28 enum dma_data_direction direction);
29
30static inline dma_addr_t
31dma_map_page(struct device *dev, struct page *page,
32 unsigned long offset, size_t size,
33 enum dma_data_direction dir)
34{
35 return dma_map_single(dev, page_address(page) + offset, size, dir);
36}
37
38/*
39 * Unmap a single streaming mode DMA translation. The dma_addr and size
40 * must match what was provided for in a previous pci_map_single call. All
41 * other usages are undefined.
42 *
43 * After this call, reads by the cpu to the buffer are guarenteed to see
44 * whatever the device wrote there.
45 */
46extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
47 enum dma_data_direction direction);
48
49static inline void
50dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
51 enum dma_data_direction dir)
52{
53 dma_unmap_single(dev, dma_addr, size, dir);
54}
55
56/*
57 * Map a set of buffers described by scatterlist in streaming
58 * mode for DMA. This is the scather-gather version of the
59 * above pci_map_single interface. Here the scatter gather list
60 * elements are each tagged with the appropriate dma address
61 * and length. They are obtained via sg_dma_{address,length}(SG).
62 *
63 * NOTE: An implementation may be able to use a smaller number of
64 * DMA address/length pairs than there are SG table elements.
65 * (for example via virtual mapping capabilities)
66 * The routine returns the number of addr/length pairs actually
67 * used, at most nents.
68 *
69 * Device ownership issues as mentioned above for pci_map_single are
70 * the same here.
71 */
72extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
73 enum dma_data_direction direction);
74
75/*
76 * Unmap a set of streaming mode DMA translations.
77 * Again, cpu read rules concerning calls here are the same as for
78 * pci_unmap_single() above.
79 */
80extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
81 int nhwentries, enum dma_data_direction direction);
82
83#endif /* _BLACKFIN_DMA_MAPPING_H */
diff --git a/include/asm-blackfin/dma.h b/include/asm-blackfin/dma.h
deleted file mode 100644
index 3cd4b522aa3f..000000000000
--- a/include/asm-blackfin/dma.h
+++ /dev/null
@@ -1,205 +0,0 @@
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
37#include <linux/kernel.h>
38#include <asm/mach/dma.h>
39#include <linux/mm.h>
40#include <linux/interrupt.h>
41#include <asm/blackfin.h>
42
43#define MAX_DMA_ADDRESS PAGE_OFFSET
44
45/*****************************************************************************
46* Generic DMA Declarations
47*
48****************************************************************************/
49enum dma_chan_status {
50 DMA_CHANNEL_FREE,
51 DMA_CHANNEL_REQUESTED,
52 DMA_CHANNEL_ENABLED,
53};
54
55/*-------------------------
56 * config reg bits value
57 *-------------------------*/
58#define DATA_SIZE_8 0
59#define DATA_SIZE_16 1
60#define DATA_SIZE_32 2
61
62#define DMA_FLOW_STOP 0
63#define DMA_FLOW_AUTO 1
64#define DMA_FLOW_ARRAY 4
65#define DMA_FLOW_SMALL 6
66#define DMA_FLOW_LARGE 7
67
68#define DIMENSION_LINEAR 0
69#define DIMENSION_2D 1
70
71#define DIR_READ 0
72#define DIR_WRITE 1
73
74#define INTR_DISABLE 0
75#define INTR_ON_BUF 2
76#define INTR_ON_ROW 3
77
78#define DMA_NOSYNC_KEEP_DMA_BUF 0
79#define DMA_SYNC_RESTART 1
80
81struct dmasg {
82 unsigned long next_desc_addr;
83 unsigned long start_addr;
84 unsigned short cfg;
85 unsigned short x_count;
86 short x_modify;
87 unsigned short y_count;
88 short y_modify;
89} __attribute__((packed));
90
91struct dma_register {
92 unsigned long next_desc_ptr; /* DMA Next Descriptor Pointer register */
93 unsigned long start_addr; /* DMA Start address register */
94
95 unsigned short cfg; /* DMA Configuration register */
96 unsigned short dummy1; /* DMA Configuration register */
97
98 unsigned long reserved;
99
100 unsigned short x_count; /* DMA x_count register */
101 unsigned short dummy2;
102
103 short x_modify; /* DMA x_modify register */
104 unsigned short dummy3;
105
106 unsigned short y_count; /* DMA y_count register */
107 unsigned short dummy4;
108
109 short y_modify; /* DMA y_modify register */
110 unsigned short dummy5;
111
112 unsigned long curr_desc_ptr; /* DMA Current Descriptor Pointer
113 register */
114 unsigned long curr_addr_ptr; /* 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#ifdef CONFIG_PM
148 unsigned short saved_peripheral_map;
149#endif
150};
151
152#ifdef CONFIG_PM
153int blackfin_dma_suspend(void);
154void blackfin_dma_resume(void);
155#endif
156
157/*******************************************************************************
158* DMA API's
159*******************************************************************************/
160/* functions to set register mode */
161void set_dma_start_addr(unsigned int channel, unsigned long addr);
162void set_dma_next_desc_addr(unsigned int channel, unsigned long addr);
163void set_dma_curr_desc_addr(unsigned int channel, unsigned long addr);
164void set_dma_x_count(unsigned int channel, unsigned short x_count);
165void set_dma_x_modify(unsigned int channel, short x_modify);
166void set_dma_y_count(unsigned int channel, unsigned short y_count);
167void set_dma_y_modify(unsigned int channel, short y_modify);
168void set_dma_config(unsigned int channel, unsigned short config);
169unsigned short set_bfin_dma_config(char direction, char flow_mode,
170 char intr_mode, char dma_mode, char width,
171 char syncmode);
172void set_dma_curr_addr(unsigned int channel, unsigned long addr);
173
174/* get curr status for polling */
175unsigned short get_dma_curr_irqstat(unsigned int channel);
176unsigned short get_dma_curr_xcount(unsigned int channel);
177unsigned short get_dma_curr_ycount(unsigned int channel);
178unsigned long get_dma_next_desc_ptr(unsigned int channel);
179unsigned long get_dma_curr_desc_ptr(unsigned int channel);
180unsigned long get_dma_curr_addr(unsigned int channel);
181
182/* set large DMA mode descriptor */
183void set_dma_sg(unsigned int channel, struct dmasg *sg, int nr_sg);
184
185/* check if current channel is in use */
186int dma_channel_active(unsigned int channel);
187
188/* common functions must be called in any mode */
189void free_dma(unsigned int channel);
190int dma_channel_active(unsigned int channel); /* check if a channel is in use */
191void disable_dma(unsigned int channel);
192void enable_dma(unsigned int channel);
193int request_dma(unsigned int channel, char *device_id);
194int set_dma_callback(unsigned int channel, dma_interrupt_t callback,
195 void *data);
196void dma_disable_irq(unsigned int channel);
197void dma_enable_irq(unsigned int channel);
198void clear_dma_irqstat(unsigned int channel);
199void *dma_memcpy(void *dest, const void *src, size_t count);
200void *safe_dma_memcpy(void *dest, const void *src, size_t count);
201
202extern int channel2irq(unsigned int channel);
203extern struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL];
204
205#endif
diff --git a/include/asm-blackfin/dpmc.h b/include/asm-blackfin/dpmc.h
deleted file mode 100644
index 96e8208f929a..000000000000
--- a/include/asm-blackfin/dpmc.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * include/asm-blackfin/dpmc.h - Miscellaneous IOCTL commands for Dynamic Power
3 * Management Controller Driver.
4 * Copyright (C) 2004-2008 Analog Device Inc.
5 *
6 */
7#ifndef _BLACKFIN_DPMC_H_
8#define _BLACKFIN_DPMC_H_
9
10#ifdef __KERNEL__
11#ifndef __ASSEMBLY__
12
13void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
14void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
15void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
16void do_hibernate(int wakeup);
17void set_dram_srfs(void);
18void unset_dram_srfs(void);
19
20#define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16))
21
22struct bfin_dpmc_platform_data {
23 const unsigned int *tuple_tab;
24 unsigned short tabsize;
25 unsigned short vr_settling_time; /* in us */
26};
27
28#else
29
30#define PM_PUSH(x) \
31 R0 = [P0 + (x - SRAM_BASE_ADDRESS)];\
32 [--SP] = R0;\
33
34#define PM_POP(x) \
35 R0 = [SP++];\
36 [P0 + (x - SRAM_BASE_ADDRESS)] = R0;\
37
38#define PM_SYS_PUSH(x) \
39 R0 = [P0 + (x - PLL_CTL)];\
40 [--SP] = R0;\
41
42#define PM_SYS_POP(x) \
43 R0 = [SP++];\
44 [P0 + (x - PLL_CTL)] = R0;\
45
46#define PM_SYS_PUSH16(x) \
47 R0 = w[P0 + (x - PLL_CTL)];\
48 [--SP] = R0;\
49
50#define PM_SYS_POP16(x) \
51 R0 = [SP++];\
52 w[P0 + (x - PLL_CTL)] = R0;\
53
54#endif
55#endif /* __KERNEL__ */
56
57#endif /*_BLACKFIN_DPMC_H_*/
diff --git a/include/asm-blackfin/early_printk.h b/include/asm-blackfin/early_printk.h
deleted file mode 100644
index 110f1c1f845c..000000000000
--- a/include/asm-blackfin/early_printk.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * File: include/asm-blackfin/early_printk.h
3 * Author: Robin Getz <rgetz@blackfin.uclinux.org
4 *
5 * Created: 14Aug2007
6 * Description: function prototpyes for early printk
7 *
8 * Modified:
9 * Copyright 2004-2007 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
24#ifdef CONFIG_EARLY_PRINTK
25extern int setup_early_printk(char *);
26#else
27#define setup_early_printk(fmt) do { } while (0)
28#endif /* CONFIG_EARLY_PRINTK */
diff --git a/include/asm-blackfin/elf.h b/include/asm-blackfin/elf.h
deleted file mode 100644
index 67a03a8a353e..000000000000
--- a/include/asm-blackfin/elf.h
+++ /dev/null
@@ -1,127 +0,0 @@
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#define EF_BFIN_CODE_IN_L2 0x00000040 /* --code-in-l2 */
19#define EF_BFIN_DATA_IN_L2 0x00000080 /* --data-in-l2 */
20
21typedef unsigned long elf_greg_t;
22
23#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
24typedef elf_greg_t elf_gregset_t[ELF_NGREG];
25
26typedef struct user_bfinfp_struct elf_fpregset_t;
27/*
28 * This is used to ensure we don't load something for the wrong architecture.
29 */
30#define elf_check_arch(x) ((x)->e_machine == EM_BLACKFIN)
31
32#define elf_check_fdpic(x) ((x)->e_flags & EF_BFIN_FDPIC /* && !((x)->e_flags & EF_FRV_NON_PIC_RELOCS) */)
33#define elf_check_const_displacement(x) ((x)->e_flags & EF_BFIN_PIC)
34
35/* EM_BLACKFIN defined in linux/elf.h */
36
37/*
38 * These are used to set parameters in the core dumps.
39 */
40#define ELF_CLASS ELFCLASS32
41#define ELF_DATA ELFDATA2LSB
42#define ELF_ARCH EM_BLACKFIN
43
44#define ELF_PLAT_INIT(_r) _r->p1 = 0
45
46#define ELF_FDPIC_PLAT_INIT(_regs, _exec_map_addr, _interp_map_addr, _dynamic_addr) \
47do { \
48 _regs->r7 = 0; \
49 _regs->p0 = _exec_map_addr; \
50 _regs->p1 = _interp_map_addr; \
51 _regs->p2 = _dynamic_addr; \
52} while(0)
53
54#define USE_ELF_CORE_DUMP
55#define ELF_FDPIC_CORE_EFLAGS EF_BFIN_FDPIC
56#define ELF_EXEC_PAGESIZE 4096
57
58#define R_unused0 0 /* relocation type 0 is not defined */
59#define R_pcrel5m2 1 /*LSETUP part a */
60#define R_unused1 2 /* relocation type 2 is not defined */
61#define R_pcrel10 3 /* type 3, if cc jump <target> */
62#define R_pcrel12_jump 4 /* type 4, jump <target> */
63#define R_rimm16 5 /* type 0x5, rN = <target> */
64#define R_luimm16 6 /* # 0x6, preg.l=<target> Load imm 16 to lower half */
65#define R_huimm16 7 /* # 0x7, preg.h=<target> Load imm 16 to upper half */
66#define R_pcrel12_jump_s 8 /* # 0x8 jump.s <target> */
67#define R_pcrel24_jump_x 9 /* # 0x9 jump.x <target> */
68#define R_pcrel24 10 /* # 0xa call <target> , not expandable */
69#define R_unusedb 11 /* # 0xb not generated */
70#define R_unusedc 12 /* # 0xc not used */
71#define R_pcrel24_jump_l 13 /*0xd jump.l <target> */
72#define R_pcrel24_call_x 14 /* 0xE, call.x <target> if <target> is above 24 bit limit call through P1 */
73#define R_var_eq_symb 15 /* 0xf, linker should treat it same as 0x12 */
74#define R_byte_data 16 /* 0x10, .byte var = symbol */
75#define R_byte2_data 17 /* 0x11, .byte2 var = symbol */
76#define R_byte4_data 18 /* 0x12, .byte4 var = symbol and .var var=symbol */
77#define R_pcrel11 19 /* 0x13, lsetup part b */
78#define R_unused14 20 /* 0x14, undefined */
79#define R_unused15 21 /* not generated by VDSP 3.5 */
80
81/* arithmetic relocations */
82#define R_push 0xE0
83#define R_const 0xE1
84#define R_add 0xE2
85#define R_sub 0xE3
86#define R_mult 0xE4
87#define R_div 0xE5
88#define R_mod 0xE6
89#define R_lshift 0xE7
90#define R_rshift 0xE8
91#define R_and 0xE9
92#define R_or 0xEA
93#define R_xor 0xEB
94#define R_land 0xEC
95#define R_lor 0xED
96#define R_len 0xEE
97#define R_neg 0xEF
98#define R_comp 0xF0
99#define R_page 0xF1
100#define R_hwpage 0xF2
101#define R_addr 0xF3
102
103/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
104 use of this is to invoke "./ld.so someprog" to test out a new version of
105 the loader. We need to make sure that it is out of the way of the program
106 that it will "exec", and that there is sufficient room for the brk. */
107
108#define ELF_ET_DYN_BASE 0xD0000000UL
109
110#define ELF_CORE_COPY_REGS(pr_reg, regs) \
111 memcpy((char *) &pr_reg, (char *)regs, \
112 sizeof(struct pt_regs));
113
114/* This yields a mask that user programs can use to figure out what
115 instruction set this cpu supports. */
116
117#define ELF_HWCAP (0)
118
119/* This yields a string that ld.so will use to load implementation
120 specific libraries for optimization. This is more specific in
121 intent than poking at uname or /proc/cpuinfo. */
122
123#define ELF_PLATFORM (NULL)
124
125#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
126
127#endif
diff --git a/include/asm-blackfin/emergency-restart.h b/include/asm-blackfin/emergency-restart.h
deleted file mode 100644
index 27f6c785d103..000000000000
--- a/include/asm-blackfin/emergency-restart.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index c4f721e0d00d..000000000000
--- a/include/asm-blackfin/entry.h
+++ /dev/null
@@ -1,61 +0,0 @@
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/*
21 * NOTE! The single-stepping code assumes that all interrupt handlers
22 * start by saving SYSCFG on the stack with their first instruction.
23 */
24
25/* This one is used for exceptions, emulation, and NMI. It doesn't push
26 RETI and doesn't do cli. */
27#define SAVE_ALL_SYS save_context_no_interrupts
28/* This is used for all normal interrupts. It saves a minimum of registers
29 to the stack, loads the IRQ number, and jumps to common code. */
30#define INTERRUPT_ENTRY(N) \
31 [--sp] = SYSCFG; \
32 \
33 [--sp] = P0; /*orig_p0*/ \
34 [--sp] = R0; /*orig_r0*/ \
35 [--sp] = (R7:0,P5:0); \
36 R0 = (N); \
37 jump __common_int_entry;
38
39/* For timer interrupts, we need to save IPEND, since the user_mode
40 macro accesses it to determine where to account time. */
41#define TIMER_INTERRUPT_ENTRY(N) \
42 [--sp] = SYSCFG; \
43 \
44 [--sp] = P0; /*orig_p0*/ \
45 [--sp] = R0; /*orig_r0*/ \
46 [--sp] = (R7:0,P5:0); \
47 p0.l = lo(IPEND); \
48 p0.h = hi(IPEND); \
49 r1 = [p0]; \
50 R0 = (N); \
51 jump __common_int_entry;
52
53/* This one pushes RETI without using CLI. Interrupts are enabled. */
54#define SAVE_CONTEXT_SYSCALL save_context_syscall
55#define SAVE_CONTEXT save_context_with_interrupts
56
57#define RESTORE_ALL_SYS restore_context_no_interrupts
58#define RESTORE_CONTEXT restore_context_with_interrupts
59
60#endif /* __ASSEMBLY__ */
61#endif /* __BFIN_ENTRY_H */
diff --git a/include/asm-blackfin/errno.h b/include/asm-blackfin/errno.h
deleted file mode 100644
index 164e4f39bb57..000000000000
--- a/include/asm-blackfin/errno.h
+++ /dev/null
@@ -1,6 +0,0 @@
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/fb.h b/include/asm-blackfin/fb.h
deleted file mode 100644
index c7df38030992..000000000000
--- a/include/asm-blackfin/fb.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-blackfin/fcntl.h b/include/asm-blackfin/fcntl.h
deleted file mode 100644
index 9c4037127857..000000000000
--- a/include/asm-blackfin/fcntl.h
+++ /dev/null
@@ -1,13 +0,0 @@
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/fixed_code.h b/include/asm-blackfin/fixed_code.h
deleted file mode 100644
index 32c4d495d847..000000000000
--- a/include/asm-blackfin/fixed_code.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/* This file defines the fixed addresses where userspace programs can find
2 atomic code sequences. */
3
4#ifndef __BFIN_ASM_FIXED_CODE_H__
5#define __BFIN_ASM_FIXED_CODE_H__
6
7#ifdef __KERNEL__
8#ifndef __ASSEMBLY__
9#include <linux/linkage.h>
10#include <linux/ptrace.h>
11extern asmlinkage void finish_atomic_sections(struct pt_regs *regs);
12extern char fixed_code_start;
13extern char fixed_code_end;
14extern int atomic_xchg32(void);
15extern int atomic_cas32(void);
16extern int atomic_add32(void);
17extern int atomic_sub32(void);
18extern int atomic_ior32(void);
19extern int atomic_and32(void);
20extern int atomic_xor32(void);
21extern void safe_user_instruction(void);
22extern void sigreturn_stub(void);
23#endif
24#endif
25
26#define FIXED_CODE_START 0x400
27
28#define SIGRETURN_STUB 0x400
29
30#define ATOMIC_SEQS_START 0x410
31
32#define ATOMIC_XCHG32 0x410
33#define ATOMIC_CAS32 0x420
34#define ATOMIC_ADD32 0x430
35#define ATOMIC_SUB32 0x440
36#define ATOMIC_IOR32 0x450
37#define ATOMIC_AND32 0x460
38#define ATOMIC_XOR32 0x470
39
40#define ATOMIC_SEQS_END 0x480
41
42#define SAFE_USER_INSTRUCTION 0x480
43
44#define FIXED_CODE_END 0x490
45
46#endif
diff --git a/include/asm-blackfin/flat.h b/include/asm-blackfin/flat.h
deleted file mode 100644
index e70074e05f4e..000000000000
--- a/include/asm-blackfin/flat.h
+++ /dev/null
@@ -1,58 +0,0 @@
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
deleted file mode 100644
index 6a332a9f099c..000000000000
--- a/include/asm-blackfin/futex.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index 168f1251eb4d..000000000000
--- a/include/asm-blackfin/gpio.h
+++ /dev/null
@@ -1,456 +0,0 @@
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-2008 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* BF527/5/2
33*
34* GPIO_0 PF0 PF0 PF0
35* GPIO_1 PF1 PF1 PF1
36* GPIO_2 PF2 PF2 PF2
37* GPIO_3 PF3 PF3 PF3
38* GPIO_4 PF4 PF4 PF4
39* GPIO_5 PF5 PF5 PF5
40* GPIO_6 PF6 PF6 PF6
41* GPIO_7 PF7 PF7 PF7
42* GPIO_8 PF8 PF8 PF8
43* GPIO_9 PF9 PF9 PF9
44* GPIO_10 PF10 PF10 PF10
45* GPIO_11 PF11 PF11 PF11
46* GPIO_12 PF12 PF12 PF12
47* GPIO_13 PF13 PF13 PF13
48* GPIO_14 PF14 PF14 PF14
49* GPIO_15 PF15 PF15 PF15
50* GPIO_16 PG0 PF16
51* GPIO_17 PG1 PF17
52* GPIO_18 PG2 PF18
53* GPIO_19 PG3 PF19
54* GPIO_20 PG4 PF20
55* GPIO_21 PG5 PF21
56* GPIO_22 PG6 PF22
57* GPIO_23 PG7 PF23
58* GPIO_24 PG8 PF24
59* GPIO_25 PG9 PF25
60* GPIO_26 PG10 PF26
61* GPIO_27 PG11 PF27
62* GPIO_28 PG12 PF28
63* GPIO_29 PG13 PF29
64* GPIO_30 PG14 PF30
65* GPIO_31 PG15 PF31
66* GPIO_32 PH0 PF32
67* GPIO_33 PH1 PF33
68* GPIO_34 PH2 PF34
69* GPIO_35 PH3 PF35
70* GPIO_36 PH4 PF36
71* GPIO_37 PH5 PF37
72* GPIO_38 PH6 PF38
73* GPIO_39 PH7 PF39
74* GPIO_40 PH8 PF40
75* GPIO_41 PH9 PF41
76* GPIO_42 PH10 PF42
77* GPIO_43 PH11 PF43
78* GPIO_44 PH12 PF44
79* GPIO_45 PH13 PF45
80* GPIO_46 PH14 PF46
81* GPIO_47 PH15 PF47
82*/
83
84#ifndef __ARCH_BLACKFIN_GPIO_H__
85#define __ARCH_BLACKFIN_GPIO_H__
86
87#define gpio_bank(x) ((x) >> 4)
88#define gpio_bit(x) (1<<((x) & 0xF))
89#define gpio_sub_n(x) ((x) & 0xF)
90
91#define GPIO_BANKSIZE 16
92
93#define GPIO_0 0
94#define GPIO_1 1
95#define GPIO_2 2
96#define GPIO_3 3
97#define GPIO_4 4
98#define GPIO_5 5
99#define GPIO_6 6
100#define GPIO_7 7
101#define GPIO_8 8
102#define GPIO_9 9
103#define GPIO_10 10
104#define GPIO_11 11
105#define GPIO_12 12
106#define GPIO_13 13
107#define GPIO_14 14
108#define GPIO_15 15
109#define GPIO_16 16
110#define GPIO_17 17
111#define GPIO_18 18
112#define GPIO_19 19
113#define GPIO_20 20
114#define GPIO_21 21
115#define GPIO_22 22
116#define GPIO_23 23
117#define GPIO_24 24
118#define GPIO_25 25
119#define GPIO_26 26
120#define GPIO_27 27
121#define GPIO_28 28
122#define GPIO_29 29
123#define GPIO_30 30
124#define GPIO_31 31
125#define GPIO_32 32
126#define GPIO_33 33
127#define GPIO_34 34
128#define GPIO_35 35
129#define GPIO_36 36
130#define GPIO_37 37
131#define GPIO_38 38
132#define GPIO_39 39
133#define GPIO_40 40
134#define GPIO_41 41
135#define GPIO_42 42
136#define GPIO_43 43
137#define GPIO_44 44
138#define GPIO_45 45
139#define GPIO_46 46
140#define GPIO_47 47
141
142
143#define PERIPHERAL_USAGE 1
144#define GPIO_USAGE 0
145
146#ifdef BF533_FAMILY
147#define MAX_BLACKFIN_GPIOS 16
148
149#define GPIO_PF0 0
150#define GPIO_PF1 1
151#define GPIO_PF2 2
152#define GPIO_PF3 3
153#define GPIO_PF4 4
154#define GPIO_PF5 5
155#define GPIO_PF6 6
156#define GPIO_PF7 7
157#define GPIO_PF8 8
158#define GPIO_PF9 9
159#define GPIO_PF10 10
160#define GPIO_PF11 11
161#define GPIO_PF12 12
162#define GPIO_PF13 13
163#define GPIO_PF14 14
164#define GPIO_PF15 15
165
166#endif
167
168#if defined(BF527_FAMILY) || defined(BF537_FAMILY)
169#define MAX_BLACKFIN_GPIOS 48
170
171#define GPIO_PF0 0
172#define GPIO_PF1 1
173#define GPIO_PF2 2
174#define GPIO_PF3 3
175#define GPIO_PF4 4
176#define GPIO_PF5 5
177#define GPIO_PF6 6
178#define GPIO_PF7 7
179#define GPIO_PF8 8
180#define GPIO_PF9 9
181#define GPIO_PF10 10
182#define GPIO_PF11 11
183#define GPIO_PF12 12
184#define GPIO_PF13 13
185#define GPIO_PF14 14
186#define GPIO_PF15 15
187#define GPIO_PG0 16
188#define GPIO_PG1 17
189#define GPIO_PG2 18
190#define GPIO_PG3 19
191#define GPIO_PG4 20
192#define GPIO_PG5 21
193#define GPIO_PG6 22
194#define GPIO_PG7 23
195#define GPIO_PG8 24
196#define GPIO_PG9 25
197#define GPIO_PG10 26
198#define GPIO_PG11 27
199#define GPIO_PG12 28
200#define GPIO_PG13 29
201#define GPIO_PG14 30
202#define GPIO_PG15 31
203#define GPIO_PH0 32
204#define GPIO_PH1 33
205#define GPIO_PH2 34
206#define GPIO_PH3 35
207#define GPIO_PH4 36
208#define GPIO_PH5 37
209#define GPIO_PH6 38
210#define GPIO_PH7 39
211#define GPIO_PH8 40
212#define GPIO_PH9 41
213#define GPIO_PH10 42
214#define GPIO_PH11 43
215#define GPIO_PH12 44
216#define GPIO_PH13 45
217#define GPIO_PH14 46
218#define GPIO_PH15 47
219
220#define PORT_F GPIO_PF0
221#define PORT_G GPIO_PG0
222#define PORT_H GPIO_PH0
223
224#endif
225
226#ifdef BF548_FAMILY
227#include <asm-blackfin/mach-bf548/gpio.h>
228#endif
229
230#ifdef BF561_FAMILY
231#define MAX_BLACKFIN_GPIOS 48
232
233#define GPIO_PF0 0
234#define GPIO_PF1 1
235#define GPIO_PF2 2
236#define GPIO_PF3 3
237#define GPIO_PF4 4
238#define GPIO_PF5 5
239#define GPIO_PF6 6
240#define GPIO_PF7 7
241#define GPIO_PF8 8
242#define GPIO_PF9 9
243#define GPIO_PF10 10
244#define GPIO_PF11 11
245#define GPIO_PF12 12
246#define GPIO_PF13 13
247#define GPIO_PF14 14
248#define GPIO_PF15 15
249#define GPIO_PF16 16
250#define GPIO_PF17 17
251#define GPIO_PF18 18
252#define GPIO_PF19 19
253#define GPIO_PF20 20
254#define GPIO_PF21 21
255#define GPIO_PF22 22
256#define GPIO_PF23 23
257#define GPIO_PF24 24
258#define GPIO_PF25 25
259#define GPIO_PF26 26
260#define GPIO_PF27 27
261#define GPIO_PF28 28
262#define GPIO_PF29 29
263#define GPIO_PF30 30
264#define GPIO_PF31 31
265#define GPIO_PF32 32
266#define GPIO_PF33 33
267#define GPIO_PF34 34
268#define GPIO_PF35 35
269#define GPIO_PF36 36
270#define GPIO_PF37 37
271#define GPIO_PF38 38
272#define GPIO_PF39 39
273#define GPIO_PF40 40
274#define GPIO_PF41 41
275#define GPIO_PF42 42
276#define GPIO_PF43 43
277#define GPIO_PF44 44
278#define GPIO_PF45 45
279#define GPIO_PF46 46
280#define GPIO_PF47 47
281
282#define PORT_FIO0 GPIO_0
283#define PORT_FIO1 GPIO_16
284#define PORT_FIO2 GPIO_32
285#endif
286
287#ifndef __ASSEMBLY__
288
289/***********************************************************
290*
291* FUNCTIONS: Blackfin General Purpose Ports Access Functions
292*
293* INPUTS/OUTPUTS:
294* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
295*
296*
297* DESCRIPTION: These functions abstract direct register access
298* to Blackfin processor General Purpose
299* Ports Regsiters
300*
301* CAUTION: These functions do not belong to the GPIO Driver API
302*************************************************************
303* MODIFICATION HISTORY :
304**************************************************************/
305
306#ifndef BF548_FAMILY
307void set_gpio_dir(unsigned, unsigned short);
308void set_gpio_inen(unsigned, unsigned short);
309void set_gpio_polar(unsigned, unsigned short);
310void set_gpio_edge(unsigned, unsigned short);
311void set_gpio_both(unsigned, unsigned short);
312void set_gpio_data(unsigned, unsigned short);
313void set_gpio_maska(unsigned, unsigned short);
314void set_gpio_maskb(unsigned, unsigned short);
315void set_gpio_toggle(unsigned);
316void set_gpiop_dir(unsigned, unsigned short);
317void set_gpiop_inen(unsigned, unsigned short);
318void set_gpiop_polar(unsigned, unsigned short);
319void set_gpiop_edge(unsigned, unsigned short);
320void set_gpiop_both(unsigned, unsigned short);
321void set_gpiop_data(unsigned, unsigned short);
322void set_gpiop_maska(unsigned, unsigned short);
323void set_gpiop_maskb(unsigned, unsigned short);
324unsigned short get_gpio_dir(unsigned);
325unsigned short get_gpio_inen(unsigned);
326unsigned short get_gpio_polar(unsigned);
327unsigned short get_gpio_edge(unsigned);
328unsigned short get_gpio_both(unsigned);
329unsigned short get_gpio_maska(unsigned);
330unsigned short get_gpio_maskb(unsigned);
331unsigned short get_gpio_data(unsigned);
332unsigned short get_gpiop_dir(unsigned);
333unsigned short get_gpiop_inen(unsigned);
334unsigned short get_gpiop_polar(unsigned);
335unsigned short get_gpiop_edge(unsigned);
336unsigned short get_gpiop_both(unsigned);
337unsigned short get_gpiop_maska(unsigned);
338unsigned short get_gpiop_maskb(unsigned);
339unsigned short get_gpiop_data(unsigned);
340
341struct gpio_port_t {
342 unsigned short data;
343 unsigned short dummy1;
344 unsigned short data_clear;
345 unsigned short dummy2;
346 unsigned short data_set;
347 unsigned short dummy3;
348 unsigned short toggle;
349 unsigned short dummy4;
350 unsigned short maska;
351 unsigned short dummy5;
352 unsigned short maska_clear;
353 unsigned short dummy6;
354 unsigned short maska_set;
355 unsigned short dummy7;
356 unsigned short maska_toggle;
357 unsigned short dummy8;
358 unsigned short maskb;
359 unsigned short dummy9;
360 unsigned short maskb_clear;
361 unsigned short dummy10;
362 unsigned short maskb_set;
363 unsigned short dummy11;
364 unsigned short maskb_toggle;
365 unsigned short dummy12;
366 unsigned short dir;
367 unsigned short dummy13;
368 unsigned short polar;
369 unsigned short dummy14;
370 unsigned short edge;
371 unsigned short dummy15;
372 unsigned short both;
373 unsigned short dummy16;
374 unsigned short inen;
375};
376#endif
377
378#ifdef CONFIG_PM
379
380unsigned int bfin_pm_standby_setup(void);
381void bfin_pm_standby_restore(void);
382
383void bfin_gpio_pm_hibernate_restore(void);
384void bfin_gpio_pm_hibernate_suspend(void);
385
386#ifndef CONFIG_BF54x
387#define PM_WAKE_RISING 0x1
388#define PM_WAKE_FALLING 0x2
389#define PM_WAKE_HIGH 0x4
390#define PM_WAKE_LOW 0x8
391#define PM_WAKE_BOTH_EDGES (PM_WAKE_RISING | PM_WAKE_FALLING)
392#define PM_WAKE_IGNORE 0xF0
393
394int gpio_pm_wakeup_request(unsigned gpio, unsigned char type);
395void gpio_pm_wakeup_free(unsigned gpio);
396
397struct gpio_port_s {
398 unsigned short data;
399 unsigned short maska;
400 unsigned short maskb;
401 unsigned short dir;
402 unsigned short polar;
403 unsigned short edge;
404 unsigned short both;
405 unsigned short inen;
406
407 unsigned short fer;
408 unsigned short reserved;
409 unsigned short mux;
410};
411#endif /*CONFIG_BF54x*/
412#endif /*CONFIG_PM*/
413/***********************************************************
414*
415* FUNCTIONS: Blackfin GPIO Driver
416*
417* INPUTS/OUTPUTS:
418* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
419*
420*
421* DESCRIPTION: Blackfin GPIO Driver API
422*
423* CAUTION:
424*************************************************************
425* MODIFICATION HISTORY :
426**************************************************************/
427
428int gpio_request(unsigned, const char *);
429void gpio_free(unsigned);
430
431void gpio_set_value(unsigned gpio, int arg);
432int gpio_get_value(unsigned gpio);
433
434#ifndef BF548_FAMILY
435#define gpio_set_value(gpio, value) set_gpio_data(gpio, value)
436#endif
437
438int gpio_direction_input(unsigned gpio);
439int gpio_direction_output(unsigned gpio, int value);
440
441#include <asm-generic/gpio.h> /* cansleep wrappers */
442#include <asm/irq.h>
443
444static inline int gpio_to_irq(unsigned gpio)
445{
446 return (gpio + GPIO_IRQ_BASE);
447}
448
449static inline int irq_to_gpio(unsigned irq)
450{
451 return (irq - GPIO_IRQ_BASE);
452}
453
454#endif /* __ASSEMBLY__ */
455
456#endif /* __ARCH_BLACKFIN_GPIO_H__ */
diff --git a/include/asm-blackfin/gptimers.h b/include/asm-blackfin/gptimers.h
deleted file mode 100644
index 0520d2aac8f3..000000000000
--- a/include/asm-blackfin/gptimers.h
+++ /dev/null
@@ -1,191 +0,0 @@
1/*
2 * gptimers.h - Blackfin General Purpose Timer structs/defines/prototypes
3 *
4 * Copyright (c) 2005-2008 Analog Devices Inc.
5 * Copyright (C) 2005 John DeHority
6 * Copyright (C) 2006 Hella Aglaia GmbH (awe@aglaia-gmbh.de)
7 *
8 * Licensed under the GPL-2.
9 */
10
11#ifndef _BLACKFIN_TIMERS_H_
12#define _BLACKFIN_TIMERS_H_
13
14#include <linux/types.h>
15#include <asm/blackfin.h>
16
17/*
18 * BF537/BF527: 8 timers:
19 */
20#if defined(BF527_FAMILY) || defined(BF537_FAMILY)
21# define MAX_BLACKFIN_GPTIMERS 8
22# define TIMER0_GROUP_REG TIMER_ENABLE
23#endif
24/*
25 * BF54x: 11 timers (BF542: 8 timers):
26 */
27#if defined(BF548_FAMILY)
28# ifdef CONFIG_BF542
29# define MAX_BLACKFIN_GPTIMERS 8
30# else
31# define MAX_BLACKFIN_GPTIMERS 11
32# define TIMER8_GROUP_REG TIMER_ENABLE1
33# endif
34# define TIMER0_GROUP_REG TIMER_ENABLE0
35#endif
36/*
37 * BF561: 12 timers:
38 */
39#if defined(CONFIG_BF561)
40# define MAX_BLACKFIN_GPTIMERS 12
41# define TIMER0_GROUP_REG TMRS8_ENABLE
42# define TIMER8_GROUP_REG TMRS4_ENABLE
43#endif
44/*
45 * All others: 3 timers:
46 */
47#if !defined(MAX_BLACKFIN_GPTIMERS)
48# define MAX_BLACKFIN_GPTIMERS 3
49# define TIMER0_GROUP_REG TIMER_ENABLE
50#endif
51
52#define BLACKFIN_GPTIMER_IDMASK ((1UL << MAX_BLACKFIN_GPTIMERS) - 1)
53#define BFIN_TIMER_OCTET(x) ((x) >> 3)
54
55/* used in masks for timer_enable() and timer_disable() */
56#define TIMER0bit 0x0001 /* 0001b */
57#define TIMER1bit 0x0002 /* 0010b */
58#define TIMER2bit 0x0004 /* 0100b */
59#define TIMER3bit 0x0008
60#define TIMER4bit 0x0010
61#define TIMER5bit 0x0020
62#define TIMER6bit 0x0040
63#define TIMER7bit 0x0080
64#define TIMER8bit 0x0100
65#define TIMER9bit 0x0200
66#define TIMER10bit 0x0400
67#define TIMER11bit 0x0800
68
69#define TIMER0_id 0
70#define TIMER1_id 1
71#define TIMER2_id 2
72#define TIMER3_id 3
73#define TIMER4_id 4
74#define TIMER5_id 5
75#define TIMER6_id 6
76#define TIMER7_id 7
77#define TIMER8_id 8
78#define TIMER9_id 9
79#define TIMER10_id 10
80#define TIMER11_id 11
81
82/* associated timers for ppi framesync: */
83
84#if defined(CONFIG_BF561)
85# define FS0_1_TIMER_ID TIMER8_id
86# define FS0_2_TIMER_ID TIMER9_id
87# define FS1_1_TIMER_ID TIMER10_id
88# define FS1_2_TIMER_ID TIMER11_id
89# define FS0_1_TIMER_BIT TIMER8bit
90# define FS0_2_TIMER_BIT TIMER9bit
91# define FS1_1_TIMER_BIT TIMER10bit
92# define FS1_2_TIMER_BIT TIMER11bit
93# undef FS1_TIMER_ID
94# undef FS2_TIMER_ID
95# undef FS1_TIMER_BIT
96# undef FS2_TIMER_BIT
97#else
98# define FS1_TIMER_ID TIMER0_id
99# define FS2_TIMER_ID TIMER1_id
100# define FS1_TIMER_BIT TIMER0bit
101# define FS2_TIMER_BIT TIMER1bit
102#endif
103
104/*
105 * Timer Configuration Register Bits
106 */
107#define TIMER_ERR 0xC000
108#define TIMER_ERR_OVFL 0x4000
109#define TIMER_ERR_PROG_PER 0x8000
110#define TIMER_ERR_PROG_PW 0xC000
111#define TIMER_EMU_RUN 0x0200
112#define TIMER_TOGGLE_HI 0x0100
113#define TIMER_CLK_SEL 0x0080
114#define TIMER_OUT_DIS 0x0040
115#define TIMER_TIN_SEL 0x0020
116#define TIMER_IRQ_ENA 0x0010
117#define TIMER_PERIOD_CNT 0x0008
118#define TIMER_PULSE_HI 0x0004
119#define TIMER_MODE 0x0003
120#define TIMER_MODE_PWM 0x0001
121#define TIMER_MODE_WDTH 0x0002
122#define TIMER_MODE_EXT_CLK 0x0003
123
124/*
125 * Timer Status Register Bits
126 */
127#define TIMER_STATUS_TIMIL0 0x0001
128#define TIMER_STATUS_TIMIL1 0x0002
129#define TIMER_STATUS_TIMIL2 0x0004
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#define TIMER_STATUS_TIMIL8 0x0001
136#define TIMER_STATUS_TIMIL9 0x0002
137#define TIMER_STATUS_TIMIL10 0x0004
138#define TIMER_STATUS_TIMIL11 0x0008
139
140#define TIMER_STATUS_TOVF0 0x0010 /* timer 0 overflow error */
141#define TIMER_STATUS_TOVF1 0x0020
142#define TIMER_STATUS_TOVF2 0x0040
143#define TIMER_STATUS_TOVF3 0x00000080
144#define TIMER_STATUS_TOVF4 0x00100000
145#define TIMER_STATUS_TOVF5 0x00200000
146#define TIMER_STATUS_TOVF6 0x00400000
147#define TIMER_STATUS_TOVF7 0x00800000
148#define TIMER_STATUS_TOVF8 0x0010
149#define TIMER_STATUS_TOVF9 0x0020
150#define TIMER_STATUS_TOVF10 0x0040
151#define TIMER_STATUS_TOVF11 0x0080
152
153/*
154 * Timer Slave Enable Status : write 1 to clear
155 */
156#define TIMER_STATUS_TRUN0 0x1000
157#define TIMER_STATUS_TRUN1 0x2000
158#define TIMER_STATUS_TRUN2 0x4000
159#define TIMER_STATUS_TRUN3 0x00008000
160#define TIMER_STATUS_TRUN4 0x10000000
161#define TIMER_STATUS_TRUN5 0x20000000
162#define TIMER_STATUS_TRUN6 0x40000000
163#define TIMER_STATUS_TRUN7 0x80000000
164#define TIMER_STATUS_TRUN 0xF000F000
165#define TIMER_STATUS_TRUN8 0x1000
166#define TIMER_STATUS_TRUN9 0x2000
167#define TIMER_STATUS_TRUN10 0x4000
168#define TIMER_STATUS_TRUN11 0x8000
169
170/* The actual gptimer API */
171
172void set_gptimer_pwidth (int timer_id, uint32_t width);
173uint32_t get_gptimer_pwidth (int timer_id);
174void set_gptimer_period (int timer_id, uint32_t period);
175uint32_t get_gptimer_period (int timer_id);
176uint32_t get_gptimer_count (int timer_id);
177uint16_t get_gptimer_intr (int timer_id);
178void clear_gptimer_intr (int timer_id);
179uint16_t get_gptimer_over (int timer_id);
180void clear_gptimer_over (int timer_id);
181void set_gptimer_config (int timer_id, uint16_t config);
182uint16_t get_gptimer_config (int timer_id);
183void set_gptimer_pulse_hi (int timer_id);
184void clear_gptimer_pulse_hi(int timer_id);
185void enable_gptimers (uint16_t mask);
186void disable_gptimers (uint16_t mask);
187uint16_t get_enabled_gptimers (void);
188uint32_t get_gptimer_status (int group);
189void set_gptimer_status (int group, uint32_t value);
190
191#endif
diff --git a/include/asm-blackfin/hardirq.h b/include/asm-blackfin/hardirq.h
deleted file mode 100644
index b6b19f1b9dab..000000000000
--- a/include/asm-blackfin/hardirq.h
+++ /dev/null
@@ -1,45 +0,0 @@
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#if NR_IRQS > 256
32#define HARDIRQ_BITS 9
33#else
34#define HARDIRQ_BITS 8
35#endif
36
37#ifdef NR_IRQS
38# if (1 << HARDIRQ_BITS) < NR_IRQS
39# error HARDIRQ_BITS is too low!
40# endif
41#endif
42
43#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
44
45#endif
diff --git a/include/asm-blackfin/hw_irq.h b/include/asm-blackfin/hw_irq.h
deleted file mode 100644
index 5b51eaec012c..000000000000
--- a/include/asm-blackfin/hw_irq.h
+++ /dev/null
@@ -1,6 +0,0 @@
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/io.h b/include/asm-blackfin/io.h
deleted file mode 100644
index cbbf7ffdbbff..000000000000
--- a/include/asm-blackfin/io.h
+++ /dev/null
@@ -1,212 +0,0 @@
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(const volatile 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(const volatile 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(const volatile 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(unsigned long port, const void *addr, unsigned long count);
119extern void outsw(unsigned long port, const void *addr, unsigned long count);
120extern void outsw_8(unsigned long port, const void *addr, unsigned long count);
121extern void outsl(unsigned long port, const void *addr, unsigned long count);
122
123extern void insb(unsigned long port, void *addr, unsigned long count);
124extern void insw(unsigned long port, void *addr, unsigned long count);
125extern void insw_8(unsigned long port, void *addr, unsigned long count);
126extern void insl(unsigned long port, void *addr, unsigned long count);
127extern void insl_16(unsigned long port, void *addr, unsigned long count);
128
129extern void dma_outsb(unsigned long port, const void *addr, unsigned short count);
130extern void dma_outsw(unsigned long port, const void *addr, unsigned short count);
131extern void dma_outsl(unsigned long port, const void *addr, unsigned short count);
132
133extern void dma_insb(unsigned long port, void *addr, unsigned short count);
134extern void dma_insw(unsigned long port, void *addr, unsigned short count);
135extern void dma_insl(unsigned long port, void *addr, unsigned short count);
136
137/*
138 * Map some physical address range into the kernel address space.
139 */
140static inline void __iomem *__ioremap(unsigned long physaddr, unsigned long size,
141 int cacheflag)
142{
143 return (void __iomem *)physaddr;
144}
145
146/*
147 * Unmap a ioremap()ed region again
148 */
149static inline void iounmap(void *addr)
150{
151}
152
153/*
154 * __iounmap unmaps nearly everything, so be careful
155 * it doesn't free currently pointer/page tables anymore but it
156 * wans't used anyway and might be added later.
157 */
158static inline void __iounmap(void *addr, unsigned long size)
159{
160}
161
162/*
163 * Set new cache mode for some kernel address space.
164 * The caller must push data for that range itself, if such data may already
165 * be in the cache.
166 */
167static inline void kernel_set_cachemode(void *addr, unsigned long size,
168 int cmode)
169{
170}
171
172static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
173{
174 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
175}
176static inline void __iomem *ioremap_nocache(unsigned long physaddr,
177 unsigned long size)
178{
179 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
180}
181
182extern void blkfin_inv_cache_all(void);
183
184#endif
185
186#define ioport_map(port, nr) ((void __iomem*)(port))
187#define ioport_unmap(addr)
188
189/* Pages to physical address... */
190#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
191#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
192
193#define phys_to_virt(vaddr) ((void *) (vaddr))
194#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
195
196#define virt_to_bus virt_to_phys
197#define bus_to_virt phys_to_virt
198
199/*
200 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
201 * access
202 */
203#define xlate_dev_mem_ptr(p) __va(p)
204
205/*
206 * Convert a virtual cached pointer to an uncached pointer
207 */
208#define xlate_dev_kmem_ptr(p) p
209
210#endif /* __KERNEL__ */
211
212#endif /* _BFIN_IO_H */
diff --git a/include/asm-blackfin/ioctl.h b/include/asm-blackfin/ioctl.h
deleted file mode 100644
index b279fe06dfe5..000000000000
--- a/include/asm-blackfin/ioctl.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ioctl.h>
diff --git a/include/asm-blackfin/ioctls.h b/include/asm-blackfin/ioctls.h
deleted file mode 100644
index 895e3173165d..000000000000
--- a/include/asm-blackfin/ioctls.h
+++ /dev/null
@@ -1,87 +0,0 @@
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 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)
54/* Get Pty Number (of pty-mux device) */
55#define TIOCGPTN _IOR('T', 0x30, unsigned int)
56#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
57
58#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
59#define FIOCLEX 0x5451
60#define FIOASYNC 0x5452
61#define TIOCSERCONFIG 0x5453
62#define TIOCSERGWILD 0x5454
63#define TIOCSERSWILD 0x5455
64#define TIOCGLCKTRMIOS 0x5456
65#define TIOCSLCKTRMIOS 0x5457
66#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
67#define TIOCSERGETLSR 0x5459 /* Get line status register */
68#define TIOCSERGETMULTI 0x545A /* Get multiport config */
69#define TIOCSERSETMULTI 0x545B /* Set multiport config */
70
71#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
72#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
73
74#define FIOQSIZE 0x545E
75
76/* Used for packet mode */
77#define TIOCPKT_DATA 0
78#define TIOCPKT_FLUSHREAD 1
79#define TIOCPKT_FLUSHWRITE 2
80#define TIOCPKT_STOP 4
81#define TIOCPKT_START 8
82#define TIOCPKT_NOSTOP 16
83#define TIOCPKT_DOSTOP 32
84
85#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
86
87#endif /* __ARCH_BFIN_IOCTLS_H__ */
diff --git a/include/asm-blackfin/ipcbuf.h b/include/asm-blackfin/ipcbuf.h
deleted file mode 100644
index 8f0899cdf4d2..000000000000
--- a/include/asm-blackfin/ipcbuf.h
+++ /dev/null
@@ -1,30 +0,0 @@
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
deleted file mode 100644
index 86b67834354d..000000000000
--- a/include/asm-blackfin/irq.h
+++ /dev/null
@@ -1,72 +0,0 @@
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#define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
71
72#endif /* _BFIN_IRQ_H_ */
diff --git a/include/asm-blackfin/irq_handler.h b/include/asm-blackfin/irq_handler.h
deleted file mode 100644
index 139b5208f9d8..000000000000
--- a/include/asm-blackfin/irq_handler.h
+++ /dev/null
@@ -1,33 +0,0 @@
1#ifndef _IRQ_HANDLER_H
2#define _IRQ_HANDLER_H
3
4#include <linux/types.h>
5#include <linux/linkage.h>
6
7/* BASE LEVEL interrupt handler routines */
8asmlinkage void evt_exception(void);
9asmlinkage void trap(void);
10asmlinkage void evt_ivhw(void);
11asmlinkage void evt_timer(void);
12asmlinkage void evt_nmi(void);
13asmlinkage void evt_evt7(void);
14asmlinkage void evt_evt8(void);
15asmlinkage void evt_evt9(void);
16asmlinkage void evt_evt10(void);
17asmlinkage void evt_evt11(void);
18asmlinkage void evt_evt12(void);
19asmlinkage void evt_evt13(void);
20asmlinkage void evt_soft_int1(void);
21asmlinkage void evt_system_call(void);
22asmlinkage void init_exception_buff(void);
23asmlinkage void trap_c(struct pt_regs *fp);
24asmlinkage void ex_replaceable(void);
25asmlinkage void early_trap(void);
26
27extern void *ex_table[];
28extern void return_from_exception(void);
29
30extern int bfin_request_exception(unsigned int exception, void (*handler)(void));
31extern int bfin_free_exception(unsigned int exception, void (*handler)(void));
32
33#endif
diff --git a/include/asm-blackfin/irq_regs.h b/include/asm-blackfin/irq_regs.h
deleted file mode 100644
index 3dd9c0b70270..000000000000
--- a/include/asm-blackfin/irq_regs.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/irq_regs.h>
diff --git a/include/asm-blackfin/kdebug.h b/include/asm-blackfin/kdebug.h
deleted file mode 100644
index 6ece1b037665..000000000000
--- a/include/asm-blackfin/kdebug.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/kdebug.h>
diff --git a/include/asm-blackfin/kgdb.h b/include/asm-blackfin/kgdb.h
deleted file mode 100644
index 0f73847fd6bc..000000000000
--- a/include/asm-blackfin/kgdb.h
+++ /dev/null
@@ -1,184 +0,0 @@
1/*
2 * File: include/asm-blackfin/kgdb.h
3 * Based on:
4 * Author: Sonic Zhang
5 *
6 * Created:
7 * Description:
8 *
9 * Rev: $Id: kgdb_bfin_linux-2.6.x.patch 4934 2007-02-13 09:32:11Z sonicz $
10 *
11 * Modified:
12 * Copyright 2005-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 of the License, or
19 * (at your option) 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; if not, see the file COPYING, or write
28 * to the Free Software Foundation, Inc.,
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */
31
32#ifndef __ASM_BLACKFIN_KGDB_H__
33#define __ASM_BLACKFIN_KGDB_H__
34
35#include <linux/ptrace.h>
36
37/* gdb locks */
38#define KGDB_MAX_NO_CPUS 8
39
40/************************************************************************/
41/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
42/* at least NUMREGBYTES*2 are needed for register packets */
43/* Longer buffer is needed to list all threads */
44#define BUFMAX 2048
45
46/*
47 * Note that this register image is different from
48 * the register image that Linux produces at interrupt time.
49 *
50 * Linux's register image is defined by struct pt_regs in ptrace.h.
51 */
52enum regnames {
53 /* Core Registers */
54 BFIN_R0 = 0,
55 BFIN_R1,
56 BFIN_R2,
57 BFIN_R3,
58 BFIN_R4,
59 BFIN_R5,
60 BFIN_R6,
61 BFIN_R7,
62 BFIN_P0,
63 BFIN_P1,
64 BFIN_P2,
65 BFIN_P3,
66 BFIN_P4,
67 BFIN_P5,
68 BFIN_SP,
69 BFIN_FP,
70 BFIN_I0,
71 BFIN_I1,
72 BFIN_I2,
73 BFIN_I3,
74 BFIN_M0,
75 BFIN_M1,
76 BFIN_M2,
77 BFIN_M3,
78 BFIN_B0,
79 BFIN_B1,
80 BFIN_B2,
81 BFIN_B3,
82 BFIN_L0,
83 BFIN_L1,
84 BFIN_L2,
85 BFIN_L3,
86 BFIN_A0_DOT_X,
87 BFIN_A0_DOT_W,
88 BFIN_A1_DOT_X,
89 BFIN_A1_DOT_W,
90 BFIN_ASTAT,
91 BFIN_RETS,
92 BFIN_LC0,
93 BFIN_LT0,
94 BFIN_LB0,
95 BFIN_LC1,
96 BFIN_LT1,
97 BFIN_LB1,
98 BFIN_CYCLES,
99 BFIN_CYCLES2,
100 BFIN_USP,
101 BFIN_SEQSTAT,
102 BFIN_SYSCFG,
103 BFIN_RETI,
104 BFIN_RETX,
105 BFIN_RETN,
106 BFIN_RETE,
107
108 /* Pseudo Registers */
109 BFIN_PC,
110 BFIN_CC,
111 BFIN_EXTRA1, /* Address of .text section. */
112 BFIN_EXTRA2, /* Address of .data section. */
113 BFIN_EXTRA3, /* Address of .bss section. */
114 BFIN_FDPIC_EXEC,
115 BFIN_FDPIC_INTERP,
116
117 /* MMRs */
118 BFIN_IPEND,
119
120 /* LAST ENTRY SHOULD NOT BE CHANGED. */
121 BFIN_NUM_REGS /* The number of all registers. */
122};
123
124/* Number of bytes of registers. */
125#define NUMREGBYTES BFIN_NUM_REGS*4
126
127#define BREAKPOINT() asm(" EXCPT 2;");
128#define BREAK_INSTR_SIZE 2
129#define HW_BREAKPOINT_NUM 6
130
131/* Instruction watchpoint address control register bits mask */
132#define WPPWR 0x1
133#define WPIREN01 0x2
134#define WPIRINV01 0x4
135#define WPIAEN0 0x8
136#define WPIAEN1 0x10
137#define WPICNTEN0 0x20
138#define WPICNTEN1 0x40
139#define EMUSW0 0x80
140#define EMUSW1 0x100
141#define WPIREN23 0x200
142#define WPIRINV23 0x400
143#define WPIAEN2 0x800
144#define WPIAEN3 0x1000
145#define WPICNTEN2 0x2000
146#define WPICNTEN3 0x4000
147#define EMUSW2 0x8000
148#define EMUSW3 0x10000
149#define WPIREN45 0x20000
150#define WPIRINV45 0x40000
151#define WPIAEN4 0x80000
152#define WPIAEN5 0x100000
153#define WPICNTEN4 0x200000
154#define WPICNTEN5 0x400000
155#define EMUSW4 0x800000
156#define EMUSW5 0x1000000
157#define WPAND 0x2000000
158
159/* Data watchpoint address control register bits mask */
160#define WPDREN01 0x1
161#define WPDRINV01 0x2
162#define WPDAEN0 0x4
163#define WPDAEN1 0x8
164#define WPDCNTEN0 0x10
165#define WPDCNTEN1 0x20
166#define WPDSRC0 0xc0
167#define WPDACC0 0x300
168#define WPDSRC1 0xc00
169#define WPDACC1 0x3000
170
171/* Watchpoint status register bits mask */
172#define STATIA0 0x1
173#define STATIA1 0x2
174#define STATIA2 0x4
175#define STATIA3 0x8
176#define STATIA4 0x10
177#define STATIA5 0x20
178#define STATDA0 0x40
179#define STATDA1 0x80
180
181extern void kgdb_print(const char *fmt, ...);
182extern void init_kgdb_uart(void);
183
184#endif
diff --git a/include/asm-blackfin/kmap_types.h b/include/asm-blackfin/kmap_types.h
deleted file mode 100644
index e215f7104974..000000000000
--- a/include/asm-blackfin/kmap_types.h
+++ /dev/null
@@ -1,21 +0,0 @@
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
deleted file mode 100644
index c13ded777828..000000000000
--- a/include/asm-blackfin/l1layout.h
+++ /dev/null
@@ -1,31 +0,0 @@
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
deleted file mode 100644
index 5a822bb790f7..000000000000
--- a/include/asm-blackfin/linkage.h
+++ /dev/null
@@ -1,7 +0,0 @@
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
deleted file mode 100644
index 75afffbc6421..000000000000
--- a/include/asm-blackfin/local.h
+++ /dev/null
@@ -1,6 +0,0 @@
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-bf527/anomaly.h b/include/asm-blackfin/mach-bf527/anomaly.h
deleted file mode 100644
index b7b166f4f064..000000000000
--- a/include/asm-blackfin/mach-bf527/anomaly.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/anomaly.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2004-2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9/* This file shoule be up to date with:
10 * - Revision C, 01/25/2008; ADSP-BF527 Blackfin Processor Anomaly List
11 */
12
13#ifndef _MACH_ANOMALY_H_
14#define _MACH_ANOMALY_H_
15
16/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */
17#define ANOMALY_05000074 (1)
18/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
19#define ANOMALY_05000119 (1)
20/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
21#define ANOMALY_05000122 (1)
22/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */
23#define ANOMALY_05000245 (1)
24/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
25#define ANOMALY_05000265 (1)
26/* New Feature: EMAC TX DMA Word Alignment */
27#define ANOMALY_05000285 (1)
28/* Errors when SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
29#define ANOMALY_05000312 (1)
30/* Incorrect Access of OTP_STATUS During otp_write() Function */
31#define ANOMALY_05000328 (1)
32/* Disallowed Configuration Prevents Subsequent Allowed Configuration on Host DMA Port */
33#define ANOMALY_05000337 (1)
34/* Ethernet MAC MDIO Reads Do Not Meet IEEE Specification */
35#define ANOMALY_05000341 (1)
36/* TWI May Not Operate Correctly Under Certain Signal Termination Conditions */
37#define ANOMALY_05000342 (1)
38/* USB Calibration Value Is Not Initialized */
39#define ANOMALY_05000346 (1)
40/* Preboot Routine Incorrectly Alters Reset Value of USB Register */
41#define ANOMALY_05000347 (1)
42/* Security Features Are Not Functional */
43#define ANOMALY_05000348 (__SILICON_REVISION__ < 1)
44/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */
45#define ANOMALY_05000355 (1)
46/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
47#define ANOMALY_05000357 (1)
48/* Incorrect Revision Number in DSPID Register */
49#define ANOMALY_05000364 (__SILICON_REVISION__ > 0)
50/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
51#define ANOMALY_05000366 (1)
52/* New Feature: Higher Default CCLK Rate */
53#define ANOMALY_05000368 (1)
54/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
55#define ANOMALY_05000371 (1)
56/* Authentication Fails To Initiate */
57#define ANOMALY_05000376 (__SILICON_REVISION__ > 0)
58/* Data Read From L3 Memory by USB DMA May be Corrupted */
59#define ANOMALY_05000380 (1)
60/* USB Full-speed Mode not Fully Tested */
61#define ANOMALY_05000381 (1)
62/* New Feature: Boot from OTP Memory */
63#define ANOMALY_05000385 (1)
64/* New Feature: bfrom_SysControl() Routine */
65#define ANOMALY_05000386 (1)
66/* New Feature: Programmable Preboot Settings */
67#define ANOMALY_05000387 (1)
68/* Reset Vector Must Not Be in SDRAM Memory Space */
69#define ANOMALY_05000389 (1)
70/* New Feature: pTempCurrent Added to ADI_BOOT_DATA Structure */
71#define ANOMALY_05000392 (1)
72/* New Feature: dTempByteCount Value Increased in ADI_BOOT_DATA Structure */
73#define ANOMALY_05000393 (1)
74/* New Feature: Log Buffer Functionality */
75#define ANOMALY_05000394 (1)
76/* New Feature: Hook Routine Functionality */
77#define ANOMALY_05000395 (1)
78/* New Feature: Header Indirect Bit */
79#define ANOMALY_05000396 (1)
80/* New Feature: BK_ONES, BK_ZEROS, and BK_DATECODE Constants */
81#define ANOMALY_05000397 (1)
82/* New Feature: SWRESET, DFRESET and WDRESET Bits Added to SYSCR Register */
83#define ANOMALY_05000398 (1)
84/* New Feature: BCODE_NOBOOT Added to BCODE Field of SYSCR Register */
85#define ANOMALY_05000399 (1)
86/* PPI Data Signals D0 and D8 do not Tristate After Disabling PPI */
87#define ANOMALY_05000401 (1)
88
89/* Anomalies that don't exist on this proc */
90#define ANOMALY_05000125 (0)
91#define ANOMALY_05000158 (0)
92#define ANOMALY_05000183 (0)
93#define ANOMALY_05000198 (0)
94#define ANOMALY_05000230 (0)
95#define ANOMALY_05000244 (0)
96#define ANOMALY_05000261 (0)
97#define ANOMALY_05000263 (0)
98#define ANOMALY_05000266 (0)
99#define ANOMALY_05000273 (0)
100#define ANOMALY_05000311 (0)
101#define ANOMALY_05000323 (0)
102#define ANOMALY_05000363 (0)
103
104#endif
diff --git a/include/asm-blackfin/mach-bf527/bf527.h b/include/asm-blackfin/mach-bf527/bf527.h
deleted file mode 100644
index 056eb4b9cd25..000000000000
--- a/include/asm-blackfin/mach-bf527/bf527.h
+++ /dev/null
@@ -1,127 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/bf527.h
3 * Based on: include/asm-blackfin/mach-bf537/bf537.h
4 * Author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * Created:
7 * Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF527
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#ifndef __MACH_BF527_H__
31#define __MACH_BF527_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#define BFIN_DSUBBANKS 4
55#define BFIN_DWAYS 2
56#define BFIN_DLINES 64
57#define BFIN_ISUBBANKS 4
58#define BFIN_IWAYS 4
59#define BFIN_ILINES 32
60
61#define WAY0_L 0x1
62#define WAY1_L 0x2
63#define WAY01_L 0x3
64#define WAY2_L 0x4
65#define WAY02_L 0x5
66#define WAY12_L 0x6
67#define WAY012_L 0x7
68
69#define WAY3_L 0x8
70#define WAY03_L 0x9
71#define WAY13_L 0xA
72#define WAY013_L 0xB
73
74#define WAY32_L 0xC
75#define WAY320_L 0xD
76#define WAY321_L 0xE
77#define WAYALL_L 0xF
78
79#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
80
81/********************************* EBIU Settings ************************************/
82#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
83#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
84
85#ifdef CONFIG_C_AMBEN_ALL
86#define V_AMBEN AMBEN_ALL
87#endif
88#ifdef CONFIG_C_AMBEN
89#define V_AMBEN 0x0
90#endif
91#ifdef CONFIG_C_AMBEN_B0
92#define V_AMBEN AMBEN_B0
93#endif
94#ifdef CONFIG_C_AMBEN_B0_B1
95#define V_AMBEN AMBEN_B0_B1
96#endif
97#ifdef CONFIG_C_AMBEN_B0_B1_B2
98#define V_AMBEN AMBEN_B0_B1_B2
99#endif
100#ifdef CONFIG_C_AMCKEN
101#define V_AMCKEN AMCKEN
102#else
103#define V_AMCKEN 0x0
104#endif
105#ifdef CONFIG_C_CDPRIO
106#define V_CDPRIO 0x100
107#else
108#define V_CDPRIO 0x0
109#endif
110
111#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
112
113#ifdef CONFIG_BF527
114#define CPU "BF527"
115#endif
116#ifdef CONFIG_BF525
117#define CPU "BF525"
118#endif
119#ifdef CONFIG_BF522
120#define CPU "BF522"
121#endif
122#ifndef CPU
123#define CPU "UNKNOWN"
124#define CPUID 0x0
125#endif
126
127#endif /* __MACH_BF527_H__ */
diff --git a/include/asm-blackfin/mach-bf527/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
deleted file mode 100644
index 2526b6ed6faa..000000000000
--- a/include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
+++ /dev/null
@@ -1,195 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * blackfin serial driver head file
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#include <linux/serial.h>
33#include <asm/dma.h>
34#include <asm/portmux.h>
35
36#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
37#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
38#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
39#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
40#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
41#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
42#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
43
44#define UART_PUT_CHAR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_THR), v)
45#define UART_PUT_DLL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_DLL), v)
46#define UART_PUT_IER(uart, v) bfin_write16(((uart)->port.membase + OFFSET_IER), v)
47#define UART_SET_IER(uart, v) UART_PUT_IER(uart, UART_GET_IER(uart) | (v))
48#define UART_CLEAR_IER(uart, v) UART_PUT_IER(uart, UART_GET_IER(uart) & ~(v))
49#define UART_PUT_DLH(uart, v) bfin_write16(((uart)->port.membase + OFFSET_DLH), v)
50#define UART_PUT_LCR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_LCR), v)
51#define UART_PUT_GCTL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_GCTL), v)
52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
60#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
61
62#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
63# define CONFIG_SERIAL_BFIN_CTSRTS
64
65# ifndef CONFIG_UART0_CTS_PIN
66# define CONFIG_UART0_CTS_PIN -1
67# endif
68
69# ifndef CONFIG_UART0_RTS_PIN
70# define CONFIG_UART0_RTS_PIN -1
71# endif
72
73# ifndef CONFIG_UART1_CTS_PIN
74# define CONFIG_UART1_CTS_PIN -1
75# endif
76
77# ifndef CONFIG_UART1_RTS_PIN
78# define CONFIG_UART1_RTS_PIN -1
79# endif
80#endif
81/*
82 * The pin configuration is different from schematic
83 */
84struct bfin_serial_port {
85 struct uart_port port;
86 unsigned int old_status;
87 unsigned int lsr;
88#ifdef CONFIG_SERIAL_BFIN_DMA
89 int tx_done;
90 int tx_count;
91 struct circ_buf rx_dma_buf;
92 struct timer_list rx_dma_timer;
93 int rx_dma_nrows;
94 unsigned int tx_dma_channel;
95 unsigned int rx_dma_channel;
96 struct work_struct tx_dma_workqueue;
97#endif
98#ifdef CONFIG_SERIAL_BFIN_CTSRTS
99 struct timer_list cts_timer;
100 int cts_pin;
101 int rts_pin;
102#endif
103};
104
105/* The hardware clears the LSR bits upon read, so we need to cache
106 * some of the more fun bits in software so they don't get lost
107 * when checking the LSR in other code paths (TX).
108 */
109static inline unsigned int UART_GET_LSR(struct bfin_serial_port *uart)
110{
111 unsigned int lsr = bfin_read16(uart->port.membase + OFFSET_LSR);
112 uart->lsr |= (lsr & (BI|FE|PE|OE));
113 return lsr | uart->lsr;
114}
115
116static inline void UART_CLEAR_LSR(struct bfin_serial_port *uart)
117{
118 uart->lsr = 0;
119 bfin_write16(uart->port.membase + OFFSET_LSR, -1);
120}
121
122struct bfin_serial_port bfin_serial_ports[BFIN_UART_NR_PORTS];
123struct bfin_serial_res {
124 unsigned long uart_base_addr;
125 int uart_irq;
126#ifdef CONFIG_SERIAL_BFIN_DMA
127 unsigned int uart_tx_dma_channel;
128 unsigned int uart_rx_dma_channel;
129#endif
130#ifdef CONFIG_SERIAL_BFIN_CTSRTS
131 int uart_cts_pin;
132 int uart_rts_pin;
133#endif
134};
135
136struct bfin_serial_res bfin_serial_resource[] = {
137#ifdef CONFIG_SERIAL_BFIN_UART0
138 {
139 0xFFC00400,
140 IRQ_UART0_RX,
141#ifdef CONFIG_SERIAL_BFIN_DMA
142 CH_UART0_TX,
143 CH_UART0_RX,
144#endif
145#ifdef CONFIG_BFIN_UART0_CTSRTS
146 CONFIG_UART0_CTS_PIN,
147 CONFIG_UART0_RTS_PIN,
148#endif
149 },
150#endif
151#ifdef CONFIG_SERIAL_BFIN_UART1
152 {
153 0xFFC02000,
154 IRQ_UART1_RX,
155#ifdef CONFIG_SERIAL_BFIN_DMA
156 CH_UART1_TX,
157 CH_UART1_RX,
158#endif
159#ifdef CONFIG_BFIN_UART1_CTSRTS
160 CONFIG_UART1_CTS_PIN,
161 CONFIG_UART1_RTS_PIN,
162#endif
163 },
164#endif
165};
166
167int nr_ports = ARRAY_SIZE(bfin_serial_resource);
168
169#define DRIVER_NAME "bfin-uart"
170
171static void bfin_serial_hw_init(struct bfin_serial_port *uart)
172{
173
174#ifdef CONFIG_SERIAL_BFIN_UART0
175 peripheral_request(P_UART0_TX, DRIVER_NAME);
176 peripheral_request(P_UART0_RX, DRIVER_NAME);
177#endif
178
179#ifdef CONFIG_SERIAL_BFIN_UART1
180 peripheral_request(P_UART1_TX, DRIVER_NAME);
181 peripheral_request(P_UART1_RX, DRIVER_NAME);
182#endif
183
184#ifdef CONFIG_SERIAL_BFIN_CTSRTS
185 if (uart->cts_pin >= 0) {
186 gpio_request(uart->cts_pin, DRIVER_NAME);
187 gpio_direction_input(uart->cts_pin);
188 }
189
190 if (uart->rts_pin >= 0) {
191 gpio_request(uart->rts_pin, DRIVER_NAME);
192 gpio_direction_output(uart->rts_pin, 0);
193 }
194#endif
195}
diff --git a/include/asm-blackfin/mach-bf527/bfin_sir.h b/include/asm-blackfin/mach-bf527/bfin_sir.h
deleted file mode 100644
index cfd8ad4f1f2c..000000000000
--- a/include/asm-blackfin/mach-bf527/bfin_sir.h
+++ /dev/null
@@ -1,142 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART0_RX,
69 CH_UART0_RX,
70 CH_UART0_TX,
71 },
72#endif
73#ifdef CONFIG_BFIN_SIR1
74 {
75 0xFFC02000,
76 IRQ_UART1_RX,
77 CH_UART1_RX,
78 CH_UART1_TX,
79 },
80#endif
81};
82
83int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
84
85struct bfin_sir_self {
86 struct bfin_sir_port *sir_port;
87 spinlock_t lock;
88 unsigned int open;
89 int speed;
90 int newspeed;
91
92 struct sk_buff *txskb;
93 struct sk_buff *rxskb;
94 struct net_device_stats stats;
95 struct device *dev;
96 struct irlap_cb *irlap;
97 struct qos_info qos;
98
99 iobuff_t tx_buff;
100 iobuff_t rx_buff;
101
102 struct work_struct work;
103 int mtt;
104};
105
106static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
107{
108 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
109 port->lsr |= (lsr & (BI|FE|PE|OE));
110 return lsr | port->lsr;
111}
112
113static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
114{
115 port->lsr = 0;
116 bfin_read16(port->membase + OFFSET_LSR);
117}
118
119#define DRIVER_NAME "bfin_sir"
120
121static int bfin_sir_hw_init(void)
122{
123 int ret = -ENODEV;
124#ifdef CONFIG_BFIN_SIR0
125 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
126 if (ret)
127 return ret;
128 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
129 if (ret)
130 return ret;
131#endif
132
133#ifdef CONFIG_BFIN_SIR1
134 ret = peripheral_request(P_UART1_TX, DRIVER_NAME);
135 if (ret)
136 return ret;
137 ret = peripheral_request(P_UART1_RX, DRIVER_NAME);
138 if (ret)
139 return ret;
140#endif
141 return ret;
142}
diff --git a/include/asm-blackfin/mach-bf527/blackfin.h b/include/asm-blackfin/mach-bf527/blackfin.h
deleted file mode 100644
index 297821e2d79a..000000000000
--- a/include/asm-blackfin/mach-bf527/blackfin.h
+++ /dev/null
@@ -1,93 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/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 BF527_FAMILY
36
37#include "bf527.h"
38#include "mem_map.h"
39#include "defBF522.h"
40#include "anomaly.h"
41
42#if defined(CONFIG_BF527) || defined(CONFIG_BF526)
43#include "defBF527.h"
44#endif
45
46#if defined(CONFIG_BF525) || defined(CONFIG_BF524)
47#include "defBF525.h"
48#endif
49
50#if !defined(__ASSEMBLY__)
51#include "cdefBF522.h"
52
53#if defined(CONFIG_BF527) || defined(CONFIG_BF526)
54#include "cdefBF527.h"
55#endif
56
57#if defined(CONFIG_BF525) || defined(CONFIG_BF524)
58#include "cdefBF525.h"
59#endif
60#endif
61
62/* UART_IIR Register */
63#define STATUS(x) ((x << 1) & 0x06)
64#define STATUS_P1 0x02
65#define STATUS_P0 0x01
66
67#define BFIN_UART_NR_PORTS 2
68
69#define OFFSET_THR 0x00 /* Transmit Holding register */
70#define OFFSET_RBR 0x00 /* Receive Buffer register */
71#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
72#define OFFSET_IER 0x04 /* Interrupt Enable Register */
73#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
74#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
75#define OFFSET_LCR 0x0C /* Line Control Register */
76#define OFFSET_MCR 0x10 /* Modem Control Register */
77#define OFFSET_LSR 0x14 /* Line Status Register */
78#define OFFSET_MSR 0x18 /* Modem Status Register */
79#define OFFSET_SCR 0x1C /* SCR Scratch Register */
80#define OFFSET_GCTL 0x24 /* Global Control Register */
81
82/* DPMC*/
83#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
84#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
85#define STOPCK_OFF STOPCK
86
87/* PLL_DIV Masks */
88#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
89#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
90#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
91#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
92
93#endif
diff --git a/include/asm-blackfin/mach-bf527/cdefBF522.h b/include/asm-blackfin/mach-bf527/cdefBF522.h
deleted file mode 100644
index 52c06494b886..000000000000
--- a/include/asm-blackfin/mach-bf527/cdefBF522.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/cdefbf522.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_BF522_H
33#define _CDEF_BF522_H
34
35/* include all Core registers and bit definitions */
36#include "defBF522.h"
37
38/* include core specific register pointer definitions */
39#include <asm/mach-common/cdef_LPBlackfin.h>
40
41/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF522 */
42
43/* include cdefBF52x_base.h for the set of #defines that are common to all ADSP-BF52x processors */
44#include "cdefBF52x_base.h"
45
46#endif /* _CDEF_BF522_H */
diff --git a/include/asm-blackfin/mach-bf527/cdefBF525.h b/include/asm-blackfin/mach-bf527/cdefBF525.h
deleted file mode 100644
index 2cc67e4b4d86..000000000000
--- a/include/asm-blackfin/mach-bf527/cdefBF525.h
+++ /dev/null
@@ -1,461 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/cdefbf525.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_BF525_H
33#define _CDEF_BF525_H
34
35/* include all Core registers and bit definitions */
36#include "defBF525.h"
37
38/* include core specific register pointer definitions */
39#include <asm/mach-common/cdef_LPBlackfin.h>
40
41/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF525 */
42
43/* include cdefBF52x_base.h for the set of #defines that are common to all ADSP-BF52x processors */
44#include "cdefBF52x_base.h"
45
46/* The following are the #defines needed by ADSP-BF525 that are not in the common header */
47
48/* USB Control Registers */
49
50#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
51#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
52#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
53#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
54#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
55#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
56#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
57#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
58#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
59#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
60#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
61#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
62#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
63#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
64#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
65#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
66#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
67#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
68#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
69#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
70#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
71#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
72#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
73#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
74#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
75#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
76
77/* USB Packet Control Registers */
78
79#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
80#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
81#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
82#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
83#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
84#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
85#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
86#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
87#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
88#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
89#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
90#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
91#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
92#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
93#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
94#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
95#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
96#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
97#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
98#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
99#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
100#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
101#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
102#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
103#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
104#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
105
106/* USB Endpoint FIFO Registers */
107
108#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
109#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
110#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
111#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
112#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
113#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
114#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
115#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
116#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
117#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
118#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
119#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
120#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
121#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
122#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
123#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
124
125/* USB OTG Control Registers */
126
127#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
128#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
129#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
130#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
131#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
132#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
133
134/* USB Phy Control Registers */
135
136#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
137#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
138#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
139#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
140#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
141#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
142#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
143#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
144#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
145#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
146
147/* (APHY_CNTRL is for ADI usage only) */
148
149#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
150#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
151
152/* (APHY_CALIB is for ADI usage only) */
153
154#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
155#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
156
157#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
158#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
159
160/* (PHY_TEST is for ADI usage only) */
161
162#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
163#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
164
165#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
166#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
167#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
168#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
169
170/* USB Endpoint 0 Control Registers */
171
172#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
173#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
174#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
175#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
176#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
177#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
178#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
179#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
180#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
181#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
182#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
183#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
184#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
185#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
186#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
187#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
188#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
189#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
190#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
191#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
192
193/* USB Endpoint 1 Control Registers */
194
195#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
196#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
197#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
198#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
199#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
200#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
201#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
202#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
203#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
204#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
205#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
206#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
207#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
208#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
209#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
210#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
211#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
212#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
213#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
214#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
215
216/* USB Endpoint 2 Control Registers */
217
218#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
219#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
220#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
221#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
222#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
223#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
224#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
225#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
226#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
227#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
228#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
229#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
230#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
231#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
232#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
233#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
234#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
235#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
236#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
237#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
238
239/* USB Endpoint 3 Control Registers */
240
241#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
242#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
243#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
244#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
245#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
246#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
247#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
248#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
249#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
250#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
251#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
252#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
253#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
254#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
255#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
256#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
257#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
258#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
259#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
260#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
261
262/* USB Endpoint 4 Control Registers */
263
264#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
265#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
266#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
267#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
268#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
269#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
270#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
271#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
272#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
273#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
274#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
275#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
276#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
277#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
278#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
279#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
280#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
281#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
282#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
283#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
284
285/* USB Endpoint 5 Control Registers */
286
287#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
288#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
289#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
290#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
291#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
292#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
293#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
294#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
295#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
296#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
297#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
298#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
299#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
300#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
301#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
302#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
303#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
304#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
305#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
306#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
307
308/* USB Endpoint 6 Control Registers */
309
310#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
311#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
312#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
313#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
314#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
315#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
316#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
317#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
318#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
319#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
320#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
321#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
322#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
323#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
324#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
325#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
326#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
327#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
328#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
329#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
330
331/* USB Endpoint 7 Control Registers */
332
333#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
334#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
335#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
336#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
337#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
338#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
339#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
340#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
341#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
342#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
343#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
344#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
345#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
346#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
347#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
348#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
349#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
350#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
351#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
352#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
353
354#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
355#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
356
357/* USB Channel 0 Config Registers */
358
359#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
360#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
361#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
362#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
363#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
364#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
365#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
366#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
367#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
368#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
369
370/* USB Channel 1 Config Registers */
371
372#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
373#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
374#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
375#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
376#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
377#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
378#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
379#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
380#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
381#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
382
383/* USB Channel 2 Config Registers */
384
385#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
386#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
387#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
388#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
389#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
390#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
391#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
392#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
393#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
394#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
395
396/* USB Channel 3 Config Registers */
397
398#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
399#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
400#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
401#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
402#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
403#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
404#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
405#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
406#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
407#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
408
409/* USB Channel 4 Config Registers */
410
411#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
412#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
413#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
414#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
415#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
416#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
417#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
418#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
419#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
420#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
421
422/* USB Channel 5 Config Registers */
423
424#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
425#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
426#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
427#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
428#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
429#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
430#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
431#define bfin_write_USB_DMA5COUNTLOW(val) bfin_write16(USB_DMA5COUNTLOW, val)
432#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
433#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
434
435/* USB Channel 6 Config Registers */
436
437#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
438#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
439#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
440#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
441#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
442#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
443#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
444#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
445#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
446#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
447
448/* USB Channel 7 Config Registers */
449
450#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
451#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
452#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
453#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
454#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
455#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
456#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
457#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
458#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
459#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
460
461#endif /* _CDEF_BF525_H */
diff --git a/include/asm-blackfin/mach-bf527/cdefBF527.h b/include/asm-blackfin/mach-bf527/cdefBF527.h
deleted file mode 100644
index 5bd1a8601743..000000000000
--- a/include/asm-blackfin/mach-bf527/cdefBF527.h
+++ /dev/null
@@ -1,626 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/cdefbf527.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_BF527_H
33#define _CDEF_BF527_H
34
35/* include all Core registers and bit definitions */
36#include "defBF527.h"
37
38/* include core specific register pointer definitions */
39#include <asm/mach-common/cdef_LPBlackfin.h>
40
41/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF527 */
42
43/* include cdefBF52x_base.h for the set of #defines that are common to all ADSP-BF52x processors */
44#include "cdefBF52x_base.h"
45
46/* The following are the #defines needed by ADSP-BF527 that are not in the common header */
47
48/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
49
50#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
51#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE, val)
52#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
53#define bfin_write_EMAC_ADDRLO(val) bfin_write32(EMAC_ADDRLO, val)
54#define bfin_read_EMAC_ADDRHI() bfin_read32(EMAC_ADDRHI)
55#define bfin_write_EMAC_ADDRHI(val) bfin_write32(EMAC_ADDRHI, val)
56#define bfin_read_EMAC_HASHLO() bfin_read32(EMAC_HASHLO)
57#define bfin_write_EMAC_HASHLO(val) bfin_write32(EMAC_HASHLO, val)
58#define bfin_read_EMAC_HASHHI() bfin_read32(EMAC_HASHHI)
59#define bfin_write_EMAC_HASHHI(val) bfin_write32(EMAC_HASHHI, val)
60#define bfin_read_EMAC_STAADD() bfin_read32(EMAC_STAADD)
61#define bfin_write_EMAC_STAADD(val) bfin_write32(EMAC_STAADD, val)
62#define bfin_read_EMAC_STADAT() bfin_read32(EMAC_STADAT)
63#define bfin_write_EMAC_STADAT(val) bfin_write32(EMAC_STADAT, val)
64#define bfin_read_EMAC_FLC() bfin_read32(EMAC_FLC)
65#define bfin_write_EMAC_FLC(val) bfin_write32(EMAC_FLC, val)
66#define bfin_read_EMAC_VLAN1() bfin_read32(EMAC_VLAN1)
67#define bfin_write_EMAC_VLAN1(val) bfin_write32(EMAC_VLAN1, val)
68#define bfin_read_EMAC_VLAN2() bfin_read32(EMAC_VLAN2)
69#define bfin_write_EMAC_VLAN2(val) bfin_write32(EMAC_VLAN2, val)
70#define bfin_read_EMAC_WKUP_CTL() bfin_read32(EMAC_WKUP_CTL)
71#define bfin_write_EMAC_WKUP_CTL(val) bfin_write32(EMAC_WKUP_CTL, val)
72#define bfin_read_EMAC_WKUP_FFMSK0() bfin_read32(EMAC_WKUP_FFMSK0)
73#define bfin_write_EMAC_WKUP_FFMSK0(val) bfin_write32(EMAC_WKUP_FFMSK0, val)
74#define bfin_read_EMAC_WKUP_FFMSK1() bfin_read32(EMAC_WKUP_FFMSK1)
75#define bfin_write_EMAC_WKUP_FFMSK1(val) bfin_write32(EMAC_WKUP_FFMSK1, val)
76#define bfin_read_EMAC_WKUP_FFMSK2() bfin_read32(EMAC_WKUP_FFMSK2)
77#define bfin_write_EMAC_WKUP_FFMSK2(val) bfin_write32(EMAC_WKUP_FFMSK2, val)
78#define bfin_read_EMAC_WKUP_FFMSK3() bfin_read32(EMAC_WKUP_FFMSK3)
79#define bfin_write_EMAC_WKUP_FFMSK3(val) bfin_write32(EMAC_WKUP_FFMSK3, val)
80#define bfin_read_EMAC_WKUP_FFCMD() bfin_read32(EMAC_WKUP_FFCMD)
81#define bfin_write_EMAC_WKUP_FFCMD(val) bfin_write32(EMAC_WKUP_FFCMD, val)
82#define bfin_read_EMAC_WKUP_FFOFF() bfin_read32(EMAC_WKUP_FFOFF)
83#define bfin_write_EMAC_WKUP_FFOFF(val) bfin_write32(EMAC_WKUP_FFOFF, val)
84#define bfin_read_EMAC_WKUP_FFCRC0() bfin_read32(EMAC_WKUP_FFCRC0)
85#define bfin_write_EMAC_WKUP_FFCRC0(val) bfin_write32(EMAC_WKUP_FFCRC0, val)
86#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
87#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1, val)
88
89#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
90#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL, val)
91#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
92#define bfin_write_EMAC_SYSTAT(val) bfin_write32(EMAC_SYSTAT, val)
93#define bfin_read_EMAC_RX_STAT() bfin_read32(EMAC_RX_STAT)
94#define bfin_write_EMAC_RX_STAT(val) bfin_write32(EMAC_RX_STAT, val)
95#define bfin_read_EMAC_RX_STKY() bfin_read32(EMAC_RX_STKY)
96#define bfin_write_EMAC_RX_STKY(val) bfin_write32(EMAC_RX_STKY, val)
97#define bfin_read_EMAC_RX_IRQE() bfin_read32(EMAC_RX_IRQE)
98#define bfin_write_EMAC_RX_IRQE(val) bfin_write32(EMAC_RX_IRQE, val)
99#define bfin_read_EMAC_TX_STAT() bfin_read32(EMAC_TX_STAT)
100#define bfin_write_EMAC_TX_STAT(val) bfin_write32(EMAC_TX_STAT, val)
101#define bfin_read_EMAC_TX_STKY() bfin_read32(EMAC_TX_STKY)
102#define bfin_write_EMAC_TX_STKY(val) bfin_write32(EMAC_TX_STKY, val)
103#define bfin_read_EMAC_TX_IRQE() bfin_read32(EMAC_TX_IRQE)
104#define bfin_write_EMAC_TX_IRQE(val) bfin_write32(EMAC_TX_IRQE, val)
105
106#define bfin_read_EMAC_MMC_CTL() bfin_read32(EMAC_MMC_CTL)
107#define bfin_write_EMAC_MMC_CTL(val) bfin_write32(EMAC_MMC_CTL, val)
108#define bfin_read_EMAC_MMC_RIRQS() bfin_read32(EMAC_MMC_RIRQS)
109#define bfin_write_EMAC_MMC_RIRQS(val) bfin_write32(EMAC_MMC_RIRQS, val)
110#define bfin_read_EMAC_MMC_RIRQE() bfin_read32(EMAC_MMC_RIRQE)
111#define bfin_write_EMAC_MMC_RIRQE(val) bfin_write32(EMAC_MMC_RIRQE, val)
112#define bfin_read_EMAC_MMC_TIRQS() bfin_read32(EMAC_MMC_TIRQS)
113#define bfin_write_EMAC_MMC_TIRQS(val) bfin_write32(EMAC_MMC_TIRQS, val)
114#define bfin_read_EMAC_MMC_TIRQE() bfin_read32(EMAC_MMC_TIRQE)
115#define bfin_write_EMAC_MMC_TIRQE(val) bfin_write32(EMAC_MMC_TIRQE, val)
116
117#define bfin_read_EMAC_RXC_OK() bfin_read32(EMAC_RXC_OK)
118#define bfin_write_EMAC_RXC_OK(val) bfin_write32(EMAC_RXC_OK, val)
119#define bfin_read_EMAC_RXC_FCS() bfin_read32(EMAC_RXC_FCS)
120#define bfin_write_EMAC_RXC_FCS(val) bfin_write32(EMAC_RXC_FCS, val)
121#define bfin_read_EMAC_RXC_ALIGN() bfin_read32(EMAC_RXC_ALIGN)
122#define bfin_write_EMAC_RXC_ALIGN(val) bfin_write32(EMAC_RXC_ALIGN, val)
123#define bfin_read_EMAC_RXC_OCTET() bfin_read32(EMAC_RXC_OCTET)
124#define bfin_write_EMAC_RXC_OCTET(val) bfin_write32(EMAC_RXC_OCTET, val)
125#define bfin_read_EMAC_RXC_DMAOVF() bfin_read32(EMAC_RXC_DMAOVF)
126#define bfin_write_EMAC_RXC_DMAOVF(val) bfin_write32(EMAC_RXC_DMAOVF, val)
127#define bfin_read_EMAC_RXC_UNICST() bfin_read32(EMAC_RXC_UNICST)
128#define bfin_write_EMAC_RXC_UNICST(val) bfin_write32(EMAC_RXC_UNICST, val)
129#define bfin_read_EMAC_RXC_MULTI() bfin_read32(EMAC_RXC_MULTI)
130#define bfin_write_EMAC_RXC_MULTI(val) bfin_write32(EMAC_RXC_MULTI, val)
131#define bfin_read_EMAC_RXC_BROAD() bfin_read32(EMAC_RXC_BROAD)
132#define bfin_write_EMAC_RXC_BROAD(val) bfin_write32(EMAC_RXC_BROAD, val)
133#define bfin_read_EMAC_RXC_LNERRI() bfin_read32(EMAC_RXC_LNERRI)
134#define bfin_write_EMAC_RXC_LNERRI(val) bfin_write32(EMAC_RXC_LNERRI, val)
135#define bfin_read_EMAC_RXC_LNERRO() bfin_read32(EMAC_RXC_LNERRO)
136#define bfin_write_EMAC_RXC_LNERRO(val) bfin_write32(EMAC_RXC_LNERRO, val)
137#define bfin_read_EMAC_RXC_LONG() bfin_read32(EMAC_RXC_LONG)
138#define bfin_write_EMAC_RXC_LONG(val) bfin_write32(EMAC_RXC_LONG, val)
139#define bfin_read_EMAC_RXC_MACCTL() bfin_read32(EMAC_RXC_MACCTL)
140#define bfin_write_EMAC_RXC_MACCTL(val) bfin_write32(EMAC_RXC_MACCTL, val)
141#define bfin_read_EMAC_RXC_OPCODE() bfin_read32(EMAC_RXC_OPCODE)
142#define bfin_write_EMAC_RXC_OPCODE(val) bfin_write32(EMAC_RXC_OPCODE, val)
143#define bfin_read_EMAC_RXC_PAUSE() bfin_read32(EMAC_RXC_PAUSE)
144#define bfin_write_EMAC_RXC_PAUSE(val) bfin_write32(EMAC_RXC_PAUSE, val)
145#define bfin_read_EMAC_RXC_ALLFRM() bfin_read32(EMAC_RXC_ALLFRM)
146#define bfin_write_EMAC_RXC_ALLFRM(val) bfin_write32(EMAC_RXC_ALLFRM, val)
147#define bfin_read_EMAC_RXC_ALLOCT() bfin_read32(EMAC_RXC_ALLOCT)
148#define bfin_write_EMAC_RXC_ALLOCT(val) bfin_write32(EMAC_RXC_ALLOCT, val)
149#define bfin_read_EMAC_RXC_TYPED() bfin_read32(EMAC_RXC_TYPED)
150#define bfin_write_EMAC_RXC_TYPED(val) bfin_write32(EMAC_RXC_TYPED, val)
151#define bfin_read_EMAC_RXC_SHORT() bfin_read32(EMAC_RXC_SHORT)
152#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT, val)
153#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
154#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64, val)
155#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
156#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128, val)
157#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
158#define bfin_write_EMAC_RXC_LT256(val) bfin_write32(EMAC_RXC_LT256, val)
159#define bfin_read_EMAC_RXC_LT512() bfin_read32(EMAC_RXC_LT512)
160#define bfin_write_EMAC_RXC_LT512(val) bfin_write32(EMAC_RXC_LT512, val)
161#define bfin_read_EMAC_RXC_LT1024() bfin_read32(EMAC_RXC_LT1024)
162#define bfin_write_EMAC_RXC_LT1024(val) bfin_write32(EMAC_RXC_LT1024, val)
163#define bfin_read_EMAC_RXC_GE1024() bfin_read32(EMAC_RXC_GE1024)
164#define bfin_write_EMAC_RXC_GE1024(val) bfin_write32(EMAC_RXC_GE1024, val)
165
166#define bfin_read_EMAC_TXC_OK() bfin_read32(EMAC_TXC_OK)
167#define bfin_write_EMAC_TXC_OK(val) bfin_write32(EMAC_TXC_OK, val)
168#define bfin_read_EMAC_TXC_1COL() bfin_read32(EMAC_TXC_1COL)
169#define bfin_write_EMAC_TXC_1COL(val) bfin_write32(EMAC_TXC_1COL, val)
170#define bfin_read_EMAC_TXC_GT1COL() bfin_read32(EMAC_TXC_GT1COL)
171#define bfin_write_EMAC_TXC_GT1COL(val) bfin_write32(EMAC_TXC_GT1COL, val)
172#define bfin_read_EMAC_TXC_OCTET() bfin_read32(EMAC_TXC_OCTET)
173#define bfin_write_EMAC_TXC_OCTET(val) bfin_write32(EMAC_TXC_OCTET, val)
174#define bfin_read_EMAC_TXC_DEFER() bfin_read32(EMAC_TXC_DEFER)
175#define bfin_write_EMAC_TXC_DEFER(val) bfin_write32(EMAC_TXC_DEFER, val)
176#define bfin_read_EMAC_TXC_LATECL() bfin_read32(EMAC_TXC_LATECL)
177#define bfin_write_EMAC_TXC_LATECL(val) bfin_write32(EMAC_TXC_LATECL, val)
178#define bfin_read_EMAC_TXC_XS_COL() bfin_read32(EMAC_TXC_XS_COL)
179#define bfin_write_EMAC_TXC_XS_COL(val) bfin_write32(EMAC_TXC_XS_COL, val)
180#define bfin_read_EMAC_TXC_DMAUND() bfin_read32(EMAC_TXC_DMAUND)
181#define bfin_write_EMAC_TXC_DMAUND(val) bfin_write32(EMAC_TXC_DMAUND, val)
182#define bfin_read_EMAC_TXC_CRSERR() bfin_read32(EMAC_TXC_CRSERR)
183#define bfin_write_EMAC_TXC_CRSERR(val) bfin_write32(EMAC_TXC_CRSERR, val)
184#define bfin_read_EMAC_TXC_UNICST() bfin_read32(EMAC_TXC_UNICST)
185#define bfin_write_EMAC_TXC_UNICST(val) bfin_write32(EMAC_TXC_UNICST, val)
186#define bfin_read_EMAC_TXC_MULTI() bfin_read32(EMAC_TXC_MULTI)
187#define bfin_write_EMAC_TXC_MULTI(val) bfin_write32(EMAC_TXC_MULTI, val)
188#define bfin_read_EMAC_TXC_BROAD() bfin_read32(EMAC_TXC_BROAD)
189#define bfin_write_EMAC_TXC_BROAD(val) bfin_write32(EMAC_TXC_BROAD, val)
190#define bfin_read_EMAC_TXC_XS_DFR() bfin_read32(EMAC_TXC_XS_DFR)
191#define bfin_write_EMAC_TXC_XS_DFR(val) bfin_write32(EMAC_TXC_XS_DFR, val)
192#define bfin_read_EMAC_TXC_MACCTL() bfin_read32(EMAC_TXC_MACCTL)
193#define bfin_write_EMAC_TXC_MACCTL(val) bfin_write32(EMAC_TXC_MACCTL, val)
194#define bfin_read_EMAC_TXC_ALLFRM() bfin_read32(EMAC_TXC_ALLFRM)
195#define bfin_write_EMAC_TXC_ALLFRM(val) bfin_write32(EMAC_TXC_ALLFRM, val)
196#define bfin_read_EMAC_TXC_ALLOCT() bfin_read32(EMAC_TXC_ALLOCT)
197#define bfin_write_EMAC_TXC_ALLOCT(val) bfin_write32(EMAC_TXC_ALLOCT, val)
198#define bfin_read_EMAC_TXC_EQ64() bfin_read32(EMAC_TXC_EQ64)
199#define bfin_write_EMAC_TXC_EQ64(val) bfin_write32(EMAC_TXC_EQ64, val)
200#define bfin_read_EMAC_TXC_LT128() bfin_read32(EMAC_TXC_LT128)
201#define bfin_write_EMAC_TXC_LT128(val) bfin_write32(EMAC_TXC_LT128, val)
202#define bfin_read_EMAC_TXC_LT256() bfin_read32(EMAC_TXC_LT256)
203#define bfin_write_EMAC_TXC_LT256(val) bfin_write32(EMAC_TXC_LT256, val)
204#define bfin_read_EMAC_TXC_LT512() bfin_read32(EMAC_TXC_LT512)
205#define bfin_write_EMAC_TXC_LT512(val) bfin_write32(EMAC_TXC_LT512, val)
206#define bfin_read_EMAC_TXC_LT1024() bfin_read32(EMAC_TXC_LT1024)
207#define bfin_write_EMAC_TXC_LT1024(val) bfin_write32(EMAC_TXC_LT1024, val)
208#define bfin_read_EMAC_TXC_GE1024() bfin_read32(EMAC_TXC_GE1024)
209#define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024, val)
210#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
211#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT, val)
212
213/* USB Control Registers */
214
215#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
216#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
217#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
218#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
219#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
220#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
221#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
222#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
223#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
224#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
225#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
226#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
227#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
228#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
229#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
230#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
231#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
232#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
233#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
234#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
235#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
236#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
237#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
238#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
239#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
240#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
241
242/* USB Packet Control Registers */
243
244#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
245#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
246#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
247#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
248#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
249#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
250#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
251#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
252#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
253#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
254#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
255#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
256#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
257#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
258#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
259#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
260#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
261#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
262#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
263#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
264#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
265#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
266#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
267#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
268#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
269#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
270
271/* USB Endpoint FIFO Registers */
272
273#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
274#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
275#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
276#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
277#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
278#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
279#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
280#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
281#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
282#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
283#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
284#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
285#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
286#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
287#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
288#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
289
290/* USB OTG Control Registers */
291
292#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
293#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
294#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
295#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
296#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
297#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
298
299/* USB Phy Control Registers */
300
301#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
302#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
303#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
304#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
305#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
306#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
307#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
308#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
309#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
310#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
311
312/* (APHY_CNTRL is for ADI usage only) */
313
314#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
315#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
316
317/* (APHY_CALIB is for ADI usage only) */
318
319#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
320#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
321
322#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
323#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
324
325/* (PHY_TEST is for ADI usage only) */
326
327#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
328#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
329
330#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
331#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
332#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
333#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
334
335/* USB Endpoint 0 Control Registers */
336
337#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
338#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
339#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
340#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
341#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
342#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
343#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
344#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
345#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
346#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
347#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
348#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
349#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
350#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
351#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
352#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
353#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
354#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
355#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
356#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
357
358/* USB Endpoint 1 Control Registers */
359
360#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
361#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
362#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
363#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
364#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
365#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
366#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
367#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
368#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
369#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
370#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
371#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
372#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
373#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
374#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
375#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
376#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
377#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
378#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
379#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
380
381/* USB Endpoint 2 Control Registers */
382
383#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
384#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
385#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
386#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
387#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
388#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
389#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
390#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
391#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
392#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
393#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
394#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
395#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
396#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
397#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
398#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
399#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
400#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
401#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
402#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
403
404/* USB Endpoint 3 Control Registers */
405
406#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
407#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
408#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
409#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
410#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
411#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
412#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
413#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
414#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
415#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
416#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
417#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
418#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
419#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
420#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
421#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
422#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
423#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
424#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
425#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
426
427/* USB Endpoint 4 Control Registers */
428
429#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
430#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
431#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
432#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
433#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
434#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
435#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
436#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
437#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
438#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
439#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
440#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
441#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
442#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
443#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
444#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
445#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
446#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
447#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
448#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
449
450/* USB Endpoint 5 Control Registers */
451
452#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
453#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
454#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
455#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
456#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
457#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
458#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
459#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
460#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
461#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
462#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
463#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
464#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
465#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
466#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
467#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
468#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
469#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
470#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
471#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
472
473/* USB Endpoint 6 Control Registers */
474
475#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
476#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
477#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
478#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
479#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
480#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
481#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
482#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
483#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
484#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
485#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
486#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
487#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
488#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
489#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
490#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
491#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
492#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
493#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
494#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
495
496/* USB Endpoint 7 Control Registers */
497
498#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
499#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
500#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
501#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
502#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
503#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
504#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
505#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
506#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
507#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
508#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
509#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
510#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
511#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
512#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
513#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
514#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
515#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
516#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
517#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
518
519#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
520#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
521
522/* USB Channel 0 Config Registers */
523
524#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
525#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
526#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
527#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
528#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
529#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
530#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
531#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
532#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
533#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
534
535/* USB Channel 1 Config Registers */
536
537#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
538#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
539#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
540#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
541#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
542#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
543#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
544#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
545#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
546#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
547
548/* USB Channel 2 Config Registers */
549
550#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
551#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
552#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
553#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
554#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
555#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
556#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
557#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
558#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
559#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
560
561/* USB Channel 3 Config Registers */
562
563#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
564#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
565#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
566#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
567#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
568#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
569#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
570#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
571#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
572#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
573
574/* USB Channel 4 Config Registers */
575
576#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
577#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
578#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
579#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
580#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
581#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
582#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
583#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
584#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
585#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
586
587/* USB Channel 5 Config Registers */
588
589#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
590#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
591#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
592#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
593#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
594#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
595#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
596#define bfin_write_USB_DMA5COUNTLOW(val) bfin_write16(USB_DMA5COUNTLOW, val)
597#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
598#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
599
600/* USB Channel 6 Config Registers */
601
602#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
603#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
604#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
605#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
606#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
607#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
608#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
609#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
610#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
611#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
612
613/* USB Channel 7 Config Registers */
614
615#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
616#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
617#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
618#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
619#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
620#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
621#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
622#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
623#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
624#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
625
626#endif /* _CDEF_BF527_H */
diff --git a/include/asm-blackfin/mach-bf527/cdefBF52x_base.h b/include/asm-blackfin/mach-bf527/cdefBF52x_base.h
deleted file mode 100644
index 9dbdbec8ea1b..000000000000
--- a/include/asm-blackfin/mach-bf527/cdefBF52x_base.h
+++ /dev/null
@@ -1,1204 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/cdefBF52x_base.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_BF52X_H
32#define _CDEF_BF52X_H
33
34#include <asm/system.h>
35#include <asm/blackfin.h>
36
37#include "defBF52x_base.h"
38
39/* Include core specific register pointer definitions */
40#include <asm/mach-common/cdef_LPBlackfin.h>
41
42/* ==== begin from cdefBF534.h ==== */
43
44/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
45#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
46/* Writing to PLL_CTL initiates a PLL relock sequence. */
47static __inline__ void bfin_write_PLL_CTL(unsigned int val)
48{
49 unsigned long flags, iwr0, iwr1;
50
51 if (val == bfin_read_PLL_CTL())
52 return;
53
54 local_irq_save(flags);
55 /* Enable the PLL Wakeup bit in SIC IWR */
56 iwr0 = bfin_read32(SIC_IWR0);
57 iwr1 = bfin_read32(SIC_IWR1);
58 /* Only allow PPL Wakeup) */
59 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
60 bfin_write32(SIC_IWR1, 0);
61
62 bfin_write16(PLL_CTL, val);
63 SSYNC();
64 asm("IDLE;");
65
66 bfin_write32(SIC_IWR0, iwr0);
67 bfin_write32(SIC_IWR1, iwr1);
68 local_irq_restore(flags);
69}
70#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
71#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
72#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
73/* Writing to VR_CTL initiates a PLL relock sequence. */
74static __inline__ void bfin_write_VR_CTL(unsigned int val)
75{
76 unsigned long flags, iwr0, iwr1;
77
78 if (val == bfin_read_VR_CTL())
79 return;
80
81 local_irq_save(flags);
82 /* Enable the PLL Wakeup bit in SIC IWR */
83 iwr0 = bfin_read32(SIC_IWR0);
84 iwr1 = bfin_read32(SIC_IWR1);
85 /* Only allow PPL Wakeup) */
86 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
87 bfin_write32(SIC_IWR1, 0);
88
89 bfin_write16(VR_CTL, val);
90 SSYNC();
91 asm("IDLE;");
92
93 bfin_write32(SIC_IWR0, iwr0);
94 bfin_write32(SIC_IWR1, iwr1);
95 local_irq_restore(flags);
96}
97#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
98#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
99#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
100#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT, val)
101#define bfin_read_CHIPID() bfin_read32(CHIPID)
102#define bfin_write_CHIPID(val) bfin_write32(CHIPID, val)
103
104
105/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
106#define bfin_read_SWRST() bfin_read16(SWRST)
107#define bfin_write_SWRST(val) bfin_write16(SWRST, val)
108#define bfin_read_SYSCR() bfin_read16(SYSCR)
109#define bfin_write_SYSCR(val) bfin_write16(SYSCR, val)
110
111#define bfin_read_SIC_RVECT() bfin_read32(SIC_RVECT)
112#define bfin_write_SIC_RVECT(val) bfin_write32(SIC_RVECT, val)
113#define bfin_read_SIC_IMASK0() bfin_read32(SIC_IMASK0)
114#define bfin_write_SIC_IMASK0(val) bfin_write32(SIC_IMASK0, val)
115#define bfin_read_SIC_IMASK(x) bfin_read32(SIC_IMASK0 + (x << 6))
116#define bfin_write_SIC_IMASK(x, val) bfin_write32((SIC_IMASK0 + (x << 6)), val)
117
118#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
119#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
120#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
121#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1, val)
122#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
123#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2, val)
124#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
125#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3, val)
126
127#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
128#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
129#define bfin_read_SIC_ISR(x) bfin_read32(SIC_ISR0 + (x << 6))
130#define bfin_write_SIC_ISR(x, val) bfin_write32((SIC_ISR0 + (x << 6)), val)
131
132#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
133#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
134#define bfin_read_SIC_IWR(x) bfin_read32(SIC_IWR0 + (x << 6))
135#define bfin_write_SIC_IWR(x, val) bfin_write32((SIC_IWR0 + (x << 6)), val)
136
137/* SIC Additions to ADSP-BF52x (0xFFC0014C - 0xFFC00162) */
138
139#define bfin_read_SIC_IMASK1() bfin_read32(SIC_IMASK1)
140#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
141#define bfin_read_SIC_IAR4() bfin_read32(SIC_IAR4)
142#define bfin_write_SIC_IAR4(val) bfin_write32(SIC_IAR4, val)
143#define bfin_read_SIC_IAR5() bfin_read32(SIC_IAR5)
144#define bfin_write_SIC_IAR5(val) bfin_write32(SIC_IAR5, val)
145#define bfin_read_SIC_IAR6() bfin_read32(SIC_IAR6)
146#define bfin_write_SIC_IAR6(val) bfin_write32(SIC_IAR6, val)
147#define bfin_read_SIC_IAR7() bfin_read32(SIC_IAR7)
148#define bfin_write_SIC_IAR7(val) bfin_write32(SIC_IAR7, val)
149#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
150#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
151#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
152#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
153
154/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
155#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
156#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL, val)
157#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
158#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT, val)
159#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
160#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT, val)
161
162
163/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
164#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
165#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT, val)
166#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
167#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL, val)
168#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
169#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT, val)
170#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
171#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT, val)
172#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
173#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM, val)
174#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
175#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST, val)
176#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
177#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN, val)
178
179
180/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
181#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
182#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR, val)
183#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
184#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR, val)
185#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
186#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL, val)
187#define bfin_read_UART0_IER() bfin_read16(UART0_IER)
188#define bfin_write_UART0_IER(val) bfin_write16(UART0_IER, val)
189#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
190#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH, val)
191#define bfin_read_UART0_IIR() bfin_read16(UART0_IIR)
192#define bfin_write_UART0_IIR(val) bfin_write16(UART0_IIR, val)
193#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
194#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR, val)
195#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
196#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR, val)
197#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
198#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR, val)
199#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
200#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR, val)
201#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
202#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR, val)
203#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
204#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL, val)
205
206
207/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
208#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
209#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL, val)
210#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
211#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG, val)
212#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
213#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT, val)
214#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
215#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR, val)
216#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
217#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR, val)
218#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
219#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD, val)
220#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
221#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW, val)
222
223
224/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
225#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
226#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG, val)
227#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
228#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
229#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
230#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD, val)
231#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
232#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH, val)
233
234#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
235#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG, val)
236#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
237#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
238#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
239#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD, val)
240#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
241#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH, val)
242
243#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
244#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG, val)
245#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
246#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
247#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
248#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD, val)
249#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
250#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH, val)
251
252#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
253#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG, val)
254#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
255#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
256#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
257#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD, val)
258#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
259#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH, val)
260
261#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
262#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG, val)
263#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
264#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
265#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
266#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD, val)
267#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
268#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH, val)
269
270#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
271#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG, val)
272#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
273#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
274#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
275#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD, val)
276#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
277#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH, val)
278
279#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
280#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG, val)
281#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
282#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
283#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
284#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD, val)
285#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
286#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH, val)
287
288#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
289#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG, val)
290#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
291#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
292#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
293#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD, val)
294#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
295#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH, val)
296
297#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
298#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE, val)
299#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
300#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE, val)
301#define bfin_read_TIMER_STATUS() bfin_read32(TIMER_STATUS)
302#define bfin_write_TIMER_STATUS(val) bfin_write32(TIMER_STATUS, val)
303
304
305/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
306#define bfin_read_PORTFIO() bfin_read16(PORTFIO)
307#define bfin_write_PORTFIO(val) bfin_write16(PORTFIO, val)
308#define bfin_read_PORTFIO_CLEAR() bfin_read16(PORTFIO_CLEAR)
309#define bfin_write_PORTFIO_CLEAR(val) bfin_write16(PORTFIO_CLEAR, val)
310#define bfin_read_PORTFIO_SET() bfin_read16(PORTFIO_SET)
311#define bfin_write_PORTFIO_SET(val) bfin_write16(PORTFIO_SET, val)
312#define bfin_read_PORTFIO_TOGGLE() bfin_read16(PORTFIO_TOGGLE)
313#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
314#define bfin_read_PORTFIO_MASKA() bfin_read16(PORTFIO_MASKA)
315#define bfin_write_PORTFIO_MASKA(val) bfin_write16(PORTFIO_MASKA, val)
316#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
317#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
318#define bfin_read_PORTFIO_MASKA_SET() bfin_read16(PORTFIO_MASKA_SET)
319#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
320#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
321#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
322#define bfin_read_PORTFIO_MASKB() bfin_read16(PORTFIO_MASKB)
323#define bfin_write_PORTFIO_MASKB(val) bfin_write16(PORTFIO_MASKB, val)
324#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
325#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
326#define bfin_read_PORTFIO_MASKB_SET() bfin_read16(PORTFIO_MASKB_SET)
327#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
328#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
329#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
330#define bfin_read_PORTFIO_DIR() bfin_read16(PORTFIO_DIR)
331#define bfin_write_PORTFIO_DIR(val) bfin_write16(PORTFIO_DIR, val)
332#define bfin_read_PORTFIO_POLAR() bfin_read16(PORTFIO_POLAR)
333#define bfin_write_PORTFIO_POLAR(val) bfin_write16(PORTFIO_POLAR, val)
334#define bfin_read_PORTFIO_EDGE() bfin_read16(PORTFIO_EDGE)
335#define bfin_write_PORTFIO_EDGE(val) bfin_write16(PORTFIO_EDGE, val)
336#define bfin_read_PORTFIO_BOTH() bfin_read16(PORTFIO_BOTH)
337#define bfin_write_PORTFIO_BOTH(val) bfin_write16(PORTFIO_BOTH, val)
338#define bfin_read_PORTFIO_INEN() bfin_read16(PORTFIO_INEN)
339#define bfin_write_PORTFIO_INEN(val) bfin_write16(PORTFIO_INEN, val)
340
341
342/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
343#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
344#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
345#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
346#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
347#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
348#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
349#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
350#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
351#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
352#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
353#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
354#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
355#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX32)
356#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX32, val)
357#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX32)
358#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX32, val)
359#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX16)
360#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX16, val)
361#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX16)
362#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX16, val)
363#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
364#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
365#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
366#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
367#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
368#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
369#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
370#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
371#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
372#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
373#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
374#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
375#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
376#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
377#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
378#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
379#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
380#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
381#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
382#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
383#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
384#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
385#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
386#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
387#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
388#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
389#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
390#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
391#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
392#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
393#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
394#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
395
396
397/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
398#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
399#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1, val)
400#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
401#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2, val)
402#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
403#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
404#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
405#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV, val)
406#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
407#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX, val)
408#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
409#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX, val)
410#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX32)
411#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX32, val)
412#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX32)
413#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX32, val)
414#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX16)
415#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX16, val)
416#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX16)
417#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX16, val)
418#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
419#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1, val)
420#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
421#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2, val)
422#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
423#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
424#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
425#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV, val)
426#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
427#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT, val)
428#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
429#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL, val)
430#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
431#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1, val)
432#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
433#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2, val)
434#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
435#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0, val)
436#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
437#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1, val)
438#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
439#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2, val)
440#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
441#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3, val)
442#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
443#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0, val)
444#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
445#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1, val)
446#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
447#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2, val)
448#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
449#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3, val)
450
451
452/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
453#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
454#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL, val)
455#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
456#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0, val)
457#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
458#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1, val)
459#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
460#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL, val)
461#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
462#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL, val)
463#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
464#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC, val)
465#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
466#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT, val)
467
468
469/* DMA Traffic Control Registers */
470#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
471#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER, val)
472#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
473#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT, val)
474
475/* Alternate deprecated register names (below) provided for backwards code compatibility */
476#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
477#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER, val)
478#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
479#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT, val)
480
481/* DMA Controller */
482#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
483#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG, val)
484#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
485#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR, val)
486#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
487#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR, val)
488#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
489#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT, val)
490#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
491#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT, val)
492#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
493#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY, val)
494#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
495#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY, val)
496#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
497#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR, val)
498#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
499#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR, val)
500#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
501#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
502#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
503#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
504#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
505#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
506#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
507#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
508
509#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
510#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG, val)
511#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
512#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR, val)
513#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
514#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR, val)
515#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
516#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT, val)
517#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
518#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT, val)
519#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
520#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY, val)
521#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
522#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY, val)
523#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
524#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR, val)
525#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
526#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR, val)
527#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
528#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
529#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
530#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
531#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
532#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
533#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
534#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
535
536#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
537#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG, val)
538#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
539#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR, val)
540#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
541#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR, val)
542#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
543#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT, val)
544#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
545#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT, val)
546#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
547#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY, val)
548#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
549#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY, val)
550#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
551#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR, val)
552#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
553#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR, val)
554#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
555#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
556#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
557#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
558#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
559#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
560#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
561#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
562
563#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
564#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG, val)
565#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
566#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR, val)
567#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
568#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR, val)
569#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
570#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT, val)
571#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
572#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT, val)
573#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
574#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY, val)
575#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
576#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY, val)
577#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
578#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR, val)
579#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
580#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR, val)
581#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
582#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
583#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
584#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
585#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
586#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
587#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
588#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
589
590#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
591#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG, val)
592#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
593#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR, val)
594#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
595#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR, val)
596#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
597#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT, val)
598#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
599#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT, val)
600#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
601#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY, val)
602#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
603#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY, val)
604#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
605#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR, val)
606#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
607#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR, val)
608#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
609#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
610#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
611#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
612#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
613#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
614#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
615#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
616
617#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
618#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG, val)
619#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
620#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR, val)
621#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
622#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR, val)
623#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
624#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT, val)
625#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
626#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT, val)
627#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
628#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY, val)
629#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
630#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY, val)
631#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
632#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR, val)
633#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
634#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR, val)
635#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
636#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
637#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
638#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
639#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
640#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
641#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
642#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
643
644#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
645#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG, val)
646#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
647#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
648#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
649#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR, val)
650#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
651#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT, val)
652#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
653#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT, val)
654#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
655#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY, val)
656#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
657#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY, val)
658#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
659#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR, val)
660#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
661#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR, val)
662#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
663#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
664#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
665#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
666#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
667#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
668#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
669#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
670
671#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
672#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG, val)
673#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
674#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR, val)
675#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
676#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR, val)
677#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
678#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT, val)
679#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
680#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT, val)
681#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
682#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY, val)
683#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
684#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY, val)
685#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
686#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR, val)
687#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
688#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR, val)
689#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
690#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
691#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
692#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
693#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
694#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
695#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
696#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
697
698#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
699#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG, val)
700#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_read32(DMA8_NEXT_DESC_PTR)
701#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_write32(DMA8_NEXT_DESC_PTR, val)
702#define bfin_read_DMA8_START_ADDR() bfin_read32(DMA8_START_ADDR)
703#define bfin_write_DMA8_START_ADDR(val) bfin_write32(DMA8_START_ADDR, val)
704#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
705#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT, val)
706#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
707#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT, val)
708#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
709#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY, val)
710#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
711#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY, val)
712#define bfin_read_DMA8_CURR_DESC_PTR() bfin_read32(DMA8_CURR_DESC_PTR)
713#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_write32(DMA8_CURR_DESC_PTR, val)
714#define bfin_read_DMA8_CURR_ADDR() bfin_read32(DMA8_CURR_ADDR)
715#define bfin_write_DMA8_CURR_ADDR(val) bfin_write32(DMA8_CURR_ADDR, val)
716#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
717#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
718#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
719#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
720#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
721#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
722#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
723#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
724
725#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
726#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG, val)
727#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_read32(DMA9_NEXT_DESC_PTR)
728#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_write32(DMA9_NEXT_DESC_PTR, val)
729#define bfin_read_DMA9_START_ADDR() bfin_read32(DMA9_START_ADDR)
730#define bfin_write_DMA9_START_ADDR(val) bfin_write32(DMA9_START_ADDR, val)
731#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
732#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT, val)
733#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
734#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT, val)
735#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
736#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY, val)
737#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
738#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY, val)
739#define bfin_read_DMA9_CURR_DESC_PTR() bfin_read32(DMA9_CURR_DESC_PTR)
740#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_write32(DMA9_CURR_DESC_PTR, val)
741#define bfin_read_DMA9_CURR_ADDR() bfin_read32(DMA9_CURR_ADDR)
742#define bfin_write_DMA9_CURR_ADDR(val) bfin_write32(DMA9_CURR_ADDR, val)
743#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
744#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
745#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
746#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
747#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
748#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
749#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
750#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
751
752#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
753#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG, val)
754#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_read32(DMA10_NEXT_DESC_PTR)
755#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_write32(DMA10_NEXT_DESC_PTR, val)
756#define bfin_read_DMA10_START_ADDR() bfin_read32(DMA10_START_ADDR)
757#define bfin_write_DMA10_START_ADDR(val) bfin_write32(DMA10_START_ADDR, val)
758#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
759#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT, val)
760#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
761#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT, val)
762#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
763#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
764#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
765#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
766#define bfin_read_DMA10_CURR_DESC_PTR() bfin_read32(DMA10_CURR_DESC_PTR)
767#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_write32(DMA10_CURR_DESC_PTR, val)
768#define bfin_read_DMA10_CURR_ADDR() bfin_read32(DMA10_CURR_ADDR)
769#define bfin_write_DMA10_CURR_ADDR(val) bfin_write32(DMA10_CURR_ADDR, val)
770#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
771#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
772#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
773#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
774#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
775#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
776#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
777#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
778
779#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
780#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG, val)
781#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_read32(DMA11_NEXT_DESC_PTR)
782#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_write32(DMA11_NEXT_DESC_PTR, val)
783#define bfin_read_DMA11_START_ADDR() bfin_read32(DMA11_START_ADDR)
784#define bfin_write_DMA11_START_ADDR(val) bfin_write32(DMA11_START_ADDR, val)
785#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
786#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT, val)
787#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
788#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT, val)
789#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
790#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
791#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
792#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
793#define bfin_read_DMA11_CURR_DESC_PTR() bfin_read32(DMA11_CURR_DESC_PTR)
794#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_write32(DMA11_CURR_DESC_PTR, val)
795#define bfin_read_DMA11_CURR_ADDR() bfin_read32(DMA11_CURR_ADDR)
796#define bfin_write_DMA11_CURR_ADDR(val) bfin_write32(DMA11_CURR_ADDR, val)
797#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
798#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
799#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
800#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
801#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
802#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
803#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
804#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
805
806#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
807#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
808#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
809#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR, val)
810#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
811#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR, val)
812#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
813#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
814#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
815#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
816#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
817#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
818#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
819#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
820#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
821#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR, val)
822#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
823#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR, val)
824#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
825#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
826#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
827#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
828#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
829#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
830#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
831#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
832
833#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
834#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
835#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
836#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR, val)
837#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
838#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR, val)
839#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
840#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
841#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
842#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
843#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
844#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
845#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
846#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
847#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
848#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR, val)
849#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
850#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR, val)
851#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
852#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
853#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
854#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
855#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
856#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
857#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
858#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
859
860#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
861#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
862#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
863#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR, val)
864#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
865#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR, val)
866#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
867#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
868#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
869#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
870#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
871#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
872#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
873#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
874#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
875#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR, val)
876#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
877#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR, val)
878#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
879#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
880#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
881#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
882#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
883#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
884#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
885#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
886
887#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
888#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
889#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
890#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR, val)
891#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
892#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR, val)
893#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
894#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
895#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
896#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
897#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
898#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
899#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
900#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
901#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
902#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR, val)
903#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
904#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR, val)
905#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
906#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
907#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
908#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
909#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
910#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
911#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
912#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
913
914
915/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
916#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
917#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val)
918#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
919#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS, val)
920#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
921#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY, val)
922#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
923#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT, val)
924#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
925#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME, val)
926
927
928/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
929
930/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
931#define bfin_read_PORTGIO() bfin_read16(PORTGIO)
932#define bfin_write_PORTGIO(val) bfin_write16(PORTGIO, val)
933#define bfin_read_PORTGIO_CLEAR() bfin_read16(PORTGIO_CLEAR)
934#define bfin_write_PORTGIO_CLEAR(val) bfin_write16(PORTGIO_CLEAR, val)
935#define bfin_read_PORTGIO_SET() bfin_read16(PORTGIO_SET)
936#define bfin_write_PORTGIO_SET(val) bfin_write16(PORTGIO_SET, val)
937#define bfin_read_PORTGIO_TOGGLE() bfin_read16(PORTGIO_TOGGLE)
938#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
939#define bfin_read_PORTGIO_MASKA() bfin_read16(PORTGIO_MASKA)
940#define bfin_write_PORTGIO_MASKA(val) bfin_write16(PORTGIO_MASKA, val)
941#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
942#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
943#define bfin_read_PORTGIO_MASKA_SET() bfin_read16(PORTGIO_MASKA_SET)
944#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
945#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
946#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
947#define bfin_read_PORTGIO_MASKB() bfin_read16(PORTGIO_MASKB)
948#define bfin_write_PORTGIO_MASKB(val) bfin_write16(PORTGIO_MASKB, val)
949#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
950#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
951#define bfin_read_PORTGIO_MASKB_SET() bfin_read16(PORTGIO_MASKB_SET)
952#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
953#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
954#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
955#define bfin_read_PORTGIO_DIR() bfin_read16(PORTGIO_DIR)
956#define bfin_write_PORTGIO_DIR(val) bfin_write16(PORTGIO_DIR, val)
957#define bfin_read_PORTGIO_POLAR() bfin_read16(PORTGIO_POLAR)
958#define bfin_write_PORTGIO_POLAR(val) bfin_write16(PORTGIO_POLAR, val)
959#define bfin_read_PORTGIO_EDGE() bfin_read16(PORTGIO_EDGE)
960#define bfin_write_PORTGIO_EDGE(val) bfin_write16(PORTGIO_EDGE, val)
961#define bfin_read_PORTGIO_BOTH() bfin_read16(PORTGIO_BOTH)
962#define bfin_write_PORTGIO_BOTH(val) bfin_write16(PORTGIO_BOTH, val)
963#define bfin_read_PORTGIO_INEN() bfin_read16(PORTGIO_INEN)
964#define bfin_write_PORTGIO_INEN(val) bfin_write16(PORTGIO_INEN, val)
965
966
967/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
968#define bfin_read_PORTHIO() bfin_read16(PORTHIO)
969#define bfin_write_PORTHIO(val) bfin_write16(PORTHIO, val)
970#define bfin_read_PORTHIO_CLEAR() bfin_read16(PORTHIO_CLEAR)
971#define bfin_write_PORTHIO_CLEAR(val) bfin_write16(PORTHIO_CLEAR, val)
972#define bfin_read_PORTHIO_SET() bfin_read16(PORTHIO_SET)
973#define bfin_write_PORTHIO_SET(val) bfin_write16(PORTHIO_SET, val)
974#define bfin_read_PORTHIO_TOGGLE() bfin_read16(PORTHIO_TOGGLE)
975#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
976#define bfin_read_PORTHIO_MASKA() bfin_read16(PORTHIO_MASKA)
977#define bfin_write_PORTHIO_MASKA(val) bfin_write16(PORTHIO_MASKA, val)
978#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
979#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
980#define bfin_read_PORTHIO_MASKA_SET() bfin_read16(PORTHIO_MASKA_SET)
981#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
982#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
983#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
984#define bfin_read_PORTHIO_MASKB() bfin_read16(PORTHIO_MASKB)
985#define bfin_write_PORTHIO_MASKB(val) bfin_write16(PORTHIO_MASKB, val)
986#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
987#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
988#define bfin_read_PORTHIO_MASKB_SET() bfin_read16(PORTHIO_MASKB_SET)
989#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
990#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
991#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
992#define bfin_read_PORTHIO_DIR() bfin_read16(PORTHIO_DIR)
993#define bfin_write_PORTHIO_DIR(val) bfin_write16(PORTHIO_DIR, val)
994#define bfin_read_PORTHIO_POLAR() bfin_read16(PORTHIO_POLAR)
995#define bfin_write_PORTHIO_POLAR(val) bfin_write16(PORTHIO_POLAR, val)
996#define bfin_read_PORTHIO_EDGE() bfin_read16(PORTHIO_EDGE)
997#define bfin_write_PORTHIO_EDGE(val) bfin_write16(PORTHIO_EDGE, val)
998#define bfin_read_PORTHIO_BOTH() bfin_read16(PORTHIO_BOTH)
999#define bfin_write_PORTHIO_BOTH(val) bfin_write16(PORTHIO_BOTH, val)
1000#define bfin_read_PORTHIO_INEN() bfin_read16(PORTHIO_INEN)
1001#define bfin_write_PORTHIO_INEN(val) bfin_write16(PORTHIO_INEN, val)
1002
1003
1004/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
1005#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
1006#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR, val)
1007#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
1008#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR, val)
1009#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
1010#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL, val)
1011#define bfin_read_UART1_IER() bfin_read16(UART1_IER)
1012#define bfin_write_UART1_IER(val) bfin_write16(UART1_IER, val)
1013#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
1014#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH, val)
1015#define bfin_read_UART1_IIR() bfin_read16(UART1_IIR)
1016#define bfin_write_UART1_IIR(val) bfin_write16(UART1_IIR, val)
1017#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
1018#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR, val)
1019#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
1020#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR, val)
1021#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
1022#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR, val)
1023#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
1024#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR, val)
1025#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
1026#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR, val)
1027#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
1028#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL, val)
1029
1030/* Omit CAN register sets from the cdefBF534.h (CAN is not in the ADSP-BF52x processor) */
1031
1032/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
1033#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
1034#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER, val)
1035#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
1036#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER, val)
1037#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
1038#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER, val)
1039#define bfin_read_PORT_MUX() bfin_read16(PORT_MUX)
1040#define bfin_write_PORT_MUX(val) bfin_write16(PORT_MUX, val)
1041
1042
1043/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
1044#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1045#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
1046#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1047#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
1048#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1049#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
1050#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1051#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
1052#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1053#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
1054#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1055#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
1056#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1057#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
1058
1059#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1060#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
1061#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1062#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
1063#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1064#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
1065#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1066#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
1067#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1068#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
1069#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1070#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
1071#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1072#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
1073
1074/* ==== end from cdefBF534.h ==== */
1075
1076/* GPIO PIN mux (0xFFC03210 - OxFFC03288) */
1077
1078#define bfin_read_PORTF_MUX() bfin_read16(PORTF_MUX)
1079#define bfin_write_PORTF_MUX(val) bfin_write16(PORTF_MUX, val)
1080#define bfin_read_PORTG_MUX() bfin_read16(PORTG_MUX)
1081#define bfin_write_PORTG_MUX(val) bfin_write16(PORTG_MUX, val)
1082#define bfin_read_PORTH_MUX() bfin_read16(PORTH_MUX)
1083#define bfin_write_PORTH_MUX(val) bfin_write16(PORTH_MUX, val)
1084
1085#define bfin_read_PORTF_DRIVE() bfin_read16(PORTF_DRIVE)
1086#define bfin_write_PORTF_DRIVE(val) bfin_write16(PORTF_DRIVE, val)
1087#define bfin_read_PORTG_DRIVE() bfin_read16(PORTG_DRIVE)
1088#define bfin_write_PORTG_DRIVE(val) bfin_write16(PORTG_DRIVE, val)
1089#define bfin_read_PORTH_DRIVE() bfin_read16(PORTH_DRIVE)
1090#define bfin_write_PORTH_DRIVE(val) bfin_write16(PORTH_DRIVE, val)
1091#define bfin_read_PORTF_SLEW() bfin_read16(PORTF_SLEW)
1092#define bfin_write_PORTF_SLEW(val) bfin_write16(PORTF_SLEW, val)
1093#define bfin_read_PORTG_SLEW() bfin_read16(PORTG_SLEW)
1094#define bfin_write_PORTG_SLEW(val) bfin_write16(PORTG_SLEW, val)
1095#define bfin_read_PORTH_SLEW() bfin_read16(PORTH_SLEW)
1096#define bfin_write_PORTH_SLEW(val) bfin_write16(PORTH_SLEW, val)
1097#define bfin_read_PORTF_HYSTERISIS() bfin_read16(PORTF_HYSTERISIS)
1098#define bfin_write_PORTF_HYSTERISIS(val) bfin_write16(PORTF_HYSTERISIS, val)
1099#define bfin_read_PORTG_HYSTERISIS() bfin_read16(PORTG_HYSTERISIS)
1100#define bfin_write_PORTG_HYSTERISIS(val) bfin_write16(PORTG_HYSTERISIS, val)
1101#define bfin_read_PORTH_HYSTERISIS() bfin_read16(PORTH_HYSTERISIS)
1102#define bfin_write_PORTH_HYSTERISIS(val) bfin_write16(PORTH_HYSTERISIS, val)
1103#define bfin_read_MISCPORT_DRIVE() bfin_read16(MISCPORT_DRIVE)
1104#define bfin_write_MISCPORT_DRIVE(val) bfin_write16(MISCPORT_DRIVE, val)
1105#define bfin_read_MISCPORT_SLEW() bfin_read16(MISCPORT_SLEW)
1106#define bfin_write_MISCPORT_SLEW(val) bfin_write16(MISCPORT_SLEW, val)
1107#define bfin_read_MISCPORT_HYSTERISIS() bfin_read16(MISCPORT_HYSTERISIS)
1108#define bfin_write_MISCPORT_HYSTERISIS(val) bfin_write16(MISCPORT_HYSTERISIS, val)
1109
1110/* HOST Port Registers */
1111
1112#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
1113#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
1114#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
1115#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
1116#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
1117#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
1118
1119/* Counter Registers */
1120
1121#define bfin_read_CNT_CONFIG() bfin_read16(CNT_CONFIG)
1122#define bfin_write_CNT_CONFIG(val) bfin_write16(CNT_CONFIG, val)
1123#define bfin_read_CNT_IMASK() bfin_read16(CNT_IMASK)
1124#define bfin_write_CNT_IMASK(val) bfin_write16(CNT_IMASK, val)
1125#define bfin_read_CNT_STATUS() bfin_read16(CNT_STATUS)
1126#define bfin_write_CNT_STATUS(val) bfin_write16(CNT_STATUS, val)
1127#define bfin_read_CNT_COMMAND() bfin_read16(CNT_COMMAND)
1128#define bfin_write_CNT_COMMAND(val) bfin_write16(CNT_COMMAND, val)
1129#define bfin_read_CNT_DEBOUNCE() bfin_read16(CNT_DEBOUNCE)
1130#define bfin_write_CNT_DEBOUNCE(val) bfin_write16(CNT_DEBOUNCE, val)
1131#define bfin_read_CNT_COUNTER() bfin_read32(CNT_COUNTER)
1132#define bfin_write_CNT_COUNTER(val) bfin_write32(CNT_COUNTER, val)
1133#define bfin_read_CNT_MAX() bfin_read32(CNT_MAX)
1134#define bfin_write_CNT_MAX(val) bfin_write32(CNT_MAX, val)
1135#define bfin_read_CNT_MIN() bfin_read32(CNT_MIN)
1136#define bfin_write_CNT_MIN(val) bfin_write32(CNT_MIN, val)
1137
1138/* OTP/FUSE Registers */
1139
1140#define bfin_read_OTP_CONTROL() bfin_read16(OTP_CONTROL)
1141#define bfin_write_OTP_CONTROL(val) bfin_write16(OTP_CONTROL, val)
1142#define bfin_read_OTP_BEN() bfin_read16(OTP_BEN)
1143#define bfin_write_OTP_BEN(val) bfin_write16(OTP_BEN, val)
1144#define bfin_read_OTP_STATUS() bfin_read16(OTP_STATUS)
1145#define bfin_write_OTP_STATUS(val) bfin_write16(OTP_STATUS, val)
1146#define bfin_read_OTP_TIMING() bfin_read32(OTP_TIMING)
1147#define bfin_write_OTP_TIMING(val) bfin_write32(OTP_TIMING, val)
1148
1149/* Security Registers */
1150
1151#define bfin_read_SECURE_SYSSWT() bfin_read32(SECURE_SYSSWT)
1152#define bfin_write_SECURE_SYSSWT(val) bfin_write32(SECURE_SYSSWT, val)
1153#define bfin_read_SECURE_CONTROL() bfin_read16(SECURE_CONTROL)
1154#define bfin_write_SECURE_CONTROL(val) bfin_write16(SECURE_CONTROL, val)
1155#define bfin_read_SECURE_STATUS() bfin_read16(SECURE_STATUS)
1156#define bfin_write_SECURE_STATUS(val) bfin_write16(SECURE_STATUS, val)
1157
1158/* OTP Read/Write Data Buffer Registers */
1159
1160#define bfin_read_OTP_DATA0() bfin_read32(OTP_DATA0)
1161#define bfin_write_OTP_DATA0(val) bfin_write32(OTP_DATA0, val)
1162#define bfin_read_OTP_DATA1() bfin_read32(OTP_DATA1)
1163#define bfin_write_OTP_DATA1(val) bfin_write32(OTP_DATA1, val)
1164#define bfin_read_OTP_DATA2() bfin_read32(OTP_DATA2)
1165#define bfin_write_OTP_DATA2(val) bfin_write32(OTP_DATA2, val)
1166#define bfin_read_OTP_DATA3() bfin_read32(OTP_DATA3)
1167#define bfin_write_OTP_DATA3(val) bfin_write32(OTP_DATA3, val)
1168
1169/* NFC Registers */
1170
1171#define bfin_read_NFC_CTL() bfin_read16(NFC_CTL)
1172#define bfin_write_NFC_CTL(val) bfin_write16(NFC_CTL, val)
1173#define bfin_read_NFC_STAT() bfin_read16(NFC_STAT)
1174#define bfin_write_NFC_STAT(val) bfin_write16(NFC_STAT, val)
1175#define bfin_read_NFC_IRQSTAT() bfin_read16(NFC_IRQSTAT)
1176#define bfin_write_NFC_IRQSTAT(val) bfin_write16(NFC_IRQSTAT, val)
1177#define bfin_read_NFC_IRQMASK() bfin_read16(NFC_IRQMASK)
1178#define bfin_write_NFC_IRQMASK(val) bfin_write16(NFC_IRQMASK, val)
1179#define bfin_read_NFC_ECC0() bfin_read16(NFC_ECC0)
1180#define bfin_write_NFC_ECC0(val) bfin_write16(NFC_ECC0, val)
1181#define bfin_read_NFC_ECC1() bfin_read16(NFC_ECC1)
1182#define bfin_write_NFC_ECC1(val) bfin_write16(NFC_ECC1, val)
1183#define bfin_read_NFC_ECC2() bfin_read16(NFC_ECC2)
1184#define bfin_write_NFC_ECC2(val) bfin_write16(NFC_ECC2, val)
1185#define bfin_read_NFC_ECC3() bfin_read16(NFC_ECC3)
1186#define bfin_write_NFC_ECC3(val) bfin_write16(NFC_ECC3, val)
1187#define bfin_read_NFC_COUNT() bfin_read16(NFC_COUNT)
1188#define bfin_write_NFC_COUNT(val) bfin_write16(NFC_COUNT, val)
1189#define bfin_read_NFC_RST() bfin_read16(NFC_RST)
1190#define bfin_write_NFC_RST(val) bfin_write16(NFC_RST, val)
1191#define bfin_read_NFC_PGCTL() bfin_read16(NFC_PGCTL)
1192#define bfin_write_NFC_PGCTL(val) bfin_write16(NFC_PGCTL, val)
1193#define bfin_read_NFC_READ() bfin_read16(NFC_READ)
1194#define bfin_write_NFC_READ(val) bfin_write16(NFC_READ, val)
1195#define bfin_read_NFC_ADDR() bfin_read16(NFC_ADDR)
1196#define bfin_write_NFC_ADDR(val) bfin_write16(NFC_ADDR, val)
1197#define bfin_read_NFC_CMD() bfin_read16(NFC_CMD)
1198#define bfin_write_NFC_CMD(val) bfin_write16(NFC_CMD, val)
1199#define bfin_read_NFC_DATA_WR() bfin_read16(NFC_DATA_WR)
1200#define bfin_write_NFC_DATA_WR(val) bfin_write16(NFC_DATA_WR, val)
1201#define bfin_read_NFC_DATA_RD() bfin_read16(NFC_DATA_RD)
1202#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
1203
1204#endif /* _CDEF_BF52X_H */
diff --git a/include/asm-blackfin/mach-bf527/defBF522.h b/include/asm-blackfin/mach-bf527/defBF522.h
deleted file mode 100644
index 9671d8f2c5ef..000000000000
--- a/include/asm-blackfin/mach-bf527/defBF522.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/defBF522.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_BF522_H
32#define _DEF_BF522_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF522 */
38
39/* Include defBF52x_base.h for the set of #defines that are common to all ADSP-BF52x processors */
40#include "defBF52x_base.h"
41
42#endif /* _DEF_BF522_H */
diff --git a/include/asm-blackfin/mach-bf527/defBF525.h b/include/asm-blackfin/mach-bf527/defBF525.h
deleted file mode 100644
index 6a375a084acc..000000000000
--- a/include/asm-blackfin/mach-bf527/defBF525.h
+++ /dev/null
@@ -1,713 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/defBF525.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_BF525_H
32#define _DEF_BF525_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF525 */
38
39/* Include defBF52x_base.h for the set of #defines that are common to all ADSP-BF52x processors */
40#include "defBF52x_base.h"
41
42/* The following are the #defines needed by ADSP-BF525 that are not in the common header */
43
44/* USB Control Registers */
45
46#define USB_FADDR 0xffc03800 /* Function address register */
47#define USB_POWER 0xffc03804 /* Power management register */
48#define USB_INTRTX 0xffc03808 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
49#define USB_INTRRX 0xffc0380c /* Interrupt register for Rx endpoints 1 to 7 */
50#define USB_INTRTXE 0xffc03810 /* Interrupt enable register for IntrTx */
51#define USB_INTRRXE 0xffc03814 /* Interrupt enable register for IntrRx */
52#define USB_INTRUSB 0xffc03818 /* Interrupt register for common USB interrupts */
53#define USB_INTRUSBE 0xffc0381c /* Interrupt enable register for IntrUSB */
54#define USB_FRAME 0xffc03820 /* USB frame number */
55#define USB_INDEX 0xffc03824 /* Index register for selecting the indexed endpoint registers */
56#define USB_TESTMODE 0xffc03828 /* Enabled USB 20 test modes */
57#define USB_GLOBINTR 0xffc0382c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
58#define USB_GLOBAL_CTL 0xffc03830 /* Global Clock Control for the core */
59
60/* USB Packet Control Registers */
61
62#define USB_TX_MAX_PACKET 0xffc03840 /* Maximum packet size for Host Tx endpoint */
63#define USB_CSR0 0xffc03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
64#define USB_TXCSR 0xffc03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
65#define USB_RX_MAX_PACKET 0xffc03848 /* Maximum packet size for Host Rx endpoint */
66#define USB_RXCSR 0xffc0384c /* Control Status register for Host Rx endpoint */
67#define USB_COUNT0 0xffc03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
68#define USB_RXCOUNT 0xffc03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
69#define USB_TXTYPE 0xffc03854 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
70#define USB_NAKLIMIT0 0xffc03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
71#define USB_TXINTERVAL 0xffc03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
72#define USB_RXTYPE 0xffc0385c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
73#define USB_RXINTERVAL 0xffc03860 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
74#define USB_TXCOUNT 0xffc03868 /* Number of bytes to be written to the selected endpoint Tx FIFO */
75
76/* USB Endpoint FIFO Registers */
77
78#define USB_EP0_FIFO 0xffc03880 /* Endpoint 0 FIFO */
79#define USB_EP1_FIFO 0xffc03888 /* Endpoint 1 FIFO */
80#define USB_EP2_FIFO 0xffc03890 /* Endpoint 2 FIFO */
81#define USB_EP3_FIFO 0xffc03898 /* Endpoint 3 FIFO */
82#define USB_EP4_FIFO 0xffc038a0 /* Endpoint 4 FIFO */
83#define USB_EP5_FIFO 0xffc038a8 /* Endpoint 5 FIFO */
84#define USB_EP6_FIFO 0xffc038b0 /* Endpoint 6 FIFO */
85#define USB_EP7_FIFO 0xffc038b8 /* Endpoint 7 FIFO */
86
87/* USB OTG Control Registers */
88
89#define USB_OTG_DEV_CTL 0xffc03900 /* OTG Device Control Register */
90#define USB_OTG_VBUS_IRQ 0xffc03904 /* OTG VBUS Control Interrupts */
91#define USB_OTG_VBUS_MASK 0xffc03908 /* VBUS Control Interrupt Enable */
92
93/* USB Phy Control Registers */
94
95#define USB_LINKINFO 0xffc03948 /* Enables programming of some PHY-side delays */
96#define USB_VPLEN 0xffc0394c /* Determines duration of VBUS pulse for VBUS charging */
97#define USB_HS_EOF1 0xffc03950 /* Time buffer for High-Speed transactions */
98#define USB_FS_EOF1 0xffc03954 /* Time buffer for Full-Speed transactions */
99#define USB_LS_EOF1 0xffc03958 /* Time buffer for Low-Speed transactions */
100
101/* (APHY_CNTRL is for ADI usage only) */
102
103#define USB_APHY_CNTRL 0xffc039e0 /* Register that increases visibility of Analog PHY */
104
105/* (APHY_CALIB is for ADI usage only) */
106
107#define USB_APHY_CALIB 0xffc039e4 /* Register used to set some calibration values */
108
109#define USB_APHY_CNTRL2 0xffc039e8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
110
111/* (PHY_TEST is for ADI usage only) */
112
113#define USB_PHY_TEST 0xffc039ec /* Used for reducing simulation time and simplifies FIFO testability */
114
115#define USB_PLLOSC_CTRL 0xffc039f0 /* Used to program different parameters for USB PLL and Oscillator */
116#define USB_SRP_CLKDIV 0xffc039f4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
117
118/* USB Endpoint 0 Control Registers */
119
120#define USB_EP_NI0_TXMAXP 0xffc03a00 /* Maximum packet size for Host Tx endpoint0 */
121#define USB_EP_NI0_TXCSR 0xffc03a04 /* Control Status register for endpoint 0 */
122#define USB_EP_NI0_RXMAXP 0xffc03a08 /* Maximum packet size for Host Rx endpoint0 */
123#define USB_EP_NI0_RXCSR 0xffc03a0c /* Control Status register for Host Rx endpoint0 */
124#define USB_EP_NI0_RXCOUNT 0xffc03a10 /* Number of bytes received in endpoint 0 FIFO */
125#define USB_EP_NI0_TXTYPE 0xffc03a14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
126#define USB_EP_NI0_TXINTERVAL 0xffc03a18 /* Sets the NAK response timeout on Endpoint 0 */
127#define USB_EP_NI0_RXTYPE 0xffc03a1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
128#define USB_EP_NI0_RXINTERVAL 0xffc03a20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint0 */
129#define USB_EP_NI0_TXCOUNT 0xffc03a28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
130
131/* USB Endpoint 1 Control Registers */
132
133#define USB_EP_NI1_TXMAXP 0xffc03a40 /* Maximum packet size for Host Tx endpoint1 */
134#define USB_EP_NI1_TXCSR 0xffc03a44 /* Control Status register for endpoint1 */
135#define USB_EP_NI1_RXMAXP 0xffc03a48 /* Maximum packet size for Host Rx endpoint1 */
136#define USB_EP_NI1_RXCSR 0xffc03a4c /* Control Status register for Host Rx endpoint1 */
137#define USB_EP_NI1_RXCOUNT 0xffc03a50 /* Number of bytes received in endpoint1 FIFO */
138#define USB_EP_NI1_TXTYPE 0xffc03a54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
139#define USB_EP_NI1_TXINTERVAL 0xffc03a58 /* Sets the NAK response timeout on Endpoint1 */
140#define USB_EP_NI1_RXTYPE 0xffc03a5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
141#define USB_EP_NI1_RXINTERVAL 0xffc03a60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint1 */
142#define USB_EP_NI1_TXCOUNT 0xffc03a68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
143
144/* USB Endpoint 2 Control Registers */
145
146#define USB_EP_NI2_TXMAXP 0xffc03a80 /* Maximum packet size for Host Tx endpoint2 */
147#define USB_EP_NI2_TXCSR 0xffc03a84 /* Control Status register for endpoint2 */
148#define USB_EP_NI2_RXMAXP 0xffc03a88 /* Maximum packet size for Host Rx endpoint2 */
149#define USB_EP_NI2_RXCSR 0xffc03a8c /* Control Status register for Host Rx endpoint2 */
150#define USB_EP_NI2_RXCOUNT 0xffc03a90 /* Number of bytes received in endpoint2 FIFO */
151#define USB_EP_NI2_TXTYPE 0xffc03a94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
152#define USB_EP_NI2_TXINTERVAL 0xffc03a98 /* Sets the NAK response timeout on Endpoint2 */
153#define USB_EP_NI2_RXTYPE 0xffc03a9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
154#define USB_EP_NI2_RXINTERVAL 0xffc03aa0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint2 */
155#define USB_EP_NI2_TXCOUNT 0xffc03aa8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
156
157/* USB Endpoint 3 Control Registers */
158
159#define USB_EP_NI3_TXMAXP 0xffc03ac0 /* Maximum packet size for Host Tx endpoint3 */
160#define USB_EP_NI3_TXCSR 0xffc03ac4 /* Control Status register for endpoint3 */
161#define USB_EP_NI3_RXMAXP 0xffc03ac8 /* Maximum packet size for Host Rx endpoint3 */
162#define USB_EP_NI3_RXCSR 0xffc03acc /* Control Status register for Host Rx endpoint3 */
163#define USB_EP_NI3_RXCOUNT 0xffc03ad0 /* Number of bytes received in endpoint3 FIFO */
164#define USB_EP_NI3_TXTYPE 0xffc03ad4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
165#define USB_EP_NI3_TXINTERVAL 0xffc03ad8 /* Sets the NAK response timeout on Endpoint3 */
166#define USB_EP_NI3_RXTYPE 0xffc03adc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
167#define USB_EP_NI3_RXINTERVAL 0xffc03ae0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint3 */
168#define USB_EP_NI3_TXCOUNT 0xffc03ae8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
169
170/* USB Endpoint 4 Control Registers */
171
172#define USB_EP_NI4_TXMAXP 0xffc03b00 /* Maximum packet size for Host Tx endpoint4 */
173#define USB_EP_NI4_TXCSR 0xffc03b04 /* Control Status register for endpoint4 */
174#define USB_EP_NI4_RXMAXP 0xffc03b08 /* Maximum packet size for Host Rx endpoint4 */
175#define USB_EP_NI4_RXCSR 0xffc03b0c /* Control Status register for Host Rx endpoint4 */
176#define USB_EP_NI4_RXCOUNT 0xffc03b10 /* Number of bytes received in endpoint4 FIFO */
177#define USB_EP_NI4_TXTYPE 0xffc03b14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
178#define USB_EP_NI4_TXINTERVAL 0xffc03b18 /* Sets the NAK response timeout on Endpoint4 */
179#define USB_EP_NI4_RXTYPE 0xffc03b1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
180#define USB_EP_NI4_RXINTERVAL 0xffc03b20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint4 */
181#define USB_EP_NI4_TXCOUNT 0xffc03b28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
182
183/* USB Endpoint 5 Control Registers */
184
185#define USB_EP_NI5_TXMAXP 0xffc03b40 /* Maximum packet size for Host Tx endpoint5 */
186#define USB_EP_NI5_TXCSR 0xffc03b44 /* Control Status register for endpoint5 */
187#define USB_EP_NI5_RXMAXP 0xffc03b48 /* Maximum packet size for Host Rx endpoint5 */
188#define USB_EP_NI5_RXCSR 0xffc03b4c /* Control Status register for Host Rx endpoint5 */
189#define USB_EP_NI5_RXCOUNT 0xffc03b50 /* Number of bytes received in endpoint5 FIFO */
190#define USB_EP_NI5_TXTYPE 0xffc03b54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
191#define USB_EP_NI5_TXINTERVAL 0xffc03b58 /* Sets the NAK response timeout on Endpoint5 */
192#define USB_EP_NI5_RXTYPE 0xffc03b5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
193#define USB_EP_NI5_RXINTERVAL 0xffc03b60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint5 */
194#define USB_EP_NI5_TXCOUNT 0xffc03b68 /* Number of bytes to be written to the endpoint5 Tx FIFO */
195
196/* USB Endpoint 6 Control Registers */
197
198#define USB_EP_NI6_TXMAXP 0xffc03b80 /* Maximum packet size for Host Tx endpoint6 */
199#define USB_EP_NI6_TXCSR 0xffc03b84 /* Control Status register for endpoint6 */
200#define USB_EP_NI6_RXMAXP 0xffc03b88 /* Maximum packet size for Host Rx endpoint6 */
201#define USB_EP_NI6_RXCSR 0xffc03b8c /* Control Status register for Host Rx endpoint6 */
202#define USB_EP_NI6_RXCOUNT 0xffc03b90 /* Number of bytes received in endpoint6 FIFO */
203#define USB_EP_NI6_TXTYPE 0xffc03b94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
204#define USB_EP_NI6_TXINTERVAL 0xffc03b98 /* Sets the NAK response timeout on Endpoint6 */
205#define USB_EP_NI6_RXTYPE 0xffc03b9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
206#define USB_EP_NI6_RXINTERVAL 0xffc03ba0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint6 */
207#define USB_EP_NI6_TXCOUNT 0xffc03ba8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
208
209/* USB Endpoint 7 Control Registers */
210
211#define USB_EP_NI7_TXMAXP 0xffc03bc0 /* Maximum packet size for Host Tx endpoint7 */
212#define USB_EP_NI7_TXCSR 0xffc03bc4 /* Control Status register for endpoint7 */
213#define USB_EP_NI7_RXMAXP 0xffc03bc8 /* Maximum packet size for Host Rx endpoint7 */
214#define USB_EP_NI7_RXCSR 0xffc03bcc /* Control Status register for Host Rx endpoint7 */
215#define USB_EP_NI7_RXCOUNT 0xffc03bd0 /* Number of bytes received in endpoint7 FIFO */
216#define USB_EP_NI7_TXTYPE 0xffc03bd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
217#define USB_EP_NI7_TXINTERVAL 0xffc03bd8 /* Sets the NAK response timeout on Endpoint7 */
218#define USB_EP_NI7_RXTYPE 0xffc03bdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
219#define USB_EP_NI7_RXINTERVAL 0xffc03bf0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint7 */
220#define USB_EP_NI7_TXCOUNT 0xffc03bf8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
221
222#define USB_DMA_INTERRUPT 0xffc03c00 /* Indicates pending interrupts for the DMA channels */
223
224/* USB Channel 0 Config Registers */
225
226#define USB_DMA0CONTROL 0xffc03c04 /* DMA master channel 0 configuration */
227#define USB_DMA0ADDRLOW 0xffc03c08 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
228#define USB_DMA0ADDRHIGH 0xffc03c0c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
229#define USB_DMA0COUNTLOW 0xffc03c10 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
230#define USB_DMA0COUNTHIGH 0xffc03c14 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
231
232/* USB Channel 1 Config Registers */
233
234#define USB_DMA1CONTROL 0xffc03c24 /* DMA master channel 1 configuration */
235#define USB_DMA1ADDRLOW 0xffc03c28 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
236#define USB_DMA1ADDRHIGH 0xffc03c2c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
237#define USB_DMA1COUNTLOW 0xffc03c30 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
238#define USB_DMA1COUNTHIGH 0xffc03c34 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
239
240/* USB Channel 2 Config Registers */
241
242#define USB_DMA2CONTROL 0xffc03c44 /* DMA master channel 2 configuration */
243#define USB_DMA2ADDRLOW 0xffc03c48 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
244#define USB_DMA2ADDRHIGH 0xffc03c4c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
245#define USB_DMA2COUNTLOW 0xffc03c50 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
246#define USB_DMA2COUNTHIGH 0xffc03c54 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
247
248/* USB Channel 3 Config Registers */
249
250#define USB_DMA3CONTROL 0xffc03c64 /* DMA master channel 3 configuration */
251#define USB_DMA3ADDRLOW 0xffc03c68 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
252#define USB_DMA3ADDRHIGH 0xffc03c6c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
253#define USB_DMA3COUNTLOW 0xffc03c70 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
254#define USB_DMA3COUNTHIGH 0xffc03c74 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
255
256/* USB Channel 4 Config Registers */
257
258#define USB_DMA4CONTROL 0xffc03c84 /* DMA master channel 4 configuration */
259#define USB_DMA4ADDRLOW 0xffc03c88 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
260#define USB_DMA4ADDRHIGH 0xffc03c8c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
261#define USB_DMA4COUNTLOW 0xffc03c90 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
262#define USB_DMA4COUNTHIGH 0xffc03c94 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
263
264/* USB Channel 5 Config Registers */
265
266#define USB_DMA5CONTROL 0xffc03ca4 /* DMA master channel 5 configuration */
267#define USB_DMA5ADDRLOW 0xffc03ca8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
268#define USB_DMA5ADDRHIGH 0xffc03cac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
269#define USB_DMA5COUNTLOW 0xffc03cb0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
270#define USB_DMA5COUNTHIGH 0xffc03cb4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
271
272/* USB Channel 6 Config Registers */
273
274#define USB_DMA6CONTROL 0xffc03cc4 /* DMA master channel 6 configuration */
275#define USB_DMA6ADDRLOW 0xffc03cc8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
276#define USB_DMA6ADDRHIGH 0xffc03ccc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
277#define USB_DMA6COUNTLOW 0xffc03cd0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
278#define USB_DMA6COUNTHIGH 0xffc03cd4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
279
280/* USB Channel 7 Config Registers */
281
282#define USB_DMA7CONTROL 0xffc03ce4 /* DMA master channel 7 configuration */
283#define USB_DMA7ADDRLOW 0xffc03ce8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
284#define USB_DMA7ADDRHIGH 0xffc03cec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
285#define USB_DMA7COUNTLOW 0xffc03cf0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
286#define USB_DMA7COUNTHIGH 0xffc03cf4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
287
288/* Bit masks for USB_FADDR */
289
290#define FUNCTION_ADDRESS 0x7f /* Function address */
291
292/* Bit masks for USB_POWER */
293
294#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
295#define nENABLE_SUSPENDM 0x0
296#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
297#define nSUSPEND_MODE 0x0
298#define RESUME_MODE 0x4 /* DMA Mode */
299#define nRESUME_MODE 0x0
300#define RESET 0x8 /* Reset indicator */
301#define nRESET 0x0
302#define HS_MODE 0x10 /* High Speed mode indicator */
303#define nHS_MODE 0x0
304#define HS_ENABLE 0x20 /* high Speed Enable */
305#define nHS_ENABLE 0x0
306#define SOFT_CONN 0x40 /* Soft connect */
307#define nSOFT_CONN 0x0
308#define ISO_UPDATE 0x80 /* Isochronous update */
309#define nISO_UPDATE 0x0
310
311/* Bit masks for USB_INTRTX */
312
313#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
314#define nEP0_TX 0x0
315#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
316#define nEP1_TX 0x0
317#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
318#define nEP2_TX 0x0
319#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
320#define nEP3_TX 0x0
321#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
322#define nEP4_TX 0x0
323#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
324#define nEP5_TX 0x0
325#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
326#define nEP6_TX 0x0
327#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
328#define nEP7_TX 0x0
329
330/* Bit masks for USB_INTRRX */
331
332#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
333#define nEP1_RX 0x0
334#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
335#define nEP2_RX 0x0
336#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
337#define nEP3_RX 0x0
338#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
339#define nEP4_RX 0x0
340#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
341#define nEP5_RX 0x0
342#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
343#define nEP6_RX 0x0
344#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
345#define nEP7_RX 0x0
346
347/* Bit masks for USB_INTRTXE */
348
349#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
350#define nEP0_TX_E 0x0
351#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
352#define nEP1_TX_E 0x0
353#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
354#define nEP2_TX_E 0x0
355#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
356#define nEP3_TX_E 0x0
357#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
358#define nEP4_TX_E 0x0
359#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
360#define nEP5_TX_E 0x0
361#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
362#define nEP6_TX_E 0x0
363#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
364#define nEP7_TX_E 0x0
365
366/* Bit masks for USB_INTRRXE */
367
368#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
369#define nEP1_RX_E 0x0
370#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
371#define nEP2_RX_E 0x0
372#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
373#define nEP3_RX_E 0x0
374#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
375#define nEP4_RX_E 0x0
376#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
377#define nEP5_RX_E 0x0
378#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
379#define nEP6_RX_E 0x0
380#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
381#define nEP7_RX_E 0x0
382
383/* Bit masks for USB_INTRUSB */
384
385#define SUSPEND_B 0x1 /* Suspend indicator */
386#define nSUSPEND_B 0x0
387#define RESUME_B 0x2 /* Resume indicator */
388#define nRESUME_B 0x0
389#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
390#define nRESET_OR_BABLE_B 0x0
391#define SOF_B 0x8 /* Start of frame */
392#define nSOF_B 0x0
393#define CONN_B 0x10 /* Connection indicator */
394#define nCONN_B 0x0
395#define DISCON_B 0x20 /* Disconnect indicator */
396#define nDISCON_B 0x0
397#define SESSION_REQ_B 0x40 /* Session Request */
398#define nSESSION_REQ_B 0x0
399#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
400#define nVBUS_ERROR_B 0x0
401
402/* Bit masks for USB_INTRUSBE */
403
404#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
405#define nSUSPEND_BE 0x0
406#define RESUME_BE 0x2 /* Resume indicator int enable */
407#define nRESUME_BE 0x0
408#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
409#define nRESET_OR_BABLE_BE 0x0
410#define SOF_BE 0x8 /* Start of frame int enable */
411#define nSOF_BE 0x0
412#define CONN_BE 0x10 /* Connection indicator int enable */
413#define nCONN_BE 0x0
414#define DISCON_BE 0x20 /* Disconnect indicator int enable */
415#define nDISCON_BE 0x0
416#define SESSION_REQ_BE 0x40 /* Session Request int enable */
417#define nSESSION_REQ_BE 0x0
418#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
419#define nVBUS_ERROR_BE 0x0
420
421/* Bit masks for USB_FRAME */
422
423#define FRAME_NUMBER 0x7ff /* Frame number */
424
425/* Bit masks for USB_INDEX */
426
427#define SELECTED_ENDPOINT 0xf /* selected endpoint */
428
429/* Bit masks for USB_GLOBAL_CTL */
430
431#define GLOBAL_ENA 0x1 /* enables USB module */
432#define nGLOBAL_ENA 0x0
433#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
434#define nEP1_TX_ENA 0x0
435#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
436#define nEP2_TX_ENA 0x0
437#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
438#define nEP3_TX_ENA 0x0
439#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
440#define nEP4_TX_ENA 0x0
441#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
442#define nEP5_TX_ENA 0x0
443#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
444#define nEP6_TX_ENA 0x0
445#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
446#define nEP7_TX_ENA 0x0
447#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
448#define nEP1_RX_ENA 0x0
449#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
450#define nEP2_RX_ENA 0x0
451#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
452#define nEP3_RX_ENA 0x0
453#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
454#define nEP4_RX_ENA 0x0
455#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
456#define nEP5_RX_ENA 0x0
457#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
458#define nEP6_RX_ENA 0x0
459#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
460#define nEP7_RX_ENA 0x0
461
462/* Bit masks for USB_OTG_DEV_CTL */
463
464#define SESSION 0x1 /* session indicator */
465#define nSESSION 0x0
466#define HOST_REQ 0x2 /* Host negotiation request */
467#define nHOST_REQ 0x0
468#define HOST_MODE 0x4 /* indicates USBDRC is a host */
469#define nHOST_MODE 0x0
470#define VBUS0 0x8 /* Vbus level indicator[0] */
471#define nVBUS0 0x0
472#define VBUS1 0x10 /* Vbus level indicator[1] */
473#define nVBUS1 0x0
474#define LSDEV 0x20 /* Low-speed indicator */
475#define nLSDEV 0x0
476#define FSDEV 0x40 /* Full or High-speed indicator */
477#define nFSDEV 0x0
478#define B_DEVICE 0x80 /* A' or 'B' device indicator */
479#define nB_DEVICE 0x0
480
481/* Bit masks for USB_OTG_VBUS_IRQ */
482
483#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
484#define nDRIVE_VBUS_ON 0x0
485#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
486#define nDRIVE_VBUS_OFF 0x0
487#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
488#define nCHRG_VBUS_START 0x0
489#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
490#define nCHRG_VBUS_END 0x0
491#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
492#define nDISCHRG_VBUS_START 0x0
493#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
494#define nDISCHRG_VBUS_END 0x0
495
496/* Bit masks for USB_OTG_VBUS_MASK */
497
498#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
499#define nDRIVE_VBUS_ON_ENA 0x0
500#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
501#define nDRIVE_VBUS_OFF_ENA 0x0
502#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
503#define nCHRG_VBUS_START_ENA 0x0
504#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
505#define nCHRG_VBUS_END_ENA 0x0
506#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
507#define nDISCHRG_VBUS_START_ENA 0x0
508#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
509#define nDISCHRG_VBUS_END_ENA 0x0
510
511/* Bit masks for USB_CSR0 */
512
513#define RXPKTRDY 0x1 /* data packet receive indicator */
514#define nRXPKTRDY 0x0
515#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
516#define nTXPKTRDY 0x0
517#define STALL_SENT 0x4 /* STALL handshake sent */
518#define nSTALL_SENT 0x0
519#define DATAEND 0x8 /* Data end indicator */
520#define nDATAEND 0x0
521#define SETUPEND 0x10 /* Setup end */
522#define nSETUPEND 0x0
523#define SENDSTALL 0x20 /* Send STALL handshake */
524#define nSENDSTALL 0x0
525#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
526#define nSERVICED_RXPKTRDY 0x0
527#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
528#define nSERVICED_SETUPEND 0x0
529#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
530#define nFLUSHFIFO 0x0
531#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
532#define nSTALL_RECEIVED_H 0x0
533#define SETUPPKT_H 0x8 /* send Setup token host mode */
534#define nSETUPPKT_H 0x0
535#define ERROR_H 0x10 /* timeout error indicator host mode */
536#define nERROR_H 0x0
537#define REQPKT_H 0x20 /* Request an IN transaction host mode */
538#define nREQPKT_H 0x0
539#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
540#define nSTATUSPKT_H 0x0
541#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
542#define nNAK_TIMEOUT_H 0x0
543
544/* Bit masks for USB_COUNT0 */
545
546#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
547
548/* Bit masks for USB_NAKLIMIT0 */
549
550#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
551
552/* Bit masks for USB_TX_MAX_PACKET */
553
554#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
555
556/* Bit masks for USB_RX_MAX_PACKET */
557
558#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
559
560/* Bit masks for USB_TXCSR */
561
562#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
563#define nTXPKTRDY_T 0x0
564#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
565#define nFIFO_NOT_EMPTY_T 0x0
566#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
567#define nUNDERRUN_T 0x0
568#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
569#define nFLUSHFIFO_T 0x0
570#define STALL_SEND_T 0x10 /* issue a Stall handshake */
571#define nSTALL_SEND_T 0x0
572#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
573#define nSTALL_SENT_T 0x0
574#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
575#define nCLEAR_DATATOGGLE_T 0x0
576#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
577#define nINCOMPTX_T 0x0
578#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
579#define nDMAREQMODE_T 0x0
580#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
581#define nFORCE_DATATOGGLE_T 0x0
582#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
583#define nDMAREQ_ENA_T 0x0
584#define ISO_T 0x4000 /* enable Isochronous transfers */
585#define nISO_T 0x0
586#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
587#define nAUTOSET_T 0x0
588#define ERROR_TH 0x4 /* error condition host mode */
589#define nERROR_TH 0x0
590#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
591#define nSTALL_RECEIVED_TH 0x0
592#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
593#define nNAK_TIMEOUT_TH 0x0
594
595/* Bit masks for USB_TXCOUNT */
596
597#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
598
599/* Bit masks for USB_RXCSR */
600
601#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
602#define nRXPKTRDY_R 0x0
603#define FIFO_FULL_R 0x2 /* FIFO not empty */
604#define nFIFO_FULL_R 0x0
605#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
606#define nOVERRUN_R 0x0
607#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
608#define nDATAERROR_R 0x0
609#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
610#define nFLUSHFIFO_R 0x0
611#define STALL_SEND_R 0x20 /* issue a Stall handshake */
612#define nSTALL_SEND_R 0x0
613#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
614#define nSTALL_SENT_R 0x0
615#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
616#define nCLEAR_DATATOGGLE_R 0x0
617#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
618#define nINCOMPRX_R 0x0
619#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
620#define nDMAREQMODE_R 0x0
621#define DISNYET_R 0x1000 /* disable Nyet handshakes */
622#define nDISNYET_R 0x0
623#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
624#define nDMAREQ_ENA_R 0x0
625#define ISO_R 0x4000 /* enable Isochronous transfers */
626#define nISO_R 0x0
627#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
628#define nAUTOCLEAR_R 0x0
629#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
630#define nERROR_RH 0x0
631#define REQPKT_RH 0x20 /* request an IN transaction host mode */
632#define nREQPKT_RH 0x0
633#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
634#define nSTALL_RECEIVED_RH 0x0
635#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
636#define nINCOMPRX_RH 0x0
637#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
638#define nDMAREQMODE_RH 0x0
639#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
640#define nAUTOREQ_RH 0x0
641
642/* Bit masks for USB_RXCOUNT */
643
644#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
645
646/* Bit masks for USB_TXTYPE */
647
648#define TARGET_EP_NO_T 0xf /* EP number */
649#define PROTOCOL_T 0xc /* transfer type */
650
651/* Bit masks for USB_TXINTERVAL */
652
653#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
654
655/* Bit masks for USB_RXTYPE */
656
657#define TARGET_EP_NO_R 0xf /* EP number */
658#define PROTOCOL_R 0xc /* transfer type */
659
660/* Bit masks for USB_RXINTERVAL */
661
662#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
663
664/* Bit masks for USB_DMA_INTERRUPT */
665
666#define DMA0_INT 0x1 /* DMA0 pending interrupt */
667#define nDMA0_INT 0x0
668#define DMA1_INT 0x2 /* DMA1 pending interrupt */
669#define nDMA1_INT 0x0
670#define DMA2_INT 0x4 /* DMA2 pending interrupt */
671#define nDMA2_INT 0x0
672#define DMA3_INT 0x8 /* DMA3 pending interrupt */
673#define nDMA3_INT 0x0
674#define DMA4_INT 0x10 /* DMA4 pending interrupt */
675#define nDMA4_INT 0x0
676#define DMA5_INT 0x20 /* DMA5 pending interrupt */
677#define nDMA5_INT 0x0
678#define DMA6_INT 0x40 /* DMA6 pending interrupt */
679#define nDMA6_INT 0x0
680#define DMA7_INT 0x80 /* DMA7 pending interrupt */
681#define nDMA7_INT 0x0
682
683/* Bit masks for USB_DMAxCONTROL */
684
685#define DMA_ENA 0x1 /* DMA enable */
686#define nDMA_ENA 0x0
687#define DIRECTION 0x2 /* direction of DMA transfer */
688#define nDIRECTION 0x0
689#define MODE 0x4 /* DMA Bus error */
690#define nMODE 0x0
691#define INT_ENA 0x8 /* Interrupt enable */
692#define nINT_ENA 0x0
693#define EPNUM 0xf0 /* EP number */
694#define BUSERROR 0x100 /* DMA Bus error */
695#define nBUSERROR 0x0
696
697/* Bit masks for USB_DMAxADDRHIGH */
698
699#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
700
701/* Bit masks for USB_DMAxADDRLOW */
702
703#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
704
705/* Bit masks for USB_DMAxCOUNTHIGH */
706
707#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
708
709/* Bit masks for USB_DMAxCOUNTLOW */
710
711#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
712
713#endif /* _DEF_BF525_H */
diff --git a/include/asm-blackfin/mach-bf527/defBF527.h b/include/asm-blackfin/mach-bf527/defBF527.h
deleted file mode 100644
index f1a70db70cb8..000000000000
--- a/include/asm-blackfin/mach-bf527/defBF527.h
+++ /dev/null
@@ -1,1090 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/defBF527.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_BF527_H
32#define _DEF_BF527_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF527 */
38
39/* Include defBF52x_base.h for the set of #defines that are common to all ADSP-BF52x processors */
40#include "defBF52x_base.h"
41
42/* The following are the #defines needed by ADSP-BF527 that are not in the common header */
43/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
44
45#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
46#define EMAC_ADDRLO 0xFFC03004 /* Address Low (32 LSBs) Register */
47#define EMAC_ADDRHI 0xFFC03008 /* Address High (16 MSBs) Register */
48#define EMAC_HASHLO 0xFFC0300C /* Multicast Hash Table Low (Bins 31-0) Register */
49#define EMAC_HASHHI 0xFFC03010 /* Multicast Hash Table High (Bins 63-32) Register */
50#define EMAC_STAADD 0xFFC03014 /* Station Management Address Register */
51#define EMAC_STADAT 0xFFC03018 /* Station Management Data Register */
52#define EMAC_FLC 0xFFC0301C /* Flow Control Register */
53#define EMAC_VLAN1 0xFFC03020 /* VLAN1 Tag Register */
54#define EMAC_VLAN2 0xFFC03024 /* VLAN2 Tag Register */
55#define EMAC_WKUP_CTL 0xFFC0302C /* Wake-Up Control/Status Register */
56#define EMAC_WKUP_FFMSK0 0xFFC03030 /* Wake-Up Frame Filter 0 Byte Mask Register */
57#define EMAC_WKUP_FFMSK1 0xFFC03034 /* Wake-Up Frame Filter 1 Byte Mask Register */
58#define EMAC_WKUP_FFMSK2 0xFFC03038 /* Wake-Up Frame Filter 2 Byte Mask Register */
59#define EMAC_WKUP_FFMSK3 0xFFC0303C /* Wake-Up Frame Filter 3 Byte Mask Register */
60#define EMAC_WKUP_FFCMD 0xFFC03040 /* Wake-Up Frame Filter Commands Register */
61#define EMAC_WKUP_FFOFF 0xFFC03044 /* Wake-Up Frame Filter Offsets Register */
62#define EMAC_WKUP_FFCRC0 0xFFC03048 /* Wake-Up Frame Filter 0,1 CRC-16 Register */
63#define EMAC_WKUP_FFCRC1 0xFFC0304C /* Wake-Up Frame Filter 2,3 CRC-16 Register */
64
65#define EMAC_SYSCTL 0xFFC03060 /* EMAC System Control Register */
66#define EMAC_SYSTAT 0xFFC03064 /* EMAC System Status Register */
67#define EMAC_RX_STAT 0xFFC03068 /* RX Current Frame Status Register */
68#define EMAC_RX_STKY 0xFFC0306C /* RX Sticky Frame Status Register */
69#define EMAC_RX_IRQE 0xFFC03070 /* RX Frame Status Interrupt Enables Register */
70#define EMAC_TX_STAT 0xFFC03074 /* TX Current Frame Status Register */
71#define EMAC_TX_STKY 0xFFC03078 /* TX Sticky Frame Status Register */
72#define EMAC_TX_IRQE 0xFFC0307C /* TX Frame Status Interrupt Enables Register */
73
74#define EMAC_MMC_CTL 0xFFC03080 /* MMC Counter Control Register */
75#define EMAC_MMC_RIRQS 0xFFC03084 /* MMC RX Interrupt Status Register */
76#define EMAC_MMC_RIRQE 0xFFC03088 /* MMC RX Interrupt Enables Register */
77#define EMAC_MMC_TIRQS 0xFFC0308C /* MMC TX Interrupt Status Register */
78#define EMAC_MMC_TIRQE 0xFFC03090 /* MMC TX Interrupt Enables Register */
79
80#define EMAC_RXC_OK 0xFFC03100 /* RX Frame Successful Count */
81#define EMAC_RXC_FCS 0xFFC03104 /* RX Frame FCS Failure Count */
82#define EMAC_RXC_ALIGN 0xFFC03108 /* RX Alignment Error Count */
83#define EMAC_RXC_OCTET 0xFFC0310C /* RX Octets Successfully Received Count */
84#define EMAC_RXC_DMAOVF 0xFFC03110 /* Internal MAC Sublayer Error RX Frame Count */
85#define EMAC_RXC_UNICST 0xFFC03114 /* Unicast RX Frame Count */
86#define EMAC_RXC_MULTI 0xFFC03118 /* Multicast RX Frame Count */
87#define EMAC_RXC_BROAD 0xFFC0311C /* Broadcast RX Frame Count */
88#define EMAC_RXC_LNERRI 0xFFC03120 /* RX Frame In Range Error Count */
89#define EMAC_RXC_LNERRO 0xFFC03124 /* RX Frame Out Of Range Error Count */
90#define EMAC_RXC_LONG 0xFFC03128 /* RX Frame Too Long Count */
91#define EMAC_RXC_MACCTL 0xFFC0312C /* MAC Control RX Frame Count */
92#define EMAC_RXC_OPCODE 0xFFC03130 /* Unsupported Op-Code RX Frame Count */
93#define EMAC_RXC_PAUSE 0xFFC03134 /* MAC Control Pause RX Frame Count */
94#define EMAC_RXC_ALLFRM 0xFFC03138 /* Overall RX Frame Count */
95#define EMAC_RXC_ALLOCT 0xFFC0313C /* Overall RX Octet Count */
96#define EMAC_RXC_TYPED 0xFFC03140 /* Type/Length Consistent RX Frame Count */
97#define EMAC_RXC_SHORT 0xFFC03144 /* RX Frame Fragment Count - Byte Count x < 64 */
98#define EMAC_RXC_EQ64 0xFFC03148 /* Good RX Frame Count - Byte Count x = 64 */
99#define EMAC_RXC_LT128 0xFFC0314C /* Good RX Frame Count - Byte Count 64 < x < 128 */
100#define EMAC_RXC_LT256 0xFFC03150 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
101#define EMAC_RXC_LT512 0xFFC03154 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
102#define EMAC_RXC_LT1024 0xFFC03158 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
103#define EMAC_RXC_GE1024 0xFFC0315C /* Good RX Frame Count - Byte Count x >= 1024 */
104
105#define EMAC_TXC_OK 0xFFC03180 /* TX Frame Successful Count */
106#define EMAC_TXC_1COL 0xFFC03184 /* TX Frames Successful After Single Collision Count */
107#define EMAC_TXC_GT1COL 0xFFC03188 /* TX Frames Successful After Multiple Collisions Count */
108#define EMAC_TXC_OCTET 0xFFC0318C /* TX Octets Successfully Received Count */
109#define EMAC_TXC_DEFER 0xFFC03190 /* TX Frame Delayed Due To Busy Count */
110#define EMAC_TXC_LATECL 0xFFC03194 /* Late TX Collisions Count */
111#define EMAC_TXC_XS_COL 0xFFC03198 /* TX Frame Failed Due To Excessive Collisions Count */
112#define EMAC_TXC_DMAUND 0xFFC0319C /* Internal MAC Sublayer Error TX Frame Count */
113#define EMAC_TXC_CRSERR 0xFFC031A0 /* Carrier Sense Deasserted During TX Frame Count */
114#define EMAC_TXC_UNICST 0xFFC031A4 /* Unicast TX Frame Count */
115#define EMAC_TXC_MULTI 0xFFC031A8 /* Multicast TX Frame Count */
116#define EMAC_TXC_BROAD 0xFFC031AC /* Broadcast TX Frame Count */
117#define EMAC_TXC_XS_DFR 0xFFC031B0 /* TX Frames With Excessive Deferral Count */
118#define EMAC_TXC_MACCTL 0xFFC031B4 /* MAC Control TX Frame Count */
119#define EMAC_TXC_ALLFRM 0xFFC031B8 /* Overall TX Frame Count */
120#define EMAC_TXC_ALLOCT 0xFFC031BC /* Overall TX Octet Count */
121#define EMAC_TXC_EQ64 0xFFC031C0 /* Good TX Frame Count - Byte Count x = 64 */
122#define EMAC_TXC_LT128 0xFFC031C4 /* Good TX Frame Count - Byte Count 64 < x < 128 */
123#define EMAC_TXC_LT256 0xFFC031C8 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
124#define EMAC_TXC_LT512 0xFFC031CC /* Good TX Frame Count - Byte Count 256 <= x < 512 */
125#define EMAC_TXC_LT1024 0xFFC031D0 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
126#define EMAC_TXC_GE1024 0xFFC031D4 /* Good TX Frame Count - Byte Count x >= 1024 */
127#define EMAC_TXC_ABORT 0xFFC031D8 /* Total TX Frames Aborted Count */
128
129/* Listing for IEEE-Supported Count Registers */
130
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
192/************************ ETHERNET 10/100 CONTROLLER MASKS ************************/
193
194/* EMAC_OPMODE Masks */
195
196#define RE 0x00000001 /* Receiver Enable */
197#define ASTP 0x00000002 /* Enable Automatic Pad Stripping On RX Frames */
198#define HU 0x00000010 /* Hash Filter Unicast Address */
199#define HM 0x00000020 /* Hash Filter Multicast Address */
200#define PAM 0x00000040 /* Pass-All-Multicast Mode Enable */
201#define PR 0x00000080 /* Promiscuous Mode Enable */
202#define IFE 0x00000100 /* Inverse Filtering Enable */
203#define DBF 0x00000200 /* Disable Broadcast Frame Reception */
204#define PBF 0x00000400 /* Pass Bad Frames Enable */
205#define PSF 0x00000800 /* Pass Short Frames Enable */
206#define RAF 0x00001000 /* Receive-All Mode */
207#define TE 0x00010000 /* Transmitter Enable */
208#define DTXPAD 0x00020000 /* Disable Automatic TX Padding */
209#define DTXCRC 0x00040000 /* Disable Automatic TX CRC Generation */
210#define DC 0x00080000 /* Deferral Check */
211#define BOLMT 0x00300000 /* Back-Off Limit */
212#define BOLMT_10 0x00000000 /* 10-bit range */
213#define BOLMT_8 0x00100000 /* 8-bit range */
214#define BOLMT_4 0x00200000 /* 4-bit range */
215#define BOLMT_1 0x00300000 /* 1-bit range */
216#define DRTY 0x00400000 /* Disable TX Retry On Collision */
217#define LCTRE 0x00800000 /* Enable TX Retry On Late Collision */
218#define RMII 0x01000000 /* RMII/MII* Mode */
219#define RMII_10 0x02000000 /* Speed Select for RMII Port (10MBit/100MBit*) */
220#define FDMODE 0x04000000 /* Duplex Mode Enable (Full/Half*) */
221#define LB 0x08000000 /* Internal Loopback Enable */
222#define DRO 0x10000000 /* Disable Receive Own Frames (Half-Duplex Mode) */
223
224/* EMAC_STAADD Masks */
225
226#define STABUSY 0x00000001 /* Initiate Station Mgt Reg Access / STA Busy Stat */
227#define STAOP 0x00000002 /* Station Management Operation Code (Write/Read*) */
228#define STADISPRE 0x00000004 /* Disable Preamble Generation */
229#define STAIE 0x00000008 /* Station Mgt. Transfer Done Interrupt Enable */
230#define REGAD 0x000007C0 /* STA Register Address */
231#define PHYAD 0x0000F800 /* PHY Device Address */
232
233#define SET_REGAD(x) (((x)&0x1F)<< 6 ) /* Set STA Register Address */
234#define SET_PHYAD(x) (((x)&0x1F)<< 11 ) /* Set PHY Device Address */
235
236/* EMAC_STADAT Mask */
237
238#define STADATA 0x0000FFFF /* Station Management Data */
239
240/* EMAC_FLC Masks */
241
242#define FLCBUSY 0x00000001 /* Send Flow Ctrl Frame / Flow Ctrl Busy Status */
243#define FLCE 0x00000002 /* Flow Control Enable */
244#define PCF 0x00000004 /* Pass Control Frames */
245#define BKPRSEN 0x00000008 /* Enable Backpressure */
246#define FLCPAUSE 0xFFFF0000 /* Pause Time */
247
248#define SET_FLCPAUSE(x) (((x)&0xFFFF)<< 16) /* Set Pause Time */
249
250/* EMAC_WKUP_CTL Masks */
251
252#define CAPWKFRM 0x00000001 /* Capture Wake-Up Frames */
253#define MPKE 0x00000002 /* Magic Packet Enable */
254#define RWKE 0x00000004 /* Remote Wake-Up Frame Enable */
255#define GUWKE 0x00000008 /* Global Unicast Wake Enable */
256#define MPKS 0x00000020 /* Magic Packet Received Status */
257#define RWKS 0x00000F00 /* Wake-Up Frame Received Status, Filters 3:0 */
258
259/* EMAC_WKUP_FFCMD Masks */
260
261#define WF0_E 0x00000001 /* Enable Wake-Up Filter 0 */
262#define WF0_T 0x00000008 /* Wake-Up Filter 0 Addr Type (Multicast/Unicast*) */
263#define WF1_E 0x00000100 /* Enable Wake-Up Filter 1 */
264#define WF1_T 0x00000800 /* Wake-Up Filter 1 Addr Type (Multicast/Unicast*) */
265#define WF2_E 0x00010000 /* Enable Wake-Up Filter 2 */
266#define WF2_T 0x00080000 /* Wake-Up Filter 2 Addr Type (Multicast/Unicast*) */
267#define WF3_E 0x01000000 /* Enable Wake-Up Filter 3 */
268#define WF3_T 0x08000000 /* Wake-Up Filter 3 Addr Type (Multicast/Unicast*) */
269
270/* EMAC_WKUP_FFOFF Masks */
271
272#define WF0_OFF 0x000000FF /* Wake-Up Filter 0 Pattern Offset */
273#define WF1_OFF 0x0000FF00 /* Wake-Up Filter 1 Pattern Offset */
274#define WF2_OFF 0x00FF0000 /* Wake-Up Filter 2 Pattern Offset */
275#define WF3_OFF 0xFF000000 /* Wake-Up Filter 3 Pattern Offset */
276
277#define SET_WF0_OFF(x) (((x)&0xFF)<< 0 ) /* Set Wake-Up Filter 0 Byte Offset */
278#define SET_WF1_OFF(x) (((x)&0xFF)<< 8 ) /* Set Wake-Up Filter 1 Byte Offset */
279#define SET_WF2_OFF(x) (((x)&0xFF)<< 16 ) /* Set Wake-Up Filter 2 Byte Offset */
280#define SET_WF3_OFF(x) (((x)&0xFF)<< 24 ) /* Set Wake-Up Filter 3 Byte Offset */
281/* Set ALL Offsets */
282#define SET_WF_OFFS(x0,x1,x2,x3) (SET_WF0_OFF((x0))|SET_WF1_OFF((x1))|SET_WF2_OFF((x2))|SET_WF3_OFF((x3)))
283
284/* EMAC_WKUP_FFCRC0 Masks */
285
286#define WF0_CRC 0x0000FFFF /* Wake-Up Filter 0 Pattern CRC */
287#define WF1_CRC 0xFFFF0000 /* Wake-Up Filter 1 Pattern CRC */
288
289#define SET_WF0_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 0 Target CRC */
290#define SET_WF1_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 1 Target CRC */
291
292/* EMAC_WKUP_FFCRC1 Masks */
293
294#define WF2_CRC 0x0000FFFF /* Wake-Up Filter 2 Pattern CRC */
295#define WF3_CRC 0xFFFF0000 /* Wake-Up Filter 3 Pattern CRC */
296
297#define SET_WF2_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 2 Target CRC */
298#define SET_WF3_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 3 Target CRC */
299
300/* EMAC_SYSCTL Masks */
301
302#define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */
303#define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */
304#define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */
305#define TXDWA 0x00000010 /* Transmit Frame DMA Word Alignment (Odd/Even*) */
306#define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
307
308#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
309
310/* EMAC_SYSTAT Masks */
311
312#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
313#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
314#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
315#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
316#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
317#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
318#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
319#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
320
321/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
322
323#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
324#define RX_COMP 0x00001000 /* RX Frame Complete */
325#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
326#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
327#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
328#define RX_CRC 0x00010000 /* RX Frame CRC Error */
329#define RX_LEN 0x00020000 /* RX Frame Length Error */
330#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
331#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
332#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
333#define RX_PHY 0x00200000 /* RX Frame PHY Error */
334#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
335#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
336#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
337#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
338#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
339#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
340#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
341#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
342#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
343#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
344
345/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
346
347#define TX_COMP 0x00000001 /* TX Frame Complete */
348#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
349#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
350#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
351#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
352#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
353#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
354#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
355#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
356#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
357#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
358#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
359#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
360#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
361#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
362
363/* EMAC_MMC_CTL Masks */
364#define RSTC 0x00000001 /* Reset All Counters */
365#define CROLL 0x00000002 /* Counter Roll-Over Enable */
366#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
367#define MMCE 0x00000008 /* Enable MMC Counter Operation */
368
369/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
370#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
371#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
372#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
373#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
374#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
375#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
376#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
377#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
378#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
379#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
380#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
381#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
382#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
383#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
384#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
385#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
386#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
387#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
388#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
389#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
390#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
391#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
392#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
393#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
394
395/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
396
397#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
398#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
399#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
400#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
401#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
402#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
403#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
404#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
405#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
406#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
407#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
408#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
409#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
410#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
411#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
412#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
413#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
414#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
415#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
416#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
417#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
418#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
419#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
420
421/* USB Control Registers */
422
423#define USB_FADDR 0xffc03800 /* Function address register */
424#define USB_POWER 0xffc03804 /* Power management register */
425#define USB_INTRTX 0xffc03808 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
426#define USB_INTRRX 0xffc0380c /* Interrupt register for Rx endpoints 1 to 7 */
427#define USB_INTRTXE 0xffc03810 /* Interrupt enable register for IntrTx */
428#define USB_INTRRXE 0xffc03814 /* Interrupt enable register for IntrRx */
429#define USB_INTRUSB 0xffc03818 /* Interrupt register for common USB interrupts */
430#define USB_INTRUSBE 0xffc0381c /* Interrupt enable register for IntrUSB */
431#define USB_FRAME 0xffc03820 /* USB frame number */
432#define USB_INDEX 0xffc03824 /* Index register for selecting the indexed endpoint registers */
433#define USB_TESTMODE 0xffc03828 /* Enabled USB 20 test modes */
434#define USB_GLOBINTR 0xffc0382c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
435#define USB_GLOBAL_CTL 0xffc03830 /* Global Clock Control for the core */
436
437/* USB Packet Control Registers */
438
439#define USB_TX_MAX_PACKET 0xffc03840 /* Maximum packet size for Host Tx endpoint */
440#define USB_CSR0 0xffc03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
441#define USB_TXCSR 0xffc03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
442#define USB_RX_MAX_PACKET 0xffc03848 /* Maximum packet size for Host Rx endpoint */
443#define USB_RXCSR 0xffc0384c /* Control Status register for Host Rx endpoint */
444#define USB_COUNT0 0xffc03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
445#define USB_RXCOUNT 0xffc03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
446#define USB_TXTYPE 0xffc03854 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
447#define USB_NAKLIMIT0 0xffc03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
448#define USB_TXINTERVAL 0xffc03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
449#define USB_RXTYPE 0xffc0385c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
450#define USB_RXINTERVAL 0xffc03860 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
451#define USB_TXCOUNT 0xffc03868 /* Number of bytes to be written to the selected endpoint Tx FIFO */
452
453/* USB Endpoint FIFO Registers */
454
455#define USB_EP0_FIFO 0xffc03880 /* Endpoint 0 FIFO */
456#define USB_EP1_FIFO 0xffc03888 /* Endpoint 1 FIFO */
457#define USB_EP2_FIFO 0xffc03890 /* Endpoint 2 FIFO */
458#define USB_EP3_FIFO 0xffc03898 /* Endpoint 3 FIFO */
459#define USB_EP4_FIFO 0xffc038a0 /* Endpoint 4 FIFO */
460#define USB_EP5_FIFO 0xffc038a8 /* Endpoint 5 FIFO */
461#define USB_EP6_FIFO 0xffc038b0 /* Endpoint 6 FIFO */
462#define USB_EP7_FIFO 0xffc038b8 /* Endpoint 7 FIFO */
463
464/* USB OTG Control Registers */
465
466#define USB_OTG_DEV_CTL 0xffc03900 /* OTG Device Control Register */
467#define USB_OTG_VBUS_IRQ 0xffc03904 /* OTG VBUS Control Interrupts */
468#define USB_OTG_VBUS_MASK 0xffc03908 /* VBUS Control Interrupt Enable */
469
470/* USB Phy Control Registers */
471
472#define USB_LINKINFO 0xffc03948 /* Enables programming of some PHY-side delays */
473#define USB_VPLEN 0xffc0394c /* Determines duration of VBUS pulse for VBUS charging */
474#define USB_HS_EOF1 0xffc03950 /* Time buffer for High-Speed transactions */
475#define USB_FS_EOF1 0xffc03954 /* Time buffer for Full-Speed transactions */
476#define USB_LS_EOF1 0xffc03958 /* Time buffer for Low-Speed transactions */
477
478/* (APHY_CNTRL is for ADI usage only) */
479
480#define USB_APHY_CNTRL 0xffc039e0 /* Register that increases visibility of Analog PHY */
481
482/* (APHY_CALIB is for ADI usage only) */
483
484#define USB_APHY_CALIB 0xffc039e4 /* Register used to set some calibration values */
485
486#define USB_APHY_CNTRL2 0xffc039e8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
487
488/* (PHY_TEST is for ADI usage only) */
489
490#define USB_PHY_TEST 0xffc039ec /* Used for reducing simulation time and simplifies FIFO testability */
491
492#define USB_PLLOSC_CTRL 0xffc039f0 /* Used to program different parameters for USB PLL and Oscillator */
493#define USB_SRP_CLKDIV 0xffc039f4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
494
495/* USB Endpoint 0 Control Registers */
496
497#define USB_EP_NI0_TXMAXP 0xffc03a00 /* Maximum packet size for Host Tx endpoint0 */
498#define USB_EP_NI0_TXCSR 0xffc03a04 /* Control Status register for endpoint 0 */
499#define USB_EP_NI0_RXMAXP 0xffc03a08 /* Maximum packet size for Host Rx endpoint0 */
500#define USB_EP_NI0_RXCSR 0xffc03a0c /* Control Status register for Host Rx endpoint0 */
501#define USB_EP_NI0_RXCOUNT 0xffc03a10 /* Number of bytes received in endpoint 0 FIFO */
502#define USB_EP_NI0_TXTYPE 0xffc03a14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
503#define USB_EP_NI0_TXINTERVAL 0xffc03a18 /* Sets the NAK response timeout on Endpoint 0 */
504#define USB_EP_NI0_RXTYPE 0xffc03a1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
505#define USB_EP_NI0_RXINTERVAL 0xffc03a20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint0 */
506#define USB_EP_NI0_TXCOUNT 0xffc03a28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
507
508/* USB Endpoint 1 Control Registers */
509
510#define USB_EP_NI1_TXMAXP 0xffc03a40 /* Maximum packet size for Host Tx endpoint1 */
511#define USB_EP_NI1_TXCSR 0xffc03a44 /* Control Status register for endpoint1 */
512#define USB_EP_NI1_RXMAXP 0xffc03a48 /* Maximum packet size for Host Rx endpoint1 */
513#define USB_EP_NI1_RXCSR 0xffc03a4c /* Control Status register for Host Rx endpoint1 */
514#define USB_EP_NI1_RXCOUNT 0xffc03a50 /* Number of bytes received in endpoint1 FIFO */
515#define USB_EP_NI1_TXTYPE 0xffc03a54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
516#define USB_EP_NI1_TXINTERVAL 0xffc03a58 /* Sets the NAK response timeout on Endpoint1 */
517#define USB_EP_NI1_RXTYPE 0xffc03a5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
518#define USB_EP_NI1_RXINTERVAL 0xffc03a60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint1 */
519#define USB_EP_NI1_TXCOUNT 0xffc03a68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
520
521/* USB Endpoint 2 Control Registers */
522
523#define USB_EP_NI2_TXMAXP 0xffc03a80 /* Maximum packet size for Host Tx endpoint2 */
524#define USB_EP_NI2_TXCSR 0xffc03a84 /* Control Status register for endpoint2 */
525#define USB_EP_NI2_RXMAXP 0xffc03a88 /* Maximum packet size for Host Rx endpoint2 */
526#define USB_EP_NI2_RXCSR 0xffc03a8c /* Control Status register for Host Rx endpoint2 */
527#define USB_EP_NI2_RXCOUNT 0xffc03a90 /* Number of bytes received in endpoint2 FIFO */
528#define USB_EP_NI2_TXTYPE 0xffc03a94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
529#define USB_EP_NI2_TXINTERVAL 0xffc03a98 /* Sets the NAK response timeout on Endpoint2 */
530#define USB_EP_NI2_RXTYPE 0xffc03a9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
531#define USB_EP_NI2_RXINTERVAL 0xffc03aa0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint2 */
532#define USB_EP_NI2_TXCOUNT 0xffc03aa8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
533
534/* USB Endpoint 3 Control Registers */
535
536#define USB_EP_NI3_TXMAXP 0xffc03ac0 /* Maximum packet size for Host Tx endpoint3 */
537#define USB_EP_NI3_TXCSR 0xffc03ac4 /* Control Status register for endpoint3 */
538#define USB_EP_NI3_RXMAXP 0xffc03ac8 /* Maximum packet size for Host Rx endpoint3 */
539#define USB_EP_NI3_RXCSR 0xffc03acc /* Control Status register for Host Rx endpoint3 */
540#define USB_EP_NI3_RXCOUNT 0xffc03ad0 /* Number of bytes received in endpoint3 FIFO */
541#define USB_EP_NI3_TXTYPE 0xffc03ad4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
542#define USB_EP_NI3_TXINTERVAL 0xffc03ad8 /* Sets the NAK response timeout on Endpoint3 */
543#define USB_EP_NI3_RXTYPE 0xffc03adc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
544#define USB_EP_NI3_RXINTERVAL 0xffc03ae0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint3 */
545#define USB_EP_NI3_TXCOUNT 0xffc03ae8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
546
547/* USB Endpoint 4 Control Registers */
548
549#define USB_EP_NI4_TXMAXP 0xffc03b00 /* Maximum packet size for Host Tx endpoint4 */
550#define USB_EP_NI4_TXCSR 0xffc03b04 /* Control Status register for endpoint4 */
551#define USB_EP_NI4_RXMAXP 0xffc03b08 /* Maximum packet size for Host Rx endpoint4 */
552#define USB_EP_NI4_RXCSR 0xffc03b0c /* Control Status register for Host Rx endpoint4 */
553#define USB_EP_NI4_RXCOUNT 0xffc03b10 /* Number of bytes received in endpoint4 FIFO */
554#define USB_EP_NI4_TXTYPE 0xffc03b14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
555#define USB_EP_NI4_TXINTERVAL 0xffc03b18 /* Sets the NAK response timeout on Endpoint4 */
556#define USB_EP_NI4_RXTYPE 0xffc03b1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
557#define USB_EP_NI4_RXINTERVAL 0xffc03b20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint4 */
558#define USB_EP_NI4_TXCOUNT 0xffc03b28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
559
560/* USB Endpoint 5 Control Registers */
561
562#define USB_EP_NI5_TXMAXP 0xffc03b40 /* Maximum packet size for Host Tx endpoint5 */
563#define USB_EP_NI5_TXCSR 0xffc03b44 /* Control Status register for endpoint5 */
564#define USB_EP_NI5_RXMAXP 0xffc03b48 /* Maximum packet size for Host Rx endpoint5 */
565#define USB_EP_NI5_RXCSR 0xffc03b4c /* Control Status register for Host Rx endpoint5 */
566#define USB_EP_NI5_RXCOUNT 0xffc03b50 /* Number of bytes received in endpoint5 FIFO */
567#define USB_EP_NI5_TXTYPE 0xffc03b54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
568#define USB_EP_NI5_TXINTERVAL 0xffc03b58 /* Sets the NAK response timeout on Endpoint5 */
569#define USB_EP_NI5_RXTYPE 0xffc03b5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
570#define USB_EP_NI5_RXINTERVAL 0xffc03b60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint5 */
571#define USB_EP_NI5_TXCOUNT 0xffc03b68 /* Number of bytes to be written to the endpoint5 Tx FIFO */
572
573/* USB Endpoint 6 Control Registers */
574
575#define USB_EP_NI6_TXMAXP 0xffc03b80 /* Maximum packet size for Host Tx endpoint6 */
576#define USB_EP_NI6_TXCSR 0xffc03b84 /* Control Status register for endpoint6 */
577#define USB_EP_NI6_RXMAXP 0xffc03b88 /* Maximum packet size for Host Rx endpoint6 */
578#define USB_EP_NI6_RXCSR 0xffc03b8c /* Control Status register for Host Rx endpoint6 */
579#define USB_EP_NI6_RXCOUNT 0xffc03b90 /* Number of bytes received in endpoint6 FIFO */
580#define USB_EP_NI6_TXTYPE 0xffc03b94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
581#define USB_EP_NI6_TXINTERVAL 0xffc03b98 /* Sets the NAK response timeout on Endpoint6 */
582#define USB_EP_NI6_RXTYPE 0xffc03b9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
583#define USB_EP_NI6_RXINTERVAL 0xffc03ba0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint6 */
584#define USB_EP_NI6_TXCOUNT 0xffc03ba8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
585
586/* USB Endpoint 7 Control Registers */
587
588#define USB_EP_NI7_TXMAXP 0xffc03bc0 /* Maximum packet size for Host Tx endpoint7 */
589#define USB_EP_NI7_TXCSR 0xffc03bc4 /* Control Status register for endpoint7 */
590#define USB_EP_NI7_RXMAXP 0xffc03bc8 /* Maximum packet size for Host Rx endpoint7 */
591#define USB_EP_NI7_RXCSR 0xffc03bcc /* Control Status register for Host Rx endpoint7 */
592#define USB_EP_NI7_RXCOUNT 0xffc03bd0 /* Number of bytes received in endpoint7 FIFO */
593#define USB_EP_NI7_TXTYPE 0xffc03bd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
594#define USB_EP_NI7_TXINTERVAL 0xffc03bd8 /* Sets the NAK response timeout on Endpoint7 */
595#define USB_EP_NI7_RXTYPE 0xffc03bdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
596#define USB_EP_NI7_RXINTERVAL 0xffc03bf0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint7 */
597#define USB_EP_NI7_TXCOUNT 0xffc03bf8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
598
599#define USB_DMA_INTERRUPT 0xffc03c00 /* Indicates pending interrupts for the DMA channels */
600
601/* USB Channel 0 Config Registers */
602
603#define USB_DMA0CONTROL 0xffc03c04 /* DMA master channel 0 configuration */
604#define USB_DMA0ADDRLOW 0xffc03c08 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
605#define USB_DMA0ADDRHIGH 0xffc03c0c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
606#define USB_DMA0COUNTLOW 0xffc03c10 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
607#define USB_DMA0COUNTHIGH 0xffc03c14 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
608
609/* USB Channel 1 Config Registers */
610
611#define USB_DMA1CONTROL 0xffc03c24 /* DMA master channel 1 configuration */
612#define USB_DMA1ADDRLOW 0xffc03c28 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
613#define USB_DMA1ADDRHIGH 0xffc03c2c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
614#define USB_DMA1COUNTLOW 0xffc03c30 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
615#define USB_DMA1COUNTHIGH 0xffc03c34 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
616
617/* USB Channel 2 Config Registers */
618
619#define USB_DMA2CONTROL 0xffc03c44 /* DMA master channel 2 configuration */
620#define USB_DMA2ADDRLOW 0xffc03c48 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
621#define USB_DMA2ADDRHIGH 0xffc03c4c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
622#define USB_DMA2COUNTLOW 0xffc03c50 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
623#define USB_DMA2COUNTHIGH 0xffc03c54 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
624
625/* USB Channel 3 Config Registers */
626
627#define USB_DMA3CONTROL 0xffc03c64 /* DMA master channel 3 configuration */
628#define USB_DMA3ADDRLOW 0xffc03c68 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
629#define USB_DMA3ADDRHIGH 0xffc03c6c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
630#define USB_DMA3COUNTLOW 0xffc03c70 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
631#define USB_DMA3COUNTHIGH 0xffc03c74 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
632
633/* USB Channel 4 Config Registers */
634
635#define USB_DMA4CONTROL 0xffc03c84 /* DMA master channel 4 configuration */
636#define USB_DMA4ADDRLOW 0xffc03c88 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
637#define USB_DMA4ADDRHIGH 0xffc03c8c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
638#define USB_DMA4COUNTLOW 0xffc03c90 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
639#define USB_DMA4COUNTHIGH 0xffc03c94 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
640
641/* USB Channel 5 Config Registers */
642
643#define USB_DMA5CONTROL 0xffc03ca4 /* DMA master channel 5 configuration */
644#define USB_DMA5ADDRLOW 0xffc03ca8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
645#define USB_DMA5ADDRHIGH 0xffc03cac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
646#define USB_DMA5COUNTLOW 0xffc03cb0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
647#define USB_DMA5COUNTHIGH 0xffc03cb4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
648
649/* USB Channel 6 Config Registers */
650
651#define USB_DMA6CONTROL 0xffc03cc4 /* DMA master channel 6 configuration */
652#define USB_DMA6ADDRLOW 0xffc03cc8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
653#define USB_DMA6ADDRHIGH 0xffc03ccc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
654#define USB_DMA6COUNTLOW 0xffc03cd0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
655#define USB_DMA6COUNTHIGH 0xffc03cd4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
656
657/* USB Channel 7 Config Registers */
658
659#define USB_DMA7CONTROL 0xffc03ce4 /* DMA master channel 7 configuration */
660#define USB_DMA7ADDRLOW 0xffc03ce8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
661#define USB_DMA7ADDRHIGH 0xffc03cec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
662#define USB_DMA7COUNTLOW 0xffc03cf0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
663#define USB_DMA7COUNTHIGH 0xffc03cf4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
664
665/* Bit masks for USB_FADDR */
666
667#define FUNCTION_ADDRESS 0x7f /* Function address */
668
669/* Bit masks for USB_POWER */
670
671#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
672#define nENABLE_SUSPENDM 0x0
673#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
674#define nSUSPEND_MODE 0x0
675#define RESUME_MODE 0x4 /* DMA Mode */
676#define nRESUME_MODE 0x0
677#define RESET 0x8 /* Reset indicator */
678#define nRESET 0x0
679#define HS_MODE 0x10 /* High Speed mode indicator */
680#define nHS_MODE 0x0
681#define HS_ENABLE 0x20 /* high Speed Enable */
682#define nHS_ENABLE 0x0
683#define SOFT_CONN 0x40 /* Soft connect */
684#define nSOFT_CONN 0x0
685#define ISO_UPDATE 0x80 /* Isochronous update */
686#define nISO_UPDATE 0x0
687
688/* Bit masks for USB_INTRTX */
689
690#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
691#define nEP0_TX 0x0
692#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
693#define nEP1_TX 0x0
694#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
695#define nEP2_TX 0x0
696#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
697#define nEP3_TX 0x0
698#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
699#define nEP4_TX 0x0
700#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
701#define nEP5_TX 0x0
702#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
703#define nEP6_TX 0x0
704#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
705#define nEP7_TX 0x0
706
707/* Bit masks for USB_INTRRX */
708
709#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
710#define nEP1_RX 0x0
711#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
712#define nEP2_RX 0x0
713#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
714#define nEP3_RX 0x0
715#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
716#define nEP4_RX 0x0
717#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
718#define nEP5_RX 0x0
719#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
720#define nEP6_RX 0x0
721#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
722#define nEP7_RX 0x0
723
724/* Bit masks for USB_INTRTXE */
725
726#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
727#define nEP0_TX_E 0x0
728#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
729#define nEP1_TX_E 0x0
730#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
731#define nEP2_TX_E 0x0
732#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
733#define nEP3_TX_E 0x0
734#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
735#define nEP4_TX_E 0x0
736#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
737#define nEP5_TX_E 0x0
738#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
739#define nEP6_TX_E 0x0
740#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
741#define nEP7_TX_E 0x0
742
743/* Bit masks for USB_INTRRXE */
744
745#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
746#define nEP1_RX_E 0x0
747#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
748#define nEP2_RX_E 0x0
749#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
750#define nEP3_RX_E 0x0
751#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
752#define nEP4_RX_E 0x0
753#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
754#define nEP5_RX_E 0x0
755#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
756#define nEP6_RX_E 0x0
757#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
758#define nEP7_RX_E 0x0
759
760/* Bit masks for USB_INTRUSB */
761
762#define SUSPEND_B 0x1 /* Suspend indicator */
763#define nSUSPEND_B 0x0
764#define RESUME_B 0x2 /* Resume indicator */
765#define nRESUME_B 0x0
766#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
767#define nRESET_OR_BABLE_B 0x0
768#define SOF_B 0x8 /* Start of frame */
769#define nSOF_B 0x0
770#define CONN_B 0x10 /* Connection indicator */
771#define nCONN_B 0x0
772#define DISCON_B 0x20 /* Disconnect indicator */
773#define nDISCON_B 0x0
774#define SESSION_REQ_B 0x40 /* Session Request */
775#define nSESSION_REQ_B 0x0
776#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
777#define nVBUS_ERROR_B 0x0
778
779/* Bit masks for USB_INTRUSBE */
780
781#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
782#define nSUSPEND_BE 0x0
783#define RESUME_BE 0x2 /* Resume indicator int enable */
784#define nRESUME_BE 0x0
785#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
786#define nRESET_OR_BABLE_BE 0x0
787#define SOF_BE 0x8 /* Start of frame int enable */
788#define nSOF_BE 0x0
789#define CONN_BE 0x10 /* Connection indicator int enable */
790#define nCONN_BE 0x0
791#define DISCON_BE 0x20 /* Disconnect indicator int enable */
792#define nDISCON_BE 0x0
793#define SESSION_REQ_BE 0x40 /* Session Request int enable */
794#define nSESSION_REQ_BE 0x0
795#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
796#define nVBUS_ERROR_BE 0x0
797
798/* Bit masks for USB_FRAME */
799
800#define FRAME_NUMBER 0x7ff /* Frame number */
801
802/* Bit masks for USB_INDEX */
803
804#define SELECTED_ENDPOINT 0xf /* selected endpoint */
805
806/* Bit masks for USB_GLOBAL_CTL */
807
808#define GLOBAL_ENA 0x1 /* enables USB module */
809#define nGLOBAL_ENA 0x0
810#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
811#define nEP1_TX_ENA 0x0
812#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
813#define nEP2_TX_ENA 0x0
814#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
815#define nEP3_TX_ENA 0x0
816#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
817#define nEP4_TX_ENA 0x0
818#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
819#define nEP5_TX_ENA 0x0
820#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
821#define nEP6_TX_ENA 0x0
822#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
823#define nEP7_TX_ENA 0x0
824#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
825#define nEP1_RX_ENA 0x0
826#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
827#define nEP2_RX_ENA 0x0
828#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
829#define nEP3_RX_ENA 0x0
830#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
831#define nEP4_RX_ENA 0x0
832#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
833#define nEP5_RX_ENA 0x0
834#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
835#define nEP6_RX_ENA 0x0
836#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
837#define nEP7_RX_ENA 0x0
838
839/* Bit masks for USB_OTG_DEV_CTL */
840
841#define SESSION 0x1 /* session indicator */
842#define nSESSION 0x0
843#define HOST_REQ 0x2 /* Host negotiation request */
844#define nHOST_REQ 0x0
845#define HOST_MODE 0x4 /* indicates USBDRC is a host */
846#define nHOST_MODE 0x0
847#define VBUS0 0x8 /* Vbus level indicator[0] */
848#define nVBUS0 0x0
849#define VBUS1 0x10 /* Vbus level indicator[1] */
850#define nVBUS1 0x0
851#define LSDEV 0x20 /* Low-speed indicator */
852#define nLSDEV 0x0
853#define FSDEV 0x40 /* Full or High-speed indicator */
854#define nFSDEV 0x0
855#define B_DEVICE 0x80 /* A' or 'B' device indicator */
856#define nB_DEVICE 0x0
857
858/* Bit masks for USB_OTG_VBUS_IRQ */
859
860#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
861#define nDRIVE_VBUS_ON 0x0
862#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
863#define nDRIVE_VBUS_OFF 0x0
864#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
865#define nCHRG_VBUS_START 0x0
866#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
867#define nCHRG_VBUS_END 0x0
868#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
869#define nDISCHRG_VBUS_START 0x0
870#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
871#define nDISCHRG_VBUS_END 0x0
872
873/* Bit masks for USB_OTG_VBUS_MASK */
874
875#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
876#define nDRIVE_VBUS_ON_ENA 0x0
877#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
878#define nDRIVE_VBUS_OFF_ENA 0x0
879#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
880#define nCHRG_VBUS_START_ENA 0x0
881#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
882#define nCHRG_VBUS_END_ENA 0x0
883#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
884#define nDISCHRG_VBUS_START_ENA 0x0
885#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
886#define nDISCHRG_VBUS_END_ENA 0x0
887
888/* Bit masks for USB_CSR0 */
889
890#define RXPKTRDY 0x1 /* data packet receive indicator */
891#define nRXPKTRDY 0x0
892#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
893#define nTXPKTRDY 0x0
894#define STALL_SENT 0x4 /* STALL handshake sent */
895#define nSTALL_SENT 0x0
896#define DATAEND 0x8 /* Data end indicator */
897#define nDATAEND 0x0
898#define SETUPEND 0x10 /* Setup end */
899#define nSETUPEND 0x0
900#define SENDSTALL 0x20 /* Send STALL handshake */
901#define nSENDSTALL 0x0
902#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
903#define nSERVICED_RXPKTRDY 0x0
904#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
905#define nSERVICED_SETUPEND 0x0
906#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
907#define nFLUSHFIFO 0x0
908#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
909#define nSTALL_RECEIVED_H 0x0
910#define SETUPPKT_H 0x8 /* send Setup token host mode */
911#define nSETUPPKT_H 0x0
912#define ERROR_H 0x10 /* timeout error indicator host mode */
913#define nERROR_H 0x0
914#define REQPKT_H 0x20 /* Request an IN transaction host mode */
915#define nREQPKT_H 0x0
916#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
917#define nSTATUSPKT_H 0x0
918#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
919#define nNAK_TIMEOUT_H 0x0
920
921/* Bit masks for USB_COUNT0 */
922
923#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
924
925/* Bit masks for USB_NAKLIMIT0 */
926
927#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
928
929/* Bit masks for USB_TX_MAX_PACKET */
930
931#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
932
933/* Bit masks for USB_RX_MAX_PACKET */
934
935#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
936
937/* Bit masks for USB_TXCSR */
938
939#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
940#define nTXPKTRDY_T 0x0
941#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
942#define nFIFO_NOT_EMPTY_T 0x0
943#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
944#define nUNDERRUN_T 0x0
945#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
946#define nFLUSHFIFO_T 0x0
947#define STALL_SEND_T 0x10 /* issue a Stall handshake */
948#define nSTALL_SEND_T 0x0
949#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
950#define nSTALL_SENT_T 0x0
951#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
952#define nCLEAR_DATATOGGLE_T 0x0
953#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
954#define nINCOMPTX_T 0x0
955#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
956#define nDMAREQMODE_T 0x0
957#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
958#define nFORCE_DATATOGGLE_T 0x0
959#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
960#define nDMAREQ_ENA_T 0x0
961#define ISO_T 0x4000 /* enable Isochronous transfers */
962#define nISO_T 0x0
963#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
964#define nAUTOSET_T 0x0
965#define ERROR_TH 0x4 /* error condition host mode */
966#define nERROR_TH 0x0
967#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
968#define nSTALL_RECEIVED_TH 0x0
969#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
970#define nNAK_TIMEOUT_TH 0x0
971
972/* Bit masks for USB_TXCOUNT */
973
974#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
975
976/* Bit masks for USB_RXCSR */
977
978#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
979#define nRXPKTRDY_R 0x0
980#define FIFO_FULL_R 0x2 /* FIFO not empty */
981#define nFIFO_FULL_R 0x0
982#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
983#define nOVERRUN_R 0x0
984#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
985#define nDATAERROR_R 0x0
986#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
987#define nFLUSHFIFO_R 0x0
988#define STALL_SEND_R 0x20 /* issue a Stall handshake */
989#define nSTALL_SEND_R 0x0
990#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
991#define nSTALL_SENT_R 0x0
992#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
993#define nCLEAR_DATATOGGLE_R 0x0
994#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
995#define nINCOMPRX_R 0x0
996#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
997#define nDMAREQMODE_R 0x0
998#define DISNYET_R 0x1000 /* disable Nyet handshakes */
999#define nDISNYET_R 0x0
1000#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1001#define nDMAREQ_ENA_R 0x0
1002#define ISO_R 0x4000 /* enable Isochronous transfers */
1003#define nISO_R 0x0
1004#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1005#define nAUTOCLEAR_R 0x0
1006#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1007#define nERROR_RH 0x0
1008#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1009#define nREQPKT_RH 0x0
1010#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1011#define nSTALL_RECEIVED_RH 0x0
1012#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1013#define nINCOMPRX_RH 0x0
1014#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1015#define nDMAREQMODE_RH 0x0
1016#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1017#define nAUTOREQ_RH 0x0
1018
1019/* Bit masks for USB_RXCOUNT */
1020
1021#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
1022
1023/* Bit masks for USB_TXTYPE */
1024
1025#define TARGET_EP_NO_T 0xf /* EP number */
1026#define PROTOCOL_T 0xc /* transfer type */
1027
1028/* Bit masks for USB_TXINTERVAL */
1029
1030#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
1031
1032/* Bit masks for USB_RXTYPE */
1033
1034#define TARGET_EP_NO_R 0xf /* EP number */
1035#define PROTOCOL_R 0xc /* transfer type */
1036
1037/* Bit masks for USB_RXINTERVAL */
1038
1039#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
1040
1041/* Bit masks for USB_DMA_INTERRUPT */
1042
1043#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1044#define nDMA0_INT 0x0
1045#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1046#define nDMA1_INT 0x0
1047#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1048#define nDMA2_INT 0x0
1049#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1050#define nDMA3_INT 0x0
1051#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1052#define nDMA4_INT 0x0
1053#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1054#define nDMA5_INT 0x0
1055#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1056#define nDMA6_INT 0x0
1057#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1058#define nDMA7_INT 0x0
1059
1060/* Bit masks for USB_DMAxCONTROL */
1061
1062#define DMA_ENA 0x1 /* DMA enable */
1063#define nDMA_ENA 0x0
1064#define DIRECTION 0x2 /* direction of DMA transfer */
1065#define nDIRECTION 0x0
1066#define MODE 0x4 /* DMA Bus error */
1067#define nMODE 0x0
1068#define INT_ENA 0x8 /* Interrupt enable */
1069#define nINT_ENA 0x0
1070#define EPNUM 0xf0 /* EP number */
1071#define BUSERROR 0x100 /* DMA Bus error */
1072#define nBUSERROR 0x0
1073
1074/* Bit masks for USB_DMAxADDRHIGH */
1075
1076#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
1077
1078/* Bit masks for USB_DMAxADDRLOW */
1079
1080#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
1081
1082/* Bit masks for USB_DMAxCOUNTHIGH */
1083
1084#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
1085
1086/* Bit masks for USB_DMAxCOUNTLOW */
1087
1088#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
1089
1090#endif /* _DEF_BF527_H */
diff --git a/include/asm-blackfin/mach-bf527/defBF52x_base.h b/include/asm-blackfin/mach-bf527/defBF52x_base.h
deleted file mode 100644
index fc69cf93f149..000000000000
--- a/include/asm-blackfin/mach-bf527/defBF52x_base.h
+++ /dev/null
@@ -1,2014 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/defBF52x_base.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_BF52X_H
32#define _DEF_BF52X_H
33
34
35/* ************************************************************** */
36/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF52x */
37/* ************************************************************** */
38
39/* ==== begin from defBF534.h ==== */
40
41/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
42#define PLL_CTL 0xFFC00000 /* PLL Control Register */
43#define PLL_DIV 0xFFC00004 /* PLL Divide Register */
44#define VR_CTL 0xFFC00008 /* Voltage Regulator Control Register */
45#define PLL_STAT 0xFFC0000C /* PLL Status Register */
46#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count Register */
47#define CHIPID 0xFFC00014 /* Device ID Register */
48
49
50/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
51#define SWRST 0xFFC00100 /* Software Reset Register */
52#define SYSCR 0xFFC00104 /* System Configuration Register */
53#define SIC_RVECT 0xFFC00108 /* Interrupt Reset Vector Address Register */
54
55#define SIC_IMASK0 0xFFC0010C /* Interrupt Mask Register */
56#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */
57#define SIC_IAR1 0xFFC00114 /* Interrupt Assignment Register 1 */
58#define SIC_IAR2 0xFFC00118 /* Interrupt Assignment Register 2 */
59#define SIC_IAR3 0xFFC0011C /* Interrupt Assignment Register 3 */
60#define SIC_ISR0 0xFFC00120 /* Interrupt Status Register */
61#define SIC_IWR0 0xFFC00124 /* Interrupt Wakeup Register */
62
63/* SIC Additions to ADSP-BF52x (0xFFC0014C - 0xFFC00162) */
64#define SIC_IMASK1 0xFFC0014C /* Interrupt Mask register of SIC2 */
65#define SIC_IAR4 0xFFC00150 /* Interrupt Assignment register4 */
66#define SIC_IAR5 0xFFC00154 /* Interrupt Assignment register5 */
67#define SIC_IAR6 0xFFC00158 /* Interrupt Assignment register6 */
68#define SIC_IAR7 0xFFC0015C /* Interrupt Assignment register7 */
69#define SIC_ISR1 0xFFC00160 /* Interrupt Statur register */
70#define SIC_IWR1 0xFFC00164 /* Interrupt Wakeup register */
71
72
73/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
74#define WDOG_CTL 0xFFC00200 /* Watchdog Control Register */
75#define WDOG_CNT 0xFFC00204 /* Watchdog Count Register */
76#define WDOG_STAT 0xFFC00208 /* Watchdog Status Register */
77
78
79/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
80#define RTC_STAT 0xFFC00300 /* RTC Status Register */
81#define RTC_ICTL 0xFFC00304 /* RTC Interrupt Control Register */
82#define RTC_ISTAT 0xFFC00308 /* RTC Interrupt Status Register */
83#define RTC_SWCNT 0xFFC0030C /* RTC Stopwatch Count Register */
84#define RTC_ALARM 0xFFC00310 /* RTC Alarm Time Register */
85#define RTC_FAST 0xFFC00314 /* RTC Prescaler Enable Register */
86#define RTC_PREN 0xFFC00314 /* RTC Prescaler Enable Alternate Macro */
87
88
89/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
90#define UART0_THR 0xFFC00400 /* Transmit Holding register */
91#define UART0_RBR 0xFFC00400 /* Receive Buffer register */
92#define UART0_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
93#define UART0_IER 0xFFC00404 /* Interrupt Enable Register */
94#define UART0_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
95#define UART0_IIR 0xFFC00408 /* Interrupt Identification Register */
96#define UART0_LCR 0xFFC0040C /* Line Control Register */
97#define UART0_MCR 0xFFC00410 /* Modem Control Register */
98#define UART0_LSR 0xFFC00414 /* Line Status Register */
99#define UART0_MSR 0xFFC00418 /* Modem Status Register */
100#define UART0_SCR 0xFFC0041C /* SCR Scratch Register */
101#define UART0_GCTL 0xFFC00424 /* Global Control Register */
102
103
104/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
105#define SPI0_REGBASE 0xFFC00500
106#define SPI_CTL 0xFFC00500 /* SPI Control Register */
107#define SPI_FLG 0xFFC00504 /* SPI Flag register */
108#define SPI_STAT 0xFFC00508 /* SPI Status register */
109#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
110#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
111#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
112#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
113
114
115/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
116#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
117#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
118#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
119#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
120
121#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
122#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
123#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
124#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
125
126#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
127#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
128#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
129#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
130
131#define TIMER3_CONFIG 0xFFC00630 /* Timer 3 Configuration Register */
132#define TIMER3_COUNTER 0xFFC00634 /* Timer 3 Counter Register */
133#define TIMER3_PERIOD 0xFFC00638 /* Timer 3 Period Register */
134#define TIMER3_WIDTH 0xFFC0063C /* Timer 3 Width Register */
135
136#define TIMER4_CONFIG 0xFFC00640 /* Timer 4 Configuration Register */
137#define TIMER4_COUNTER 0xFFC00644 /* Timer 4 Counter Register */
138#define TIMER4_PERIOD 0xFFC00648 /* Timer 4 Period Register */
139#define TIMER4_WIDTH 0xFFC0064C /* Timer 4 Width Register */
140
141#define TIMER5_CONFIG 0xFFC00650 /* Timer 5 Configuration Register */
142#define TIMER5_COUNTER 0xFFC00654 /* Timer 5 Counter Register */
143#define TIMER5_PERIOD 0xFFC00658 /* Timer 5 Period Register */
144#define TIMER5_WIDTH 0xFFC0065C /* Timer 5 Width Register */
145
146#define TIMER6_CONFIG 0xFFC00660 /* Timer 6 Configuration Register */
147#define TIMER6_COUNTER 0xFFC00664 /* Timer 6 Counter Register */
148#define TIMER6_PERIOD 0xFFC00668 /* Timer 6 Period Register */
149#define TIMER6_WIDTH 0xFFC0066C /* Timer 6 Width Register */
150
151#define TIMER7_CONFIG 0xFFC00670 /* Timer 7 Configuration Register */
152#define TIMER7_COUNTER 0xFFC00674 /* Timer 7 Counter Register */
153#define TIMER7_PERIOD 0xFFC00678 /* Timer 7 Period Register */
154#define TIMER7_WIDTH 0xFFC0067C /* Timer 7 Width Register */
155
156#define TIMER_ENABLE 0xFFC00680 /* Timer Enable Register */
157#define TIMER_DISABLE 0xFFC00684 /* Timer Disable Register */
158#define TIMER_STATUS 0xFFC00688 /* Timer Status Register */
159
160
161/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
162#define PORTFIO 0xFFC00700 /* Port F I/O Pin State Specify Register */
163#define PORTFIO_CLEAR 0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
164#define PORTFIO_SET 0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
165#define PORTFIO_TOGGLE 0xFFC0070C /* Port F I/O Pin State Toggle Register */
166#define PORTFIO_MASKA 0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
167#define PORTFIO_MASKA_CLEAR 0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
168#define PORTFIO_MASKA_SET 0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
169#define PORTFIO_MASKA_TOGGLE 0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
170#define PORTFIO_MASKB 0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
171#define PORTFIO_MASKB_CLEAR 0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
172#define PORTFIO_MASKB_SET 0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
173#define PORTFIO_MASKB_TOGGLE 0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
174#define PORTFIO_DIR 0xFFC00730 /* Port F I/O Direction Register */
175#define PORTFIO_POLAR 0xFFC00734 /* Port F I/O Source Polarity Register */
176#define PORTFIO_EDGE 0xFFC00738 /* Port F I/O Source Sensitivity Register */
177#define PORTFIO_BOTH 0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
178#define PORTFIO_INEN 0xFFC00740 /* Port F I/O Input Enable Register */
179
180
181/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
182#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
183#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
184#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
185#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
186#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
187#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
188#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
189#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
190#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
191#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
192#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
193#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
194#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
195#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
196#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
197#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
198#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
199#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
200#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
201#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
202#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
203#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
204
205
206/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
207#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
208#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
209#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
210#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
211#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
212#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
213#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
214#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
215#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
216#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
217#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
218#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
219#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
220#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
221#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
222#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
223#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
224#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
225#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
226#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
227#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
228#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
229
230
231/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
232#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
233#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
234#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
235#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
236#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
237#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
238#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
239
240
241/* DMA Traffic Control Registers */
242#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
243#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
244
245/* Alternate deprecated register names (below) provided for backwards code compatibility */
246#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
247#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
248
249/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
250#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
251#define DMA0_START_ADDR 0xFFC00C04 /* DMA Channel 0 Start Address Register */
252#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
253#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
254#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
255#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
256#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
257#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
258#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
259#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
260#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
261#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
262#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
263
264#define DMA1_NEXT_DESC_PTR 0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
265#define DMA1_START_ADDR 0xFFC00C44 /* DMA Channel 1 Start Address Register */
266#define DMA1_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
267#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
268#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
269#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
270#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
271#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
272#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
273#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
274#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
275#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
276#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
277
278#define DMA2_NEXT_DESC_PTR 0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
279#define DMA2_START_ADDR 0xFFC00C84 /* DMA Channel 2 Start Address Register */
280#define DMA2_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
281#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
282#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
283#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
284#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
285#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
286#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
287#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
288#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
289#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
290#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
291
292#define DMA3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
293#define DMA3_START_ADDR 0xFFC00CC4 /* DMA Channel 3 Start Address Register */
294#define DMA3_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
295#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
296#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
297#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
298#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
299#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
300#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
301#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
302#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
303#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
304#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
305
306#define DMA4_NEXT_DESC_PTR 0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
307#define DMA4_START_ADDR 0xFFC00D04 /* DMA Channel 4 Start Address Register */
308#define DMA4_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
309#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
310#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
311#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
312#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
313#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
314#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
315#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
316#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
317#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
318#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
319
320#define DMA5_NEXT_DESC_PTR 0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
321#define DMA5_START_ADDR 0xFFC00D44 /* DMA Channel 5 Start Address Register */
322#define DMA5_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
323#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
324#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
325#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
326#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
327#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
328#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
329#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
330#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
331#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
332#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
333
334#define DMA6_NEXT_DESC_PTR 0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
335#define DMA6_START_ADDR 0xFFC00D84 /* DMA Channel 6 Start Address Register */
336#define DMA6_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
337#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
338#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
339#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
340#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
341#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
342#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
343#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
344#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
345#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
346#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
347
348#define DMA7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
349#define DMA7_START_ADDR 0xFFC00DC4 /* DMA Channel 7 Start Address Register */
350#define DMA7_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
351#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
352#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
353#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
354#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
355#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
356#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
357#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
358#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
359#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
360#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
361
362#define DMA8_NEXT_DESC_PTR 0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
363#define DMA8_START_ADDR 0xFFC00E04 /* DMA Channel 8 Start Address Register */
364#define DMA8_CONFIG 0xFFC00E08 /* DMA Channel 8 Configuration Register */
365#define DMA8_X_COUNT 0xFFC00E10 /* DMA Channel 8 X Count Register */
366#define DMA8_X_MODIFY 0xFFC00E14 /* DMA Channel 8 X Modify Register */
367#define DMA8_Y_COUNT 0xFFC00E18 /* DMA Channel 8 Y Count Register */
368#define DMA8_Y_MODIFY 0xFFC00E1C /* DMA Channel 8 Y Modify Register */
369#define DMA8_CURR_DESC_PTR 0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
370#define DMA8_CURR_ADDR 0xFFC00E24 /* DMA Channel 8 Current Address Register */
371#define DMA8_IRQ_STATUS 0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
372#define DMA8_PERIPHERAL_MAP 0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
373#define DMA8_CURR_X_COUNT 0xFFC00E30 /* DMA Channel 8 Current X Count Register */
374#define DMA8_CURR_Y_COUNT 0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
375
376#define DMA9_NEXT_DESC_PTR 0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
377#define DMA9_START_ADDR 0xFFC00E44 /* DMA Channel 9 Start Address Register */
378#define DMA9_CONFIG 0xFFC00E48 /* DMA Channel 9 Configuration Register */
379#define DMA9_X_COUNT 0xFFC00E50 /* DMA Channel 9 X Count Register */
380#define DMA9_X_MODIFY 0xFFC00E54 /* DMA Channel 9 X Modify Register */
381#define DMA9_Y_COUNT 0xFFC00E58 /* DMA Channel 9 Y Count Register */
382#define DMA9_Y_MODIFY 0xFFC00E5C /* DMA Channel 9 Y Modify Register */
383#define DMA9_CURR_DESC_PTR 0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
384#define DMA9_CURR_ADDR 0xFFC00E64 /* DMA Channel 9 Current Address Register */
385#define DMA9_IRQ_STATUS 0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
386#define DMA9_PERIPHERAL_MAP 0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
387#define DMA9_CURR_X_COUNT 0xFFC00E70 /* DMA Channel 9 Current X Count Register */
388#define DMA9_CURR_Y_COUNT 0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
389
390#define DMA10_NEXT_DESC_PTR 0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
391#define DMA10_START_ADDR 0xFFC00E84 /* DMA Channel 10 Start Address Register */
392#define DMA10_CONFIG 0xFFC00E88 /* DMA Channel 10 Configuration Register */
393#define DMA10_X_COUNT 0xFFC00E90 /* DMA Channel 10 X Count Register */
394#define DMA10_X_MODIFY 0xFFC00E94 /* DMA Channel 10 X Modify Register */
395#define DMA10_Y_COUNT 0xFFC00E98 /* DMA Channel 10 Y Count Register */
396#define DMA10_Y_MODIFY 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
397#define DMA10_CURR_DESC_PTR 0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
398#define DMA10_CURR_ADDR 0xFFC00EA4 /* DMA Channel 10 Current Address Register */
399#define DMA10_IRQ_STATUS 0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
400#define DMA10_PERIPHERAL_MAP 0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
401#define DMA10_CURR_X_COUNT 0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
402#define DMA10_CURR_Y_COUNT 0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
403
404#define DMA11_NEXT_DESC_PTR 0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
405#define DMA11_START_ADDR 0xFFC00EC4 /* DMA Channel 11 Start Address Register */
406#define DMA11_CONFIG 0xFFC00EC8 /* DMA Channel 11 Configuration Register */
407#define DMA11_X_COUNT 0xFFC00ED0 /* DMA Channel 11 X Count Register */
408#define DMA11_X_MODIFY 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
409#define DMA11_Y_COUNT 0xFFC00ED8 /* DMA Channel 11 Y Count Register */
410#define DMA11_Y_MODIFY 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
411#define DMA11_CURR_DESC_PTR 0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
412#define DMA11_CURR_ADDR 0xFFC00EE4 /* DMA Channel 11 Current Address Register */
413#define DMA11_IRQ_STATUS 0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
414#define DMA11_PERIPHERAL_MAP 0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
415#define DMA11_CURR_X_COUNT 0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
416#define DMA11_CURR_Y_COUNT 0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
417
418#define MDMA_D0_NEXT_DESC_PTR 0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
419#define MDMA_D0_START_ADDR 0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
420#define MDMA_D0_CONFIG 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
421#define MDMA_D0_X_COUNT 0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
422#define MDMA_D0_X_MODIFY 0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
423#define MDMA_D0_Y_COUNT 0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
424#define MDMA_D0_Y_MODIFY 0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
425#define MDMA_D0_CURR_DESC_PTR 0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
426#define MDMA_D0_CURR_ADDR 0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
427#define MDMA_D0_IRQ_STATUS 0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
428#define MDMA_D0_PERIPHERAL_MAP 0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
429#define MDMA_D0_CURR_X_COUNT 0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
430#define MDMA_D0_CURR_Y_COUNT 0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
431
432#define MDMA_S0_NEXT_DESC_PTR 0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
433#define MDMA_S0_START_ADDR 0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
434#define MDMA_S0_CONFIG 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
435#define MDMA_S0_X_COUNT 0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
436#define MDMA_S0_X_MODIFY 0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
437#define MDMA_S0_Y_COUNT 0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
438#define MDMA_S0_Y_MODIFY 0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
439#define MDMA_S0_CURR_DESC_PTR 0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
440#define MDMA_S0_CURR_ADDR 0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
441#define MDMA_S0_IRQ_STATUS 0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
442#define MDMA_S0_PERIPHERAL_MAP 0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
443#define MDMA_S0_CURR_X_COUNT 0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
444#define MDMA_S0_CURR_Y_COUNT 0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
445
446#define MDMA_D1_NEXT_DESC_PTR 0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
447#define MDMA_D1_START_ADDR 0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
448#define MDMA_D1_CONFIG 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
449#define MDMA_D1_X_COUNT 0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
450#define MDMA_D1_X_MODIFY 0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
451#define MDMA_D1_Y_COUNT 0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
452#define MDMA_D1_Y_MODIFY 0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
453#define MDMA_D1_CURR_DESC_PTR 0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
454#define MDMA_D1_CURR_ADDR 0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
455#define MDMA_D1_IRQ_STATUS 0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
456#define MDMA_D1_PERIPHERAL_MAP 0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
457#define MDMA_D1_CURR_X_COUNT 0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
458#define MDMA_D1_CURR_Y_COUNT 0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
459
460#define MDMA_S1_NEXT_DESC_PTR 0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
461#define MDMA_S1_START_ADDR 0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
462#define MDMA_S1_CONFIG 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
463#define MDMA_S1_X_COUNT 0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
464#define MDMA_S1_X_MODIFY 0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
465#define MDMA_S1_Y_COUNT 0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
466#define MDMA_S1_Y_MODIFY 0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
467#define MDMA_S1_CURR_DESC_PTR 0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
468#define MDMA_S1_CURR_ADDR 0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
469#define MDMA_S1_IRQ_STATUS 0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
470#define MDMA_S1_PERIPHERAL_MAP 0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
471#define MDMA_S1_CURR_X_COUNT 0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
472#define MDMA_S1_CURR_Y_COUNT 0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
473
474
475/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
476#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
477#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
478#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
479#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
480#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
481
482
483/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
484#define TWI0_REGBASE 0xFFC01400
485#define TWI_CLKDIV 0xFFC01400 /* Serial Clock Divider Register */
486#define TWI_CONTROL 0xFFC01404 /* TWI Control Register */
487#define TWI_SLAVE_CTL 0xFFC01408 /* Slave Mode Control Register */
488#define TWI_SLAVE_STAT 0xFFC0140C /* Slave Mode Status Register */
489#define TWI_SLAVE_ADDR 0xFFC01410 /* Slave Mode Address Register */
490#define TWI_MASTER_CTL 0xFFC01414 /* Master Mode Control Register */
491#define TWI_MASTER_STAT 0xFFC01418 /* Master Mode Status Register */
492#define TWI_MASTER_ADDR 0xFFC0141C /* Master Mode Address Register */
493#define TWI_INT_STAT 0xFFC01420 /* TWI Interrupt Status Register */
494#define TWI_INT_MASK 0xFFC01424 /* TWI Master Interrupt Mask Register */
495#define TWI_FIFO_CTL 0xFFC01428 /* FIFO Control Register */
496#define TWI_FIFO_STAT 0xFFC0142C /* FIFO Status Register */
497#define TWI_XMT_DATA8 0xFFC01480 /* FIFO Transmit Data Single Byte Register */
498#define TWI_XMT_DATA16 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
499#define TWI_RCV_DATA8 0xFFC01488 /* FIFO Receive Data Single Byte Register */
500#define TWI_RCV_DATA16 0xFFC0148C /* FIFO Receive Data Double Byte Register */
501
502
503/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
504#define PORTGIO 0xFFC01500 /* Port G I/O Pin State Specify Register */
505#define PORTGIO_CLEAR 0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
506#define PORTGIO_SET 0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
507#define PORTGIO_TOGGLE 0xFFC0150C /* Port G I/O Pin State Toggle Register */
508#define PORTGIO_MASKA 0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
509#define PORTGIO_MASKA_CLEAR 0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
510#define PORTGIO_MASKA_SET 0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
511#define PORTGIO_MASKA_TOGGLE 0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
512#define PORTGIO_MASKB 0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
513#define PORTGIO_MASKB_CLEAR 0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
514#define PORTGIO_MASKB_SET 0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
515#define PORTGIO_MASKB_TOGGLE 0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
516#define PORTGIO_DIR 0xFFC01530 /* Port G I/O Direction Register */
517#define PORTGIO_POLAR 0xFFC01534 /* Port G I/O Source Polarity Register */
518#define PORTGIO_EDGE 0xFFC01538 /* Port G I/O Source Sensitivity Register */
519#define PORTGIO_BOTH 0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
520#define PORTGIO_INEN 0xFFC01540 /* Port G I/O Input Enable Register */
521
522
523/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
524#define PORTHIO 0xFFC01700 /* Port H I/O Pin State Specify Register */
525#define PORTHIO_CLEAR 0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
526#define PORTHIO_SET 0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
527#define PORTHIO_TOGGLE 0xFFC0170C /* Port H I/O Pin State Toggle Register */
528#define PORTHIO_MASKA 0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
529#define PORTHIO_MASKA_CLEAR 0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
530#define PORTHIO_MASKA_SET 0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
531#define PORTHIO_MASKA_TOGGLE 0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
532#define PORTHIO_MASKB 0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
533#define PORTHIO_MASKB_CLEAR 0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
534#define PORTHIO_MASKB_SET 0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
535#define PORTHIO_MASKB_TOGGLE 0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
536#define PORTHIO_DIR 0xFFC01730 /* Port H I/O Direction Register */
537#define PORTHIO_POLAR 0xFFC01734 /* Port H I/O Source Polarity Register */
538#define PORTHIO_EDGE 0xFFC01738 /* Port H I/O Source Sensitivity Register */
539#define PORTHIO_BOTH 0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
540#define PORTHIO_INEN 0xFFC01740 /* Port H I/O Input Enable Register */
541
542
543/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
544#define UART1_THR 0xFFC02000 /* Transmit Holding register */
545#define UART1_RBR 0xFFC02000 /* Receive Buffer register */
546#define UART1_DLL 0xFFC02000 /* Divisor Latch (Low-Byte) */
547#define UART1_IER 0xFFC02004 /* Interrupt Enable Register */
548#define UART1_DLH 0xFFC02004 /* Divisor Latch (High-Byte) */
549#define UART1_IIR 0xFFC02008 /* Interrupt Identification Register */
550#define UART1_LCR 0xFFC0200C /* Line Control Register */
551#define UART1_MCR 0xFFC02010 /* Modem Control Register */
552#define UART1_LSR 0xFFC02014 /* Line Status Register */
553#define UART1_MSR 0xFFC02018 /* Modem Status Register */
554#define UART1_SCR 0xFFC0201C /* SCR Scratch Register */
555#define UART1_GCTL 0xFFC02024 /* Global Control Register */
556
557
558/* Omit CAN register sets from the defBF534.h (CAN is not in the ADSP-BF52x processor) */
559
560/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
561#define PORTF_FER 0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
562#define PORTG_FER 0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
563#define PORTH_FER 0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
564#define BFIN_PORT_MUX 0xFFC0320C /* Port Multiplexer Control Register */
565
566
567/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
568#define HMDMA0_CONTROL 0xFFC03300 /* Handshake MDMA0 Control Register */
569#define HMDMA0_ECINIT 0xFFC03304 /* HMDMA0 Initial Edge Count Register */
570#define HMDMA0_BCINIT 0xFFC03308 /* HMDMA0 Initial Block Count Register */
571#define HMDMA0_ECURGENT 0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
572#define HMDMA0_ECOVERFLOW 0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
573#define HMDMA0_ECOUNT 0xFFC03314 /* HMDMA0 Current Edge Count Register */
574#define HMDMA0_BCOUNT 0xFFC03318 /* HMDMA0 Current Block Count Register */
575
576#define HMDMA1_CONTROL 0xFFC03340 /* Handshake MDMA1 Control Register */
577#define HMDMA1_ECINIT 0xFFC03344 /* HMDMA1 Initial Edge Count Register */
578#define HMDMA1_BCINIT 0xFFC03348 /* HMDMA1 Initial Block Count Register */
579#define HMDMA1_ECURGENT 0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
580#define HMDMA1_ECOVERFLOW 0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
581#define HMDMA1_ECOUNT 0xFFC03354 /* HMDMA1 Current Edge Count Register */
582#define HMDMA1_BCOUNT 0xFFC03358 /* HMDMA1 Current Block Count Register */
583
584/* GPIO PIN mux (0xFFC03210 - OxFFC03288) */
585#define PORTF_MUX 0xFFC03210 /* Port F mux control */
586#define PORTG_MUX 0xFFC03214 /* Port G mux control */
587#define PORTH_MUX 0xFFC03218 /* Port H mux control */
588#define PORTF_DRIVE 0xFFC03220 /* Port F drive strength control */
589#define PORTG_DRIVE 0xFFC03224 /* Port G drive strength control */
590#define PORTH_DRIVE 0xFFC03228 /* Port H drive strength control */
591#define PORTF_SLEW 0xFFC03230 /* Port F slew control */
592#define PORTG_SLEW 0xFFC03234 /* Port G slew control */
593#define PORTH_SLEW 0xFFC03238 /* Port H slew control */
594#define PORTF_HYSTERISIS 0xFFC03240 /* Port F Schmitt trigger control */
595#define PORTG_HYSTERISIS 0xFFC03244 /* Port G Schmitt trigger control */
596#define PORTH_HYSTERISIS 0xFFC03248 /* Port H Schmitt trigger control */
597#define MISCPORT_DRIVE 0xFFC03280 /* Misc Port drive strength control */
598#define MISCPORT_SLEW 0xFFC03284 /* Misc Port slew control */
599#define MISCPORT_HYSTERISIS 0xFFC03288 /* Misc Port Schmitt trigger control */
600
601
602/***********************************************************************************
603** System MMR Register Bits And Macros
604**
605** Disclaimer: All macros are intended to make C and Assembly code more readable.
606** Use these macros carefully, as any that do left shifts for field
607** depositing will result in the lower order bits being destroyed. Any
608** macro that shifts left to properly position the bit-field should be
609** used as part of an OR to initialize a register and NOT as a dynamic
610** modifier UNLESS the lower order bits are saved and ORed back in when
611** the macro is used.
612*************************************************************************************/
613/*
614** ********************* PLL AND RESET MASKS ****************************************/
615/* PLL_CTL Masks */
616#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
617#define PLL_OFF 0x0002 /* PLL Not Powered */
618#define STOPCK 0x0008 /* Core Clock Off */
619#define PDWN 0x0020 /* Enter Deep Sleep Mode */
620#define IN_DELAY 0x0040 /* Add 200ps Delay To EBIU Input Latches */
621#define OUT_DELAY 0x0080 /* Add 200ps Delay To EBIU Output Signals */
622#define BYPASS 0x0100 /* Bypass the PLL */
623#define MSEL 0x7E00 /* Multiplier Select For CCLK/VCO Factors */
624/* PLL_CTL Macros (Only Use With Logic OR While Setting Lower Order Bits) */
625#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
626
627/* PLL_DIV Masks */
628#define SSEL 0x000F /* System Select */
629#define CSEL 0x0030 /* Core Select */
630#define CSEL_DIV1 0x0000 /* CCLK = VCO / 1 */
631#define CSEL_DIV2 0x0010 /* CCLK = VCO / 2 */
632#define CSEL_DIV4 0x0020 /* CCLK = VCO / 4 */
633#define CSEL_DIV8 0x0030 /* CCLK = VCO / 8 */
634/* PLL_DIV Macros */
635#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
636
637/* VR_CTL Masks */
638#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
639#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
640#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
641#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
642#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
643
644#define GAIN 0x000C /* Voltage Level Gain */
645#define GAIN_5 0x0000 /* GAIN = 5 */
646#define GAIN_10 0x0004 /* GAIN = 10 */
647#define GAIN_20 0x0008 /* GAIN = 20 */
648#define GAIN_50 0x000C /* GAIN = 50 */
649
650#define VLEV 0x00F0 /* Internal Voltage Level */
651#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
652#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
653#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
654#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
655#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
656#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
657#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
658#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
659#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
660#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
661
662#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
663#define CANWE 0x0200 /* Enable CAN Wakeup From Hibernate */
664#define PHYWE 0x0400 /* Enable PHY Wakeup From Hibernate */
665#define CLKBUFOE 0x4000 /* CLKIN Buffer Output Enable */
666#define PHYCLKOE CLKBUFOE /* Alternative legacy name for the above */
667#define SCKELOW 0x8000 /* Enable Drive CKE Low During Reset */
668
669/* PLL_STAT Masks */
670#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
671#define FULL_ON 0x0002 /* Processor In Full On Mode */
672#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
673#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
674
675/* CHIPID Masks */
676#define CHIPID_VERSION 0xF0000000
677#define CHIPID_FAMILY 0x0FFFF000
678#define CHIPID_MANUFACTURE 0x00000FFE
679
680/* SWRST Masks */
681#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
682#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
683#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
684#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
685#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
686
687/* SYSCR Masks */
688#define BMODE 0x0007 /* Boot Mode - Latched During HW Reset From Mode Pins */
689#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
690
691
692/* ************* SYSTEM INTERRUPT CONTROLLER MASKS *************************************/
693/* Peripheral Masks For SIC_ISR, SIC_IWR, SIC_IMASK */
694
695#if 0
696#define IRQ_PLL_WAKEUP 0x00000001 /* PLL Wakeup Interrupt */
697
698#define IRQ_ERROR1 0x00000002 /* Error Interrupt (DMA, DMARx Block, DMARx Overflow) */
699#define IRQ_ERROR2 0x00000004 /* Error Interrupt (CAN, Ethernet, SPORTx, PPI, SPI, UARTx) */
700#define IRQ_RTC 0x00000008 /* Real Time Clock Interrupt */
701#define IRQ_DMA0 0x00000010 /* DMA Channel 0 (PPI) Interrupt */
702#define IRQ_DMA3 0x00000020 /* DMA Channel 3 (SPORT0 RX) Interrupt */
703#define IRQ_DMA4 0x00000040 /* DMA Channel 4 (SPORT0 TX) Interrupt */
704#define IRQ_DMA5 0x00000080 /* DMA Channel 5 (SPORT1 RX) Interrupt */
705
706#define IRQ_DMA6 0x00000100 /* DMA Channel 6 (SPORT1 TX) Interrupt */
707#define IRQ_TWI 0x00000200 /* TWI Interrupt */
708#define IRQ_DMA7 0x00000400 /* DMA Channel 7 (SPI) Interrupt */
709#define IRQ_DMA8 0x00000800 /* DMA Channel 8 (UART0 RX) Interrupt */
710#define IRQ_DMA9 0x00001000 /* DMA Channel 9 (UART0 TX) Interrupt */
711#define IRQ_DMA10 0x00002000 /* DMA Channel 10 (UART1 RX) Interrupt */
712#define IRQ_DMA11 0x00004000 /* DMA Channel 11 (UART1 TX) Interrupt */
713#define IRQ_CAN_RX 0x00008000 /* CAN Receive Interrupt */
714
715#define IRQ_CAN_TX 0x00010000 /* CAN Transmit Interrupt */
716#define IRQ_DMA1 0x00020000 /* DMA Channel 1 (Ethernet RX) Interrupt */
717#define IRQ_PFA_PORTH 0x00020000 /* PF Port H (PF47:32) Interrupt A */
718#define IRQ_DMA2 0x00040000 /* DMA Channel 2 (Ethernet TX) Interrupt */
719#define IRQ_PFB_PORTH 0x00040000 /* PF Port H (PF47:32) Interrupt B */
720#define IRQ_TIMER0 0x00080000 /* Timer 0 Interrupt */
721#define IRQ_TIMER1 0x00100000 /* Timer 1 Interrupt */
722#define IRQ_TIMER2 0x00200000 /* Timer 2 Interrupt */
723#define IRQ_TIMER3 0x00400000 /* Timer 3 Interrupt */
724#define IRQ_TIMER4 0x00800000 /* Timer 4 Interrupt */
725
726#define IRQ_TIMER5 0x01000000 /* Timer 5 Interrupt */
727#define IRQ_TIMER6 0x02000000 /* Timer 6 Interrupt */
728#define IRQ_TIMER7 0x04000000 /* Timer 7 Interrupt */
729#define IRQ_PFA_PORTFG 0x08000000 /* PF Ports F&G (PF31:0) Interrupt A */
730#define IRQ_PFB_PORTF 0x80000000 /* PF Port F (PF15:0) Interrupt B */
731#define IRQ_DMA12 0x20000000 /* DMA Channels 12 (MDMA1 Source) RX Interrupt */
732#define IRQ_DMA13 0x20000000 /* DMA Channels 13 (MDMA1 Destination) TX Interrupt */
733#define IRQ_DMA14 0x40000000 /* DMA Channels 14 (MDMA0 Source) RX Interrupt */
734#define IRQ_DMA15 0x40000000 /* DMA Channels 15 (MDMA0 Destination) TX Interrupt */
735#define IRQ_WDOG 0x80000000 /* Software Watchdog Timer Interrupt */
736#define IRQ_PFB_PORTG 0x10000000 /* PF Port G (PF31:16) Interrupt B */
737#endif
738
739/* SIC_IAR0 Macros */
740#define P0_IVG(x) (((x)&0xF)-7) /* Peripheral #0 assigned IVG #x */
741#define P1_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #1 assigned IVG #x */
742#define P2_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #2 assigned IVG #x */
743#define P3_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #3 assigned IVG #x */
744#define P4_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #4 assigned IVG #x */
745#define P5_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #5 assigned IVG #x */
746#define P6_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #6 assigned IVG #x */
747#define P7_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #7 assigned IVG #x */
748
749/* SIC_IAR1 Macros */
750#define P8_IVG(x) (((x)&0xF)-7) /* Peripheral #8 assigned IVG #x */
751#define P9_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #9 assigned IVG #x */
752#define P10_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #10 assigned IVG #x */
753#define P11_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #11 assigned IVG #x */
754#define P12_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #12 assigned IVG #x */
755#define P13_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #13 assigned IVG #x */
756#define P14_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #14 assigned IVG #x */
757#define P15_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #15 assigned IVG #x */
758
759/* SIC_IAR2 Macros */
760#define P16_IVG(x) (((x)&0xF)-7) /* Peripheral #16 assigned IVG #x */
761#define P17_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #17 assigned IVG #x */
762#define P18_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #18 assigned IVG #x */
763#define P19_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #19 assigned IVG #x */
764#define P20_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #20 assigned IVG #x */
765#define P21_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #21 assigned IVG #x */
766#define P22_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #22 assigned IVG #x */
767#define P23_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #23 assigned IVG #x */
768
769/* SIC_IAR3 Macros */
770#define P24_IVG(x) (((x)&0xF)-7) /* Peripheral #24 assigned IVG #x */
771#define P25_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #25 assigned IVG #x */
772#define P26_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #26 assigned IVG #x */
773#define P27_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #27 assigned IVG #x */
774#define P28_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #28 assigned IVG #x */
775#define P29_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #29 assigned IVG #x */
776#define P30_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #30 assigned IVG #x */
777#define P31_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #31 assigned IVG #x */
778
779
780/* SIC_IMASK Masks */
781#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
782#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
783#define SIC_MASK(x) (1 << ((x)&0x1F)) /* Mask Peripheral #x interrupt */
784#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Unmask Peripheral #x interrupt */
785
786/* SIC_IWR Masks */
787#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
788#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
789#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */
790#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */
791
792
793/* ********* WATCHDOG TIMER MASKS ******************** */
794
795/* Watchdog Timer WDOG_CTL Register Masks */
796
797#define WDEV(x) (((x)<<1) & 0x0006) /* event generated on roll over */
798#define WDEV_RESET 0x0000 /* generate reset event on roll over */
799#define WDEV_NMI 0x0002 /* generate NMI event on roll over */
800#define WDEV_GPI 0x0004 /* generate GP IRQ on roll over */
801#define WDEV_NONE 0x0006 /* no event on roll over */
802#define WDEN 0x0FF0 /* enable watchdog */
803#define WDDIS 0x0AD0 /* disable watchdog */
804#define WDRO 0x8000 /* watchdog rolled over latch */
805
806/* depreciated WDOG_CTL Register Masks for legacy code */
807
808
809#define ICTL WDEV
810#define ENABLE_RESET WDEV_RESET
811#define WDOG_RESET WDEV_RESET
812#define ENABLE_NMI WDEV_NMI
813#define WDOG_NMI WDEV_NMI
814#define ENABLE_GPI WDEV_GPI
815#define WDOG_GPI WDEV_GPI
816#define DISABLE_EVT WDEV_NONE
817#define WDOG_NONE WDEV_NONE
818
819#define TMR_EN WDEN
820#define TMR_DIS WDDIS
821#define TRO WDRO
822#define ICTL_P0 0x01
823 #define ICTL_P1 0x02
824#define TRO_P 0x0F
825
826
827
828/* *************** REAL TIME CLOCK MASKS **************************/
829/* RTC_STAT and RTC_ALARM Masks */
830#define RTC_SEC 0x0000003F /* Real-Time Clock Seconds */
831#define RTC_MIN 0x00000FC0 /* Real-Time Clock Minutes */
832#define RTC_HR 0x0001F000 /* Real-Time Clock Hours */
833#define RTC_DAY 0xFFFE0000 /* Real-Time Clock Days */
834
835/* RTC_ALARM Macro z=day y=hr x=min w=sec */
836#define SET_ALARM(z,y,x,w) ((((z)&0x7FFF)<<0x11)|(((y)&0x1F)<<0xC)|(((x)&0x3F)<<0x6)|((w)&0x3F))
837
838/* RTC_ICTL and RTC_ISTAT Masks */
839#define STOPWATCH 0x0001 /* Stopwatch Interrupt Enable */
840#define ALARM 0x0002 /* Alarm Interrupt Enable */
841#define SECOND 0x0004 /* Seconds (1 Hz) Interrupt Enable */
842#define MINUTE 0x0008 /* Minutes Interrupt Enable */
843#define HOUR 0x0010 /* Hours Interrupt Enable */
844#define DAY 0x0020 /* 24 Hours (Days) Interrupt Enable */
845#define DAY_ALARM 0x0040 /* Day Alarm (Day, Hour, Minute, Second) Interrupt Enable */
846#define WRITE_PENDING 0x4000 /* Write Pending Status */
847#define WRITE_COMPLETE 0x8000 /* Write Complete Interrupt Enable */
848
849/* RTC_FAST / RTC_PREN Mask */
850#define PREN 0x0001 /* Enable Prescaler, RTC Runs @1 Hz */
851
852
853/* ************** UART CONTROLLER MASKS *************************/
854/* UARTx_LCR Masks */
855#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
856#define STB 0x04 /* Stop Bits */
857#define PEN 0x08 /* Parity Enable */
858#define EPS 0x10 /* Even Parity Select */
859#define STP 0x20 /* Stick Parity */
860#define SB 0x40 /* Set Break */
861#define DLAB 0x80 /* Divisor Latch Access */
862
863/* UARTx_MCR Mask */
864#define LOOP_ENA 0x10 /* Loopback Mode Enable */
865#define LOOP_ENA_P 0x04
866
867/* UARTx_LSR Masks */
868#define DR 0x01 /* Data Ready */
869#define OE 0x02 /* Overrun Error */
870#define PE 0x04 /* Parity Error */
871#define FE 0x08 /* Framing Error */
872#define BI 0x10 /* Break Interrupt */
873#define THRE 0x20 /* THR Empty */
874#define TEMT 0x40 /* TSR and UART_THR Empty */
875
876/* UARTx_IER Masks */
877#define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */
878#define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */
879#define ELSI 0x04 /* Enable RX Status Interrupt */
880
881/* UARTx_IIR Masks */
882#define NINT 0x01 /* Pending Interrupt */
883#define IIR_TX_READY 0x02 /* UART_THR empty */
884#define IIR_RX_READY 0x04 /* Receive data ready */
885#define IIR_LINE_CHANGE 0x06 /* Receive line status */
886#define IIR_STATUS 0x06 /* Highest Priority Pending Interrupt */
887
888/* UARTx_GCTL Masks */
889#define UCEN 0x01 /* Enable UARTx Clocks */
890#define IREN 0x02 /* Enable IrDA Mode */
891#define TPOLC 0x04 /* IrDA TX Polarity Change */
892#define RPOLC 0x08 /* IrDA RX Polarity Change */
893#define FPE 0x10 /* Force Parity Error On Transmit */
894#define FFE 0x20 /* Force Framing Error On Transmit */
895
896
897/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS ****************************/
898/* SPI_CTL Masks */
899#define TIMOD 0x0003 /* Transfer Initiate Mode */
900#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
901#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
902#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
903#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
904#define SZ 0x0004 /* Send Zero (When TDBR Empty, Send Zero/Last*) */
905#define GM 0x0008 /* Get More (When RDBR Full, Overwrite/Discard*) */
906#define PSSE 0x0010 /* Slave-Select Input Enable */
907#define EMISO 0x0020 /* Enable MISO As Output */
908#define SIZE 0x0100 /* Size of Words (16/8* Bits) */
909#define LSBF 0x0200 /* LSB First */
910#define CPHA 0x0400 /* Clock Phase */
911#define CPOL 0x0800 /* Clock Polarity */
912#define MSTR 0x1000 /* Master/Slave* */
913#define WOM 0x2000 /* Write Open Drain Master */
914#define SPE 0x4000 /* SPI Enable */
915
916/* SPI_FLG Masks */
917#define FLS1 0x0002 /* Enables SPI_FLOUT1 as SPI Slave-Select Output */
918#define FLS2 0x0004 /* Enables SPI_FLOUT2 as SPI Slave-Select Output */
919#define FLS3 0x0008 /* Enables SPI_FLOUT3 as SPI Slave-Select Output */
920#define FLS4 0x0010 /* Enables SPI_FLOUT4 as SPI Slave-Select Output */
921#define FLS5 0x0020 /* Enables SPI_FLOUT5 as SPI Slave-Select Output */
922#define FLS6 0x0040 /* Enables SPI_FLOUT6 as SPI Slave-Select Output */
923#define FLS7 0x0080 /* Enables SPI_FLOUT7 as SPI Slave-Select Output */
924#define FLG1 0xFDFF /* Activates SPI_FLOUT1 */
925#define FLG2 0xFBFF /* Activates SPI_FLOUT2 */
926#define FLG3 0xF7FF /* Activates SPI_FLOUT3 */
927#define FLG4 0xEFFF /* Activates SPI_FLOUT4 */
928#define FLG5 0xDFFF /* Activates SPI_FLOUT5 */
929#define FLG6 0xBFFF /* Activates SPI_FLOUT6 */
930#define FLG7 0x7FFF /* Activates SPI_FLOUT7 */
931
932/* SPI_STAT Masks */
933#define SPIF 0x0001 /* SPI Finished (Single-Word Transfer Complete) */
934#define MODF 0x0002 /* Mode Fault Error (Another Device Tried To Become Master) */
935#define TXE 0x0004 /* Transmission Error (Data Sent With No New Data In TDBR) */
936#define TXS 0x0008 /* SPI_TDBR Data Buffer Status (Full/Empty*) */
937#define RBSY 0x0010 /* Receive Error (Data Received With RDBR Full) */
938#define RXS 0x0020 /* SPI_RDBR Data Buffer Status (Full/Empty*) */
939#define TXCOL 0x0040 /* Transmit Collision Error (Corrupt Data May Have Been Sent) */
940
941
942/* **************** GENERAL PURPOSE TIMER MASKS **********************/
943/* TIMER_ENABLE Masks */
944#define TIMEN0 0x0001 /* Enable Timer 0 */
945#define TIMEN1 0x0002 /* Enable Timer 1 */
946#define TIMEN2 0x0004 /* Enable Timer 2 */
947#define TIMEN3 0x0008 /* Enable Timer 3 */
948#define TIMEN4 0x0010 /* Enable Timer 4 */
949#define TIMEN5 0x0020 /* Enable Timer 5 */
950#define TIMEN6 0x0040 /* Enable Timer 6 */
951#define TIMEN7 0x0080 /* Enable Timer 7 */
952
953/* TIMER_DISABLE Masks */
954#define TIMDIS0 TIMEN0 /* Disable Timer 0 */
955#define TIMDIS1 TIMEN1 /* Disable Timer 1 */
956#define TIMDIS2 TIMEN2 /* Disable Timer 2 */
957#define TIMDIS3 TIMEN3 /* Disable Timer 3 */
958#define TIMDIS4 TIMEN4 /* Disable Timer 4 */
959#define TIMDIS5 TIMEN5 /* Disable Timer 5 */
960#define TIMDIS6 TIMEN6 /* Disable Timer 6 */
961#define TIMDIS7 TIMEN7 /* Disable Timer 7 */
962
963/* TIMER_STATUS Masks */
964#define TIMIL0 0x00000001 /* Timer 0 Interrupt */
965#define TIMIL1 0x00000002 /* Timer 1 Interrupt */
966#define TIMIL2 0x00000004 /* Timer 2 Interrupt */
967#define TIMIL3 0x00000008 /* Timer 3 Interrupt */
968#define TOVF_ERR0 0x00000010 /* Timer 0 Counter Overflow */
969#define TOVF_ERR1 0x00000020 /* Timer 1 Counter Overflow */
970#define TOVF_ERR2 0x00000040 /* Timer 2 Counter Overflow */
971#define TOVF_ERR3 0x00000080 /* Timer 3 Counter Overflow */
972#define TRUN0 0x00001000 /* Timer 0 Slave Enable Status */
973#define TRUN1 0x00002000 /* Timer 1 Slave Enable Status */
974#define TRUN2 0x00004000 /* Timer 2 Slave Enable Status */
975#define TRUN3 0x00008000 /* Timer 3 Slave Enable Status */
976#define TIMIL4 0x00010000 /* Timer 4 Interrupt */
977#define TIMIL5 0x00020000 /* Timer 5 Interrupt */
978#define TIMIL6 0x00040000 /* Timer 6 Interrupt */
979#define TIMIL7 0x00080000 /* Timer 7 Interrupt */
980#define TOVF_ERR4 0x00100000 /* Timer 4 Counter Overflow */
981#define TOVF_ERR5 0x00200000 /* Timer 5 Counter Overflow */
982#define TOVF_ERR6 0x00400000 /* Timer 6 Counter Overflow */
983#define TOVF_ERR7 0x00800000 /* Timer 7 Counter Overflow */
984#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
985#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
986#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
987#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
988
989/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
990#define TOVL_ERR0 TOVF_ERR0
991#define TOVL_ERR1 TOVF_ERR1
992#define TOVL_ERR2 TOVF_ERR2
993#define TOVL_ERR3 TOVF_ERR3
994#define TOVL_ERR4 TOVF_ERR4
995#define TOVL_ERR5 TOVF_ERR5
996#define TOVL_ERR6 TOVF_ERR6
997#define TOVL_ERR7 TOVF_ERR7
998
999/* TIMERx_CONFIG Masks */
1000#define PWM_OUT 0x0001 /* Pulse-Width Modulation Output Mode */
1001#define WDTH_CAP 0x0002 /* Width Capture Input Mode */
1002#define EXT_CLK 0x0003 /* External Clock Mode */
1003#define PULSE_HI 0x0004 /* Action Pulse (Positive/Negative*) */
1004#define PERIOD_CNT 0x0008 /* Period Count */
1005#define IRQ_ENA 0x0010 /* Interrupt Request Enable */
1006#define TIN_SEL 0x0020 /* Timer Input Select */
1007#define OUT_DIS 0x0040 /* Output Pad Disable */
1008#define CLK_SEL 0x0080 /* Timer Clock Select */
1009#define TOGGLE_HI 0x0100 /* PWM_OUT PULSE_HI Toggle Mode */
1010#define EMU_RUN 0x0200 /* Emulation Behavior Select */
1011#define ERR_TYP 0xC000 /* Error Type */
1012
1013
1014/* ****************** GPIO PORTS F, G, H MASKS ***********************/
1015/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
1016/* Port F Masks */
1017#define PF0 0x0001
1018#define PF1 0x0002
1019#define PF2 0x0004
1020#define PF3 0x0008
1021#define PF4 0x0010
1022#define PF5 0x0020
1023#define PF6 0x0040
1024#define PF7 0x0080
1025#define PF8 0x0100
1026#define PF9 0x0200
1027#define PF10 0x0400
1028#define PF11 0x0800
1029#define PF12 0x1000
1030#define PF13 0x2000
1031#define PF14 0x4000
1032#define PF15 0x8000
1033
1034/* Port G Masks */
1035#define PG0 0x0001
1036#define PG1 0x0002
1037#define PG2 0x0004
1038#define PG3 0x0008
1039#define PG4 0x0010
1040#define PG5 0x0020
1041#define PG6 0x0040
1042#define PG7 0x0080
1043#define PG8 0x0100
1044#define PG9 0x0200
1045#define PG10 0x0400
1046#define PG11 0x0800
1047#define PG12 0x1000
1048#define PG13 0x2000
1049#define PG14 0x4000
1050#define PG15 0x8000
1051
1052/* Port H Masks */
1053#define PH0 0x0001
1054#define PH1 0x0002
1055#define PH2 0x0004
1056#define PH3 0x0008
1057#define PH4 0x0010
1058#define PH5 0x0020
1059#define PH6 0x0040
1060#define PH7 0x0080
1061#define PH8 0x0100
1062#define PH9 0x0200
1063#define PH10 0x0400
1064#define PH11 0x0800
1065#define PH12 0x1000
1066#define PH13 0x2000
1067#define PH14 0x4000
1068#define PH15 0x8000
1069
1070
1071/* ******************* SERIAL PORT MASKS **************************************/
1072/* SPORTx_TCR1 Masks */
1073#define TSPEN 0x0001 /* Transmit Enable */
1074#define ITCLK 0x0002 /* Internal Transmit Clock Select */
1075#define DTYPE_NORM 0x0004 /* Data Format Normal */
1076#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1077#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1078#define TLSBIT 0x0010 /* Transmit Bit Order */
1079#define ITFS 0x0200 /* Internal Transmit Frame Sync Select */
1080#define TFSR 0x0400 /* Transmit Frame Sync Required Select */
1081#define DITFS 0x0800 /* Data-Independent Transmit Frame Sync Select */
1082#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
1083#define LATFS 0x2000 /* Late Transmit Frame Sync Select */
1084#define TCKFE 0x4000 /* Clock Falling Edge Select */
1085
1086/* SPORTx_TCR2 Masks and Macro */
1087#define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
1088#define TXSE 0x0100 /* TX Secondary Enable */
1089#define TSFSE 0x0200 /* Transmit Stereo Frame Sync Enable */
1090#define TRFST 0x0400 /* Left/Right Order (1 = Right Channel 1st) */
1091
1092/* SPORTx_RCR1 Masks */
1093#define RSPEN 0x0001 /* Receive Enable */
1094#define IRCLK 0x0002 /* Internal Receive Clock Select */
1095#define DTYPE_NORM 0x0004 /* Data Format Normal */
1096#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1097#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1098#define RLSBIT 0x0010 /* Receive Bit Order */
1099#define IRFS 0x0200 /* Internal Receive Frame Sync Select */
1100#define RFSR 0x0400 /* Receive Frame Sync Required Select */
1101#define LRFS 0x1000 /* Low Receive Frame Sync Select */
1102#define LARFS 0x2000 /* Late Receive Frame Sync Select */
1103#define RCKFE 0x4000 /* Clock Falling Edge Select */
1104
1105/* SPORTx_RCR2 Masks */
1106#define SLEN(x) ((x)&0x1F) /* SPORT RX Word Length (2 - 31) */
1107#define RXSE 0x0100 /* RX Secondary Enable */
1108#define RSFSE 0x0200 /* RX Stereo Frame Sync Enable */
1109#define RRFST 0x0400 /* Right-First Data Order */
1110
1111/* SPORTx_STAT Masks */
1112#define RXNE 0x0001 /* Receive FIFO Not Empty Status */
1113#define RUVF 0x0002 /* Sticky Receive Underflow Status */
1114#define ROVF 0x0004 /* Sticky Receive Overflow Status */
1115#define TXF 0x0008 /* Transmit FIFO Full Status */
1116#define TUVF 0x0010 /* Sticky Transmit Underflow Status */
1117#define TOVF 0x0020 /* Sticky Transmit Overflow Status */
1118#define TXHRE 0x0040 /* Transmit Hold Register Empty */
1119
1120/* SPORTx_MCMC1 Macros */
1121#define SP_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
1122
1123/* Only use WSIZE Macro With Logic OR While Setting Lower Order Bits */
1124#define SP_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
1125
1126/* SPORTx_MCMC2 Masks */
1127#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
1128#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
1129#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
1130#define MCDTXPE 0x0004 /* Multichannel DMA Transmit Packing */
1131#define MCDRXPE 0x0008 /* Multichannel DMA Receive Packing */
1132#define MCMEN 0x0010 /* Multichannel Frame Mode Enable */
1133#define FSDR 0x0080 /* Multichannel Frame Sync to Data Relationship */
1134#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
1135#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
1136#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
1137#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
1138#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
1139#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
1140#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
1141#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
1142#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
1143#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
1144#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
1145#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
1146#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
1147#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
1148#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
1149#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
1150
1151
1152/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS *************************/
1153/* EBIU_AMGCTL Masks */
1154#define AMCKEN 0x0001 /* Enable CLKOUT */
1155#define AMBEN_NONE 0x0000 /* All Banks Disabled */
1156#define AMBEN_B0 0x0002 /* Enable Async Memory Bank 0 only */
1157#define AMBEN_B0_B1 0x0004 /* Enable Async Memory Banks 0 & 1 only */
1158#define AMBEN_B0_B1_B2 0x0006 /* Enable Async Memory Banks 0, 1, and 2 */
1159#define AMBEN_ALL 0x0008 /* Enable Async Memory Banks (all) 0, 1, 2, and 3 */
1160
1161/* EBIU_AMBCTL0 Masks */
1162#define B0RDYEN 0x00000001 /* Bank 0 (B0) RDY Enable */
1163#define B0RDYPOL 0x00000002 /* B0 RDY Active High */
1164#define B0TT_1 0x00000004 /* B0 Transition Time (Read to Write) = 1 cycle */
1165#define B0TT_2 0x00000008 /* B0 Transition Time (Read to Write) = 2 cycles */
1166#define B0TT_3 0x0000000C /* B0 Transition Time (Read to Write) = 3 cycles */
1167#define B0TT_4 0x00000000 /* B0 Transition Time (Read to Write) = 4 cycles */
1168#define B0ST_1 0x00000010 /* B0 Setup Time (AOE to Read/Write) = 1 cycle */
1169#define B0ST_2 0x00000020 /* B0 Setup Time (AOE to Read/Write) = 2 cycles */
1170#define B0ST_3 0x00000030 /* B0 Setup Time (AOE to Read/Write) = 3 cycles */
1171#define B0ST_4 0x00000000 /* B0 Setup Time (AOE to Read/Write) = 4 cycles */
1172#define B0HT_1 0x00000040 /* B0 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1173#define B0HT_2 0x00000080 /* B0 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1174#define B0HT_3 0x000000C0 /* B0 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1175#define B0HT_0 0x00000000 /* B0 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1176#define B0RAT_1 0x00000100 /* B0 Read Access Time = 1 cycle */
1177#define B0RAT_2 0x00000200 /* B0 Read Access Time = 2 cycles */
1178#define B0RAT_3 0x00000300 /* B0 Read Access Time = 3 cycles */
1179#define B0RAT_4 0x00000400 /* B0 Read Access Time = 4 cycles */
1180#define B0RAT_5 0x00000500 /* B0 Read Access Time = 5 cycles */
1181#define B0RAT_6 0x00000600 /* B0 Read Access Time = 6 cycles */
1182#define B0RAT_7 0x00000700 /* B0 Read Access Time = 7 cycles */
1183#define B0RAT_8 0x00000800 /* B0 Read Access Time = 8 cycles */
1184#define B0RAT_9 0x00000900 /* B0 Read Access Time = 9 cycles */
1185#define B0RAT_10 0x00000A00 /* B0 Read Access Time = 10 cycles */
1186#define B0RAT_11 0x00000B00 /* B0 Read Access Time = 11 cycles */
1187#define B0RAT_12 0x00000C00 /* B0 Read Access Time = 12 cycles */
1188#define B0RAT_13 0x00000D00 /* B0 Read Access Time = 13 cycles */
1189#define B0RAT_14 0x00000E00 /* B0 Read Access Time = 14 cycles */
1190#define B0RAT_15 0x00000F00 /* B0 Read Access Time = 15 cycles */
1191#define B0WAT_1 0x00001000 /* B0 Write Access Time = 1 cycle */
1192#define B0WAT_2 0x00002000 /* B0 Write Access Time = 2 cycles */
1193#define B0WAT_3 0x00003000 /* B0 Write Access Time = 3 cycles */
1194#define B0WAT_4 0x00004000 /* B0 Write Access Time = 4 cycles */
1195#define B0WAT_5 0x00005000 /* B0 Write Access Time = 5 cycles */
1196#define B0WAT_6 0x00006000 /* B0 Write Access Time = 6 cycles */
1197#define B0WAT_7 0x00007000 /* B0 Write Access Time = 7 cycles */
1198#define B0WAT_8 0x00008000 /* B0 Write Access Time = 8 cycles */
1199#define B0WAT_9 0x00009000 /* B0 Write Access Time = 9 cycles */
1200#define B0WAT_10 0x0000A000 /* B0 Write Access Time = 10 cycles */
1201#define B0WAT_11 0x0000B000 /* B0 Write Access Time = 11 cycles */
1202#define B0WAT_12 0x0000C000 /* B0 Write Access Time = 12 cycles */
1203#define B0WAT_13 0x0000D000 /* B0 Write Access Time = 13 cycles */
1204#define B0WAT_14 0x0000E000 /* B0 Write Access Time = 14 cycles */
1205#define B0WAT_15 0x0000F000 /* B0 Write Access Time = 15 cycles */
1206
1207#define B1RDYEN 0x00010000 /* Bank 1 (B1) RDY Enable */
1208#define B1RDYPOL 0x00020000 /* B1 RDY Active High */
1209#define B1TT_1 0x00040000 /* B1 Transition Time (Read to Write) = 1 cycle */
1210#define B1TT_2 0x00080000 /* B1 Transition Time (Read to Write) = 2 cycles */
1211#define B1TT_3 0x000C0000 /* B1 Transition Time (Read to Write) = 3 cycles */
1212#define B1TT_4 0x00000000 /* B1 Transition Time (Read to Write) = 4 cycles */
1213#define B1ST_1 0x00100000 /* B1 Setup Time (AOE to Read/Write) = 1 cycle */
1214#define B1ST_2 0x00200000 /* B1 Setup Time (AOE to Read/Write) = 2 cycles */
1215#define B1ST_3 0x00300000 /* B1 Setup Time (AOE to Read/Write) = 3 cycles */
1216#define B1ST_4 0x00000000 /* B1 Setup Time (AOE to Read/Write) = 4 cycles */
1217#define B1HT_1 0x00400000 /* B1 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1218#define B1HT_2 0x00800000 /* B1 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1219#define B1HT_3 0x00C00000 /* B1 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1220#define B1HT_0 0x00000000 /* B1 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1221#define B1RAT_1 0x01000000 /* B1 Read Access Time = 1 cycle */
1222#define B1RAT_2 0x02000000 /* B1 Read Access Time = 2 cycles */
1223#define B1RAT_3 0x03000000 /* B1 Read Access Time = 3 cycles */
1224#define B1RAT_4 0x04000000 /* B1 Read Access Time = 4 cycles */
1225#define B1RAT_5 0x05000000 /* B1 Read Access Time = 5 cycles */
1226#define B1RAT_6 0x06000000 /* B1 Read Access Time = 6 cycles */
1227#define B1RAT_7 0x07000000 /* B1 Read Access Time = 7 cycles */
1228#define B1RAT_8 0x08000000 /* B1 Read Access Time = 8 cycles */
1229#define B1RAT_9 0x09000000 /* B1 Read Access Time = 9 cycles */
1230#define B1RAT_10 0x0A000000 /* B1 Read Access Time = 10 cycles */
1231#define B1RAT_11 0x0B000000 /* B1 Read Access Time = 11 cycles */
1232#define B1RAT_12 0x0C000000 /* B1 Read Access Time = 12 cycles */
1233#define B1RAT_13 0x0D000000 /* B1 Read Access Time = 13 cycles */
1234#define B1RAT_14 0x0E000000 /* B1 Read Access Time = 14 cycles */
1235#define B1RAT_15 0x0F000000 /* B1 Read Access Time = 15 cycles */
1236#define B1WAT_1 0x10000000 /* B1 Write Access Time = 1 cycle */
1237#define B1WAT_2 0x20000000 /* B1 Write Access Time = 2 cycles */
1238#define B1WAT_3 0x30000000 /* B1 Write Access Time = 3 cycles */
1239#define B1WAT_4 0x40000000 /* B1 Write Access Time = 4 cycles */
1240#define B1WAT_5 0x50000000 /* B1 Write Access Time = 5 cycles */
1241#define B1WAT_6 0x60000000 /* B1 Write Access Time = 6 cycles */
1242#define B1WAT_7 0x70000000 /* B1 Write Access Time = 7 cycles */
1243#define B1WAT_8 0x80000000 /* B1 Write Access Time = 8 cycles */
1244#define B1WAT_9 0x90000000 /* B1 Write Access Time = 9 cycles */
1245#define B1WAT_10 0xA0000000 /* B1 Write Access Time = 10 cycles */
1246#define B1WAT_11 0xB0000000 /* B1 Write Access Time = 11 cycles */
1247#define B1WAT_12 0xC0000000 /* B1 Write Access Time = 12 cycles */
1248#define B1WAT_13 0xD0000000 /* B1 Write Access Time = 13 cycles */
1249#define B1WAT_14 0xE0000000 /* B1 Write Access Time = 14 cycles */
1250#define B1WAT_15 0xF0000000 /* B1 Write Access Time = 15 cycles */
1251
1252/* EBIU_AMBCTL1 Masks */
1253#define B2RDYEN 0x00000001 /* Bank 2 (B2) RDY Enable */
1254#define B2RDYPOL 0x00000002 /* B2 RDY Active High */
1255#define B2TT_1 0x00000004 /* B2 Transition Time (Read to Write) = 1 cycle */
1256#define B2TT_2 0x00000008 /* B2 Transition Time (Read to Write) = 2 cycles */
1257#define B2TT_3 0x0000000C /* B2 Transition Time (Read to Write) = 3 cycles */
1258#define B2TT_4 0x00000000 /* B2 Transition Time (Read to Write) = 4 cycles */
1259#define B2ST_1 0x00000010 /* B2 Setup Time (AOE to Read/Write) = 1 cycle */
1260#define B2ST_2 0x00000020 /* B2 Setup Time (AOE to Read/Write) = 2 cycles */
1261#define B2ST_3 0x00000030 /* B2 Setup Time (AOE to Read/Write) = 3 cycles */
1262#define B2ST_4 0x00000000 /* B2 Setup Time (AOE to Read/Write) = 4 cycles */
1263#define B2HT_1 0x00000040 /* B2 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1264#define B2HT_2 0x00000080 /* B2 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1265#define B2HT_3 0x000000C0 /* B2 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1266#define B2HT_0 0x00000000 /* B2 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1267#define B2RAT_1 0x00000100 /* B2 Read Access Time = 1 cycle */
1268#define B2RAT_2 0x00000200 /* B2 Read Access Time = 2 cycles */
1269#define B2RAT_3 0x00000300 /* B2 Read Access Time = 3 cycles */
1270#define B2RAT_4 0x00000400 /* B2 Read Access Time = 4 cycles */
1271#define B2RAT_5 0x00000500 /* B2 Read Access Time = 5 cycles */
1272#define B2RAT_6 0x00000600 /* B2 Read Access Time = 6 cycles */
1273#define B2RAT_7 0x00000700 /* B2 Read Access Time = 7 cycles */
1274#define B2RAT_8 0x00000800 /* B2 Read Access Time = 8 cycles */
1275#define B2RAT_9 0x00000900 /* B2 Read Access Time = 9 cycles */
1276#define B2RAT_10 0x00000A00 /* B2 Read Access Time = 10 cycles */
1277#define B2RAT_11 0x00000B00 /* B2 Read Access Time = 11 cycles */
1278#define B2RAT_12 0x00000C00 /* B2 Read Access Time = 12 cycles */
1279#define B2RAT_13 0x00000D00 /* B2 Read Access Time = 13 cycles */
1280#define B2RAT_14 0x00000E00 /* B2 Read Access Time = 14 cycles */
1281#define B2RAT_15 0x00000F00 /* B2 Read Access Time = 15 cycles */
1282#define B2WAT_1 0x00001000 /* B2 Write Access Time = 1 cycle */
1283#define B2WAT_2 0x00002000 /* B2 Write Access Time = 2 cycles */
1284#define B2WAT_3 0x00003000 /* B2 Write Access Time = 3 cycles */
1285#define B2WAT_4 0x00004000 /* B2 Write Access Time = 4 cycles */
1286#define B2WAT_5 0x00005000 /* B2 Write Access Time = 5 cycles */
1287#define B2WAT_6 0x00006000 /* B2 Write Access Time = 6 cycles */
1288#define B2WAT_7 0x00007000 /* B2 Write Access Time = 7 cycles */
1289#define B2WAT_8 0x00008000 /* B2 Write Access Time = 8 cycles */
1290#define B2WAT_9 0x00009000 /* B2 Write Access Time = 9 cycles */
1291#define B2WAT_10 0x0000A000 /* B2 Write Access Time = 10 cycles */
1292#define B2WAT_11 0x0000B000 /* B2 Write Access Time = 11 cycles */
1293#define B2WAT_12 0x0000C000 /* B2 Write Access Time = 12 cycles */
1294#define B2WAT_13 0x0000D000 /* B2 Write Access Time = 13 cycles */
1295#define B2WAT_14 0x0000E000 /* B2 Write Access Time = 14 cycles */
1296#define B2WAT_15 0x0000F000 /* B2 Write Access Time = 15 cycles */
1297
1298#define B3RDYEN 0x00010000 /* Bank 3 (B3) RDY Enable */
1299#define B3RDYPOL 0x00020000 /* B3 RDY Active High */
1300#define B3TT_1 0x00040000 /* B3 Transition Time (Read to Write) = 1 cycle */
1301#define B3TT_2 0x00080000 /* B3 Transition Time (Read to Write) = 2 cycles */
1302#define B3TT_3 0x000C0000 /* B3 Transition Time (Read to Write) = 3 cycles */
1303#define B3TT_4 0x00000000 /* B3 Transition Time (Read to Write) = 4 cycles */
1304#define B3ST_1 0x00100000 /* B3 Setup Time (AOE to Read/Write) = 1 cycle */
1305#define B3ST_2 0x00200000 /* B3 Setup Time (AOE to Read/Write) = 2 cycles */
1306#define B3ST_3 0x00300000 /* B3 Setup Time (AOE to Read/Write) = 3 cycles */
1307#define B3ST_4 0x00000000 /* B3 Setup Time (AOE to Read/Write) = 4 cycles */
1308#define B3HT_1 0x00400000 /* B3 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1309#define B3HT_2 0x00800000 /* B3 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1310#define B3HT_3 0x00C00000 /* B3 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1311#define B3HT_0 0x00000000 /* B3 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1312#define B3RAT_1 0x01000000 /* B3 Read Access Time = 1 cycle */
1313#define B3RAT_2 0x02000000 /* B3 Read Access Time = 2 cycles */
1314#define B3RAT_3 0x03000000 /* B3 Read Access Time = 3 cycles */
1315#define B3RAT_4 0x04000000 /* B3 Read Access Time = 4 cycles */
1316#define B3RAT_5 0x05000000 /* B3 Read Access Time = 5 cycles */
1317#define B3RAT_6 0x06000000 /* B3 Read Access Time = 6 cycles */
1318#define B3RAT_7 0x07000000 /* B3 Read Access Time = 7 cycles */
1319#define B3RAT_8 0x08000000 /* B3 Read Access Time = 8 cycles */
1320#define B3RAT_9 0x09000000 /* B3 Read Access Time = 9 cycles */
1321#define B3RAT_10 0x0A000000 /* B3 Read Access Time = 10 cycles */
1322#define B3RAT_11 0x0B000000 /* B3 Read Access Time = 11 cycles */
1323#define B3RAT_12 0x0C000000 /* B3 Read Access Time = 12 cycles */
1324#define B3RAT_13 0x0D000000 /* B3 Read Access Time = 13 cycles */
1325#define B3RAT_14 0x0E000000 /* B3 Read Access Time = 14 cycles */
1326#define B3RAT_15 0x0F000000 /* B3 Read Access Time = 15 cycles */
1327#define B3WAT_1 0x10000000 /* B3 Write Access Time = 1 cycle */
1328#define B3WAT_2 0x20000000 /* B3 Write Access Time = 2 cycles */
1329#define B3WAT_3 0x30000000 /* B3 Write Access Time = 3 cycles */
1330#define B3WAT_4 0x40000000 /* B3 Write Access Time = 4 cycles */
1331#define B3WAT_5 0x50000000 /* B3 Write Access Time = 5 cycles */
1332#define B3WAT_6 0x60000000 /* B3 Write Access Time = 6 cycles */
1333#define B3WAT_7 0x70000000 /* B3 Write Access Time = 7 cycles */
1334#define B3WAT_8 0x80000000 /* B3 Write Access Time = 8 cycles */
1335#define B3WAT_9 0x90000000 /* B3 Write Access Time = 9 cycles */
1336#define B3WAT_10 0xA0000000 /* B3 Write Access Time = 10 cycles */
1337#define B3WAT_11 0xB0000000 /* B3 Write Access Time = 11 cycles */
1338#define B3WAT_12 0xC0000000 /* B3 Write Access Time = 12 cycles */
1339#define B3WAT_13 0xD0000000 /* B3 Write Access Time = 13 cycles */
1340#define B3WAT_14 0xE0000000 /* B3 Write Access Time = 14 cycles */
1341#define B3WAT_15 0xF0000000 /* B3 Write Access Time = 15 cycles */
1342
1343
1344/* ********************** SDRAM CONTROLLER MASKS **********************************************/
1345/* EBIU_SDGCTL Masks */
1346#define SCTLE 0x00000001 /* Enable SDRAM Signals */
1347#define CL_2 0x00000008 /* SDRAM CAS Latency = 2 cycles */
1348#define CL_3 0x0000000C /* SDRAM CAS Latency = 3 cycles */
1349#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
1350#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
1351#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
1352#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1353#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1354#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1355#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1356#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1357#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1358#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1359#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1360#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1361#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1362#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1363#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1364#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1365#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1366#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1367#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1368#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1369#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1370#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1371#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1372#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1373#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1374#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1375#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1376#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1377#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1378#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1379#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1380#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1381#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1382#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1383#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1384#define PUPSD 0x00200000 /* Power-Up Start Delay (15 SCLK Cycles Delay) */
1385#define PSM 0x00400000 /* Power-Up Sequence (Mode Register Before/After* Refresh) */
1386#define PSS 0x00800000 /* Enable Power-Up Sequence on Next SDRAM Access */
1387#define SRFS 0x01000000 /* Enable SDRAM Self-Refresh Mode */
1388#define EBUFE 0x02000000 /* Enable External Buffering Timing */
1389#define FBBRW 0x04000000 /* Enable Fast Back-To-Back Read To Write */
1390#define EMREN 0x10000000 /* Extended Mode Register Enable */
1391#define TCSR 0x20000000 /* Temp-Compensated Self-Refresh Value (85/45* Deg C) */
1392#define CDDBG 0x40000000 /* Tristate SDRAM Controls During Bus Grant */
1393
1394/* EBIU_SDBCTL Masks */
1395#define EBE 0x0001 /* Enable SDRAM External Bank */
1396#define EBSZ_16 0x0000 /* SDRAM External Bank Size = 16MB */
1397#define EBSZ_32 0x0002 /* SDRAM External Bank Size = 32MB */
1398#define EBSZ_64 0x0004 /* SDRAM External Bank Size = 64MB */
1399#define EBSZ_128 0x0006 /* SDRAM External Bank Size = 128MB */
1400#define EBSZ_256 0x0008 /* SDRAM External Bank Size = 256MB */
1401#define EBSZ_512 0x000A /* SDRAM External Bank Size = 512MB */
1402#define EBCAW_8 0x0000 /* SDRAM External Bank Column Address Width = 8 Bits */
1403#define EBCAW_9 0x0010 /* SDRAM External Bank Column Address Width = 9 Bits */
1404#define EBCAW_10 0x0020 /* SDRAM External Bank Column Address Width = 10 Bits */
1405#define EBCAW_11 0x0030 /* SDRAM External Bank Column Address Width = 11 Bits */
1406
1407/* EBIU_SDSTAT Masks */
1408#define SDCI 0x0001 /* SDRAM Controller Idle */
1409#define SDSRA 0x0002 /* SDRAM Self-Refresh Active */
1410#define SDPUA 0x0004 /* SDRAM Power-Up Active */
1411#define SDRS 0x0008 /* SDRAM Will Power-Up On Next Access */
1412#define SDEASE 0x0010 /* SDRAM EAB Sticky Error Status */
1413#define BGSTAT 0x0020 /* Bus Grant Status */
1414
1415
1416/* ************************** DMA CONTROLLER MASKS ********************************/
1417/* DMAx_CONFIG, MDMA_yy_CONFIG Masks */
1418#define DMAEN 0x0001 /* DMA Channel Enable */
1419#define WNR 0x0002 /* Channel Direction (W/R*) */
1420#define WDSIZE_8 0x0000 /* Transfer Word Size = 8 */
1421#define WDSIZE_16 0x0004 /* Transfer Word Size = 16 */
1422#define WDSIZE_32 0x0008 /* Transfer Word Size = 32 */
1423#define DMA2D 0x0010 /* DMA Mode (2D/1D*) */
1424#define RESTART 0x0020 /* DMA Buffer Clear */
1425#define DI_SEL 0x0040 /* Data Interrupt Timing Select */
1426#define DI_EN 0x0080 /* Data Interrupt Enable */
1427#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1428#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1429#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1430#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1431#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1432#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1433#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1434#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1435#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1436#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1437#define NDSIZE 0x0900 /* Next Descriptor Size */
1438#define DMAFLOW 0x7000 /* Flow Control */
1439#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1440#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1441#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1442#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1443#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1444
1445/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
1446#define CTYPE 0x0040 /* DMA Channel Type Indicator (Memory/Peripheral*) */
1447#define PMAP 0xF000 /* Peripheral Mapped To This Channel */
1448#define PMAP_PPI 0x0000 /* PPI Port DMA */
1449#define PMAP_EMACRX 0x1000 /* Ethernet Receive DMA */
1450#define PMAP_EMACTX 0x2000 /* Ethernet Transmit DMA */
1451#define PMAP_SPORT0RX 0x3000 /* SPORT0 Receive DMA */
1452#define PMAP_SPORT0TX 0x4000 /* SPORT0 Transmit DMA */
1453#define PMAP_SPORT1RX 0x5000 /* SPORT1 Receive DMA */
1454#define PMAP_SPORT1TX 0x6000 /* SPORT1 Transmit DMA */
1455#define PMAP_SPI 0x7000 /* SPI Port DMA */
1456#define PMAP_UART0RX 0x8000 /* UART0 Port Receive DMA */
1457#define PMAP_UART0TX 0x9000 /* UART0 Port Transmit DMA */
1458#define PMAP_UART1RX 0xA000 /* UART1 Port Receive DMA */
1459#define PMAP_UART1TX 0xB000 /* UART1 Port Transmit DMA */
1460
1461/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
1462#define DMA_DONE 0x0001 /* DMA Completion Interrupt Status */
1463#define DMA_ERR 0x0002 /* DMA Error Interrupt Status */
1464#define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */
1465#define DMA_RUN 0x0008 /* DMA Channel Running Indicator */
1466
1467
1468/* ************ PARALLEL PERIPHERAL INTERFACE (PPI) MASKS *************/
1469/* PPI_CONTROL Masks */
1470#define PORT_EN 0x0001 /* PPI Port Enable */
1471#define PORT_DIR 0x0002 /* PPI Port Direction */
1472#define XFR_TYPE 0x000C /* PPI Transfer Type */
1473#define PORT_CFG 0x0030 /* PPI Port Configuration */
1474#define FLD_SEL 0x0040 /* PPI Active Field Select */
1475#define PACK_EN 0x0080 /* PPI Packing Mode */
1476#define DMA32 0x0100 /* PPI 32-bit DMA Enable */
1477#define SKIP_EN 0x0200 /* PPI Skip Element Enable */
1478#define SKIP_EO 0x0400 /* PPI Skip Even/Odd Elements */
1479#define DLEN_8 0x0000 /* Data Length = 8 Bits */
1480#define DLEN_10 0x0800 /* Data Length = 10 Bits */
1481#define DLEN_11 0x1000 /* Data Length = 11 Bits */
1482#define DLEN_12 0x1800 /* Data Length = 12 Bits */
1483#define DLEN_13 0x2000 /* Data Length = 13 Bits */
1484#define DLEN_14 0x2800 /* Data Length = 14 Bits */
1485#define DLEN_15 0x3000 /* Data Length = 15 Bits */
1486#define DLEN_16 0x3800 /* Data Length = 16 Bits */
1487#define DLENGTH 0x3800 /* PPI Data Length */
1488#define POLC 0x4000 /* PPI Clock Polarity */
1489#define POLS 0x8000 /* PPI Frame Sync Polarity */
1490
1491/* PPI_STATUS Masks */
1492#define FLD 0x0400 /* Field Indicator */
1493#define FT_ERR 0x0800 /* Frame Track Error */
1494#define OVR 0x1000 /* FIFO Overflow Error */
1495#define UNDR 0x2000 /* FIFO Underrun Error */
1496#define ERR_DET 0x4000 /* Error Detected Indicator */
1497#define ERR_NCOR 0x8000 /* Error Not Corrected Indicator */
1498
1499
1500/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/
1501/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
1502#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */
1503#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */
1504
1505/* TWI_PRESCALE Masks */
1506#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
1507#define TWI_ENA 0x0080 /* TWI Enable */
1508#define SCCB 0x0200 /* SCCB Compatibility Enable */
1509
1510/* TWI_SLAVE_CTRL Masks */
1511#define SEN 0x0001 /* Slave Enable */
1512#define SADD_LEN 0x0002 /* Slave Address Length */
1513#define STDVAL 0x0004 /* Slave Transmit Data Valid */
1514#define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */
1515#define GEN 0x0010 /* General Call Adrress Matching Enabled */
1516
1517/* TWI_SLAVE_STAT Masks */
1518#define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */
1519#define GCALL 0x0002 /* General Call Indicator */
1520
1521/* TWI_MASTER_CTRL Masks */
1522#define MEN 0x0001 /* Master Mode Enable */
1523#define MADD_LEN 0x0002 /* Master Address Length */
1524#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
1525#define FAST 0x0008 /* Use Fast Mode Timing Specs */
1526#define STOP 0x0010 /* Issue Stop Condition */
1527#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
1528#define DCNT 0x3FC0 /* Data Bytes To Transfer */
1529#define SDAOVR 0x4000 /* Serial Data Override */
1530#define SCLOVR 0x8000 /* Serial Clock Override */
1531
1532/* TWI_MASTER_STAT Masks */
1533#define MPROG 0x0001 /* Master Transfer In Progress */
1534#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
1535#define ANAK 0x0004 /* Address Not Acknowledged */
1536#define DNAK 0x0008 /* Data Not Acknowledged */
1537#define BUFRDERR 0x0010 /* Buffer Read Error */
1538#define BUFWRERR 0x0020 /* Buffer Write Error */
1539#define SDASEN 0x0040 /* Serial Data Sense */
1540#define SCLSEN 0x0080 /* Serial Clock Sense */
1541#define BUSBUSY 0x0100 /* Bus Busy Indicator */
1542
1543/* TWI_INT_SRC and TWI_INT_ENABLE Masks */
1544#define SINIT 0x0001 /* Slave Transfer Initiated */
1545#define SCOMP 0x0002 /* Slave Transfer Complete */
1546#define SERR 0x0004 /* Slave Transfer Error */
1547#define SOVF 0x0008 /* Slave Overflow */
1548#define MCOMP 0x0010 /* Master Transfer Complete */
1549#define MERR 0x0020 /* Master Transfer Error */
1550#define XMTSERV 0x0040 /* Transmit FIFO Service */
1551#define RCVSERV 0x0080 /* Receive FIFO Service */
1552
1553/* TWI_FIFO_CTRL Masks */
1554#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
1555#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
1556#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
1557#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
1558
1559/* TWI_FIFO_STAT Masks */
1560#define XMTSTAT 0x0003 /* Transmit FIFO Status */
1561#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
1562#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
1563#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
1564
1565#define RCVSTAT 0x000C /* Receive FIFO Status */
1566#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */
1567#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */
1568#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */
1569
1570
1571/* Omit CAN masks from defBF534.h */
1572
1573/* ******************* PIN CONTROL REGISTER MASKS ************************/
1574/* PORT_MUX Masks */
1575#define PJSE 0x0001 /* Port J SPI/SPORT Enable */
1576#define PJSE_SPORT 0x0000 /* Enable TFS0/DT0PRI */
1577#define PJSE_SPI 0x0001 /* Enable SPI_SSEL3:2 */
1578
1579#define PJCE(x) (((x)&0x3)<<1) /* Port J CAN/SPI/SPORT Enable */
1580#define PJCE_SPORT 0x0000 /* Enable DR0SEC/DT0SEC */
1581#define PJCE_CAN 0x0002 /* Enable CAN RX/TX */
1582#define PJCE_SPI 0x0004 /* Enable SPI_SSEL7 */
1583
1584#define PFDE 0x0008 /* Port F DMA Request Enable */
1585#define PFDE_UART 0x0000 /* Enable UART0 RX/TX */
1586#define PFDE_DMA 0x0008 /* Enable DMAR1:0 */
1587
1588#define PFTE 0x0010 /* Port F Timer Enable */
1589#define PFTE_UART 0x0000 /* Enable UART1 RX/TX */
1590#define PFTE_TIMER 0x0010 /* Enable TMR7:6 */
1591
1592#define PFS6E 0x0020 /* Port F SPI SSEL 6 Enable */
1593#define PFS6E_TIMER 0x0000 /* Enable TMR5 */
1594#define PFS6E_SPI 0x0020 /* Enable SPI_SSEL6 */
1595
1596#define PFS5E 0x0040 /* Port F SPI SSEL 5 Enable */
1597#define PFS5E_TIMER 0x0000 /* Enable TMR4 */
1598#define PFS5E_SPI 0x0040 /* Enable SPI_SSEL5 */
1599
1600#define PFS4E 0x0080 /* Port F SPI SSEL 4 Enable */
1601#define PFS4E_TIMER 0x0000 /* Enable TMR3 */
1602#define PFS4E_SPI 0x0080 /* Enable SPI_SSEL4 */
1603
1604#define PFFE 0x0100 /* Port F PPI Frame Sync Enable */
1605#define PFFE_TIMER 0x0000 /* Enable TMR2 */
1606#define PFFE_PPI 0x0100 /* Enable PPI FS3 */
1607
1608#define PGSE 0x0200 /* Port G SPORT1 Secondary Enable */
1609#define PGSE_PPI 0x0000 /* Enable PPI D9:8 */
1610#define PGSE_SPORT 0x0200 /* Enable DR1SEC/DT1SEC */
1611
1612#define PGRE 0x0400 /* Port G SPORT1 Receive Enable */
1613#define PGRE_PPI 0x0000 /* Enable PPI D12:10 */
1614#define PGRE_SPORT 0x0400 /* Enable DR1PRI/RFS1/RSCLK1 */
1615
1616#define PGTE 0x0800 /* Port G SPORT1 Transmit Enable */
1617#define PGTE_PPI 0x0000 /* Enable PPI D15:13 */
1618#define PGTE_SPORT 0x0800 /* Enable DT1PRI/TFS1/TSCLK1 */
1619
1620
1621/* ****************** HANDSHAKE DMA (HDMA) MASKS *********************/
1622/* HDMAx_CTL Masks */
1623#define HMDMAEN 0x0001 /* Enable Handshake DMA 0/1 */
1624#define REP 0x0002 /* HDMA Request Polarity */
1625#define UTE 0x0004 /* Urgency Threshold Enable */
1626#define OIE 0x0010 /* Overflow Interrupt Enable */
1627#define BDIE 0x0020 /* Block Done Interrupt Enable */
1628#define MBDI 0x0040 /* Mask Block Done IRQ If Pending ECNT */
1629#define DRQ 0x0300 /* HDMA Request Type */
1630#define DRQ_NONE 0x0000 /* No Request */
1631#define DRQ_SINGLE 0x0100 /* Channels Request Single */
1632#define DRQ_MULTI 0x0200 /* Channels Request Multi (Default) */
1633#define DRQ_URGENT 0x0300 /* Channels Request Multi Urgent */
1634#define RBC 0x1000 /* Reload BCNT With IBCNT */
1635#define PS 0x2000 /* HDMA Pin Status */
1636#define OI 0x4000 /* Overflow Interrupt Generated */
1637#define BDI 0x8000 /* Block Done Interrupt Generated */
1638
1639/* entry addresses of the user-callable Boot ROM functions */
1640
1641#define _BOOTROM_RESET 0xEF000000
1642#define _BOOTROM_FINAL_INIT 0xEF000002
1643#define _BOOTROM_DO_MEMORY_DMA 0xEF000006
1644#define _BOOTROM_BOOT_DXE_FLASH 0xEF000008
1645#define _BOOTROM_BOOT_DXE_SPI 0xEF00000A
1646#define _BOOTROM_BOOT_DXE_TWI 0xEF00000C
1647#define _BOOTROM_GET_DXE_ADDRESS_FLASH 0xEF000010
1648#define _BOOTROM_GET_DXE_ADDRESS_SPI 0xEF000012
1649#define _BOOTROM_GET_DXE_ADDRESS_TWI 0xEF000014
1650
1651/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
1652#define PGDE_UART PFDE_UART
1653#define PGDE_DMA PFDE_DMA
1654#define CKELOW SCKELOW
1655
1656/* ==== end from defBF534.h ==== */
1657
1658/* HOST Port Registers */
1659
1660#define HOST_CONTROL 0xffc03400 /* HOST Control Register */
1661#define HOST_STATUS 0xffc03404 /* HOST Status Register */
1662#define HOST_TIMEOUT 0xffc03408 /* HOST Acknowledge Mode Timeout Register */
1663
1664/* Counter Registers */
1665
1666#define CNT_CONFIG 0xffc03500 /* Configuration Register */
1667#define CNT_IMASK 0xffc03504 /* Interrupt Mask Register */
1668#define CNT_STATUS 0xffc03508 /* Status Register */
1669#define CNT_COMMAND 0xffc0350c /* Command Register */
1670#define CNT_DEBOUNCE 0xffc03510 /* Debounce Register */
1671#define CNT_COUNTER 0xffc03514 /* Counter Register */
1672#define CNT_MAX 0xffc03518 /* Maximal Count Register */
1673#define CNT_MIN 0xffc0351c /* Minimal Count Register */
1674
1675/* OTP/FUSE Registers */
1676
1677#define OTP_CONTROL 0xffc03600 /* OTP/Fuse Control Register */
1678#define OTP_BEN 0xffc03604 /* OTP/Fuse Byte Enable */
1679#define OTP_STATUS 0xffc03608 /* OTP/Fuse Status */
1680#define OTP_TIMING 0xffc0360c /* OTP/Fuse Access Timing */
1681
1682/* Security Registers */
1683
1684#define SECURE_SYSSWT 0xffc03620 /* Secure System Switches */
1685#define SECURE_CONTROL 0xffc03624 /* Secure Control */
1686#define SECURE_STATUS 0xffc03628 /* Secure Status */
1687
1688/* OTP Read/Write Data Buffer Registers */
1689
1690#define OTP_DATA0 0xffc03680 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1691#define OTP_DATA1 0xffc03684 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1692#define OTP_DATA2 0xffc03688 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1693#define OTP_DATA3 0xffc0368c /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1694
1695/* NFC Registers */
1696
1697#define NFC_CTL 0xffc03700 /* NAND Control Register */
1698#define NFC_STAT 0xffc03704 /* NAND Status Register */
1699#define NFC_IRQSTAT 0xffc03708 /* NAND Interrupt Status Register */
1700#define NFC_IRQMASK 0xffc0370c /* NAND Interrupt Mask Register */
1701#define NFC_ECC0 0xffc03710 /* NAND ECC Register 0 */
1702#define NFC_ECC1 0xffc03714 /* NAND ECC Register 1 */
1703#define NFC_ECC2 0xffc03718 /* NAND ECC Register 2 */
1704#define NFC_ECC3 0xffc0371c /* NAND ECC Register 3 */
1705#define NFC_COUNT 0xffc03720 /* NAND ECC Count Register */
1706#define NFC_RST 0xffc03724 /* NAND ECC Reset Register */
1707#define NFC_PGCTL 0xffc03728 /* NAND Page Control Register */
1708#define NFC_READ 0xffc0372c /* NAND Read Data Register */
1709#define NFC_ADDR 0xffc03740 /* NAND Address Register */
1710#define NFC_CMD 0xffc03744 /* NAND Command Register */
1711#define NFC_DATA_WR 0xffc03748 /* NAND Data Write Register */
1712#define NFC_DATA_RD 0xffc0374c /* NAND Data Read Register */
1713
1714/* ********************************************************** */
1715/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
1716/* and MULTI BIT READ MACROS */
1717/* ********************************************************** */
1718
1719/* Bit masks for HOST_CONTROL */
1720
1721#define HOST_CNTR_HOST_EN 0x1 /* Host Enable */
1722#define HOST_CNTR_nHOST_EN 0x0
1723#define HOST_CNTR_HOST_END 0x2 /* Host Endianess */
1724#define HOST_CNTR_nHOST_END 0x0
1725#define HOST_CNTR_DATA_SIZE 0x4 /* Data Size */
1726#define HOST_CNTR_nDATA_SIZE 0x0
1727#define HOST_CNTR_HOST_RST 0x8 /* Host Reset */
1728#define HOST_CNTR_nHOST_RST 0x0
1729#define HOST_CNTR_HRDY_OVR 0x20 /* Host Ready Override */
1730#define HOST_CNTR_nHRDY_OVR 0x0
1731#define HOST_CNTR_INT_MODE 0x40 /* Interrupt Mode */
1732#define HOST_CNTR_nINT_MODE 0x0
1733#define HOST_CNTR_BT_EN 0x80 /* Bus Timeout Enable */
1734#define HOST_CNTR_ nBT_EN 0x0
1735#define HOST_CNTR_EHW 0x100 /* Enable Host Write */
1736#define HOST_CNTR_nEHW 0x0
1737#define HOST_CNTR_EHR 0x200 /* Enable Host Read */
1738#define HOST_CNTR_nEHR 0x0
1739#define HOST_CNTR_BDR 0x400 /* Burst DMA Requests */
1740#define HOST_CNTR_nBDR 0x0
1741
1742/* Bit masks for HOST_STATUS */
1743
1744#define HOST_STAT_READY 0x1 /* DMA Ready */
1745#define HOST_STAT_nREADY 0x0
1746#define HOST_STAT_FIFOFULL 0x2 /* FIFO Full */
1747#define HOST_STAT_nFIFOFULL 0x0
1748#define HOST_STAT_FIFOEMPTY 0x4 /* FIFO Empty */
1749#define HOST_STAT_nFIFOEMPTY 0x0
1750#define HOST_STAT_COMPLETE 0x8 /* DMA Complete */
1751#define HOST_STAT_nCOMPLETE 0x0
1752#define HOST_STAT_HSHK 0x10 /* Host Handshake */
1753#define HOST_STAT_nHSHK 0x0
1754#define HOST_STAT_TIMEOUT 0x20 /* Host Timeout */
1755#define HOST_STAT_nTIMEOUT 0x0
1756#define HOST_STAT_HIRQ 0x40 /* Host Interrupt Request */
1757#define HOST_STAT_nHIRQ 0x0
1758#define HOST_STAT_ALLOW_CNFG 0x80 /* Allow New Configuration */
1759#define HOST_STAT_nALLOW_CNFG 0x0
1760#define HOST_STAT_DMA_DIR 0x100 /* DMA Direction */
1761#define HOST_STAT_nDMA_DIR 0x0
1762#define HOST_STAT_BTE 0x200 /* Bus Timeout Enabled */
1763#define HOST_STAT_nBTE 0x0
1764#define HOST_STAT_HOSTRD_DONE 0x8000 /* Host Read Completion Interrupt */
1765#define HOST_STAT_nHOSTRD_DONE 0x0
1766
1767/* Bit masks for HOST_TIMEOUT */
1768
1769#define HOST_COUNT_TIMEOUT 0x7ff /* Host Timeout count */
1770
1771/* Bit masks for CNT_CONFIG */
1772
1773#define CNTE 0x1 /* Counter Enable */
1774#define nCNTE 0x0
1775#define DEBE 0x2 /* Debounce Enable */
1776#define nDEBE 0x0
1777#define CDGINV 0x10 /* CDG Pin Polarity Invert */
1778#define nCDGINV 0x0
1779#define CUDINV 0x20 /* CUD Pin Polarity Invert */
1780#define nCUDINV 0x0
1781#define CZMINV 0x40 /* CZM Pin Polarity Invert */
1782#define nCZMINV 0x0
1783#define CNTMODE 0x700 /* Counter Operating Mode */
1784#define ZMZC 0x800 /* CZM Zeroes Counter Enable */
1785#define nZMZC 0x0
1786#define BNDMODE 0x3000 /* Boundary register Mode */
1787#define INPDIS 0x8000 /* CUG and CDG Input Disable */
1788#define nINPDIS 0x0
1789
1790/* Bit masks for CNT_IMASK */
1791
1792#define ICIE 0x1 /* Illegal Gray/Binary Code Interrupt Enable */
1793#define nICIE 0x0
1794#define UCIE 0x2 /* Up count Interrupt Enable */
1795#define nUCIE 0x0
1796#define DCIE 0x4 /* Down count Interrupt Enable */
1797#define nDCIE 0x0
1798#define MINCIE 0x8 /* Min Count Interrupt Enable */
1799#define nMINCIE 0x0
1800#define MAXCIE 0x10 /* Max Count Interrupt Enable */
1801#define nMAXCIE 0x0
1802#define COV31IE 0x20 /* Bit 31 Overflow Interrupt Enable */
1803#define nCOV31IE 0x0
1804#define COV15IE 0x40 /* Bit 15 Overflow Interrupt Enable */
1805#define nCOV15IE 0x0
1806#define CZEROIE 0x80 /* Count to Zero Interrupt Enable */
1807#define nCZEROIE 0x0
1808#define CZMIE 0x100 /* CZM Pin Interrupt Enable */
1809#define nCZMIE 0x0
1810#define CZMEIE 0x200 /* CZM Error Interrupt Enable */
1811#define nCZMEIE 0x0
1812#define CZMZIE 0x400 /* CZM Zeroes Counter Interrupt Enable */
1813#define nCZMZIE 0x0
1814
1815/* Bit masks for CNT_STATUS */
1816
1817#define ICII 0x1 /* Illegal Gray/Binary Code Interrupt Identifier */
1818#define nICII 0x0
1819#define UCII 0x2 /* Up count Interrupt Identifier */
1820#define nUCII 0x0
1821#define DCII 0x4 /* Down count Interrupt Identifier */
1822#define nDCII 0x0
1823#define MINCII 0x8 /* Min Count Interrupt Identifier */
1824#define nMINCII 0x0
1825#define MAXCII 0x10 /* Max Count Interrupt Identifier */
1826#define nMAXCII 0x0
1827#define COV31II 0x20 /* Bit 31 Overflow Interrupt Identifier */
1828#define nCOV31II 0x0
1829#define COV15II 0x40 /* Bit 15 Overflow Interrupt Identifier */
1830#define nCOV15II 0x0
1831#define CZEROII 0x80 /* Count to Zero Interrupt Identifier */
1832#define nCZEROII 0x0
1833#define CZMII 0x100 /* CZM Pin Interrupt Identifier */
1834#define nCZMII 0x0
1835#define CZMEII 0x200 /* CZM Error Interrupt Identifier */
1836#define nCZMEII 0x0
1837#define CZMZII 0x400 /* CZM Zeroes Counter Interrupt Identifier */
1838#define nCZMZII 0x0
1839
1840/* Bit masks for CNT_COMMAND */
1841
1842#define W1LCNT 0xf /* Load Counter Register */
1843#define W1LMIN 0xf0 /* Load Min Register */
1844#define W1LMAX 0xf00 /* Load Max Register */
1845#define W1ZMONCE 0x1000 /* Enable CZM Clear Counter Once */
1846#define nW1ZMONCE 0x0
1847
1848/* Bit masks for CNT_DEBOUNCE */
1849
1850#define DPRESCALE 0xf /* Load Counter Register */
1851
1852/* Bit masks for OTP_CONTROL */
1853
1854#define FUSE_FADDR 0x1ff /* OTP/Fuse Address */
1855#define FIEN 0x800 /* OTP/Fuse Interrupt Enable */
1856#define nFIEN 0x0
1857#define FTESTDEC 0x1000 /* OTP/Fuse Test Decoder */
1858#define nFTESTDEC 0x0
1859#define FWRTEST 0x2000 /* OTP/Fuse Write Test */
1860#define nFWRTEST 0x0
1861#define FRDEN 0x4000 /* OTP/Fuse Read Enable */
1862#define nFRDEN 0x0
1863#define FWREN 0x8000 /* OTP/Fuse Write Enable */
1864#define nFWREN 0x0
1865
1866/* Bit masks for OTP_BEN */
1867
1868#define FBEN 0xffff /* OTP/Fuse Byte Enable */
1869
1870/* Bit masks for OTP_STATUS */
1871
1872#define FCOMP 0x1 /* OTP/Fuse Access Complete */
1873#define nFCOMP 0x0
1874#define FERROR 0x2 /* OTP/Fuse Access Error */
1875#define nFERROR 0x0
1876#define MMRGLOAD 0x10 /* Memory Mapped Register Gasket Load */
1877#define nMMRGLOAD 0x0
1878#define MMRGLOCK 0x20 /* Memory Mapped Register Gasket Lock */
1879#define nMMRGLOCK 0x0
1880#define FPGMEN 0x40 /* OTP/Fuse Program Enable */
1881#define nFPGMEN 0x0
1882
1883/* Bit masks for OTP_TIMING */
1884
1885#define USECDIV 0xff /* Micro Second Divider */
1886#define READACC 0x7f00 /* Read Access Time */
1887#define CPUMPRL 0x38000 /* Charge Pump Release Time */
1888#define CPUMPSU 0xc0000 /* Charge Pump Setup Time */
1889#define CPUMPHD 0xf00000 /* Charge Pump Hold Time */
1890#define PGMTIME 0xff000000 /* Program Time */
1891
1892/* Bit masks for SECURE_SYSSWT */
1893
1894#define EMUDABL 0x1 /* Emulation Disable. */
1895#define nEMUDABL 0x0
1896#define RSTDABL 0x2 /* Reset Disable */
1897#define nRSTDABL 0x0
1898#define L1IDABL 0x1c /* L1 Instruction Memory Disable. */
1899#define L1DADABL 0xe0 /* L1 Data Bank A Memory Disable. */
1900#define L1DBDABL 0x700 /* L1 Data Bank B Memory Disable. */
1901#define DMA0OVR 0x800 /* DMA0 Memory Access Override */
1902#define nDMA0OVR 0x0
1903#define DMA1OVR 0x1000 /* DMA1 Memory Access Override */
1904#define nDMA1OVR 0x0
1905#define EMUOVR 0x4000 /* Emulation Override */
1906#define nEMUOVR 0x0
1907#define OTPSEN 0x8000 /* OTP Secrets Enable. */
1908#define nOTPSEN 0x0
1909#define L2DABL 0x70000 /* L2 Memory Disable. */
1910
1911/* Bit masks for SECURE_CONTROL */
1912
1913#define SECURE0 0x1 /* SECURE 0 */
1914#define nSECURE0 0x0
1915#define SECURE1 0x2 /* SECURE 1 */
1916#define nSECURE1 0x0
1917#define SECURE2 0x4 /* SECURE 2 */
1918#define nSECURE2 0x0
1919#define SECURE3 0x8 /* SECURE 3 */
1920#define nSECURE3 0x0
1921
1922/* Bit masks for SECURE_STATUS */
1923
1924#define SECMODE 0x3 /* Secured Mode Control State */
1925#define NMI 0x4 /* Non Maskable Interrupt */
1926#define nNMI 0x0
1927#define AFVALID 0x8 /* Authentication Firmware Valid */
1928#define nAFVALID 0x0
1929#define AFEXIT 0x10 /* Authentication Firmware Exit */
1930#define nAFEXIT 0x0
1931#define SECSTAT 0xe0 /* Secure Status */
1932
1933/* Bit masks for NFC_CTL */
1934
1935#define WR_DLY 0xf /* Write Strobe Delay */
1936#define RD_DLY 0xf0 /* Read Strobe Delay */
1937#define NWIDTH 0x100 /* NAND Data Width */
1938#define nNWIDTH 0x0
1939#define PG_SIZE 0x200 /* Page Size */
1940#define nPG_SIZE 0x0
1941
1942/* Bit masks for NFC_STAT */
1943
1944#define NBUSY 0x1 /* Not Busy */
1945#define nNBUSY 0x0
1946#define WB_FULL 0x2 /* Write Buffer Full */
1947#define nWB_FULL 0x0
1948#define PG_WR_STAT 0x4 /* Page Write Pending */
1949#define nPG_WR_STAT 0x0
1950#define PG_RD_STAT 0x8 /* Page Read Pending */
1951#define nPG_RD_STAT 0x0
1952#define WB_EMPTY 0x10 /* Write Buffer Empty */
1953#define nWB_EMPTY 0x0
1954
1955/* Bit masks for NFC_IRQSTAT */
1956
1957#define NBUSYIRQ 0x1 /* Not Busy IRQ */
1958#define nNBUSYIRQ 0x0
1959#define WB_OVF 0x2 /* Write Buffer Overflow */
1960#define nWB_OVF 0x0
1961#define WB_EDGE 0x4 /* Write Buffer Edge Detect */
1962#define nWB_EDGE 0x0
1963#define RD_RDY 0x8 /* Read Data Ready */
1964#define nRD_RDY 0x0
1965#define WR_DONE 0x10 /* Page Write Done */
1966#define nWR_DONE 0x0
1967
1968/* Bit masks for NFC_IRQMASK */
1969
1970#define MASK_BUSYIRQ 0x1 /* Mask Not Busy IRQ */
1971#define nMASK_BUSYIRQ 0x0
1972#define MASK_WBOVF 0x2 /* Mask Write Buffer Overflow */
1973#define nMASK_WBOVF 0x0
1974#define MASK_WBEMPTY 0x4 /* Mask Write Buffer Empty */
1975#define nMASK_WBEMPTY 0x0
1976#define MASK_RDRDY 0x8 /* Mask Read Data Ready */
1977#define nMASK_RDRDY 0x0
1978#define MASK_WRDONE 0x10 /* Mask Write Done */
1979#define nMASK_WRDONE 0x0
1980
1981/* Bit masks for NFC_RST */
1982
1983#define ECC_RST 0x1 /* ECC (and NFC counters) Reset */
1984#define nECC_RST 0x0
1985
1986/* Bit masks for NFC_PGCTL */
1987
1988#define PG_RD_START 0x1 /* Page Read Start */
1989#define nPG_RD_START 0x0
1990#define PG_WR_START 0x2 /* Page Write Start */
1991#define nPG_WR_START 0x0
1992
1993/* Bit masks for NFC_ECC0 */
1994
1995#define ECC0 0x7ff /* Parity Calculation Result0 */
1996
1997/* Bit masks for NFC_ECC1 */
1998
1999#define ECC1 0x7ff /* Parity Calculation Result1 */
2000
2001/* Bit masks for NFC_ECC2 */
2002
2003#define ECC2 0x7ff /* Parity Calculation Result2 */
2004
2005/* Bit masks for NFC_ECC3 */
2006
2007#define ECC3 0x7ff /* Parity Calculation Result3 */
2008
2009/* Bit masks for NFC_COUNT */
2010
2011#define ECCCNT 0x3ff /* Transfer Count */
2012
2013
2014#endif /* _DEF_BF52X_H */
diff --git a/include/asm-blackfin/mach-bf527/dma.h b/include/asm-blackfin/mach-bf527/dma.h
deleted file mode 100644
index 49dd693223e8..000000000000
--- a/include/asm-blackfin/mach-bf527/dma.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf527/dma.h
3 * based on: include/asm-blackfin/mach-bf537/dma.h
4 * author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * created:
7 * description:
8 * system DMA 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 /* PPI receive/transmit or NFC */
38#define CH_EMAC_RX 1 /* Ethernet MAC receive or HOSTDP */
39#define CH_EMAC_HOSTDP 1 /* Ethernet MAC receive or HOSTDP */
40#define CH_EMAC_TX 2 /* Ethernet MAC transmit or NFC */
41#define CH_SPORT0_RX 3 /* SPORT0 receive */
42#define CH_SPORT0_TX 4 /* SPORT0 transmit */
43#define CH_SPORT1_RX 5 /* SPORT1 receive */
44#define CH_SPORT1_TX 6 /* SPORT1 transmit */
45#define CH_SPI 7 /* SPI transmit/receive */
46#define CH_UART0_RX 8 /* UART0 receive */
47#define CH_UART0_TX 9 /* UART0 transmit */
48#define CH_UART1_RX 10 /* UART1 receive */
49#define CH_UART1_TX 11 /* UART1 transmit */
50
51#define CH_MEM_STREAM0_DEST 12 /* TX */
52#define CH_MEM_STREAM0_SRC 13 /* RX */
53#define CH_MEM_STREAM1_DEST 14 /* TX */
54#define CH_MEM_STREAM1_SRC 15 /* RX */
55
56#if defined(CONFIG_BF527_NAND_D_PORTF)
57#define CH_NFC CH_PPI /* PPI receive/transmit or NFC */
58#elif defined(CONFIG_BF527_NAND_D_PORTH)
59#define CH_NFC CH_EMAC_TX /* PPI receive/transmit or NFC */
60#endif
61
62#endif
diff --git a/include/asm-blackfin/mach-bf527/irq.h b/include/asm-blackfin/mach-bf527/irq.h
deleted file mode 100644
index 4e2b3f2020e5..000000000000
--- a/include/asm-blackfin/mach-bf527/irq.h
+++ /dev/null
@@ -1,259 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf527/irq.h
3 * based on: include/asm-blackfin/mach-bf537/irq.h
4 * author: Michael Hennerich (michael.hennerich@analog.com)
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 _BF527_IRQ_H_
33#define _BF527_IRQ_H_
34
35/*
36 * Interrupt source definitions
37 Event Source Core Event Name
38 Core 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 NR_PERI_INTS (2 * 32)
55
56/* The ABSTRACT IRQ definitions */
57/** the first seven of the following are fixed, the rest you change if you need to **/
58#define IRQ_EMU 0 /* Emulation */
59#define IRQ_RST 1 /* reset */
60#define IRQ_NMI 2 /* Non Maskable */
61#define IRQ_EVX 3 /* Exception */
62#define IRQ_UNUSED 4 /* - unused interrupt */
63#define IRQ_HWERR 5 /* Hardware Error */
64#define IRQ_CORETMR 6 /* Core timer */
65
66#define BFIN_IRQ(x) ((x) + 7)
67
68#define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */
69#define IRQ_DMA0_ERROR BFIN_IRQ(1) /* DMA Error 0 (generic) */
70#define IRQ_DMAR0_BLK BFIN_IRQ(2) /* DMAR0 Block Interrupt */
71#define IRQ_DMAR1_BLK BFIN_IRQ(3) /* DMAR1 Block Interrupt */
72#define IRQ_DMAR0_OVR BFIN_IRQ(4) /* DMAR0 Overflow Error */
73#define IRQ_DMAR1_OVR BFIN_IRQ(5) /* DMAR1 Overflow Error */
74#define IRQ_PPI_ERROR BFIN_IRQ(6) /* PPI Error */
75#define IRQ_MAC_ERROR BFIN_IRQ(7) /* MAC Status */
76#define IRQ_SPORT0_ERROR BFIN_IRQ(8) /* SPORT0 Status */
77#define IRQ_SPORT1_ERROR BFIN_IRQ(9) /* SPORT1 Status */
78#define IRQ_UART0_ERROR BFIN_IRQ(12) /* UART0 Status */
79#define IRQ_UART1_ERROR BFIN_IRQ(13) /* UART1 Status */
80#define IRQ_RTC BFIN_IRQ(14) /* RTC */
81#define IRQ_PPI BFIN_IRQ(15) /* DMA Channel 0 (PPI/NAND) */
82#define IRQ_SPORT0_RX BFIN_IRQ(16) /* DMA 3 Channel (SPORT0 RX) */
83#define IRQ_SPORT0_TX BFIN_IRQ(17) /* DMA 4 Channel (SPORT0 TX) */
84#define IRQ_SPORT1_RX BFIN_IRQ(18) /* DMA 5 Channel (SPORT1 RX) */
85#define IRQ_SPORT1_TX BFIN_IRQ(19) /* DMA 6 Channel (SPORT1 TX) */
86#define IRQ_TWI BFIN_IRQ(20) /* TWI */
87#define IRQ_SPI BFIN_IRQ(21) /* DMA 7 Channel (SPI) */
88#define IRQ_UART0_RX BFIN_IRQ(22) /* DMA8 Channel (UART0 RX) */
89#define IRQ_UART0_TX BFIN_IRQ(23) /* DMA9 Channel (UART0 TX) */
90#define IRQ_UART1_RX BFIN_IRQ(24) /* DMA10 Channel (UART1 RX) */
91#define IRQ_UART1_TX BFIN_IRQ(25) /* DMA11 Channel (UART1 TX) */
92#define IRQ_OPTSEC BFIN_IRQ(26) /* OTPSEC Interrupt */
93#define IRQ_CNT BFIN_IRQ(27) /* GP Counter */
94#define IRQ_MAC_RX BFIN_IRQ(28) /* DMA1 Channel (MAC RX/HDMA) */
95#define IRQ_PORTH_INTA BFIN_IRQ(29) /* Port H Interrupt A */
96#define IRQ_MAC_TX BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */
97#define IRQ_NFC BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */
98#define IRQ_PORTH_INTB BFIN_IRQ(31) /* Port H Interrupt B */
99#define IRQ_TMR0 BFIN_IRQ(32) /* Timer 0 */
100#define IRQ_TMR1 BFIN_IRQ(33) /* Timer 1 */
101#define IRQ_TMR2 BFIN_IRQ(34) /* Timer 2 */
102#define IRQ_TMR3 BFIN_IRQ(35) /* Timer 3 */
103#define IRQ_TMR4 BFIN_IRQ(36) /* Timer 4 */
104#define IRQ_TMR5 BFIN_IRQ(37) /* Timer 5 */
105#define IRQ_TMR6 BFIN_IRQ(38) /* Timer 6 */
106#define IRQ_TMR7 BFIN_IRQ(39) /* Timer 7 */
107#define IRQ_PORTG_INTA BFIN_IRQ(40) /* Port G Interrupt A */
108#define IRQ_PORTG_INTB BFIN_IRQ(41) /* Port G Interrupt B */
109#define IRQ_MEM_DMA0 BFIN_IRQ(42) /* MDMA Stream 0 */
110#define IRQ_MEM_DMA1 BFIN_IRQ(43) /* MDMA Stream 1 */
111#define IRQ_WATCH BFIN_IRQ(44) /* Software Watchdog Timer */
112#define IRQ_PORTF_INTA BFIN_IRQ(45) /* Port F Interrupt A */
113#define IRQ_PORTF_INTB BFIN_IRQ(46) /* Port F Interrupt B */
114#define IRQ_SPI_ERROR BFIN_IRQ(47) /* SPI Status */
115#define IRQ_NFC_ERROR BFIN_IRQ(48) /* NAND Error */
116#define IRQ_HDMA_ERROR BFIN_IRQ(49) /* HDMA Error */
117#define IRQ_HDMA BFIN_IRQ(50) /* HDMA (TFI) */
118#define IRQ_USB_EINT BFIN_IRQ(51) /* USB_EINT Interrupt */
119#define IRQ_USB_INT0 BFIN_IRQ(52) /* USB_INT0 Interrupt */
120#define IRQ_USB_INT1 BFIN_IRQ(53) /* USB_INT1 Interrupt */
121#define IRQ_USB_INT2 BFIN_IRQ(54) /* USB_INT2 Interrupt */
122#define IRQ_USB_DMA BFIN_IRQ(55) /* USB_DMAINT Interrupt */
123
124#define SYS_IRQS BFIN_IRQ(63) /* 70 */
125
126#define IRQ_PF0 71
127#define IRQ_PF1 72
128#define IRQ_PF2 73
129#define IRQ_PF3 74
130#define IRQ_PF4 75
131#define IRQ_PF5 76
132#define IRQ_PF6 77
133#define IRQ_PF7 78
134#define IRQ_PF8 79
135#define IRQ_PF9 80
136#define IRQ_PF10 81
137#define IRQ_PF11 82
138#define IRQ_PF12 83
139#define IRQ_PF13 84
140#define IRQ_PF14 85
141#define IRQ_PF15 86
142
143#define IRQ_PG0 87
144#define IRQ_PG1 88
145#define IRQ_PG2 89
146#define IRQ_PG3 90
147#define IRQ_PG4 91
148#define IRQ_PG5 92
149#define IRQ_PG6 93
150#define IRQ_PG7 94
151#define IRQ_PG8 95
152#define IRQ_PG9 96
153#define IRQ_PG10 97
154#define IRQ_PG11 98
155#define IRQ_PG12 99
156#define IRQ_PG13 100
157#define IRQ_PG14 101
158#define IRQ_PG15 102
159
160#define IRQ_PH0 103
161#define IRQ_PH1 104
162#define IRQ_PH2 105
163#define IRQ_PH3 106
164#define IRQ_PH4 107
165#define IRQ_PH5 108
166#define IRQ_PH6 109
167#define IRQ_PH7 110
168#define IRQ_PH8 111
169#define IRQ_PH9 112
170#define IRQ_PH10 113
171#define IRQ_PH11 114
172#define IRQ_PH12 115
173#define IRQ_PH13 116
174#define IRQ_PH14 117
175#define IRQ_PH15 118
176
177#define GPIO_IRQ_BASE IRQ_PF0
178
179#define NR_IRQS (IRQ_PH15+1)
180
181#define IVG7 7
182#define IVG8 8
183#define IVG9 9
184#define IVG10 10
185#define IVG11 11
186#define IVG12 12
187#define IVG13 13
188#define IVG14 14
189#define IVG15 15
190
191/* IAR0 BIT FIELDS */
192#define IRQ_PLL_WAKEUP_POS 0
193#define IRQ_DMA0_ERROR_POS 4
194#define IRQ_DMAR0_BLK_POS 8
195#define IRQ_DMAR1_BLK_POS 12
196#define IRQ_DMAR0_OVR_POS 16
197#define IRQ_DMAR1_OVR_POS 20
198#define IRQ_PPI_ERROR_POS 24
199#define IRQ_MAC_ERROR_POS 28
200
201/* IAR1 BIT FIELDS */
202#define IRQ_SPORT0_ERROR_POS 0
203#define IRQ_SPORT1_ERROR_POS 4
204#define IRQ_UART0_ERROR_POS 16
205#define IRQ_UART1_ERROR_POS 20
206#define IRQ_RTC_POS 24
207#define IRQ_PPI_POS 28
208
209/* IAR2 BIT FIELDS */
210#define IRQ_SPORT0_RX_POS 0
211#define IRQ_SPORT0_TX_POS 4
212#define IRQ_SPORT1_RX_POS 8
213#define IRQ_SPORT1_TX_POS 12
214#define IRQ_TWI_POS 16
215#define IRQ_SPI_POS 20
216#define IRQ_UART0_RX_POS 24
217#define IRQ_UART0_TX_POS 28
218
219/* IAR3 BIT FIELDS */
220#define IRQ_UART1_RX_POS 0
221#define IRQ_UART1_TX_POS 4
222#define IRQ_OPTSEC_POS 8
223#define IRQ_CNT_POS 12
224#define IRQ_MAC_RX_POS 16
225#define IRQ_PORTH_INTA_POS 20
226#define IRQ_MAC_TX_POS 24
227#define IRQ_PORTH_INTB_POS 28
228
229/* IAR4 BIT FIELDS */
230#define IRQ_TMR0_POS 0
231#define IRQ_TMR1_POS 4
232#define IRQ_TMR2_POS 8
233#define IRQ_TMR3_POS 12
234#define IRQ_TMR4_POS 16
235#define IRQ_TMR5_POS 20
236#define IRQ_TMR6_POS 24
237#define IRQ_TMR7_POS 28
238
239/* IAR5 BIT FIELDS */
240#define IRQ_PORTG_INTA_POS 0
241#define IRQ_PORTG_INTB_POS 4
242#define IRQ_MEM_DMA0_POS 8
243#define IRQ_MEM_DMA1_POS 12
244#define IRQ_WATCH_POS 16
245#define IRQ_PORTF_INTA_POS 20
246#define IRQ_PORTF_INTB_POS 24
247#define IRQ_SPI_ERROR_POS 28
248
249/* IAR6 BIT FIELDS */
250#define IRQ_NFC_ERROR_POS 0
251#define IRQ_HDMA_ERROR_POS 4
252#define IRQ_HDMA_POS 8
253#define IRQ_USB_EINT_POS 12
254#define IRQ_USB_INT0_POS 16
255#define IRQ_USB_INT1_POS 20
256#define IRQ_USB_INT2_POS 24
257#define IRQ_USB_DMA_POS 28
258
259#endif /* _BF527_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf527/mem_init.h b/include/asm-blackfin/mach-bf527/mem_init.h
deleted file mode 100644
index cbe03f4a5698..000000000000
--- a/include/asm-blackfin/mach-bf527/mem_init.h
+++ /dev/null
@@ -1,310 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf527/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 * Copyright 2004-2007 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 || CONFIG_MEM_MT48LC32M16A2TG_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_MT48LC32M16A2TG_75)
143 /*SDRAM INFORMATION: */
144#define SDRAM_Tref 64 /* Refresh period in milliseconds */
145#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
146#define SDRAM_CL CL_3
147#endif
148
149/* Equation from section 17 (p17-46) of BF533 HRM */
150#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
151
152/* Enable SCLK Out */
153#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
154
155#if defined CONFIG_CLKIN_HALF
156#define CLKIN_HALF 1
157#else
158#define CLKIN_HALF 0
159#endif
160
161#if defined CONFIG_PLL_BYPASS
162#define PLL_BYPASS 1
163#else
164#define PLL_BYPASS 0
165#endif
166
167/***************************************Currently Not Being Used *********************************/
168#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
169#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
170#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
171#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
172#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
173
174#if (flash_EBIU_AMBCTL_TT > 3)
175#define flash_EBIU_AMBCTL0_TT B0TT_4
176#endif
177#if (flash_EBIU_AMBCTL_TT == 3)
178#define flash_EBIU_AMBCTL0_TT B0TT_3
179#endif
180#if (flash_EBIU_AMBCTL_TT == 2)
181#define flash_EBIU_AMBCTL0_TT B0TT_2
182#endif
183#if (flash_EBIU_AMBCTL_TT < 2)
184#define flash_EBIU_AMBCTL0_TT B0TT_1
185#endif
186
187#if (flash_EBIU_AMBCTL_ST > 3)
188#define flash_EBIU_AMBCTL0_ST B0ST_4
189#endif
190#if (flash_EBIU_AMBCTL_ST == 3)
191#define flash_EBIU_AMBCTL0_ST B0ST_3
192#endif
193#if (flash_EBIU_AMBCTL_ST == 2)
194#define flash_EBIU_AMBCTL0_ST B0ST_2
195#endif
196#if (flash_EBIU_AMBCTL_ST < 2)
197#define flash_EBIU_AMBCTL0_ST B0ST_1
198#endif
199
200#if (flash_EBIU_AMBCTL_HT > 2)
201#define flash_EBIU_AMBCTL0_HT B0HT_3
202#endif
203#if (flash_EBIU_AMBCTL_HT == 2)
204#define flash_EBIU_AMBCTL0_HT B0HT_2
205#endif
206#if (flash_EBIU_AMBCTL_HT == 1)
207#define flash_EBIU_AMBCTL0_HT B0HT_1
208#endif
209#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
210#define flash_EBIU_AMBCTL0_HT B0HT_0
211#endif
212#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
213#define flash_EBIU_AMBCTL0_HT B0HT_1
214#endif
215
216#if (flash_EBIU_AMBCTL_WAT > 14)
217#define flash_EBIU_AMBCTL0_WAT B0WAT_15
218#endif
219#if (flash_EBIU_AMBCTL_WAT == 14)
220#define flash_EBIU_AMBCTL0_WAT B0WAT_14
221#endif
222#if (flash_EBIU_AMBCTL_WAT == 13)
223#define flash_EBIU_AMBCTL0_WAT B0WAT_13
224#endif
225#if (flash_EBIU_AMBCTL_WAT == 12)
226#define flash_EBIU_AMBCTL0_WAT B0WAT_12
227#endif
228#if (flash_EBIU_AMBCTL_WAT == 11)
229#define flash_EBIU_AMBCTL0_WAT B0WAT_11
230#endif
231#if (flash_EBIU_AMBCTL_WAT == 10)
232#define flash_EBIU_AMBCTL0_WAT B0WAT_10
233#endif
234#if (flash_EBIU_AMBCTL_WAT == 9)
235#define flash_EBIU_AMBCTL0_WAT B0WAT_9
236#endif
237#if (flash_EBIU_AMBCTL_WAT == 8)
238#define flash_EBIU_AMBCTL0_WAT B0WAT_8
239#endif
240#if (flash_EBIU_AMBCTL_WAT == 7)
241#define flash_EBIU_AMBCTL0_WAT B0WAT_7
242#endif
243#if (flash_EBIU_AMBCTL_WAT == 6)
244#define flash_EBIU_AMBCTL0_WAT B0WAT_6
245#endif
246#if (flash_EBIU_AMBCTL_WAT == 5)
247#define flash_EBIU_AMBCTL0_WAT B0WAT_5
248#endif
249#if (flash_EBIU_AMBCTL_WAT == 4)
250#define flash_EBIU_AMBCTL0_WAT B0WAT_4
251#endif
252#if (flash_EBIU_AMBCTL_WAT == 3)
253#define flash_EBIU_AMBCTL0_WAT B0WAT_3
254#endif
255#if (flash_EBIU_AMBCTL_WAT == 2)
256#define flash_EBIU_AMBCTL0_WAT B0WAT_2
257#endif
258#if (flash_EBIU_AMBCTL_WAT == 1)
259#define flash_EBIU_AMBCTL0_WAT B0WAT_1
260#endif
261
262#if (flash_EBIU_AMBCTL_RAT > 14)
263#define flash_EBIU_AMBCTL0_RAT B0RAT_15
264#endif
265#if (flash_EBIU_AMBCTL_RAT == 14)
266#define flash_EBIU_AMBCTL0_RAT B0RAT_14
267#endif
268#if (flash_EBIU_AMBCTL_RAT == 13)
269#define flash_EBIU_AMBCTL0_RAT B0RAT_13
270#endif
271#if (flash_EBIU_AMBCTL_RAT == 12)
272#define flash_EBIU_AMBCTL0_RAT B0RAT_12
273#endif
274#if (flash_EBIU_AMBCTL_RAT == 11)
275#define flash_EBIU_AMBCTL0_RAT B0RAT_11
276#endif
277#if (flash_EBIU_AMBCTL_RAT == 10)
278#define flash_EBIU_AMBCTL0_RAT B0RAT_10
279#endif
280#if (flash_EBIU_AMBCTL_RAT == 9)
281#define flash_EBIU_AMBCTL0_RAT B0RAT_9
282#endif
283#if (flash_EBIU_AMBCTL_RAT == 8)
284#define flash_EBIU_AMBCTL0_RAT B0RAT_8
285#endif
286#if (flash_EBIU_AMBCTL_RAT == 7)
287#define flash_EBIU_AMBCTL0_RAT B0RAT_7
288#endif
289#if (flash_EBIU_AMBCTL_RAT == 6)
290#define flash_EBIU_AMBCTL0_RAT B0RAT_6
291#endif
292#if (flash_EBIU_AMBCTL_RAT == 5)
293#define flash_EBIU_AMBCTL0_RAT B0RAT_5
294#endif
295#if (flash_EBIU_AMBCTL_RAT == 4)
296#define flash_EBIU_AMBCTL0_RAT B0RAT_4
297#endif
298#if (flash_EBIU_AMBCTL_RAT == 3)
299#define flash_EBIU_AMBCTL0_RAT B0RAT_3
300#endif
301#if (flash_EBIU_AMBCTL_RAT == 2)
302#define flash_EBIU_AMBCTL0_RAT B0RAT_2
303#endif
304#if (flash_EBIU_AMBCTL_RAT == 1)
305#define flash_EBIU_AMBCTL0_RAT B0RAT_1
306#endif
307
308#define flash_EBIU_AMBCTL0 \
309 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
310 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/include/asm-blackfin/mach-bf527/mem_map.h b/include/asm-blackfin/mach-bf527/mem_map.h
deleted file mode 100644
index ef46dc991cd4..000000000000
--- a/include/asm-blackfin/mach-bf527/mem_map.h
+++ /dev/null
@@ -1,102 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf527/mem_map.h
3 * based on: include/asm-blackfin/mach-bf537/mem_map.h
4 * author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * created:
7 * description:
8 * Memory MAP Common header file for blackfin BF527/5/2 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_527_H_
32#define _MEM_MAP_527_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#define BOOT_ROM_LENGTH 0x8000
51
52/* Level 1 Memory */
53
54/* Memory Map for ADSP-BF527 ADSP-BF525 ADSP-BF522 processors */
55
56#ifdef CONFIG_BFIN_ICACHE
57#define BFIN_ICACHESIZE (16*1024)
58#else
59#define BFIN_ICACHESIZE (0*1024)
60#endif
61
62#define L1_CODE_START 0xFFA00000
63#define L1_DATA_A_START 0xFF800000
64#define L1_DATA_B_START 0xFF900000
65
66#define L1_CODE_LENGTH 0xC000
67
68#ifdef CONFIG_BFIN_DCACHE
69
70#ifdef CONFIG_BFIN_DCACHE_BANKA
71#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
72#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
73#define L1_DATA_B_LENGTH 0x8000
74#define BFIN_DCACHESIZE (16*1024)
75#define BFIN_DSUPBANKS 1
76#else
77#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
78#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
79#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
80#define BFIN_DCACHESIZE (32*1024)
81#define BFIN_DSUPBANKS 2
82#endif
83
84#else
85#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
86#define L1_DATA_A_LENGTH 0x8000
87#define L1_DATA_B_LENGTH 0x8000
88#define BFIN_DCACHESIZE (0*1024)
89#define BFIN_DSUPBANKS 0
90#endif /*CONFIG_BFIN_DCACHE */
91
92/* Level 2 Memory - none */
93
94#define L2_START 0
95#define L2_LENGTH 0
96
97/* Scratch Pad Memory */
98
99#define L1_SCRATCH_START 0xFFB00000
100#define L1_SCRATCH_LENGTH 0x1000
101
102#endif /* _MEM_MAP_527_H_ */
diff --git a/include/asm-blackfin/mach-bf527/portmux.h b/include/asm-blackfin/mach-bf527/portmux.h
deleted file mode 100644
index ae4d205bfcf5..000000000000
--- a/include/asm-blackfin/mach-bf527/portmux.h
+++ /dev/null
@@ -1,207 +0,0 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
5
6#define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
7#define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
8#define P_PPI0_D2 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
9#define P_PPI0_D3 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
10#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
11#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
12#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
13#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
14#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
15#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
16#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
17#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
18#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
19#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
20#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
21#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
22
23#if defined(CONFIG_BF527_SPORT0_PORTF)
24#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
25#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
26#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
27#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
28#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
29#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
30#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
31#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
32#elif defined(CONFIG_BF527_SPORT0_PORTG)
33#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
34#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1))
35#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(1))
36#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1))
37#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(1))
38#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(1))
39#if defined(CONFIG_BF527_SPORT0_TSCLK_PG10)
40#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(1))
41#elif defined(CONFIG_BF527_SPORT0_TSCLK_PG14)
42#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
43#endif
44#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
45#endif
46
47#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
48#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
49#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(1))
50#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(1))
51#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(1))
52#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(1))
53#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
54#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
55
56#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(2))
57#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(2))
58
59#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(2))
60#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(2))
61
62#if defined(CONFIG_BF527_UART1_PORTF)
63#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(2))
64#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(2))
65#elif defined(CONFIG_BF527_UART1_PORTG)
66#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(1))
67#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
68#endif
69
70#define P_HWAIT (P_DONTCARE)
71
72#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
73#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(2))
74#define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(2))
75#define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(2))
76#define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(2))
77#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
78#define P_PPI0_FS2 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
79#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
80#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
81#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
82#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
83/* #define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0)) */
84#define P_DMAR1 (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
85#define P_DMAR0 (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
86#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(1))
87#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
88#define P_MDC (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(1))
89#define P_RMII0_MDINT (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(1))
90#define P_MII0_PHYINT (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(1))
91
92#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(2))
93#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(2))
94#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(2))
95
96#define P_HOST_WR (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(2))
97#define P_HOST_ACK (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(2))
98#define P_HOST_ADDR (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(2))
99#define P_HOST_RD (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(2))
100#define P_HOST_CE (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(2))
101
102#if defined(CONFIG_BF527_NAND_D_PORTF)
103#define P_NAND_D0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(2))
104#define P_NAND_D1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(2))
105#define P_NAND_D2 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(2))
106#define P_NAND_D3 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(2))
107#define P_NAND_D4 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(2))
108#define P_NAND_D5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(2))
109#define P_NAND_D6 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(2))
110#define P_NAND_D7 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(2))
111#elif defined(CONFIG_BF527_NAND_D_PORTH)
112#define P_NAND_D0 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
113#define P_NAND_D1 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
114#define P_NAND_D2 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
115#define P_NAND_D3 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(0))
116#define P_NAND_D4 (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(0))
117#define P_NAND_D5 (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(0))
118#define P_NAND_D6 (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(0))
119#define P_NAND_D7 (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(0))
120#endif
121
122#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(0))
123#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(0))
124#define P_NAND_CE (P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(0))
125#define P_NAND_WE (P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(0))
126#define P_NAND_RE (P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(0))
127#define P_NAND_RB (P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(0))
128#define P_NAND_CLE (P_DEFINED | P_IDENT(GPIO_PH14) | P_FUNCT(0))
129#define P_NAND_ALE (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(0))
130
131#define P_HOST_D0 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(2))
132#define P_HOST_D1 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(2))
133#define P_HOST_D2 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(2))
134#define P_HOST_D3 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(2))
135#define P_HOST_D4 (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(2))
136#define P_HOST_D5 (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(2))
137#define P_HOST_D6 (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(2))
138#define P_HOST_D7 (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(2))
139#define P_HOST_D8 (P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(2))
140#define P_HOST_D9 (P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(2))
141#define P_HOST_D10 (P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(2))
142#define P_HOST_D11 (P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(2))
143#define P_HOST_D12 (P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(2))
144#define P_HOST_D13 (P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(2))
145#define P_HOST_D14 (P_DEFINED | P_IDENT(GPIO_PH14) | P_FUNCT(2))
146#define P_HOST_D15 (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(2))
147
148#define P_MII0_ETxD0 (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(1))
149#define P_MII0_ETxD1 (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(1))
150#define P_MII0_ETxD2 (P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(1))
151#define P_MII0_ETxD3 (P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(1))
152#define P_MII0_ETxEN (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(1))
153#define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(1))
154#define P_MII0_COL (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(1))
155#define P_MII0_ERxD0 (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(1))
156#define P_MII0_ERxD1 (P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(1))
157#define P_MII0_ERxD2 (P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(1))
158#define P_MII0_ERxD3 (P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(1))
159#define P_MII0_ERxDV (P_DEFINED | P_IDENT(GPIO_PH14) | P_FUNCT(1))
160#define P_MII0_ERxCLK (P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(1))
161#define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(1))
162#define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(1))
163#define P_RMII0_REF_CLK (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(1))
164#define P_RMII0_CRS_DV (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(1))
165#define P_MDIO (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(1))
166
167#define P_TWI0_SCL (P_DONTCARE)
168#define P_TWI0_SDA (P_DONTCARE)
169#define P_PPI0_FS1 (P_DONTCARE)
170#define P_TMR0 (P_DONTCARE)
171#define P_TMRCLK (P_DONTCARE)
172#define P_PPI0_CLK (P_DONTCARE)
173
174#define P_MII0 {\
175 P_MII0_ETxD0, \
176 P_MII0_ETxD1, \
177 P_MII0_ETxD2, \
178 P_MII0_ETxD3, \
179 P_MII0_ETxEN, \
180 P_MII0_TxCLK, \
181 P_MII0_PHYINT, \
182 P_MII0_COL, \
183 P_MII0_ERxD0, \
184 P_MII0_ERxD1, \
185 P_MII0_ERxD2, \
186 P_MII0_ERxD3, \
187 P_MII0_ERxDV, \
188 P_MII0_ERxCLK, \
189 P_MII0_ERxER, \
190 P_MII0_CRS, \
191 P_MDC, \
192 P_MDIO, 0}
193
194#define P_RMII0 {\
195 P_MII0_ETxD0, \
196 P_MII0_ETxD1, \
197 P_MII0_ETxEN, \
198 P_MII0_ERxD0, \
199 P_MII0_ERxD1, \
200 P_MII0_ERxER, \
201 P_RMII0_REF_CLK, \
202 P_RMII0_MDINT, \
203 P_RMII0_CRS_DV, \
204 P_MDC, \
205 P_MDIO, 0}
206
207#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf533/anomaly.h b/include/asm-blackfin/mach-bf533/anomaly.h
deleted file mode 100644
index 8f7ea112fd3a..000000000000
--- a/include/asm-blackfin/mach-bf533/anomaly.h
+++ /dev/null
@@ -1,272 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/anomaly.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2004-2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9/* This file shoule be up to date with:
10 * - Revision C, 02/08/2008; ADSP-BF531/BF532/BF533 Blackfin Processor Anomaly List
11 */
12
13#ifndef _MACH_ANOMALY_H_
14#define _MACH_ANOMALY_H_
15
16/* We do not support 0.1 or 0.2 silicon - sorry */
17#if __SILICON_REVISION__ < 3
18# error will not work on BF533 silicon version 0.0, 0.1, or 0.2
19#endif
20
21#if defined(__ADSPBF531__)
22# define ANOMALY_BF531 1
23#else
24# define ANOMALY_BF531 0
25#endif
26#if defined(__ADSPBF532__)
27# define ANOMALY_BF532 1
28#else
29# define ANOMALY_BF532 0
30#endif
31#if defined(__ADSPBF533__)
32# define ANOMALY_BF533 1
33#else
34# define ANOMALY_BF533 0
35#endif
36
37/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot 2 Not Supported */
38#define ANOMALY_05000074 (1)
39/* UART Line Status Register (UART_LSR) Bits Are Not Updated at the Same Time */
40#define ANOMALY_05000099 (__SILICON_REVISION__ < 5)
41/* Watchpoint Status Register (WPSTAT) Bits Are Set on Every Corresponding Match */
42#define ANOMALY_05000105 (1)
43/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
44#define ANOMALY_05000119 (1)
45/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
46#define ANOMALY_05000122 (1)
47/* Instruction DMA Can Cause Data Cache Fills to Fail (Boot Implications) */
48#define ANOMALY_05000158 (__SILICON_REVISION__ < 5)
49/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */
50#define ANOMALY_05000166 (1)
51/* Turning Serial Ports on with External Frame Syncs */
52#define ANOMALY_05000167 (1)
53/* PPI_COUNT Cannot Be Programmed to 0 in General Purpose TX or RX Modes */
54#define ANOMALY_05000179 (__SILICON_REVISION__ < 5)
55/* PPI_DELAY Not Functional in PPI Modes with 0 Frame Syncs */
56#define ANOMALY_05000180 (1)
57/* Timer Pin Limitations for PPI TX Modes with External Frame Syncs */
58#define ANOMALY_05000183 (__SILICON_REVISION__ < 4)
59/* False Protection Exceptions */
60#define ANOMALY_05000189 (__SILICON_REVISION__ < 4)
61/* False I/O Pin Interrupts on Edge-Sensitive Inputs When Polarity Setting Is Changed */
62#define ANOMALY_05000193 (__SILICON_REVISION__ < 4)
63/* Restarting SPORT in Specific Modes May Cause Data Corruption */
64#define ANOMALY_05000194 (__SILICON_REVISION__ < 4)
65/* Failing MMR Accesses When Stalled by Preceding Memory Read */
66#define ANOMALY_05000198 (__SILICON_REVISION__ < 5)
67/* Current DMA Address Shows Wrong Value During Carry Fix */
68#define ANOMALY_05000199 (__SILICON_REVISION__ < 4)
69/* SPORT TFS and DT Are Incorrectly Driven During Inactive Channels in Certain Conditions */
70#define ANOMALY_05000200 (__SILICON_REVISION__ < 5)
71/* Receive Frame Sync Not Ignored During Active Frames in SPORT Multi-Channel Mode */
72#define ANOMALY_05000201 (__SILICON_REVISION__ < 4)
73/* Possible Infinite Stall with Specific Dual-DAG Situation */
74#define ANOMALY_05000202 (__SILICON_REVISION__ < 5)
75/* Specific Sequence That Can Cause DMA Error or DMA Stopping */
76#define ANOMALY_05000203 (__SILICON_REVISION__ < 4)
77/* Incorrect data read with write-through cache and allocate cache lines on reads only mode */
78#define ANOMALY_05000204 (__SILICON_REVISION__ < 4 && ANOMALY_BF533)
79/* Recovery from "Brown-Out" Condition */
80#define ANOMALY_05000207 (__SILICON_REVISION__ < 4)
81/* VSTAT Status Bit in PLL_STAT Register Is Not Functional */
82#define ANOMALY_05000208 (1)
83/* Speed Path in Computational Unit Affects Certain Instructions */
84#define ANOMALY_05000209 (__SILICON_REVISION__ < 4)
85/* UART TX Interrupt Masked Erroneously */
86#define ANOMALY_05000215 (__SILICON_REVISION__ < 5)
87/* NMI Event at Boot Time Results in Unpredictable State */
88#define ANOMALY_05000219 (1)
89/* Incorrect Pulse-Width of UART Start Bit */
90#define ANOMALY_05000225 (__SILICON_REVISION__ < 5)
91/* Scratchpad Memory Bank Reads May Return Incorrect Data */
92#define ANOMALY_05000227 (__SILICON_REVISION__ < 5)
93/* SPI Slave Boot Mode Modifies Registers from Reset Value */
94#define ANOMALY_05000229 (1)
95/* UART Receiver is Less Robust Against Baudrate Differences in Certain Conditions */
96#define ANOMALY_05000230 (__SILICON_REVISION__ < 5)
97/* UART STB Bit Incorrectly Affects Receiver Setting */
98#define ANOMALY_05000231 (__SILICON_REVISION__ < 5)
99/* PPI_FS3 Is Not Driven in 2 or 3 Internal Frame Sync Transmit Modes */
100#define ANOMALY_05000233 (__SILICON_REVISION__ < 4)
101/* Incorrect Revision Number in DSPID Register */
102#define ANOMALY_05000234 (__SILICON_REVISION__ == 4)
103/* DF Bit in PLL_CTL Register Does Not Respond to Hardware Reset */
104#define ANOMALY_05000242 (__SILICON_REVISION__ < 4)
105/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */
106#define ANOMALY_05000244 (__SILICON_REVISION__ < 5)
107/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */
108#define ANOMALY_05000245 (1)
109/* Data CPLBs Should Prevent Spurious Hardware Errors */
110#define ANOMALY_05000246 (__SILICON_REVISION__ < 5)
111/* Incorrect Bit Shift of Data Word in Multichannel (TDM) Mode in Certain Conditions */
112#define ANOMALY_05000250 (__SILICON_REVISION__ == 4)
113/* Maximum External Clock Speed for Timers */
114#define ANOMALY_05000253 (__SILICON_REVISION__ < 5)
115/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */
116#define ANOMALY_05000254 (__SILICON_REVISION__ > 4)
117/* Entering Hibernate State with RTC Seconds Interrupt Not Functional */
118#define ANOMALY_05000255 (__SILICON_REVISION__ < 5)
119/* Interrupt/Exception During Short Hardware Loop May Cause Bad Instruction Fetches */
120#define ANOMALY_05000257 (__SILICON_REVISION__ < 5)
121/* Instruction Cache Is Corrupted When Bits 9 and 12 of the ICPLB Data Registers Differ */
122#define ANOMALY_05000258 (__SILICON_REVISION__ < 5)
123/* ICPLB_STATUS MMR Register May Be Corrupted */
124#define ANOMALY_05000260 (__SILICON_REVISION__ < 5)
125/* DCPLB_FAULT_ADDR MMR Register May Be Corrupted */
126#define ANOMALY_05000261 (__SILICON_REVISION__ < 5)
127/* Stores To Data Cache May Be Lost */
128#define ANOMALY_05000262 (__SILICON_REVISION__ < 5)
129/* Hardware Loop Corrupted When Taking an ICPLB Exception */
130#define ANOMALY_05000263 (__SILICON_REVISION__ < 5)
131/* CSYNC/SSYNC/IDLE Causes Infinite Stall in Penultimate Instruction in Hardware Loop */
132#define ANOMALY_05000264 (__SILICON_REVISION__ < 5)
133/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
134#define ANOMALY_05000265 (__SILICON_REVISION__ < 5)
135/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Increase */
136#define ANOMALY_05000269 (__SILICON_REVISION__ < 5)
137/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */
138#define ANOMALY_05000270 (__SILICON_REVISION__ < 5)
139/* Spontaneous Reset of Internal Voltage Regulator */
140#define ANOMALY_05000271 (__SILICON_REVISION__ < 4)
141/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
142#define ANOMALY_05000272 (1)
143/* Writes to Synchronous SDRAM Memory May Be Lost */
144#define ANOMALY_05000273 (1)
145/* Timing Requirements Change for External Frame Sync PPI Modes with Non-Zero PPI_DELAY */
146#define ANOMALY_05000276 (1)
147/* Writes to an I/O Data Register One SCLK Cycle after an Edge Is Detected May Clear Interrupt */
148#define ANOMALY_05000277 (1)
149/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
150#define ANOMALY_05000278 (1)
151/* False Hardware Error Exception When ISR Context Is Not Restored */
152#define ANOMALY_05000281 (1)
153/* Memory DMA Corruption with 32-Bit Data and Traffic Control */
154#define ANOMALY_05000282 (1)
155/* System MMR Write Is Stalled Indefinitely When Killed in a Particular Stage */
156#define ANOMALY_05000283 (1)
157/* SPORTs May Receive Bad Data If FIFOs Fill Up */
158#define ANOMALY_05000288 (1)
159/* Memory-To-Memory DMA Source/Destination Descriptors Must Be in Same Memory Space */
160#define ANOMALY_05000301 (1)
161/* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */
162#define ANOMALY_05000302 (__SILICON_REVISION__ < 5)
163/* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */
164#define ANOMALY_05000305 (__SILICON_REVISION__ < 5)
165/* New Feature: Additional PPI Frame Sync Sampling Options (Not Available On Older Silicon) */
166#define ANOMALY_05000306 (__SILICON_REVISION__ < 5)
167/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
168#define ANOMALY_05000310 (1)
169/* Erroneous Flag (GPIO) Pin Operations under Specific Sequences */
170#define ANOMALY_05000311 (1)
171/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
172#define ANOMALY_05000312 (1)
173/* PPI Is Level-Sensitive on First Transfer */
174#define ANOMALY_05000313 (1)
175/* Killed System MMR Write Completes Erroneously On Next System MMR Access */
176#define ANOMALY_05000315 (1)
177/* Internal Voltage Regulator Values of 1.05V, 1.10V and 1.15V Not Allowed for LQFP Packages */
178#define ANOMALY_05000319 (ANOMALY_BF531 || ANOMALY_BF532)
179/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
180#define ANOMALY_05000357 (1)
181/* UART Break Signal Issues */
182#define ANOMALY_05000363 (__SILICON_REVISION__ < 5)
183/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
184#define ANOMALY_05000366 (1)
185/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
186#define ANOMALY_05000371 (1)
187/* PPI Does Not Start Properly In Specific Mode */
188#define ANOMALY_05000400 (__SILICON_REVISION__ >= 5)
189/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */
190#define ANOMALY_05000402 (__SILICON_REVISION__ >= 5)
191/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
192#define ANOMALY_05000403 (1)
193
194
195/* These anomalies have been "phased" out of analog.com anomaly sheets and are
196 * here to show running on older silicon just isn't feasible.
197 */
198
199/* Watchpoints (Hardware Breakpoints) are not supported */
200#define ANOMALY_05000067 (__SILICON_REVISION__ < 3)
201/* Reserved bits in SYSCFG register not set at power on */
202#define ANOMALY_05000109 (__SILICON_REVISION__ < 3)
203/* Trace Buffers may record discontinuities into emulation mode and/or exception, NMI, reset handlers */
204#define ANOMALY_05000116 (__SILICON_REVISION__ < 3)
205/* DTEST_COMMAND initiated memory access may be incorrect if data cache or DMA is active */
206#define ANOMALY_05000123 (__SILICON_REVISION__ < 3)
207/* DMA Lock-up at CCLK to SCLK ratios of 4:1, 2:1, or 1:1 */
208#define ANOMALY_05000124 (__SILICON_REVISION__ < 3)
209/* Erroneous exception when enabling cache */
210#define ANOMALY_05000125 (__SILICON_REVISION__ < 3)
211/* SPI clock polarity and phase bits incorrect during booting */
212#define ANOMALY_05000126 (__SILICON_REVISION__ < 3)
213/* DMEM_CONTROL is not set on Reset */
214#define ANOMALY_05000137 (__SILICON_REVISION__ < 3)
215/* SPI boot will not complete if there is a zero fill block in the loader file */
216#define ANOMALY_05000138 (__SILICON_REVISION__ < 3)
217/* Allowing the SPORT RX FIFO to fill will cause an overflow */
218#define ANOMALY_05000140 (__SILICON_REVISION__ < 3)
219/* An Infinite Stall occurs with a particular sequence of consecutive dual dag events */
220#define ANOMALY_05000141 (__SILICON_REVISION__ < 3)
221/* Interrupts may be lost when a programmable input flag is configured to be edge sensitive */
222#define ANOMALY_05000142 (__SILICON_REVISION__ < 3)
223/* A read from external memory may return a wrong value with data cache enabled */
224#define ANOMALY_05000143 (__SILICON_REVISION__ < 3)
225/* DMA and TESTSET conflict when both are accessing external memory */
226#define ANOMALY_05000144 (__SILICON_REVISION__ < 3)
227/* In PWM_OUT mode, you must enable the PPI block to generate a waveform from PPI_CLK */
228#define ANOMALY_05000145 (__SILICON_REVISION__ < 3)
229/* MDMA may lose the first few words of a descriptor chain */
230#define ANOMALY_05000146 (__SILICON_REVISION__ < 3)
231/* The source MDMA descriptor may stop with a DMA Error */
232#define ANOMALY_05000147 (__SILICON_REVISION__ < 3)
233/* When booting from a 16-bit asynchronous memory device, the upper 8-bits of each word must be 0x00 */
234#define ANOMALY_05000148 (__SILICON_REVISION__ < 3)
235/* Frame Delay in SPORT Multichannel Mode */
236#define ANOMALY_05000153 (__SILICON_REVISION__ < 3)
237/* SPORT TFS signal is active in Multi-channel mode outside of valid channels */
238#define ANOMALY_05000154 (__SILICON_REVISION__ < 3)
239/* Timer1 can not be used for PWMOUT mode when a certain PPI mode is in use */
240#define ANOMALY_05000155 (__SILICON_REVISION__ < 3)
241/* A killed 32-bit System MMR write will lead to the next system MMR access thinking it should be 32-bit. */
242#define ANOMALY_05000157 (__SILICON_REVISION__ < 3)
243/* SPORT transmit data is not gated by external frame sync in certain conditions */
244#define ANOMALY_05000163 (__SILICON_REVISION__ < 3)
245/* SDRAM auto-refresh and subsequent Power Ups */
246#define ANOMALY_05000168 (__SILICON_REVISION__ < 3)
247/* DATA CPLB page miss can result in lost write-through cache data writes */
248#define ANOMALY_05000169 (__SILICON_REVISION__ < 3)
249/* DMA vs Core accesses to external memory */
250#define ANOMALY_05000173 (__SILICON_REVISION__ < 3)
251/* Cache Fill Buffer Data lost */
252#define ANOMALY_05000174 (__SILICON_REVISION__ < 3)
253/* Overlapping Sequencer and Memory Stalls */
254#define ANOMALY_05000175 (__SILICON_REVISION__ < 3)
255/* Multiplication of (-1) by (-1) followed by an accumulator saturation */
256#define ANOMALY_05000176 (__SILICON_REVISION__ < 3)
257/* Disabling the PPI resets the PPI configuration registers */
258#define ANOMALY_05000181 (__SILICON_REVISION__ < 3)
259/* PPI TX Mode with 2 External Frame Syncs */
260#define ANOMALY_05000185 (__SILICON_REVISION__ < 3)
261/* PPI does not invert the Driving PPICLK edge in Transmit Modes */
262#define ANOMALY_05000191 (__SILICON_REVISION__ < 3)
263/* In PPI Transmit Modes with External Frame Syncs POLC */
264#define ANOMALY_05000192 (__SILICON_REVISION__ < 3)
265/* Internal Voltage Regulator may not start up */
266#define ANOMALY_05000206 (__SILICON_REVISION__ < 3)
267
268/* Anomalies that don't exist on this proc */
269#define ANOMALY_05000266 (0)
270#define ANOMALY_05000323 (0)
271
272#endif
diff --git a/include/asm-blackfin/mach-bf533/bf533.h b/include/asm-blackfin/mach-bf533/bf533.h
deleted file mode 100644
index 12a416931991..000000000000
--- a/include/asm-blackfin/mach-bf533/bf533.h
+++ /dev/null
@@ -1,161 +0,0 @@
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 BFIN_DSUBBANKS 4
56#define BFIN_DWAYS 2
57#define BFIN_DLINES 64
58#define BFIN_ISUBBANKS 4
59#define BFIN_IWAYS 4
60#define BFIN_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#ifdef CONFIG_BF533
145#define CPU "BF533"
146#define CPUID 0x027a5000
147#endif
148#ifdef CONFIG_BF532
149#define CPU "BF532"
150#define CPUID 0x0275A000
151#endif
152#ifdef CONFIG_BF531
153#define CPU "BF531"
154#define CPUID 0x027a5000
155#endif
156#ifndef CPU
157#define CPU "UNKNOWN"
158#define CPUID 0x0
159#endif
160
161#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
deleted file mode 100644
index ebf592b59aab..000000000000
--- a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * blackfin serial driver head file
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#include <linux/serial.h>
33#include <asm/dma.h>
34#include <asm/portmux.h>
35
36#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
37#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
38#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
39#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
40#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
41#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
42#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
43
44#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
45#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
46#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
47#define UART_SET_IER(uart,v) UART_PUT_IER(uart, UART_GET_IER(uart) | (v))
48#define UART_CLEAR_IER(uart,v) UART_PUT_IER(uart, UART_GET_IER(uart) & ~(v))
49#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
60#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
61
62#ifdef CONFIG_BFIN_UART0_CTSRTS
63# define CONFIG_SERIAL_BFIN_CTSRTS
64# ifndef CONFIG_UART0_CTS_PIN
65# define CONFIG_UART0_CTS_PIN -1
66# endif
67# ifndef CONFIG_UART0_RTS_PIN
68# define CONFIG_UART0_RTS_PIN -1
69# endif
70#endif
71
72struct bfin_serial_port {
73 struct uart_port port;
74 unsigned int old_status;
75 unsigned int lsr;
76#ifdef CONFIG_SERIAL_BFIN_DMA
77 int tx_done;
78 int tx_count;
79 struct circ_buf rx_dma_buf;
80 struct timer_list rx_dma_timer;
81 int rx_dma_nrows;
82 unsigned int tx_dma_channel;
83 unsigned int rx_dma_channel;
84 struct work_struct tx_dma_workqueue;
85#else
86# if ANOMALY_05000230
87 unsigned int anomaly_threshold;
88# endif
89#endif
90#ifdef CONFIG_SERIAL_BFIN_CTSRTS
91 struct timer_list cts_timer;
92 int cts_pin;
93 int rts_pin;
94#endif
95};
96
97/* The hardware clears the LSR bits upon read, so we need to cache
98 * some of the more fun bits in software so they don't get lost
99 * when checking the LSR in other code paths (TX).
100 */
101static inline unsigned int UART_GET_LSR(struct bfin_serial_port *uart)
102{
103 unsigned int lsr = bfin_read16(uart->port.membase + OFFSET_LSR);
104 uart->lsr |= (lsr & (BI|FE|PE|OE));
105 return lsr | uart->lsr;
106}
107
108static inline void UART_CLEAR_LSR(struct bfin_serial_port *uart)
109{
110 uart->lsr = 0;
111 bfin_write16(uart->port.membase + OFFSET_LSR, -1);
112}
113
114struct bfin_serial_port bfin_serial_ports[BFIN_UART_NR_PORTS];
115struct bfin_serial_res {
116 unsigned long uart_base_addr;
117 int uart_irq;
118#ifdef CONFIG_SERIAL_BFIN_DMA
119 unsigned int uart_tx_dma_channel;
120 unsigned int uart_rx_dma_channel;
121#endif
122#ifdef CONFIG_SERIAL_BFIN_CTSRTS
123 int uart_cts_pin;
124 int uart_rts_pin;
125#endif
126};
127
128struct bfin_serial_res bfin_serial_resource[] = {
129 {
130 0xFFC00400,
131 IRQ_UART_RX,
132#ifdef CONFIG_SERIAL_BFIN_DMA
133 CH_UART_TX,
134 CH_UART_RX,
135#endif
136#ifdef CONFIG_BFIN_UART0_CTSRTS
137 CONFIG_UART0_CTS_PIN,
138 CONFIG_UART0_RTS_PIN,
139#endif
140 }
141};
142
143#define DRIVER_NAME "bfin-uart"
144
145int nr_ports = BFIN_UART_NR_PORTS;
146static void bfin_serial_hw_init(struct bfin_serial_port *uart)
147{
148
149#ifdef CONFIG_SERIAL_BFIN_UART0
150 peripheral_request(P_UART0_TX, DRIVER_NAME);
151 peripheral_request(P_UART0_RX, DRIVER_NAME);
152#endif
153
154#ifdef CONFIG_SERIAL_BFIN_CTSRTS
155 if (uart->cts_pin >= 0) {
156 gpio_request(uart->cts_pin, DRIVER_NAME);
157 gpio_direction_input(uart->cts_pin);
158 }
159 if (uart->rts_pin >= 0) {
160 gpio_request(uart->rts_pin, DRIVER_NAME);
161 gpio_direction_input(uart->rts_pin, 0);
162 }
163#endif
164}
diff --git a/include/asm-blackfin/mach-bf533/bfin_sir.h b/include/asm-blackfin/mach-bf533/bfin_sir.h
deleted file mode 100644
index 9bb87e9e2e9b..000000000000
--- a/include/asm-blackfin/mach-bf533/bfin_sir.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART_RX,
69 CH_UART_RX,
70 CH_UART_TX,
71 },
72#endif
73};
74
75int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
76
77struct bfin_sir_self {
78 struct bfin_sir_port *sir_port;
79 spinlock_t lock;
80 unsigned int open;
81 int speed;
82 int newspeed;
83
84 struct sk_buff *txskb;
85 struct sk_buff *rxskb;
86 struct net_device_stats stats;
87 struct device *dev;
88 struct irlap_cb *irlap;
89 struct qos_info qos;
90
91 iobuff_t tx_buff;
92 iobuff_t rx_buff;
93
94 struct work_struct work;
95 int mtt;
96};
97
98static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
99{
100 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
101 port->lsr |= (lsr & (BI|FE|PE|OE));
102 return lsr | port->lsr;
103}
104
105static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
106{
107 port->lsr = 0;
108 bfin_read16(port->membase + OFFSET_LSR);
109}
110
111#define DRIVER_NAME "bfin_sir"
112
113static int bfin_sir_hw_init(void)
114{
115 int ret = -ENODEV;
116#ifdef CONFIG_BFIN_SIR0
117 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
118 if (ret)
119 return ret;
120 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
121 if (ret)
122 return ret;
123#endif
124 return ret;
125}
diff --git a/include/asm-blackfin/mach-bf533/blackfin.h b/include/asm-blackfin/mach-bf533/blackfin.h
deleted file mode 100644
index d80971b4e3aa..000000000000
--- a/include/asm-blackfin/mach-bf533/blackfin.h
+++ /dev/null
@@ -1,60 +0,0 @@
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__)
42#include "cdefBF532.h"
43#endif
44
45#define BFIN_UART_NR_PORTS 1
46
47#define OFFSET_THR 0x00 /* Transmit Holding register */
48#define OFFSET_RBR 0x00 /* Receive Buffer register */
49#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
50#define OFFSET_IER 0x04 /* Interrupt Enable Register */
51#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
52#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
53#define OFFSET_LCR 0x0C /* Line Control Register */
54#define OFFSET_MCR 0x10 /* Modem Control Register */
55#define OFFSET_LSR 0x14 /* Line Status Register */
56#define OFFSET_MSR 0x18 /* Modem Status Register */
57#define OFFSET_SCR 0x1C /* SCR Scratch Register */
58#define OFFSET_GCTL 0x24 /* Global Control Register */
59
60#endif /* _MACH_BLACKFIN_H_ */
diff --git a/include/asm-blackfin/mach-bf533/cdefBF532.h b/include/asm-blackfin/mach-bf533/cdefBF532.h
deleted file mode 100644
index 154655452d4c..000000000000
--- a/include/asm-blackfin/mach-bf533/cdefBF532.h
+++ /dev/null
@@ -1,767 +0,0 @@
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#include <asm/blackfin.h>
35
36/*include all Core registers and bit definitions*/
37#include "defBF532.h"
38
39/*include core specific register pointer definitions*/
40#include <asm/mach-common/cdef_LPBlackfin.h>
41
42#include <asm/system.h>
43
44/* Clock and System Control (0xFFC0 0400-0xFFC0 07FF) */
45#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
46/* Writing to PLL_CTL initiates a PLL relock sequence. */
47static __inline__ void bfin_write_PLL_CTL(unsigned int val)
48{
49 unsigned long flags, iwr;
50
51 if (val == bfin_read_PLL_CTL())
52 return;
53
54 local_irq_save(flags);
55 /* Enable the PLL Wakeup bit in SIC IWR */
56 iwr = bfin_read32(SIC_IWR);
57 /* Only allow PPL Wakeup) */
58 bfin_write32(SIC_IWR, IWR_ENABLE(0));
59
60 bfin_write16(PLL_CTL, val);
61 SSYNC();
62 asm("IDLE;");
63
64 bfin_write32(SIC_IWR, iwr);
65 local_irq_restore(flags);
66}
67#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
68#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
69#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
70#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
71#define bfin_read_CHIPID() bfin_read32(CHIPID)
72#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
73#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
74#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
75/* Writing to VR_CTL initiates a PLL relock sequence. */
76static __inline__ void bfin_write_VR_CTL(unsigned int val)
77{
78 unsigned long flags, iwr;
79
80 if (val == bfin_read_VR_CTL())
81 return;
82
83 local_irq_save(flags);
84 /* Enable the PLL Wakeup bit in SIC IWR */
85 iwr = bfin_read32(SIC_IWR);
86 /* Only allow PPL Wakeup) */
87 bfin_write32(SIC_IWR, IWR_ENABLE(0));
88
89 bfin_write16(VR_CTL, val);
90 SSYNC();
91 asm("IDLE;");
92
93 bfin_write32(SIC_IWR, iwr);
94 local_irq_restore(flags);
95}
96
97/* System Interrupt Controller (0xFFC0 0C00-0xFFC0 0FFF) */
98#define bfin_read_SWRST() bfin_read16(SWRST)
99#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
100#define bfin_read_SYSCR() bfin_read16(SYSCR)
101#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
102#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
103#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0,val)
104#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
105#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1,val)
106#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
107#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2,val)
108#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
109#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3,val)
110#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK)
111#define bfin_write_SIC_IMASK(val) bfin_write32(SIC_IMASK,val)
112#define bfin_read_SIC_ISR() bfin_read32(SIC_ISR)
113#define bfin_write_SIC_ISR(val) bfin_write32(SIC_ISR,val)
114#define bfin_read_SIC_IWR() bfin_read32(SIC_IWR)
115#define bfin_write_SIC_IWR(val) bfin_write32(SIC_IWR,val)
116
117/* Watchdog Timer (0xFFC0 1000-0xFFC0 13FF) */
118#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
119#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL,val)
120#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
121#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT,val)
122#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
123#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT,val)
124
125/* Real Time Clock (0xFFC0 1400-0xFFC0 17FF) */
126#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
127#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT,val)
128#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
129#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL,val)
130#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
131#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT,val)
132#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
133#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT,val)
134#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
135#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM,val)
136#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
137#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST,val)
138#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
139#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val)
140
141/* DMA Traffic controls */
142#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
143#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
144#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
145#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
146
147/* Alternate deprecated register names (below) provided for backwards code compatibility */
148#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
149#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER,val)
150#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
151#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT,val)
152
153/* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */
154#define bfin_read_FIO_DIR() bfin_read16(FIO_DIR)
155#define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val)
156#define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C)
157#define bfin_write_FIO_MASKA_C(val) bfin_write16(FIO_MASKA_C,val)
158#define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S)
159#define bfin_write_FIO_MASKA_S(val) bfin_write16(FIO_MASKA_S,val)
160#define bfin_read_FIO_MASKB_C() bfin_read16(FIO_MASKB_C)
161#define bfin_write_FIO_MASKB_C(val) bfin_write16(FIO_MASKB_C,val)
162#define bfin_read_FIO_MASKB_S() bfin_read16(FIO_MASKB_S)
163#define bfin_write_FIO_MASKB_S(val) bfin_write16(FIO_MASKB_S,val)
164#define bfin_read_FIO_POLAR() bfin_read16(FIO_POLAR)
165#define bfin_write_FIO_POLAR(val) bfin_write16(FIO_POLAR,val)
166#define bfin_read_FIO_EDGE() bfin_read16(FIO_EDGE)
167#define bfin_write_FIO_EDGE(val) bfin_write16(FIO_EDGE,val)
168#define bfin_read_FIO_BOTH() bfin_read16(FIO_BOTH)
169#define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val)
170#define bfin_read_FIO_INEN() bfin_read16(FIO_INEN)
171#define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val)
172#define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D)
173#define bfin_write_FIO_MASKA_D(val) bfin_write16(FIO_MASKA_D,val)
174#define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T)
175#define bfin_write_FIO_MASKA_T(val) bfin_write16(FIO_MASKA_T,val)
176#define bfin_read_FIO_MASKB_D() bfin_read16(FIO_MASKB_D)
177#define bfin_write_FIO_MASKB_D(val) bfin_write16(FIO_MASKB_D,val)
178#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T)
179#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val)
180
181
182#if ANOMALY_05000311
183#define BFIN_WRITE_FIO_FLAG(name) \
184static __inline__ void bfin_write_FIO_FLAG_ ## name (unsigned short val)\
185{\
186 unsigned long flags;\
187 local_irq_save(flags);\
188 bfin_write16(FIO_FLAG_ ## name,val);\
189 bfin_read_CHIPID();\
190 local_irq_restore(flags);\
191}
192BFIN_WRITE_FIO_FLAG(D)
193BFIN_WRITE_FIO_FLAG(C)
194BFIN_WRITE_FIO_FLAG(S)
195BFIN_WRITE_FIO_FLAG(T)
196
197#define BFIN_READ_FIO_FLAG(name) \
198static __inline__ unsigned short bfin_read_FIO_FLAG_ ## name (void)\
199{\
200 unsigned long flags;\
201 unsigned short ret;\
202 local_irq_save(flags);\
203 ret = bfin_read16(FIO_FLAG_ ## name);\
204 bfin_read_CHIPID();\
205 local_irq_restore(flags);\
206 return ret;\
207}
208BFIN_READ_FIO_FLAG(D)
209BFIN_READ_FIO_FLAG(C)
210BFIN_READ_FIO_FLAG(S)
211BFIN_READ_FIO_FLAG(T)
212
213#else
214#define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val)
215#define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val)
216#define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val)
217#define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val)
218#define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T)
219#define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C)
220#define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S)
221#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
222#endif
223
224
225/* DMA Controller */
226#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
227#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
228#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
229#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR,val)
230#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
231#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR,val)
232#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
233#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT,val)
234#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
235#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT,val)
236#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
237#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY,val)
238#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
239#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY,val)
240#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
241#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR,val)
242#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
243#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR,val)
244#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
245#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT,val)
246#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
247#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT,val)
248#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
249#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS,val)
250#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
251#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP,val)
252
253#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
254#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG,val)
255#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
256#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR,val)
257#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
258#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR,val)
259#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
260#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT,val)
261#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
262#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT,val)
263#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
264#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY,val)
265#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
266#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY,val)
267#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
268#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR,val)
269#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
270#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR,val)
271#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
272#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT,val)
273#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
274#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT,val)
275#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
276#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS,val)
277#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
278#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP,val)
279
280#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
281#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG,val)
282#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
283#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR,val)
284#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
285#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR,val)
286#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
287#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT,val)
288#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
289#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT,val)
290#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
291#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY,val)
292#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
293#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY,val)
294#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
295#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR,val)
296#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
297#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR,val)
298#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
299#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT,val)
300#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
301#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT,val)
302#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
303#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS,val)
304#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
305#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP,val)
306
307#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
308#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG,val)
309#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
310#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR,val)
311#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
312#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR,val)
313#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
314#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT,val)
315#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
316#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT,val)
317#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
318#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY,val)
319#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
320#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY,val)
321#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
322#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR,val)
323#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
324#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR,val)
325#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
326#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT,val)
327#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
328#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT,val)
329#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
330#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS,val)
331#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
332#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP,val)
333
334#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
335#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG,val)
336#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
337#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR,val)
338#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
339#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR,val)
340#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
341#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT,val)
342#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
343#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT,val)
344#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
345#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY,val)
346#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
347#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY,val)
348#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
349#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR,val)
350#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
351#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR,val)
352#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
353#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT,val)
354#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
355#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT,val)
356#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
357#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS,val)
358#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
359#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP,val)
360
361#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
362#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG,val)
363#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
364#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR,val)
365#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
366#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR,val)
367#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
368#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT,val)
369#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
370#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT,val)
371#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
372#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY,val)
373#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
374#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY,val)
375#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
376#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR,val)
377#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
378#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR,val)
379#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
380#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT,val)
381#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
382#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT,val)
383#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
384#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS,val)
385#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
386#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP,val)
387
388#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
389#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG,val)
390#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
391#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR,val)
392#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
393#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR,val)
394#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
395#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT,val)
396#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
397#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT,val)
398#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
399#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY,val)
400#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
401#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY,val)
402#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
403#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR,val)
404#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
405#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR,val)
406#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
407#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT,val)
408#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
409#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT,val)
410#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
411#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS,val)
412#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
413#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP,val)
414
415#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
416#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG,val)
417#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
418#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR,val)
419#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
420#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR,val)
421#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
422#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT,val)
423#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
424#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT,val)
425#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
426#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY,val)
427#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
428#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY,val)
429#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
430#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR,val)
431#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
432#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR,val)
433#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
434#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT,val)
435#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
436#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT,val)
437#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
438#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS,val)
439#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
440#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP,val)
441
442#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
443#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG,val)
444#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
445#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR,val)
446#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
447#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR,val)
448#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
449#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT,val)
450#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
451#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT,val)
452#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
453#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY,val)
454#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
455#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY,val)
456#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
457#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR,val)
458#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
459#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR,val)
460#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
461#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT,val)
462#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
463#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT,val)
464#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
465#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS,val)
466#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
467#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP,val)
468
469#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
470#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG,val)
471#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
472#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR,val)
473#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
474#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR,val)
475#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
476#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT,val)
477#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
478#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT,val)
479#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
480#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY,val)
481#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
482#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY,val)
483#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
484#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR,val)
485#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
486#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR,val)
487#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
488#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT,val)
489#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
490#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT,val)
491#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
492#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS,val)
493#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
494#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP,val)
495
496#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
497#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG,val)
498#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
499#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR,val)
500#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
501#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR,val)
502#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
503#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT,val)
504#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
505#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT,val)
506#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
507#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY,val)
508#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
509#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY,val)
510#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
511#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR,val)
512#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
513#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR,val)
514#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
515#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT,val)
516#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
517#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT,val)
518#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
519#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS,val)
520#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
521#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP,val)
522
523#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
524#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG,val)
525#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
526#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR,val)
527#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
528#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR,val)
529#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
530#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT,val)
531#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
532#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT,val)
533#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
534#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY,val)
535#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
536#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY,val)
537#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
538#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR,val)
539#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
540#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR,val)
541#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
542#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT,val)
543#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
544#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT,val)
545#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
546#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS,val)
547#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
548#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP,val)
549
550/* Aysnchronous Memory Controller - External Bus Interface Unit (0xFFC0 3C00-0xFFC0 3FFF) */
551#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
552#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL,val)
553#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
554#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0,val)
555#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
556#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1,val)
557
558/* SDRAM Controller External Bus Interface Unit (0xFFC0 4C00-0xFFC0 4FFF) */
559#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
560#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL,val)
561#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
562#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC,val)
563#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
564#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
565#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
566#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL,val)
567
568/* UART Controller */
569#define bfin_read_UART_THR() bfin_read16(UART_THR)
570#define bfin_write_UART_THR(val) bfin_write16(UART_THR,val)
571#define bfin_read_UART_RBR() bfin_read16(UART_RBR)
572#define bfin_write_UART_RBR(val) bfin_write16(UART_RBR,val)
573#define bfin_read_UART_DLL() bfin_read16(UART_DLL)
574#define bfin_write_UART_DLL(val) bfin_write16(UART_DLL,val)
575#define bfin_read_UART_IER() bfin_read16(UART_IER)
576#define bfin_write_UART_IER(val) bfin_write16(UART_IER,val)
577#define bfin_read_UART_DLH() bfin_read16(UART_DLH)
578#define bfin_write_UART_DLH(val) bfin_write16(UART_DLH,val)
579#define bfin_read_UART_IIR() bfin_read16(UART_IIR)
580#define bfin_write_UART_IIR(val) bfin_write16(UART_IIR,val)
581#define bfin_read_UART_LCR() bfin_read16(UART_LCR)
582#define bfin_write_UART_LCR(val) bfin_write16(UART_LCR,val)
583#define bfin_read_UART_MCR() bfin_read16(UART_MCR)
584#define bfin_write_UART_MCR(val) bfin_write16(UART_MCR,val)
585#define bfin_read_UART_LSR() bfin_read16(UART_LSR)
586#define bfin_write_UART_LSR(val) bfin_write16(UART_LSR,val)
587/*
588#define UART_MSR
589*/
590#define bfin_read_UART_SCR() bfin_read16(UART_SCR)
591#define bfin_write_UART_SCR(val) bfin_write16(UART_SCR,val)
592#define bfin_read_UART_GCTL() bfin_read16(UART_GCTL)
593#define bfin_write_UART_GCTL(val) bfin_write16(UART_GCTL,val)
594
595/* SPI Controller */
596#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
597#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL,val)
598#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
599#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG,val)
600#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
601#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT,val)
602#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
603#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR,val)
604#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
605#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR,val)
606#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
607#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD,val)
608#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
609#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW,val)
610
611/* TIMER 0, 1, 2 Registers */
612#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
613#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG,val)
614#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
615#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER,val)
616#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
617#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD,val)
618#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
619#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH,val)
620
621#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
622#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG,val)
623#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
624#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER,val)
625#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
626#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD,val)
627#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
628#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH,val)
629
630#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
631#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG,val)
632#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
633#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER,val)
634#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
635#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD,val)
636#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
637#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH,val)
638
639#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
640#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE,val)
641#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
642#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE,val)
643#define bfin_read_TIMER_STATUS() bfin_read16(TIMER_STATUS)
644#define bfin_write_TIMER_STATUS(val) bfin_write16(TIMER_STATUS,val)
645
646/* SPORT0 Controller */
647#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
648#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1,val)
649#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
650#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2,val)
651#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
652#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV,val)
653#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
654#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV,val)
655#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
656#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX,val)
657#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
658#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX,val)
659#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX)
660#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX,val)
661#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX)
662#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX,val)
663#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX)
664#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX,val)
665#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX)
666#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX,val)
667#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
668#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1,val)
669#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
670#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2,val)
671#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
672#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV,val)
673#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
674#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV,val)
675#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
676#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT,val)
677#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
678#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL,val)
679#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
680#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1,val)
681#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
682#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2,val)
683#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
684#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0,val)
685#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
686#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1,val)
687#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
688#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2,val)
689#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
690#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3,val)
691#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
692#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0,val)
693#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
694#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1,val)
695#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
696#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2,val)
697#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
698#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3,val)
699
700/* SPORT1 Controller */
701#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
702#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1,val)
703#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
704#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2,val)
705#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
706#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV,val)
707#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
708#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV,val)
709#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
710#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val)
711#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
712#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX,val)
713#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX)
714#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val)
715#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX)
716#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX,val)
717#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX)
718#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
719#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX)
720#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX,val)
721#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
722#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1,val)
723#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
724#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2,val)
725#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
726#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV,val)
727#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
728#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV,val)
729#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
730#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT,val)
731#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
732#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL,val)
733#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
734#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1,val)
735#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
736#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2,val)
737#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
738#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0,val)
739#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
740#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1,val)
741#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
742#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2,val)
743#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
744#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3,val)
745#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
746#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0,val)
747#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
748#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1,val)
749#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
750#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2,val)
751#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
752#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3,val)
753
754/* Parallel Peripheral Interface (PPI) */
755#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
756#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL,val)
757#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
758#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS,val)
759#define bfin_clear_PPI_STATUS() bfin_read_PPI_STATUS()
760#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
761#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY,val)
762#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
763#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT,val)
764#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
765#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val)
766
767#endif /* _CDEF_BF532_H */
diff --git a/include/asm-blackfin/mach-bf533/defBF532.h b/include/asm-blackfin/mach-bf533/defBF532.h
deleted file mode 100644
index 0ab4dd7494cf..000000000000
--- a/include/asm-blackfin/mach-bf533/defBF532.h
+++ /dev/null
@@ -1,1266 +0,0 @@
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/* include all Core registers and bit definitions */
51#include <asm/mach-common/def_LPBlackfin.h>
52
53/*********************************************************************************** */
54/* System MMR Register Map */
55/*********************************************************************************** */
56/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
57
58#define PLL_CTL 0xFFC00000 /* PLL Control register (16-bit) */
59#define PLL_DIV 0xFFC00004 /* PLL Divide Register (16-bit) */
60#define VR_CTL 0xFFC00008 /* Voltage Regulator Control Register (16-bit) */
61#define PLL_STAT 0xFFC0000C /* PLL Status register (16-bit) */
62#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */
63#define CHIPID 0xFFC00014 /* Chip ID Register */
64
65/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
66#define SWRST 0xFFC00100 /* Software Reset Register (16-bit) */
67#define SYSCR 0xFFC00104 /* System Configuration registe */
68#define SIC_RVECT 0xFFC00108 /* Interrupt Reset Vector Address Register */
69#define SIC_IMASK 0xFFC0010C /* Interrupt Mask Register */
70#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */
71#define SIC_IAR1 0xFFC00114 /* Interrupt Assignment Register 1 */
72#define SIC_IAR2 0xFFC00118 /* Interrupt Assignment Register 2 */
73#define SIC_ISR 0xFFC00120 /* Interrupt Status Register */
74#define SIC_IWR 0xFFC00124 /* Interrupt Wakeup Register */
75
76/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
77#define WDOG_CTL 0xFFC00200 /* Watchdog Control Register */
78#define WDOG_CNT 0xFFC00204 /* Watchdog Count Register */
79#define WDOG_STAT 0xFFC00208 /* Watchdog Status Register */
80
81/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
82#define RTC_STAT 0xFFC00300 /* RTC Status Register */
83#define RTC_ICTL 0xFFC00304 /* RTC Interrupt Control Register */
84#define RTC_ISTAT 0xFFC00308 /* RTC Interrupt Status Register */
85#define RTC_SWCNT 0xFFC0030C /* RTC Stopwatch Count Register */
86#define RTC_ALARM 0xFFC00310 /* RTC Alarm Time Register */
87#define RTC_FAST 0xFFC00314 /* RTC Prescaler Enable Register */
88#define RTC_PREN 0xFFC00314 /* RTC Prescaler Enable Register (alternate macro) */
89
90/* UART Controller (0xFFC00400 - 0xFFC004FF) */
91
92/*
93 * Because include/linux/serial_reg.h have defined UART_*,
94 * So we define blackfin uart regs to BFIN_UART_*.
95 */
96#define BFIN_UART_THR 0xFFC00400 /* Transmit Holding register */
97#define BFIN_UART_RBR 0xFFC00400 /* Receive Buffer register */
98#define BFIN_UART_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
99#define BFIN_UART_IER 0xFFC00404 /* Interrupt Enable Register */
100#define BFIN_UART_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
101#define BFIN_UART_IIR 0xFFC00408 /* Interrupt Identification Register */
102#define BFIN_UART_LCR 0xFFC0040C /* Line Control Register */
103#define BFIN_UART_MCR 0xFFC00410 /* Modem Control Register */
104#define BFIN_UART_LSR 0xFFC00414 /* Line Status Register */
105#if 0
106#define BFIN_UART_MSR 0xFFC00418 /* Modem Status Register (UNUSED in ADSP-BF532) */
107#endif
108#define BFIN_UART_SCR 0xFFC0041C /* SCR Scratch Register */
109#define BFIN_UART_GCTL 0xFFC00424 /* Global Control Register */
110
111/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
112#define SPI0_REGBASE 0xFFC00500
113#define SPI_CTL 0xFFC00500 /* SPI Control Register */
114#define SPI_FLG 0xFFC00504 /* SPI Flag register */
115#define SPI_STAT 0xFFC00508 /* SPI Status register */
116#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
117#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
118#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
119#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
120
121/* TIMER 0, 1, 2 Registers (0xFFC00600 - 0xFFC006FF) */
122
123#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
124#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
125#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
126#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
127
128#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
129#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
130#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
131#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
132
133#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
134#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
135#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
136#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
137
138#define TIMER_ENABLE 0xFFC00640 /* Timer Enable Register */
139#define TIMER_DISABLE 0xFFC00644 /* Timer Disable Register */
140#define TIMER_STATUS 0xFFC00648 /* Timer Status Register */
141
142/* General Purpose IO (0xFFC00700 - 0xFFC007FF) */
143
144#define FIO_FLAG_D 0xFFC00700 /* Flag Mask to directly specify state of pins */
145#define FIO_FLAG_C 0xFFC00704 /* Peripheral Interrupt Flag Register (clear) */
146#define FIO_FLAG_S 0xFFC00708 /* Peripheral Interrupt Flag Register (set) */
147#define FIO_FLAG_T 0xFFC0070C /* Flag Mask to directly toggle state of pins */
148#define FIO_MASKA_D 0xFFC00710 /* Flag Mask Interrupt A Register (set directly) */
149#define FIO_MASKA_C 0xFFC00714 /* Flag Mask Interrupt A Register (clear) */
150#define FIO_MASKA_S 0xFFC00718 /* Flag Mask Interrupt A Register (set) */
151#define FIO_MASKA_T 0xFFC0071C /* Flag Mask Interrupt A Register (toggle) */
152#define FIO_MASKB_D 0xFFC00720 /* Flag Mask Interrupt B Register (set directly) */
153#define FIO_MASKB_C 0xFFC00724 /* Flag Mask Interrupt B Register (clear) */
154#define FIO_MASKB_S 0xFFC00728 /* Flag Mask Interrupt B Register (set) */
155#define FIO_MASKB_T 0xFFC0072C /* Flag Mask Interrupt B Register (toggle) */
156#define FIO_DIR 0xFFC00730 /* Peripheral Flag Direction Register */
157#define FIO_POLAR 0xFFC00734 /* Flag Source Polarity Register */
158#define FIO_EDGE 0xFFC00738 /* Flag Source Sensitivity Register */
159#define FIO_BOTH 0xFFC0073C /* Flag Set on BOTH Edges Register */
160#define FIO_INEN 0xFFC00740 /* Flag Input Enable Register */
161
162/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
163#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
164#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
165#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
166#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
167#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
168#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
169#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
170#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
171#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
172#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
173#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
174#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
175#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
176#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
177#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
178#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
179#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
180#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
181#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
182#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
183#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
184#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
185
186/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
187#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
188#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
189#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
190#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
191#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
192#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
193#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
194#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
195#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
196#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
197#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
198#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
199#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
200#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
201#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
202#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
203#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
204#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
205#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
206#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
207#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
208#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
209
210/* Asynchronous Memory Controller - External Bus Interface Unit */
211#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
212#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
213#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
214
215/* SDRAM Controller External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
216
217#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
218#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
219#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
220#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
221
222/* DMA Traffic controls */
223#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
224#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
225
226/* Alternate deprecated register names (below) provided for backwards code compatibility */
227#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
228#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
229
230/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
231#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
232#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
233#define DMA0_START_ADDR 0xFFC00C04 /* DMA Channel 0 Start Address Register */
234#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
235#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
236#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
237#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
238#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
239#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
240#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
241#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
242#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
243#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
244
245#define DMA1_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
246#define DMA1_NEXT_DESC_PTR 0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
247#define DMA1_START_ADDR 0xFFC00C44 /* DMA Channel 1 Start Address Register */
248#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
249#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
250#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
251#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
252#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
253#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
254#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
255#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
256#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
257#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
258
259#define DMA2_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
260#define DMA2_NEXT_DESC_PTR 0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
261#define DMA2_START_ADDR 0xFFC00C84 /* DMA Channel 2 Start Address Register */
262#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
263#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
264#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
265#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
266#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
267#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
268#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
269#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
270#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
271#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
272
273#define DMA3_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
274#define DMA3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
275#define DMA3_START_ADDR 0xFFC00CC4 /* DMA Channel 3 Start Address Register */
276#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
277#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
278#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
279#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
280#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
281#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
282#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
283#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
284#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
285#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
286
287#define DMA4_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
288#define DMA4_NEXT_DESC_PTR 0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
289#define DMA4_START_ADDR 0xFFC00D04 /* DMA Channel 4 Start Address Register */
290#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
291#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
292#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
293#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
294#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
295#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
296#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
297#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
298#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
299#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
300
301#define DMA5_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
302#define DMA5_NEXT_DESC_PTR 0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
303#define DMA5_START_ADDR 0xFFC00D44 /* DMA Channel 5 Start Address Register */
304#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
305#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
306#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
307#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
308#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
309#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
310#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
311#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
312#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
313#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
314
315#define DMA6_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
316#define DMA6_NEXT_DESC_PTR 0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
317#define DMA6_START_ADDR 0xFFC00D84 /* DMA Channel 6 Start Address Register */
318#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
319#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
320#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
321#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
322#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
323#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
324#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
325#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
326#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
327#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
328
329#define DMA7_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
330#define DMA7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
331#define DMA7_START_ADDR 0xFFC00DC4 /* DMA Channel 7 Start Address Register */
332#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
333#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
334#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
335#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
336#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
337#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
338#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
339#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
340#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
341#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
342
343#define MDMA_D1_CONFIG 0xFFC00E88 /* MemDMA Stream 1 Destination Configuration Register */
344#define MDMA_D1_NEXT_DESC_PTR 0xFFC00E80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
345#define MDMA_D1_START_ADDR 0xFFC00E84 /* MemDMA Stream 1 Destination Start Address Register */
346#define MDMA_D1_X_COUNT 0xFFC00E90 /* MemDMA Stream 1 Destination X Count Register */
347#define MDMA_D1_Y_COUNT 0xFFC00E98 /* MemDMA Stream 1 Destination Y Count Register */
348#define MDMA_D1_X_MODIFY 0xFFC00E94 /* MemDMA Stream 1 Destination X Modify Register */
349#define MDMA_D1_Y_MODIFY 0xFFC00E9C /* MemDMA Stream 1 Destination Y Modify Register */
350#define MDMA_D1_CURR_DESC_PTR 0xFFC00EA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
351#define MDMA_D1_CURR_ADDR 0xFFC00EA4 /* MemDMA Stream 1 Destination Current Address Register */
352#define MDMA_D1_CURR_X_COUNT 0xFFC00EB0 /* MemDMA Stream 1 Destination Current X Count Register */
353#define MDMA_D1_CURR_Y_COUNT 0xFFC00EB8 /* MemDMA Stream 1 Destination Current Y Count Register */
354#define MDMA_D1_IRQ_STATUS 0xFFC00EA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
355#define MDMA_D1_PERIPHERAL_MAP 0xFFC00EAC /* MemDMA Stream 1 Destination Peripheral Map Register */
356
357#define MDMA_S1_CONFIG 0xFFC00EC8 /* MemDMA Stream 1 Source Configuration Register */
358#define MDMA_S1_NEXT_DESC_PTR 0xFFC00EC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
359#define MDMA_S1_START_ADDR 0xFFC00EC4 /* MemDMA Stream 1 Source Start Address Register */
360#define MDMA_S1_X_COUNT 0xFFC00ED0 /* MemDMA Stream 1 Source X Count Register */
361#define MDMA_S1_Y_COUNT 0xFFC00ED8 /* MemDMA Stream 1 Source Y Count Register */
362#define MDMA_S1_X_MODIFY 0xFFC00ED4 /* MemDMA Stream 1 Source X Modify Register */
363#define MDMA_S1_Y_MODIFY 0xFFC00EDC /* MemDMA Stream 1 Source Y Modify Register */
364#define MDMA_S1_CURR_DESC_PTR 0xFFC00EE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
365#define MDMA_S1_CURR_ADDR 0xFFC00EE4 /* MemDMA Stream 1 Source Current Address Register */
366#define MDMA_S1_CURR_X_COUNT 0xFFC00EF0 /* MemDMA Stream 1 Source Current X Count Register */
367#define MDMA_S1_CURR_Y_COUNT 0xFFC00EF8 /* MemDMA Stream 1 Source Current Y Count Register */
368#define MDMA_S1_IRQ_STATUS 0xFFC00EE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
369#define MDMA_S1_PERIPHERAL_MAP 0xFFC00EEC /* MemDMA Stream 1 Source Peripheral Map Register */
370
371#define MDMA_D0_CONFIG 0xFFC00E08 /* MemDMA Stream 0 Destination Configuration Register */
372#define MDMA_D0_NEXT_DESC_PTR 0xFFC00E00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
373#define MDMA_D0_START_ADDR 0xFFC00E04 /* MemDMA Stream 0 Destination Start Address Register */
374#define MDMA_D0_X_COUNT 0xFFC00E10 /* MemDMA Stream 0 Destination X Count Register */
375#define MDMA_D0_Y_COUNT 0xFFC00E18 /* MemDMA Stream 0 Destination Y Count Register */
376#define MDMA_D0_X_MODIFY 0xFFC00E14 /* MemDMA Stream 0 Destination X Modify Register */
377#define MDMA_D0_Y_MODIFY 0xFFC00E1C /* MemDMA Stream 0 Destination Y Modify Register */
378#define MDMA_D0_CURR_DESC_PTR 0xFFC00E20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
379#define MDMA_D0_CURR_ADDR 0xFFC00E24 /* MemDMA Stream 0 Destination Current Address Register */
380#define MDMA_D0_CURR_X_COUNT 0xFFC00E30 /* MemDMA Stream 0 Destination Current X Count Register */
381#define MDMA_D0_CURR_Y_COUNT 0xFFC00E38 /* MemDMA Stream 0 Destination Current Y Count Register */
382#define MDMA_D0_IRQ_STATUS 0xFFC00E28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
383#define MDMA_D0_PERIPHERAL_MAP 0xFFC00E2C /* MemDMA Stream 0 Destination Peripheral Map Register */
384
385#define MDMA_S0_CONFIG 0xFFC00E48 /* MemDMA Stream 0 Source Configuration Register */
386#define MDMA_S0_NEXT_DESC_PTR 0xFFC00E40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
387#define MDMA_S0_START_ADDR 0xFFC00E44 /* MemDMA Stream 0 Source Start Address Register */
388#define MDMA_S0_X_COUNT 0xFFC00E50 /* MemDMA Stream 0 Source X Count Register */
389#define MDMA_S0_Y_COUNT 0xFFC00E58 /* MemDMA Stream 0 Source Y Count Register */
390#define MDMA_S0_X_MODIFY 0xFFC00E54 /* MemDMA Stream 0 Source X Modify Register */
391#define MDMA_S0_Y_MODIFY 0xFFC00E5C /* MemDMA Stream 0 Source Y Modify Register */
392#define MDMA_S0_CURR_DESC_PTR 0xFFC00E60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
393#define MDMA_S0_CURR_ADDR 0xFFC00E64 /* MemDMA Stream 0 Source Current Address Register */
394#define MDMA_S0_CURR_X_COUNT 0xFFC00E70 /* MemDMA Stream 0 Source Current X Count Register */
395#define MDMA_S0_CURR_Y_COUNT 0xFFC00E78 /* MemDMA Stream 0 Source Current Y Count Register */
396#define MDMA_S0_IRQ_STATUS 0xFFC00E68 /* MemDMA Stream 0 Source Interrupt/Status Register */
397#define MDMA_S0_PERIPHERAL_MAP 0xFFC00E6C /* MemDMA Stream 0 Source Peripheral Map Register */
398
399/* Parallel Peripheral Interface (PPI) (0xFFC01000 - 0xFFC010FF) */
400
401#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
402#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
403#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
404#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
405#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
406
407/*********************************************************************************** */
408/* System MMR Register Bits */
409/******************************************************************************* */
410
411/* ********************* PLL AND RESET MASKS ************************ */
412
413/* PLL_CTL Masks */
414#define PLL_CLKIN 0x0000 /* Pass CLKIN to PLL */
415#define PLL_CLKIN_DIV2 0x0001 /* Pass CLKIN/2 to PLL */
416#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
417#define PLL_OFF 0x0002 /* Shut off PLL clocks */
418#define STOPCK_OFF 0x0008 /* Core clock off */
419#define STOPCK 0x0008 /* Core Clock Off */
420#define PDWN 0x0020 /* Put the PLL in a Deep Sleep state */
421#if !defined(__ADSPBF538__)
422/* this file is included in defBF538.h but IN_DELAY/OUT_DELAY are different */
423# define IN_DELAY 0x0040 /* Add 200ps Delay To EBIU Input Latches */
424# define OUT_DELAY 0x0080 /* Add 200ps Delay To EBIU Output Signals */
425#endif
426#define BYPASS 0x0100 /* Bypass the PLL */
427/* PLL_CTL Macros (Only Use With Logic OR While Setting Lower Order Bits) */
428#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
429
430/* PLL_DIV Masks */
431#define SSEL 0x000F /* System Select */
432#define CSEL 0x0030 /* Core Select */
433
434#define SCLK_DIV(x) (x) /* SCLK = VCO / x */
435
436#define CCLK_DIV1 0x00000000 /* CCLK = VCO / 1 */
437#define CCLK_DIV2 0x00000010 /* CCLK = VCO / 2 */
438#define CCLK_DIV4 0x00000020 /* CCLK = VCO / 4 */
439#define CCLK_DIV8 0x00000030 /* CCLK = VCO / 8 */
440/* PLL_DIV Macros */
441#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
442
443/* PLL_STAT Masks */
444#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
445#define FULL_ON 0x0002 /* Processor In Full On Mode */
446#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
447#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
448
449/* VR_CTL Masks */
450#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
451#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
452#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
453#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
454#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
455
456#define GAIN 0x000C /* Voltage Level Gain */
457#define GAIN_5 0x0000 /* GAIN = 5 */
458#define GAIN_10 0x0004 /* GAIN = 10 */
459#define GAIN_20 0x0008 /* GAIN = 20 */
460#define GAIN_50 0x000C /* GAIN = 50 */
461
462#define VLEV 0x00F0 /* Internal Voltage Level */
463#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
464#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
465#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
466#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
467#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
468#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
469#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
470#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
471#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
472#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
473
474#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
475#define SCKELOW 0x8000 /* Do Not Drive SCKE High During Reset After Hibernate */
476
477/* CHIPID Masks */
478#define CHIPID_VERSION 0xF0000000
479#define CHIPID_FAMILY 0x0FFFF000
480#define CHIPID_MANUFACTURE 0x00000FFE
481
482/* SWRST Mask */
483#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
484#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
485#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
486#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
487#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
488
489/* SYSCR Masks */
490#define BMODE 0x0006 /* Boot Mode - Latched During HW Reset From Mode Pins */
491#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
492
493/* ************* SYSTEM INTERRUPT CONTROLLER MASKS ***************** */
494
495 /* SIC_IAR0 Masks */
496
497#define P0_IVG(x) ((x)-7) /* Peripheral #0 assigned IVG #x */
498#define P1_IVG(x) ((x)-7) << 0x4 /* Peripheral #1 assigned IVG #x */
499#define P2_IVG(x) ((x)-7) << 0x8 /* Peripheral #2 assigned IVG #x */
500#define P3_IVG(x) ((x)-7) << 0xC /* Peripheral #3 assigned IVG #x */
501#define P4_IVG(x) ((x)-7) << 0x10 /* Peripheral #4 assigned IVG #x */
502#define P5_IVG(x) ((x)-7) << 0x14 /* Peripheral #5 assigned IVG #x */
503#define P6_IVG(x) ((x)-7) << 0x18 /* Peripheral #6 assigned IVG #x */
504#define P7_IVG(x) ((x)-7) << 0x1C /* Peripheral #7 assigned IVG #x */
505
506/* SIC_IAR1 Masks */
507
508#define P8_IVG(x) ((x)-7) /* Peripheral #8 assigned IVG #x */
509#define P9_IVG(x) ((x)-7) << 0x4 /* Peripheral #9 assigned IVG #x */
510#define P10_IVG(x) ((x)-7) << 0x8 /* Peripheral #10 assigned IVG #x */
511#define P11_IVG(x) ((x)-7) << 0xC /* Peripheral #11 assigned IVG #x */
512#define P12_IVG(x) ((x)-7) << 0x10 /* Peripheral #12 assigned IVG #x */
513#define P13_IVG(x) ((x)-7) << 0x14 /* Peripheral #13 assigned IVG #x */
514#define P14_IVG(x) ((x)-7) << 0x18 /* Peripheral #14 assigned IVG #x */
515#define P15_IVG(x) ((x)-7) << 0x1C /* Peripheral #15 assigned IVG #x */
516
517/* SIC_IAR2 Masks */
518#define P16_IVG(x) ((x)-7) /* Peripheral #16 assigned IVG #x */
519#define P17_IVG(x) ((x)-7) << 0x4 /* Peripheral #17 assigned IVG #x */
520#define P18_IVG(x) ((x)-7) << 0x8 /* Peripheral #18 assigned IVG #x */
521#define P19_IVG(x) ((x)-7) << 0xC /* Peripheral #19 assigned IVG #x */
522#define P20_IVG(x) ((x)-7) << 0x10 /* Peripheral #20 assigned IVG #x */
523#define P21_IVG(x) ((x)-7) << 0x14 /* Peripheral #21 assigned IVG #x */
524#define P22_IVG(x) ((x)-7) << 0x18 /* Peripheral #22 assigned IVG #x */
525#define P23_IVG(x) ((x)-7) << 0x1C /* Peripheral #23 assigned IVG #x */
526
527/* SIC_IMASK Masks */
528#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
529#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
530#define SIC_MASK(x) (1 << (x)) /* Mask Peripheral #x interrupt */
531#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << (x))) /* Unmask Peripheral #x interrupt */
532
533/* SIC_IWR Masks */
534#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
535#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
536#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
537#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
538
539/* ***************************** UART CONTROLLER MASKS ********************** */
540
541/* UART_LCR Register */
542
543#define DLAB 0x80
544#define SB 0x40
545#define STP 0x20
546#define EPS 0x10
547#define PEN 0x08
548#define STB 0x04
549#define WLS(x) ((x-5) & 0x03)
550
551#define DLAB_P 0x07
552#define SB_P 0x06
553#define STP_P 0x05
554#define EPS_P 0x04
555#define PEN_P 0x03
556#define STB_P 0x02
557#define WLS_P1 0x01
558#define WLS_P0 0x00
559
560/* UART_MCR Register */
561#define LOOP_ENA 0x10
562#define LOOP_ENA_P 0x04
563
564/* UART_LSR Register */
565#define TEMT 0x40
566#define THRE 0x20
567#define BI 0x10
568#define FE 0x08
569#define PE 0x04
570#define OE 0x02
571#define DR 0x01
572
573#define TEMP_P 0x06
574#define THRE_P 0x05
575#define BI_P 0x04
576#define FE_P 0x03
577#define PE_P 0x02
578#define OE_P 0x01
579#define DR_P 0x00
580
581/* UART_IER Register */
582#define ELSI 0x04
583#define ETBEI 0x02
584#define ERBFI 0x01
585
586#define ELSI_P 0x02
587#define ETBEI_P 0x01
588#define ERBFI_P 0x00
589
590/* UART_IIR Register */
591#define STATUS(x) ((x << 1) & 0x06)
592#define NINT 0x01
593#define STATUS_P1 0x02
594#define STATUS_P0 0x01
595#define NINT_P 0x00
596#define IIR_TX_READY 0x02 /* UART_THR empty */
597#define IIR_RX_READY 0x04 /* Receive data ready */
598#define IIR_LINE_CHANGE 0x06 /* Receive line status */
599#define IIR_STATUS 0x06
600
601/* UART_GCTL Register */
602#define FFE 0x20
603#define FPE 0x10
604#define RPOLC 0x08
605#define TPOLC 0x04
606#define IREN 0x02
607#define UCEN 0x01
608
609#define FFE_P 0x05
610#define FPE_P 0x04
611#define RPOLC_P 0x03
612#define TPOLC_P 0x02
613#define IREN_P 0x01
614#define UCEN_P 0x00
615
616/* ********** SERIAL PORT MASKS ********************** */
617
618/* SPORTx_TCR1 Masks */
619#define TSPEN 0x0001 /* TX enable */
620#define ITCLK 0x0002 /* Internal TX Clock Select */
621#define TDTYPE 0x000C /* TX Data Formatting Select */
622#define DTYPE_NORM 0x0000 /* Data Format Normal */
623#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
624#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
625#define TLSBIT 0x0010 /* TX Bit Order */
626#define ITFS 0x0200 /* Internal TX Frame Sync Select */
627#define TFSR 0x0400 /* TX Frame Sync Required Select */
628#define DITFS 0x0800 /* Data Independent TX Frame Sync Select */
629#define LTFS 0x1000 /* Low TX Frame Sync Select */
630#define LATFS 0x2000 /* Late TX Frame Sync Select */
631#define TCKFE 0x4000 /* TX Clock Falling Edge Select */
632
633/* SPORTx_TCR2 Masks */
634#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || \
635 defined(__ADSPBF533__)
636# define SLEN 0x001F /*TX Word Length */
637#else
638# define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
639#endif
640#define TXSE 0x0100 /*TX Secondary Enable */
641#define TSFSE 0x0200 /*TX Stereo Frame Sync Enable */
642#define TRFST 0x0400 /*TX Right-First Data Order */
643
644/* SPORTx_RCR1 Masks */
645#define RSPEN 0x0001 /* RX enable */
646#define IRCLK 0x0002 /* Internal RX Clock Select */
647#define RDTYPE 0x000C /* RX Data Formatting Select */
648#define DTYPE_NORM 0x0000 /* no companding */
649#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
650#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
651#define RLSBIT 0x0010 /* RX Bit Order */
652#define IRFS 0x0200 /* Internal RX Frame Sync Select */
653#define RFSR 0x0400 /* RX Frame Sync Required Select */
654#define LRFS 0x1000 /* Low RX Frame Sync Select */
655#define LARFS 0x2000 /* Late RX Frame Sync Select */
656#define RCKFE 0x4000 /* RX Clock Falling Edge Select */
657
658/* SPORTx_RCR2 Masks */
659/* SLEN defined above */
660#define RXSE 0x0100 /*RX Secondary Enable */
661#define RSFSE 0x0200 /*RX Stereo Frame Sync Enable */
662#define RRFST 0x0400 /*Right-First Data Order */
663
664/*SPORTx_STAT Masks */
665#define RXNE 0x0001 /*RX FIFO Not Empty Status */
666#define RUVF 0x0002 /*RX Underflow Status */
667#define ROVF 0x0004 /*RX Overflow Status */
668#define TXF 0x0008 /*TX FIFO Full Status */
669#define TUVF 0x0010 /*TX Underflow Status */
670#define TOVF 0x0020 /*TX Overflow Status */
671#define TXHRE 0x0040 /*TX Hold Register Empty */
672
673/*SPORTx_MCMC1 Masks */
674#define SP_WSIZE 0x0000F000 /*Multichannel Window Size Field */
675#define SP_WOFF 0x000003FF /*Multichannel Window Offset Field */
676/* SPORTx_MCMC1 Macros */
677#define SET_SP_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
678/* Only use SET_WSIZE Macro With Logic OR While Setting Lower Order Bits */
679#define SET_SP_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
680
681/*SPORTx_MCMC2 Masks */
682#define MCCRM 0x00000003 /*Multichannel Clock Recovery Mode */
683#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
684#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
685#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
686#define MCDTXPE 0x00000004 /*Multichannel DMA Transmit Packing */
687#define MCDRXPE 0x00000008 /*Multichannel DMA Receive Packing */
688#define MCMEN 0x00000010 /*Multichannel Frame Mode Enable */
689#define FSDR 0x00000080 /*Multichannel Frame Sync to Data Relationship */
690#define MFD 0x0000F000 /*Multichannel Frame Delay */
691#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
692#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
693#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
694#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
695#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
696#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
697#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
698#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
699#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
700#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
701#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
702#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
703#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
704#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
705#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
706#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
707
708/* ********* PARALLEL PERIPHERAL INTERFACE (PPI) MASKS **************** */
709
710/* PPI_CONTROL Masks */
711#define PORT_EN 0x00000001 /* PPI Port Enable */
712#define PORT_DIR 0x00000002 /* PPI Port Direction */
713#define XFR_TYPE 0x0000000C /* PPI Transfer Type */
714#define PORT_CFG 0x00000030 /* PPI Port Configuration */
715#define FLD_SEL 0x00000040 /* PPI Active Field Select */
716#define PACK_EN 0x00000080 /* PPI Packing Mode */
717#define DMA32 0x00000100 /* PPI 32-bit DMA Enable */
718#define SKIP_EN 0x00000200 /* PPI Skip Element Enable */
719#define SKIP_EO 0x00000400 /* PPI Skip Even/Odd Elements */
720#define DLENGTH 0x00003800 /* PPI Data Length */
721#define DLEN_8 0x0000 /* Data Length = 8 Bits */
722#define DLEN_10 0x0800 /* Data Length = 10 Bits */
723#define DLEN_11 0x1000 /* Data Length = 11 Bits */
724#define DLEN_12 0x1800 /* Data Length = 12 Bits */
725#define DLEN_13 0x2000 /* Data Length = 13 Bits */
726#define DLEN_14 0x2800 /* Data Length = 14 Bits */
727#define DLEN_15 0x3000 /* Data Length = 15 Bits */
728#define DLEN_16 0x3800 /* Data Length = 16 Bits */
729#define DLEN(x) (((x-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */
730#define POL 0x0000C000 /* PPI Signal Polarities */
731#define POLC 0x4000 /* PPI Clock Polarity */
732#define POLS 0x8000 /* PPI Frame Sync Polarity */
733
734/* PPI_STATUS Masks */
735#define FLD 0x00000400 /* Field Indicator */
736#define FT_ERR 0x00000800 /* Frame Track Error */
737#define OVR 0x00001000 /* FIFO Overflow Error */
738#define UNDR 0x00002000 /* FIFO Underrun Error */
739#define ERR_DET 0x00004000 /* Error Detected Indicator */
740#define ERR_NCOR 0x00008000 /* Error Not Corrected Indicator */
741
742/* ********** DMA CONTROLLER MASKS *********************8 */
743
744/*DMAx_CONFIG, MDMA_yy_CONFIG Masks */
745#define DMAEN 0x00000001 /* Channel Enable */
746#define WNR 0x00000002 /* Channel Direction (W/R*) */
747#define WDSIZE_8 0x00000000 /* Word Size 8 bits */
748#define WDSIZE_16 0x00000004 /* Word Size 16 bits */
749#define WDSIZE_32 0x00000008 /* Word Size 32 bits */
750#define DMA2D 0x00000010 /* 2D/1D* Mode */
751#define RESTART 0x00000020 /* Restart */
752#define DI_SEL 0x00000040 /* Data Interrupt Select */
753#define DI_EN 0x00000080 /* Data Interrupt Enable */
754#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
755#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
756#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
757#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
758#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
759#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
760#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
761#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
762#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
763#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
764#define NDSIZE 0x00000900 /* Next Descriptor Size */
765#define DMAFLOW 0x00007000 /* Flow Control */
766#define DMAFLOW_STOP 0x0000 /* Stop Mode */
767#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
768#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
769#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
770#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
771
772#define DMAEN_P 0 /* Channel Enable */
773#define WNR_P 1 /* Channel Direction (W/R*) */
774#define DMA2D_P 4 /* 2D/1D* Mode */
775#define RESTART_P 5 /* Restart */
776#define DI_SEL_P 6 /* Data Interrupt Select */
777#define DI_EN_P 7 /* Data Interrupt Enable */
778
779/*DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
780
781#define DMA_DONE 0x00000001 /* DMA Done Indicator */
782#define DMA_ERR 0x00000002 /* DMA Error Indicator */
783#define DFETCH 0x00000004 /* Descriptor Fetch Indicator */
784#define DMA_RUN 0x00000008 /* DMA Running Indicator */
785
786#define DMA_DONE_P 0 /* DMA Done Indicator */
787#define DMA_ERR_P 1 /* DMA Error Indicator */
788#define DFETCH_P 2 /* Descriptor Fetch Indicator */
789#define DMA_RUN_P 3 /* DMA Running Indicator */
790
791/*DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
792
793#define CTYPE 0x00000040 /* DMA Channel Type Indicator */
794#define CTYPE_P 6 /* DMA Channel Type Indicator BIT POSITION */
795#define PCAP8 0x00000080 /* DMA 8-bit Operation Indicator */
796#define PCAP16 0x00000100 /* DMA 16-bit Operation Indicator */
797#define PCAP32 0x00000200 /* DMA 32-bit Operation Indicator */
798#define PCAPWR 0x00000400 /* DMA Write Operation Indicator */
799#define PCAPRD 0x00000800 /* DMA Read Operation Indicator */
800#define PMAP 0x00007000 /* DMA Peripheral Map Field */
801
802#define PMAP_PPI 0x0000 /* PMAP PPI Port DMA */
803#define PMAP_SPORT0RX 0x1000 /* PMAP SPORT0 Receive DMA */
804#define PMAP_SPORT0TX 0x2000 /* PMAP SPORT0 Transmit DMA */
805#define PMAP_SPORT1RX 0x3000 /* PMAP SPORT1 Receive DMA */
806#define PMAP_SPORT1TX 0x4000 /* PMAP SPORT1 Transmit DMA */
807#define PMAP_SPI 0x5000 /* PMAP SPI DMA */
808#define PMAP_UARTRX 0x6000 /* PMAP UART Receive DMA */
809#define PMAP_UARTTX 0x7000 /* PMAP UART Transmit DMA */
810
811/* ************* GENERAL PURPOSE TIMER MASKS ******************** */
812
813/* PWM Timer bit definitions */
814
815/* TIMER_ENABLE Register */
816#define TIMEN0 0x0001
817#define TIMEN1 0x0002
818#define TIMEN2 0x0004
819
820#define TIMEN0_P 0x00
821#define TIMEN1_P 0x01
822#define TIMEN2_P 0x02
823
824/* TIMER_DISABLE Register */
825#define TIMDIS0 0x0001
826#define TIMDIS1 0x0002
827#define TIMDIS2 0x0004
828
829#define TIMDIS0_P 0x00
830#define TIMDIS1_P 0x01
831#define TIMDIS2_P 0x02
832
833/* TIMER_STATUS Register */
834#define TIMIL0 0x0001
835#define TIMIL1 0x0002
836#define TIMIL2 0x0004
837#define TOVF_ERR0 0x0010 /* Timer 0 Counter Overflow */
838#define TOVF_ERR1 0x0020 /* Timer 1 Counter Overflow */
839#define TOVF_ERR2 0x0040 /* Timer 2 Counter Overflow */
840#define TRUN0 0x1000
841#define TRUN1 0x2000
842#define TRUN2 0x4000
843
844#define TIMIL0_P 0x00
845#define TIMIL1_P 0x01
846#define TIMIL2_P 0x02
847#define TOVF_ERR0_P 0x04
848#define TOVF_ERR1_P 0x05
849#define TOVF_ERR2_P 0x06
850#define TRUN0_P 0x0C
851#define TRUN1_P 0x0D
852#define TRUN2_P 0x0E
853
854/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
855#define TOVL_ERR0 TOVF_ERR0
856#define TOVL_ERR1 TOVF_ERR1
857#define TOVL_ERR2 TOVF_ERR2
858#define TOVL_ERR0_P TOVF_ERR0_P
859#define TOVL_ERR1_P TOVF_ERR1_P
860#define TOVL_ERR2_P TOVF_ERR2_P
861
862/* TIMERx_CONFIG Registers */
863#define PWM_OUT 0x0001
864#define WDTH_CAP 0x0002
865#define EXT_CLK 0x0003
866#define PULSE_HI 0x0004
867#define PERIOD_CNT 0x0008
868#define IRQ_ENA 0x0010
869#define TIN_SEL 0x0020
870#define OUT_DIS 0x0040
871#define CLK_SEL 0x0080
872#define TOGGLE_HI 0x0100
873#define EMU_RUN 0x0200
874#define ERR_TYP(x) ((x & 0x03) << 14)
875
876#define TMODE_P0 0x00
877#define TMODE_P1 0x01
878#define PULSE_HI_P 0x02
879#define PERIOD_CNT_P 0x03
880#define IRQ_ENA_P 0x04
881#define TIN_SEL_P 0x05
882#define OUT_DIS_P 0x06
883#define CLK_SEL_P 0x07
884#define TOGGLE_HI_P 0x08
885#define EMU_RUN_P 0x09
886#define ERR_TYP_P0 0x0E
887#define ERR_TYP_P1 0x0F
888
889/*/ ****************** PROGRAMMABLE FLAG MASKS ********************* */
890
891/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
892#define PF0 0x0001
893#define PF1 0x0002
894#define PF2 0x0004
895#define PF3 0x0008
896#define PF4 0x0010
897#define PF5 0x0020
898#define PF6 0x0040
899#define PF7 0x0080
900#define PF8 0x0100
901#define PF9 0x0200
902#define PF10 0x0400
903#define PF11 0x0800
904#define PF12 0x1000
905#define PF13 0x2000
906#define PF14 0x4000
907#define PF15 0x8000
908
909/* General Purpose IO (0xFFC00700 - 0xFFC007FF) BIT POSITIONS */
910#define PF0_P 0
911#define PF1_P 1
912#define PF2_P 2
913#define PF3_P 3
914#define PF4_P 4
915#define PF5_P 5
916#define PF6_P 6
917#define PF7_P 7
918#define PF8_P 8
919#define PF9_P 9
920#define PF10_P 10
921#define PF11_P 11
922#define PF12_P 12
923#define PF13_P 13
924#define PF14_P 14
925#define PF15_P 15
926
927/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS **************** */
928
929/* SPI_CTL Masks */
930#define TIMOD 0x00000003 /* Transfer initiation mode and interrupt generation */
931#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
932#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
933#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
934#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
935#define SZ 0x00000004 /* Send Zero (=0) or last (=1) word when TDBR empty. */
936#define GM 0x00000008 /* When RDBR full, get more (=1) data or discard (=0) incoming Data */
937#define PSSE 0x00000010 /* Enable (=1) Slave-Select input for Master. */
938#define EMISO 0x00000020 /* Enable (=1) MISO pin as an output. */
939#define SIZE 0x00000100 /* Word length (0 => 8 bits, 1 => 16 bits) */
940#define LSBF 0x00000200 /* Data format (0 => MSB sent/received first 1 => LSB sent/received first) */
941#define CPHA 0x00000400 /* Clock phase (0 => SPICLK starts toggling in middle of xfer, 1 => SPICLK toggles at the beginning of xfer. */
942#define CPOL 0x00000800 /* Clock polarity (0 => active-high, 1 => active-low) */
943#define MSTR 0x00001000 /* Configures SPI as master (=1) or slave (=0) */
944#define WOM 0x00002000 /* Open drain (=1) data output enable (for MOSI and MISO) */
945#define SPE 0x00004000 /* SPI module enable (=1), disable (=0) */
946
947/* SPI_FLG Masks */
948#define FLS1 0x00000002 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
949#define FLS2 0x00000004 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
950#define FLS3 0x00000008 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
951#define FLS4 0x00000010 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
952#define FLS5 0x00000020 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
953#define FLS6 0x00000040 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
954#define FLS7 0x00000080 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
955#define FLG1 0x00000200 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
956#define FLG2 0x00000400 /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
957#define FLG3 0x00000800 /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
958#define FLG4 0x00001000 /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
959#define FLG5 0x00002000 /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
960#define FLG6 0x00004000 /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
961#define FLG7 0x00008000 /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
962
963/* SPI_FLG Bit Positions */
964#define FLS1_P 0x00000001 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
965#define FLS2_P 0x00000002 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
966#define FLS3_P 0x00000003 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
967#define FLS4_P 0x00000004 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
968#define FLS5_P 0x00000005 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
969#define FLS6_P 0x00000006 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
970#define FLS7_P 0x00000007 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
971#define FLG1_P 0x00000009 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
972#define FLG2_P 0x0000000A /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
973#define FLG3_P 0x0000000B /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
974#define FLG4_P 0x0000000C /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
975#define FLG5_P 0x0000000D /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
976#define FLG6_P 0x0000000E /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
977#define FLG7_P 0x0000000F /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
978
979/* SPI_STAT Masks */
980#define SPIF 0x00000001 /* Set (=1) when SPI single-word transfer complete */
981#define MODF 0x00000002 /* Set (=1) in a master device when some other device tries to become master */
982#define TXE 0x00000004 /* Set (=1) when transmission occurs with no new data in SPI_TDBR */
983#define TXS 0x00000008 /* SPI_TDBR Data Buffer Status (0=Empty, 1=Full) */
984#define RBSY 0x00000010 /* Set (=1) when data is received with RDBR full */
985#define RXS 0x00000020 /* SPI_RDBR Data Buffer Status (0=Empty, 1=Full) */
986#define TXCOL 0x00000040 /* When set (=1), corrupt data may have been transmitted */
987
988/* SPIx_FLG Masks */
989#define FLG1E 0xFDFF /* Activates SPI_FLOUT1 */
990#define FLG2E 0xFBFF /* Activates SPI_FLOUT2 */
991#define FLG3E 0xF7FF /* Activates SPI_FLOUT3 */
992#define FLG4E 0xEFFF /* Activates SPI_FLOUT4 */
993#define FLG5E 0xDFFF /* Activates SPI_FLOUT5 */
994#define FLG6E 0xBFFF /* Activates SPI_FLOUT6 */
995#define FLG7E 0x7FFF /* Activates SPI_FLOUT7 */
996
997/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS ************* */
998
999/* AMGCTL Masks */
1000#define AMCKEN 0x00000001 /* Enable CLKOUT */
1001#define AMBEN_NONE 0x00000000 /* All Banks Disabled */
1002#define AMBEN_B0 0x00000002 /* Enable Asynchronous Memory Bank 0 only */
1003#define AMBEN_B0_B1 0x00000004 /* Enable Asynchronous Memory Banks 0 & 1 only */
1004#define AMBEN_B0_B1_B2 0x00000006 /* Enable Asynchronous Memory Banks 0, 1, and 2 */
1005#define AMBEN_ALL 0x00000008 /* Enable Asynchronous Memory Banks (all) 0, 1, 2, and 3 */
1006
1007/* AMGCTL Bit Positions */
1008#define AMCKEN_P 0x00000000 /* Enable CLKOUT */
1009#define AMBEN_P0 0x00000001 /* Asynchronous Memory Enable, 000 - banks 0-3 disabled, 001 - Bank 0 enabled */
1010#define AMBEN_P1 0x00000002 /* Asynchronous Memory Enable, 010 - banks 0&1 enabled, 011 - banks 0-3 enabled */
1011#define AMBEN_P2 0x00000003 /* Asynchronous Memory Enable, 1xx - All banks (bank 0, 1, 2, and 3) enabled */
1012
1013/* AMBCTL0 Masks */
1014#define B0RDYEN 0x00000001 /* Bank 0 RDY Enable, 0=disable, 1=enable */
1015#define B0RDYPOL 0x00000002 /* Bank 0 RDY Active high, 0=active low, 1=active high */
1016#define B0TT_1 0x00000004 /* Bank 0 Transition Time from Read to Write = 1 cycle */
1017#define B0TT_2 0x00000008 /* Bank 0 Transition Time from Read to Write = 2 cycles */
1018#define B0TT_3 0x0000000C /* Bank 0 Transition Time from Read to Write = 3 cycles */
1019#define B0TT_4 0x00000000 /* Bank 0 Transition Time from Read to Write = 4 cycles */
1020#define B0ST_1 0x00000010 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=1 cycle */
1021#define B0ST_2 0x00000020 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=2 cycles */
1022#define B0ST_3 0x00000030 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=3 cycles */
1023#define B0ST_4 0x00000000 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=4 cycles */
1024#define B0HT_1 0x00000040 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 1 cycle */
1025#define B0HT_2 0x00000080 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */
1026#define B0HT_3 0x000000C0 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 3 cycles */
1027#define B0HT_0 0x00000000 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 0 cycles */
1028#define B0RAT_1 0x00000100 /* Bank 0 Read Access Time = 1 cycle */
1029#define B0RAT_2 0x00000200 /* Bank 0 Read Access Time = 2 cycles */
1030#define B0RAT_3 0x00000300 /* Bank 0 Read Access Time = 3 cycles */
1031#define B0RAT_4 0x00000400 /* Bank 0 Read Access Time = 4 cycles */
1032#define B0RAT_5 0x00000500 /* Bank 0 Read Access Time = 5 cycles */
1033#define B0RAT_6 0x00000600 /* Bank 0 Read Access Time = 6 cycles */
1034#define B0RAT_7 0x00000700 /* Bank 0 Read Access Time = 7 cycles */
1035#define B0RAT_8 0x00000800 /* Bank 0 Read Access Time = 8 cycles */
1036#define B0RAT_9 0x00000900 /* Bank 0 Read Access Time = 9 cycles */
1037#define B0RAT_10 0x00000A00 /* Bank 0 Read Access Time = 10 cycles */
1038#define B0RAT_11 0x00000B00 /* Bank 0 Read Access Time = 11 cycles */
1039#define B0RAT_12 0x00000C00 /* Bank 0 Read Access Time = 12 cycles */
1040#define B0RAT_13 0x00000D00 /* Bank 0 Read Access Time = 13 cycles */
1041#define B0RAT_14 0x00000E00 /* Bank 0 Read Access Time = 14 cycles */
1042#define B0RAT_15 0x00000F00 /* Bank 0 Read Access Time = 15 cycles */
1043#define B0WAT_1 0x00001000 /* Bank 0 Write Access Time = 1 cycle */
1044#define B0WAT_2 0x00002000 /* Bank 0 Write Access Time = 2 cycles */
1045#define B0WAT_3 0x00003000 /* Bank 0 Write Access Time = 3 cycles */
1046#define B0WAT_4 0x00004000 /* Bank 0 Write Access Time = 4 cycles */
1047#define B0WAT_5 0x00005000 /* Bank 0 Write Access Time = 5 cycles */
1048#define B0WAT_6 0x00006000 /* Bank 0 Write Access Time = 6 cycles */
1049#define B0WAT_7 0x00007000 /* Bank 0 Write Access Time = 7 cycles */
1050#define B0WAT_8 0x00008000 /* Bank 0 Write Access Time = 8 cycles */
1051#define B0WAT_9 0x00009000 /* Bank 0 Write Access Time = 9 cycles */
1052#define B0WAT_10 0x0000A000 /* Bank 0 Write Access Time = 10 cycles */
1053#define B0WAT_11 0x0000B000 /* Bank 0 Write Access Time = 11 cycles */
1054#define B0WAT_12 0x0000C000 /* Bank 0 Write Access Time = 12 cycles */
1055#define B0WAT_13 0x0000D000 /* Bank 0 Write Access Time = 13 cycles */
1056#define B0WAT_14 0x0000E000 /* Bank 0 Write Access Time = 14 cycles */
1057#define B0WAT_15 0x0000F000 /* Bank 0 Write Access Time = 15 cycles */
1058#define B1RDYEN 0x00010000 /* Bank 1 RDY enable, 0=disable, 1=enable */
1059#define B1RDYPOL 0x00020000 /* Bank 1 RDY Active high, 0=active low, 1=active high */
1060#define B1TT_1 0x00040000 /* Bank 1 Transition Time from Read to Write = 1 cycle */
1061#define B1TT_2 0x00080000 /* Bank 1 Transition Time from Read to Write = 2 cycles */
1062#define B1TT_3 0x000C0000 /* Bank 1 Transition Time from Read to Write = 3 cycles */
1063#define B1TT_4 0x00000000 /* Bank 1 Transition Time from Read to Write = 4 cycles */
1064#define B1ST_1 0x00100000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1065#define B1ST_2 0x00200000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1066#define B1ST_3 0x00300000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1067#define B1ST_4 0x00000000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1068#define B1HT_1 0x00400000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1069#define B1HT_2 0x00800000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1070#define B1HT_3 0x00C00000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1071#define B1HT_0 0x00000000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1072#define B1RAT_1 0x01000000 /* Bank 1 Read Access Time = 1 cycle */
1073#define B1RAT_2 0x02000000 /* Bank 1 Read Access Time = 2 cycles */
1074#define B1RAT_3 0x03000000 /* Bank 1 Read Access Time = 3 cycles */
1075#define B1RAT_4 0x04000000 /* Bank 1 Read Access Time = 4 cycles */
1076#define B1RAT_5 0x05000000 /* Bank 1 Read Access Time = 5 cycles */
1077#define B1RAT_6 0x06000000 /* Bank 1 Read Access Time = 6 cycles */
1078#define B1RAT_7 0x07000000 /* Bank 1 Read Access Time = 7 cycles */
1079#define B1RAT_8 0x08000000 /* Bank 1 Read Access Time = 8 cycles */
1080#define B1RAT_9 0x09000000 /* Bank 1 Read Access Time = 9 cycles */
1081#define B1RAT_10 0x0A000000 /* Bank 1 Read Access Time = 10 cycles */
1082#define B1RAT_11 0x0B000000 /* Bank 1 Read Access Time = 11 cycles */
1083#define B1RAT_12 0x0C000000 /* Bank 1 Read Access Time = 12 cycles */
1084#define B1RAT_13 0x0D000000 /* Bank 1 Read Access Time = 13 cycles */
1085#define B1RAT_14 0x0E000000 /* Bank 1 Read Access Time = 14 cycles */
1086#define B1RAT_15 0x0F000000 /* Bank 1 Read Access Time = 15 cycles */
1087#define B1WAT_1 0x10000000 /* Bank 1 Write Access Time = 1 cycle */
1088#define B1WAT_2 0x20000000 /* Bank 1 Write Access Time = 2 cycles */
1089#define B1WAT_3 0x30000000 /* Bank 1 Write Access Time = 3 cycles */
1090#define B1WAT_4 0x40000000 /* Bank 1 Write Access Time = 4 cycles */
1091#define B1WAT_5 0x50000000 /* Bank 1 Write Access Time = 5 cycles */
1092#define B1WAT_6 0x60000000 /* Bank 1 Write Access Time = 6 cycles */
1093#define B1WAT_7 0x70000000 /* Bank 1 Write Access Time = 7 cycles */
1094#define B1WAT_8 0x80000000 /* Bank 1 Write Access Time = 8 cycles */
1095#define B1WAT_9 0x90000000 /* Bank 1 Write Access Time = 9 cycles */
1096#define B1WAT_10 0xA0000000 /* Bank 1 Write Access Time = 10 cycles */
1097#define B1WAT_11 0xB0000000 /* Bank 1 Write Access Time = 11 cycles */
1098#define B1WAT_12 0xC0000000 /* Bank 1 Write Access Time = 12 cycles */
1099#define B1WAT_13 0xD0000000 /* Bank 1 Write Access Time = 13 cycles */
1100#define B1WAT_14 0xE0000000 /* Bank 1 Write Access Time = 14 cycles */
1101#define B1WAT_15 0xF0000000 /* Bank 1 Write Access Time = 15 cycles */
1102
1103/* AMBCTL1 Masks */
1104#define B2RDYEN 0x00000001 /* Bank 2 RDY Enable, 0=disable, 1=enable */
1105#define B2RDYPOL 0x00000002 /* Bank 2 RDY Active high, 0=active low, 1=active high */
1106#define B2TT_1 0x00000004 /* Bank 2 Transition Time from Read to Write = 1 cycle */
1107#define B2TT_2 0x00000008 /* Bank 2 Transition Time from Read to Write = 2 cycles */
1108#define B2TT_3 0x0000000C /* Bank 2 Transition Time from Read to Write = 3 cycles */
1109#define B2TT_4 0x00000000 /* Bank 2 Transition Time from Read to Write = 4 cycles */
1110#define B2ST_1 0x00000010 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1111#define B2ST_2 0x00000020 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1112#define B2ST_3 0x00000030 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1113#define B2ST_4 0x00000000 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1114#define B2HT_1 0x00000040 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1115#define B2HT_2 0x00000080 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1116#define B2HT_3 0x000000C0 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1117#define B2HT_0 0x00000000 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1118#define B2RAT_1 0x00000100 /* Bank 2 Read Access Time = 1 cycle */
1119#define B2RAT_2 0x00000200 /* Bank 2 Read Access Time = 2 cycles */
1120#define B2RAT_3 0x00000300 /* Bank 2 Read Access Time = 3 cycles */
1121#define B2RAT_4 0x00000400 /* Bank 2 Read Access Time = 4 cycles */
1122#define B2RAT_5 0x00000500 /* Bank 2 Read Access Time = 5 cycles */
1123#define B2RAT_6 0x00000600 /* Bank 2 Read Access Time = 6 cycles */
1124#define B2RAT_7 0x00000700 /* Bank 2 Read Access Time = 7 cycles */
1125#define B2RAT_8 0x00000800 /* Bank 2 Read Access Time = 8 cycles */
1126#define B2RAT_9 0x00000900 /* Bank 2 Read Access Time = 9 cycles */
1127#define B2RAT_10 0x00000A00 /* Bank 2 Read Access Time = 10 cycles */
1128#define B2RAT_11 0x00000B00 /* Bank 2 Read Access Time = 11 cycles */
1129#define B2RAT_12 0x00000C00 /* Bank 2 Read Access Time = 12 cycles */
1130#define B2RAT_13 0x00000D00 /* Bank 2 Read Access Time = 13 cycles */
1131#define B2RAT_14 0x00000E00 /* Bank 2 Read Access Time = 14 cycles */
1132#define B2RAT_15 0x00000F00 /* Bank 2 Read Access Time = 15 cycles */
1133#define B2WAT_1 0x00001000 /* Bank 2 Write Access Time = 1 cycle */
1134#define B2WAT_2 0x00002000 /* Bank 2 Write Access Time = 2 cycles */
1135#define B2WAT_3 0x00003000 /* Bank 2 Write Access Time = 3 cycles */
1136#define B2WAT_4 0x00004000 /* Bank 2 Write Access Time = 4 cycles */
1137#define B2WAT_5 0x00005000 /* Bank 2 Write Access Time = 5 cycles */
1138#define B2WAT_6 0x00006000 /* Bank 2 Write Access Time = 6 cycles */
1139#define B2WAT_7 0x00007000 /* Bank 2 Write Access Time = 7 cycles */
1140#define B2WAT_8 0x00008000 /* Bank 2 Write Access Time = 8 cycles */
1141#define B2WAT_9 0x00009000 /* Bank 2 Write Access Time = 9 cycles */
1142#define B2WAT_10 0x0000A000 /* Bank 2 Write Access Time = 10 cycles */
1143#define B2WAT_11 0x0000B000 /* Bank 2 Write Access Time = 11 cycles */
1144#define B2WAT_12 0x0000C000 /* Bank 2 Write Access Time = 12 cycles */
1145#define B2WAT_13 0x0000D000 /* Bank 2 Write Access Time = 13 cycles */
1146#define B2WAT_14 0x0000E000 /* Bank 2 Write Access Time = 14 cycles */
1147#define B2WAT_15 0x0000F000 /* Bank 2 Write Access Time = 15 cycles */
1148#define B3RDYEN 0x00010000 /* Bank 3 RDY enable, 0=disable, 1=enable */
1149#define B3RDYPOL 0x00020000 /* Bank 3 RDY Active high, 0=active low, 1=active high */
1150#define B3TT_1 0x00040000 /* Bank 3 Transition Time from Read to Write = 1 cycle */
1151#define B3TT_2 0x00080000 /* Bank 3 Transition Time from Read to Write = 2 cycles */
1152#define B3TT_3 0x000C0000 /* Bank 3 Transition Time from Read to Write = 3 cycles */
1153#define B3TT_4 0x00000000 /* Bank 3 Transition Time from Read to Write = 4 cycles */
1154#define B3ST_1 0x00100000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1155#define B3ST_2 0x00200000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1156#define B3ST_3 0x00300000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1157#define B3ST_4 0x00000000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1158#define B3HT_1 0x00400000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1159#define B3HT_2 0x00800000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1160#define B3HT_3 0x00C00000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1161#define B3HT_0 0x00000000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1162#define B3RAT_1 0x01000000 /* Bank 3 Read Access Time = 1 cycle */
1163#define B3RAT_2 0x02000000 /* Bank 3 Read Access Time = 2 cycles */
1164#define B3RAT_3 0x03000000 /* Bank 3 Read Access Time = 3 cycles */
1165#define B3RAT_4 0x04000000 /* Bank 3 Read Access Time = 4 cycles */
1166#define B3RAT_5 0x05000000 /* Bank 3 Read Access Time = 5 cycles */
1167#define B3RAT_6 0x06000000 /* Bank 3 Read Access Time = 6 cycles */
1168#define B3RAT_7 0x07000000 /* Bank 3 Read Access Time = 7 cycles */
1169#define B3RAT_8 0x08000000 /* Bank 3 Read Access Time = 8 cycles */
1170#define B3RAT_9 0x09000000 /* Bank 3 Read Access Time = 9 cycles */
1171#define B3RAT_10 0x0A000000 /* Bank 3 Read Access Time = 10 cycles */
1172#define B3RAT_11 0x0B000000 /* Bank 3 Read Access Time = 11 cycles */
1173#define B3RAT_12 0x0C000000 /* Bank 3 Read Access Time = 12 cycles */
1174#define B3RAT_13 0x0D000000 /* Bank 3 Read Access Time = 13 cycles */
1175#define B3RAT_14 0x0E000000 /* Bank 3 Read Access Time = 14 cycles */
1176#define B3RAT_15 0x0F000000 /* Bank 3 Read Access Time = 15 cycles */
1177#define B3WAT_1 0x10000000 /* Bank 3 Write Access Time = 1 cycle */
1178#define B3WAT_2 0x20000000 /* Bank 3 Write Access Time = 2 cycles */
1179#define B3WAT_3 0x30000000 /* Bank 3 Write Access Time = 3 cycles */
1180#define B3WAT_4 0x40000000 /* Bank 3 Write Access Time = 4 cycles */
1181#define B3WAT_5 0x50000000 /* Bank 3 Write Access Time = 5 cycles */
1182#define B3WAT_6 0x60000000 /* Bank 3 Write Access Time = 6 cycles */
1183#define B3WAT_7 0x70000000 /* Bank 3 Write Access Time = 7 cycles */
1184#define B3WAT_8 0x80000000 /* Bank 3 Write Access Time = 8 cycles */
1185#define B3WAT_9 0x90000000 /* Bank 3 Write Access Time = 9 cycles */
1186#define B3WAT_10 0xA0000000 /* Bank 3 Write Access Time = 10 cycles */
1187#define B3WAT_11 0xB0000000 /* Bank 3 Write Access Time = 11 cycles */
1188#define B3WAT_12 0xC0000000 /* Bank 3 Write Access Time = 12 cycles */
1189#define B3WAT_13 0xD0000000 /* Bank 3 Write Access Time = 13 cycles */
1190#define B3WAT_14 0xE0000000 /* Bank 3 Write Access Time = 14 cycles */
1191#define B3WAT_15 0xF0000000 /* Bank 3 Write Access Time = 15 cycles */
1192
1193/* ********************** SDRAM CONTROLLER MASKS *************************** */
1194
1195/* SDGCTL Masks */
1196#define SCTLE 0x00000001 /* Enable SCLK[0], /SRAS, /SCAS, /SWE, SDQM[3:0] */
1197#define CL_2 0x00000008 /* SDRAM CAS latency = 2 cycles */
1198#define CL_3 0x0000000C /* SDRAM CAS latency = 3 cycles */
1199#define PFE 0x00000010 /* Enable SDRAM prefetch */
1200#define PFP 0x00000020 /* Prefetch has priority over AMC requests */
1201#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
1202#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
1203#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
1204#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1205#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1206#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1207#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1208#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1209#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1210#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1211#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1212#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1213#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1214#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1215#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1216#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1217#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1218#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1219#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1220#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1221#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1222#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1223#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1224#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1225#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1226#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1227#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1228#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1229#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1230#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1231#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1232#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1233#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1234#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1235#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1236#define PUPSD 0x00200000 /*Power-up start delay */
1237#define PSM 0x00400000 /* SDRAM power-up sequence = Precharge, mode register set, 8 CBR refresh cycles */
1238#define PSS 0x00800000 /* enable SDRAM power-up sequence on next SDRAM access */
1239#define SRFS 0x01000000 /* Start SDRAM self-refresh mode */
1240#define EBUFE 0x02000000 /* Enable external buffering timing */
1241#define FBBRW 0x04000000 /* Fast back-to-back read write enable */
1242#define EMREN 0x10000000 /* Extended mode register enable */
1243#define TCSR 0x20000000 /* Temp compensated self refresh value 85 deg C */
1244#define CDDBG 0x40000000 /* Tristate SDRAM controls during bus grant */
1245
1246/* EBIU_SDBCTL Masks */
1247#define EBE 0x00000001 /* Enable SDRAM external bank */
1248#define EBSZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1249#define EBSZ_32 0x00000002 /* SDRAM external bank size = 32MB */
1250#define EBSZ_64 0x00000004 /* SDRAM external bank size = 64MB */
1251#define EBSZ_128 0x00000006 /* SDRAM external bank size = 128MB */
1252#define EBCAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1253#define EBCAW_9 0x00000010 /* SDRAM external bank column address width = 9 bits */
1254#define EBCAW_10 0x00000020 /* SDRAM external bank column address width = 9 bits */
1255#define EBCAW_11 0x00000030 /* SDRAM external bank column address width = 9 bits */
1256
1257/* EBIU_SDSTAT Masks */
1258#define SDCI 0x00000001 /* SDRAM controller is idle */
1259#define SDSRA 0x00000002 /* SDRAM SDRAM self refresh is active */
1260#define SDPUA 0x00000004 /* SDRAM power up active */
1261#define SDRS 0x00000008 /* SDRAM is in reset state */
1262#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */
1263#define BGSTAT 0x00000020 /* Bus granted */
1264
1265
1266#endif /* _DEF_BF532_H */
diff --git a/include/asm-blackfin/mach-bf533/dma.h b/include/asm-blackfin/mach-bf533/dma.h
deleted file mode 100644
index bd9d5e94307d..000000000000
--- a/include/asm-blackfin/mach-bf533/dma.h
+++ /dev/null
@@ -1,54 +0,0 @@
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
deleted file mode 100644
index 5aa38e5da6b7..000000000000
--- a/include/asm-blackfin/mach-bf533/irq.h
+++ /dev/null
@@ -1,173 +0,0 @@
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
70 Softirq IVG14 31
71 System Call --
72 (lowest priority) IVG15 32 *
73 */
74#define SYS_IRQS 31
75#define NR_PERI_INTS 24
76
77/* The ABSTRACT IRQ definitions */
78/** the first seven of the following are fixed, the rest you change if you need to **/
79#define IRQ_EMU 0 /*Emulation */
80#define IRQ_RST 1 /*reset */
81#define IRQ_NMI 2 /*Non Maskable */
82#define IRQ_EVX 3 /*Exception */
83#define IRQ_UNUSED 4 /*- unused interrupt*/
84#define IRQ_HWERR 5 /*Hardware Error */
85#define IRQ_CORETMR 6 /*Core timer */
86
87#define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */
88#define IRQ_DMA_ERROR 8 /*DMA Error (general) */
89#define IRQ_PPI_ERROR 9 /*PPI Error Interrupt */
90#define IRQ_SPORT0_ERROR 10 /*SPORT0 Error Interrupt */
91#define IRQ_SPORT1_ERROR 11 /*SPORT1 Error Interrupt */
92#define IRQ_SPI_ERROR 12 /*SPI Error Interrupt */
93#define IRQ_UART_ERROR 13 /*UART Error Interrupt */
94#define IRQ_RTC 14 /*RTC Interrupt */
95#define IRQ_PPI 15 /*DMA0 Interrupt (PPI) */
96#define IRQ_SPORT0_RX 16 /*DMA1 Interrupt (SPORT0 RX) */
97#define IRQ_SPORT0_TX 17 /*DMA2 Interrupt (SPORT0 TX) */
98#define IRQ_SPORT1_RX 18 /*DMA3 Interrupt (SPORT1 RX) */
99#define IRQ_SPORT1_TX 19 /*DMA4 Interrupt (SPORT1 TX) */
100#define IRQ_SPI 20 /*DMA5 Interrupt (SPI) */
101#define IRQ_UART_RX 21 /*DMA6 Interrupt (UART RX) */
102#define IRQ_UART_TX 22 /*DMA7 Interrupt (UART TX) */
103#define IRQ_TMR0 23 /*Timer 0 */
104#define IRQ_TMR1 24 /*Timer 1 */
105#define IRQ_TMR2 25 /*Timer 2 */
106#define IRQ_PROG_INTA 26 /*Programmable Flags A (8) */
107#define IRQ_PROG_INTB 27 /*Programmable Flags B (8) */
108#define IRQ_MEM_DMA0 28 /*DMA8/9 Interrupt (Memory DMA Stream 0) */
109#define IRQ_MEM_DMA1 29 /*DMA10/11 Interrupt (Memory DMA Stream 1) */
110#define IRQ_WATCH 30 /*Watch Dog Timer */
111
112#define IRQ_PF0 33
113#define IRQ_PF1 34
114#define IRQ_PF2 35
115#define IRQ_PF3 36
116#define IRQ_PF4 37
117#define IRQ_PF5 38
118#define IRQ_PF6 39
119#define IRQ_PF7 40
120#define IRQ_PF8 41
121#define IRQ_PF9 42
122#define IRQ_PF10 43
123#define IRQ_PF11 44
124#define IRQ_PF12 45
125#define IRQ_PF13 46
126#define IRQ_PF14 47
127#define IRQ_PF15 48
128
129#define GPIO_IRQ_BASE IRQ_PF0
130
131#define NR_IRQS (IRQ_PF15+1)
132
133#define IVG7 7
134#define IVG8 8
135#define IVG9 9
136#define IVG10 10
137#define IVG11 11
138#define IVG12 12
139#define IVG13 13
140#define IVG14 14
141#define IVG15 15
142
143/* IAR0 BIT FIELDS*/
144#define RTC_ERROR_POS 28
145#define UART_ERROR_POS 24
146#define SPORT1_ERROR_POS 20
147#define SPI_ERROR_POS 16
148#define SPORT0_ERROR_POS 12
149#define PPI_ERROR_POS 8
150#define DMA_ERROR_POS 4
151#define PLLWAKE_ERROR_POS 0
152
153/* IAR1 BIT FIELDS*/
154#define DMA7_UARTTX_POS 28
155#define DMA6_UARTRX_POS 24
156#define DMA5_SPI_POS 20
157#define DMA4_SPORT1TX_POS 16
158#define DMA3_SPORT1RX_POS 12
159#define DMA2_SPORT0TX_POS 8
160#define DMA1_SPORT0RX_POS 4
161#define DMA0_PPI_POS 0
162
163/* IAR2 BIT FIELDS*/
164#define WDTIMER_POS 28
165#define MEMDMA1_POS 24
166#define MEMDMA0_POS 20
167#define PFB_POS 16
168#define PFA_POS 12
169#define TIMER2_POS 8
170#define TIMER1_POS 4
171#define TIMER0_POS 0
172
173#endif /* _BF533_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf533/mem_init.h b/include/asm-blackfin/mach-bf533/mem_init.h
deleted file mode 100644
index ed2034bf10ec..000000000000
--- a/include/asm-blackfin/mach-bf533/mem_init.h
+++ /dev/null
@@ -1,297 +0,0 @@
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 || \
33 CONFIG_MEM_MT48LC32M16A2TG_75 || CONFIG_MEM_GENERIC_BOARD)
34#if (CONFIG_SCLK_HZ > 119402985)
35#define SDRAM_tRP TRP_2
36#define SDRAM_tRP_num 2
37#define SDRAM_tRAS TRAS_7
38#define SDRAM_tRAS_num 7
39#define SDRAM_tRCD TRCD_2
40#define SDRAM_tWR TWR_2
41#endif
42#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
43#define SDRAM_tRP TRP_2
44#define SDRAM_tRP_num 2
45#define SDRAM_tRAS TRAS_6
46#define SDRAM_tRAS_num 6
47#define SDRAM_tRCD TRCD_2
48#define SDRAM_tWR TWR_2
49#endif
50#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
51#define SDRAM_tRP TRP_2
52#define SDRAM_tRP_num 2
53#define SDRAM_tRAS TRAS_5
54#define SDRAM_tRAS_num 5
55#define SDRAM_tRCD TRCD_2
56#define SDRAM_tWR TWR_2
57#endif
58#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
59#define SDRAM_tRP TRP_2
60#define SDRAM_tRP_num 2
61#define SDRAM_tRAS TRAS_4
62#define SDRAM_tRAS_num 4
63#define SDRAM_tRCD TRCD_2
64#define SDRAM_tWR TWR_2
65#endif
66#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
67#define SDRAM_tRP TRP_2
68#define SDRAM_tRP_num 2
69#define SDRAM_tRAS TRAS_3
70#define SDRAM_tRAS_num 3
71#define SDRAM_tRCD TRCD_2
72#define SDRAM_tWR TWR_2
73#endif
74#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
75#define SDRAM_tRP TRP_1
76#define SDRAM_tRP_num 1
77#define SDRAM_tRAS TRAS_4
78#define SDRAM_tRAS_num 3
79#define SDRAM_tRCD TRCD_1
80#define SDRAM_tWR TWR_2
81#endif
82#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
83#define SDRAM_tRP TRP_1
84#define SDRAM_tRP_num 1
85#define SDRAM_tRAS TRAS_3
86#define SDRAM_tRAS_num 3
87#define SDRAM_tRCD TRCD_1
88#define SDRAM_tWR TWR_2
89#endif
90#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
91#define SDRAM_tRP TRP_1
92#define SDRAM_tRP_num 1
93#define SDRAM_tRAS TRAS_2
94#define SDRAM_tRAS_num 2
95#define SDRAM_tRCD TRCD_1
96#define SDRAM_tWR TWR_2
97#endif
98#if (CONFIG_SCLK_HZ <= 29850746)
99#define SDRAM_tRP TRP_1
100#define SDRAM_tRP_num 1
101#define SDRAM_tRAS TRAS_1
102#define SDRAM_tRAS_num 1
103#define SDRAM_tRCD TRCD_1
104#define SDRAM_tWR TWR_2
105#endif
106#endif
107
108#if (CONFIG_MEM_MT48LC16M16A2TG_75)
109 /*SDRAM INFORMATION: */
110#define SDRAM_Tref 64 /* Refresh period in milliseconds */
111#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
112#define SDRAM_CL CL_3
113#endif
114
115#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
116 /*SDRAM INFORMATION: */
117#define SDRAM_Tref 64 /* Refresh period in milliseconds */
118#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
119#define SDRAM_CL CL_3
120#endif
121
122#if (CONFIG_MEM_MT48LC32M16A2TG_75)
123 /*SDRAM INFORMATION: */
124#define SDRAM_Tref 64 /* Refresh period in milliseconds */
125#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
126#define SDRAM_CL CL_3
127#endif
128
129#if (CONFIG_MEM_GENERIC_BOARD)
130 /*SDRAM INFORMATION: Modify this for your board */
131#define SDRAM_Tref 64 /* Refresh period in milliseconds */
132#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
133#define SDRAM_CL CL_3
134#endif
135
136/* Equation from section 17 (p17-46) of BF533 HRM */
137#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
138
139/* Enable SCLK Out */
140#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
141
142#if defined CONFIG_CLKIN_HALF
143#define CLKIN_HALF 1
144#else
145#define CLKIN_HALF 0
146#endif
147
148#if defined CONFIG_PLL_BYPASS
149#define PLL_BYPASS 1
150#else
151#define PLL_BYPASS 0
152#endif
153
154/***************************************Currently Not Being Used *********************************/
155#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
156#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
157#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
158#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
159#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
160
161#if (flash_EBIU_AMBCTL_TT > 3)
162#define flash_EBIU_AMBCTL0_TT B0TT_4
163#endif
164#if (flash_EBIU_AMBCTL_TT == 3)
165#define flash_EBIU_AMBCTL0_TT B0TT_3
166#endif
167#if (flash_EBIU_AMBCTL_TT == 2)
168#define flash_EBIU_AMBCTL0_TT B0TT_2
169#endif
170#if (flash_EBIU_AMBCTL_TT < 2)
171#define flash_EBIU_AMBCTL0_TT B0TT_1
172#endif
173
174#if (flash_EBIU_AMBCTL_ST > 3)
175#define flash_EBIU_AMBCTL0_ST B0ST_4
176#endif
177#if (flash_EBIU_AMBCTL_ST == 3)
178#define flash_EBIU_AMBCTL0_ST B0ST_3
179#endif
180#if (flash_EBIU_AMBCTL_ST == 2)
181#define flash_EBIU_AMBCTL0_ST B0ST_2
182#endif
183#if (flash_EBIU_AMBCTL_ST < 2)
184#define flash_EBIU_AMBCTL0_ST B0ST_1
185#endif
186
187#if (flash_EBIU_AMBCTL_HT > 2)
188#define flash_EBIU_AMBCTL0_HT B0HT_3
189#endif
190#if (flash_EBIU_AMBCTL_HT == 2)
191#define flash_EBIU_AMBCTL0_HT B0HT_2
192#endif
193#if (flash_EBIU_AMBCTL_HT == 1)
194#define flash_EBIU_AMBCTL0_HT B0HT_1
195#endif
196#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
197#define flash_EBIU_AMBCTL0_HT B0HT_0
198#endif
199#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
200#define flash_EBIU_AMBCTL0_HT B0HT_1
201#endif
202
203#if (flash_EBIU_AMBCTL_WAT > 14)
204#define flash_EBIU_AMBCTL0_WAT B0WAT_15
205#endif
206#if (flash_EBIU_AMBCTL_WAT == 14)
207#define flash_EBIU_AMBCTL0_WAT B0WAT_14
208#endif
209#if (flash_EBIU_AMBCTL_WAT == 13)
210#define flash_EBIU_AMBCTL0_WAT B0WAT_13
211#endif
212#if (flash_EBIU_AMBCTL_WAT == 12)
213#define flash_EBIU_AMBCTL0_WAT B0WAT_12
214#endif
215#if (flash_EBIU_AMBCTL_WAT == 11)
216#define flash_EBIU_AMBCTL0_WAT B0WAT_11
217#endif
218#if (flash_EBIU_AMBCTL_WAT == 10)
219#define flash_EBIU_AMBCTL0_WAT B0WAT_10
220#endif
221#if (flash_EBIU_AMBCTL_WAT == 9)
222#define flash_EBIU_AMBCTL0_WAT B0WAT_9
223#endif
224#if (flash_EBIU_AMBCTL_WAT == 8)
225#define flash_EBIU_AMBCTL0_WAT B0WAT_8
226#endif
227#if (flash_EBIU_AMBCTL_WAT == 7)
228#define flash_EBIU_AMBCTL0_WAT B0WAT_7
229#endif
230#if (flash_EBIU_AMBCTL_WAT == 6)
231#define flash_EBIU_AMBCTL0_WAT B0WAT_6
232#endif
233#if (flash_EBIU_AMBCTL_WAT == 5)
234#define flash_EBIU_AMBCTL0_WAT B0WAT_5
235#endif
236#if (flash_EBIU_AMBCTL_WAT == 4)
237#define flash_EBIU_AMBCTL0_WAT B0WAT_4
238#endif
239#if (flash_EBIU_AMBCTL_WAT == 3)
240#define flash_EBIU_AMBCTL0_WAT B0WAT_3
241#endif
242#if (flash_EBIU_AMBCTL_WAT == 2)
243#define flash_EBIU_AMBCTL0_WAT B0WAT_2
244#endif
245#if (flash_EBIU_AMBCTL_WAT == 1)
246#define flash_EBIU_AMBCTL0_WAT B0WAT_1
247#endif
248
249#if (flash_EBIU_AMBCTL_RAT > 14)
250#define flash_EBIU_AMBCTL0_RAT B0RAT_15
251#endif
252#if (flash_EBIU_AMBCTL_RAT == 14)
253#define flash_EBIU_AMBCTL0_RAT B0RAT_14
254#endif
255#if (flash_EBIU_AMBCTL_RAT == 13)
256#define flash_EBIU_AMBCTL0_RAT B0RAT_13
257#endif
258#if (flash_EBIU_AMBCTL_RAT == 12)
259#define flash_EBIU_AMBCTL0_RAT B0RAT_12
260#endif
261#if (flash_EBIU_AMBCTL_RAT == 11)
262#define flash_EBIU_AMBCTL0_RAT B0RAT_11
263#endif
264#if (flash_EBIU_AMBCTL_RAT == 10)
265#define flash_EBIU_AMBCTL0_RAT B0RAT_10
266#endif
267#if (flash_EBIU_AMBCTL_RAT == 9)
268#define flash_EBIU_AMBCTL0_RAT B0RAT_9
269#endif
270#if (flash_EBIU_AMBCTL_RAT == 8)
271#define flash_EBIU_AMBCTL0_RAT B0RAT_8
272#endif
273#if (flash_EBIU_AMBCTL_RAT == 7)
274#define flash_EBIU_AMBCTL0_RAT B0RAT_7
275#endif
276#if (flash_EBIU_AMBCTL_RAT == 6)
277#define flash_EBIU_AMBCTL0_RAT B0RAT_6
278#endif
279#if (flash_EBIU_AMBCTL_RAT == 5)
280#define flash_EBIU_AMBCTL0_RAT B0RAT_5
281#endif
282#if (flash_EBIU_AMBCTL_RAT == 4)
283#define flash_EBIU_AMBCTL0_RAT B0RAT_4
284#endif
285#if (flash_EBIU_AMBCTL_RAT == 3)
286#define flash_EBIU_AMBCTL0_RAT B0RAT_3
287#endif
288#if (flash_EBIU_AMBCTL_RAT == 2)
289#define flash_EBIU_AMBCTL0_RAT B0RAT_2
290#endif
291#if (flash_EBIU_AMBCTL_RAT == 1)
292#define flash_EBIU_AMBCTL0_RAT B0RAT_1
293#endif
294
295#define flash_EBIU_AMBCTL0 \
296 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
297 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
deleted file mode 100644
index 581fc6eea789..000000000000
--- a/include/asm-blackfin/mach-bf533/mem_map.h
+++ /dev/null
@@ -1,171 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/mem_map.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 _MEM_MAP_533_H_
32#define _MEM_MAP_533_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#define BOOT_ROM_LENGTH 0x400
51
52/* Level 1 Memory */
53
54#ifdef CONFIG_BFIN_ICACHE
55#define BFIN_ICACHESIZE (16*1024)
56#else
57#define BFIN_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_BFIN_ICACHE
68#define L1_CODE_LENGTH (0x14000 - 0x4000)
69#else
70#define L1_CODE_LENGTH 0x14000
71#endif
72
73#ifdef CONFIG_BFIN_DCACHE
74
75#ifdef CONFIG_BFIN_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 BFIN_DCACHESIZE (16*1024)
80#define BFIN_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 BFIN_DCACHESIZE (32*1024)
86#define BFIN_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 BFIN_DCACHESIZE (0*1024)
94#define BFIN_DSUPBANKS 0
95#endif /*CONFIG_BFIN_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_BFIN_ICACHE
106#define L1_CODE_LENGTH (0xC000 - 0x4000)
107#else
108#define L1_CODE_LENGTH 0xC000
109#endif
110
111#ifdef CONFIG_BFIN_DCACHE
112
113#ifdef CONFIG_BFIN_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 BFIN_DCACHESIZE (16*1024)
118#define BFIN_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 BFIN_DCACHESIZE (32*1024)
125#define BFIN_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 BFIN_DCACHESIZE (0*1024)
133#define BFIN_DSUPBANKS 0
134#endif /*CONFIG_BFIN_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_BFIN_DCACHE
148#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
149#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
150#define BFIN_DCACHESIZE (16*1024)
151#define BFIN_DSUPBANKS 1
152#else
153#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
154#define L1_DATA_A_LENGTH 0x4000
155#define BFIN_DCACHESIZE (0*1024)
156#define BFIN_DSUPBANKS 0
157#endif
158
159#endif
160
161/* Level 2 Memory - none */
162
163#define L2_START 0
164#define L2_LENGTH 0
165
166/* Scratch Pad Memory */
167
168#define L1_SCRATCH_START 0xFFB00000
169#define L1_SCRATCH_LENGTH 0x1000
170
171#endif /* _MEM_MAP_533_H_ */
diff --git a/include/asm-blackfin/mach-bf533/portmux.h b/include/asm-blackfin/mach-bf533/portmux.h
deleted file mode 100644
index 685a2651dcda..000000000000
--- a/include/asm-blackfin/mach-bf533/portmux.h
+++ /dev/null
@@ -1,67 +0,0 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
5
6#define P_PPI0_CLK (P_DONTCARE)
7#define P_PPI0_FS1 (P_DONTCARE)
8#define P_PPI0_FS2 (P_DONTCARE)
9#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PF3))
10#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF4))
11#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF5))
12#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF6))
13#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF7))
14#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF8))
15#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF9))
16#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF10))
17#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF11))
18#define P_PPI0_D0 (P_DONTCARE)
19#define P_PPI0_D1 (P_DONTCARE)
20#define P_PPI0_D2 (P_DONTCARE)
21#define P_PPI0_D3 (P_DONTCARE)
22#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PF15))
23#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PF14))
24#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PF13))
25#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PF12))
26
27#define P_SPORT1_TSCLK (P_DONTCARE)
28#define P_SPORT1_RSCLK (P_DONTCARE)
29#define P_SPORT0_TSCLK (P_DONTCARE)
30#define P_SPORT0_RSCLK (P_DONTCARE)
31#define P_UART0_RX (P_DONTCARE)
32#define P_UART0_TX (P_DONTCARE)
33#define P_SPORT1_DRSEC (P_DONTCARE)
34#define P_SPORT1_RFS (P_DONTCARE)
35#define P_SPORT1_DTPRI (P_DONTCARE)
36#define P_SPORT1_DTSEC (P_DONTCARE)
37#define P_SPORT1_TFS (P_DONTCARE)
38#define P_SPORT1_DRPRI (P_DONTCARE)
39#define P_SPORT0_DRSEC (P_DONTCARE)
40#define P_SPORT0_RFS (P_DONTCARE)
41#define P_SPORT0_DTPRI (P_DONTCARE)
42#define P_SPORT0_DTSEC (P_DONTCARE)
43#define P_SPORT0_TFS (P_DONTCARE)
44#define P_SPORT0_DRPRI (P_DONTCARE)
45
46#define P_SPI0_MOSI (P_DONTCARE)
47#define P_SPI0_MISO (P_DONTCARE)
48#define P_SPI0_SCK (P_DONTCARE)
49#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(GPIO_PF7))
50#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF6))
51#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5))
52#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF4))
53#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PF3))
54#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2))
55#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1))
56#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0))
57
58#define P_TMR2 (P_DONTCARE)
59#define P_TMR1 (P_DONTCARE)
60#define P_TMR0 (P_DONTCARE)
61#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF1))
62
63
64
65
66
67#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf537/anomaly.h b/include/asm-blackfin/mach-bf537/anomaly.h
deleted file mode 100644
index 8460ab9c324f..000000000000
--- a/include/asm-blackfin/mach-bf537/anomaly.h
+++ /dev/null
@@ -1,163 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/anomaly.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2004-2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9/* This file shoule be up to date with:
10 * - Revision C, 02/08/2008; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List
11 */
12
13#ifndef _MACH_ANOMALY_H_
14#define _MACH_ANOMALY_H_
15
16/* We do not support 0.1 silicon - sorry */
17#if __SILICON_REVISION__ < 2
18# error will not work on BF537 silicon version 0.0 or 0.1
19#endif
20
21#if defined(__ADSPBF534__)
22# define ANOMALY_BF534 1
23#else
24# define ANOMALY_BF534 0
25#endif
26#if defined(__ADSPBF536__)
27# define ANOMALY_BF536 1
28#else
29# define ANOMALY_BF536 0
30#endif
31#if defined(__ADSPBF537__)
32# define ANOMALY_BF537 1
33#else
34# define ANOMALY_BF537 0
35#endif
36
37/* Multi-issue instruction with dsp32shiftimm in slot1 and P-reg store in slot 2 not supported */
38#define ANOMALY_05000074 (1)
39/* DMA_RUN bit is not valid after a Peripheral Receive Channel DMA stops */
40#define ANOMALY_05000119 (1)
41/* Rx.H cannot be used to access 16-bit System MMR registers */
42#define ANOMALY_05000122 (1)
43/* Killed 32-bit MMR write leads to next system MMR access thinking it should be 32-bit */
44#define ANOMALY_05000157 (__SILICON_REVISION__ < 2)
45/* Turning SPORTs on while External Frame Sync Is Active May Corrupt Data */
46#define ANOMALY_05000167 (1)
47/* PPI_DELAY not functional in PPI modes with 0 frame syncs */
48#define ANOMALY_05000180 (1)
49/* Instruction Cache Is Not Functional */
50#define ANOMALY_05000237 (__SILICON_REVISION__ < 2)
51/* If i-cache is on, CSYNC/SSYNC/IDLE around Change of Control causes failures */
52#define ANOMALY_05000244 (__SILICON_REVISION__ < 3)
53/* Spurious Hardware Error from an access in the shadow of a conditional branch */
54#define ANOMALY_05000245 (1)
55/* CLKIN Buffer Output Enable Reset Behavior Is Changed */
56#define ANOMALY_05000247 (1)
57/* Incorrect Bit-Shift of Data Word in Multichannel (TDM) mode in certain conditions */
58#define ANOMALY_05000250 (__SILICON_REVISION__ < 3)
59/* EMAC Tx DMA error after an early frame abort */
60#define ANOMALY_05000252 (__SILICON_REVISION__ < 3)
61/* Maximum external clock speed for Timers */
62#define ANOMALY_05000253 (__SILICON_REVISION__ < 3)
63/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT mode with external clock */
64#define ANOMALY_05000254 (__SILICON_REVISION__ > 2)
65/* Entering Hibernate Mode with RTC Seconds event interrupt not functional */
66#define ANOMALY_05000255 (__SILICON_REVISION__ < 3)
67/* EMAC MDIO input latched on wrong MDC edge */
68#define ANOMALY_05000256 (__SILICON_REVISION__ < 3)
69/* Interrupt/Exception during short hardware loop may cause bad instruction fetches */
70#define ANOMALY_05000257 (__SILICON_REVISION__ < 3)
71/* Instruction Cache is corrupted when bits 9 and 12 of the ICPLB Data registers differ */
72#define ANOMALY_05000258 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ == 1) || __SILICON_REVISION__ == 2)
73/* ICPLB_STATUS MMR register may be corrupted */
74#define ANOMALY_05000260 (__SILICON_REVISION__ == 2)
75/* DCPLB_FAULT_ADDR MMR register may be corrupted */
76#define ANOMALY_05000261 (__SILICON_REVISION__ < 3)
77/* Stores to data cache may be lost */
78#define ANOMALY_05000262 (__SILICON_REVISION__ < 3)
79/* Hardware loop corrupted when taking an ICPLB exception */
80#define ANOMALY_05000263 (__SILICON_REVISION__ == 2)
81/* CSYNC/SSYNC/IDLE causes infinite stall in second to last instruction in hardware loop */
82#define ANOMALY_05000264 (__SILICON_REVISION__ < 3)
83/* Sensitivity to noise with slow input edge rates on external SPORT TX and RX clocks */
84#define ANOMALY_05000265 (1)
85/* Memory DMA error when peripheral DMA is running with non-zero DEB_TRAFFIC_PERIOD */
86#define ANOMALY_05000268 (__SILICON_REVISION__ < 3)
87/* High I/O activity causes output voltage of internal voltage regulator (VDDint) to decrease */
88#define ANOMALY_05000270 (__SILICON_REVISION__ < 3)
89/* Certain data cache write through modes fail for VDDint <=0.9V */
90#define ANOMALY_05000272 (1)
91/* Writes to Synchronous SDRAM memory may be lost */
92#define ANOMALY_05000273 (__SILICON_REVISION__ < 3)
93/* Writes to an I/O data register one SCLK cycle after an edge is detected may clear interrupt */
94#define ANOMALY_05000277 (__SILICON_REVISION__ < 3)
95/* Disabling Peripherals with DMA running may cause DMA system instability */
96#define ANOMALY_05000278 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ < 3) || (ANOMALY_BF534 && __SILICON_REVISION__ < 2))
97/* SPI Master boot mode does not work well with Atmel Data flash devices */
98#define ANOMALY_05000280 (1)
99/* False Hardware Error Exception when ISR context is not restored */
100#define ANOMALY_05000281 (__SILICON_REVISION__ < 3)
101/* Memory DMA corruption with 32-bit data and traffic control */
102#define ANOMALY_05000282 (__SILICON_REVISION__ < 3)
103/* System MMR Write Is Stalled Indefinitely When Killed in a Particular Stage */
104#define ANOMALY_05000283 (__SILICON_REVISION__ < 3)
105/* New Feature: EMAC TX DMA Word Alignment (Not Available On Older Silicon) */
106#define ANOMALY_05000285 (__SILICON_REVISION__ < 3)
107/* SPORTs may receive bad data if FIFOs fill up */
108#define ANOMALY_05000288 (__SILICON_REVISION__ < 3)
109/* Memory to memory DMA source/destination descriptors must be in same memory space */
110#define ANOMALY_05000301 (1)
111/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */
112#define ANOMALY_05000304 (__SILICON_REVISION__ < 3)
113/* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */
114#define ANOMALY_05000305 (__SILICON_REVISION__ < 3)
115/* SCKELOW Bit Does Not Maintain State Through Hibernate */
116#define ANOMALY_05000307 (__SILICON_REVISION__ < 3)
117/* Writing UART_THR while UART clock is disabled sends erroneous start bit */
118#define ANOMALY_05000309 (__SILICON_REVISION__ < 3)
119/* False hardware errors caused by fetches at the boundary of reserved memory */
120#define ANOMALY_05000310 (1)
121/* Errors when SSYNC, CSYNC, or loads to LT, LB and LC registers are interrupted */
122#define ANOMALY_05000312 (1)
123/* PPI is level sensitive on first transfer */
124#define ANOMALY_05000313 (1)
125/* Killed System MMR Write Completes Erroneously On Next System MMR Access */
126#define ANOMALY_05000315 (__SILICON_REVISION__ < 3)
127/* EMAC RMII mode: collisions occur in Full Duplex mode */
128#define ANOMALY_05000316 (__SILICON_REVISION__ < 3)
129/* EMAC RMII mode: TX frames in half duplex fail with status No Carrier */
130#define ANOMALY_05000321 (__SILICON_REVISION__ < 3)
131/* EMAC RMII mode at 10-Base-T speed: RX frames not received properly */
132#define ANOMALY_05000322 (1)
133/* Ethernet MAC MDIO Reads Do Not Meet IEEE Specification */
134#define ANOMALY_05000341 (__SILICON_REVISION__ >= 3)
135/* New Feature: UART Remains Enabled after UART Boot */
136#define ANOMALY_05000350 (__SILICON_REVISION__ >= 3)
137/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */
138#define ANOMALY_05000355 (1)
139/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
140#define ANOMALY_05000357 (1)
141/* DMAs that Go Urgent during Tight Core Writes to External Memory Are Blocked */
142#define ANOMALY_05000359 (1)
143/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
144#define ANOMALY_05000366 (1)
145/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
146#define ANOMALY_05000371 (1)
147/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */
148#define ANOMALY_05000402 (__SILICON_REVISION__ >= 5)
149/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
150#define ANOMALY_05000403 (1)
151
152/* Anomalies that don't exist on this proc */
153#define ANOMALY_05000125 (0)
154#define ANOMALY_05000158 (0)
155#define ANOMALY_05000183 (0)
156#define ANOMALY_05000198 (0)
157#define ANOMALY_05000230 (0)
158#define ANOMALY_05000266 (0)
159#define ANOMALY_05000311 (0)
160#define ANOMALY_05000323 (0)
161#define ANOMALY_05000363 (0)
162
163#endif
diff --git a/include/asm-blackfin/mach-bf537/bf537.h b/include/asm-blackfin/mach-bf537/bf537.h
deleted file mode 100644
index cfe2a221112e..000000000000
--- a/include/asm-blackfin/mach-bf537/bf537.h
+++ /dev/null
@@ -1,141 +0,0 @@
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 BFIN_DSUBBANKS 4
66#define BFIN_DWAYS 2
67#define BFIN_DLINES 64
68#define BFIN_ISUBBANKS 4
69#define BFIN_IWAYS 4
70#define BFIN_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#ifdef CONFIG_BF537
125#define CPU "BF537"
126#define CPUID 0x027c8000
127#endif
128#ifdef CONFIG_BF536
129#define CPU "BF536"
130#define CPUID 0x027c8000
131#endif
132#ifdef CONFIG_BF534
133#define CPU "BF534"
134#define CPUID 0x027c6000
135#endif
136#ifndef CPU
137#define CPU "UNKNOWN"
138#define CPUID 0x0
139#endif
140
141#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
deleted file mode 100644
index 1bf56ffa22f9..000000000000
--- a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
+++ /dev/null
@@ -1,195 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * blackfin serial driver header files
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#include <linux/serial.h>
33#include <asm/dma.h>
34#include <asm/portmux.h>
35
36#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
37#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
38#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
39#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
40#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
41#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
42#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
43
44#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
45#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
46#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
47#define UART_SET_IER(uart,v) UART_PUT_IER(uart, UART_GET_IER(uart) | (v))
48#define UART_CLEAR_IER(uart,v) UART_PUT_IER(uart, UART_GET_IER(uart) & ~(v))
49#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
60#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
61
62#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
63# define CONFIG_SERIAL_BFIN_CTSRTS
64
65# ifndef CONFIG_UART0_CTS_PIN
66# define CONFIG_UART0_CTS_PIN -1
67# endif
68
69# ifndef CONFIG_UART0_RTS_PIN
70# define CONFIG_UART0_RTS_PIN -1
71# endif
72
73# ifndef CONFIG_UART1_CTS_PIN
74# define CONFIG_UART1_CTS_PIN -1
75# endif
76
77# ifndef CONFIG_UART1_RTS_PIN
78# define CONFIG_UART1_RTS_PIN -1
79# endif
80#endif
81/*
82 * The pin configuration is different from schematic
83 */
84struct bfin_serial_port {
85 struct uart_port port;
86 unsigned int old_status;
87 unsigned int lsr;
88#ifdef CONFIG_SERIAL_BFIN_DMA
89 int tx_done;
90 int tx_count;
91 struct circ_buf rx_dma_buf;
92 struct timer_list rx_dma_timer;
93 int rx_dma_nrows;
94 unsigned int tx_dma_channel;
95 unsigned int rx_dma_channel;
96 struct work_struct tx_dma_workqueue;
97#endif
98#ifdef CONFIG_SERIAL_BFIN_CTSRTS
99 struct timer_list cts_timer;
100 int cts_pin;
101 int rts_pin;
102#endif
103};
104
105/* The hardware clears the LSR bits upon read, so we need to cache
106 * some of the more fun bits in software so they don't get lost
107 * when checking the LSR in other code paths (TX).
108 */
109static inline unsigned int UART_GET_LSR(struct bfin_serial_port *uart)
110{
111 unsigned int lsr = bfin_read16(uart->port.membase + OFFSET_LSR);
112 uart->lsr |= (lsr & (BI|FE|PE|OE));
113 return lsr | uart->lsr;
114}
115
116static inline void UART_CLEAR_LSR(struct bfin_serial_port *uart)
117{
118 uart->lsr = 0;
119 bfin_write16(uart->port.membase + OFFSET_LSR, -1);
120}
121
122struct bfin_serial_port bfin_serial_ports[BFIN_UART_NR_PORTS];
123struct bfin_serial_res {
124 unsigned long uart_base_addr;
125 int uart_irq;
126#ifdef CONFIG_SERIAL_BFIN_DMA
127 unsigned int uart_tx_dma_channel;
128 unsigned int uart_rx_dma_channel;
129#endif
130#ifdef CONFIG_SERIAL_BFIN_CTSRTS
131 int uart_cts_pin;
132 int uart_rts_pin;
133#endif
134};
135
136struct bfin_serial_res bfin_serial_resource[] = {
137#ifdef CONFIG_SERIAL_BFIN_UART0
138 {
139 0xFFC00400,
140 IRQ_UART0_RX,
141#ifdef CONFIG_SERIAL_BFIN_DMA
142 CH_UART0_TX,
143 CH_UART0_RX,
144#endif
145#ifdef CONFIG_BFIN_UART0_CTSRTS
146 CONFIG_UART0_CTS_PIN,
147 CONFIG_UART0_RTS_PIN,
148#endif
149 },
150#endif
151#ifdef CONFIG_SERIAL_BFIN_UART1
152 {
153 0xFFC02000,
154 IRQ_UART1_RX,
155#ifdef CONFIG_SERIAL_BFIN_DMA
156 CH_UART1_TX,
157 CH_UART1_RX,
158#endif
159#ifdef CONFIG_BFIN_UART1_CTSRTS
160 CONFIG_UART1_CTS_PIN,
161 CONFIG_UART1_RTS_PIN,
162#endif
163 },
164#endif
165};
166
167int nr_ports = ARRAY_SIZE(bfin_serial_resource);
168
169#define DRIVER_NAME "bfin-uart"
170
171static void bfin_serial_hw_init(struct bfin_serial_port *uart)
172{
173
174#ifdef CONFIG_SERIAL_BFIN_UART0
175 peripheral_request(P_UART0_TX, DRIVER_NAME);
176 peripheral_request(P_UART0_RX, DRIVER_NAME);
177#endif
178
179#ifdef CONFIG_SERIAL_BFIN_UART1
180 peripheral_request(P_UART1_TX, DRIVER_NAME);
181 peripheral_request(P_UART1_RX, DRIVER_NAME);
182#endif
183
184#ifdef CONFIG_SERIAL_BFIN_CTSRTS
185 if (uart->cts_pin >= 0) {
186 gpio_request(uart->cts_pin, DRIVER_NAME);
187 gpio_direction_input(uart->cts_pin);
188 }
189
190 if (uart->rts_pin >= 0) {
191 gpio_request(uart->rts_pin, DRIVER_NAME);
192 gpio_direction_output(uart->rts_pin, 0);
193 }
194#endif
195}
diff --git a/include/asm-blackfin/mach-bf537/bfin_sir.h b/include/asm-blackfin/mach-bf537/bfin_sir.h
deleted file mode 100644
index cfd8ad4f1f2c..000000000000
--- a/include/asm-blackfin/mach-bf537/bfin_sir.h
+++ /dev/null
@@ -1,142 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART0_RX,
69 CH_UART0_RX,
70 CH_UART0_TX,
71 },
72#endif
73#ifdef CONFIG_BFIN_SIR1
74 {
75 0xFFC02000,
76 IRQ_UART1_RX,
77 CH_UART1_RX,
78 CH_UART1_TX,
79 },
80#endif
81};
82
83int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
84
85struct bfin_sir_self {
86 struct bfin_sir_port *sir_port;
87 spinlock_t lock;
88 unsigned int open;
89 int speed;
90 int newspeed;
91
92 struct sk_buff *txskb;
93 struct sk_buff *rxskb;
94 struct net_device_stats stats;
95 struct device *dev;
96 struct irlap_cb *irlap;
97 struct qos_info qos;
98
99 iobuff_t tx_buff;
100 iobuff_t rx_buff;
101
102 struct work_struct work;
103 int mtt;
104};
105
106static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
107{
108 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
109 port->lsr |= (lsr & (BI|FE|PE|OE));
110 return lsr | port->lsr;
111}
112
113static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
114{
115 port->lsr = 0;
116 bfin_read16(port->membase + OFFSET_LSR);
117}
118
119#define DRIVER_NAME "bfin_sir"
120
121static int bfin_sir_hw_init(void)
122{
123 int ret = -ENODEV;
124#ifdef CONFIG_BFIN_SIR0
125 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
126 if (ret)
127 return ret;
128 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
129 if (ret)
130 return ret;
131#endif
132
133#ifdef CONFIG_BFIN_SIR1
134 ret = peripheral_request(P_UART1_TX, DRIVER_NAME);
135 if (ret)
136 return ret;
137 ret = peripheral_request(P_UART1_RX, DRIVER_NAME);
138 if (ret)
139 return ret;
140#endif
141 return ret;
142}
diff --git a/include/asm-blackfin/mach-bf537/blackfin.h b/include/asm-blackfin/mach-bf537/blackfin.h
deleted file mode 100644
index cffc786b2a2b..000000000000
--- a/include/asm-blackfin/mach-bf537/blackfin.h
+++ /dev/null
@@ -1,165 +0,0 @@
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__)
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/* DMA Channnel */
86#define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX()
87#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val)
88#define CH_UART_RX CH_UART0_RX
89#define bfin_read_CH_UART_TX() bfin_read_CH_UART0_TX()
90#define bfin_write_CH_UART_TX(val) bfin_write_CH_UART0_TX(val)
91#define CH_UART_TX CH_UART0_TX
92
93/* System Interrupt Controller */
94#define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART0_RX()
95#define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART0_RX(val)
96#define IRQ_UART_RX IRQ_UART0_RX
97#define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART0_TX()
98#define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART0_TX(val)
99#define IRQ_UART_TX IRQ_UART0_TX
100#define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART0_ERROR()
101#define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART0_ERROR(val)
102#define IRQ_UART_ERROR IRQ_UART0_ERROR
103
104/* MMR Registers*/
105#define bfin_read_UART_THR() bfin_read_UART0_THR()
106#define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
107#define BFIN_UART_THR UART0_THR
108#define bfin_read_UART_RBR() bfin_read_UART0_RBR()
109#define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
110#define BFIN_UART_RBR UART0_RBR
111#define bfin_read_UART_DLL() bfin_read_UART0_DLL()
112#define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
113#define BFIN_UART_DLL UART0_DLL
114#define bfin_read_UART_IER() bfin_read_UART0_IER()
115#define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
116#define BFIN_UART_IER UART0_IER
117#define bfin_read_UART_DLH() bfin_read_UART0_DLH()
118#define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
119#define BFIN_UART_DLH UART0_DLH
120#define bfin_read_UART_IIR() bfin_read_UART0_IIR()
121#define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
122#define BFIN_UART_IIR UART0_IIR
123#define bfin_read_UART_LCR() bfin_read_UART0_LCR()
124#define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
125#define BFIN_UART_LCR UART0_LCR
126#define bfin_read_UART_MCR() bfin_read_UART0_MCR()
127#define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
128#define BFIN_UART_MCR UART0_MCR
129#define bfin_read_UART_LSR() bfin_read_UART0_LSR()
130#define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
131#define BFIN_UART_LSR UART0_LSR
132#define bfin_read_UART_SCR() bfin_read_UART0_SCR()
133#define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
134#define BFIN_UART_SCR UART0_SCR
135#define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
136#define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
137#define BFIN_UART_GCTL UART0_GCTL
138
139#define BFIN_UART_NR_PORTS 2
140
141#define OFFSET_THR 0x00 /* Transmit Holding register */
142#define OFFSET_RBR 0x00 /* Receive Buffer register */
143#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
144#define OFFSET_IER 0x04 /* Interrupt Enable Register */
145#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
146#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
147#define OFFSET_LCR 0x0C /* Line Control Register */
148#define OFFSET_MCR 0x10 /* Modem Control Register */
149#define OFFSET_LSR 0x14 /* Line Status Register */
150#define OFFSET_MSR 0x18 /* Modem Status Register */
151#define OFFSET_SCR 0x1C /* SCR Scratch Register */
152#define OFFSET_GCTL 0x24 /* Global Control Register */
153
154/* DPMC*/
155#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
156#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
157#define STOPCK_OFF STOPCK
158
159/* PLL_DIV Masks */
160#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
161#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
162#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
163#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
164
165#endif
diff --git a/include/asm-blackfin/mach-bf537/cdefBF534.h b/include/asm-blackfin/mach-bf537/cdefBF534.h
deleted file mode 100644
index 82de526f8097..000000000000
--- a/include/asm-blackfin/mach-bf537/cdefBF534.h
+++ /dev/null
@@ -1,1819 +0,0 @@
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 <asm/blackfin.h>
36
37/* Include all Core registers and bit definitions */
38#include "defBF534.h"
39
40/* Include core specific register pointer definitions */
41#include <asm/mach-common/cdef_LPBlackfin.h>
42
43#include <asm/system.h>
44
45/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
46#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
47/* Writing to PLL_CTL initiates a PLL relock sequence. */
48static __inline__ void bfin_write_PLL_CTL(unsigned int val)
49{
50 unsigned long flags, iwr;
51
52 if (val == bfin_read_PLL_CTL())
53 return;
54
55 local_irq_save(flags);
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
61 bfin_write16(PLL_CTL, val);
62 SSYNC();
63 asm("IDLE;");
64
65 bfin_write32(SIC_IWR, iwr);
66 local_irq_restore(flags);
67}
68#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
69#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
70#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
71/* Writing to VR_CTL initiates a PLL relock sequence. */
72static __inline__ void bfin_write_VR_CTL(unsigned int val)
73{
74 unsigned long flags, iwr;
75
76 if (val == bfin_read_VR_CTL())
77 return;
78
79 local_irq_save(flags);
80 /* Enable the PLL Wakeup bit in SIC IWR */
81 iwr = bfin_read32(SIC_IWR);
82 /* Only allow PPL Wakeup) */
83 bfin_write32(SIC_IWR, IWR_ENABLE(0));
84
85 bfin_write16(VR_CTL, val);
86 SSYNC();
87 asm("IDLE;");
88
89 bfin_write32(SIC_IWR, iwr);
90 local_irq_restore(flags);
91}
92#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
93#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
94#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
95#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
96#define bfin_read_CHIPID() bfin_read32(CHIPID)
97
98/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
99#define bfin_read_SWRST() bfin_read16(SWRST)
100#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
101#define bfin_read_SYSCR() bfin_read16(SYSCR)
102#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
103#define bfin_read_SIC_RVECT() bfin_read32(SIC_RVECT)
104#define bfin_write_SIC_RVECT(val) bfin_write32(SIC_RVECT,val)
105#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK)
106#define bfin_write_SIC_IMASK(val) bfin_write32(SIC_IMASK,val)
107#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
108#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0,val)
109#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
110#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1,val)
111#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
112#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2,val)
113#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
114#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3,val)
115#define bfin_read_SIC_ISR() bfin_read32(SIC_ISR)
116#define bfin_write_SIC_ISR(val) bfin_write32(SIC_ISR,val)
117#define bfin_read_SIC_IWR() bfin_read32(SIC_IWR)
118#define bfin_write_SIC_IWR(val) bfin_write32(SIC_IWR,val)
119
120/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
121#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
122#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL,val)
123#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
124#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT,val)
125#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
126#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT,val)
127
128/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
129#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
130#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT,val)
131#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
132#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL,val)
133#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
134#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT,val)
135#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
136#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT,val)
137#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
138#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM,val)
139#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
140#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST,val)
141#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
142#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val)
143
144/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
145#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
146#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR,val)
147#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
148#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR,val)
149#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
150#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL,val)
151#define bfin_read_UART0_IER() bfin_read16(UART0_IER)
152#define bfin_write_UART0_IER(val) bfin_write16(UART0_IER,val)
153#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
154#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH,val)
155#define bfin_read_UART0_IIR() bfin_read16(UART0_IIR)
156#define bfin_write_UART0_IIR(val) bfin_write16(UART0_IIR,val)
157#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
158#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR,val)
159#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
160#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR,val)
161#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
162#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR,val)
163#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
164#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR,val)
165#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
166#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR,val)
167#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
168#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL,val)
169
170/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
171#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
172#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL,val)
173#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
174#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG,val)
175#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
176#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT,val)
177#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
178#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR,val)
179#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
180#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR,val)
181#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
182#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD,val)
183#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
184#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW,val)
185
186/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
187#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
188#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG,val)
189#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
190#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER,val)
191#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
192#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD,val)
193#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
194#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH,val)
195
196#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
197#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG,val)
198#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
199#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER,val)
200#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
201#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD,val)
202#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
203#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH,val)
204
205#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
206#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG,val)
207#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
208#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER,val)
209#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
210#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD,val)
211#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
212#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH,val)
213
214#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
215#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG,val)
216#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
217#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER,val)
218#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
219#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD,val)
220#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
221#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH,val)
222
223#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
224#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG,val)
225#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
226#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER,val)
227#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
228#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD,val)
229#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
230#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH,val)
231
232#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
233#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG,val)
234#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
235#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER,val)
236#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
237#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD,val)
238#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
239#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH,val)
240
241#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
242#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG,val)
243#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
244#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER,val)
245#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
246#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD,val)
247#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
248#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH,val)
249
250#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
251#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG,val)
252#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
253#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER,val)
254#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
255#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD,val)
256#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
257#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH,val)
258
259#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
260#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE,val)
261#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
262#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE,val)
263#define bfin_read_TIMER_STATUS() bfin_read32(TIMER_STATUS)
264#define bfin_write_TIMER_STATUS(val) bfin_write32(TIMER_STATUS,val)
265
266/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
267#define bfin_read_PORTFIO() bfin_read16(PORTFIO)
268#define bfin_write_PORTFIO(val) bfin_write16(PORTFIO,val)
269#define bfin_read_PORTFIO_CLEAR() bfin_read16(PORTFIO_CLEAR)
270#define bfin_write_PORTFIO_CLEAR(val) bfin_write16(PORTFIO_CLEAR,val)
271#define bfin_read_PORTFIO_SET() bfin_read16(PORTFIO_SET)
272#define bfin_write_PORTFIO_SET(val) bfin_write16(PORTFIO_SET,val)
273#define bfin_read_PORTFIO_TOGGLE() bfin_read16(PORTFIO_TOGGLE)
274#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE,val)
275#define bfin_read_PORTFIO_MASKA() bfin_read16(PORTFIO_MASKA)
276#define bfin_write_PORTFIO_MASKA(val) bfin_write16(PORTFIO_MASKA,val)
277#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
278#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR,val)
279#define bfin_read_PORTFIO_MASKA_SET() bfin_read16(PORTFIO_MASKA_SET)
280#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET,val)
281#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
282#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE,val)
283#define bfin_read_PORTFIO_MASKB() bfin_read16(PORTFIO_MASKB)
284#define bfin_write_PORTFIO_MASKB(val) bfin_write16(PORTFIO_MASKB,val)
285#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
286#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR,val)
287#define bfin_read_PORTFIO_MASKB_SET() bfin_read16(PORTFIO_MASKB_SET)
288#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET,val)
289#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
290#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE,val)
291#define bfin_read_PORTFIO_DIR() bfin_read16(PORTFIO_DIR)
292#define bfin_write_PORTFIO_DIR(val) bfin_write16(PORTFIO_DIR,val)
293#define bfin_read_PORTFIO_POLAR() bfin_read16(PORTFIO_POLAR)
294#define bfin_write_PORTFIO_POLAR(val) bfin_write16(PORTFIO_POLAR,val)
295#define bfin_read_PORTFIO_EDGE() bfin_read16(PORTFIO_EDGE)
296#define bfin_write_PORTFIO_EDGE(val) bfin_write16(PORTFIO_EDGE,val)
297#define bfin_read_PORTFIO_BOTH() bfin_read16(PORTFIO_BOTH)
298#define bfin_write_PORTFIO_BOTH(val) bfin_write16(PORTFIO_BOTH,val)
299#define bfin_read_PORTFIO_INEN() bfin_read16(PORTFIO_INEN)
300#define bfin_write_PORTFIO_INEN(val) bfin_write16(PORTFIO_INEN,val)
301
302/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
303#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
304#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1,val)
305#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
306#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2,val)
307#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
308#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV,val)
309#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
310#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV,val)
311#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
312#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX,val)
313#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
314#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX,val)
315#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX)
316#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX,val)
317#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX)
318#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX,val)
319#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX)
320#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX,val)
321#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX)
322#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX,val)
323#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
324#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1,val)
325#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
326#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2,val)
327#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
328#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV,val)
329#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
330#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV,val)
331#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
332#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT,val)
333#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
334#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL,val)
335#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
336#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1,val)
337#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
338#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2,val)
339#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
340#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0,val)
341#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
342#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1,val)
343#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
344#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2,val)
345#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
346#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3,val)
347#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
348#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0,val)
349#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
350#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1,val)
351#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
352#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2,val)
353#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
354#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3,val)
355
356/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
357#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
358#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1,val)
359#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
360#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2,val)
361#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
362#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV,val)
363#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
364#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV,val)
365#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
366#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val)
367#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
368#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX,val)
369#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX)
370#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val)
371#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX)
372#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX,val)
373#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX)
374#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
375#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX)
376#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX,val)
377#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
378#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1,val)
379#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
380#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2,val)
381#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
382#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV,val)
383#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
384#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV,val)
385#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
386#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT,val)
387#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
388#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL,val)
389#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
390#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1,val)
391#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
392#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2,val)
393#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
394#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0,val)
395#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
396#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1,val)
397#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
398#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2,val)
399#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
400#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3,val)
401#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
402#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0,val)
403#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
404#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1,val)
405#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
406#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2,val)
407#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
408#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3,val)
409
410/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
411#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
412#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL,val)
413#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
414#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0,val)
415#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
416#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1,val)
417#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
418#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL,val)
419#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
420#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL,val)
421#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
422#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC,val)
423#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
424#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
425
426/* DMA Traffic Control Registers */
427#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
428#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER,val)
429#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
430#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT,val)
431
432/* Alternate deprecated register names (below) provided for backwards code compatibility */
433#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
434#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
435#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
436#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
437
438/* DMA Controller */
439#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
440#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
441#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
442#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR,val)
443#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
444#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR,val)
445#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
446#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT,val)
447#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
448#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT,val)
449#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
450#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY,val)
451#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
452#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY,val)
453#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
454#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR,val)
455#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
456#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR,val)
457#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
458#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT,val)
459#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
460#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT,val)
461#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
462#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS,val)
463#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
464#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP,val)
465
466#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
467#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG,val)
468#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
469#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR,val)
470#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
471#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR,val)
472#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
473#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT,val)
474#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
475#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT,val)
476#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
477#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY,val)
478#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
479#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY,val)
480#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
481#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR,val)
482#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
483#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR,val)
484#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
485#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT,val)
486#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
487#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT,val)
488#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
489#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS,val)
490#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
491#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP,val)
492
493#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
494#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG,val)
495#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
496#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR,val)
497#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
498#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR,val)
499#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
500#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT,val)
501#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
502#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT,val)
503#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
504#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY,val)
505#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
506#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY,val)
507#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
508#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR,val)
509#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
510#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR,val)
511#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
512#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT,val)
513#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
514#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT,val)
515#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
516#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS,val)
517#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
518#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP,val)
519
520#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
521#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG,val)
522#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
523#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR,val)
524#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
525#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR,val)
526#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
527#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT,val)
528#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
529#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT,val)
530#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
531#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY,val)
532#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
533#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY,val)
534#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
535#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR,val)
536#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
537#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR,val)
538#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
539#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT,val)
540#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
541#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT,val)
542#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
543#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS,val)
544#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
545#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP,val)
546
547#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
548#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG,val)
549#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
550#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR,val)
551#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
552#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR,val)
553#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
554#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT,val)
555#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
556#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT,val)
557#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
558#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY,val)
559#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
560#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY,val)
561#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
562#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR,val)
563#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
564#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR,val)
565#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
566#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT,val)
567#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
568#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT,val)
569#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
570#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS,val)
571#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
572#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP,val)
573
574#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
575#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG,val)
576#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
577#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR,val)
578#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
579#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR,val)
580#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
581#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT,val)
582#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
583#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT,val)
584#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
585#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY,val)
586#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
587#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY,val)
588#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
589#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR,val)
590#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
591#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR,val)
592#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
593#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT,val)
594#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
595#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT,val)
596#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
597#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS,val)
598#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
599#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP,val)
600
601#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
602#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG,val)
603#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
604#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR,val)
605#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
606#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR,val)
607#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
608#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT,val)
609#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
610#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT,val)
611#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
612#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY,val)
613#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
614#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY,val)
615#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
616#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR,val)
617#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
618#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR,val)
619#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
620#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT,val)
621#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
622#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT,val)
623#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
624#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS,val)
625#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
626#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP,val)
627
628#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
629#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG,val)
630#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
631#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR,val)
632#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
633#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR,val)
634#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
635#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT,val)
636#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
637#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT,val)
638#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
639#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY,val)
640#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
641#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY,val)
642#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
643#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR,val)
644#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
645#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR,val)
646#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
647#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT,val)
648#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
649#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT,val)
650#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
651#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS,val)
652#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
653#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP,val)
654
655#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
656#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG,val)
657#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_read32(DMA8_NEXT_DESC_PTR)
658#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_write32(DMA8_NEXT_DESC_PTR,val)
659#define bfin_read_DMA8_START_ADDR() bfin_read32(DMA8_START_ADDR)
660#define bfin_write_DMA8_START_ADDR(val) bfin_write32(DMA8_START_ADDR,val)
661#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
662#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT,val)
663#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
664#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT,val)
665#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
666#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY,val)
667#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
668#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY,val)
669#define bfin_read_DMA8_CURR_DESC_PTR() bfin_read32(DMA8_CURR_DESC_PTR)
670#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_write32(DMA8_CURR_DESC_PTR,val)
671#define bfin_read_DMA8_CURR_ADDR() bfin_read32(DMA8_CURR_ADDR)
672#define bfin_write_DMA8_CURR_ADDR(val) bfin_write32(DMA8_CURR_ADDR,val)
673#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
674#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT,val)
675#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
676#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT,val)
677#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
678#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS,val)
679#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
680#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP,val)
681
682#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
683#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG,val)
684#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_read32(DMA9_NEXT_DESC_PTR)
685#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_write32(DMA9_NEXT_DESC_PTR,val)
686#define bfin_read_DMA9_START_ADDR() bfin_read32(DMA9_START_ADDR)
687#define bfin_write_DMA9_START_ADDR(val) bfin_write32(DMA9_START_ADDR,val)
688#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
689#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT,val)
690#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
691#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT,val)
692#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
693#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY,val)
694#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
695#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY,val)
696#define bfin_read_DMA9_CURR_DESC_PTR() bfin_read32(DMA9_CURR_DESC_PTR)
697#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_write32(DMA9_CURR_DESC_PTR,val)
698#define bfin_read_DMA9_CURR_ADDR() bfin_read32(DMA9_CURR_ADDR)
699#define bfin_write_DMA9_CURR_ADDR(val) bfin_write32(DMA9_CURR_ADDR,val)
700#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
701#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT,val)
702#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
703#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT,val)
704#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
705#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS,val)
706#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
707#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP,val)
708
709#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
710#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG,val)
711#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_read32(DMA10_NEXT_DESC_PTR)
712#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_write32(DMA10_NEXT_DESC_PTR,val)
713#define bfin_read_DMA10_START_ADDR() bfin_read32(DMA10_START_ADDR)
714#define bfin_write_DMA10_START_ADDR(val) bfin_write32(DMA10_START_ADDR,val)
715#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
716#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT,val)
717#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
718#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT,val)
719#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
720#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY,val)
721#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
722#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY,val)
723#define bfin_read_DMA10_CURR_DESC_PTR() bfin_read32(DMA10_CURR_DESC_PTR)
724#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_write32(DMA10_CURR_DESC_PTR,val)
725#define bfin_read_DMA10_CURR_ADDR() bfin_read32(DMA10_CURR_ADDR)
726#define bfin_write_DMA10_CURR_ADDR(val) bfin_write32(DMA10_CURR_ADDR,val)
727#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
728#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT,val)
729#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
730#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT,val)
731#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
732#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS,val)
733#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
734#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP,val)
735
736#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
737#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG,val)
738#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_read32(DMA11_NEXT_DESC_PTR)
739#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_write32(DMA11_NEXT_DESC_PTR,val)
740#define bfin_read_DMA11_START_ADDR() bfin_read32(DMA11_START_ADDR)
741#define bfin_write_DMA11_START_ADDR(val) bfin_write32(DMA11_START_ADDR,val)
742#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
743#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT,val)
744#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
745#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT,val)
746#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
747#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY,val)
748#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
749#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY,val)
750#define bfin_read_DMA11_CURR_DESC_PTR() bfin_read32(DMA11_CURR_DESC_PTR)
751#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_write32(DMA11_CURR_DESC_PTR,val)
752#define bfin_read_DMA11_CURR_ADDR() bfin_read32(DMA11_CURR_ADDR)
753#define bfin_write_DMA11_CURR_ADDR(val) bfin_write32(DMA11_CURR_ADDR,val)
754#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
755#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT,val)
756#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
757#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT,val)
758#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
759#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS,val)
760#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
761#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP,val)
762
763#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
764#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG,val)
765#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
766#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR,val)
767#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
768#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR,val)
769#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
770#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT,val)
771#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
772#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT,val)
773#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
774#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY,val)
775#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
776#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY,val)
777#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
778#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR,val)
779#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
780#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR,val)
781#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
782#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT,val)
783#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
784#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT,val)
785#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
786#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS,val)
787#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
788#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP,val)
789
790#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
791#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG,val)
792#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
793#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR,val)
794#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
795#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR,val)
796#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
797#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT,val)
798#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
799#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT,val)
800#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
801#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY,val)
802#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
803#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY,val)
804#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
805#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR,val)
806#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
807#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR,val)
808#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
809#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT,val)
810#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
811#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT,val)
812#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
813#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS,val)
814#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
815#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP,val)
816
817#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
818#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG,val)
819#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
820#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR,val)
821#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
822#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR,val)
823#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
824#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT,val)
825#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
826#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT,val)
827#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
828#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY,val)
829#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
830#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY,val)
831#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
832#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR,val)
833#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
834#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR,val)
835#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
836#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT,val)
837#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
838#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT,val)
839#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
840#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS,val)
841#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
842#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP,val)
843
844#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
845#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG,val)
846#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
847#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR,val)
848#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
849#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR,val)
850#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
851#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT,val)
852#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
853#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT,val)
854#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
855#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY,val)
856#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
857#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY,val)
858#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
859#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR,val)
860#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
861#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR,val)
862#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
863#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT,val)
864#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
865#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT,val)
866#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
867#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS,val)
868#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
869#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP,val)
870
871/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
872#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
873#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL,val)
874#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
875#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS,val)
876#define bfin_clear_PPI_STATUS() bfin_write_PPI_STATUS(0xFFFF)
877#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
878#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY,val)
879#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
880#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT,val)
881#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
882#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val)
883
884/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
885
886/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
887#define bfin_read_PORTGIO() bfin_read16(PORTGIO)
888#define bfin_write_PORTGIO(val) bfin_write16(PORTGIO,val)
889#define bfin_read_PORTGIO_CLEAR() bfin_read16(PORTGIO_CLEAR)
890#define bfin_write_PORTGIO_CLEAR(val) bfin_write16(PORTGIO_CLEAR,val)
891#define bfin_read_PORTGIO_SET() bfin_read16(PORTGIO_SET)
892#define bfin_write_PORTGIO_SET(val) bfin_write16(PORTGIO_SET,val)
893#define bfin_read_PORTGIO_TOGGLE() bfin_read16(PORTGIO_TOGGLE)
894#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE,val)
895#define bfin_read_PORTGIO_MASKA() bfin_read16(PORTGIO_MASKA)
896#define bfin_write_PORTGIO_MASKA(val) bfin_write16(PORTGIO_MASKA,val)
897#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
898#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR,val)
899#define bfin_read_PORTGIO_MASKA_SET() bfin_read16(PORTGIO_MASKA_SET)
900#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET,val)
901#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
902#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE,val)
903#define bfin_read_PORTGIO_MASKB() bfin_read16(PORTGIO_MASKB)
904#define bfin_write_PORTGIO_MASKB(val) bfin_write16(PORTGIO_MASKB,val)
905#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
906#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR,val)
907#define bfin_read_PORTGIO_MASKB_SET() bfin_read16(PORTGIO_MASKB_SET)
908#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET,val)
909#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
910#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE,val)
911#define bfin_read_PORTGIO_DIR() bfin_read16(PORTGIO_DIR)
912#define bfin_write_PORTGIO_DIR(val) bfin_write16(PORTGIO_DIR,val)
913#define bfin_read_PORTGIO_POLAR() bfin_read16(PORTGIO_POLAR)
914#define bfin_write_PORTGIO_POLAR(val) bfin_write16(PORTGIO_POLAR,val)
915#define bfin_read_PORTGIO_EDGE() bfin_read16(PORTGIO_EDGE)
916#define bfin_write_PORTGIO_EDGE(val) bfin_write16(PORTGIO_EDGE,val)
917#define bfin_read_PORTGIO_BOTH() bfin_read16(PORTGIO_BOTH)
918#define bfin_write_PORTGIO_BOTH(val) bfin_write16(PORTGIO_BOTH,val)
919#define bfin_read_PORTGIO_INEN() bfin_read16(PORTGIO_INEN)
920#define bfin_write_PORTGIO_INEN(val) bfin_write16(PORTGIO_INEN,val)
921
922/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
923#define bfin_read_PORTHIO() bfin_read16(PORTHIO)
924#define bfin_write_PORTHIO(val) bfin_write16(PORTHIO,val)
925#define bfin_read_PORTHIO_CLEAR() bfin_read16(PORTHIO_CLEAR)
926#define bfin_write_PORTHIO_CLEAR(val) bfin_write16(PORTHIO_CLEAR,val)
927#define bfin_read_PORTHIO_SET() bfin_read16(PORTHIO_SET)
928#define bfin_write_PORTHIO_SET(val) bfin_write16(PORTHIO_SET,val)
929#define bfin_read_PORTHIO_TOGGLE() bfin_read16(PORTHIO_TOGGLE)
930#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE,val)
931#define bfin_read_PORTHIO_MASKA() bfin_read16(PORTHIO_MASKA)
932#define bfin_write_PORTHIO_MASKA(val) bfin_write16(PORTHIO_MASKA,val)
933#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
934#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR,val)
935#define bfin_read_PORTHIO_MASKA_SET() bfin_read16(PORTHIO_MASKA_SET)
936#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET,val)
937#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
938#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE,val)
939#define bfin_read_PORTHIO_MASKB() bfin_read16(PORTHIO_MASKB)
940#define bfin_write_PORTHIO_MASKB(val) bfin_write16(PORTHIO_MASKB,val)
941#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
942#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR,val)
943#define bfin_read_PORTHIO_MASKB_SET() bfin_read16(PORTHIO_MASKB_SET)
944#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET,val)
945#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
946#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE,val)
947#define bfin_read_PORTHIO_DIR() bfin_read16(PORTHIO_DIR)
948#define bfin_write_PORTHIO_DIR(val) bfin_write16(PORTHIO_DIR,val)
949#define bfin_read_PORTHIO_POLAR() bfin_read16(PORTHIO_POLAR)
950#define bfin_write_PORTHIO_POLAR(val) bfin_write16(PORTHIO_POLAR,val)
951#define bfin_read_PORTHIO_EDGE() bfin_read16(PORTHIO_EDGE)
952#define bfin_write_PORTHIO_EDGE(val) bfin_write16(PORTHIO_EDGE,val)
953#define bfin_read_PORTHIO_BOTH() bfin_read16(PORTHIO_BOTH)
954#define bfin_write_PORTHIO_BOTH(val) bfin_write16(PORTHIO_BOTH,val)
955#define bfin_read_PORTHIO_INEN() bfin_read16(PORTHIO_INEN)
956#define bfin_write_PORTHIO_INEN(val) bfin_write16(PORTHIO_INEN,val)
957
958/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
959#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
960#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR,val)
961#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
962#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR,val)
963#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
964#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL,val)
965#define bfin_read_UART1_IER() bfin_read16(UART1_IER)
966#define bfin_write_UART1_IER(val) bfin_write16(UART1_IER,val)
967#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
968#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH,val)
969#define bfin_read_UART1_IIR() bfin_read16(UART1_IIR)
970#define bfin_write_UART1_IIR(val) bfin_write16(UART1_IIR,val)
971#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
972#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR,val)
973#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
974#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR,val)
975#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
976#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR,val)
977#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
978#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR,val)
979#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
980#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR,val)
981#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
982#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL,val)
983
984/* CAN Controller (0xFFC02A00 - 0xFFC02FFF) */
985/* For Mailboxes 0-15 */
986#define bfin_read_CAN_MC1() bfin_read16(CAN_MC1)
987#define bfin_write_CAN_MC1(val) bfin_write16(CAN_MC1,val)
988#define bfin_read_CAN_MD1() bfin_read16(CAN_MD1)
989#define bfin_write_CAN_MD1(val) bfin_write16(CAN_MD1,val)
990#define bfin_read_CAN_TRS1() bfin_read16(CAN_TRS1)
991#define bfin_write_CAN_TRS1(val) bfin_write16(CAN_TRS1,val)
992#define bfin_read_CAN_TRR1() bfin_read16(CAN_TRR1)
993#define bfin_write_CAN_TRR1(val) bfin_write16(CAN_TRR1,val)
994#define bfin_read_CAN_TA1() bfin_read16(CAN_TA1)
995#define bfin_write_CAN_TA1(val) bfin_write16(CAN_TA1,val)
996#define bfin_read_CAN_AA1() bfin_read16(CAN_AA1)
997#define bfin_write_CAN_AA1(val) bfin_write16(CAN_AA1,val)
998#define bfin_read_CAN_RMP1() bfin_read16(CAN_RMP1)
999#define bfin_write_CAN_RMP1(val) bfin_write16(CAN_RMP1,val)
1000#define bfin_read_CAN_RML1() bfin_read16(CAN_RML1)
1001#define bfin_write_CAN_RML1(val) bfin_write16(CAN_RML1,val)
1002#define bfin_read_CAN_MBTIF1() bfin_read16(CAN_MBTIF1)
1003#define bfin_write_CAN_MBTIF1(val) bfin_write16(CAN_MBTIF1,val)
1004#define bfin_read_CAN_MBRIF1() bfin_read16(CAN_MBRIF1)
1005#define bfin_write_CAN_MBRIF1(val) bfin_write16(CAN_MBRIF1,val)
1006#define bfin_read_CAN_MBIM1() bfin_read16(CAN_MBIM1)
1007#define bfin_write_CAN_MBIM1(val) bfin_write16(CAN_MBIM1,val)
1008#define bfin_read_CAN_RFH1() bfin_read16(CAN_RFH1)
1009#define bfin_write_CAN_RFH1(val) bfin_write16(CAN_RFH1,val)
1010#define bfin_read_CAN_OPSS1() bfin_read16(CAN_OPSS1)
1011#define bfin_write_CAN_OPSS1(val) bfin_write16(CAN_OPSS1,val)
1012
1013/* For Mailboxes 16-31 */
1014#define bfin_read_CAN_MC2() bfin_read16(CAN_MC2)
1015#define bfin_write_CAN_MC2(val) bfin_write16(CAN_MC2,val)
1016#define bfin_read_CAN_MD2() bfin_read16(CAN_MD2)
1017#define bfin_write_CAN_MD2(val) bfin_write16(CAN_MD2,val)
1018#define bfin_read_CAN_TRS2() bfin_read16(CAN_TRS2)
1019#define bfin_write_CAN_TRS2(val) bfin_write16(CAN_TRS2,val)
1020#define bfin_read_CAN_TRR2() bfin_read16(CAN_TRR2)
1021#define bfin_write_CAN_TRR2(val) bfin_write16(CAN_TRR2,val)
1022#define bfin_read_CAN_TA2() bfin_read16(CAN_TA2)
1023#define bfin_write_CAN_TA2(val) bfin_write16(CAN_TA2,val)
1024#define bfin_read_CAN_AA2() bfin_read16(CAN_AA2)
1025#define bfin_write_CAN_AA2(val) bfin_write16(CAN_AA2,val)
1026#define bfin_read_CAN_RMP2() bfin_read16(CAN_RMP2)
1027#define bfin_write_CAN_RMP2(val) bfin_write16(CAN_RMP2,val)
1028#define bfin_read_CAN_RML2() bfin_read16(CAN_RML2)
1029#define bfin_write_CAN_RML2(val) bfin_write16(CAN_RML2,val)
1030#define bfin_read_CAN_MBTIF2() bfin_read16(CAN_MBTIF2)
1031#define bfin_write_CAN_MBTIF2(val) bfin_write16(CAN_MBTIF2,val)
1032#define bfin_read_CAN_MBRIF2() bfin_read16(CAN_MBRIF2)
1033#define bfin_write_CAN_MBRIF2(val) bfin_write16(CAN_MBRIF2,val)
1034#define bfin_read_CAN_MBIM2() bfin_read16(CAN_MBIM2)
1035#define bfin_write_CAN_MBIM2(val) bfin_write16(CAN_MBIM2,val)
1036#define bfin_read_CAN_RFH2() bfin_read16(CAN_RFH2)
1037#define bfin_write_CAN_RFH2(val) bfin_write16(CAN_RFH2,val)
1038#define bfin_read_CAN_OPSS2() bfin_read16(CAN_OPSS2)
1039#define bfin_write_CAN_OPSS2(val) bfin_write16(CAN_OPSS2,val)
1040
1041#define bfin_read_CAN_CLOCK() bfin_read16(CAN_CLOCK)
1042#define bfin_write_CAN_CLOCK(val) bfin_write16(CAN_CLOCK,val)
1043#define bfin_read_CAN_TIMING() bfin_read16(CAN_TIMING)
1044#define bfin_write_CAN_TIMING(val) bfin_write16(CAN_TIMING,val)
1045#define bfin_read_CAN_DEBUG() bfin_read16(CAN_DEBUG)
1046#define bfin_write_CAN_DEBUG(val) bfin_write16(CAN_DEBUG,val)
1047#define bfin_read_CAN_STATUS() bfin_read16(CAN_STATUS)
1048#define bfin_write_CAN_STATUS(val) bfin_write16(CAN_STATUS,val)
1049#define bfin_read_CAN_CEC() bfin_read16(CAN_CEC)
1050#define bfin_write_CAN_CEC(val) bfin_write16(CAN_CEC,val)
1051#define bfin_read_CAN_GIS() bfin_read16(CAN_GIS)
1052#define bfin_write_CAN_GIS(val) bfin_write16(CAN_GIS,val)
1053#define bfin_read_CAN_GIM() bfin_read16(CAN_GIM)
1054#define bfin_write_CAN_GIM(val) bfin_write16(CAN_GIM,val)
1055#define bfin_read_CAN_GIF() bfin_read16(CAN_GIF)
1056#define bfin_write_CAN_GIF(val) bfin_write16(CAN_GIF,val)
1057#define bfin_read_CAN_CONTROL() bfin_read16(CAN_CONTROL)
1058#define bfin_write_CAN_CONTROL(val) bfin_write16(CAN_CONTROL,val)
1059#define bfin_read_CAN_INTR() bfin_read16(CAN_INTR)
1060#define bfin_write_CAN_INTR(val) bfin_write16(CAN_INTR,val)
1061#define bfin_read_CAN_SFCMVER() bfin_read16(CAN_SFCMVER)
1062#define bfin_write_CAN_SFCMVER(val) bfin_write16(CAN_SFCMVER,val)
1063#define bfin_read_CAN_MBTD() bfin_read16(CAN_MBTD)
1064#define bfin_write_CAN_MBTD(val) bfin_write16(CAN_MBTD,val)
1065#define bfin_read_CAN_EWR() bfin_read16(CAN_EWR)
1066#define bfin_write_CAN_EWR(val) bfin_write16(CAN_EWR,val)
1067#define bfin_read_CAN_ESR() bfin_read16(CAN_ESR)
1068#define bfin_write_CAN_ESR(val) bfin_write16(CAN_ESR,val)
1069#define bfin_read_CAN_UCREG() bfin_read16(CAN_UCREG)
1070#define bfin_write_CAN_UCREG(val) bfin_write16(CAN_UCREG,val)
1071#define bfin_read_CAN_UCCNT() bfin_read16(CAN_UCCNT)
1072#define bfin_write_CAN_UCCNT(val) bfin_write16(CAN_UCCNT,val)
1073#define bfin_read_CAN_UCRC() bfin_read16(CAN_UCRC)
1074#define bfin_write_CAN_UCRC(val) bfin_write16(CAN_UCRC,val)
1075#define bfin_read_CAN_UCCNF() bfin_read16(CAN_UCCNF)
1076#define bfin_write_CAN_UCCNF(val) bfin_write16(CAN_UCCNF,val)
1077
1078/* Mailbox Acceptance Masks */
1079#define bfin_read_CAN_AM00L() bfin_read16(CAN_AM00L)
1080#define bfin_write_CAN_AM00L(val) bfin_write16(CAN_AM00L,val)
1081#define bfin_read_CAN_AM00H() bfin_read16(CAN_AM00H)
1082#define bfin_write_CAN_AM00H(val) bfin_write16(CAN_AM00H,val)
1083#define bfin_read_CAN_AM01L() bfin_read16(CAN_AM01L)
1084#define bfin_write_CAN_AM01L(val) bfin_write16(CAN_AM01L,val)
1085#define bfin_read_CAN_AM01H() bfin_read16(CAN_AM01H)
1086#define bfin_write_CAN_AM01H(val) bfin_write16(CAN_AM01H,val)
1087#define bfin_read_CAN_AM02L() bfin_read16(CAN_AM02L)
1088#define bfin_write_CAN_AM02L(val) bfin_write16(CAN_AM02L,val)
1089#define bfin_read_CAN_AM02H() bfin_read16(CAN_AM02H)
1090#define bfin_write_CAN_AM02H(val) bfin_write16(CAN_AM02H,val)
1091#define bfin_read_CAN_AM03L() bfin_read16(CAN_AM03L)
1092#define bfin_write_CAN_AM03L(val) bfin_write16(CAN_AM03L,val)
1093#define bfin_read_CAN_AM03H() bfin_read16(CAN_AM03H)
1094#define bfin_write_CAN_AM03H(val) bfin_write16(CAN_AM03H,val)
1095#define bfin_read_CAN_AM04L() bfin_read16(CAN_AM04L)
1096#define bfin_write_CAN_AM04L(val) bfin_write16(CAN_AM04L,val)
1097#define bfin_read_CAN_AM04H() bfin_read16(CAN_AM04H)
1098#define bfin_write_CAN_AM04H(val) bfin_write16(CAN_AM04H,val)
1099#define bfin_read_CAN_AM05L() bfin_read16(CAN_AM05L)
1100#define bfin_write_CAN_AM05L(val) bfin_write16(CAN_AM05L,val)
1101#define bfin_read_CAN_AM05H() bfin_read16(CAN_AM05H)
1102#define bfin_write_CAN_AM05H(val) bfin_write16(CAN_AM05H,val)
1103#define bfin_read_CAN_AM06L() bfin_read16(CAN_AM06L)
1104#define bfin_write_CAN_AM06L(val) bfin_write16(CAN_AM06L,val)
1105#define bfin_read_CAN_AM06H() bfin_read16(CAN_AM06H)
1106#define bfin_write_CAN_AM06H(val) bfin_write16(CAN_AM06H,val)
1107#define bfin_read_CAN_AM07L() bfin_read16(CAN_AM07L)
1108#define bfin_write_CAN_AM07L(val) bfin_write16(CAN_AM07L,val)
1109#define bfin_read_CAN_AM07H() bfin_read16(CAN_AM07H)
1110#define bfin_write_CAN_AM07H(val) bfin_write16(CAN_AM07H,val)
1111#define bfin_read_CAN_AM08L() bfin_read16(CAN_AM08L)
1112#define bfin_write_CAN_AM08L(val) bfin_write16(CAN_AM08L,val)
1113#define bfin_read_CAN_AM08H() bfin_read16(CAN_AM08H)
1114#define bfin_write_CAN_AM08H(val) bfin_write16(CAN_AM08H,val)
1115#define bfin_read_CAN_AM09L() bfin_read16(CAN_AM09L)
1116#define bfin_write_CAN_AM09L(val) bfin_write16(CAN_AM09L,val)
1117#define bfin_read_CAN_AM09H() bfin_read16(CAN_AM09H)
1118#define bfin_write_CAN_AM09H(val) bfin_write16(CAN_AM09H,val)
1119#define bfin_read_CAN_AM10L() bfin_read16(CAN_AM10L)
1120#define bfin_write_CAN_AM10L(val) bfin_write16(CAN_AM10L,val)
1121#define bfin_read_CAN_AM10H() bfin_read16(CAN_AM10H)
1122#define bfin_write_CAN_AM10H(val) bfin_write16(CAN_AM10H,val)
1123#define bfin_read_CAN_AM11L() bfin_read16(CAN_AM11L)
1124#define bfin_write_CAN_AM11L(val) bfin_write16(CAN_AM11L,val)
1125#define bfin_read_CAN_AM11H() bfin_read16(CAN_AM11H)
1126#define bfin_write_CAN_AM11H(val) bfin_write16(CAN_AM11H,val)
1127#define bfin_read_CAN_AM12L() bfin_read16(CAN_AM12L)
1128#define bfin_write_CAN_AM12L(val) bfin_write16(CAN_AM12L,val)
1129#define bfin_read_CAN_AM12H() bfin_read16(CAN_AM12H)
1130#define bfin_write_CAN_AM12H(val) bfin_write16(CAN_AM12H,val)
1131#define bfin_read_CAN_AM13L() bfin_read16(CAN_AM13L)
1132#define bfin_write_CAN_AM13L(val) bfin_write16(CAN_AM13L,val)
1133#define bfin_read_CAN_AM13H() bfin_read16(CAN_AM13H)
1134#define bfin_write_CAN_AM13H(val) bfin_write16(CAN_AM13H,val)
1135#define bfin_read_CAN_AM14L() bfin_read16(CAN_AM14L)
1136#define bfin_write_CAN_AM14L(val) bfin_write16(CAN_AM14L,val)
1137#define bfin_read_CAN_AM14H() bfin_read16(CAN_AM14H)
1138#define bfin_write_CAN_AM14H(val) bfin_write16(CAN_AM14H,val)
1139#define bfin_read_CAN_AM15L() bfin_read16(CAN_AM15L)
1140#define bfin_write_CAN_AM15L(val) bfin_write16(CAN_AM15L,val)
1141#define bfin_read_CAN_AM15H() bfin_read16(CAN_AM15H)
1142#define bfin_write_CAN_AM15H(val) bfin_write16(CAN_AM15H,val)
1143
1144#define bfin_read_CAN_AM16L() bfin_read16(CAN_AM16L)
1145#define bfin_write_CAN_AM16L(val) bfin_write16(CAN_AM16L,val)
1146#define bfin_read_CAN_AM16H() bfin_read16(CAN_AM16H)
1147#define bfin_write_CAN_AM16H(val) bfin_write16(CAN_AM16H,val)
1148#define bfin_read_CAN_AM17L() bfin_read16(CAN_AM17L)
1149#define bfin_write_CAN_AM17L(val) bfin_write16(CAN_AM17L,val)
1150#define bfin_read_CAN_AM17H() bfin_read16(CAN_AM17H)
1151#define bfin_write_CAN_AM17H(val) bfin_write16(CAN_AM17H,val)
1152#define bfin_read_CAN_AM18L() bfin_read16(CAN_AM18L)
1153#define bfin_write_CAN_AM18L(val) bfin_write16(CAN_AM18L,val)
1154#define bfin_read_CAN_AM18H() bfin_read16(CAN_AM18H)
1155#define bfin_write_CAN_AM18H(val) bfin_write16(CAN_AM18H,val)
1156#define bfin_read_CAN_AM19L() bfin_read16(CAN_AM19L)
1157#define bfin_write_CAN_AM19L(val) bfin_write16(CAN_AM19L,val)
1158#define bfin_read_CAN_AM19H() bfin_read16(CAN_AM19H)
1159#define bfin_write_CAN_AM19H(val) bfin_write16(CAN_AM19H,val)
1160#define bfin_read_CAN_AM20L() bfin_read16(CAN_AM20L)
1161#define bfin_write_CAN_AM20L(val) bfin_write16(CAN_AM20L,val)
1162#define bfin_read_CAN_AM20H() bfin_read16(CAN_AM20H)
1163#define bfin_write_CAN_AM20H(val) bfin_write16(CAN_AM20H,val)
1164#define bfin_read_CAN_AM21L() bfin_read16(CAN_AM21L)
1165#define bfin_write_CAN_AM21L(val) bfin_write16(CAN_AM21L,val)
1166#define bfin_read_CAN_AM21H() bfin_read16(CAN_AM21H)
1167#define bfin_write_CAN_AM21H(val) bfin_write16(CAN_AM21H,val)
1168#define bfin_read_CAN_AM22L() bfin_read16(CAN_AM22L)
1169#define bfin_write_CAN_AM22L(val) bfin_write16(CAN_AM22L,val)
1170#define bfin_read_CAN_AM22H() bfin_read16(CAN_AM22H)
1171#define bfin_write_CAN_AM22H(val) bfin_write16(CAN_AM22H,val)
1172#define bfin_read_CAN_AM23L() bfin_read16(CAN_AM23L)
1173#define bfin_write_CAN_AM23L(val) bfin_write16(CAN_AM23L,val)
1174#define bfin_read_CAN_AM23H() bfin_read16(CAN_AM23H)
1175#define bfin_write_CAN_AM23H(val) bfin_write16(CAN_AM23H,val)
1176#define bfin_read_CAN_AM24L() bfin_read16(CAN_AM24L)
1177#define bfin_write_CAN_AM24L(val) bfin_write16(CAN_AM24L,val)
1178#define bfin_read_CAN_AM24H() bfin_read16(CAN_AM24H)
1179#define bfin_write_CAN_AM24H(val) bfin_write16(CAN_AM24H,val)
1180#define bfin_read_CAN_AM25L() bfin_read16(CAN_AM25L)
1181#define bfin_write_CAN_AM25L(val) bfin_write16(CAN_AM25L,val)
1182#define bfin_read_CAN_AM25H() bfin_read16(CAN_AM25H)
1183#define bfin_write_CAN_AM25H(val) bfin_write16(CAN_AM25H,val)
1184#define bfin_read_CAN_AM26L() bfin_read16(CAN_AM26L)
1185#define bfin_write_CAN_AM26L(val) bfin_write16(CAN_AM26L,val)
1186#define bfin_read_CAN_AM26H() bfin_read16(CAN_AM26H)
1187#define bfin_write_CAN_AM26H(val) bfin_write16(CAN_AM26H,val)
1188#define bfin_read_CAN_AM27L() bfin_read16(CAN_AM27L)
1189#define bfin_write_CAN_AM27L(val) bfin_write16(CAN_AM27L,val)
1190#define bfin_read_CAN_AM27H() bfin_read16(CAN_AM27H)
1191#define bfin_write_CAN_AM27H(val) bfin_write16(CAN_AM27H,val)
1192#define bfin_read_CAN_AM28L() bfin_read16(CAN_AM28L)
1193#define bfin_write_CAN_AM28L(val) bfin_write16(CAN_AM28L,val)
1194#define bfin_read_CAN_AM28H() bfin_read16(CAN_AM28H)
1195#define bfin_write_CAN_AM28H(val) bfin_write16(CAN_AM28H,val)
1196#define bfin_read_CAN_AM29L() bfin_read16(CAN_AM29L)
1197#define bfin_write_CAN_AM29L(val) bfin_write16(CAN_AM29L,val)
1198#define bfin_read_CAN_AM29H() bfin_read16(CAN_AM29H)
1199#define bfin_write_CAN_AM29H(val) bfin_write16(CAN_AM29H,val)
1200#define bfin_read_CAN_AM30L() bfin_read16(CAN_AM30L)
1201#define bfin_write_CAN_AM30L(val) bfin_write16(CAN_AM30L,val)
1202#define bfin_read_CAN_AM30H() bfin_read16(CAN_AM30H)
1203#define bfin_write_CAN_AM30H(val) bfin_write16(CAN_AM30H,val)
1204#define bfin_read_CAN_AM31L() bfin_read16(CAN_AM31L)
1205#define bfin_write_CAN_AM31L(val) bfin_write16(CAN_AM31L,val)
1206#define bfin_read_CAN_AM31H() bfin_read16(CAN_AM31H)
1207#define bfin_write_CAN_AM31H(val) bfin_write16(CAN_AM31H,val)
1208
1209/* CAN Acceptance Mask Area Macros */
1210#define bfin_read_CAN_AM_L(x)() bfin_read16(CAN_AM_L(x))
1211#define bfin_write_CAN_AM_L(x)(val) bfin_write16(CAN_AM_L(x),val)
1212#define bfin_read_CAN_AM_H(x)() bfin_read16(CAN_AM_H(x))
1213#define bfin_write_CAN_AM_H(x)(val) bfin_write16(CAN_AM_H(x),val)
1214
1215/* Mailbox Registers */
1216#define bfin_read_CAN_MB00_ID1() bfin_read16(CAN_MB00_ID1)
1217#define bfin_write_CAN_MB00_ID1(val) bfin_write16(CAN_MB00_ID1,val)
1218#define bfin_read_CAN_MB00_ID0() bfin_read16(CAN_MB00_ID0)
1219#define bfin_write_CAN_MB00_ID0(val) bfin_write16(CAN_MB00_ID0,val)
1220#define bfin_read_CAN_MB00_TIMESTAMP() bfin_read16(CAN_MB00_TIMESTAMP)
1221#define bfin_write_CAN_MB00_TIMESTAMP(val) bfin_write16(CAN_MB00_TIMESTAMP,val)
1222#define bfin_read_CAN_MB00_LENGTH() bfin_read16(CAN_MB00_LENGTH)
1223#define bfin_write_CAN_MB00_LENGTH(val) bfin_write16(CAN_MB00_LENGTH,val)
1224#define bfin_read_CAN_MB00_DATA3() bfin_read16(CAN_MB00_DATA3)
1225#define bfin_write_CAN_MB00_DATA3(val) bfin_write16(CAN_MB00_DATA3,val)
1226#define bfin_read_CAN_MB00_DATA2() bfin_read16(CAN_MB00_DATA2)
1227#define bfin_write_CAN_MB00_DATA2(val) bfin_write16(CAN_MB00_DATA2,val)
1228#define bfin_read_CAN_MB00_DATA1() bfin_read16(CAN_MB00_DATA1)
1229#define bfin_write_CAN_MB00_DATA1(val) bfin_write16(CAN_MB00_DATA1,val)
1230#define bfin_read_CAN_MB00_DATA0() bfin_read16(CAN_MB00_DATA0)
1231#define bfin_write_CAN_MB00_DATA0(val) bfin_write16(CAN_MB00_DATA0,val)
1232
1233#define bfin_read_CAN_MB01_ID1() bfin_read16(CAN_MB01_ID1)
1234#define bfin_write_CAN_MB01_ID1(val) bfin_write16(CAN_MB01_ID1,val)
1235#define bfin_read_CAN_MB01_ID0() bfin_read16(CAN_MB01_ID0)
1236#define bfin_write_CAN_MB01_ID0(val) bfin_write16(CAN_MB01_ID0,val)
1237#define bfin_read_CAN_MB01_TIMESTAMP() bfin_read16(CAN_MB01_TIMESTAMP)
1238#define bfin_write_CAN_MB01_TIMESTAMP(val) bfin_write16(CAN_MB01_TIMESTAMP,val)
1239#define bfin_read_CAN_MB01_LENGTH() bfin_read16(CAN_MB01_LENGTH)
1240#define bfin_write_CAN_MB01_LENGTH(val) bfin_write16(CAN_MB01_LENGTH,val)
1241#define bfin_read_CAN_MB01_DATA3() bfin_read16(CAN_MB01_DATA3)
1242#define bfin_write_CAN_MB01_DATA3(val) bfin_write16(CAN_MB01_DATA3,val)
1243#define bfin_read_CAN_MB01_DATA2() bfin_read16(CAN_MB01_DATA2)
1244#define bfin_write_CAN_MB01_DATA2(val) bfin_write16(CAN_MB01_DATA2,val)
1245#define bfin_read_CAN_MB01_DATA1() bfin_read16(CAN_MB01_DATA1)
1246#define bfin_write_CAN_MB01_DATA1(val) bfin_write16(CAN_MB01_DATA1,val)
1247#define bfin_read_CAN_MB01_DATA0() bfin_read16(CAN_MB01_DATA0)
1248#define bfin_write_CAN_MB01_DATA0(val) bfin_write16(CAN_MB01_DATA0,val)
1249
1250#define bfin_read_CAN_MB02_ID1() bfin_read16(CAN_MB02_ID1)
1251#define bfin_write_CAN_MB02_ID1(val) bfin_write16(CAN_MB02_ID1,val)
1252#define bfin_read_CAN_MB02_ID0() bfin_read16(CAN_MB02_ID0)
1253#define bfin_write_CAN_MB02_ID0(val) bfin_write16(CAN_MB02_ID0,val)
1254#define bfin_read_CAN_MB02_TIMESTAMP() bfin_read16(CAN_MB02_TIMESTAMP)
1255#define bfin_write_CAN_MB02_TIMESTAMP(val) bfin_write16(CAN_MB02_TIMESTAMP,val)
1256#define bfin_read_CAN_MB02_LENGTH() bfin_read16(CAN_MB02_LENGTH)
1257#define bfin_write_CAN_MB02_LENGTH(val) bfin_write16(CAN_MB02_LENGTH,val)
1258#define bfin_read_CAN_MB02_DATA3() bfin_read16(CAN_MB02_DATA3)
1259#define bfin_write_CAN_MB02_DATA3(val) bfin_write16(CAN_MB02_DATA3,val)
1260#define bfin_read_CAN_MB02_DATA2() bfin_read16(CAN_MB02_DATA2)
1261#define bfin_write_CAN_MB02_DATA2(val) bfin_write16(CAN_MB02_DATA2,val)
1262#define bfin_read_CAN_MB02_DATA1() bfin_read16(CAN_MB02_DATA1)
1263#define bfin_write_CAN_MB02_DATA1(val) bfin_write16(CAN_MB02_DATA1,val)
1264#define bfin_read_CAN_MB02_DATA0() bfin_read16(CAN_MB02_DATA0)
1265#define bfin_write_CAN_MB02_DATA0(val) bfin_write16(CAN_MB02_DATA0,val)
1266
1267#define bfin_read_CAN_MB03_ID1() bfin_read16(CAN_MB03_ID1)
1268#define bfin_write_CAN_MB03_ID1(val) bfin_write16(CAN_MB03_ID1,val)
1269#define bfin_read_CAN_MB03_ID0() bfin_read16(CAN_MB03_ID0)
1270#define bfin_write_CAN_MB03_ID0(val) bfin_write16(CAN_MB03_ID0,val)
1271#define bfin_read_CAN_MB03_TIMESTAMP() bfin_read16(CAN_MB03_TIMESTAMP)
1272#define bfin_write_CAN_MB03_TIMESTAMP(val) bfin_write16(CAN_MB03_TIMESTAMP,val)
1273#define bfin_read_CAN_MB03_LENGTH() bfin_read16(CAN_MB03_LENGTH)
1274#define bfin_write_CAN_MB03_LENGTH(val) bfin_write16(CAN_MB03_LENGTH,val)
1275#define bfin_read_CAN_MB03_DATA3() bfin_read16(CAN_MB03_DATA3)
1276#define bfin_write_CAN_MB03_DATA3(val) bfin_write16(CAN_MB03_DATA3,val)
1277#define bfin_read_CAN_MB03_DATA2() bfin_read16(CAN_MB03_DATA2)
1278#define bfin_write_CAN_MB03_DATA2(val) bfin_write16(CAN_MB03_DATA2,val)
1279#define bfin_read_CAN_MB03_DATA1() bfin_read16(CAN_MB03_DATA1)
1280#define bfin_write_CAN_MB03_DATA1(val) bfin_write16(CAN_MB03_DATA1,val)
1281#define bfin_read_CAN_MB03_DATA0() bfin_read16(CAN_MB03_DATA0)
1282#define bfin_write_CAN_MB03_DATA0(val) bfin_write16(CAN_MB03_DATA0,val)
1283
1284#define bfin_read_CAN_MB04_ID1() bfin_read16(CAN_MB04_ID1)
1285#define bfin_write_CAN_MB04_ID1(val) bfin_write16(CAN_MB04_ID1,val)
1286#define bfin_read_CAN_MB04_ID0() bfin_read16(CAN_MB04_ID0)
1287#define bfin_write_CAN_MB04_ID0(val) bfin_write16(CAN_MB04_ID0,val)
1288#define bfin_read_CAN_MB04_TIMESTAMP() bfin_read16(CAN_MB04_TIMESTAMP)
1289#define bfin_write_CAN_MB04_TIMESTAMP(val) bfin_write16(CAN_MB04_TIMESTAMP,val)
1290#define bfin_read_CAN_MB04_LENGTH() bfin_read16(CAN_MB04_LENGTH)
1291#define bfin_write_CAN_MB04_LENGTH(val) bfin_write16(CAN_MB04_LENGTH,val)
1292#define bfin_read_CAN_MB04_DATA3() bfin_read16(CAN_MB04_DATA3)
1293#define bfin_write_CAN_MB04_DATA3(val) bfin_write16(CAN_MB04_DATA3,val)
1294#define bfin_read_CAN_MB04_DATA2() bfin_read16(CAN_MB04_DATA2)
1295#define bfin_write_CAN_MB04_DATA2(val) bfin_write16(CAN_MB04_DATA2,val)
1296#define bfin_read_CAN_MB04_DATA1() bfin_read16(CAN_MB04_DATA1)
1297#define bfin_write_CAN_MB04_DATA1(val) bfin_write16(CAN_MB04_DATA1,val)
1298#define bfin_read_CAN_MB04_DATA0() bfin_read16(CAN_MB04_DATA0)
1299#define bfin_write_CAN_MB04_DATA0(val) bfin_write16(CAN_MB04_DATA0,val)
1300
1301#define bfin_read_CAN_MB05_ID1() bfin_read16(CAN_MB05_ID1)
1302#define bfin_write_CAN_MB05_ID1(val) bfin_write16(CAN_MB05_ID1,val)
1303#define bfin_read_CAN_MB05_ID0() bfin_read16(CAN_MB05_ID0)
1304#define bfin_write_CAN_MB05_ID0(val) bfin_write16(CAN_MB05_ID0,val)
1305#define bfin_read_CAN_MB05_TIMESTAMP() bfin_read16(CAN_MB05_TIMESTAMP)
1306#define bfin_write_CAN_MB05_TIMESTAMP(val) bfin_write16(CAN_MB05_TIMESTAMP,val)
1307#define bfin_read_CAN_MB05_LENGTH() bfin_read16(CAN_MB05_LENGTH)
1308#define bfin_write_CAN_MB05_LENGTH(val) bfin_write16(CAN_MB05_LENGTH,val)
1309#define bfin_read_CAN_MB05_DATA3() bfin_read16(CAN_MB05_DATA3)
1310#define bfin_write_CAN_MB05_DATA3(val) bfin_write16(CAN_MB05_DATA3,val)
1311#define bfin_read_CAN_MB05_DATA2() bfin_read16(CAN_MB05_DATA2)
1312#define bfin_write_CAN_MB05_DATA2(val) bfin_write16(CAN_MB05_DATA2,val)
1313#define bfin_read_CAN_MB05_DATA1() bfin_read16(CAN_MB05_DATA1)
1314#define bfin_write_CAN_MB05_DATA1(val) bfin_write16(CAN_MB05_DATA1,val)
1315#define bfin_read_CAN_MB05_DATA0() bfin_read16(CAN_MB05_DATA0)
1316#define bfin_write_CAN_MB05_DATA0(val) bfin_write16(CAN_MB05_DATA0,val)
1317
1318#define bfin_read_CAN_MB06_ID1() bfin_read16(CAN_MB06_ID1)
1319#define bfin_write_CAN_MB06_ID1(val) bfin_write16(CAN_MB06_ID1,val)
1320#define bfin_read_CAN_MB06_ID0() bfin_read16(CAN_MB06_ID0)
1321#define bfin_write_CAN_MB06_ID0(val) bfin_write16(CAN_MB06_ID0,val)
1322#define bfin_read_CAN_MB06_TIMESTAMP() bfin_read16(CAN_MB06_TIMESTAMP)
1323#define bfin_write_CAN_MB06_TIMESTAMP(val) bfin_write16(CAN_MB06_TIMESTAMP,val)
1324#define bfin_read_CAN_MB06_LENGTH() bfin_read16(CAN_MB06_LENGTH)
1325#define bfin_write_CAN_MB06_LENGTH(val) bfin_write16(CAN_MB06_LENGTH,val)
1326#define bfin_read_CAN_MB06_DATA3() bfin_read16(CAN_MB06_DATA3)
1327#define bfin_write_CAN_MB06_DATA3(val) bfin_write16(CAN_MB06_DATA3,val)
1328#define bfin_read_CAN_MB06_DATA2() bfin_read16(CAN_MB06_DATA2)
1329#define bfin_write_CAN_MB06_DATA2(val) bfin_write16(CAN_MB06_DATA2,val)
1330#define bfin_read_CAN_MB06_DATA1() bfin_read16(CAN_MB06_DATA1)
1331#define bfin_write_CAN_MB06_DATA1(val) bfin_write16(CAN_MB06_DATA1,val)
1332#define bfin_read_CAN_MB06_DATA0() bfin_read16(CAN_MB06_DATA0)
1333#define bfin_write_CAN_MB06_DATA0(val) bfin_write16(CAN_MB06_DATA0,val)
1334
1335#define bfin_read_CAN_MB07_ID1() bfin_read16(CAN_MB07_ID1)
1336#define bfin_write_CAN_MB07_ID1(val) bfin_write16(CAN_MB07_ID1,val)
1337#define bfin_read_CAN_MB07_ID0() bfin_read16(CAN_MB07_ID0)
1338#define bfin_write_CAN_MB07_ID0(val) bfin_write16(CAN_MB07_ID0,val)
1339#define bfin_read_CAN_MB07_TIMESTAMP() bfin_read16(CAN_MB07_TIMESTAMP)
1340#define bfin_write_CAN_MB07_TIMESTAMP(val) bfin_write16(CAN_MB07_TIMESTAMP,val)
1341#define bfin_read_CAN_MB07_LENGTH() bfin_read16(CAN_MB07_LENGTH)
1342#define bfin_write_CAN_MB07_LENGTH(val) bfin_write16(CAN_MB07_LENGTH,val)
1343#define bfin_read_CAN_MB07_DATA3() bfin_read16(CAN_MB07_DATA3)
1344#define bfin_write_CAN_MB07_DATA3(val) bfin_write16(CAN_MB07_DATA3,val)
1345#define bfin_read_CAN_MB07_DATA2() bfin_read16(CAN_MB07_DATA2)
1346#define bfin_write_CAN_MB07_DATA2(val) bfin_write16(CAN_MB07_DATA2,val)
1347#define bfin_read_CAN_MB07_DATA1() bfin_read16(CAN_MB07_DATA1)
1348#define bfin_write_CAN_MB07_DATA1(val) bfin_write16(CAN_MB07_DATA1,val)
1349#define bfin_read_CAN_MB07_DATA0() bfin_read16(CAN_MB07_DATA0)
1350#define bfin_write_CAN_MB07_DATA0(val) bfin_write16(CAN_MB07_DATA0,val)
1351
1352#define bfin_read_CAN_MB08_ID1() bfin_read16(CAN_MB08_ID1)
1353#define bfin_write_CAN_MB08_ID1(val) bfin_write16(CAN_MB08_ID1,val)
1354#define bfin_read_CAN_MB08_ID0() bfin_read16(CAN_MB08_ID0)
1355#define bfin_write_CAN_MB08_ID0(val) bfin_write16(CAN_MB08_ID0,val)
1356#define bfin_read_CAN_MB08_TIMESTAMP() bfin_read16(CAN_MB08_TIMESTAMP)
1357#define bfin_write_CAN_MB08_TIMESTAMP(val) bfin_write16(CAN_MB08_TIMESTAMP,val)
1358#define bfin_read_CAN_MB08_LENGTH() bfin_read16(CAN_MB08_LENGTH)
1359#define bfin_write_CAN_MB08_LENGTH(val) bfin_write16(CAN_MB08_LENGTH,val)
1360#define bfin_read_CAN_MB08_DATA3() bfin_read16(CAN_MB08_DATA3)
1361#define bfin_write_CAN_MB08_DATA3(val) bfin_write16(CAN_MB08_DATA3,val)
1362#define bfin_read_CAN_MB08_DATA2() bfin_read16(CAN_MB08_DATA2)
1363#define bfin_write_CAN_MB08_DATA2(val) bfin_write16(CAN_MB08_DATA2,val)
1364#define bfin_read_CAN_MB08_DATA1() bfin_read16(CAN_MB08_DATA1)
1365#define bfin_write_CAN_MB08_DATA1(val) bfin_write16(CAN_MB08_DATA1,val)
1366#define bfin_read_CAN_MB08_DATA0() bfin_read16(CAN_MB08_DATA0)
1367#define bfin_write_CAN_MB08_DATA0(val) bfin_write16(CAN_MB08_DATA0,val)
1368
1369#define bfin_read_CAN_MB09_ID1() bfin_read16(CAN_MB09_ID1)
1370#define bfin_write_CAN_MB09_ID1(val) bfin_write16(CAN_MB09_ID1,val)
1371#define bfin_read_CAN_MB09_ID0() bfin_read16(CAN_MB09_ID0)
1372#define bfin_write_CAN_MB09_ID0(val) bfin_write16(CAN_MB09_ID0,val)
1373#define bfin_read_CAN_MB09_TIMESTAMP() bfin_read16(CAN_MB09_TIMESTAMP)
1374#define bfin_write_CAN_MB09_TIMESTAMP(val) bfin_write16(CAN_MB09_TIMESTAMP,val)
1375#define bfin_read_CAN_MB09_LENGTH() bfin_read16(CAN_MB09_LENGTH)
1376#define bfin_write_CAN_MB09_LENGTH(val) bfin_write16(CAN_MB09_LENGTH,val)
1377#define bfin_read_CAN_MB09_DATA3() bfin_read16(CAN_MB09_DATA3)
1378#define bfin_write_CAN_MB09_DATA3(val) bfin_write16(CAN_MB09_DATA3,val)
1379#define bfin_read_CAN_MB09_DATA2() bfin_read16(CAN_MB09_DATA2)
1380#define bfin_write_CAN_MB09_DATA2(val) bfin_write16(CAN_MB09_DATA2,val)
1381#define bfin_read_CAN_MB09_DATA1() bfin_read16(CAN_MB09_DATA1)
1382#define bfin_write_CAN_MB09_DATA1(val) bfin_write16(CAN_MB09_DATA1,val)
1383#define bfin_read_CAN_MB09_DATA0() bfin_read16(CAN_MB09_DATA0)
1384#define bfin_write_CAN_MB09_DATA0(val) bfin_write16(CAN_MB09_DATA0,val)
1385
1386#define bfin_read_CAN_MB10_ID1() bfin_read16(CAN_MB10_ID1)
1387#define bfin_write_CAN_MB10_ID1(val) bfin_write16(CAN_MB10_ID1,val)
1388#define bfin_read_CAN_MB10_ID0() bfin_read16(CAN_MB10_ID0)
1389#define bfin_write_CAN_MB10_ID0(val) bfin_write16(CAN_MB10_ID0,val)
1390#define bfin_read_CAN_MB10_TIMESTAMP() bfin_read16(CAN_MB10_TIMESTAMP)
1391#define bfin_write_CAN_MB10_TIMESTAMP(val) bfin_write16(CAN_MB10_TIMESTAMP,val)
1392#define bfin_read_CAN_MB10_LENGTH() bfin_read16(CAN_MB10_LENGTH)
1393#define bfin_write_CAN_MB10_LENGTH(val) bfin_write16(CAN_MB10_LENGTH,val)
1394#define bfin_read_CAN_MB10_DATA3() bfin_read16(CAN_MB10_DATA3)
1395#define bfin_write_CAN_MB10_DATA3(val) bfin_write16(CAN_MB10_DATA3,val)
1396#define bfin_read_CAN_MB10_DATA2() bfin_read16(CAN_MB10_DATA2)
1397#define bfin_write_CAN_MB10_DATA2(val) bfin_write16(CAN_MB10_DATA2,val)
1398#define bfin_read_CAN_MB10_DATA1() bfin_read16(CAN_MB10_DATA1)
1399#define bfin_write_CAN_MB10_DATA1(val) bfin_write16(CAN_MB10_DATA1,val)
1400#define bfin_read_CAN_MB10_DATA0() bfin_read16(CAN_MB10_DATA0)
1401#define bfin_write_CAN_MB10_DATA0(val) bfin_write16(CAN_MB10_DATA0,val)
1402
1403#define bfin_read_CAN_MB11_ID1() bfin_read16(CAN_MB11_ID1)
1404#define bfin_write_CAN_MB11_ID1(val) bfin_write16(CAN_MB11_ID1,val)
1405#define bfin_read_CAN_MB11_ID0() bfin_read16(CAN_MB11_ID0)
1406#define bfin_write_CAN_MB11_ID0(val) bfin_write16(CAN_MB11_ID0,val)
1407#define bfin_read_CAN_MB11_TIMESTAMP() bfin_read16(CAN_MB11_TIMESTAMP)
1408#define bfin_write_CAN_MB11_TIMESTAMP(val) bfin_write16(CAN_MB11_TIMESTAMP,val)
1409#define bfin_read_CAN_MB11_LENGTH() bfin_read16(CAN_MB11_LENGTH)
1410#define bfin_write_CAN_MB11_LENGTH(val) bfin_write16(CAN_MB11_LENGTH,val)
1411#define bfin_read_CAN_MB11_DATA3() bfin_read16(CAN_MB11_DATA3)
1412#define bfin_write_CAN_MB11_DATA3(val) bfin_write16(CAN_MB11_DATA3,val)
1413#define bfin_read_CAN_MB11_DATA2() bfin_read16(CAN_MB11_DATA2)
1414#define bfin_write_CAN_MB11_DATA2(val) bfin_write16(CAN_MB11_DATA2,val)
1415#define bfin_read_CAN_MB11_DATA1() bfin_read16(CAN_MB11_DATA1)
1416#define bfin_write_CAN_MB11_DATA1(val) bfin_write16(CAN_MB11_DATA1,val)
1417#define bfin_read_CAN_MB11_DATA0() bfin_read16(CAN_MB11_DATA0)
1418#define bfin_write_CAN_MB11_DATA0(val) bfin_write16(CAN_MB11_DATA0,val)
1419
1420#define bfin_read_CAN_MB12_ID1() bfin_read16(CAN_MB12_ID1)
1421#define bfin_write_CAN_MB12_ID1(val) bfin_write16(CAN_MB12_ID1,val)
1422#define bfin_read_CAN_MB12_ID0() bfin_read16(CAN_MB12_ID0)
1423#define bfin_write_CAN_MB12_ID0(val) bfin_write16(CAN_MB12_ID0,val)
1424#define bfin_read_CAN_MB12_TIMESTAMP() bfin_read16(CAN_MB12_TIMESTAMP)
1425#define bfin_write_CAN_MB12_TIMESTAMP(val) bfin_write16(CAN_MB12_TIMESTAMP,val)
1426#define bfin_read_CAN_MB12_LENGTH() bfin_read16(CAN_MB12_LENGTH)
1427#define bfin_write_CAN_MB12_LENGTH(val) bfin_write16(CAN_MB12_LENGTH,val)
1428#define bfin_read_CAN_MB12_DATA3() bfin_read16(CAN_MB12_DATA3)
1429#define bfin_write_CAN_MB12_DATA3(val) bfin_write16(CAN_MB12_DATA3,val)
1430#define bfin_read_CAN_MB12_DATA2() bfin_read16(CAN_MB12_DATA2)
1431#define bfin_write_CAN_MB12_DATA2(val) bfin_write16(CAN_MB12_DATA2,val)
1432#define bfin_read_CAN_MB12_DATA1() bfin_read16(CAN_MB12_DATA1)
1433#define bfin_write_CAN_MB12_DATA1(val) bfin_write16(CAN_MB12_DATA1,val)
1434#define bfin_read_CAN_MB12_DATA0() bfin_read16(CAN_MB12_DATA0)
1435#define bfin_write_CAN_MB12_DATA0(val) bfin_write16(CAN_MB12_DATA0,val)
1436
1437#define bfin_read_CAN_MB13_ID1() bfin_read16(CAN_MB13_ID1)
1438#define bfin_write_CAN_MB13_ID1(val) bfin_write16(CAN_MB13_ID1,val)
1439#define bfin_read_CAN_MB13_ID0() bfin_read16(CAN_MB13_ID0)
1440#define bfin_write_CAN_MB13_ID0(val) bfin_write16(CAN_MB13_ID0,val)
1441#define bfin_read_CAN_MB13_TIMESTAMP() bfin_read16(CAN_MB13_TIMESTAMP)
1442#define bfin_write_CAN_MB13_TIMESTAMP(val) bfin_write16(CAN_MB13_TIMESTAMP,val)
1443#define bfin_read_CAN_MB13_LENGTH() bfin_read16(CAN_MB13_LENGTH)
1444#define bfin_write_CAN_MB13_LENGTH(val) bfin_write16(CAN_MB13_LENGTH,val)
1445#define bfin_read_CAN_MB13_DATA3() bfin_read16(CAN_MB13_DATA3)
1446#define bfin_write_CAN_MB13_DATA3(val) bfin_write16(CAN_MB13_DATA3,val)
1447#define bfin_read_CAN_MB13_DATA2() bfin_read16(CAN_MB13_DATA2)
1448#define bfin_write_CAN_MB13_DATA2(val) bfin_write16(CAN_MB13_DATA2,val)
1449#define bfin_read_CAN_MB13_DATA1() bfin_read16(CAN_MB13_DATA1)
1450#define bfin_write_CAN_MB13_DATA1(val) bfin_write16(CAN_MB13_DATA1,val)
1451#define bfin_read_CAN_MB13_DATA0() bfin_read16(CAN_MB13_DATA0)
1452#define bfin_write_CAN_MB13_DATA0(val) bfin_write16(CAN_MB13_DATA0,val)
1453
1454#define bfin_read_CAN_MB14_ID1() bfin_read16(CAN_MB14_ID1)
1455#define bfin_write_CAN_MB14_ID1(val) bfin_write16(CAN_MB14_ID1,val)
1456#define bfin_read_CAN_MB14_ID0() bfin_read16(CAN_MB14_ID0)
1457#define bfin_write_CAN_MB14_ID0(val) bfin_write16(CAN_MB14_ID0,val)
1458#define bfin_read_CAN_MB14_TIMESTAMP() bfin_read16(CAN_MB14_TIMESTAMP)
1459#define bfin_write_CAN_MB14_TIMESTAMP(val) bfin_write16(CAN_MB14_TIMESTAMP,val)
1460#define bfin_read_CAN_MB14_LENGTH() bfin_read16(CAN_MB14_LENGTH)
1461#define bfin_write_CAN_MB14_LENGTH(val) bfin_write16(CAN_MB14_LENGTH,val)
1462#define bfin_read_CAN_MB14_DATA3() bfin_read16(CAN_MB14_DATA3)
1463#define bfin_write_CAN_MB14_DATA3(val) bfin_write16(CAN_MB14_DATA3,val)
1464#define bfin_read_CAN_MB14_DATA2() bfin_read16(CAN_MB14_DATA2)
1465#define bfin_write_CAN_MB14_DATA2(val) bfin_write16(CAN_MB14_DATA2,val)
1466#define bfin_read_CAN_MB14_DATA1() bfin_read16(CAN_MB14_DATA1)
1467#define bfin_write_CAN_MB14_DATA1(val) bfin_write16(CAN_MB14_DATA1,val)
1468#define bfin_read_CAN_MB14_DATA0() bfin_read16(CAN_MB14_DATA0)
1469#define bfin_write_CAN_MB14_DATA0(val) bfin_write16(CAN_MB14_DATA0,val)
1470
1471#define bfin_read_CAN_MB15_ID1() bfin_read16(CAN_MB15_ID1)
1472#define bfin_write_CAN_MB15_ID1(val) bfin_write16(CAN_MB15_ID1,val)
1473#define bfin_read_CAN_MB15_ID0() bfin_read16(CAN_MB15_ID0)
1474#define bfin_write_CAN_MB15_ID0(val) bfin_write16(CAN_MB15_ID0,val)
1475#define bfin_read_CAN_MB15_TIMESTAMP() bfin_read16(CAN_MB15_TIMESTAMP)
1476#define bfin_write_CAN_MB15_TIMESTAMP(val) bfin_write16(CAN_MB15_TIMESTAMP,val)
1477#define bfin_read_CAN_MB15_LENGTH() bfin_read16(CAN_MB15_LENGTH)
1478#define bfin_write_CAN_MB15_LENGTH(val) bfin_write16(CAN_MB15_LENGTH,val)
1479#define bfin_read_CAN_MB15_DATA3() bfin_read16(CAN_MB15_DATA3)
1480#define bfin_write_CAN_MB15_DATA3(val) bfin_write16(CAN_MB15_DATA3,val)
1481#define bfin_read_CAN_MB15_DATA2() bfin_read16(CAN_MB15_DATA2)
1482#define bfin_write_CAN_MB15_DATA2(val) bfin_write16(CAN_MB15_DATA2,val)
1483#define bfin_read_CAN_MB15_DATA1() bfin_read16(CAN_MB15_DATA1)
1484#define bfin_write_CAN_MB15_DATA1(val) bfin_write16(CAN_MB15_DATA1,val)
1485#define bfin_read_CAN_MB15_DATA0() bfin_read16(CAN_MB15_DATA0)
1486#define bfin_write_CAN_MB15_DATA0(val) bfin_write16(CAN_MB15_DATA0,val)
1487
1488#define bfin_read_CAN_MB16_ID1() bfin_read16(CAN_MB16_ID1)
1489#define bfin_write_CAN_MB16_ID1(val) bfin_write16(CAN_MB16_ID1,val)
1490#define bfin_read_CAN_MB16_ID0() bfin_read16(CAN_MB16_ID0)
1491#define bfin_write_CAN_MB16_ID0(val) bfin_write16(CAN_MB16_ID0,val)
1492#define bfin_read_CAN_MB16_TIMESTAMP() bfin_read16(CAN_MB16_TIMESTAMP)
1493#define bfin_write_CAN_MB16_TIMESTAMP(val) bfin_write16(CAN_MB16_TIMESTAMP,val)
1494#define bfin_read_CAN_MB16_LENGTH() bfin_read16(CAN_MB16_LENGTH)
1495#define bfin_write_CAN_MB16_LENGTH(val) bfin_write16(CAN_MB16_LENGTH,val)
1496#define bfin_read_CAN_MB16_DATA3() bfin_read16(CAN_MB16_DATA3)
1497#define bfin_write_CAN_MB16_DATA3(val) bfin_write16(CAN_MB16_DATA3,val)
1498#define bfin_read_CAN_MB16_DATA2() bfin_read16(CAN_MB16_DATA2)
1499#define bfin_write_CAN_MB16_DATA2(val) bfin_write16(CAN_MB16_DATA2,val)
1500#define bfin_read_CAN_MB16_DATA1() bfin_read16(CAN_MB16_DATA1)
1501#define bfin_write_CAN_MB16_DATA1(val) bfin_write16(CAN_MB16_DATA1,val)
1502#define bfin_read_CAN_MB16_DATA0() bfin_read16(CAN_MB16_DATA0)
1503#define bfin_write_CAN_MB16_DATA0(val) bfin_write16(CAN_MB16_DATA0,val)
1504
1505#define bfin_read_CAN_MB17_ID1() bfin_read16(CAN_MB17_ID1)
1506#define bfin_write_CAN_MB17_ID1(val) bfin_write16(CAN_MB17_ID1,val)
1507#define bfin_read_CAN_MB17_ID0() bfin_read16(CAN_MB17_ID0)
1508#define bfin_write_CAN_MB17_ID0(val) bfin_write16(CAN_MB17_ID0,val)
1509#define bfin_read_CAN_MB17_TIMESTAMP() bfin_read16(CAN_MB17_TIMESTAMP)
1510#define bfin_write_CAN_MB17_TIMESTAMP(val) bfin_write16(CAN_MB17_TIMESTAMP,val)
1511#define bfin_read_CAN_MB17_LENGTH() bfin_read16(CAN_MB17_LENGTH)
1512#define bfin_write_CAN_MB17_LENGTH(val) bfin_write16(CAN_MB17_LENGTH,val)
1513#define bfin_read_CAN_MB17_DATA3() bfin_read16(CAN_MB17_DATA3)
1514#define bfin_write_CAN_MB17_DATA3(val) bfin_write16(CAN_MB17_DATA3,val)
1515#define bfin_read_CAN_MB17_DATA2() bfin_read16(CAN_MB17_DATA2)
1516#define bfin_write_CAN_MB17_DATA2(val) bfin_write16(CAN_MB17_DATA2,val)
1517#define bfin_read_CAN_MB17_DATA1() bfin_read16(CAN_MB17_DATA1)
1518#define bfin_write_CAN_MB17_DATA1(val) bfin_write16(CAN_MB17_DATA1,val)
1519#define bfin_read_CAN_MB17_DATA0() bfin_read16(CAN_MB17_DATA0)
1520#define bfin_write_CAN_MB17_DATA0(val) bfin_write16(CAN_MB17_DATA0,val)
1521
1522#define bfin_read_CAN_MB18_ID1() bfin_read16(CAN_MB18_ID1)
1523#define bfin_write_CAN_MB18_ID1(val) bfin_write16(CAN_MB18_ID1,val)
1524#define bfin_read_CAN_MB18_ID0() bfin_read16(CAN_MB18_ID0)
1525#define bfin_write_CAN_MB18_ID0(val) bfin_write16(CAN_MB18_ID0,val)
1526#define bfin_read_CAN_MB18_TIMESTAMP() bfin_read16(CAN_MB18_TIMESTAMP)
1527#define bfin_write_CAN_MB18_TIMESTAMP(val) bfin_write16(CAN_MB18_TIMESTAMP,val)
1528#define bfin_read_CAN_MB18_LENGTH() bfin_read16(CAN_MB18_LENGTH)
1529#define bfin_write_CAN_MB18_LENGTH(val) bfin_write16(CAN_MB18_LENGTH,val)
1530#define bfin_read_CAN_MB18_DATA3() bfin_read16(CAN_MB18_DATA3)
1531#define bfin_write_CAN_MB18_DATA3(val) bfin_write16(CAN_MB18_DATA3,val)
1532#define bfin_read_CAN_MB18_DATA2() bfin_read16(CAN_MB18_DATA2)
1533#define bfin_write_CAN_MB18_DATA2(val) bfin_write16(CAN_MB18_DATA2,val)
1534#define bfin_read_CAN_MB18_DATA1() bfin_read16(CAN_MB18_DATA1)
1535#define bfin_write_CAN_MB18_DATA1(val) bfin_write16(CAN_MB18_DATA1,val)
1536#define bfin_read_CAN_MB18_DATA0() bfin_read16(CAN_MB18_DATA0)
1537#define bfin_write_CAN_MB18_DATA0(val) bfin_write16(CAN_MB18_DATA0,val)
1538
1539#define bfin_read_CAN_MB19_ID1() bfin_read16(CAN_MB19_ID1)
1540#define bfin_write_CAN_MB19_ID1(val) bfin_write16(CAN_MB19_ID1,val)
1541#define bfin_read_CAN_MB19_ID0() bfin_read16(CAN_MB19_ID0)
1542#define bfin_write_CAN_MB19_ID0(val) bfin_write16(CAN_MB19_ID0,val)
1543#define bfin_read_CAN_MB19_TIMESTAMP() bfin_read16(CAN_MB19_TIMESTAMP)
1544#define bfin_write_CAN_MB19_TIMESTAMP(val) bfin_write16(CAN_MB19_TIMESTAMP,val)
1545#define bfin_read_CAN_MB19_LENGTH() bfin_read16(CAN_MB19_LENGTH)
1546#define bfin_write_CAN_MB19_LENGTH(val) bfin_write16(CAN_MB19_LENGTH,val)
1547#define bfin_read_CAN_MB19_DATA3() bfin_read16(CAN_MB19_DATA3)
1548#define bfin_write_CAN_MB19_DATA3(val) bfin_write16(CAN_MB19_DATA3,val)
1549#define bfin_read_CAN_MB19_DATA2() bfin_read16(CAN_MB19_DATA2)
1550#define bfin_write_CAN_MB19_DATA2(val) bfin_write16(CAN_MB19_DATA2,val)
1551#define bfin_read_CAN_MB19_DATA1() bfin_read16(CAN_MB19_DATA1)
1552#define bfin_write_CAN_MB19_DATA1(val) bfin_write16(CAN_MB19_DATA1,val)
1553#define bfin_read_CAN_MB19_DATA0() bfin_read16(CAN_MB19_DATA0)
1554#define bfin_write_CAN_MB19_DATA0(val) bfin_write16(CAN_MB19_DATA0,val)
1555
1556#define bfin_read_CAN_MB20_ID1() bfin_read16(CAN_MB20_ID1)
1557#define bfin_write_CAN_MB20_ID1(val) bfin_write16(CAN_MB20_ID1,val)
1558#define bfin_read_CAN_MB20_ID0() bfin_read16(CAN_MB20_ID0)
1559#define bfin_write_CAN_MB20_ID0(val) bfin_write16(CAN_MB20_ID0,val)
1560#define bfin_read_CAN_MB20_TIMESTAMP() bfin_read16(CAN_MB20_TIMESTAMP)
1561#define bfin_write_CAN_MB20_TIMESTAMP(val) bfin_write16(CAN_MB20_TIMESTAMP,val)
1562#define bfin_read_CAN_MB20_LENGTH() bfin_read16(CAN_MB20_LENGTH)
1563#define bfin_write_CAN_MB20_LENGTH(val) bfin_write16(CAN_MB20_LENGTH,val)
1564#define bfin_read_CAN_MB20_DATA3() bfin_read16(CAN_MB20_DATA3)
1565#define bfin_write_CAN_MB20_DATA3(val) bfin_write16(CAN_MB20_DATA3,val)
1566#define bfin_read_CAN_MB20_DATA2() bfin_read16(CAN_MB20_DATA2)
1567#define bfin_write_CAN_MB20_DATA2(val) bfin_write16(CAN_MB20_DATA2,val)
1568#define bfin_read_CAN_MB20_DATA1() bfin_read16(CAN_MB20_DATA1)
1569#define bfin_write_CAN_MB20_DATA1(val) bfin_write16(CAN_MB20_DATA1,val)
1570#define bfin_read_CAN_MB20_DATA0() bfin_read16(CAN_MB20_DATA0)
1571#define bfin_write_CAN_MB20_DATA0(val) bfin_write16(CAN_MB20_DATA0,val)
1572
1573#define bfin_read_CAN_MB21_ID1() bfin_read16(CAN_MB21_ID1)
1574#define bfin_write_CAN_MB21_ID1(val) bfin_write16(CAN_MB21_ID1,val)
1575#define bfin_read_CAN_MB21_ID0() bfin_read16(CAN_MB21_ID0)
1576#define bfin_write_CAN_MB21_ID0(val) bfin_write16(CAN_MB21_ID0,val)
1577#define bfin_read_CAN_MB21_TIMESTAMP() bfin_read16(CAN_MB21_TIMESTAMP)
1578#define bfin_write_CAN_MB21_TIMESTAMP(val) bfin_write16(CAN_MB21_TIMESTAMP,val)
1579#define bfin_read_CAN_MB21_LENGTH() bfin_read16(CAN_MB21_LENGTH)
1580#define bfin_write_CAN_MB21_LENGTH(val) bfin_write16(CAN_MB21_LENGTH,val)
1581#define bfin_read_CAN_MB21_DATA3() bfin_read16(CAN_MB21_DATA3)
1582#define bfin_write_CAN_MB21_DATA3(val) bfin_write16(CAN_MB21_DATA3,val)
1583#define bfin_read_CAN_MB21_DATA2() bfin_read16(CAN_MB21_DATA2)
1584#define bfin_write_CAN_MB21_DATA2(val) bfin_write16(CAN_MB21_DATA2,val)
1585#define bfin_read_CAN_MB21_DATA1() bfin_read16(CAN_MB21_DATA1)
1586#define bfin_write_CAN_MB21_DATA1(val) bfin_write16(CAN_MB21_DATA1,val)
1587#define bfin_read_CAN_MB21_DATA0() bfin_read16(CAN_MB21_DATA0)
1588#define bfin_write_CAN_MB21_DATA0(val) bfin_write16(CAN_MB21_DATA0,val)
1589
1590#define bfin_read_CAN_MB22_ID1() bfin_read16(CAN_MB22_ID1)
1591#define bfin_write_CAN_MB22_ID1(val) bfin_write16(CAN_MB22_ID1,val)
1592#define bfin_read_CAN_MB22_ID0() bfin_read16(CAN_MB22_ID0)
1593#define bfin_write_CAN_MB22_ID0(val) bfin_write16(CAN_MB22_ID0,val)
1594#define bfin_read_CAN_MB22_TIMESTAMP() bfin_read16(CAN_MB22_TIMESTAMP)
1595#define bfin_write_CAN_MB22_TIMESTAMP(val) bfin_write16(CAN_MB22_TIMESTAMP,val)
1596#define bfin_read_CAN_MB22_LENGTH() bfin_read16(CAN_MB22_LENGTH)
1597#define bfin_write_CAN_MB22_LENGTH(val) bfin_write16(CAN_MB22_LENGTH,val)
1598#define bfin_read_CAN_MB22_DATA3() bfin_read16(CAN_MB22_DATA3)
1599#define bfin_write_CAN_MB22_DATA3(val) bfin_write16(CAN_MB22_DATA3,val)
1600#define bfin_read_CAN_MB22_DATA2() bfin_read16(CAN_MB22_DATA2)
1601#define bfin_write_CAN_MB22_DATA2(val) bfin_write16(CAN_MB22_DATA2,val)
1602#define bfin_read_CAN_MB22_DATA1() bfin_read16(CAN_MB22_DATA1)
1603#define bfin_write_CAN_MB22_DATA1(val) bfin_write16(CAN_MB22_DATA1,val)
1604#define bfin_read_CAN_MB22_DATA0() bfin_read16(CAN_MB22_DATA0)
1605#define bfin_write_CAN_MB22_DATA0(val) bfin_write16(CAN_MB22_DATA0,val)
1606
1607#define bfin_read_CAN_MB23_ID1() bfin_read16(CAN_MB23_ID1)
1608#define bfin_write_CAN_MB23_ID1(val) bfin_write16(CAN_MB23_ID1,val)
1609#define bfin_read_CAN_MB23_ID0() bfin_read16(CAN_MB23_ID0)
1610#define bfin_write_CAN_MB23_ID0(val) bfin_write16(CAN_MB23_ID0,val)
1611#define bfin_read_CAN_MB23_TIMESTAMP() bfin_read16(CAN_MB23_TIMESTAMP)
1612#define bfin_write_CAN_MB23_TIMESTAMP(val) bfin_write16(CAN_MB23_TIMESTAMP,val)
1613#define bfin_read_CAN_MB23_LENGTH() bfin_read16(CAN_MB23_LENGTH)
1614#define bfin_write_CAN_MB23_LENGTH(val) bfin_write16(CAN_MB23_LENGTH,val)
1615#define bfin_read_CAN_MB23_DATA3() bfin_read16(CAN_MB23_DATA3)
1616#define bfin_write_CAN_MB23_DATA3(val) bfin_write16(CAN_MB23_DATA3,val)
1617#define bfin_read_CAN_MB23_DATA2() bfin_read16(CAN_MB23_DATA2)
1618#define bfin_write_CAN_MB23_DATA2(val) bfin_write16(CAN_MB23_DATA2,val)
1619#define bfin_read_CAN_MB23_DATA1() bfin_read16(CAN_MB23_DATA1)
1620#define bfin_write_CAN_MB23_DATA1(val) bfin_write16(CAN_MB23_DATA1,val)
1621#define bfin_read_CAN_MB23_DATA0() bfin_read16(CAN_MB23_DATA0)
1622#define bfin_write_CAN_MB23_DATA0(val) bfin_write16(CAN_MB23_DATA0,val)
1623
1624#define bfin_read_CAN_MB24_ID1() bfin_read16(CAN_MB24_ID1)
1625#define bfin_write_CAN_MB24_ID1(val) bfin_write16(CAN_MB24_ID1,val)
1626#define bfin_read_CAN_MB24_ID0() bfin_read16(CAN_MB24_ID0)
1627#define bfin_write_CAN_MB24_ID0(val) bfin_write16(CAN_MB24_ID0,val)
1628#define bfin_read_CAN_MB24_TIMESTAMP() bfin_read16(CAN_MB24_TIMESTAMP)
1629#define bfin_write_CAN_MB24_TIMESTAMP(val) bfin_write16(CAN_MB24_TIMESTAMP,val)
1630#define bfin_read_CAN_MB24_LENGTH() bfin_read16(CAN_MB24_LENGTH)
1631#define bfin_write_CAN_MB24_LENGTH(val) bfin_write16(CAN_MB24_LENGTH,val)
1632#define bfin_read_CAN_MB24_DATA3() bfin_read16(CAN_MB24_DATA3)
1633#define bfin_write_CAN_MB24_DATA3(val) bfin_write16(CAN_MB24_DATA3,val)
1634#define bfin_read_CAN_MB24_DATA2() bfin_read16(CAN_MB24_DATA2)
1635#define bfin_write_CAN_MB24_DATA2(val) bfin_write16(CAN_MB24_DATA2,val)
1636#define bfin_read_CAN_MB24_DATA1() bfin_read16(CAN_MB24_DATA1)
1637#define bfin_write_CAN_MB24_DATA1(val) bfin_write16(CAN_MB24_DATA1,val)
1638#define bfin_read_CAN_MB24_DATA0() bfin_read16(CAN_MB24_DATA0)
1639#define bfin_write_CAN_MB24_DATA0(val) bfin_write16(CAN_MB24_DATA0,val)
1640
1641#define bfin_read_CAN_MB25_ID1() bfin_read16(CAN_MB25_ID1)
1642#define bfin_write_CAN_MB25_ID1(val) bfin_write16(CAN_MB25_ID1,val)
1643#define bfin_read_CAN_MB25_ID0() bfin_read16(CAN_MB25_ID0)
1644#define bfin_write_CAN_MB25_ID0(val) bfin_write16(CAN_MB25_ID0,val)
1645#define bfin_read_CAN_MB25_TIMESTAMP() bfin_read16(CAN_MB25_TIMESTAMP)
1646#define bfin_write_CAN_MB25_TIMESTAMP(val) bfin_write16(CAN_MB25_TIMESTAMP,val)
1647#define bfin_read_CAN_MB25_LENGTH() bfin_read16(CAN_MB25_LENGTH)
1648#define bfin_write_CAN_MB25_LENGTH(val) bfin_write16(CAN_MB25_LENGTH,val)
1649#define bfin_read_CAN_MB25_DATA3() bfin_read16(CAN_MB25_DATA3)
1650#define bfin_write_CAN_MB25_DATA3(val) bfin_write16(CAN_MB25_DATA3,val)
1651#define bfin_read_CAN_MB25_DATA2() bfin_read16(CAN_MB25_DATA2)
1652#define bfin_write_CAN_MB25_DATA2(val) bfin_write16(CAN_MB25_DATA2,val)
1653#define bfin_read_CAN_MB25_DATA1() bfin_read16(CAN_MB25_DATA1)
1654#define bfin_write_CAN_MB25_DATA1(val) bfin_write16(CAN_MB25_DATA1,val)
1655#define bfin_read_CAN_MB25_DATA0() bfin_read16(CAN_MB25_DATA0)
1656#define bfin_write_CAN_MB25_DATA0(val) bfin_write16(CAN_MB25_DATA0,val)
1657
1658#define bfin_read_CAN_MB26_ID1() bfin_read16(CAN_MB26_ID1)
1659#define bfin_write_CAN_MB26_ID1(val) bfin_write16(CAN_MB26_ID1,val)
1660#define bfin_read_CAN_MB26_ID0() bfin_read16(CAN_MB26_ID0)
1661#define bfin_write_CAN_MB26_ID0(val) bfin_write16(CAN_MB26_ID0,val)
1662#define bfin_read_CAN_MB26_TIMESTAMP() bfin_read16(CAN_MB26_TIMESTAMP)
1663#define bfin_write_CAN_MB26_TIMESTAMP(val) bfin_write16(CAN_MB26_TIMESTAMP,val)
1664#define bfin_read_CAN_MB26_LENGTH() bfin_read16(CAN_MB26_LENGTH)
1665#define bfin_write_CAN_MB26_LENGTH(val) bfin_write16(CAN_MB26_LENGTH,val)
1666#define bfin_read_CAN_MB26_DATA3() bfin_read16(CAN_MB26_DATA3)
1667#define bfin_write_CAN_MB26_DATA3(val) bfin_write16(CAN_MB26_DATA3,val)
1668#define bfin_read_CAN_MB26_DATA2() bfin_read16(CAN_MB26_DATA2)
1669#define bfin_write_CAN_MB26_DATA2(val) bfin_write16(CAN_MB26_DATA2,val)
1670#define bfin_read_CAN_MB26_DATA1() bfin_read16(CAN_MB26_DATA1)
1671#define bfin_write_CAN_MB26_DATA1(val) bfin_write16(CAN_MB26_DATA1,val)
1672#define bfin_read_CAN_MB26_DATA0() bfin_read16(CAN_MB26_DATA0)
1673#define bfin_write_CAN_MB26_DATA0(val) bfin_write16(CAN_MB26_DATA0,val)
1674
1675#define bfin_read_CAN_MB27_ID1() bfin_read16(CAN_MB27_ID1)
1676#define bfin_write_CAN_MB27_ID1(val) bfin_write16(CAN_MB27_ID1,val)
1677#define bfin_read_CAN_MB27_ID0() bfin_read16(CAN_MB27_ID0)
1678#define bfin_write_CAN_MB27_ID0(val) bfin_write16(CAN_MB27_ID0,val)
1679#define bfin_read_CAN_MB27_TIMESTAMP() bfin_read16(CAN_MB27_TIMESTAMP)
1680#define bfin_write_CAN_MB27_TIMESTAMP(val) bfin_write16(CAN_MB27_TIMESTAMP,val)
1681#define bfin_read_CAN_MB27_LENGTH() bfin_read16(CAN_MB27_LENGTH)
1682#define bfin_write_CAN_MB27_LENGTH(val) bfin_write16(CAN_MB27_LENGTH,val)
1683#define bfin_read_CAN_MB27_DATA3() bfin_read16(CAN_MB27_DATA3)
1684#define bfin_write_CAN_MB27_DATA3(val) bfin_write16(CAN_MB27_DATA3,val)
1685#define bfin_read_CAN_MB27_DATA2() bfin_read16(CAN_MB27_DATA2)
1686#define bfin_write_CAN_MB27_DATA2(val) bfin_write16(CAN_MB27_DATA2,val)
1687#define bfin_read_CAN_MB27_DATA1() bfin_read16(CAN_MB27_DATA1)
1688#define bfin_write_CAN_MB27_DATA1(val) bfin_write16(CAN_MB27_DATA1,val)
1689#define bfin_read_CAN_MB27_DATA0() bfin_read16(CAN_MB27_DATA0)
1690#define bfin_write_CAN_MB27_DATA0(val) bfin_write16(CAN_MB27_DATA0,val)
1691
1692#define bfin_read_CAN_MB28_ID1() bfin_read16(CAN_MB28_ID1)
1693#define bfin_write_CAN_MB28_ID1(val) bfin_write16(CAN_MB28_ID1,val)
1694#define bfin_read_CAN_MB28_ID0() bfin_read16(CAN_MB28_ID0)
1695#define bfin_write_CAN_MB28_ID0(val) bfin_write16(CAN_MB28_ID0,val)
1696#define bfin_read_CAN_MB28_TIMESTAMP() bfin_read16(CAN_MB28_TIMESTAMP)
1697#define bfin_write_CAN_MB28_TIMESTAMP(val) bfin_write16(CAN_MB28_TIMESTAMP,val)
1698#define bfin_read_CAN_MB28_LENGTH() bfin_read16(CAN_MB28_LENGTH)
1699#define bfin_write_CAN_MB28_LENGTH(val) bfin_write16(CAN_MB28_LENGTH,val)
1700#define bfin_read_CAN_MB28_DATA3() bfin_read16(CAN_MB28_DATA3)
1701#define bfin_write_CAN_MB28_DATA3(val) bfin_write16(CAN_MB28_DATA3,val)
1702#define bfin_read_CAN_MB28_DATA2() bfin_read16(CAN_MB28_DATA2)
1703#define bfin_write_CAN_MB28_DATA2(val) bfin_write16(CAN_MB28_DATA2,val)
1704#define bfin_read_CAN_MB28_DATA1() bfin_read16(CAN_MB28_DATA1)
1705#define bfin_write_CAN_MB28_DATA1(val) bfin_write16(CAN_MB28_DATA1,val)
1706#define bfin_read_CAN_MB28_DATA0() bfin_read16(CAN_MB28_DATA0)
1707#define bfin_write_CAN_MB28_DATA0(val) bfin_write16(CAN_MB28_DATA0,val)
1708
1709#define bfin_read_CAN_MB29_ID1() bfin_read16(CAN_MB29_ID1)
1710#define bfin_write_CAN_MB29_ID1(val) bfin_write16(CAN_MB29_ID1,val)
1711#define bfin_read_CAN_MB29_ID0() bfin_read16(CAN_MB29_ID0)
1712#define bfin_write_CAN_MB29_ID0(val) bfin_write16(CAN_MB29_ID0,val)
1713#define bfin_read_CAN_MB29_TIMESTAMP() bfin_read16(CAN_MB29_TIMESTAMP)
1714#define bfin_write_CAN_MB29_TIMESTAMP(val) bfin_write16(CAN_MB29_TIMESTAMP,val)
1715#define bfin_read_CAN_MB29_LENGTH() bfin_read16(CAN_MB29_LENGTH)
1716#define bfin_write_CAN_MB29_LENGTH(val) bfin_write16(CAN_MB29_LENGTH,val)
1717#define bfin_read_CAN_MB29_DATA3() bfin_read16(CAN_MB29_DATA3)
1718#define bfin_write_CAN_MB29_DATA3(val) bfin_write16(CAN_MB29_DATA3,val)
1719#define bfin_read_CAN_MB29_DATA2() bfin_read16(CAN_MB29_DATA2)
1720#define bfin_write_CAN_MB29_DATA2(val) bfin_write16(CAN_MB29_DATA2,val)
1721#define bfin_read_CAN_MB29_DATA1() bfin_read16(CAN_MB29_DATA1)
1722#define bfin_write_CAN_MB29_DATA1(val) bfin_write16(CAN_MB29_DATA1,val)
1723#define bfin_read_CAN_MB29_DATA0() bfin_read16(CAN_MB29_DATA0)
1724#define bfin_write_CAN_MB29_DATA0(val) bfin_write16(CAN_MB29_DATA0,val)
1725
1726#define bfin_read_CAN_MB30_ID1() bfin_read16(CAN_MB30_ID1)
1727#define bfin_write_CAN_MB30_ID1(val) bfin_write16(CAN_MB30_ID1,val)
1728#define bfin_read_CAN_MB30_ID0() bfin_read16(CAN_MB30_ID0)
1729#define bfin_write_CAN_MB30_ID0(val) bfin_write16(CAN_MB30_ID0,val)
1730#define bfin_read_CAN_MB30_TIMESTAMP() bfin_read16(CAN_MB30_TIMESTAMP)
1731#define bfin_write_CAN_MB30_TIMESTAMP(val) bfin_write16(CAN_MB30_TIMESTAMP,val)
1732#define bfin_read_CAN_MB30_LENGTH() bfin_read16(CAN_MB30_LENGTH)
1733#define bfin_write_CAN_MB30_LENGTH(val) bfin_write16(CAN_MB30_LENGTH,val)
1734#define bfin_read_CAN_MB30_DATA3() bfin_read16(CAN_MB30_DATA3)
1735#define bfin_write_CAN_MB30_DATA3(val) bfin_write16(CAN_MB30_DATA3,val)
1736#define bfin_read_CAN_MB30_DATA2() bfin_read16(CAN_MB30_DATA2)
1737#define bfin_write_CAN_MB30_DATA2(val) bfin_write16(CAN_MB30_DATA2,val)
1738#define bfin_read_CAN_MB30_DATA1() bfin_read16(CAN_MB30_DATA1)
1739#define bfin_write_CAN_MB30_DATA1(val) bfin_write16(CAN_MB30_DATA1,val)
1740#define bfin_read_CAN_MB30_DATA0() bfin_read16(CAN_MB30_DATA0)
1741#define bfin_write_CAN_MB30_DATA0(val) bfin_write16(CAN_MB30_DATA0,val)
1742
1743#define bfin_read_CAN_MB31_ID1() bfin_read16(CAN_MB31_ID1)
1744#define bfin_write_CAN_MB31_ID1(val) bfin_write16(CAN_MB31_ID1,val)
1745#define bfin_read_CAN_MB31_ID0() bfin_read16(CAN_MB31_ID0)
1746#define bfin_write_CAN_MB31_ID0(val) bfin_write16(CAN_MB31_ID0,val)
1747#define bfin_read_CAN_MB31_TIMESTAMP() bfin_read16(CAN_MB31_TIMESTAMP)
1748#define bfin_write_CAN_MB31_TIMESTAMP(val) bfin_write16(CAN_MB31_TIMESTAMP,val)
1749#define bfin_read_CAN_MB31_LENGTH() bfin_read16(CAN_MB31_LENGTH)
1750#define bfin_write_CAN_MB31_LENGTH(val) bfin_write16(CAN_MB31_LENGTH,val)
1751#define bfin_read_CAN_MB31_DATA3() bfin_read16(CAN_MB31_DATA3)
1752#define bfin_write_CAN_MB31_DATA3(val) bfin_write16(CAN_MB31_DATA3,val)
1753#define bfin_read_CAN_MB31_DATA2() bfin_read16(CAN_MB31_DATA2)
1754#define bfin_write_CAN_MB31_DATA2(val) bfin_write16(CAN_MB31_DATA2,val)
1755#define bfin_read_CAN_MB31_DATA1() bfin_read16(CAN_MB31_DATA1)
1756#define bfin_write_CAN_MB31_DATA1(val) bfin_write16(CAN_MB31_DATA1,val)
1757#define bfin_read_CAN_MB31_DATA0() bfin_read16(CAN_MB31_DATA0)
1758#define bfin_write_CAN_MB31_DATA0(val) bfin_write16(CAN_MB31_DATA0,val)
1759
1760/* CAN Mailbox Area Macros */
1761#define bfin_read_CAN_MB_ID1(x)() bfin_read16(CAN_MB_ID1(x))
1762#define bfin_write_CAN_MB_ID1(x)(val) bfin_write16(CAN_MB_ID1(x),val)
1763#define bfin_read_CAN_MB_ID0(x)() bfin_read16(CAN_MB_ID0(x))
1764#define bfin_write_CAN_MB_ID0(x)(val) bfin_write16(CAN_MB_ID0(x),val)
1765#define bfin_read_CAN_MB_TIMESTAMP(x)() bfin_read16(CAN_MB_TIMESTAMP(x))
1766#define bfin_write_CAN_MB_TIMESTAMP(x)(val) bfin_write16(CAN_MB_TIMESTAMP(x),val)
1767#define bfin_read_CAN_MB_LENGTH(x)() bfin_read16(CAN_MB_LENGTH(x))
1768#define bfin_write_CAN_MB_LENGTH(x)(val) bfin_write16(CAN_MB_LENGTH(x),val)
1769#define bfin_read_CAN_MB_DATA3(x)() bfin_read16(CAN_MB_DATA3(x))
1770#define bfin_write_CAN_MB_DATA3(x)(val) bfin_write16(CAN_MB_DATA3(x),val)
1771#define bfin_read_CAN_MB_DATA2(x)() bfin_read16(CAN_MB_DATA2(x))
1772#define bfin_write_CAN_MB_DATA2(x)(val) bfin_write16(CAN_MB_DATA2(x),val)
1773#define bfin_read_CAN_MB_DATA1(x)() bfin_read16(CAN_MB_DATA1(x))
1774#define bfin_write_CAN_MB_DATA1(x)(val) bfin_write16(CAN_MB_DATA1(x),val)
1775#define bfin_read_CAN_MB_DATA0(x)() bfin_read16(CAN_MB_DATA0(x))
1776#define bfin_write_CAN_MB_DATA0(x)(val) bfin_write16(CAN_MB_DATA0(x),val)
1777
1778/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
1779#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
1780#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER,val)
1781#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
1782#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER,val)
1783#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
1784#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER,val)
1785#define bfin_read_PORT_MUX() bfin_read16(BFIN_PORT_MUX)
1786#define bfin_write_PORT_MUX(val) bfin_write16(BFIN_PORT_MUX,val)
1787
1788/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
1789#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1790#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL,val)
1791#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1792#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT,val)
1793#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1794#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT,val)
1795#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1796#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT,val)
1797#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1798#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW,val)
1799#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1800#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT,val)
1801#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1802#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT,val)
1803
1804#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1805#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL,val)
1806#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1807#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT,val)
1808#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1809#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT,val)
1810#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1811#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT,val)
1812#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1813#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW,val)
1814#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1815#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT,val)
1816#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1817#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT,val)
1818
1819#endif /* _CDEF_BF534_H */
diff --git a/include/asm-blackfin/mach-bf537/cdefBF537.h b/include/asm-blackfin/mach-bf537/cdefBF537.h
deleted file mode 100644
index b8fc949a991f..000000000000
--- a/include/asm-blackfin/mach-bf537/cdefBF537.h
+++ /dev/null
@@ -1,206 +0,0 @@
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 bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
44#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE,val)
45#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
46#define bfin_write_EMAC_ADDRLO(val) bfin_write32(EMAC_ADDRLO,val)
47#define bfin_read_EMAC_ADDRHI() bfin_read32(EMAC_ADDRHI)
48#define bfin_write_EMAC_ADDRHI(val) bfin_write32(EMAC_ADDRHI,val)
49#define bfin_read_EMAC_HASHLO() bfin_read32(EMAC_HASHLO)
50#define bfin_write_EMAC_HASHLO(val) bfin_write32(EMAC_HASHLO,val)
51#define bfin_read_EMAC_HASHHI() bfin_read32(EMAC_HASHHI)
52#define bfin_write_EMAC_HASHHI(val) bfin_write32(EMAC_HASHHI,val)
53#define bfin_read_EMAC_STAADD() bfin_read32(EMAC_STAADD)
54#define bfin_write_EMAC_STAADD(val) bfin_write32(EMAC_STAADD,val)
55#define bfin_read_EMAC_STADAT() bfin_read32(EMAC_STADAT)
56#define bfin_write_EMAC_STADAT(val) bfin_write32(EMAC_STADAT,val)
57#define bfin_read_EMAC_FLC() bfin_read32(EMAC_FLC)
58#define bfin_write_EMAC_FLC(val) bfin_write32(EMAC_FLC,val)
59#define bfin_read_EMAC_VLAN1() bfin_read32(EMAC_VLAN1)
60#define bfin_write_EMAC_VLAN1(val) bfin_write32(EMAC_VLAN1,val)
61#define bfin_read_EMAC_VLAN2() bfin_read32(EMAC_VLAN2)
62#define bfin_write_EMAC_VLAN2(val) bfin_write32(EMAC_VLAN2,val)
63#define bfin_read_EMAC_WKUP_CTL() bfin_read32(EMAC_WKUP_CTL)
64#define bfin_write_EMAC_WKUP_CTL(val) bfin_write32(EMAC_WKUP_CTL,val)
65#define bfin_read_EMAC_WKUP_FFMSK0() bfin_read32(EMAC_WKUP_FFMSK0)
66#define bfin_write_EMAC_WKUP_FFMSK0(val) bfin_write32(EMAC_WKUP_FFMSK0,val)
67#define bfin_read_EMAC_WKUP_FFMSK1() bfin_read32(EMAC_WKUP_FFMSK1)
68#define bfin_write_EMAC_WKUP_FFMSK1(val) bfin_write32(EMAC_WKUP_FFMSK1,val)
69#define bfin_read_EMAC_WKUP_FFMSK2() bfin_read32(EMAC_WKUP_FFMSK2)
70#define bfin_write_EMAC_WKUP_FFMSK2(val) bfin_write32(EMAC_WKUP_FFMSK2,val)
71#define bfin_read_EMAC_WKUP_FFMSK3() bfin_read32(EMAC_WKUP_FFMSK3)
72#define bfin_write_EMAC_WKUP_FFMSK3(val) bfin_write32(EMAC_WKUP_FFMSK3,val)
73#define bfin_read_EMAC_WKUP_FFCMD() bfin_read32(EMAC_WKUP_FFCMD)
74#define bfin_write_EMAC_WKUP_FFCMD(val) bfin_write32(EMAC_WKUP_FFCMD,val)
75#define bfin_read_EMAC_WKUP_FFOFF() bfin_read32(EMAC_WKUP_FFOFF)
76#define bfin_write_EMAC_WKUP_FFOFF(val) bfin_write32(EMAC_WKUP_FFOFF,val)
77#define bfin_read_EMAC_WKUP_FFCRC0() bfin_read32(EMAC_WKUP_FFCRC0)
78#define bfin_write_EMAC_WKUP_FFCRC0(val) bfin_write32(EMAC_WKUP_FFCRC0,val)
79#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
80#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1,val)
81
82#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
83#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL,val)
84#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
85#define bfin_write_EMAC_SYSTAT(val) bfin_write32(EMAC_SYSTAT,val)
86#define bfin_read_EMAC_RX_STAT() bfin_read32(EMAC_RX_STAT)
87#define bfin_write_EMAC_RX_STAT(val) bfin_write32(EMAC_RX_STAT,val)
88#define bfin_read_EMAC_RX_STKY() bfin_read32(EMAC_RX_STKY)
89#define bfin_write_EMAC_RX_STKY(val) bfin_write32(EMAC_RX_STKY,val)
90#define bfin_read_EMAC_RX_IRQE() bfin_read32(EMAC_RX_IRQE)
91#define bfin_write_EMAC_RX_IRQE(val) bfin_write32(EMAC_RX_IRQE,val)
92#define bfin_read_EMAC_TX_STAT() bfin_read32(EMAC_TX_STAT)
93#define bfin_write_EMAC_TX_STAT(val) bfin_write32(EMAC_TX_STAT,val)
94#define bfin_read_EMAC_TX_STKY() bfin_read32(EMAC_TX_STKY)
95#define bfin_write_EMAC_TX_STKY(val) bfin_write32(EMAC_TX_STKY,val)
96#define bfin_read_EMAC_TX_IRQE() bfin_read32(EMAC_TX_IRQE)
97#define bfin_write_EMAC_TX_IRQE(val) bfin_write32(EMAC_TX_IRQE,val)
98
99#define bfin_read_EMAC_MMC_CTL() bfin_read32(EMAC_MMC_CTL)
100#define bfin_write_EMAC_MMC_CTL(val) bfin_write32(EMAC_MMC_CTL,val)
101#define bfin_read_EMAC_MMC_RIRQS() bfin_read32(EMAC_MMC_RIRQS)
102#define bfin_write_EMAC_MMC_RIRQS(val) bfin_write32(EMAC_MMC_RIRQS,val)
103#define bfin_read_EMAC_MMC_RIRQE() bfin_read32(EMAC_MMC_RIRQE)
104#define bfin_write_EMAC_MMC_RIRQE(val) bfin_write32(EMAC_MMC_RIRQE,val)
105#define bfin_read_EMAC_MMC_TIRQS() bfin_read32(EMAC_MMC_TIRQS)
106#define bfin_write_EMAC_MMC_TIRQS(val) bfin_write32(EMAC_MMC_TIRQS,val)
107#define bfin_read_EMAC_MMC_TIRQE() bfin_read32(EMAC_MMC_TIRQE)
108#define bfin_write_EMAC_MMC_TIRQE(val) bfin_write32(EMAC_MMC_TIRQE,val)
109
110#define bfin_read_EMAC_RXC_OK() bfin_read32(EMAC_RXC_OK)
111#define bfin_write_EMAC_RXC_OK(val) bfin_write32(EMAC_RXC_OK,val)
112#define bfin_read_EMAC_RXC_FCS() bfin_read32(EMAC_RXC_FCS)
113#define bfin_write_EMAC_RXC_FCS(val) bfin_write32(EMAC_RXC_FCS,val)
114#define bfin_read_EMAC_RXC_ALIGN() bfin_read32(EMAC_RXC_ALIGN)
115#define bfin_write_EMAC_RXC_ALIGN(val) bfin_write32(EMAC_RXC_ALIGN,val)
116#define bfin_read_EMAC_RXC_OCTET() bfin_read32(EMAC_RXC_OCTET)
117#define bfin_write_EMAC_RXC_OCTET(val) bfin_write32(EMAC_RXC_OCTET,val)
118#define bfin_read_EMAC_RXC_DMAOVF() bfin_read32(EMAC_RXC_DMAOVF)
119#define bfin_write_EMAC_RXC_DMAOVF(val) bfin_write32(EMAC_RXC_DMAOVF,val)
120#define bfin_read_EMAC_RXC_UNICST() bfin_read32(EMAC_RXC_UNICST)
121#define bfin_write_EMAC_RXC_UNICST(val) bfin_write32(EMAC_RXC_UNICST,val)
122#define bfin_read_EMAC_RXC_MULTI() bfin_read32(EMAC_RXC_MULTI)
123#define bfin_write_EMAC_RXC_MULTI(val) bfin_write32(EMAC_RXC_MULTI,val)
124#define bfin_read_EMAC_RXC_BROAD() bfin_read32(EMAC_RXC_BROAD)
125#define bfin_write_EMAC_RXC_BROAD(val) bfin_write32(EMAC_RXC_BROAD,val)
126#define bfin_read_EMAC_RXC_LNERRI() bfin_read32(EMAC_RXC_LNERRI)
127#define bfin_write_EMAC_RXC_LNERRI(val) bfin_write32(EMAC_RXC_LNERRI,val)
128#define bfin_read_EMAC_RXC_LNERRO() bfin_read32(EMAC_RXC_LNERRO)
129#define bfin_write_EMAC_RXC_LNERRO(val) bfin_write32(EMAC_RXC_LNERRO,val)
130#define bfin_read_EMAC_RXC_LONG() bfin_read32(EMAC_RXC_LONG)
131#define bfin_write_EMAC_RXC_LONG(val) bfin_write32(EMAC_RXC_LONG,val)
132#define bfin_read_EMAC_RXC_MACCTL() bfin_read32(EMAC_RXC_MACCTL)
133#define bfin_write_EMAC_RXC_MACCTL(val) bfin_write32(EMAC_RXC_MACCTL,val)
134#define bfin_read_EMAC_RXC_OPCODE() bfin_read32(EMAC_RXC_OPCODE)
135#define bfin_write_EMAC_RXC_OPCODE(val) bfin_write32(EMAC_RXC_OPCODE,val)
136#define bfin_read_EMAC_RXC_PAUSE() bfin_read32(EMAC_RXC_PAUSE)
137#define bfin_write_EMAC_RXC_PAUSE(val) bfin_write32(EMAC_RXC_PAUSE,val)
138#define bfin_read_EMAC_RXC_ALLFRM() bfin_read32(EMAC_RXC_ALLFRM)
139#define bfin_write_EMAC_RXC_ALLFRM(val) bfin_write32(EMAC_RXC_ALLFRM,val)
140#define bfin_read_EMAC_RXC_ALLOCT() bfin_read32(EMAC_RXC_ALLOCT)
141#define bfin_write_EMAC_RXC_ALLOCT(val) bfin_write32(EMAC_RXC_ALLOCT,val)
142#define bfin_read_EMAC_RXC_TYPED() bfin_read32(EMAC_RXC_TYPED)
143#define bfin_write_EMAC_RXC_TYPED(val) bfin_write32(EMAC_RXC_TYPED,val)
144#define bfin_read_EMAC_RXC_SHORT() bfin_read32(EMAC_RXC_SHORT)
145#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT,val)
146#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
147#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64,val)
148#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
149#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128,val)
150#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
151#define bfin_write_EMAC_RXC_LT256(val) bfin_write32(EMAC_RXC_LT256,val)
152#define bfin_read_EMAC_RXC_LT512() bfin_read32(EMAC_RXC_LT512)
153#define bfin_write_EMAC_RXC_LT512(val) bfin_write32(EMAC_RXC_LT512,val)
154#define bfin_read_EMAC_RXC_LT1024() bfin_read32(EMAC_RXC_LT1024)
155#define bfin_write_EMAC_RXC_LT1024(val) bfin_write32(EMAC_RXC_LT1024,val)
156#define bfin_read_EMAC_RXC_GE1024() bfin_read32(EMAC_RXC_GE1024)
157#define bfin_write_EMAC_RXC_GE1024(val) bfin_write32(EMAC_RXC_GE1024,val)
158
159#define bfin_read_EMAC_TXC_OK() bfin_read32(EMAC_TXC_OK)
160#define bfin_write_EMAC_TXC_OK(val) bfin_write32(EMAC_TXC_OK,val)
161#define bfin_read_EMAC_TXC_1COL() bfin_read32(EMAC_TXC_1COL)
162#define bfin_write_EMAC_TXC_1COL(val) bfin_write32(EMAC_TXC_1COL,val)
163#define bfin_read_EMAC_TXC_GT1COL() bfin_read32(EMAC_TXC_GT1COL)
164#define bfin_write_EMAC_TXC_GT1COL(val) bfin_write32(EMAC_TXC_GT1COL,val)
165#define bfin_read_EMAC_TXC_OCTET() bfin_read32(EMAC_TXC_OCTET)
166#define bfin_write_EMAC_TXC_OCTET(val) bfin_write32(EMAC_TXC_OCTET,val)
167#define bfin_read_EMAC_TXC_DEFER() bfin_read32(EMAC_TXC_DEFER)
168#define bfin_write_EMAC_TXC_DEFER(val) bfin_write32(EMAC_TXC_DEFER,val)
169#define bfin_read_EMAC_TXC_LATECL() bfin_read32(EMAC_TXC_LATECL)
170#define bfin_write_EMAC_TXC_LATECL(val) bfin_write32(EMAC_TXC_LATECL,val)
171#define bfin_read_EMAC_TXC_XS_COL() bfin_read32(EMAC_TXC_XS_COL)
172#define bfin_write_EMAC_TXC_XS_COL(val) bfin_write32(EMAC_TXC_XS_COL,val)
173#define bfin_read_EMAC_TXC_DMAUND() bfin_read32(EMAC_TXC_DMAUND)
174#define bfin_write_EMAC_TXC_DMAUND(val) bfin_write32(EMAC_TXC_DMAUND,val)
175#define bfin_read_EMAC_TXC_CRSERR() bfin_read32(EMAC_TXC_CRSERR)
176#define bfin_write_EMAC_TXC_CRSERR(val) bfin_write32(EMAC_TXC_CRSERR,val)
177#define bfin_read_EMAC_TXC_UNICST() bfin_read32(EMAC_TXC_UNICST)
178#define bfin_write_EMAC_TXC_UNICST(val) bfin_write32(EMAC_TXC_UNICST,val)
179#define bfin_read_EMAC_TXC_MULTI() bfin_read32(EMAC_TXC_MULTI)
180#define bfin_write_EMAC_TXC_MULTI(val) bfin_write32(EMAC_TXC_MULTI,val)
181#define bfin_read_EMAC_TXC_BROAD() bfin_read32(EMAC_TXC_BROAD)
182#define bfin_write_EMAC_TXC_BROAD(val) bfin_write32(EMAC_TXC_BROAD,val)
183#define bfin_read_EMAC_TXC_XS_DFR() bfin_read32(EMAC_TXC_XS_DFR)
184#define bfin_write_EMAC_TXC_XS_DFR(val) bfin_write32(EMAC_TXC_XS_DFR,val)
185#define bfin_read_EMAC_TXC_MACCTL() bfin_read32(EMAC_TXC_MACCTL)
186#define bfin_write_EMAC_TXC_MACCTL(val) bfin_write32(EMAC_TXC_MACCTL,val)
187#define bfin_read_EMAC_TXC_ALLFRM() bfin_read32(EMAC_TXC_ALLFRM)
188#define bfin_write_EMAC_TXC_ALLFRM(val) bfin_write32(EMAC_TXC_ALLFRM,val)
189#define bfin_read_EMAC_TXC_ALLOCT() bfin_read32(EMAC_TXC_ALLOCT)
190#define bfin_write_EMAC_TXC_ALLOCT(val) bfin_write32(EMAC_TXC_ALLOCT,val)
191#define bfin_read_EMAC_TXC_EQ64() bfin_read32(EMAC_TXC_EQ64)
192#define bfin_write_EMAC_TXC_EQ64(val) bfin_write32(EMAC_TXC_EQ64,val)
193#define bfin_read_EMAC_TXC_LT128() bfin_read32(EMAC_TXC_LT128)
194#define bfin_write_EMAC_TXC_LT128(val) bfin_write32(EMAC_TXC_LT128,val)
195#define bfin_read_EMAC_TXC_LT256() bfin_read32(EMAC_TXC_LT256)
196#define bfin_write_EMAC_TXC_LT256(val) bfin_write32(EMAC_TXC_LT256,val)
197#define bfin_read_EMAC_TXC_LT512() bfin_read32(EMAC_TXC_LT512)
198#define bfin_write_EMAC_TXC_LT512(val) bfin_write32(EMAC_TXC_LT512,val)
199#define bfin_read_EMAC_TXC_LT1024() bfin_read32(EMAC_TXC_LT1024)
200#define bfin_write_EMAC_TXC_LT1024(val) bfin_write32(EMAC_TXC_LT1024,val)
201#define bfin_read_EMAC_TXC_GE1024() bfin_read32(EMAC_TXC_GE1024)
202#define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024,val)
203#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
204#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT,val)
205
206#endif /* _CDEF_BF537_H */
diff --git a/include/asm-blackfin/mach-bf537/defBF534.h b/include/asm-blackfin/mach-bf537/defBF534.h
deleted file mode 100644
index d0d80d3152ba..000000000000
--- a/include/asm-blackfin/mach-bf537/defBF534.h
+++ /dev/null
@@ -1,2527 +0,0 @@
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 SPI0_REGBASE 0xFFC00500
90#define SPI_CTL 0xFFC00500 /* SPI Control Register */
91#define SPI_FLG 0xFFC00504 /* SPI Flag register */
92#define SPI_STAT 0xFFC00508 /* SPI Status register */
93#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
94#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
95#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
96#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
97
98/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
99#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
100#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
101#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
102#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
103
104#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
105#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
106#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
107#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
108
109#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
110#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
111#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
112#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
113
114#define TIMER3_CONFIG 0xFFC00630 /* Timer 3 Configuration Register */
115#define TIMER3_COUNTER 0xFFC00634 /* Timer 3 Counter Register */
116#define TIMER3_PERIOD 0xFFC00638 /* Timer 3 Period Register */
117#define TIMER3_WIDTH 0xFFC0063C /* Timer 3 Width Register */
118
119#define TIMER4_CONFIG 0xFFC00640 /* Timer 4 Configuration Register */
120#define TIMER4_COUNTER 0xFFC00644 /* Timer 4 Counter Register */
121#define TIMER4_PERIOD 0xFFC00648 /* Timer 4 Period Register */
122#define TIMER4_WIDTH 0xFFC0064C /* Timer 4 Width Register */
123
124#define TIMER5_CONFIG 0xFFC00650 /* Timer 5 Configuration Register */
125#define TIMER5_COUNTER 0xFFC00654 /* Timer 5 Counter Register */
126#define TIMER5_PERIOD 0xFFC00658 /* Timer 5 Period Register */
127#define TIMER5_WIDTH 0xFFC0065C /* Timer 5 Width Register */
128
129#define TIMER6_CONFIG 0xFFC00660 /* Timer 6 Configuration Register */
130#define TIMER6_COUNTER 0xFFC00664 /* Timer 6 Counter Register */
131#define TIMER6_PERIOD 0xFFC00668 /* Timer 6 Period Register */
132#define TIMER6_WIDTH 0xFFC0066C /* Timer 6 Width Register */
133
134#define TIMER7_CONFIG 0xFFC00670 /* Timer 7 Configuration Register */
135#define TIMER7_COUNTER 0xFFC00674 /* Timer 7 Counter Register */
136#define TIMER7_PERIOD 0xFFC00678 /* Timer 7 Period Register */
137#define TIMER7_WIDTH 0xFFC0067C /* Timer 7 Width Register */
138
139#define TIMER_ENABLE 0xFFC00680 /* Timer Enable Register */
140#define TIMER_DISABLE 0xFFC00684 /* Timer Disable Register */
141#define TIMER_STATUS 0xFFC00688 /* Timer Status Register */
142
143/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
144#define PORTFIO 0xFFC00700 /* Port F I/O Pin State Specify Register */
145#define PORTFIO_CLEAR 0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
146#define PORTFIO_SET 0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
147#define PORTFIO_TOGGLE 0xFFC0070C /* Port F I/O Pin State Toggle Register */
148#define PORTFIO_MASKA 0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
149#define PORTFIO_MASKA_CLEAR 0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
150#define PORTFIO_MASKA_SET 0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
151#define PORTFIO_MASKA_TOGGLE 0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
152#define PORTFIO_MASKB 0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
153#define PORTFIO_MASKB_CLEAR 0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
154#define PORTFIO_MASKB_SET 0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
155#define PORTFIO_MASKB_TOGGLE 0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
156#define PORTFIO_DIR 0xFFC00730 /* Port F I/O Direction Register */
157#define PORTFIO_POLAR 0xFFC00734 /* Port F I/O Source Polarity Register */
158#define PORTFIO_EDGE 0xFFC00738 /* Port F I/O Source Sensitivity Register */
159#define PORTFIO_BOTH 0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
160#define PORTFIO_INEN 0xFFC00740 /* Port F I/O Input Enable Register */
161
162/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
163#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
164#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
165#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
166#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
167#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
168#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
169#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
170#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
171#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
172#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
173#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
174#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
175#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
176#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
177#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
178#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
179#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
180#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
181#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
182#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
183#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
184#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
185
186/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
187#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
188#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
189#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
190#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
191#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
192#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
193#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
194#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
195#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
196#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
197#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
198#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
199#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
200#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
201#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
202#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
203#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
204#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
205#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
206#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
207#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
208#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
209
210/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
211#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
212#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
213#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
214#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
215#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
216#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
217#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
218
219/* DMA Traffic Control Registers */
220#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
221#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
222
223/* Alternate deprecated register names (below) provided for backwards code compatibility */
224#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
225#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
226
227/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
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_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
231#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
232#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
233#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
234#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
235#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
236#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
237#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
238#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
239#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
240#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
241
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_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
245#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
246#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
247#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
248#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
249#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
250#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
251#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
252#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
253#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
254#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
255
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_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
259#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
260#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
261#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
262#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
263#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
264#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
265#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
266#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
267#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
268#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
269
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_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
273#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
274#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
275#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
276#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
277#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
278#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
279#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
280#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
281#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
282#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
283
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_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
287#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
288#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
289#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
290#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
291#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
292#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
293#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
294#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
295#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
296#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
297
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_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
301#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
302#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
303#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
304#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
305#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
306#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
307#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
308#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
309#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
310#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
311
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_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
315#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
316#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
317#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
318#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
319#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
320#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
321#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
322#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
323#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
324#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
325
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_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
329#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
330#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
331#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
332#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
333#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
334#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
335#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
336#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
337#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
338#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
339
340#define DMA8_NEXT_DESC_PTR 0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
341#define DMA8_START_ADDR 0xFFC00E04 /* DMA Channel 8 Start Address Register */
342#define DMA8_CONFIG 0xFFC00E08 /* DMA Channel 8 Configuration Register */
343#define DMA8_X_COUNT 0xFFC00E10 /* DMA Channel 8 X Count Register */
344#define DMA8_X_MODIFY 0xFFC00E14 /* DMA Channel 8 X Modify Register */
345#define DMA8_Y_COUNT 0xFFC00E18 /* DMA Channel 8 Y Count Register */
346#define DMA8_Y_MODIFY 0xFFC00E1C /* DMA Channel 8 Y Modify Register */
347#define DMA8_CURR_DESC_PTR 0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
348#define DMA8_CURR_ADDR 0xFFC00E24 /* DMA Channel 8 Current Address Register */
349#define DMA8_IRQ_STATUS 0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
350#define DMA8_PERIPHERAL_MAP 0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
351#define DMA8_CURR_X_COUNT 0xFFC00E30 /* DMA Channel 8 Current X Count Register */
352#define DMA8_CURR_Y_COUNT 0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
353
354#define DMA9_NEXT_DESC_PTR 0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
355#define DMA9_START_ADDR 0xFFC00E44 /* DMA Channel 9 Start Address Register */
356#define DMA9_CONFIG 0xFFC00E48 /* DMA Channel 9 Configuration Register */
357#define DMA9_X_COUNT 0xFFC00E50 /* DMA Channel 9 X Count Register */
358#define DMA9_X_MODIFY 0xFFC00E54 /* DMA Channel 9 X Modify Register */
359#define DMA9_Y_COUNT 0xFFC00E58 /* DMA Channel 9 Y Count Register */
360#define DMA9_Y_MODIFY 0xFFC00E5C /* DMA Channel 9 Y Modify Register */
361#define DMA9_CURR_DESC_PTR 0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
362#define DMA9_CURR_ADDR 0xFFC00E64 /* DMA Channel 9 Current Address Register */
363#define DMA9_IRQ_STATUS 0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
364#define DMA9_PERIPHERAL_MAP 0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
365#define DMA9_CURR_X_COUNT 0xFFC00E70 /* DMA Channel 9 Current X Count Register */
366#define DMA9_CURR_Y_COUNT 0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
367
368#define DMA10_NEXT_DESC_PTR 0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
369#define DMA10_START_ADDR 0xFFC00E84 /* DMA Channel 10 Start Address Register */
370#define DMA10_CONFIG 0xFFC00E88 /* DMA Channel 10 Configuration Register */
371#define DMA10_X_COUNT 0xFFC00E90 /* DMA Channel 10 X Count Register */
372#define DMA10_X_MODIFY 0xFFC00E94 /* DMA Channel 10 X Modify Register */
373#define DMA10_Y_COUNT 0xFFC00E98 /* DMA Channel 10 Y Count Register */
374#define DMA10_Y_MODIFY 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
375#define DMA10_CURR_DESC_PTR 0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
376#define DMA10_CURR_ADDR 0xFFC00EA4 /* DMA Channel 10 Current Address Register */
377#define DMA10_IRQ_STATUS 0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
378#define DMA10_PERIPHERAL_MAP 0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
379#define DMA10_CURR_X_COUNT 0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
380#define DMA10_CURR_Y_COUNT 0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
381
382#define DMA11_NEXT_DESC_PTR 0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
383#define DMA11_START_ADDR 0xFFC00EC4 /* DMA Channel 11 Start Address Register */
384#define DMA11_CONFIG 0xFFC00EC8 /* DMA Channel 11 Configuration Register */
385#define DMA11_X_COUNT 0xFFC00ED0 /* DMA Channel 11 X Count Register */
386#define DMA11_X_MODIFY 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
387#define DMA11_Y_COUNT 0xFFC00ED8 /* DMA Channel 11 Y Count Register */
388#define DMA11_Y_MODIFY 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
389#define DMA11_CURR_DESC_PTR 0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
390#define DMA11_CURR_ADDR 0xFFC00EE4 /* DMA Channel 11 Current Address Register */
391#define DMA11_IRQ_STATUS 0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
392#define DMA11_PERIPHERAL_MAP 0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
393#define DMA11_CURR_X_COUNT 0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
394#define DMA11_CURR_Y_COUNT 0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
395
396#define MDMA_D0_NEXT_DESC_PTR 0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
397#define MDMA_D0_START_ADDR 0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
398#define MDMA_D0_CONFIG 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
399#define MDMA_D0_X_COUNT 0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
400#define MDMA_D0_X_MODIFY 0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
401#define MDMA_D0_Y_COUNT 0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
402#define MDMA_D0_Y_MODIFY 0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
403#define MDMA_D0_CURR_DESC_PTR 0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
404#define MDMA_D0_CURR_ADDR 0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
405#define MDMA_D0_IRQ_STATUS 0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
406#define MDMA_D0_PERIPHERAL_MAP 0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
407#define MDMA_D0_CURR_X_COUNT 0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
408#define MDMA_D0_CURR_Y_COUNT 0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
409
410#define MDMA_S0_NEXT_DESC_PTR 0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
411#define MDMA_S0_START_ADDR 0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
412#define MDMA_S0_CONFIG 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
413#define MDMA_S0_X_COUNT 0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
414#define MDMA_S0_X_MODIFY 0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
415#define MDMA_S0_Y_COUNT 0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
416#define MDMA_S0_Y_MODIFY 0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
417#define MDMA_S0_CURR_DESC_PTR 0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
418#define MDMA_S0_CURR_ADDR 0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
419#define MDMA_S0_IRQ_STATUS 0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
420#define MDMA_S0_PERIPHERAL_MAP 0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
421#define MDMA_S0_CURR_X_COUNT 0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
422#define MDMA_S0_CURR_Y_COUNT 0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
423
424#define MDMA_D1_NEXT_DESC_PTR 0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
425#define MDMA_D1_START_ADDR 0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
426#define MDMA_D1_CONFIG 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
427#define MDMA_D1_X_COUNT 0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
428#define MDMA_D1_X_MODIFY 0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
429#define MDMA_D1_Y_COUNT 0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
430#define MDMA_D1_Y_MODIFY 0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
431#define MDMA_D1_CURR_DESC_PTR 0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
432#define MDMA_D1_CURR_ADDR 0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
433#define MDMA_D1_IRQ_STATUS 0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
434#define MDMA_D1_PERIPHERAL_MAP 0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
435#define MDMA_D1_CURR_X_COUNT 0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
436#define MDMA_D1_CURR_Y_COUNT 0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
437
438#define MDMA_S1_NEXT_DESC_PTR 0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
439#define MDMA_S1_START_ADDR 0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
440#define MDMA_S1_CONFIG 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
441#define MDMA_S1_X_COUNT 0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
442#define MDMA_S1_X_MODIFY 0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
443#define MDMA_S1_Y_COUNT 0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
444#define MDMA_S1_Y_MODIFY 0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
445#define MDMA_S1_CURR_DESC_PTR 0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
446#define MDMA_S1_CURR_ADDR 0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
447#define MDMA_S1_IRQ_STATUS 0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
448#define MDMA_S1_PERIPHERAL_MAP 0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
449#define MDMA_S1_CURR_X_COUNT 0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
450#define MDMA_S1_CURR_Y_COUNT 0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
451
452/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
453#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
454#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
455#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
456#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
457#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
458
459/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
460#define TWI0_REGBASE 0xFFC01400
461#define TWI_CLKDIV 0xFFC01400 /* Serial Clock Divider Register */
462#define TWI_CONTROL 0xFFC01404 /* TWI Control Register */
463#define TWI_SLAVE_CTL 0xFFC01408 /* Slave Mode Control Register */
464#define TWI_SLAVE_STAT 0xFFC0140C /* Slave Mode Status Register */
465#define TWI_SLAVE_ADDR 0xFFC01410 /* Slave Mode Address Register */
466#define TWI_MASTER_CTL 0xFFC01414 /* Master Mode Control Register */
467#define TWI_MASTER_STAT 0xFFC01418 /* Master Mode Status Register */
468#define TWI_MASTER_ADDR 0xFFC0141C /* Master Mode Address Register */
469#define TWI_INT_STAT 0xFFC01420 /* TWI Interrupt Status Register */
470#define TWI_INT_MASK 0xFFC01424 /* TWI Master Interrupt Mask Register */
471#define TWI_FIFO_CTL 0xFFC01428 /* FIFO Control Register */
472#define TWI_FIFO_STAT 0xFFC0142C /* FIFO Status Register */
473#define TWI_XMT_DATA8 0xFFC01480 /* FIFO Transmit Data Single Byte Register */
474#define TWI_XMT_DATA16 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
475#define TWI_RCV_DATA8 0xFFC01488 /* FIFO Receive Data Single Byte Register */
476#define TWI_RCV_DATA16 0xFFC0148C /* FIFO Receive Data Double Byte Register */
477
478/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
479#define PORTGIO 0xFFC01500 /* Port G I/O Pin State Specify Register */
480#define PORTGIO_CLEAR 0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
481#define PORTGIO_SET 0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
482#define PORTGIO_TOGGLE 0xFFC0150C /* Port G I/O Pin State Toggle Register */
483#define PORTGIO_MASKA 0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
484#define PORTGIO_MASKA_CLEAR 0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
485#define PORTGIO_MASKA_SET 0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
486#define PORTGIO_MASKA_TOGGLE 0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
487#define PORTGIO_MASKB 0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
488#define PORTGIO_MASKB_CLEAR 0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
489#define PORTGIO_MASKB_SET 0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
490#define PORTGIO_MASKB_TOGGLE 0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
491#define PORTGIO_DIR 0xFFC01530 /* Port G I/O Direction Register */
492#define PORTGIO_POLAR 0xFFC01534 /* Port G I/O Source Polarity Register */
493#define PORTGIO_EDGE 0xFFC01538 /* Port G I/O Source Sensitivity Register */
494#define PORTGIO_BOTH 0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
495#define PORTGIO_INEN 0xFFC01540 /* Port G I/O Input Enable Register */
496
497/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
498#define PORTHIO 0xFFC01700 /* Port H I/O Pin State Specify Register */
499#define PORTHIO_CLEAR 0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
500#define PORTHIO_SET 0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
501#define PORTHIO_TOGGLE 0xFFC0170C /* Port H I/O Pin State Toggle Register */
502#define PORTHIO_MASKA 0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
503#define PORTHIO_MASKA_CLEAR 0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
504#define PORTHIO_MASKA_SET 0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
505#define PORTHIO_MASKA_TOGGLE 0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
506#define PORTHIO_MASKB 0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
507#define PORTHIO_MASKB_CLEAR 0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
508#define PORTHIO_MASKB_SET 0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
509#define PORTHIO_MASKB_TOGGLE 0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
510#define PORTHIO_DIR 0xFFC01730 /* Port H I/O Direction Register */
511#define PORTHIO_POLAR 0xFFC01734 /* Port H I/O Source Polarity Register */
512#define PORTHIO_EDGE 0xFFC01738 /* Port H I/O Source Sensitivity Register */
513#define PORTHIO_BOTH 0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
514#define PORTHIO_INEN 0xFFC01740 /* Port H I/O Input Enable Register */
515
516/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
517#define UART1_THR 0xFFC02000 /* Transmit Holding register */
518#define UART1_RBR 0xFFC02000 /* Receive Buffer register */
519#define UART1_DLL 0xFFC02000 /* Divisor Latch (Low-Byte) */
520#define UART1_IER 0xFFC02004 /* Interrupt Enable Register */
521#define UART1_DLH 0xFFC02004 /* Divisor Latch (High-Byte) */
522#define UART1_IIR 0xFFC02008 /* Interrupt Identification Register */
523#define UART1_LCR 0xFFC0200C /* Line Control Register */
524#define UART1_MCR 0xFFC02010 /* Modem Control Register */
525#define UART1_LSR 0xFFC02014 /* Line Status Register */
526#define UART1_MSR 0xFFC02018 /* Modem Status Register */
527#define UART1_SCR 0xFFC0201C /* SCR Scratch Register */
528#define UART1_GCTL 0xFFC02024 /* Global Control Register */
529
530/* CAN Controller (0xFFC02A00 - 0xFFC02FFF) */
531/* For Mailboxes 0-15 */
532#define CAN_MC1 0xFFC02A00 /* Mailbox config reg 1 */
533#define CAN_MD1 0xFFC02A04 /* Mailbox direction reg 1 */
534#define CAN_TRS1 0xFFC02A08 /* Transmit Request Set reg 1 */
535#define CAN_TRR1 0xFFC02A0C /* Transmit Request Reset reg 1 */
536#define CAN_TA1 0xFFC02A10 /* Transmit Acknowledge reg 1 */
537#define CAN_AA1 0xFFC02A14 /* Transmit Abort Acknowledge reg 1 */
538#define CAN_RMP1 0xFFC02A18 /* Receive Message Pending reg 1 */
539#define CAN_RML1 0xFFC02A1C /* Receive Message Lost reg 1 */
540#define CAN_MBTIF1 0xFFC02A20 /* Mailbox Transmit Interrupt Flag reg 1 */
541#define CAN_MBRIF1 0xFFC02A24 /* Mailbox Receive Interrupt Flag reg 1 */
542#define CAN_MBIM1 0xFFC02A28 /* Mailbox Interrupt Mask reg 1 */
543#define CAN_RFH1 0xFFC02A2C /* Remote Frame Handling reg 1 */
544#define CAN_OPSS1 0xFFC02A30 /* Overwrite Protection Single Shot Xmit reg 1 */
545
546/* For Mailboxes 16-31 */
547#define CAN_MC2 0xFFC02A40 /* Mailbox config reg 2 */
548#define CAN_MD2 0xFFC02A44 /* Mailbox direction reg 2 */
549#define CAN_TRS2 0xFFC02A48 /* Transmit Request Set reg 2 */
550#define CAN_TRR2 0xFFC02A4C /* Transmit Request Reset reg 2 */
551#define CAN_TA2 0xFFC02A50 /* Transmit Acknowledge reg 2 */
552#define CAN_AA2 0xFFC02A54 /* Transmit Abort Acknowledge reg 2 */
553#define CAN_RMP2 0xFFC02A58 /* Receive Message Pending reg 2 */
554#define CAN_RML2 0xFFC02A5C /* Receive Message Lost reg 2 */
555#define CAN_MBTIF2 0xFFC02A60 /* Mailbox Transmit Interrupt Flag reg 2 */
556#define CAN_MBRIF2 0xFFC02A64 /* Mailbox Receive Interrupt Flag reg 2 */
557#define CAN_MBIM2 0xFFC02A68 /* Mailbox Interrupt Mask reg 2 */
558#define CAN_RFH2 0xFFC02A6C /* Remote Frame Handling reg 2 */
559#define CAN_OPSS2 0xFFC02A70 /* Overwrite Protection Single Shot Xmit reg 2 */
560
561/* CAN Configuration, Control, and Status Registers */
562#define CAN_CLOCK 0xFFC02A80 /* Bit Timing Configuration register 0 */
563#define CAN_TIMING 0xFFC02A84 /* Bit Timing Configuration register 1 */
564#define CAN_DEBUG 0xFFC02A88 /* Debug Register */
565#define CAN_STATUS 0xFFC02A8C /* Global Status Register */
566#define CAN_CEC 0xFFC02A90 /* Error Counter Register */
567#define CAN_GIS 0xFFC02A94 /* Global Interrupt Status Register */
568#define CAN_GIM 0xFFC02A98 /* Global Interrupt Mask Register */
569#define CAN_GIF 0xFFC02A9C /* Global Interrupt Flag Register */
570#define CAN_CONTROL 0xFFC02AA0 /* Master Control Register */
571#define CAN_INTR 0xFFC02AA4 /* Interrupt Pending Register */
572
573#define CAN_MBTD 0xFFC02AAC /* Mailbox Temporary Disable Feature */
574#define CAN_EWR 0xFFC02AB0 /* Programmable Warning Level */
575#define CAN_ESR 0xFFC02AB4 /* Error Status Register */
576#define CAN_UCREG 0xFFC02AC0 /* Universal Counter Register/Capture Register */
577#define CAN_UCCNT 0xFFC02AC4 /* Universal Counter */
578#define CAN_UCRC 0xFFC02AC8 /* Universal Counter Force Reload Register */
579#define CAN_UCCNF 0xFFC02ACC /* Universal Counter Configuration Register */
580
581/* Mailbox Acceptance Masks */
582#define CAN_AM00L 0xFFC02B00 /* Mailbox 0 Low Acceptance Mask */
583#define CAN_AM00H 0xFFC02B04 /* Mailbox 0 High Acceptance Mask */
584#define CAN_AM01L 0xFFC02B08 /* Mailbox 1 Low Acceptance Mask */
585#define CAN_AM01H 0xFFC02B0C /* Mailbox 1 High Acceptance Mask */
586#define CAN_AM02L 0xFFC02B10 /* Mailbox 2 Low Acceptance Mask */
587#define CAN_AM02H 0xFFC02B14 /* Mailbox 2 High Acceptance Mask */
588#define CAN_AM03L 0xFFC02B18 /* Mailbox 3 Low Acceptance Mask */
589#define CAN_AM03H 0xFFC02B1C /* Mailbox 3 High Acceptance Mask */
590#define CAN_AM04L 0xFFC02B20 /* Mailbox 4 Low Acceptance Mask */
591#define CAN_AM04H 0xFFC02B24 /* Mailbox 4 High Acceptance Mask */
592#define CAN_AM05L 0xFFC02B28 /* Mailbox 5 Low Acceptance Mask */
593#define CAN_AM05H 0xFFC02B2C /* Mailbox 5 High Acceptance Mask */
594#define CAN_AM06L 0xFFC02B30 /* Mailbox 6 Low Acceptance Mask */
595#define CAN_AM06H 0xFFC02B34 /* Mailbox 6 High Acceptance Mask */
596#define CAN_AM07L 0xFFC02B38 /* Mailbox 7 Low Acceptance Mask */
597#define CAN_AM07H 0xFFC02B3C /* Mailbox 7 High Acceptance Mask */
598#define CAN_AM08L 0xFFC02B40 /* Mailbox 8 Low Acceptance Mask */
599#define CAN_AM08H 0xFFC02B44 /* Mailbox 8 High Acceptance Mask */
600#define CAN_AM09L 0xFFC02B48 /* Mailbox 9 Low Acceptance Mask */
601#define CAN_AM09H 0xFFC02B4C /* Mailbox 9 High Acceptance Mask */
602#define CAN_AM10L 0xFFC02B50 /* Mailbox 10 Low Acceptance Mask */
603#define CAN_AM10H 0xFFC02B54 /* Mailbox 10 High Acceptance Mask */
604#define CAN_AM11L 0xFFC02B58 /* Mailbox 11 Low Acceptance Mask */
605#define CAN_AM11H 0xFFC02B5C /* Mailbox 11 High Acceptance Mask */
606#define CAN_AM12L 0xFFC02B60 /* Mailbox 12 Low Acceptance Mask */
607#define CAN_AM12H 0xFFC02B64 /* Mailbox 12 High Acceptance Mask */
608#define CAN_AM13L 0xFFC02B68 /* Mailbox 13 Low Acceptance Mask */
609#define CAN_AM13H 0xFFC02B6C /* Mailbox 13 High Acceptance Mask */
610#define CAN_AM14L 0xFFC02B70 /* Mailbox 14 Low Acceptance Mask */
611#define CAN_AM14H 0xFFC02B74 /* Mailbox 14 High Acceptance Mask */
612#define CAN_AM15L 0xFFC02B78 /* Mailbox 15 Low Acceptance Mask */
613#define CAN_AM15H 0xFFC02B7C /* Mailbox 15 High Acceptance Mask */
614
615#define CAN_AM16L 0xFFC02B80 /* Mailbox 16 Low Acceptance Mask */
616#define CAN_AM16H 0xFFC02B84 /* Mailbox 16 High Acceptance Mask */
617#define CAN_AM17L 0xFFC02B88 /* Mailbox 17 Low Acceptance Mask */
618#define CAN_AM17H 0xFFC02B8C /* Mailbox 17 High Acceptance Mask */
619#define CAN_AM18L 0xFFC02B90 /* Mailbox 18 Low Acceptance Mask */
620#define CAN_AM18H 0xFFC02B94 /* Mailbox 18 High Acceptance Mask */
621#define CAN_AM19L 0xFFC02B98 /* Mailbox 19 Low Acceptance Mask */
622#define CAN_AM19H 0xFFC02B9C /* Mailbox 19 High Acceptance Mask */
623#define CAN_AM20L 0xFFC02BA0 /* Mailbox 20 Low Acceptance Mask */
624#define CAN_AM20H 0xFFC02BA4 /* Mailbox 20 High Acceptance Mask */
625#define CAN_AM21L 0xFFC02BA8 /* Mailbox 21 Low Acceptance Mask */
626#define CAN_AM21H 0xFFC02BAC /* Mailbox 21 High Acceptance Mask */
627#define CAN_AM22L 0xFFC02BB0 /* Mailbox 22 Low Acceptance Mask */
628#define CAN_AM22H 0xFFC02BB4 /* Mailbox 22 High Acceptance Mask */
629#define CAN_AM23L 0xFFC02BB8 /* Mailbox 23 Low Acceptance Mask */
630#define CAN_AM23H 0xFFC02BBC /* Mailbox 23 High Acceptance Mask */
631#define CAN_AM24L 0xFFC02BC0 /* Mailbox 24 Low Acceptance Mask */
632#define CAN_AM24H 0xFFC02BC4 /* Mailbox 24 High Acceptance Mask */
633#define CAN_AM25L 0xFFC02BC8 /* Mailbox 25 Low Acceptance Mask */
634#define CAN_AM25H 0xFFC02BCC /* Mailbox 25 High Acceptance Mask */
635#define CAN_AM26L 0xFFC02BD0 /* Mailbox 26 Low Acceptance Mask */
636#define CAN_AM26H 0xFFC02BD4 /* Mailbox 26 High Acceptance Mask */
637#define CAN_AM27L 0xFFC02BD8 /* Mailbox 27 Low Acceptance Mask */
638#define CAN_AM27H 0xFFC02BDC /* Mailbox 27 High Acceptance Mask */
639#define CAN_AM28L 0xFFC02BE0 /* Mailbox 28 Low Acceptance Mask */
640#define CAN_AM28H 0xFFC02BE4 /* Mailbox 28 High Acceptance Mask */
641#define CAN_AM29L 0xFFC02BE8 /* Mailbox 29 Low Acceptance Mask */
642#define CAN_AM29H 0xFFC02BEC /* Mailbox 29 High Acceptance Mask */
643#define CAN_AM30L 0xFFC02BF0 /* Mailbox 30 Low Acceptance Mask */
644#define CAN_AM30H 0xFFC02BF4 /* Mailbox 30 High Acceptance Mask */
645#define CAN_AM31L 0xFFC02BF8 /* Mailbox 31 Low Acceptance Mask */
646#define CAN_AM31H 0xFFC02BFC /* Mailbox 31 High Acceptance Mask */
647
648/* CAN Acceptance Mask Macros */
649#define CAN_AM_L(x) (CAN_AM00L+((x)*0x8))
650#define CAN_AM_H(x) (CAN_AM00H+((x)*0x8))
651
652/* Mailbox Registers */
653#define CAN_MB00_DATA0 0xFFC02C00 /* Mailbox 0 Data Word 0 [15:0] Register */
654#define CAN_MB00_DATA1 0xFFC02C04 /* Mailbox 0 Data Word 1 [31:16] Register */
655#define CAN_MB00_DATA2 0xFFC02C08 /* Mailbox 0 Data Word 2 [47:32] Register */
656#define CAN_MB00_DATA3 0xFFC02C0C /* Mailbox 0 Data Word 3 [63:48] Register */
657#define CAN_MB00_LENGTH 0xFFC02C10 /* Mailbox 0 Data Length Code Register */
658#define CAN_MB00_TIMESTAMP 0xFFC02C14 /* Mailbox 0 Time Stamp Value Register */
659#define CAN_MB00_ID0 0xFFC02C18 /* Mailbox 0 Identifier Low Register */
660#define CAN_MB00_ID1 0xFFC02C1C /* Mailbox 0 Identifier High Register */
661
662#define CAN_MB01_DATA0 0xFFC02C20 /* Mailbox 1 Data Word 0 [15:0] Register */
663#define CAN_MB01_DATA1 0xFFC02C24 /* Mailbox 1 Data Word 1 [31:16] Register */
664#define CAN_MB01_DATA2 0xFFC02C28 /* Mailbox 1 Data Word 2 [47:32] Register */
665#define CAN_MB01_DATA3 0xFFC02C2C /* Mailbox 1 Data Word 3 [63:48] Register */
666#define CAN_MB01_LENGTH 0xFFC02C30 /* Mailbox 1 Data Length Code Register */
667#define CAN_MB01_TIMESTAMP 0xFFC02C34 /* Mailbox 1 Time Stamp Value Register */
668#define CAN_MB01_ID0 0xFFC02C38 /* Mailbox 1 Identifier Low Register */
669#define CAN_MB01_ID1 0xFFC02C3C /* Mailbox 1 Identifier High Register */
670
671#define CAN_MB02_DATA0 0xFFC02C40 /* Mailbox 2 Data Word 0 [15:0] Register */
672#define CAN_MB02_DATA1 0xFFC02C44 /* Mailbox 2 Data Word 1 [31:16] Register */
673#define CAN_MB02_DATA2 0xFFC02C48 /* Mailbox 2 Data Word 2 [47:32] Register */
674#define CAN_MB02_DATA3 0xFFC02C4C /* Mailbox 2 Data Word 3 [63:48] Register */
675#define CAN_MB02_LENGTH 0xFFC02C50 /* Mailbox 2 Data Length Code Register */
676#define CAN_MB02_TIMESTAMP 0xFFC02C54 /* Mailbox 2 Time Stamp Value Register */
677#define CAN_MB02_ID0 0xFFC02C58 /* Mailbox 2 Identifier Low Register */
678#define CAN_MB02_ID1 0xFFC02C5C /* Mailbox 2 Identifier High Register */
679
680#define CAN_MB03_DATA0 0xFFC02C60 /* Mailbox 3 Data Word 0 [15:0] Register */
681#define CAN_MB03_DATA1 0xFFC02C64 /* Mailbox 3 Data Word 1 [31:16] Register */
682#define CAN_MB03_DATA2 0xFFC02C68 /* Mailbox 3 Data Word 2 [47:32] Register */
683#define CAN_MB03_DATA3 0xFFC02C6C /* Mailbox 3 Data Word 3 [63:48] Register */
684#define CAN_MB03_LENGTH 0xFFC02C70 /* Mailbox 3 Data Length Code Register */
685#define CAN_MB03_TIMESTAMP 0xFFC02C74 /* Mailbox 3 Time Stamp Value Register */
686#define CAN_MB03_ID0 0xFFC02C78 /* Mailbox 3 Identifier Low Register */
687#define CAN_MB03_ID1 0xFFC02C7C /* Mailbox 3 Identifier High Register */
688
689#define CAN_MB04_DATA0 0xFFC02C80 /* Mailbox 4 Data Word 0 [15:0] Register */
690#define CAN_MB04_DATA1 0xFFC02C84 /* Mailbox 4 Data Word 1 [31:16] Register */
691#define CAN_MB04_DATA2 0xFFC02C88 /* Mailbox 4 Data Word 2 [47:32] Register */
692#define CAN_MB04_DATA3 0xFFC02C8C /* Mailbox 4 Data Word 3 [63:48] Register */
693#define CAN_MB04_LENGTH 0xFFC02C90 /* Mailbox 4 Data Length Code Register */
694#define CAN_MB04_TIMESTAMP 0xFFC02C94 /* Mailbox 4 Time Stamp Value Register */
695#define CAN_MB04_ID0 0xFFC02C98 /* Mailbox 4 Identifier Low Register */
696#define CAN_MB04_ID1 0xFFC02C9C /* Mailbox 4 Identifier High Register */
697
698#define CAN_MB05_DATA0 0xFFC02CA0 /* Mailbox 5 Data Word 0 [15:0] Register */
699#define CAN_MB05_DATA1 0xFFC02CA4 /* Mailbox 5 Data Word 1 [31:16] Register */
700#define CAN_MB05_DATA2 0xFFC02CA8 /* Mailbox 5 Data Word 2 [47:32] Register */
701#define CAN_MB05_DATA3 0xFFC02CAC /* Mailbox 5 Data Word 3 [63:48] Register */
702#define CAN_MB05_LENGTH 0xFFC02CB0 /* Mailbox 5 Data Length Code Register */
703#define CAN_MB05_TIMESTAMP 0xFFC02CB4 /* Mailbox 5 Time Stamp Value Register */
704#define CAN_MB05_ID0 0xFFC02CB8 /* Mailbox 5 Identifier Low Register */
705#define CAN_MB05_ID1 0xFFC02CBC /* Mailbox 5 Identifier High Register */
706
707#define CAN_MB06_DATA0 0xFFC02CC0 /* Mailbox 6 Data Word 0 [15:0] Register */
708#define CAN_MB06_DATA1 0xFFC02CC4 /* Mailbox 6 Data Word 1 [31:16] Register */
709#define CAN_MB06_DATA2 0xFFC02CC8 /* Mailbox 6 Data Word 2 [47:32] Register */
710#define CAN_MB06_DATA3 0xFFC02CCC /* Mailbox 6 Data Word 3 [63:48] Register */
711#define CAN_MB06_LENGTH 0xFFC02CD0 /* Mailbox 6 Data Length Code Register */
712#define CAN_MB06_TIMESTAMP 0xFFC02CD4 /* Mailbox 6 Time Stamp Value Register */
713#define CAN_MB06_ID0 0xFFC02CD8 /* Mailbox 6 Identifier Low Register */
714#define CAN_MB06_ID1 0xFFC02CDC /* Mailbox 6 Identifier High Register */
715
716#define CAN_MB07_DATA0 0xFFC02CE0 /* Mailbox 7 Data Word 0 [15:0] Register */
717#define CAN_MB07_DATA1 0xFFC02CE4 /* Mailbox 7 Data Word 1 [31:16] Register */
718#define CAN_MB07_DATA2 0xFFC02CE8 /* Mailbox 7 Data Word 2 [47:32] Register */
719#define CAN_MB07_DATA3 0xFFC02CEC /* Mailbox 7 Data Word 3 [63:48] Register */
720#define CAN_MB07_LENGTH 0xFFC02CF0 /* Mailbox 7 Data Length Code Register */
721#define CAN_MB07_TIMESTAMP 0xFFC02CF4 /* Mailbox 7 Time Stamp Value Register */
722#define CAN_MB07_ID0 0xFFC02CF8 /* Mailbox 7 Identifier Low Register */
723#define CAN_MB07_ID1 0xFFC02CFC /* Mailbox 7 Identifier High Register */
724
725#define CAN_MB08_DATA0 0xFFC02D00 /* Mailbox 8 Data Word 0 [15:0] Register */
726#define CAN_MB08_DATA1 0xFFC02D04 /* Mailbox 8 Data Word 1 [31:16] Register */
727#define CAN_MB08_DATA2 0xFFC02D08 /* Mailbox 8 Data Word 2 [47:32] Register */
728#define CAN_MB08_DATA3 0xFFC02D0C /* Mailbox 8 Data Word 3 [63:48] Register */
729#define CAN_MB08_LENGTH 0xFFC02D10 /* Mailbox 8 Data Length Code Register */
730#define CAN_MB08_TIMESTAMP 0xFFC02D14 /* Mailbox 8 Time Stamp Value Register */
731#define CAN_MB08_ID0 0xFFC02D18 /* Mailbox 8 Identifier Low Register */
732#define CAN_MB08_ID1 0xFFC02D1C /* Mailbox 8 Identifier High Register */
733
734#define CAN_MB09_DATA0 0xFFC02D20 /* Mailbox 9 Data Word 0 [15:0] Register */
735#define CAN_MB09_DATA1 0xFFC02D24 /* Mailbox 9 Data Word 1 [31:16] Register */
736#define CAN_MB09_DATA2 0xFFC02D28 /* Mailbox 9 Data Word 2 [47:32] Register */
737#define CAN_MB09_DATA3 0xFFC02D2C /* Mailbox 9 Data Word 3 [63:48] Register */
738#define CAN_MB09_LENGTH 0xFFC02D30 /* Mailbox 9 Data Length Code Register */
739#define CAN_MB09_TIMESTAMP 0xFFC02D34 /* Mailbox 9 Time Stamp Value Register */
740#define CAN_MB09_ID0 0xFFC02D38 /* Mailbox 9 Identifier Low Register */
741#define CAN_MB09_ID1 0xFFC02D3C /* Mailbox 9 Identifier High Register */
742
743#define CAN_MB10_DATA0 0xFFC02D40 /* Mailbox 10 Data Word 0 [15:0] Register */
744#define CAN_MB10_DATA1 0xFFC02D44 /* Mailbox 10 Data Word 1 [31:16] Register */
745#define CAN_MB10_DATA2 0xFFC02D48 /* Mailbox 10 Data Word 2 [47:32] Register */
746#define CAN_MB10_DATA3 0xFFC02D4C /* Mailbox 10 Data Word 3 [63:48] Register */
747#define CAN_MB10_LENGTH 0xFFC02D50 /* Mailbox 10 Data Length Code Register */
748#define CAN_MB10_TIMESTAMP 0xFFC02D54 /* Mailbox 10 Time Stamp Value Register */
749#define CAN_MB10_ID0 0xFFC02D58 /* Mailbox 10 Identifier Low Register */
750#define CAN_MB10_ID1 0xFFC02D5C /* Mailbox 10 Identifier High Register */
751
752#define CAN_MB11_DATA0 0xFFC02D60 /* Mailbox 11 Data Word 0 [15:0] Register */
753#define CAN_MB11_DATA1 0xFFC02D64 /* Mailbox 11 Data Word 1 [31:16] Register */
754#define CAN_MB11_DATA2 0xFFC02D68 /* Mailbox 11 Data Word 2 [47:32] Register */
755#define CAN_MB11_DATA3 0xFFC02D6C /* Mailbox 11 Data Word 3 [63:48] Register */
756#define CAN_MB11_LENGTH 0xFFC02D70 /* Mailbox 11 Data Length Code Register */
757#define CAN_MB11_TIMESTAMP 0xFFC02D74 /* Mailbox 11 Time Stamp Value Register */
758#define CAN_MB11_ID0 0xFFC02D78 /* Mailbox 11 Identifier Low Register */
759#define CAN_MB11_ID1 0xFFC02D7C /* Mailbox 11 Identifier High Register */
760
761#define CAN_MB12_DATA0 0xFFC02D80 /* Mailbox 12 Data Word 0 [15:0] Register */
762#define CAN_MB12_DATA1 0xFFC02D84 /* Mailbox 12 Data Word 1 [31:16] Register */
763#define CAN_MB12_DATA2 0xFFC02D88 /* Mailbox 12 Data Word 2 [47:32] Register */
764#define CAN_MB12_DATA3 0xFFC02D8C /* Mailbox 12 Data Word 3 [63:48] Register */
765#define CAN_MB12_LENGTH 0xFFC02D90 /* Mailbox 12 Data Length Code Register */
766#define CAN_MB12_TIMESTAMP 0xFFC02D94 /* Mailbox 12 Time Stamp Value Register */
767#define CAN_MB12_ID0 0xFFC02D98 /* Mailbox 12 Identifier Low Register */
768#define CAN_MB12_ID1 0xFFC02D9C /* Mailbox 12 Identifier High Register */
769
770#define CAN_MB13_DATA0 0xFFC02DA0 /* Mailbox 13 Data Word 0 [15:0] Register */
771#define CAN_MB13_DATA1 0xFFC02DA4 /* Mailbox 13 Data Word 1 [31:16] Register */
772#define CAN_MB13_DATA2 0xFFC02DA8 /* Mailbox 13 Data Word 2 [47:32] Register */
773#define CAN_MB13_DATA3 0xFFC02DAC /* Mailbox 13 Data Word 3 [63:48] Register */
774#define CAN_MB13_LENGTH 0xFFC02DB0 /* Mailbox 13 Data Length Code Register */
775#define CAN_MB13_TIMESTAMP 0xFFC02DB4 /* Mailbox 13 Time Stamp Value Register */
776#define CAN_MB13_ID0 0xFFC02DB8 /* Mailbox 13 Identifier Low Register */
777#define CAN_MB13_ID1 0xFFC02DBC /* Mailbox 13 Identifier High Register */
778
779#define CAN_MB14_DATA0 0xFFC02DC0 /* Mailbox 14 Data Word 0 [15:0] Register */
780#define CAN_MB14_DATA1 0xFFC02DC4 /* Mailbox 14 Data Word 1 [31:16] Register */
781#define CAN_MB14_DATA2 0xFFC02DC8 /* Mailbox 14 Data Word 2 [47:32] Register */
782#define CAN_MB14_DATA3 0xFFC02DCC /* Mailbox 14 Data Word 3 [63:48] Register */
783#define CAN_MB14_LENGTH 0xFFC02DD0 /* Mailbox 14 Data Length Code Register */
784#define CAN_MB14_TIMESTAMP 0xFFC02DD4 /* Mailbox 14 Time Stamp Value Register */
785#define CAN_MB14_ID0 0xFFC02DD8 /* Mailbox 14 Identifier Low Register */
786#define CAN_MB14_ID1 0xFFC02DDC /* Mailbox 14 Identifier High Register */
787
788#define CAN_MB15_DATA0 0xFFC02DE0 /* Mailbox 15 Data Word 0 [15:0] Register */
789#define CAN_MB15_DATA1 0xFFC02DE4 /* Mailbox 15 Data Word 1 [31:16] Register */
790#define CAN_MB15_DATA2 0xFFC02DE8 /* Mailbox 15 Data Word 2 [47:32] Register */
791#define CAN_MB15_DATA3 0xFFC02DEC /* Mailbox 15 Data Word 3 [63:48] Register */
792#define CAN_MB15_LENGTH 0xFFC02DF0 /* Mailbox 15 Data Length Code Register */
793#define CAN_MB15_TIMESTAMP 0xFFC02DF4 /* Mailbox 15 Time Stamp Value Register */
794#define CAN_MB15_ID0 0xFFC02DF8 /* Mailbox 15 Identifier Low Register */
795#define CAN_MB15_ID1 0xFFC02DFC /* Mailbox 15 Identifier High Register */
796
797#define CAN_MB16_DATA0 0xFFC02E00 /* Mailbox 16 Data Word 0 [15:0] Register */
798#define CAN_MB16_DATA1 0xFFC02E04 /* Mailbox 16 Data Word 1 [31:16] Register */
799#define CAN_MB16_DATA2 0xFFC02E08 /* Mailbox 16 Data Word 2 [47:32] Register */
800#define CAN_MB16_DATA3 0xFFC02E0C /* Mailbox 16 Data Word 3 [63:48] Register */
801#define CAN_MB16_LENGTH 0xFFC02E10 /* Mailbox 16 Data Length Code Register */
802#define CAN_MB16_TIMESTAMP 0xFFC02E14 /* Mailbox 16 Time Stamp Value Register */
803#define CAN_MB16_ID0 0xFFC02E18 /* Mailbox 16 Identifier Low Register */
804#define CAN_MB16_ID1 0xFFC02E1C /* Mailbox 16 Identifier High Register */
805
806#define CAN_MB17_DATA0 0xFFC02E20 /* Mailbox 17 Data Word 0 [15:0] Register */
807#define CAN_MB17_DATA1 0xFFC02E24 /* Mailbox 17 Data Word 1 [31:16] Register */
808#define CAN_MB17_DATA2 0xFFC02E28 /* Mailbox 17 Data Word 2 [47:32] Register */
809#define CAN_MB17_DATA3 0xFFC02E2C /* Mailbox 17 Data Word 3 [63:48] Register */
810#define CAN_MB17_LENGTH 0xFFC02E30 /* Mailbox 17 Data Length Code Register */
811#define CAN_MB17_TIMESTAMP 0xFFC02E34 /* Mailbox 17 Time Stamp Value Register */
812#define CAN_MB17_ID0 0xFFC02E38 /* Mailbox 17 Identifier Low Register */
813#define CAN_MB17_ID1 0xFFC02E3C /* Mailbox 17 Identifier High Register */
814
815#define CAN_MB18_DATA0 0xFFC02E40 /* Mailbox 18 Data Word 0 [15:0] Register */
816#define CAN_MB18_DATA1 0xFFC02E44 /* Mailbox 18 Data Word 1 [31:16] Register */
817#define CAN_MB18_DATA2 0xFFC02E48 /* Mailbox 18 Data Word 2 [47:32] Register */
818#define CAN_MB18_DATA3 0xFFC02E4C /* Mailbox 18 Data Word 3 [63:48] Register */
819#define CAN_MB18_LENGTH 0xFFC02E50 /* Mailbox 18 Data Length Code Register */
820#define CAN_MB18_TIMESTAMP 0xFFC02E54 /* Mailbox 18 Time Stamp Value Register */
821#define CAN_MB18_ID0 0xFFC02E58 /* Mailbox 18 Identifier Low Register */
822#define CAN_MB18_ID1 0xFFC02E5C /* Mailbox 18 Identifier High Register */
823
824#define CAN_MB19_DATA0 0xFFC02E60 /* Mailbox 19 Data Word 0 [15:0] Register */
825#define CAN_MB19_DATA1 0xFFC02E64 /* Mailbox 19 Data Word 1 [31:16] Register */
826#define CAN_MB19_DATA2 0xFFC02E68 /* Mailbox 19 Data Word 2 [47:32] Register */
827#define CAN_MB19_DATA3 0xFFC02E6C /* Mailbox 19 Data Word 3 [63:48] Register */
828#define CAN_MB19_LENGTH 0xFFC02E70 /* Mailbox 19 Data Length Code Register */
829#define CAN_MB19_TIMESTAMP 0xFFC02E74 /* Mailbox 19 Time Stamp Value Register */
830#define CAN_MB19_ID0 0xFFC02E78 /* Mailbox 19 Identifier Low Register */
831#define CAN_MB19_ID1 0xFFC02E7C /* Mailbox 19 Identifier High Register */
832
833#define CAN_MB20_DATA0 0xFFC02E80 /* Mailbox 20 Data Word 0 [15:0] Register */
834#define CAN_MB20_DATA1 0xFFC02E84 /* Mailbox 20 Data Word 1 [31:16] Register */
835#define CAN_MB20_DATA2 0xFFC02E88 /* Mailbox 20 Data Word 2 [47:32] Register */
836#define CAN_MB20_DATA3 0xFFC02E8C /* Mailbox 20 Data Word 3 [63:48] Register */
837#define CAN_MB20_LENGTH 0xFFC02E90 /* Mailbox 20 Data Length Code Register */
838#define CAN_MB20_TIMESTAMP 0xFFC02E94 /* Mailbox 20 Time Stamp Value Register */
839#define CAN_MB20_ID0 0xFFC02E98 /* Mailbox 20 Identifier Low Register */
840#define CAN_MB20_ID1 0xFFC02E9C /* Mailbox 20 Identifier High Register */
841
842#define CAN_MB21_DATA0 0xFFC02EA0 /* Mailbox 21 Data Word 0 [15:0] Register */
843#define CAN_MB21_DATA1 0xFFC02EA4 /* Mailbox 21 Data Word 1 [31:16] Register */
844#define CAN_MB21_DATA2 0xFFC02EA8 /* Mailbox 21 Data Word 2 [47:32] Register */
845#define CAN_MB21_DATA3 0xFFC02EAC /* Mailbox 21 Data Word 3 [63:48] Register */
846#define CAN_MB21_LENGTH 0xFFC02EB0 /* Mailbox 21 Data Length Code Register */
847#define CAN_MB21_TIMESTAMP 0xFFC02EB4 /* Mailbox 21 Time Stamp Value Register */
848#define CAN_MB21_ID0 0xFFC02EB8 /* Mailbox 21 Identifier Low Register */
849#define CAN_MB21_ID1 0xFFC02EBC /* Mailbox 21 Identifier High Register */
850
851#define CAN_MB22_DATA0 0xFFC02EC0 /* Mailbox 22 Data Word 0 [15:0] Register */
852#define CAN_MB22_DATA1 0xFFC02EC4 /* Mailbox 22 Data Word 1 [31:16] Register */
853#define CAN_MB22_DATA2 0xFFC02EC8 /* Mailbox 22 Data Word 2 [47:32] Register */
854#define CAN_MB22_DATA3 0xFFC02ECC /* Mailbox 22 Data Word 3 [63:48] Register */
855#define CAN_MB22_LENGTH 0xFFC02ED0 /* Mailbox 22 Data Length Code Register */
856#define CAN_MB22_TIMESTAMP 0xFFC02ED4 /* Mailbox 22 Time Stamp Value Register */
857#define CAN_MB22_ID0 0xFFC02ED8 /* Mailbox 22 Identifier Low Register */
858#define CAN_MB22_ID1 0xFFC02EDC /* Mailbox 22 Identifier High Register */
859
860#define CAN_MB23_DATA0 0xFFC02EE0 /* Mailbox 23 Data Word 0 [15:0] Register */
861#define CAN_MB23_DATA1 0xFFC02EE4 /* Mailbox 23 Data Word 1 [31:16] Register */
862#define CAN_MB23_DATA2 0xFFC02EE8 /* Mailbox 23 Data Word 2 [47:32] Register */
863#define CAN_MB23_DATA3 0xFFC02EEC /* Mailbox 23 Data Word 3 [63:48] Register */
864#define CAN_MB23_LENGTH 0xFFC02EF0 /* Mailbox 23 Data Length Code Register */
865#define CAN_MB23_TIMESTAMP 0xFFC02EF4 /* Mailbox 23 Time Stamp Value Register */
866#define CAN_MB23_ID0 0xFFC02EF8 /* Mailbox 23 Identifier Low Register */
867#define CAN_MB23_ID1 0xFFC02EFC /* Mailbox 23 Identifier High Register */
868
869#define CAN_MB24_DATA0 0xFFC02F00 /* Mailbox 24 Data Word 0 [15:0] Register */
870#define CAN_MB24_DATA1 0xFFC02F04 /* Mailbox 24 Data Word 1 [31:16] Register */
871#define CAN_MB24_DATA2 0xFFC02F08 /* Mailbox 24 Data Word 2 [47:32] Register */
872#define CAN_MB24_DATA3 0xFFC02F0C /* Mailbox 24 Data Word 3 [63:48] Register */
873#define CAN_MB24_LENGTH 0xFFC02F10 /* Mailbox 24 Data Length Code Register */
874#define CAN_MB24_TIMESTAMP 0xFFC02F14 /* Mailbox 24 Time Stamp Value Register */
875#define CAN_MB24_ID0 0xFFC02F18 /* Mailbox 24 Identifier Low Register */
876#define CAN_MB24_ID1 0xFFC02F1C /* Mailbox 24 Identifier High Register */
877
878#define CAN_MB25_DATA0 0xFFC02F20 /* Mailbox 25 Data Word 0 [15:0] Register */
879#define CAN_MB25_DATA1 0xFFC02F24 /* Mailbox 25 Data Word 1 [31:16] Register */
880#define CAN_MB25_DATA2 0xFFC02F28 /* Mailbox 25 Data Word 2 [47:32] Register */
881#define CAN_MB25_DATA3 0xFFC02F2C /* Mailbox 25 Data Word 3 [63:48] Register */
882#define CAN_MB25_LENGTH 0xFFC02F30 /* Mailbox 25 Data Length Code Register */
883#define CAN_MB25_TIMESTAMP 0xFFC02F34 /* Mailbox 25 Time Stamp Value Register */
884#define CAN_MB25_ID0 0xFFC02F38 /* Mailbox 25 Identifier Low Register */
885#define CAN_MB25_ID1 0xFFC02F3C /* Mailbox 25 Identifier High Register */
886
887#define CAN_MB26_DATA0 0xFFC02F40 /* Mailbox 26 Data Word 0 [15:0] Register */
888#define CAN_MB26_DATA1 0xFFC02F44 /* Mailbox 26 Data Word 1 [31:16] Register */
889#define CAN_MB26_DATA2 0xFFC02F48 /* Mailbox 26 Data Word 2 [47:32] Register */
890#define CAN_MB26_DATA3 0xFFC02F4C /* Mailbox 26 Data Word 3 [63:48] Register */
891#define CAN_MB26_LENGTH 0xFFC02F50 /* Mailbox 26 Data Length Code Register */
892#define CAN_MB26_TIMESTAMP 0xFFC02F54 /* Mailbox 26 Time Stamp Value Register */
893#define CAN_MB26_ID0 0xFFC02F58 /* Mailbox 26 Identifier Low Register */
894#define CAN_MB26_ID1 0xFFC02F5C /* Mailbox 26 Identifier High Register */
895
896#define CAN_MB27_DATA0 0xFFC02F60 /* Mailbox 27 Data Word 0 [15:0] Register */
897#define CAN_MB27_DATA1 0xFFC02F64 /* Mailbox 27 Data Word 1 [31:16] Register */
898#define CAN_MB27_DATA2 0xFFC02F68 /* Mailbox 27 Data Word 2 [47:32] Register */
899#define CAN_MB27_DATA3 0xFFC02F6C /* Mailbox 27 Data Word 3 [63:48] Register */
900#define CAN_MB27_LENGTH 0xFFC02F70 /* Mailbox 27 Data Length Code Register */
901#define CAN_MB27_TIMESTAMP 0xFFC02F74 /* Mailbox 27 Time Stamp Value Register */
902#define CAN_MB27_ID0 0xFFC02F78 /* Mailbox 27 Identifier Low Register */
903#define CAN_MB27_ID1 0xFFC02F7C /* Mailbox 27 Identifier High Register */
904
905#define CAN_MB28_DATA0 0xFFC02F80 /* Mailbox 28 Data Word 0 [15:0] Register */
906#define CAN_MB28_DATA1 0xFFC02F84 /* Mailbox 28 Data Word 1 [31:16] Register */
907#define CAN_MB28_DATA2 0xFFC02F88 /* Mailbox 28 Data Word 2 [47:32] Register */
908#define CAN_MB28_DATA3 0xFFC02F8C /* Mailbox 28 Data Word 3 [63:48] Register */
909#define CAN_MB28_LENGTH 0xFFC02F90 /* Mailbox 28 Data Length Code Register */
910#define CAN_MB28_TIMESTAMP 0xFFC02F94 /* Mailbox 28 Time Stamp Value Register */
911#define CAN_MB28_ID0 0xFFC02F98 /* Mailbox 28 Identifier Low Register */
912#define CAN_MB28_ID1 0xFFC02F9C /* Mailbox 28 Identifier High Register */
913
914#define CAN_MB29_DATA0 0xFFC02FA0 /* Mailbox 29 Data Word 0 [15:0] Register */
915#define CAN_MB29_DATA1 0xFFC02FA4 /* Mailbox 29 Data Word 1 [31:16] Register */
916#define CAN_MB29_DATA2 0xFFC02FA8 /* Mailbox 29 Data Word 2 [47:32] Register */
917#define CAN_MB29_DATA3 0xFFC02FAC /* Mailbox 29 Data Word 3 [63:48] Register */
918#define CAN_MB29_LENGTH 0xFFC02FB0 /* Mailbox 29 Data Length Code Register */
919#define CAN_MB29_TIMESTAMP 0xFFC02FB4 /* Mailbox 29 Time Stamp Value Register */
920#define CAN_MB29_ID0 0xFFC02FB8 /* Mailbox 29 Identifier Low Register */
921#define CAN_MB29_ID1 0xFFC02FBC /* Mailbox 29 Identifier High Register */
922
923#define CAN_MB30_DATA0 0xFFC02FC0 /* Mailbox 30 Data Word 0 [15:0] Register */
924#define CAN_MB30_DATA1 0xFFC02FC4 /* Mailbox 30 Data Word 1 [31:16] Register */
925#define CAN_MB30_DATA2 0xFFC02FC8 /* Mailbox 30 Data Word 2 [47:32] Register */
926#define CAN_MB30_DATA3 0xFFC02FCC /* Mailbox 30 Data Word 3 [63:48] Register */
927#define CAN_MB30_LENGTH 0xFFC02FD0 /* Mailbox 30 Data Length Code Register */
928#define CAN_MB30_TIMESTAMP 0xFFC02FD4 /* Mailbox 30 Time Stamp Value Register */
929#define CAN_MB30_ID0 0xFFC02FD8 /* Mailbox 30 Identifier Low Register */
930#define CAN_MB30_ID1 0xFFC02FDC /* Mailbox 30 Identifier High Register */
931
932#define CAN_MB31_DATA0 0xFFC02FE0 /* Mailbox 31 Data Word 0 [15:0] Register */
933#define CAN_MB31_DATA1 0xFFC02FE4 /* Mailbox 31 Data Word 1 [31:16] Register */
934#define CAN_MB31_DATA2 0xFFC02FE8 /* Mailbox 31 Data Word 2 [47:32] Register */
935#define CAN_MB31_DATA3 0xFFC02FEC /* Mailbox 31 Data Word 3 [63:48] Register */
936#define CAN_MB31_LENGTH 0xFFC02FF0 /* Mailbox 31 Data Length Code Register */
937#define CAN_MB31_TIMESTAMP 0xFFC02FF4 /* Mailbox 31 Time Stamp Value Register */
938#define CAN_MB31_ID0 0xFFC02FF8 /* Mailbox 31 Identifier Low Register */
939#define CAN_MB31_ID1 0xFFC02FFC /* Mailbox 31 Identifier High Register */
940
941/* CAN Mailbox Area Macros */
942#define CAN_MB_ID1(x) (CAN_MB00_ID1+((x)*0x20))
943#define CAN_MB_ID0(x) (CAN_MB00_ID0+((x)*0x20))
944#define CAN_MB_TIMESTAMP(x) (CAN_MB00_TIMESTAMP+((x)*0x20))
945#define CAN_MB_LENGTH(x) (CAN_MB00_LENGTH+((x)*0x20))
946#define CAN_MB_DATA3(x) (CAN_MB00_DATA3+((x)*0x20))
947#define CAN_MB_DATA2(x) (CAN_MB00_DATA2+((x)*0x20))
948#define CAN_MB_DATA1(x) (CAN_MB00_DATA1+((x)*0x20))
949#define CAN_MB_DATA0(x) (CAN_MB00_DATA0+((x)*0x20))
950
951/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
952#define PORTF_FER 0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
953#define PORTG_FER 0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
954#define PORTH_FER 0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
955#define BFIN_PORT_MUX 0xFFC0320C /* Port Multiplexer Control Register */
956
957/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
958#define HMDMA0_CONTROL 0xFFC03300 /* Handshake MDMA0 Control Register */
959#define HMDMA0_ECINIT 0xFFC03304 /* HMDMA0 Initial Edge Count Register */
960#define HMDMA0_BCINIT 0xFFC03308 /* HMDMA0 Initial Block Count Register */
961#define HMDMA0_ECURGENT 0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
962#define HMDMA0_ECOVERFLOW 0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
963#define HMDMA0_ECOUNT 0xFFC03314 /* HMDMA0 Current Edge Count Register */
964#define HMDMA0_BCOUNT 0xFFC03318 /* HMDMA0 Current Block Count Register */
965
966#define HMDMA1_CONTROL 0xFFC03340 /* Handshake MDMA1 Control Register */
967#define HMDMA1_ECINIT 0xFFC03344 /* HMDMA1 Initial Edge Count Register */
968#define HMDMA1_BCINIT 0xFFC03348 /* HMDMA1 Initial Block Count Register */
969#define HMDMA1_ECURGENT 0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
970#define HMDMA1_ECOVERFLOW 0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
971#define HMDMA1_ECOUNT 0xFFC03354 /* HMDMA1 Current Edge Count Register */
972#define HMDMA1_BCOUNT 0xFFC03358 /* HMDMA1 Current Block Count Register */
973
974/***********************************************************************************
975** System MMR Register Bits And Macros
976**
977** Disclaimer: All macros are intended to make C and Assembly code more readable.
978** Use these macros carefully, as any that do left shifts for field
979** depositing will result in the lower order bits being destroyed. Any
980** macro that shifts left to properly position the bit-field should be
981** used as part of an OR to initialize a register and NOT as a dynamic
982** modifier UNLESS the lower order bits are saved and ORed back in when
983** the macro is used.
984*************************************************************************************/
985/*
986** ********************* PLL AND RESET MASKS ****************************************/
987/* PLL_CTL Masks */
988#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
989#define PLL_OFF 0x0002 /* PLL Not Powered */
990#define STOPCK 0x0008 /* Core Clock Off */
991#define PDWN 0x0020 /* Enter Deep Sleep Mode */
992#define IN_DELAY 0x0040 /* Add 200ps Delay To EBIU Input Latches */
993#define OUT_DELAY 0x0080 /* Add 200ps Delay To EBIU Output Signals */
994#define BYPASS 0x0100 /* Bypass the PLL */
995#define MSEL 0x7E00 /* Multiplier Select For CCLK/VCO Factors */
996/* PLL_CTL Macros (Only Use With Logic OR While Setting Lower Order Bits) */
997#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
998
999/* PLL_DIV Masks */
1000#define SSEL 0x000F /* System Select */
1001#define CSEL 0x0030 /* Core Select */
1002#define CSEL_DIV1 0x0000 /* CCLK = VCO / 1 */
1003#define CSEL_DIV2 0x0010 /* CCLK = VCO / 2 */
1004#define CSEL_DIV4 0x0020 /* CCLK = VCO / 4 */
1005#define CSEL_DIV8 0x0030 /* CCLK = VCO / 8 */
1006/* PLL_DIV Macros */
1007#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
1008
1009/* VR_CTL Masks */
1010#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
1011#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
1012#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
1013#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
1014#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
1015
1016#define GAIN 0x000C /* Voltage Level Gain */
1017#define GAIN_5 0x0000 /* GAIN = 5 */
1018#define GAIN_10 0x0004 /* GAIN = 10 */
1019#define GAIN_20 0x0008 /* GAIN = 20 */
1020#define GAIN_50 0x000C /* GAIN = 50 */
1021
1022#define VLEV 0x00F0 /* Internal Voltage Level */
1023#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
1024#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
1025#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
1026#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
1027#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
1028#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
1029#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
1030#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
1031#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
1032#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
1033
1034#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
1035#define CANWE 0x0200 /* Enable CAN Wakeup From Hibernate */
1036#define PHYWE 0x0400 /* Enable PHY Wakeup From Hibernate */
1037#define CLKBUFOE 0x4000 /* CLKIN Buffer Output Enable */
1038#define PHYCLKOE CLKBUFOE /* Alternative legacy name for the above */
1039#define SCKELOW 0x8000 /* Enable Drive CKE Low During Reset */
1040
1041/* PLL_STAT Masks */
1042#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
1043#define FULL_ON 0x0002 /* Processor In Full On Mode */
1044#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
1045#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
1046
1047/* CHIPID Masks */
1048#define CHIPID_VERSION 0xF0000000
1049#define CHIPID_FAMILY 0x0FFFF000
1050#define CHIPID_MANUFACTURE 0x00000FFE
1051
1052/* SWRST Masks */
1053#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
1054#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
1055#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
1056#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
1057#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
1058
1059/* SYSCR Masks */
1060#define BMODE 0x0007 /* Boot Mode - Latched During HW Reset From Mode Pins */
1061#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
1062
1063/* ************* SYSTEM INTERRUPT CONTROLLER MASKS *************************************/
1064
1065/* SIC_IAR0 Macros */
1066#define P0_IVG(x) (((x)&0xF)-7) /* Peripheral #0 assigned IVG #x */
1067#define P1_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #1 assigned IVG #x */
1068#define P2_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #2 assigned IVG #x */
1069#define P3_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #3 assigned IVG #x */
1070#define P4_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #4 assigned IVG #x */
1071#define P5_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #5 assigned IVG #x */
1072#define P6_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #6 assigned IVG #x */
1073#define P7_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #7 assigned IVG #x */
1074
1075/* SIC_IAR1 Macros */
1076#define P8_IVG(x) (((x)&0xF)-7) /* Peripheral #8 assigned IVG #x */
1077#define P9_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #9 assigned IVG #x */
1078#define P10_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #10 assigned IVG #x */
1079#define P11_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #11 assigned IVG #x */
1080#define P12_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #12 assigned IVG #x */
1081#define P13_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #13 assigned IVG #x */
1082#define P14_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #14 assigned IVG #x */
1083#define P15_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #15 assigned IVG #x */
1084
1085/* SIC_IAR2 Macros */
1086#define P16_IVG(x) (((x)&0xF)-7) /* Peripheral #16 assigned IVG #x */
1087#define P17_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #17 assigned IVG #x */
1088#define P18_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #18 assigned IVG #x */
1089#define P19_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #19 assigned IVG #x */
1090#define P20_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #20 assigned IVG #x */
1091#define P21_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #21 assigned IVG #x */
1092#define P22_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #22 assigned IVG #x */
1093#define P23_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #23 assigned IVG #x */
1094
1095/* SIC_IAR3 Macros */
1096#define P24_IVG(x) (((x)&0xF)-7) /* Peripheral #24 assigned IVG #x */
1097#define P25_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #25 assigned IVG #x */
1098#define P26_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #26 assigned IVG #x */
1099#define P27_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #27 assigned IVG #x */
1100#define P28_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #28 assigned IVG #x */
1101#define P29_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #29 assigned IVG #x */
1102#define P30_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #30 assigned IVG #x */
1103#define P31_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #31 assigned IVG #x */
1104
1105/* SIC_IMASK Masks */
1106#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
1107#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
1108#define SIC_MASK(x) (1 << ((x)&0x1F)) /* Mask Peripheral #x interrupt */
1109#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Unmask Peripheral #x interrupt */
1110
1111/* SIC_IWR Masks */
1112#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
1113#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
1114#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */
1115#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */
1116
1117/* ************** UART CONTROLLER MASKS *************************/
1118/* UARTx_LCR Masks */
1119#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
1120#define STB 0x04 /* Stop Bits */
1121#define PEN 0x08 /* Parity Enable */
1122#define EPS 0x10 /* Even Parity Select */
1123#define STP 0x20 /* Stick Parity */
1124#define SB 0x40 /* Set Break */
1125#define DLAB 0x80 /* Divisor Latch Access */
1126
1127/* UARTx_MCR Mask */
1128#define LOOP_ENA 0x10 /* Loopback Mode Enable */
1129#define LOOP_ENA_P 0x04
1130/* UARTx_LSR Masks */
1131#define DR 0x01 /* Data Ready */
1132#define OE 0x02 /* Overrun Error */
1133#define PE 0x04 /* Parity Error */
1134#define FE 0x08 /* Framing Error */
1135#define BI 0x10 /* Break Interrupt */
1136#define THRE 0x20 /* THR Empty */
1137#define TEMT 0x40 /* TSR and UART_THR Empty */
1138
1139/* UARTx_IER Masks */
1140#define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */
1141#define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */
1142#define ELSI 0x04 /* Enable RX Status Interrupt */
1143
1144/* UARTx_IIR Masks */
1145#define NINT 0x01 /* Pending Interrupt */
1146#define IIR_TX_READY 0x02 /* UART_THR empty */
1147#define IIR_RX_READY 0x04 /* Receive data ready */
1148#define IIR_LINE_CHANGE 0x06 /* Receive line status */
1149#define IIR_STATUS 0x06
1150
1151/* UARTx_GCTL Masks */
1152#define UCEN 0x01 /* Enable UARTx Clocks */
1153#define IREN 0x02 /* Enable IrDA Mode */
1154#define TPOLC 0x04 /* IrDA TX Polarity Change */
1155#define RPOLC 0x08 /* IrDA RX Polarity Change */
1156#define FPE 0x10 /* Force Parity Error On Transmit */
1157#define FFE 0x20 /* Force Framing Error On Transmit */
1158
1159/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS ****************************/
1160/* SPI_CTL Masks */
1161#define TIMOD 0x0003 /* Transfer Initiate Mode */
1162#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
1163#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
1164#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
1165#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
1166#define SZ 0x0004 /* Send Zero (When TDBR Empty, Send Zero/Last*) */
1167#define GM 0x0008 /* Get More (When RDBR Full, Overwrite/Discard*) */
1168#define PSSE 0x0010 /* Slave-Select Input Enable */
1169#define EMISO 0x0020 /* Enable MISO As Output */
1170#define SIZE 0x0100 /* Size of Words (16/8* Bits) */
1171#define LSBF 0x0200 /* LSB First */
1172#define CPHA 0x0400 /* Clock Phase */
1173#define CPOL 0x0800 /* Clock Polarity */
1174#define MSTR 0x1000 /* Master/Slave* */
1175#define WOM 0x2000 /* Write Open Drain Master */
1176#define SPE 0x4000 /* SPI Enable */
1177
1178/* SPI_FLG Masks */
1179#define FLS1 0x0002 /* Enables SPI_FLOUT1 as SPI Slave-Select Output */
1180#define FLS2 0x0004 /* Enables SPI_FLOUT2 as SPI Slave-Select Output */
1181#define FLS3 0x0008 /* Enables SPI_FLOUT3 as SPI Slave-Select Output */
1182#define FLS4 0x0010 /* Enables SPI_FLOUT4 as SPI Slave-Select Output */
1183#define FLS5 0x0020 /* Enables SPI_FLOUT5 as SPI Slave-Select Output */
1184#define FLS6 0x0040 /* Enables SPI_FLOUT6 as SPI Slave-Select Output */
1185#define FLS7 0x0080 /* Enables SPI_FLOUT7 as SPI Slave-Select Output */
1186#define FLG1 0xFDFF /* Activates SPI_FLOUT1 */
1187#define FLG2 0xFBFF /* Activates SPI_FLOUT2 */
1188#define FLG3 0xF7FF /* Activates SPI_FLOUT3 */
1189#define FLG4 0xEFFF /* Activates SPI_FLOUT4 */
1190#define FLG5 0xDFFF /* Activates SPI_FLOUT5 */
1191#define FLG6 0xBFFF /* Activates SPI_FLOUT6 */
1192#define FLG7 0x7FFF /* Activates SPI_FLOUT7 */
1193
1194/* SPI_STAT Masks */
1195#define SPIF 0x0001 /* SPI Finished (Single-Word Transfer Complete) */
1196#define MODF 0x0002 /* Mode Fault Error (Another Device Tried To Become Master) */
1197#define TXE 0x0004 /* Transmission Error (Data Sent With No New Data In TDBR) */
1198#define TXS 0x0008 /* SPI_TDBR Data Buffer Status (Full/Empty*) */
1199#define RBSY 0x0010 /* Receive Error (Data Received With RDBR Full) */
1200#define RXS 0x0020 /* SPI_RDBR Data Buffer Status (Full/Empty*) */
1201#define TXCOL 0x0040 /* Transmit Collision Error (Corrupt Data May Have Been Sent) */
1202
1203/* **************** GENERAL PURPOSE TIMER MASKS **********************/
1204/* TIMER_ENABLE Masks */
1205#define TIMEN0 0x0001 /* Enable Timer 0 */
1206#define TIMEN1 0x0002 /* Enable Timer 1 */
1207#define TIMEN2 0x0004 /* Enable Timer 2 */
1208#define TIMEN3 0x0008 /* Enable Timer 3 */
1209#define TIMEN4 0x0010 /* Enable Timer 4 */
1210#define TIMEN5 0x0020 /* Enable Timer 5 */
1211#define TIMEN6 0x0040 /* Enable Timer 6 */
1212#define TIMEN7 0x0080 /* Enable Timer 7 */
1213
1214/* TIMER_DISABLE Masks */
1215#define TIMDIS0 TIMEN0 /* Disable Timer 0 */
1216#define TIMDIS1 TIMEN1 /* Disable Timer 1 */
1217#define TIMDIS2 TIMEN2 /* Disable Timer 2 */
1218#define TIMDIS3 TIMEN3 /* Disable Timer 3 */
1219#define TIMDIS4 TIMEN4 /* Disable Timer 4 */
1220#define TIMDIS5 TIMEN5 /* Disable Timer 5 */
1221#define TIMDIS6 TIMEN6 /* Disable Timer 6 */
1222#define TIMDIS7 TIMEN7 /* Disable Timer 7 */
1223
1224/* TIMER_STATUS Masks */
1225#define TIMIL0 0x00000001 /* Timer 0 Interrupt */
1226#define TIMIL1 0x00000002 /* Timer 1 Interrupt */
1227#define TIMIL2 0x00000004 /* Timer 2 Interrupt */
1228#define TIMIL3 0x00000008 /* Timer 3 Interrupt */
1229#define TOVF_ERR0 0x00000010 /* Timer 0 Counter Overflow */
1230#define TOVF_ERR1 0x00000020 /* Timer 1 Counter Overflow */
1231#define TOVF_ERR2 0x00000040 /* Timer 2 Counter Overflow */
1232#define TOVF_ERR3 0x00000080 /* Timer 3 Counter Overflow */
1233#define TRUN0 0x00001000 /* Timer 0 Slave Enable Status */
1234#define TRUN1 0x00002000 /* Timer 1 Slave Enable Status */
1235#define TRUN2 0x00004000 /* Timer 2 Slave Enable Status */
1236#define TRUN3 0x00008000 /* Timer 3 Slave Enable Status */
1237#define TIMIL4 0x00010000 /* Timer 4 Interrupt */
1238#define TIMIL5 0x00020000 /* Timer 5 Interrupt */
1239#define TIMIL6 0x00040000 /* Timer 6 Interrupt */
1240#define TIMIL7 0x00080000 /* Timer 7 Interrupt */
1241#define TOVF_ERR4 0x00100000 /* Timer 4 Counter Overflow */
1242#define TOVF_ERR5 0x00200000 /* Timer 5 Counter Overflow */
1243#define TOVF_ERR6 0x00400000 /* Timer 6 Counter Overflow */
1244#define TOVF_ERR7 0x00800000 /* Timer 7 Counter Overflow */
1245#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
1246#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
1247#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
1248#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
1249
1250/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
1251#define TOVL_ERR0 TOVF_ERR0
1252#define TOVL_ERR1 TOVF_ERR1
1253#define TOVL_ERR2 TOVF_ERR2
1254#define TOVL_ERR3 TOVF_ERR3
1255#define TOVL_ERR4 TOVF_ERR4
1256#define TOVL_ERR5 TOVF_ERR5
1257#define TOVL_ERR6 TOVF_ERR6
1258#define TOVL_ERR7 TOVF_ERR7
1259/* TIMERx_CONFIG Masks */
1260#define PWM_OUT 0x0001 /* Pulse-Width Modulation Output Mode */
1261#define WDTH_CAP 0x0002 /* Width Capture Input Mode */
1262#define EXT_CLK 0x0003 /* External Clock Mode */
1263#define PULSE_HI 0x0004 /* Action Pulse (Positive/Negative*) */
1264#define PERIOD_CNT 0x0008 /* Period Count */
1265#define IRQ_ENA 0x0010 /* Interrupt Request Enable */
1266#define TIN_SEL 0x0020 /* Timer Input Select */
1267#define OUT_DIS 0x0040 /* Output Pad Disable */
1268#define CLK_SEL 0x0080 /* Timer Clock Select */
1269#define TOGGLE_HI 0x0100 /* PWM_OUT PULSE_HI Toggle Mode */
1270#define EMU_RUN 0x0200 /* Emulation Behavior Select */
1271#define ERR_TYP 0xC000 /* Error Type */
1272
1273/* ****************** GPIO PORTS F, G, H MASKS ***********************/
1274/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
1275/* Port F Masks */
1276#define PF0 0x0001
1277#define PF1 0x0002
1278#define PF2 0x0004
1279#define PF3 0x0008
1280#define PF4 0x0010
1281#define PF5 0x0020
1282#define PF6 0x0040
1283#define PF7 0x0080
1284#define PF8 0x0100
1285#define PF9 0x0200
1286#define PF10 0x0400
1287#define PF11 0x0800
1288#define PF12 0x1000
1289#define PF13 0x2000
1290#define PF14 0x4000
1291#define PF15 0x8000
1292
1293/* Port G Masks */
1294#define PG0 0x0001
1295#define PG1 0x0002
1296#define PG2 0x0004
1297#define PG3 0x0008
1298#define PG4 0x0010
1299#define PG5 0x0020
1300#define PG6 0x0040
1301#define PG7 0x0080
1302#define PG8 0x0100
1303#define PG9 0x0200
1304#define PG10 0x0400
1305#define PG11 0x0800
1306#define PG12 0x1000
1307#define PG13 0x2000
1308#define PG14 0x4000
1309#define PG15 0x8000
1310
1311/* Port H Masks */
1312#define PH0 0x0001
1313#define PH1 0x0002
1314#define PH2 0x0004
1315#define PH3 0x0008
1316#define PH4 0x0010
1317#define PH5 0x0020
1318#define PH6 0x0040
1319#define PH7 0x0080
1320#define PH8 0x0100
1321#define PH9 0x0200
1322#define PH10 0x0400
1323#define PH11 0x0800
1324#define PH12 0x1000
1325#define PH13 0x2000
1326#define PH14 0x4000
1327#define PH15 0x8000
1328
1329/* ******************* SERIAL PORT MASKS **************************************/
1330/* SPORTx_TCR1 Masks */
1331#define TSPEN 0x0001 /* Transmit Enable */
1332#define ITCLK 0x0002 /* Internal Transmit Clock Select */
1333#define DTYPE_NORM 0x0004 /* Data Format Normal */
1334#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1335#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1336#define TLSBIT 0x0010 /* Transmit Bit Order */
1337#define ITFS 0x0200 /* Internal Transmit Frame Sync Select */
1338#define TFSR 0x0400 /* Transmit Frame Sync Required Select */
1339#define DITFS 0x0800 /* Data-Independent Transmit Frame Sync Select */
1340#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
1341#define LATFS 0x2000 /* Late Transmit Frame Sync Select */
1342#define TCKFE 0x4000 /* Clock Falling Edge Select */
1343
1344/* SPORTx_TCR2 Masks and Macro */
1345#define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
1346#define TXSE 0x0100 /* TX Secondary Enable */
1347#define TSFSE 0x0200 /* Transmit Stereo Frame Sync Enable */
1348#define TRFST 0x0400 /* Left/Right Order (1 = Right Channel 1st) */
1349
1350/* SPORTx_RCR1 Masks */
1351#define RSPEN 0x0001 /* Receive Enable */
1352#define IRCLK 0x0002 /* Internal Receive Clock Select */
1353#define DTYPE_NORM 0x0004 /* Data Format Normal */
1354#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1355#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1356#define RLSBIT 0x0010 /* Receive Bit Order */
1357#define IRFS 0x0200 /* Internal Receive Frame Sync Select */
1358#define RFSR 0x0400 /* Receive Frame Sync Required Select */
1359#define LRFS 0x1000 /* Low Receive Frame Sync Select */
1360#define LARFS 0x2000 /* Late Receive Frame Sync Select */
1361#define RCKFE 0x4000 /* Clock Falling Edge Select */
1362
1363/* SPORTx_RCR2 Masks */
1364#define SLEN(x) ((x)&0x1F) /* SPORT RX Word Length (2 - 31) */
1365#define RXSE 0x0100 /* RX Secondary Enable */
1366#define RSFSE 0x0200 /* RX Stereo Frame Sync Enable */
1367#define RRFST 0x0400 /* Right-First Data Order */
1368
1369/* SPORTx_STAT Masks */
1370#define RXNE 0x0001 /* Receive FIFO Not Empty Status */
1371#define RUVF 0x0002 /* Sticky Receive Underflow Status */
1372#define ROVF 0x0004 /* Sticky Receive Overflow Status */
1373#define TXF 0x0008 /* Transmit FIFO Full Status */
1374#define TUVF 0x0010 /* Sticky Transmit Underflow Status */
1375#define TOVF 0x0020 /* Sticky Transmit Overflow Status */
1376#define TXHRE 0x0040 /* Transmit Hold Register Empty */
1377
1378/* SPORTx_MCMC1 Macros */
1379#define SP_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
1380
1381/* Only use WSIZE Macro With Logic OR While Setting Lower Order Bits */
1382#define SP_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
1383
1384/* SPORTx_MCMC2 Masks */
1385#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
1386#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
1387#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
1388#define MCDTXPE 0x0004 /* Multichannel DMA Transmit Packing */
1389#define MCDRXPE 0x0008 /* Multichannel DMA Receive Packing */
1390#define MCMEN 0x0010 /* Multichannel Frame Mode Enable */
1391#define FSDR 0x0080 /* Multichannel Frame Sync to Data Relationship */
1392#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
1393#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
1394#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
1395#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
1396#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
1397#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
1398#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
1399#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
1400#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
1401#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
1402#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
1403#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
1404#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
1405#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
1406#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
1407#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
1408
1409/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS *************************/
1410/* EBIU_AMGCTL Masks */
1411#define AMCKEN 0x0001 /* Enable CLKOUT */
1412#define AMBEN_NONE 0x0000 /* All Banks Disabled */
1413#define AMBEN_B0 0x0002 /* Enable Async Memory Bank 0 only */
1414#define AMBEN_B0_B1 0x0004 /* Enable Async Memory Banks 0 & 1 only */
1415#define AMBEN_B0_B1_B2 0x0006 /* Enable Async Memory Banks 0, 1, and 2 */
1416#define AMBEN_ALL 0x0008 /* Enable Async Memory Banks (all) 0, 1, 2, and 3 */
1417
1418/* EBIU_AMBCTL0 Masks */
1419#define B0RDYEN 0x00000001 /* Bank 0 (B0) RDY Enable */
1420#define B0RDYPOL 0x00000002 /* B0 RDY Active High */
1421#define B0TT_1 0x00000004 /* B0 Transition Time (Read to Write) = 1 cycle */
1422#define B0TT_2 0x00000008 /* B0 Transition Time (Read to Write) = 2 cycles */
1423#define B0TT_3 0x0000000C /* B0 Transition Time (Read to Write) = 3 cycles */
1424#define B0TT_4 0x00000000 /* B0 Transition Time (Read to Write) = 4 cycles */
1425#define B0ST_1 0x00000010 /* B0 Setup Time (AOE to Read/Write) = 1 cycle */
1426#define B0ST_2 0x00000020 /* B0 Setup Time (AOE to Read/Write) = 2 cycles */
1427#define B0ST_3 0x00000030 /* B0 Setup Time (AOE to Read/Write) = 3 cycles */
1428#define B0ST_4 0x00000000 /* B0 Setup Time (AOE to Read/Write) = 4 cycles */
1429#define B0HT_1 0x00000040 /* B0 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1430#define B0HT_2 0x00000080 /* B0 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1431#define B0HT_3 0x000000C0 /* B0 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1432#define B0HT_0 0x00000000 /* B0 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1433#define B0RAT_1 0x00000100 /* B0 Read Access Time = 1 cycle */
1434#define B0RAT_2 0x00000200 /* B0 Read Access Time = 2 cycles */
1435#define B0RAT_3 0x00000300 /* B0 Read Access Time = 3 cycles */
1436#define B0RAT_4 0x00000400 /* B0 Read Access Time = 4 cycles */
1437#define B0RAT_5 0x00000500 /* B0 Read Access Time = 5 cycles */
1438#define B0RAT_6 0x00000600 /* B0 Read Access Time = 6 cycles */
1439#define B0RAT_7 0x00000700 /* B0 Read Access Time = 7 cycles */
1440#define B0RAT_8 0x00000800 /* B0 Read Access Time = 8 cycles */
1441#define B0RAT_9 0x00000900 /* B0 Read Access Time = 9 cycles */
1442#define B0RAT_10 0x00000A00 /* B0 Read Access Time = 10 cycles */
1443#define B0RAT_11 0x00000B00 /* B0 Read Access Time = 11 cycles */
1444#define B0RAT_12 0x00000C00 /* B0 Read Access Time = 12 cycles */
1445#define B0RAT_13 0x00000D00 /* B0 Read Access Time = 13 cycles */
1446#define B0RAT_14 0x00000E00 /* B0 Read Access Time = 14 cycles */
1447#define B0RAT_15 0x00000F00 /* B0 Read Access Time = 15 cycles */
1448#define B0WAT_1 0x00001000 /* B0 Write Access Time = 1 cycle */
1449#define B0WAT_2 0x00002000 /* B0 Write Access Time = 2 cycles */
1450#define B0WAT_3 0x00003000 /* B0 Write Access Time = 3 cycles */
1451#define B0WAT_4 0x00004000 /* B0 Write Access Time = 4 cycles */
1452#define B0WAT_5 0x00005000 /* B0 Write Access Time = 5 cycles */
1453#define B0WAT_6 0x00006000 /* B0 Write Access Time = 6 cycles */
1454#define B0WAT_7 0x00007000 /* B0 Write Access Time = 7 cycles */
1455#define B0WAT_8 0x00008000 /* B0 Write Access Time = 8 cycles */
1456#define B0WAT_9 0x00009000 /* B0 Write Access Time = 9 cycles */
1457#define B0WAT_10 0x0000A000 /* B0 Write Access Time = 10 cycles */
1458#define B0WAT_11 0x0000B000 /* B0 Write Access Time = 11 cycles */
1459#define B0WAT_12 0x0000C000 /* B0 Write Access Time = 12 cycles */
1460#define B0WAT_13 0x0000D000 /* B0 Write Access Time = 13 cycles */
1461#define B0WAT_14 0x0000E000 /* B0 Write Access Time = 14 cycles */
1462#define B0WAT_15 0x0000F000 /* B0 Write Access Time = 15 cycles */
1463
1464#define B1RDYEN 0x00010000 /* Bank 1 (B1) RDY Enable */
1465#define B1RDYPOL 0x00020000 /* B1 RDY Active High */
1466#define B1TT_1 0x00040000 /* B1 Transition Time (Read to Write) = 1 cycle */
1467#define B1TT_2 0x00080000 /* B1 Transition Time (Read to Write) = 2 cycles */
1468#define B1TT_3 0x000C0000 /* B1 Transition Time (Read to Write) = 3 cycles */
1469#define B1TT_4 0x00000000 /* B1 Transition Time (Read to Write) = 4 cycles */
1470#define B1ST_1 0x00100000 /* B1 Setup Time (AOE to Read/Write) = 1 cycle */
1471#define B1ST_2 0x00200000 /* B1 Setup Time (AOE to Read/Write) = 2 cycles */
1472#define B1ST_3 0x00300000 /* B1 Setup Time (AOE to Read/Write) = 3 cycles */
1473#define B1ST_4 0x00000000 /* B1 Setup Time (AOE to Read/Write) = 4 cycles */
1474#define B1HT_1 0x00400000 /* B1 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1475#define B1HT_2 0x00800000 /* B1 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1476#define B1HT_3 0x00C00000 /* B1 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1477#define B1HT_0 0x00000000 /* B1 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1478#define B1RAT_1 0x01000000 /* B1 Read Access Time = 1 cycle */
1479#define B1RAT_2 0x02000000 /* B1 Read Access Time = 2 cycles */
1480#define B1RAT_3 0x03000000 /* B1 Read Access Time = 3 cycles */
1481#define B1RAT_4 0x04000000 /* B1 Read Access Time = 4 cycles */
1482#define B1RAT_5 0x05000000 /* B1 Read Access Time = 5 cycles */
1483#define B1RAT_6 0x06000000 /* B1 Read Access Time = 6 cycles */
1484#define B1RAT_7 0x07000000 /* B1 Read Access Time = 7 cycles */
1485#define B1RAT_8 0x08000000 /* B1 Read Access Time = 8 cycles */
1486#define B1RAT_9 0x09000000 /* B1 Read Access Time = 9 cycles */
1487#define B1RAT_10 0x0A000000 /* B1 Read Access Time = 10 cycles */
1488#define B1RAT_11 0x0B000000 /* B1 Read Access Time = 11 cycles */
1489#define B1RAT_12 0x0C000000 /* B1 Read Access Time = 12 cycles */
1490#define B1RAT_13 0x0D000000 /* B1 Read Access Time = 13 cycles */
1491#define B1RAT_14 0x0E000000 /* B1 Read Access Time = 14 cycles */
1492#define B1RAT_15 0x0F000000 /* B1 Read Access Time = 15 cycles */
1493#define B1WAT_1 0x10000000 /* B1 Write Access Time = 1 cycle */
1494#define B1WAT_2 0x20000000 /* B1 Write Access Time = 2 cycles */
1495#define B1WAT_3 0x30000000 /* B1 Write Access Time = 3 cycles */
1496#define B1WAT_4 0x40000000 /* B1 Write Access Time = 4 cycles */
1497#define B1WAT_5 0x50000000 /* B1 Write Access Time = 5 cycles */
1498#define B1WAT_6 0x60000000 /* B1 Write Access Time = 6 cycles */
1499#define B1WAT_7 0x70000000 /* B1 Write Access Time = 7 cycles */
1500#define B1WAT_8 0x80000000 /* B1 Write Access Time = 8 cycles */
1501#define B1WAT_9 0x90000000 /* B1 Write Access Time = 9 cycles */
1502#define B1WAT_10 0xA0000000 /* B1 Write Access Time = 10 cycles */
1503#define B1WAT_11 0xB0000000 /* B1 Write Access Time = 11 cycles */
1504#define B1WAT_12 0xC0000000 /* B1 Write Access Time = 12 cycles */
1505#define B1WAT_13 0xD0000000 /* B1 Write Access Time = 13 cycles */
1506#define B1WAT_14 0xE0000000 /* B1 Write Access Time = 14 cycles */
1507#define B1WAT_15 0xF0000000 /* B1 Write Access Time = 15 cycles */
1508
1509/* EBIU_AMBCTL1 Masks */
1510#define B2RDYEN 0x00000001 /* Bank 2 (B2) RDY Enable */
1511#define B2RDYPOL 0x00000002 /* B2 RDY Active High */
1512#define B2TT_1 0x00000004 /* B2 Transition Time (Read to Write) = 1 cycle */
1513#define B2TT_2 0x00000008 /* B2 Transition Time (Read to Write) = 2 cycles */
1514#define B2TT_3 0x0000000C /* B2 Transition Time (Read to Write) = 3 cycles */
1515#define B2TT_4 0x00000000 /* B2 Transition Time (Read to Write) = 4 cycles */
1516#define B2ST_1 0x00000010 /* B2 Setup Time (AOE to Read/Write) = 1 cycle */
1517#define B2ST_2 0x00000020 /* B2 Setup Time (AOE to Read/Write) = 2 cycles */
1518#define B2ST_3 0x00000030 /* B2 Setup Time (AOE to Read/Write) = 3 cycles */
1519#define B2ST_4 0x00000000 /* B2 Setup Time (AOE to Read/Write) = 4 cycles */
1520#define B2HT_1 0x00000040 /* B2 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1521#define B2HT_2 0x00000080 /* B2 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1522#define B2HT_3 0x000000C0 /* B2 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1523#define B2HT_0 0x00000000 /* B2 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1524#define B2RAT_1 0x00000100 /* B2 Read Access Time = 1 cycle */
1525#define B2RAT_2 0x00000200 /* B2 Read Access Time = 2 cycles */
1526#define B2RAT_3 0x00000300 /* B2 Read Access Time = 3 cycles */
1527#define B2RAT_4 0x00000400 /* B2 Read Access Time = 4 cycles */
1528#define B2RAT_5 0x00000500 /* B2 Read Access Time = 5 cycles */
1529#define B2RAT_6 0x00000600 /* B2 Read Access Time = 6 cycles */
1530#define B2RAT_7 0x00000700 /* B2 Read Access Time = 7 cycles */
1531#define B2RAT_8 0x00000800 /* B2 Read Access Time = 8 cycles */
1532#define B2RAT_9 0x00000900 /* B2 Read Access Time = 9 cycles */
1533#define B2RAT_10 0x00000A00 /* B2 Read Access Time = 10 cycles */
1534#define B2RAT_11 0x00000B00 /* B2 Read Access Time = 11 cycles */
1535#define B2RAT_12 0x00000C00 /* B2 Read Access Time = 12 cycles */
1536#define B2RAT_13 0x00000D00 /* B2 Read Access Time = 13 cycles */
1537#define B2RAT_14 0x00000E00 /* B2 Read Access Time = 14 cycles */
1538#define B2RAT_15 0x00000F00 /* B2 Read Access Time = 15 cycles */
1539#define B2WAT_1 0x00001000 /* B2 Write Access Time = 1 cycle */
1540#define B2WAT_2 0x00002000 /* B2 Write Access Time = 2 cycles */
1541#define B2WAT_3 0x00003000 /* B2 Write Access Time = 3 cycles */
1542#define B2WAT_4 0x00004000 /* B2 Write Access Time = 4 cycles */
1543#define B2WAT_5 0x00005000 /* B2 Write Access Time = 5 cycles */
1544#define B2WAT_6 0x00006000 /* B2 Write Access Time = 6 cycles */
1545#define B2WAT_7 0x00007000 /* B2 Write Access Time = 7 cycles */
1546#define B2WAT_8 0x00008000 /* B2 Write Access Time = 8 cycles */
1547#define B2WAT_9 0x00009000 /* B2 Write Access Time = 9 cycles */
1548#define B2WAT_10 0x0000A000 /* B2 Write Access Time = 10 cycles */
1549#define B2WAT_11 0x0000B000 /* B2 Write Access Time = 11 cycles */
1550#define B2WAT_12 0x0000C000 /* B2 Write Access Time = 12 cycles */
1551#define B2WAT_13 0x0000D000 /* B2 Write Access Time = 13 cycles */
1552#define B2WAT_14 0x0000E000 /* B2 Write Access Time = 14 cycles */
1553#define B2WAT_15 0x0000F000 /* B2 Write Access Time = 15 cycles */
1554
1555#define B3RDYEN 0x00010000 /* Bank 3 (B3) RDY Enable */
1556#define B3RDYPOL 0x00020000 /* B3 RDY Active High */
1557#define B3TT_1 0x00040000 /* B3 Transition Time (Read to Write) = 1 cycle */
1558#define B3TT_2 0x00080000 /* B3 Transition Time (Read to Write) = 2 cycles */
1559#define B3TT_3 0x000C0000 /* B3 Transition Time (Read to Write) = 3 cycles */
1560#define B3TT_4 0x00000000 /* B3 Transition Time (Read to Write) = 4 cycles */
1561#define B3ST_1 0x00100000 /* B3 Setup Time (AOE to Read/Write) = 1 cycle */
1562#define B3ST_2 0x00200000 /* B3 Setup Time (AOE to Read/Write) = 2 cycles */
1563#define B3ST_3 0x00300000 /* B3 Setup Time (AOE to Read/Write) = 3 cycles */
1564#define B3ST_4 0x00000000 /* B3 Setup Time (AOE to Read/Write) = 4 cycles */
1565#define B3HT_1 0x00400000 /* B3 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1566#define B3HT_2 0x00800000 /* B3 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1567#define B3HT_3 0x00C00000 /* B3 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1568#define B3HT_0 0x00000000 /* B3 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1569#define B3RAT_1 0x01000000 /* B3 Read Access Time = 1 cycle */
1570#define B3RAT_2 0x02000000 /* B3 Read Access Time = 2 cycles */
1571#define B3RAT_3 0x03000000 /* B3 Read Access Time = 3 cycles */
1572#define B3RAT_4 0x04000000 /* B3 Read Access Time = 4 cycles */
1573#define B3RAT_5 0x05000000 /* B3 Read Access Time = 5 cycles */
1574#define B3RAT_6 0x06000000 /* B3 Read Access Time = 6 cycles */
1575#define B3RAT_7 0x07000000 /* B3 Read Access Time = 7 cycles */
1576#define B3RAT_8 0x08000000 /* B3 Read Access Time = 8 cycles */
1577#define B3RAT_9 0x09000000 /* B3 Read Access Time = 9 cycles */
1578#define B3RAT_10 0x0A000000 /* B3 Read Access Time = 10 cycles */
1579#define B3RAT_11 0x0B000000 /* B3 Read Access Time = 11 cycles */
1580#define B3RAT_12 0x0C000000 /* B3 Read Access Time = 12 cycles */
1581#define B3RAT_13 0x0D000000 /* B3 Read Access Time = 13 cycles */
1582#define B3RAT_14 0x0E000000 /* B3 Read Access Time = 14 cycles */
1583#define B3RAT_15 0x0F000000 /* B3 Read Access Time = 15 cycles */
1584#define B3WAT_1 0x10000000 /* B3 Write Access Time = 1 cycle */
1585#define B3WAT_2 0x20000000 /* B3 Write Access Time = 2 cycles */
1586#define B3WAT_3 0x30000000 /* B3 Write Access Time = 3 cycles */
1587#define B3WAT_4 0x40000000 /* B3 Write Access Time = 4 cycles */
1588#define B3WAT_5 0x50000000 /* B3 Write Access Time = 5 cycles */
1589#define B3WAT_6 0x60000000 /* B3 Write Access Time = 6 cycles */
1590#define B3WAT_7 0x70000000 /* B3 Write Access Time = 7 cycles */
1591#define B3WAT_8 0x80000000 /* B3 Write Access Time = 8 cycles */
1592#define B3WAT_9 0x90000000 /* B3 Write Access Time = 9 cycles */
1593#define B3WAT_10 0xA0000000 /* B3 Write Access Time = 10 cycles */
1594#define B3WAT_11 0xB0000000 /* B3 Write Access Time = 11 cycles */
1595#define B3WAT_12 0xC0000000 /* B3 Write Access Time = 12 cycles */
1596#define B3WAT_13 0xD0000000 /* B3 Write Access Time = 13 cycles */
1597#define B3WAT_14 0xE0000000 /* B3 Write Access Time = 14 cycles */
1598#define B3WAT_15 0xF0000000 /* B3 Write Access Time = 15 cycles */
1599
1600/* ********************** SDRAM CONTROLLER MASKS **********************************************/
1601/* EBIU_SDGCTL Masks */
1602#define SCTLE 0x00000001 /* Enable SDRAM Signals */
1603#define CL_2 0x00000008 /* SDRAM CAS Latency = 2 cycles */
1604#define CL_3 0x0000000C /* SDRAM CAS Latency = 3 cycles */
1605#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
1606#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
1607#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
1608#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1609#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1610#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1611#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1612#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1613#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1614#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1615#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1616#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1617#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1618#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1619#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1620#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1621#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1622#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1623#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1624#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1625#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1626#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1627#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1628#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1629#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1630#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1631#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1632#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1633#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1634#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1635#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1636#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1637#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1638#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1639#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1640#define PUPSD 0x00200000 /* Power-Up Start Delay (15 SCLK Cycles Delay) */
1641#define PSM 0x00400000 /* Power-Up Sequence (Mode Register Before/After* Refresh) */
1642#define PSS 0x00800000 /* Enable Power-Up Sequence on Next SDRAM Access */
1643#define SRFS 0x01000000 /* Enable SDRAM Self-Refresh Mode */
1644#define EBUFE 0x02000000 /* Enable External Buffering Timing */
1645#define FBBRW 0x04000000 /* Enable Fast Back-To-Back Read To Write */
1646#define EMREN 0x10000000 /* Extended Mode Register Enable */
1647#define TCSR 0x20000000 /* Temp-Compensated Self-Refresh Value (85/45* Deg C) */
1648#define CDDBG 0x40000000 /* Tristate SDRAM Controls During Bus Grant */
1649
1650/* EBIU_SDBCTL Masks */
1651#define EBE 0x0001 /* Enable SDRAM External Bank */
1652#define EBSZ_16 0x0000 /* SDRAM External Bank Size = 16MB */
1653#define EBSZ_32 0x0002 /* SDRAM External Bank Size = 32MB */
1654#define EBSZ_64 0x0004 /* SDRAM External Bank Size = 64MB */
1655#define EBSZ_128 0x0006 /* SDRAM External Bank Size = 128MB */
1656#define EBSZ_256 0x0008 /* SDRAM External Bank Size = 256MB */
1657#define EBSZ_512 0x000A /* SDRAM External Bank Size = 512MB */
1658#define EBCAW_8 0x0000 /* SDRAM External Bank Column Address Width = 8 Bits */
1659#define EBCAW_9 0x0010 /* SDRAM External Bank Column Address Width = 9 Bits */
1660#define EBCAW_10 0x0020 /* SDRAM External Bank Column Address Width = 10 Bits */
1661#define EBCAW_11 0x0030 /* SDRAM External Bank Column Address Width = 11 Bits */
1662
1663/* EBIU_SDSTAT Masks */
1664#define SDCI 0x0001 /* SDRAM Controller Idle */
1665#define SDSRA 0x0002 /* SDRAM Self-Refresh Active */
1666#define SDPUA 0x0004 /* SDRAM Power-Up Active */
1667#define SDRS 0x0008 /* SDRAM Will Power-Up On Next Access */
1668#define SDEASE 0x0010 /* SDRAM EAB Sticky Error Status */
1669#define BGSTAT 0x0020 /* Bus Grant Status */
1670
1671/* ************************** DMA CONTROLLER MASKS ********************************/
1672/* DMAx_CONFIG, MDMA_yy_CONFIG Masks */
1673#define DMAEN 0x0001 /* DMA Channel Enable */
1674#define WNR 0x0002 /* Channel Direction (W/R*) */
1675#define WDSIZE_8 0x0000 /* Transfer Word Size = 8 */
1676#define WDSIZE_16 0x0004 /* Transfer Word Size = 16 */
1677#define WDSIZE_32 0x0008 /* Transfer Word Size = 32 */
1678#define DMA2D 0x0010 /* DMA Mode (2D/1D*) */
1679#define RESTART 0x0020 /* DMA Buffer Clear */
1680#define DI_SEL 0x0040 /* Data Interrupt Timing Select */
1681#define DI_EN 0x0080 /* Data Interrupt Enable */
1682#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1683#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1684#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1685#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1686#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1687#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1688#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1689#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1690#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1691#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1692#define NDSIZE 0x0900 /* Next Descriptor Size */
1693
1694#define DMAFLOW 0x7000 /* Flow Control */
1695#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1696#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1697#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1698#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1699#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1700
1701/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
1702#define CTYPE 0x0040 /* DMA Channel Type Indicator (Memory/Peripheral*) */
1703#define PMAP 0xF000 /* Peripheral Mapped To This Channel */
1704#define PMAP_PPI 0x0000 /* PPI Port DMA */
1705#define PMAP_EMACRX 0x1000 /* Ethernet Receive DMA */
1706#define PMAP_EMACTX 0x2000 /* Ethernet Transmit DMA */
1707#define PMAP_SPORT0RX 0x3000 /* SPORT0 Receive DMA */
1708#define PMAP_SPORT0TX 0x4000 /* SPORT0 Transmit DMA */
1709#define PMAP_SPORT1RX 0x5000 /* SPORT1 Receive DMA */
1710#define PMAP_SPORT1TX 0x6000 /* SPORT1 Transmit DMA */
1711#define PMAP_SPI 0x7000 /* SPI Port DMA */
1712#define PMAP_UART0RX 0x8000 /* UART0 Port Receive DMA */
1713#define PMAP_UART0TX 0x9000 /* UART0 Port Transmit DMA */
1714#define PMAP_UART1RX 0xA000 /* UART1 Port Receive DMA */
1715#define PMAP_UART1TX 0xB000 /* UART1 Port Transmit DMA */
1716
1717/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
1718#define DMA_DONE 0x0001 /* DMA Completion Interrupt Status */
1719#define DMA_ERR 0x0002 /* DMA Error Interrupt Status */
1720#define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */
1721#define DMA_RUN 0x0008 /* DMA Channel Running Indicator */
1722
1723/* ************ PARALLEL PERIPHERAL INTERFACE (PPI) MASKS *************/
1724/* PPI_CONTROL Masks */
1725#define PORT_EN 0x0001 /* PPI Port Enable */
1726#define PORT_DIR 0x0002 /* PPI Port Direction */
1727#define XFR_TYPE 0x000C /* PPI Transfer Type */
1728#define PORT_CFG 0x0030 /* PPI Port Configuration */
1729#define FLD_SEL 0x0040 /* PPI Active Field Select */
1730#define PACK_EN 0x0080 /* PPI Packing Mode */
1731#define DMA32 0x0100 /* PPI 32-bit DMA Enable */
1732#define SKIP_EN 0x0200 /* PPI Skip Element Enable */
1733#define SKIP_EO 0x0400 /* PPI Skip Even/Odd Elements */
1734#define DLENGTH 0x3800 /* PPI Data Length */
1735#define DLEN_8 0x0000 /* Data Length = 8 Bits */
1736#define DLEN_10 0x0800 /* Data Length = 10 Bits */
1737#define DLEN_11 0x1000 /* Data Length = 11 Bits */
1738#define DLEN_12 0x1800 /* Data Length = 12 Bits */
1739#define DLEN_13 0x2000 /* Data Length = 13 Bits */
1740#define DLEN_14 0x2800 /* Data Length = 14 Bits */
1741#define DLEN_15 0x3000 /* Data Length = 15 Bits */
1742#define DLEN_16 0x3800 /* Data Length = 16 Bits */
1743#define POLC 0x4000 /* PPI Clock Polarity */
1744#define POLS 0x8000 /* PPI Frame Sync Polarity */
1745
1746/* PPI_STATUS Masks */
1747#define FLD 0x0400 /* Field Indicator */
1748#define FT_ERR 0x0800 /* Frame Track Error */
1749#define OVR 0x1000 /* FIFO Overflow Error */
1750#define UNDR 0x2000 /* FIFO Underrun Error */
1751#define ERR_DET 0x4000 /* Error Detected Indicator */
1752#define ERR_NCOR 0x8000 /* Error Not Corrected Indicator */
1753
1754/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/
1755/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
1756#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */
1757#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */
1758
1759/* TWI_PRESCALE Masks */
1760#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
1761#define TWI_ENA 0x0080 /* TWI Enable */
1762#define SCCB 0x0200 /* SCCB Compatibility Enable */
1763
1764/* TWI_SLAVE_CTRL Masks */
1765#define SEN 0x0001 /* Slave Enable */
1766#define SADD_LEN 0x0002 /* Slave Address Length */
1767#define STDVAL 0x0004 /* Slave Transmit Data Valid */
1768#define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */
1769#define GEN 0x0010 /* General Call Adrress Matching Enabled */
1770
1771/* TWI_SLAVE_STAT Masks */
1772#define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */
1773#define GCALL 0x0002 /* General Call Indicator */
1774
1775/* TWI_MASTER_CTRL Masks */
1776#define MEN 0x0001 /* Master Mode Enable */
1777#define MADD_LEN 0x0002 /* Master Address Length */
1778#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
1779#define FAST 0x0008 /* Use Fast Mode Timing Specs */
1780#define STOP 0x0010 /* Issue Stop Condition */
1781#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
1782#define DCNT 0x3FC0 /* Data Bytes To Transfer */
1783#define SDAOVR 0x4000 /* Serial Data Override */
1784#define SCLOVR 0x8000 /* Serial Clock Override */
1785
1786/* TWI_MASTER_STAT Masks */
1787#define MPROG 0x0001 /* Master Transfer In Progress */
1788#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
1789#define ANAK 0x0004 /* Address Not Acknowledged */
1790#define DNAK 0x0008 /* Data Not Acknowledged */
1791#define BUFRDERR 0x0010 /* Buffer Read Error */
1792#define BUFWRERR 0x0020 /* Buffer Write Error */
1793#define SDASEN 0x0040 /* Serial Data Sense */
1794#define SCLSEN 0x0080 /* Serial Clock Sense */
1795#define BUSBUSY 0x0100 /* Bus Busy Indicator */
1796
1797/* TWI_INT_SRC and TWI_INT_ENABLE Masks */
1798#define SINIT 0x0001 /* Slave Transfer Initiated */
1799#define SCOMP 0x0002 /* Slave Transfer Complete */
1800#define SERR 0x0004 /* Slave Transfer Error */
1801#define SOVF 0x0008 /* Slave Overflow */
1802#define MCOMP 0x0010 /* Master Transfer Complete */
1803#define MERR 0x0020 /* Master Transfer Error */
1804#define XMTSERV 0x0040 /* Transmit FIFO Service */
1805#define RCVSERV 0x0080 /* Receive FIFO Service */
1806
1807/* TWI_FIFO_CTRL Masks */
1808#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
1809#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
1810#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
1811#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
1812
1813/* TWI_FIFO_STAT Masks */
1814#define XMTSTAT 0x0003 /* Transmit FIFO Status */
1815#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
1816#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
1817#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
1818
1819#define RCVSTAT 0x000C /* Receive FIFO Status */
1820#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */
1821#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */
1822#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */
1823
1824/* ************ CONTROLLER AREA NETWORK (CAN) MASKS ***************/
1825/* CAN_CONTROL Masks */
1826#define SRS 0x0001 /* Software Reset */
1827#define DNM 0x0002 /* Device Net Mode */
1828#define ABO 0x0004 /* Auto-Bus On Enable */
1829#define TXPRIO 0x0008 /* TX Priority (Priority/Mailbox*) */
1830#define WBA 0x0010 /* Wake-Up On CAN Bus Activity Enable */
1831#define SMR 0x0020 /* Sleep Mode Request */
1832#define CSR 0x0040 /* CAN Suspend Mode Request */
1833#define CCR 0x0080 /* CAN Configuration Mode Request */
1834
1835/* CAN_STATUS Masks */
1836#define WT 0x0001 /* TX Warning Flag */
1837#define WR 0x0002 /* RX Warning Flag */
1838#define EP 0x0004 /* Error Passive Mode */
1839#define EBO 0x0008 /* Error Bus Off Mode */
1840#define SMA 0x0020 /* Sleep Mode Acknowledge */
1841#define CSA 0x0040 /* Suspend Mode Acknowledge */
1842#define CCA 0x0080 /* Configuration Mode Acknowledge */
1843#define MBPTR 0x1F00 /* Mailbox Pointer */
1844#define TRM 0x4000 /* Transmit Mode */
1845#define REC 0x8000 /* Receive Mode */
1846
1847/* CAN_CLOCK Masks */
1848#define BRP 0x03FF /* Bit-Rate Pre-Scaler */
1849
1850/* CAN_TIMING Masks */
1851#define TSEG1 0x000F /* Time Segment 1 */
1852#define TSEG2 0x0070 /* Time Segment 2 */
1853#define SAM 0x0080 /* Sampling */
1854#define SJW 0x0300 /* Synchronization Jump Width */
1855
1856/* CAN_DEBUG Masks */
1857#define DEC 0x0001 /* Disable CAN Error Counters */
1858#define DRI 0x0002 /* Disable CAN RX Input */
1859#define DTO 0x0004 /* Disable CAN TX Output */
1860#define DIL 0x0008 /* Disable CAN Internal Loop */
1861#define MAA 0x0010 /* Mode Auto-Acknowledge Enable */
1862#define MRB 0x0020 /* Mode Read Back Enable */
1863#define CDE 0x8000 /* CAN Debug Enable */
1864
1865/* CAN_CEC Masks */
1866#define RXECNT 0x00FF /* Receive Error Counter */
1867#define TXECNT 0xFF00 /* Transmit Error Counter */
1868
1869/* CAN_INTR Masks */
1870#define MBRIRQ 0x0001 /* Mailbox Receive Interrupt */
1871#define MBRIF MBRIRQ /* legacy */
1872#define MBTIRQ 0x0002 /* Mailbox Transmit Interrupt */
1873#define MBTIF MBTIRQ /* legacy */
1874#define GIRQ 0x0004 /* Global Interrupt */
1875#define SMACK 0x0008 /* Sleep Mode Acknowledge */
1876#define CANTX 0x0040 /* CAN TX Bus Value */
1877#define CANRX 0x0080 /* CAN RX Bus Value */
1878
1879/* CAN_MBxx_ID1 and CAN_MBxx_ID0 Masks */
1880#define DFC 0xFFFF /* Data Filtering Code (If Enabled) (ID0) */
1881#define EXTID_LO 0xFFFF /* Lower 16 Bits of Extended Identifier (ID0) */
1882#define EXTID_HI 0x0003 /* Upper 2 Bits of Extended Identifier (ID1) */
1883#define BASEID 0x1FFC /* Base Identifier */
1884#define IDE 0x2000 /* Identifier Extension */
1885#define RTR 0x4000 /* Remote Frame Transmission Request */
1886#define AME 0x8000 /* Acceptance Mask Enable */
1887
1888/* CAN_MBxx_TIMESTAMP Masks */
1889#define TSV 0xFFFF /* Timestamp */
1890
1891/* CAN_MBxx_LENGTH Masks */
1892#define DLC 0x000F /* Data Length Code */
1893
1894/* CAN_AMxxH and CAN_AMxxL Masks */
1895#define DFM 0xFFFF /* Data Field Mask (If Enabled) (CAN_AMxxL) */
1896#define EXTID_LO 0xFFFF /* Lower 16 Bits of Extended Identifier (CAN_AMxxL) */
1897#define EXTID_HI 0x0003 /* Upper 2 Bits of Extended Identifier (CAN_AMxxH) */
1898#define BASEID 0x1FFC /* Base Identifier */
1899#define AMIDE 0x2000 /* Acceptance Mask ID Extension Enable */
1900#define FMD 0x4000 /* Full Mask Data Field Enable */
1901#define FDF 0x8000 /* Filter On Data Field Enable */
1902
1903/* CAN_MC1 Masks */
1904#define MC0 0x0001 /* Enable Mailbox 0 */
1905#define MC1 0x0002 /* Enable Mailbox 1 */
1906#define MC2 0x0004 /* Enable Mailbox 2 */
1907#define MC3 0x0008 /* Enable Mailbox 3 */
1908#define MC4 0x0010 /* Enable Mailbox 4 */
1909#define MC5 0x0020 /* Enable Mailbox 5 */
1910#define MC6 0x0040 /* Enable Mailbox 6 */
1911#define MC7 0x0080 /* Enable Mailbox 7 */
1912#define MC8 0x0100 /* Enable Mailbox 8 */
1913#define MC9 0x0200 /* Enable Mailbox 9 */
1914#define MC10 0x0400 /* Enable Mailbox 10 */
1915#define MC11 0x0800 /* Enable Mailbox 11 */
1916#define MC12 0x1000 /* Enable Mailbox 12 */
1917#define MC13 0x2000 /* Enable Mailbox 13 */
1918#define MC14 0x4000 /* Enable Mailbox 14 */
1919#define MC15 0x8000 /* Enable Mailbox 15 */
1920
1921/* CAN_MC2 Masks */
1922#define MC16 0x0001 /* Enable Mailbox 16 */
1923#define MC17 0x0002 /* Enable Mailbox 17 */
1924#define MC18 0x0004 /* Enable Mailbox 18 */
1925#define MC19 0x0008 /* Enable Mailbox 19 */
1926#define MC20 0x0010 /* Enable Mailbox 20 */
1927#define MC21 0x0020 /* Enable Mailbox 21 */
1928#define MC22 0x0040 /* Enable Mailbox 22 */
1929#define MC23 0x0080 /* Enable Mailbox 23 */
1930#define MC24 0x0100 /* Enable Mailbox 24 */
1931#define MC25 0x0200 /* Enable Mailbox 25 */
1932#define MC26 0x0400 /* Enable Mailbox 26 */
1933#define MC27 0x0800 /* Enable Mailbox 27 */
1934#define MC28 0x1000 /* Enable Mailbox 28 */
1935#define MC29 0x2000 /* Enable Mailbox 29 */
1936#define MC30 0x4000 /* Enable Mailbox 30 */
1937#define MC31 0x8000 /* Enable Mailbox 31 */
1938
1939/* CAN_MD1 Masks */
1940#define MD0 0x0001 /* Enable Mailbox 0 For Receive */
1941#define MD1 0x0002 /* Enable Mailbox 1 For Receive */
1942#define MD2 0x0004 /* Enable Mailbox 2 For Receive */
1943#define MD3 0x0008 /* Enable Mailbox 3 For Receive */
1944#define MD4 0x0010 /* Enable Mailbox 4 For Receive */
1945#define MD5 0x0020 /* Enable Mailbox 5 For Receive */
1946#define MD6 0x0040 /* Enable Mailbox 6 For Receive */
1947#define MD7 0x0080 /* Enable Mailbox 7 For Receive */
1948#define MD8 0x0100 /* Enable Mailbox 8 For Receive */
1949#define MD9 0x0200 /* Enable Mailbox 9 For Receive */
1950#define MD10 0x0400 /* Enable Mailbox 10 For Receive */
1951#define MD11 0x0800 /* Enable Mailbox 11 For Receive */
1952#define MD12 0x1000 /* Enable Mailbox 12 For Receive */
1953#define MD13 0x2000 /* Enable Mailbox 13 For Receive */
1954#define MD14 0x4000 /* Enable Mailbox 14 For Receive */
1955#define MD15 0x8000 /* Enable Mailbox 15 For Receive */
1956
1957/* CAN_MD2 Masks */
1958#define MD16 0x0001 /* Enable Mailbox 16 For Receive */
1959#define MD17 0x0002 /* Enable Mailbox 17 For Receive */
1960#define MD18 0x0004 /* Enable Mailbox 18 For Receive */
1961#define MD19 0x0008 /* Enable Mailbox 19 For Receive */
1962#define MD20 0x0010 /* Enable Mailbox 20 For Receive */
1963#define MD21 0x0020 /* Enable Mailbox 21 For Receive */
1964#define MD22 0x0040 /* Enable Mailbox 22 For Receive */
1965#define MD23 0x0080 /* Enable Mailbox 23 For Receive */
1966#define MD24 0x0100 /* Enable Mailbox 24 For Receive */
1967#define MD25 0x0200 /* Enable Mailbox 25 For Receive */
1968#define MD26 0x0400 /* Enable Mailbox 26 For Receive */
1969#define MD27 0x0800 /* Enable Mailbox 27 For Receive */
1970#define MD28 0x1000 /* Enable Mailbox 28 For Receive */
1971#define MD29 0x2000 /* Enable Mailbox 29 For Receive */
1972#define MD30 0x4000 /* Enable Mailbox 30 For Receive */
1973#define MD31 0x8000 /* Enable Mailbox 31 For Receive */
1974
1975/* CAN_RMP1 Masks */
1976#define RMP0 0x0001 /* RX Message Pending In Mailbox 0 */
1977#define RMP1 0x0002 /* RX Message Pending In Mailbox 1 */
1978#define RMP2 0x0004 /* RX Message Pending In Mailbox 2 */
1979#define RMP3 0x0008 /* RX Message Pending In Mailbox 3 */
1980#define RMP4 0x0010 /* RX Message Pending In Mailbox 4 */
1981#define RMP5 0x0020 /* RX Message Pending In Mailbox 5 */
1982#define RMP6 0x0040 /* RX Message Pending In Mailbox 6 */
1983#define RMP7 0x0080 /* RX Message Pending In Mailbox 7 */
1984#define RMP8 0x0100 /* RX Message Pending In Mailbox 8 */
1985#define RMP9 0x0200 /* RX Message Pending In Mailbox 9 */
1986#define RMP10 0x0400 /* RX Message Pending In Mailbox 10 */
1987#define RMP11 0x0800 /* RX Message Pending In Mailbox 11 */
1988#define RMP12 0x1000 /* RX Message Pending In Mailbox 12 */
1989#define RMP13 0x2000 /* RX Message Pending In Mailbox 13 */
1990#define RMP14 0x4000 /* RX Message Pending In Mailbox 14 */
1991#define RMP15 0x8000 /* RX Message Pending In Mailbox 15 */
1992
1993/* CAN_RMP2 Masks */
1994#define RMP16 0x0001 /* RX Message Pending In Mailbox 16 */
1995#define RMP17 0x0002 /* RX Message Pending In Mailbox 17 */
1996#define RMP18 0x0004 /* RX Message Pending In Mailbox 18 */
1997#define RMP19 0x0008 /* RX Message Pending In Mailbox 19 */
1998#define RMP20 0x0010 /* RX Message Pending In Mailbox 20 */
1999#define RMP21 0x0020 /* RX Message Pending In Mailbox 21 */
2000#define RMP22 0x0040 /* RX Message Pending In Mailbox 22 */
2001#define RMP23 0x0080 /* RX Message Pending In Mailbox 23 */
2002#define RMP24 0x0100 /* RX Message Pending In Mailbox 24 */
2003#define RMP25 0x0200 /* RX Message Pending In Mailbox 25 */
2004#define RMP26 0x0400 /* RX Message Pending In Mailbox 26 */
2005#define RMP27 0x0800 /* RX Message Pending In Mailbox 27 */
2006#define RMP28 0x1000 /* RX Message Pending In Mailbox 28 */
2007#define RMP29 0x2000 /* RX Message Pending In Mailbox 29 */
2008#define RMP30 0x4000 /* RX Message Pending In Mailbox 30 */
2009#define RMP31 0x8000 /* RX Message Pending In Mailbox 31 */
2010
2011/* CAN_RML1 Masks */
2012#define RML0 0x0001 /* RX Message Lost In Mailbox 0 */
2013#define RML1 0x0002 /* RX Message Lost In Mailbox 1 */
2014#define RML2 0x0004 /* RX Message Lost In Mailbox 2 */
2015#define RML3 0x0008 /* RX Message Lost In Mailbox 3 */
2016#define RML4 0x0010 /* RX Message Lost In Mailbox 4 */
2017#define RML5 0x0020 /* RX Message Lost In Mailbox 5 */
2018#define RML6 0x0040 /* RX Message Lost In Mailbox 6 */
2019#define RML7 0x0080 /* RX Message Lost In Mailbox 7 */
2020#define RML8 0x0100 /* RX Message Lost In Mailbox 8 */
2021#define RML9 0x0200 /* RX Message Lost In Mailbox 9 */
2022#define RML10 0x0400 /* RX Message Lost In Mailbox 10 */
2023#define RML11 0x0800 /* RX Message Lost In Mailbox 11 */
2024#define RML12 0x1000 /* RX Message Lost In Mailbox 12 */
2025#define RML13 0x2000 /* RX Message Lost In Mailbox 13 */
2026#define RML14 0x4000 /* RX Message Lost In Mailbox 14 */
2027#define RML15 0x8000 /* RX Message Lost In Mailbox 15 */
2028
2029/* CAN_RML2 Masks */
2030#define RML16 0x0001 /* RX Message Lost In Mailbox 16 */
2031#define RML17 0x0002 /* RX Message Lost In Mailbox 17 */
2032#define RML18 0x0004 /* RX Message Lost In Mailbox 18 */
2033#define RML19 0x0008 /* RX Message Lost In Mailbox 19 */
2034#define RML20 0x0010 /* RX Message Lost In Mailbox 20 */
2035#define RML21 0x0020 /* RX Message Lost In Mailbox 21 */
2036#define RML22 0x0040 /* RX Message Lost In Mailbox 22 */
2037#define RML23 0x0080 /* RX Message Lost In Mailbox 23 */
2038#define RML24 0x0100 /* RX Message Lost In Mailbox 24 */
2039#define RML25 0x0200 /* RX Message Lost In Mailbox 25 */
2040#define RML26 0x0400 /* RX Message Lost In Mailbox 26 */
2041#define RML27 0x0800 /* RX Message Lost In Mailbox 27 */
2042#define RML28 0x1000 /* RX Message Lost In Mailbox 28 */
2043#define RML29 0x2000 /* RX Message Lost In Mailbox 29 */
2044#define RML30 0x4000 /* RX Message Lost In Mailbox 30 */
2045#define RML31 0x8000 /* RX Message Lost In Mailbox 31 */
2046
2047/* CAN_OPSS1 Masks */
2048#define OPSS0 0x0001 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 0 */
2049#define OPSS1 0x0002 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 1 */
2050#define OPSS2 0x0004 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 2 */
2051#define OPSS3 0x0008 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 3 */
2052#define OPSS4 0x0010 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 4 */
2053#define OPSS5 0x0020 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 5 */
2054#define OPSS6 0x0040 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 6 */
2055#define OPSS7 0x0080 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 7 */
2056#define OPSS8 0x0100 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 8 */
2057#define OPSS9 0x0200 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 9 */
2058#define OPSS10 0x0400 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 10 */
2059#define OPSS11 0x0800 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 11 */
2060#define OPSS12 0x1000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 12 */
2061#define OPSS13 0x2000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 13 */
2062#define OPSS14 0x4000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 14 */
2063#define OPSS15 0x8000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 15 */
2064
2065/* CAN_OPSS2 Masks */
2066#define OPSS16 0x0001 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 16 */
2067#define OPSS17 0x0002 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 17 */
2068#define OPSS18 0x0004 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 18 */
2069#define OPSS19 0x0008 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 19 */
2070#define OPSS20 0x0010 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 20 */
2071#define OPSS21 0x0020 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 21 */
2072#define OPSS22 0x0040 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 22 */
2073#define OPSS23 0x0080 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 23 */
2074#define OPSS24 0x0100 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 24 */
2075#define OPSS25 0x0200 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 25 */
2076#define OPSS26 0x0400 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 26 */
2077#define OPSS27 0x0800 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 27 */
2078#define OPSS28 0x1000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 28 */
2079#define OPSS29 0x2000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 29 */
2080#define OPSS30 0x4000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 30 */
2081#define OPSS31 0x8000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 31 */
2082
2083/* CAN_TRR1 Masks */
2084#define TRR0 0x0001 /* Deny But Don't Lock Access To Mailbox 0 */
2085#define TRR1 0x0002 /* Deny But Don't Lock Access To Mailbox 1 */
2086#define TRR2 0x0004 /* Deny But Don't Lock Access To Mailbox 2 */
2087#define TRR3 0x0008 /* Deny But Don't Lock Access To Mailbox 3 */
2088#define TRR4 0x0010 /* Deny But Don't Lock Access To Mailbox 4 */
2089#define TRR5 0x0020 /* Deny But Don't Lock Access To Mailbox 5 */
2090#define TRR6 0x0040 /* Deny But Don't Lock Access To Mailbox 6 */
2091#define TRR7 0x0080 /* Deny But Don't Lock Access To Mailbox 7 */
2092#define TRR8 0x0100 /* Deny But Don't Lock Access To Mailbox 8 */
2093#define TRR9 0x0200 /* Deny But Don't Lock Access To Mailbox 9 */
2094#define TRR10 0x0400 /* Deny But Don't Lock Access To Mailbox 10 */
2095#define TRR11 0x0800 /* Deny But Don't Lock Access To Mailbox 11 */
2096#define TRR12 0x1000 /* Deny But Don't Lock Access To Mailbox 12 */
2097#define TRR13 0x2000 /* Deny But Don't Lock Access To Mailbox 13 */
2098#define TRR14 0x4000 /* Deny But Don't Lock Access To Mailbox 14 */
2099#define TRR15 0x8000 /* Deny But Don't Lock Access To Mailbox 15 */
2100
2101/* CAN_TRR2 Masks */
2102#define TRR16 0x0001 /* Deny But Don't Lock Access To Mailbox 16 */
2103#define TRR17 0x0002 /* Deny But Don't Lock Access To Mailbox 17 */
2104#define TRR18 0x0004 /* Deny But Don't Lock Access To Mailbox 18 */
2105#define TRR19 0x0008 /* Deny But Don't Lock Access To Mailbox 19 */
2106#define TRR20 0x0010 /* Deny But Don't Lock Access To Mailbox 20 */
2107#define TRR21 0x0020 /* Deny But Don't Lock Access To Mailbox 21 */
2108#define TRR22 0x0040 /* Deny But Don't Lock Access To Mailbox 22 */
2109#define TRR23 0x0080 /* Deny But Don't Lock Access To Mailbox 23 */
2110#define TRR24 0x0100 /* Deny But Don't Lock Access To Mailbox 24 */
2111#define TRR25 0x0200 /* Deny But Don't Lock Access To Mailbox 25 */
2112#define TRR26 0x0400 /* Deny But Don't Lock Access To Mailbox 26 */
2113#define TRR27 0x0800 /* Deny But Don't Lock Access To Mailbox 27 */
2114#define TRR28 0x1000 /* Deny But Don't Lock Access To Mailbox 28 */
2115#define TRR29 0x2000 /* Deny But Don't Lock Access To Mailbox 29 */
2116#define TRR30 0x4000 /* Deny But Don't Lock Access To Mailbox 30 */
2117#define TRR31 0x8000 /* Deny But Don't Lock Access To Mailbox 31 */
2118
2119/* CAN_TRS1 Masks */
2120#define TRS0 0x0001 /* Remote Frame Request For Mailbox 0 */
2121#define TRS1 0x0002 /* Remote Frame Request For Mailbox 1 */
2122#define TRS2 0x0004 /* Remote Frame Request For Mailbox 2 */
2123#define TRS3 0x0008 /* Remote Frame Request For Mailbox 3 */
2124#define TRS4 0x0010 /* Remote Frame Request For Mailbox 4 */
2125#define TRS5 0x0020 /* Remote Frame Request For Mailbox 5 */
2126#define TRS6 0x0040 /* Remote Frame Request For Mailbox 6 */
2127#define TRS7 0x0080 /* Remote Frame Request For Mailbox 7 */
2128#define TRS8 0x0100 /* Remote Frame Request For Mailbox 8 */
2129#define TRS9 0x0200 /* Remote Frame Request For Mailbox 9 */
2130#define TRS10 0x0400 /* Remote Frame Request For Mailbox 10 */
2131#define TRS11 0x0800 /* Remote Frame Request For Mailbox 11 */
2132#define TRS12 0x1000 /* Remote Frame Request For Mailbox 12 */
2133#define TRS13 0x2000 /* Remote Frame Request For Mailbox 13 */
2134#define TRS14 0x4000 /* Remote Frame Request For Mailbox 14 */
2135#define TRS15 0x8000 /* Remote Frame Request For Mailbox 15 */
2136
2137/* CAN_TRS2 Masks */
2138#define TRS16 0x0001 /* Remote Frame Request For Mailbox 16 */
2139#define TRS17 0x0002 /* Remote Frame Request For Mailbox 17 */
2140#define TRS18 0x0004 /* Remote Frame Request For Mailbox 18 */
2141#define TRS19 0x0008 /* Remote Frame Request For Mailbox 19 */
2142#define TRS20 0x0010 /* Remote Frame Request For Mailbox 20 */
2143#define TRS21 0x0020 /* Remote Frame Request For Mailbox 21 */
2144#define TRS22 0x0040 /* Remote Frame Request For Mailbox 22 */
2145#define TRS23 0x0080 /* Remote Frame Request For Mailbox 23 */
2146#define TRS24 0x0100 /* Remote Frame Request For Mailbox 24 */
2147#define TRS25 0x0200 /* Remote Frame Request For Mailbox 25 */
2148#define TRS26 0x0400 /* Remote Frame Request For Mailbox 26 */
2149#define TRS27 0x0800 /* Remote Frame Request For Mailbox 27 */
2150#define TRS28 0x1000 /* Remote Frame Request For Mailbox 28 */
2151#define TRS29 0x2000 /* Remote Frame Request For Mailbox 29 */
2152#define TRS30 0x4000 /* Remote Frame Request For Mailbox 30 */
2153#define TRS31 0x8000 /* Remote Frame Request For Mailbox 31 */
2154
2155/* CAN_AA1 Masks */
2156#define AA0 0x0001 /* Aborted Message In Mailbox 0 */
2157#define AA1 0x0002 /* Aborted Message In Mailbox 1 */
2158#define AA2 0x0004 /* Aborted Message In Mailbox 2 */
2159#define AA3 0x0008 /* Aborted Message In Mailbox 3 */
2160#define AA4 0x0010 /* Aborted Message In Mailbox 4 */
2161#define AA5 0x0020 /* Aborted Message In Mailbox 5 */
2162#define AA6 0x0040 /* Aborted Message In Mailbox 6 */
2163#define AA7 0x0080 /* Aborted Message In Mailbox 7 */
2164#define AA8 0x0100 /* Aborted Message In Mailbox 8 */
2165#define AA9 0x0200 /* Aborted Message In Mailbox 9 */
2166#define AA10 0x0400 /* Aborted Message In Mailbox 10 */
2167#define AA11 0x0800 /* Aborted Message In Mailbox 11 */
2168#define AA12 0x1000 /* Aborted Message In Mailbox 12 */
2169#define AA13 0x2000 /* Aborted Message In Mailbox 13 */
2170#define AA14 0x4000 /* Aborted Message In Mailbox 14 */
2171#define AA15 0x8000 /* Aborted Message In Mailbox 15 */
2172
2173/* CAN_AA2 Masks */
2174#define AA16 0x0001 /* Aborted Message In Mailbox 16 */
2175#define AA17 0x0002 /* Aborted Message In Mailbox 17 */
2176#define AA18 0x0004 /* Aborted Message In Mailbox 18 */
2177#define AA19 0x0008 /* Aborted Message In Mailbox 19 */
2178#define AA20 0x0010 /* Aborted Message In Mailbox 20 */
2179#define AA21 0x0020 /* Aborted Message In Mailbox 21 */
2180#define AA22 0x0040 /* Aborted Message In Mailbox 22 */
2181#define AA23 0x0080 /* Aborted Message In Mailbox 23 */
2182#define AA24 0x0100 /* Aborted Message In Mailbox 24 */
2183#define AA25 0x0200 /* Aborted Message In Mailbox 25 */
2184#define AA26 0x0400 /* Aborted Message In Mailbox 26 */
2185#define AA27 0x0800 /* Aborted Message In Mailbox 27 */
2186#define AA28 0x1000 /* Aborted Message In Mailbox 28 */
2187#define AA29 0x2000 /* Aborted Message In Mailbox 29 */
2188#define AA30 0x4000 /* Aborted Message In Mailbox 30 */
2189#define AA31 0x8000 /* Aborted Message In Mailbox 31 */
2190
2191/* CAN_TA1 Masks */
2192#define TA0 0x0001 /* Transmit Successful From Mailbox 0 */
2193#define TA1 0x0002 /* Transmit Successful From Mailbox 1 */
2194#define TA2 0x0004 /* Transmit Successful From Mailbox 2 */
2195#define TA3 0x0008 /* Transmit Successful From Mailbox 3 */
2196#define TA4 0x0010 /* Transmit Successful From Mailbox 4 */
2197#define TA5 0x0020 /* Transmit Successful From Mailbox 5 */
2198#define TA6 0x0040 /* Transmit Successful From Mailbox 6 */
2199#define TA7 0x0080 /* Transmit Successful From Mailbox 7 */
2200#define TA8 0x0100 /* Transmit Successful From Mailbox 8 */
2201#define TA9 0x0200 /* Transmit Successful From Mailbox 9 */
2202#define TA10 0x0400 /* Transmit Successful From Mailbox 10 */
2203#define TA11 0x0800 /* Transmit Successful From Mailbox 11 */
2204#define TA12 0x1000 /* Transmit Successful From Mailbox 12 */
2205#define TA13 0x2000 /* Transmit Successful From Mailbox 13 */
2206#define TA14 0x4000 /* Transmit Successful From Mailbox 14 */
2207#define TA15 0x8000 /* Transmit Successful From Mailbox 15 */
2208
2209/* CAN_TA2 Masks */
2210#define TA16 0x0001 /* Transmit Successful From Mailbox 16 */
2211#define TA17 0x0002 /* Transmit Successful From Mailbox 17 */
2212#define TA18 0x0004 /* Transmit Successful From Mailbox 18 */
2213#define TA19 0x0008 /* Transmit Successful From Mailbox 19 */
2214#define TA20 0x0010 /* Transmit Successful From Mailbox 20 */
2215#define TA21 0x0020 /* Transmit Successful From Mailbox 21 */
2216#define TA22 0x0040 /* Transmit Successful From Mailbox 22 */
2217#define TA23 0x0080 /* Transmit Successful From Mailbox 23 */
2218#define TA24 0x0100 /* Transmit Successful From Mailbox 24 */
2219#define TA25 0x0200 /* Transmit Successful From Mailbox 25 */
2220#define TA26 0x0400 /* Transmit Successful From Mailbox 26 */
2221#define TA27 0x0800 /* Transmit Successful From Mailbox 27 */
2222#define TA28 0x1000 /* Transmit Successful From Mailbox 28 */
2223#define TA29 0x2000 /* Transmit Successful From Mailbox 29 */
2224#define TA30 0x4000 /* Transmit Successful From Mailbox 30 */
2225#define TA31 0x8000 /* Transmit Successful From Mailbox 31 */
2226
2227/* CAN_MBTD Masks */
2228#define TDPTR 0x001F /* Mailbox To Temporarily Disable */
2229#define TDA 0x0040 /* Temporary Disable Acknowledge */
2230#define TDR 0x0080 /* Temporary Disable Request */
2231
2232/* CAN_RFH1 Masks */
2233#define RFH0 0x0001 /* Enable Automatic Remote Frame Handling For Mailbox 0 */
2234#define RFH1 0x0002 /* Enable Automatic Remote Frame Handling For Mailbox 1 */
2235#define RFH2 0x0004 /* Enable Automatic Remote Frame Handling For Mailbox 2 */
2236#define RFH3 0x0008 /* Enable Automatic Remote Frame Handling For Mailbox 3 */
2237#define RFH4 0x0010 /* Enable Automatic Remote Frame Handling For Mailbox 4 */
2238#define RFH5 0x0020 /* Enable Automatic Remote Frame Handling For Mailbox 5 */
2239#define RFH6 0x0040 /* Enable Automatic Remote Frame Handling For Mailbox 6 */
2240#define RFH7 0x0080 /* Enable Automatic Remote Frame Handling For Mailbox 7 */
2241#define RFH8 0x0100 /* Enable Automatic Remote Frame Handling For Mailbox 8 */
2242#define RFH9 0x0200 /* Enable Automatic Remote Frame Handling For Mailbox 9 */
2243#define RFH10 0x0400 /* Enable Automatic Remote Frame Handling For Mailbox 10 */
2244#define RFH11 0x0800 /* Enable Automatic Remote Frame Handling For Mailbox 11 */
2245#define RFH12 0x1000 /* Enable Automatic Remote Frame Handling For Mailbox 12 */
2246#define RFH13 0x2000 /* Enable Automatic Remote Frame Handling For Mailbox 13 */
2247#define RFH14 0x4000 /* Enable Automatic Remote Frame Handling For Mailbox 14 */
2248#define RFH15 0x8000 /* Enable Automatic Remote Frame Handling For Mailbox 15 */
2249
2250/* CAN_RFH2 Masks */
2251#define RFH16 0x0001 /* Enable Automatic Remote Frame Handling For Mailbox 16 */
2252#define RFH17 0x0002 /* Enable Automatic Remote Frame Handling For Mailbox 17 */
2253#define RFH18 0x0004 /* Enable Automatic Remote Frame Handling For Mailbox 18 */
2254#define RFH19 0x0008 /* Enable Automatic Remote Frame Handling For Mailbox 19 */
2255#define RFH20 0x0010 /* Enable Automatic Remote Frame Handling For Mailbox 20 */
2256#define RFH21 0x0020 /* Enable Automatic Remote Frame Handling For Mailbox 21 */
2257#define RFH22 0x0040 /* Enable Automatic Remote Frame Handling For Mailbox 22 */
2258#define RFH23 0x0080 /* Enable Automatic Remote Frame Handling For Mailbox 23 */
2259#define RFH24 0x0100 /* Enable Automatic Remote Frame Handling For Mailbox 24 */
2260#define RFH25 0x0200 /* Enable Automatic Remote Frame Handling For Mailbox 25 */
2261#define RFH26 0x0400 /* Enable Automatic Remote Frame Handling For Mailbox 26 */
2262#define RFH27 0x0800 /* Enable Automatic Remote Frame Handling For Mailbox 27 */
2263#define RFH28 0x1000 /* Enable Automatic Remote Frame Handling For Mailbox 28 */
2264#define RFH29 0x2000 /* Enable Automatic Remote Frame Handling For Mailbox 29 */
2265#define RFH30 0x4000 /* Enable Automatic Remote Frame Handling For Mailbox 30 */
2266#define RFH31 0x8000 /* Enable Automatic Remote Frame Handling For Mailbox 31 */
2267
2268/* CAN_MBTIF1 Masks */
2269#define MBTIF0 0x0001 /* TX Interrupt Active In Mailbox 0 */
2270#define MBTIF1 0x0002 /* TX Interrupt Active In Mailbox 1 */
2271#define MBTIF2 0x0004 /* TX Interrupt Active In Mailbox 2 */
2272#define MBTIF3 0x0008 /* TX Interrupt Active In Mailbox 3 */
2273#define MBTIF4 0x0010 /* TX Interrupt Active In Mailbox 4 */
2274#define MBTIF5 0x0020 /* TX Interrupt Active In Mailbox 5 */
2275#define MBTIF6 0x0040 /* TX Interrupt Active In Mailbox 6 */
2276#define MBTIF7 0x0080 /* TX Interrupt Active In Mailbox 7 */
2277#define MBTIF8 0x0100 /* TX Interrupt Active In Mailbox 8 */
2278#define MBTIF9 0x0200 /* TX Interrupt Active In Mailbox 9 */
2279#define MBTIF10 0x0400 /* TX Interrupt Active In Mailbox 10 */
2280#define MBTIF11 0x0800 /* TX Interrupt Active In Mailbox 11 */
2281#define MBTIF12 0x1000 /* TX Interrupt Active In Mailbox 12 */
2282#define MBTIF13 0x2000 /* TX Interrupt Active In Mailbox 13 */
2283#define MBTIF14 0x4000 /* TX Interrupt Active In Mailbox 14 */
2284#define MBTIF15 0x8000 /* TX Interrupt Active In Mailbox 15 */
2285
2286/* CAN_MBTIF2 Masks */
2287#define MBTIF16 0x0001 /* TX Interrupt Active In Mailbox 16 */
2288#define MBTIF17 0x0002 /* TX Interrupt Active In Mailbox 17 */
2289#define MBTIF18 0x0004 /* TX Interrupt Active In Mailbox 18 */
2290#define MBTIF19 0x0008 /* TX Interrupt Active In Mailbox 19 */
2291#define MBTIF20 0x0010 /* TX Interrupt Active In Mailbox 20 */
2292#define MBTIF21 0x0020 /* TX Interrupt Active In Mailbox 21 */
2293#define MBTIF22 0x0040 /* TX Interrupt Active In Mailbox 22 */
2294#define MBTIF23 0x0080 /* TX Interrupt Active In Mailbox 23 */
2295#define MBTIF24 0x0100 /* TX Interrupt Active In Mailbox 24 */
2296#define MBTIF25 0x0200 /* TX Interrupt Active In Mailbox 25 */
2297#define MBTIF26 0x0400 /* TX Interrupt Active In Mailbox 26 */
2298#define MBTIF27 0x0800 /* TX Interrupt Active In Mailbox 27 */
2299#define MBTIF28 0x1000 /* TX Interrupt Active In Mailbox 28 */
2300#define MBTIF29 0x2000 /* TX Interrupt Active In Mailbox 29 */
2301#define MBTIF30 0x4000 /* TX Interrupt Active In Mailbox 30 */
2302#define MBTIF31 0x8000 /* TX Interrupt Active In Mailbox 31 */
2303
2304/* CAN_MBRIF1 Masks */
2305#define MBRIF0 0x0001 /* RX Interrupt Active In Mailbox 0 */
2306#define MBRIF1 0x0002 /* RX Interrupt Active In Mailbox 1 */
2307#define MBRIF2 0x0004 /* RX Interrupt Active In Mailbox 2 */
2308#define MBRIF3 0x0008 /* RX Interrupt Active In Mailbox 3 */
2309#define MBRIF4 0x0010 /* RX Interrupt Active In Mailbox 4 */
2310#define MBRIF5 0x0020 /* RX Interrupt Active In Mailbox 5 */
2311#define MBRIF6 0x0040 /* RX Interrupt Active In Mailbox 6 */
2312#define MBRIF7 0x0080 /* RX Interrupt Active In Mailbox 7 */
2313#define MBRIF8 0x0100 /* RX Interrupt Active In Mailbox 8 */
2314#define MBRIF9 0x0200 /* RX Interrupt Active In Mailbox 9 */
2315#define MBRIF10 0x0400 /* RX Interrupt Active In Mailbox 10 */
2316#define MBRIF11 0x0800 /* RX Interrupt Active In Mailbox 11 */
2317#define MBRIF12 0x1000 /* RX Interrupt Active In Mailbox 12 */
2318#define MBRIF13 0x2000 /* RX Interrupt Active In Mailbox 13 */
2319#define MBRIF14 0x4000 /* RX Interrupt Active In Mailbox 14 */
2320#define MBRIF15 0x8000 /* RX Interrupt Active In Mailbox 15 */
2321
2322/* CAN_MBRIF2 Masks */
2323#define MBRIF16 0x0001 /* RX Interrupt Active In Mailbox 16 */
2324#define MBRIF17 0x0002 /* RX Interrupt Active In Mailbox 17 */
2325#define MBRIF18 0x0004 /* RX Interrupt Active In Mailbox 18 */
2326#define MBRIF19 0x0008 /* RX Interrupt Active In Mailbox 19 */
2327#define MBRIF20 0x0010 /* RX Interrupt Active In Mailbox 20 */
2328#define MBRIF21 0x0020 /* RX Interrupt Active In Mailbox 21 */
2329#define MBRIF22 0x0040 /* RX Interrupt Active In Mailbox 22 */
2330#define MBRIF23 0x0080 /* RX Interrupt Active In Mailbox 23 */
2331#define MBRIF24 0x0100 /* RX Interrupt Active In Mailbox 24 */
2332#define MBRIF25 0x0200 /* RX Interrupt Active In Mailbox 25 */
2333#define MBRIF26 0x0400 /* RX Interrupt Active In Mailbox 26 */
2334#define MBRIF27 0x0800 /* RX Interrupt Active In Mailbox 27 */
2335#define MBRIF28 0x1000 /* RX Interrupt Active In Mailbox 28 */
2336#define MBRIF29 0x2000 /* RX Interrupt Active In Mailbox 29 */
2337#define MBRIF30 0x4000 /* RX Interrupt Active In Mailbox 30 */
2338#define MBRIF31 0x8000 /* RX Interrupt Active In Mailbox 31 */
2339
2340/* CAN_MBIM1 Masks */
2341#define MBIM0 0x0001 /* Enable Interrupt For Mailbox 0 */
2342#define MBIM1 0x0002 /* Enable Interrupt For Mailbox 1 */
2343#define MBIM2 0x0004 /* Enable Interrupt For Mailbox 2 */
2344#define MBIM3 0x0008 /* Enable Interrupt For Mailbox 3 */
2345#define MBIM4 0x0010 /* Enable Interrupt For Mailbox 4 */
2346#define MBIM5 0x0020 /* Enable Interrupt For Mailbox 5 */
2347#define MBIM6 0x0040 /* Enable Interrupt For Mailbox 6 */
2348#define MBIM7 0x0080 /* Enable Interrupt For Mailbox 7 */
2349#define MBIM8 0x0100 /* Enable Interrupt For Mailbox 8 */
2350#define MBIM9 0x0200 /* Enable Interrupt For Mailbox 9 */
2351#define MBIM10 0x0400 /* Enable Interrupt For Mailbox 10 */
2352#define MBIM11 0x0800 /* Enable Interrupt For Mailbox 11 */
2353#define MBIM12 0x1000 /* Enable Interrupt For Mailbox 12 */
2354#define MBIM13 0x2000 /* Enable Interrupt For Mailbox 13 */
2355#define MBIM14 0x4000 /* Enable Interrupt For Mailbox 14 */
2356#define MBIM15 0x8000 /* Enable Interrupt For Mailbox 15 */
2357
2358/* CAN_MBIM2 Masks */
2359#define MBIM16 0x0001 /* Enable Interrupt For Mailbox 16 */
2360#define MBIM17 0x0002 /* Enable Interrupt For Mailbox 17 */
2361#define MBIM18 0x0004 /* Enable Interrupt For Mailbox 18 */
2362#define MBIM19 0x0008 /* Enable Interrupt For Mailbox 19 */
2363#define MBIM20 0x0010 /* Enable Interrupt For Mailbox 20 */
2364#define MBIM21 0x0020 /* Enable Interrupt For Mailbox 21 */
2365#define MBIM22 0x0040 /* Enable Interrupt For Mailbox 22 */
2366#define MBIM23 0x0080 /* Enable Interrupt For Mailbox 23 */
2367#define MBIM24 0x0100 /* Enable Interrupt For Mailbox 24 */
2368#define MBIM25 0x0200 /* Enable Interrupt For Mailbox 25 */
2369#define MBIM26 0x0400 /* Enable Interrupt For Mailbox 26 */
2370#define MBIM27 0x0800 /* Enable Interrupt For Mailbox 27 */
2371#define MBIM28 0x1000 /* Enable Interrupt For Mailbox 28 */
2372#define MBIM29 0x2000 /* Enable Interrupt For Mailbox 29 */
2373#define MBIM30 0x4000 /* Enable Interrupt For Mailbox 30 */
2374#define MBIM31 0x8000 /* Enable Interrupt For Mailbox 31 */
2375
2376/* CAN_GIM Masks */
2377#define EWTIM 0x0001 /* Enable TX Error Count Interrupt */
2378#define EWRIM 0x0002 /* Enable RX Error Count Interrupt */
2379#define EPIM 0x0004 /* Enable Error-Passive Mode Interrupt */
2380#define BOIM 0x0008 /* Enable Bus Off Interrupt */
2381#define WUIM 0x0010 /* Enable Wake-Up Interrupt */
2382#define UIAIM 0x0020 /* Enable Access To Unimplemented Address Interrupt */
2383#define AAIM 0x0040 /* Enable Abort Acknowledge Interrupt */
2384#define RMLIM 0x0080 /* Enable RX Message Lost Interrupt */
2385#define UCEIM 0x0100 /* Enable Universal Counter Overflow Interrupt */
2386#define EXTIM 0x0200 /* Enable External Trigger Output Interrupt */
2387#define ADIM 0x0400 /* Enable Access Denied Interrupt */
2388
2389/* CAN_GIS Masks */
2390#define EWTIS 0x0001 /* TX Error Count IRQ Status */
2391#define EWRIS 0x0002 /* RX Error Count IRQ Status */
2392#define EPIS 0x0004 /* Error-Passive Mode IRQ Status */
2393#define BOIS 0x0008 /* Bus Off IRQ Status */
2394#define WUIS 0x0010 /* Wake-Up IRQ Status */
2395#define UIAIS 0x0020 /* Access To Unimplemented Address IRQ Status */
2396#define AAIS 0x0040 /* Abort Acknowledge IRQ Status */
2397#define RMLIS 0x0080 /* RX Message Lost IRQ Status */
2398#define UCEIS 0x0100 /* Universal Counter Overflow IRQ Status */
2399#define EXTIS 0x0200 /* External Trigger Output IRQ Status */
2400#define ADIS 0x0400 /* Access Denied IRQ Status */
2401
2402/* CAN_GIF Masks */
2403#define EWTIF 0x0001 /* TX Error Count IRQ Flag */
2404#define EWRIF 0x0002 /* RX Error Count IRQ Flag */
2405#define EPIF 0x0004 /* Error-Passive Mode IRQ Flag */
2406#define BOIF 0x0008 /* Bus Off IRQ Flag */
2407#define WUIF 0x0010 /* Wake-Up IRQ Flag */
2408#define UIAIF 0x0020 /* Access To Unimplemented Address IRQ Flag */
2409#define AAIF 0x0040 /* Abort Acknowledge IRQ Flag */
2410#define RMLIF 0x0080 /* RX Message Lost IRQ Flag */
2411#define UCEIF 0x0100 /* Universal Counter Overflow IRQ Flag */
2412#define EXTIF 0x0200 /* External Trigger Output IRQ Flag */
2413#define ADIF 0x0400 /* Access Denied IRQ Flag */
2414
2415/* CAN_UCCNF Masks */
2416#define UCCNF 0x000F /* Universal Counter Mode */
2417#define UC_STAMP 0x0001 /* Timestamp Mode */
2418#define UC_WDOG 0x0002 /* Watchdog Mode */
2419#define UC_AUTOTX 0x0003 /* Auto-Transmit Mode */
2420#define UC_ERROR 0x0006 /* CAN Error Frame Count */
2421#define UC_OVER 0x0007 /* CAN Overload Frame Count */
2422#define UC_LOST 0x0008 /* Arbitration Lost During TX Count */
2423#define UC_AA 0x0009 /* TX Abort Count */
2424#define UC_TA 0x000A /* TX Successful Count */
2425#define UC_REJECT 0x000B /* RX Message Rejected Count */
2426#define UC_RML 0x000C /* RX Message Lost Count */
2427#define UC_RX 0x000D /* Total Successful RX Messages Count */
2428#define UC_RMP 0x000E /* Successful RX W/Matching ID Count */
2429#define UC_ALL 0x000F /* Correct Message On CAN Bus Line Count */
2430#define UCRC 0x0020 /* Universal Counter Reload/Clear */
2431#define UCCT 0x0040 /* Universal Counter CAN Trigger */
2432#define UCE 0x0080 /* Universal Counter Enable */
2433
2434/* CAN_ESR Masks */
2435#define ACKE 0x0004 /* Acknowledge Error */
2436#define SER 0x0008 /* Stuff Error */
2437#define CRCE 0x0010 /* CRC Error */
2438#define SA0 0x0020 /* Stuck At Dominant Error */
2439#define BEF 0x0040 /* Bit Error Flag */
2440#define FER 0x0080 /* Form Error Flag */
2441
2442/* CAN_EWR Masks */
2443#define EWLREC 0x00FF /* RX Error Count Limit (For EWRIS) */
2444#define EWLTEC 0xFF00 /* TX Error Count Limit (For EWTIS) */
2445
2446/* ******************* PIN CONTROL REGISTER MASKS ************************/
2447/* PORT_MUX Masks */
2448#define PJSE 0x0001 /* Port J SPI/SPORT Enable */
2449#define PJSE_SPORT 0x0000 /* Enable TFS0/DT0PRI */
2450#define PJSE_SPI 0x0001 /* Enable SPI_SSEL3:2 */
2451
2452#define PJCE(x) (((x)&0x3)<<1) /* Port J CAN/SPI/SPORT Enable */
2453#define PJCE_SPORT 0x0000 /* Enable DR0SEC/DT0SEC */
2454#define PJCE_CAN 0x0002 /* Enable CAN RX/TX */
2455#define PJCE_SPI 0x0004 /* Enable SPI_SSEL7 */
2456
2457#define PFDE 0x0008 /* Port F DMA Request Enable */
2458#define PFDE_UART 0x0000 /* Enable UART0 RX/TX */
2459#define PFDE_DMA 0x0008 /* Enable DMAR1:0 */
2460
2461#define PFTE 0x0010 /* Port F Timer Enable */
2462#define PFTE_UART 0x0000 /* Enable UART1 RX/TX */
2463#define PFTE_TIMER 0x0010 /* Enable TMR7:6 */
2464
2465#define PFS6E 0x0020 /* Port F SPI SSEL 6 Enable */
2466#define PFS6E_TIMER 0x0000 /* Enable TMR5 */
2467#define PFS6E_SPI 0x0020 /* Enable SPI_SSEL6 */
2468
2469#define PFS5E 0x0040 /* Port F SPI SSEL 5 Enable */
2470#define PFS5E_TIMER 0x0000 /* Enable TMR4 */
2471#define PFS5E_SPI 0x0040 /* Enable SPI_SSEL5 */
2472
2473#define PFS4E 0x0080 /* Port F SPI SSEL 4 Enable */
2474#define PFS4E_TIMER 0x0000 /* Enable TMR3 */
2475#define PFS4E_SPI 0x0080 /* Enable SPI_SSEL4 */
2476
2477#define PFFE 0x0100 /* Port F PPI Frame Sync Enable */
2478#define PFFE_TIMER 0x0000 /* Enable TMR2 */
2479#define PFFE_PPI 0x0100 /* Enable PPI FS3 */
2480
2481#define PGSE 0x0200 /* Port G SPORT1 Secondary Enable */
2482#define PGSE_PPI 0x0000 /* Enable PPI D9:8 */
2483#define PGSE_SPORT 0x0200 /* Enable DR1SEC/DT1SEC */
2484
2485#define PGRE 0x0400 /* Port G SPORT1 Receive Enable */
2486#define PGRE_PPI 0x0000 /* Enable PPI D12:10 */
2487#define PGRE_SPORT 0x0400 /* Enable DR1PRI/RFS1/RSCLK1 */
2488
2489#define PGTE 0x0800 /* Port G SPORT1 Transmit Enable */
2490#define PGTE_PPI 0x0000 /* Enable PPI D15:13 */
2491#define PGTE_SPORT 0x0800 /* Enable DT1PRI/TFS1/TSCLK1 */
2492
2493/* ****************** HANDSHAKE DMA (HDMA) MASKS *********************/
2494/* HDMAx_CTL Masks */
2495#define HMDMAEN 0x0001 /* Enable Handshake DMA 0/1 */
2496#define REP 0x0002 /* HDMA Request Polarity */
2497#define UTE 0x0004 /* Urgency Threshold Enable */
2498#define OIE 0x0010 /* Overflow Interrupt Enable */
2499#define BDIE 0x0020 /* Block Done Interrupt Enable */
2500#define MBDI 0x0040 /* Mask Block Done IRQ If Pending ECNT */
2501#define DRQ 0x0300 /* HDMA Request Type */
2502#define DRQ_NONE 0x0000 /* No Request */
2503#define DRQ_SINGLE 0x0100 /* Channels Request Single */
2504#define DRQ_MULTI 0x0200 /* Channels Request Multi (Default) */
2505#define DRQ_URGENT 0x0300 /* Channels Request Multi Urgent */
2506#define RBC 0x1000 /* Reload BCNT With IBCNT */
2507#define PS 0x2000 /* HDMA Pin Status */
2508#define OI 0x4000 /* Overflow Interrupt Generated */
2509#define BDI 0x8000 /* Block Done Interrupt Generated */
2510
2511/* entry addresses of the user-callable Boot ROM functions */
2512
2513#define _BOOTROM_RESET 0xEF000000
2514#define _BOOTROM_FINAL_INIT 0xEF000002
2515#define _BOOTROM_DO_MEMORY_DMA 0xEF000006
2516#define _BOOTROM_BOOT_DXE_FLASH 0xEF000008
2517#define _BOOTROM_BOOT_DXE_SPI 0xEF00000A
2518#define _BOOTROM_BOOT_DXE_TWI 0xEF00000C
2519#define _BOOTROM_GET_DXE_ADDRESS_FLASH 0xEF000010
2520#define _BOOTROM_GET_DXE_ADDRESS_SPI 0xEF000012
2521#define _BOOTROM_GET_DXE_ADDRESS_TWI 0xEF000014
2522
2523/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
2524#define PGDE_UART PFDE_UART
2525#define PGDE_DMA PFDE_DMA
2526#define CKELOW SCKELOW
2527#endif /* _DEF_BF534_H */
diff --git a/include/asm-blackfin/mach-bf537/defBF537.h b/include/asm-blackfin/mach-bf537/defBF537.h
deleted file mode 100644
index abde24c6d3b1..000000000000
--- a/include/asm-blackfin/mach-bf537/defBF537.h
+++ /dev/null
@@ -1,405 +0,0 @@
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 <asm/mach-common/cdef_LPBlackfin.h>
37
38/* Include all MMR and bit defines common to BF534 */
39#include "defBF534.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 TXDWA 0x00000010 /* Transmit Frame DMA Word Alignment (Odd/Even*) */
294#define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
295
296#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
297
298/* EMAC_SYSTAT Masks */
299#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
300#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
301#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
302#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
303#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
304#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
305#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
306#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
307
308/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
309#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
310#define RX_COMP 0x00001000 /* RX Frame Complete */
311#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
312#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
313#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
314#define RX_CRC 0x00010000 /* RX Frame CRC Error */
315#define RX_LEN 0x00020000 /* RX Frame Length Error */
316#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
317#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
318#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
319#define RX_PHY 0x00200000 /* RX Frame PHY Error */
320#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
321#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
322#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
323#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
324#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
325#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
326#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
327#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
328#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
329#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
330
331/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
332#define TX_COMP 0x00000001 /* TX Frame Complete */
333#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
334#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
335#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
336#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
337#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
338#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
339#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
340#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
341#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
342#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
343#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
344#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
345#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
346#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
347
348/* EMAC_MMC_CTL Masks */
349#define RSTC 0x00000001 /* Reset All Counters */
350#define CROLL 0x00000002 /* Counter Roll-Over Enable */
351#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
352#define MMCE 0x00000008 /* Enable MMC Counter Operation */
353
354/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
355#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
356#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
357#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
358#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
359#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
360#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
361#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
362#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
363#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
364#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
365#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
366#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
367#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
368#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
369#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
370#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
371#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
372#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
373#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
374#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
375#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
376#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
377#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
378#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
379
380/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
381#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
382#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
383#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
384#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
385#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
386#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
387#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
388#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
389#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
390#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
391#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
392#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
393#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
394#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
395#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
396#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
397#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
398#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
399#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
400#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
401#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
402#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
403#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
404
405#endif /* _DEF_BF537_H */
diff --git a/include/asm-blackfin/mach-bf537/dma.h b/include/asm-blackfin/mach-bf537/dma.h
deleted file mode 100644
index 7a964040870a..000000000000
--- a/include/asm-blackfin/mach-bf537/dma.h
+++ /dev/null
@@ -1,55 +0,0 @@
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
deleted file mode 100644
index 2e68a8a1e730..000000000000
--- a/include/asm-blackfin/mach-bf537/irq.h
+++ /dev/null
@@ -1,214 +0,0 @@
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
38 * Core 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 * Softirq IVG14
49 * System Call --
50 * (lowest priority) IVG15
51 */
52
53#define SYS_IRQS 39
54#define NR_PERI_INTS 32
55
56/* The ABSTRACT IRQ definitions */
57/** the first seven of the following are fixed, the rest you change if you need to **/
58#define IRQ_EMU 0 /*Emulation */
59#define IRQ_RST 1 /*reset */
60#define IRQ_NMI 2 /*Non Maskable */
61#define IRQ_EVX 3 /*Exception */
62#define IRQ_UNUSED 4 /*- unused interrupt*/
63#define IRQ_HWERR 5 /*Hardware Error */
64#define IRQ_CORETMR 6 /*Core timer */
65
66#define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */
67#define IRQ_DMA_ERROR 8 /*DMA Error (general) */
68#define IRQ_GENERIC_ERROR 9 /*GENERIC Error Interrupt */
69#define IRQ_RTC 10 /*RTC Interrupt */
70#define IRQ_PPI 11 /*DMA0 Interrupt (PPI) */
71#define IRQ_SPORT0_RX 12 /*DMA3 Interrupt (SPORT0 RX) */
72#define IRQ_SPORT0_TX 13 /*DMA4 Interrupt (SPORT0 TX) */
73#define IRQ_SPORT1_RX 14 /*DMA5 Interrupt (SPORT1 RX) */
74#define IRQ_SPORT1_TX 15 /*DMA6 Interrupt (SPORT1 TX) */
75#define IRQ_TWI 16 /*TWI Interrupt */
76#define IRQ_SPI 17 /*DMA7 Interrupt (SPI) */
77#define IRQ_UART0_RX 18 /*DMA8 Interrupt (UART0 RX) */
78#define IRQ_UART0_TX 19 /*DMA9 Interrupt (UART0 TX) */
79#define IRQ_UART1_RX 20 /*DMA10 Interrupt (UART1 RX) */
80#define IRQ_UART1_TX 21 /*DMA11 Interrupt (UART1 TX) */
81#define IRQ_CAN_RX 22 /*CAN Receive Interrupt */
82#define IRQ_CAN_TX 23 /*CAN Transmit Interrupt */
83#define IRQ_MAC_RX 24 /*DMA1 (Ethernet RX) Interrupt */
84#define IRQ_MAC_TX 25 /*DMA2 (Ethernet TX) Interrupt */
85#define IRQ_TMR0 26 /*Timer 0 */
86#define IRQ_TMR1 27 /*Timer 1 */
87#define IRQ_TMR2 28 /*Timer 2 */
88#define IRQ_TMR3 29 /*Timer 3 */
89#define IRQ_TMR4 30 /*Timer 4 */
90#define IRQ_TMR5 31 /*Timer 5 */
91#define IRQ_TMR6 32 /*Timer 6 */
92#define IRQ_TMR7 33 /*Timer 7 */
93#define IRQ_PROG_INTA 34 /* PF Ports F&G (PF15:0) Interrupt A */
94#define IRQ_PORTG_INTB 35 /* PF Port G (PF15:0) Interrupt B */
95#define IRQ_MEM_DMA0 36 /*(Memory DMA Stream 0) */
96#define IRQ_MEM_DMA1 37 /*(Memory DMA Stream 1) */
97#define IRQ_PROG_INTB 38 /* PF Ports F (PF15:0) Interrupt B */
98#define IRQ_WATCH 38 /*Watch Dog Timer */
99
100#define IRQ_PPI_ERROR 42 /*PPI Error Interrupt */
101#define IRQ_CAN_ERROR 43 /*CAN Error Interrupt */
102#define IRQ_MAC_ERROR 44 /*PPI Error Interrupt */
103#define IRQ_SPORT0_ERROR 45 /*SPORT0 Error Interrupt */
104#define IRQ_SPORT1_ERROR 46 /*SPORT1 Error Interrupt */
105#define IRQ_SPI_ERROR 47 /*SPI Error Interrupt */
106#define IRQ_UART0_ERROR 48 /*UART Error Interrupt */
107#define IRQ_UART1_ERROR 49 /*UART Error Interrupt */
108
109#define IRQ_PF0 50
110#define IRQ_PF1 51
111#define IRQ_PF2 52
112#define IRQ_PF3 53
113#define IRQ_PF4 54
114#define IRQ_PF5 55
115#define IRQ_PF6 56
116#define IRQ_PF7 57
117#define IRQ_PF8 58
118#define IRQ_PF9 59
119#define IRQ_PF10 60
120#define IRQ_PF11 61
121#define IRQ_PF12 62
122#define IRQ_PF13 63
123#define IRQ_PF14 64
124#define IRQ_PF15 65
125
126#define IRQ_PG0 66
127#define IRQ_PG1 67
128#define IRQ_PG2 68
129#define IRQ_PG3 69
130#define IRQ_PG4 70
131#define IRQ_PG5 71
132#define IRQ_PG6 72
133#define IRQ_PG7 73
134#define IRQ_PG8 74
135#define IRQ_PG9 75
136#define IRQ_PG10 76
137#define IRQ_PG11 77
138#define IRQ_PG12 78
139#define IRQ_PG13 79
140#define IRQ_PG14 80
141#define IRQ_PG15 81
142
143#define IRQ_PH0 82
144#define IRQ_PH1 83
145#define IRQ_PH2 84
146#define IRQ_PH3 85
147#define IRQ_PH4 86
148#define IRQ_PH5 87
149#define IRQ_PH6 88
150#define IRQ_PH7 89
151#define IRQ_PH8 90
152#define IRQ_PH9 91
153#define IRQ_PH10 92
154#define IRQ_PH11 93
155#define IRQ_PH12 94
156#define IRQ_PH13 95
157#define IRQ_PH14 96
158#define IRQ_PH15 97
159
160#define GPIO_IRQ_BASE IRQ_PF0
161
162#define NR_IRQS (IRQ_PH15+1)
163
164#define IVG7 7
165#define IVG8 8
166#define IVG9 9
167#define IVG10 10
168#define IVG11 11
169#define IVG12 12
170#define IVG13 13
171#define IVG14 14
172#define IVG15 15
173
174/* IAR0 BIT FIELDS*/
175#define IRQ_PLL_WAKEUP_POS 0
176#define IRQ_DMA_ERROR_POS 4
177#define IRQ_ERROR_POS 8
178#define IRQ_RTC_POS 12
179#define IRQ_PPI_POS 16
180#define IRQ_SPORT0_RX_POS 20
181#define IRQ_SPORT0_TX_POS 24
182#define IRQ_SPORT1_RX_POS 28
183
184/* IAR1 BIT FIELDS*/
185#define IRQ_SPORT1_TX_POS 0
186#define IRQ_TWI_POS 4
187#define IRQ_SPI_POS 8
188#define IRQ_UART0_RX_POS 12
189#define IRQ_UART0_TX_POS 16
190#define IRQ_UART1_RX_POS 20
191#define IRQ_UART1_TX_POS 24
192#define IRQ_CAN_RX_POS 28
193
194/* IAR2 BIT FIELDS*/
195#define IRQ_CAN_TX_POS 0
196#define IRQ_MAC_RX_POS 4
197#define IRQ_MAC_TX_POS 8
198#define IRQ_TMR0_POS 12
199#define IRQ_TMR1_POS 16
200#define IRQ_TMR2_POS 20
201#define IRQ_TMR3_POS 24
202#define IRQ_TMR4_POS 28
203
204/* IAR3 BIT FIELDS*/
205#define IRQ_TMR5_POS 0
206#define IRQ_TMR6_POS 4
207#define IRQ_TMR7_POS 8
208#define IRQ_PROG_INTA_POS 12
209#define IRQ_PORTG_INTB_POS 16
210#define IRQ_MEM_DMA0_POS 20
211#define IRQ_MEM_DMA1_POS 24
212#define IRQ_WATCH_POS 28
213
214#endif /* _BF537_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf537/mem_init.h b/include/asm-blackfin/mach-bf537/mem_init.h
deleted file mode 100644
index f67698f670ca..000000000000
--- a/include/asm-blackfin/mach-bf537/mem_init.h
+++ /dev/null
@@ -1,303 +0,0 @@
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/* Equation from section 17 (p17-46) of BF533 HRM */
143#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
144
145/* Enable SCLK Out */
146#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
147
148#if defined CONFIG_CLKIN_HALF
149#define CLKIN_HALF 1
150#else
151#define CLKIN_HALF 0
152#endif
153
154#if defined CONFIG_PLL_BYPASS
155#define PLL_BYPASS 1
156#else
157#define PLL_BYPASS 0
158#endif
159
160/***************************************Currently Not Being Used *********************************/
161#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
162#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
163#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
164#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
165#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
166
167#if (flash_EBIU_AMBCTL_TT > 3)
168#define flash_EBIU_AMBCTL0_TT B0TT_4
169#endif
170#if (flash_EBIU_AMBCTL_TT == 3)
171#define flash_EBIU_AMBCTL0_TT B0TT_3
172#endif
173#if (flash_EBIU_AMBCTL_TT == 2)
174#define flash_EBIU_AMBCTL0_TT B0TT_2
175#endif
176#if (flash_EBIU_AMBCTL_TT < 2)
177#define flash_EBIU_AMBCTL0_TT B0TT_1
178#endif
179
180#if (flash_EBIU_AMBCTL_ST > 3)
181#define flash_EBIU_AMBCTL0_ST B0ST_4
182#endif
183#if (flash_EBIU_AMBCTL_ST == 3)
184#define flash_EBIU_AMBCTL0_ST B0ST_3
185#endif
186#if (flash_EBIU_AMBCTL_ST == 2)
187#define flash_EBIU_AMBCTL0_ST B0ST_2
188#endif
189#if (flash_EBIU_AMBCTL_ST < 2)
190#define flash_EBIU_AMBCTL0_ST B0ST_1
191#endif
192
193#if (flash_EBIU_AMBCTL_HT > 2)
194#define flash_EBIU_AMBCTL0_HT B0HT_3
195#endif
196#if (flash_EBIU_AMBCTL_HT == 2)
197#define flash_EBIU_AMBCTL0_HT B0HT_2
198#endif
199#if (flash_EBIU_AMBCTL_HT == 1)
200#define flash_EBIU_AMBCTL0_HT B0HT_1
201#endif
202#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
203#define flash_EBIU_AMBCTL0_HT B0HT_0
204#endif
205#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
206#define flash_EBIU_AMBCTL0_HT B0HT_1
207#endif
208
209#if (flash_EBIU_AMBCTL_WAT > 14)
210#define flash_EBIU_AMBCTL0_WAT B0WAT_15
211#endif
212#if (flash_EBIU_AMBCTL_WAT == 14)
213#define flash_EBIU_AMBCTL0_WAT B0WAT_14
214#endif
215#if (flash_EBIU_AMBCTL_WAT == 13)
216#define flash_EBIU_AMBCTL0_WAT B0WAT_13
217#endif
218#if (flash_EBIU_AMBCTL_WAT == 12)
219#define flash_EBIU_AMBCTL0_WAT B0WAT_12
220#endif
221#if (flash_EBIU_AMBCTL_WAT == 11)
222#define flash_EBIU_AMBCTL0_WAT B0WAT_11
223#endif
224#if (flash_EBIU_AMBCTL_WAT == 10)
225#define flash_EBIU_AMBCTL0_WAT B0WAT_10
226#endif
227#if (flash_EBIU_AMBCTL_WAT == 9)
228#define flash_EBIU_AMBCTL0_WAT B0WAT_9
229#endif
230#if (flash_EBIU_AMBCTL_WAT == 8)
231#define flash_EBIU_AMBCTL0_WAT B0WAT_8
232#endif
233#if (flash_EBIU_AMBCTL_WAT == 7)
234#define flash_EBIU_AMBCTL0_WAT B0WAT_7
235#endif
236#if (flash_EBIU_AMBCTL_WAT == 6)
237#define flash_EBIU_AMBCTL0_WAT B0WAT_6
238#endif
239#if (flash_EBIU_AMBCTL_WAT == 5)
240#define flash_EBIU_AMBCTL0_WAT B0WAT_5
241#endif
242#if (flash_EBIU_AMBCTL_WAT == 4)
243#define flash_EBIU_AMBCTL0_WAT B0WAT_4
244#endif
245#if (flash_EBIU_AMBCTL_WAT == 3)
246#define flash_EBIU_AMBCTL0_WAT B0WAT_3
247#endif
248#if (flash_EBIU_AMBCTL_WAT == 2)
249#define flash_EBIU_AMBCTL0_WAT B0WAT_2
250#endif
251#if (flash_EBIU_AMBCTL_WAT == 1)
252#define flash_EBIU_AMBCTL0_WAT B0WAT_1
253#endif
254
255#if (flash_EBIU_AMBCTL_RAT > 14)
256#define flash_EBIU_AMBCTL0_RAT B0RAT_15
257#endif
258#if (flash_EBIU_AMBCTL_RAT == 14)
259#define flash_EBIU_AMBCTL0_RAT B0RAT_14
260#endif
261#if (flash_EBIU_AMBCTL_RAT == 13)
262#define flash_EBIU_AMBCTL0_RAT B0RAT_13
263#endif
264#if (flash_EBIU_AMBCTL_RAT == 12)
265#define flash_EBIU_AMBCTL0_RAT B0RAT_12
266#endif
267#if (flash_EBIU_AMBCTL_RAT == 11)
268#define flash_EBIU_AMBCTL0_RAT B0RAT_11
269#endif
270#if (flash_EBIU_AMBCTL_RAT == 10)
271#define flash_EBIU_AMBCTL0_RAT B0RAT_10
272#endif
273#if (flash_EBIU_AMBCTL_RAT == 9)
274#define flash_EBIU_AMBCTL0_RAT B0RAT_9
275#endif
276#if (flash_EBIU_AMBCTL_RAT == 8)
277#define flash_EBIU_AMBCTL0_RAT B0RAT_8
278#endif
279#if (flash_EBIU_AMBCTL_RAT == 7)
280#define flash_EBIU_AMBCTL0_RAT B0RAT_7
281#endif
282#if (flash_EBIU_AMBCTL_RAT == 6)
283#define flash_EBIU_AMBCTL0_RAT B0RAT_6
284#endif
285#if (flash_EBIU_AMBCTL_RAT == 5)
286#define flash_EBIU_AMBCTL0_RAT B0RAT_5
287#endif
288#if (flash_EBIU_AMBCTL_RAT == 4)
289#define flash_EBIU_AMBCTL0_RAT B0RAT_4
290#endif
291#if (flash_EBIU_AMBCTL_RAT == 3)
292#define flash_EBIU_AMBCTL0_RAT B0RAT_3
293#endif
294#if (flash_EBIU_AMBCTL_RAT == 2)
295#define flash_EBIU_AMBCTL0_RAT B0RAT_2
296#endif
297#if (flash_EBIU_AMBCTL_RAT == 1)
298#define flash_EBIU_AMBCTL0_RAT B0RAT_1
299#endif
300
301#define flash_EBIU_AMBCTL0 \
302 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
303 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
deleted file mode 100644
index 5078b669431f..000000000000
--- a/include/asm-blackfin/mach-bf537/mem_map.h
+++ /dev/null
@@ -1,179 +0,0 @@
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#define BOOT_ROM_LENGTH 0x800
51
52/* Level 1 Memory */
53
54/* Memory Map for ADSP-BF537 processors */
55
56#ifdef CONFIG_BFIN_ICACHE
57#define BFIN_ICACHESIZE (16*1024)
58#else
59#define BFIN_ICACHESIZE (0*1024)
60#endif
61
62
63#ifdef CONFIG_BF537
64#define L1_CODE_START 0xFFA00000
65#define L1_DATA_A_START 0xFF800000
66#define L1_DATA_B_START 0xFF900000
67
68#define L1_CODE_LENGTH 0xC000
69
70#ifdef CONFIG_BFIN_DCACHE
71
72#ifdef CONFIG_BFIN_DCACHE_BANKA
73#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
74#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
75#define L1_DATA_B_LENGTH 0x8000
76#define BFIN_DCACHESIZE (16*1024)
77#define BFIN_DSUPBANKS 1
78#else
79#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
80#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
81#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
82#define BFIN_DCACHESIZE (32*1024)
83#define BFIN_DSUPBANKS 2
84#endif
85
86#else
87#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
88#define L1_DATA_A_LENGTH 0x8000
89#define L1_DATA_B_LENGTH 0x8000
90#define BFIN_DCACHESIZE (0*1024)
91#define BFIN_DSUPBANKS 0
92#endif /*CONFIG_BFIN_DCACHE*/
93
94#endif /*CONFIG_BF537*/
95
96/* Memory Map for ADSP-BF536 processors */
97
98#ifdef CONFIG_BF536
99#define L1_CODE_START 0xFFA00000
100#define L1_DATA_A_START 0xFF804000
101#define L1_DATA_B_START 0xFF904000
102
103#define L1_CODE_LENGTH 0xC000
104
105
106#ifdef CONFIG_BFIN_DCACHE
107
108#ifdef CONFIG_BFIN_DCACHE_BANKA
109#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
110#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
111#define L1_DATA_B_LENGTH 0x4000
112#define BFIN_DCACHESIZE (16*1024)
113#define BFIN_DSUPBANKS 1
114
115#else
116#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
117#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
118#define L1_DATA_B_LENGTH (0x4000 - 0x4000)
119#define BFIN_DCACHESIZE (32*1024)
120#define BFIN_DSUPBANKS 2
121#endif
122
123#else
124#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
125#define L1_DATA_A_LENGTH 0x4000
126#define L1_DATA_B_LENGTH 0x4000
127#define BFIN_DCACHESIZE (0*1024)
128#define BFIN_DSUPBANKS 0
129#endif /*CONFIG_BFIN_DCACHE*/
130
131#endif
132
133/* Memory Map for ADSP-BF534 processors */
134
135#ifdef CONFIG_BF534
136#define L1_CODE_START 0xFFA00000
137#define L1_DATA_A_START 0xFF800000
138#define L1_DATA_B_START 0xFF900000
139
140#define L1_CODE_LENGTH 0xC000
141
142#ifdef CONFIG_BFIN_DCACHE
143
144#ifdef CONFIG_BFIN_DCACHE_BANKA
145#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
146#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
147#define L1_DATA_B_LENGTH 0x8000
148#define BFIN_DCACHESIZE (16*1024)
149#define BFIN_DSUPBANKS 1
150
151#else
152#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
153#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
154#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
155#define BFIN_DCACHESIZE (32*1024)
156#define BFIN_DSUPBANKS 2
157#endif
158
159#else
160#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
161#define L1_DATA_A_LENGTH 0x8000
162#define L1_DATA_B_LENGTH 0x8000
163#define BFIN_DCACHESIZE (0*1024)
164#define BFIN_DSUPBANKS 0
165#endif /*CONFIG_BFIN_DCACHE*/
166
167#endif
168
169/* Level 2 Memory - none */
170
171#define L2_START 0
172#define L2_LENGTH 0
173
174/* Scratch Pad Memory */
175
176#define L1_SCRATCH_START 0xFFB00000
177#define L1_SCRATCH_LENGTH 0x1000
178
179#endif /* _MEM_MAP_537_H_ */
diff --git a/include/asm-blackfin/mach-bf537/portmux.h b/include/asm-blackfin/mach-bf537/portmux.h
deleted file mode 100644
index 78fee6e0f237..000000000000
--- a/include/asm-blackfin/mach-bf537/portmux.h
+++ /dev/null
@@ -1,144 +0,0 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define MAX_RESOURCES (MAX_BLACKFIN_GPIOS + GPIO_BANKSIZE) /* We additionally handle PORTJ */
5
6#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
7#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
8#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
9#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
10#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
11#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
12#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
13#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
14#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
15#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
16#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
17#define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
18#define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
19#define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
20#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
21#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
22#define P_DMAR0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
23#define P_DMAR1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
24#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
25#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
26#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
27#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
28#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
29#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
30#define P_PPI0_FS2 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
31#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
32#define P_TACLK0 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
33#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
34
35#define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
36#define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
37#define P_PPI0_D2 (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(0))
38#define P_PPI0_D3 (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
39#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
40#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
41#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
42#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
43#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
44#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
45#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
46#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0))
47#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
48#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
49#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
50#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
51#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(1))
52#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(1))
53#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(1))
54#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
55#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(1))
56#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
57#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(1))
58#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(1))
59
60#define P_MII0_ETxD0 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
61#define P_MII0_ETxD1 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
62#define P_MII0_ETxD2 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
63#define P_MII0_ETxD3 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(0))
64#define P_MII0_ETxEN (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(0))
65#define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(0))
66#define P_MII0_PHYINT (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(0))
67#define P_MII0_COL (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(0))
68#define P_MII0_ERxD0 (P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(0))
69#define P_MII0_ERxD1 (P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(0))
70#define P_MII0_ERxD2 (P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(0))
71#define P_MII0_ERxD3 (P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(0))
72#define P_MII0_ERxDV (P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(0))
73#define P_MII0_ERxCLK (P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(0))
74#define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PH14) | P_FUNCT(0))
75#define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(0))
76#define P_RMII0_REF_CLK (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(1))
77#define P_RMII0_MDINT (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(1))
78#define P_RMII0_CRS_DV (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(1))
79
80#define PORT_PJ0 (GPIO_PH15 + 1)
81#define PORT_PJ1 (GPIO_PH15 + 2)
82#define PORT_PJ2 (GPIO_PH15 + 3)
83#define PORT_PJ3 (GPIO_PH15 + 4)
84#define PORT_PJ4 (GPIO_PH15 + 5)
85#define PORT_PJ5 (GPIO_PH15 + 6)
86#define PORT_PJ6 (GPIO_PH15 + 7)
87#define PORT_PJ7 (GPIO_PH15 + 8)
88#define PORT_PJ8 (GPIO_PH15 + 9)
89#define PORT_PJ9 (GPIO_PH15 + 10)
90#define PORT_PJ10 (GPIO_PH15 + 11)
91#define PORT_PJ11 (GPIO_PH15 + 12)
92
93#define P_MDC (P_DEFINED | P_IDENT(PORT_PJ0) | P_FUNCT(0))
94#define P_MDIO (P_DEFINED | P_IDENT(PORT_PJ1) | P_FUNCT(0))
95#define P_TWI0_SCL (P_DEFINED | P_IDENT(PORT_PJ2) | P_FUNCT(0))
96#define P_TWI0_SDA (P_DEFINED | P_IDENT(PORT_PJ3) | P_FUNCT(0))
97#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(PORT_PJ4) | P_FUNCT(0))
98#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(0))
99#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(PORT_PJ6) | P_FUNCT(0))
100#define P_SPORT0_RFS (P_DEFINED | P_IDENT(PORT_PJ7) | P_FUNCT(0))
101#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(PORT_PJ8) | P_FUNCT(0))
102#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(PORT_PJ9) | P_FUNCT(0))
103#define P_SPORT0_TFS (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(0))
104#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(0))
105#define P_CAN0_RX (P_DEFINED | P_IDENT(PORT_PJ4) | P_FUNCT(1))
106#define P_CAN0_TX (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(1))
107#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(1))
108#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
109#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2))
110
111#define P_MII0 {\
112 P_MII0_ETxD0, \
113 P_MII0_ETxD1, \
114 P_MII0_ETxD2, \
115 P_MII0_ETxD3, \
116 P_MII0_ETxEN, \
117 P_MII0_TxCLK, \
118 P_MII0_PHYINT, \
119 P_MII0_COL, \
120 P_MII0_ERxD0, \
121 P_MII0_ERxD1, \
122 P_MII0_ERxD2, \
123 P_MII0_ERxD3, \
124 P_MII0_ERxDV, \
125 P_MII0_ERxCLK, \
126 P_MII0_ERxER, \
127 P_MII0_CRS, \
128 P_MDC, \
129 P_MDIO, 0}
130
131
132#define P_RMII0 {\
133 P_MII0_ETxD0, \
134 P_MII0_ETxD1, \
135 P_MII0_ETxEN, \
136 P_MII0_ERxD0, \
137 P_MII0_ERxD1, \
138 P_MII0_ERxER, \
139 P_RMII0_REF_CLK, \
140 P_RMII0_MDINT, \
141 P_RMII0_CRS_DV, \
142 P_MDC, \
143 P_MDIO, 0}
144#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf548/anomaly.h b/include/asm-blackfin/mach-bf548/anomaly.h
deleted file mode 100644
index 3ad59655881a..000000000000
--- a/include/asm-blackfin/mach-bf548/anomaly.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/anomaly.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2004-2007 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9/* This file shoule be up to date with:
10 * - Revision E, 11/28/2007; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List
11 */
12
13#ifndef _MACH_ANOMALY_H_
14#define _MACH_ANOMALY_H_
15
16/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot 2 Not Supported */
17#define ANOMALY_05000074 (1)
18/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
19#define ANOMALY_05000119 (1)
20/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
21#define ANOMALY_05000122 (1)
22/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */
23#define ANOMALY_05000245 (1)
24/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
25#define ANOMALY_05000265 (1)
26/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
27#define ANOMALY_05000272 (1)
28/* False Hardware Error Exception when ISR context is not restored */
29#define ANOMALY_05000281 (__SILICON_REVISION__ < 1)
30/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */
31#define ANOMALY_05000304 (__SILICON_REVISION__ < 1)
32/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
33#define ANOMALY_05000310 (1)
34/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
35#define ANOMALY_05000312 (__SILICON_REVISION__ < 1)
36/* TWI Slave Boot Mode Is Not Functional */
37#define ANOMALY_05000324 (__SILICON_REVISION__ < 1)
38/* External FIFO Boot Mode Is Not Functional */
39#define ANOMALY_05000325 (__SILICON_REVISION__ < 1)
40/* Data Lost When Core and DMA Accesses Are Made to the USB FIFO Simultaneously */
41#define ANOMALY_05000327 (__SILICON_REVISION__ < 1)
42/* Incorrect Access of OTP_STATUS During otp_write() Function */
43#define ANOMALY_05000328 (__SILICON_REVISION__ < 1)
44/* Synchronous Burst Flash Boot Mode Is Not Functional */
45#define ANOMALY_05000329 (__SILICON_REVISION__ < 1)
46/* Host DMA Boot Mode Is Not Functional */
47#define ANOMALY_05000330 (__SILICON_REVISION__ < 1)
48/* Inadequate Timing Margins on DDR DQS to DQ and DQM Skew */
49#define ANOMALY_05000334 (__SILICON_REVISION__ < 1)
50/* Inadequate Rotary Debounce Logic Duration */
51#define ANOMALY_05000335 (__SILICON_REVISION__ < 1)
52/* Phantom Interrupt Occurs After First Configuration of Host DMA Port */
53#define ANOMALY_05000336 (__SILICON_REVISION__ < 1)
54/* Disallowed Configuration Prevents Subsequent Allowed Configuration on Host DMA Port */
55#define ANOMALY_05000337 (__SILICON_REVISION__ < 1)
56/* Slave-Mode SPI0 MISO Failure With CPHA = 0 */
57#define ANOMALY_05000338 (__SILICON_REVISION__ < 1)
58/* If Memory Reads Are Enabled on SDH or HOSTDP, Other DMAC1 Peripherals Cannot Read */
59#define ANOMALY_05000340 (__SILICON_REVISION__ < 1)
60/* Boot Host Wait (HWAIT) and Boot Host Wait Alternate (HWAITA) Signals Are Swapped */
61#define ANOMALY_05000344 (__SILICON_REVISION__ < 1)
62/* USB Calibration Value Is Not Intialized */
63#define ANOMALY_05000346 (__SILICON_REVISION__ < 1)
64/* Boot ROM Kernel Incorrectly Alters Reset Value of USB Register */
65#define ANOMALY_05000347 (__SILICON_REVISION__ < 1)
66/* Data Lost when Core Reads SDH Data FIFO */
67#define ANOMALY_05000349 (__SILICON_REVISION__ < 1)
68/* PLL Status Register Is Inaccurate */
69#define ANOMALY_05000351 (__SILICON_REVISION__ < 1)
70/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
71#define ANOMALY_05000357 (1)
72/* External Memory Read Access Hangs Core With PLL Bypass */
73#define ANOMALY_05000360 (1)
74/* DMAs that Go Urgent during Tight Core Writes to External Memory Are Blocked */
75#define ANOMALY_05000365 (1)
76/* Addressing Conflict between Boot ROM and Asynchronous Memory */
77#define ANOMALY_05000369 (1)
78/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
79#define ANOMALY_05000371 (1)
80/* Mobile DDR Operation Not Functional */
81#define ANOMALY_05000377 (1)
82/* Security/Authentication Speedpath Causes Authentication To Fail To Initiate */
83#define ANOMALY_05000378 (1)
84
85/* Anomalies that don't exist on this proc */
86#define ANOMALY_05000125 (0)
87#define ANOMALY_05000158 (0)
88#define ANOMALY_05000183 (0)
89#define ANOMALY_05000198 (0)
90#define ANOMALY_05000230 (0)
91#define ANOMALY_05000244 (0)
92#define ANOMALY_05000261 (0)
93#define ANOMALY_05000263 (0)
94#define ANOMALY_05000266 (0)
95#define ANOMALY_05000273 (0)
96#define ANOMALY_05000311 (0)
97#define ANOMALY_05000323 (0)
98#define ANOMALY_05000363 (0)
99
100#endif
diff --git a/include/asm-blackfin/mach-bf548/bf548.h b/include/asm-blackfin/mach-bf548/bf548.h
deleted file mode 100644
index e748588e8930..000000000000
--- a/include/asm-blackfin/mach-bf548/bf548.h
+++ /dev/null
@@ -1,127 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/bf548.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: System MMR register and memory map for ADSP-BF548
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#ifndef __MACH_BF548_H__
31#define __MACH_BF548_H__
32
33#define SUPPORTED_REVID 0
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 BFIN_DSUBBANKS 4
56#define BFIN_DWAYS 2
57#define BFIN_DLINES 64
58#define BFIN_ISUBBANKS 4
59#define BFIN_IWAYS 4
60#define BFIN_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/********************************* EBIU Settings ************************************/
83#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
84#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
85
86#ifdef CONFIG_C_AMBEN_ALL
87#define V_AMBEN AMBEN_ALL
88#endif
89#ifdef CONFIG_C_AMBEN
90#define V_AMBEN 0x0
91#endif
92#ifdef CONFIG_C_AMBEN_B0
93#define V_AMBEN AMBEN_B0
94#endif
95#ifdef CONFIG_C_AMBEN_B0_B1
96#define V_AMBEN AMBEN_B0_B1
97#endif
98#ifdef CONFIG_C_AMBEN_B0_B1_B2
99#define V_AMBEN AMBEN_B0_B1_B2
100#endif
101#ifdef CONFIG_C_AMCKEN
102#define V_AMCKEN AMCKEN
103#else
104#define V_AMCKEN 0x0
105#endif
106
107#define AMGCTLVAL (V_AMBEN | V_AMCKEN)
108
109#if defined(CONFIG_BF542)
110# define CPU "BF542"
111# define CPUID 0x027c8000
112#elif defined(CONFIG_BF544)
113# define CPU "BF544"
114# define CPUID 0x027c8000
115#elif defined(CONFIG_BF547)
116# define CPU "BF547"
117#elif defined(CONFIG_BF548)
118# define CPU "BF548"
119# define CPUID 0x027c6000
120#elif defined(CONFIG_BF549)
121# define CPU "BF549"
122#else
123# define CPU "UNKNOWN"
124# define CPUID 0x0
125#endif
126
127#endif /* __MACH_BF48_H__ */
diff --git a/include/asm-blackfin/mach-bf548/bf54x-lq043.h b/include/asm-blackfin/mach-bf548/bf54x-lq043.h
deleted file mode 100644
index 9c7ca62a45eb..000000000000
--- a/include/asm-blackfin/mach-bf548/bf54x-lq043.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef BF54X_LQ043_H
2#define BF54X_LQ043_H
3
4struct bfin_bf54xfb_val {
5 unsigned int defval;
6 unsigned int min;
7 unsigned int max;
8};
9
10struct bfin_bf54xfb_mach_info {
11 unsigned char fixed_syncs; /* do not update sync/border */
12
13 /* LCD types */
14 int type;
15
16 /* Screen size */
17 int width;
18 int height;
19
20 /* Screen info */
21 struct bfin_bf54xfb_val xres;
22 struct bfin_bf54xfb_val yres;
23 struct bfin_bf54xfb_val bpp;
24
25 /* GPIOs */
26 unsigned short disp;
27
28};
29
30#endif /* BF54X_LQ043_H */
diff --git a/include/asm-blackfin/mach-bf548/bf54x_keys.h b/include/asm-blackfin/mach-bf548/bf54x_keys.h
deleted file mode 100644
index 1fb4ec77cc25..000000000000
--- a/include/asm-blackfin/mach-bf548/bf54x_keys.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _BFIN_KPAD_H
2#define _BFIN_KPAD_H
3
4struct bfin_kpad_platform_data {
5 int rows;
6 int cols;
7 const unsigned int *keymap;
8 unsigned short keymapsize;
9 unsigned short repeat;
10 u32 debounce_time; /* in ns */
11 u32 coldrive_time; /* in ns */
12 u32 keyup_test_interval; /* in ms */
13};
14
15#define KEYVAL(col, row, val) (((1 << col) << 24) | ((1 << row) << 16) | (val))
16
17#endif
diff --git a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
deleted file mode 100644
index 5e29446a8e03..000000000000
--- a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
+++ /dev/null
@@ -1,220 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * blackfin serial driver head file
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#include <linux/serial.h>
33#include <asm/dma.h>
34#include <asm/portmux.h>
35
36#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
37#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
38#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
39#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER_SET))
40#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
41#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
42#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
43#define UART_GET_MSR(uart) bfin_read16(((uart)->port.membase + OFFSET_MSR))
44#define UART_GET_MCR(uart) bfin_read16(((uart)->port.membase + OFFSET_MCR))
45
46#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
47#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
48#define UART_SET_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER_SET),v)
49#define UART_CLEAR_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER_CLEAR),v)
50#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
51#define UART_PUT_LSR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LSR),v)
52#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
53#define UART_CLEAR_LSR(uart) bfin_write16(((uart)->port.membase + OFFSET_LSR), -1)
54#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
55#define UART_PUT_MCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_MCR),v)
56
57#define UART_SET_DLAB(uart) /* MMRs not muxed on BF54x */
58#define UART_CLEAR_DLAB(uart) /* MMRs not muxed on BF54x */
59
60#define UART_GET_CTS(x) (UART_GET_MSR(x) & CTS)
61#define UART_SET_RTS(x) (UART_PUT_MCR(x, UART_GET_MCR(x) | MRTS))
62#define UART_CLEAR_RTS(x) (UART_PUT_MCR(x, UART_GET_MCR(x) & ~MRTS))
63#define UART_ENABLE_INTS(x, v) UART_SET_IER(x, v)
64#define UART_DISABLE_INTS(x) UART_CLEAR_IER(x, 0xF)
65
66#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
67# define CONFIG_SERIAL_BFIN_CTSRTS
68
69# ifndef CONFIG_UART0_CTS_PIN
70# define CONFIG_UART0_CTS_PIN -1
71# endif
72
73# ifndef CONFIG_UART0_RTS_PIN
74# define CONFIG_UART0_RTS_PIN -1
75# endif
76
77# ifndef CONFIG_UART1_CTS_PIN
78# define CONFIG_UART1_CTS_PIN -1
79# endif
80
81# ifndef CONFIG_UART1_RTS_PIN
82# define CONFIG_UART1_RTS_PIN -1
83# endif
84#endif
85/*
86 * The pin configuration is different from schematic
87 */
88struct bfin_serial_port {
89 struct uart_port port;
90 unsigned int old_status;
91#ifdef CONFIG_SERIAL_BFIN_DMA
92 int tx_done;
93 int tx_count;
94 struct circ_buf rx_dma_buf;
95 struct timer_list rx_dma_timer;
96 int rx_dma_nrows;
97 unsigned int tx_dma_channel;
98 unsigned int rx_dma_channel;
99 struct work_struct tx_dma_workqueue;
100#endif
101#ifdef CONFIG_SERIAL_BFIN_CTSRTS
102 struct timer_list cts_timer;
103 int cts_pin;
104 int rts_pin;
105#endif
106};
107
108struct bfin_serial_port bfin_serial_ports[BFIN_UART_NR_PORTS];
109struct bfin_serial_res {
110 unsigned long uart_base_addr;
111 int uart_irq;
112#ifdef CONFIG_SERIAL_BFIN_DMA
113 unsigned int uart_tx_dma_channel;
114 unsigned int uart_rx_dma_channel;
115#endif
116#ifdef CONFIG_SERIAL_BFIN_CTSRTS
117 int uart_cts_pin;
118 int uart_rts_pin;
119#endif
120};
121
122struct bfin_serial_res bfin_serial_resource[] = {
123#ifdef CONFIG_SERIAL_BFIN_UART0
124 {
125 0xFFC00400,
126 IRQ_UART0_RX,
127#ifdef CONFIG_SERIAL_BFIN_DMA
128 CH_UART0_TX,
129 CH_UART0_RX,
130#endif
131#ifdef CONFIG_BFIN_UART0_CTSRTS
132 CONFIG_UART0_CTS_PIN,
133 CONFIG_UART0_RTS_PIN,
134#endif
135 },
136#endif
137#ifdef CONFIG_SERIAL_BFIN_UART1
138 {
139 0xFFC02000,
140 IRQ_UART1_RX,
141#ifdef CONFIG_SERIAL_BFIN_DMA
142 CH_UART1_TX,
143 CH_UART1_RX,
144#endif
145 },
146#endif
147#ifdef CONFIG_SERIAL_BFIN_UART2
148 {
149 0xFFC02100,
150 IRQ_UART2_RX,
151#ifdef CONFIG_SERIAL_BFIN_DMA
152 CH_UART2_TX,
153 CH_UART2_RX,
154#endif
155#ifdef CONFIG_BFIN_UART2_CTSRTS
156 CONFIG_UART2_CTS_PIN,
157 CONFIG_UART2_RTS_PIN,
158#endif
159 },
160#endif
161#ifdef CONFIG_SERIAL_BFIN_UART3
162 {
163 0xFFC03100,
164 IRQ_UART3_RX,
165#ifdef CONFIG_SERIAL_BFIN_DMA
166 CH_UART3_TX,
167 CH_UART3_RX,
168#endif
169 },
170#endif
171};
172
173int nr_ports = ARRAY_SIZE(bfin_serial_resource);
174
175#define DRIVER_NAME "bfin-uart"
176
177static void bfin_serial_hw_init(struct bfin_serial_port *uart)
178{
179#ifdef CONFIG_SERIAL_BFIN_UART0
180 peripheral_request(P_UART0_TX, DRIVER_NAME);
181 peripheral_request(P_UART0_RX, DRIVER_NAME);
182#endif
183
184#ifdef CONFIG_SERIAL_BFIN_UART1
185 peripheral_request(P_UART1_TX, DRIVER_NAME);
186 peripheral_request(P_UART1_RX, DRIVER_NAME);
187
188#ifdef CONFIG_BFIN_UART1_CTSRTS
189 peripheral_request(P_UART1_RTS, DRIVER_NAME);
190 peripheral_request(P_UART1_CTS, DRIVER_NAME);
191#endif
192#endif
193
194#ifdef CONFIG_SERIAL_BFIN_UART2
195 peripheral_request(P_UART2_TX, DRIVER_NAME);
196 peripheral_request(P_UART2_RX, DRIVER_NAME);
197#endif
198
199#ifdef CONFIG_SERIAL_BFIN_UART3
200 peripheral_request(P_UART3_TX, DRIVER_NAME);
201 peripheral_request(P_UART3_RX, DRIVER_NAME);
202
203#ifdef CONFIG_BFIN_UART3_CTSRTS
204 peripheral_request(P_UART3_RTS, DRIVER_NAME);
205 peripheral_request(P_UART3_CTS, DRIVER_NAME);
206#endif
207#endif
208 SSYNC();
209#ifdef CONFIG_SERIAL_BFIN_CTSRTS
210 if (uart->cts_pin >= 0) {
211 gpio_request(uart->cts_pin, DRIVER_NAME);
212 gpio_direction_input(uart->cts_pin);
213 }
214
215 if (uart->rts_pin >= 0) {
216 gpio_request(uart->rts_pin, DRIVER_NAME);
217 gpio_direction_output(uart->rts_pin, 0);
218 }
219#endif
220}
diff --git a/include/asm-blackfin/mach-bf548/bfin_sir.h b/include/asm-blackfin/mach-bf548/bfin_sir.h
deleted file mode 100644
index c41f9cf00268..000000000000
--- a/include/asm-blackfin/mach-bf548/bfin_sir.h
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER_SET)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
21#define SIR_UART_GET_LSR(port) bfin_read16((port)->membase + OFFSET_LSR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_SET_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER_SET), v)
27#define SIR_UART_CLEAR_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER_CLEAR), v)
28#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
29#define SIR_UART_PUT_LSR(port, v) bfin_write16(((port)->membase + OFFSET_LSR), v)
30#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
31#define SIR_UART_CLEAR_LSR(port) bfin_write16(((port)->membase + OFFSET_LSR), -1)
32#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
33
34#ifdef CONFIG_SIR_BFIN_DMA
35struct dma_rx_buf {
36 char *buf;
37 int head;
38 int tail;
39 };
40#endif /* CONFIG_SIR_BFIN_DMA */
41
42struct bfin_sir_port {
43 unsigned char __iomem *membase;
44 unsigned int irq;
45 unsigned int lsr;
46 unsigned long clk;
47 struct net_device *dev;
48#ifdef CONFIG_SIR_BFIN_DMA
49 int tx_done;
50 struct dma_rx_buf rx_dma_buf;
51 struct timer_list rx_dma_timer;
52 int rx_dma_nrows;
53#endif /* CONFIG_SIR_BFIN_DMA */
54 unsigned int tx_dma_channel;
55 unsigned int rx_dma_channel;
56};
57
58struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
59
60struct bfin_sir_port_res {
61 unsigned long base_addr;
62 int irq;
63 unsigned int rx_dma_channel;
64 unsigned int tx_dma_channel;
65};
66
67struct bfin_sir_port_res bfin_sir_port_resource[] = {
68#ifdef CONFIG_BFIN_SIR0
69 {
70 0xFFC00400,
71 IRQ_UART0_RX,
72 CH_UART0_RX,
73 CH_UART0_TX,
74 },
75#endif
76#ifdef CONFIG_BFIN_SIR1
77 {
78 0xFFC02000,
79 IRQ_UART1_RX,
80 CH_UART1_RX,
81 CH_UART1_TX,
82 },
83#endif
84#ifdef CONFIG_BFIN_SIR2
85 {
86 0xFFC02100,
87 IRQ_UART2_RX,
88 CH_UART2_RX,
89 CH_UART2_TX,
90 },
91#endif
92#ifdef CONFIG_BFIN_SIR3
93 {
94 0xFFC03100,
95 IRQ_UART3_RX,
96 CH_UART3_RX,
97 CH_UART3_TX,
98 },
99#endif
100};
101
102int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
103
104struct bfin_sir_self {
105 struct bfin_sir_port *sir_port;
106 spinlock_t lock;
107 unsigned int open;
108 int speed;
109 int newspeed;
110
111 struct sk_buff *txskb;
112 struct sk_buff *rxskb;
113 struct net_device_stats stats;
114 struct device *dev;
115 struct irlap_cb *irlap;
116 struct qos_info qos;
117
118 iobuff_t tx_buff;
119 iobuff_t rx_buff;
120
121 struct work_struct work;
122 int mtt;
123};
124
125#define DRIVER_NAME "bfin_sir"
126
127static int bfin_sir_hw_init(void)
128{
129 int ret = -ENODEV;
130#ifdef CONFIG_BFIN_SIR0
131 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
132 if (ret)
133 return ret;
134 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
135 if (ret)
136 return ret;
137#endif
138
139#ifdef CONFIG_BFIN_SIR1
140 ret = peripheral_request(P_UART1_TX, DRIVER_NAME);
141 if (ret)
142 return ret;
143 ret = peripheral_request(P_UART1_RX, DRIVER_NAME);
144 if (ret)
145 return ret;
146#endif
147
148#ifdef CONFIG_BFIN_SIR2
149 ret = peripheral_request(P_UART2_TX, DRIVER_NAME);
150 if (ret)
151 return ret;
152 ret = peripheral_request(P_UART2_RX, DRIVER_NAME);
153 if (ret)
154 return ret;
155#endif
156
157#ifdef CONFIG_BFIN_SIR3
158 ret = peripheral_request(P_UART3_TX, DRIVER_NAME);
159 if (ret)
160 return ret;
161 ret = peripheral_request(P_UART3_RX, DRIVER_NAME);
162 if (ret)
163 return ret;
164#endif
165 return ret;
166}
diff --git a/include/asm-blackfin/mach-bf548/blackfin.h b/include/asm-blackfin/mach-bf548/blackfin.h
deleted file mode 100644
index d6ee74ac0460..000000000000
--- a/include/asm-blackfin/mach-bf548/blackfin.h
+++ /dev/null
@@ -1,190 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/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 BF548_FAMILY
36
37#include "bf548.h"
38#include "mem_map.h"
39#include "anomaly.h"
40
41#ifdef CONFIG_BF542
42#include "defBF542.h"
43#endif
44
45#ifdef CONFIG_BF544
46#include "defBF544.h"
47#endif
48
49#ifdef CONFIG_BF547
50#include "defBF547.h"
51#endif
52
53#ifdef CONFIG_BF548
54#include "defBF548.h"
55#endif
56
57#ifdef CONFIG_BF549
58#include "defBF549.h"
59#endif
60
61#if !defined(__ASSEMBLY__)
62#ifdef CONFIG_BF542
63#include "cdefBF542.h"
64#endif
65#ifdef CONFIG_BF544
66#include "cdefBF544.h"
67#endif
68#ifdef CONFIG_BF547
69#include "cdefBF547.h"
70#endif
71#ifdef CONFIG_BF548
72#include "cdefBF548.h"
73#endif
74#ifdef CONFIG_BF549
75#include "cdefBF549.h"
76#endif
77
78/* UART 1*/
79#define bfin_read_UART_THR() bfin_read_UART1_THR()
80#define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
81#define bfin_read_UART_RBR() bfin_read_UART1_RBR()
82#define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
83#define bfin_read_UART_DLL() bfin_read_UART1_DLL()
84#define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
85#define bfin_read_UART_IER() bfin_read_UART1_IER()
86#define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
87#define bfin_read_UART_DLH() bfin_read_UART1_DLH()
88#define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
89#define bfin_read_UART_IIR() bfin_read_UART1_IIR()
90#define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
91#define bfin_read_UART_LCR() bfin_read_UART1_LCR()
92#define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
93#define bfin_read_UART_MCR() bfin_read_UART1_MCR()
94#define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
95#define bfin_read_UART_LSR() bfin_read_UART1_LSR()
96#define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
97#define bfin_read_UART_SCR() bfin_read_UART1_SCR()
98#define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
99#define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
100#define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
101
102#endif
103
104/* MAP used DEFINES from BF533 to BF54x - so we don't need to change
105 * them in the driver, kernel, etc. */
106
107/* UART_IIR Register */
108#define STATUS(x) ((x << 1) & 0x06)
109#define STATUS_P1 0x02
110#define STATUS_P0 0x01
111
112/* UART 0*/
113
114/* DMA Channnel */
115#define bfin_read_CH_UART_RX() bfin_read_CH_UART1_RX()
116#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART1_RX(val)
117#define bfin_read_CH_UART_TX() bfin_read_CH_UART1_TX()
118#define bfin_write_CH_UART_TX(val) bfin_write_CH_UART1_TX(val)
119#define CH_UART_RX CH_UART1_RX
120#define CH_UART_TX CH_UART1_TX
121
122/* System Interrupt Controller */
123#define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART1_RX()
124#define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART1_RX(val)
125#define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART1_TX()
126#define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART1_TX(val)
127#define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART1_ERROR()
128#define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART1_ERROR(val)
129#define IRQ_UART_RX IRQ_UART1_RX
130#define IRQ_UART_TX IRQ_UART1_TX
131#define IRQ_UART_ERROR IRQ_UART1_ERROR
132
133/* MMR Registers*/
134#define bfin_read_UART_THR() bfin_read_UART1_THR()
135#define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
136#define bfin_read_UART_RBR() bfin_read_UART1_RBR()
137#define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
138#define bfin_read_UART_DLL() bfin_read_UART1_DLL()
139#define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
140#define bfin_read_UART_IER() bfin_read_UART1_IER()
141#define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
142#define bfin_read_UART_DLH() bfin_read_UART1_DLH()
143#define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
144#define bfin_read_UART_IIR() bfin_read_UART1_IIR()
145#define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
146#define bfin_read_UART_LCR() bfin_read_UART1_LCR()
147#define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
148#define bfin_read_UART_MCR() bfin_read_UART1_MCR()
149#define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
150#define bfin_read_UART_LSR() bfin_read_UART1_LSR()
151#define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
152#define bfin_read_UART_SCR() bfin_read_UART1_SCR()
153#define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
154#define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
155#define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
156
157#define BFIN_UART_THR UART1_THR
158#define BFIN_UART_RBR UART1_RBR
159#define BFIN_UART_DLL UART1_DLL
160#define BFIN_UART_IER UART1_IER
161#define BFIN_UART_DLH UART1_DLH
162#define BFIN_UART_IIR UART1_IIR
163#define BFIN_UART_LCR UART1_LCR
164#define BFIN_UART_MCR UART1_MCR
165#define BFIN_UART_LSR UART1_LSR
166#define BFIN_UART_SCR UART1_SCR
167#define BFIN_UART_GCTL UART1_GCTL
168
169#define BFIN_UART_NR_PORTS 4
170
171#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
172#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
173#define OFFSET_GCTL 0x08 /* Global Control Register */
174#define OFFSET_LCR 0x0C /* Line Control Register */
175#define OFFSET_MCR 0x10 /* Modem Control Register */
176#define OFFSET_LSR 0x14 /* Line Status Register */
177#define OFFSET_MSR 0x18 /* Modem Status Register */
178#define OFFSET_SCR 0x1C /* SCR Scratch Register */
179#define OFFSET_IER_SET 0x20 /* Set Interrupt Enable Register */
180#define OFFSET_IER_CLEAR 0x24 /* Clear Interrupt Enable Register */
181#define OFFSET_THR 0x28 /* Transmit Holding register */
182#define OFFSET_RBR 0x2C /* Receive Buffer register */
183
184/* PLL_DIV Masks */
185#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
186#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
187#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
188#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
189
190#endif
diff --git a/include/asm-blackfin/mach-bf548/cdefBF542.h b/include/asm-blackfin/mach-bf548/cdefBF542.h
deleted file mode 100644
index 60b9f77576f1..000000000000
--- a/include/asm-blackfin/mach-bf548/cdefBF542.h
+++ /dev/null
@@ -1,590 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/cdefBF542.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_BF542_H
32#define _CDEF_BF542_H
33
34/* include all Core registers and bit definitions */
35#include "defBF542.h"
36
37/* include core sbfin_read_()ecific register pointer definitions */
38#include <asm/mach-common/cdef_LPBlackfin.h>
39
40/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF542 */
41
42/* include cdefBF54x_base.h for the set of #defines that are common to all ADSP-BF54x bfin_read_()rocessors */
43#include "cdefBF54x_base.h"
44
45/* The following are the #defines needed by ADSP-BF542 that are not in the common header */
46
47/* ATAPI Registers */
48
49#define bfin_read_ATAPI_CONTROL() bfin_read16(ATAPI_CONTROL)
50#define bfin_write_ATAPI_CONTROL(val) bfin_write16(ATAPI_CONTROL, val)
51#define bfin_read_ATAPI_STATUS() bfin_read16(ATAPI_STATUS)
52#define bfin_write_ATAPI_STATUS(val) bfin_write16(ATAPI_STATUS, val)
53#define bfin_read_ATAPI_DEV_ADDR() bfin_read16(ATAPI_DEV_ADDR)
54#define bfin_write_ATAPI_DEV_ADDR(val) bfin_write16(ATAPI_DEV_ADDR, val)
55#define bfin_read_ATAPI_DEV_TXBUF() bfin_read16(ATAPI_DEV_TXBUF)
56#define bfin_write_ATAPI_DEV_TXBUF(val) bfin_write16(ATAPI_DEV_TXBUF, val)
57#define bfin_read_ATAPI_DEV_RXBUF() bfin_read16(ATAPI_DEV_RXBUF)
58#define bfin_write_ATAPI_DEV_RXBUF(val) bfin_write16(ATAPI_DEV_RXBUF, val)
59#define bfin_read_ATAPI_INT_MASK() bfin_read16(ATAPI_INT_MASK)
60#define bfin_write_ATAPI_INT_MASK(val) bfin_write16(ATAPI_INT_MASK, val)
61#define bfin_read_ATAPI_INT_STATUS() bfin_read16(ATAPI_INT_STATUS)
62#define bfin_write_ATAPI_INT_STATUS(val) bfin_write16(ATAPI_INT_STATUS, val)
63#define bfin_read_ATAPI_XFER_LEN() bfin_read16(ATAPI_XFER_LEN)
64#define bfin_write_ATAPI_XFER_LEN(val) bfin_write16(ATAPI_XFER_LEN, val)
65#define bfin_read_ATAPI_LINE_STATUS() bfin_read16(ATAPI_LINE_STATUS)
66#define bfin_write_ATAPI_LINE_STATUS(val) bfin_write16(ATAPI_LINE_STATUS, val)
67#define bfin_read_ATAPI_SM_STATE() bfin_read16(ATAPI_SM_STATE)
68#define bfin_write_ATAPI_SM_STATE(val) bfin_write16(ATAPI_SM_STATE, val)
69#define bfin_read_ATAPI_TERMINATE() bfin_read16(ATAPI_TERMINATE)
70#define bfin_write_ATAPI_TERMINATE(val) bfin_write16(ATAPI_TERMINATE, val)
71#define bfin_read_ATAPI_PIO_TFRCNT() bfin_read16(ATAPI_PIO_TFRCNT)
72#define bfin_write_ATAPI_PIO_TFRCNT(val) bfin_write16(ATAPI_PIO_TFRCNT, val)
73#define bfin_read_ATAPI_DMA_TFRCNT() bfin_read16(ATAPI_DMA_TFRCNT)
74#define bfin_write_ATAPI_DMA_TFRCNT(val) bfin_write16(ATAPI_DMA_TFRCNT, val)
75#define bfin_read_ATAPI_UMAIN_TFRCNT() bfin_read16(ATAPI_UMAIN_TFRCNT)
76#define bfin_write_ATAPI_UMAIN_TFRCNT(val) bfin_write16(ATAPI_UMAIN_TFRCNT, val)
77#define bfin_read_ATAPI_UDMAOUT_TFRCNT() bfin_read16(ATAPI_UDMAOUT_TFRCNT)
78#define bfin_write_ATAPI_UDMAOUT_TFRCNT(val) bfin_write16(ATAPI_UDMAOUT_TFRCNT, val)
79#define bfin_read_ATAPI_REG_TIM_0() bfin_read16(ATAPI_REG_TIM_0)
80#define bfin_write_ATAPI_REG_TIM_0(val) bfin_write16(ATAPI_REG_TIM_0, val)
81#define bfin_read_ATAPI_PIO_TIM_0() bfin_read16(ATAPI_PIO_TIM_0)
82#define bfin_write_ATAPI_PIO_TIM_0(val) bfin_write16(ATAPI_PIO_TIM_0, val)
83#define bfin_read_ATAPI_PIO_TIM_1() bfin_read16(ATAPI_PIO_TIM_1)
84#define bfin_write_ATAPI_PIO_TIM_1(val) bfin_write16(ATAPI_PIO_TIM_1, val)
85#define bfin_read_ATAPI_MULTI_TIM_0() bfin_read16(ATAPI_MULTI_TIM_0)
86#define bfin_write_ATAPI_MULTI_TIM_0(val) bfin_write16(ATAPI_MULTI_TIM_0, val)
87#define bfin_read_ATAPI_MULTI_TIM_1() bfin_read16(ATAPI_MULTI_TIM_1)
88#define bfin_write_ATAPI_MULTI_TIM_1(val) bfin_write16(ATAPI_MULTI_TIM_1, val)
89#define bfin_read_ATAPI_MULTI_TIM_2() bfin_read16(ATAPI_MULTI_TIM_2)
90#define bfin_write_ATAPI_MULTI_TIM_2(val) bfin_write16(ATAPI_MULTI_TIM_2, val)
91#define bfin_read_ATAPI_ULTRA_TIM_0() bfin_read16(ATAPI_ULTRA_TIM_0)
92#define bfin_write_ATAPI_ULTRA_TIM_0(val) bfin_write16(ATAPI_ULTRA_TIM_0, val)
93#define bfin_read_ATAPI_ULTRA_TIM_1() bfin_read16(ATAPI_ULTRA_TIM_1)
94#define bfin_write_ATAPI_ULTRA_TIM_1(val) bfin_write16(ATAPI_ULTRA_TIM_1, val)
95#define bfin_read_ATAPI_ULTRA_TIM_2() bfin_read16(ATAPI_ULTRA_TIM_2)
96#define bfin_write_ATAPI_ULTRA_TIM_2(val) bfin_write16(ATAPI_ULTRA_TIM_2, val)
97#define bfin_read_ATAPI_ULTRA_TIM_3() bfin_read16(ATAPI_ULTRA_TIM_3)
98#define bfin_write_ATAPI_ULTRA_TIM_3(val) bfin_write16(ATAPI_ULTRA_TIM_3, val)
99
100/* SDH Registers */
101
102#define bfin_read_SDH_PWR_CTL() bfin_read16(SDH_PWR_CTL)
103#define bfin_write_SDH_PWR_CTL(val) bfin_write16(SDH_PWR_CTL, val)
104#define bfin_read_SDH_CLK_CTL() bfin_read16(SDH_CLK_CTL)
105#define bfin_write_SDH_CLK_CTL(val) bfin_write16(SDH_CLK_CTL, val)
106#define bfin_read_SDH_ARGUMENT() bfin_read32(SDH_ARGUMENT)
107#define bfin_write_SDH_ARGUMENT(val) bfin_write32(SDH_ARGUMENT, val)
108#define bfin_read_SDH_COMMAND() bfin_read16(SDH_COMMAND)
109#define bfin_write_SDH_COMMAND(val) bfin_write16(SDH_COMMAND, val)
110#define bfin_read_SDH_RESP_CMD() bfin_read16(SDH_RESP_CMD)
111#define bfin_write_SDH_RESP_CMD(val) bfin_write16(SDH_RESP_CMD, val)
112#define bfin_read_SDH_RESPONSE0() bfin_read32(SDH_RESPONSE0)
113#define bfin_write_SDH_RESPONSE0(val) bfin_write32(SDH_RESPONSE0, val)
114#define bfin_read_SDH_RESPONSE1() bfin_read32(SDH_RESPONSE1)
115#define bfin_write_SDH_RESPONSE1(val) bfin_write32(SDH_RESPONSE1, val)
116#define bfin_read_SDH_RESPONSE2() bfin_read32(SDH_RESPONSE2)
117#define bfin_write_SDH_RESPONSE2(val) bfin_write32(SDH_RESPONSE2, val)
118#define bfin_read_SDH_RESPONSE3() bfin_read32(SDH_RESPONSE3)
119#define bfin_write_SDH_RESPONSE3(val) bfin_write32(SDH_RESPONSE3, val)
120#define bfin_read_SDH_DATA_TIMER() bfin_read32(SDH_DATA_TIMER)
121#define bfin_write_SDH_DATA_TIMER(val) bfin_write32(SDH_DATA_TIMER, val)
122#define bfin_read_SDH_DATA_LGTH() bfin_read16(SDH_DATA_LGTH)
123#define bfin_write_SDH_DATA_LGTH(val) bfin_write16(SDH_DATA_LGTH, val)
124#define bfin_read_SDH_DATA_CTL() bfin_read16(SDH_DATA_CTL)
125#define bfin_write_SDH_DATA_CTL(val) bfin_write16(SDH_DATA_CTL, val)
126#define bfin_read_SDH_DATA_CNT() bfin_read16(SDH_DATA_CNT)
127#define bfin_write_SDH_DATA_CNT(val) bfin_write16(SDH_DATA_CNT, val)
128#define bfin_read_SDH_STATUS() bfin_read32(SDH_STATUS)
129#define bfin_write_SDH_STATUS(val) bfin_write32(SDH_STATUS, val)
130#define bfin_read_SDH_STATUS_CLR() bfin_read16(SDH_STATUS_CLR)
131#define bfin_write_SDH_STATUS_CLR(val) bfin_write16(SDH_STATUS_CLR, val)
132#define bfin_read_SDH_MASK0() bfin_read32(SDH_MASK0)
133#define bfin_write_SDH_MASK0(val) bfin_write32(SDH_MASK0, val)
134#define bfin_read_SDH_MASK1() bfin_read32(SDH_MASK1)
135#define bfin_write_SDH_MASK1(val) bfin_write32(SDH_MASK1, val)
136#define bfin_read_SDH_FIFO_CNT() bfin_read16(SDH_FIFO_CNT)
137#define bfin_write_SDH_FIFO_CNT(val) bfin_write16(SDH_FIFO_CNT, val)
138#define bfin_read_SDH_FIFO() bfin_read32(SDH_FIFO)
139#define bfin_write_SDH_FIFO(val) bfin_write32(SDH_FIFO, val)
140#define bfin_read_SDH_E_STATUS() bfin_read16(SDH_E_STATUS)
141#define bfin_write_SDH_E_STATUS(val) bfin_write16(SDH_E_STATUS, val)
142#define bfin_read_SDH_E_MASK() bfin_read16(SDH_E_MASK)
143#define bfin_write_SDH_E_MASK(val) bfin_write16(SDH_E_MASK, val)
144#define bfin_read_SDH_CFG() bfin_read16(SDH_CFG)
145#define bfin_write_SDH_CFG(val) bfin_write16(SDH_CFG, val)
146#define bfin_read_SDH_RD_WAIT_EN() bfin_read16(SDH_RD_WAIT_EN)
147#define bfin_write_SDH_RD_WAIT_EN(val) bfin_write16(SDH_RD_WAIT_EN, val)
148#define bfin_read_SDH_PID0() bfin_read16(SDH_PID0)
149#define bfin_write_SDH_PID0(val) bfin_write16(SDH_PID0, val)
150#define bfin_read_SDH_PID1() bfin_read16(SDH_PID1)
151#define bfin_write_SDH_PID1(val) bfin_write16(SDH_PID1, val)
152#define bfin_read_SDH_PID2() bfin_read16(SDH_PID2)
153#define bfin_write_SDH_PID2(val) bfin_write16(SDH_PID2, val)
154#define bfin_read_SDH_PID3() bfin_read16(SDH_PID3)
155#define bfin_write_SDH_PID3(val) bfin_write16(SDH_PID3, val)
156#define bfin_read_SDH_PID4() bfin_read16(SDH_PID4)
157#define bfin_write_SDH_PID4(val) bfin_write16(SDH_PID4, val)
158#define bfin_read_SDH_PID5() bfin_read16(SDH_PID5)
159#define bfin_write_SDH_PID5(val) bfin_write16(SDH_PID5, val)
160#define bfin_read_SDH_PID6() bfin_read16(SDH_PID6)
161#define bfin_write_SDH_PID6(val) bfin_write16(SDH_PID6, val)
162#define bfin_read_SDH_PID7() bfin_read16(SDH_PID7)
163#define bfin_write_SDH_PID7(val) bfin_write16(SDH_PID7, val)
164
165/* USB Control Registers */
166
167#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
168#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
169#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
170#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
171#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
172#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
173#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
174#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
175#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
176#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
177#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
178#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
179#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
180#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
181#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
182#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
183#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
184#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
185#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
186#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
187#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
188#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
189#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
190#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
191#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
192#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
193
194/* USB Packet Control Registers */
195
196#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
197#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
198#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
199#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
200#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
201#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
202#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
203#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
204#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
205#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
206#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
207#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
208#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
209#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
210#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
211#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
212#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
213#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
214#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
215#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
216#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
217#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
218#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
219#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
220#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
221#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
222
223/* USB Endbfin_read_()oint FIFO Registers */
224
225#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
226#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
227#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
228#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
229#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
230#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
231#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
232#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
233#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
234#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
235#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
236#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
237#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
238#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
239#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
240#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
241
242/* USB OTG Control Registers */
243
244#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
245#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
246#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
247#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
248#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
249#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
250
251/* USB Phy Control Registers */
252
253#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
254#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
255#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
256#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
257#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
258#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
259#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
260#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
261#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
262#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
263
264/* (APHY_CNTRL is for ADI usage only) */
265
266#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
267#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
268
269/* (APHY_CALIB is for ADI usage only) */
270
271#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
272#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
273#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
274#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
275
276/* (PHY_TEST is for ADI usage only) */
277
278#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
279#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
280#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
281#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
282#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
283#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
284
285/* USB Endbfin_read_()oint 0 Control Registers */
286
287#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
288#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
289#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
290#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
291#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
292#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
293#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
294#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
295#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
296#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
297#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
298#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
299#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
300#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
301#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
302#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
303#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
304#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
305
306/* USB Endbfin_read_()oint 1 Control Registers */
307
308#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
309#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
310#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
311#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
312#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
313#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
314#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
315#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
316#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
317#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
318#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
319#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
320#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
321#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
322#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
323#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
324#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
325#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
326#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
327#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
328
329/* USB Endbfin_read_()oint 2 Control Registers */
330
331#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
332#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
333#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
334#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
335#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
336#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
337#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
338#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
339#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
340#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
341#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
342#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
343#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
344#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
345#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
346#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
347#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
348#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
349#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
350#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
351
352/* USB Endbfin_read_()oint 3 Control Registers */
353
354#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
355#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
356#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
357#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
358#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
359#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
360#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
361#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
362#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
363#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
364#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
365#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
366#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
367#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
368#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
369#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
370#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
371#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
372#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
373#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
374
375/* USB Endbfin_read_()oint 4 Control Registers */
376
377#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
378#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
379#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
380#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
381#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
382#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
383#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
384#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
385#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
386#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
387#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
388#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
389#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
390#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
391#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
392#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
393#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
394#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
395#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
396#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
397
398/* USB Endbfin_read_()oint 5 Control Registers */
399
400#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
401#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
402#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
403#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
404#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
405#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
406#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
407#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
408#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
409#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
410#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
411#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
412#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
413#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
414#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
415#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
416#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
417#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
418#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
419#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
420
421/* USB Endbfin_read_()oint 6 Control Registers */
422
423#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
424#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
425#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
426#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
427#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
428#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
429#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
430#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
431#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
432#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
433#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
434#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
435#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
436#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
437#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
438#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
439#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
440#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
441#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
442#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
443
444/* USB Endbfin_read_()oint 7 Control Registers */
445
446#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
447#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
448#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
449#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
450#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
451#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
452#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
453#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
454#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
455#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
456#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
457#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
458#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
459#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
460#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
461#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
462#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
463#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
464#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
465#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
466#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
467#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
468#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
469#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
470
471/* USB Channel 0 Config Registers */
472
473#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
474#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
475#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
476#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
477#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
478#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
479#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
480#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
481#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
482#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
483
484/* USB Channel 1 Config Registers */
485
486#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
487#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
488#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
489#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
490#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
491#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
492#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
493#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
494#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
495#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
496
497/* USB Channel 2 Config Registers */
498
499#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
500#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
501#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
502#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
503#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
504#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
505#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
506#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
507#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
508#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
509
510/* USB Channel 3 Config Registers */
511
512#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
513#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
514#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
515#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
516#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
517#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
518#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
519#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
520#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
521#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
522
523/* USB Channel 4 Config Registers */
524
525#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
526#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
527#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
528#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
529#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
530#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
531#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
532#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
533#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
534#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
535
536/* USB Channel 5 Config Registers */
537
538#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
539#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
540#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
541#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
542#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
543#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
544#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
545#define bfin_write_USB_DMA5COUNTLOW(val) bfin_write16(USB_DMA5COUNTLOW, val)
546#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
547#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
548
549/* USB Channel 6 Config Registers */
550
551#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
552#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
553#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
554#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
555#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
556#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
557#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
558#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
559#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
560#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
561
562/* USB Channel 7 Config Registers */
563
564#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
565#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
566#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
567#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
568#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
569#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
570#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
571#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
572#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
573#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
574
575/* Keybfin_read_()ad Registers */
576
577#define bfin_read_KPAD_CTL() bfin_read16(KPAD_CTL)
578#define bfin_write_KPAD_CTL(val) bfin_write16(KPAD_CTL, val)
579#define bfin_read_KPAD_PRESCALE() bfin_read16(KPAD_PRESCALE)
580#define bfin_write_KPAD_PRESCALE(val) bfin_write16(KPAD_PRESCALE, val)
581#define bfin_read_KPAD_MSEL() bfin_read16(KPAD_MSEL)
582#define bfin_write_KPAD_MSEL(val) bfin_write16(KPAD_MSEL, val)
583#define bfin_read_KPAD_ROWCOL() bfin_read16(KPAD_ROWCOL)
584#define bfin_write_KPAD_ROWCOL(val) bfin_write16(KPAD_ROWCOL, val)
585#define bfin_read_KPAD_STAT() bfin_read16(KPAD_STAT)
586#define bfin_write_KPAD_STAT(val) bfin_write16(KPAD_STAT, val)
587#define bfin_read_KPAD_SOFTEVAL() bfin_read16(KPAD_SOFTEVAL)
588#define bfin_write_KPAD_SOFTEVAL(val) bfin_write16(KPAD_SOFTEVAL, val)
589
590#endif /* _CDEF_BF542_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF544.h b/include/asm-blackfin/mach-bf548/cdefBF544.h
deleted file mode 100644
index ea9b4ab496f3..000000000000
--- a/include/asm-blackfin/mach-bf548/cdefBF544.h
+++ /dev/null
@@ -1,945 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/cdefBF544.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_BF544_H
32#define _CDEF_BF544_H
33
34/* include all Core registers and bit definitions */
35#include "defBF544.h"
36
37/* include core sbfin_read_()ecific register pointer definitions */
38#include <asm/mach-common/cdef_LPBlackfin.h>
39
40/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF544 */
41
42/* include cdefBF54x_base.h for the set of #defines that are common to all ADSP-BF54x bfin_read_()rocessors */
43#include "cdefBF54x_base.h"
44
45/* The following are the #defines needed by ADSP-BF544 that are not in the common header */
46
47/* Timer Registers */
48
49#define bfin_read_TIMER8_CONFIG() bfin_read16(TIMER8_CONFIG)
50#define bfin_write_TIMER8_CONFIG(val) bfin_write16(TIMER8_CONFIG, val)
51#define bfin_read_TIMER8_COUNTER() bfin_read32(TIMER8_COUNTER)
52#define bfin_write_TIMER8_COUNTER(val) bfin_write32(TIMER8_COUNTER, val)
53#define bfin_read_TIMER8_PERIOD() bfin_read32(TIMER8_PERIOD)
54#define bfin_write_TIMER8_PERIOD(val) bfin_write32(TIMER8_PERIOD, val)
55#define bfin_read_TIMER8_WIDTH() bfin_read32(TIMER8_WIDTH)
56#define bfin_write_TIMER8_WIDTH(val) bfin_write32(TIMER8_WIDTH, val)
57#define bfin_read_TIMER9_CONFIG() bfin_read16(TIMER9_CONFIG)
58#define bfin_write_TIMER9_CONFIG(val) bfin_write16(TIMER9_CONFIG, val)
59#define bfin_read_TIMER9_COUNTER() bfin_read32(TIMER9_COUNTER)
60#define bfin_write_TIMER9_COUNTER(val) bfin_write32(TIMER9_COUNTER, val)
61#define bfin_read_TIMER9_PERIOD() bfin_read32(TIMER9_PERIOD)
62#define bfin_write_TIMER9_PERIOD(val) bfin_write32(TIMER9_PERIOD, val)
63#define bfin_read_TIMER9_WIDTH() bfin_read32(TIMER9_WIDTH)
64#define bfin_write_TIMER9_WIDTH(val) bfin_write32(TIMER9_WIDTH, val)
65#define bfin_read_TIMER10_CONFIG() bfin_read16(TIMER10_CONFIG)
66#define bfin_write_TIMER10_CONFIG(val) bfin_write16(TIMER10_CONFIG, val)
67#define bfin_read_TIMER10_COUNTER() bfin_read32(TIMER10_COUNTER)
68#define bfin_write_TIMER10_COUNTER(val) bfin_write32(TIMER10_COUNTER, val)
69#define bfin_read_TIMER10_PERIOD() bfin_read32(TIMER10_PERIOD)
70#define bfin_write_TIMER10_PERIOD(val) bfin_write32(TIMER10_PERIOD, val)
71#define bfin_read_TIMER10_WIDTH() bfin_read32(TIMER10_WIDTH)
72#define bfin_write_TIMER10_WIDTH(val) bfin_write32(TIMER10_WIDTH, val)
73
74/* Timer Groubfin_read_() of 3 */
75
76#define bfin_read_TIMER_ENABLE1() bfin_read16(TIMER_ENABLE1)
77#define bfin_write_TIMER_ENABLE1(val) bfin_write16(TIMER_ENABLE1, val)
78#define bfin_read_TIMER_DISABLE1() bfin_read16(TIMER_DISABLE1)
79#define bfin_write_TIMER_DISABLE1(val) bfin_write16(TIMER_DISABLE1, val)
80#define bfin_read_TIMER_STATUS1() bfin_read32(TIMER_STATUS1)
81#define bfin_write_TIMER_STATUS1(val) bfin_write32(TIMER_STATUS1, val)
82
83/* EPPI0 Registers */
84
85#define bfin_read_EPPI0_STATUS() bfin_read16(EPPI0_STATUS)
86#define bfin_write_EPPI0_STATUS(val) bfin_write16(EPPI0_STATUS, val)
87#define bfin_read_EPPI0_HCOUNT() bfin_read16(EPPI0_HCOUNT)
88#define bfin_write_EPPI0_HCOUNT(val) bfin_write16(EPPI0_HCOUNT, val)
89#define bfin_read_EPPI0_HDELAY() bfin_read16(EPPI0_HDELAY)
90#define bfin_write_EPPI0_HDELAY(val) bfin_write16(EPPI0_HDELAY, val)
91#define bfin_read_EPPI0_VCOUNT() bfin_read16(EPPI0_VCOUNT)
92#define bfin_write_EPPI0_VCOUNT(val) bfin_write16(EPPI0_VCOUNT, val)
93#define bfin_read_EPPI0_VDELAY() bfin_read16(EPPI0_VDELAY)
94#define bfin_write_EPPI0_VDELAY(val) bfin_write16(EPPI0_VDELAY, val)
95#define bfin_read_EPPI0_FRAME() bfin_read16(EPPI0_FRAME)
96#define bfin_write_EPPI0_FRAME(val) bfin_write16(EPPI0_FRAME, val)
97#define bfin_read_EPPI0_LINE() bfin_read16(EPPI0_LINE)
98#define bfin_write_EPPI0_LINE(val) bfin_write16(EPPI0_LINE, val)
99#define bfin_read_EPPI0_CLKDIV() bfin_read16(EPPI0_CLKDIV)
100#define bfin_write_EPPI0_CLKDIV(val) bfin_write16(EPPI0_CLKDIV, val)
101#define bfin_read_EPPI0_CONTROL() bfin_read32(EPPI0_CONTROL)
102#define bfin_write_EPPI0_CONTROL(val) bfin_write32(EPPI0_CONTROL, val)
103#define bfin_read_EPPI0_FS1W_HBL() bfin_read32(EPPI0_FS1W_HBL)
104#define bfin_write_EPPI0_FS1W_HBL(val) bfin_write32(EPPI0_FS1W_HBL, val)
105#define bfin_read_EPPI0_FS1P_AVPL() bfin_read32(EPPI0_FS1P_AVPL)
106#define bfin_write_EPPI0_FS1P_AVPL(val) bfin_write32(EPPI0_FS1P_AVPL, val)
107#define bfin_read_EPPI0_FS2W_LVB() bfin_read32(EPPI0_FS2W_LVB)
108#define bfin_write_EPPI0_FS2W_LVB(val) bfin_write32(EPPI0_FS2W_LVB, val)
109#define bfin_read_EPPI0_FS2P_LAVF() bfin_read32(EPPI0_FS2P_LAVF)
110#define bfin_write_EPPI0_FS2P_LAVF(val) bfin_write32(EPPI0_FS2P_LAVF, val)
111#define bfin_read_EPPI0_CLIP() bfin_read32(EPPI0_CLIP)
112#define bfin_write_EPPI0_CLIP(val) bfin_write32(EPPI0_CLIP, val)
113
114/* Two Wire Interface Registers (TWI1) */
115
116/* CAN Controller 1 Config 1 Registers */
117
118#define bfin_read_CAN1_MC1() bfin_read16(CAN1_MC1)
119#define bfin_write_CAN1_MC1(val) bfin_write16(CAN1_MC1, val)
120#define bfin_read_CAN1_MD1() bfin_read16(CAN1_MD1)
121#define bfin_write_CAN1_MD1(val) bfin_write16(CAN1_MD1, val)
122#define bfin_read_CAN1_TRS1() bfin_read16(CAN1_TRS1)
123#define bfin_write_CAN1_TRS1(val) bfin_write16(CAN1_TRS1, val)
124#define bfin_read_CAN1_TRR1() bfin_read16(CAN1_TRR1)
125#define bfin_write_CAN1_TRR1(val) bfin_write16(CAN1_TRR1, val)
126#define bfin_read_CAN1_TA1() bfin_read16(CAN1_TA1)
127#define bfin_write_CAN1_TA1(val) bfin_write16(CAN1_TA1, val)
128#define bfin_read_CAN1_AA1() bfin_read16(CAN1_AA1)
129#define bfin_write_CAN1_AA1(val) bfin_write16(CAN1_AA1, val)
130#define bfin_read_CAN1_RMP1() bfin_read16(CAN1_RMP1)
131#define bfin_write_CAN1_RMP1(val) bfin_write16(CAN1_RMP1, val)
132#define bfin_read_CAN1_RML1() bfin_read16(CAN1_RML1)
133#define bfin_write_CAN1_RML1(val) bfin_write16(CAN1_RML1, val)
134#define bfin_read_CAN1_MBTIF1() bfin_read16(CAN1_MBTIF1)
135#define bfin_write_CAN1_MBTIF1(val) bfin_write16(CAN1_MBTIF1, val)
136#define bfin_read_CAN1_MBRIF1() bfin_read16(CAN1_MBRIF1)
137#define bfin_write_CAN1_MBRIF1(val) bfin_write16(CAN1_MBRIF1, val)
138#define bfin_read_CAN1_MBIM1() bfin_read16(CAN1_MBIM1)
139#define bfin_write_CAN1_MBIM1(val) bfin_write16(CAN1_MBIM1, val)
140#define bfin_read_CAN1_RFH1() bfin_read16(CAN1_RFH1)
141#define bfin_write_CAN1_RFH1(val) bfin_write16(CAN1_RFH1, val)
142#define bfin_read_CAN1_OPSS1() bfin_read16(CAN1_OPSS1)
143#define bfin_write_CAN1_OPSS1(val) bfin_write16(CAN1_OPSS1, val)
144
145/* CAN Controller 1 Config 2 Registers */
146
147#define bfin_read_CAN1_MC2() bfin_read16(CAN1_MC2)
148#define bfin_write_CAN1_MC2(val) bfin_write16(CAN1_MC2, val)
149#define bfin_read_CAN1_MD2() bfin_read16(CAN1_MD2)
150#define bfin_write_CAN1_MD2(val) bfin_write16(CAN1_MD2, val)
151#define bfin_read_CAN1_TRS2() bfin_read16(CAN1_TRS2)
152#define bfin_write_CAN1_TRS2(val) bfin_write16(CAN1_TRS2, val)
153#define bfin_read_CAN1_TRR2() bfin_read16(CAN1_TRR2)
154#define bfin_write_CAN1_TRR2(val) bfin_write16(CAN1_TRR2, val)
155#define bfin_read_CAN1_TA2() bfin_read16(CAN1_TA2)
156#define bfin_write_CAN1_TA2(val) bfin_write16(CAN1_TA2, val)
157#define bfin_read_CAN1_AA2() bfin_read16(CAN1_AA2)
158#define bfin_write_CAN1_AA2(val) bfin_write16(CAN1_AA2, val)
159#define bfin_read_CAN1_RMP2() bfin_read16(CAN1_RMP2)
160#define bfin_write_CAN1_RMP2(val) bfin_write16(CAN1_RMP2, val)
161#define bfin_read_CAN1_RML2() bfin_read16(CAN1_RML2)
162#define bfin_write_CAN1_RML2(val) bfin_write16(CAN1_RML2, val)
163#define bfin_read_CAN1_MBTIF2() bfin_read16(CAN1_MBTIF2)
164#define bfin_write_CAN1_MBTIF2(val) bfin_write16(CAN1_MBTIF2, val)
165#define bfin_read_CAN1_MBRIF2() bfin_read16(CAN1_MBRIF2)
166#define bfin_write_CAN1_MBRIF2(val) bfin_write16(CAN1_MBRIF2, val)
167#define bfin_read_CAN1_MBIM2() bfin_read16(CAN1_MBIM2)
168#define bfin_write_CAN1_MBIM2(val) bfin_write16(CAN1_MBIM2, val)
169#define bfin_read_CAN1_RFH2() bfin_read16(CAN1_RFH2)
170#define bfin_write_CAN1_RFH2(val) bfin_write16(CAN1_RFH2, val)
171#define bfin_read_CAN1_OPSS2() bfin_read16(CAN1_OPSS2)
172#define bfin_write_CAN1_OPSS2(val) bfin_write16(CAN1_OPSS2, val)
173
174/* CAN Controller 1 Clock/Interrubfin_read_()t/Counter Registers */
175
176#define bfin_read_CAN1_CLOCK() bfin_read16(CAN1_CLOCK)
177#define bfin_write_CAN1_CLOCK(val) bfin_write16(CAN1_CLOCK, val)
178#define bfin_read_CAN1_TIMING() bfin_read16(CAN1_TIMING)
179#define bfin_write_CAN1_TIMING(val) bfin_write16(CAN1_TIMING, val)
180#define bfin_read_CAN1_DEBUG() bfin_read16(CAN1_DEBUG)
181#define bfin_write_CAN1_DEBUG(val) bfin_write16(CAN1_DEBUG, val)
182#define bfin_read_CAN1_STATUS() bfin_read16(CAN1_STATUS)
183#define bfin_write_CAN1_STATUS(val) bfin_write16(CAN1_STATUS, val)
184#define bfin_read_CAN1_CEC() bfin_read16(CAN1_CEC)
185#define bfin_write_CAN1_CEC(val) bfin_write16(CAN1_CEC, val)
186#define bfin_read_CAN1_GIS() bfin_read16(CAN1_GIS)
187#define bfin_write_CAN1_GIS(val) bfin_write16(CAN1_GIS, val)
188#define bfin_read_CAN1_GIM() bfin_read16(CAN1_GIM)
189#define bfin_write_CAN1_GIM(val) bfin_write16(CAN1_GIM, val)
190#define bfin_read_CAN1_GIF() bfin_read16(CAN1_GIF)
191#define bfin_write_CAN1_GIF(val) bfin_write16(CAN1_GIF, val)
192#define bfin_read_CAN1_CONTROL() bfin_read16(CAN1_CONTROL)
193#define bfin_write_CAN1_CONTROL(val) bfin_write16(CAN1_CONTROL, val)
194#define bfin_read_CAN1_INTR() bfin_read16(CAN1_INTR)
195#define bfin_write_CAN1_INTR(val) bfin_write16(CAN1_INTR, val)
196#define bfin_read_CAN1_MBTD() bfin_read16(CAN1_MBTD)
197#define bfin_write_CAN1_MBTD(val) bfin_write16(CAN1_MBTD, val)
198#define bfin_read_CAN1_EWR() bfin_read16(CAN1_EWR)
199#define bfin_write_CAN1_EWR(val) bfin_write16(CAN1_EWR, val)
200#define bfin_read_CAN1_ESR() bfin_read16(CAN1_ESR)
201#define bfin_write_CAN1_ESR(val) bfin_write16(CAN1_ESR, val)
202#define bfin_read_CAN1_UCCNT() bfin_read16(CAN1_UCCNT)
203#define bfin_write_CAN1_UCCNT(val) bfin_write16(CAN1_UCCNT, val)
204#define bfin_read_CAN1_UCRC() bfin_read16(CAN1_UCRC)
205#define bfin_write_CAN1_UCRC(val) bfin_write16(CAN1_UCRC, val)
206#define bfin_read_CAN1_UCCNF() bfin_read16(CAN1_UCCNF)
207#define bfin_write_CAN1_UCCNF(val) bfin_write16(CAN1_UCCNF, val)
208
209/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
210
211#define bfin_read_CAN1_AM00L() bfin_read16(CAN1_AM00L)
212#define bfin_write_CAN1_AM00L(val) bfin_write16(CAN1_AM00L, val)
213#define bfin_read_CAN1_AM00H() bfin_read16(CAN1_AM00H)
214#define bfin_write_CAN1_AM00H(val) bfin_write16(CAN1_AM00H, val)
215#define bfin_read_CAN1_AM01L() bfin_read16(CAN1_AM01L)
216#define bfin_write_CAN1_AM01L(val) bfin_write16(CAN1_AM01L, val)
217#define bfin_read_CAN1_AM01H() bfin_read16(CAN1_AM01H)
218#define bfin_write_CAN1_AM01H(val) bfin_write16(CAN1_AM01H, val)
219#define bfin_read_CAN1_AM02L() bfin_read16(CAN1_AM02L)
220#define bfin_write_CAN1_AM02L(val) bfin_write16(CAN1_AM02L, val)
221#define bfin_read_CAN1_AM02H() bfin_read16(CAN1_AM02H)
222#define bfin_write_CAN1_AM02H(val) bfin_write16(CAN1_AM02H, val)
223#define bfin_read_CAN1_AM03L() bfin_read16(CAN1_AM03L)
224#define bfin_write_CAN1_AM03L(val) bfin_write16(CAN1_AM03L, val)
225#define bfin_read_CAN1_AM03H() bfin_read16(CAN1_AM03H)
226#define bfin_write_CAN1_AM03H(val) bfin_write16(CAN1_AM03H, val)
227#define bfin_read_CAN1_AM04L() bfin_read16(CAN1_AM04L)
228#define bfin_write_CAN1_AM04L(val) bfin_write16(CAN1_AM04L, val)
229#define bfin_read_CAN1_AM04H() bfin_read16(CAN1_AM04H)
230#define bfin_write_CAN1_AM04H(val) bfin_write16(CAN1_AM04H, val)
231#define bfin_read_CAN1_AM05L() bfin_read16(CAN1_AM05L)
232#define bfin_write_CAN1_AM05L(val) bfin_write16(CAN1_AM05L, val)
233#define bfin_read_CAN1_AM05H() bfin_read16(CAN1_AM05H)
234#define bfin_write_CAN1_AM05H(val) bfin_write16(CAN1_AM05H, val)
235#define bfin_read_CAN1_AM06L() bfin_read16(CAN1_AM06L)
236#define bfin_write_CAN1_AM06L(val) bfin_write16(CAN1_AM06L, val)
237#define bfin_read_CAN1_AM06H() bfin_read16(CAN1_AM06H)
238#define bfin_write_CAN1_AM06H(val) bfin_write16(CAN1_AM06H, val)
239#define bfin_read_CAN1_AM07L() bfin_read16(CAN1_AM07L)
240#define bfin_write_CAN1_AM07L(val) bfin_write16(CAN1_AM07L, val)
241#define bfin_read_CAN1_AM07H() bfin_read16(CAN1_AM07H)
242#define bfin_write_CAN1_AM07H(val) bfin_write16(CAN1_AM07H, val)
243#define bfin_read_CAN1_AM08L() bfin_read16(CAN1_AM08L)
244#define bfin_write_CAN1_AM08L(val) bfin_write16(CAN1_AM08L, val)
245#define bfin_read_CAN1_AM08H() bfin_read16(CAN1_AM08H)
246#define bfin_write_CAN1_AM08H(val) bfin_write16(CAN1_AM08H, val)
247#define bfin_read_CAN1_AM09L() bfin_read16(CAN1_AM09L)
248#define bfin_write_CAN1_AM09L(val) bfin_write16(CAN1_AM09L, val)
249#define bfin_read_CAN1_AM09H() bfin_read16(CAN1_AM09H)
250#define bfin_write_CAN1_AM09H(val) bfin_write16(CAN1_AM09H, val)
251#define bfin_read_CAN1_AM10L() bfin_read16(CAN1_AM10L)
252#define bfin_write_CAN1_AM10L(val) bfin_write16(CAN1_AM10L, val)
253#define bfin_read_CAN1_AM10H() bfin_read16(CAN1_AM10H)
254#define bfin_write_CAN1_AM10H(val) bfin_write16(CAN1_AM10H, val)
255#define bfin_read_CAN1_AM11L() bfin_read16(CAN1_AM11L)
256#define bfin_write_CAN1_AM11L(val) bfin_write16(CAN1_AM11L, val)
257#define bfin_read_CAN1_AM11H() bfin_read16(CAN1_AM11H)
258#define bfin_write_CAN1_AM11H(val) bfin_write16(CAN1_AM11H, val)
259#define bfin_read_CAN1_AM12L() bfin_read16(CAN1_AM12L)
260#define bfin_write_CAN1_AM12L(val) bfin_write16(CAN1_AM12L, val)
261#define bfin_read_CAN1_AM12H() bfin_read16(CAN1_AM12H)
262#define bfin_write_CAN1_AM12H(val) bfin_write16(CAN1_AM12H, val)
263#define bfin_read_CAN1_AM13L() bfin_read16(CAN1_AM13L)
264#define bfin_write_CAN1_AM13L(val) bfin_write16(CAN1_AM13L, val)
265#define bfin_read_CAN1_AM13H() bfin_read16(CAN1_AM13H)
266#define bfin_write_CAN1_AM13H(val) bfin_write16(CAN1_AM13H, val)
267#define bfin_read_CAN1_AM14L() bfin_read16(CAN1_AM14L)
268#define bfin_write_CAN1_AM14L(val) bfin_write16(CAN1_AM14L, val)
269#define bfin_read_CAN1_AM14H() bfin_read16(CAN1_AM14H)
270#define bfin_write_CAN1_AM14H(val) bfin_write16(CAN1_AM14H, val)
271#define bfin_read_CAN1_AM15L() bfin_read16(CAN1_AM15L)
272#define bfin_write_CAN1_AM15L(val) bfin_write16(CAN1_AM15L, val)
273#define bfin_read_CAN1_AM15H() bfin_read16(CAN1_AM15H)
274#define bfin_write_CAN1_AM15H(val) bfin_write16(CAN1_AM15H, val)
275
276/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
277
278#define bfin_read_CAN1_AM16L() bfin_read16(CAN1_AM16L)
279#define bfin_write_CAN1_AM16L(val) bfin_write16(CAN1_AM16L, val)
280#define bfin_read_CAN1_AM16H() bfin_read16(CAN1_AM16H)
281#define bfin_write_CAN1_AM16H(val) bfin_write16(CAN1_AM16H, val)
282#define bfin_read_CAN1_AM17L() bfin_read16(CAN1_AM17L)
283#define bfin_write_CAN1_AM17L(val) bfin_write16(CAN1_AM17L, val)
284#define bfin_read_CAN1_AM17H() bfin_read16(CAN1_AM17H)
285#define bfin_write_CAN1_AM17H(val) bfin_write16(CAN1_AM17H, val)
286#define bfin_read_CAN1_AM18L() bfin_read16(CAN1_AM18L)
287#define bfin_write_CAN1_AM18L(val) bfin_write16(CAN1_AM18L, val)
288#define bfin_read_CAN1_AM18H() bfin_read16(CAN1_AM18H)
289#define bfin_write_CAN1_AM18H(val) bfin_write16(CAN1_AM18H, val)
290#define bfin_read_CAN1_AM19L() bfin_read16(CAN1_AM19L)
291#define bfin_write_CAN1_AM19L(val) bfin_write16(CAN1_AM19L, val)
292#define bfin_read_CAN1_AM19H() bfin_read16(CAN1_AM19H)
293#define bfin_write_CAN1_AM19H(val) bfin_write16(CAN1_AM19H, val)
294#define bfin_read_CAN1_AM20L() bfin_read16(CAN1_AM20L)
295#define bfin_write_CAN1_AM20L(val) bfin_write16(CAN1_AM20L, val)
296#define bfin_read_CAN1_AM20H() bfin_read16(CAN1_AM20H)
297#define bfin_write_CAN1_AM20H(val) bfin_write16(CAN1_AM20H, val)
298#define bfin_read_CAN1_AM21L() bfin_read16(CAN1_AM21L)
299#define bfin_write_CAN1_AM21L(val) bfin_write16(CAN1_AM21L, val)
300#define bfin_read_CAN1_AM21H() bfin_read16(CAN1_AM21H)
301#define bfin_write_CAN1_AM21H(val) bfin_write16(CAN1_AM21H, val)
302#define bfin_read_CAN1_AM22L() bfin_read16(CAN1_AM22L)
303#define bfin_write_CAN1_AM22L(val) bfin_write16(CAN1_AM22L, val)
304#define bfin_read_CAN1_AM22H() bfin_read16(CAN1_AM22H)
305#define bfin_write_CAN1_AM22H(val) bfin_write16(CAN1_AM22H, val)
306#define bfin_read_CAN1_AM23L() bfin_read16(CAN1_AM23L)
307#define bfin_write_CAN1_AM23L(val) bfin_write16(CAN1_AM23L, val)
308#define bfin_read_CAN1_AM23H() bfin_read16(CAN1_AM23H)
309#define bfin_write_CAN1_AM23H(val) bfin_write16(CAN1_AM23H, val)
310#define bfin_read_CAN1_AM24L() bfin_read16(CAN1_AM24L)
311#define bfin_write_CAN1_AM24L(val) bfin_write16(CAN1_AM24L, val)
312#define bfin_read_CAN1_AM24H() bfin_read16(CAN1_AM24H)
313#define bfin_write_CAN1_AM24H(val) bfin_write16(CAN1_AM24H, val)
314#define bfin_read_CAN1_AM25L() bfin_read16(CAN1_AM25L)
315#define bfin_write_CAN1_AM25L(val) bfin_write16(CAN1_AM25L, val)
316#define bfin_read_CAN1_AM25H() bfin_read16(CAN1_AM25H)
317#define bfin_write_CAN1_AM25H(val) bfin_write16(CAN1_AM25H, val)
318#define bfin_read_CAN1_AM26L() bfin_read16(CAN1_AM26L)
319#define bfin_write_CAN1_AM26L(val) bfin_write16(CAN1_AM26L, val)
320#define bfin_read_CAN1_AM26H() bfin_read16(CAN1_AM26H)
321#define bfin_write_CAN1_AM26H(val) bfin_write16(CAN1_AM26H, val)
322#define bfin_read_CAN1_AM27L() bfin_read16(CAN1_AM27L)
323#define bfin_write_CAN1_AM27L(val) bfin_write16(CAN1_AM27L, val)
324#define bfin_read_CAN1_AM27H() bfin_read16(CAN1_AM27H)
325#define bfin_write_CAN1_AM27H(val) bfin_write16(CAN1_AM27H, val)
326#define bfin_read_CAN1_AM28L() bfin_read16(CAN1_AM28L)
327#define bfin_write_CAN1_AM28L(val) bfin_write16(CAN1_AM28L, val)
328#define bfin_read_CAN1_AM28H() bfin_read16(CAN1_AM28H)
329#define bfin_write_CAN1_AM28H(val) bfin_write16(CAN1_AM28H, val)
330#define bfin_read_CAN1_AM29L() bfin_read16(CAN1_AM29L)
331#define bfin_write_CAN1_AM29L(val) bfin_write16(CAN1_AM29L, val)
332#define bfin_read_CAN1_AM29H() bfin_read16(CAN1_AM29H)
333#define bfin_write_CAN1_AM29H(val) bfin_write16(CAN1_AM29H, val)
334#define bfin_read_CAN1_AM30L() bfin_read16(CAN1_AM30L)
335#define bfin_write_CAN1_AM30L(val) bfin_write16(CAN1_AM30L, val)
336#define bfin_read_CAN1_AM30H() bfin_read16(CAN1_AM30H)
337#define bfin_write_CAN1_AM30H(val) bfin_write16(CAN1_AM30H, val)
338#define bfin_read_CAN1_AM31L() bfin_read16(CAN1_AM31L)
339#define bfin_write_CAN1_AM31L(val) bfin_write16(CAN1_AM31L, val)
340#define bfin_read_CAN1_AM31H() bfin_read16(CAN1_AM31H)
341#define bfin_write_CAN1_AM31H(val) bfin_write16(CAN1_AM31H, val)
342
343/* CAN Controller 1 Mailbox Data Registers */
344
345#define bfin_read_CAN1_MB00_DATA0() bfin_read16(CAN1_MB00_DATA0)
346#define bfin_write_CAN1_MB00_DATA0(val) bfin_write16(CAN1_MB00_DATA0, val)
347#define bfin_read_CAN1_MB00_DATA1() bfin_read16(CAN1_MB00_DATA1)
348#define bfin_write_CAN1_MB00_DATA1(val) bfin_write16(CAN1_MB00_DATA1, val)
349#define bfin_read_CAN1_MB00_DATA2() bfin_read16(CAN1_MB00_DATA2)
350#define bfin_write_CAN1_MB00_DATA2(val) bfin_write16(CAN1_MB00_DATA2, val)
351#define bfin_read_CAN1_MB00_DATA3() bfin_read16(CAN1_MB00_DATA3)
352#define bfin_write_CAN1_MB00_DATA3(val) bfin_write16(CAN1_MB00_DATA3, val)
353#define bfin_read_CAN1_MB00_LENGTH() bfin_read16(CAN1_MB00_LENGTH)
354#define bfin_write_CAN1_MB00_LENGTH(val) bfin_write16(CAN1_MB00_LENGTH, val)
355#define bfin_read_CAN1_MB00_TIMESTAMP() bfin_read16(CAN1_MB00_TIMESTAMP)
356#define bfin_write_CAN1_MB00_TIMESTAMP(val) bfin_write16(CAN1_MB00_TIMESTAMP, val)
357#define bfin_read_CAN1_MB00_ID0() bfin_read16(CAN1_MB00_ID0)
358#define bfin_write_CAN1_MB00_ID0(val) bfin_write16(CAN1_MB00_ID0, val)
359#define bfin_read_CAN1_MB00_ID1() bfin_read16(CAN1_MB00_ID1)
360#define bfin_write_CAN1_MB00_ID1(val) bfin_write16(CAN1_MB00_ID1, val)
361#define bfin_read_CAN1_MB01_DATA0() bfin_read16(CAN1_MB01_DATA0)
362#define bfin_write_CAN1_MB01_DATA0(val) bfin_write16(CAN1_MB01_DATA0, val)
363#define bfin_read_CAN1_MB01_DATA1() bfin_read16(CAN1_MB01_DATA1)
364#define bfin_write_CAN1_MB01_DATA1(val) bfin_write16(CAN1_MB01_DATA1, val)
365#define bfin_read_CAN1_MB01_DATA2() bfin_read16(CAN1_MB01_DATA2)
366#define bfin_write_CAN1_MB01_DATA2(val) bfin_write16(CAN1_MB01_DATA2, val)
367#define bfin_read_CAN1_MB01_DATA3() bfin_read16(CAN1_MB01_DATA3)
368#define bfin_write_CAN1_MB01_DATA3(val) bfin_write16(CAN1_MB01_DATA3, val)
369#define bfin_read_CAN1_MB01_LENGTH() bfin_read16(CAN1_MB01_LENGTH)
370#define bfin_write_CAN1_MB01_LENGTH(val) bfin_write16(CAN1_MB01_LENGTH, val)
371#define bfin_read_CAN1_MB01_TIMESTAMP() bfin_read16(CAN1_MB01_TIMESTAMP)
372#define bfin_write_CAN1_MB01_TIMESTAMP(val) bfin_write16(CAN1_MB01_TIMESTAMP, val)
373#define bfin_read_CAN1_MB01_ID0() bfin_read16(CAN1_MB01_ID0)
374#define bfin_write_CAN1_MB01_ID0(val) bfin_write16(CAN1_MB01_ID0, val)
375#define bfin_read_CAN1_MB01_ID1() bfin_read16(CAN1_MB01_ID1)
376#define bfin_write_CAN1_MB01_ID1(val) bfin_write16(CAN1_MB01_ID1, val)
377#define bfin_read_CAN1_MB02_DATA0() bfin_read16(CAN1_MB02_DATA0)
378#define bfin_write_CAN1_MB02_DATA0(val) bfin_write16(CAN1_MB02_DATA0, val)
379#define bfin_read_CAN1_MB02_DATA1() bfin_read16(CAN1_MB02_DATA1)
380#define bfin_write_CAN1_MB02_DATA1(val) bfin_write16(CAN1_MB02_DATA1, val)
381#define bfin_read_CAN1_MB02_DATA2() bfin_read16(CAN1_MB02_DATA2)
382#define bfin_write_CAN1_MB02_DATA2(val) bfin_write16(CAN1_MB02_DATA2, val)
383#define bfin_read_CAN1_MB02_DATA3() bfin_read16(CAN1_MB02_DATA3)
384#define bfin_write_CAN1_MB02_DATA3(val) bfin_write16(CAN1_MB02_DATA3, val)
385#define bfin_read_CAN1_MB02_LENGTH() bfin_read16(CAN1_MB02_LENGTH)
386#define bfin_write_CAN1_MB02_LENGTH(val) bfin_write16(CAN1_MB02_LENGTH, val)
387#define bfin_read_CAN1_MB02_TIMESTAMP() bfin_read16(CAN1_MB02_TIMESTAMP)
388#define bfin_write_CAN1_MB02_TIMESTAMP(val) bfin_write16(CAN1_MB02_TIMESTAMP, val)
389#define bfin_read_CAN1_MB02_ID0() bfin_read16(CAN1_MB02_ID0)
390#define bfin_write_CAN1_MB02_ID0(val) bfin_write16(CAN1_MB02_ID0, val)
391#define bfin_read_CAN1_MB02_ID1() bfin_read16(CAN1_MB02_ID1)
392#define bfin_write_CAN1_MB02_ID1(val) bfin_write16(CAN1_MB02_ID1, val)
393#define bfin_read_CAN1_MB03_DATA0() bfin_read16(CAN1_MB03_DATA0)
394#define bfin_write_CAN1_MB03_DATA0(val) bfin_write16(CAN1_MB03_DATA0, val)
395#define bfin_read_CAN1_MB03_DATA1() bfin_read16(CAN1_MB03_DATA1)
396#define bfin_write_CAN1_MB03_DATA1(val) bfin_write16(CAN1_MB03_DATA1, val)
397#define bfin_read_CAN1_MB03_DATA2() bfin_read16(CAN1_MB03_DATA2)
398#define bfin_write_CAN1_MB03_DATA2(val) bfin_write16(CAN1_MB03_DATA2, val)
399#define bfin_read_CAN1_MB03_DATA3() bfin_read16(CAN1_MB03_DATA3)
400#define bfin_write_CAN1_MB03_DATA3(val) bfin_write16(CAN1_MB03_DATA3, val)
401#define bfin_read_CAN1_MB03_LENGTH() bfin_read16(CAN1_MB03_LENGTH)
402#define bfin_write_CAN1_MB03_LENGTH(val) bfin_write16(CAN1_MB03_LENGTH, val)
403#define bfin_read_CAN1_MB03_TIMESTAMP() bfin_read16(CAN1_MB03_TIMESTAMP)
404#define bfin_write_CAN1_MB03_TIMESTAMP(val) bfin_write16(CAN1_MB03_TIMESTAMP, val)
405#define bfin_read_CAN1_MB03_ID0() bfin_read16(CAN1_MB03_ID0)
406#define bfin_write_CAN1_MB03_ID0(val) bfin_write16(CAN1_MB03_ID0, val)
407#define bfin_read_CAN1_MB03_ID1() bfin_read16(CAN1_MB03_ID1)
408#define bfin_write_CAN1_MB03_ID1(val) bfin_write16(CAN1_MB03_ID1, val)
409#define bfin_read_CAN1_MB04_DATA0() bfin_read16(CAN1_MB04_DATA0)
410#define bfin_write_CAN1_MB04_DATA0(val) bfin_write16(CAN1_MB04_DATA0, val)
411#define bfin_read_CAN1_MB04_DATA1() bfin_read16(CAN1_MB04_DATA1)
412#define bfin_write_CAN1_MB04_DATA1(val) bfin_write16(CAN1_MB04_DATA1, val)
413#define bfin_read_CAN1_MB04_DATA2() bfin_read16(CAN1_MB04_DATA2)
414#define bfin_write_CAN1_MB04_DATA2(val) bfin_write16(CAN1_MB04_DATA2, val)
415#define bfin_read_CAN1_MB04_DATA3() bfin_read16(CAN1_MB04_DATA3)
416#define bfin_write_CAN1_MB04_DATA3(val) bfin_write16(CAN1_MB04_DATA3, val)
417#define bfin_read_CAN1_MB04_LENGTH() bfin_read16(CAN1_MB04_LENGTH)
418#define bfin_write_CAN1_MB04_LENGTH(val) bfin_write16(CAN1_MB04_LENGTH, val)
419#define bfin_read_CAN1_MB04_TIMESTAMP() bfin_read16(CAN1_MB04_TIMESTAMP)
420#define bfin_write_CAN1_MB04_TIMESTAMP(val) bfin_write16(CAN1_MB04_TIMESTAMP, val)
421#define bfin_read_CAN1_MB04_ID0() bfin_read16(CAN1_MB04_ID0)
422#define bfin_write_CAN1_MB04_ID0(val) bfin_write16(CAN1_MB04_ID0, val)
423#define bfin_read_CAN1_MB04_ID1() bfin_read16(CAN1_MB04_ID1)
424#define bfin_write_CAN1_MB04_ID1(val) bfin_write16(CAN1_MB04_ID1, val)
425#define bfin_read_CAN1_MB05_DATA0() bfin_read16(CAN1_MB05_DATA0)
426#define bfin_write_CAN1_MB05_DATA0(val) bfin_write16(CAN1_MB05_DATA0, val)
427#define bfin_read_CAN1_MB05_DATA1() bfin_read16(CAN1_MB05_DATA1)
428#define bfin_write_CAN1_MB05_DATA1(val) bfin_write16(CAN1_MB05_DATA1, val)
429#define bfin_read_CAN1_MB05_DATA2() bfin_read16(CAN1_MB05_DATA2)
430#define bfin_write_CAN1_MB05_DATA2(val) bfin_write16(CAN1_MB05_DATA2, val)
431#define bfin_read_CAN1_MB05_DATA3() bfin_read16(CAN1_MB05_DATA3)
432#define bfin_write_CAN1_MB05_DATA3(val) bfin_write16(CAN1_MB05_DATA3, val)
433#define bfin_read_CAN1_MB05_LENGTH() bfin_read16(CAN1_MB05_LENGTH)
434#define bfin_write_CAN1_MB05_LENGTH(val) bfin_write16(CAN1_MB05_LENGTH, val)
435#define bfin_read_CAN1_MB05_TIMESTAMP() bfin_read16(CAN1_MB05_TIMESTAMP)
436#define bfin_write_CAN1_MB05_TIMESTAMP(val) bfin_write16(CAN1_MB05_TIMESTAMP, val)
437#define bfin_read_CAN1_MB05_ID0() bfin_read16(CAN1_MB05_ID0)
438#define bfin_write_CAN1_MB05_ID0(val) bfin_write16(CAN1_MB05_ID0, val)
439#define bfin_read_CAN1_MB05_ID1() bfin_read16(CAN1_MB05_ID1)
440#define bfin_write_CAN1_MB05_ID1(val) bfin_write16(CAN1_MB05_ID1, val)
441#define bfin_read_CAN1_MB06_DATA0() bfin_read16(CAN1_MB06_DATA0)
442#define bfin_write_CAN1_MB06_DATA0(val) bfin_write16(CAN1_MB06_DATA0, val)
443#define bfin_read_CAN1_MB06_DATA1() bfin_read16(CAN1_MB06_DATA1)
444#define bfin_write_CAN1_MB06_DATA1(val) bfin_write16(CAN1_MB06_DATA1, val)
445#define bfin_read_CAN1_MB06_DATA2() bfin_read16(CAN1_MB06_DATA2)
446#define bfin_write_CAN1_MB06_DATA2(val) bfin_write16(CAN1_MB06_DATA2, val)
447#define bfin_read_CAN1_MB06_DATA3() bfin_read16(CAN1_MB06_DATA3)
448#define bfin_write_CAN1_MB06_DATA3(val) bfin_write16(CAN1_MB06_DATA3, val)
449#define bfin_read_CAN1_MB06_LENGTH() bfin_read16(CAN1_MB06_LENGTH)
450#define bfin_write_CAN1_MB06_LENGTH(val) bfin_write16(CAN1_MB06_LENGTH, val)
451#define bfin_read_CAN1_MB06_TIMESTAMP() bfin_read16(CAN1_MB06_TIMESTAMP)
452#define bfin_write_CAN1_MB06_TIMESTAMP(val) bfin_write16(CAN1_MB06_TIMESTAMP, val)
453#define bfin_read_CAN1_MB06_ID0() bfin_read16(CAN1_MB06_ID0)
454#define bfin_write_CAN1_MB06_ID0(val) bfin_write16(CAN1_MB06_ID0, val)
455#define bfin_read_CAN1_MB06_ID1() bfin_read16(CAN1_MB06_ID1)
456#define bfin_write_CAN1_MB06_ID1(val) bfin_write16(CAN1_MB06_ID1, val)
457#define bfin_read_CAN1_MB07_DATA0() bfin_read16(CAN1_MB07_DATA0)
458#define bfin_write_CAN1_MB07_DATA0(val) bfin_write16(CAN1_MB07_DATA0, val)
459#define bfin_read_CAN1_MB07_DATA1() bfin_read16(CAN1_MB07_DATA1)
460#define bfin_write_CAN1_MB07_DATA1(val) bfin_write16(CAN1_MB07_DATA1, val)
461#define bfin_read_CAN1_MB07_DATA2() bfin_read16(CAN1_MB07_DATA2)
462#define bfin_write_CAN1_MB07_DATA2(val) bfin_write16(CAN1_MB07_DATA2, val)
463#define bfin_read_CAN1_MB07_DATA3() bfin_read16(CAN1_MB07_DATA3)
464#define bfin_write_CAN1_MB07_DATA3(val) bfin_write16(CAN1_MB07_DATA3, val)
465#define bfin_read_CAN1_MB07_LENGTH() bfin_read16(CAN1_MB07_LENGTH)
466#define bfin_write_CAN1_MB07_LENGTH(val) bfin_write16(CAN1_MB07_LENGTH, val)
467#define bfin_read_CAN1_MB07_TIMESTAMP() bfin_read16(CAN1_MB07_TIMESTAMP)
468#define bfin_write_CAN1_MB07_TIMESTAMP(val) bfin_write16(CAN1_MB07_TIMESTAMP, val)
469#define bfin_read_CAN1_MB07_ID0() bfin_read16(CAN1_MB07_ID0)
470#define bfin_write_CAN1_MB07_ID0(val) bfin_write16(CAN1_MB07_ID0, val)
471#define bfin_read_CAN1_MB07_ID1() bfin_read16(CAN1_MB07_ID1)
472#define bfin_write_CAN1_MB07_ID1(val) bfin_write16(CAN1_MB07_ID1, val)
473#define bfin_read_CAN1_MB08_DATA0() bfin_read16(CAN1_MB08_DATA0)
474#define bfin_write_CAN1_MB08_DATA0(val) bfin_write16(CAN1_MB08_DATA0, val)
475#define bfin_read_CAN1_MB08_DATA1() bfin_read16(CAN1_MB08_DATA1)
476#define bfin_write_CAN1_MB08_DATA1(val) bfin_write16(CAN1_MB08_DATA1, val)
477#define bfin_read_CAN1_MB08_DATA2() bfin_read16(CAN1_MB08_DATA2)
478#define bfin_write_CAN1_MB08_DATA2(val) bfin_write16(CAN1_MB08_DATA2, val)
479#define bfin_read_CAN1_MB08_DATA3() bfin_read16(CAN1_MB08_DATA3)
480#define bfin_write_CAN1_MB08_DATA3(val) bfin_write16(CAN1_MB08_DATA3, val)
481#define bfin_read_CAN1_MB08_LENGTH() bfin_read16(CAN1_MB08_LENGTH)
482#define bfin_write_CAN1_MB08_LENGTH(val) bfin_write16(CAN1_MB08_LENGTH, val)
483#define bfin_read_CAN1_MB08_TIMESTAMP() bfin_read16(CAN1_MB08_TIMESTAMP)
484#define bfin_write_CAN1_MB08_TIMESTAMP(val) bfin_write16(CAN1_MB08_TIMESTAMP, val)
485#define bfin_read_CAN1_MB08_ID0() bfin_read16(CAN1_MB08_ID0)
486#define bfin_write_CAN1_MB08_ID0(val) bfin_write16(CAN1_MB08_ID0, val)
487#define bfin_read_CAN1_MB08_ID1() bfin_read16(CAN1_MB08_ID1)
488#define bfin_write_CAN1_MB08_ID1(val) bfin_write16(CAN1_MB08_ID1, val)
489#define bfin_read_CAN1_MB09_DATA0() bfin_read16(CAN1_MB09_DATA0)
490#define bfin_write_CAN1_MB09_DATA0(val) bfin_write16(CAN1_MB09_DATA0, val)
491#define bfin_read_CAN1_MB09_DATA1() bfin_read16(CAN1_MB09_DATA1)
492#define bfin_write_CAN1_MB09_DATA1(val) bfin_write16(CAN1_MB09_DATA1, val)
493#define bfin_read_CAN1_MB09_DATA2() bfin_read16(CAN1_MB09_DATA2)
494#define bfin_write_CAN1_MB09_DATA2(val) bfin_write16(CAN1_MB09_DATA2, val)
495#define bfin_read_CAN1_MB09_DATA3() bfin_read16(CAN1_MB09_DATA3)
496#define bfin_write_CAN1_MB09_DATA3(val) bfin_write16(CAN1_MB09_DATA3, val)
497#define bfin_read_CAN1_MB09_LENGTH() bfin_read16(CAN1_MB09_LENGTH)
498#define bfin_write_CAN1_MB09_LENGTH(val) bfin_write16(CAN1_MB09_LENGTH, val)
499#define bfin_read_CAN1_MB09_TIMESTAMP() bfin_read16(CAN1_MB09_TIMESTAMP)
500#define bfin_write_CAN1_MB09_TIMESTAMP(val) bfin_write16(CAN1_MB09_TIMESTAMP, val)
501#define bfin_read_CAN1_MB09_ID0() bfin_read16(CAN1_MB09_ID0)
502#define bfin_write_CAN1_MB09_ID0(val) bfin_write16(CAN1_MB09_ID0, val)
503#define bfin_read_CAN1_MB09_ID1() bfin_read16(CAN1_MB09_ID1)
504#define bfin_write_CAN1_MB09_ID1(val) bfin_write16(CAN1_MB09_ID1, val)
505#define bfin_read_CAN1_MB10_DATA0() bfin_read16(CAN1_MB10_DATA0)
506#define bfin_write_CAN1_MB10_DATA0(val) bfin_write16(CAN1_MB10_DATA0, val)
507#define bfin_read_CAN1_MB10_DATA1() bfin_read16(CAN1_MB10_DATA1)
508#define bfin_write_CAN1_MB10_DATA1(val) bfin_write16(CAN1_MB10_DATA1, val)
509#define bfin_read_CAN1_MB10_DATA2() bfin_read16(CAN1_MB10_DATA2)
510#define bfin_write_CAN1_MB10_DATA2(val) bfin_write16(CAN1_MB10_DATA2, val)
511#define bfin_read_CAN1_MB10_DATA3() bfin_read16(CAN1_MB10_DATA3)
512#define bfin_write_CAN1_MB10_DATA3(val) bfin_write16(CAN1_MB10_DATA3, val)
513#define bfin_read_CAN1_MB10_LENGTH() bfin_read16(CAN1_MB10_LENGTH)
514#define bfin_write_CAN1_MB10_LENGTH(val) bfin_write16(CAN1_MB10_LENGTH, val)
515#define bfin_read_CAN1_MB10_TIMESTAMP() bfin_read16(CAN1_MB10_TIMESTAMP)
516#define bfin_write_CAN1_MB10_TIMESTAMP(val) bfin_write16(CAN1_MB10_TIMESTAMP, val)
517#define bfin_read_CAN1_MB10_ID0() bfin_read16(CAN1_MB10_ID0)
518#define bfin_write_CAN1_MB10_ID0(val) bfin_write16(CAN1_MB10_ID0, val)
519#define bfin_read_CAN1_MB10_ID1() bfin_read16(CAN1_MB10_ID1)
520#define bfin_write_CAN1_MB10_ID1(val) bfin_write16(CAN1_MB10_ID1, val)
521#define bfin_read_CAN1_MB11_DATA0() bfin_read16(CAN1_MB11_DATA0)
522#define bfin_write_CAN1_MB11_DATA0(val) bfin_write16(CAN1_MB11_DATA0, val)
523#define bfin_read_CAN1_MB11_DATA1() bfin_read16(CAN1_MB11_DATA1)
524#define bfin_write_CAN1_MB11_DATA1(val) bfin_write16(CAN1_MB11_DATA1, val)
525#define bfin_read_CAN1_MB11_DATA2() bfin_read16(CAN1_MB11_DATA2)
526#define bfin_write_CAN1_MB11_DATA2(val) bfin_write16(CAN1_MB11_DATA2, val)
527#define bfin_read_CAN1_MB11_DATA3() bfin_read16(CAN1_MB11_DATA3)
528#define bfin_write_CAN1_MB11_DATA3(val) bfin_write16(CAN1_MB11_DATA3, val)
529#define bfin_read_CAN1_MB11_LENGTH() bfin_read16(CAN1_MB11_LENGTH)
530#define bfin_write_CAN1_MB11_LENGTH(val) bfin_write16(CAN1_MB11_LENGTH, val)
531#define bfin_read_CAN1_MB11_TIMESTAMP() bfin_read16(CAN1_MB11_TIMESTAMP)
532#define bfin_write_CAN1_MB11_TIMESTAMP(val) bfin_write16(CAN1_MB11_TIMESTAMP, val)
533#define bfin_read_CAN1_MB11_ID0() bfin_read16(CAN1_MB11_ID0)
534#define bfin_write_CAN1_MB11_ID0(val) bfin_write16(CAN1_MB11_ID0, val)
535#define bfin_read_CAN1_MB11_ID1() bfin_read16(CAN1_MB11_ID1)
536#define bfin_write_CAN1_MB11_ID1(val) bfin_write16(CAN1_MB11_ID1, val)
537#define bfin_read_CAN1_MB12_DATA0() bfin_read16(CAN1_MB12_DATA0)
538#define bfin_write_CAN1_MB12_DATA0(val) bfin_write16(CAN1_MB12_DATA0, val)
539#define bfin_read_CAN1_MB12_DATA1() bfin_read16(CAN1_MB12_DATA1)
540#define bfin_write_CAN1_MB12_DATA1(val) bfin_write16(CAN1_MB12_DATA1, val)
541#define bfin_read_CAN1_MB12_DATA2() bfin_read16(CAN1_MB12_DATA2)
542#define bfin_write_CAN1_MB12_DATA2(val) bfin_write16(CAN1_MB12_DATA2, val)
543#define bfin_read_CAN1_MB12_DATA3() bfin_read16(CAN1_MB12_DATA3)
544#define bfin_write_CAN1_MB12_DATA3(val) bfin_write16(CAN1_MB12_DATA3, val)
545#define bfin_read_CAN1_MB12_LENGTH() bfin_read16(CAN1_MB12_LENGTH)
546#define bfin_write_CAN1_MB12_LENGTH(val) bfin_write16(CAN1_MB12_LENGTH, val)
547#define bfin_read_CAN1_MB12_TIMESTAMP() bfin_read16(CAN1_MB12_TIMESTAMP)
548#define bfin_write_CAN1_MB12_TIMESTAMP(val) bfin_write16(CAN1_MB12_TIMESTAMP, val)
549#define bfin_read_CAN1_MB12_ID0() bfin_read16(CAN1_MB12_ID0)
550#define bfin_write_CAN1_MB12_ID0(val) bfin_write16(CAN1_MB12_ID0, val)
551#define bfin_read_CAN1_MB12_ID1() bfin_read16(CAN1_MB12_ID1)
552#define bfin_write_CAN1_MB12_ID1(val) bfin_write16(CAN1_MB12_ID1, val)
553#define bfin_read_CAN1_MB13_DATA0() bfin_read16(CAN1_MB13_DATA0)
554#define bfin_write_CAN1_MB13_DATA0(val) bfin_write16(CAN1_MB13_DATA0, val)
555#define bfin_read_CAN1_MB13_DATA1() bfin_read16(CAN1_MB13_DATA1)
556#define bfin_write_CAN1_MB13_DATA1(val) bfin_write16(CAN1_MB13_DATA1, val)
557#define bfin_read_CAN1_MB13_DATA2() bfin_read16(CAN1_MB13_DATA2)
558#define bfin_write_CAN1_MB13_DATA2(val) bfin_write16(CAN1_MB13_DATA2, val)
559#define bfin_read_CAN1_MB13_DATA3() bfin_read16(CAN1_MB13_DATA3)
560#define bfin_write_CAN1_MB13_DATA3(val) bfin_write16(CAN1_MB13_DATA3, val)
561#define bfin_read_CAN1_MB13_LENGTH() bfin_read16(CAN1_MB13_LENGTH)
562#define bfin_write_CAN1_MB13_LENGTH(val) bfin_write16(CAN1_MB13_LENGTH, val)
563#define bfin_read_CAN1_MB13_TIMESTAMP() bfin_read16(CAN1_MB13_TIMESTAMP)
564#define bfin_write_CAN1_MB13_TIMESTAMP(val) bfin_write16(CAN1_MB13_TIMESTAMP, val)
565#define bfin_read_CAN1_MB13_ID0() bfin_read16(CAN1_MB13_ID0)
566#define bfin_write_CAN1_MB13_ID0(val) bfin_write16(CAN1_MB13_ID0, val)
567#define bfin_read_CAN1_MB13_ID1() bfin_read16(CAN1_MB13_ID1)
568#define bfin_write_CAN1_MB13_ID1(val) bfin_write16(CAN1_MB13_ID1, val)
569#define bfin_read_CAN1_MB14_DATA0() bfin_read16(CAN1_MB14_DATA0)
570#define bfin_write_CAN1_MB14_DATA0(val) bfin_write16(CAN1_MB14_DATA0, val)
571#define bfin_read_CAN1_MB14_DATA1() bfin_read16(CAN1_MB14_DATA1)
572#define bfin_write_CAN1_MB14_DATA1(val) bfin_write16(CAN1_MB14_DATA1, val)
573#define bfin_read_CAN1_MB14_DATA2() bfin_read16(CAN1_MB14_DATA2)
574#define bfin_write_CAN1_MB14_DATA2(val) bfin_write16(CAN1_MB14_DATA2, val)
575#define bfin_read_CAN1_MB14_DATA3() bfin_read16(CAN1_MB14_DATA3)
576#define bfin_write_CAN1_MB14_DATA3(val) bfin_write16(CAN1_MB14_DATA3, val)
577#define bfin_read_CAN1_MB14_LENGTH() bfin_read16(CAN1_MB14_LENGTH)
578#define bfin_write_CAN1_MB14_LENGTH(val) bfin_write16(CAN1_MB14_LENGTH, val)
579#define bfin_read_CAN1_MB14_TIMESTAMP() bfin_read16(CAN1_MB14_TIMESTAMP)
580#define bfin_write_CAN1_MB14_TIMESTAMP(val) bfin_write16(CAN1_MB14_TIMESTAMP, val)
581#define bfin_read_CAN1_MB14_ID0() bfin_read16(CAN1_MB14_ID0)
582#define bfin_write_CAN1_MB14_ID0(val) bfin_write16(CAN1_MB14_ID0, val)
583#define bfin_read_CAN1_MB14_ID1() bfin_read16(CAN1_MB14_ID1)
584#define bfin_write_CAN1_MB14_ID1(val) bfin_write16(CAN1_MB14_ID1, val)
585#define bfin_read_CAN1_MB15_DATA0() bfin_read16(CAN1_MB15_DATA0)
586#define bfin_write_CAN1_MB15_DATA0(val) bfin_write16(CAN1_MB15_DATA0, val)
587#define bfin_read_CAN1_MB15_DATA1() bfin_read16(CAN1_MB15_DATA1)
588#define bfin_write_CAN1_MB15_DATA1(val) bfin_write16(CAN1_MB15_DATA1, val)
589#define bfin_read_CAN1_MB15_DATA2() bfin_read16(CAN1_MB15_DATA2)
590#define bfin_write_CAN1_MB15_DATA2(val) bfin_write16(CAN1_MB15_DATA2, val)
591#define bfin_read_CAN1_MB15_DATA3() bfin_read16(CAN1_MB15_DATA3)
592#define bfin_write_CAN1_MB15_DATA3(val) bfin_write16(CAN1_MB15_DATA3, val)
593#define bfin_read_CAN1_MB15_LENGTH() bfin_read16(CAN1_MB15_LENGTH)
594#define bfin_write_CAN1_MB15_LENGTH(val) bfin_write16(CAN1_MB15_LENGTH, val)
595#define bfin_read_CAN1_MB15_TIMESTAMP() bfin_read16(CAN1_MB15_TIMESTAMP)
596#define bfin_write_CAN1_MB15_TIMESTAMP(val) bfin_write16(CAN1_MB15_TIMESTAMP, val)
597#define bfin_read_CAN1_MB15_ID0() bfin_read16(CAN1_MB15_ID0)
598#define bfin_write_CAN1_MB15_ID0(val) bfin_write16(CAN1_MB15_ID0, val)
599#define bfin_read_CAN1_MB15_ID1() bfin_read16(CAN1_MB15_ID1)
600#define bfin_write_CAN1_MB15_ID1(val) bfin_write16(CAN1_MB15_ID1, val)
601
602/* CAN Controller 1 Mailbox Data Registers */
603
604#define bfin_read_CAN1_MB16_DATA0() bfin_read16(CAN1_MB16_DATA0)
605#define bfin_write_CAN1_MB16_DATA0(val) bfin_write16(CAN1_MB16_DATA0, val)
606#define bfin_read_CAN1_MB16_DATA1() bfin_read16(CAN1_MB16_DATA1)
607#define bfin_write_CAN1_MB16_DATA1(val) bfin_write16(CAN1_MB16_DATA1, val)
608#define bfin_read_CAN1_MB16_DATA2() bfin_read16(CAN1_MB16_DATA2)
609#define bfin_write_CAN1_MB16_DATA2(val) bfin_write16(CAN1_MB16_DATA2, val)
610#define bfin_read_CAN1_MB16_DATA3() bfin_read16(CAN1_MB16_DATA3)
611#define bfin_write_CAN1_MB16_DATA3(val) bfin_write16(CAN1_MB16_DATA3, val)
612#define bfin_read_CAN1_MB16_LENGTH() bfin_read16(CAN1_MB16_LENGTH)
613#define bfin_write_CAN1_MB16_LENGTH(val) bfin_write16(CAN1_MB16_LENGTH, val)
614#define bfin_read_CAN1_MB16_TIMESTAMP() bfin_read16(CAN1_MB16_TIMESTAMP)
615#define bfin_write_CAN1_MB16_TIMESTAMP(val) bfin_write16(CAN1_MB16_TIMESTAMP, val)
616#define bfin_read_CAN1_MB16_ID0() bfin_read16(CAN1_MB16_ID0)
617#define bfin_write_CAN1_MB16_ID0(val) bfin_write16(CAN1_MB16_ID0, val)
618#define bfin_read_CAN1_MB16_ID1() bfin_read16(CAN1_MB16_ID1)
619#define bfin_write_CAN1_MB16_ID1(val) bfin_write16(CAN1_MB16_ID1, val)
620#define bfin_read_CAN1_MB17_DATA0() bfin_read16(CAN1_MB17_DATA0)
621#define bfin_write_CAN1_MB17_DATA0(val) bfin_write16(CAN1_MB17_DATA0, val)
622#define bfin_read_CAN1_MB17_DATA1() bfin_read16(CAN1_MB17_DATA1)
623#define bfin_write_CAN1_MB17_DATA1(val) bfin_write16(CAN1_MB17_DATA1, val)
624#define bfin_read_CAN1_MB17_DATA2() bfin_read16(CAN1_MB17_DATA2)
625#define bfin_write_CAN1_MB17_DATA2(val) bfin_write16(CAN1_MB17_DATA2, val)
626#define bfin_read_CAN1_MB17_DATA3() bfin_read16(CAN1_MB17_DATA3)
627#define bfin_write_CAN1_MB17_DATA3(val) bfin_write16(CAN1_MB17_DATA3, val)
628#define bfin_read_CAN1_MB17_LENGTH() bfin_read16(CAN1_MB17_LENGTH)
629#define bfin_write_CAN1_MB17_LENGTH(val) bfin_write16(CAN1_MB17_LENGTH, val)
630#define bfin_read_CAN1_MB17_TIMESTAMP() bfin_read16(CAN1_MB17_TIMESTAMP)
631#define bfin_write_CAN1_MB17_TIMESTAMP(val) bfin_write16(CAN1_MB17_TIMESTAMP, val)
632#define bfin_read_CAN1_MB17_ID0() bfin_read16(CAN1_MB17_ID0)
633#define bfin_write_CAN1_MB17_ID0(val) bfin_write16(CAN1_MB17_ID0, val)
634#define bfin_read_CAN1_MB17_ID1() bfin_read16(CAN1_MB17_ID1)
635#define bfin_write_CAN1_MB17_ID1(val) bfin_write16(CAN1_MB17_ID1, val)
636#define bfin_read_CAN1_MB18_DATA0() bfin_read16(CAN1_MB18_DATA0)
637#define bfin_write_CAN1_MB18_DATA0(val) bfin_write16(CAN1_MB18_DATA0, val)
638#define bfin_read_CAN1_MB18_DATA1() bfin_read16(CAN1_MB18_DATA1)
639#define bfin_write_CAN1_MB18_DATA1(val) bfin_write16(CAN1_MB18_DATA1, val)
640#define bfin_read_CAN1_MB18_DATA2() bfin_read16(CAN1_MB18_DATA2)
641#define bfin_write_CAN1_MB18_DATA2(val) bfin_write16(CAN1_MB18_DATA2, val)
642#define bfin_read_CAN1_MB18_DATA3() bfin_read16(CAN1_MB18_DATA3)
643#define bfin_write_CAN1_MB18_DATA3(val) bfin_write16(CAN1_MB18_DATA3, val)
644#define bfin_read_CAN1_MB18_LENGTH() bfin_read16(CAN1_MB18_LENGTH)
645#define bfin_write_CAN1_MB18_LENGTH(val) bfin_write16(CAN1_MB18_LENGTH, val)
646#define bfin_read_CAN1_MB18_TIMESTAMP() bfin_read16(CAN1_MB18_TIMESTAMP)
647#define bfin_write_CAN1_MB18_TIMESTAMP(val) bfin_write16(CAN1_MB18_TIMESTAMP, val)
648#define bfin_read_CAN1_MB18_ID0() bfin_read16(CAN1_MB18_ID0)
649#define bfin_write_CAN1_MB18_ID0(val) bfin_write16(CAN1_MB18_ID0, val)
650#define bfin_read_CAN1_MB18_ID1() bfin_read16(CAN1_MB18_ID1)
651#define bfin_write_CAN1_MB18_ID1(val) bfin_write16(CAN1_MB18_ID1, val)
652#define bfin_read_CAN1_MB19_DATA0() bfin_read16(CAN1_MB19_DATA0)
653#define bfin_write_CAN1_MB19_DATA0(val) bfin_write16(CAN1_MB19_DATA0, val)
654#define bfin_read_CAN1_MB19_DATA1() bfin_read16(CAN1_MB19_DATA1)
655#define bfin_write_CAN1_MB19_DATA1(val) bfin_write16(CAN1_MB19_DATA1, val)
656#define bfin_read_CAN1_MB19_DATA2() bfin_read16(CAN1_MB19_DATA2)
657#define bfin_write_CAN1_MB19_DATA2(val) bfin_write16(CAN1_MB19_DATA2, val)
658#define bfin_read_CAN1_MB19_DATA3() bfin_read16(CAN1_MB19_DATA3)
659#define bfin_write_CAN1_MB19_DATA3(val) bfin_write16(CAN1_MB19_DATA3, val)
660#define bfin_read_CAN1_MB19_LENGTH() bfin_read16(CAN1_MB19_LENGTH)
661#define bfin_write_CAN1_MB19_LENGTH(val) bfin_write16(CAN1_MB19_LENGTH, val)
662#define bfin_read_CAN1_MB19_TIMESTAMP() bfin_read16(CAN1_MB19_TIMESTAMP)
663#define bfin_write_CAN1_MB19_TIMESTAMP(val) bfin_write16(CAN1_MB19_TIMESTAMP, val)
664#define bfin_read_CAN1_MB19_ID0() bfin_read16(CAN1_MB19_ID0)
665#define bfin_write_CAN1_MB19_ID0(val) bfin_write16(CAN1_MB19_ID0, val)
666#define bfin_read_CAN1_MB19_ID1() bfin_read16(CAN1_MB19_ID1)
667#define bfin_write_CAN1_MB19_ID1(val) bfin_write16(CAN1_MB19_ID1, val)
668#define bfin_read_CAN1_MB20_DATA0() bfin_read16(CAN1_MB20_DATA0)
669#define bfin_write_CAN1_MB20_DATA0(val) bfin_write16(CAN1_MB20_DATA0, val)
670#define bfin_read_CAN1_MB20_DATA1() bfin_read16(CAN1_MB20_DATA1)
671#define bfin_write_CAN1_MB20_DATA1(val) bfin_write16(CAN1_MB20_DATA1, val)
672#define bfin_read_CAN1_MB20_DATA2() bfin_read16(CAN1_MB20_DATA2)
673#define bfin_write_CAN1_MB20_DATA2(val) bfin_write16(CAN1_MB20_DATA2, val)
674#define bfin_read_CAN1_MB20_DATA3() bfin_read16(CAN1_MB20_DATA3)
675#define bfin_write_CAN1_MB20_DATA3(val) bfin_write16(CAN1_MB20_DATA3, val)
676#define bfin_read_CAN1_MB20_LENGTH() bfin_read16(CAN1_MB20_LENGTH)
677#define bfin_write_CAN1_MB20_LENGTH(val) bfin_write16(CAN1_MB20_LENGTH, val)
678#define bfin_read_CAN1_MB20_TIMESTAMP() bfin_read16(CAN1_MB20_TIMESTAMP)
679#define bfin_write_CAN1_MB20_TIMESTAMP(val) bfin_write16(CAN1_MB20_TIMESTAMP, val)
680#define bfin_read_CAN1_MB20_ID0() bfin_read16(CAN1_MB20_ID0)
681#define bfin_write_CAN1_MB20_ID0(val) bfin_write16(CAN1_MB20_ID0, val)
682#define bfin_read_CAN1_MB20_ID1() bfin_read16(CAN1_MB20_ID1)
683#define bfin_write_CAN1_MB20_ID1(val) bfin_write16(CAN1_MB20_ID1, val)
684#define bfin_read_CAN1_MB21_DATA0() bfin_read16(CAN1_MB21_DATA0)
685#define bfin_write_CAN1_MB21_DATA0(val) bfin_write16(CAN1_MB21_DATA0, val)
686#define bfin_read_CAN1_MB21_DATA1() bfin_read16(CAN1_MB21_DATA1)
687#define bfin_write_CAN1_MB21_DATA1(val) bfin_write16(CAN1_MB21_DATA1, val)
688#define bfin_read_CAN1_MB21_DATA2() bfin_read16(CAN1_MB21_DATA2)
689#define bfin_write_CAN1_MB21_DATA2(val) bfin_write16(CAN1_MB21_DATA2, val)
690#define bfin_read_CAN1_MB21_DATA3() bfin_read16(CAN1_MB21_DATA3)
691#define bfin_write_CAN1_MB21_DATA3(val) bfin_write16(CAN1_MB21_DATA3, val)
692#define bfin_read_CAN1_MB21_LENGTH() bfin_read16(CAN1_MB21_LENGTH)
693#define bfin_write_CAN1_MB21_LENGTH(val) bfin_write16(CAN1_MB21_LENGTH, val)
694#define bfin_read_CAN1_MB21_TIMESTAMP() bfin_read16(CAN1_MB21_TIMESTAMP)
695#define bfin_write_CAN1_MB21_TIMESTAMP(val) bfin_write16(CAN1_MB21_TIMESTAMP, val)
696#define bfin_read_CAN1_MB21_ID0() bfin_read16(CAN1_MB21_ID0)
697#define bfin_write_CAN1_MB21_ID0(val) bfin_write16(CAN1_MB21_ID0, val)
698#define bfin_read_CAN1_MB21_ID1() bfin_read16(CAN1_MB21_ID1)
699#define bfin_write_CAN1_MB21_ID1(val) bfin_write16(CAN1_MB21_ID1, val)
700#define bfin_read_CAN1_MB22_DATA0() bfin_read16(CAN1_MB22_DATA0)
701#define bfin_write_CAN1_MB22_DATA0(val) bfin_write16(CAN1_MB22_DATA0, val)
702#define bfin_read_CAN1_MB22_DATA1() bfin_read16(CAN1_MB22_DATA1)
703#define bfin_write_CAN1_MB22_DATA1(val) bfin_write16(CAN1_MB22_DATA1, val)
704#define bfin_read_CAN1_MB22_DATA2() bfin_read16(CAN1_MB22_DATA2)
705#define bfin_write_CAN1_MB22_DATA2(val) bfin_write16(CAN1_MB22_DATA2, val)
706#define bfin_read_CAN1_MB22_DATA3() bfin_read16(CAN1_MB22_DATA3)
707#define bfin_write_CAN1_MB22_DATA3(val) bfin_write16(CAN1_MB22_DATA3, val)
708#define bfin_read_CAN1_MB22_LENGTH() bfin_read16(CAN1_MB22_LENGTH)
709#define bfin_write_CAN1_MB22_LENGTH(val) bfin_write16(CAN1_MB22_LENGTH, val)
710#define bfin_read_CAN1_MB22_TIMESTAMP() bfin_read16(CAN1_MB22_TIMESTAMP)
711#define bfin_write_CAN1_MB22_TIMESTAMP(val) bfin_write16(CAN1_MB22_TIMESTAMP, val)
712#define bfin_read_CAN1_MB22_ID0() bfin_read16(CAN1_MB22_ID0)
713#define bfin_write_CAN1_MB22_ID0(val) bfin_write16(CAN1_MB22_ID0, val)
714#define bfin_read_CAN1_MB22_ID1() bfin_read16(CAN1_MB22_ID1)
715#define bfin_write_CAN1_MB22_ID1(val) bfin_write16(CAN1_MB22_ID1, val)
716#define bfin_read_CAN1_MB23_DATA0() bfin_read16(CAN1_MB23_DATA0)
717#define bfin_write_CAN1_MB23_DATA0(val) bfin_write16(CAN1_MB23_DATA0, val)
718#define bfin_read_CAN1_MB23_DATA1() bfin_read16(CAN1_MB23_DATA1)
719#define bfin_write_CAN1_MB23_DATA1(val) bfin_write16(CAN1_MB23_DATA1, val)
720#define bfin_read_CAN1_MB23_DATA2() bfin_read16(CAN1_MB23_DATA2)
721#define bfin_write_CAN1_MB23_DATA2(val) bfin_write16(CAN1_MB23_DATA2, val)
722#define bfin_read_CAN1_MB23_DATA3() bfin_read16(CAN1_MB23_DATA3)
723#define bfin_write_CAN1_MB23_DATA3(val) bfin_write16(CAN1_MB23_DATA3, val)
724#define bfin_read_CAN1_MB23_LENGTH() bfin_read16(CAN1_MB23_LENGTH)
725#define bfin_write_CAN1_MB23_LENGTH(val) bfin_write16(CAN1_MB23_LENGTH, val)
726#define bfin_read_CAN1_MB23_TIMESTAMP() bfin_read16(CAN1_MB23_TIMESTAMP)
727#define bfin_write_CAN1_MB23_TIMESTAMP(val) bfin_write16(CAN1_MB23_TIMESTAMP, val)
728#define bfin_read_CAN1_MB23_ID0() bfin_read16(CAN1_MB23_ID0)
729#define bfin_write_CAN1_MB23_ID0(val) bfin_write16(CAN1_MB23_ID0, val)
730#define bfin_read_CAN1_MB23_ID1() bfin_read16(CAN1_MB23_ID1)
731#define bfin_write_CAN1_MB23_ID1(val) bfin_write16(CAN1_MB23_ID1, val)
732#define bfin_read_CAN1_MB24_DATA0() bfin_read16(CAN1_MB24_DATA0)
733#define bfin_write_CAN1_MB24_DATA0(val) bfin_write16(CAN1_MB24_DATA0, val)
734#define bfin_read_CAN1_MB24_DATA1() bfin_read16(CAN1_MB24_DATA1)
735#define bfin_write_CAN1_MB24_DATA1(val) bfin_write16(CAN1_MB24_DATA1, val)
736#define bfin_read_CAN1_MB24_DATA2() bfin_read16(CAN1_MB24_DATA2)
737#define bfin_write_CAN1_MB24_DATA2(val) bfin_write16(CAN1_MB24_DATA2, val)
738#define bfin_read_CAN1_MB24_DATA3() bfin_read16(CAN1_MB24_DATA3)
739#define bfin_write_CAN1_MB24_DATA3(val) bfin_write16(CAN1_MB24_DATA3, val)
740#define bfin_read_CAN1_MB24_LENGTH() bfin_read16(CAN1_MB24_LENGTH)
741#define bfin_write_CAN1_MB24_LENGTH(val) bfin_write16(CAN1_MB24_LENGTH, val)
742#define bfin_read_CAN1_MB24_TIMESTAMP() bfin_read16(CAN1_MB24_TIMESTAMP)
743#define bfin_write_CAN1_MB24_TIMESTAMP(val) bfin_write16(CAN1_MB24_TIMESTAMP, val)
744#define bfin_read_CAN1_MB24_ID0() bfin_read16(CAN1_MB24_ID0)
745#define bfin_write_CAN1_MB24_ID0(val) bfin_write16(CAN1_MB24_ID0, val)
746#define bfin_read_CAN1_MB24_ID1() bfin_read16(CAN1_MB24_ID1)
747#define bfin_write_CAN1_MB24_ID1(val) bfin_write16(CAN1_MB24_ID1, val)
748#define bfin_read_CAN1_MB25_DATA0() bfin_read16(CAN1_MB25_DATA0)
749#define bfin_write_CAN1_MB25_DATA0(val) bfin_write16(CAN1_MB25_DATA0, val)
750#define bfin_read_CAN1_MB25_DATA1() bfin_read16(CAN1_MB25_DATA1)
751#define bfin_write_CAN1_MB25_DATA1(val) bfin_write16(CAN1_MB25_DATA1, val)
752#define bfin_read_CAN1_MB25_DATA2() bfin_read16(CAN1_MB25_DATA2)
753#define bfin_write_CAN1_MB25_DATA2(val) bfin_write16(CAN1_MB25_DATA2, val)
754#define bfin_read_CAN1_MB25_DATA3() bfin_read16(CAN1_MB25_DATA3)
755#define bfin_write_CAN1_MB25_DATA3(val) bfin_write16(CAN1_MB25_DATA3, val)
756#define bfin_read_CAN1_MB25_LENGTH() bfin_read16(CAN1_MB25_LENGTH)
757#define bfin_write_CAN1_MB25_LENGTH(val) bfin_write16(CAN1_MB25_LENGTH, val)
758#define bfin_read_CAN1_MB25_TIMESTAMP() bfin_read16(CAN1_MB25_TIMESTAMP)
759#define bfin_write_CAN1_MB25_TIMESTAMP(val) bfin_write16(CAN1_MB25_TIMESTAMP, val)
760#define bfin_read_CAN1_MB25_ID0() bfin_read16(CAN1_MB25_ID0)
761#define bfin_write_CAN1_MB25_ID0(val) bfin_write16(CAN1_MB25_ID0, val)
762#define bfin_read_CAN1_MB25_ID1() bfin_read16(CAN1_MB25_ID1)
763#define bfin_write_CAN1_MB25_ID1(val) bfin_write16(CAN1_MB25_ID1, val)
764#define bfin_read_CAN1_MB26_DATA0() bfin_read16(CAN1_MB26_DATA0)
765#define bfin_write_CAN1_MB26_DATA0(val) bfin_write16(CAN1_MB26_DATA0, val)
766#define bfin_read_CAN1_MB26_DATA1() bfin_read16(CAN1_MB26_DATA1)
767#define bfin_write_CAN1_MB26_DATA1(val) bfin_write16(CAN1_MB26_DATA1, val)
768#define bfin_read_CAN1_MB26_DATA2() bfin_read16(CAN1_MB26_DATA2)
769#define bfin_write_CAN1_MB26_DATA2(val) bfin_write16(CAN1_MB26_DATA2, val)
770#define bfin_read_CAN1_MB26_DATA3() bfin_read16(CAN1_MB26_DATA3)
771#define bfin_write_CAN1_MB26_DATA3(val) bfin_write16(CAN1_MB26_DATA3, val)
772#define bfin_read_CAN1_MB26_LENGTH() bfin_read16(CAN1_MB26_LENGTH)
773#define bfin_write_CAN1_MB26_LENGTH(val) bfin_write16(CAN1_MB26_LENGTH, val)
774#define bfin_read_CAN1_MB26_TIMESTAMP() bfin_read16(CAN1_MB26_TIMESTAMP)
775#define bfin_write_CAN1_MB26_TIMESTAMP(val) bfin_write16(CAN1_MB26_TIMESTAMP, val)
776#define bfin_read_CAN1_MB26_ID0() bfin_read16(CAN1_MB26_ID0)
777#define bfin_write_CAN1_MB26_ID0(val) bfin_write16(CAN1_MB26_ID0, val)
778#define bfin_read_CAN1_MB26_ID1() bfin_read16(CAN1_MB26_ID1)
779#define bfin_write_CAN1_MB26_ID1(val) bfin_write16(CAN1_MB26_ID1, val)
780#define bfin_read_CAN1_MB27_DATA0() bfin_read16(CAN1_MB27_DATA0)
781#define bfin_write_CAN1_MB27_DATA0(val) bfin_write16(CAN1_MB27_DATA0, val)
782#define bfin_read_CAN1_MB27_DATA1() bfin_read16(CAN1_MB27_DATA1)
783#define bfin_write_CAN1_MB27_DATA1(val) bfin_write16(CAN1_MB27_DATA1, val)
784#define bfin_read_CAN1_MB27_DATA2() bfin_read16(CAN1_MB27_DATA2)
785#define bfin_write_CAN1_MB27_DATA2(val) bfin_write16(CAN1_MB27_DATA2, val)
786#define bfin_read_CAN1_MB27_DATA3() bfin_read16(CAN1_MB27_DATA3)
787#define bfin_write_CAN1_MB27_DATA3(val) bfin_write16(CAN1_MB27_DATA3, val)
788#define bfin_read_CAN1_MB27_LENGTH() bfin_read16(CAN1_MB27_LENGTH)
789#define bfin_write_CAN1_MB27_LENGTH(val) bfin_write16(CAN1_MB27_LENGTH, val)
790#define bfin_read_CAN1_MB27_TIMESTAMP() bfin_read16(CAN1_MB27_TIMESTAMP)
791#define bfin_write_CAN1_MB27_TIMESTAMP(val) bfin_write16(CAN1_MB27_TIMESTAMP, val)
792#define bfin_read_CAN1_MB27_ID0() bfin_read16(CAN1_MB27_ID0)
793#define bfin_write_CAN1_MB27_ID0(val) bfin_write16(CAN1_MB27_ID0, val)
794#define bfin_read_CAN1_MB27_ID1() bfin_read16(CAN1_MB27_ID1)
795#define bfin_write_CAN1_MB27_ID1(val) bfin_write16(CAN1_MB27_ID1, val)
796#define bfin_read_CAN1_MB28_DATA0() bfin_read16(CAN1_MB28_DATA0)
797#define bfin_write_CAN1_MB28_DATA0(val) bfin_write16(CAN1_MB28_DATA0, val)
798#define bfin_read_CAN1_MB28_DATA1() bfin_read16(CAN1_MB28_DATA1)
799#define bfin_write_CAN1_MB28_DATA1(val) bfin_write16(CAN1_MB28_DATA1, val)
800#define bfin_read_CAN1_MB28_DATA2() bfin_read16(CAN1_MB28_DATA2)
801#define bfin_write_CAN1_MB28_DATA2(val) bfin_write16(CAN1_MB28_DATA2, val)
802#define bfin_read_CAN1_MB28_DATA3() bfin_read16(CAN1_MB28_DATA3)
803#define bfin_write_CAN1_MB28_DATA3(val) bfin_write16(CAN1_MB28_DATA3, val)
804#define bfin_read_CAN1_MB28_LENGTH() bfin_read16(CAN1_MB28_LENGTH)
805#define bfin_write_CAN1_MB28_LENGTH(val) bfin_write16(CAN1_MB28_LENGTH, val)
806#define bfin_read_CAN1_MB28_TIMESTAMP() bfin_read16(CAN1_MB28_TIMESTAMP)
807#define bfin_write_CAN1_MB28_TIMESTAMP(val) bfin_write16(CAN1_MB28_TIMESTAMP, val)
808#define bfin_read_CAN1_MB28_ID0() bfin_read16(CAN1_MB28_ID0)
809#define bfin_write_CAN1_MB28_ID0(val) bfin_write16(CAN1_MB28_ID0, val)
810#define bfin_read_CAN1_MB28_ID1() bfin_read16(CAN1_MB28_ID1)
811#define bfin_write_CAN1_MB28_ID1(val) bfin_write16(CAN1_MB28_ID1, val)
812#define bfin_read_CAN1_MB29_DATA0() bfin_read16(CAN1_MB29_DATA0)
813#define bfin_write_CAN1_MB29_DATA0(val) bfin_write16(CAN1_MB29_DATA0, val)
814#define bfin_read_CAN1_MB29_DATA1() bfin_read16(CAN1_MB29_DATA1)
815#define bfin_write_CAN1_MB29_DATA1(val) bfin_write16(CAN1_MB29_DATA1, val)
816#define bfin_read_CAN1_MB29_DATA2() bfin_read16(CAN1_MB29_DATA2)
817#define bfin_write_CAN1_MB29_DATA2(val) bfin_write16(CAN1_MB29_DATA2, val)
818#define bfin_read_CAN1_MB29_DATA3() bfin_read16(CAN1_MB29_DATA3)
819#define bfin_write_CAN1_MB29_DATA3(val) bfin_write16(CAN1_MB29_DATA3, val)
820#define bfin_read_CAN1_MB29_LENGTH() bfin_read16(CAN1_MB29_LENGTH)
821#define bfin_write_CAN1_MB29_LENGTH(val) bfin_write16(CAN1_MB29_LENGTH, val)
822#define bfin_read_CAN1_MB29_TIMESTAMP() bfin_read16(CAN1_MB29_TIMESTAMP)
823#define bfin_write_CAN1_MB29_TIMESTAMP(val) bfin_write16(CAN1_MB29_TIMESTAMP, val)
824#define bfin_read_CAN1_MB29_ID0() bfin_read16(CAN1_MB29_ID0)
825#define bfin_write_CAN1_MB29_ID0(val) bfin_write16(CAN1_MB29_ID0, val)
826#define bfin_read_CAN1_MB29_ID1() bfin_read16(CAN1_MB29_ID1)
827#define bfin_write_CAN1_MB29_ID1(val) bfin_write16(CAN1_MB29_ID1, val)
828#define bfin_read_CAN1_MB30_DATA0() bfin_read16(CAN1_MB30_DATA0)
829#define bfin_write_CAN1_MB30_DATA0(val) bfin_write16(CAN1_MB30_DATA0, val)
830#define bfin_read_CAN1_MB30_DATA1() bfin_read16(CAN1_MB30_DATA1)
831#define bfin_write_CAN1_MB30_DATA1(val) bfin_write16(CAN1_MB30_DATA1, val)
832#define bfin_read_CAN1_MB30_DATA2() bfin_read16(CAN1_MB30_DATA2)
833#define bfin_write_CAN1_MB30_DATA2(val) bfin_write16(CAN1_MB30_DATA2, val)
834#define bfin_read_CAN1_MB30_DATA3() bfin_read16(CAN1_MB30_DATA3)
835#define bfin_write_CAN1_MB30_DATA3(val) bfin_write16(CAN1_MB30_DATA3, val)
836#define bfin_read_CAN1_MB30_LENGTH() bfin_read16(CAN1_MB30_LENGTH)
837#define bfin_write_CAN1_MB30_LENGTH(val) bfin_write16(CAN1_MB30_LENGTH, val)
838#define bfin_read_CAN1_MB30_TIMESTAMP() bfin_read16(CAN1_MB30_TIMESTAMP)
839#define bfin_write_CAN1_MB30_TIMESTAMP(val) bfin_write16(CAN1_MB30_TIMESTAMP, val)
840#define bfin_read_CAN1_MB30_ID0() bfin_read16(CAN1_MB30_ID0)
841#define bfin_write_CAN1_MB30_ID0(val) bfin_write16(CAN1_MB30_ID0, val)
842#define bfin_read_CAN1_MB30_ID1() bfin_read16(CAN1_MB30_ID1)
843#define bfin_write_CAN1_MB30_ID1(val) bfin_write16(CAN1_MB30_ID1, val)
844#define bfin_read_CAN1_MB31_DATA0() bfin_read16(CAN1_MB31_DATA0)
845#define bfin_write_CAN1_MB31_DATA0(val) bfin_write16(CAN1_MB31_DATA0, val)
846#define bfin_read_CAN1_MB31_DATA1() bfin_read16(CAN1_MB31_DATA1)
847#define bfin_write_CAN1_MB31_DATA1(val) bfin_write16(CAN1_MB31_DATA1, val)
848#define bfin_read_CAN1_MB31_DATA2() bfin_read16(CAN1_MB31_DATA2)
849#define bfin_write_CAN1_MB31_DATA2(val) bfin_write16(CAN1_MB31_DATA2, val)
850#define bfin_read_CAN1_MB31_DATA3() bfin_read16(CAN1_MB31_DATA3)
851#define bfin_write_CAN1_MB31_DATA3(val) bfin_write16(CAN1_MB31_DATA3, val)
852#define bfin_read_CAN1_MB31_LENGTH() bfin_read16(CAN1_MB31_LENGTH)
853#define bfin_write_CAN1_MB31_LENGTH(val) bfin_write16(CAN1_MB31_LENGTH, val)
854#define bfin_read_CAN1_MB31_TIMESTAMP() bfin_read16(CAN1_MB31_TIMESTAMP)
855#define bfin_write_CAN1_MB31_TIMESTAMP(val) bfin_write16(CAN1_MB31_TIMESTAMP, val)
856#define bfin_read_CAN1_MB31_ID0() bfin_read16(CAN1_MB31_ID0)
857#define bfin_write_CAN1_MB31_ID0(val) bfin_write16(CAN1_MB31_ID0, val)
858#define bfin_read_CAN1_MB31_ID1() bfin_read16(CAN1_MB31_ID1)
859#define bfin_write_CAN1_MB31_ID1(val) bfin_write16(CAN1_MB31_ID1, val)
860
861/* HOST Port Registers */
862
863#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
864#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
865#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
866#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
867#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
868#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
869
870/* Pixel Combfin_read_()ositor (PIXC) Registers */
871
872#define bfin_read_PIXC_CTL() bfin_read16(PIXC_CTL)
873#define bfin_write_PIXC_CTL(val) bfin_write16(PIXC_CTL, val)
874#define bfin_read_PIXC_PPL() bfin_read16(PIXC_PPL)
875#define bfin_write_PIXC_PPL(val) bfin_write16(PIXC_PPL, val)
876#define bfin_read_PIXC_LPF() bfin_read16(PIXC_LPF)
877#define bfin_write_PIXC_LPF(val) bfin_write16(PIXC_LPF, val)
878#define bfin_read_PIXC_AHSTART() bfin_read16(PIXC_AHSTART)
879#define bfin_write_PIXC_AHSTART(val) bfin_write16(PIXC_AHSTART, val)
880#define bfin_read_PIXC_AHEND() bfin_read16(PIXC_AHEND)
881#define bfin_write_PIXC_AHEND(val) bfin_write16(PIXC_AHEND, val)
882#define bfin_read_PIXC_AVSTART() bfin_read16(PIXC_AVSTART)
883#define bfin_write_PIXC_AVSTART(val) bfin_write16(PIXC_AVSTART, val)
884#define bfin_read_PIXC_AVEND() bfin_read16(PIXC_AVEND)
885#define bfin_write_PIXC_AVEND(val) bfin_write16(PIXC_AVEND, val)
886#define bfin_read_PIXC_ATRANSP() bfin_read16(PIXC_ATRANSP)
887#define bfin_write_PIXC_ATRANSP(val) bfin_write16(PIXC_ATRANSP, val)
888#define bfin_read_PIXC_BHSTART() bfin_read16(PIXC_BHSTART)
889#define bfin_write_PIXC_BHSTART(val) bfin_write16(PIXC_BHSTART, val)
890#define bfin_read_PIXC_BHEND() bfin_read16(PIXC_BHEND)
891#define bfin_write_PIXC_BHEND(val) bfin_write16(PIXC_BHEND, val)
892#define bfin_read_PIXC_BVSTART() bfin_read16(PIXC_BVSTART)
893#define bfin_write_PIXC_BVSTART(val) bfin_write16(PIXC_BVSTART, val)
894#define bfin_read_PIXC_BVEND() bfin_read16(PIXC_BVEND)
895#define bfin_write_PIXC_BVEND(val) bfin_write16(PIXC_BVEND, val)
896#define bfin_read_PIXC_BTRANSP() bfin_read16(PIXC_BTRANSP)
897#define bfin_write_PIXC_BTRANSP(val) bfin_write16(PIXC_BTRANSP, val)
898#define bfin_read_PIXC_INTRSTAT() bfin_read16(PIXC_INTRSTAT)
899#define bfin_write_PIXC_INTRSTAT(val) bfin_write16(PIXC_INTRSTAT, val)
900#define bfin_read_PIXC_RYCON() bfin_read32(PIXC_RYCON)
901#define bfin_write_PIXC_RYCON(val) bfin_write32(PIXC_RYCON, val)
902#define bfin_read_PIXC_GUCON() bfin_read32(PIXC_GUCON)
903#define bfin_write_PIXC_GUCON(val) bfin_write32(PIXC_GUCON, val)
904#define bfin_read_PIXC_BVCON() bfin_read32(PIXC_BVCON)
905#define bfin_write_PIXC_BVCON(val) bfin_write32(PIXC_BVCON, val)
906#define bfin_read_PIXC_CCBIAS() bfin_read32(PIXC_CCBIAS)
907#define bfin_write_PIXC_CCBIAS(val) bfin_write32(PIXC_CCBIAS, val)
908#define bfin_read_PIXC_TC() bfin_read32(PIXC_TC)
909#define bfin_write_PIXC_TC(val) bfin_write32(PIXC_TC, val)
910
911/* Handshake MDMA 0 Registers */
912
913#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
914#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
915#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
916#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
917#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
918#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
919#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
920#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
921#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
922#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
923#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
924#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
925#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
926#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
927
928/* Handshake MDMA 1 Registers */
929
930#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
931#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
932#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
933#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
934#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
935#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
936#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
937#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
938#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
939#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
940#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
941#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
942#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
943#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
944
945#endif /* _CDEF_BF544_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF547.h b/include/asm-blackfin/mach-bf548/cdefBF547.h
deleted file mode 100644
index ba716277c00d..000000000000
--- a/include/asm-blackfin/mach-bf548/cdefBF547.h
+++ /dev/null
@@ -1,832 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/cdefBF547.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_BF548_H
32#define _CDEF_BF548_H
33
34/* include all Core registers and bit definitions */
35#include "defBF548.h"
36
37/* include core sbfin_read_()ecific register pointer definitions */
38#include <asm/mach-common/cdef_LPBlackfin.h>
39
40/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF548 */
41
42/* include cdefBF54x_base.h for the set of #defines that are common to all ADSP-BF54x bfin_read_()rocessors */
43#include "cdefBF54x_base.h"
44
45/* The following are the #defines needed by ADSP-BF548 that are not in the common header */
46
47/* Timer Registers */
48
49#define bfin_read_TIMER8_CONFIG() bfin_read16(TIMER8_CONFIG)
50#define bfin_write_TIMER8_CONFIG(val) bfin_write16(TIMER8_CONFIG, val)
51#define bfin_read_TIMER8_COUNTER() bfin_read32(TIMER8_COUNTER)
52#define bfin_write_TIMER8_COUNTER(val) bfin_write32(TIMER8_COUNTER, val)
53#define bfin_read_TIMER8_PERIOD() bfin_read32(TIMER8_PERIOD)
54#define bfin_write_TIMER8_PERIOD(val) bfin_write32(TIMER8_PERIOD, val)
55#define bfin_read_TIMER8_WIDTH() bfin_read32(TIMER8_WIDTH)
56#define bfin_write_TIMER8_WIDTH(val) bfin_write32(TIMER8_WIDTH, val)
57#define bfin_read_TIMER9_CONFIG() bfin_read16(TIMER9_CONFIG)
58#define bfin_write_TIMER9_CONFIG(val) bfin_write16(TIMER9_CONFIG, val)
59#define bfin_read_TIMER9_COUNTER() bfin_read32(TIMER9_COUNTER)
60#define bfin_write_TIMER9_COUNTER(val) bfin_write32(TIMER9_COUNTER, val)
61#define bfin_read_TIMER9_PERIOD() bfin_read32(TIMER9_PERIOD)
62#define bfin_write_TIMER9_PERIOD(val) bfin_write32(TIMER9_PERIOD, val)
63#define bfin_read_TIMER9_WIDTH() bfin_read32(TIMER9_WIDTH)
64#define bfin_write_TIMER9_WIDTH(val) bfin_write32(TIMER9_WIDTH, val)
65#define bfin_read_TIMER10_CONFIG() bfin_read16(TIMER10_CONFIG)
66#define bfin_write_TIMER10_CONFIG(val) bfin_write16(TIMER10_CONFIG, val)
67#define bfin_read_TIMER10_COUNTER() bfin_read32(TIMER10_COUNTER)
68#define bfin_write_TIMER10_COUNTER(val) bfin_write32(TIMER10_COUNTER, val)
69#define bfin_read_TIMER10_PERIOD() bfin_read32(TIMER10_PERIOD)
70#define bfin_write_TIMER10_PERIOD(val) bfin_write32(TIMER10_PERIOD, val)
71#define bfin_read_TIMER10_WIDTH() bfin_read32(TIMER10_WIDTH)
72#define bfin_write_TIMER10_WIDTH(val) bfin_write32(TIMER10_WIDTH, val)
73
74/* Timer Groubfin_read_() of 3 */
75
76#define bfin_read_TIMER_ENABLE1() bfin_read16(TIMER_ENABLE1)
77#define bfin_write_TIMER_ENABLE1(val) bfin_write16(TIMER_ENABLE1, val)
78#define bfin_read_TIMER_DISABLE1() bfin_read16(TIMER_DISABLE1)
79#define bfin_write_TIMER_DISABLE1(val) bfin_write16(TIMER_DISABLE1, val)
80#define bfin_read_TIMER_STATUS1() bfin_read32(TIMER_STATUS1)
81#define bfin_write_TIMER_STATUS1(val) bfin_write32(TIMER_STATUS1, val)
82
83/* SPORT0 Registers */
84
85#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
86#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
87#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
88#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
89#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
90#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
91#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
92#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
93#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
94#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
95#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
96#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
97#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
98#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
99#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
100#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
101#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
102#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
103#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
104#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
105#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
106#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
107#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
108#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
109#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
110#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
111#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
112#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
113#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
114#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
115#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
116#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
117#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
118#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
119#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
120#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
121#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
122#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
123#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
124#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
125#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
126#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
127#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
128#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
129
130/* EPPI0 Registers */
131
132#define bfin_read_EPPI0_STATUS() bfin_read16(EPPI0_STATUS)
133#define bfin_write_EPPI0_STATUS(val) bfin_write16(EPPI0_STATUS, val)
134#define bfin_read_EPPI0_HCOUNT() bfin_read16(EPPI0_HCOUNT)
135#define bfin_write_EPPI0_HCOUNT(val) bfin_write16(EPPI0_HCOUNT, val)
136#define bfin_read_EPPI0_HDELAY() bfin_read16(EPPI0_HDELAY)
137#define bfin_write_EPPI0_HDELAY(val) bfin_write16(EPPI0_HDELAY, val)
138#define bfin_read_EPPI0_VCOUNT() bfin_read16(EPPI0_VCOUNT)
139#define bfin_write_EPPI0_VCOUNT(val) bfin_write16(EPPI0_VCOUNT, val)
140#define bfin_read_EPPI0_VDELAY() bfin_read16(EPPI0_VDELAY)
141#define bfin_write_EPPI0_VDELAY(val) bfin_write16(EPPI0_VDELAY, val)
142#define bfin_read_EPPI0_FRAME() bfin_read16(EPPI0_FRAME)
143#define bfin_write_EPPI0_FRAME(val) bfin_write16(EPPI0_FRAME, val)
144#define bfin_read_EPPI0_LINE() bfin_read16(EPPI0_LINE)
145#define bfin_write_EPPI0_LINE(val) bfin_write16(EPPI0_LINE, val)
146#define bfin_read_EPPI0_CLKDIV() bfin_read16(EPPI0_CLKDIV)
147#define bfin_write_EPPI0_CLKDIV(val) bfin_write16(EPPI0_CLKDIV, val)
148#define bfin_read_EPPI0_CONTROL() bfin_read32(EPPI0_CONTROL)
149#define bfin_write_EPPI0_CONTROL(val) bfin_write32(EPPI0_CONTROL, val)
150#define bfin_read_EPPI0_FS1W_HBL() bfin_read32(EPPI0_FS1W_HBL)
151#define bfin_write_EPPI0_FS1W_HBL(val) bfin_write32(EPPI0_FS1W_HBL, val)
152#define bfin_read_EPPI0_FS1P_AVPL() bfin_read32(EPPI0_FS1P_AVPL)
153#define bfin_write_EPPI0_FS1P_AVPL(val) bfin_write32(EPPI0_FS1P_AVPL, val)
154#define bfin_read_EPPI0_FS2W_LVB() bfin_read32(EPPI0_FS2W_LVB)
155#define bfin_write_EPPI0_FS2W_LVB(val) bfin_write32(EPPI0_FS2W_LVB, val)
156#define bfin_read_EPPI0_FS2P_LAVF() bfin_read32(EPPI0_FS2P_LAVF)
157#define bfin_write_EPPI0_FS2P_LAVF(val) bfin_write32(EPPI0_FS2P_LAVF, val)
158#define bfin_read_EPPI0_CLIP() bfin_read32(EPPI0_CLIP)
159#define bfin_write_EPPI0_CLIP(val) bfin_write32(EPPI0_CLIP, val)
160
161/* UART2 Registers */
162
163#define bfin_read_UART2_DLL() bfin_read16(UART2_DLL)
164#define bfin_write_UART2_DLL(val) bfin_write16(UART2_DLL, val)
165#define bfin_read_UART2_DLH() bfin_read16(UART2_DLH)
166#define bfin_write_UART2_DLH(val) bfin_write16(UART2_DLH, val)
167#define bfin_read_UART2_GCTL() bfin_read16(UART2_GCTL)
168#define bfin_write_UART2_GCTL(val) bfin_write16(UART2_GCTL, val)
169#define bfin_read_UART2_LCR() bfin_read16(UART2_LCR)
170#define bfin_write_UART2_LCR(val) bfin_write16(UART2_LCR, val)
171#define bfin_read_UART2_MCR() bfin_read16(UART2_MCR)
172#define bfin_write_UART2_MCR(val) bfin_write16(UART2_MCR, val)
173#define bfin_read_UART2_LSR() bfin_read16(UART2_LSR)
174#define bfin_write_UART2_LSR(val) bfin_write16(UART2_LSR, val)
175#define bfin_read_UART2_MSR() bfin_read16(UART2_MSR)
176#define bfin_write_UART2_MSR(val) bfin_write16(UART2_MSR, val)
177#define bfin_read_UART2_SCR() bfin_read16(UART2_SCR)
178#define bfin_write_UART2_SCR(val) bfin_write16(UART2_SCR, val)
179#define bfin_read_UART2_IER_SET() bfin_read16(UART2_IER_SET)
180#define bfin_write_UART2_IER_SET(val) bfin_write16(UART2_IER_SET, val)
181#define bfin_read_UART2_IER_CLEAR() bfin_read16(UART2_IER_CLEAR)
182#define bfin_write_UART2_IER_CLEAR(val) bfin_write16(UART2_IER_CLEAR, val)
183#define bfin_read_UART2_RBR() bfin_read16(UART2_RBR)
184#define bfin_write_UART2_RBR(val) bfin_write16(UART2_RBR, val)
185
186/* Two Wire Interface Registers (TWI1) */
187
188/* SPI2 Registers */
189
190#define bfin_read_SPI2_CTL() bfin_read16(SPI2_CTL)
191#define bfin_write_SPI2_CTL(val) bfin_write16(SPI2_CTL, val)
192#define bfin_read_SPI2_FLG() bfin_read16(SPI2_FLG)
193#define bfin_write_SPI2_FLG(val) bfin_write16(SPI2_FLG, val)
194#define bfin_read_SPI2_STAT() bfin_read16(SPI2_STAT)
195#define bfin_write_SPI2_STAT(val) bfin_write16(SPI2_STAT, val)
196#define bfin_read_SPI2_TDBR() bfin_read16(SPI2_TDBR)
197#define bfin_write_SPI2_TDBR(val) bfin_write16(SPI2_TDBR, val)
198#define bfin_read_SPI2_RDBR() bfin_read16(SPI2_RDBR)
199#define bfin_write_SPI2_RDBR(val) bfin_write16(SPI2_RDBR, val)
200#define bfin_read_SPI2_BAUD() bfin_read16(SPI2_BAUD)
201#define bfin_write_SPI2_BAUD(val) bfin_write16(SPI2_BAUD, val)
202#define bfin_read_SPI2_SHADOW() bfin_read16(SPI2_SHADOW)
203#define bfin_write_SPI2_SHADOW(val) bfin_write16(SPI2_SHADOW, val)
204
205/* ATAPI Registers */
206
207#define bfin_read_ATAPI_CONTROL() bfin_read16(ATAPI_CONTROL)
208#define bfin_write_ATAPI_CONTROL(val) bfin_write16(ATAPI_CONTROL, val)
209#define bfin_read_ATAPI_STATUS() bfin_read16(ATAPI_STATUS)
210#define bfin_write_ATAPI_STATUS(val) bfin_write16(ATAPI_STATUS, val)
211#define bfin_read_ATAPI_DEV_ADDR() bfin_read16(ATAPI_DEV_ADDR)
212#define bfin_write_ATAPI_DEV_ADDR(val) bfin_write16(ATAPI_DEV_ADDR, val)
213#define bfin_read_ATAPI_DEV_TXBUF() bfin_read16(ATAPI_DEV_TXBUF)
214#define bfin_write_ATAPI_DEV_TXBUF(val) bfin_write16(ATAPI_DEV_TXBUF, val)
215#define bfin_read_ATAPI_DEV_RXBUF() bfin_read16(ATAPI_DEV_RXBUF)
216#define bfin_write_ATAPI_DEV_RXBUF(val) bfin_write16(ATAPI_DEV_RXBUF, val)
217#define bfin_read_ATAPI_INT_MASK() bfin_read16(ATAPI_INT_MASK)
218#define bfin_write_ATAPI_INT_MASK(val) bfin_write16(ATAPI_INT_MASK, val)
219#define bfin_read_ATAPI_INT_STATUS() bfin_read16(ATAPI_INT_STATUS)
220#define bfin_write_ATAPI_INT_STATUS(val) bfin_write16(ATAPI_INT_STATUS, val)
221#define bfin_read_ATAPI_XFER_LEN() bfin_read16(ATAPI_XFER_LEN)
222#define bfin_write_ATAPI_XFER_LEN(val) bfin_write16(ATAPI_XFER_LEN, val)
223#define bfin_read_ATAPI_LINE_STATUS() bfin_read16(ATAPI_LINE_STATUS)
224#define bfin_write_ATAPI_LINE_STATUS(val) bfin_write16(ATAPI_LINE_STATUS, val)
225#define bfin_read_ATAPI_SM_STATE() bfin_read16(ATAPI_SM_STATE)
226#define bfin_write_ATAPI_SM_STATE(val) bfin_write16(ATAPI_SM_STATE, val)
227#define bfin_read_ATAPI_TERMINATE() bfin_read16(ATAPI_TERMINATE)
228#define bfin_write_ATAPI_TERMINATE(val) bfin_write16(ATAPI_TERMINATE, val)
229#define bfin_read_ATAPI_PIO_TFRCNT() bfin_read16(ATAPI_PIO_TFRCNT)
230#define bfin_write_ATAPI_PIO_TFRCNT(val) bfin_write16(ATAPI_PIO_TFRCNT, val)
231#define bfin_read_ATAPI_DMA_TFRCNT() bfin_read16(ATAPI_DMA_TFRCNT)
232#define bfin_write_ATAPI_DMA_TFRCNT(val) bfin_write16(ATAPI_DMA_TFRCNT, val)
233#define bfin_read_ATAPI_UMAIN_TFRCNT() bfin_read16(ATAPI_UMAIN_TFRCNT)
234#define bfin_write_ATAPI_UMAIN_TFRCNT(val) bfin_write16(ATAPI_UMAIN_TFRCNT, val)
235#define bfin_read_ATAPI_UDMAOUT_TFRCNT() bfin_read16(ATAPI_UDMAOUT_TFRCNT)
236#define bfin_write_ATAPI_UDMAOUT_TFRCNT(val) bfin_write16(ATAPI_UDMAOUT_TFRCNT, val)
237#define bfin_read_ATAPI_REG_TIM_0() bfin_read16(ATAPI_REG_TIM_0)
238#define bfin_write_ATAPI_REG_TIM_0(val) bfin_write16(ATAPI_REG_TIM_0, val)
239#define bfin_read_ATAPI_PIO_TIM_0() bfin_read16(ATAPI_PIO_TIM_0)
240#define bfin_write_ATAPI_PIO_TIM_0(val) bfin_write16(ATAPI_PIO_TIM_0, val)
241#define bfin_read_ATAPI_PIO_TIM_1() bfin_read16(ATAPI_PIO_TIM_1)
242#define bfin_write_ATAPI_PIO_TIM_1(val) bfin_write16(ATAPI_PIO_TIM_1, val)
243#define bfin_read_ATAPI_MULTI_TIM_0() bfin_read16(ATAPI_MULTI_TIM_0)
244#define bfin_write_ATAPI_MULTI_TIM_0(val) bfin_write16(ATAPI_MULTI_TIM_0, val)
245#define bfin_read_ATAPI_MULTI_TIM_1() bfin_read16(ATAPI_MULTI_TIM_1)
246#define bfin_write_ATAPI_MULTI_TIM_1(val) bfin_write16(ATAPI_MULTI_TIM_1, val)
247#define bfin_read_ATAPI_MULTI_TIM_2() bfin_read16(ATAPI_MULTI_TIM_2)
248#define bfin_write_ATAPI_MULTI_TIM_2(val) bfin_write16(ATAPI_MULTI_TIM_2, val)
249#define bfin_read_ATAPI_ULTRA_TIM_0() bfin_read16(ATAPI_ULTRA_TIM_0)
250#define bfin_write_ATAPI_ULTRA_TIM_0(val) bfin_write16(ATAPI_ULTRA_TIM_0, val)
251#define bfin_read_ATAPI_ULTRA_TIM_1() bfin_read16(ATAPI_ULTRA_TIM_1)
252#define bfin_write_ATAPI_ULTRA_TIM_1(val) bfin_write16(ATAPI_ULTRA_TIM_1, val)
253#define bfin_read_ATAPI_ULTRA_TIM_2() bfin_read16(ATAPI_ULTRA_TIM_2)
254#define bfin_write_ATAPI_ULTRA_TIM_2(val) bfin_write16(ATAPI_ULTRA_TIM_2, val)
255#define bfin_read_ATAPI_ULTRA_TIM_3() bfin_read16(ATAPI_ULTRA_TIM_3)
256#define bfin_write_ATAPI_ULTRA_TIM_3(val) bfin_write16(ATAPI_ULTRA_TIM_3, val)
257
258/* SDH Registers */
259
260#define bfin_read_SDH_PWR_CTL() bfin_read16(SDH_PWR_CTL)
261#define bfin_write_SDH_PWR_CTL(val) bfin_write16(SDH_PWR_CTL, val)
262#define bfin_read_SDH_CLK_CTL() bfin_read16(SDH_CLK_CTL)
263#define bfin_write_SDH_CLK_CTL(val) bfin_write16(SDH_CLK_CTL, val)
264#define bfin_read_SDH_ARGUMENT() bfin_read32(SDH_ARGUMENT)
265#define bfin_write_SDH_ARGUMENT(val) bfin_write32(SDH_ARGUMENT, val)
266#define bfin_read_SDH_COMMAND() bfin_read16(SDH_COMMAND)
267#define bfin_write_SDH_COMMAND(val) bfin_write16(SDH_COMMAND, val)
268#define bfin_read_SDH_RESP_CMD() bfin_read16(SDH_RESP_CMD)
269#define bfin_write_SDH_RESP_CMD(val) bfin_write16(SDH_RESP_CMD, val)
270#define bfin_read_SDH_RESPONSE0() bfin_read32(SDH_RESPONSE0)
271#define bfin_write_SDH_RESPONSE0(val) bfin_write32(SDH_RESPONSE0, val)
272#define bfin_read_SDH_RESPONSE1() bfin_read32(SDH_RESPONSE1)
273#define bfin_write_SDH_RESPONSE1(val) bfin_write32(SDH_RESPONSE1, val)
274#define bfin_read_SDH_RESPONSE2() bfin_read32(SDH_RESPONSE2)
275#define bfin_write_SDH_RESPONSE2(val) bfin_write32(SDH_RESPONSE2, val)
276#define bfin_read_SDH_RESPONSE3() bfin_read32(SDH_RESPONSE3)
277#define bfin_write_SDH_RESPONSE3(val) bfin_write32(SDH_RESPONSE3, val)
278#define bfin_read_SDH_DATA_TIMER() bfin_read32(SDH_DATA_TIMER)
279#define bfin_write_SDH_DATA_TIMER(val) bfin_write32(SDH_DATA_TIMER, val)
280#define bfin_read_SDH_DATA_LGTH() bfin_read16(SDH_DATA_LGTH)
281#define bfin_write_SDH_DATA_LGTH(val) bfin_write16(SDH_DATA_LGTH, val)
282#define bfin_read_SDH_DATA_CTL() bfin_read16(SDH_DATA_CTL)
283#define bfin_write_SDH_DATA_CTL(val) bfin_write16(SDH_DATA_CTL, val)
284#define bfin_read_SDH_DATA_CNT() bfin_read16(SDH_DATA_CNT)
285#define bfin_write_SDH_DATA_CNT(val) bfin_write16(SDH_DATA_CNT, val)
286#define bfin_read_SDH_STATUS() bfin_read32(SDH_STATUS)
287#define bfin_write_SDH_STATUS(val) bfin_write32(SDH_STATUS, val)
288#define bfin_read_SDH_STATUS_CLR() bfin_read16(SDH_STATUS_CLR)
289#define bfin_write_SDH_STATUS_CLR(val) bfin_write16(SDH_STATUS_CLR, val)
290#define bfin_read_SDH_MASK0() bfin_read32(SDH_MASK0)
291#define bfin_write_SDH_MASK0(val) bfin_write32(SDH_MASK0, val)
292#define bfin_read_SDH_MASK1() bfin_read32(SDH_MASK1)
293#define bfin_write_SDH_MASK1(val) bfin_write32(SDH_MASK1, val)
294#define bfin_read_SDH_FIFO_CNT() bfin_read16(SDH_FIFO_CNT)
295#define bfin_write_SDH_FIFO_CNT(val) bfin_write16(SDH_FIFO_CNT, val)
296#define bfin_read_SDH_FIFO() bfin_read32(SDH_FIFO)
297#define bfin_write_SDH_FIFO(val) bfin_write32(SDH_FIFO, val)
298#define bfin_read_SDH_E_STATUS() bfin_read16(SDH_E_STATUS)
299#define bfin_write_SDH_E_STATUS(val) bfin_write16(SDH_E_STATUS, val)
300#define bfin_read_SDH_E_MASK() bfin_read16(SDH_E_MASK)
301#define bfin_write_SDH_E_MASK(val) bfin_write16(SDH_E_MASK, val)
302#define bfin_read_SDH_CFG() bfin_read16(SDH_CFG)
303#define bfin_write_SDH_CFG(val) bfin_write16(SDH_CFG, val)
304#define bfin_read_SDH_RD_WAIT_EN() bfin_read16(SDH_RD_WAIT_EN)
305#define bfin_write_SDH_RD_WAIT_EN(val) bfin_write16(SDH_RD_WAIT_EN, val)
306#define bfin_read_SDH_PID0() bfin_read16(SDH_PID0)
307#define bfin_write_SDH_PID0(val) bfin_write16(SDH_PID0, val)
308#define bfin_read_SDH_PID1() bfin_read16(SDH_PID1)
309#define bfin_write_SDH_PID1(val) bfin_write16(SDH_PID1, val)
310#define bfin_read_SDH_PID2() bfin_read16(SDH_PID2)
311#define bfin_write_SDH_PID2(val) bfin_write16(SDH_PID2, val)
312#define bfin_read_SDH_PID3() bfin_read16(SDH_PID3)
313#define bfin_write_SDH_PID3(val) bfin_write16(SDH_PID3, val)
314#define bfin_read_SDH_PID4() bfin_read16(SDH_PID4)
315#define bfin_write_SDH_PID4(val) bfin_write16(SDH_PID4, val)
316#define bfin_read_SDH_PID5() bfin_read16(SDH_PID5)
317#define bfin_write_SDH_PID5(val) bfin_write16(SDH_PID5, val)
318#define bfin_read_SDH_PID6() bfin_read16(SDH_PID6)
319#define bfin_write_SDH_PID6(val) bfin_write16(SDH_PID6, val)
320#define bfin_read_SDH_PID7() bfin_read16(SDH_PID7)
321#define bfin_write_SDH_PID7(val) bfin_write16(SDH_PID7, val)
322
323/* HOST Port Registers */
324
325#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
326#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
327#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
328#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
329#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
330#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
331
332/* USB Control Registers */
333
334#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
335#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
336#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
337#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
338#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
339#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
340#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
341#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
342#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
343#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
344#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
345#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
346#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
347#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
348#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
349#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
350#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
351#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
352#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
353#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
354#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
355#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
356#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
357#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
358#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
359#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
360
361/* USB Packet Control Registers */
362
363#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
364#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
365#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
366#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
367#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
368#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
369#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
370#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
371#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
372#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
373#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
374#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
375#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
376#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
377#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
378#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
379#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
380#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
381#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
382#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
383#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
384#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
385#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
386#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
387#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
388#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
389
390/* USB Endbfin_read_()oint FIFO Registers */
391
392#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
393#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
394#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
395#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
396#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
397#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
398#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
399#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
400#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
401#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
402#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
403#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
404#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
405#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
406#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
407#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
408
409/* USB OTG Control Registers */
410
411#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
412#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
413#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
414#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
415#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
416#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
417
418/* USB Phy Control Registers */
419
420#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
421#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
422#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
423#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
424#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
425#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
426#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
427#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
428#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
429#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
430
431/* (APHY_CNTRL is for ADI usage only) */
432
433#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
434#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
435
436/* (APHY_CALIB is for ADI usage only) */
437
438#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
439#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
440#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
441#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
442
443/* (PHY_TEST is for ADI usage only) */
444
445#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
446#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
447#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
448#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
449#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
450#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
451
452/* USB Endbfin_read_()oint 0 Control Registers */
453
454#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
455#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
456#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
457#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
458#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
459#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
460#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
461#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
462#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
463#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
464#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
465#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
466#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
467#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
468#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
469#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
470#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
471#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
472
473/* USB Endbfin_read_()oint 1 Control Registers */
474
475#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
476#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
477#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
478#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
479#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
480#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
481#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
482#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
483#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
484#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
485#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
486#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
487#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
488#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
489#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
490#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
491#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
492#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
493#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
494#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
495
496/* USB Endbfin_read_()oint 2 Control Registers */
497
498#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
499#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
500#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
501#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
502#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
503#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
504#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
505#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
506#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
507#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
508#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
509#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
510#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
511#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
512#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
513#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
514#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
515#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
516#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
517#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
518
519/* USB Endbfin_read_()oint 3 Control Registers */
520
521#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
522#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
523#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
524#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
525#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
526#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
527#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
528#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
529#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
530#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
531#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
532#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
533#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
534#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
535#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
536#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
537#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
538#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
539#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
540#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
541
542/* USB Endbfin_read_()oint 4 Control Registers */
543
544#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
545#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
546#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
547#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
548#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
549#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
550#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
551#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
552#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
553#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
554#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
555#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
556#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
557#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
558#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
559#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
560#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
561#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
562#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
563#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
564
565/* USB Endbfin_read_()oint 5 Control Registers */
566
567#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
568#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
569#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
570#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
571#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
572#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
573#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
574#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
575#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
576#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
577#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
578#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
579#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
580#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
581#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
582#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
583#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
584#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
585#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
586#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
587
588/* USB Endbfin_read_()oint 6 Control Registers */
589
590#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
591#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
592#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
593#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
594#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
595#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
596#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
597#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
598#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
599#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
600#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
601#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
602#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
603#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
604#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
605#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
606#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
607#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
608#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
609#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
610
611/* USB Endbfin_read_()oint 7 Control Registers */
612
613#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
614#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
615#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
616#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
617#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
618#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
619#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
620#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
621#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
622#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
623#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
624#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
625#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
626#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
627#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
628#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
629#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
630#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
631#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
632#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
633#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
634#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
635#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
636#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
637
638/* USB Channel 0 Config Registers */
639
640#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
641#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
642#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
643#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
644#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
645#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
646#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
647#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
648#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
649#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
650
651/* USB Channel 1 Config Registers */
652
653#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
654#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
655#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
656#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
657#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
658#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
659#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
660#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
661#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
662#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
663
664/* USB Channel 2 Config Registers */
665
666#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
667#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
668#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
669#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
670#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
671#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
672#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
673#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
674#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
675#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
676
677/* USB Channel 3 Config Registers */
678
679#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
680#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
681#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
682#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
683#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
684#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
685#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
686#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
687#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
688#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
689
690/* USB Channel 4 Config Registers */
691
692#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
693#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
694#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
695#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
696#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
697#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
698#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
699#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
700#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
701#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
702
703/* USB Channel 5 Config Registers */
704
705#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
706#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
707#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
708#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
709#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
710#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
711#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
712#define bfin_write_USB_DMA5COUNTLOW(val) bfin_write16(USB_DMA5COUNTLOW, val)
713#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
714#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
715
716/* USB Channel 6 Config Registers */
717
718#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
719#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
720#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
721#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
722#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
723#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
724#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
725#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
726#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
727#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
728
729/* USB Channel 7 Config Registers */
730
731#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
732#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
733#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
734#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
735#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
736#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
737#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
738#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
739#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
740#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
741
742/* Keybfin_read_()ad Registers */
743
744#define bfin_read_KPAD_CTL() bfin_read16(KPAD_CTL)
745#define bfin_write_KPAD_CTL(val) bfin_write16(KPAD_CTL, val)
746#define bfin_read_KPAD_PRESCALE() bfin_read16(KPAD_PRESCALE)
747#define bfin_write_KPAD_PRESCALE(val) bfin_write16(KPAD_PRESCALE, val)
748#define bfin_read_KPAD_MSEL() bfin_read16(KPAD_MSEL)
749#define bfin_write_KPAD_MSEL(val) bfin_write16(KPAD_MSEL, val)
750#define bfin_read_KPAD_ROWCOL() bfin_read16(KPAD_ROWCOL)
751#define bfin_write_KPAD_ROWCOL(val) bfin_write16(KPAD_ROWCOL, val)
752#define bfin_read_KPAD_STAT() bfin_read16(KPAD_STAT)
753#define bfin_write_KPAD_STAT(val) bfin_write16(KPAD_STAT, val)
754#define bfin_read_KPAD_SOFTEVAL() bfin_read16(KPAD_SOFTEVAL)
755#define bfin_write_KPAD_SOFTEVAL(val) bfin_write16(KPAD_SOFTEVAL, val)
756
757/* Pixel Combfin_read_()ositor (PIXC) Registers */
758
759#define bfin_read_PIXC_CTL() bfin_read16(PIXC_CTL)
760#define bfin_write_PIXC_CTL(val) bfin_write16(PIXC_CTL, val)
761#define bfin_read_PIXC_PPL() bfin_read16(PIXC_PPL)
762#define bfin_write_PIXC_PPL(val) bfin_write16(PIXC_PPL, val)
763#define bfin_read_PIXC_LPF() bfin_read16(PIXC_LPF)
764#define bfin_write_PIXC_LPF(val) bfin_write16(PIXC_LPF, val)
765#define bfin_read_PIXC_AHSTART() bfin_read16(PIXC_AHSTART)
766#define bfin_write_PIXC_AHSTART(val) bfin_write16(PIXC_AHSTART, val)
767#define bfin_read_PIXC_AHEND() bfin_read16(PIXC_AHEND)
768#define bfin_write_PIXC_AHEND(val) bfin_write16(PIXC_AHEND, val)
769#define bfin_read_PIXC_AVSTART() bfin_read16(PIXC_AVSTART)
770#define bfin_write_PIXC_AVSTART(val) bfin_write16(PIXC_AVSTART, val)
771#define bfin_read_PIXC_AVEND() bfin_read16(PIXC_AVEND)
772#define bfin_write_PIXC_AVEND(val) bfin_write16(PIXC_AVEND, val)
773#define bfin_read_PIXC_ATRANSP() bfin_read16(PIXC_ATRANSP)
774#define bfin_write_PIXC_ATRANSP(val) bfin_write16(PIXC_ATRANSP, val)
775#define bfin_read_PIXC_BHSTART() bfin_read16(PIXC_BHSTART)
776#define bfin_write_PIXC_BHSTART(val) bfin_write16(PIXC_BHSTART, val)
777#define bfin_read_PIXC_BHEND() bfin_read16(PIXC_BHEND)
778#define bfin_write_PIXC_BHEND(val) bfin_write16(PIXC_BHEND, val)
779#define bfin_read_PIXC_BVSTART() bfin_read16(PIXC_BVSTART)
780#define bfin_write_PIXC_BVSTART(val) bfin_write16(PIXC_BVSTART, val)
781#define bfin_read_PIXC_BVEND() bfin_read16(PIXC_BVEND)
782#define bfin_write_PIXC_BVEND(val) bfin_write16(PIXC_BVEND, val)
783#define bfin_read_PIXC_BTRANSP() bfin_read16(PIXC_BTRANSP)
784#define bfin_write_PIXC_BTRANSP(val) bfin_write16(PIXC_BTRANSP, val)
785#define bfin_read_PIXC_INTRSTAT() bfin_read16(PIXC_INTRSTAT)
786#define bfin_write_PIXC_INTRSTAT(val) bfin_write16(PIXC_INTRSTAT, val)
787#define bfin_read_PIXC_RYCON() bfin_read32(PIXC_RYCON)
788#define bfin_write_PIXC_RYCON(val) bfin_write32(PIXC_RYCON, val)
789#define bfin_read_PIXC_GUCON() bfin_read32(PIXC_GUCON)
790#define bfin_write_PIXC_GUCON(val) bfin_write32(PIXC_GUCON, val)
791#define bfin_read_PIXC_BVCON() bfin_read32(PIXC_BVCON)
792#define bfin_write_PIXC_BVCON(val) bfin_write32(PIXC_BVCON, val)
793#define bfin_read_PIXC_CCBIAS() bfin_read32(PIXC_CCBIAS)
794#define bfin_write_PIXC_CCBIAS(val) bfin_write32(PIXC_CCBIAS, val)
795#define bfin_read_PIXC_TC() bfin_read32(PIXC_TC)
796#define bfin_write_PIXC_TC(val) bfin_write32(PIXC_TC, val)
797
798/* Handshake MDMA 0 Registers */
799
800#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
801#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
802#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
803#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
804#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
805#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
806#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
807#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
808#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
809#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
810#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
811#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
812#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
813#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
814
815/* Handshake MDMA 1 Registers */
816
817#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
818#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
819#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
820#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
821#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
822#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
823#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
824#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
825#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
826#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
827#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
828#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
829#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
830#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
831
832#endif /* _CDEF_BF548_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF548.h b/include/asm-blackfin/mach-bf548/cdefBF548.h
deleted file mode 100644
index ae971ebff6a0..000000000000
--- a/include/asm-blackfin/mach-bf548/cdefBF548.h
+++ /dev/null
@@ -1,1577 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/cdefBF548.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_BF548_H
32#define _CDEF_BF548_H
33
34/* include all Core registers and bit definitions */
35#include "defBF548.h"
36
37/* include core sbfin_read_()ecific register pointer definitions */
38#include <asm/mach-common/cdef_LPBlackfin.h>
39
40/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF548 */
41
42/* include cdefBF54x_base.h for the set of #defines that are common to all ADSP-BF54x bfin_read_()rocessors */
43#include "cdefBF54x_base.h"
44
45/* The following are the #defines needed by ADSP-BF548 that are not in the common header */
46
47/* Timer Registers */
48
49#define bfin_read_TIMER8_CONFIG() bfin_read16(TIMER8_CONFIG)
50#define bfin_write_TIMER8_CONFIG(val) bfin_write16(TIMER8_CONFIG, val)
51#define bfin_read_TIMER8_COUNTER() bfin_read32(TIMER8_COUNTER)
52#define bfin_write_TIMER8_COUNTER(val) bfin_write32(TIMER8_COUNTER, val)
53#define bfin_read_TIMER8_PERIOD() bfin_read32(TIMER8_PERIOD)
54#define bfin_write_TIMER8_PERIOD(val) bfin_write32(TIMER8_PERIOD, val)
55#define bfin_read_TIMER8_WIDTH() bfin_read32(TIMER8_WIDTH)
56#define bfin_write_TIMER8_WIDTH(val) bfin_write32(TIMER8_WIDTH, val)
57#define bfin_read_TIMER9_CONFIG() bfin_read16(TIMER9_CONFIG)
58#define bfin_write_TIMER9_CONFIG(val) bfin_write16(TIMER9_CONFIG, val)
59#define bfin_read_TIMER9_COUNTER() bfin_read32(TIMER9_COUNTER)
60#define bfin_write_TIMER9_COUNTER(val) bfin_write32(TIMER9_COUNTER, val)
61#define bfin_read_TIMER9_PERIOD() bfin_read32(TIMER9_PERIOD)
62#define bfin_write_TIMER9_PERIOD(val) bfin_write32(TIMER9_PERIOD, val)
63#define bfin_read_TIMER9_WIDTH() bfin_read32(TIMER9_WIDTH)
64#define bfin_write_TIMER9_WIDTH(val) bfin_write32(TIMER9_WIDTH, val)
65#define bfin_read_TIMER10_CONFIG() bfin_read16(TIMER10_CONFIG)
66#define bfin_write_TIMER10_CONFIG(val) bfin_write16(TIMER10_CONFIG, val)
67#define bfin_read_TIMER10_COUNTER() bfin_read32(TIMER10_COUNTER)
68#define bfin_write_TIMER10_COUNTER(val) bfin_write32(TIMER10_COUNTER, val)
69#define bfin_read_TIMER10_PERIOD() bfin_read32(TIMER10_PERIOD)
70#define bfin_write_TIMER10_PERIOD(val) bfin_write32(TIMER10_PERIOD, val)
71#define bfin_read_TIMER10_WIDTH() bfin_read32(TIMER10_WIDTH)
72#define bfin_write_TIMER10_WIDTH(val) bfin_write32(TIMER10_WIDTH, val)
73
74/* Timer Groubfin_read_() of 3 */
75
76#define bfin_read_TIMER_ENABLE1() bfin_read16(TIMER_ENABLE1)
77#define bfin_write_TIMER_ENABLE1(val) bfin_write16(TIMER_ENABLE1, val)
78#define bfin_read_TIMER_DISABLE1() bfin_read16(TIMER_DISABLE1)
79#define bfin_write_TIMER_DISABLE1(val) bfin_write16(TIMER_DISABLE1, val)
80#define bfin_read_TIMER_STATUS1() bfin_read32(TIMER_STATUS1)
81#define bfin_write_TIMER_STATUS1(val) bfin_write32(TIMER_STATUS1, val)
82
83/* SPORT0 Registers */
84
85#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
86#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
87#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
88#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
89#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
90#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
91#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
92#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
93#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
94#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
95#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
96#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
97#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
98#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
99#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
100#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
101#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
102#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
103#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
104#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
105#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
106#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
107#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
108#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
109#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
110#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
111#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
112#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
113#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
114#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
115#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
116#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
117#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
118#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
119#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
120#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
121#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
122#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
123#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
124#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
125#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
126#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
127#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
128#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
129
130/* EPPI0 Registers */
131
132#define bfin_read_EPPI0_STATUS() bfin_read16(EPPI0_STATUS)
133#define bfin_write_EPPI0_STATUS(val) bfin_write16(EPPI0_STATUS, val)
134#define bfin_read_EPPI0_HCOUNT() bfin_read16(EPPI0_HCOUNT)
135#define bfin_write_EPPI0_HCOUNT(val) bfin_write16(EPPI0_HCOUNT, val)
136#define bfin_read_EPPI0_HDELAY() bfin_read16(EPPI0_HDELAY)
137#define bfin_write_EPPI0_HDELAY(val) bfin_write16(EPPI0_HDELAY, val)
138#define bfin_read_EPPI0_VCOUNT() bfin_read16(EPPI0_VCOUNT)
139#define bfin_write_EPPI0_VCOUNT(val) bfin_write16(EPPI0_VCOUNT, val)
140#define bfin_read_EPPI0_VDELAY() bfin_read16(EPPI0_VDELAY)
141#define bfin_write_EPPI0_VDELAY(val) bfin_write16(EPPI0_VDELAY, val)
142#define bfin_read_EPPI0_FRAME() bfin_read16(EPPI0_FRAME)
143#define bfin_write_EPPI0_FRAME(val) bfin_write16(EPPI0_FRAME, val)
144#define bfin_read_EPPI0_LINE() bfin_read16(EPPI0_LINE)
145#define bfin_write_EPPI0_LINE(val) bfin_write16(EPPI0_LINE, val)
146#define bfin_read_EPPI0_CLKDIV() bfin_read16(EPPI0_CLKDIV)
147#define bfin_write_EPPI0_CLKDIV(val) bfin_write16(EPPI0_CLKDIV, val)
148#define bfin_read_EPPI0_CONTROL() bfin_read32(EPPI0_CONTROL)
149#define bfin_write_EPPI0_CONTROL(val) bfin_write32(EPPI0_CONTROL, val)
150#define bfin_read_EPPI0_FS1W_HBL() bfin_read32(EPPI0_FS1W_HBL)
151#define bfin_write_EPPI0_FS1W_HBL(val) bfin_write32(EPPI0_FS1W_HBL, val)
152#define bfin_read_EPPI0_FS1P_AVPL() bfin_read32(EPPI0_FS1P_AVPL)
153#define bfin_write_EPPI0_FS1P_AVPL(val) bfin_write32(EPPI0_FS1P_AVPL, val)
154#define bfin_read_EPPI0_FS2W_LVB() bfin_read32(EPPI0_FS2W_LVB)
155#define bfin_write_EPPI0_FS2W_LVB(val) bfin_write32(EPPI0_FS2W_LVB, val)
156#define bfin_read_EPPI0_FS2P_LAVF() bfin_read32(EPPI0_FS2P_LAVF)
157#define bfin_write_EPPI0_FS2P_LAVF(val) bfin_write32(EPPI0_FS2P_LAVF, val)
158#define bfin_read_EPPI0_CLIP() bfin_read32(EPPI0_CLIP)
159#define bfin_write_EPPI0_CLIP(val) bfin_write32(EPPI0_CLIP, val)
160
161/* UART2 Registers */
162
163#define bfin_read_UART2_DLL() bfin_read16(UART2_DLL)
164#define bfin_write_UART2_DLL(val) bfin_write16(UART2_DLL, val)
165#define bfin_read_UART2_DLH() bfin_read16(UART2_DLH)
166#define bfin_write_UART2_DLH(val) bfin_write16(UART2_DLH, val)
167#define bfin_read_UART2_GCTL() bfin_read16(UART2_GCTL)
168#define bfin_write_UART2_GCTL(val) bfin_write16(UART2_GCTL, val)
169#define bfin_read_UART2_LCR() bfin_read16(UART2_LCR)
170#define bfin_write_UART2_LCR(val) bfin_write16(UART2_LCR, val)
171#define bfin_read_UART2_MCR() bfin_read16(UART2_MCR)
172#define bfin_write_UART2_MCR(val) bfin_write16(UART2_MCR, val)
173#define bfin_read_UART2_LSR() bfin_read16(UART2_LSR)
174#define bfin_write_UART2_LSR(val) bfin_write16(UART2_LSR, val)
175#define bfin_read_UART2_MSR() bfin_read16(UART2_MSR)
176#define bfin_write_UART2_MSR(val) bfin_write16(UART2_MSR, val)
177#define bfin_read_UART2_SCR() bfin_read16(UART2_SCR)
178#define bfin_write_UART2_SCR(val) bfin_write16(UART2_SCR, val)
179#define bfin_read_UART2_IER_SET() bfin_read16(UART2_IER_SET)
180#define bfin_write_UART2_IER_SET(val) bfin_write16(UART2_IER_SET, val)
181#define bfin_read_UART2_IER_CLEAR() bfin_read16(UART2_IER_CLEAR)
182#define bfin_write_UART2_IER_CLEAR(val) bfin_write16(UART2_IER_CLEAR, val)
183#define bfin_read_UART2_RBR() bfin_read16(UART2_RBR)
184#define bfin_write_UART2_RBR(val) bfin_write16(UART2_RBR, val)
185
186/* Two Wire Interface Registers (TWI1) */
187
188/* SPI2 Registers */
189
190#define bfin_read_SPI2_CTL() bfin_read16(SPI2_CTL)
191#define bfin_write_SPI2_CTL(val) bfin_write16(SPI2_CTL, val)
192#define bfin_read_SPI2_FLG() bfin_read16(SPI2_FLG)
193#define bfin_write_SPI2_FLG(val) bfin_write16(SPI2_FLG, val)
194#define bfin_read_SPI2_STAT() bfin_read16(SPI2_STAT)
195#define bfin_write_SPI2_STAT(val) bfin_write16(SPI2_STAT, val)
196#define bfin_read_SPI2_TDBR() bfin_read16(SPI2_TDBR)
197#define bfin_write_SPI2_TDBR(val) bfin_write16(SPI2_TDBR, val)
198#define bfin_read_SPI2_RDBR() bfin_read16(SPI2_RDBR)
199#define bfin_write_SPI2_RDBR(val) bfin_write16(SPI2_RDBR, val)
200#define bfin_read_SPI2_BAUD() bfin_read16(SPI2_BAUD)
201#define bfin_write_SPI2_BAUD(val) bfin_write16(SPI2_BAUD, val)
202#define bfin_read_SPI2_SHADOW() bfin_read16(SPI2_SHADOW)
203#define bfin_write_SPI2_SHADOW(val) bfin_write16(SPI2_SHADOW, val)
204
205/* CAN Controller 1 Config 1 Registers */
206
207#define bfin_read_CAN1_MC1() bfin_read16(CAN1_MC1)
208#define bfin_write_CAN1_MC1(val) bfin_write16(CAN1_MC1, val)
209#define bfin_read_CAN1_MD1() bfin_read16(CAN1_MD1)
210#define bfin_write_CAN1_MD1(val) bfin_write16(CAN1_MD1, val)
211#define bfin_read_CAN1_TRS1() bfin_read16(CAN1_TRS1)
212#define bfin_write_CAN1_TRS1(val) bfin_write16(CAN1_TRS1, val)
213#define bfin_read_CAN1_TRR1() bfin_read16(CAN1_TRR1)
214#define bfin_write_CAN1_TRR1(val) bfin_write16(CAN1_TRR1, val)
215#define bfin_read_CAN1_TA1() bfin_read16(CAN1_TA1)
216#define bfin_write_CAN1_TA1(val) bfin_write16(CAN1_TA1, val)
217#define bfin_read_CAN1_AA1() bfin_read16(CAN1_AA1)
218#define bfin_write_CAN1_AA1(val) bfin_write16(CAN1_AA1, val)
219#define bfin_read_CAN1_RMP1() bfin_read16(CAN1_RMP1)
220#define bfin_write_CAN1_RMP1(val) bfin_write16(CAN1_RMP1, val)
221#define bfin_read_CAN1_RML1() bfin_read16(CAN1_RML1)
222#define bfin_write_CAN1_RML1(val) bfin_write16(CAN1_RML1, val)
223#define bfin_read_CAN1_MBTIF1() bfin_read16(CAN1_MBTIF1)
224#define bfin_write_CAN1_MBTIF1(val) bfin_write16(CAN1_MBTIF1, val)
225#define bfin_read_CAN1_MBRIF1() bfin_read16(CAN1_MBRIF1)
226#define bfin_write_CAN1_MBRIF1(val) bfin_write16(CAN1_MBRIF1, val)
227#define bfin_read_CAN1_MBIM1() bfin_read16(CAN1_MBIM1)
228#define bfin_write_CAN1_MBIM1(val) bfin_write16(CAN1_MBIM1, val)
229#define bfin_read_CAN1_RFH1() bfin_read16(CAN1_RFH1)
230#define bfin_write_CAN1_RFH1(val) bfin_write16(CAN1_RFH1, val)
231#define bfin_read_CAN1_OPSS1() bfin_read16(CAN1_OPSS1)
232#define bfin_write_CAN1_OPSS1(val) bfin_write16(CAN1_OPSS1, val)
233
234/* CAN Controller 1 Config 2 Registers */
235
236#define bfin_read_CAN1_MC2() bfin_read16(CAN1_MC2)
237#define bfin_write_CAN1_MC2(val) bfin_write16(CAN1_MC2, val)
238#define bfin_read_CAN1_MD2() bfin_read16(CAN1_MD2)
239#define bfin_write_CAN1_MD2(val) bfin_write16(CAN1_MD2, val)
240#define bfin_read_CAN1_TRS2() bfin_read16(CAN1_TRS2)
241#define bfin_write_CAN1_TRS2(val) bfin_write16(CAN1_TRS2, val)
242#define bfin_read_CAN1_TRR2() bfin_read16(CAN1_TRR2)
243#define bfin_write_CAN1_TRR2(val) bfin_write16(CAN1_TRR2, val)
244#define bfin_read_CAN1_TA2() bfin_read16(CAN1_TA2)
245#define bfin_write_CAN1_TA2(val) bfin_write16(CAN1_TA2, val)
246#define bfin_read_CAN1_AA2() bfin_read16(CAN1_AA2)
247#define bfin_write_CAN1_AA2(val) bfin_write16(CAN1_AA2, val)
248#define bfin_read_CAN1_RMP2() bfin_read16(CAN1_RMP2)
249#define bfin_write_CAN1_RMP2(val) bfin_write16(CAN1_RMP2, val)
250#define bfin_read_CAN1_RML2() bfin_read16(CAN1_RML2)
251#define bfin_write_CAN1_RML2(val) bfin_write16(CAN1_RML2, val)
252#define bfin_read_CAN1_MBTIF2() bfin_read16(CAN1_MBTIF2)
253#define bfin_write_CAN1_MBTIF2(val) bfin_write16(CAN1_MBTIF2, val)
254#define bfin_read_CAN1_MBRIF2() bfin_read16(CAN1_MBRIF2)
255#define bfin_write_CAN1_MBRIF2(val) bfin_write16(CAN1_MBRIF2, val)
256#define bfin_read_CAN1_MBIM2() bfin_read16(CAN1_MBIM2)
257#define bfin_write_CAN1_MBIM2(val) bfin_write16(CAN1_MBIM2, val)
258#define bfin_read_CAN1_RFH2() bfin_read16(CAN1_RFH2)
259#define bfin_write_CAN1_RFH2(val) bfin_write16(CAN1_RFH2, val)
260#define bfin_read_CAN1_OPSS2() bfin_read16(CAN1_OPSS2)
261#define bfin_write_CAN1_OPSS2(val) bfin_write16(CAN1_OPSS2, val)
262
263/* CAN Controller 1 Clock/Interrubfin_read_()t/Counter Registers */
264
265#define bfin_read_CAN1_CLOCK() bfin_read16(CAN1_CLOCK)
266#define bfin_write_CAN1_CLOCK(val) bfin_write16(CAN1_CLOCK, val)
267#define bfin_read_CAN1_TIMING() bfin_read16(CAN1_TIMING)
268#define bfin_write_CAN1_TIMING(val) bfin_write16(CAN1_TIMING, val)
269#define bfin_read_CAN1_DEBUG() bfin_read16(CAN1_DEBUG)
270#define bfin_write_CAN1_DEBUG(val) bfin_write16(CAN1_DEBUG, val)
271#define bfin_read_CAN1_STATUS() bfin_read16(CAN1_STATUS)
272#define bfin_write_CAN1_STATUS(val) bfin_write16(CAN1_STATUS, val)
273#define bfin_read_CAN1_CEC() bfin_read16(CAN1_CEC)
274#define bfin_write_CAN1_CEC(val) bfin_write16(CAN1_CEC, val)
275#define bfin_read_CAN1_GIS() bfin_read16(CAN1_GIS)
276#define bfin_write_CAN1_GIS(val) bfin_write16(CAN1_GIS, val)
277#define bfin_read_CAN1_GIM() bfin_read16(CAN1_GIM)
278#define bfin_write_CAN1_GIM(val) bfin_write16(CAN1_GIM, val)
279#define bfin_read_CAN1_GIF() bfin_read16(CAN1_GIF)
280#define bfin_write_CAN1_GIF(val) bfin_write16(CAN1_GIF, val)
281#define bfin_read_CAN1_CONTROL() bfin_read16(CAN1_CONTROL)
282#define bfin_write_CAN1_CONTROL(val) bfin_write16(CAN1_CONTROL, val)
283#define bfin_read_CAN1_INTR() bfin_read16(CAN1_INTR)
284#define bfin_write_CAN1_INTR(val) bfin_write16(CAN1_INTR, val)
285#define bfin_read_CAN1_MBTD() bfin_read16(CAN1_MBTD)
286#define bfin_write_CAN1_MBTD(val) bfin_write16(CAN1_MBTD, val)
287#define bfin_read_CAN1_EWR() bfin_read16(CAN1_EWR)
288#define bfin_write_CAN1_EWR(val) bfin_write16(CAN1_EWR, val)
289#define bfin_read_CAN1_ESR() bfin_read16(CAN1_ESR)
290#define bfin_write_CAN1_ESR(val) bfin_write16(CAN1_ESR, val)
291#define bfin_read_CAN1_UCCNT() bfin_read16(CAN1_UCCNT)
292#define bfin_write_CAN1_UCCNT(val) bfin_write16(CAN1_UCCNT, val)
293#define bfin_read_CAN1_UCRC() bfin_read16(CAN1_UCRC)
294#define bfin_write_CAN1_UCRC(val) bfin_write16(CAN1_UCRC, val)
295#define bfin_read_CAN1_UCCNF() bfin_read16(CAN1_UCCNF)
296#define bfin_write_CAN1_UCCNF(val) bfin_write16(CAN1_UCCNF, val)
297
298/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
299
300#define bfin_read_CAN1_AM00L() bfin_read16(CAN1_AM00L)
301#define bfin_write_CAN1_AM00L(val) bfin_write16(CAN1_AM00L, val)
302#define bfin_read_CAN1_AM00H() bfin_read16(CAN1_AM00H)
303#define bfin_write_CAN1_AM00H(val) bfin_write16(CAN1_AM00H, val)
304#define bfin_read_CAN1_AM01L() bfin_read16(CAN1_AM01L)
305#define bfin_write_CAN1_AM01L(val) bfin_write16(CAN1_AM01L, val)
306#define bfin_read_CAN1_AM01H() bfin_read16(CAN1_AM01H)
307#define bfin_write_CAN1_AM01H(val) bfin_write16(CAN1_AM01H, val)
308#define bfin_read_CAN1_AM02L() bfin_read16(CAN1_AM02L)
309#define bfin_write_CAN1_AM02L(val) bfin_write16(CAN1_AM02L, val)
310#define bfin_read_CAN1_AM02H() bfin_read16(CAN1_AM02H)
311#define bfin_write_CAN1_AM02H(val) bfin_write16(CAN1_AM02H, val)
312#define bfin_read_CAN1_AM03L() bfin_read16(CAN1_AM03L)
313#define bfin_write_CAN1_AM03L(val) bfin_write16(CAN1_AM03L, val)
314#define bfin_read_CAN1_AM03H() bfin_read16(CAN1_AM03H)
315#define bfin_write_CAN1_AM03H(val) bfin_write16(CAN1_AM03H, val)
316#define bfin_read_CAN1_AM04L() bfin_read16(CAN1_AM04L)
317#define bfin_write_CAN1_AM04L(val) bfin_write16(CAN1_AM04L, val)
318#define bfin_read_CAN1_AM04H() bfin_read16(CAN1_AM04H)
319#define bfin_write_CAN1_AM04H(val) bfin_write16(CAN1_AM04H, val)
320#define bfin_read_CAN1_AM05L() bfin_read16(CAN1_AM05L)
321#define bfin_write_CAN1_AM05L(val) bfin_write16(CAN1_AM05L, val)
322#define bfin_read_CAN1_AM05H() bfin_read16(CAN1_AM05H)
323#define bfin_write_CAN1_AM05H(val) bfin_write16(CAN1_AM05H, val)
324#define bfin_read_CAN1_AM06L() bfin_read16(CAN1_AM06L)
325#define bfin_write_CAN1_AM06L(val) bfin_write16(CAN1_AM06L, val)
326#define bfin_read_CAN1_AM06H() bfin_read16(CAN1_AM06H)
327#define bfin_write_CAN1_AM06H(val) bfin_write16(CAN1_AM06H, val)
328#define bfin_read_CAN1_AM07L() bfin_read16(CAN1_AM07L)
329#define bfin_write_CAN1_AM07L(val) bfin_write16(CAN1_AM07L, val)
330#define bfin_read_CAN1_AM07H() bfin_read16(CAN1_AM07H)
331#define bfin_write_CAN1_AM07H(val) bfin_write16(CAN1_AM07H, val)
332#define bfin_read_CAN1_AM08L() bfin_read16(CAN1_AM08L)
333#define bfin_write_CAN1_AM08L(val) bfin_write16(CAN1_AM08L, val)
334#define bfin_read_CAN1_AM08H() bfin_read16(CAN1_AM08H)
335#define bfin_write_CAN1_AM08H(val) bfin_write16(CAN1_AM08H, val)
336#define bfin_read_CAN1_AM09L() bfin_read16(CAN1_AM09L)
337#define bfin_write_CAN1_AM09L(val) bfin_write16(CAN1_AM09L, val)
338#define bfin_read_CAN1_AM09H() bfin_read16(CAN1_AM09H)
339#define bfin_write_CAN1_AM09H(val) bfin_write16(CAN1_AM09H, val)
340#define bfin_read_CAN1_AM10L() bfin_read16(CAN1_AM10L)
341#define bfin_write_CAN1_AM10L(val) bfin_write16(CAN1_AM10L, val)
342#define bfin_read_CAN1_AM10H() bfin_read16(CAN1_AM10H)
343#define bfin_write_CAN1_AM10H(val) bfin_write16(CAN1_AM10H, val)
344#define bfin_read_CAN1_AM11L() bfin_read16(CAN1_AM11L)
345#define bfin_write_CAN1_AM11L(val) bfin_write16(CAN1_AM11L, val)
346#define bfin_read_CAN1_AM11H() bfin_read16(CAN1_AM11H)
347#define bfin_write_CAN1_AM11H(val) bfin_write16(CAN1_AM11H, val)
348#define bfin_read_CAN1_AM12L() bfin_read16(CAN1_AM12L)
349#define bfin_write_CAN1_AM12L(val) bfin_write16(CAN1_AM12L, val)
350#define bfin_read_CAN1_AM12H() bfin_read16(CAN1_AM12H)
351#define bfin_write_CAN1_AM12H(val) bfin_write16(CAN1_AM12H, val)
352#define bfin_read_CAN1_AM13L() bfin_read16(CAN1_AM13L)
353#define bfin_write_CAN1_AM13L(val) bfin_write16(CAN1_AM13L, val)
354#define bfin_read_CAN1_AM13H() bfin_read16(CAN1_AM13H)
355#define bfin_write_CAN1_AM13H(val) bfin_write16(CAN1_AM13H, val)
356#define bfin_read_CAN1_AM14L() bfin_read16(CAN1_AM14L)
357#define bfin_write_CAN1_AM14L(val) bfin_write16(CAN1_AM14L, val)
358#define bfin_read_CAN1_AM14H() bfin_read16(CAN1_AM14H)
359#define bfin_write_CAN1_AM14H(val) bfin_write16(CAN1_AM14H, val)
360#define bfin_read_CAN1_AM15L() bfin_read16(CAN1_AM15L)
361#define bfin_write_CAN1_AM15L(val) bfin_write16(CAN1_AM15L, val)
362#define bfin_read_CAN1_AM15H() bfin_read16(CAN1_AM15H)
363#define bfin_write_CAN1_AM15H(val) bfin_write16(CAN1_AM15H, val)
364
365/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
366
367#define bfin_read_CAN1_AM16L() bfin_read16(CAN1_AM16L)
368#define bfin_write_CAN1_AM16L(val) bfin_write16(CAN1_AM16L, val)
369#define bfin_read_CAN1_AM16H() bfin_read16(CAN1_AM16H)
370#define bfin_write_CAN1_AM16H(val) bfin_write16(CAN1_AM16H, val)
371#define bfin_read_CAN1_AM17L() bfin_read16(CAN1_AM17L)
372#define bfin_write_CAN1_AM17L(val) bfin_write16(CAN1_AM17L, val)
373#define bfin_read_CAN1_AM17H() bfin_read16(CAN1_AM17H)
374#define bfin_write_CAN1_AM17H(val) bfin_write16(CAN1_AM17H, val)
375#define bfin_read_CAN1_AM18L() bfin_read16(CAN1_AM18L)
376#define bfin_write_CAN1_AM18L(val) bfin_write16(CAN1_AM18L, val)
377#define bfin_read_CAN1_AM18H() bfin_read16(CAN1_AM18H)
378#define bfin_write_CAN1_AM18H(val) bfin_write16(CAN1_AM18H, val)
379#define bfin_read_CAN1_AM19L() bfin_read16(CAN1_AM19L)
380#define bfin_write_CAN1_AM19L(val) bfin_write16(CAN1_AM19L, val)
381#define bfin_read_CAN1_AM19H() bfin_read16(CAN1_AM19H)
382#define bfin_write_CAN1_AM19H(val) bfin_write16(CAN1_AM19H, val)
383#define bfin_read_CAN1_AM20L() bfin_read16(CAN1_AM20L)
384#define bfin_write_CAN1_AM20L(val) bfin_write16(CAN1_AM20L, val)
385#define bfin_read_CAN1_AM20H() bfin_read16(CAN1_AM20H)
386#define bfin_write_CAN1_AM20H(val) bfin_write16(CAN1_AM20H, val)
387#define bfin_read_CAN1_AM21L() bfin_read16(CAN1_AM21L)
388#define bfin_write_CAN1_AM21L(val) bfin_write16(CAN1_AM21L, val)
389#define bfin_read_CAN1_AM21H() bfin_read16(CAN1_AM21H)
390#define bfin_write_CAN1_AM21H(val) bfin_write16(CAN1_AM21H, val)
391#define bfin_read_CAN1_AM22L() bfin_read16(CAN1_AM22L)
392#define bfin_write_CAN1_AM22L(val) bfin_write16(CAN1_AM22L, val)
393#define bfin_read_CAN1_AM22H() bfin_read16(CAN1_AM22H)
394#define bfin_write_CAN1_AM22H(val) bfin_write16(CAN1_AM22H, val)
395#define bfin_read_CAN1_AM23L() bfin_read16(CAN1_AM23L)
396#define bfin_write_CAN1_AM23L(val) bfin_write16(CAN1_AM23L, val)
397#define bfin_read_CAN1_AM23H() bfin_read16(CAN1_AM23H)
398#define bfin_write_CAN1_AM23H(val) bfin_write16(CAN1_AM23H, val)
399#define bfin_read_CAN1_AM24L() bfin_read16(CAN1_AM24L)
400#define bfin_write_CAN1_AM24L(val) bfin_write16(CAN1_AM24L, val)
401#define bfin_read_CAN1_AM24H() bfin_read16(CAN1_AM24H)
402#define bfin_write_CAN1_AM24H(val) bfin_write16(CAN1_AM24H, val)
403#define bfin_read_CAN1_AM25L() bfin_read16(CAN1_AM25L)
404#define bfin_write_CAN1_AM25L(val) bfin_write16(CAN1_AM25L, val)
405#define bfin_read_CAN1_AM25H() bfin_read16(CAN1_AM25H)
406#define bfin_write_CAN1_AM25H(val) bfin_write16(CAN1_AM25H, val)
407#define bfin_read_CAN1_AM26L() bfin_read16(CAN1_AM26L)
408#define bfin_write_CAN1_AM26L(val) bfin_write16(CAN1_AM26L, val)
409#define bfin_read_CAN1_AM26H() bfin_read16(CAN1_AM26H)
410#define bfin_write_CAN1_AM26H(val) bfin_write16(CAN1_AM26H, val)
411#define bfin_read_CAN1_AM27L() bfin_read16(CAN1_AM27L)
412#define bfin_write_CAN1_AM27L(val) bfin_write16(CAN1_AM27L, val)
413#define bfin_read_CAN1_AM27H() bfin_read16(CAN1_AM27H)
414#define bfin_write_CAN1_AM27H(val) bfin_write16(CAN1_AM27H, val)
415#define bfin_read_CAN1_AM28L() bfin_read16(CAN1_AM28L)
416#define bfin_write_CAN1_AM28L(val) bfin_write16(CAN1_AM28L, val)
417#define bfin_read_CAN1_AM28H() bfin_read16(CAN1_AM28H)
418#define bfin_write_CAN1_AM28H(val) bfin_write16(CAN1_AM28H, val)
419#define bfin_read_CAN1_AM29L() bfin_read16(CAN1_AM29L)
420#define bfin_write_CAN1_AM29L(val) bfin_write16(CAN1_AM29L, val)
421#define bfin_read_CAN1_AM29H() bfin_read16(CAN1_AM29H)
422#define bfin_write_CAN1_AM29H(val) bfin_write16(CAN1_AM29H, val)
423#define bfin_read_CAN1_AM30L() bfin_read16(CAN1_AM30L)
424#define bfin_write_CAN1_AM30L(val) bfin_write16(CAN1_AM30L, val)
425#define bfin_read_CAN1_AM30H() bfin_read16(CAN1_AM30H)
426#define bfin_write_CAN1_AM30H(val) bfin_write16(CAN1_AM30H, val)
427#define bfin_read_CAN1_AM31L() bfin_read16(CAN1_AM31L)
428#define bfin_write_CAN1_AM31L(val) bfin_write16(CAN1_AM31L, val)
429#define bfin_read_CAN1_AM31H() bfin_read16(CAN1_AM31H)
430#define bfin_write_CAN1_AM31H(val) bfin_write16(CAN1_AM31H, val)
431
432/* CAN Controller 1 Mailbox Data Registers */
433
434#define bfin_read_CAN1_MB00_DATA0() bfin_read16(CAN1_MB00_DATA0)
435#define bfin_write_CAN1_MB00_DATA0(val) bfin_write16(CAN1_MB00_DATA0, val)
436#define bfin_read_CAN1_MB00_DATA1() bfin_read16(CAN1_MB00_DATA1)
437#define bfin_write_CAN1_MB00_DATA1(val) bfin_write16(CAN1_MB00_DATA1, val)
438#define bfin_read_CAN1_MB00_DATA2() bfin_read16(CAN1_MB00_DATA2)
439#define bfin_write_CAN1_MB00_DATA2(val) bfin_write16(CAN1_MB00_DATA2, val)
440#define bfin_read_CAN1_MB00_DATA3() bfin_read16(CAN1_MB00_DATA3)
441#define bfin_write_CAN1_MB00_DATA3(val) bfin_write16(CAN1_MB00_DATA3, val)
442#define bfin_read_CAN1_MB00_LENGTH() bfin_read16(CAN1_MB00_LENGTH)
443#define bfin_write_CAN1_MB00_LENGTH(val) bfin_write16(CAN1_MB00_LENGTH, val)
444#define bfin_read_CAN1_MB00_TIMESTAMP() bfin_read16(CAN1_MB00_TIMESTAMP)
445#define bfin_write_CAN1_MB00_TIMESTAMP(val) bfin_write16(CAN1_MB00_TIMESTAMP, val)
446#define bfin_read_CAN1_MB00_ID0() bfin_read16(CAN1_MB00_ID0)
447#define bfin_write_CAN1_MB00_ID0(val) bfin_write16(CAN1_MB00_ID0, val)
448#define bfin_read_CAN1_MB00_ID1() bfin_read16(CAN1_MB00_ID1)
449#define bfin_write_CAN1_MB00_ID1(val) bfin_write16(CAN1_MB00_ID1, val)
450#define bfin_read_CAN1_MB01_DATA0() bfin_read16(CAN1_MB01_DATA0)
451#define bfin_write_CAN1_MB01_DATA0(val) bfin_write16(CAN1_MB01_DATA0, val)
452#define bfin_read_CAN1_MB01_DATA1() bfin_read16(CAN1_MB01_DATA1)
453#define bfin_write_CAN1_MB01_DATA1(val) bfin_write16(CAN1_MB01_DATA1, val)
454#define bfin_read_CAN1_MB01_DATA2() bfin_read16(CAN1_MB01_DATA2)
455#define bfin_write_CAN1_MB01_DATA2(val) bfin_write16(CAN1_MB01_DATA2, val)
456#define bfin_read_CAN1_MB01_DATA3() bfin_read16(CAN1_MB01_DATA3)
457#define bfin_write_CAN1_MB01_DATA3(val) bfin_write16(CAN1_MB01_DATA3, val)
458#define bfin_read_CAN1_MB01_LENGTH() bfin_read16(CAN1_MB01_LENGTH)
459#define bfin_write_CAN1_MB01_LENGTH(val) bfin_write16(CAN1_MB01_LENGTH, val)
460#define bfin_read_CAN1_MB01_TIMESTAMP() bfin_read16(CAN1_MB01_TIMESTAMP)
461#define bfin_write_CAN1_MB01_TIMESTAMP(val) bfin_write16(CAN1_MB01_TIMESTAMP, val)
462#define bfin_read_CAN1_MB01_ID0() bfin_read16(CAN1_MB01_ID0)
463#define bfin_write_CAN1_MB01_ID0(val) bfin_write16(CAN1_MB01_ID0, val)
464#define bfin_read_CAN1_MB01_ID1() bfin_read16(CAN1_MB01_ID1)
465#define bfin_write_CAN1_MB01_ID1(val) bfin_write16(CAN1_MB01_ID1, val)
466#define bfin_read_CAN1_MB02_DATA0() bfin_read16(CAN1_MB02_DATA0)
467#define bfin_write_CAN1_MB02_DATA0(val) bfin_write16(CAN1_MB02_DATA0, val)
468#define bfin_read_CAN1_MB02_DATA1() bfin_read16(CAN1_MB02_DATA1)
469#define bfin_write_CAN1_MB02_DATA1(val) bfin_write16(CAN1_MB02_DATA1, val)
470#define bfin_read_CAN1_MB02_DATA2() bfin_read16(CAN1_MB02_DATA2)
471#define bfin_write_CAN1_MB02_DATA2(val) bfin_write16(CAN1_MB02_DATA2, val)
472#define bfin_read_CAN1_MB02_DATA3() bfin_read16(CAN1_MB02_DATA3)
473#define bfin_write_CAN1_MB02_DATA3(val) bfin_write16(CAN1_MB02_DATA3, val)
474#define bfin_read_CAN1_MB02_LENGTH() bfin_read16(CAN1_MB02_LENGTH)
475#define bfin_write_CAN1_MB02_LENGTH(val) bfin_write16(CAN1_MB02_LENGTH, val)
476#define bfin_read_CAN1_MB02_TIMESTAMP() bfin_read16(CAN1_MB02_TIMESTAMP)
477#define bfin_write_CAN1_MB02_TIMESTAMP(val) bfin_write16(CAN1_MB02_TIMESTAMP, val)
478#define bfin_read_CAN1_MB02_ID0() bfin_read16(CAN1_MB02_ID0)
479#define bfin_write_CAN1_MB02_ID0(val) bfin_write16(CAN1_MB02_ID0, val)
480#define bfin_read_CAN1_MB02_ID1() bfin_read16(CAN1_MB02_ID1)
481#define bfin_write_CAN1_MB02_ID1(val) bfin_write16(CAN1_MB02_ID1, val)
482#define bfin_read_CAN1_MB03_DATA0() bfin_read16(CAN1_MB03_DATA0)
483#define bfin_write_CAN1_MB03_DATA0(val) bfin_write16(CAN1_MB03_DATA0, val)
484#define bfin_read_CAN1_MB03_DATA1() bfin_read16(CAN1_MB03_DATA1)
485#define bfin_write_CAN1_MB03_DATA1(val) bfin_write16(CAN1_MB03_DATA1, val)
486#define bfin_read_CAN1_MB03_DATA2() bfin_read16(CAN1_MB03_DATA2)
487#define bfin_write_CAN1_MB03_DATA2(val) bfin_write16(CAN1_MB03_DATA2, val)
488#define bfin_read_CAN1_MB03_DATA3() bfin_read16(CAN1_MB03_DATA3)
489#define bfin_write_CAN1_MB03_DATA3(val) bfin_write16(CAN1_MB03_DATA3, val)
490#define bfin_read_CAN1_MB03_LENGTH() bfin_read16(CAN1_MB03_LENGTH)
491#define bfin_write_CAN1_MB03_LENGTH(val) bfin_write16(CAN1_MB03_LENGTH, val)
492#define bfin_read_CAN1_MB03_TIMESTAMP() bfin_read16(CAN1_MB03_TIMESTAMP)
493#define bfin_write_CAN1_MB03_TIMESTAMP(val) bfin_write16(CAN1_MB03_TIMESTAMP, val)
494#define bfin_read_CAN1_MB03_ID0() bfin_read16(CAN1_MB03_ID0)
495#define bfin_write_CAN1_MB03_ID0(val) bfin_write16(CAN1_MB03_ID0, val)
496#define bfin_read_CAN1_MB03_ID1() bfin_read16(CAN1_MB03_ID1)
497#define bfin_write_CAN1_MB03_ID1(val) bfin_write16(CAN1_MB03_ID1, val)
498#define bfin_read_CAN1_MB04_DATA0() bfin_read16(CAN1_MB04_DATA0)
499#define bfin_write_CAN1_MB04_DATA0(val) bfin_write16(CAN1_MB04_DATA0, val)
500#define bfin_read_CAN1_MB04_DATA1() bfin_read16(CAN1_MB04_DATA1)
501#define bfin_write_CAN1_MB04_DATA1(val) bfin_write16(CAN1_MB04_DATA1, val)
502#define bfin_read_CAN1_MB04_DATA2() bfin_read16(CAN1_MB04_DATA2)
503#define bfin_write_CAN1_MB04_DATA2(val) bfin_write16(CAN1_MB04_DATA2, val)
504#define bfin_read_CAN1_MB04_DATA3() bfin_read16(CAN1_MB04_DATA3)
505#define bfin_write_CAN1_MB04_DATA3(val) bfin_write16(CAN1_MB04_DATA3, val)
506#define bfin_read_CAN1_MB04_LENGTH() bfin_read16(CAN1_MB04_LENGTH)
507#define bfin_write_CAN1_MB04_LENGTH(val) bfin_write16(CAN1_MB04_LENGTH, val)
508#define bfin_read_CAN1_MB04_TIMESTAMP() bfin_read16(CAN1_MB04_TIMESTAMP)
509#define bfin_write_CAN1_MB04_TIMESTAMP(val) bfin_write16(CAN1_MB04_TIMESTAMP, val)
510#define bfin_read_CAN1_MB04_ID0() bfin_read16(CAN1_MB04_ID0)
511#define bfin_write_CAN1_MB04_ID0(val) bfin_write16(CAN1_MB04_ID0, val)
512#define bfin_read_CAN1_MB04_ID1() bfin_read16(CAN1_MB04_ID1)
513#define bfin_write_CAN1_MB04_ID1(val) bfin_write16(CAN1_MB04_ID1, val)
514#define bfin_read_CAN1_MB05_DATA0() bfin_read16(CAN1_MB05_DATA0)
515#define bfin_write_CAN1_MB05_DATA0(val) bfin_write16(CAN1_MB05_DATA0, val)
516#define bfin_read_CAN1_MB05_DATA1() bfin_read16(CAN1_MB05_DATA1)
517#define bfin_write_CAN1_MB05_DATA1(val) bfin_write16(CAN1_MB05_DATA1, val)
518#define bfin_read_CAN1_MB05_DATA2() bfin_read16(CAN1_MB05_DATA2)
519#define bfin_write_CAN1_MB05_DATA2(val) bfin_write16(CAN1_MB05_DATA2, val)
520#define bfin_read_CAN1_MB05_DATA3() bfin_read16(CAN1_MB05_DATA3)
521#define bfin_write_CAN1_MB05_DATA3(val) bfin_write16(CAN1_MB05_DATA3, val)
522#define bfin_read_CAN1_MB05_LENGTH() bfin_read16(CAN1_MB05_LENGTH)
523#define bfin_write_CAN1_MB05_LENGTH(val) bfin_write16(CAN1_MB05_LENGTH, val)
524#define bfin_read_CAN1_MB05_TIMESTAMP() bfin_read16(CAN1_MB05_TIMESTAMP)
525#define bfin_write_CAN1_MB05_TIMESTAMP(val) bfin_write16(CAN1_MB05_TIMESTAMP, val)
526#define bfin_read_CAN1_MB05_ID0() bfin_read16(CAN1_MB05_ID0)
527#define bfin_write_CAN1_MB05_ID0(val) bfin_write16(CAN1_MB05_ID0, val)
528#define bfin_read_CAN1_MB05_ID1() bfin_read16(CAN1_MB05_ID1)
529#define bfin_write_CAN1_MB05_ID1(val) bfin_write16(CAN1_MB05_ID1, val)
530#define bfin_read_CAN1_MB06_DATA0() bfin_read16(CAN1_MB06_DATA0)
531#define bfin_write_CAN1_MB06_DATA0(val) bfin_write16(CAN1_MB06_DATA0, val)
532#define bfin_read_CAN1_MB06_DATA1() bfin_read16(CAN1_MB06_DATA1)
533#define bfin_write_CAN1_MB06_DATA1(val) bfin_write16(CAN1_MB06_DATA1, val)
534#define bfin_read_CAN1_MB06_DATA2() bfin_read16(CAN1_MB06_DATA2)
535#define bfin_write_CAN1_MB06_DATA2(val) bfin_write16(CAN1_MB06_DATA2, val)
536#define bfin_read_CAN1_MB06_DATA3() bfin_read16(CAN1_MB06_DATA3)
537#define bfin_write_CAN1_MB06_DATA3(val) bfin_write16(CAN1_MB06_DATA3, val)
538#define bfin_read_CAN1_MB06_LENGTH() bfin_read16(CAN1_MB06_LENGTH)
539#define bfin_write_CAN1_MB06_LENGTH(val) bfin_write16(CAN1_MB06_LENGTH, val)
540#define bfin_read_CAN1_MB06_TIMESTAMP() bfin_read16(CAN1_MB06_TIMESTAMP)
541#define bfin_write_CAN1_MB06_TIMESTAMP(val) bfin_write16(CAN1_MB06_TIMESTAMP, val)
542#define bfin_read_CAN1_MB06_ID0() bfin_read16(CAN1_MB06_ID0)
543#define bfin_write_CAN1_MB06_ID0(val) bfin_write16(CAN1_MB06_ID0, val)
544#define bfin_read_CAN1_MB06_ID1() bfin_read16(CAN1_MB06_ID1)
545#define bfin_write_CAN1_MB06_ID1(val) bfin_write16(CAN1_MB06_ID1, val)
546#define bfin_read_CAN1_MB07_DATA0() bfin_read16(CAN1_MB07_DATA0)
547#define bfin_write_CAN1_MB07_DATA0(val) bfin_write16(CAN1_MB07_DATA0, val)
548#define bfin_read_CAN1_MB07_DATA1() bfin_read16(CAN1_MB07_DATA1)
549#define bfin_write_CAN1_MB07_DATA1(val) bfin_write16(CAN1_MB07_DATA1, val)
550#define bfin_read_CAN1_MB07_DATA2() bfin_read16(CAN1_MB07_DATA2)
551#define bfin_write_CAN1_MB07_DATA2(val) bfin_write16(CAN1_MB07_DATA2, val)
552#define bfin_read_CAN1_MB07_DATA3() bfin_read16(CAN1_MB07_DATA3)
553#define bfin_write_CAN1_MB07_DATA3(val) bfin_write16(CAN1_MB07_DATA3, val)
554#define bfin_read_CAN1_MB07_LENGTH() bfin_read16(CAN1_MB07_LENGTH)
555#define bfin_write_CAN1_MB07_LENGTH(val) bfin_write16(CAN1_MB07_LENGTH, val)
556#define bfin_read_CAN1_MB07_TIMESTAMP() bfin_read16(CAN1_MB07_TIMESTAMP)
557#define bfin_write_CAN1_MB07_TIMESTAMP(val) bfin_write16(CAN1_MB07_TIMESTAMP, val)
558#define bfin_read_CAN1_MB07_ID0() bfin_read16(CAN1_MB07_ID0)
559#define bfin_write_CAN1_MB07_ID0(val) bfin_write16(CAN1_MB07_ID0, val)
560#define bfin_read_CAN1_MB07_ID1() bfin_read16(CAN1_MB07_ID1)
561#define bfin_write_CAN1_MB07_ID1(val) bfin_write16(CAN1_MB07_ID1, val)
562#define bfin_read_CAN1_MB08_DATA0() bfin_read16(CAN1_MB08_DATA0)
563#define bfin_write_CAN1_MB08_DATA0(val) bfin_write16(CAN1_MB08_DATA0, val)
564#define bfin_read_CAN1_MB08_DATA1() bfin_read16(CAN1_MB08_DATA1)
565#define bfin_write_CAN1_MB08_DATA1(val) bfin_write16(CAN1_MB08_DATA1, val)
566#define bfin_read_CAN1_MB08_DATA2() bfin_read16(CAN1_MB08_DATA2)
567#define bfin_write_CAN1_MB08_DATA2(val) bfin_write16(CAN1_MB08_DATA2, val)
568#define bfin_read_CAN1_MB08_DATA3() bfin_read16(CAN1_MB08_DATA3)
569#define bfin_write_CAN1_MB08_DATA3(val) bfin_write16(CAN1_MB08_DATA3, val)
570#define bfin_read_CAN1_MB08_LENGTH() bfin_read16(CAN1_MB08_LENGTH)
571#define bfin_write_CAN1_MB08_LENGTH(val) bfin_write16(CAN1_MB08_LENGTH, val)
572#define bfin_read_CAN1_MB08_TIMESTAMP() bfin_read16(CAN1_MB08_TIMESTAMP)
573#define bfin_write_CAN1_MB08_TIMESTAMP(val) bfin_write16(CAN1_MB08_TIMESTAMP, val)
574#define bfin_read_CAN1_MB08_ID0() bfin_read16(CAN1_MB08_ID0)
575#define bfin_write_CAN1_MB08_ID0(val) bfin_write16(CAN1_MB08_ID0, val)
576#define bfin_read_CAN1_MB08_ID1() bfin_read16(CAN1_MB08_ID1)
577#define bfin_write_CAN1_MB08_ID1(val) bfin_write16(CAN1_MB08_ID1, val)
578#define bfin_read_CAN1_MB09_DATA0() bfin_read16(CAN1_MB09_DATA0)
579#define bfin_write_CAN1_MB09_DATA0(val) bfin_write16(CAN1_MB09_DATA0, val)
580#define bfin_read_CAN1_MB09_DATA1() bfin_read16(CAN1_MB09_DATA1)
581#define bfin_write_CAN1_MB09_DATA1(val) bfin_write16(CAN1_MB09_DATA1, val)
582#define bfin_read_CAN1_MB09_DATA2() bfin_read16(CAN1_MB09_DATA2)
583#define bfin_write_CAN1_MB09_DATA2(val) bfin_write16(CAN1_MB09_DATA2, val)
584#define bfin_read_CAN1_MB09_DATA3() bfin_read16(CAN1_MB09_DATA3)
585#define bfin_write_CAN1_MB09_DATA3(val) bfin_write16(CAN1_MB09_DATA3, val)
586#define bfin_read_CAN1_MB09_LENGTH() bfin_read16(CAN1_MB09_LENGTH)
587#define bfin_write_CAN1_MB09_LENGTH(val) bfin_write16(CAN1_MB09_LENGTH, val)
588#define bfin_read_CAN1_MB09_TIMESTAMP() bfin_read16(CAN1_MB09_TIMESTAMP)
589#define bfin_write_CAN1_MB09_TIMESTAMP(val) bfin_write16(CAN1_MB09_TIMESTAMP, val)
590#define bfin_read_CAN1_MB09_ID0() bfin_read16(CAN1_MB09_ID0)
591#define bfin_write_CAN1_MB09_ID0(val) bfin_write16(CAN1_MB09_ID0, val)
592#define bfin_read_CAN1_MB09_ID1() bfin_read16(CAN1_MB09_ID1)
593#define bfin_write_CAN1_MB09_ID1(val) bfin_write16(CAN1_MB09_ID1, val)
594#define bfin_read_CAN1_MB10_DATA0() bfin_read16(CAN1_MB10_DATA0)
595#define bfin_write_CAN1_MB10_DATA0(val) bfin_write16(CAN1_MB10_DATA0, val)
596#define bfin_read_CAN1_MB10_DATA1() bfin_read16(CAN1_MB10_DATA1)
597#define bfin_write_CAN1_MB10_DATA1(val) bfin_write16(CAN1_MB10_DATA1, val)
598#define bfin_read_CAN1_MB10_DATA2() bfin_read16(CAN1_MB10_DATA2)
599#define bfin_write_CAN1_MB10_DATA2(val) bfin_write16(CAN1_MB10_DATA2, val)
600#define bfin_read_CAN1_MB10_DATA3() bfin_read16(CAN1_MB10_DATA3)
601#define bfin_write_CAN1_MB10_DATA3(val) bfin_write16(CAN1_MB10_DATA3, val)
602#define bfin_read_CAN1_MB10_LENGTH() bfin_read16(CAN1_MB10_LENGTH)
603#define bfin_write_CAN1_MB10_LENGTH(val) bfin_write16(CAN1_MB10_LENGTH, val)
604#define bfin_read_CAN1_MB10_TIMESTAMP() bfin_read16(CAN1_MB10_TIMESTAMP)
605#define bfin_write_CAN1_MB10_TIMESTAMP(val) bfin_write16(CAN1_MB10_TIMESTAMP, val)
606#define bfin_read_CAN1_MB10_ID0() bfin_read16(CAN1_MB10_ID0)
607#define bfin_write_CAN1_MB10_ID0(val) bfin_write16(CAN1_MB10_ID0, val)
608#define bfin_read_CAN1_MB10_ID1() bfin_read16(CAN1_MB10_ID1)
609#define bfin_write_CAN1_MB10_ID1(val) bfin_write16(CAN1_MB10_ID1, val)
610#define bfin_read_CAN1_MB11_DATA0() bfin_read16(CAN1_MB11_DATA0)
611#define bfin_write_CAN1_MB11_DATA0(val) bfin_write16(CAN1_MB11_DATA0, val)
612#define bfin_read_CAN1_MB11_DATA1() bfin_read16(CAN1_MB11_DATA1)
613#define bfin_write_CAN1_MB11_DATA1(val) bfin_write16(CAN1_MB11_DATA1, val)
614#define bfin_read_CAN1_MB11_DATA2() bfin_read16(CAN1_MB11_DATA2)
615#define bfin_write_CAN1_MB11_DATA2(val) bfin_write16(CAN1_MB11_DATA2, val)
616#define bfin_read_CAN1_MB11_DATA3() bfin_read16(CAN1_MB11_DATA3)
617#define bfin_write_CAN1_MB11_DATA3(val) bfin_write16(CAN1_MB11_DATA3, val)
618#define bfin_read_CAN1_MB11_LENGTH() bfin_read16(CAN1_MB11_LENGTH)
619#define bfin_write_CAN1_MB11_LENGTH(val) bfin_write16(CAN1_MB11_LENGTH, val)
620#define bfin_read_CAN1_MB11_TIMESTAMP() bfin_read16(CAN1_MB11_TIMESTAMP)
621#define bfin_write_CAN1_MB11_TIMESTAMP(val) bfin_write16(CAN1_MB11_TIMESTAMP, val)
622#define bfin_read_CAN1_MB11_ID0() bfin_read16(CAN1_MB11_ID0)
623#define bfin_write_CAN1_MB11_ID0(val) bfin_write16(CAN1_MB11_ID0, val)
624#define bfin_read_CAN1_MB11_ID1() bfin_read16(CAN1_MB11_ID1)
625#define bfin_write_CAN1_MB11_ID1(val) bfin_write16(CAN1_MB11_ID1, val)
626#define bfin_read_CAN1_MB12_DATA0() bfin_read16(CAN1_MB12_DATA0)
627#define bfin_write_CAN1_MB12_DATA0(val) bfin_write16(CAN1_MB12_DATA0, val)
628#define bfin_read_CAN1_MB12_DATA1() bfin_read16(CAN1_MB12_DATA1)
629#define bfin_write_CAN1_MB12_DATA1(val) bfin_write16(CAN1_MB12_DATA1, val)
630#define bfin_read_CAN1_MB12_DATA2() bfin_read16(CAN1_MB12_DATA2)
631#define bfin_write_CAN1_MB12_DATA2(val) bfin_write16(CAN1_MB12_DATA2, val)
632#define bfin_read_CAN1_MB12_DATA3() bfin_read16(CAN1_MB12_DATA3)
633#define bfin_write_CAN1_MB12_DATA3(val) bfin_write16(CAN1_MB12_DATA3, val)
634#define bfin_read_CAN1_MB12_LENGTH() bfin_read16(CAN1_MB12_LENGTH)
635#define bfin_write_CAN1_MB12_LENGTH(val) bfin_write16(CAN1_MB12_LENGTH, val)
636#define bfin_read_CAN1_MB12_TIMESTAMP() bfin_read16(CAN1_MB12_TIMESTAMP)
637#define bfin_write_CAN1_MB12_TIMESTAMP(val) bfin_write16(CAN1_MB12_TIMESTAMP, val)
638#define bfin_read_CAN1_MB12_ID0() bfin_read16(CAN1_MB12_ID0)
639#define bfin_write_CAN1_MB12_ID0(val) bfin_write16(CAN1_MB12_ID0, val)
640#define bfin_read_CAN1_MB12_ID1() bfin_read16(CAN1_MB12_ID1)
641#define bfin_write_CAN1_MB12_ID1(val) bfin_write16(CAN1_MB12_ID1, val)
642#define bfin_read_CAN1_MB13_DATA0() bfin_read16(CAN1_MB13_DATA0)
643#define bfin_write_CAN1_MB13_DATA0(val) bfin_write16(CAN1_MB13_DATA0, val)
644#define bfin_read_CAN1_MB13_DATA1() bfin_read16(CAN1_MB13_DATA1)
645#define bfin_write_CAN1_MB13_DATA1(val) bfin_write16(CAN1_MB13_DATA1, val)
646#define bfin_read_CAN1_MB13_DATA2() bfin_read16(CAN1_MB13_DATA2)
647#define bfin_write_CAN1_MB13_DATA2(val) bfin_write16(CAN1_MB13_DATA2, val)
648#define bfin_read_CAN1_MB13_DATA3() bfin_read16(CAN1_MB13_DATA3)
649#define bfin_write_CAN1_MB13_DATA3(val) bfin_write16(CAN1_MB13_DATA3, val)
650#define bfin_read_CAN1_MB13_LENGTH() bfin_read16(CAN1_MB13_LENGTH)
651#define bfin_write_CAN1_MB13_LENGTH(val) bfin_write16(CAN1_MB13_LENGTH, val)
652#define bfin_read_CAN1_MB13_TIMESTAMP() bfin_read16(CAN1_MB13_TIMESTAMP)
653#define bfin_write_CAN1_MB13_TIMESTAMP(val) bfin_write16(CAN1_MB13_TIMESTAMP, val)
654#define bfin_read_CAN1_MB13_ID0() bfin_read16(CAN1_MB13_ID0)
655#define bfin_write_CAN1_MB13_ID0(val) bfin_write16(CAN1_MB13_ID0, val)
656#define bfin_read_CAN1_MB13_ID1() bfin_read16(CAN1_MB13_ID1)
657#define bfin_write_CAN1_MB13_ID1(val) bfin_write16(CAN1_MB13_ID1, val)
658#define bfin_read_CAN1_MB14_DATA0() bfin_read16(CAN1_MB14_DATA0)
659#define bfin_write_CAN1_MB14_DATA0(val) bfin_write16(CAN1_MB14_DATA0, val)
660#define bfin_read_CAN1_MB14_DATA1() bfin_read16(CAN1_MB14_DATA1)
661#define bfin_write_CAN1_MB14_DATA1(val) bfin_write16(CAN1_MB14_DATA1, val)
662#define bfin_read_CAN1_MB14_DATA2() bfin_read16(CAN1_MB14_DATA2)
663#define bfin_write_CAN1_MB14_DATA2(val) bfin_write16(CAN1_MB14_DATA2, val)
664#define bfin_read_CAN1_MB14_DATA3() bfin_read16(CAN1_MB14_DATA3)
665#define bfin_write_CAN1_MB14_DATA3(val) bfin_write16(CAN1_MB14_DATA3, val)
666#define bfin_read_CAN1_MB14_LENGTH() bfin_read16(CAN1_MB14_LENGTH)
667#define bfin_write_CAN1_MB14_LENGTH(val) bfin_write16(CAN1_MB14_LENGTH, val)
668#define bfin_read_CAN1_MB14_TIMESTAMP() bfin_read16(CAN1_MB14_TIMESTAMP)
669#define bfin_write_CAN1_MB14_TIMESTAMP(val) bfin_write16(CAN1_MB14_TIMESTAMP, val)
670#define bfin_read_CAN1_MB14_ID0() bfin_read16(CAN1_MB14_ID0)
671#define bfin_write_CAN1_MB14_ID0(val) bfin_write16(CAN1_MB14_ID0, val)
672#define bfin_read_CAN1_MB14_ID1() bfin_read16(CAN1_MB14_ID1)
673#define bfin_write_CAN1_MB14_ID1(val) bfin_write16(CAN1_MB14_ID1, val)
674#define bfin_read_CAN1_MB15_DATA0() bfin_read16(CAN1_MB15_DATA0)
675#define bfin_write_CAN1_MB15_DATA0(val) bfin_write16(CAN1_MB15_DATA0, val)
676#define bfin_read_CAN1_MB15_DATA1() bfin_read16(CAN1_MB15_DATA1)
677#define bfin_write_CAN1_MB15_DATA1(val) bfin_write16(CAN1_MB15_DATA1, val)
678#define bfin_read_CAN1_MB15_DATA2() bfin_read16(CAN1_MB15_DATA2)
679#define bfin_write_CAN1_MB15_DATA2(val) bfin_write16(CAN1_MB15_DATA2, val)
680#define bfin_read_CAN1_MB15_DATA3() bfin_read16(CAN1_MB15_DATA3)
681#define bfin_write_CAN1_MB15_DATA3(val) bfin_write16(CAN1_MB15_DATA3, val)
682#define bfin_read_CAN1_MB15_LENGTH() bfin_read16(CAN1_MB15_LENGTH)
683#define bfin_write_CAN1_MB15_LENGTH(val) bfin_write16(CAN1_MB15_LENGTH, val)
684#define bfin_read_CAN1_MB15_TIMESTAMP() bfin_read16(CAN1_MB15_TIMESTAMP)
685#define bfin_write_CAN1_MB15_TIMESTAMP(val) bfin_write16(CAN1_MB15_TIMESTAMP, val)
686#define bfin_read_CAN1_MB15_ID0() bfin_read16(CAN1_MB15_ID0)
687#define bfin_write_CAN1_MB15_ID0(val) bfin_write16(CAN1_MB15_ID0, val)
688#define bfin_read_CAN1_MB15_ID1() bfin_read16(CAN1_MB15_ID1)
689#define bfin_write_CAN1_MB15_ID1(val) bfin_write16(CAN1_MB15_ID1, val)
690
691/* CAN Controller 1 Mailbox Data Registers */
692
693#define bfin_read_CAN1_MB16_DATA0() bfin_read16(CAN1_MB16_DATA0)
694#define bfin_write_CAN1_MB16_DATA0(val) bfin_write16(CAN1_MB16_DATA0, val)
695#define bfin_read_CAN1_MB16_DATA1() bfin_read16(CAN1_MB16_DATA1)
696#define bfin_write_CAN1_MB16_DATA1(val) bfin_write16(CAN1_MB16_DATA1, val)
697#define bfin_read_CAN1_MB16_DATA2() bfin_read16(CAN1_MB16_DATA2)
698#define bfin_write_CAN1_MB16_DATA2(val) bfin_write16(CAN1_MB16_DATA2, val)
699#define bfin_read_CAN1_MB16_DATA3() bfin_read16(CAN1_MB16_DATA3)
700#define bfin_write_CAN1_MB16_DATA3(val) bfin_write16(CAN1_MB16_DATA3, val)
701#define bfin_read_CAN1_MB16_LENGTH() bfin_read16(CAN1_MB16_LENGTH)
702#define bfin_write_CAN1_MB16_LENGTH(val) bfin_write16(CAN1_MB16_LENGTH, val)
703#define bfin_read_CAN1_MB16_TIMESTAMP() bfin_read16(CAN1_MB16_TIMESTAMP)
704#define bfin_write_CAN1_MB16_TIMESTAMP(val) bfin_write16(CAN1_MB16_TIMESTAMP, val)
705#define bfin_read_CAN1_MB16_ID0() bfin_read16(CAN1_MB16_ID0)
706#define bfin_write_CAN1_MB16_ID0(val) bfin_write16(CAN1_MB16_ID0, val)
707#define bfin_read_CAN1_MB16_ID1() bfin_read16(CAN1_MB16_ID1)
708#define bfin_write_CAN1_MB16_ID1(val) bfin_write16(CAN1_MB16_ID1, val)
709#define bfin_read_CAN1_MB17_DATA0() bfin_read16(CAN1_MB17_DATA0)
710#define bfin_write_CAN1_MB17_DATA0(val) bfin_write16(CAN1_MB17_DATA0, val)
711#define bfin_read_CAN1_MB17_DATA1() bfin_read16(CAN1_MB17_DATA1)
712#define bfin_write_CAN1_MB17_DATA1(val) bfin_write16(CAN1_MB17_DATA1, val)
713#define bfin_read_CAN1_MB17_DATA2() bfin_read16(CAN1_MB17_DATA2)
714#define bfin_write_CAN1_MB17_DATA2(val) bfin_write16(CAN1_MB17_DATA2, val)
715#define bfin_read_CAN1_MB17_DATA3() bfin_read16(CAN1_MB17_DATA3)
716#define bfin_write_CAN1_MB17_DATA3(val) bfin_write16(CAN1_MB17_DATA3, val)
717#define bfin_read_CAN1_MB17_LENGTH() bfin_read16(CAN1_MB17_LENGTH)
718#define bfin_write_CAN1_MB17_LENGTH(val) bfin_write16(CAN1_MB17_LENGTH, val)
719#define bfin_read_CAN1_MB17_TIMESTAMP() bfin_read16(CAN1_MB17_TIMESTAMP)
720#define bfin_write_CAN1_MB17_TIMESTAMP(val) bfin_write16(CAN1_MB17_TIMESTAMP, val)
721#define bfin_read_CAN1_MB17_ID0() bfin_read16(CAN1_MB17_ID0)
722#define bfin_write_CAN1_MB17_ID0(val) bfin_write16(CAN1_MB17_ID0, val)
723#define bfin_read_CAN1_MB17_ID1() bfin_read16(CAN1_MB17_ID1)
724#define bfin_write_CAN1_MB17_ID1(val) bfin_write16(CAN1_MB17_ID1, val)
725#define bfin_read_CAN1_MB18_DATA0() bfin_read16(CAN1_MB18_DATA0)
726#define bfin_write_CAN1_MB18_DATA0(val) bfin_write16(CAN1_MB18_DATA0, val)
727#define bfin_read_CAN1_MB18_DATA1() bfin_read16(CAN1_MB18_DATA1)
728#define bfin_write_CAN1_MB18_DATA1(val) bfin_write16(CAN1_MB18_DATA1, val)
729#define bfin_read_CAN1_MB18_DATA2() bfin_read16(CAN1_MB18_DATA2)
730#define bfin_write_CAN1_MB18_DATA2(val) bfin_write16(CAN1_MB18_DATA2, val)
731#define bfin_read_CAN1_MB18_DATA3() bfin_read16(CAN1_MB18_DATA3)
732#define bfin_write_CAN1_MB18_DATA3(val) bfin_write16(CAN1_MB18_DATA3, val)
733#define bfin_read_CAN1_MB18_LENGTH() bfin_read16(CAN1_MB18_LENGTH)
734#define bfin_write_CAN1_MB18_LENGTH(val) bfin_write16(CAN1_MB18_LENGTH, val)
735#define bfin_read_CAN1_MB18_TIMESTAMP() bfin_read16(CAN1_MB18_TIMESTAMP)
736#define bfin_write_CAN1_MB18_TIMESTAMP(val) bfin_write16(CAN1_MB18_TIMESTAMP, val)
737#define bfin_read_CAN1_MB18_ID0() bfin_read16(CAN1_MB18_ID0)
738#define bfin_write_CAN1_MB18_ID0(val) bfin_write16(CAN1_MB18_ID0, val)
739#define bfin_read_CAN1_MB18_ID1() bfin_read16(CAN1_MB18_ID1)
740#define bfin_write_CAN1_MB18_ID1(val) bfin_write16(CAN1_MB18_ID1, val)
741#define bfin_read_CAN1_MB19_DATA0() bfin_read16(CAN1_MB19_DATA0)
742#define bfin_write_CAN1_MB19_DATA0(val) bfin_write16(CAN1_MB19_DATA0, val)
743#define bfin_read_CAN1_MB19_DATA1() bfin_read16(CAN1_MB19_DATA1)
744#define bfin_write_CAN1_MB19_DATA1(val) bfin_write16(CAN1_MB19_DATA1, val)
745#define bfin_read_CAN1_MB19_DATA2() bfin_read16(CAN1_MB19_DATA2)
746#define bfin_write_CAN1_MB19_DATA2(val) bfin_write16(CAN1_MB19_DATA2, val)
747#define bfin_read_CAN1_MB19_DATA3() bfin_read16(CAN1_MB19_DATA3)
748#define bfin_write_CAN1_MB19_DATA3(val) bfin_write16(CAN1_MB19_DATA3, val)
749#define bfin_read_CAN1_MB19_LENGTH() bfin_read16(CAN1_MB19_LENGTH)
750#define bfin_write_CAN1_MB19_LENGTH(val) bfin_write16(CAN1_MB19_LENGTH, val)
751#define bfin_read_CAN1_MB19_TIMESTAMP() bfin_read16(CAN1_MB19_TIMESTAMP)
752#define bfin_write_CAN1_MB19_TIMESTAMP(val) bfin_write16(CAN1_MB19_TIMESTAMP, val)
753#define bfin_read_CAN1_MB19_ID0() bfin_read16(CAN1_MB19_ID0)
754#define bfin_write_CAN1_MB19_ID0(val) bfin_write16(CAN1_MB19_ID0, val)
755#define bfin_read_CAN1_MB19_ID1() bfin_read16(CAN1_MB19_ID1)
756#define bfin_write_CAN1_MB19_ID1(val) bfin_write16(CAN1_MB19_ID1, val)
757#define bfin_read_CAN1_MB20_DATA0() bfin_read16(CAN1_MB20_DATA0)
758#define bfin_write_CAN1_MB20_DATA0(val) bfin_write16(CAN1_MB20_DATA0, val)
759#define bfin_read_CAN1_MB20_DATA1() bfin_read16(CAN1_MB20_DATA1)
760#define bfin_write_CAN1_MB20_DATA1(val) bfin_write16(CAN1_MB20_DATA1, val)
761#define bfin_read_CAN1_MB20_DATA2() bfin_read16(CAN1_MB20_DATA2)
762#define bfin_write_CAN1_MB20_DATA2(val) bfin_write16(CAN1_MB20_DATA2, val)
763#define bfin_read_CAN1_MB20_DATA3() bfin_read16(CAN1_MB20_DATA3)
764#define bfin_write_CAN1_MB20_DATA3(val) bfin_write16(CAN1_MB20_DATA3, val)
765#define bfin_read_CAN1_MB20_LENGTH() bfin_read16(CAN1_MB20_LENGTH)
766#define bfin_write_CAN1_MB20_LENGTH(val) bfin_write16(CAN1_MB20_LENGTH, val)
767#define bfin_read_CAN1_MB20_TIMESTAMP() bfin_read16(CAN1_MB20_TIMESTAMP)
768#define bfin_write_CAN1_MB20_TIMESTAMP(val) bfin_write16(CAN1_MB20_TIMESTAMP, val)
769#define bfin_read_CAN1_MB20_ID0() bfin_read16(CAN1_MB20_ID0)
770#define bfin_write_CAN1_MB20_ID0(val) bfin_write16(CAN1_MB20_ID0, val)
771#define bfin_read_CAN1_MB20_ID1() bfin_read16(CAN1_MB20_ID1)
772#define bfin_write_CAN1_MB20_ID1(val) bfin_write16(CAN1_MB20_ID1, val)
773#define bfin_read_CAN1_MB21_DATA0() bfin_read16(CAN1_MB21_DATA0)
774#define bfin_write_CAN1_MB21_DATA0(val) bfin_write16(CAN1_MB21_DATA0, val)
775#define bfin_read_CAN1_MB21_DATA1() bfin_read16(CAN1_MB21_DATA1)
776#define bfin_write_CAN1_MB21_DATA1(val) bfin_write16(CAN1_MB21_DATA1, val)
777#define bfin_read_CAN1_MB21_DATA2() bfin_read16(CAN1_MB21_DATA2)
778#define bfin_write_CAN1_MB21_DATA2(val) bfin_write16(CAN1_MB21_DATA2, val)
779#define bfin_read_CAN1_MB21_DATA3() bfin_read16(CAN1_MB21_DATA3)
780#define bfin_write_CAN1_MB21_DATA3(val) bfin_write16(CAN1_MB21_DATA3, val)
781#define bfin_read_CAN1_MB21_LENGTH() bfin_read16(CAN1_MB21_LENGTH)
782#define bfin_write_CAN1_MB21_LENGTH(val) bfin_write16(CAN1_MB21_LENGTH, val)
783#define bfin_read_CAN1_MB21_TIMESTAMP() bfin_read16(CAN1_MB21_TIMESTAMP)
784#define bfin_write_CAN1_MB21_TIMESTAMP(val) bfin_write16(CAN1_MB21_TIMESTAMP, val)
785#define bfin_read_CAN1_MB21_ID0() bfin_read16(CAN1_MB21_ID0)
786#define bfin_write_CAN1_MB21_ID0(val) bfin_write16(CAN1_MB21_ID0, val)
787#define bfin_read_CAN1_MB21_ID1() bfin_read16(CAN1_MB21_ID1)
788#define bfin_write_CAN1_MB21_ID1(val) bfin_write16(CAN1_MB21_ID1, val)
789#define bfin_read_CAN1_MB22_DATA0() bfin_read16(CAN1_MB22_DATA0)
790#define bfin_write_CAN1_MB22_DATA0(val) bfin_write16(CAN1_MB22_DATA0, val)
791#define bfin_read_CAN1_MB22_DATA1() bfin_read16(CAN1_MB22_DATA1)
792#define bfin_write_CAN1_MB22_DATA1(val) bfin_write16(CAN1_MB22_DATA1, val)
793#define bfin_read_CAN1_MB22_DATA2() bfin_read16(CAN1_MB22_DATA2)
794#define bfin_write_CAN1_MB22_DATA2(val) bfin_write16(CAN1_MB22_DATA2, val)
795#define bfin_read_CAN1_MB22_DATA3() bfin_read16(CAN1_MB22_DATA3)
796#define bfin_write_CAN1_MB22_DATA3(val) bfin_write16(CAN1_MB22_DATA3, val)
797#define bfin_read_CAN1_MB22_LENGTH() bfin_read16(CAN1_MB22_LENGTH)
798#define bfin_write_CAN1_MB22_LENGTH(val) bfin_write16(CAN1_MB22_LENGTH, val)
799#define bfin_read_CAN1_MB22_TIMESTAMP() bfin_read16(CAN1_MB22_TIMESTAMP)
800#define bfin_write_CAN1_MB22_TIMESTAMP(val) bfin_write16(CAN1_MB22_TIMESTAMP, val)
801#define bfin_read_CAN1_MB22_ID0() bfin_read16(CAN1_MB22_ID0)
802#define bfin_write_CAN1_MB22_ID0(val) bfin_write16(CAN1_MB22_ID0, val)
803#define bfin_read_CAN1_MB22_ID1() bfin_read16(CAN1_MB22_ID1)
804#define bfin_write_CAN1_MB22_ID1(val) bfin_write16(CAN1_MB22_ID1, val)
805#define bfin_read_CAN1_MB23_DATA0() bfin_read16(CAN1_MB23_DATA0)
806#define bfin_write_CAN1_MB23_DATA0(val) bfin_write16(CAN1_MB23_DATA0, val)
807#define bfin_read_CAN1_MB23_DATA1() bfin_read16(CAN1_MB23_DATA1)
808#define bfin_write_CAN1_MB23_DATA1(val) bfin_write16(CAN1_MB23_DATA1, val)
809#define bfin_read_CAN1_MB23_DATA2() bfin_read16(CAN1_MB23_DATA2)
810#define bfin_write_CAN1_MB23_DATA2(val) bfin_write16(CAN1_MB23_DATA2, val)
811#define bfin_read_CAN1_MB23_DATA3() bfin_read16(CAN1_MB23_DATA3)
812#define bfin_write_CAN1_MB23_DATA3(val) bfin_write16(CAN1_MB23_DATA3, val)
813#define bfin_read_CAN1_MB23_LENGTH() bfin_read16(CAN1_MB23_LENGTH)
814#define bfin_write_CAN1_MB23_LENGTH(val) bfin_write16(CAN1_MB23_LENGTH, val)
815#define bfin_read_CAN1_MB23_TIMESTAMP() bfin_read16(CAN1_MB23_TIMESTAMP)
816#define bfin_write_CAN1_MB23_TIMESTAMP(val) bfin_write16(CAN1_MB23_TIMESTAMP, val)
817#define bfin_read_CAN1_MB23_ID0() bfin_read16(CAN1_MB23_ID0)
818#define bfin_write_CAN1_MB23_ID0(val) bfin_write16(CAN1_MB23_ID0, val)
819#define bfin_read_CAN1_MB23_ID1() bfin_read16(CAN1_MB23_ID1)
820#define bfin_write_CAN1_MB23_ID1(val) bfin_write16(CAN1_MB23_ID1, val)
821#define bfin_read_CAN1_MB24_DATA0() bfin_read16(CAN1_MB24_DATA0)
822#define bfin_write_CAN1_MB24_DATA0(val) bfin_write16(CAN1_MB24_DATA0, val)
823#define bfin_read_CAN1_MB24_DATA1() bfin_read16(CAN1_MB24_DATA1)
824#define bfin_write_CAN1_MB24_DATA1(val) bfin_write16(CAN1_MB24_DATA1, val)
825#define bfin_read_CAN1_MB24_DATA2() bfin_read16(CAN1_MB24_DATA2)
826#define bfin_write_CAN1_MB24_DATA2(val) bfin_write16(CAN1_MB24_DATA2, val)
827#define bfin_read_CAN1_MB24_DATA3() bfin_read16(CAN1_MB24_DATA3)
828#define bfin_write_CAN1_MB24_DATA3(val) bfin_write16(CAN1_MB24_DATA3, val)
829#define bfin_read_CAN1_MB24_LENGTH() bfin_read16(CAN1_MB24_LENGTH)
830#define bfin_write_CAN1_MB24_LENGTH(val) bfin_write16(CAN1_MB24_LENGTH, val)
831#define bfin_read_CAN1_MB24_TIMESTAMP() bfin_read16(CAN1_MB24_TIMESTAMP)
832#define bfin_write_CAN1_MB24_TIMESTAMP(val) bfin_write16(CAN1_MB24_TIMESTAMP, val)
833#define bfin_read_CAN1_MB24_ID0() bfin_read16(CAN1_MB24_ID0)
834#define bfin_write_CAN1_MB24_ID0(val) bfin_write16(CAN1_MB24_ID0, val)
835#define bfin_read_CAN1_MB24_ID1() bfin_read16(CAN1_MB24_ID1)
836#define bfin_write_CAN1_MB24_ID1(val) bfin_write16(CAN1_MB24_ID1, val)
837#define bfin_read_CAN1_MB25_DATA0() bfin_read16(CAN1_MB25_DATA0)
838#define bfin_write_CAN1_MB25_DATA0(val) bfin_write16(CAN1_MB25_DATA0, val)
839#define bfin_read_CAN1_MB25_DATA1() bfin_read16(CAN1_MB25_DATA1)
840#define bfin_write_CAN1_MB25_DATA1(val) bfin_write16(CAN1_MB25_DATA1, val)
841#define bfin_read_CAN1_MB25_DATA2() bfin_read16(CAN1_MB25_DATA2)
842#define bfin_write_CAN1_MB25_DATA2(val) bfin_write16(CAN1_MB25_DATA2, val)
843#define bfin_read_CAN1_MB25_DATA3() bfin_read16(CAN1_MB25_DATA3)
844#define bfin_write_CAN1_MB25_DATA3(val) bfin_write16(CAN1_MB25_DATA3, val)
845#define bfin_read_CAN1_MB25_LENGTH() bfin_read16(CAN1_MB25_LENGTH)
846#define bfin_write_CAN1_MB25_LENGTH(val) bfin_write16(CAN1_MB25_LENGTH, val)
847#define bfin_read_CAN1_MB25_TIMESTAMP() bfin_read16(CAN1_MB25_TIMESTAMP)
848#define bfin_write_CAN1_MB25_TIMESTAMP(val) bfin_write16(CAN1_MB25_TIMESTAMP, val)
849#define bfin_read_CAN1_MB25_ID0() bfin_read16(CAN1_MB25_ID0)
850#define bfin_write_CAN1_MB25_ID0(val) bfin_write16(CAN1_MB25_ID0, val)
851#define bfin_read_CAN1_MB25_ID1() bfin_read16(CAN1_MB25_ID1)
852#define bfin_write_CAN1_MB25_ID1(val) bfin_write16(CAN1_MB25_ID1, val)
853#define bfin_read_CAN1_MB26_DATA0() bfin_read16(CAN1_MB26_DATA0)
854#define bfin_write_CAN1_MB26_DATA0(val) bfin_write16(CAN1_MB26_DATA0, val)
855#define bfin_read_CAN1_MB26_DATA1() bfin_read16(CAN1_MB26_DATA1)
856#define bfin_write_CAN1_MB26_DATA1(val) bfin_write16(CAN1_MB26_DATA1, val)
857#define bfin_read_CAN1_MB26_DATA2() bfin_read16(CAN1_MB26_DATA2)
858#define bfin_write_CAN1_MB26_DATA2(val) bfin_write16(CAN1_MB26_DATA2, val)
859#define bfin_read_CAN1_MB26_DATA3() bfin_read16(CAN1_MB26_DATA3)
860#define bfin_write_CAN1_MB26_DATA3(val) bfin_write16(CAN1_MB26_DATA3, val)
861#define bfin_read_CAN1_MB26_LENGTH() bfin_read16(CAN1_MB26_LENGTH)
862#define bfin_write_CAN1_MB26_LENGTH(val) bfin_write16(CAN1_MB26_LENGTH, val)
863#define bfin_read_CAN1_MB26_TIMESTAMP() bfin_read16(CAN1_MB26_TIMESTAMP)
864#define bfin_write_CAN1_MB26_TIMESTAMP(val) bfin_write16(CAN1_MB26_TIMESTAMP, val)
865#define bfin_read_CAN1_MB26_ID0() bfin_read16(CAN1_MB26_ID0)
866#define bfin_write_CAN1_MB26_ID0(val) bfin_write16(CAN1_MB26_ID0, val)
867#define bfin_read_CAN1_MB26_ID1() bfin_read16(CAN1_MB26_ID1)
868#define bfin_write_CAN1_MB26_ID1(val) bfin_write16(CAN1_MB26_ID1, val)
869#define bfin_read_CAN1_MB27_DATA0() bfin_read16(CAN1_MB27_DATA0)
870#define bfin_write_CAN1_MB27_DATA0(val) bfin_write16(CAN1_MB27_DATA0, val)
871#define bfin_read_CAN1_MB27_DATA1() bfin_read16(CAN1_MB27_DATA1)
872#define bfin_write_CAN1_MB27_DATA1(val) bfin_write16(CAN1_MB27_DATA1, val)
873#define bfin_read_CAN1_MB27_DATA2() bfin_read16(CAN1_MB27_DATA2)
874#define bfin_write_CAN1_MB27_DATA2(val) bfin_write16(CAN1_MB27_DATA2, val)
875#define bfin_read_CAN1_MB27_DATA3() bfin_read16(CAN1_MB27_DATA3)
876#define bfin_write_CAN1_MB27_DATA3(val) bfin_write16(CAN1_MB27_DATA3, val)
877#define bfin_read_CAN1_MB27_LENGTH() bfin_read16(CAN1_MB27_LENGTH)
878#define bfin_write_CAN1_MB27_LENGTH(val) bfin_write16(CAN1_MB27_LENGTH, val)
879#define bfin_read_CAN1_MB27_TIMESTAMP() bfin_read16(CAN1_MB27_TIMESTAMP)
880#define bfin_write_CAN1_MB27_TIMESTAMP(val) bfin_write16(CAN1_MB27_TIMESTAMP, val)
881#define bfin_read_CAN1_MB27_ID0() bfin_read16(CAN1_MB27_ID0)
882#define bfin_write_CAN1_MB27_ID0(val) bfin_write16(CAN1_MB27_ID0, val)
883#define bfin_read_CAN1_MB27_ID1() bfin_read16(CAN1_MB27_ID1)
884#define bfin_write_CAN1_MB27_ID1(val) bfin_write16(CAN1_MB27_ID1, val)
885#define bfin_read_CAN1_MB28_DATA0() bfin_read16(CAN1_MB28_DATA0)
886#define bfin_write_CAN1_MB28_DATA0(val) bfin_write16(CAN1_MB28_DATA0, val)
887#define bfin_read_CAN1_MB28_DATA1() bfin_read16(CAN1_MB28_DATA1)
888#define bfin_write_CAN1_MB28_DATA1(val) bfin_write16(CAN1_MB28_DATA1, val)
889#define bfin_read_CAN1_MB28_DATA2() bfin_read16(CAN1_MB28_DATA2)
890#define bfin_write_CAN1_MB28_DATA2(val) bfin_write16(CAN1_MB28_DATA2, val)
891#define bfin_read_CAN1_MB28_DATA3() bfin_read16(CAN1_MB28_DATA3)
892#define bfin_write_CAN1_MB28_DATA3(val) bfin_write16(CAN1_MB28_DATA3, val)
893#define bfin_read_CAN1_MB28_LENGTH() bfin_read16(CAN1_MB28_LENGTH)
894#define bfin_write_CAN1_MB28_LENGTH(val) bfin_write16(CAN1_MB28_LENGTH, val)
895#define bfin_read_CAN1_MB28_TIMESTAMP() bfin_read16(CAN1_MB28_TIMESTAMP)
896#define bfin_write_CAN1_MB28_TIMESTAMP(val) bfin_write16(CAN1_MB28_TIMESTAMP, val)
897#define bfin_read_CAN1_MB28_ID0() bfin_read16(CAN1_MB28_ID0)
898#define bfin_write_CAN1_MB28_ID0(val) bfin_write16(CAN1_MB28_ID0, val)
899#define bfin_read_CAN1_MB28_ID1() bfin_read16(CAN1_MB28_ID1)
900#define bfin_write_CAN1_MB28_ID1(val) bfin_write16(CAN1_MB28_ID1, val)
901#define bfin_read_CAN1_MB29_DATA0() bfin_read16(CAN1_MB29_DATA0)
902#define bfin_write_CAN1_MB29_DATA0(val) bfin_write16(CAN1_MB29_DATA0, val)
903#define bfin_read_CAN1_MB29_DATA1() bfin_read16(CAN1_MB29_DATA1)
904#define bfin_write_CAN1_MB29_DATA1(val) bfin_write16(CAN1_MB29_DATA1, val)
905#define bfin_read_CAN1_MB29_DATA2() bfin_read16(CAN1_MB29_DATA2)
906#define bfin_write_CAN1_MB29_DATA2(val) bfin_write16(CAN1_MB29_DATA2, val)
907#define bfin_read_CAN1_MB29_DATA3() bfin_read16(CAN1_MB29_DATA3)
908#define bfin_write_CAN1_MB29_DATA3(val) bfin_write16(CAN1_MB29_DATA3, val)
909#define bfin_read_CAN1_MB29_LENGTH() bfin_read16(CAN1_MB29_LENGTH)
910#define bfin_write_CAN1_MB29_LENGTH(val) bfin_write16(CAN1_MB29_LENGTH, val)
911#define bfin_read_CAN1_MB29_TIMESTAMP() bfin_read16(CAN1_MB29_TIMESTAMP)
912#define bfin_write_CAN1_MB29_TIMESTAMP(val) bfin_write16(CAN1_MB29_TIMESTAMP, val)
913#define bfin_read_CAN1_MB29_ID0() bfin_read16(CAN1_MB29_ID0)
914#define bfin_write_CAN1_MB29_ID0(val) bfin_write16(CAN1_MB29_ID0, val)
915#define bfin_read_CAN1_MB29_ID1() bfin_read16(CAN1_MB29_ID1)
916#define bfin_write_CAN1_MB29_ID1(val) bfin_write16(CAN1_MB29_ID1, val)
917#define bfin_read_CAN1_MB30_DATA0() bfin_read16(CAN1_MB30_DATA0)
918#define bfin_write_CAN1_MB30_DATA0(val) bfin_write16(CAN1_MB30_DATA0, val)
919#define bfin_read_CAN1_MB30_DATA1() bfin_read16(CAN1_MB30_DATA1)
920#define bfin_write_CAN1_MB30_DATA1(val) bfin_write16(CAN1_MB30_DATA1, val)
921#define bfin_read_CAN1_MB30_DATA2() bfin_read16(CAN1_MB30_DATA2)
922#define bfin_write_CAN1_MB30_DATA2(val) bfin_write16(CAN1_MB30_DATA2, val)
923#define bfin_read_CAN1_MB30_DATA3() bfin_read16(CAN1_MB30_DATA3)
924#define bfin_write_CAN1_MB30_DATA3(val) bfin_write16(CAN1_MB30_DATA3, val)
925#define bfin_read_CAN1_MB30_LENGTH() bfin_read16(CAN1_MB30_LENGTH)
926#define bfin_write_CAN1_MB30_LENGTH(val) bfin_write16(CAN1_MB30_LENGTH, val)
927#define bfin_read_CAN1_MB30_TIMESTAMP() bfin_read16(CAN1_MB30_TIMESTAMP)
928#define bfin_write_CAN1_MB30_TIMESTAMP(val) bfin_write16(CAN1_MB30_TIMESTAMP, val)
929#define bfin_read_CAN1_MB30_ID0() bfin_read16(CAN1_MB30_ID0)
930#define bfin_write_CAN1_MB30_ID0(val) bfin_write16(CAN1_MB30_ID0, val)
931#define bfin_read_CAN1_MB30_ID1() bfin_read16(CAN1_MB30_ID1)
932#define bfin_write_CAN1_MB30_ID1(val) bfin_write16(CAN1_MB30_ID1, val)
933#define bfin_read_CAN1_MB31_DATA0() bfin_read16(CAN1_MB31_DATA0)
934#define bfin_write_CAN1_MB31_DATA0(val) bfin_write16(CAN1_MB31_DATA0, val)
935#define bfin_read_CAN1_MB31_DATA1() bfin_read16(CAN1_MB31_DATA1)
936#define bfin_write_CAN1_MB31_DATA1(val) bfin_write16(CAN1_MB31_DATA1, val)
937#define bfin_read_CAN1_MB31_DATA2() bfin_read16(CAN1_MB31_DATA2)
938#define bfin_write_CAN1_MB31_DATA2(val) bfin_write16(CAN1_MB31_DATA2, val)
939#define bfin_read_CAN1_MB31_DATA3() bfin_read16(CAN1_MB31_DATA3)
940#define bfin_write_CAN1_MB31_DATA3(val) bfin_write16(CAN1_MB31_DATA3, val)
941#define bfin_read_CAN1_MB31_LENGTH() bfin_read16(CAN1_MB31_LENGTH)
942#define bfin_write_CAN1_MB31_LENGTH(val) bfin_write16(CAN1_MB31_LENGTH, val)
943#define bfin_read_CAN1_MB31_TIMESTAMP() bfin_read16(CAN1_MB31_TIMESTAMP)
944#define bfin_write_CAN1_MB31_TIMESTAMP(val) bfin_write16(CAN1_MB31_TIMESTAMP, val)
945#define bfin_read_CAN1_MB31_ID0() bfin_read16(CAN1_MB31_ID0)
946#define bfin_write_CAN1_MB31_ID0(val) bfin_write16(CAN1_MB31_ID0, val)
947#define bfin_read_CAN1_MB31_ID1() bfin_read16(CAN1_MB31_ID1)
948#define bfin_write_CAN1_MB31_ID1(val) bfin_write16(CAN1_MB31_ID1, val)
949
950/* ATAPI Registers */
951
952#define bfin_read_ATAPI_CONTROL() bfin_read16(ATAPI_CONTROL)
953#define bfin_write_ATAPI_CONTROL(val) bfin_write16(ATAPI_CONTROL, val)
954#define bfin_read_ATAPI_STATUS() bfin_read16(ATAPI_STATUS)
955#define bfin_write_ATAPI_STATUS(val) bfin_write16(ATAPI_STATUS, val)
956#define bfin_read_ATAPI_DEV_ADDR() bfin_read16(ATAPI_DEV_ADDR)
957#define bfin_write_ATAPI_DEV_ADDR(val) bfin_write16(ATAPI_DEV_ADDR, val)
958#define bfin_read_ATAPI_DEV_TXBUF() bfin_read16(ATAPI_DEV_TXBUF)
959#define bfin_write_ATAPI_DEV_TXBUF(val) bfin_write16(ATAPI_DEV_TXBUF, val)
960#define bfin_read_ATAPI_DEV_RXBUF() bfin_read16(ATAPI_DEV_RXBUF)
961#define bfin_write_ATAPI_DEV_RXBUF(val) bfin_write16(ATAPI_DEV_RXBUF, val)
962#define bfin_read_ATAPI_INT_MASK() bfin_read16(ATAPI_INT_MASK)
963#define bfin_write_ATAPI_INT_MASK(val) bfin_write16(ATAPI_INT_MASK, val)
964#define bfin_read_ATAPI_INT_STATUS() bfin_read16(ATAPI_INT_STATUS)
965#define bfin_write_ATAPI_INT_STATUS(val) bfin_write16(ATAPI_INT_STATUS, val)
966#define bfin_read_ATAPI_XFER_LEN() bfin_read16(ATAPI_XFER_LEN)
967#define bfin_write_ATAPI_XFER_LEN(val) bfin_write16(ATAPI_XFER_LEN, val)
968#define bfin_read_ATAPI_LINE_STATUS() bfin_read16(ATAPI_LINE_STATUS)
969#define bfin_write_ATAPI_LINE_STATUS(val) bfin_write16(ATAPI_LINE_STATUS, val)
970#define bfin_read_ATAPI_SM_STATE() bfin_read16(ATAPI_SM_STATE)
971#define bfin_write_ATAPI_SM_STATE(val) bfin_write16(ATAPI_SM_STATE, val)
972#define bfin_read_ATAPI_TERMINATE() bfin_read16(ATAPI_TERMINATE)
973#define bfin_write_ATAPI_TERMINATE(val) bfin_write16(ATAPI_TERMINATE, val)
974#define bfin_read_ATAPI_PIO_TFRCNT() bfin_read16(ATAPI_PIO_TFRCNT)
975#define bfin_write_ATAPI_PIO_TFRCNT(val) bfin_write16(ATAPI_PIO_TFRCNT, val)
976#define bfin_read_ATAPI_DMA_TFRCNT() bfin_read16(ATAPI_DMA_TFRCNT)
977#define bfin_write_ATAPI_DMA_TFRCNT(val) bfin_write16(ATAPI_DMA_TFRCNT, val)
978#define bfin_read_ATAPI_UMAIN_TFRCNT() bfin_read16(ATAPI_UMAIN_TFRCNT)
979#define bfin_write_ATAPI_UMAIN_TFRCNT(val) bfin_write16(ATAPI_UMAIN_TFRCNT, val)
980#define bfin_read_ATAPI_UDMAOUT_TFRCNT() bfin_read16(ATAPI_UDMAOUT_TFRCNT)
981#define bfin_write_ATAPI_UDMAOUT_TFRCNT(val) bfin_write16(ATAPI_UDMAOUT_TFRCNT, val)
982#define bfin_read_ATAPI_REG_TIM_0() bfin_read16(ATAPI_REG_TIM_0)
983#define bfin_write_ATAPI_REG_TIM_0(val) bfin_write16(ATAPI_REG_TIM_0, val)
984#define bfin_read_ATAPI_PIO_TIM_0() bfin_read16(ATAPI_PIO_TIM_0)
985#define bfin_write_ATAPI_PIO_TIM_0(val) bfin_write16(ATAPI_PIO_TIM_0, val)
986#define bfin_read_ATAPI_PIO_TIM_1() bfin_read16(ATAPI_PIO_TIM_1)
987#define bfin_write_ATAPI_PIO_TIM_1(val) bfin_write16(ATAPI_PIO_TIM_1, val)
988#define bfin_read_ATAPI_MULTI_TIM_0() bfin_read16(ATAPI_MULTI_TIM_0)
989#define bfin_write_ATAPI_MULTI_TIM_0(val) bfin_write16(ATAPI_MULTI_TIM_0, val)
990#define bfin_read_ATAPI_MULTI_TIM_1() bfin_read16(ATAPI_MULTI_TIM_1)
991#define bfin_write_ATAPI_MULTI_TIM_1(val) bfin_write16(ATAPI_MULTI_TIM_1, val)
992#define bfin_read_ATAPI_MULTI_TIM_2() bfin_read16(ATAPI_MULTI_TIM_2)
993#define bfin_write_ATAPI_MULTI_TIM_2(val) bfin_write16(ATAPI_MULTI_TIM_2, val)
994#define bfin_read_ATAPI_ULTRA_TIM_0() bfin_read16(ATAPI_ULTRA_TIM_0)
995#define bfin_write_ATAPI_ULTRA_TIM_0(val) bfin_write16(ATAPI_ULTRA_TIM_0, val)
996#define bfin_read_ATAPI_ULTRA_TIM_1() bfin_read16(ATAPI_ULTRA_TIM_1)
997#define bfin_write_ATAPI_ULTRA_TIM_1(val) bfin_write16(ATAPI_ULTRA_TIM_1, val)
998#define bfin_read_ATAPI_ULTRA_TIM_2() bfin_read16(ATAPI_ULTRA_TIM_2)
999#define bfin_write_ATAPI_ULTRA_TIM_2(val) bfin_write16(ATAPI_ULTRA_TIM_2, val)
1000#define bfin_read_ATAPI_ULTRA_TIM_3() bfin_read16(ATAPI_ULTRA_TIM_3)
1001#define bfin_write_ATAPI_ULTRA_TIM_3(val) bfin_write16(ATAPI_ULTRA_TIM_3, val)
1002
1003/* SDH Registers */
1004
1005#define bfin_read_SDH_PWR_CTL() bfin_read16(SDH_PWR_CTL)
1006#define bfin_write_SDH_PWR_CTL(val) bfin_write16(SDH_PWR_CTL, val)
1007#define bfin_read_SDH_CLK_CTL() bfin_read16(SDH_CLK_CTL)
1008#define bfin_write_SDH_CLK_CTL(val) bfin_write16(SDH_CLK_CTL, val)
1009#define bfin_read_SDH_ARGUMENT() bfin_read32(SDH_ARGUMENT)
1010#define bfin_write_SDH_ARGUMENT(val) bfin_write32(SDH_ARGUMENT, val)
1011#define bfin_read_SDH_COMMAND() bfin_read16(SDH_COMMAND)
1012#define bfin_write_SDH_COMMAND(val) bfin_write16(SDH_COMMAND, val)
1013#define bfin_read_SDH_RESP_CMD() bfin_read16(SDH_RESP_CMD)
1014#define bfin_write_SDH_RESP_CMD(val) bfin_write16(SDH_RESP_CMD, val)
1015#define bfin_read_SDH_RESPONSE0() bfin_read32(SDH_RESPONSE0)
1016#define bfin_write_SDH_RESPONSE0(val) bfin_write32(SDH_RESPONSE0, val)
1017#define bfin_read_SDH_RESPONSE1() bfin_read32(SDH_RESPONSE1)
1018#define bfin_write_SDH_RESPONSE1(val) bfin_write32(SDH_RESPONSE1, val)
1019#define bfin_read_SDH_RESPONSE2() bfin_read32(SDH_RESPONSE2)
1020#define bfin_write_SDH_RESPONSE2(val) bfin_write32(SDH_RESPONSE2, val)
1021#define bfin_read_SDH_RESPONSE3() bfin_read32(SDH_RESPONSE3)
1022#define bfin_write_SDH_RESPONSE3(val) bfin_write32(SDH_RESPONSE3, val)
1023#define bfin_read_SDH_DATA_TIMER() bfin_read32(SDH_DATA_TIMER)
1024#define bfin_write_SDH_DATA_TIMER(val) bfin_write32(SDH_DATA_TIMER, val)
1025#define bfin_read_SDH_DATA_LGTH() bfin_read16(SDH_DATA_LGTH)
1026#define bfin_write_SDH_DATA_LGTH(val) bfin_write16(SDH_DATA_LGTH, val)
1027#define bfin_read_SDH_DATA_CTL() bfin_read16(SDH_DATA_CTL)
1028#define bfin_write_SDH_DATA_CTL(val) bfin_write16(SDH_DATA_CTL, val)
1029#define bfin_read_SDH_DATA_CNT() bfin_read16(SDH_DATA_CNT)
1030#define bfin_write_SDH_DATA_CNT(val) bfin_write16(SDH_DATA_CNT, val)
1031#define bfin_read_SDH_STATUS() bfin_read32(SDH_STATUS)
1032#define bfin_write_SDH_STATUS(val) bfin_write32(SDH_STATUS, val)
1033#define bfin_read_SDH_STATUS_CLR() bfin_read16(SDH_STATUS_CLR)
1034#define bfin_write_SDH_STATUS_CLR(val) bfin_write16(SDH_STATUS_CLR, val)
1035#define bfin_read_SDH_MASK0() bfin_read32(SDH_MASK0)
1036#define bfin_write_SDH_MASK0(val) bfin_write32(SDH_MASK0, val)
1037#define bfin_read_SDH_MASK1() bfin_read32(SDH_MASK1)
1038#define bfin_write_SDH_MASK1(val) bfin_write32(SDH_MASK1, val)
1039#define bfin_read_SDH_FIFO_CNT() bfin_read16(SDH_FIFO_CNT)
1040#define bfin_write_SDH_FIFO_CNT(val) bfin_write16(SDH_FIFO_CNT, val)
1041#define bfin_read_SDH_FIFO() bfin_read32(SDH_FIFO)
1042#define bfin_write_SDH_FIFO(val) bfin_write32(SDH_FIFO, val)
1043#define bfin_read_SDH_E_STATUS() bfin_read16(SDH_E_STATUS)
1044#define bfin_write_SDH_E_STATUS(val) bfin_write16(SDH_E_STATUS, val)
1045#define bfin_read_SDH_E_MASK() bfin_read16(SDH_E_MASK)
1046#define bfin_write_SDH_E_MASK(val) bfin_write16(SDH_E_MASK, val)
1047#define bfin_read_SDH_CFG() bfin_read16(SDH_CFG)
1048#define bfin_write_SDH_CFG(val) bfin_write16(SDH_CFG, val)
1049#define bfin_read_SDH_RD_WAIT_EN() bfin_read16(SDH_RD_WAIT_EN)
1050#define bfin_write_SDH_RD_WAIT_EN(val) bfin_write16(SDH_RD_WAIT_EN, val)
1051#define bfin_read_SDH_PID0() bfin_read16(SDH_PID0)
1052#define bfin_write_SDH_PID0(val) bfin_write16(SDH_PID0, val)
1053#define bfin_read_SDH_PID1() bfin_read16(SDH_PID1)
1054#define bfin_write_SDH_PID1(val) bfin_write16(SDH_PID1, val)
1055#define bfin_read_SDH_PID2() bfin_read16(SDH_PID2)
1056#define bfin_write_SDH_PID2(val) bfin_write16(SDH_PID2, val)
1057#define bfin_read_SDH_PID3() bfin_read16(SDH_PID3)
1058#define bfin_write_SDH_PID3(val) bfin_write16(SDH_PID3, val)
1059#define bfin_read_SDH_PID4() bfin_read16(SDH_PID4)
1060#define bfin_write_SDH_PID4(val) bfin_write16(SDH_PID4, val)
1061#define bfin_read_SDH_PID5() bfin_read16(SDH_PID5)
1062#define bfin_write_SDH_PID5(val) bfin_write16(SDH_PID5, val)
1063#define bfin_read_SDH_PID6() bfin_read16(SDH_PID6)
1064#define bfin_write_SDH_PID6(val) bfin_write16(SDH_PID6, val)
1065#define bfin_read_SDH_PID7() bfin_read16(SDH_PID7)
1066#define bfin_write_SDH_PID7(val) bfin_write16(SDH_PID7, val)
1067
1068/* HOST Port Registers */
1069
1070#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
1071#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
1072#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
1073#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
1074#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
1075#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
1076
1077/* USB Control Registers */
1078
1079#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
1080#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
1081#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
1082#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
1083#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
1084#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
1085#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
1086#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
1087#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
1088#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
1089#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
1090#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
1091#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
1092#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
1093#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
1094#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
1095#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
1096#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
1097#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
1098#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
1099#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
1100#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
1101#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
1102#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
1103#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
1104#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
1105
1106/* USB Packet Control Registers */
1107
1108#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
1109#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
1110#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
1111#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
1112#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
1113#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
1114#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
1115#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
1116#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
1117#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
1118#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
1119#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
1120#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
1121#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
1122#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
1123#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
1124#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
1125#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
1126#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
1127#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
1128#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
1129#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
1130#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
1131#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
1132#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
1133#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
1134
1135/* USB Endbfin_read_()oint FIFO Registers */
1136
1137#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
1138#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
1139#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
1140#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
1141#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
1142#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
1143#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
1144#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
1145#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
1146#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
1147#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
1148#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
1149#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
1150#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
1151#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
1152#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
1153
1154/* USB OTG Control Registers */
1155
1156#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
1157#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
1158#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
1159#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
1160#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
1161#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
1162
1163/* USB Phy Control Registers */
1164
1165#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
1166#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
1167#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
1168#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
1169#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
1170#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
1171#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
1172#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
1173#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
1174#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
1175
1176/* (APHY_CNTRL is for ADI usage only) */
1177
1178#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
1179#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
1180
1181/* (APHY_CALIB is for ADI usage only) */
1182
1183#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
1184#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
1185#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
1186#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
1187
1188/* (PHY_TEST is for ADI usage only) */
1189
1190#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
1191#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
1192#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
1193#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
1194#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
1195#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
1196
1197/* USB Endbfin_read_()oint 0 Control Registers */
1198
1199#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
1200#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
1201#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
1202#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
1203#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
1204#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
1205#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
1206#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
1207#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
1208#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
1209#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
1210#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
1211#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
1212#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
1213#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
1214#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
1215#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
1216#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
1217
1218/* USB Endbfin_read_()oint 1 Control Registers */
1219
1220#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
1221#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
1222#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
1223#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
1224#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
1225#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
1226#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
1227#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
1228#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
1229#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
1230#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
1231#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
1232#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
1233#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
1234#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
1235#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
1236#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
1237#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
1238#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
1239#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
1240
1241/* USB Endbfin_read_()oint 2 Control Registers */
1242
1243#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
1244#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
1245#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
1246#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
1247#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
1248#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
1249#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
1250#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
1251#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
1252#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
1253#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
1254#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
1255#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
1256#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
1257#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
1258#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
1259#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
1260#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
1261#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
1262#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
1263
1264/* USB Endbfin_read_()oint 3 Control Registers */
1265
1266#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
1267#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
1268#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
1269#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
1270#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
1271#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
1272#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
1273#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
1274#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
1275#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
1276#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
1277#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
1278#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
1279#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
1280#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
1281#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
1282#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
1283#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
1284#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
1285#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
1286
1287/* USB Endbfin_read_()oint 4 Control Registers */
1288
1289#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
1290#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
1291#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
1292#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
1293#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
1294#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
1295#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
1296#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
1297#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
1298#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
1299#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
1300#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
1301#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
1302#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
1303#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
1304#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
1305#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
1306#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
1307#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
1308#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
1309
1310/* USB Endbfin_read_()oint 5 Control Registers */
1311
1312#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
1313#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
1314#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
1315#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
1316#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
1317#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
1318#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
1319#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
1320#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
1321#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
1322#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
1323#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
1324#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
1325#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
1326#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
1327#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
1328#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
1329#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
1330#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
1331#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
1332
1333/* USB Endbfin_read_()oint 6 Control Registers */
1334
1335#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
1336#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
1337#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
1338#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
1339#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
1340#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
1341#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
1342#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
1343#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
1344#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
1345#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
1346#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
1347#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
1348#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
1349#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
1350#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
1351#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
1352#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
1353#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
1354#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
1355
1356/* USB Endbfin_read_()oint 7 Control Registers */
1357
1358#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
1359#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
1360#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
1361#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
1362#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
1363#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
1364#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
1365#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
1366#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
1367#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
1368#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
1369#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
1370#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
1371#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
1372#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
1373#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
1374#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
1375#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
1376#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
1377#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
1378#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
1379#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
1380#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
1381#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
1382
1383/* USB Channel 0 Config Registers */
1384
1385#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
1386#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
1387#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
1388#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
1389#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
1390#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
1391#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
1392#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
1393#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
1394#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
1395
1396/* USB Channel 1 Config Registers */
1397
1398#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
1399#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
1400#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
1401#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
1402#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
1403#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
1404#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
1405#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
1406#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
1407#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
1408
1409/* USB Channel 2 Config Registers */
1410
1411#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
1412#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
1413#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
1414#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
1415#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
1416#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
1417#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
1418#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
1419#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
1420#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
1421
1422/* USB Channel 3 Config Registers */
1423
1424#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
1425#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
1426#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
1427#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
1428#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
1429#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
1430#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
1431#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
1432#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
1433#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
1434
1435/* USB Channel 4 Config Registers */
1436
1437#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
1438#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
1439#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
1440#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
1441#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
1442#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
1443#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
1444#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
1445#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
1446#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
1447
1448/* USB Channel 5 Config Registers */
1449
1450#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
1451#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
1452#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
1453#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
1454#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
1455#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
1456#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
1457#define bfin_write_USB_DMA5COUNTLOW(val) bfin_write16(USB_DMA5COUNTLOW, val)
1458#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
1459#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
1460
1461/* USB Channel 6 Config Registers */
1462
1463#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
1464#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
1465#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
1466#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
1467#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
1468#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
1469#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
1470#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
1471#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
1472#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
1473
1474/* USB Channel 7 Config Registers */
1475
1476#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
1477#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
1478#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
1479#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
1480#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
1481#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
1482#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
1483#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
1484#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
1485#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
1486
1487/* Keybfin_read_()ad Registers */
1488
1489#define bfin_read_KPAD_CTL() bfin_read16(KPAD_CTL)
1490#define bfin_write_KPAD_CTL(val) bfin_write16(KPAD_CTL, val)
1491#define bfin_read_KPAD_PRESCALE() bfin_read16(KPAD_PRESCALE)
1492#define bfin_write_KPAD_PRESCALE(val) bfin_write16(KPAD_PRESCALE, val)
1493#define bfin_read_KPAD_MSEL() bfin_read16(KPAD_MSEL)
1494#define bfin_write_KPAD_MSEL(val) bfin_write16(KPAD_MSEL, val)
1495#define bfin_read_KPAD_ROWCOL() bfin_read16(KPAD_ROWCOL)
1496#define bfin_write_KPAD_ROWCOL(val) bfin_write16(KPAD_ROWCOL, val)
1497#define bfin_read_KPAD_STAT() bfin_read16(KPAD_STAT)
1498#define bfin_write_KPAD_STAT(val) bfin_write16(KPAD_STAT, val)
1499#define bfin_read_KPAD_SOFTEVAL() bfin_read16(KPAD_SOFTEVAL)
1500#define bfin_write_KPAD_SOFTEVAL(val) bfin_write16(KPAD_SOFTEVAL, val)
1501
1502/* Pixel Combfin_read_()ositor (PIXC) Registers */
1503
1504#define bfin_read_PIXC_CTL() bfin_read16(PIXC_CTL)
1505#define bfin_write_PIXC_CTL(val) bfin_write16(PIXC_CTL, val)
1506#define bfin_read_PIXC_PPL() bfin_read16(PIXC_PPL)
1507#define bfin_write_PIXC_PPL(val) bfin_write16(PIXC_PPL, val)
1508#define bfin_read_PIXC_LPF() bfin_read16(PIXC_LPF)
1509#define bfin_write_PIXC_LPF(val) bfin_write16(PIXC_LPF, val)
1510#define bfin_read_PIXC_AHSTART() bfin_read16(PIXC_AHSTART)
1511#define bfin_write_PIXC_AHSTART(val) bfin_write16(PIXC_AHSTART, val)
1512#define bfin_read_PIXC_AHEND() bfin_read16(PIXC_AHEND)
1513#define bfin_write_PIXC_AHEND(val) bfin_write16(PIXC_AHEND, val)
1514#define bfin_read_PIXC_AVSTART() bfin_read16(PIXC_AVSTART)
1515#define bfin_write_PIXC_AVSTART(val) bfin_write16(PIXC_AVSTART, val)
1516#define bfin_read_PIXC_AVEND() bfin_read16(PIXC_AVEND)
1517#define bfin_write_PIXC_AVEND(val) bfin_write16(PIXC_AVEND, val)
1518#define bfin_read_PIXC_ATRANSP() bfin_read16(PIXC_ATRANSP)
1519#define bfin_write_PIXC_ATRANSP(val) bfin_write16(PIXC_ATRANSP, val)
1520#define bfin_read_PIXC_BHSTART() bfin_read16(PIXC_BHSTART)
1521#define bfin_write_PIXC_BHSTART(val) bfin_write16(PIXC_BHSTART, val)
1522#define bfin_read_PIXC_BHEND() bfin_read16(PIXC_BHEND)
1523#define bfin_write_PIXC_BHEND(val) bfin_write16(PIXC_BHEND, val)
1524#define bfin_read_PIXC_BVSTART() bfin_read16(PIXC_BVSTART)
1525#define bfin_write_PIXC_BVSTART(val) bfin_write16(PIXC_BVSTART, val)
1526#define bfin_read_PIXC_BVEND() bfin_read16(PIXC_BVEND)
1527#define bfin_write_PIXC_BVEND(val) bfin_write16(PIXC_BVEND, val)
1528#define bfin_read_PIXC_BTRANSP() bfin_read16(PIXC_BTRANSP)
1529#define bfin_write_PIXC_BTRANSP(val) bfin_write16(PIXC_BTRANSP, val)
1530#define bfin_read_PIXC_INTRSTAT() bfin_read16(PIXC_INTRSTAT)
1531#define bfin_write_PIXC_INTRSTAT(val) bfin_write16(PIXC_INTRSTAT, val)
1532#define bfin_read_PIXC_RYCON() bfin_read32(PIXC_RYCON)
1533#define bfin_write_PIXC_RYCON(val) bfin_write32(PIXC_RYCON, val)
1534#define bfin_read_PIXC_GUCON() bfin_read32(PIXC_GUCON)
1535#define bfin_write_PIXC_GUCON(val) bfin_write32(PIXC_GUCON, val)
1536#define bfin_read_PIXC_BVCON() bfin_read32(PIXC_BVCON)
1537#define bfin_write_PIXC_BVCON(val) bfin_write32(PIXC_BVCON, val)
1538#define bfin_read_PIXC_CCBIAS() bfin_read32(PIXC_CCBIAS)
1539#define bfin_write_PIXC_CCBIAS(val) bfin_write32(PIXC_CCBIAS, val)
1540#define bfin_read_PIXC_TC() bfin_read32(PIXC_TC)
1541#define bfin_write_PIXC_TC(val) bfin_write32(PIXC_TC, val)
1542
1543/* Handshake MDMA 0 Registers */
1544
1545#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1546#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
1547#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1548#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
1549#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1550#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
1551#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1552#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
1553#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1554#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
1555#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1556#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
1557#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1558#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
1559
1560/* Handshake MDMA 1 Registers */
1561
1562#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1563#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
1564#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1565#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
1566#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1567#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
1568#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1569#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
1570#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1571#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
1572#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1573#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
1574#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1575#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
1576
1577#endif /* _CDEF_BF548_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF549.h b/include/asm-blackfin/mach-bf548/cdefBF549.h
deleted file mode 100644
index 92d07d961999..000000000000
--- a/include/asm-blackfin/mach-bf548/cdefBF549.h
+++ /dev/null
@@ -1,1863 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf549/cdefBF549.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_BF549_H
32#define _CDEF_BF549_H
33
34/* include all Core registers and bit definitions */
35#include "defBF549.h"
36
37/* include core sbfin_read_()ecific register pointer definitions */
38#include <asm/mach-common/cdef_LPBlackfin.h>
39
40/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF549 */
41
42/* include cdefBF54x_base.h for the set of #defines that are common to all ADSP-BF54x bfin_read_()rocessors */
43#include "cdefBF54x_base.h"
44
45/* The following are the #defines needed by ADSP-BF549 that are not in the common header */
46
47/* Timer Registers */
48
49#define bfin_read_TIMER8_CONFIG() bfin_read16(TIMER8_CONFIG)
50#define bfin_write_TIMER8_CONFIG(val) bfin_write16(TIMER8_CONFIG, val)
51#define bfin_read_TIMER8_COUNTER() bfin_read32(TIMER8_COUNTER)
52#define bfin_write_TIMER8_COUNTER(val) bfin_write32(TIMER8_COUNTER, val)
53#define bfin_read_TIMER8_PERIOD() bfin_read32(TIMER8_PERIOD)
54#define bfin_write_TIMER8_PERIOD(val) bfin_write32(TIMER8_PERIOD, val)
55#define bfin_read_TIMER8_WIDTH() bfin_read32(TIMER8_WIDTH)
56#define bfin_write_TIMER8_WIDTH(val) bfin_write32(TIMER8_WIDTH, val)
57#define bfin_read_TIMER9_CONFIG() bfin_read16(TIMER9_CONFIG)
58#define bfin_write_TIMER9_CONFIG(val) bfin_write16(TIMER9_CONFIG, val)
59#define bfin_read_TIMER9_COUNTER() bfin_read32(TIMER9_COUNTER)
60#define bfin_write_TIMER9_COUNTER(val) bfin_write32(TIMER9_COUNTER, val)
61#define bfin_read_TIMER9_PERIOD() bfin_read32(TIMER9_PERIOD)
62#define bfin_write_TIMER9_PERIOD(val) bfin_write32(TIMER9_PERIOD, val)
63#define bfin_read_TIMER9_WIDTH() bfin_read32(TIMER9_WIDTH)
64#define bfin_write_TIMER9_WIDTH(val) bfin_write32(TIMER9_WIDTH, val)
65#define bfin_read_TIMER10_CONFIG() bfin_read16(TIMER10_CONFIG)
66#define bfin_write_TIMER10_CONFIG(val) bfin_write16(TIMER10_CONFIG, val)
67#define bfin_read_TIMER10_COUNTER() bfin_read32(TIMER10_COUNTER)
68#define bfin_write_TIMER10_COUNTER(val) bfin_write32(TIMER10_COUNTER, val)
69#define bfin_read_TIMER10_PERIOD() bfin_read32(TIMER10_PERIOD)
70#define bfin_write_TIMER10_PERIOD(val) bfin_write32(TIMER10_PERIOD, val)
71#define bfin_read_TIMER10_WIDTH() bfin_read32(TIMER10_WIDTH)
72#define bfin_write_TIMER10_WIDTH(val) bfin_write32(TIMER10_WIDTH, val)
73
74/* Timer Groubfin_read_() of 3 */
75
76#define bfin_read_TIMER_ENABLE1() bfin_read16(TIMER_ENABLE1)
77#define bfin_write_TIMER_ENABLE1(val) bfin_write16(TIMER_ENABLE1, val)
78#define bfin_read_TIMER_DISABLE1() bfin_read16(TIMER_DISABLE1)
79#define bfin_write_TIMER_DISABLE1(val) bfin_write16(TIMER_DISABLE1, val)
80#define bfin_read_TIMER_STATUS1() bfin_read32(TIMER_STATUS1)
81#define bfin_write_TIMER_STATUS1(val) bfin_write32(TIMER_STATUS1, val)
82
83/* SPORT0 Registers */
84
85#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
86#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
87#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
88#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
89#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
90#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
91#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
92#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
93#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
94#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
95#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
96#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
97#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
98#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
99#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
100#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
101#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
102#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
103#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
104#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
105#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
106#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
107#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
108#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
109#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
110#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
111#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
112#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
113#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
114#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
115#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
116#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
117#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
118#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
119#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
120#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
121#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
122#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
123#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
124#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
125#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
126#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
127#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
128#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
129
130/* EPPI0 Registers */
131
132#define bfin_read_EPPI0_STATUS() bfin_read16(EPPI0_STATUS)
133#define bfin_write_EPPI0_STATUS(val) bfin_write16(EPPI0_STATUS, val)
134#define bfin_read_EPPI0_HCOUNT() bfin_read16(EPPI0_HCOUNT)
135#define bfin_write_EPPI0_HCOUNT(val) bfin_write16(EPPI0_HCOUNT, val)
136#define bfin_read_EPPI0_HDELAY() bfin_read16(EPPI0_HDELAY)
137#define bfin_write_EPPI0_HDELAY(val) bfin_write16(EPPI0_HDELAY, val)
138#define bfin_read_EPPI0_VCOUNT() bfin_read16(EPPI0_VCOUNT)
139#define bfin_write_EPPI0_VCOUNT(val) bfin_write16(EPPI0_VCOUNT, val)
140#define bfin_read_EPPI0_VDELAY() bfin_read16(EPPI0_VDELAY)
141#define bfin_write_EPPI0_VDELAY(val) bfin_write16(EPPI0_VDELAY, val)
142#define bfin_read_EPPI0_FRAME() bfin_read16(EPPI0_FRAME)
143#define bfin_write_EPPI0_FRAME(val) bfin_write16(EPPI0_FRAME, val)
144#define bfin_read_EPPI0_LINE() bfin_read16(EPPI0_LINE)
145#define bfin_write_EPPI0_LINE(val) bfin_write16(EPPI0_LINE, val)
146#define bfin_read_EPPI0_CLKDIV() bfin_read16(EPPI0_CLKDIV)
147#define bfin_write_EPPI0_CLKDIV(val) bfin_write16(EPPI0_CLKDIV, val)
148#define bfin_read_EPPI0_CONTROL() bfin_read32(EPPI0_CONTROL)
149#define bfin_write_EPPI0_CONTROL(val) bfin_write32(EPPI0_CONTROL, val)
150#define bfin_read_EPPI0_FS1W_HBL() bfin_read32(EPPI0_FS1W_HBL)
151#define bfin_write_EPPI0_FS1W_HBL(val) bfin_write32(EPPI0_FS1W_HBL, val)
152#define bfin_read_EPPI0_FS1P_AVPL() bfin_read32(EPPI0_FS1P_AVPL)
153#define bfin_write_EPPI0_FS1P_AVPL(val) bfin_write32(EPPI0_FS1P_AVPL, val)
154#define bfin_read_EPPI0_FS2W_LVB() bfin_read32(EPPI0_FS2W_LVB)
155#define bfin_write_EPPI0_FS2W_LVB(val) bfin_write32(EPPI0_FS2W_LVB, val)
156#define bfin_read_EPPI0_FS2P_LAVF() bfin_read32(EPPI0_FS2P_LAVF)
157#define bfin_write_EPPI0_FS2P_LAVF(val) bfin_write32(EPPI0_FS2P_LAVF, val)
158#define bfin_read_EPPI0_CLIP() bfin_read32(EPPI0_CLIP)
159#define bfin_write_EPPI0_CLIP(val) bfin_write32(EPPI0_CLIP, val)
160
161/* UART2 Registers */
162
163#define bfin_read_UART2_DLL() bfin_read16(UART2_DLL)
164#define bfin_write_UART2_DLL(val) bfin_write16(UART2_DLL, val)
165#define bfin_read_UART2_DLH() bfin_read16(UART2_DLH)
166#define bfin_write_UART2_DLH(val) bfin_write16(UART2_DLH, val)
167#define bfin_read_UART2_GCTL() bfin_read16(UART2_GCTL)
168#define bfin_write_UART2_GCTL(val) bfin_write16(UART2_GCTL, val)
169#define bfin_read_UART2_LCR() bfin_read16(UART2_LCR)
170#define bfin_write_UART2_LCR(val) bfin_write16(UART2_LCR, val)
171#define bfin_read_UART2_MCR() bfin_read16(UART2_MCR)
172#define bfin_write_UART2_MCR(val) bfin_write16(UART2_MCR, val)
173#define bfin_read_UART2_LSR() bfin_read16(UART2_LSR)
174#define bfin_write_UART2_LSR(val) bfin_write16(UART2_LSR, val)
175#define bfin_read_UART2_MSR() bfin_read16(UART2_MSR)
176#define bfin_write_UART2_MSR(val) bfin_write16(UART2_MSR, val)
177#define bfin_read_UART2_SCR() bfin_read16(UART2_SCR)
178#define bfin_write_UART2_SCR(val) bfin_write16(UART2_SCR, val)
179#define bfin_read_UART2_IER_SET() bfin_read16(UART2_IER_SET)
180#define bfin_write_UART2_IER_SET(val) bfin_write16(UART2_IER_SET, val)
181#define bfin_read_UART2_IER_CLEAR() bfin_read16(UART2_IER_CLEAR)
182#define bfin_write_UART2_IER_CLEAR(val) bfin_write16(UART2_IER_CLEAR, val)
183#define bfin_read_UART2_RBR() bfin_read16(UART2_RBR)
184#define bfin_write_UART2_RBR(val) bfin_write16(UART2_RBR, val)
185
186/* Two Wire Interface Registers (TWI1) */
187
188/* SPI2 Registers */
189
190#define bfin_read_SPI2_CTL() bfin_read16(SPI2_CTL)
191#define bfin_write_SPI2_CTL(val) bfin_write16(SPI2_CTL, val)
192#define bfin_read_SPI2_FLG() bfin_read16(SPI2_FLG)
193#define bfin_write_SPI2_FLG(val) bfin_write16(SPI2_FLG, val)
194#define bfin_read_SPI2_STAT() bfin_read16(SPI2_STAT)
195#define bfin_write_SPI2_STAT(val) bfin_write16(SPI2_STAT, val)
196#define bfin_read_SPI2_TDBR() bfin_read16(SPI2_TDBR)
197#define bfin_write_SPI2_TDBR(val) bfin_write16(SPI2_TDBR, val)
198#define bfin_read_SPI2_RDBR() bfin_read16(SPI2_RDBR)
199#define bfin_write_SPI2_RDBR(val) bfin_write16(SPI2_RDBR, val)
200#define bfin_read_SPI2_BAUD() bfin_read16(SPI2_BAUD)
201#define bfin_write_SPI2_BAUD(val) bfin_write16(SPI2_BAUD, val)
202#define bfin_read_SPI2_SHADOW() bfin_read16(SPI2_SHADOW)
203#define bfin_write_SPI2_SHADOW(val) bfin_write16(SPI2_SHADOW, val)
204
205/* MXVR Registers */
206
207#define bfin_read_MXVR_CONFIG() bfin_read16(MXVR_CONFIG)
208#define bfin_write_MXVR_CONFIG(val) bfin_write16(MXVR_CONFIG, val)
209#define bfin_read_MXVR_STATE_0() bfin_read32(MXVR_STATE_0)
210#define bfin_write_MXVR_STATE_0(val) bfin_write32(MXVR_STATE_0, val)
211#define bfin_read_MXVR_STATE_1() bfin_read32(MXVR_STATE_1)
212#define bfin_write_MXVR_STATE_1(val) bfin_write32(MXVR_STATE_1, val)
213#define bfin_read_MXVR_INT_STAT_0() bfin_read32(MXVR_INT_STAT_0)
214#define bfin_write_MXVR_INT_STAT_0(val) bfin_write32(MXVR_INT_STAT_0, val)
215#define bfin_read_MXVR_INT_STAT_1() bfin_read32(MXVR_INT_STAT_1)
216#define bfin_write_MXVR_INT_STAT_1(val) bfin_write32(MXVR_INT_STAT_1, val)
217#define bfin_read_MXVR_INT_EN_0() bfin_read32(MXVR_INT_EN_0)
218#define bfin_write_MXVR_INT_EN_0(val) bfin_write32(MXVR_INT_EN_0, val)
219#define bfin_read_MXVR_INT_EN_1() bfin_read32(MXVR_INT_EN_1)
220#define bfin_write_MXVR_INT_EN_1(val) bfin_write32(MXVR_INT_EN_1, val)
221#define bfin_read_MXVR_POSITION() bfin_read16(MXVR_POSITION)
222#define bfin_write_MXVR_POSITION(val) bfin_write16(MXVR_POSITION, val)
223#define bfin_read_MXVR_MAX_POSITION() bfin_read16(MXVR_MAX_POSITION)
224#define bfin_write_MXVR_MAX_POSITION(val) bfin_write16(MXVR_MAX_POSITION, val)
225#define bfin_read_MXVR_DELAY() bfin_read16(MXVR_DELAY)
226#define bfin_write_MXVR_DELAY(val) bfin_write16(MXVR_DELAY, val)
227#define bfin_read_MXVR_MAX_DELAY() bfin_read16(MXVR_MAX_DELAY)
228#define bfin_write_MXVR_MAX_DELAY(val) bfin_write16(MXVR_MAX_DELAY, val)
229#define bfin_read_MXVR_LADDR() bfin_read32(MXVR_LADDR)
230#define bfin_write_MXVR_LADDR(val) bfin_write32(MXVR_LADDR, val)
231#define bfin_read_MXVR_GADDR() bfin_read16(MXVR_GADDR)
232#define bfin_write_MXVR_GADDR(val) bfin_write16(MXVR_GADDR, val)
233#define bfin_read_MXVR_AADDR() bfin_read32(MXVR_AADDR)
234#define bfin_write_MXVR_AADDR(val) bfin_write32(MXVR_AADDR, val)
235
236/* MXVR Allocation Table Registers */
237
238#define bfin_read_MXVR_ALLOC_0() bfin_read32(MXVR_ALLOC_0)
239#define bfin_write_MXVR_ALLOC_0(val) bfin_write32(MXVR_ALLOC_0, val)
240#define bfin_read_MXVR_ALLOC_1() bfin_read32(MXVR_ALLOC_1)
241#define bfin_write_MXVR_ALLOC_1(val) bfin_write32(MXVR_ALLOC_1, val)
242#define bfin_read_MXVR_ALLOC_2() bfin_read32(MXVR_ALLOC_2)
243#define bfin_write_MXVR_ALLOC_2(val) bfin_write32(MXVR_ALLOC_2, val)
244#define bfin_read_MXVR_ALLOC_3() bfin_read32(MXVR_ALLOC_3)
245#define bfin_write_MXVR_ALLOC_3(val) bfin_write32(MXVR_ALLOC_3, val)
246#define bfin_read_MXVR_ALLOC_4() bfin_read32(MXVR_ALLOC_4)
247#define bfin_write_MXVR_ALLOC_4(val) bfin_write32(MXVR_ALLOC_4, val)
248#define bfin_read_MXVR_ALLOC_5() bfin_read32(MXVR_ALLOC_5)
249#define bfin_write_MXVR_ALLOC_5(val) bfin_write32(MXVR_ALLOC_5, val)
250#define bfin_read_MXVR_ALLOC_6() bfin_read32(MXVR_ALLOC_6)
251#define bfin_write_MXVR_ALLOC_6(val) bfin_write32(MXVR_ALLOC_6, val)
252#define bfin_read_MXVR_ALLOC_7() bfin_read32(MXVR_ALLOC_7)
253#define bfin_write_MXVR_ALLOC_7(val) bfin_write32(MXVR_ALLOC_7, val)
254#define bfin_read_MXVR_ALLOC_8() bfin_read32(MXVR_ALLOC_8)
255#define bfin_write_MXVR_ALLOC_8(val) bfin_write32(MXVR_ALLOC_8, val)
256#define bfin_read_MXVR_ALLOC_9() bfin_read32(MXVR_ALLOC_9)
257#define bfin_write_MXVR_ALLOC_9(val) bfin_write32(MXVR_ALLOC_9, val)
258#define bfin_read_MXVR_ALLOC_10() bfin_read32(MXVR_ALLOC_10)
259#define bfin_write_MXVR_ALLOC_10(val) bfin_write32(MXVR_ALLOC_10, val)
260#define bfin_read_MXVR_ALLOC_11() bfin_read32(MXVR_ALLOC_11)
261#define bfin_write_MXVR_ALLOC_11(val) bfin_write32(MXVR_ALLOC_11, val)
262#define bfin_read_MXVR_ALLOC_12() bfin_read32(MXVR_ALLOC_12)
263#define bfin_write_MXVR_ALLOC_12(val) bfin_write32(MXVR_ALLOC_12, val)
264#define bfin_read_MXVR_ALLOC_13() bfin_read32(MXVR_ALLOC_13)
265#define bfin_write_MXVR_ALLOC_13(val) bfin_write32(MXVR_ALLOC_13, val)
266#define bfin_read_MXVR_ALLOC_14() bfin_read32(MXVR_ALLOC_14)
267#define bfin_write_MXVR_ALLOC_14(val) bfin_write32(MXVR_ALLOC_14, val)
268
269/* MXVR Channel Assign Registers */
270
271#define bfin_read_MXVR_SYNC_LCHAN_0() bfin_read32(MXVR_SYNC_LCHAN_0)
272#define bfin_write_MXVR_SYNC_LCHAN_0(val) bfin_write32(MXVR_SYNC_LCHAN_0, val)
273#define bfin_read_MXVR_SYNC_LCHAN_1() bfin_read32(MXVR_SYNC_LCHAN_1)
274#define bfin_write_MXVR_SYNC_LCHAN_1(val) bfin_write32(MXVR_SYNC_LCHAN_1, val)
275#define bfin_read_MXVR_SYNC_LCHAN_2() bfin_read32(MXVR_SYNC_LCHAN_2)
276#define bfin_write_MXVR_SYNC_LCHAN_2(val) bfin_write32(MXVR_SYNC_LCHAN_2, val)
277#define bfin_read_MXVR_SYNC_LCHAN_3() bfin_read32(MXVR_SYNC_LCHAN_3)
278#define bfin_write_MXVR_SYNC_LCHAN_3(val) bfin_write32(MXVR_SYNC_LCHAN_3, val)
279#define bfin_read_MXVR_SYNC_LCHAN_4() bfin_read32(MXVR_SYNC_LCHAN_4)
280#define bfin_write_MXVR_SYNC_LCHAN_4(val) bfin_write32(MXVR_SYNC_LCHAN_4, val)
281#define bfin_read_MXVR_SYNC_LCHAN_5() bfin_read32(MXVR_SYNC_LCHAN_5)
282#define bfin_write_MXVR_SYNC_LCHAN_5(val) bfin_write32(MXVR_SYNC_LCHAN_5, val)
283#define bfin_read_MXVR_SYNC_LCHAN_6() bfin_read32(MXVR_SYNC_LCHAN_6)
284#define bfin_write_MXVR_SYNC_LCHAN_6(val) bfin_write32(MXVR_SYNC_LCHAN_6, val)
285#define bfin_read_MXVR_SYNC_LCHAN_7() bfin_read32(MXVR_SYNC_LCHAN_7)
286#define bfin_write_MXVR_SYNC_LCHAN_7(val) bfin_write32(MXVR_SYNC_LCHAN_7, val)
287
288/* MXVR DMA0 Registers */
289
290#define bfin_read_MXVR_DMA0_CONFIG() bfin_read32(MXVR_DMA0_CONFIG)
291#define bfin_write_MXVR_DMA0_CONFIG(val) bfin_write32(MXVR_DMA0_CONFIG, val)
292#define bfin_read_MXVR_DMA0_START_ADDR() bfin_read32(MXVR_DMA0_START_ADDR)
293#define bfin_write_MXVR_DMA0_START_ADDR(val) bfin_write32(MXVR_DMA0_START_ADDR)
294#define bfin_read_MXVR_DMA0_COUNT() bfin_read16(MXVR_DMA0_COUNT)
295#define bfin_write_MXVR_DMA0_COUNT(val) bfin_write16(MXVR_DMA0_COUNT, val)
296#define bfin_read_MXVR_DMA0_CURR_ADDR() bfin_read32(MXVR_DMA0_CURR_ADDR)
297#define bfin_write_MXVR_DMA0_CURR_ADDR(val) bfin_write32(MXVR_DMA0_CURR_ADDR)
298#define bfin_read_MXVR_DMA0_CURR_COUNT() bfin_read16(MXVR_DMA0_CURR_COUNT)
299#define bfin_write_MXVR_DMA0_CURR_COUNT(val) bfin_write16(MXVR_DMA0_CURR_COUNT, val)
300
301/* MXVR DMA1 Registers */
302
303#define bfin_read_MXVR_DMA1_CONFIG() bfin_read32(MXVR_DMA1_CONFIG)
304#define bfin_write_MXVR_DMA1_CONFIG(val) bfin_write32(MXVR_DMA1_CONFIG, val)
305#define bfin_read_MXVR_DMA1_START_ADDR() bfin_read32(MXVR_DMA1_START_ADDR)
306#define bfin_write_MXVR_DMA1_START_ADDR(val) bfin_write32(MXVR_DMA1_START_ADDR)
307#define bfin_read_MXVR_DMA1_COUNT() bfin_read16(MXVR_DMA1_COUNT)
308#define bfin_write_MXVR_DMA1_COUNT(val) bfin_write16(MXVR_DMA1_COUNT, val)
309#define bfin_read_MXVR_DMA1_CURR_ADDR() bfin_read32(MXVR_DMA1_CURR_ADDR)
310#define bfin_write_MXVR_DMA1_CURR_ADDR(val) bfin_write32(MXVR_DMA1_CURR_ADDR)
311#define bfin_read_MXVR_DMA1_CURR_COUNT() bfin_read16(MXVR_DMA1_CURR_COUNT)
312#define bfin_write_MXVR_DMA1_CURR_COUNT(val) bfin_write16(MXVR_DMA1_CURR_COUNT, val)
313
314/* MXVR DMA2 Registers */
315
316#define bfin_read_MXVR_DMA2_CONFIG() bfin_read32(MXVR_DMA2_CONFIG)
317#define bfin_write_MXVR_DMA2_CONFIG(val) bfin_write32(MXVR_DMA2_CONFIG, val)
318#define bfin_read_MXVR_DMA2_START_ADDR() bfin_read32(MXVR_DMA2_START_ADDR)
319#define bfin_write_MXVR_DMA2_START_ADDR(val) bfin_write32(MXVR_DMA2_START_ADDR)
320#define bfin_read_MXVR_DMA2_COUNT() bfin_read16(MXVR_DMA2_COUNT)
321#define bfin_write_MXVR_DMA2_COUNT(val) bfin_write16(MXVR_DMA2_COUNT, val)
322#define bfin_read_MXVR_DMA2_CURR_ADDR() bfin_read32(MXVR_DMA2_CURR_ADDR)
323#define bfin_write_MXVR_DMA2_CURR_ADDR(val) bfin_write32(MXVR_DMA2_CURR_ADDR)
324#define bfin_read_MXVR_DMA2_CURR_COUNT() bfin_read16(MXVR_DMA2_CURR_COUNT)
325#define bfin_write_MXVR_DMA2_CURR_COUNT(val) bfin_write16(MXVR_DMA2_CURR_COUNT, val)
326
327/* MXVR DMA3 Registers */
328
329#define bfin_read_MXVR_DMA3_CONFIG() bfin_read32(MXVR_DMA3_CONFIG)
330#define bfin_write_MXVR_DMA3_CONFIG(val) bfin_write32(MXVR_DMA3_CONFIG, val)
331#define bfin_read_MXVR_DMA3_START_ADDR() bfin_read32(MXVR_DMA3_START_ADDR)
332#define bfin_write_MXVR_DMA3_START_ADDR(val) bfin_write32(MXVR_DMA3_START_ADDR)
333#define bfin_read_MXVR_DMA3_COUNT() bfin_read16(MXVR_DMA3_COUNT)
334#define bfin_write_MXVR_DMA3_COUNT(val) bfin_write16(MXVR_DMA3_COUNT, val)
335#define bfin_read_MXVR_DMA3_CURR_ADDR() bfin_read32(MXVR_DMA3_CURR_ADDR)
336#define bfin_write_MXVR_DMA3_CURR_ADDR(val) bfin_write32(MXVR_DMA3_CURR_ADDR)
337#define bfin_read_MXVR_DMA3_CURR_COUNT() bfin_read16(MXVR_DMA3_CURR_COUNT)
338#define bfin_write_MXVR_DMA3_CURR_COUNT(val) bfin_write16(MXVR_DMA3_CURR_COUNT, val)
339
340/* MXVR DMA4 Registers */
341
342#define bfin_read_MXVR_DMA4_CONFIG() bfin_read32(MXVR_DMA4_CONFIG)
343#define bfin_write_MXVR_DMA4_CONFIG(val) bfin_write32(MXVR_DMA4_CONFIG, val)
344#define bfin_read_MXVR_DMA4_START_ADDR() bfin_read32(MXVR_DMA4_START_ADDR)
345#define bfin_write_MXVR_DMA4_START_ADDR(val) bfin_write32(MXVR_DMA4_START_ADDR)
346#define bfin_read_MXVR_DMA4_COUNT() bfin_read16(MXVR_DMA4_COUNT)
347#define bfin_write_MXVR_DMA4_COUNT(val) bfin_write16(MXVR_DMA4_COUNT, val)
348#define bfin_read_MXVR_DMA4_CURR_ADDR() bfin_read32(MXVR_DMA4_CURR_ADDR)
349#define bfin_write_MXVR_DMA4_CURR_ADDR(val) bfin_write32(MXVR_DMA4_CURR_ADDR)
350#define bfin_read_MXVR_DMA4_CURR_COUNT() bfin_read16(MXVR_DMA4_CURR_COUNT)
351#define bfin_write_MXVR_DMA4_CURR_COUNT(val) bfin_write16(MXVR_DMA4_CURR_COUNT, val)
352
353/* MXVR DMA5 Registers */
354
355#define bfin_read_MXVR_DMA5_CONFIG() bfin_read32(MXVR_DMA5_CONFIG)
356#define bfin_write_MXVR_DMA5_CONFIG(val) bfin_write32(MXVR_DMA5_CONFIG, val)
357#define bfin_read_MXVR_DMA5_START_ADDR() bfin_read32(MXVR_DMA5_START_ADDR)
358#define bfin_write_MXVR_DMA5_START_ADDR(val) bfin_write32(MXVR_DMA5_START_ADDR)
359#define bfin_read_MXVR_DMA5_COUNT() bfin_read16(MXVR_DMA5_COUNT)
360#define bfin_write_MXVR_DMA5_COUNT(val) bfin_write16(MXVR_DMA5_COUNT, val)
361#define bfin_read_MXVR_DMA5_CURR_ADDR() bfin_read32(MXVR_DMA5_CURR_ADDR)
362#define bfin_write_MXVR_DMA5_CURR_ADDR(val) bfin_write32(MXVR_DMA5_CURR_ADDR)
363#define bfin_read_MXVR_DMA5_CURR_COUNT() bfin_read16(MXVR_DMA5_CURR_COUNT)
364#define bfin_write_MXVR_DMA5_CURR_COUNT(val) bfin_write16(MXVR_DMA5_CURR_COUNT, val)
365
366/* MXVR DMA6 Registers */
367
368#define bfin_read_MXVR_DMA6_CONFIG() bfin_read32(MXVR_DMA6_CONFIG)
369#define bfin_write_MXVR_DMA6_CONFIG(val) bfin_write32(MXVR_DMA6_CONFIG, val)
370#define bfin_read_MXVR_DMA6_START_ADDR() bfin_read32(MXVR_DMA6_START_ADDR)
371#define bfin_write_MXVR_DMA6_START_ADDR(val) bfin_write32(MXVR_DMA6_START_ADDR)
372#define bfin_read_MXVR_DMA6_COUNT() bfin_read16(MXVR_DMA6_COUNT)
373#define bfin_write_MXVR_DMA6_COUNT(val) bfin_write16(MXVR_DMA6_COUNT, val)
374#define bfin_read_MXVR_DMA6_CURR_ADDR() bfin_read32(MXVR_DMA6_CURR_ADDR)
375#define bfin_write_MXVR_DMA6_CURR_ADDR(val) bfin_write32(MXVR_DMA6_CURR_ADDR)
376#define bfin_read_MXVR_DMA6_CURR_COUNT() bfin_read16(MXVR_DMA6_CURR_COUNT)
377#define bfin_write_MXVR_DMA6_CURR_COUNT(val) bfin_write16(MXVR_DMA6_CURR_COUNT, val)
378
379/* MXVR DMA7 Registers */
380
381#define bfin_read_MXVR_DMA7_CONFIG() bfin_read32(MXVR_DMA7_CONFIG)
382#define bfin_write_MXVR_DMA7_CONFIG(val) bfin_write32(MXVR_DMA7_CONFIG, val)
383#define bfin_read_MXVR_DMA7_START_ADDR() bfin_read32(MXVR_DMA7_START_ADDR)
384#define bfin_write_MXVR_DMA7_START_ADDR(val) bfin_write32(MXVR_DMA7_START_ADDR)
385#define bfin_read_MXVR_DMA7_COUNT() bfin_read16(MXVR_DMA7_COUNT)
386#define bfin_write_MXVR_DMA7_COUNT(val) bfin_write16(MXVR_DMA7_COUNT, val)
387#define bfin_read_MXVR_DMA7_CURR_ADDR() bfin_read32(MXVR_DMA7_CURR_ADDR)
388#define bfin_write_MXVR_DMA7_CURR_ADDR(val) bfin_write32(MXVR_DMA7_CURR_ADDR)
389#define bfin_read_MXVR_DMA7_CURR_COUNT() bfin_read16(MXVR_DMA7_CURR_COUNT)
390#define bfin_write_MXVR_DMA7_CURR_COUNT(val) bfin_write16(MXVR_DMA7_CURR_COUNT, val)
391
392/* MXVR Asynch Packet Registers */
393
394#define bfin_read_MXVR_AP_CTL() bfin_read16(MXVR_AP_CTL)
395#define bfin_write_MXVR_AP_CTL(val) bfin_write16(MXVR_AP_CTL, val)
396#define bfin_read_MXVR_APRB_START_ADDR() bfin_read32(MXVR_APRB_START_ADDR)
397#define bfin_write_MXVR_APRB_START_ADDR(val) bfin_write32(MXVR_APRB_START_ADDR)
398#define bfin_read_MXVR_APRB_CURR_ADDR() bfin_read32(MXVR_APRB_CURR_ADDR)
399#define bfin_write_MXVR_APRB_CURR_ADDR(val) bfin_write32(MXVR_APRB_CURR_ADDR)
400#define bfin_read_MXVR_APTB_START_ADDR() bfin_read32(MXVR_APTB_START_ADDR)
401#define bfin_write_MXVR_APTB_START_ADDR(val) bfin_write32(MXVR_APTB_START_ADDR)
402#define bfin_read_MXVR_APTB_CURR_ADDR() bfin_read32(MXVR_APTB_CURR_ADDR)
403#define bfin_write_MXVR_APTB_CURR_ADDR(val) bfin_write32(MXVR_APTB_CURR_ADDR)
404
405/* MXVR Control Message Registers */
406
407#define bfin_read_MXVR_CM_CTL() bfin_read32(MXVR_CM_CTL)
408#define bfin_write_MXVR_CM_CTL(val) bfin_write32(MXVR_CM_CTL, val)
409#define bfin_read_MXVR_CMRB_START_ADDR() bfin_read32(MXVR_CMRB_START_ADDR)
410#define bfin_write_MXVR_CMRB_START_ADDR(val) bfin_write32(MXVR_CMRB_START_ADDR)
411#define bfin_read_MXVR_CMRB_CURR_ADDR() bfin_read32(MXVR_CMRB_CURR_ADDR)
412#define bfin_write_MXVR_CMRB_CURR_ADDR(val) bfin_write32(MXVR_CMRB_CURR_ADDR)
413#define bfin_read_MXVR_CMTB_START_ADDR() bfin_read32(MXVR_CMTB_START_ADDR)
414#define bfin_write_MXVR_CMTB_START_ADDR(val) bfin_write32(MXVR_CMTB_START_ADDR)
415#define bfin_read_MXVR_CMTB_CURR_ADDR() bfin_read32(MXVR_CMTB_CURR_ADDR)
416#define bfin_write_MXVR_CMTB_CURR_ADDR(val) bfin_write32(MXVR_CMTB_CURR_ADDR)
417
418/* MXVR Remote Read Registers */
419
420#define bfin_read_MXVR_RRDB_START_ADDR() bfin_read32(MXVR_RRDB_START_ADDR)
421#define bfin_write_MXVR_RRDB_START_ADDR(val) bfin_write32(MXVR_RRDB_START_ADDR)
422#define bfin_read_MXVR_RRDB_CURR_ADDR() bfin_read32(MXVR_RRDB_CURR_ADDR)
423#define bfin_write_MXVR_RRDB_CURR_ADDR(val) bfin_write32(MXVR_RRDB_CURR_ADDR)
424
425/* MXVR Pattern Data Registers */
426
427#define bfin_read_MXVR_PAT_DATA_0() bfin_read32(MXVR_PAT_DATA_0)
428#define bfin_write_MXVR_PAT_DATA_0(val) bfin_write32(MXVR_PAT_DATA_0, val)
429#define bfin_read_MXVR_PAT_EN_0() bfin_read32(MXVR_PAT_EN_0)
430#define bfin_write_MXVR_PAT_EN_0(val) bfin_write32(MXVR_PAT_EN_0, val)
431#define bfin_read_MXVR_PAT_DATA_1() bfin_read32(MXVR_PAT_DATA_1)
432#define bfin_write_MXVR_PAT_DATA_1(val) bfin_write32(MXVR_PAT_DATA_1, val)
433#define bfin_read_MXVR_PAT_EN_1() bfin_read32(MXVR_PAT_EN_1)
434#define bfin_write_MXVR_PAT_EN_1(val) bfin_write32(MXVR_PAT_EN_1, val)
435
436/* MXVR Frame Counter Registers */
437
438#define bfin_read_MXVR_FRAME_CNT_0() bfin_read16(MXVR_FRAME_CNT_0)
439#define bfin_write_MXVR_FRAME_CNT_0(val) bfin_write16(MXVR_FRAME_CNT_0, val)
440#define bfin_read_MXVR_FRAME_CNT_1() bfin_read16(MXVR_FRAME_CNT_1)
441#define bfin_write_MXVR_FRAME_CNT_1(val) bfin_write16(MXVR_FRAME_CNT_1, val)
442
443/* MXVR Routing Table Registers */
444
445#define bfin_read_MXVR_ROUTING_0() bfin_read32(MXVR_ROUTING_0)
446#define bfin_write_MXVR_ROUTING_0(val) bfin_write32(MXVR_ROUTING_0, val)
447#define bfin_read_MXVR_ROUTING_1() bfin_read32(MXVR_ROUTING_1)
448#define bfin_write_MXVR_ROUTING_1(val) bfin_write32(MXVR_ROUTING_1, val)
449#define bfin_read_MXVR_ROUTING_2() bfin_read32(MXVR_ROUTING_2)
450#define bfin_write_MXVR_ROUTING_2(val) bfin_write32(MXVR_ROUTING_2, val)
451#define bfin_read_MXVR_ROUTING_3() bfin_read32(MXVR_ROUTING_3)
452#define bfin_write_MXVR_ROUTING_3(val) bfin_write32(MXVR_ROUTING_3, val)
453#define bfin_read_MXVR_ROUTING_4() bfin_read32(MXVR_ROUTING_4)
454#define bfin_write_MXVR_ROUTING_4(val) bfin_write32(MXVR_ROUTING_4, val)
455#define bfin_read_MXVR_ROUTING_5() bfin_read32(MXVR_ROUTING_5)
456#define bfin_write_MXVR_ROUTING_5(val) bfin_write32(MXVR_ROUTING_5, val)
457#define bfin_read_MXVR_ROUTING_6() bfin_read32(MXVR_ROUTING_6)
458#define bfin_write_MXVR_ROUTING_6(val) bfin_write32(MXVR_ROUTING_6, val)
459#define bfin_read_MXVR_ROUTING_7() bfin_read32(MXVR_ROUTING_7)
460#define bfin_write_MXVR_ROUTING_7(val) bfin_write32(MXVR_ROUTING_7, val)
461#define bfin_read_MXVR_ROUTING_8() bfin_read32(MXVR_ROUTING_8)
462#define bfin_write_MXVR_ROUTING_8(val) bfin_write32(MXVR_ROUTING_8, val)
463#define bfin_read_MXVR_ROUTING_9() bfin_read32(MXVR_ROUTING_9)
464#define bfin_write_MXVR_ROUTING_9(val) bfin_write32(MXVR_ROUTING_9, val)
465#define bfin_read_MXVR_ROUTING_10() bfin_read32(MXVR_ROUTING_10)
466#define bfin_write_MXVR_ROUTING_10(val) bfin_write32(MXVR_ROUTING_10, val)
467#define bfin_read_MXVR_ROUTING_11() bfin_read32(MXVR_ROUTING_11)
468#define bfin_write_MXVR_ROUTING_11(val) bfin_write32(MXVR_ROUTING_11, val)
469#define bfin_read_MXVR_ROUTING_12() bfin_read32(MXVR_ROUTING_12)
470#define bfin_write_MXVR_ROUTING_12(val) bfin_write32(MXVR_ROUTING_12, val)
471#define bfin_read_MXVR_ROUTING_13() bfin_read32(MXVR_ROUTING_13)
472#define bfin_write_MXVR_ROUTING_13(val) bfin_write32(MXVR_ROUTING_13, val)
473#define bfin_read_MXVR_ROUTING_14() bfin_read32(MXVR_ROUTING_14)
474#define bfin_write_MXVR_ROUTING_14(val) bfin_write32(MXVR_ROUTING_14, val)
475
476/* MXVR Counter-Clock-Control Registers */
477
478#define bfin_read_MXVR_BLOCK_CNT() bfin_read16(MXVR_BLOCK_CNT)
479#define bfin_write_MXVR_BLOCK_CNT(val) bfin_write16(MXVR_BLOCK_CNT, val)
480#define bfin_read_MXVR_CLK_CTL() bfin_read32(MXVR_CLK_CTL)
481#define bfin_write_MXVR_CLK_CTL(val) bfin_write32(MXVR_CLK_CTL, val)
482#define bfin_read_MXVR_CDRPLL_CTL() bfin_read32(MXVR_CDRPLL_CTL)
483#define bfin_write_MXVR_CDRPLL_CTL(val) bfin_write32(MXVR_CDRPLL_CTL, val)
484#define bfin_read_MXVR_FMPLL_CTL() bfin_read32(MXVR_FMPLL_CTL)
485#define bfin_write_MXVR_FMPLL_CTL(val) bfin_write32(MXVR_FMPLL_CTL, val)
486#define bfin_read_MXVR_PIN_CTL() bfin_read16(MXVR_PIN_CTL)
487#define bfin_write_MXVR_PIN_CTL(val) bfin_write16(MXVR_PIN_CTL, val)
488#define bfin_read_MXVR_SCLK_CNT() bfin_read16(MXVR_SCLK_CNT)
489#define bfin_write_MXVR_SCLK_CNT(val) bfin_write16(MXVR_SCLK_CNT, val)
490
491/* CAN Controller 1 Config 1 Registers */
492
493#define bfin_read_CAN1_MC1() bfin_read16(CAN1_MC1)
494#define bfin_write_CAN1_MC1(val) bfin_write16(CAN1_MC1, val)
495#define bfin_read_CAN1_MD1() bfin_read16(CAN1_MD1)
496#define bfin_write_CAN1_MD1(val) bfin_write16(CAN1_MD1, val)
497#define bfin_read_CAN1_TRS1() bfin_read16(CAN1_TRS1)
498#define bfin_write_CAN1_TRS1(val) bfin_write16(CAN1_TRS1, val)
499#define bfin_read_CAN1_TRR1() bfin_read16(CAN1_TRR1)
500#define bfin_write_CAN1_TRR1(val) bfin_write16(CAN1_TRR1, val)
501#define bfin_read_CAN1_TA1() bfin_read16(CAN1_TA1)
502#define bfin_write_CAN1_TA1(val) bfin_write16(CAN1_TA1, val)
503#define bfin_read_CAN1_AA1() bfin_read16(CAN1_AA1)
504#define bfin_write_CAN1_AA1(val) bfin_write16(CAN1_AA1, val)
505#define bfin_read_CAN1_RMP1() bfin_read16(CAN1_RMP1)
506#define bfin_write_CAN1_RMP1(val) bfin_write16(CAN1_RMP1, val)
507#define bfin_read_CAN1_RML1() bfin_read16(CAN1_RML1)
508#define bfin_write_CAN1_RML1(val) bfin_write16(CAN1_RML1, val)
509#define bfin_read_CAN1_MBTIF1() bfin_read16(CAN1_MBTIF1)
510#define bfin_write_CAN1_MBTIF1(val) bfin_write16(CAN1_MBTIF1, val)
511#define bfin_read_CAN1_MBRIF1() bfin_read16(CAN1_MBRIF1)
512#define bfin_write_CAN1_MBRIF1(val) bfin_write16(CAN1_MBRIF1, val)
513#define bfin_read_CAN1_MBIM1() bfin_read16(CAN1_MBIM1)
514#define bfin_write_CAN1_MBIM1(val) bfin_write16(CAN1_MBIM1, val)
515#define bfin_read_CAN1_RFH1() bfin_read16(CAN1_RFH1)
516#define bfin_write_CAN1_RFH1(val) bfin_write16(CAN1_RFH1, val)
517#define bfin_read_CAN1_OPSS1() bfin_read16(CAN1_OPSS1)
518#define bfin_write_CAN1_OPSS1(val) bfin_write16(CAN1_OPSS1, val)
519
520/* CAN Controller 1 Config 2 Registers */
521
522#define bfin_read_CAN1_MC2() bfin_read16(CAN1_MC2)
523#define bfin_write_CAN1_MC2(val) bfin_write16(CAN1_MC2, val)
524#define bfin_read_CAN1_MD2() bfin_read16(CAN1_MD2)
525#define bfin_write_CAN1_MD2(val) bfin_write16(CAN1_MD2, val)
526#define bfin_read_CAN1_TRS2() bfin_read16(CAN1_TRS2)
527#define bfin_write_CAN1_TRS2(val) bfin_write16(CAN1_TRS2, val)
528#define bfin_read_CAN1_TRR2() bfin_read16(CAN1_TRR2)
529#define bfin_write_CAN1_TRR2(val) bfin_write16(CAN1_TRR2, val)
530#define bfin_read_CAN1_TA2() bfin_read16(CAN1_TA2)
531#define bfin_write_CAN1_TA2(val) bfin_write16(CAN1_TA2, val)
532#define bfin_read_CAN1_AA2() bfin_read16(CAN1_AA2)
533#define bfin_write_CAN1_AA2(val) bfin_write16(CAN1_AA2, val)
534#define bfin_read_CAN1_RMP2() bfin_read16(CAN1_RMP2)
535#define bfin_write_CAN1_RMP2(val) bfin_write16(CAN1_RMP2, val)
536#define bfin_read_CAN1_RML2() bfin_read16(CAN1_RML2)
537#define bfin_write_CAN1_RML2(val) bfin_write16(CAN1_RML2, val)
538#define bfin_read_CAN1_MBTIF2() bfin_read16(CAN1_MBTIF2)
539#define bfin_write_CAN1_MBTIF2(val) bfin_write16(CAN1_MBTIF2, val)
540#define bfin_read_CAN1_MBRIF2() bfin_read16(CAN1_MBRIF2)
541#define bfin_write_CAN1_MBRIF2(val) bfin_write16(CAN1_MBRIF2, val)
542#define bfin_read_CAN1_MBIM2() bfin_read16(CAN1_MBIM2)
543#define bfin_write_CAN1_MBIM2(val) bfin_write16(CAN1_MBIM2, val)
544#define bfin_read_CAN1_RFH2() bfin_read16(CAN1_RFH2)
545#define bfin_write_CAN1_RFH2(val) bfin_write16(CAN1_RFH2, val)
546#define bfin_read_CAN1_OPSS2() bfin_read16(CAN1_OPSS2)
547#define bfin_write_CAN1_OPSS2(val) bfin_write16(CAN1_OPSS2, val)
548
549/* CAN Controller 1 Clock/Interrubfin_read_()t/Counter Registers */
550
551#define bfin_read_CAN1_CLOCK() bfin_read16(CAN1_CLOCK)
552#define bfin_write_CAN1_CLOCK(val) bfin_write16(CAN1_CLOCK, val)
553#define bfin_read_CAN1_TIMING() bfin_read16(CAN1_TIMING)
554#define bfin_write_CAN1_TIMING(val) bfin_write16(CAN1_TIMING, val)
555#define bfin_read_CAN1_DEBUG() bfin_read16(CAN1_DEBUG)
556#define bfin_write_CAN1_DEBUG(val) bfin_write16(CAN1_DEBUG, val)
557#define bfin_read_CAN1_STATUS() bfin_read16(CAN1_STATUS)
558#define bfin_write_CAN1_STATUS(val) bfin_write16(CAN1_STATUS, val)
559#define bfin_read_CAN1_CEC() bfin_read16(CAN1_CEC)
560#define bfin_write_CAN1_CEC(val) bfin_write16(CAN1_CEC, val)
561#define bfin_read_CAN1_GIS() bfin_read16(CAN1_GIS)
562#define bfin_write_CAN1_GIS(val) bfin_write16(CAN1_GIS, val)
563#define bfin_read_CAN1_GIM() bfin_read16(CAN1_GIM)
564#define bfin_write_CAN1_GIM(val) bfin_write16(CAN1_GIM, val)
565#define bfin_read_CAN1_GIF() bfin_read16(CAN1_GIF)
566#define bfin_write_CAN1_GIF(val) bfin_write16(CAN1_GIF, val)
567#define bfin_read_CAN1_CONTROL() bfin_read16(CAN1_CONTROL)
568#define bfin_write_CAN1_CONTROL(val) bfin_write16(CAN1_CONTROL, val)
569#define bfin_read_CAN1_INTR() bfin_read16(CAN1_INTR)
570#define bfin_write_CAN1_INTR(val) bfin_write16(CAN1_INTR, val)
571#define bfin_read_CAN1_MBTD() bfin_read16(CAN1_MBTD)
572#define bfin_write_CAN1_MBTD(val) bfin_write16(CAN1_MBTD, val)
573#define bfin_read_CAN1_EWR() bfin_read16(CAN1_EWR)
574#define bfin_write_CAN1_EWR(val) bfin_write16(CAN1_EWR, val)
575#define bfin_read_CAN1_ESR() bfin_read16(CAN1_ESR)
576#define bfin_write_CAN1_ESR(val) bfin_write16(CAN1_ESR, val)
577#define bfin_read_CAN1_UCCNT() bfin_read16(CAN1_UCCNT)
578#define bfin_write_CAN1_UCCNT(val) bfin_write16(CAN1_UCCNT, val)
579#define bfin_read_CAN1_UCRC() bfin_read16(CAN1_UCRC)
580#define bfin_write_CAN1_UCRC(val) bfin_write16(CAN1_UCRC, val)
581#define bfin_read_CAN1_UCCNF() bfin_read16(CAN1_UCCNF)
582#define bfin_write_CAN1_UCCNF(val) bfin_write16(CAN1_UCCNF, val)
583
584/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
585
586#define bfin_read_CAN1_AM00L() bfin_read16(CAN1_AM00L)
587#define bfin_write_CAN1_AM00L(val) bfin_write16(CAN1_AM00L, val)
588#define bfin_read_CAN1_AM00H() bfin_read16(CAN1_AM00H)
589#define bfin_write_CAN1_AM00H(val) bfin_write16(CAN1_AM00H, val)
590#define bfin_read_CAN1_AM01L() bfin_read16(CAN1_AM01L)
591#define bfin_write_CAN1_AM01L(val) bfin_write16(CAN1_AM01L, val)
592#define bfin_read_CAN1_AM01H() bfin_read16(CAN1_AM01H)
593#define bfin_write_CAN1_AM01H(val) bfin_write16(CAN1_AM01H, val)
594#define bfin_read_CAN1_AM02L() bfin_read16(CAN1_AM02L)
595#define bfin_write_CAN1_AM02L(val) bfin_write16(CAN1_AM02L, val)
596#define bfin_read_CAN1_AM02H() bfin_read16(CAN1_AM02H)
597#define bfin_write_CAN1_AM02H(val) bfin_write16(CAN1_AM02H, val)
598#define bfin_read_CAN1_AM03L() bfin_read16(CAN1_AM03L)
599#define bfin_write_CAN1_AM03L(val) bfin_write16(CAN1_AM03L, val)
600#define bfin_read_CAN1_AM03H() bfin_read16(CAN1_AM03H)
601#define bfin_write_CAN1_AM03H(val) bfin_write16(CAN1_AM03H, val)
602#define bfin_read_CAN1_AM04L() bfin_read16(CAN1_AM04L)
603#define bfin_write_CAN1_AM04L(val) bfin_write16(CAN1_AM04L, val)
604#define bfin_read_CAN1_AM04H() bfin_read16(CAN1_AM04H)
605#define bfin_write_CAN1_AM04H(val) bfin_write16(CAN1_AM04H, val)
606#define bfin_read_CAN1_AM05L() bfin_read16(CAN1_AM05L)
607#define bfin_write_CAN1_AM05L(val) bfin_write16(CAN1_AM05L, val)
608#define bfin_read_CAN1_AM05H() bfin_read16(CAN1_AM05H)
609#define bfin_write_CAN1_AM05H(val) bfin_write16(CAN1_AM05H, val)
610#define bfin_read_CAN1_AM06L() bfin_read16(CAN1_AM06L)
611#define bfin_write_CAN1_AM06L(val) bfin_write16(CAN1_AM06L, val)
612#define bfin_read_CAN1_AM06H() bfin_read16(CAN1_AM06H)
613#define bfin_write_CAN1_AM06H(val) bfin_write16(CAN1_AM06H, val)
614#define bfin_read_CAN1_AM07L() bfin_read16(CAN1_AM07L)
615#define bfin_write_CAN1_AM07L(val) bfin_write16(CAN1_AM07L, val)
616#define bfin_read_CAN1_AM07H() bfin_read16(CAN1_AM07H)
617#define bfin_write_CAN1_AM07H(val) bfin_write16(CAN1_AM07H, val)
618#define bfin_read_CAN1_AM08L() bfin_read16(CAN1_AM08L)
619#define bfin_write_CAN1_AM08L(val) bfin_write16(CAN1_AM08L, val)
620#define bfin_read_CAN1_AM08H() bfin_read16(CAN1_AM08H)
621#define bfin_write_CAN1_AM08H(val) bfin_write16(CAN1_AM08H, val)
622#define bfin_read_CAN1_AM09L() bfin_read16(CAN1_AM09L)
623#define bfin_write_CAN1_AM09L(val) bfin_write16(CAN1_AM09L, val)
624#define bfin_read_CAN1_AM09H() bfin_read16(CAN1_AM09H)
625#define bfin_write_CAN1_AM09H(val) bfin_write16(CAN1_AM09H, val)
626#define bfin_read_CAN1_AM10L() bfin_read16(CAN1_AM10L)
627#define bfin_write_CAN1_AM10L(val) bfin_write16(CAN1_AM10L, val)
628#define bfin_read_CAN1_AM10H() bfin_read16(CAN1_AM10H)
629#define bfin_write_CAN1_AM10H(val) bfin_write16(CAN1_AM10H, val)
630#define bfin_read_CAN1_AM11L() bfin_read16(CAN1_AM11L)
631#define bfin_write_CAN1_AM11L(val) bfin_write16(CAN1_AM11L, val)
632#define bfin_read_CAN1_AM11H() bfin_read16(CAN1_AM11H)
633#define bfin_write_CAN1_AM11H(val) bfin_write16(CAN1_AM11H, val)
634#define bfin_read_CAN1_AM12L() bfin_read16(CAN1_AM12L)
635#define bfin_write_CAN1_AM12L(val) bfin_write16(CAN1_AM12L, val)
636#define bfin_read_CAN1_AM12H() bfin_read16(CAN1_AM12H)
637#define bfin_write_CAN1_AM12H(val) bfin_write16(CAN1_AM12H, val)
638#define bfin_read_CAN1_AM13L() bfin_read16(CAN1_AM13L)
639#define bfin_write_CAN1_AM13L(val) bfin_write16(CAN1_AM13L, val)
640#define bfin_read_CAN1_AM13H() bfin_read16(CAN1_AM13H)
641#define bfin_write_CAN1_AM13H(val) bfin_write16(CAN1_AM13H, val)
642#define bfin_read_CAN1_AM14L() bfin_read16(CAN1_AM14L)
643#define bfin_write_CAN1_AM14L(val) bfin_write16(CAN1_AM14L, val)
644#define bfin_read_CAN1_AM14H() bfin_read16(CAN1_AM14H)
645#define bfin_write_CAN1_AM14H(val) bfin_write16(CAN1_AM14H, val)
646#define bfin_read_CAN1_AM15L() bfin_read16(CAN1_AM15L)
647#define bfin_write_CAN1_AM15L(val) bfin_write16(CAN1_AM15L, val)
648#define bfin_read_CAN1_AM15H() bfin_read16(CAN1_AM15H)
649#define bfin_write_CAN1_AM15H(val) bfin_write16(CAN1_AM15H, val)
650
651/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
652
653#define bfin_read_CAN1_AM16L() bfin_read16(CAN1_AM16L)
654#define bfin_write_CAN1_AM16L(val) bfin_write16(CAN1_AM16L, val)
655#define bfin_read_CAN1_AM16H() bfin_read16(CAN1_AM16H)
656#define bfin_write_CAN1_AM16H(val) bfin_write16(CAN1_AM16H, val)
657#define bfin_read_CAN1_AM17L() bfin_read16(CAN1_AM17L)
658#define bfin_write_CAN1_AM17L(val) bfin_write16(CAN1_AM17L, val)
659#define bfin_read_CAN1_AM17H() bfin_read16(CAN1_AM17H)
660#define bfin_write_CAN1_AM17H(val) bfin_write16(CAN1_AM17H, val)
661#define bfin_read_CAN1_AM18L() bfin_read16(CAN1_AM18L)
662#define bfin_write_CAN1_AM18L(val) bfin_write16(CAN1_AM18L, val)
663#define bfin_read_CAN1_AM18H() bfin_read16(CAN1_AM18H)
664#define bfin_write_CAN1_AM18H(val) bfin_write16(CAN1_AM18H, val)
665#define bfin_read_CAN1_AM19L() bfin_read16(CAN1_AM19L)
666#define bfin_write_CAN1_AM19L(val) bfin_write16(CAN1_AM19L, val)
667#define bfin_read_CAN1_AM19H() bfin_read16(CAN1_AM19H)
668#define bfin_write_CAN1_AM19H(val) bfin_write16(CAN1_AM19H, val)
669#define bfin_read_CAN1_AM20L() bfin_read16(CAN1_AM20L)
670#define bfin_write_CAN1_AM20L(val) bfin_write16(CAN1_AM20L, val)
671#define bfin_read_CAN1_AM20H() bfin_read16(CAN1_AM20H)
672#define bfin_write_CAN1_AM20H(val) bfin_write16(CAN1_AM20H, val)
673#define bfin_read_CAN1_AM21L() bfin_read16(CAN1_AM21L)
674#define bfin_write_CAN1_AM21L(val) bfin_write16(CAN1_AM21L, val)
675#define bfin_read_CAN1_AM21H() bfin_read16(CAN1_AM21H)
676#define bfin_write_CAN1_AM21H(val) bfin_write16(CAN1_AM21H, val)
677#define bfin_read_CAN1_AM22L() bfin_read16(CAN1_AM22L)
678#define bfin_write_CAN1_AM22L(val) bfin_write16(CAN1_AM22L, val)
679#define bfin_read_CAN1_AM22H() bfin_read16(CAN1_AM22H)
680#define bfin_write_CAN1_AM22H(val) bfin_write16(CAN1_AM22H, val)
681#define bfin_read_CAN1_AM23L() bfin_read16(CAN1_AM23L)
682#define bfin_write_CAN1_AM23L(val) bfin_write16(CAN1_AM23L, val)
683#define bfin_read_CAN1_AM23H() bfin_read16(CAN1_AM23H)
684#define bfin_write_CAN1_AM23H(val) bfin_write16(CAN1_AM23H, val)
685#define bfin_read_CAN1_AM24L() bfin_read16(CAN1_AM24L)
686#define bfin_write_CAN1_AM24L(val) bfin_write16(CAN1_AM24L, val)
687#define bfin_read_CAN1_AM24H() bfin_read16(CAN1_AM24H)
688#define bfin_write_CAN1_AM24H(val) bfin_write16(CAN1_AM24H, val)
689#define bfin_read_CAN1_AM25L() bfin_read16(CAN1_AM25L)
690#define bfin_write_CAN1_AM25L(val) bfin_write16(CAN1_AM25L, val)
691#define bfin_read_CAN1_AM25H() bfin_read16(CAN1_AM25H)
692#define bfin_write_CAN1_AM25H(val) bfin_write16(CAN1_AM25H, val)
693#define bfin_read_CAN1_AM26L() bfin_read16(CAN1_AM26L)
694#define bfin_write_CAN1_AM26L(val) bfin_write16(CAN1_AM26L, val)
695#define bfin_read_CAN1_AM26H() bfin_read16(CAN1_AM26H)
696#define bfin_write_CAN1_AM26H(val) bfin_write16(CAN1_AM26H, val)
697#define bfin_read_CAN1_AM27L() bfin_read16(CAN1_AM27L)
698#define bfin_write_CAN1_AM27L(val) bfin_write16(CAN1_AM27L, val)
699#define bfin_read_CAN1_AM27H() bfin_read16(CAN1_AM27H)
700#define bfin_write_CAN1_AM27H(val) bfin_write16(CAN1_AM27H, val)
701#define bfin_read_CAN1_AM28L() bfin_read16(CAN1_AM28L)
702#define bfin_write_CAN1_AM28L(val) bfin_write16(CAN1_AM28L, val)
703#define bfin_read_CAN1_AM28H() bfin_read16(CAN1_AM28H)
704#define bfin_write_CAN1_AM28H(val) bfin_write16(CAN1_AM28H, val)
705#define bfin_read_CAN1_AM29L() bfin_read16(CAN1_AM29L)
706#define bfin_write_CAN1_AM29L(val) bfin_write16(CAN1_AM29L, val)
707#define bfin_read_CAN1_AM29H() bfin_read16(CAN1_AM29H)
708#define bfin_write_CAN1_AM29H(val) bfin_write16(CAN1_AM29H, val)
709#define bfin_read_CAN1_AM30L() bfin_read16(CAN1_AM30L)
710#define bfin_write_CAN1_AM30L(val) bfin_write16(CAN1_AM30L, val)
711#define bfin_read_CAN1_AM30H() bfin_read16(CAN1_AM30H)
712#define bfin_write_CAN1_AM30H(val) bfin_write16(CAN1_AM30H, val)
713#define bfin_read_CAN1_AM31L() bfin_read16(CAN1_AM31L)
714#define bfin_write_CAN1_AM31L(val) bfin_write16(CAN1_AM31L, val)
715#define bfin_read_CAN1_AM31H() bfin_read16(CAN1_AM31H)
716#define bfin_write_CAN1_AM31H(val) bfin_write16(CAN1_AM31H, val)
717
718/* CAN Controller 1 Mailbox Data Registers */
719
720#define bfin_read_CAN1_MB00_DATA0() bfin_read16(CAN1_MB00_DATA0)
721#define bfin_write_CAN1_MB00_DATA0(val) bfin_write16(CAN1_MB00_DATA0, val)
722#define bfin_read_CAN1_MB00_DATA1() bfin_read16(CAN1_MB00_DATA1)
723#define bfin_write_CAN1_MB00_DATA1(val) bfin_write16(CAN1_MB00_DATA1, val)
724#define bfin_read_CAN1_MB00_DATA2() bfin_read16(CAN1_MB00_DATA2)
725#define bfin_write_CAN1_MB00_DATA2(val) bfin_write16(CAN1_MB00_DATA2, val)
726#define bfin_read_CAN1_MB00_DATA3() bfin_read16(CAN1_MB00_DATA3)
727#define bfin_write_CAN1_MB00_DATA3(val) bfin_write16(CAN1_MB00_DATA3, val)
728#define bfin_read_CAN1_MB00_LENGTH() bfin_read16(CAN1_MB00_LENGTH)
729#define bfin_write_CAN1_MB00_LENGTH(val) bfin_write16(CAN1_MB00_LENGTH, val)
730#define bfin_read_CAN1_MB00_TIMESTAMP() bfin_read16(CAN1_MB00_TIMESTAMP)
731#define bfin_write_CAN1_MB00_TIMESTAMP(val) bfin_write16(CAN1_MB00_TIMESTAMP, val)
732#define bfin_read_CAN1_MB00_ID0() bfin_read16(CAN1_MB00_ID0)
733#define bfin_write_CAN1_MB00_ID0(val) bfin_write16(CAN1_MB00_ID0, val)
734#define bfin_read_CAN1_MB00_ID1() bfin_read16(CAN1_MB00_ID1)
735#define bfin_write_CAN1_MB00_ID1(val) bfin_write16(CAN1_MB00_ID1, val)
736#define bfin_read_CAN1_MB01_DATA0() bfin_read16(CAN1_MB01_DATA0)
737#define bfin_write_CAN1_MB01_DATA0(val) bfin_write16(CAN1_MB01_DATA0, val)
738#define bfin_read_CAN1_MB01_DATA1() bfin_read16(CAN1_MB01_DATA1)
739#define bfin_write_CAN1_MB01_DATA1(val) bfin_write16(CAN1_MB01_DATA1, val)
740#define bfin_read_CAN1_MB01_DATA2() bfin_read16(CAN1_MB01_DATA2)
741#define bfin_write_CAN1_MB01_DATA2(val) bfin_write16(CAN1_MB01_DATA2, val)
742#define bfin_read_CAN1_MB01_DATA3() bfin_read16(CAN1_MB01_DATA3)
743#define bfin_write_CAN1_MB01_DATA3(val) bfin_write16(CAN1_MB01_DATA3, val)
744#define bfin_read_CAN1_MB01_LENGTH() bfin_read16(CAN1_MB01_LENGTH)
745#define bfin_write_CAN1_MB01_LENGTH(val) bfin_write16(CAN1_MB01_LENGTH, val)
746#define bfin_read_CAN1_MB01_TIMESTAMP() bfin_read16(CAN1_MB01_TIMESTAMP)
747#define bfin_write_CAN1_MB01_TIMESTAMP(val) bfin_write16(CAN1_MB01_TIMESTAMP, val)
748#define bfin_read_CAN1_MB01_ID0() bfin_read16(CAN1_MB01_ID0)
749#define bfin_write_CAN1_MB01_ID0(val) bfin_write16(CAN1_MB01_ID0, val)
750#define bfin_read_CAN1_MB01_ID1() bfin_read16(CAN1_MB01_ID1)
751#define bfin_write_CAN1_MB01_ID1(val) bfin_write16(CAN1_MB01_ID1, val)
752#define bfin_read_CAN1_MB02_DATA0() bfin_read16(CAN1_MB02_DATA0)
753#define bfin_write_CAN1_MB02_DATA0(val) bfin_write16(CAN1_MB02_DATA0, val)
754#define bfin_read_CAN1_MB02_DATA1() bfin_read16(CAN1_MB02_DATA1)
755#define bfin_write_CAN1_MB02_DATA1(val) bfin_write16(CAN1_MB02_DATA1, val)
756#define bfin_read_CAN1_MB02_DATA2() bfin_read16(CAN1_MB02_DATA2)
757#define bfin_write_CAN1_MB02_DATA2(val) bfin_write16(CAN1_MB02_DATA2, val)
758#define bfin_read_CAN1_MB02_DATA3() bfin_read16(CAN1_MB02_DATA3)
759#define bfin_write_CAN1_MB02_DATA3(val) bfin_write16(CAN1_MB02_DATA3, val)
760#define bfin_read_CAN1_MB02_LENGTH() bfin_read16(CAN1_MB02_LENGTH)
761#define bfin_write_CAN1_MB02_LENGTH(val) bfin_write16(CAN1_MB02_LENGTH, val)
762#define bfin_read_CAN1_MB02_TIMESTAMP() bfin_read16(CAN1_MB02_TIMESTAMP)
763#define bfin_write_CAN1_MB02_TIMESTAMP(val) bfin_write16(CAN1_MB02_TIMESTAMP, val)
764#define bfin_read_CAN1_MB02_ID0() bfin_read16(CAN1_MB02_ID0)
765#define bfin_write_CAN1_MB02_ID0(val) bfin_write16(CAN1_MB02_ID0, val)
766#define bfin_read_CAN1_MB02_ID1() bfin_read16(CAN1_MB02_ID1)
767#define bfin_write_CAN1_MB02_ID1(val) bfin_write16(CAN1_MB02_ID1, val)
768#define bfin_read_CAN1_MB03_DATA0() bfin_read16(CAN1_MB03_DATA0)
769#define bfin_write_CAN1_MB03_DATA0(val) bfin_write16(CAN1_MB03_DATA0, val)
770#define bfin_read_CAN1_MB03_DATA1() bfin_read16(CAN1_MB03_DATA1)
771#define bfin_write_CAN1_MB03_DATA1(val) bfin_write16(CAN1_MB03_DATA1, val)
772#define bfin_read_CAN1_MB03_DATA2() bfin_read16(CAN1_MB03_DATA2)
773#define bfin_write_CAN1_MB03_DATA2(val) bfin_write16(CAN1_MB03_DATA2, val)
774#define bfin_read_CAN1_MB03_DATA3() bfin_read16(CAN1_MB03_DATA3)
775#define bfin_write_CAN1_MB03_DATA3(val) bfin_write16(CAN1_MB03_DATA3, val)
776#define bfin_read_CAN1_MB03_LENGTH() bfin_read16(CAN1_MB03_LENGTH)
777#define bfin_write_CAN1_MB03_LENGTH(val) bfin_write16(CAN1_MB03_LENGTH, val)
778#define bfin_read_CAN1_MB03_TIMESTAMP() bfin_read16(CAN1_MB03_TIMESTAMP)
779#define bfin_write_CAN1_MB03_TIMESTAMP(val) bfin_write16(CAN1_MB03_TIMESTAMP, val)
780#define bfin_read_CAN1_MB03_ID0() bfin_read16(CAN1_MB03_ID0)
781#define bfin_write_CAN1_MB03_ID0(val) bfin_write16(CAN1_MB03_ID0, val)
782#define bfin_read_CAN1_MB03_ID1() bfin_read16(CAN1_MB03_ID1)
783#define bfin_write_CAN1_MB03_ID1(val) bfin_write16(CAN1_MB03_ID1, val)
784#define bfin_read_CAN1_MB04_DATA0() bfin_read16(CAN1_MB04_DATA0)
785#define bfin_write_CAN1_MB04_DATA0(val) bfin_write16(CAN1_MB04_DATA0, val)
786#define bfin_read_CAN1_MB04_DATA1() bfin_read16(CAN1_MB04_DATA1)
787#define bfin_write_CAN1_MB04_DATA1(val) bfin_write16(CAN1_MB04_DATA1, val)
788#define bfin_read_CAN1_MB04_DATA2() bfin_read16(CAN1_MB04_DATA2)
789#define bfin_write_CAN1_MB04_DATA2(val) bfin_write16(CAN1_MB04_DATA2, val)
790#define bfin_read_CAN1_MB04_DATA3() bfin_read16(CAN1_MB04_DATA3)
791#define bfin_write_CAN1_MB04_DATA3(val) bfin_write16(CAN1_MB04_DATA3, val)
792#define bfin_read_CAN1_MB04_LENGTH() bfin_read16(CAN1_MB04_LENGTH)
793#define bfin_write_CAN1_MB04_LENGTH(val) bfin_write16(CAN1_MB04_LENGTH, val)
794#define bfin_read_CAN1_MB04_TIMESTAMP() bfin_read16(CAN1_MB04_TIMESTAMP)
795#define bfin_write_CAN1_MB04_TIMESTAMP(val) bfin_write16(CAN1_MB04_TIMESTAMP, val)
796#define bfin_read_CAN1_MB04_ID0() bfin_read16(CAN1_MB04_ID0)
797#define bfin_write_CAN1_MB04_ID0(val) bfin_write16(CAN1_MB04_ID0, val)
798#define bfin_read_CAN1_MB04_ID1() bfin_read16(CAN1_MB04_ID1)
799#define bfin_write_CAN1_MB04_ID1(val) bfin_write16(CAN1_MB04_ID1, val)
800#define bfin_read_CAN1_MB05_DATA0() bfin_read16(CAN1_MB05_DATA0)
801#define bfin_write_CAN1_MB05_DATA0(val) bfin_write16(CAN1_MB05_DATA0, val)
802#define bfin_read_CAN1_MB05_DATA1() bfin_read16(CAN1_MB05_DATA1)
803#define bfin_write_CAN1_MB05_DATA1(val) bfin_write16(CAN1_MB05_DATA1, val)
804#define bfin_read_CAN1_MB05_DATA2() bfin_read16(CAN1_MB05_DATA2)
805#define bfin_write_CAN1_MB05_DATA2(val) bfin_write16(CAN1_MB05_DATA2, val)
806#define bfin_read_CAN1_MB05_DATA3() bfin_read16(CAN1_MB05_DATA3)
807#define bfin_write_CAN1_MB05_DATA3(val) bfin_write16(CAN1_MB05_DATA3, val)
808#define bfin_read_CAN1_MB05_LENGTH() bfin_read16(CAN1_MB05_LENGTH)
809#define bfin_write_CAN1_MB05_LENGTH(val) bfin_write16(CAN1_MB05_LENGTH, val)
810#define bfin_read_CAN1_MB05_TIMESTAMP() bfin_read16(CAN1_MB05_TIMESTAMP)
811#define bfin_write_CAN1_MB05_TIMESTAMP(val) bfin_write16(CAN1_MB05_TIMESTAMP, val)
812#define bfin_read_CAN1_MB05_ID0() bfin_read16(CAN1_MB05_ID0)
813#define bfin_write_CAN1_MB05_ID0(val) bfin_write16(CAN1_MB05_ID0, val)
814#define bfin_read_CAN1_MB05_ID1() bfin_read16(CAN1_MB05_ID1)
815#define bfin_write_CAN1_MB05_ID1(val) bfin_write16(CAN1_MB05_ID1, val)
816#define bfin_read_CAN1_MB06_DATA0() bfin_read16(CAN1_MB06_DATA0)
817#define bfin_write_CAN1_MB06_DATA0(val) bfin_write16(CAN1_MB06_DATA0, val)
818#define bfin_read_CAN1_MB06_DATA1() bfin_read16(CAN1_MB06_DATA1)
819#define bfin_write_CAN1_MB06_DATA1(val) bfin_write16(CAN1_MB06_DATA1, val)
820#define bfin_read_CAN1_MB06_DATA2() bfin_read16(CAN1_MB06_DATA2)
821#define bfin_write_CAN1_MB06_DATA2(val) bfin_write16(CAN1_MB06_DATA2, val)
822#define bfin_read_CAN1_MB06_DATA3() bfin_read16(CAN1_MB06_DATA3)
823#define bfin_write_CAN1_MB06_DATA3(val) bfin_write16(CAN1_MB06_DATA3, val)
824#define bfin_read_CAN1_MB06_LENGTH() bfin_read16(CAN1_MB06_LENGTH)
825#define bfin_write_CAN1_MB06_LENGTH(val) bfin_write16(CAN1_MB06_LENGTH, val)
826#define bfin_read_CAN1_MB06_TIMESTAMP() bfin_read16(CAN1_MB06_TIMESTAMP)
827#define bfin_write_CAN1_MB06_TIMESTAMP(val) bfin_write16(CAN1_MB06_TIMESTAMP, val)
828#define bfin_read_CAN1_MB06_ID0() bfin_read16(CAN1_MB06_ID0)
829#define bfin_write_CAN1_MB06_ID0(val) bfin_write16(CAN1_MB06_ID0, val)
830#define bfin_read_CAN1_MB06_ID1() bfin_read16(CAN1_MB06_ID1)
831#define bfin_write_CAN1_MB06_ID1(val) bfin_write16(CAN1_MB06_ID1, val)
832#define bfin_read_CAN1_MB07_DATA0() bfin_read16(CAN1_MB07_DATA0)
833#define bfin_write_CAN1_MB07_DATA0(val) bfin_write16(CAN1_MB07_DATA0, val)
834#define bfin_read_CAN1_MB07_DATA1() bfin_read16(CAN1_MB07_DATA1)
835#define bfin_write_CAN1_MB07_DATA1(val) bfin_write16(CAN1_MB07_DATA1, val)
836#define bfin_read_CAN1_MB07_DATA2() bfin_read16(CAN1_MB07_DATA2)
837#define bfin_write_CAN1_MB07_DATA2(val) bfin_write16(CAN1_MB07_DATA2, val)
838#define bfin_read_CAN1_MB07_DATA3() bfin_read16(CAN1_MB07_DATA3)
839#define bfin_write_CAN1_MB07_DATA3(val) bfin_write16(CAN1_MB07_DATA3, val)
840#define bfin_read_CAN1_MB07_LENGTH() bfin_read16(CAN1_MB07_LENGTH)
841#define bfin_write_CAN1_MB07_LENGTH(val) bfin_write16(CAN1_MB07_LENGTH, val)
842#define bfin_read_CAN1_MB07_TIMESTAMP() bfin_read16(CAN1_MB07_TIMESTAMP)
843#define bfin_write_CAN1_MB07_TIMESTAMP(val) bfin_write16(CAN1_MB07_TIMESTAMP, val)
844#define bfin_read_CAN1_MB07_ID0() bfin_read16(CAN1_MB07_ID0)
845#define bfin_write_CAN1_MB07_ID0(val) bfin_write16(CAN1_MB07_ID0, val)
846#define bfin_read_CAN1_MB07_ID1() bfin_read16(CAN1_MB07_ID1)
847#define bfin_write_CAN1_MB07_ID1(val) bfin_write16(CAN1_MB07_ID1, val)
848#define bfin_read_CAN1_MB08_DATA0() bfin_read16(CAN1_MB08_DATA0)
849#define bfin_write_CAN1_MB08_DATA0(val) bfin_write16(CAN1_MB08_DATA0, val)
850#define bfin_read_CAN1_MB08_DATA1() bfin_read16(CAN1_MB08_DATA1)
851#define bfin_write_CAN1_MB08_DATA1(val) bfin_write16(CAN1_MB08_DATA1, val)
852#define bfin_read_CAN1_MB08_DATA2() bfin_read16(CAN1_MB08_DATA2)
853#define bfin_write_CAN1_MB08_DATA2(val) bfin_write16(CAN1_MB08_DATA2, val)
854#define bfin_read_CAN1_MB08_DATA3() bfin_read16(CAN1_MB08_DATA3)
855#define bfin_write_CAN1_MB08_DATA3(val) bfin_write16(CAN1_MB08_DATA3, val)
856#define bfin_read_CAN1_MB08_LENGTH() bfin_read16(CAN1_MB08_LENGTH)
857#define bfin_write_CAN1_MB08_LENGTH(val) bfin_write16(CAN1_MB08_LENGTH, val)
858#define bfin_read_CAN1_MB08_TIMESTAMP() bfin_read16(CAN1_MB08_TIMESTAMP)
859#define bfin_write_CAN1_MB08_TIMESTAMP(val) bfin_write16(CAN1_MB08_TIMESTAMP, val)
860#define bfin_read_CAN1_MB08_ID0() bfin_read16(CAN1_MB08_ID0)
861#define bfin_write_CAN1_MB08_ID0(val) bfin_write16(CAN1_MB08_ID0, val)
862#define bfin_read_CAN1_MB08_ID1() bfin_read16(CAN1_MB08_ID1)
863#define bfin_write_CAN1_MB08_ID1(val) bfin_write16(CAN1_MB08_ID1, val)
864#define bfin_read_CAN1_MB09_DATA0() bfin_read16(CAN1_MB09_DATA0)
865#define bfin_write_CAN1_MB09_DATA0(val) bfin_write16(CAN1_MB09_DATA0, val)
866#define bfin_read_CAN1_MB09_DATA1() bfin_read16(CAN1_MB09_DATA1)
867#define bfin_write_CAN1_MB09_DATA1(val) bfin_write16(CAN1_MB09_DATA1, val)
868#define bfin_read_CAN1_MB09_DATA2() bfin_read16(CAN1_MB09_DATA2)
869#define bfin_write_CAN1_MB09_DATA2(val) bfin_write16(CAN1_MB09_DATA2, val)
870#define bfin_read_CAN1_MB09_DATA3() bfin_read16(CAN1_MB09_DATA3)
871#define bfin_write_CAN1_MB09_DATA3(val) bfin_write16(CAN1_MB09_DATA3, val)
872#define bfin_read_CAN1_MB09_LENGTH() bfin_read16(CAN1_MB09_LENGTH)
873#define bfin_write_CAN1_MB09_LENGTH(val) bfin_write16(CAN1_MB09_LENGTH, val)
874#define bfin_read_CAN1_MB09_TIMESTAMP() bfin_read16(CAN1_MB09_TIMESTAMP)
875#define bfin_write_CAN1_MB09_TIMESTAMP(val) bfin_write16(CAN1_MB09_TIMESTAMP, val)
876#define bfin_read_CAN1_MB09_ID0() bfin_read16(CAN1_MB09_ID0)
877#define bfin_write_CAN1_MB09_ID0(val) bfin_write16(CAN1_MB09_ID0, val)
878#define bfin_read_CAN1_MB09_ID1() bfin_read16(CAN1_MB09_ID1)
879#define bfin_write_CAN1_MB09_ID1(val) bfin_write16(CAN1_MB09_ID1, val)
880#define bfin_read_CAN1_MB10_DATA0() bfin_read16(CAN1_MB10_DATA0)
881#define bfin_write_CAN1_MB10_DATA0(val) bfin_write16(CAN1_MB10_DATA0, val)
882#define bfin_read_CAN1_MB10_DATA1() bfin_read16(CAN1_MB10_DATA1)
883#define bfin_write_CAN1_MB10_DATA1(val) bfin_write16(CAN1_MB10_DATA1, val)
884#define bfin_read_CAN1_MB10_DATA2() bfin_read16(CAN1_MB10_DATA2)
885#define bfin_write_CAN1_MB10_DATA2(val) bfin_write16(CAN1_MB10_DATA2, val)
886#define bfin_read_CAN1_MB10_DATA3() bfin_read16(CAN1_MB10_DATA3)
887#define bfin_write_CAN1_MB10_DATA3(val) bfin_write16(CAN1_MB10_DATA3, val)
888#define bfin_read_CAN1_MB10_LENGTH() bfin_read16(CAN1_MB10_LENGTH)
889#define bfin_write_CAN1_MB10_LENGTH(val) bfin_write16(CAN1_MB10_LENGTH, val)
890#define bfin_read_CAN1_MB10_TIMESTAMP() bfin_read16(CAN1_MB10_TIMESTAMP)
891#define bfin_write_CAN1_MB10_TIMESTAMP(val) bfin_write16(CAN1_MB10_TIMESTAMP, val)
892#define bfin_read_CAN1_MB10_ID0() bfin_read16(CAN1_MB10_ID0)
893#define bfin_write_CAN1_MB10_ID0(val) bfin_write16(CAN1_MB10_ID0, val)
894#define bfin_read_CAN1_MB10_ID1() bfin_read16(CAN1_MB10_ID1)
895#define bfin_write_CAN1_MB10_ID1(val) bfin_write16(CAN1_MB10_ID1, val)
896#define bfin_read_CAN1_MB11_DATA0() bfin_read16(CAN1_MB11_DATA0)
897#define bfin_write_CAN1_MB11_DATA0(val) bfin_write16(CAN1_MB11_DATA0, val)
898#define bfin_read_CAN1_MB11_DATA1() bfin_read16(CAN1_MB11_DATA1)
899#define bfin_write_CAN1_MB11_DATA1(val) bfin_write16(CAN1_MB11_DATA1, val)
900#define bfin_read_CAN1_MB11_DATA2() bfin_read16(CAN1_MB11_DATA2)
901#define bfin_write_CAN1_MB11_DATA2(val) bfin_write16(CAN1_MB11_DATA2, val)
902#define bfin_read_CAN1_MB11_DATA3() bfin_read16(CAN1_MB11_DATA3)
903#define bfin_write_CAN1_MB11_DATA3(val) bfin_write16(CAN1_MB11_DATA3, val)
904#define bfin_read_CAN1_MB11_LENGTH() bfin_read16(CAN1_MB11_LENGTH)
905#define bfin_write_CAN1_MB11_LENGTH(val) bfin_write16(CAN1_MB11_LENGTH, val)
906#define bfin_read_CAN1_MB11_TIMESTAMP() bfin_read16(CAN1_MB11_TIMESTAMP)
907#define bfin_write_CAN1_MB11_TIMESTAMP(val) bfin_write16(CAN1_MB11_TIMESTAMP, val)
908#define bfin_read_CAN1_MB11_ID0() bfin_read16(CAN1_MB11_ID0)
909#define bfin_write_CAN1_MB11_ID0(val) bfin_write16(CAN1_MB11_ID0, val)
910#define bfin_read_CAN1_MB11_ID1() bfin_read16(CAN1_MB11_ID1)
911#define bfin_write_CAN1_MB11_ID1(val) bfin_write16(CAN1_MB11_ID1, val)
912#define bfin_read_CAN1_MB12_DATA0() bfin_read16(CAN1_MB12_DATA0)
913#define bfin_write_CAN1_MB12_DATA0(val) bfin_write16(CAN1_MB12_DATA0, val)
914#define bfin_read_CAN1_MB12_DATA1() bfin_read16(CAN1_MB12_DATA1)
915#define bfin_write_CAN1_MB12_DATA1(val) bfin_write16(CAN1_MB12_DATA1, val)
916#define bfin_read_CAN1_MB12_DATA2() bfin_read16(CAN1_MB12_DATA2)
917#define bfin_write_CAN1_MB12_DATA2(val) bfin_write16(CAN1_MB12_DATA2, val)
918#define bfin_read_CAN1_MB12_DATA3() bfin_read16(CAN1_MB12_DATA3)
919#define bfin_write_CAN1_MB12_DATA3(val) bfin_write16(CAN1_MB12_DATA3, val)
920#define bfin_read_CAN1_MB12_LENGTH() bfin_read16(CAN1_MB12_LENGTH)
921#define bfin_write_CAN1_MB12_LENGTH(val) bfin_write16(CAN1_MB12_LENGTH, val)
922#define bfin_read_CAN1_MB12_TIMESTAMP() bfin_read16(CAN1_MB12_TIMESTAMP)
923#define bfin_write_CAN1_MB12_TIMESTAMP(val) bfin_write16(CAN1_MB12_TIMESTAMP, val)
924#define bfin_read_CAN1_MB12_ID0() bfin_read16(CAN1_MB12_ID0)
925#define bfin_write_CAN1_MB12_ID0(val) bfin_write16(CAN1_MB12_ID0, val)
926#define bfin_read_CAN1_MB12_ID1() bfin_read16(CAN1_MB12_ID1)
927#define bfin_write_CAN1_MB12_ID1(val) bfin_write16(CAN1_MB12_ID1, val)
928#define bfin_read_CAN1_MB13_DATA0() bfin_read16(CAN1_MB13_DATA0)
929#define bfin_write_CAN1_MB13_DATA0(val) bfin_write16(CAN1_MB13_DATA0, val)
930#define bfin_read_CAN1_MB13_DATA1() bfin_read16(CAN1_MB13_DATA1)
931#define bfin_write_CAN1_MB13_DATA1(val) bfin_write16(CAN1_MB13_DATA1, val)
932#define bfin_read_CAN1_MB13_DATA2() bfin_read16(CAN1_MB13_DATA2)
933#define bfin_write_CAN1_MB13_DATA2(val) bfin_write16(CAN1_MB13_DATA2, val)
934#define bfin_read_CAN1_MB13_DATA3() bfin_read16(CAN1_MB13_DATA3)
935#define bfin_write_CAN1_MB13_DATA3(val) bfin_write16(CAN1_MB13_DATA3, val)
936#define bfin_read_CAN1_MB13_LENGTH() bfin_read16(CAN1_MB13_LENGTH)
937#define bfin_write_CAN1_MB13_LENGTH(val) bfin_write16(CAN1_MB13_LENGTH, val)
938#define bfin_read_CAN1_MB13_TIMESTAMP() bfin_read16(CAN1_MB13_TIMESTAMP)
939#define bfin_write_CAN1_MB13_TIMESTAMP(val) bfin_write16(CAN1_MB13_TIMESTAMP, val)
940#define bfin_read_CAN1_MB13_ID0() bfin_read16(CAN1_MB13_ID0)
941#define bfin_write_CAN1_MB13_ID0(val) bfin_write16(CAN1_MB13_ID0, val)
942#define bfin_read_CAN1_MB13_ID1() bfin_read16(CAN1_MB13_ID1)
943#define bfin_write_CAN1_MB13_ID1(val) bfin_write16(CAN1_MB13_ID1, val)
944#define bfin_read_CAN1_MB14_DATA0() bfin_read16(CAN1_MB14_DATA0)
945#define bfin_write_CAN1_MB14_DATA0(val) bfin_write16(CAN1_MB14_DATA0, val)
946#define bfin_read_CAN1_MB14_DATA1() bfin_read16(CAN1_MB14_DATA1)
947#define bfin_write_CAN1_MB14_DATA1(val) bfin_write16(CAN1_MB14_DATA1, val)
948#define bfin_read_CAN1_MB14_DATA2() bfin_read16(CAN1_MB14_DATA2)
949#define bfin_write_CAN1_MB14_DATA2(val) bfin_write16(CAN1_MB14_DATA2, val)
950#define bfin_read_CAN1_MB14_DATA3() bfin_read16(CAN1_MB14_DATA3)
951#define bfin_write_CAN1_MB14_DATA3(val) bfin_write16(CAN1_MB14_DATA3, val)
952#define bfin_read_CAN1_MB14_LENGTH() bfin_read16(CAN1_MB14_LENGTH)
953#define bfin_write_CAN1_MB14_LENGTH(val) bfin_write16(CAN1_MB14_LENGTH, val)
954#define bfin_read_CAN1_MB14_TIMESTAMP() bfin_read16(CAN1_MB14_TIMESTAMP)
955#define bfin_write_CAN1_MB14_TIMESTAMP(val) bfin_write16(CAN1_MB14_TIMESTAMP, val)
956#define bfin_read_CAN1_MB14_ID0() bfin_read16(CAN1_MB14_ID0)
957#define bfin_write_CAN1_MB14_ID0(val) bfin_write16(CAN1_MB14_ID0, val)
958#define bfin_read_CAN1_MB14_ID1() bfin_read16(CAN1_MB14_ID1)
959#define bfin_write_CAN1_MB14_ID1(val) bfin_write16(CAN1_MB14_ID1, val)
960#define bfin_read_CAN1_MB15_DATA0() bfin_read16(CAN1_MB15_DATA0)
961#define bfin_write_CAN1_MB15_DATA0(val) bfin_write16(CAN1_MB15_DATA0, val)
962#define bfin_read_CAN1_MB15_DATA1() bfin_read16(CAN1_MB15_DATA1)
963#define bfin_write_CAN1_MB15_DATA1(val) bfin_write16(CAN1_MB15_DATA1, val)
964#define bfin_read_CAN1_MB15_DATA2() bfin_read16(CAN1_MB15_DATA2)
965#define bfin_write_CAN1_MB15_DATA2(val) bfin_write16(CAN1_MB15_DATA2, val)
966#define bfin_read_CAN1_MB15_DATA3() bfin_read16(CAN1_MB15_DATA3)
967#define bfin_write_CAN1_MB15_DATA3(val) bfin_write16(CAN1_MB15_DATA3, val)
968#define bfin_read_CAN1_MB15_LENGTH() bfin_read16(CAN1_MB15_LENGTH)
969#define bfin_write_CAN1_MB15_LENGTH(val) bfin_write16(CAN1_MB15_LENGTH, val)
970#define bfin_read_CAN1_MB15_TIMESTAMP() bfin_read16(CAN1_MB15_TIMESTAMP)
971#define bfin_write_CAN1_MB15_TIMESTAMP(val) bfin_write16(CAN1_MB15_TIMESTAMP, val)
972#define bfin_read_CAN1_MB15_ID0() bfin_read16(CAN1_MB15_ID0)
973#define bfin_write_CAN1_MB15_ID0(val) bfin_write16(CAN1_MB15_ID0, val)
974#define bfin_read_CAN1_MB15_ID1() bfin_read16(CAN1_MB15_ID1)
975#define bfin_write_CAN1_MB15_ID1(val) bfin_write16(CAN1_MB15_ID1, val)
976
977/* CAN Controller 1 Mailbox Data Registers */
978
979#define bfin_read_CAN1_MB16_DATA0() bfin_read16(CAN1_MB16_DATA0)
980#define bfin_write_CAN1_MB16_DATA0(val) bfin_write16(CAN1_MB16_DATA0, val)
981#define bfin_read_CAN1_MB16_DATA1() bfin_read16(CAN1_MB16_DATA1)
982#define bfin_write_CAN1_MB16_DATA1(val) bfin_write16(CAN1_MB16_DATA1, val)
983#define bfin_read_CAN1_MB16_DATA2() bfin_read16(CAN1_MB16_DATA2)
984#define bfin_write_CAN1_MB16_DATA2(val) bfin_write16(CAN1_MB16_DATA2, val)
985#define bfin_read_CAN1_MB16_DATA3() bfin_read16(CAN1_MB16_DATA3)
986#define bfin_write_CAN1_MB16_DATA3(val) bfin_write16(CAN1_MB16_DATA3, val)
987#define bfin_read_CAN1_MB16_LENGTH() bfin_read16(CAN1_MB16_LENGTH)
988#define bfin_write_CAN1_MB16_LENGTH(val) bfin_write16(CAN1_MB16_LENGTH, val)
989#define bfin_read_CAN1_MB16_TIMESTAMP() bfin_read16(CAN1_MB16_TIMESTAMP)
990#define bfin_write_CAN1_MB16_TIMESTAMP(val) bfin_write16(CAN1_MB16_TIMESTAMP, val)
991#define bfin_read_CAN1_MB16_ID0() bfin_read16(CAN1_MB16_ID0)
992#define bfin_write_CAN1_MB16_ID0(val) bfin_write16(CAN1_MB16_ID0, val)
993#define bfin_read_CAN1_MB16_ID1() bfin_read16(CAN1_MB16_ID1)
994#define bfin_write_CAN1_MB16_ID1(val) bfin_write16(CAN1_MB16_ID1, val)
995#define bfin_read_CAN1_MB17_DATA0() bfin_read16(CAN1_MB17_DATA0)
996#define bfin_write_CAN1_MB17_DATA0(val) bfin_write16(CAN1_MB17_DATA0, val)
997#define bfin_read_CAN1_MB17_DATA1() bfin_read16(CAN1_MB17_DATA1)
998#define bfin_write_CAN1_MB17_DATA1(val) bfin_write16(CAN1_MB17_DATA1, val)
999#define bfin_read_CAN1_MB17_DATA2() bfin_read16(CAN1_MB17_DATA2)
1000#define bfin_write_CAN1_MB17_DATA2(val) bfin_write16(CAN1_MB17_DATA2, val)
1001#define bfin_read_CAN1_MB17_DATA3() bfin_read16(CAN1_MB17_DATA3)
1002#define bfin_write_CAN1_MB17_DATA3(val) bfin_write16(CAN1_MB17_DATA3, val)
1003#define bfin_read_CAN1_MB17_LENGTH() bfin_read16(CAN1_MB17_LENGTH)
1004#define bfin_write_CAN1_MB17_LENGTH(val) bfin_write16(CAN1_MB17_LENGTH, val)
1005#define bfin_read_CAN1_MB17_TIMESTAMP() bfin_read16(CAN1_MB17_TIMESTAMP)
1006#define bfin_write_CAN1_MB17_TIMESTAMP(val) bfin_write16(CAN1_MB17_TIMESTAMP, val)
1007#define bfin_read_CAN1_MB17_ID0() bfin_read16(CAN1_MB17_ID0)
1008#define bfin_write_CAN1_MB17_ID0(val) bfin_write16(CAN1_MB17_ID0, val)
1009#define bfin_read_CAN1_MB17_ID1() bfin_read16(CAN1_MB17_ID1)
1010#define bfin_write_CAN1_MB17_ID1(val) bfin_write16(CAN1_MB17_ID1, val)
1011#define bfin_read_CAN1_MB18_DATA0() bfin_read16(CAN1_MB18_DATA0)
1012#define bfin_write_CAN1_MB18_DATA0(val) bfin_write16(CAN1_MB18_DATA0, val)
1013#define bfin_read_CAN1_MB18_DATA1() bfin_read16(CAN1_MB18_DATA1)
1014#define bfin_write_CAN1_MB18_DATA1(val) bfin_write16(CAN1_MB18_DATA1, val)
1015#define bfin_read_CAN1_MB18_DATA2() bfin_read16(CAN1_MB18_DATA2)
1016#define bfin_write_CAN1_MB18_DATA2(val) bfin_write16(CAN1_MB18_DATA2, val)
1017#define bfin_read_CAN1_MB18_DATA3() bfin_read16(CAN1_MB18_DATA3)
1018#define bfin_write_CAN1_MB18_DATA3(val) bfin_write16(CAN1_MB18_DATA3, val)
1019#define bfin_read_CAN1_MB18_LENGTH() bfin_read16(CAN1_MB18_LENGTH)
1020#define bfin_write_CAN1_MB18_LENGTH(val) bfin_write16(CAN1_MB18_LENGTH, val)
1021#define bfin_read_CAN1_MB18_TIMESTAMP() bfin_read16(CAN1_MB18_TIMESTAMP)
1022#define bfin_write_CAN1_MB18_TIMESTAMP(val) bfin_write16(CAN1_MB18_TIMESTAMP, val)
1023#define bfin_read_CAN1_MB18_ID0() bfin_read16(CAN1_MB18_ID0)
1024#define bfin_write_CAN1_MB18_ID0(val) bfin_write16(CAN1_MB18_ID0, val)
1025#define bfin_read_CAN1_MB18_ID1() bfin_read16(CAN1_MB18_ID1)
1026#define bfin_write_CAN1_MB18_ID1(val) bfin_write16(CAN1_MB18_ID1, val)
1027#define bfin_read_CAN1_MB19_DATA0() bfin_read16(CAN1_MB19_DATA0)
1028#define bfin_write_CAN1_MB19_DATA0(val) bfin_write16(CAN1_MB19_DATA0, val)
1029#define bfin_read_CAN1_MB19_DATA1() bfin_read16(CAN1_MB19_DATA1)
1030#define bfin_write_CAN1_MB19_DATA1(val) bfin_write16(CAN1_MB19_DATA1, val)
1031#define bfin_read_CAN1_MB19_DATA2() bfin_read16(CAN1_MB19_DATA2)
1032#define bfin_write_CAN1_MB19_DATA2(val) bfin_write16(CAN1_MB19_DATA2, val)
1033#define bfin_read_CAN1_MB19_DATA3() bfin_read16(CAN1_MB19_DATA3)
1034#define bfin_write_CAN1_MB19_DATA3(val) bfin_write16(CAN1_MB19_DATA3, val)
1035#define bfin_read_CAN1_MB19_LENGTH() bfin_read16(CAN1_MB19_LENGTH)
1036#define bfin_write_CAN1_MB19_LENGTH(val) bfin_write16(CAN1_MB19_LENGTH, val)
1037#define bfin_read_CAN1_MB19_TIMESTAMP() bfin_read16(CAN1_MB19_TIMESTAMP)
1038#define bfin_write_CAN1_MB19_TIMESTAMP(val) bfin_write16(CAN1_MB19_TIMESTAMP, val)
1039#define bfin_read_CAN1_MB19_ID0() bfin_read16(CAN1_MB19_ID0)
1040#define bfin_write_CAN1_MB19_ID0(val) bfin_write16(CAN1_MB19_ID0, val)
1041#define bfin_read_CAN1_MB19_ID1() bfin_read16(CAN1_MB19_ID1)
1042#define bfin_write_CAN1_MB19_ID1(val) bfin_write16(CAN1_MB19_ID1, val)
1043#define bfin_read_CAN1_MB20_DATA0() bfin_read16(CAN1_MB20_DATA0)
1044#define bfin_write_CAN1_MB20_DATA0(val) bfin_write16(CAN1_MB20_DATA0, val)
1045#define bfin_read_CAN1_MB20_DATA1() bfin_read16(CAN1_MB20_DATA1)
1046#define bfin_write_CAN1_MB20_DATA1(val) bfin_write16(CAN1_MB20_DATA1, val)
1047#define bfin_read_CAN1_MB20_DATA2() bfin_read16(CAN1_MB20_DATA2)
1048#define bfin_write_CAN1_MB20_DATA2(val) bfin_write16(CAN1_MB20_DATA2, val)
1049#define bfin_read_CAN1_MB20_DATA3() bfin_read16(CAN1_MB20_DATA3)
1050#define bfin_write_CAN1_MB20_DATA3(val) bfin_write16(CAN1_MB20_DATA3, val)
1051#define bfin_read_CAN1_MB20_LENGTH() bfin_read16(CAN1_MB20_LENGTH)
1052#define bfin_write_CAN1_MB20_LENGTH(val) bfin_write16(CAN1_MB20_LENGTH, val)
1053#define bfin_read_CAN1_MB20_TIMESTAMP() bfin_read16(CAN1_MB20_TIMESTAMP)
1054#define bfin_write_CAN1_MB20_TIMESTAMP(val) bfin_write16(CAN1_MB20_TIMESTAMP, val)
1055#define bfin_read_CAN1_MB20_ID0() bfin_read16(CAN1_MB20_ID0)
1056#define bfin_write_CAN1_MB20_ID0(val) bfin_write16(CAN1_MB20_ID0, val)
1057#define bfin_read_CAN1_MB20_ID1() bfin_read16(CAN1_MB20_ID1)
1058#define bfin_write_CAN1_MB20_ID1(val) bfin_write16(CAN1_MB20_ID1, val)
1059#define bfin_read_CAN1_MB21_DATA0() bfin_read16(CAN1_MB21_DATA0)
1060#define bfin_write_CAN1_MB21_DATA0(val) bfin_write16(CAN1_MB21_DATA0, val)
1061#define bfin_read_CAN1_MB21_DATA1() bfin_read16(CAN1_MB21_DATA1)
1062#define bfin_write_CAN1_MB21_DATA1(val) bfin_write16(CAN1_MB21_DATA1, val)
1063#define bfin_read_CAN1_MB21_DATA2() bfin_read16(CAN1_MB21_DATA2)
1064#define bfin_write_CAN1_MB21_DATA2(val) bfin_write16(CAN1_MB21_DATA2, val)
1065#define bfin_read_CAN1_MB21_DATA3() bfin_read16(CAN1_MB21_DATA3)
1066#define bfin_write_CAN1_MB21_DATA3(val) bfin_write16(CAN1_MB21_DATA3, val)
1067#define bfin_read_CAN1_MB21_LENGTH() bfin_read16(CAN1_MB21_LENGTH)
1068#define bfin_write_CAN1_MB21_LENGTH(val) bfin_write16(CAN1_MB21_LENGTH, val)
1069#define bfin_read_CAN1_MB21_TIMESTAMP() bfin_read16(CAN1_MB21_TIMESTAMP)
1070#define bfin_write_CAN1_MB21_TIMESTAMP(val) bfin_write16(CAN1_MB21_TIMESTAMP, val)
1071#define bfin_read_CAN1_MB21_ID0() bfin_read16(CAN1_MB21_ID0)
1072#define bfin_write_CAN1_MB21_ID0(val) bfin_write16(CAN1_MB21_ID0, val)
1073#define bfin_read_CAN1_MB21_ID1() bfin_read16(CAN1_MB21_ID1)
1074#define bfin_write_CAN1_MB21_ID1(val) bfin_write16(CAN1_MB21_ID1, val)
1075#define bfin_read_CAN1_MB22_DATA0() bfin_read16(CAN1_MB22_DATA0)
1076#define bfin_write_CAN1_MB22_DATA0(val) bfin_write16(CAN1_MB22_DATA0, val)
1077#define bfin_read_CAN1_MB22_DATA1() bfin_read16(CAN1_MB22_DATA1)
1078#define bfin_write_CAN1_MB22_DATA1(val) bfin_write16(CAN1_MB22_DATA1, val)
1079#define bfin_read_CAN1_MB22_DATA2() bfin_read16(CAN1_MB22_DATA2)
1080#define bfin_write_CAN1_MB22_DATA2(val) bfin_write16(CAN1_MB22_DATA2, val)
1081#define bfin_read_CAN1_MB22_DATA3() bfin_read16(CAN1_MB22_DATA3)
1082#define bfin_write_CAN1_MB22_DATA3(val) bfin_write16(CAN1_MB22_DATA3, val)
1083#define bfin_read_CAN1_MB22_LENGTH() bfin_read16(CAN1_MB22_LENGTH)
1084#define bfin_write_CAN1_MB22_LENGTH(val) bfin_write16(CAN1_MB22_LENGTH, val)
1085#define bfin_read_CAN1_MB22_TIMESTAMP() bfin_read16(CAN1_MB22_TIMESTAMP)
1086#define bfin_write_CAN1_MB22_TIMESTAMP(val) bfin_write16(CAN1_MB22_TIMESTAMP, val)
1087#define bfin_read_CAN1_MB22_ID0() bfin_read16(CAN1_MB22_ID0)
1088#define bfin_write_CAN1_MB22_ID0(val) bfin_write16(CAN1_MB22_ID0, val)
1089#define bfin_read_CAN1_MB22_ID1() bfin_read16(CAN1_MB22_ID1)
1090#define bfin_write_CAN1_MB22_ID1(val) bfin_write16(CAN1_MB22_ID1, val)
1091#define bfin_read_CAN1_MB23_DATA0() bfin_read16(CAN1_MB23_DATA0)
1092#define bfin_write_CAN1_MB23_DATA0(val) bfin_write16(CAN1_MB23_DATA0, val)
1093#define bfin_read_CAN1_MB23_DATA1() bfin_read16(CAN1_MB23_DATA1)
1094#define bfin_write_CAN1_MB23_DATA1(val) bfin_write16(CAN1_MB23_DATA1, val)
1095#define bfin_read_CAN1_MB23_DATA2() bfin_read16(CAN1_MB23_DATA2)
1096#define bfin_write_CAN1_MB23_DATA2(val) bfin_write16(CAN1_MB23_DATA2, val)
1097#define bfin_read_CAN1_MB23_DATA3() bfin_read16(CAN1_MB23_DATA3)
1098#define bfin_write_CAN1_MB23_DATA3(val) bfin_write16(CAN1_MB23_DATA3, val)
1099#define bfin_read_CAN1_MB23_LENGTH() bfin_read16(CAN1_MB23_LENGTH)
1100#define bfin_write_CAN1_MB23_LENGTH(val) bfin_write16(CAN1_MB23_LENGTH, val)
1101#define bfin_read_CAN1_MB23_TIMESTAMP() bfin_read16(CAN1_MB23_TIMESTAMP)
1102#define bfin_write_CAN1_MB23_TIMESTAMP(val) bfin_write16(CAN1_MB23_TIMESTAMP, val)
1103#define bfin_read_CAN1_MB23_ID0() bfin_read16(CAN1_MB23_ID0)
1104#define bfin_write_CAN1_MB23_ID0(val) bfin_write16(CAN1_MB23_ID0, val)
1105#define bfin_read_CAN1_MB23_ID1() bfin_read16(CAN1_MB23_ID1)
1106#define bfin_write_CAN1_MB23_ID1(val) bfin_write16(CAN1_MB23_ID1, val)
1107#define bfin_read_CAN1_MB24_DATA0() bfin_read16(CAN1_MB24_DATA0)
1108#define bfin_write_CAN1_MB24_DATA0(val) bfin_write16(CAN1_MB24_DATA0, val)
1109#define bfin_read_CAN1_MB24_DATA1() bfin_read16(CAN1_MB24_DATA1)
1110#define bfin_write_CAN1_MB24_DATA1(val) bfin_write16(CAN1_MB24_DATA1, val)
1111#define bfin_read_CAN1_MB24_DATA2() bfin_read16(CAN1_MB24_DATA2)
1112#define bfin_write_CAN1_MB24_DATA2(val) bfin_write16(CAN1_MB24_DATA2, val)
1113#define bfin_read_CAN1_MB24_DATA3() bfin_read16(CAN1_MB24_DATA3)
1114#define bfin_write_CAN1_MB24_DATA3(val) bfin_write16(CAN1_MB24_DATA3, val)
1115#define bfin_read_CAN1_MB24_LENGTH() bfin_read16(CAN1_MB24_LENGTH)
1116#define bfin_write_CAN1_MB24_LENGTH(val) bfin_write16(CAN1_MB24_LENGTH, val)
1117#define bfin_read_CAN1_MB24_TIMESTAMP() bfin_read16(CAN1_MB24_TIMESTAMP)
1118#define bfin_write_CAN1_MB24_TIMESTAMP(val) bfin_write16(CAN1_MB24_TIMESTAMP, val)
1119#define bfin_read_CAN1_MB24_ID0() bfin_read16(CAN1_MB24_ID0)
1120#define bfin_write_CAN1_MB24_ID0(val) bfin_write16(CAN1_MB24_ID0, val)
1121#define bfin_read_CAN1_MB24_ID1() bfin_read16(CAN1_MB24_ID1)
1122#define bfin_write_CAN1_MB24_ID1(val) bfin_write16(CAN1_MB24_ID1, val)
1123#define bfin_read_CAN1_MB25_DATA0() bfin_read16(CAN1_MB25_DATA0)
1124#define bfin_write_CAN1_MB25_DATA0(val) bfin_write16(CAN1_MB25_DATA0, val)
1125#define bfin_read_CAN1_MB25_DATA1() bfin_read16(CAN1_MB25_DATA1)
1126#define bfin_write_CAN1_MB25_DATA1(val) bfin_write16(CAN1_MB25_DATA1, val)
1127#define bfin_read_CAN1_MB25_DATA2() bfin_read16(CAN1_MB25_DATA2)
1128#define bfin_write_CAN1_MB25_DATA2(val) bfin_write16(CAN1_MB25_DATA2, val)
1129#define bfin_read_CAN1_MB25_DATA3() bfin_read16(CAN1_MB25_DATA3)
1130#define bfin_write_CAN1_MB25_DATA3(val) bfin_write16(CAN1_MB25_DATA3, val)
1131#define bfin_read_CAN1_MB25_LENGTH() bfin_read16(CAN1_MB25_LENGTH)
1132#define bfin_write_CAN1_MB25_LENGTH(val) bfin_write16(CAN1_MB25_LENGTH, val)
1133#define bfin_read_CAN1_MB25_TIMESTAMP() bfin_read16(CAN1_MB25_TIMESTAMP)
1134#define bfin_write_CAN1_MB25_TIMESTAMP(val) bfin_write16(CAN1_MB25_TIMESTAMP, val)
1135#define bfin_read_CAN1_MB25_ID0() bfin_read16(CAN1_MB25_ID0)
1136#define bfin_write_CAN1_MB25_ID0(val) bfin_write16(CAN1_MB25_ID0, val)
1137#define bfin_read_CAN1_MB25_ID1() bfin_read16(CAN1_MB25_ID1)
1138#define bfin_write_CAN1_MB25_ID1(val) bfin_write16(CAN1_MB25_ID1, val)
1139#define bfin_read_CAN1_MB26_DATA0() bfin_read16(CAN1_MB26_DATA0)
1140#define bfin_write_CAN1_MB26_DATA0(val) bfin_write16(CAN1_MB26_DATA0, val)
1141#define bfin_read_CAN1_MB26_DATA1() bfin_read16(CAN1_MB26_DATA1)
1142#define bfin_write_CAN1_MB26_DATA1(val) bfin_write16(CAN1_MB26_DATA1, val)
1143#define bfin_read_CAN1_MB26_DATA2() bfin_read16(CAN1_MB26_DATA2)
1144#define bfin_write_CAN1_MB26_DATA2(val) bfin_write16(CAN1_MB26_DATA2, val)
1145#define bfin_read_CAN1_MB26_DATA3() bfin_read16(CAN1_MB26_DATA3)
1146#define bfin_write_CAN1_MB26_DATA3(val) bfin_write16(CAN1_MB26_DATA3, val)
1147#define bfin_read_CAN1_MB26_LENGTH() bfin_read16(CAN1_MB26_LENGTH)
1148#define bfin_write_CAN1_MB26_LENGTH(val) bfin_write16(CAN1_MB26_LENGTH, val)
1149#define bfin_read_CAN1_MB26_TIMESTAMP() bfin_read16(CAN1_MB26_TIMESTAMP)
1150#define bfin_write_CAN1_MB26_TIMESTAMP(val) bfin_write16(CAN1_MB26_TIMESTAMP, val)
1151#define bfin_read_CAN1_MB26_ID0() bfin_read16(CAN1_MB26_ID0)
1152#define bfin_write_CAN1_MB26_ID0(val) bfin_write16(CAN1_MB26_ID0, val)
1153#define bfin_read_CAN1_MB26_ID1() bfin_read16(CAN1_MB26_ID1)
1154#define bfin_write_CAN1_MB26_ID1(val) bfin_write16(CAN1_MB26_ID1, val)
1155#define bfin_read_CAN1_MB27_DATA0() bfin_read16(CAN1_MB27_DATA0)
1156#define bfin_write_CAN1_MB27_DATA0(val) bfin_write16(CAN1_MB27_DATA0, val)
1157#define bfin_read_CAN1_MB27_DATA1() bfin_read16(CAN1_MB27_DATA1)
1158#define bfin_write_CAN1_MB27_DATA1(val) bfin_write16(CAN1_MB27_DATA1, val)
1159#define bfin_read_CAN1_MB27_DATA2() bfin_read16(CAN1_MB27_DATA2)
1160#define bfin_write_CAN1_MB27_DATA2(val) bfin_write16(CAN1_MB27_DATA2, val)
1161#define bfin_read_CAN1_MB27_DATA3() bfin_read16(CAN1_MB27_DATA3)
1162#define bfin_write_CAN1_MB27_DATA3(val) bfin_write16(CAN1_MB27_DATA3, val)
1163#define bfin_read_CAN1_MB27_LENGTH() bfin_read16(CAN1_MB27_LENGTH)
1164#define bfin_write_CAN1_MB27_LENGTH(val) bfin_write16(CAN1_MB27_LENGTH, val)
1165#define bfin_read_CAN1_MB27_TIMESTAMP() bfin_read16(CAN1_MB27_TIMESTAMP)
1166#define bfin_write_CAN1_MB27_TIMESTAMP(val) bfin_write16(CAN1_MB27_TIMESTAMP, val)
1167#define bfin_read_CAN1_MB27_ID0() bfin_read16(CAN1_MB27_ID0)
1168#define bfin_write_CAN1_MB27_ID0(val) bfin_write16(CAN1_MB27_ID0, val)
1169#define bfin_read_CAN1_MB27_ID1() bfin_read16(CAN1_MB27_ID1)
1170#define bfin_write_CAN1_MB27_ID1(val) bfin_write16(CAN1_MB27_ID1, val)
1171#define bfin_read_CAN1_MB28_DATA0() bfin_read16(CAN1_MB28_DATA0)
1172#define bfin_write_CAN1_MB28_DATA0(val) bfin_write16(CAN1_MB28_DATA0, val)
1173#define bfin_read_CAN1_MB28_DATA1() bfin_read16(CAN1_MB28_DATA1)
1174#define bfin_write_CAN1_MB28_DATA1(val) bfin_write16(CAN1_MB28_DATA1, val)
1175#define bfin_read_CAN1_MB28_DATA2() bfin_read16(CAN1_MB28_DATA2)
1176#define bfin_write_CAN1_MB28_DATA2(val) bfin_write16(CAN1_MB28_DATA2, val)
1177#define bfin_read_CAN1_MB28_DATA3() bfin_read16(CAN1_MB28_DATA3)
1178#define bfin_write_CAN1_MB28_DATA3(val) bfin_write16(CAN1_MB28_DATA3, val)
1179#define bfin_read_CAN1_MB28_LENGTH() bfin_read16(CAN1_MB28_LENGTH)
1180#define bfin_write_CAN1_MB28_LENGTH(val) bfin_write16(CAN1_MB28_LENGTH, val)
1181#define bfin_read_CAN1_MB28_TIMESTAMP() bfin_read16(CAN1_MB28_TIMESTAMP)
1182#define bfin_write_CAN1_MB28_TIMESTAMP(val) bfin_write16(CAN1_MB28_TIMESTAMP, val)
1183#define bfin_read_CAN1_MB28_ID0() bfin_read16(CAN1_MB28_ID0)
1184#define bfin_write_CAN1_MB28_ID0(val) bfin_write16(CAN1_MB28_ID0, val)
1185#define bfin_read_CAN1_MB28_ID1() bfin_read16(CAN1_MB28_ID1)
1186#define bfin_write_CAN1_MB28_ID1(val) bfin_write16(CAN1_MB28_ID1, val)
1187#define bfin_read_CAN1_MB29_DATA0() bfin_read16(CAN1_MB29_DATA0)
1188#define bfin_write_CAN1_MB29_DATA0(val) bfin_write16(CAN1_MB29_DATA0, val)
1189#define bfin_read_CAN1_MB29_DATA1() bfin_read16(CAN1_MB29_DATA1)
1190#define bfin_write_CAN1_MB29_DATA1(val) bfin_write16(CAN1_MB29_DATA1, val)
1191#define bfin_read_CAN1_MB29_DATA2() bfin_read16(CAN1_MB29_DATA2)
1192#define bfin_write_CAN1_MB29_DATA2(val) bfin_write16(CAN1_MB29_DATA2, val)
1193#define bfin_read_CAN1_MB29_DATA3() bfin_read16(CAN1_MB29_DATA3)
1194#define bfin_write_CAN1_MB29_DATA3(val) bfin_write16(CAN1_MB29_DATA3, val)
1195#define bfin_read_CAN1_MB29_LENGTH() bfin_read16(CAN1_MB29_LENGTH)
1196#define bfin_write_CAN1_MB29_LENGTH(val) bfin_write16(CAN1_MB29_LENGTH, val)
1197#define bfin_read_CAN1_MB29_TIMESTAMP() bfin_read16(CAN1_MB29_TIMESTAMP)
1198#define bfin_write_CAN1_MB29_TIMESTAMP(val) bfin_write16(CAN1_MB29_TIMESTAMP, val)
1199#define bfin_read_CAN1_MB29_ID0() bfin_read16(CAN1_MB29_ID0)
1200#define bfin_write_CAN1_MB29_ID0(val) bfin_write16(CAN1_MB29_ID0, val)
1201#define bfin_read_CAN1_MB29_ID1() bfin_read16(CAN1_MB29_ID1)
1202#define bfin_write_CAN1_MB29_ID1(val) bfin_write16(CAN1_MB29_ID1, val)
1203#define bfin_read_CAN1_MB30_DATA0() bfin_read16(CAN1_MB30_DATA0)
1204#define bfin_write_CAN1_MB30_DATA0(val) bfin_write16(CAN1_MB30_DATA0, val)
1205#define bfin_read_CAN1_MB30_DATA1() bfin_read16(CAN1_MB30_DATA1)
1206#define bfin_write_CAN1_MB30_DATA1(val) bfin_write16(CAN1_MB30_DATA1, val)
1207#define bfin_read_CAN1_MB30_DATA2() bfin_read16(CAN1_MB30_DATA2)
1208#define bfin_write_CAN1_MB30_DATA2(val) bfin_write16(CAN1_MB30_DATA2, val)
1209#define bfin_read_CAN1_MB30_DATA3() bfin_read16(CAN1_MB30_DATA3)
1210#define bfin_write_CAN1_MB30_DATA3(val) bfin_write16(CAN1_MB30_DATA3, val)
1211#define bfin_read_CAN1_MB30_LENGTH() bfin_read16(CAN1_MB30_LENGTH)
1212#define bfin_write_CAN1_MB30_LENGTH(val) bfin_write16(CAN1_MB30_LENGTH, val)
1213#define bfin_read_CAN1_MB30_TIMESTAMP() bfin_read16(CAN1_MB30_TIMESTAMP)
1214#define bfin_write_CAN1_MB30_TIMESTAMP(val) bfin_write16(CAN1_MB30_TIMESTAMP, val)
1215#define bfin_read_CAN1_MB30_ID0() bfin_read16(CAN1_MB30_ID0)
1216#define bfin_write_CAN1_MB30_ID0(val) bfin_write16(CAN1_MB30_ID0, val)
1217#define bfin_read_CAN1_MB30_ID1() bfin_read16(CAN1_MB30_ID1)
1218#define bfin_write_CAN1_MB30_ID1(val) bfin_write16(CAN1_MB30_ID1, val)
1219#define bfin_read_CAN1_MB31_DATA0() bfin_read16(CAN1_MB31_DATA0)
1220#define bfin_write_CAN1_MB31_DATA0(val) bfin_write16(CAN1_MB31_DATA0, val)
1221#define bfin_read_CAN1_MB31_DATA1() bfin_read16(CAN1_MB31_DATA1)
1222#define bfin_write_CAN1_MB31_DATA1(val) bfin_write16(CAN1_MB31_DATA1, val)
1223#define bfin_read_CAN1_MB31_DATA2() bfin_read16(CAN1_MB31_DATA2)
1224#define bfin_write_CAN1_MB31_DATA2(val) bfin_write16(CAN1_MB31_DATA2, val)
1225#define bfin_read_CAN1_MB31_DATA3() bfin_read16(CAN1_MB31_DATA3)
1226#define bfin_write_CAN1_MB31_DATA3(val) bfin_write16(CAN1_MB31_DATA3, val)
1227#define bfin_read_CAN1_MB31_LENGTH() bfin_read16(CAN1_MB31_LENGTH)
1228#define bfin_write_CAN1_MB31_LENGTH(val) bfin_write16(CAN1_MB31_LENGTH, val)
1229#define bfin_read_CAN1_MB31_TIMESTAMP() bfin_read16(CAN1_MB31_TIMESTAMP)
1230#define bfin_write_CAN1_MB31_TIMESTAMP(val) bfin_write16(CAN1_MB31_TIMESTAMP, val)
1231#define bfin_read_CAN1_MB31_ID0() bfin_read16(CAN1_MB31_ID0)
1232#define bfin_write_CAN1_MB31_ID0(val) bfin_write16(CAN1_MB31_ID0, val)
1233#define bfin_read_CAN1_MB31_ID1() bfin_read16(CAN1_MB31_ID1)
1234#define bfin_write_CAN1_MB31_ID1(val) bfin_write16(CAN1_MB31_ID1, val)
1235
1236/* ATAPI Registers */
1237
1238#define bfin_read_ATAPI_CONTROL() bfin_read16(ATAPI_CONTROL)
1239#define bfin_write_ATAPI_CONTROL(val) bfin_write16(ATAPI_CONTROL, val)
1240#define bfin_read_ATAPI_STATUS() bfin_read16(ATAPI_STATUS)
1241#define bfin_write_ATAPI_STATUS(val) bfin_write16(ATAPI_STATUS, val)
1242#define bfin_read_ATAPI_DEV_ADDR() bfin_read16(ATAPI_DEV_ADDR)
1243#define bfin_write_ATAPI_DEV_ADDR(val) bfin_write16(ATAPI_DEV_ADDR, val)
1244#define bfin_read_ATAPI_DEV_TXBUF() bfin_read16(ATAPI_DEV_TXBUF)
1245#define bfin_write_ATAPI_DEV_TXBUF(val) bfin_write16(ATAPI_DEV_TXBUF, val)
1246#define bfin_read_ATAPI_DEV_RXBUF() bfin_read16(ATAPI_DEV_RXBUF)
1247#define bfin_write_ATAPI_DEV_RXBUF(val) bfin_write16(ATAPI_DEV_RXBUF, val)
1248#define bfin_read_ATAPI_INT_MASK() bfin_read16(ATAPI_INT_MASK)
1249#define bfin_write_ATAPI_INT_MASK(val) bfin_write16(ATAPI_INT_MASK, val)
1250#define bfin_read_ATAPI_INT_STATUS() bfin_read16(ATAPI_INT_STATUS)
1251#define bfin_write_ATAPI_INT_STATUS(val) bfin_write16(ATAPI_INT_STATUS, val)
1252#define bfin_read_ATAPI_XFER_LEN() bfin_read16(ATAPI_XFER_LEN)
1253#define bfin_write_ATAPI_XFER_LEN(val) bfin_write16(ATAPI_XFER_LEN, val)
1254#define bfin_read_ATAPI_LINE_STATUS() bfin_read16(ATAPI_LINE_STATUS)
1255#define bfin_write_ATAPI_LINE_STATUS(val) bfin_write16(ATAPI_LINE_STATUS, val)
1256#define bfin_read_ATAPI_SM_STATE() bfin_read16(ATAPI_SM_STATE)
1257#define bfin_write_ATAPI_SM_STATE(val) bfin_write16(ATAPI_SM_STATE, val)
1258#define bfin_read_ATAPI_TERMINATE() bfin_read16(ATAPI_TERMINATE)
1259#define bfin_write_ATAPI_TERMINATE(val) bfin_write16(ATAPI_TERMINATE, val)
1260#define bfin_read_ATAPI_PIO_TFRCNT() bfin_read16(ATAPI_PIO_TFRCNT)
1261#define bfin_write_ATAPI_PIO_TFRCNT(val) bfin_write16(ATAPI_PIO_TFRCNT, val)
1262#define bfin_read_ATAPI_DMA_TFRCNT() bfin_read16(ATAPI_DMA_TFRCNT)
1263#define bfin_write_ATAPI_DMA_TFRCNT(val) bfin_write16(ATAPI_DMA_TFRCNT, val)
1264#define bfin_read_ATAPI_UMAIN_TFRCNT() bfin_read16(ATAPI_UMAIN_TFRCNT)
1265#define bfin_write_ATAPI_UMAIN_TFRCNT(val) bfin_write16(ATAPI_UMAIN_TFRCNT, val)
1266#define bfin_read_ATAPI_UDMAOUT_TFRCNT() bfin_read16(ATAPI_UDMAOUT_TFRCNT)
1267#define bfin_write_ATAPI_UDMAOUT_TFRCNT(val) bfin_write16(ATAPI_UDMAOUT_TFRCNT, val)
1268#define bfin_read_ATAPI_REG_TIM_0() bfin_read16(ATAPI_REG_TIM_0)
1269#define bfin_write_ATAPI_REG_TIM_0(val) bfin_write16(ATAPI_REG_TIM_0, val)
1270#define bfin_read_ATAPI_PIO_TIM_0() bfin_read16(ATAPI_PIO_TIM_0)
1271#define bfin_write_ATAPI_PIO_TIM_0(val) bfin_write16(ATAPI_PIO_TIM_0, val)
1272#define bfin_read_ATAPI_PIO_TIM_1() bfin_read16(ATAPI_PIO_TIM_1)
1273#define bfin_write_ATAPI_PIO_TIM_1(val) bfin_write16(ATAPI_PIO_TIM_1, val)
1274#define bfin_read_ATAPI_MULTI_TIM_0() bfin_read16(ATAPI_MULTI_TIM_0)
1275#define bfin_write_ATAPI_MULTI_TIM_0(val) bfin_write16(ATAPI_MULTI_TIM_0, val)
1276#define bfin_read_ATAPI_MULTI_TIM_1() bfin_read16(ATAPI_MULTI_TIM_1)
1277#define bfin_write_ATAPI_MULTI_TIM_1(val) bfin_write16(ATAPI_MULTI_TIM_1, val)
1278#define bfin_read_ATAPI_MULTI_TIM_2() bfin_read16(ATAPI_MULTI_TIM_2)
1279#define bfin_write_ATAPI_MULTI_TIM_2(val) bfin_write16(ATAPI_MULTI_TIM_2, val)
1280#define bfin_read_ATAPI_ULTRA_TIM_0() bfin_read16(ATAPI_ULTRA_TIM_0)
1281#define bfin_write_ATAPI_ULTRA_TIM_0(val) bfin_write16(ATAPI_ULTRA_TIM_0, val)
1282#define bfin_read_ATAPI_ULTRA_TIM_1() bfin_read16(ATAPI_ULTRA_TIM_1)
1283#define bfin_write_ATAPI_ULTRA_TIM_1(val) bfin_write16(ATAPI_ULTRA_TIM_1, val)
1284#define bfin_read_ATAPI_ULTRA_TIM_2() bfin_read16(ATAPI_ULTRA_TIM_2)
1285#define bfin_write_ATAPI_ULTRA_TIM_2(val) bfin_write16(ATAPI_ULTRA_TIM_2, val)
1286#define bfin_read_ATAPI_ULTRA_TIM_3() bfin_read16(ATAPI_ULTRA_TIM_3)
1287#define bfin_write_ATAPI_ULTRA_TIM_3(val) bfin_write16(ATAPI_ULTRA_TIM_3, val)
1288
1289/* SDH Registers */
1290
1291#define bfin_read_SDH_PWR_CTL() bfin_read16(SDH_PWR_CTL)
1292#define bfin_write_SDH_PWR_CTL(val) bfin_write16(SDH_PWR_CTL, val)
1293#define bfin_read_SDH_CLK_CTL() bfin_read16(SDH_CLK_CTL)
1294#define bfin_write_SDH_CLK_CTL(val) bfin_write16(SDH_CLK_CTL, val)
1295#define bfin_read_SDH_ARGUMENT() bfin_read32(SDH_ARGUMENT)
1296#define bfin_write_SDH_ARGUMENT(val) bfin_write32(SDH_ARGUMENT, val)
1297#define bfin_read_SDH_COMMAND() bfin_read16(SDH_COMMAND)
1298#define bfin_write_SDH_COMMAND(val) bfin_write16(SDH_COMMAND, val)
1299#define bfin_read_SDH_RESP_CMD() bfin_read16(SDH_RESP_CMD)
1300#define bfin_write_SDH_RESP_CMD(val) bfin_write16(SDH_RESP_CMD, val)
1301#define bfin_read_SDH_RESPONSE0() bfin_read32(SDH_RESPONSE0)
1302#define bfin_write_SDH_RESPONSE0(val) bfin_write32(SDH_RESPONSE0, val)
1303#define bfin_read_SDH_RESPONSE1() bfin_read32(SDH_RESPONSE1)
1304#define bfin_write_SDH_RESPONSE1(val) bfin_write32(SDH_RESPONSE1, val)
1305#define bfin_read_SDH_RESPONSE2() bfin_read32(SDH_RESPONSE2)
1306#define bfin_write_SDH_RESPONSE2(val) bfin_write32(SDH_RESPONSE2, val)
1307#define bfin_read_SDH_RESPONSE3() bfin_read32(SDH_RESPONSE3)
1308#define bfin_write_SDH_RESPONSE3(val) bfin_write32(SDH_RESPONSE3, val)
1309#define bfin_read_SDH_DATA_TIMER() bfin_read32(SDH_DATA_TIMER)
1310#define bfin_write_SDH_DATA_TIMER(val) bfin_write32(SDH_DATA_TIMER, val)
1311#define bfin_read_SDH_DATA_LGTH() bfin_read16(SDH_DATA_LGTH)
1312#define bfin_write_SDH_DATA_LGTH(val) bfin_write16(SDH_DATA_LGTH, val)
1313#define bfin_read_SDH_DATA_CTL() bfin_read16(SDH_DATA_CTL)
1314#define bfin_write_SDH_DATA_CTL(val) bfin_write16(SDH_DATA_CTL, val)
1315#define bfin_read_SDH_DATA_CNT() bfin_read16(SDH_DATA_CNT)
1316#define bfin_write_SDH_DATA_CNT(val) bfin_write16(SDH_DATA_CNT, val)
1317#define bfin_read_SDH_STATUS() bfin_read32(SDH_STATUS)
1318#define bfin_write_SDH_STATUS(val) bfin_write32(SDH_STATUS, val)
1319#define bfin_read_SDH_STATUS_CLR() bfin_read16(SDH_STATUS_CLR)
1320#define bfin_write_SDH_STATUS_CLR(val) bfin_write16(SDH_STATUS_CLR, val)
1321#define bfin_read_SDH_MASK0() bfin_read32(SDH_MASK0)
1322#define bfin_write_SDH_MASK0(val) bfin_write32(SDH_MASK0, val)
1323#define bfin_read_SDH_MASK1() bfin_read32(SDH_MASK1)
1324#define bfin_write_SDH_MASK1(val) bfin_write32(SDH_MASK1, val)
1325#define bfin_read_SDH_FIFO_CNT() bfin_read16(SDH_FIFO_CNT)
1326#define bfin_write_SDH_FIFO_CNT(val) bfin_write16(SDH_FIFO_CNT, val)
1327#define bfin_read_SDH_FIFO() bfin_read32(SDH_FIFO)
1328#define bfin_write_SDH_FIFO(val) bfin_write32(SDH_FIFO, val)
1329#define bfin_read_SDH_E_STATUS() bfin_read16(SDH_E_STATUS)
1330#define bfin_write_SDH_E_STATUS(val) bfin_write16(SDH_E_STATUS, val)
1331#define bfin_read_SDH_E_MASK() bfin_read16(SDH_E_MASK)
1332#define bfin_write_SDH_E_MASK(val) bfin_write16(SDH_E_MASK, val)
1333#define bfin_read_SDH_CFG() bfin_read16(SDH_CFG)
1334#define bfin_write_SDH_CFG(val) bfin_write16(SDH_CFG, val)
1335#define bfin_read_SDH_RD_WAIT_EN() bfin_read16(SDH_RD_WAIT_EN)
1336#define bfin_write_SDH_RD_WAIT_EN(val) bfin_write16(SDH_RD_WAIT_EN, val)
1337#define bfin_read_SDH_PID0() bfin_read16(SDH_PID0)
1338#define bfin_write_SDH_PID0(val) bfin_write16(SDH_PID0, val)
1339#define bfin_read_SDH_PID1() bfin_read16(SDH_PID1)
1340#define bfin_write_SDH_PID1(val) bfin_write16(SDH_PID1, val)
1341#define bfin_read_SDH_PID2() bfin_read16(SDH_PID2)
1342#define bfin_write_SDH_PID2(val) bfin_write16(SDH_PID2, val)
1343#define bfin_read_SDH_PID3() bfin_read16(SDH_PID3)
1344#define bfin_write_SDH_PID3(val) bfin_write16(SDH_PID3, val)
1345#define bfin_read_SDH_PID4() bfin_read16(SDH_PID4)
1346#define bfin_write_SDH_PID4(val) bfin_write16(SDH_PID4, val)
1347#define bfin_read_SDH_PID5() bfin_read16(SDH_PID5)
1348#define bfin_write_SDH_PID5(val) bfin_write16(SDH_PID5, val)
1349#define bfin_read_SDH_PID6() bfin_read16(SDH_PID6)
1350#define bfin_write_SDH_PID6(val) bfin_write16(SDH_PID6, val)
1351#define bfin_read_SDH_PID7() bfin_read16(SDH_PID7)
1352#define bfin_write_SDH_PID7(val) bfin_write16(SDH_PID7, val)
1353
1354/* HOST Port Registers */
1355
1356#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
1357#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
1358#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
1359#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
1360#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
1361#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
1362
1363/* USB Control Registers */
1364
1365#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
1366#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
1367#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
1368#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
1369#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
1370#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
1371#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
1372#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
1373#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
1374#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
1375#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
1376#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
1377#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
1378#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
1379#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
1380#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
1381#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
1382#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
1383#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
1384#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
1385#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
1386#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
1387#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
1388#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
1389#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
1390#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
1391
1392/* USB Packet Control Registers */
1393
1394#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
1395#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
1396#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
1397#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
1398#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
1399#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
1400#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
1401#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
1402#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
1403#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
1404#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
1405#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
1406#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
1407#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
1408#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
1409#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
1410#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
1411#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
1412#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
1413#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
1414#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
1415#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
1416#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
1417#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
1418#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
1419#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
1420
1421/* USB Endbfin_read_()oint FIFO Registers */
1422
1423#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
1424#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
1425#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
1426#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
1427#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
1428#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
1429#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
1430#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
1431#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
1432#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
1433#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
1434#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
1435#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
1436#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
1437#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
1438#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
1439
1440/* USB OTG Control Registers */
1441
1442#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
1443#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
1444#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
1445#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
1446#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
1447#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
1448
1449/* USB Phy Control Registers */
1450
1451#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
1452#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
1453#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
1454#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
1455#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
1456#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
1457#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
1458#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
1459#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
1460#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
1461
1462/* (APHY_CNTRL is for ADI usage only) */
1463
1464#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
1465#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
1466
1467/* (APHY_CALIB is for ADI usage only) */
1468
1469#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
1470#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
1471#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
1472#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
1473
1474/* (PHY_TEST is for ADI usage only) */
1475
1476#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
1477#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
1478#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
1479#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
1480#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
1481#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
1482
1483/* USB Endbfin_read_()oint 0 Control Registers */
1484
1485#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
1486#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
1487#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
1488#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
1489#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
1490#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
1491#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
1492#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
1493#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
1494#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
1495#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
1496#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
1497#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
1498#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
1499#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
1500#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
1501#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
1502#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
1503
1504/* USB Endbfin_read_()oint 1 Control Registers */
1505
1506#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
1507#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
1508#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
1509#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
1510#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
1511#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
1512#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
1513#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
1514#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
1515#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
1516#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
1517#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
1518#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
1519#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
1520#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
1521#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
1522#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
1523#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
1524#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
1525#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
1526
1527/* USB Endbfin_read_()oint 2 Control Registers */
1528
1529#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
1530#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
1531#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
1532#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
1533#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
1534#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
1535#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
1536#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
1537#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
1538#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
1539#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
1540#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
1541#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
1542#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
1543#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
1544#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
1545#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
1546#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
1547#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
1548#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
1549
1550/* USB Endbfin_read_()oint 3 Control Registers */
1551
1552#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
1553#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
1554#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
1555#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
1556#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
1557#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
1558#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
1559#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
1560#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
1561#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
1562#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
1563#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
1564#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
1565#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
1566#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
1567#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
1568#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
1569#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
1570#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
1571#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
1572
1573/* USB Endbfin_read_()oint 4 Control Registers */
1574
1575#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
1576#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
1577#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
1578#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
1579#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
1580#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
1581#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
1582#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
1583#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
1584#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
1585#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
1586#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
1587#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
1588#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
1589#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
1590#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
1591#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
1592#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
1593#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
1594#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
1595
1596/* USB Endbfin_read_()oint 5 Control Registers */
1597
1598#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
1599#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
1600#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
1601#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
1602#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
1603#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
1604#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
1605#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
1606#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
1607#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
1608#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
1609#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
1610#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
1611#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
1612#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
1613#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
1614#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
1615#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
1616#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
1617#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
1618
1619/* USB Endbfin_read_()oint 6 Control Registers */
1620
1621#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
1622#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
1623#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
1624#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
1625#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
1626#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
1627#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
1628#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
1629#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
1630#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
1631#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
1632#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
1633#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
1634#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
1635#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
1636#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
1637#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
1638#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
1639#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
1640#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
1641
1642/* USB Endbfin_read_()oint 7 Control Registers */
1643
1644#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
1645#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
1646#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
1647#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
1648#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
1649#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
1650#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
1651#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
1652#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
1653#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
1654#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
1655#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
1656#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
1657#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
1658#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
1659#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
1660#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
1661#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
1662#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
1663#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
1664#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
1665#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
1666#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
1667#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
1668
1669/* USB Channel 0 Config Registers */
1670
1671#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
1672#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
1673#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
1674#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
1675#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
1676#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
1677#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
1678#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
1679#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
1680#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
1681
1682/* USB Channel 1 Config Registers */
1683
1684#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
1685#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
1686#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
1687#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
1688#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
1689#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
1690#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
1691#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
1692#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
1693#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
1694
1695/* USB Channel 2 Config Registers */
1696
1697#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
1698#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
1699#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
1700#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
1701#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
1702#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
1703#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
1704#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
1705#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
1706#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
1707
1708/* USB Channel 3 Config Registers */
1709
1710#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
1711#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
1712#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
1713#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
1714#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
1715#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
1716#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
1717#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
1718#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
1719#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
1720
1721/* USB Channel 4 Config Registers */
1722
1723#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
1724#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
1725#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
1726#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
1727#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
1728#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
1729#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
1730#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
1731#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
1732#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
1733
1734/* USB Channel 5 Config Registers */
1735
1736#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
1737#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
1738#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
1739#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
1740#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
1741#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
1742#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
1743#define bfin_write_USB_DMA5COUNTLOW(val) bfin_write16(USB_DMA5COUNTLOW, val)
1744#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
1745#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
1746
1747/* USB Channel 6 Config Registers */
1748
1749#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
1750#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
1751#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
1752#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
1753#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
1754#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
1755#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
1756#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
1757#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
1758#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
1759
1760/* USB Channel 7 Config Registers */
1761
1762#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
1763#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
1764#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
1765#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
1766#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
1767#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
1768#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
1769#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
1770#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
1771#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
1772
1773/* Keybfin_read_()ad Registers */
1774
1775#define bfin_read_KPAD_CTL() bfin_read16(KPAD_CTL)
1776#define bfin_write_KPAD_CTL(val) bfin_write16(KPAD_CTL, val)
1777#define bfin_read_KPAD_PRESCALE() bfin_read16(KPAD_PRESCALE)
1778#define bfin_write_KPAD_PRESCALE(val) bfin_write16(KPAD_PRESCALE, val)
1779#define bfin_read_KPAD_MSEL() bfin_read16(KPAD_MSEL)
1780#define bfin_write_KPAD_MSEL(val) bfin_write16(KPAD_MSEL, val)
1781#define bfin_read_KPAD_ROWCOL() bfin_read16(KPAD_ROWCOL)
1782#define bfin_write_KPAD_ROWCOL(val) bfin_write16(KPAD_ROWCOL, val)
1783#define bfin_read_KPAD_STAT() bfin_read16(KPAD_STAT)
1784#define bfin_write_KPAD_STAT(val) bfin_write16(KPAD_STAT, val)
1785#define bfin_read_KPAD_SOFTEVAL() bfin_read16(KPAD_SOFTEVAL)
1786#define bfin_write_KPAD_SOFTEVAL(val) bfin_write16(KPAD_SOFTEVAL, val)
1787
1788/* Pixel Combfin_read_()ositor (PIXC) Registers */
1789
1790#define bfin_read_PIXC_CTL() bfin_read16(PIXC_CTL)
1791#define bfin_write_PIXC_CTL(val) bfin_write16(PIXC_CTL, val)
1792#define bfin_read_PIXC_PPL() bfin_read16(PIXC_PPL)
1793#define bfin_write_PIXC_PPL(val) bfin_write16(PIXC_PPL, val)
1794#define bfin_read_PIXC_LPF() bfin_read16(PIXC_LPF)
1795#define bfin_write_PIXC_LPF(val) bfin_write16(PIXC_LPF, val)
1796#define bfin_read_PIXC_AHSTART() bfin_read16(PIXC_AHSTART)
1797#define bfin_write_PIXC_AHSTART(val) bfin_write16(PIXC_AHSTART, val)
1798#define bfin_read_PIXC_AHEND() bfin_read16(PIXC_AHEND)
1799#define bfin_write_PIXC_AHEND(val) bfin_write16(PIXC_AHEND, val)
1800#define bfin_read_PIXC_AVSTART() bfin_read16(PIXC_AVSTART)
1801#define bfin_write_PIXC_AVSTART(val) bfin_write16(PIXC_AVSTART, val)
1802#define bfin_read_PIXC_AVEND() bfin_read16(PIXC_AVEND)
1803#define bfin_write_PIXC_AVEND(val) bfin_write16(PIXC_AVEND, val)
1804#define bfin_read_PIXC_ATRANSP() bfin_read16(PIXC_ATRANSP)
1805#define bfin_write_PIXC_ATRANSP(val) bfin_write16(PIXC_ATRANSP, val)
1806#define bfin_read_PIXC_BHSTART() bfin_read16(PIXC_BHSTART)
1807#define bfin_write_PIXC_BHSTART(val) bfin_write16(PIXC_BHSTART, val)
1808#define bfin_read_PIXC_BHEND() bfin_read16(PIXC_BHEND)
1809#define bfin_write_PIXC_BHEND(val) bfin_write16(PIXC_BHEND, val)
1810#define bfin_read_PIXC_BVSTART() bfin_read16(PIXC_BVSTART)
1811#define bfin_write_PIXC_BVSTART(val) bfin_write16(PIXC_BVSTART, val)
1812#define bfin_read_PIXC_BVEND() bfin_read16(PIXC_BVEND)
1813#define bfin_write_PIXC_BVEND(val) bfin_write16(PIXC_BVEND, val)
1814#define bfin_read_PIXC_BTRANSP() bfin_read16(PIXC_BTRANSP)
1815#define bfin_write_PIXC_BTRANSP(val) bfin_write16(PIXC_BTRANSP, val)
1816#define bfin_read_PIXC_INTRSTAT() bfin_read16(PIXC_INTRSTAT)
1817#define bfin_write_PIXC_INTRSTAT(val) bfin_write16(PIXC_INTRSTAT, val)
1818#define bfin_read_PIXC_RYCON() bfin_read32(PIXC_RYCON)
1819#define bfin_write_PIXC_RYCON(val) bfin_write32(PIXC_RYCON, val)
1820#define bfin_read_PIXC_GUCON() bfin_read32(PIXC_GUCON)
1821#define bfin_write_PIXC_GUCON(val) bfin_write32(PIXC_GUCON, val)
1822#define bfin_read_PIXC_BVCON() bfin_read32(PIXC_BVCON)
1823#define bfin_write_PIXC_BVCON(val) bfin_write32(PIXC_BVCON, val)
1824#define bfin_read_PIXC_CCBIAS() bfin_read32(PIXC_CCBIAS)
1825#define bfin_write_PIXC_CCBIAS(val) bfin_write32(PIXC_CCBIAS, val)
1826#define bfin_read_PIXC_TC() bfin_read32(PIXC_TC)
1827#define bfin_write_PIXC_TC(val) bfin_write32(PIXC_TC, val)
1828
1829/* Handshake MDMA 0 Registers */
1830
1831#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1832#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
1833#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1834#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
1835#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1836#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
1837#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1838#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
1839#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1840#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
1841#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1842#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
1843#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1844#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
1845
1846/* Handshake MDMA 1 Registers */
1847
1848#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1849#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
1850#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1851#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
1852#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1853#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
1854#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1855#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
1856#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1857#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
1858#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1859#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
1860#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1861#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
1862
1863#endif /* _CDEF_BF549_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
deleted file mode 100644
index 57ac8cb9b1f6..000000000000
--- a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
+++ /dev/null
@@ -1,2750 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/cdefBF54x_base.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_BF54X_H
32#define _CDEF_BF54X_H
33
34#include <asm/blackfin.h>
35
36#include "defBF54x_base.h"
37#include <asm/system.h>
38
39/* ************************************************************** */
40/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */
41/* ************************************************************** */
42
43/* PLL Registers */
44
45#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
46/* Writing to PLL_CTL initiates a PLL relock sequence. */
47static __inline__ void bfin_write_PLL_CTL(unsigned int val)
48{
49 unsigned long flags, iwr0, iwr1, iwr2;
50
51 if (val == bfin_read_PLL_CTL())
52 return;
53
54 local_irq_save(flags);
55 /* Enable the PLL Wakeup bit in SIC IWR */
56 iwr0 = bfin_read32(SIC_IWR0);
57 iwr1 = bfin_read32(SIC_IWR1);
58 iwr2 = bfin_read32(SIC_IWR2);
59 /* Only allow PPL Wakeup) */
60 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
61 bfin_write32(SIC_IWR1, 0);
62 bfin_write32(SIC_IWR2, 0);
63
64 bfin_write16(PLL_CTL, val);
65 SSYNC();
66 asm("IDLE;");
67
68 bfin_write32(SIC_IWR0, iwr0);
69 bfin_write32(SIC_IWR1, iwr1);
70 bfin_write32(SIC_IWR2, iwr2);
71 local_irq_restore(flags);
72}
73#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
74#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
75#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
76/* Writing to VR_CTL initiates a PLL relock sequence. */
77static __inline__ void bfin_write_VR_CTL(unsigned int val)
78{
79 unsigned long flags, iwr0, iwr1, iwr2;
80
81 if (val == bfin_read_VR_CTL())
82 return;
83
84 local_irq_save(flags);
85 /* Enable the PLL Wakeup bit in SIC IWR */
86 iwr0 = bfin_read32(SIC_IWR0);
87 iwr1 = bfin_read32(SIC_IWR1);
88 iwr2 = bfin_read32(SIC_IWR2);
89 /* Only allow PPL Wakeup) */
90 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
91 bfin_write32(SIC_IWR1, 0);
92 bfin_write32(SIC_IWR2, 0);
93
94 bfin_write16(VR_CTL, val);
95 SSYNC();
96 asm("IDLE;");
97
98 bfin_write32(SIC_IWR0, iwr0);
99 bfin_write32(SIC_IWR1, iwr1);
100 bfin_write32(SIC_IWR2, iwr2);
101 local_irq_restore(flags);
102}
103#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
104#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
105#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
106#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT, val)
107
108/* Debug/MP/Emulation Registers (0xFFC00014 - 0xFFC00014) */
109
110#define bfin_read_CHIPID() bfin_read32(CHIPID)
111#define bfin_write_CHIPID(val) bfin_write32(CHIPID, val)
112
113/* System Reset and Interrubfin_read_()t Controller (0xFFC00100 - 0xFFC00104) */
114
115#define bfin_read_SWRST() bfin_read16(SWRST)
116#define bfin_write_SWRST(val) bfin_write16(SWRST, val)
117#define bfin_read_SYSCR() bfin_read16(SYSCR)
118#define bfin_write_SYSCR(val) bfin_write16(SYSCR, val)
119
120/* SIC Registers */
121
122#define bfin_read_SIC_IMASK0() bfin_read32(SIC_IMASK0)
123#define bfin_write_SIC_IMASK0(val) bfin_write32(SIC_IMASK0, val)
124#define bfin_read_SIC_IMASK1() bfin_read32(SIC_IMASK1)
125#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
126#define bfin_read_SIC_IMASK2() bfin_read32(SIC_IMASK2)
127#define bfin_write_SIC_IMASK2(val) bfin_write32(SIC_IMASK2, val)
128#define bfin_read_SIC_IMASK(x) bfin_read32(SIC_IMASK0 + (x << 2))
129#define bfin_write_SIC_IMASK(x, val) bfin_write32((SIC_IMASK0 + (x << 2)), val)
130
131#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
132#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
133#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
134#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
135#define bfin_read_SIC_ISR2() bfin_read32(SIC_ISR2)
136#define bfin_write_SIC_ISR2(val) bfin_write32(SIC_ISR2, val)
137#define bfin_read_SIC_ISR(x) bfin_read32(SIC_ISR0 + (x << 2))
138#define bfin_write_SIC_ISR(x, val) bfin_write32((SIC_ISR0 + (x << 2)), val)
139
140#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
141#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
142#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
143#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
144#define bfin_read_SIC_IWR2() bfin_read32(SIC_IWR2)
145#define bfin_write_SIC_IWR2(val) bfin_write32(SIC_IWR2, val)
146#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
147#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
148#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
149#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1, val)
150#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
151#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2, val)
152#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
153#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3, val)
154#define bfin_read_SIC_IAR4() bfin_read32(SIC_IAR4)
155#define bfin_write_SIC_IAR4(val) bfin_write32(SIC_IAR4, val)
156#define bfin_read_SIC_IAR5() bfin_read32(SIC_IAR5)
157#define bfin_write_SIC_IAR5(val) bfin_write32(SIC_IAR5, val)
158#define bfin_read_SIC_IAR6() bfin_read32(SIC_IAR6)
159#define bfin_write_SIC_IAR6(val) bfin_write32(SIC_IAR6, val)
160#define bfin_read_SIC_IAR7() bfin_read32(SIC_IAR7)
161#define bfin_write_SIC_IAR7(val) bfin_write32(SIC_IAR7, val)
162#define bfin_read_SIC_IAR8() bfin_read32(SIC_IAR8)
163#define bfin_write_SIC_IAR8(val) bfin_write32(SIC_IAR8, val)
164#define bfin_read_SIC_IAR9() bfin_read32(SIC_IAR9)
165#define bfin_write_SIC_IAR9(val) bfin_write32(SIC_IAR9, val)
166#define bfin_read_SIC_IAR10() bfin_read32(SIC_IAR10)
167#define bfin_write_SIC_IAR10(val) bfin_write32(SIC_IAR10, val)
168#define bfin_read_SIC_IAR11() bfin_read32(SIC_IAR11)
169#define bfin_write_SIC_IAR11(val) bfin_write32(SIC_IAR11, val)
170
171/* Watchdog Timer Registers */
172
173#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
174#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL, val)
175#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
176#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT, val)
177#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
178#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT, val)
179
180/* RTC Registers */
181
182#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
183#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT, val)
184#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
185#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL, val)
186#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
187#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT, val)
188#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
189#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT, val)
190#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
191#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM, val)
192#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
193#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN, val)
194
195/* UART0 Registers */
196
197#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
198#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL, val)
199#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
200#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH, val)
201#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
202#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL, val)
203#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
204#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR, val)
205#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
206#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR, val)
207#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
208#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR, val)
209#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
210#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR, val)
211#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
212#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR, val)
213#define bfin_read_UART0_IER_SET() bfin_read16(UART0_IER_SET)
214#define bfin_write_UART0_IER_SET(val) bfin_write16(UART0_IER_SET, val)
215#define bfin_read_UART0_IER_CLEAR() bfin_read16(UART0_IER_CLEAR)
216#define bfin_write_UART0_IER_CLEAR(val) bfin_write16(UART0_IER_CLEAR, val)
217#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
218#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR, val)
219#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
220#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR, val)
221
222/* SPI0 Registers */
223
224#define bfin_read_SPI0_CTL() bfin_read16(SPI0_CTL)
225#define bfin_write_SPI0_CTL(val) bfin_write16(SPI0_CTL, val)
226#define bfin_read_SPI0_FLG() bfin_read16(SPI0_FLG)
227#define bfin_write_SPI0_FLG(val) bfin_write16(SPI0_FLG, val)
228#define bfin_read_SPI0_STAT() bfin_read16(SPI0_STAT)
229#define bfin_write_SPI0_STAT(val) bfin_write16(SPI0_STAT, val)
230#define bfin_read_SPI0_TDBR() bfin_read16(SPI0_TDBR)
231#define bfin_write_SPI0_TDBR(val) bfin_write16(SPI0_TDBR, val)
232#define bfin_read_SPI0_RDBR() bfin_read16(SPI0_RDBR)
233#define bfin_write_SPI0_RDBR(val) bfin_write16(SPI0_RDBR, val)
234#define bfin_read_SPI0_BAUD() bfin_read16(SPI0_BAUD)
235#define bfin_write_SPI0_BAUD(val) bfin_write16(SPI0_BAUD, val)
236#define bfin_read_SPI0_SHADOW() bfin_read16(SPI0_SHADOW)
237#define bfin_write_SPI0_SHADOW(val) bfin_write16(SPI0_SHADOW, val)
238
239/* Timer Groubfin_read_() of 3 registers are not defined in the shared file because they are not available on the ADSP-BF542 processor */
240
241/* Two Wire Interface Registers (TWI0) */
242
243/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */
244
245/* SPORT1 Registers */
246
247#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
248#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1, val)
249#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
250#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2, val)
251#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
252#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
253#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
254#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV, val)
255#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
256#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX, val)
257#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
258#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX, val)
259#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
260#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1, val)
261#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
262#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2, val)
263#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
264#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
265#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
266#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV, val)
267#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
268#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT, val)
269#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
270#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL, val)
271#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
272#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1, val)
273#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
274#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2, val)
275#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
276#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0, val)
277#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
278#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1, val)
279#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
280#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2, val)
281#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
282#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3, val)
283#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
284#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0, val)
285#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
286#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1, val)
287#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
288#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2, val)
289#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
290#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3, val)
291
292/* Asynchronous Memory Control Registers */
293
294#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
295#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL, val)
296#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
297#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0, val)
298#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
299#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1, val)
300#define bfin_read_EBIU_MBSCTL() bfin_read16(EBIU_MBSCTL)
301#define bfin_write_EBIU_MBSCTL(val) bfin_write16(EBIU_MBSCTL, val)
302#define bfin_read_EBIU_ARBSTAT() bfin_read32(EBIU_ARBSTAT)
303#define bfin_write_EBIU_ARBSTAT(val) bfin_write32(EBIU_ARBSTAT, val)
304#define bfin_read_EBIU_MODE() bfin_read32(EBIU_MODE)
305#define bfin_write_EBIU_MODE(val) bfin_write32(EBIU_MODE, val)
306#define bfin_read_EBIU_FCTL() bfin_read16(EBIU_FCTL)
307#define bfin_write_EBIU_FCTL(val) bfin_write16(EBIU_FCTL, val)
308
309/* DDR Memory Control Registers */
310
311#define bfin_read_EBIU_DDRCTL0() bfin_read32(EBIU_DDRCTL0)
312#define bfin_write_EBIU_DDRCTL0(val) bfin_write32(EBIU_DDRCTL0, val)
313#define bfin_read_EBIU_DDRCTL1() bfin_read32(EBIU_DDRCTL1)
314#define bfin_write_EBIU_DDRCTL1(val) bfin_write32(EBIU_DDRCTL1, val)
315#define bfin_read_EBIU_DDRCTL2() bfin_read32(EBIU_DDRCTL2)
316#define bfin_write_EBIU_DDRCTL2(val) bfin_write32(EBIU_DDRCTL2, val)
317#define bfin_read_EBIU_DDRCTL3() bfin_read32(EBIU_DDRCTL3)
318#define bfin_write_EBIU_DDRCTL3(val) bfin_write32(EBIU_DDRCTL3, val)
319#define bfin_read_EBIU_DDRQUE() bfin_read32(EBIU_DDRQUE)
320#define bfin_write_EBIU_DDRQUE(val) bfin_write32(EBIU_DDRQUE, val)
321#define bfin_read_EBIU_ERRADD() bfin_read32(EBIU_ERRADD)
322#define bfin_write_EBIU_ERRADD(val) bfin_write32(EBIU_ERRADD, val)
323#define bfin_read_EBIU_ERRMST() bfin_read16(EBIU_ERRMST)
324#define bfin_write_EBIU_ERRMST(val) bfin_write16(EBIU_ERRMST, val)
325#define bfin_read_EBIU_RSTCTL() bfin_read16(EBIU_RSTCTL)
326#define bfin_write_EBIU_RSTCTL(val) bfin_write16(EBIU_RSTCTL, val)
327
328/* DDR BankRead and Write Count Registers */
329
330#define bfin_read_EBIU_DDRBRC0() bfin_read32(EBIU_DDRBRC0)
331#define bfin_write_EBIU_DDRBRC0(val) bfin_write32(EBIU_DDRBRC0, val)
332#define bfin_read_EBIU_DDRBRC1() bfin_read32(EBIU_DDRBRC1)
333#define bfin_write_EBIU_DDRBRC1(val) bfin_write32(EBIU_DDRBRC1, val)
334#define bfin_read_EBIU_DDRBRC2() bfin_read32(EBIU_DDRBRC2)
335#define bfin_write_EBIU_DDRBRC2(val) bfin_write32(EBIU_DDRBRC2, val)
336#define bfin_read_EBIU_DDRBRC3() bfin_read32(EBIU_DDRBRC3)
337#define bfin_write_EBIU_DDRBRC3(val) bfin_write32(EBIU_DDRBRC3, val)
338#define bfin_read_EBIU_DDRBRC4() bfin_read32(EBIU_DDRBRC4)
339#define bfin_write_EBIU_DDRBRC4(val) bfin_write32(EBIU_DDRBRC4, val)
340#define bfin_read_EBIU_DDRBRC5() bfin_read32(EBIU_DDRBRC5)
341#define bfin_write_EBIU_DDRBRC5(val) bfin_write32(EBIU_DDRBRC5, val)
342#define bfin_read_EBIU_DDRBRC6() bfin_read32(EBIU_DDRBRC6)
343#define bfin_write_EBIU_DDRBRC6(val) bfin_write32(EBIU_DDRBRC6, val)
344#define bfin_read_EBIU_DDRBRC7() bfin_read32(EBIU_DDRBRC7)
345#define bfin_write_EBIU_DDRBRC7(val) bfin_write32(EBIU_DDRBRC7, val)
346#define bfin_read_EBIU_DDRBWC0() bfin_read32(EBIU_DDRBWC0)
347#define bfin_write_EBIU_DDRBWC0(val) bfin_write32(EBIU_DDRBWC0, val)
348#define bfin_read_EBIU_DDRBWC1() bfin_read32(EBIU_DDRBWC1)
349#define bfin_write_EBIU_DDRBWC1(val) bfin_write32(EBIU_DDRBWC1, val)
350#define bfin_read_EBIU_DDRBWC2() bfin_read32(EBIU_DDRBWC2)
351#define bfin_write_EBIU_DDRBWC2(val) bfin_write32(EBIU_DDRBWC2, val)
352#define bfin_read_EBIU_DDRBWC3() bfin_read32(EBIU_DDRBWC3)
353#define bfin_write_EBIU_DDRBWC3(val) bfin_write32(EBIU_DDRBWC3, val)
354#define bfin_read_EBIU_DDRBWC4() bfin_read32(EBIU_DDRBWC4)
355#define bfin_write_EBIU_DDRBWC4(val) bfin_write32(EBIU_DDRBWC4, val)
356#define bfin_read_EBIU_DDRBWC5() bfin_read32(EBIU_DDRBWC5)
357#define bfin_write_EBIU_DDRBWC5(val) bfin_write32(EBIU_DDRBWC5, val)
358#define bfin_read_EBIU_DDRBWC6() bfin_read32(EBIU_DDRBWC6)
359#define bfin_write_EBIU_DDRBWC6(val) bfin_write32(EBIU_DDRBWC6, val)
360#define bfin_read_EBIU_DDRBWC7() bfin_read32(EBIU_DDRBWC7)
361#define bfin_write_EBIU_DDRBWC7(val) bfin_write32(EBIU_DDRBWC7, val)
362#define bfin_read_EBIU_DDRACCT() bfin_read32(EBIU_DDRACCT)
363#define bfin_write_EBIU_DDRACCT(val) bfin_write32(EBIU_DDRACCT, val)
364#define bfin_read_EBIU_DDRTACT() bfin_read32(EBIU_DDRTACT)
365#define bfin_write_EBIU_DDRTACT(val) bfin_write32(EBIU_DDRTACT, val)
366#define bfin_read_EBIU_DDRARCT() bfin_read32(EBIU_DDRARCT)
367#define bfin_write_EBIU_DDRARCT(val) bfin_write32(EBIU_DDRARCT, val)
368#define bfin_read_EBIU_DDRGC0() bfin_read32(EBIU_DDRGC0)
369#define bfin_write_EBIU_DDRGC0(val) bfin_write32(EBIU_DDRGC0, val)
370#define bfin_read_EBIU_DDRGC1() bfin_read32(EBIU_DDRGC1)
371#define bfin_write_EBIU_DDRGC1(val) bfin_write32(EBIU_DDRGC1, val)
372#define bfin_read_EBIU_DDRGC2() bfin_read32(EBIU_DDRGC2)
373#define bfin_write_EBIU_DDRGC2(val) bfin_write32(EBIU_DDRGC2, val)
374#define bfin_read_EBIU_DDRGC3() bfin_read32(EBIU_DDRGC3)
375#define bfin_write_EBIU_DDRGC3(val) bfin_write32(EBIU_DDRGC3, val)
376#define bfin_read_EBIU_DDRMCEN() bfin_read32(EBIU_DDRMCEN)
377#define bfin_write_EBIU_DDRMCEN(val) bfin_write32(EBIU_DDRMCEN, val)
378#define bfin_read_EBIU_DDRMCCL() bfin_read32(EBIU_DDRMCCL)
379#define bfin_write_EBIU_DDRMCCL(val) bfin_write32(EBIU_DDRMCCL, val)
380
381/* DMAC0 Registers */
382
383#define bfin_read_DMAC0_TCPER() bfin_read16(DMAC0_TCPER)
384#define bfin_write_DMAC0_TCPER(val) bfin_write16(DMAC0_TCPER, val)
385#define bfin_read_DMAC0_TCCNT() bfin_read16(DMAC0_TCCNT)
386#define bfin_write_DMAC0_TCCNT(val) bfin_write16(DMAC0_TCCNT, val)
387
388/* DMA Channel 0 Registers */
389
390#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
391#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR, val)
392#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
393#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR, val)
394#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
395#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG, val)
396#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
397#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT, val)
398#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
399#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY, val)
400#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
401#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT, val)
402#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
403#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY, val)
404#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
405#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR, val)
406#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
407#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR, val)
408#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
409#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
410#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
411#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
412#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
413#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
414#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
415#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
416
417/* DMA Channel 1 Registers */
418
419#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
420#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR, val)
421#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
422#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR, val)
423#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
424#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG, val)
425#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
426#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT, val)
427#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
428#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY, val)
429#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
430#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT, val)
431#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
432#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY, val)
433#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
434#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR, val)
435#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
436#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR, val)
437#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
438#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
439#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
440#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
441#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
442#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
443#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
444#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
445
446/* DMA Channel 2 Registers */
447
448#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
449#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR, val)
450#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
451#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR, val)
452#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
453#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG, val)
454#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
455#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT, val)
456#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
457#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY, val)
458#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
459#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT, val)
460#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
461#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY, val)
462#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
463#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR, val)
464#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
465#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR, val)
466#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
467#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
468#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
469#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
470#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
471#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
472#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
473#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
474
475/* DMA Channel 3 Registers */
476
477#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
478#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR, val)
479#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
480#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR, val)
481#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
482#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG, val)
483#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
484#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT, val)
485#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
486#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY, val)
487#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
488#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT, val)
489#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
490#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY, val)
491#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
492#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR, val)
493#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
494#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR, val)
495#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
496#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
497#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
498#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
499#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
500#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
501#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
502#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
503
504/* DMA Channel 4 Registers */
505
506#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
507#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR, val)
508#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
509#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR, val)
510#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
511#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG, val)
512#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
513#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT, val)
514#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
515#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY, val)
516#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
517#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT, val)
518#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
519#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY, val)
520#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
521#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR, val)
522#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
523#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR, val)
524#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
525#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
526#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
527#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
528#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
529#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
530#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
531#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
532
533/* DMA Channel 5 Registers */
534
535#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
536#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR, val)
537#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
538#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR, val)
539#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
540#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG, val)
541#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
542#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT, val)
543#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
544#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY, val)
545#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
546#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT, val)
547#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
548#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY, val)
549#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
550#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR, val)
551#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
552#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR, val)
553#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
554#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
555#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
556#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
557#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
558#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
559#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
560#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
561
562/* DMA Channel 6 Registers */
563
564#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
565#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
566#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
567#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR, val)
568#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
569#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG, val)
570#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
571#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT, val)
572#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
573#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY, val)
574#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
575#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT, val)
576#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
577#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY, val)
578#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
579#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR, val)
580#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
581#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR, val)
582#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
583#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
584#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
585#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
586#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
587#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
588#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
589#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
590
591/* DMA Channel 7 Registers */
592
593#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
594#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR, val)
595#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
596#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR, val)
597#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
598#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG, val)
599#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
600#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT, val)
601#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
602#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY, val)
603#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
604#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT, val)
605#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
606#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY, val)
607#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
608#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR, val)
609#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
610#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR, val)
611#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
612#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
613#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
614#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
615#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
616#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
617#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
618#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
619
620/* DMA Channel 8 Registers */
621
622#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_read32(DMA8_NEXT_DESC_PTR)
623#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_write32(DMA8_NEXT_DESC_PTR, val)
624#define bfin_read_DMA8_START_ADDR() bfin_read32(DMA8_START_ADDR)
625#define bfin_write_DMA8_START_ADDR(val) bfin_write32(DMA8_START_ADDR, val)
626#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
627#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG, val)
628#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
629#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT, val)
630#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
631#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY, val)
632#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
633#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT, val)
634#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
635#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY, val)
636#define bfin_read_DMA8_CURR_DESC_PTR() bfin_read32(DMA8_CURR_DESC_PTR)
637#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_write32(DMA8_CURR_DESC_PTR, val)
638#define bfin_read_DMA8_CURR_ADDR() bfin_read32(DMA8_CURR_ADDR)
639#define bfin_write_DMA8_CURR_ADDR(val) bfin_write32(DMA8_CURR_ADDR, val)
640#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
641#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
642#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
643#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
644#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
645#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
646#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
647#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
648
649/* DMA Channel 9 Registers */
650
651#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_read32(DMA9_NEXT_DESC_PTR)
652#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_write32(DMA9_NEXT_DESC_PTR, val)
653#define bfin_read_DMA9_START_ADDR() bfin_read32(DMA9_START_ADDR)
654#define bfin_write_DMA9_START_ADDR(val) bfin_write32(DMA9_START_ADDR, val)
655#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
656#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG, val)
657#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
658#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT, val)
659#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
660#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY, val)
661#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
662#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT, val)
663#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
664#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY, val)
665#define bfin_read_DMA9_CURR_DESC_PTR() bfin_read32(DMA9_CURR_DESC_PTR)
666#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_write32(DMA9_CURR_DESC_PTR, val)
667#define bfin_read_DMA9_CURR_ADDR() bfin_read32(DMA9_CURR_ADDR)
668#define bfin_write_DMA9_CURR_ADDR(val) bfin_write32(DMA9_CURR_ADDR, val)
669#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
670#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
671#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
672#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
673#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
674#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
675#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
676#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
677
678/* DMA Channel 10 Registers */
679
680#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_read32(DMA10_NEXT_DESC_PTR)
681#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_write32(DMA10_NEXT_DESC_PTR, val)
682#define bfin_read_DMA10_START_ADDR() bfin_read32(DMA10_START_ADDR)
683#define bfin_write_DMA10_START_ADDR(val) bfin_write32(DMA10_START_ADDR, val)
684#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
685#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG, val)
686#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
687#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT, val)
688#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
689#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
690#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
691#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT, val)
692#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
693#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
694#define bfin_read_DMA10_CURR_DESC_PTR() bfin_read32(DMA10_CURR_DESC_PTR)
695#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_write32(DMA10_CURR_DESC_PTR, val)
696#define bfin_read_DMA10_CURR_ADDR() bfin_read32(DMA10_CURR_ADDR)
697#define bfin_write_DMA10_CURR_ADDR(val) bfin_write32(DMA10_CURR_ADDR, val)
698#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
699#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
700#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
701#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
702#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
703#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
704#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
705#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
706
707/* DMA Channel 11 Registers */
708
709#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_read32(DMA11_NEXT_DESC_PTR)
710#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_write32(DMA11_NEXT_DESC_PTR, val)
711#define bfin_read_DMA11_START_ADDR() bfin_read32(DMA11_START_ADDR)
712#define bfin_write_DMA11_START_ADDR(val) bfin_write32(DMA11_START_ADDR, val)
713#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
714#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG, val)
715#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
716#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT, val)
717#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
718#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
719#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
720#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT, val)
721#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
722#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
723#define bfin_read_DMA11_CURR_DESC_PTR() bfin_read32(DMA11_CURR_DESC_PTR)
724#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_write32(DMA11_CURR_DESC_PTR, val)
725#define bfin_read_DMA11_CURR_ADDR() bfin_read32(DMA11_CURR_ADDR)
726#define bfin_write_DMA11_CURR_ADDR(val) bfin_write32(DMA11_CURR_ADDR, val)
727#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
728#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
729#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
730#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
731#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
732#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
733#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
734#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
735
736/* MDMA Stream 0 Registers */
737
738#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
739#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR, val)
740#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
741#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR, val)
742#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
743#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
744#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
745#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
746#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
747#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
748#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
749#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
750#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
751#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
752#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
753#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR, val)
754#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
755#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR, val)
756#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
757#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
758#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
759#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
760#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
761#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
762#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
763#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
764#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
765#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR, val)
766#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
767#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR, val)
768#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
769#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
770#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
771#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
772#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
773#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
774#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
775#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
776#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
777#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
778#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
779#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR, val)
780#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
781#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR, 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#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
787#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
788#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
789#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
790
791/* MDMA Stream 1 Registers */
792
793#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
794#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR, val)
795#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
796#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR, val)
797#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
798#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
799#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
800#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
801#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
802#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
803#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
804#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
805#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
806#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
807#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
808#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR, val)
809#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
810#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR, val)
811#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
812#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
813#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
814#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
815#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
816#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
817#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
818#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
819#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
820#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR, val)
821#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
822#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR, val)
823#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
824#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
825#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
826#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
827#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
828#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
829#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
830#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
831#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
832#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
833#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
834#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR, val)
835#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
836#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR, val)
837#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
838#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
839#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
840#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
841#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
842#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
843#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
844#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
845
846/* EPPI1 Registers */
847
848#define bfin_read_EPPI1_STATUS() bfin_read16(EPPI1_STATUS)
849#define bfin_write_EPPI1_STATUS(val) bfin_write16(EPPI1_STATUS, val)
850#define bfin_read_EPPI1_HCOUNT() bfin_read16(EPPI1_HCOUNT)
851#define bfin_write_EPPI1_HCOUNT(val) bfin_write16(EPPI1_HCOUNT, val)
852#define bfin_read_EPPI1_HDELAY() bfin_read16(EPPI1_HDELAY)
853#define bfin_write_EPPI1_HDELAY(val) bfin_write16(EPPI1_HDELAY, val)
854#define bfin_read_EPPI1_VCOUNT() bfin_read16(EPPI1_VCOUNT)
855#define bfin_write_EPPI1_VCOUNT(val) bfin_write16(EPPI1_VCOUNT, val)
856#define bfin_read_EPPI1_VDELAY() bfin_read16(EPPI1_VDELAY)
857#define bfin_write_EPPI1_VDELAY(val) bfin_write16(EPPI1_VDELAY, val)
858#define bfin_read_EPPI1_FRAME() bfin_read16(EPPI1_FRAME)
859#define bfin_write_EPPI1_FRAME(val) bfin_write16(EPPI1_FRAME, val)
860#define bfin_read_EPPI1_LINE() bfin_read16(EPPI1_LINE)
861#define bfin_write_EPPI1_LINE(val) bfin_write16(EPPI1_LINE, val)
862#define bfin_read_EPPI1_CLKDIV() bfin_read16(EPPI1_CLKDIV)
863#define bfin_write_EPPI1_CLKDIV(val) bfin_write16(EPPI1_CLKDIV, val)
864#define bfin_read_EPPI1_CONTROL() bfin_read32(EPPI1_CONTROL)
865#define bfin_write_EPPI1_CONTROL(val) bfin_write32(EPPI1_CONTROL, val)
866#define bfin_read_EPPI1_FS1W_HBL() bfin_read32(EPPI1_FS1W_HBL)
867#define bfin_write_EPPI1_FS1W_HBL(val) bfin_write32(EPPI1_FS1W_HBL, val)
868#define bfin_read_EPPI1_FS1P_AVPL() bfin_read32(EPPI1_FS1P_AVPL)
869#define bfin_write_EPPI1_FS1P_AVPL(val) bfin_write32(EPPI1_FS1P_AVPL, val)
870#define bfin_read_EPPI1_FS2W_LVB() bfin_read32(EPPI1_FS2W_LVB)
871#define bfin_write_EPPI1_FS2W_LVB(val) bfin_write32(EPPI1_FS2W_LVB, val)
872#define bfin_read_EPPI1_FS2P_LAVF() bfin_read32(EPPI1_FS2P_LAVF)
873#define bfin_write_EPPI1_FS2P_LAVF(val) bfin_write32(EPPI1_FS2P_LAVF, val)
874#define bfin_read_EPPI1_CLIP() bfin_read32(EPPI1_CLIP)
875#define bfin_write_EPPI1_CLIP(val) bfin_write32(EPPI1_CLIP, val)
876
877/* Port Interrubfin_read_()t 0 Registers (32-bit) */
878
879#define bfin_read_PINT0_MASK_SET() bfin_read32(PINT0_MASK_SET)
880#define bfin_write_PINT0_MASK_SET(val) bfin_write32(PINT0_MASK_SET, val)
881#define bfin_read_PINT0_MASK_CLEAR() bfin_read32(PINT0_MASK_CLEAR)
882#define bfin_write_PINT0_MASK_CLEAR(val) bfin_write32(PINT0_MASK_CLEAR, val)
883#define bfin_read_PINT0_REQUEST() bfin_read32(PINT0_REQUEST)
884#define bfin_write_PINT0_REQUEST(val) bfin_write32(PINT0_REQUEST, val)
885#define bfin_read_PINT0_ASSIGN() bfin_read32(PINT0_ASSIGN)
886#define bfin_write_PINT0_ASSIGN(val) bfin_write32(PINT0_ASSIGN, val)
887#define bfin_read_PINT0_EDGE_SET() bfin_read32(PINT0_EDGE_SET)
888#define bfin_write_PINT0_EDGE_SET(val) bfin_write32(PINT0_EDGE_SET, val)
889#define bfin_read_PINT0_EDGE_CLEAR() bfin_read32(PINT0_EDGE_CLEAR)
890#define bfin_write_PINT0_EDGE_CLEAR(val) bfin_write32(PINT0_EDGE_CLEAR, val)
891#define bfin_read_PINT0_INVERT_SET() bfin_read32(PINT0_INVERT_SET)
892#define bfin_write_PINT0_INVERT_SET(val) bfin_write32(PINT0_INVERT_SET, val)
893#define bfin_read_PINT0_INVERT_CLEAR() bfin_read32(PINT0_INVERT_CLEAR)
894#define bfin_write_PINT0_INVERT_CLEAR(val) bfin_write32(PINT0_INVERT_CLEAR, val)
895#define bfin_read_PINT0_PINSTATE() bfin_read32(PINT0_PINSTATE)
896#define bfin_write_PINT0_PINSTATE(val) bfin_write32(PINT0_PINSTATE, val)
897#define bfin_read_PINT0_LATCH() bfin_read32(PINT0_LATCH)
898#define bfin_write_PINT0_LATCH(val) bfin_write32(PINT0_LATCH, val)
899
900/* Port Interrubfin_read_()t 1 Registers (32-bit) */
901
902#define bfin_read_PINT1_MASK_SET() bfin_read32(PINT1_MASK_SET)
903#define bfin_write_PINT1_MASK_SET(val) bfin_write32(PINT1_MASK_SET, val)
904#define bfin_read_PINT1_MASK_CLEAR() bfin_read32(PINT1_MASK_CLEAR)
905#define bfin_write_PINT1_MASK_CLEAR(val) bfin_write32(PINT1_MASK_CLEAR, val)
906#define bfin_read_PINT1_REQUEST() bfin_read32(PINT1_REQUEST)
907#define bfin_write_PINT1_REQUEST(val) bfin_write32(PINT1_REQUEST, val)
908#define bfin_read_PINT1_ASSIGN() bfin_read32(PINT1_ASSIGN)
909#define bfin_write_PINT1_ASSIGN(val) bfin_write32(PINT1_ASSIGN, val)
910#define bfin_read_PINT1_EDGE_SET() bfin_read32(PINT1_EDGE_SET)
911#define bfin_write_PINT1_EDGE_SET(val) bfin_write32(PINT1_EDGE_SET, val)
912#define bfin_read_PINT1_EDGE_CLEAR() bfin_read32(PINT1_EDGE_CLEAR)
913#define bfin_write_PINT1_EDGE_CLEAR(val) bfin_write32(PINT1_EDGE_CLEAR, val)
914#define bfin_read_PINT1_INVERT_SET() bfin_read32(PINT1_INVERT_SET)
915#define bfin_write_PINT1_INVERT_SET(val) bfin_write32(PINT1_INVERT_SET, val)
916#define bfin_read_PINT1_INVERT_CLEAR() bfin_read32(PINT1_INVERT_CLEAR)
917#define bfin_write_PINT1_INVERT_CLEAR(val) bfin_write32(PINT1_INVERT_CLEAR, val)
918#define bfin_read_PINT1_PINSTATE() bfin_read32(PINT1_PINSTATE)
919#define bfin_write_PINT1_PINSTATE(val) bfin_write32(PINT1_PINSTATE, val)
920#define bfin_read_PINT1_LATCH() bfin_read32(PINT1_LATCH)
921#define bfin_write_PINT1_LATCH(val) bfin_write32(PINT1_LATCH, val)
922
923/* Port Interrubfin_read_()t 2 Registers (32-bit) */
924
925#define bfin_read_PINT2_MASK_SET() bfin_read32(PINT2_MASK_SET)
926#define bfin_write_PINT2_MASK_SET(val) bfin_write32(PINT2_MASK_SET, val)
927#define bfin_read_PINT2_MASK_CLEAR() bfin_read32(PINT2_MASK_CLEAR)
928#define bfin_write_PINT2_MASK_CLEAR(val) bfin_write32(PINT2_MASK_CLEAR, val)
929#define bfin_read_PINT2_REQUEST() bfin_read32(PINT2_REQUEST)
930#define bfin_write_PINT2_REQUEST(val) bfin_write32(PINT2_REQUEST, val)
931#define bfin_read_PINT2_ASSIGN() bfin_read32(PINT2_ASSIGN)
932#define bfin_write_PINT2_ASSIGN(val) bfin_write32(PINT2_ASSIGN, val)
933#define bfin_read_PINT2_EDGE_SET() bfin_read32(PINT2_EDGE_SET)
934#define bfin_write_PINT2_EDGE_SET(val) bfin_write32(PINT2_EDGE_SET, val)
935#define bfin_read_PINT2_EDGE_CLEAR() bfin_read32(PINT2_EDGE_CLEAR)
936#define bfin_write_PINT2_EDGE_CLEAR(val) bfin_write32(PINT2_EDGE_CLEAR, val)
937#define bfin_read_PINT2_INVERT_SET() bfin_read32(PINT2_INVERT_SET)
938#define bfin_write_PINT2_INVERT_SET(val) bfin_write32(PINT2_INVERT_SET, val)
939#define bfin_read_PINT2_INVERT_CLEAR() bfin_read32(PINT2_INVERT_CLEAR)
940#define bfin_write_PINT2_INVERT_CLEAR(val) bfin_write32(PINT2_INVERT_CLEAR, val)
941#define bfin_read_PINT2_PINSTATE() bfin_read32(PINT2_PINSTATE)
942#define bfin_write_PINT2_PINSTATE(val) bfin_write32(PINT2_PINSTATE, val)
943#define bfin_read_PINT2_LATCH() bfin_read32(PINT2_LATCH)
944#define bfin_write_PINT2_LATCH(val) bfin_write32(PINT2_LATCH, val)
945
946/* Port Interrubfin_read_()t 3 Registers (32-bit) */
947
948#define bfin_read_PINT3_MASK_SET() bfin_read32(PINT3_MASK_SET)
949#define bfin_write_PINT3_MASK_SET(val) bfin_write32(PINT3_MASK_SET, val)
950#define bfin_read_PINT3_MASK_CLEAR() bfin_read32(PINT3_MASK_CLEAR)
951#define bfin_write_PINT3_MASK_CLEAR(val) bfin_write32(PINT3_MASK_CLEAR, val)
952#define bfin_read_PINT3_REQUEST() bfin_read32(PINT3_REQUEST)
953#define bfin_write_PINT3_REQUEST(val) bfin_write32(PINT3_REQUEST, val)
954#define bfin_read_PINT3_ASSIGN() bfin_read32(PINT3_ASSIGN)
955#define bfin_write_PINT3_ASSIGN(val) bfin_write32(PINT3_ASSIGN, val)
956#define bfin_read_PINT3_EDGE_SET() bfin_read32(PINT3_EDGE_SET)
957#define bfin_write_PINT3_EDGE_SET(val) bfin_write32(PINT3_EDGE_SET, val)
958#define bfin_read_PINT3_EDGE_CLEAR() bfin_read32(PINT3_EDGE_CLEAR)
959#define bfin_write_PINT3_EDGE_CLEAR(val) bfin_write32(PINT3_EDGE_CLEAR, val)
960#define bfin_read_PINT3_INVERT_SET() bfin_read32(PINT3_INVERT_SET)
961#define bfin_write_PINT3_INVERT_SET(val) bfin_write32(PINT3_INVERT_SET, val)
962#define bfin_read_PINT3_INVERT_CLEAR() bfin_read32(PINT3_INVERT_CLEAR)
963#define bfin_write_PINT3_INVERT_CLEAR(val) bfin_write32(PINT3_INVERT_CLEAR, val)
964#define bfin_read_PINT3_PINSTATE() bfin_read32(PINT3_PINSTATE)
965#define bfin_write_PINT3_PINSTATE(val) bfin_write32(PINT3_PINSTATE, val)
966#define bfin_read_PINT3_LATCH() bfin_read32(PINT3_LATCH)
967#define bfin_write_PINT3_LATCH(val) bfin_write32(PINT3_LATCH, val)
968
969/* Port A Registers */
970
971#define bfin_read_PORTA_FER() bfin_read16(PORTA_FER)
972#define bfin_write_PORTA_FER(val) bfin_write16(PORTA_FER, val)
973#define bfin_read_PORTA() bfin_read16(PORTA)
974#define bfin_write_PORTA(val) bfin_write16(PORTA, val)
975#define bfin_read_PORTA_SET() bfin_read16(PORTA_SET)
976#define bfin_write_PORTA_SET(val) bfin_write16(PORTA_SET, val)
977#define bfin_read_PORTA_CLEAR() bfin_read16(PORTA_CLEAR)
978#define bfin_write_PORTA_CLEAR(val) bfin_write16(PORTA_CLEAR, val)
979#define bfin_read_PORTA_DIR_SET() bfin_read16(PORTA_DIR_SET)
980#define bfin_write_PORTA_DIR_SET(val) bfin_write16(PORTA_DIR_SET, val)
981#define bfin_read_PORTA_DIR_CLEAR() bfin_read16(PORTA_DIR_CLEAR)
982#define bfin_write_PORTA_DIR_CLEAR(val) bfin_write16(PORTA_DIR_CLEAR, val)
983#define bfin_read_PORTA_INEN() bfin_read16(PORTA_INEN)
984#define bfin_write_PORTA_INEN(val) bfin_write16(PORTA_INEN, val)
985#define bfin_read_PORTA_MUX() bfin_read32(PORTA_MUX)
986#define bfin_write_PORTA_MUX(val) bfin_write32(PORTA_MUX, val)
987
988/* Port B Registers */
989
990#define bfin_read_PORTB_FER() bfin_read16(PORTB_FER)
991#define bfin_write_PORTB_FER(val) bfin_write16(PORTB_FER, val)
992#define bfin_read_PORTB() bfin_read16(PORTB)
993#define bfin_write_PORTB(val) bfin_write16(PORTB, val)
994#define bfin_read_PORTB_SET() bfin_read16(PORTB_SET)
995#define bfin_write_PORTB_SET(val) bfin_write16(PORTB_SET, val)
996#define bfin_read_PORTB_CLEAR() bfin_read16(PORTB_CLEAR)
997#define bfin_write_PORTB_CLEAR(val) bfin_write16(PORTB_CLEAR, val)
998#define bfin_read_PORTB_DIR_SET() bfin_read16(PORTB_DIR_SET)
999#define bfin_write_PORTB_DIR_SET(val) bfin_write16(PORTB_DIR_SET, val)
1000#define bfin_read_PORTB_DIR_CLEAR() bfin_read16(PORTB_DIR_CLEAR)
1001#define bfin_write_PORTB_DIR_CLEAR(val) bfin_write16(PORTB_DIR_CLEAR, val)
1002#define bfin_read_PORTB_INEN() bfin_read16(PORTB_INEN)
1003#define bfin_write_PORTB_INEN(val) bfin_write16(PORTB_INEN, val)
1004#define bfin_read_PORTB_MUX() bfin_read32(PORTB_MUX)
1005#define bfin_write_PORTB_MUX(val) bfin_write32(PORTB_MUX, val)
1006
1007/* Port C Registers */
1008
1009#define bfin_read_PORTC_FER() bfin_read16(PORTC_FER)
1010#define bfin_write_PORTC_FER(val) bfin_write16(PORTC_FER, val)
1011#define bfin_read_PORTC() bfin_read16(PORTC)
1012#define bfin_write_PORTC(val) bfin_write16(PORTC, val)
1013#define bfin_read_PORTC_SET() bfin_read16(PORTC_SET)
1014#define bfin_write_PORTC_SET(val) bfin_write16(PORTC_SET, val)
1015#define bfin_read_PORTC_CLEAR() bfin_read16(PORTC_CLEAR)
1016#define bfin_write_PORTC_CLEAR(val) bfin_write16(PORTC_CLEAR, val)
1017#define bfin_read_PORTC_DIR_SET() bfin_read16(PORTC_DIR_SET)
1018#define bfin_write_PORTC_DIR_SET(val) bfin_write16(PORTC_DIR_SET, val)
1019#define bfin_read_PORTC_DIR_CLEAR() bfin_read16(PORTC_DIR_CLEAR)
1020#define bfin_write_PORTC_DIR_CLEAR(val) bfin_write16(PORTC_DIR_CLEAR, val)
1021#define bfin_read_PORTC_INEN() bfin_read16(PORTC_INEN)
1022#define bfin_write_PORTC_INEN(val) bfin_write16(PORTC_INEN, val)
1023#define bfin_read_PORTC_MUX() bfin_read32(PORTC_MUX)
1024#define bfin_write_PORTC_MUX(val) bfin_write32(PORTC_MUX, val)
1025
1026/* Port D Registers */
1027
1028#define bfin_read_PORTD_FER() bfin_read16(PORTD_FER)
1029#define bfin_write_PORTD_FER(val) bfin_write16(PORTD_FER, val)
1030#define bfin_read_PORTD() bfin_read16(PORTD)
1031#define bfin_write_PORTD(val) bfin_write16(PORTD, val)
1032#define bfin_read_PORTD_SET() bfin_read16(PORTD_SET)
1033#define bfin_write_PORTD_SET(val) bfin_write16(PORTD_SET, val)
1034#define bfin_read_PORTD_CLEAR() bfin_read16(PORTD_CLEAR)
1035#define bfin_write_PORTD_CLEAR(val) bfin_write16(PORTD_CLEAR, val)
1036#define bfin_read_PORTD_DIR_SET() bfin_read16(PORTD_DIR_SET)
1037#define bfin_write_PORTD_DIR_SET(val) bfin_write16(PORTD_DIR_SET, val)
1038#define bfin_read_PORTD_DIR_CLEAR() bfin_read16(PORTD_DIR_CLEAR)
1039#define bfin_write_PORTD_DIR_CLEAR(val) bfin_write16(PORTD_DIR_CLEAR, val)
1040#define bfin_read_PORTD_INEN() bfin_read16(PORTD_INEN)
1041#define bfin_write_PORTD_INEN(val) bfin_write16(PORTD_INEN, val)
1042#define bfin_read_PORTD_MUX() bfin_read32(PORTD_MUX)
1043#define bfin_write_PORTD_MUX(val) bfin_write32(PORTD_MUX, val)
1044
1045/* Port E Registers */
1046
1047#define bfin_read_PORTE_FER() bfin_read16(PORTE_FER)
1048#define bfin_write_PORTE_FER(val) bfin_write16(PORTE_FER, val)
1049#define bfin_read_PORTE() bfin_read16(PORTE)
1050#define bfin_write_PORTE(val) bfin_write16(PORTE, val)
1051#define bfin_read_PORTE_SET() bfin_read16(PORTE_SET)
1052#define bfin_write_PORTE_SET(val) bfin_write16(PORTE_SET, val)
1053#define bfin_read_PORTE_CLEAR() bfin_read16(PORTE_CLEAR)
1054#define bfin_write_PORTE_CLEAR(val) bfin_write16(PORTE_CLEAR, val)
1055#define bfin_read_PORTE_DIR_SET() bfin_read16(PORTE_DIR_SET)
1056#define bfin_write_PORTE_DIR_SET(val) bfin_write16(PORTE_DIR_SET, val)
1057#define bfin_read_PORTE_DIR_CLEAR() bfin_read16(PORTE_DIR_CLEAR)
1058#define bfin_write_PORTE_DIR_CLEAR(val) bfin_write16(PORTE_DIR_CLEAR, val)
1059#define bfin_read_PORTE_INEN() bfin_read16(PORTE_INEN)
1060#define bfin_write_PORTE_INEN(val) bfin_write16(PORTE_INEN, val)
1061#define bfin_read_PORTE_MUX() bfin_read32(PORTE_MUX)
1062#define bfin_write_PORTE_MUX(val) bfin_write32(PORTE_MUX, val)
1063
1064/* Port F Registers */
1065
1066#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
1067#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER, val)
1068#define bfin_read_PORTF() bfin_read16(PORTF)
1069#define bfin_write_PORTF(val) bfin_write16(PORTF, val)
1070#define bfin_read_PORTF_SET() bfin_read16(PORTF_SET)
1071#define bfin_write_PORTF_SET(val) bfin_write16(PORTF_SET, val)
1072#define bfin_read_PORTF_CLEAR() bfin_read16(PORTF_CLEAR)
1073#define bfin_write_PORTF_CLEAR(val) bfin_write16(PORTF_CLEAR, val)
1074#define bfin_read_PORTF_DIR_SET() bfin_read16(PORTF_DIR_SET)
1075#define bfin_write_PORTF_DIR_SET(val) bfin_write16(PORTF_DIR_SET, val)
1076#define bfin_read_PORTF_DIR_CLEAR() bfin_read16(PORTF_DIR_CLEAR)
1077#define bfin_write_PORTF_DIR_CLEAR(val) bfin_write16(PORTF_DIR_CLEAR, val)
1078#define bfin_read_PORTF_INEN() bfin_read16(PORTF_INEN)
1079#define bfin_write_PORTF_INEN(val) bfin_write16(PORTF_INEN, val)
1080#define bfin_read_PORTF_MUX() bfin_read32(PORTF_MUX)
1081#define bfin_write_PORTF_MUX(val) bfin_write32(PORTF_MUX, val)
1082
1083/* Port G Registers */
1084
1085#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
1086#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER, val)
1087#define bfin_read_PORTG() bfin_read16(PORTG)
1088#define bfin_write_PORTG(val) bfin_write16(PORTG, val)
1089#define bfin_read_PORTG_SET() bfin_read16(PORTG_SET)
1090#define bfin_write_PORTG_SET(val) bfin_write16(PORTG_SET, val)
1091#define bfin_read_PORTG_CLEAR() bfin_read16(PORTG_CLEAR)
1092#define bfin_write_PORTG_CLEAR(val) bfin_write16(PORTG_CLEAR, val)
1093#define bfin_read_PORTG_DIR_SET() bfin_read16(PORTG_DIR_SET)
1094#define bfin_write_PORTG_DIR_SET(val) bfin_write16(PORTG_DIR_SET, val)
1095#define bfin_read_PORTG_DIR_CLEAR() bfin_read16(PORTG_DIR_CLEAR)
1096#define bfin_write_PORTG_DIR_CLEAR(val) bfin_write16(PORTG_DIR_CLEAR, val)
1097#define bfin_read_PORTG_INEN() bfin_read16(PORTG_INEN)
1098#define bfin_write_PORTG_INEN(val) bfin_write16(PORTG_INEN, val)
1099#define bfin_read_PORTG_MUX() bfin_read32(PORTG_MUX)
1100#define bfin_write_PORTG_MUX(val) bfin_write32(PORTG_MUX, val)
1101
1102/* Port H Registers */
1103
1104#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
1105#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER, val)
1106#define bfin_read_PORTH() bfin_read16(PORTH)
1107#define bfin_write_PORTH(val) bfin_write16(PORTH, val)
1108#define bfin_read_PORTH_SET() bfin_read16(PORTH_SET)
1109#define bfin_write_PORTH_SET(val) bfin_write16(PORTH_SET, val)
1110#define bfin_read_PORTH_CLEAR() bfin_read16(PORTH_CLEAR)
1111#define bfin_write_PORTH_CLEAR(val) bfin_write16(PORTH_CLEAR, val)
1112#define bfin_read_PORTH_DIR_SET() bfin_read16(PORTH_DIR_SET)
1113#define bfin_write_PORTH_DIR_SET(val) bfin_write16(PORTH_DIR_SET, val)
1114#define bfin_read_PORTH_DIR_CLEAR() bfin_read16(PORTH_DIR_CLEAR)
1115#define bfin_write_PORTH_DIR_CLEAR(val) bfin_write16(PORTH_DIR_CLEAR, val)
1116#define bfin_read_PORTH_INEN() bfin_read16(PORTH_INEN)
1117#define bfin_write_PORTH_INEN(val) bfin_write16(PORTH_INEN, val)
1118#define bfin_read_PORTH_MUX() bfin_read32(PORTH_MUX)
1119#define bfin_write_PORTH_MUX(val) bfin_write32(PORTH_MUX, val)
1120
1121/* Port I Registers */
1122
1123#define bfin_read_PORTI_FER() bfin_read16(PORTI_FER)
1124#define bfin_write_PORTI_FER(val) bfin_write16(PORTI_FER, val)
1125#define bfin_read_PORTI() bfin_read16(PORTI)
1126#define bfin_write_PORTI(val) bfin_write16(PORTI, val)
1127#define bfin_read_PORTI_SET() bfin_read16(PORTI_SET)
1128#define bfin_write_PORTI_SET(val) bfin_write16(PORTI_SET, val)
1129#define bfin_read_PORTI_CLEAR() bfin_read16(PORTI_CLEAR)
1130#define bfin_write_PORTI_CLEAR(val) bfin_write16(PORTI_CLEAR, val)
1131#define bfin_read_PORTI_DIR_SET() bfin_read16(PORTI_DIR_SET)
1132#define bfin_write_PORTI_DIR_SET(val) bfin_write16(PORTI_DIR_SET, val)
1133#define bfin_read_PORTI_DIR_CLEAR() bfin_read16(PORTI_DIR_CLEAR)
1134#define bfin_write_PORTI_DIR_CLEAR(val) bfin_write16(PORTI_DIR_CLEAR, val)
1135#define bfin_read_PORTI_INEN() bfin_read16(PORTI_INEN)
1136#define bfin_write_PORTI_INEN(val) bfin_write16(PORTI_INEN, val)
1137#define bfin_read_PORTI_MUX() bfin_read32(PORTI_MUX)
1138#define bfin_write_PORTI_MUX(val) bfin_write32(PORTI_MUX, val)
1139
1140/* Port J Registers */
1141
1142#define bfin_read_PORTJ_FER() bfin_read16(PORTJ_FER)
1143#define bfin_write_PORTJ_FER(val) bfin_write16(PORTJ_FER, val)
1144#define bfin_read_PORTJ() bfin_read16(PORTJ)
1145#define bfin_write_PORTJ(val) bfin_write16(PORTJ, val)
1146#define bfin_read_PORTJ_SET() bfin_read16(PORTJ_SET)
1147#define bfin_write_PORTJ_SET(val) bfin_write16(PORTJ_SET, val)
1148#define bfin_read_PORTJ_CLEAR() bfin_read16(PORTJ_CLEAR)
1149#define bfin_write_PORTJ_CLEAR(val) bfin_write16(PORTJ_CLEAR, val)
1150#define bfin_read_PORTJ_DIR_SET() bfin_read16(PORTJ_DIR_SET)
1151#define bfin_write_PORTJ_DIR_SET(val) bfin_write16(PORTJ_DIR_SET, val)
1152#define bfin_read_PORTJ_DIR_CLEAR() bfin_read16(PORTJ_DIR_CLEAR)
1153#define bfin_write_PORTJ_DIR_CLEAR(val) bfin_write16(PORTJ_DIR_CLEAR, val)
1154#define bfin_read_PORTJ_INEN() bfin_read16(PORTJ_INEN)
1155#define bfin_write_PORTJ_INEN(val) bfin_write16(PORTJ_INEN, val)
1156#define bfin_read_PORTJ_MUX() bfin_read32(PORTJ_MUX)
1157#define bfin_write_PORTJ_MUX(val) bfin_write32(PORTJ_MUX, val)
1158
1159/* PWM Timer Registers */
1160
1161#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
1162#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG, val)
1163#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
1164#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
1165#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
1166#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD, val)
1167#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
1168#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH, val)
1169#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
1170#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG, val)
1171#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
1172#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
1173#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
1174#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD, val)
1175#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
1176#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH, val)
1177#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
1178#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG, val)
1179#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
1180#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
1181#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
1182#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD, val)
1183#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
1184#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH, val)
1185#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
1186#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG, val)
1187#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
1188#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
1189#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
1190#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD, val)
1191#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
1192#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH, val)
1193#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
1194#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG, val)
1195#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
1196#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
1197#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
1198#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD, val)
1199#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
1200#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH, val)
1201#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
1202#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG, val)
1203#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
1204#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
1205#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
1206#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD, val)
1207#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
1208#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH, val)
1209#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
1210#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG, val)
1211#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
1212#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
1213#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
1214#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD, val)
1215#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
1216#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH, val)
1217#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
1218#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG, val)
1219#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
1220#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
1221#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
1222#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD, val)
1223#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
1224#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH, val)
1225
1226/* Timer Groubfin_read_() of 8 */
1227
1228#define bfin_read_TIMER_ENABLE0() bfin_read16(TIMER_ENABLE0)
1229#define bfin_write_TIMER_ENABLE0(val) bfin_write16(TIMER_ENABLE0, val)
1230#define bfin_read_TIMER_DISABLE0() bfin_read16(TIMER_DISABLE0)
1231#define bfin_write_TIMER_DISABLE0(val) bfin_write16(TIMER_DISABLE0, val)
1232#define bfin_read_TIMER_STATUS0() bfin_read32(TIMER_STATUS0)
1233#define bfin_write_TIMER_STATUS0(val) bfin_write32(TIMER_STATUS0, val)
1234
1235/* DMAC1 Registers */
1236
1237#define bfin_read_DMAC1_TCPER() bfin_read16(DMAC1_TCPER)
1238#define bfin_write_DMAC1_TCPER(val) bfin_write16(DMAC1_TCPER, val)
1239#define bfin_read_DMAC1_TCCNT() bfin_read16(DMAC1_TCCNT)
1240#define bfin_write_DMAC1_TCCNT(val) bfin_write16(DMAC1_TCCNT, val)
1241
1242/* DMA Channel 12 Registers */
1243
1244#define bfin_read_DMA12_NEXT_DESC_PTR() bfin_read32(DMA12_NEXT_DESC_PTR)
1245#define bfin_write_DMA12_NEXT_DESC_PTR(val) bfin_write32(DMA12_NEXT_DESC_PTR, val)
1246#define bfin_read_DMA12_START_ADDR() bfin_read32(DMA12_START_ADDR)
1247#define bfin_write_DMA12_START_ADDR(val) bfin_write32(DMA12_START_ADDR, val)
1248#define bfin_read_DMA12_CONFIG() bfin_read16(DMA12_CONFIG)
1249#define bfin_write_DMA12_CONFIG(val) bfin_write16(DMA12_CONFIG, val)
1250#define bfin_read_DMA12_X_COUNT() bfin_read16(DMA12_X_COUNT)
1251#define bfin_write_DMA12_X_COUNT(val) bfin_write16(DMA12_X_COUNT, val)
1252#define bfin_read_DMA12_X_MODIFY() bfin_read16(DMA12_X_MODIFY)
1253#define bfin_write_DMA12_X_MODIFY(val) bfin_write16(DMA12_X_MODIFY, val)
1254#define bfin_read_DMA12_Y_COUNT() bfin_read16(DMA12_Y_COUNT)
1255#define bfin_write_DMA12_Y_COUNT(val) bfin_write16(DMA12_Y_COUNT, val)
1256#define bfin_read_DMA12_Y_MODIFY() bfin_read16(DMA12_Y_MODIFY)
1257#define bfin_write_DMA12_Y_MODIFY(val) bfin_write16(DMA12_Y_MODIFY, val)
1258#define bfin_read_DMA12_CURR_DESC_PTR() bfin_read32(DMA12_CURR_DESC_PTR)
1259#define bfin_write_DMA12_CURR_DESC_PTR(val) bfin_write32(DMA12_CURR_DESC_PTR, val)
1260#define bfin_read_DMA12_CURR_ADDR() bfin_read32(DMA12_CURR_ADDR)
1261#define bfin_write_DMA12_CURR_ADDR(val) bfin_write32(DMA12_CURR_ADDR, val)
1262#define bfin_read_DMA12_IRQ_STATUS() bfin_read16(DMA12_IRQ_STATUS)
1263#define bfin_write_DMA12_IRQ_STATUS(val) bfin_write16(DMA12_IRQ_STATUS, val)
1264#define bfin_read_DMA12_PERIPHERAL_MAP() bfin_read16(DMA12_PERIPHERAL_MAP)
1265#define bfin_write_DMA12_PERIPHERAL_MAP(val) bfin_write16(DMA12_PERIPHERAL_MAP, val)
1266#define bfin_read_DMA12_CURR_X_COUNT() bfin_read16(DMA12_CURR_X_COUNT)
1267#define bfin_write_DMA12_CURR_X_COUNT(val) bfin_write16(DMA12_CURR_X_COUNT, val)
1268#define bfin_read_DMA12_CURR_Y_COUNT() bfin_read16(DMA12_CURR_Y_COUNT)
1269#define bfin_write_DMA12_CURR_Y_COUNT(val) bfin_write16(DMA12_CURR_Y_COUNT, val)
1270
1271/* DMA Channel 13 Registers */
1272
1273#define bfin_read_DMA13_NEXT_DESC_PTR() bfin_read32(DMA13_NEXT_DESC_PTR)
1274#define bfin_write_DMA13_NEXT_DESC_PTR(val) bfin_write32(DMA13_NEXT_DESC_PTR, val)
1275#define bfin_read_DMA13_START_ADDR() bfin_read32(DMA13_START_ADDR)
1276#define bfin_write_DMA13_START_ADDR(val) bfin_write32(DMA13_START_ADDR, val)
1277#define bfin_read_DMA13_CONFIG() bfin_read16(DMA13_CONFIG)
1278#define bfin_write_DMA13_CONFIG(val) bfin_write16(DMA13_CONFIG, val)
1279#define bfin_read_DMA13_X_COUNT() bfin_read16(DMA13_X_COUNT)
1280#define bfin_write_DMA13_X_COUNT(val) bfin_write16(DMA13_X_COUNT, val)
1281#define bfin_read_DMA13_X_MODIFY() bfin_read16(DMA13_X_MODIFY)
1282#define bfin_write_DMA13_X_MODIFY(val) bfin_write16(DMA13_X_MODIFY, val)
1283#define bfin_read_DMA13_Y_COUNT() bfin_read16(DMA13_Y_COUNT)
1284#define bfin_write_DMA13_Y_COUNT(val) bfin_write16(DMA13_Y_COUNT, val)
1285#define bfin_read_DMA13_Y_MODIFY() bfin_read16(DMA13_Y_MODIFY)
1286#define bfin_write_DMA13_Y_MODIFY(val) bfin_write16(DMA13_Y_MODIFY, val)
1287#define bfin_read_DMA13_CURR_DESC_PTR() bfin_read32(DMA13_CURR_DESC_PTR)
1288#define bfin_write_DMA13_CURR_DESC_PTR(val) bfin_write32(DMA13_CURR_DESC_PTR, val)
1289#define bfin_read_DMA13_CURR_ADDR() bfin_read32(DMA13_CURR_ADDR)
1290#define bfin_write_DMA13_CURR_ADDR(val) bfin_write32(DMA13_CURR_ADDR, val)
1291#define bfin_read_DMA13_IRQ_STATUS() bfin_read16(DMA13_IRQ_STATUS)
1292#define bfin_write_DMA13_IRQ_STATUS(val) bfin_write16(DMA13_IRQ_STATUS, val)
1293#define bfin_read_DMA13_PERIPHERAL_MAP() bfin_read16(DMA13_PERIPHERAL_MAP)
1294#define bfin_write_DMA13_PERIPHERAL_MAP(val) bfin_write16(DMA13_PERIPHERAL_MAP, val)
1295#define bfin_read_DMA13_CURR_X_COUNT() bfin_read16(DMA13_CURR_X_COUNT)
1296#define bfin_write_DMA13_CURR_X_COUNT(val) bfin_write16(DMA13_CURR_X_COUNT, val)
1297#define bfin_read_DMA13_CURR_Y_COUNT() bfin_read16(DMA13_CURR_Y_COUNT)
1298#define bfin_write_DMA13_CURR_Y_COUNT(val) bfin_write16(DMA13_CURR_Y_COUNT, val)
1299
1300/* DMA Channel 14 Registers */
1301
1302#define bfin_read_DMA14_NEXT_DESC_PTR() bfin_read32(DMA14_NEXT_DESC_PTR)
1303#define bfin_write_DMA14_NEXT_DESC_PTR(val) bfin_write32(DMA14_NEXT_DESC_PTR, val)
1304#define bfin_read_DMA14_START_ADDR() bfin_read32(DMA14_START_ADDR)
1305#define bfin_write_DMA14_START_ADDR(val) bfin_write32(DMA14_START_ADDR, val)
1306#define bfin_read_DMA14_CONFIG() bfin_read16(DMA14_CONFIG)
1307#define bfin_write_DMA14_CONFIG(val) bfin_write16(DMA14_CONFIG, val)
1308#define bfin_read_DMA14_X_COUNT() bfin_read16(DMA14_X_COUNT)
1309#define bfin_write_DMA14_X_COUNT(val) bfin_write16(DMA14_X_COUNT, val)
1310#define bfin_read_DMA14_X_MODIFY() bfin_read16(DMA14_X_MODIFY)
1311#define bfin_write_DMA14_X_MODIFY(val) bfin_write16(DMA14_X_MODIFY, val)
1312#define bfin_read_DMA14_Y_COUNT() bfin_read16(DMA14_Y_COUNT)
1313#define bfin_write_DMA14_Y_COUNT(val) bfin_write16(DMA14_Y_COUNT, val)
1314#define bfin_read_DMA14_Y_MODIFY() bfin_read16(DMA14_Y_MODIFY)
1315#define bfin_write_DMA14_Y_MODIFY(val) bfin_write16(DMA14_Y_MODIFY, val)
1316#define bfin_read_DMA14_CURR_DESC_PTR() bfin_read32(DMA14_CURR_DESC_PTR)
1317#define bfin_write_DMA14_CURR_DESC_PTR(val) bfin_write32(DMA14_CURR_DESC_PTR, val)
1318#define bfin_read_DMA14_CURR_ADDR() bfin_read32(DMA14_CURR_ADDR)
1319#define bfin_write_DMA14_CURR_ADDR(val) bfin_write32(DMA14_CURR_ADDR, val)
1320#define bfin_read_DMA14_IRQ_STATUS() bfin_read16(DMA14_IRQ_STATUS)
1321#define bfin_write_DMA14_IRQ_STATUS(val) bfin_write16(DMA14_IRQ_STATUS, val)
1322#define bfin_read_DMA14_PERIPHERAL_MAP() bfin_read16(DMA14_PERIPHERAL_MAP)
1323#define bfin_write_DMA14_PERIPHERAL_MAP(val) bfin_write16(DMA14_PERIPHERAL_MAP, val)
1324#define bfin_read_DMA14_CURR_X_COUNT() bfin_read16(DMA14_CURR_X_COUNT)
1325#define bfin_write_DMA14_CURR_X_COUNT(val) bfin_write16(DMA14_CURR_X_COUNT, val)
1326#define bfin_read_DMA14_CURR_Y_COUNT() bfin_read16(DMA14_CURR_Y_COUNT)
1327#define bfin_write_DMA14_CURR_Y_COUNT(val) bfin_write16(DMA14_CURR_Y_COUNT, val)
1328
1329/* DMA Channel 15 Registers */
1330
1331#define bfin_read_DMA15_NEXT_DESC_PTR() bfin_read32(DMA15_NEXT_DESC_PTR)
1332#define bfin_write_DMA15_NEXT_DESC_PTR(val) bfin_write32(DMA15_NEXT_DESC_PTR, val)
1333#define bfin_read_DMA15_START_ADDR() bfin_read32(DMA15_START_ADDR)
1334#define bfin_write_DMA15_START_ADDR(val) bfin_write32(DMA15_START_ADDR, val)
1335#define bfin_read_DMA15_CONFIG() bfin_read16(DMA15_CONFIG)
1336#define bfin_write_DMA15_CONFIG(val) bfin_write16(DMA15_CONFIG, val)
1337#define bfin_read_DMA15_X_COUNT() bfin_read16(DMA15_X_COUNT)
1338#define bfin_write_DMA15_X_COUNT(val) bfin_write16(DMA15_X_COUNT, val)
1339#define bfin_read_DMA15_X_MODIFY() bfin_read16(DMA15_X_MODIFY)
1340#define bfin_write_DMA15_X_MODIFY(val) bfin_write16(DMA15_X_MODIFY, val)
1341#define bfin_read_DMA15_Y_COUNT() bfin_read16(DMA15_Y_COUNT)
1342#define bfin_write_DMA15_Y_COUNT(val) bfin_write16(DMA15_Y_COUNT, val)
1343#define bfin_read_DMA15_Y_MODIFY() bfin_read16(DMA15_Y_MODIFY)
1344#define bfin_write_DMA15_Y_MODIFY(val) bfin_write16(DMA15_Y_MODIFY, val)
1345#define bfin_read_DMA15_CURR_DESC_PTR() bfin_read32(DMA15_CURR_DESC_PTR)
1346#define bfin_write_DMA15_CURR_DESC_PTR(val) bfin_write32(DMA15_CURR_DESC_PTR, val)
1347#define bfin_read_DMA15_CURR_ADDR() bfin_read32(DMA15_CURR_ADDR)
1348#define bfin_write_DMA15_CURR_ADDR(val) bfin_write32(DMA15_CURR_ADDR, val)
1349#define bfin_read_DMA15_IRQ_STATUS() bfin_read16(DMA15_IRQ_STATUS)
1350#define bfin_write_DMA15_IRQ_STATUS(val) bfin_write16(DMA15_IRQ_STATUS, val)
1351#define bfin_read_DMA15_PERIPHERAL_MAP() bfin_read16(DMA15_PERIPHERAL_MAP)
1352#define bfin_write_DMA15_PERIPHERAL_MAP(val) bfin_write16(DMA15_PERIPHERAL_MAP, val)
1353#define bfin_read_DMA15_CURR_X_COUNT() bfin_read16(DMA15_CURR_X_COUNT)
1354#define bfin_write_DMA15_CURR_X_COUNT(val) bfin_write16(DMA15_CURR_X_COUNT, val)
1355#define bfin_read_DMA15_CURR_Y_COUNT() bfin_read16(DMA15_CURR_Y_COUNT)
1356#define bfin_write_DMA15_CURR_Y_COUNT(val) bfin_write16(DMA15_CURR_Y_COUNT, val)
1357
1358/* DMA Channel 16 Registers */
1359
1360#define bfin_read_DMA16_NEXT_DESC_PTR() bfin_read32(DMA16_NEXT_DESC_PTR)
1361#define bfin_write_DMA16_NEXT_DESC_PTR(val) bfin_write32(DMA16_NEXT_DESC_PTR, val)
1362#define bfin_read_DMA16_START_ADDR() bfin_read32(DMA16_START_ADDR)
1363#define bfin_write_DMA16_START_ADDR(val) bfin_write32(DMA16_START_ADDR, val)
1364#define bfin_read_DMA16_CONFIG() bfin_read16(DMA16_CONFIG)
1365#define bfin_write_DMA16_CONFIG(val) bfin_write16(DMA16_CONFIG, val)
1366#define bfin_read_DMA16_X_COUNT() bfin_read16(DMA16_X_COUNT)
1367#define bfin_write_DMA16_X_COUNT(val) bfin_write16(DMA16_X_COUNT, val)
1368#define bfin_read_DMA16_X_MODIFY() bfin_read16(DMA16_X_MODIFY)
1369#define bfin_write_DMA16_X_MODIFY(val) bfin_write16(DMA16_X_MODIFY, val)
1370#define bfin_read_DMA16_Y_COUNT() bfin_read16(DMA16_Y_COUNT)
1371#define bfin_write_DMA16_Y_COUNT(val) bfin_write16(DMA16_Y_COUNT, val)
1372#define bfin_read_DMA16_Y_MODIFY() bfin_read16(DMA16_Y_MODIFY)
1373#define bfin_write_DMA16_Y_MODIFY(val) bfin_write16(DMA16_Y_MODIFY, val)
1374#define bfin_read_DMA16_CURR_DESC_PTR() bfin_read32(DMA16_CURR_DESC_PTR)
1375#define bfin_write_DMA16_CURR_DESC_PTR(val) bfin_write32(DMA16_CURR_DESC_PTR, val)
1376#define bfin_read_DMA16_CURR_ADDR() bfin_read32(DMA16_CURR_ADDR)
1377#define bfin_write_DMA16_CURR_ADDR(val) bfin_write32(DMA16_CURR_ADDR, val)
1378#define bfin_read_DMA16_IRQ_STATUS() bfin_read16(DMA16_IRQ_STATUS)
1379#define bfin_write_DMA16_IRQ_STATUS(val) bfin_write16(DMA16_IRQ_STATUS, val)
1380#define bfin_read_DMA16_PERIPHERAL_MAP() bfin_read16(DMA16_PERIPHERAL_MAP)
1381#define bfin_write_DMA16_PERIPHERAL_MAP(val) bfin_write16(DMA16_PERIPHERAL_MAP, val)
1382#define bfin_read_DMA16_CURR_X_COUNT() bfin_read16(DMA16_CURR_X_COUNT)
1383#define bfin_write_DMA16_CURR_X_COUNT(val) bfin_write16(DMA16_CURR_X_COUNT, val)
1384#define bfin_read_DMA16_CURR_Y_COUNT() bfin_read16(DMA16_CURR_Y_COUNT)
1385#define bfin_write_DMA16_CURR_Y_COUNT(val) bfin_write16(DMA16_CURR_Y_COUNT, val)
1386
1387/* DMA Channel 17 Registers */
1388
1389#define bfin_read_DMA17_NEXT_DESC_PTR() bfin_read32(DMA17_NEXT_DESC_PTR)
1390#define bfin_write_DMA17_NEXT_DESC_PTR(val) bfin_write32(DMA17_NEXT_DESC_PTR, val)
1391#define bfin_read_DMA17_START_ADDR() bfin_read32(DMA17_START_ADDR)
1392#define bfin_write_DMA17_START_ADDR(val) bfin_write32(DMA17_START_ADDR, val)
1393#define bfin_read_DMA17_CONFIG() bfin_read16(DMA17_CONFIG)
1394#define bfin_write_DMA17_CONFIG(val) bfin_write16(DMA17_CONFIG, val)
1395#define bfin_read_DMA17_X_COUNT() bfin_read16(DMA17_X_COUNT)
1396#define bfin_write_DMA17_X_COUNT(val) bfin_write16(DMA17_X_COUNT, val)
1397#define bfin_read_DMA17_X_MODIFY() bfin_read16(DMA17_X_MODIFY)
1398#define bfin_write_DMA17_X_MODIFY(val) bfin_write16(DMA17_X_MODIFY, val)
1399#define bfin_read_DMA17_Y_COUNT() bfin_read16(DMA17_Y_COUNT)
1400#define bfin_write_DMA17_Y_COUNT(val) bfin_write16(DMA17_Y_COUNT, val)
1401#define bfin_read_DMA17_Y_MODIFY() bfin_read16(DMA17_Y_MODIFY)
1402#define bfin_write_DMA17_Y_MODIFY(val) bfin_write16(DMA17_Y_MODIFY, val)
1403#define bfin_read_DMA17_CURR_DESC_PTR() bfin_read32(DMA17_CURR_DESC_PTR)
1404#define bfin_write_DMA17_CURR_DESC_PTR(val) bfin_write32(DMA17_CURR_DESC_PTR, val)
1405#define bfin_read_DMA17_CURR_ADDR() bfin_read32(DMA17_CURR_ADDR)
1406#define bfin_write_DMA17_CURR_ADDR(val) bfin_write32(DMA17_CURR_ADDR, val)
1407#define bfin_read_DMA17_IRQ_STATUS() bfin_read16(DMA17_IRQ_STATUS)
1408#define bfin_write_DMA17_IRQ_STATUS(val) bfin_write16(DMA17_IRQ_STATUS, val)
1409#define bfin_read_DMA17_PERIPHERAL_MAP() bfin_read16(DMA17_PERIPHERAL_MAP)
1410#define bfin_write_DMA17_PERIPHERAL_MAP(val) bfin_write16(DMA17_PERIPHERAL_MAP, val)
1411#define bfin_read_DMA17_CURR_X_COUNT() bfin_read16(DMA17_CURR_X_COUNT)
1412#define bfin_write_DMA17_CURR_X_COUNT(val) bfin_write16(DMA17_CURR_X_COUNT, val)
1413#define bfin_read_DMA17_CURR_Y_COUNT() bfin_read16(DMA17_CURR_Y_COUNT)
1414#define bfin_write_DMA17_CURR_Y_COUNT(val) bfin_write16(DMA17_CURR_Y_COUNT, val)
1415
1416/* DMA Channel 18 Registers */
1417
1418#define bfin_read_DMA18_NEXT_DESC_PTR() bfin_read32(DMA18_NEXT_DESC_PTR)
1419#define bfin_write_DMA18_NEXT_DESC_PTR(val) bfin_write32(DMA18_NEXT_DESC_PTR, val)
1420#define bfin_read_DMA18_START_ADDR() bfin_read32(DMA18_START_ADDR)
1421#define bfin_write_DMA18_START_ADDR(val) bfin_write32(DMA18_START_ADDR, val)
1422#define bfin_read_DMA18_CONFIG() bfin_read16(DMA18_CONFIG)
1423#define bfin_write_DMA18_CONFIG(val) bfin_write16(DMA18_CONFIG, val)
1424#define bfin_read_DMA18_X_COUNT() bfin_read16(DMA18_X_COUNT)
1425#define bfin_write_DMA18_X_COUNT(val) bfin_write16(DMA18_X_COUNT, val)
1426#define bfin_read_DMA18_X_MODIFY() bfin_read16(DMA18_X_MODIFY)
1427#define bfin_write_DMA18_X_MODIFY(val) bfin_write16(DMA18_X_MODIFY, val)
1428#define bfin_read_DMA18_Y_COUNT() bfin_read16(DMA18_Y_COUNT)
1429#define bfin_write_DMA18_Y_COUNT(val) bfin_write16(DMA18_Y_COUNT, val)
1430#define bfin_read_DMA18_Y_MODIFY() bfin_read16(DMA18_Y_MODIFY)
1431#define bfin_write_DMA18_Y_MODIFY(val) bfin_write16(DMA18_Y_MODIFY, val)
1432#define bfin_read_DMA18_CURR_DESC_PTR() bfin_read32(DMA18_CURR_DESC_PTR)
1433#define bfin_write_DMA18_CURR_DESC_PTR(val) bfin_write32(DMA18_CURR_DESC_PTR, val)
1434#define bfin_read_DMA18_CURR_ADDR() bfin_read32(DMA18_CURR_ADDR)
1435#define bfin_write_DMA18_CURR_ADDR(val) bfin_write32(DMA18_CURR_ADDR, val)
1436#define bfin_read_DMA18_IRQ_STATUS() bfin_read16(DMA18_IRQ_STATUS)
1437#define bfin_write_DMA18_IRQ_STATUS(val) bfin_write16(DMA18_IRQ_STATUS, val)
1438#define bfin_read_DMA18_PERIPHERAL_MAP() bfin_read16(DMA18_PERIPHERAL_MAP)
1439#define bfin_write_DMA18_PERIPHERAL_MAP(val) bfin_write16(DMA18_PERIPHERAL_MAP, val)
1440#define bfin_read_DMA18_CURR_X_COUNT() bfin_read16(DMA18_CURR_X_COUNT)
1441#define bfin_write_DMA18_CURR_X_COUNT(val) bfin_write16(DMA18_CURR_X_COUNT, val)
1442#define bfin_read_DMA18_CURR_Y_COUNT() bfin_read16(DMA18_CURR_Y_COUNT)
1443#define bfin_write_DMA18_CURR_Y_COUNT(val) bfin_write16(DMA18_CURR_Y_COUNT, val)
1444
1445/* DMA Channel 19 Registers */
1446
1447#define bfin_read_DMA19_NEXT_DESC_PTR() bfin_read32(DMA19_NEXT_DESC_PTR)
1448#define bfin_write_DMA19_NEXT_DESC_PTR(val) bfin_write32(DMA19_NEXT_DESC_PTR, val)
1449#define bfin_read_DMA19_START_ADDR() bfin_read32(DMA19_START_ADDR)
1450#define bfin_write_DMA19_START_ADDR(val) bfin_write32(DMA19_START_ADDR, val)
1451#define bfin_read_DMA19_CONFIG() bfin_read16(DMA19_CONFIG)
1452#define bfin_write_DMA19_CONFIG(val) bfin_write16(DMA19_CONFIG, val)
1453#define bfin_read_DMA19_X_COUNT() bfin_read16(DMA19_X_COUNT)
1454#define bfin_write_DMA19_X_COUNT(val) bfin_write16(DMA19_X_COUNT, val)
1455#define bfin_read_DMA19_X_MODIFY() bfin_read16(DMA19_X_MODIFY)
1456#define bfin_write_DMA19_X_MODIFY(val) bfin_write16(DMA19_X_MODIFY, val)
1457#define bfin_read_DMA19_Y_COUNT() bfin_read16(DMA19_Y_COUNT)
1458#define bfin_write_DMA19_Y_COUNT(val) bfin_write16(DMA19_Y_COUNT, val)
1459#define bfin_read_DMA19_Y_MODIFY() bfin_read16(DMA19_Y_MODIFY)
1460#define bfin_write_DMA19_Y_MODIFY(val) bfin_write16(DMA19_Y_MODIFY, val)
1461#define bfin_read_DMA19_CURR_DESC_PTR() bfin_read32(DMA19_CURR_DESC_PTR)
1462#define bfin_write_DMA19_CURR_DESC_PTR(val) bfin_write32(DMA19_CURR_DESC_PTR, val)
1463#define bfin_read_DMA19_CURR_ADDR() bfin_read32(DMA19_CURR_ADDR)
1464#define bfin_write_DMA19_CURR_ADDR(val) bfin_write32(DMA19_CURR_ADDR, val)
1465#define bfin_read_DMA19_IRQ_STATUS() bfin_read16(DMA19_IRQ_STATUS)
1466#define bfin_write_DMA19_IRQ_STATUS(val) bfin_write16(DMA19_IRQ_STATUS, val)
1467#define bfin_read_DMA19_PERIPHERAL_MAP() bfin_read16(DMA19_PERIPHERAL_MAP)
1468#define bfin_write_DMA19_PERIPHERAL_MAP(val) bfin_write16(DMA19_PERIPHERAL_MAP, val)
1469#define bfin_read_DMA19_CURR_X_COUNT() bfin_read16(DMA19_CURR_X_COUNT)
1470#define bfin_write_DMA19_CURR_X_COUNT(val) bfin_write16(DMA19_CURR_X_COUNT, val)
1471#define bfin_read_DMA19_CURR_Y_COUNT() bfin_read16(DMA19_CURR_Y_COUNT)
1472#define bfin_write_DMA19_CURR_Y_COUNT(val) bfin_write16(DMA19_CURR_Y_COUNT, val)
1473
1474/* DMA Channel 20 Registers */
1475
1476#define bfin_read_DMA20_NEXT_DESC_PTR() bfin_read32(DMA20_NEXT_DESC_PTR)
1477#define bfin_write_DMA20_NEXT_DESC_PTR(val) bfin_write32(DMA20_NEXT_DESC_PTR, val)
1478#define bfin_read_DMA20_START_ADDR() bfin_read32(DMA20_START_ADDR)
1479#define bfin_write_DMA20_START_ADDR(val) bfin_write32(DMA20_START_ADDR, val)
1480#define bfin_read_DMA20_CONFIG() bfin_read16(DMA20_CONFIG)
1481#define bfin_write_DMA20_CONFIG(val) bfin_write16(DMA20_CONFIG, val)
1482#define bfin_read_DMA20_X_COUNT() bfin_read16(DMA20_X_COUNT)
1483#define bfin_write_DMA20_X_COUNT(val) bfin_write16(DMA20_X_COUNT, val)
1484#define bfin_read_DMA20_X_MODIFY() bfin_read16(DMA20_X_MODIFY)
1485#define bfin_write_DMA20_X_MODIFY(val) bfin_write16(DMA20_X_MODIFY, val)
1486#define bfin_read_DMA20_Y_COUNT() bfin_read16(DMA20_Y_COUNT)
1487#define bfin_write_DMA20_Y_COUNT(val) bfin_write16(DMA20_Y_COUNT, val)
1488#define bfin_read_DMA20_Y_MODIFY() bfin_read16(DMA20_Y_MODIFY)
1489#define bfin_write_DMA20_Y_MODIFY(val) bfin_write16(DMA20_Y_MODIFY, val)
1490#define bfin_read_DMA20_CURR_DESC_PTR() bfin_read32(DMA20_CURR_DESC_PTR)
1491#define bfin_write_DMA20_CURR_DESC_PTR(val) bfin_write32(DMA20_CURR_DESC_PTR, val)
1492#define bfin_read_DMA20_CURR_ADDR() bfin_read32(DMA20_CURR_ADDR)
1493#define bfin_write_DMA20_CURR_ADDR(val) bfin_write32(DMA20_CURR_ADDR, val)
1494#define bfin_read_DMA20_IRQ_STATUS() bfin_read16(DMA20_IRQ_STATUS)
1495#define bfin_write_DMA20_IRQ_STATUS(val) bfin_write16(DMA20_IRQ_STATUS, val)
1496#define bfin_read_DMA20_PERIPHERAL_MAP() bfin_read16(DMA20_PERIPHERAL_MAP)
1497#define bfin_write_DMA20_PERIPHERAL_MAP(val) bfin_write16(DMA20_PERIPHERAL_MAP, val)
1498#define bfin_read_DMA20_CURR_X_COUNT() bfin_read16(DMA20_CURR_X_COUNT)
1499#define bfin_write_DMA20_CURR_X_COUNT(val) bfin_write16(DMA20_CURR_X_COUNT, val)
1500#define bfin_read_DMA20_CURR_Y_COUNT() bfin_read16(DMA20_CURR_Y_COUNT)
1501#define bfin_write_DMA20_CURR_Y_COUNT(val) bfin_write16(DMA20_CURR_Y_COUNT, val)
1502
1503/* DMA Channel 21 Registers */
1504
1505#define bfin_read_DMA21_NEXT_DESC_PTR() bfin_read32(DMA21_NEXT_DESC_PTR)
1506#define bfin_write_DMA21_NEXT_DESC_PTR(val) bfin_write32(DMA21_NEXT_DESC_PTR, val)
1507#define bfin_read_DMA21_START_ADDR() bfin_read32(DMA21_START_ADDR)
1508#define bfin_write_DMA21_START_ADDR(val) bfin_write32(DMA21_START_ADDR, val)
1509#define bfin_read_DMA21_CONFIG() bfin_read16(DMA21_CONFIG)
1510#define bfin_write_DMA21_CONFIG(val) bfin_write16(DMA21_CONFIG, val)
1511#define bfin_read_DMA21_X_COUNT() bfin_read16(DMA21_X_COUNT)
1512#define bfin_write_DMA21_X_COUNT(val) bfin_write16(DMA21_X_COUNT, val)
1513#define bfin_read_DMA21_X_MODIFY() bfin_read16(DMA21_X_MODIFY)
1514#define bfin_write_DMA21_X_MODIFY(val) bfin_write16(DMA21_X_MODIFY, val)
1515#define bfin_read_DMA21_Y_COUNT() bfin_read16(DMA21_Y_COUNT)
1516#define bfin_write_DMA21_Y_COUNT(val) bfin_write16(DMA21_Y_COUNT, val)
1517#define bfin_read_DMA21_Y_MODIFY() bfin_read16(DMA21_Y_MODIFY)
1518#define bfin_write_DMA21_Y_MODIFY(val) bfin_write16(DMA21_Y_MODIFY, val)
1519#define bfin_read_DMA21_CURR_DESC_PTR() bfin_read32(DMA21_CURR_DESC_PTR)
1520#define bfin_write_DMA21_CURR_DESC_PTR(val) bfin_write32(DMA21_CURR_DESC_PTR, val)
1521#define bfin_read_DMA21_CURR_ADDR() bfin_read32(DMA21_CURR_ADDR)
1522#define bfin_write_DMA21_CURR_ADDR(val) bfin_write32(DMA21_CURR_ADDR, val)
1523#define bfin_read_DMA21_IRQ_STATUS() bfin_read16(DMA21_IRQ_STATUS)
1524#define bfin_write_DMA21_IRQ_STATUS(val) bfin_write16(DMA21_IRQ_STATUS, val)
1525#define bfin_read_DMA21_PERIPHERAL_MAP() bfin_read16(DMA21_PERIPHERAL_MAP)
1526#define bfin_write_DMA21_PERIPHERAL_MAP(val) bfin_write16(DMA21_PERIPHERAL_MAP, val)
1527#define bfin_read_DMA21_CURR_X_COUNT() bfin_read16(DMA21_CURR_X_COUNT)
1528#define bfin_write_DMA21_CURR_X_COUNT(val) bfin_write16(DMA21_CURR_X_COUNT, val)
1529#define bfin_read_DMA21_CURR_Y_COUNT() bfin_read16(DMA21_CURR_Y_COUNT)
1530#define bfin_write_DMA21_CURR_Y_COUNT(val) bfin_write16(DMA21_CURR_Y_COUNT, val)
1531
1532/* DMA Channel 22 Registers */
1533
1534#define bfin_read_DMA22_NEXT_DESC_PTR() bfin_read32(DMA22_NEXT_DESC_PTR)
1535#define bfin_write_DMA22_NEXT_DESC_PTR(val) bfin_write32(DMA22_NEXT_DESC_PTR, val)
1536#define bfin_read_DMA22_START_ADDR() bfin_read32(DMA22_START_ADDR)
1537#define bfin_write_DMA22_START_ADDR(val) bfin_write32(DMA22_START_ADDR, val)
1538#define bfin_read_DMA22_CONFIG() bfin_read16(DMA22_CONFIG)
1539#define bfin_write_DMA22_CONFIG(val) bfin_write16(DMA22_CONFIG, val)
1540#define bfin_read_DMA22_X_COUNT() bfin_read16(DMA22_X_COUNT)
1541#define bfin_write_DMA22_X_COUNT(val) bfin_write16(DMA22_X_COUNT, val)
1542#define bfin_read_DMA22_X_MODIFY() bfin_read16(DMA22_X_MODIFY)
1543#define bfin_write_DMA22_X_MODIFY(val) bfin_write16(DMA22_X_MODIFY, val)
1544#define bfin_read_DMA22_Y_COUNT() bfin_read16(DMA22_Y_COUNT)
1545#define bfin_write_DMA22_Y_COUNT(val) bfin_write16(DMA22_Y_COUNT, val)
1546#define bfin_read_DMA22_Y_MODIFY() bfin_read16(DMA22_Y_MODIFY)
1547#define bfin_write_DMA22_Y_MODIFY(val) bfin_write16(DMA22_Y_MODIFY, val)
1548#define bfin_read_DMA22_CURR_DESC_PTR() bfin_read32(DMA22_CURR_DESC_PTR)
1549#define bfin_write_DMA22_CURR_DESC_PTR(val) bfin_write32(DMA22_CURR_DESC_PTR, val)
1550#define bfin_read_DMA22_CURR_ADDR() bfin_read32(DMA22_CURR_ADDR)
1551#define bfin_write_DMA22_CURR_ADDR(val) bfin_write32(DMA22_CURR_ADDR, val)
1552#define bfin_read_DMA22_IRQ_STATUS() bfin_read16(DMA22_IRQ_STATUS)
1553#define bfin_write_DMA22_IRQ_STATUS(val) bfin_write16(DMA22_IRQ_STATUS, val)
1554#define bfin_read_DMA22_PERIPHERAL_MAP() bfin_read16(DMA22_PERIPHERAL_MAP)
1555#define bfin_write_DMA22_PERIPHERAL_MAP(val) bfin_write16(DMA22_PERIPHERAL_MAP, val)
1556#define bfin_read_DMA22_CURR_X_COUNT() bfin_read16(DMA22_CURR_X_COUNT)
1557#define bfin_write_DMA22_CURR_X_COUNT(val) bfin_write16(DMA22_CURR_X_COUNT, val)
1558#define bfin_read_DMA22_CURR_Y_COUNT() bfin_read16(DMA22_CURR_Y_COUNT)
1559#define bfin_write_DMA22_CURR_Y_COUNT(val) bfin_write16(DMA22_CURR_Y_COUNT, val)
1560
1561/* DMA Channel 23 Registers */
1562
1563#define bfin_read_DMA23_NEXT_DESC_PTR() bfin_read32(DMA23_NEXT_DESC_PTR)
1564#define bfin_write_DMA23_NEXT_DESC_PTR(val) bfin_write32(DMA23_NEXT_DESC_PTR, val)
1565#define bfin_read_DMA23_START_ADDR() bfin_read32(DMA23_START_ADDR)
1566#define bfin_write_DMA23_START_ADDR(val) bfin_write32(DMA23_START_ADDR, val)
1567#define bfin_read_DMA23_CONFIG() bfin_read16(DMA23_CONFIG)
1568#define bfin_write_DMA23_CONFIG(val) bfin_write16(DMA23_CONFIG, val)
1569#define bfin_read_DMA23_X_COUNT() bfin_read16(DMA23_X_COUNT)
1570#define bfin_write_DMA23_X_COUNT(val) bfin_write16(DMA23_X_COUNT, val)
1571#define bfin_read_DMA23_X_MODIFY() bfin_read16(DMA23_X_MODIFY)
1572#define bfin_write_DMA23_X_MODIFY(val) bfin_write16(DMA23_X_MODIFY, val)
1573#define bfin_read_DMA23_Y_COUNT() bfin_read16(DMA23_Y_COUNT)
1574#define bfin_write_DMA23_Y_COUNT(val) bfin_write16(DMA23_Y_COUNT, val)
1575#define bfin_read_DMA23_Y_MODIFY() bfin_read16(DMA23_Y_MODIFY)
1576#define bfin_write_DMA23_Y_MODIFY(val) bfin_write16(DMA23_Y_MODIFY, val)
1577#define bfin_read_DMA23_CURR_DESC_PTR() bfin_read32(DMA23_CURR_DESC_PTR)
1578#define bfin_write_DMA23_CURR_DESC_PTR(val) bfin_write32(DMA23_CURR_DESC_PTR, val)
1579#define bfin_read_DMA23_CURR_ADDR() bfin_read32(DMA23_CURR_ADDR)
1580#define bfin_write_DMA23_CURR_ADDR(val) bfin_write32(DMA23_CURR_ADDR, val)
1581#define bfin_read_DMA23_IRQ_STATUS() bfin_read16(DMA23_IRQ_STATUS)
1582#define bfin_write_DMA23_IRQ_STATUS(val) bfin_write16(DMA23_IRQ_STATUS, val)
1583#define bfin_read_DMA23_PERIPHERAL_MAP() bfin_read16(DMA23_PERIPHERAL_MAP)
1584#define bfin_write_DMA23_PERIPHERAL_MAP(val) bfin_write16(DMA23_PERIPHERAL_MAP, val)
1585#define bfin_read_DMA23_CURR_X_COUNT() bfin_read16(DMA23_CURR_X_COUNT)
1586#define bfin_write_DMA23_CURR_X_COUNT(val) bfin_write16(DMA23_CURR_X_COUNT, val)
1587#define bfin_read_DMA23_CURR_Y_COUNT() bfin_read16(DMA23_CURR_Y_COUNT)
1588#define bfin_write_DMA23_CURR_Y_COUNT(val) bfin_write16(DMA23_CURR_Y_COUNT, val)
1589
1590/* MDMA Stream 2 Registers */
1591
1592#define bfin_read_MDMA_D2_NEXT_DESC_PTR() bfin_read32(MDMA_D2_NEXT_DESC_PTR)
1593#define bfin_write_MDMA_D2_NEXT_DESC_PTR(val) bfin_write32(MDMA_D2_NEXT_DESC_PTR, val)
1594#define bfin_read_MDMA_D2_START_ADDR() bfin_read32(MDMA_D2_START_ADDR)
1595#define bfin_write_MDMA_D2_START_ADDR(val) bfin_write32(MDMA_D2_START_ADDR, val)
1596#define bfin_read_MDMA_D2_CONFIG() bfin_read16(MDMA_D2_CONFIG)
1597#define bfin_write_MDMA_D2_CONFIG(val) bfin_write16(MDMA_D2_CONFIG, val)
1598#define bfin_read_MDMA_D2_X_COUNT() bfin_read16(MDMA_D2_X_COUNT)
1599#define bfin_write_MDMA_D2_X_COUNT(val) bfin_write16(MDMA_D2_X_COUNT, val)
1600#define bfin_read_MDMA_D2_X_MODIFY() bfin_read16(MDMA_D2_X_MODIFY)
1601#define bfin_write_MDMA_D2_X_MODIFY(val) bfin_write16(MDMA_D2_X_MODIFY, val)
1602#define bfin_read_MDMA_D2_Y_COUNT() bfin_read16(MDMA_D2_Y_COUNT)
1603#define bfin_write_MDMA_D2_Y_COUNT(val) bfin_write16(MDMA_D2_Y_COUNT, val)
1604#define bfin_read_MDMA_D2_Y_MODIFY() bfin_read16(MDMA_D2_Y_MODIFY)
1605#define bfin_write_MDMA_D2_Y_MODIFY(val) bfin_write16(MDMA_D2_Y_MODIFY, val)
1606#define bfin_read_MDMA_D2_CURR_DESC_PTR() bfin_read32(MDMA_D2_CURR_DESC_PTR)
1607#define bfin_write_MDMA_D2_CURR_DESC_PTR(val) bfin_write32(MDMA_D2_CURR_DESC_PTR, val)
1608#define bfin_read_MDMA_D2_CURR_ADDR() bfin_read32(MDMA_D2_CURR_ADDR)
1609#define bfin_write_MDMA_D2_CURR_ADDR(val) bfin_write32(MDMA_D2_CURR_ADDR, val)
1610#define bfin_read_MDMA_D2_IRQ_STATUS() bfin_read16(MDMA_D2_IRQ_STATUS)
1611#define bfin_write_MDMA_D2_IRQ_STATUS(val) bfin_write16(MDMA_D2_IRQ_STATUS, val)
1612#define bfin_read_MDMA_D2_PERIPHERAL_MAP() bfin_read16(MDMA_D2_PERIPHERAL_MAP)
1613#define bfin_write_MDMA_D2_PERIPHERAL_MAP(val) bfin_write16(MDMA_D2_PERIPHERAL_MAP, val)
1614#define bfin_read_MDMA_D2_CURR_X_COUNT() bfin_read16(MDMA_D2_CURR_X_COUNT)
1615#define bfin_write_MDMA_D2_CURR_X_COUNT(val) bfin_write16(MDMA_D2_CURR_X_COUNT, val)
1616#define bfin_read_MDMA_D2_CURR_Y_COUNT() bfin_read16(MDMA_D2_CURR_Y_COUNT)
1617#define bfin_write_MDMA_D2_CURR_Y_COUNT(val) bfin_write16(MDMA_D2_CURR_Y_COUNT, val)
1618#define bfin_read_MDMA_S2_NEXT_DESC_PTR() bfin_read32(MDMA_S2_NEXT_DESC_PTR)
1619#define bfin_write_MDMA_S2_NEXT_DESC_PTR(val) bfin_write32(MDMA_S2_NEXT_DESC_PTR, val)
1620#define bfin_read_MDMA_S2_START_ADDR() bfin_read32(MDMA_S2_START_ADDR)
1621#define bfin_write_MDMA_S2_START_ADDR(val) bfin_write32(MDMA_S2_START_ADDR, val)
1622#define bfin_read_MDMA_S2_CONFIG() bfin_read16(MDMA_S2_CONFIG)
1623#define bfin_write_MDMA_S2_CONFIG(val) bfin_write16(MDMA_S2_CONFIG, val)
1624#define bfin_read_MDMA_S2_X_COUNT() bfin_read16(MDMA_S2_X_COUNT)
1625#define bfin_write_MDMA_S2_X_COUNT(val) bfin_write16(MDMA_S2_X_COUNT, val)
1626#define bfin_read_MDMA_S2_X_MODIFY() bfin_read16(MDMA_S2_X_MODIFY)
1627#define bfin_write_MDMA_S2_X_MODIFY(val) bfin_write16(MDMA_S2_X_MODIFY, val)
1628#define bfin_read_MDMA_S2_Y_COUNT() bfin_read16(MDMA_S2_Y_COUNT)
1629#define bfin_write_MDMA_S2_Y_COUNT(val) bfin_write16(MDMA_S2_Y_COUNT, val)
1630#define bfin_read_MDMA_S2_Y_MODIFY() bfin_read16(MDMA_S2_Y_MODIFY)
1631#define bfin_write_MDMA_S2_Y_MODIFY(val) bfin_write16(MDMA_S2_Y_MODIFY, val)
1632#define bfin_read_MDMA_S2_CURR_DESC_PTR() bfin_read32(MDMA_S2_CURR_DESC_PTR)
1633#define bfin_write_MDMA_S2_CURR_DESC_PTR(val) bfin_write32(MDMA_S2_CURR_DESC_PTR, val)
1634#define bfin_read_MDMA_S2_CURR_ADDR() bfin_read32(MDMA_S2_CURR_ADDR)
1635#define bfin_write_MDMA_S2_CURR_ADDR(val) bfin_write32(MDMA_S2_CURR_ADDR, val)
1636#define bfin_read_MDMA_S2_IRQ_STATUS() bfin_read16(MDMA_S2_IRQ_STATUS)
1637#define bfin_write_MDMA_S2_IRQ_STATUS(val) bfin_write16(MDMA_S2_IRQ_STATUS, val)
1638#define bfin_read_MDMA_S2_PERIPHERAL_MAP() bfin_read16(MDMA_S2_PERIPHERAL_MAP)
1639#define bfin_write_MDMA_S2_PERIPHERAL_MAP(val) bfin_write16(MDMA_S2_PERIPHERAL_MAP, val)
1640#define bfin_read_MDMA_S2_CURR_X_COUNT() bfin_read16(MDMA_S2_CURR_X_COUNT)
1641#define bfin_write_MDMA_S2_CURR_X_COUNT(val) bfin_write16(MDMA_S2_CURR_X_COUNT, val)
1642#define bfin_read_MDMA_S2_CURR_Y_COUNT() bfin_read16(MDMA_S2_CURR_Y_COUNT)
1643#define bfin_write_MDMA_S2_CURR_Y_COUNT(val) bfin_write16(MDMA_S2_CURR_Y_COUNT, val)
1644
1645/* MDMA Stream 3 Registers */
1646
1647#define bfin_read_MDMA_D3_NEXT_DESC_PTR() bfin_read32(MDMA_D3_NEXT_DESC_PTR)
1648#define bfin_write_MDMA_D3_NEXT_DESC_PTR(val) bfin_write32(MDMA_D3_NEXT_DESC_PTR, val)
1649#define bfin_read_MDMA_D3_START_ADDR() bfin_read32(MDMA_D3_START_ADDR)
1650#define bfin_write_MDMA_D3_START_ADDR(val) bfin_write32(MDMA_D3_START_ADDR, val)
1651#define bfin_read_MDMA_D3_CONFIG() bfin_read16(MDMA_D3_CONFIG)
1652#define bfin_write_MDMA_D3_CONFIG(val) bfin_write16(MDMA_D3_CONFIG, val)
1653#define bfin_read_MDMA_D3_X_COUNT() bfin_read16(MDMA_D3_X_COUNT)
1654#define bfin_write_MDMA_D3_X_COUNT(val) bfin_write16(MDMA_D3_X_COUNT, val)
1655#define bfin_read_MDMA_D3_X_MODIFY() bfin_read16(MDMA_D3_X_MODIFY)
1656#define bfin_write_MDMA_D3_X_MODIFY(val) bfin_write16(MDMA_D3_X_MODIFY, val)
1657#define bfin_read_MDMA_D3_Y_COUNT() bfin_read16(MDMA_D3_Y_COUNT)
1658#define bfin_write_MDMA_D3_Y_COUNT(val) bfin_write16(MDMA_D3_Y_COUNT, val)
1659#define bfin_read_MDMA_D3_Y_MODIFY() bfin_read16(MDMA_D3_Y_MODIFY)
1660#define bfin_write_MDMA_D3_Y_MODIFY(val) bfin_write16(MDMA_D3_Y_MODIFY, val)
1661#define bfin_read_MDMA_D3_CURR_DESC_PTR() bfin_read32(MDMA_D3_CURR_DESC_PTR)
1662#define bfin_write_MDMA_D3_CURR_DESC_PTR(val) bfin_write32(MDMA_D3_CURR_DESC_PTR, val)
1663#define bfin_read_MDMA_D3_CURR_ADDR() bfin_read32(MDMA_D3_CURR_ADDR)
1664#define bfin_write_MDMA_D3_CURR_ADDR(val) bfin_write32(MDMA_D3_CURR_ADDR, val)
1665#define bfin_read_MDMA_D3_IRQ_STATUS() bfin_read16(MDMA_D3_IRQ_STATUS)
1666#define bfin_write_MDMA_D3_IRQ_STATUS(val) bfin_write16(MDMA_D3_IRQ_STATUS, val)
1667#define bfin_read_MDMA_D3_PERIPHERAL_MAP() bfin_read16(MDMA_D3_PERIPHERAL_MAP)
1668#define bfin_write_MDMA_D3_PERIPHERAL_MAP(val) bfin_write16(MDMA_D3_PERIPHERAL_MAP, val)
1669#define bfin_read_MDMA_D3_CURR_X_COUNT() bfin_read16(MDMA_D3_CURR_X_COUNT)
1670#define bfin_write_MDMA_D3_CURR_X_COUNT(val) bfin_write16(MDMA_D3_CURR_X_COUNT, val)
1671#define bfin_read_MDMA_D3_CURR_Y_COUNT() bfin_read16(MDMA_D3_CURR_Y_COUNT)
1672#define bfin_write_MDMA_D3_CURR_Y_COUNT(val) bfin_write16(MDMA_D3_CURR_Y_COUNT, val)
1673#define bfin_read_MDMA_S3_NEXT_DESC_PTR() bfin_read32(MDMA_S3_NEXT_DESC_PTR)
1674#define bfin_write_MDMA_S3_NEXT_DESC_PTR(val) bfin_write32(MDMA_S3_NEXT_DESC_PTR, val)
1675#define bfin_read_MDMA_S3_START_ADDR() bfin_read32(MDMA_S3_START_ADDR)
1676#define bfin_write_MDMA_S3_START_ADDR(val) bfin_write32(MDMA_S3_START_ADDR, val)
1677#define bfin_read_MDMA_S3_CONFIG() bfin_read16(MDMA_S3_CONFIG)
1678#define bfin_write_MDMA_S3_CONFIG(val) bfin_write16(MDMA_S3_CONFIG, val)
1679#define bfin_read_MDMA_S3_X_COUNT() bfin_read16(MDMA_S3_X_COUNT)
1680#define bfin_write_MDMA_S3_X_COUNT(val) bfin_write16(MDMA_S3_X_COUNT, val)
1681#define bfin_read_MDMA_S3_X_MODIFY() bfin_read16(MDMA_S3_X_MODIFY)
1682#define bfin_write_MDMA_S3_X_MODIFY(val) bfin_write16(MDMA_S3_X_MODIFY, val)
1683#define bfin_read_MDMA_S3_Y_COUNT() bfin_read16(MDMA_S3_Y_COUNT)
1684#define bfin_write_MDMA_S3_Y_COUNT(val) bfin_write16(MDMA_S3_Y_COUNT, val)
1685#define bfin_read_MDMA_S3_Y_MODIFY() bfin_read16(MDMA_S3_Y_MODIFY)
1686#define bfin_write_MDMA_S3_Y_MODIFY(val) bfin_write16(MDMA_S3_Y_MODIFY, val)
1687#define bfin_read_MDMA_S3_CURR_DESC_PTR() bfin_read32(MDMA_S3_CURR_DESC_PTR)
1688#define bfin_write_MDMA_S3_CURR_DESC_PTR(val) bfin_write32(MDMA_S3_CURR_DESC_PTR, val)
1689#define bfin_read_MDMA_S3_CURR_ADDR() bfin_read32(MDMA_S3_CURR_ADDR)
1690#define bfin_write_MDMA_S3_CURR_ADDR(val) bfin_write32(MDMA_S3_CURR_ADDR, val)
1691#define bfin_read_MDMA_S3_IRQ_STATUS() bfin_read16(MDMA_S3_IRQ_STATUS)
1692#define bfin_write_MDMA_S3_IRQ_STATUS(val) bfin_write16(MDMA_S3_IRQ_STATUS, val)
1693#define bfin_read_MDMA_S3_PERIPHERAL_MAP() bfin_read16(MDMA_S3_PERIPHERAL_MAP)
1694#define bfin_write_MDMA_S3_PERIPHERAL_MAP(val) bfin_write16(MDMA_S3_PERIPHERAL_MAP, val)
1695#define bfin_read_MDMA_S3_CURR_X_COUNT() bfin_read16(MDMA_S3_CURR_X_COUNT)
1696#define bfin_write_MDMA_S3_CURR_X_COUNT(val) bfin_write16(MDMA_S3_CURR_X_COUNT, val)
1697#define bfin_read_MDMA_S3_CURR_Y_COUNT() bfin_read16(MDMA_S3_CURR_Y_COUNT)
1698#define bfin_write_MDMA_S3_CURR_Y_COUNT(val) bfin_write16(MDMA_S3_CURR_Y_COUNT, val)
1699
1700/* UART1 Registers */
1701
1702#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
1703#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL, val)
1704#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
1705#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH, val)
1706#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
1707#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL, val)
1708#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
1709#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR, val)
1710#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
1711#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR, val)
1712#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
1713#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR, val)
1714#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
1715#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR, val)
1716#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
1717#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR, val)
1718#define bfin_read_UART1_IER_SET() bfin_read16(UART1_IER_SET)
1719#define bfin_write_UART1_IER_SET(val) bfin_write16(UART1_IER_SET, val)
1720#define bfin_read_UART1_IER_CLEAR() bfin_read16(UART1_IER_CLEAR)
1721#define bfin_write_UART1_IER_CLEAR(val) bfin_write16(UART1_IER_CLEAR, val)
1722#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
1723#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR, val)
1724#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
1725#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR, val)
1726
1727/* UART2 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */
1728
1729/* SPI1 Registers */
1730
1731#define bfin_read_SPI1_CTL() bfin_read16(SPI1_CTL)
1732#define bfin_write_SPI1_CTL(val) bfin_write16(SPI1_CTL, val)
1733#define bfin_read_SPI1_FLG() bfin_read16(SPI1_FLG)
1734#define bfin_write_SPI1_FLG(val) bfin_write16(SPI1_FLG, val)
1735#define bfin_read_SPI1_STAT() bfin_read16(SPI1_STAT)
1736#define bfin_write_SPI1_STAT(val) bfin_write16(SPI1_STAT, val)
1737#define bfin_read_SPI1_TDBR() bfin_read16(SPI1_TDBR)
1738#define bfin_write_SPI1_TDBR(val) bfin_write16(SPI1_TDBR, val)
1739#define bfin_read_SPI1_RDBR() bfin_read16(SPI1_RDBR)
1740#define bfin_write_SPI1_RDBR(val) bfin_write16(SPI1_RDBR, val)
1741#define bfin_read_SPI1_BAUD() bfin_read16(SPI1_BAUD)
1742#define bfin_write_SPI1_BAUD(val) bfin_write16(SPI1_BAUD, val)
1743#define bfin_read_SPI1_SHADOW() bfin_read16(SPI1_SHADOW)
1744#define bfin_write_SPI1_SHADOW(val) bfin_write16(SPI1_SHADOW, val)
1745
1746/* SPORT2 Registers */
1747
1748#define bfin_read_SPORT2_TCR1() bfin_read16(SPORT2_TCR1)
1749#define bfin_write_SPORT2_TCR1(val) bfin_write16(SPORT2_TCR1, val)
1750#define bfin_read_SPORT2_TCR2() bfin_read16(SPORT2_TCR2)
1751#define bfin_write_SPORT2_TCR2(val) bfin_write16(SPORT2_TCR2, val)
1752#define bfin_read_SPORT2_TCLKDIV() bfin_read16(SPORT2_TCLKDIV)
1753#define bfin_write_SPORT2_TCLKDIV(val) bfin_write16(SPORT2_TCLKDIV, val)
1754#define bfin_read_SPORT2_TFSDIV() bfin_read16(SPORT2_TFSDIV)
1755#define bfin_write_SPORT2_TFSDIV(val) bfin_write16(SPORT2_TFSDIV, val)
1756#define bfin_read_SPORT2_TX() bfin_read32(SPORT2_TX)
1757#define bfin_write_SPORT2_TX(val) bfin_write32(SPORT2_TX, val)
1758#define bfin_read_SPORT2_RX() bfin_read32(SPORT2_RX)
1759#define bfin_write_SPORT2_RX(val) bfin_write32(SPORT2_RX, val)
1760#define bfin_read_SPORT2_RCR1() bfin_read16(SPORT2_RCR1)
1761#define bfin_write_SPORT2_RCR1(val) bfin_write16(SPORT2_RCR1, val)
1762#define bfin_read_SPORT2_RCR2() bfin_read16(SPORT2_RCR2)
1763#define bfin_write_SPORT2_RCR2(val) bfin_write16(SPORT2_RCR2, val)
1764#define bfin_read_SPORT2_RCLKDIV() bfin_read16(SPORT2_RCLKDIV)
1765#define bfin_write_SPORT2_RCLKDIV(val) bfin_write16(SPORT2_RCLKDIV, val)
1766#define bfin_read_SPORT2_RFSDIV() bfin_read16(SPORT2_RFSDIV)
1767#define bfin_write_SPORT2_RFSDIV(val) bfin_write16(SPORT2_RFSDIV, val)
1768#define bfin_read_SPORT2_STAT() bfin_read16(SPORT2_STAT)
1769#define bfin_write_SPORT2_STAT(val) bfin_write16(SPORT2_STAT, val)
1770#define bfin_read_SPORT2_CHNL() bfin_read16(SPORT2_CHNL)
1771#define bfin_write_SPORT2_CHNL(val) bfin_write16(SPORT2_CHNL, val)
1772#define bfin_read_SPORT2_MCMC1() bfin_read16(SPORT2_MCMC1)
1773#define bfin_write_SPORT2_MCMC1(val) bfin_write16(SPORT2_MCMC1, val)
1774#define bfin_read_SPORT2_MCMC2() bfin_read16(SPORT2_MCMC2)
1775#define bfin_write_SPORT2_MCMC2(val) bfin_write16(SPORT2_MCMC2, val)
1776#define bfin_read_SPORT2_MTCS0() bfin_read32(SPORT2_MTCS0)
1777#define bfin_write_SPORT2_MTCS0(val) bfin_write32(SPORT2_MTCS0, val)
1778#define bfin_read_SPORT2_MTCS1() bfin_read32(SPORT2_MTCS1)
1779#define bfin_write_SPORT2_MTCS1(val) bfin_write32(SPORT2_MTCS1, val)
1780#define bfin_read_SPORT2_MTCS2() bfin_read32(SPORT2_MTCS2)
1781#define bfin_write_SPORT2_MTCS2(val) bfin_write32(SPORT2_MTCS2, val)
1782#define bfin_read_SPORT2_MTCS3() bfin_read32(SPORT2_MTCS3)
1783#define bfin_write_SPORT2_MTCS3(val) bfin_write32(SPORT2_MTCS3, val)
1784#define bfin_read_SPORT2_MRCS0() bfin_read32(SPORT2_MRCS0)
1785#define bfin_write_SPORT2_MRCS0(val) bfin_write32(SPORT2_MRCS0, val)
1786#define bfin_read_SPORT2_MRCS1() bfin_read32(SPORT2_MRCS1)
1787#define bfin_write_SPORT2_MRCS1(val) bfin_write32(SPORT2_MRCS1, val)
1788#define bfin_read_SPORT2_MRCS2() bfin_read32(SPORT2_MRCS2)
1789#define bfin_write_SPORT2_MRCS2(val) bfin_write32(SPORT2_MRCS2, val)
1790#define bfin_read_SPORT2_MRCS3() bfin_read32(SPORT2_MRCS3)
1791#define bfin_write_SPORT2_MRCS3(val) bfin_write32(SPORT2_MRCS3, val)
1792
1793/* SPORT3 Registers */
1794
1795#define bfin_read_SPORT3_TCR1() bfin_read16(SPORT3_TCR1)
1796#define bfin_write_SPORT3_TCR1(val) bfin_write16(SPORT3_TCR1, val)
1797#define bfin_read_SPORT3_TCR2() bfin_read16(SPORT3_TCR2)
1798#define bfin_write_SPORT3_TCR2(val) bfin_write16(SPORT3_TCR2, val)
1799#define bfin_read_SPORT3_TCLKDIV() bfin_read16(SPORT3_TCLKDIV)
1800#define bfin_write_SPORT3_TCLKDIV(val) bfin_write16(SPORT3_TCLKDIV, val)
1801#define bfin_read_SPORT3_TFSDIV() bfin_read16(SPORT3_TFSDIV)
1802#define bfin_write_SPORT3_TFSDIV(val) bfin_write16(SPORT3_TFSDIV, val)
1803#define bfin_read_SPORT3_TX() bfin_read32(SPORT3_TX)
1804#define bfin_write_SPORT3_TX(val) bfin_write32(SPORT3_TX, val)
1805#define bfin_read_SPORT3_RX() bfin_read32(SPORT3_RX)
1806#define bfin_write_SPORT3_RX(val) bfin_write32(SPORT3_RX, val)
1807#define bfin_read_SPORT3_RCR1() bfin_read16(SPORT3_RCR1)
1808#define bfin_write_SPORT3_RCR1(val) bfin_write16(SPORT3_RCR1, val)
1809#define bfin_read_SPORT3_RCR2() bfin_read16(SPORT3_RCR2)
1810#define bfin_write_SPORT3_RCR2(val) bfin_write16(SPORT3_RCR2, val)
1811#define bfin_read_SPORT3_RCLKDIV() bfin_read16(SPORT3_RCLKDIV)
1812#define bfin_write_SPORT3_RCLKDIV(val) bfin_write16(SPORT3_RCLKDIV, val)
1813#define bfin_read_SPORT3_RFSDIV() bfin_read16(SPORT3_RFSDIV)
1814#define bfin_write_SPORT3_RFSDIV(val) bfin_write16(SPORT3_RFSDIV, val)
1815#define bfin_read_SPORT3_STAT() bfin_read16(SPORT3_STAT)
1816#define bfin_write_SPORT3_STAT(val) bfin_write16(SPORT3_STAT, val)
1817#define bfin_read_SPORT3_CHNL() bfin_read16(SPORT3_CHNL)
1818#define bfin_write_SPORT3_CHNL(val) bfin_write16(SPORT3_CHNL, val)
1819#define bfin_read_SPORT3_MCMC1() bfin_read16(SPORT3_MCMC1)
1820#define bfin_write_SPORT3_MCMC1(val) bfin_write16(SPORT3_MCMC1, val)
1821#define bfin_read_SPORT3_MCMC2() bfin_read16(SPORT3_MCMC2)
1822#define bfin_write_SPORT3_MCMC2(val) bfin_write16(SPORT3_MCMC2, val)
1823#define bfin_read_SPORT3_MTCS0() bfin_read32(SPORT3_MTCS0)
1824#define bfin_write_SPORT3_MTCS0(val) bfin_write32(SPORT3_MTCS0, val)
1825#define bfin_read_SPORT3_MTCS1() bfin_read32(SPORT3_MTCS1)
1826#define bfin_write_SPORT3_MTCS1(val) bfin_write32(SPORT3_MTCS1, val)
1827#define bfin_read_SPORT3_MTCS2() bfin_read32(SPORT3_MTCS2)
1828#define bfin_write_SPORT3_MTCS2(val) bfin_write32(SPORT3_MTCS2, val)
1829#define bfin_read_SPORT3_MTCS3() bfin_read32(SPORT3_MTCS3)
1830#define bfin_write_SPORT3_MTCS3(val) bfin_write32(SPORT3_MTCS3, val)
1831#define bfin_read_SPORT3_MRCS0() bfin_read32(SPORT3_MRCS0)
1832#define bfin_write_SPORT3_MRCS0(val) bfin_write32(SPORT3_MRCS0, val)
1833#define bfin_read_SPORT3_MRCS1() bfin_read32(SPORT3_MRCS1)
1834#define bfin_write_SPORT3_MRCS1(val) bfin_write32(SPORT3_MRCS1, val)
1835#define bfin_read_SPORT3_MRCS2() bfin_read32(SPORT3_MRCS2)
1836#define bfin_write_SPORT3_MRCS2(val) bfin_write32(SPORT3_MRCS2, val)
1837#define bfin_read_SPORT3_MRCS3() bfin_read32(SPORT3_MRCS3)
1838#define bfin_write_SPORT3_MRCS3(val) bfin_write32(SPORT3_MRCS3, val)
1839
1840/* EPPI2 Registers */
1841
1842#define bfin_read_EPPI2_STATUS() bfin_read16(EPPI2_STATUS)
1843#define bfin_write_EPPI2_STATUS(val) bfin_write16(EPPI2_STATUS, val)
1844#define bfin_read_EPPI2_HCOUNT() bfin_read16(EPPI2_HCOUNT)
1845#define bfin_write_EPPI2_HCOUNT(val) bfin_write16(EPPI2_HCOUNT, val)
1846#define bfin_read_EPPI2_HDELAY() bfin_read16(EPPI2_HDELAY)
1847#define bfin_write_EPPI2_HDELAY(val) bfin_write16(EPPI2_HDELAY, val)
1848#define bfin_read_EPPI2_VCOUNT() bfin_read16(EPPI2_VCOUNT)
1849#define bfin_write_EPPI2_VCOUNT(val) bfin_write16(EPPI2_VCOUNT, val)
1850#define bfin_read_EPPI2_VDELAY() bfin_read16(EPPI2_VDELAY)
1851#define bfin_write_EPPI2_VDELAY(val) bfin_write16(EPPI2_VDELAY, val)
1852#define bfin_read_EPPI2_FRAME() bfin_read16(EPPI2_FRAME)
1853#define bfin_write_EPPI2_FRAME(val) bfin_write16(EPPI2_FRAME, val)
1854#define bfin_read_EPPI2_LINE() bfin_read16(EPPI2_LINE)
1855#define bfin_write_EPPI2_LINE(val) bfin_write16(EPPI2_LINE, val)
1856#define bfin_read_EPPI2_CLKDIV() bfin_read16(EPPI2_CLKDIV)
1857#define bfin_write_EPPI2_CLKDIV(val) bfin_write16(EPPI2_CLKDIV, val)
1858#define bfin_read_EPPI2_CONTROL() bfin_read32(EPPI2_CONTROL)
1859#define bfin_write_EPPI2_CONTROL(val) bfin_write32(EPPI2_CONTROL, val)
1860#define bfin_read_EPPI2_FS1W_HBL() bfin_read32(EPPI2_FS1W_HBL)
1861#define bfin_write_EPPI2_FS1W_HBL(val) bfin_write32(EPPI2_FS1W_HBL, val)
1862#define bfin_read_EPPI2_FS1P_AVPL() bfin_read32(EPPI2_FS1P_AVPL)
1863#define bfin_write_EPPI2_FS1P_AVPL(val) bfin_write32(EPPI2_FS1P_AVPL, val)
1864#define bfin_read_EPPI2_FS2W_LVB() bfin_read32(EPPI2_FS2W_LVB)
1865#define bfin_write_EPPI2_FS2W_LVB(val) bfin_write32(EPPI2_FS2W_LVB, val)
1866#define bfin_read_EPPI2_FS2P_LAVF() bfin_read32(EPPI2_FS2P_LAVF)
1867#define bfin_write_EPPI2_FS2P_LAVF(val) bfin_write32(EPPI2_FS2P_LAVF, val)
1868#define bfin_read_EPPI2_CLIP() bfin_read32(EPPI2_CLIP)
1869#define bfin_write_EPPI2_CLIP(val) bfin_write32(EPPI2_CLIP, val)
1870
1871/* CAN Controller 0 Config 1 Registers */
1872
1873#define bfin_read_CAN0_MC1() bfin_read16(CAN0_MC1)
1874#define bfin_write_CAN0_MC1(val) bfin_write16(CAN0_MC1, val)
1875#define bfin_read_CAN0_MD1() bfin_read16(CAN0_MD1)
1876#define bfin_write_CAN0_MD1(val) bfin_write16(CAN0_MD1, val)
1877#define bfin_read_CAN0_TRS1() bfin_read16(CAN0_TRS1)
1878#define bfin_write_CAN0_TRS1(val) bfin_write16(CAN0_TRS1, val)
1879#define bfin_read_CAN0_TRR1() bfin_read16(CAN0_TRR1)
1880#define bfin_write_CAN0_TRR1(val) bfin_write16(CAN0_TRR1, val)
1881#define bfin_read_CAN0_TA1() bfin_read16(CAN0_TA1)
1882#define bfin_write_CAN0_TA1(val) bfin_write16(CAN0_TA1, val)
1883#define bfin_read_CAN0_AA1() bfin_read16(CAN0_AA1)
1884#define bfin_write_CAN0_AA1(val) bfin_write16(CAN0_AA1, val)
1885#define bfin_read_CAN0_RMP1() bfin_read16(CAN0_RMP1)
1886#define bfin_write_CAN0_RMP1(val) bfin_write16(CAN0_RMP1, val)
1887#define bfin_read_CAN0_RML1() bfin_read16(CAN0_RML1)
1888#define bfin_write_CAN0_RML1(val) bfin_write16(CAN0_RML1, val)
1889#define bfin_read_CAN0_MBTIF1() bfin_read16(CAN0_MBTIF1)
1890#define bfin_write_CAN0_MBTIF1(val) bfin_write16(CAN0_MBTIF1, val)
1891#define bfin_read_CAN0_MBRIF1() bfin_read16(CAN0_MBRIF1)
1892#define bfin_write_CAN0_MBRIF1(val) bfin_write16(CAN0_MBRIF1, val)
1893#define bfin_read_CAN0_MBIM1() bfin_read16(CAN0_MBIM1)
1894#define bfin_write_CAN0_MBIM1(val) bfin_write16(CAN0_MBIM1, val)
1895#define bfin_read_CAN0_RFH1() bfin_read16(CAN0_RFH1)
1896#define bfin_write_CAN0_RFH1(val) bfin_write16(CAN0_RFH1, val)
1897#define bfin_read_CAN0_OPSS1() bfin_read16(CAN0_OPSS1)
1898#define bfin_write_CAN0_OPSS1(val) bfin_write16(CAN0_OPSS1, val)
1899
1900/* CAN Controller 0 Config 2 Registers */
1901
1902#define bfin_read_CAN0_MC2() bfin_read16(CAN0_MC2)
1903#define bfin_write_CAN0_MC2(val) bfin_write16(CAN0_MC2, val)
1904#define bfin_read_CAN0_MD2() bfin_read16(CAN0_MD2)
1905#define bfin_write_CAN0_MD2(val) bfin_write16(CAN0_MD2, val)
1906#define bfin_read_CAN0_TRS2() bfin_read16(CAN0_TRS2)
1907#define bfin_write_CAN0_TRS2(val) bfin_write16(CAN0_TRS2, val)
1908#define bfin_read_CAN0_TRR2() bfin_read16(CAN0_TRR2)
1909#define bfin_write_CAN0_TRR2(val) bfin_write16(CAN0_TRR2, val)
1910#define bfin_read_CAN0_TA2() bfin_read16(CAN0_TA2)
1911#define bfin_write_CAN0_TA2(val) bfin_write16(CAN0_TA2, val)
1912#define bfin_read_CAN0_AA2() bfin_read16(CAN0_AA2)
1913#define bfin_write_CAN0_AA2(val) bfin_write16(CAN0_AA2, val)
1914#define bfin_read_CAN0_RMP2() bfin_read16(CAN0_RMP2)
1915#define bfin_write_CAN0_RMP2(val) bfin_write16(CAN0_RMP2, val)
1916#define bfin_read_CAN0_RML2() bfin_read16(CAN0_RML2)
1917#define bfin_write_CAN0_RML2(val) bfin_write16(CAN0_RML2, val)
1918#define bfin_read_CAN0_MBTIF2() bfin_read16(CAN0_MBTIF2)
1919#define bfin_write_CAN0_MBTIF2(val) bfin_write16(CAN0_MBTIF2, val)
1920#define bfin_read_CAN0_MBRIF2() bfin_read16(CAN0_MBRIF2)
1921#define bfin_write_CAN0_MBRIF2(val) bfin_write16(CAN0_MBRIF2, val)
1922#define bfin_read_CAN0_MBIM2() bfin_read16(CAN0_MBIM2)
1923#define bfin_write_CAN0_MBIM2(val) bfin_write16(CAN0_MBIM2, val)
1924#define bfin_read_CAN0_RFH2() bfin_read16(CAN0_RFH2)
1925#define bfin_write_CAN0_RFH2(val) bfin_write16(CAN0_RFH2, val)
1926#define bfin_read_CAN0_OPSS2() bfin_read16(CAN0_OPSS2)
1927#define bfin_write_CAN0_OPSS2(val) bfin_write16(CAN0_OPSS2, val)
1928
1929/* CAN Controller 0 Clock/Interrubfin_read_()t/Counter Registers */
1930
1931#define bfin_read_CAN0_CLOCK() bfin_read16(CAN0_CLOCK)
1932#define bfin_write_CAN0_CLOCK(val) bfin_write16(CAN0_CLOCK, val)
1933#define bfin_read_CAN0_TIMING() bfin_read16(CAN0_TIMING)
1934#define bfin_write_CAN0_TIMING(val) bfin_write16(CAN0_TIMING, val)
1935#define bfin_read_CAN0_DEBUG() bfin_read16(CAN0_DEBUG)
1936#define bfin_write_CAN0_DEBUG(val) bfin_write16(CAN0_DEBUG, val)
1937#define bfin_read_CAN0_STATUS() bfin_read16(CAN0_STATUS)
1938#define bfin_write_CAN0_STATUS(val) bfin_write16(CAN0_STATUS, val)
1939#define bfin_read_CAN0_CEC() bfin_read16(CAN0_CEC)
1940#define bfin_write_CAN0_CEC(val) bfin_write16(CAN0_CEC, val)
1941#define bfin_read_CAN0_GIS() bfin_read16(CAN0_GIS)
1942#define bfin_write_CAN0_GIS(val) bfin_write16(CAN0_GIS, val)
1943#define bfin_read_CAN0_GIM() bfin_read16(CAN0_GIM)
1944#define bfin_write_CAN0_GIM(val) bfin_write16(CAN0_GIM, val)
1945#define bfin_read_CAN0_GIF() bfin_read16(CAN0_GIF)
1946#define bfin_write_CAN0_GIF(val) bfin_write16(CAN0_GIF, val)
1947#define bfin_read_CAN0_CONTROL() bfin_read16(CAN0_CONTROL)
1948#define bfin_write_CAN0_CONTROL(val) bfin_write16(CAN0_CONTROL, val)
1949#define bfin_read_CAN0_INTR() bfin_read16(CAN0_INTR)
1950#define bfin_write_CAN0_INTR(val) bfin_write16(CAN0_INTR, val)
1951#define bfin_read_CAN0_MBTD() bfin_read16(CAN0_MBTD)
1952#define bfin_write_CAN0_MBTD(val) bfin_write16(CAN0_MBTD, val)
1953#define bfin_read_CAN0_EWR() bfin_read16(CAN0_EWR)
1954#define bfin_write_CAN0_EWR(val) bfin_write16(CAN0_EWR, val)
1955#define bfin_read_CAN0_ESR() bfin_read16(CAN0_ESR)
1956#define bfin_write_CAN0_ESR(val) bfin_write16(CAN0_ESR, val)
1957#define bfin_read_CAN0_UCCNT() bfin_read16(CAN0_UCCNT)
1958#define bfin_write_CAN0_UCCNT(val) bfin_write16(CAN0_UCCNT, val)
1959#define bfin_read_CAN0_UCRC() bfin_read16(CAN0_UCRC)
1960#define bfin_write_CAN0_UCRC(val) bfin_write16(CAN0_UCRC, val)
1961#define bfin_read_CAN0_UCCNF() bfin_read16(CAN0_UCCNF)
1962#define bfin_write_CAN0_UCCNF(val) bfin_write16(CAN0_UCCNF, val)
1963
1964/* CAN Controller 0 Accebfin_read_()tance Registers */
1965
1966#define bfin_read_CAN0_AM00L() bfin_read16(CAN0_AM00L)
1967#define bfin_write_CAN0_AM00L(val) bfin_write16(CAN0_AM00L, val)
1968#define bfin_read_CAN0_AM00H() bfin_read16(CAN0_AM00H)
1969#define bfin_write_CAN0_AM00H(val) bfin_write16(CAN0_AM00H, val)
1970#define bfin_read_CAN0_AM01L() bfin_read16(CAN0_AM01L)
1971#define bfin_write_CAN0_AM01L(val) bfin_write16(CAN0_AM01L, val)
1972#define bfin_read_CAN0_AM01H() bfin_read16(CAN0_AM01H)
1973#define bfin_write_CAN0_AM01H(val) bfin_write16(CAN0_AM01H, val)
1974#define bfin_read_CAN0_AM02L() bfin_read16(CAN0_AM02L)
1975#define bfin_write_CAN0_AM02L(val) bfin_write16(CAN0_AM02L, val)
1976#define bfin_read_CAN0_AM02H() bfin_read16(CAN0_AM02H)
1977#define bfin_write_CAN0_AM02H(val) bfin_write16(CAN0_AM02H, val)
1978#define bfin_read_CAN0_AM03L() bfin_read16(CAN0_AM03L)
1979#define bfin_write_CAN0_AM03L(val) bfin_write16(CAN0_AM03L, val)
1980#define bfin_read_CAN0_AM03H() bfin_read16(CAN0_AM03H)
1981#define bfin_write_CAN0_AM03H(val) bfin_write16(CAN0_AM03H, val)
1982#define bfin_read_CAN0_AM04L() bfin_read16(CAN0_AM04L)
1983#define bfin_write_CAN0_AM04L(val) bfin_write16(CAN0_AM04L, val)
1984#define bfin_read_CAN0_AM04H() bfin_read16(CAN0_AM04H)
1985#define bfin_write_CAN0_AM04H(val) bfin_write16(CAN0_AM04H, val)
1986#define bfin_read_CAN0_AM05L() bfin_read16(CAN0_AM05L)
1987#define bfin_write_CAN0_AM05L(val) bfin_write16(CAN0_AM05L, val)
1988#define bfin_read_CAN0_AM05H() bfin_read16(CAN0_AM05H)
1989#define bfin_write_CAN0_AM05H(val) bfin_write16(CAN0_AM05H, val)
1990#define bfin_read_CAN0_AM06L() bfin_read16(CAN0_AM06L)
1991#define bfin_write_CAN0_AM06L(val) bfin_write16(CAN0_AM06L, val)
1992#define bfin_read_CAN0_AM06H() bfin_read16(CAN0_AM06H)
1993#define bfin_write_CAN0_AM06H(val) bfin_write16(CAN0_AM06H, val)
1994#define bfin_read_CAN0_AM07L() bfin_read16(CAN0_AM07L)
1995#define bfin_write_CAN0_AM07L(val) bfin_write16(CAN0_AM07L, val)
1996#define bfin_read_CAN0_AM07H() bfin_read16(CAN0_AM07H)
1997#define bfin_write_CAN0_AM07H(val) bfin_write16(CAN0_AM07H, val)
1998#define bfin_read_CAN0_AM08L() bfin_read16(CAN0_AM08L)
1999#define bfin_write_CAN0_AM08L(val) bfin_write16(CAN0_AM08L, val)
2000#define bfin_read_CAN0_AM08H() bfin_read16(CAN0_AM08H)
2001#define bfin_write_CAN0_AM08H(val) bfin_write16(CAN0_AM08H, val)
2002#define bfin_read_CAN0_AM09L() bfin_read16(CAN0_AM09L)
2003#define bfin_write_CAN0_AM09L(val) bfin_write16(CAN0_AM09L, val)
2004#define bfin_read_CAN0_AM09H() bfin_read16(CAN0_AM09H)
2005#define bfin_write_CAN0_AM09H(val) bfin_write16(CAN0_AM09H, val)
2006#define bfin_read_CAN0_AM10L() bfin_read16(CAN0_AM10L)
2007#define bfin_write_CAN0_AM10L(val) bfin_write16(CAN0_AM10L, val)
2008#define bfin_read_CAN0_AM10H() bfin_read16(CAN0_AM10H)
2009#define bfin_write_CAN0_AM10H(val) bfin_write16(CAN0_AM10H, val)
2010#define bfin_read_CAN0_AM11L() bfin_read16(CAN0_AM11L)
2011#define bfin_write_CAN0_AM11L(val) bfin_write16(CAN0_AM11L, val)
2012#define bfin_read_CAN0_AM11H() bfin_read16(CAN0_AM11H)
2013#define bfin_write_CAN0_AM11H(val) bfin_write16(CAN0_AM11H, val)
2014#define bfin_read_CAN0_AM12L() bfin_read16(CAN0_AM12L)
2015#define bfin_write_CAN0_AM12L(val) bfin_write16(CAN0_AM12L, val)
2016#define bfin_read_CAN0_AM12H() bfin_read16(CAN0_AM12H)
2017#define bfin_write_CAN0_AM12H(val) bfin_write16(CAN0_AM12H, val)
2018#define bfin_read_CAN0_AM13L() bfin_read16(CAN0_AM13L)
2019#define bfin_write_CAN0_AM13L(val) bfin_write16(CAN0_AM13L, val)
2020#define bfin_read_CAN0_AM13H() bfin_read16(CAN0_AM13H)
2021#define bfin_write_CAN0_AM13H(val) bfin_write16(CAN0_AM13H, val)
2022#define bfin_read_CAN0_AM14L() bfin_read16(CAN0_AM14L)
2023#define bfin_write_CAN0_AM14L(val) bfin_write16(CAN0_AM14L, val)
2024#define bfin_read_CAN0_AM14H() bfin_read16(CAN0_AM14H)
2025#define bfin_write_CAN0_AM14H(val) bfin_write16(CAN0_AM14H, val)
2026#define bfin_read_CAN0_AM15L() bfin_read16(CAN0_AM15L)
2027#define bfin_write_CAN0_AM15L(val) bfin_write16(CAN0_AM15L, val)
2028#define bfin_read_CAN0_AM15H() bfin_read16(CAN0_AM15H)
2029#define bfin_write_CAN0_AM15H(val) bfin_write16(CAN0_AM15H, val)
2030
2031/* CAN Controller 0 Accebfin_read_()tance Registers */
2032
2033#define bfin_read_CAN0_AM16L() bfin_read16(CAN0_AM16L)
2034#define bfin_write_CAN0_AM16L(val) bfin_write16(CAN0_AM16L, val)
2035#define bfin_read_CAN0_AM16H() bfin_read16(CAN0_AM16H)
2036#define bfin_write_CAN0_AM16H(val) bfin_write16(CAN0_AM16H, val)
2037#define bfin_read_CAN0_AM17L() bfin_read16(CAN0_AM17L)
2038#define bfin_write_CAN0_AM17L(val) bfin_write16(CAN0_AM17L, val)
2039#define bfin_read_CAN0_AM17H() bfin_read16(CAN0_AM17H)
2040#define bfin_write_CAN0_AM17H(val) bfin_write16(CAN0_AM17H, val)
2041#define bfin_read_CAN0_AM18L() bfin_read16(CAN0_AM18L)
2042#define bfin_write_CAN0_AM18L(val) bfin_write16(CAN0_AM18L, val)
2043#define bfin_read_CAN0_AM18H() bfin_read16(CAN0_AM18H)
2044#define bfin_write_CAN0_AM18H(val) bfin_write16(CAN0_AM18H, val)
2045#define bfin_read_CAN0_AM19L() bfin_read16(CAN0_AM19L)
2046#define bfin_write_CAN0_AM19L(val) bfin_write16(CAN0_AM19L, val)
2047#define bfin_read_CAN0_AM19H() bfin_read16(CAN0_AM19H)
2048#define bfin_write_CAN0_AM19H(val) bfin_write16(CAN0_AM19H, val)
2049#define bfin_read_CAN0_AM20L() bfin_read16(CAN0_AM20L)
2050#define bfin_write_CAN0_AM20L(val) bfin_write16(CAN0_AM20L, val)
2051#define bfin_read_CAN0_AM20H() bfin_read16(CAN0_AM20H)
2052#define bfin_write_CAN0_AM20H(val) bfin_write16(CAN0_AM20H, val)
2053#define bfin_read_CAN0_AM21L() bfin_read16(CAN0_AM21L)
2054#define bfin_write_CAN0_AM21L(val) bfin_write16(CAN0_AM21L, val)
2055#define bfin_read_CAN0_AM21H() bfin_read16(CAN0_AM21H)
2056#define bfin_write_CAN0_AM21H(val) bfin_write16(CAN0_AM21H, val)
2057#define bfin_read_CAN0_AM22L() bfin_read16(CAN0_AM22L)
2058#define bfin_write_CAN0_AM22L(val) bfin_write16(CAN0_AM22L, val)
2059#define bfin_read_CAN0_AM22H() bfin_read16(CAN0_AM22H)
2060#define bfin_write_CAN0_AM22H(val) bfin_write16(CAN0_AM22H, val)
2061#define bfin_read_CAN0_AM23L() bfin_read16(CAN0_AM23L)
2062#define bfin_write_CAN0_AM23L(val) bfin_write16(CAN0_AM23L, val)
2063#define bfin_read_CAN0_AM23H() bfin_read16(CAN0_AM23H)
2064#define bfin_write_CAN0_AM23H(val) bfin_write16(CAN0_AM23H, val)
2065#define bfin_read_CAN0_AM24L() bfin_read16(CAN0_AM24L)
2066#define bfin_write_CAN0_AM24L(val) bfin_write16(CAN0_AM24L, val)
2067#define bfin_read_CAN0_AM24H() bfin_read16(CAN0_AM24H)
2068#define bfin_write_CAN0_AM24H(val) bfin_write16(CAN0_AM24H, val)
2069#define bfin_read_CAN0_AM25L() bfin_read16(CAN0_AM25L)
2070#define bfin_write_CAN0_AM25L(val) bfin_write16(CAN0_AM25L, val)
2071#define bfin_read_CAN0_AM25H() bfin_read16(CAN0_AM25H)
2072#define bfin_write_CAN0_AM25H(val) bfin_write16(CAN0_AM25H, val)
2073#define bfin_read_CAN0_AM26L() bfin_read16(CAN0_AM26L)
2074#define bfin_write_CAN0_AM26L(val) bfin_write16(CAN0_AM26L, val)
2075#define bfin_read_CAN0_AM26H() bfin_read16(CAN0_AM26H)
2076#define bfin_write_CAN0_AM26H(val) bfin_write16(CAN0_AM26H, val)
2077#define bfin_read_CAN0_AM27L() bfin_read16(CAN0_AM27L)
2078#define bfin_write_CAN0_AM27L(val) bfin_write16(CAN0_AM27L, val)
2079#define bfin_read_CAN0_AM27H() bfin_read16(CAN0_AM27H)
2080#define bfin_write_CAN0_AM27H(val) bfin_write16(CAN0_AM27H, val)
2081#define bfin_read_CAN0_AM28L() bfin_read16(CAN0_AM28L)
2082#define bfin_write_CAN0_AM28L(val) bfin_write16(CAN0_AM28L, val)
2083#define bfin_read_CAN0_AM28H() bfin_read16(CAN0_AM28H)
2084#define bfin_write_CAN0_AM28H(val) bfin_write16(CAN0_AM28H, val)
2085#define bfin_read_CAN0_AM29L() bfin_read16(CAN0_AM29L)
2086#define bfin_write_CAN0_AM29L(val) bfin_write16(CAN0_AM29L, val)
2087#define bfin_read_CAN0_AM29H() bfin_read16(CAN0_AM29H)
2088#define bfin_write_CAN0_AM29H(val) bfin_write16(CAN0_AM29H, val)
2089#define bfin_read_CAN0_AM30L() bfin_read16(CAN0_AM30L)
2090#define bfin_write_CAN0_AM30L(val) bfin_write16(CAN0_AM30L, val)
2091#define bfin_read_CAN0_AM30H() bfin_read16(CAN0_AM30H)
2092#define bfin_write_CAN0_AM30H(val) bfin_write16(CAN0_AM30H, val)
2093#define bfin_read_CAN0_AM31L() bfin_read16(CAN0_AM31L)
2094#define bfin_write_CAN0_AM31L(val) bfin_write16(CAN0_AM31L, val)
2095#define bfin_read_CAN0_AM31H() bfin_read16(CAN0_AM31H)
2096#define bfin_write_CAN0_AM31H(val) bfin_write16(CAN0_AM31H, val)
2097
2098/* CAN Controller 0 Mailbox Data Registers */
2099
2100#define bfin_read_CAN0_MB00_DATA0() bfin_read16(CAN0_MB00_DATA0)
2101#define bfin_write_CAN0_MB00_DATA0(val) bfin_write16(CAN0_MB00_DATA0, val)
2102#define bfin_read_CAN0_MB00_DATA1() bfin_read16(CAN0_MB00_DATA1)
2103#define bfin_write_CAN0_MB00_DATA1(val) bfin_write16(CAN0_MB00_DATA1, val)
2104#define bfin_read_CAN0_MB00_DATA2() bfin_read16(CAN0_MB00_DATA2)
2105#define bfin_write_CAN0_MB00_DATA2(val) bfin_write16(CAN0_MB00_DATA2, val)
2106#define bfin_read_CAN0_MB00_DATA3() bfin_read16(CAN0_MB00_DATA3)
2107#define bfin_write_CAN0_MB00_DATA3(val) bfin_write16(CAN0_MB00_DATA3, val)
2108#define bfin_read_CAN0_MB00_LENGTH() bfin_read16(CAN0_MB00_LENGTH)
2109#define bfin_write_CAN0_MB00_LENGTH(val) bfin_write16(CAN0_MB00_LENGTH, val)
2110#define bfin_read_CAN0_MB00_TIMESTAMP() bfin_read16(CAN0_MB00_TIMESTAMP)
2111#define bfin_write_CAN0_MB00_TIMESTAMP(val) bfin_write16(CAN0_MB00_TIMESTAMP, val)
2112#define bfin_read_CAN0_MB00_ID0() bfin_read16(CAN0_MB00_ID0)
2113#define bfin_write_CAN0_MB00_ID0(val) bfin_write16(CAN0_MB00_ID0, val)
2114#define bfin_read_CAN0_MB00_ID1() bfin_read16(CAN0_MB00_ID1)
2115#define bfin_write_CAN0_MB00_ID1(val) bfin_write16(CAN0_MB00_ID1, val)
2116#define bfin_read_CAN0_MB01_DATA0() bfin_read16(CAN0_MB01_DATA0)
2117#define bfin_write_CAN0_MB01_DATA0(val) bfin_write16(CAN0_MB01_DATA0, val)
2118#define bfin_read_CAN0_MB01_DATA1() bfin_read16(CAN0_MB01_DATA1)
2119#define bfin_write_CAN0_MB01_DATA1(val) bfin_write16(CAN0_MB01_DATA1, val)
2120#define bfin_read_CAN0_MB01_DATA2() bfin_read16(CAN0_MB01_DATA2)
2121#define bfin_write_CAN0_MB01_DATA2(val) bfin_write16(CAN0_MB01_DATA2, val)
2122#define bfin_read_CAN0_MB01_DATA3() bfin_read16(CAN0_MB01_DATA3)
2123#define bfin_write_CAN0_MB01_DATA3(val) bfin_write16(CAN0_MB01_DATA3, val)
2124#define bfin_read_CAN0_MB01_LENGTH() bfin_read16(CAN0_MB01_LENGTH)
2125#define bfin_write_CAN0_MB01_LENGTH(val) bfin_write16(CAN0_MB01_LENGTH, val)
2126#define bfin_read_CAN0_MB01_TIMESTAMP() bfin_read16(CAN0_MB01_TIMESTAMP)
2127#define bfin_write_CAN0_MB01_TIMESTAMP(val) bfin_write16(CAN0_MB01_TIMESTAMP, val)
2128#define bfin_read_CAN0_MB01_ID0() bfin_read16(CAN0_MB01_ID0)
2129#define bfin_write_CAN0_MB01_ID0(val) bfin_write16(CAN0_MB01_ID0, val)
2130#define bfin_read_CAN0_MB01_ID1() bfin_read16(CAN0_MB01_ID1)
2131#define bfin_write_CAN0_MB01_ID1(val) bfin_write16(CAN0_MB01_ID1, val)
2132#define bfin_read_CAN0_MB02_DATA0() bfin_read16(CAN0_MB02_DATA0)
2133#define bfin_write_CAN0_MB02_DATA0(val) bfin_write16(CAN0_MB02_DATA0, val)
2134#define bfin_read_CAN0_MB02_DATA1() bfin_read16(CAN0_MB02_DATA1)
2135#define bfin_write_CAN0_MB02_DATA1(val) bfin_write16(CAN0_MB02_DATA1, val)
2136#define bfin_read_CAN0_MB02_DATA2() bfin_read16(CAN0_MB02_DATA2)
2137#define bfin_write_CAN0_MB02_DATA2(val) bfin_write16(CAN0_MB02_DATA2, val)
2138#define bfin_read_CAN0_MB02_DATA3() bfin_read16(CAN0_MB02_DATA3)
2139#define bfin_write_CAN0_MB02_DATA3(val) bfin_write16(CAN0_MB02_DATA3, val)
2140#define bfin_read_CAN0_MB02_LENGTH() bfin_read16(CAN0_MB02_LENGTH)
2141#define bfin_write_CAN0_MB02_LENGTH(val) bfin_write16(CAN0_MB02_LENGTH, val)
2142#define bfin_read_CAN0_MB02_TIMESTAMP() bfin_read16(CAN0_MB02_TIMESTAMP)
2143#define bfin_write_CAN0_MB02_TIMESTAMP(val) bfin_write16(CAN0_MB02_TIMESTAMP, val)
2144#define bfin_read_CAN0_MB02_ID0() bfin_read16(CAN0_MB02_ID0)
2145#define bfin_write_CAN0_MB02_ID0(val) bfin_write16(CAN0_MB02_ID0, val)
2146#define bfin_read_CAN0_MB02_ID1() bfin_read16(CAN0_MB02_ID1)
2147#define bfin_write_CAN0_MB02_ID1(val) bfin_write16(CAN0_MB02_ID1, val)
2148#define bfin_read_CAN0_MB03_DATA0() bfin_read16(CAN0_MB03_DATA0)
2149#define bfin_write_CAN0_MB03_DATA0(val) bfin_write16(CAN0_MB03_DATA0, val)
2150#define bfin_read_CAN0_MB03_DATA1() bfin_read16(CAN0_MB03_DATA1)
2151#define bfin_write_CAN0_MB03_DATA1(val) bfin_write16(CAN0_MB03_DATA1, val)
2152#define bfin_read_CAN0_MB03_DATA2() bfin_read16(CAN0_MB03_DATA2)
2153#define bfin_write_CAN0_MB03_DATA2(val) bfin_write16(CAN0_MB03_DATA2, val)
2154#define bfin_read_CAN0_MB03_DATA3() bfin_read16(CAN0_MB03_DATA3)
2155#define bfin_write_CAN0_MB03_DATA3(val) bfin_write16(CAN0_MB03_DATA3, val)
2156#define bfin_read_CAN0_MB03_LENGTH() bfin_read16(CAN0_MB03_LENGTH)
2157#define bfin_write_CAN0_MB03_LENGTH(val) bfin_write16(CAN0_MB03_LENGTH, val)
2158#define bfin_read_CAN0_MB03_TIMESTAMP() bfin_read16(CAN0_MB03_TIMESTAMP)
2159#define bfin_write_CAN0_MB03_TIMESTAMP(val) bfin_write16(CAN0_MB03_TIMESTAMP, val)
2160#define bfin_read_CAN0_MB03_ID0() bfin_read16(CAN0_MB03_ID0)
2161#define bfin_write_CAN0_MB03_ID0(val) bfin_write16(CAN0_MB03_ID0, val)
2162#define bfin_read_CAN0_MB03_ID1() bfin_read16(CAN0_MB03_ID1)
2163#define bfin_write_CAN0_MB03_ID1(val) bfin_write16(CAN0_MB03_ID1, val)
2164#define bfin_read_CAN0_MB04_DATA0() bfin_read16(CAN0_MB04_DATA0)
2165#define bfin_write_CAN0_MB04_DATA0(val) bfin_write16(CAN0_MB04_DATA0, val)
2166#define bfin_read_CAN0_MB04_DATA1() bfin_read16(CAN0_MB04_DATA1)
2167#define bfin_write_CAN0_MB04_DATA1(val) bfin_write16(CAN0_MB04_DATA1, val)
2168#define bfin_read_CAN0_MB04_DATA2() bfin_read16(CAN0_MB04_DATA2)
2169#define bfin_write_CAN0_MB04_DATA2(val) bfin_write16(CAN0_MB04_DATA2, val)
2170#define bfin_read_CAN0_MB04_DATA3() bfin_read16(CAN0_MB04_DATA3)
2171#define bfin_write_CAN0_MB04_DATA3(val) bfin_write16(CAN0_MB04_DATA3, val)
2172#define bfin_read_CAN0_MB04_LENGTH() bfin_read16(CAN0_MB04_LENGTH)
2173#define bfin_write_CAN0_MB04_LENGTH(val) bfin_write16(CAN0_MB04_LENGTH, val)
2174#define bfin_read_CAN0_MB04_TIMESTAMP() bfin_read16(CAN0_MB04_TIMESTAMP)
2175#define bfin_write_CAN0_MB04_TIMESTAMP(val) bfin_write16(CAN0_MB04_TIMESTAMP, val)
2176#define bfin_read_CAN0_MB04_ID0() bfin_read16(CAN0_MB04_ID0)
2177#define bfin_write_CAN0_MB04_ID0(val) bfin_write16(CAN0_MB04_ID0, val)
2178#define bfin_read_CAN0_MB04_ID1() bfin_read16(CAN0_MB04_ID1)
2179#define bfin_write_CAN0_MB04_ID1(val) bfin_write16(CAN0_MB04_ID1, val)
2180#define bfin_read_CAN0_MB05_DATA0() bfin_read16(CAN0_MB05_DATA0)
2181#define bfin_write_CAN0_MB05_DATA0(val) bfin_write16(CAN0_MB05_DATA0, val)
2182#define bfin_read_CAN0_MB05_DATA1() bfin_read16(CAN0_MB05_DATA1)
2183#define bfin_write_CAN0_MB05_DATA1(val) bfin_write16(CAN0_MB05_DATA1, val)
2184#define bfin_read_CAN0_MB05_DATA2() bfin_read16(CAN0_MB05_DATA2)
2185#define bfin_write_CAN0_MB05_DATA2(val) bfin_write16(CAN0_MB05_DATA2, val)
2186#define bfin_read_CAN0_MB05_DATA3() bfin_read16(CAN0_MB05_DATA3)
2187#define bfin_write_CAN0_MB05_DATA3(val) bfin_write16(CAN0_MB05_DATA3, val)
2188#define bfin_read_CAN0_MB05_LENGTH() bfin_read16(CAN0_MB05_LENGTH)
2189#define bfin_write_CAN0_MB05_LENGTH(val) bfin_write16(CAN0_MB05_LENGTH, val)
2190#define bfin_read_CAN0_MB05_TIMESTAMP() bfin_read16(CAN0_MB05_TIMESTAMP)
2191#define bfin_write_CAN0_MB05_TIMESTAMP(val) bfin_write16(CAN0_MB05_TIMESTAMP, val)
2192#define bfin_read_CAN0_MB05_ID0() bfin_read16(CAN0_MB05_ID0)
2193#define bfin_write_CAN0_MB05_ID0(val) bfin_write16(CAN0_MB05_ID0, val)
2194#define bfin_read_CAN0_MB05_ID1() bfin_read16(CAN0_MB05_ID1)
2195#define bfin_write_CAN0_MB05_ID1(val) bfin_write16(CAN0_MB05_ID1, val)
2196#define bfin_read_CAN0_MB06_DATA0() bfin_read16(CAN0_MB06_DATA0)
2197#define bfin_write_CAN0_MB06_DATA0(val) bfin_write16(CAN0_MB06_DATA0, val)
2198#define bfin_read_CAN0_MB06_DATA1() bfin_read16(CAN0_MB06_DATA1)
2199#define bfin_write_CAN0_MB06_DATA1(val) bfin_write16(CAN0_MB06_DATA1, val)
2200#define bfin_read_CAN0_MB06_DATA2() bfin_read16(CAN0_MB06_DATA2)
2201#define bfin_write_CAN0_MB06_DATA2(val) bfin_write16(CAN0_MB06_DATA2, val)
2202#define bfin_read_CAN0_MB06_DATA3() bfin_read16(CAN0_MB06_DATA3)
2203#define bfin_write_CAN0_MB06_DATA3(val) bfin_write16(CAN0_MB06_DATA3, val)
2204#define bfin_read_CAN0_MB06_LENGTH() bfin_read16(CAN0_MB06_LENGTH)
2205#define bfin_write_CAN0_MB06_LENGTH(val) bfin_write16(CAN0_MB06_LENGTH, val)
2206#define bfin_read_CAN0_MB06_TIMESTAMP() bfin_read16(CAN0_MB06_TIMESTAMP)
2207#define bfin_write_CAN0_MB06_TIMESTAMP(val) bfin_write16(CAN0_MB06_TIMESTAMP, val)
2208#define bfin_read_CAN0_MB06_ID0() bfin_read16(CAN0_MB06_ID0)
2209#define bfin_write_CAN0_MB06_ID0(val) bfin_write16(CAN0_MB06_ID0, val)
2210#define bfin_read_CAN0_MB06_ID1() bfin_read16(CAN0_MB06_ID1)
2211#define bfin_write_CAN0_MB06_ID1(val) bfin_write16(CAN0_MB06_ID1, val)
2212#define bfin_read_CAN0_MB07_DATA0() bfin_read16(CAN0_MB07_DATA0)
2213#define bfin_write_CAN0_MB07_DATA0(val) bfin_write16(CAN0_MB07_DATA0, val)
2214#define bfin_read_CAN0_MB07_DATA1() bfin_read16(CAN0_MB07_DATA1)
2215#define bfin_write_CAN0_MB07_DATA1(val) bfin_write16(CAN0_MB07_DATA1, val)
2216#define bfin_read_CAN0_MB07_DATA2() bfin_read16(CAN0_MB07_DATA2)
2217#define bfin_write_CAN0_MB07_DATA2(val) bfin_write16(CAN0_MB07_DATA2, val)
2218#define bfin_read_CAN0_MB07_DATA3() bfin_read16(CAN0_MB07_DATA3)
2219#define bfin_write_CAN0_MB07_DATA3(val) bfin_write16(CAN0_MB07_DATA3, val)
2220#define bfin_read_CAN0_MB07_LENGTH() bfin_read16(CAN0_MB07_LENGTH)
2221#define bfin_write_CAN0_MB07_LENGTH(val) bfin_write16(CAN0_MB07_LENGTH, val)
2222#define bfin_read_CAN0_MB07_TIMESTAMP() bfin_read16(CAN0_MB07_TIMESTAMP)
2223#define bfin_write_CAN0_MB07_TIMESTAMP(val) bfin_write16(CAN0_MB07_TIMESTAMP, val)
2224#define bfin_read_CAN0_MB07_ID0() bfin_read16(CAN0_MB07_ID0)
2225#define bfin_write_CAN0_MB07_ID0(val) bfin_write16(CAN0_MB07_ID0, val)
2226#define bfin_read_CAN0_MB07_ID1() bfin_read16(CAN0_MB07_ID1)
2227#define bfin_write_CAN0_MB07_ID1(val) bfin_write16(CAN0_MB07_ID1, val)
2228#define bfin_read_CAN0_MB08_DATA0() bfin_read16(CAN0_MB08_DATA0)
2229#define bfin_write_CAN0_MB08_DATA0(val) bfin_write16(CAN0_MB08_DATA0, val)
2230#define bfin_read_CAN0_MB08_DATA1() bfin_read16(CAN0_MB08_DATA1)
2231#define bfin_write_CAN0_MB08_DATA1(val) bfin_write16(CAN0_MB08_DATA1, val)
2232#define bfin_read_CAN0_MB08_DATA2() bfin_read16(CAN0_MB08_DATA2)
2233#define bfin_write_CAN0_MB08_DATA2(val) bfin_write16(CAN0_MB08_DATA2, val)
2234#define bfin_read_CAN0_MB08_DATA3() bfin_read16(CAN0_MB08_DATA3)
2235#define bfin_write_CAN0_MB08_DATA3(val) bfin_write16(CAN0_MB08_DATA3, val)
2236#define bfin_read_CAN0_MB08_LENGTH() bfin_read16(CAN0_MB08_LENGTH)
2237#define bfin_write_CAN0_MB08_LENGTH(val) bfin_write16(CAN0_MB08_LENGTH, val)
2238#define bfin_read_CAN0_MB08_TIMESTAMP() bfin_read16(CAN0_MB08_TIMESTAMP)
2239#define bfin_write_CAN0_MB08_TIMESTAMP(val) bfin_write16(CAN0_MB08_TIMESTAMP, val)
2240#define bfin_read_CAN0_MB08_ID0() bfin_read16(CAN0_MB08_ID0)
2241#define bfin_write_CAN0_MB08_ID0(val) bfin_write16(CAN0_MB08_ID0, val)
2242#define bfin_read_CAN0_MB08_ID1() bfin_read16(CAN0_MB08_ID1)
2243#define bfin_write_CAN0_MB08_ID1(val) bfin_write16(CAN0_MB08_ID1, val)
2244#define bfin_read_CAN0_MB09_DATA0() bfin_read16(CAN0_MB09_DATA0)
2245#define bfin_write_CAN0_MB09_DATA0(val) bfin_write16(CAN0_MB09_DATA0, val)
2246#define bfin_read_CAN0_MB09_DATA1() bfin_read16(CAN0_MB09_DATA1)
2247#define bfin_write_CAN0_MB09_DATA1(val) bfin_write16(CAN0_MB09_DATA1, val)
2248#define bfin_read_CAN0_MB09_DATA2() bfin_read16(CAN0_MB09_DATA2)
2249#define bfin_write_CAN0_MB09_DATA2(val) bfin_write16(CAN0_MB09_DATA2, val)
2250#define bfin_read_CAN0_MB09_DATA3() bfin_read16(CAN0_MB09_DATA3)
2251#define bfin_write_CAN0_MB09_DATA3(val) bfin_write16(CAN0_MB09_DATA3, val)
2252#define bfin_read_CAN0_MB09_LENGTH() bfin_read16(CAN0_MB09_LENGTH)
2253#define bfin_write_CAN0_MB09_LENGTH(val) bfin_write16(CAN0_MB09_LENGTH, val)
2254#define bfin_read_CAN0_MB09_TIMESTAMP() bfin_read16(CAN0_MB09_TIMESTAMP)
2255#define bfin_write_CAN0_MB09_TIMESTAMP(val) bfin_write16(CAN0_MB09_TIMESTAMP, val)
2256#define bfin_read_CAN0_MB09_ID0() bfin_read16(CAN0_MB09_ID0)
2257#define bfin_write_CAN0_MB09_ID0(val) bfin_write16(CAN0_MB09_ID0, val)
2258#define bfin_read_CAN0_MB09_ID1() bfin_read16(CAN0_MB09_ID1)
2259#define bfin_write_CAN0_MB09_ID1(val) bfin_write16(CAN0_MB09_ID1, val)
2260#define bfin_read_CAN0_MB10_DATA0() bfin_read16(CAN0_MB10_DATA0)
2261#define bfin_write_CAN0_MB10_DATA0(val) bfin_write16(CAN0_MB10_DATA0, val)
2262#define bfin_read_CAN0_MB10_DATA1() bfin_read16(CAN0_MB10_DATA1)
2263#define bfin_write_CAN0_MB10_DATA1(val) bfin_write16(CAN0_MB10_DATA1, val)
2264#define bfin_read_CAN0_MB10_DATA2() bfin_read16(CAN0_MB10_DATA2)
2265#define bfin_write_CAN0_MB10_DATA2(val) bfin_write16(CAN0_MB10_DATA2, val)
2266#define bfin_read_CAN0_MB10_DATA3() bfin_read16(CAN0_MB10_DATA3)
2267#define bfin_write_CAN0_MB10_DATA3(val) bfin_write16(CAN0_MB10_DATA3, val)
2268#define bfin_read_CAN0_MB10_LENGTH() bfin_read16(CAN0_MB10_LENGTH)
2269#define bfin_write_CAN0_MB10_LENGTH(val) bfin_write16(CAN0_MB10_LENGTH, val)
2270#define bfin_read_CAN0_MB10_TIMESTAMP() bfin_read16(CAN0_MB10_TIMESTAMP)
2271#define bfin_write_CAN0_MB10_TIMESTAMP(val) bfin_write16(CAN0_MB10_TIMESTAMP, val)
2272#define bfin_read_CAN0_MB10_ID0() bfin_read16(CAN0_MB10_ID0)
2273#define bfin_write_CAN0_MB10_ID0(val) bfin_write16(CAN0_MB10_ID0, val)
2274#define bfin_read_CAN0_MB10_ID1() bfin_read16(CAN0_MB10_ID1)
2275#define bfin_write_CAN0_MB10_ID1(val) bfin_write16(CAN0_MB10_ID1, val)
2276#define bfin_read_CAN0_MB11_DATA0() bfin_read16(CAN0_MB11_DATA0)
2277#define bfin_write_CAN0_MB11_DATA0(val) bfin_write16(CAN0_MB11_DATA0, val)
2278#define bfin_read_CAN0_MB11_DATA1() bfin_read16(CAN0_MB11_DATA1)
2279#define bfin_write_CAN0_MB11_DATA1(val) bfin_write16(CAN0_MB11_DATA1, val)
2280#define bfin_read_CAN0_MB11_DATA2() bfin_read16(CAN0_MB11_DATA2)
2281#define bfin_write_CAN0_MB11_DATA2(val) bfin_write16(CAN0_MB11_DATA2, val)
2282#define bfin_read_CAN0_MB11_DATA3() bfin_read16(CAN0_MB11_DATA3)
2283#define bfin_write_CAN0_MB11_DATA3(val) bfin_write16(CAN0_MB11_DATA3, val)
2284#define bfin_read_CAN0_MB11_LENGTH() bfin_read16(CAN0_MB11_LENGTH)
2285#define bfin_write_CAN0_MB11_LENGTH(val) bfin_write16(CAN0_MB11_LENGTH, val)
2286#define bfin_read_CAN0_MB11_TIMESTAMP() bfin_read16(CAN0_MB11_TIMESTAMP)
2287#define bfin_write_CAN0_MB11_TIMESTAMP(val) bfin_write16(CAN0_MB11_TIMESTAMP, val)
2288#define bfin_read_CAN0_MB11_ID0() bfin_read16(CAN0_MB11_ID0)
2289#define bfin_write_CAN0_MB11_ID0(val) bfin_write16(CAN0_MB11_ID0, val)
2290#define bfin_read_CAN0_MB11_ID1() bfin_read16(CAN0_MB11_ID1)
2291#define bfin_write_CAN0_MB11_ID1(val) bfin_write16(CAN0_MB11_ID1, val)
2292#define bfin_read_CAN0_MB12_DATA0() bfin_read16(CAN0_MB12_DATA0)
2293#define bfin_write_CAN0_MB12_DATA0(val) bfin_write16(CAN0_MB12_DATA0, val)
2294#define bfin_read_CAN0_MB12_DATA1() bfin_read16(CAN0_MB12_DATA1)
2295#define bfin_write_CAN0_MB12_DATA1(val) bfin_write16(CAN0_MB12_DATA1, val)
2296#define bfin_read_CAN0_MB12_DATA2() bfin_read16(CAN0_MB12_DATA2)
2297#define bfin_write_CAN0_MB12_DATA2(val) bfin_write16(CAN0_MB12_DATA2, val)
2298#define bfin_read_CAN0_MB12_DATA3() bfin_read16(CAN0_MB12_DATA3)
2299#define bfin_write_CAN0_MB12_DATA3(val) bfin_write16(CAN0_MB12_DATA3, val)
2300#define bfin_read_CAN0_MB12_LENGTH() bfin_read16(CAN0_MB12_LENGTH)
2301#define bfin_write_CAN0_MB12_LENGTH(val) bfin_write16(CAN0_MB12_LENGTH, val)
2302#define bfin_read_CAN0_MB12_TIMESTAMP() bfin_read16(CAN0_MB12_TIMESTAMP)
2303#define bfin_write_CAN0_MB12_TIMESTAMP(val) bfin_write16(CAN0_MB12_TIMESTAMP, val)
2304#define bfin_read_CAN0_MB12_ID0() bfin_read16(CAN0_MB12_ID0)
2305#define bfin_write_CAN0_MB12_ID0(val) bfin_write16(CAN0_MB12_ID0, val)
2306#define bfin_read_CAN0_MB12_ID1() bfin_read16(CAN0_MB12_ID1)
2307#define bfin_write_CAN0_MB12_ID1(val) bfin_write16(CAN0_MB12_ID1, val)
2308#define bfin_read_CAN0_MB13_DATA0() bfin_read16(CAN0_MB13_DATA0)
2309#define bfin_write_CAN0_MB13_DATA0(val) bfin_write16(CAN0_MB13_DATA0, val)
2310#define bfin_read_CAN0_MB13_DATA1() bfin_read16(CAN0_MB13_DATA1)
2311#define bfin_write_CAN0_MB13_DATA1(val) bfin_write16(CAN0_MB13_DATA1, val)
2312#define bfin_read_CAN0_MB13_DATA2() bfin_read16(CAN0_MB13_DATA2)
2313#define bfin_write_CAN0_MB13_DATA2(val) bfin_write16(CAN0_MB13_DATA2, val)
2314#define bfin_read_CAN0_MB13_DATA3() bfin_read16(CAN0_MB13_DATA3)
2315#define bfin_write_CAN0_MB13_DATA3(val) bfin_write16(CAN0_MB13_DATA3, val)
2316#define bfin_read_CAN0_MB13_LENGTH() bfin_read16(CAN0_MB13_LENGTH)
2317#define bfin_write_CAN0_MB13_LENGTH(val) bfin_write16(CAN0_MB13_LENGTH, val)
2318#define bfin_read_CAN0_MB13_TIMESTAMP() bfin_read16(CAN0_MB13_TIMESTAMP)
2319#define bfin_write_CAN0_MB13_TIMESTAMP(val) bfin_write16(CAN0_MB13_TIMESTAMP, val)
2320#define bfin_read_CAN0_MB13_ID0() bfin_read16(CAN0_MB13_ID0)
2321#define bfin_write_CAN0_MB13_ID0(val) bfin_write16(CAN0_MB13_ID0, val)
2322#define bfin_read_CAN0_MB13_ID1() bfin_read16(CAN0_MB13_ID1)
2323#define bfin_write_CAN0_MB13_ID1(val) bfin_write16(CAN0_MB13_ID1, val)
2324#define bfin_read_CAN0_MB14_DATA0() bfin_read16(CAN0_MB14_DATA0)
2325#define bfin_write_CAN0_MB14_DATA0(val) bfin_write16(CAN0_MB14_DATA0, val)
2326#define bfin_read_CAN0_MB14_DATA1() bfin_read16(CAN0_MB14_DATA1)
2327#define bfin_write_CAN0_MB14_DATA1(val) bfin_write16(CAN0_MB14_DATA1, val)
2328#define bfin_read_CAN0_MB14_DATA2() bfin_read16(CAN0_MB14_DATA2)
2329#define bfin_write_CAN0_MB14_DATA2(val) bfin_write16(CAN0_MB14_DATA2, val)
2330#define bfin_read_CAN0_MB14_DATA3() bfin_read16(CAN0_MB14_DATA3)
2331#define bfin_write_CAN0_MB14_DATA3(val) bfin_write16(CAN0_MB14_DATA3, val)
2332#define bfin_read_CAN0_MB14_LENGTH() bfin_read16(CAN0_MB14_LENGTH)
2333#define bfin_write_CAN0_MB14_LENGTH(val) bfin_write16(CAN0_MB14_LENGTH, val)
2334#define bfin_read_CAN0_MB14_TIMESTAMP() bfin_read16(CAN0_MB14_TIMESTAMP)
2335#define bfin_write_CAN0_MB14_TIMESTAMP(val) bfin_write16(CAN0_MB14_TIMESTAMP, val)
2336#define bfin_read_CAN0_MB14_ID0() bfin_read16(CAN0_MB14_ID0)
2337#define bfin_write_CAN0_MB14_ID0(val) bfin_write16(CAN0_MB14_ID0, val)
2338#define bfin_read_CAN0_MB14_ID1() bfin_read16(CAN0_MB14_ID1)
2339#define bfin_write_CAN0_MB14_ID1(val) bfin_write16(CAN0_MB14_ID1, val)
2340#define bfin_read_CAN0_MB15_DATA0() bfin_read16(CAN0_MB15_DATA0)
2341#define bfin_write_CAN0_MB15_DATA0(val) bfin_write16(CAN0_MB15_DATA0, val)
2342#define bfin_read_CAN0_MB15_DATA1() bfin_read16(CAN0_MB15_DATA1)
2343#define bfin_write_CAN0_MB15_DATA1(val) bfin_write16(CAN0_MB15_DATA1, val)
2344#define bfin_read_CAN0_MB15_DATA2() bfin_read16(CAN0_MB15_DATA2)
2345#define bfin_write_CAN0_MB15_DATA2(val) bfin_write16(CAN0_MB15_DATA2, val)
2346#define bfin_read_CAN0_MB15_DATA3() bfin_read16(CAN0_MB15_DATA3)
2347#define bfin_write_CAN0_MB15_DATA3(val) bfin_write16(CAN0_MB15_DATA3, val)
2348#define bfin_read_CAN0_MB15_LENGTH() bfin_read16(CAN0_MB15_LENGTH)
2349#define bfin_write_CAN0_MB15_LENGTH(val) bfin_write16(CAN0_MB15_LENGTH, val)
2350#define bfin_read_CAN0_MB15_TIMESTAMP() bfin_read16(CAN0_MB15_TIMESTAMP)
2351#define bfin_write_CAN0_MB15_TIMESTAMP(val) bfin_write16(CAN0_MB15_TIMESTAMP, val)
2352#define bfin_read_CAN0_MB15_ID0() bfin_read16(CAN0_MB15_ID0)
2353#define bfin_write_CAN0_MB15_ID0(val) bfin_write16(CAN0_MB15_ID0, val)
2354#define bfin_read_CAN0_MB15_ID1() bfin_read16(CAN0_MB15_ID1)
2355#define bfin_write_CAN0_MB15_ID1(val) bfin_write16(CAN0_MB15_ID1, val)
2356
2357/* CAN Controller 0 Mailbox Data Registers */
2358
2359#define bfin_read_CAN0_MB16_DATA0() bfin_read16(CAN0_MB16_DATA0)
2360#define bfin_write_CAN0_MB16_DATA0(val) bfin_write16(CAN0_MB16_DATA0, val)
2361#define bfin_read_CAN0_MB16_DATA1() bfin_read16(CAN0_MB16_DATA1)
2362#define bfin_write_CAN0_MB16_DATA1(val) bfin_write16(CAN0_MB16_DATA1, val)
2363#define bfin_read_CAN0_MB16_DATA2() bfin_read16(CAN0_MB16_DATA2)
2364#define bfin_write_CAN0_MB16_DATA2(val) bfin_write16(CAN0_MB16_DATA2, val)
2365#define bfin_read_CAN0_MB16_DATA3() bfin_read16(CAN0_MB16_DATA3)
2366#define bfin_write_CAN0_MB16_DATA3(val) bfin_write16(CAN0_MB16_DATA3, val)
2367#define bfin_read_CAN0_MB16_LENGTH() bfin_read16(CAN0_MB16_LENGTH)
2368#define bfin_write_CAN0_MB16_LENGTH(val) bfin_write16(CAN0_MB16_LENGTH, val)
2369#define bfin_read_CAN0_MB16_TIMESTAMP() bfin_read16(CAN0_MB16_TIMESTAMP)
2370#define bfin_write_CAN0_MB16_TIMESTAMP(val) bfin_write16(CAN0_MB16_TIMESTAMP, val)
2371#define bfin_read_CAN0_MB16_ID0() bfin_read16(CAN0_MB16_ID0)
2372#define bfin_write_CAN0_MB16_ID0(val) bfin_write16(CAN0_MB16_ID0, val)
2373#define bfin_read_CAN0_MB16_ID1() bfin_read16(CAN0_MB16_ID1)
2374#define bfin_write_CAN0_MB16_ID1(val) bfin_write16(CAN0_MB16_ID1, val)
2375#define bfin_read_CAN0_MB17_DATA0() bfin_read16(CAN0_MB17_DATA0)
2376#define bfin_write_CAN0_MB17_DATA0(val) bfin_write16(CAN0_MB17_DATA0, val)
2377#define bfin_read_CAN0_MB17_DATA1() bfin_read16(CAN0_MB17_DATA1)
2378#define bfin_write_CAN0_MB17_DATA1(val) bfin_write16(CAN0_MB17_DATA1, val)
2379#define bfin_read_CAN0_MB17_DATA2() bfin_read16(CAN0_MB17_DATA2)
2380#define bfin_write_CAN0_MB17_DATA2(val) bfin_write16(CAN0_MB17_DATA2, val)
2381#define bfin_read_CAN0_MB17_DATA3() bfin_read16(CAN0_MB17_DATA3)
2382#define bfin_write_CAN0_MB17_DATA3(val) bfin_write16(CAN0_MB17_DATA3, val)
2383#define bfin_read_CAN0_MB17_LENGTH() bfin_read16(CAN0_MB17_LENGTH)
2384#define bfin_write_CAN0_MB17_LENGTH(val) bfin_write16(CAN0_MB17_LENGTH, val)
2385#define bfin_read_CAN0_MB17_TIMESTAMP() bfin_read16(CAN0_MB17_TIMESTAMP)
2386#define bfin_write_CAN0_MB17_TIMESTAMP(val) bfin_write16(CAN0_MB17_TIMESTAMP, val)
2387#define bfin_read_CAN0_MB17_ID0() bfin_read16(CAN0_MB17_ID0)
2388#define bfin_write_CAN0_MB17_ID0(val) bfin_write16(CAN0_MB17_ID0, val)
2389#define bfin_read_CAN0_MB17_ID1() bfin_read16(CAN0_MB17_ID1)
2390#define bfin_write_CAN0_MB17_ID1(val) bfin_write16(CAN0_MB17_ID1, val)
2391#define bfin_read_CAN0_MB18_DATA0() bfin_read16(CAN0_MB18_DATA0)
2392#define bfin_write_CAN0_MB18_DATA0(val) bfin_write16(CAN0_MB18_DATA0, val)
2393#define bfin_read_CAN0_MB18_DATA1() bfin_read16(CAN0_MB18_DATA1)
2394#define bfin_write_CAN0_MB18_DATA1(val) bfin_write16(CAN0_MB18_DATA1, val)
2395#define bfin_read_CAN0_MB18_DATA2() bfin_read16(CAN0_MB18_DATA2)
2396#define bfin_write_CAN0_MB18_DATA2(val) bfin_write16(CAN0_MB18_DATA2, val)
2397#define bfin_read_CAN0_MB18_DATA3() bfin_read16(CAN0_MB18_DATA3)
2398#define bfin_write_CAN0_MB18_DATA3(val) bfin_write16(CAN0_MB18_DATA3, val)
2399#define bfin_read_CAN0_MB18_LENGTH() bfin_read16(CAN0_MB18_LENGTH)
2400#define bfin_write_CAN0_MB18_LENGTH(val) bfin_write16(CAN0_MB18_LENGTH, val)
2401#define bfin_read_CAN0_MB18_TIMESTAMP() bfin_read16(CAN0_MB18_TIMESTAMP)
2402#define bfin_write_CAN0_MB18_TIMESTAMP(val) bfin_write16(CAN0_MB18_TIMESTAMP, val)
2403#define bfin_read_CAN0_MB18_ID0() bfin_read16(CAN0_MB18_ID0)
2404#define bfin_write_CAN0_MB18_ID0(val) bfin_write16(CAN0_MB18_ID0, val)
2405#define bfin_read_CAN0_MB18_ID1() bfin_read16(CAN0_MB18_ID1)
2406#define bfin_write_CAN0_MB18_ID1(val) bfin_write16(CAN0_MB18_ID1, val)
2407#define bfin_read_CAN0_MB19_DATA0() bfin_read16(CAN0_MB19_DATA0)
2408#define bfin_write_CAN0_MB19_DATA0(val) bfin_write16(CAN0_MB19_DATA0, val)
2409#define bfin_read_CAN0_MB19_DATA1() bfin_read16(CAN0_MB19_DATA1)
2410#define bfin_write_CAN0_MB19_DATA1(val) bfin_write16(CAN0_MB19_DATA1, val)
2411#define bfin_read_CAN0_MB19_DATA2() bfin_read16(CAN0_MB19_DATA2)
2412#define bfin_write_CAN0_MB19_DATA2(val) bfin_write16(CAN0_MB19_DATA2, val)
2413#define bfin_read_CAN0_MB19_DATA3() bfin_read16(CAN0_MB19_DATA3)
2414#define bfin_write_CAN0_MB19_DATA3(val) bfin_write16(CAN0_MB19_DATA3, val)
2415#define bfin_read_CAN0_MB19_LENGTH() bfin_read16(CAN0_MB19_LENGTH)
2416#define bfin_write_CAN0_MB19_LENGTH(val) bfin_write16(CAN0_MB19_LENGTH, val)
2417#define bfin_read_CAN0_MB19_TIMESTAMP() bfin_read16(CAN0_MB19_TIMESTAMP)
2418#define bfin_write_CAN0_MB19_TIMESTAMP(val) bfin_write16(CAN0_MB19_TIMESTAMP, val)
2419#define bfin_read_CAN0_MB19_ID0() bfin_read16(CAN0_MB19_ID0)
2420#define bfin_write_CAN0_MB19_ID0(val) bfin_write16(CAN0_MB19_ID0, val)
2421#define bfin_read_CAN0_MB19_ID1() bfin_read16(CAN0_MB19_ID1)
2422#define bfin_write_CAN0_MB19_ID1(val) bfin_write16(CAN0_MB19_ID1, val)
2423#define bfin_read_CAN0_MB20_DATA0() bfin_read16(CAN0_MB20_DATA0)
2424#define bfin_write_CAN0_MB20_DATA0(val) bfin_write16(CAN0_MB20_DATA0, val)
2425#define bfin_read_CAN0_MB20_DATA1() bfin_read16(CAN0_MB20_DATA1)
2426#define bfin_write_CAN0_MB20_DATA1(val) bfin_write16(CAN0_MB20_DATA1, val)
2427#define bfin_read_CAN0_MB20_DATA2() bfin_read16(CAN0_MB20_DATA2)
2428#define bfin_write_CAN0_MB20_DATA2(val) bfin_write16(CAN0_MB20_DATA2, val)
2429#define bfin_read_CAN0_MB20_DATA3() bfin_read16(CAN0_MB20_DATA3)
2430#define bfin_write_CAN0_MB20_DATA3(val) bfin_write16(CAN0_MB20_DATA3, val)
2431#define bfin_read_CAN0_MB20_LENGTH() bfin_read16(CAN0_MB20_LENGTH)
2432#define bfin_write_CAN0_MB20_LENGTH(val) bfin_write16(CAN0_MB20_LENGTH, val)
2433#define bfin_read_CAN0_MB20_TIMESTAMP() bfin_read16(CAN0_MB20_TIMESTAMP)
2434#define bfin_write_CAN0_MB20_TIMESTAMP(val) bfin_write16(CAN0_MB20_TIMESTAMP, val)
2435#define bfin_read_CAN0_MB20_ID0() bfin_read16(CAN0_MB20_ID0)
2436#define bfin_write_CAN0_MB20_ID0(val) bfin_write16(CAN0_MB20_ID0, val)
2437#define bfin_read_CAN0_MB20_ID1() bfin_read16(CAN0_MB20_ID1)
2438#define bfin_write_CAN0_MB20_ID1(val) bfin_write16(CAN0_MB20_ID1, val)
2439#define bfin_read_CAN0_MB21_DATA0() bfin_read16(CAN0_MB21_DATA0)
2440#define bfin_write_CAN0_MB21_DATA0(val) bfin_write16(CAN0_MB21_DATA0, val)
2441#define bfin_read_CAN0_MB21_DATA1() bfin_read16(CAN0_MB21_DATA1)
2442#define bfin_write_CAN0_MB21_DATA1(val) bfin_write16(CAN0_MB21_DATA1, val)
2443#define bfin_read_CAN0_MB21_DATA2() bfin_read16(CAN0_MB21_DATA2)
2444#define bfin_write_CAN0_MB21_DATA2(val) bfin_write16(CAN0_MB21_DATA2, val)
2445#define bfin_read_CAN0_MB21_DATA3() bfin_read16(CAN0_MB21_DATA3)
2446#define bfin_write_CAN0_MB21_DATA3(val) bfin_write16(CAN0_MB21_DATA3, val)
2447#define bfin_read_CAN0_MB21_LENGTH() bfin_read16(CAN0_MB21_LENGTH)
2448#define bfin_write_CAN0_MB21_LENGTH(val) bfin_write16(CAN0_MB21_LENGTH, val)
2449#define bfin_read_CAN0_MB21_TIMESTAMP() bfin_read16(CAN0_MB21_TIMESTAMP)
2450#define bfin_write_CAN0_MB21_TIMESTAMP(val) bfin_write16(CAN0_MB21_TIMESTAMP, val)
2451#define bfin_read_CAN0_MB21_ID0() bfin_read16(CAN0_MB21_ID0)
2452#define bfin_write_CAN0_MB21_ID0(val) bfin_write16(CAN0_MB21_ID0, val)
2453#define bfin_read_CAN0_MB21_ID1() bfin_read16(CAN0_MB21_ID1)
2454#define bfin_write_CAN0_MB21_ID1(val) bfin_write16(CAN0_MB21_ID1, val)
2455#define bfin_read_CAN0_MB22_DATA0() bfin_read16(CAN0_MB22_DATA0)
2456#define bfin_write_CAN0_MB22_DATA0(val) bfin_write16(CAN0_MB22_DATA0, val)
2457#define bfin_read_CAN0_MB22_DATA1() bfin_read16(CAN0_MB22_DATA1)
2458#define bfin_write_CAN0_MB22_DATA1(val) bfin_write16(CAN0_MB22_DATA1, val)
2459#define bfin_read_CAN0_MB22_DATA2() bfin_read16(CAN0_MB22_DATA2)
2460#define bfin_write_CAN0_MB22_DATA2(val) bfin_write16(CAN0_MB22_DATA2, val)
2461#define bfin_read_CAN0_MB22_DATA3() bfin_read16(CAN0_MB22_DATA3)
2462#define bfin_write_CAN0_MB22_DATA3(val) bfin_write16(CAN0_MB22_DATA3, val)
2463#define bfin_read_CAN0_MB22_LENGTH() bfin_read16(CAN0_MB22_LENGTH)
2464#define bfin_write_CAN0_MB22_LENGTH(val) bfin_write16(CAN0_MB22_LENGTH, val)
2465#define bfin_read_CAN0_MB22_TIMESTAMP() bfin_read16(CAN0_MB22_TIMESTAMP)
2466#define bfin_write_CAN0_MB22_TIMESTAMP(val) bfin_write16(CAN0_MB22_TIMESTAMP, val)
2467#define bfin_read_CAN0_MB22_ID0() bfin_read16(CAN0_MB22_ID0)
2468#define bfin_write_CAN0_MB22_ID0(val) bfin_write16(CAN0_MB22_ID0, val)
2469#define bfin_read_CAN0_MB22_ID1() bfin_read16(CAN0_MB22_ID1)
2470#define bfin_write_CAN0_MB22_ID1(val) bfin_write16(CAN0_MB22_ID1, val)
2471#define bfin_read_CAN0_MB23_DATA0() bfin_read16(CAN0_MB23_DATA0)
2472#define bfin_write_CAN0_MB23_DATA0(val) bfin_write16(CAN0_MB23_DATA0, val)
2473#define bfin_read_CAN0_MB23_DATA1() bfin_read16(CAN0_MB23_DATA1)
2474#define bfin_write_CAN0_MB23_DATA1(val) bfin_write16(CAN0_MB23_DATA1, val)
2475#define bfin_read_CAN0_MB23_DATA2() bfin_read16(CAN0_MB23_DATA2)
2476#define bfin_write_CAN0_MB23_DATA2(val) bfin_write16(CAN0_MB23_DATA2, val)
2477#define bfin_read_CAN0_MB23_DATA3() bfin_read16(CAN0_MB23_DATA3)
2478#define bfin_write_CAN0_MB23_DATA3(val) bfin_write16(CAN0_MB23_DATA3, val)
2479#define bfin_read_CAN0_MB23_LENGTH() bfin_read16(CAN0_MB23_LENGTH)
2480#define bfin_write_CAN0_MB23_LENGTH(val) bfin_write16(CAN0_MB23_LENGTH, val)
2481#define bfin_read_CAN0_MB23_TIMESTAMP() bfin_read16(CAN0_MB23_TIMESTAMP)
2482#define bfin_write_CAN0_MB23_TIMESTAMP(val) bfin_write16(CAN0_MB23_TIMESTAMP, val)
2483#define bfin_read_CAN0_MB23_ID0() bfin_read16(CAN0_MB23_ID0)
2484#define bfin_write_CAN0_MB23_ID0(val) bfin_write16(CAN0_MB23_ID0, val)
2485#define bfin_read_CAN0_MB23_ID1() bfin_read16(CAN0_MB23_ID1)
2486#define bfin_write_CAN0_MB23_ID1(val) bfin_write16(CAN0_MB23_ID1, val)
2487#define bfin_read_CAN0_MB24_DATA0() bfin_read16(CAN0_MB24_DATA0)
2488#define bfin_write_CAN0_MB24_DATA0(val) bfin_write16(CAN0_MB24_DATA0, val)
2489#define bfin_read_CAN0_MB24_DATA1() bfin_read16(CAN0_MB24_DATA1)
2490#define bfin_write_CAN0_MB24_DATA1(val) bfin_write16(CAN0_MB24_DATA1, val)
2491#define bfin_read_CAN0_MB24_DATA2() bfin_read16(CAN0_MB24_DATA2)
2492#define bfin_write_CAN0_MB24_DATA2(val) bfin_write16(CAN0_MB24_DATA2, val)
2493#define bfin_read_CAN0_MB24_DATA3() bfin_read16(CAN0_MB24_DATA3)
2494#define bfin_write_CAN0_MB24_DATA3(val) bfin_write16(CAN0_MB24_DATA3, val)
2495#define bfin_read_CAN0_MB24_LENGTH() bfin_read16(CAN0_MB24_LENGTH)
2496#define bfin_write_CAN0_MB24_LENGTH(val) bfin_write16(CAN0_MB24_LENGTH, val)
2497#define bfin_read_CAN0_MB24_TIMESTAMP() bfin_read16(CAN0_MB24_TIMESTAMP)
2498#define bfin_write_CAN0_MB24_TIMESTAMP(val) bfin_write16(CAN0_MB24_TIMESTAMP, val)
2499#define bfin_read_CAN0_MB24_ID0() bfin_read16(CAN0_MB24_ID0)
2500#define bfin_write_CAN0_MB24_ID0(val) bfin_write16(CAN0_MB24_ID0, val)
2501#define bfin_read_CAN0_MB24_ID1() bfin_read16(CAN0_MB24_ID1)
2502#define bfin_write_CAN0_MB24_ID1(val) bfin_write16(CAN0_MB24_ID1, val)
2503#define bfin_read_CAN0_MB25_DATA0() bfin_read16(CAN0_MB25_DATA0)
2504#define bfin_write_CAN0_MB25_DATA0(val) bfin_write16(CAN0_MB25_DATA0, val)
2505#define bfin_read_CAN0_MB25_DATA1() bfin_read16(CAN0_MB25_DATA1)
2506#define bfin_write_CAN0_MB25_DATA1(val) bfin_write16(CAN0_MB25_DATA1, val)
2507#define bfin_read_CAN0_MB25_DATA2() bfin_read16(CAN0_MB25_DATA2)
2508#define bfin_write_CAN0_MB25_DATA2(val) bfin_write16(CAN0_MB25_DATA2, val)
2509#define bfin_read_CAN0_MB25_DATA3() bfin_read16(CAN0_MB25_DATA3)
2510#define bfin_write_CAN0_MB25_DATA3(val) bfin_write16(CAN0_MB25_DATA3, val)
2511#define bfin_read_CAN0_MB25_LENGTH() bfin_read16(CAN0_MB25_LENGTH)
2512#define bfin_write_CAN0_MB25_LENGTH(val) bfin_write16(CAN0_MB25_LENGTH, val)
2513#define bfin_read_CAN0_MB25_TIMESTAMP() bfin_read16(CAN0_MB25_TIMESTAMP)
2514#define bfin_write_CAN0_MB25_TIMESTAMP(val) bfin_write16(CAN0_MB25_TIMESTAMP, val)
2515#define bfin_read_CAN0_MB25_ID0() bfin_read16(CAN0_MB25_ID0)
2516#define bfin_write_CAN0_MB25_ID0(val) bfin_write16(CAN0_MB25_ID0, val)
2517#define bfin_read_CAN0_MB25_ID1() bfin_read16(CAN0_MB25_ID1)
2518#define bfin_write_CAN0_MB25_ID1(val) bfin_write16(CAN0_MB25_ID1, val)
2519#define bfin_read_CAN0_MB26_DATA0() bfin_read16(CAN0_MB26_DATA0)
2520#define bfin_write_CAN0_MB26_DATA0(val) bfin_write16(CAN0_MB26_DATA0, val)
2521#define bfin_read_CAN0_MB26_DATA1() bfin_read16(CAN0_MB26_DATA1)
2522#define bfin_write_CAN0_MB26_DATA1(val) bfin_write16(CAN0_MB26_DATA1, val)
2523#define bfin_read_CAN0_MB26_DATA2() bfin_read16(CAN0_MB26_DATA2)
2524#define bfin_write_CAN0_MB26_DATA2(val) bfin_write16(CAN0_MB26_DATA2, val)
2525#define bfin_read_CAN0_MB26_DATA3() bfin_read16(CAN0_MB26_DATA3)
2526#define bfin_write_CAN0_MB26_DATA3(val) bfin_write16(CAN0_MB26_DATA3, val)
2527#define bfin_read_CAN0_MB26_LENGTH() bfin_read16(CAN0_MB26_LENGTH)
2528#define bfin_write_CAN0_MB26_LENGTH(val) bfin_write16(CAN0_MB26_LENGTH, val)
2529#define bfin_read_CAN0_MB26_TIMESTAMP() bfin_read16(CAN0_MB26_TIMESTAMP)
2530#define bfin_write_CAN0_MB26_TIMESTAMP(val) bfin_write16(CAN0_MB26_TIMESTAMP, val)
2531#define bfin_read_CAN0_MB26_ID0() bfin_read16(CAN0_MB26_ID0)
2532#define bfin_write_CAN0_MB26_ID0(val) bfin_write16(CAN0_MB26_ID0, val)
2533#define bfin_read_CAN0_MB26_ID1() bfin_read16(CAN0_MB26_ID1)
2534#define bfin_write_CAN0_MB26_ID1(val) bfin_write16(CAN0_MB26_ID1, val)
2535#define bfin_read_CAN0_MB27_DATA0() bfin_read16(CAN0_MB27_DATA0)
2536#define bfin_write_CAN0_MB27_DATA0(val) bfin_write16(CAN0_MB27_DATA0, val)
2537#define bfin_read_CAN0_MB27_DATA1() bfin_read16(CAN0_MB27_DATA1)
2538#define bfin_write_CAN0_MB27_DATA1(val) bfin_write16(CAN0_MB27_DATA1, val)
2539#define bfin_read_CAN0_MB27_DATA2() bfin_read16(CAN0_MB27_DATA2)
2540#define bfin_write_CAN0_MB27_DATA2(val) bfin_write16(CAN0_MB27_DATA2, val)
2541#define bfin_read_CAN0_MB27_DATA3() bfin_read16(CAN0_MB27_DATA3)
2542#define bfin_write_CAN0_MB27_DATA3(val) bfin_write16(CAN0_MB27_DATA3, val)
2543#define bfin_read_CAN0_MB27_LENGTH() bfin_read16(CAN0_MB27_LENGTH)
2544#define bfin_write_CAN0_MB27_LENGTH(val) bfin_write16(CAN0_MB27_LENGTH, val)
2545#define bfin_read_CAN0_MB27_TIMESTAMP() bfin_read16(CAN0_MB27_TIMESTAMP)
2546#define bfin_write_CAN0_MB27_TIMESTAMP(val) bfin_write16(CAN0_MB27_TIMESTAMP, val)
2547#define bfin_read_CAN0_MB27_ID0() bfin_read16(CAN0_MB27_ID0)
2548#define bfin_write_CAN0_MB27_ID0(val) bfin_write16(CAN0_MB27_ID0, val)
2549#define bfin_read_CAN0_MB27_ID1() bfin_read16(CAN0_MB27_ID1)
2550#define bfin_write_CAN0_MB27_ID1(val) bfin_write16(CAN0_MB27_ID1, val)
2551#define bfin_read_CAN0_MB28_DATA0() bfin_read16(CAN0_MB28_DATA0)
2552#define bfin_write_CAN0_MB28_DATA0(val) bfin_write16(CAN0_MB28_DATA0, val)
2553#define bfin_read_CAN0_MB28_DATA1() bfin_read16(CAN0_MB28_DATA1)
2554#define bfin_write_CAN0_MB28_DATA1(val) bfin_write16(CAN0_MB28_DATA1, val)
2555#define bfin_read_CAN0_MB28_DATA2() bfin_read16(CAN0_MB28_DATA2)
2556#define bfin_write_CAN0_MB28_DATA2(val) bfin_write16(CAN0_MB28_DATA2, val)
2557#define bfin_read_CAN0_MB28_DATA3() bfin_read16(CAN0_MB28_DATA3)
2558#define bfin_write_CAN0_MB28_DATA3(val) bfin_write16(CAN0_MB28_DATA3, val)
2559#define bfin_read_CAN0_MB28_LENGTH() bfin_read16(CAN0_MB28_LENGTH)
2560#define bfin_write_CAN0_MB28_LENGTH(val) bfin_write16(CAN0_MB28_LENGTH, val)
2561#define bfin_read_CAN0_MB28_TIMESTAMP() bfin_read16(CAN0_MB28_TIMESTAMP)
2562#define bfin_write_CAN0_MB28_TIMESTAMP(val) bfin_write16(CAN0_MB28_TIMESTAMP, val)
2563#define bfin_read_CAN0_MB28_ID0() bfin_read16(CAN0_MB28_ID0)
2564#define bfin_write_CAN0_MB28_ID0(val) bfin_write16(CAN0_MB28_ID0, val)
2565#define bfin_read_CAN0_MB28_ID1() bfin_read16(CAN0_MB28_ID1)
2566#define bfin_write_CAN0_MB28_ID1(val) bfin_write16(CAN0_MB28_ID1, val)
2567#define bfin_read_CAN0_MB29_DATA0() bfin_read16(CAN0_MB29_DATA0)
2568#define bfin_write_CAN0_MB29_DATA0(val) bfin_write16(CAN0_MB29_DATA0, val)
2569#define bfin_read_CAN0_MB29_DATA1() bfin_read16(CAN0_MB29_DATA1)
2570#define bfin_write_CAN0_MB29_DATA1(val) bfin_write16(CAN0_MB29_DATA1, val)
2571#define bfin_read_CAN0_MB29_DATA2() bfin_read16(CAN0_MB29_DATA2)
2572#define bfin_write_CAN0_MB29_DATA2(val) bfin_write16(CAN0_MB29_DATA2, val)
2573#define bfin_read_CAN0_MB29_DATA3() bfin_read16(CAN0_MB29_DATA3)
2574#define bfin_write_CAN0_MB29_DATA3(val) bfin_write16(CAN0_MB29_DATA3, val)
2575#define bfin_read_CAN0_MB29_LENGTH() bfin_read16(CAN0_MB29_LENGTH)
2576#define bfin_write_CAN0_MB29_LENGTH(val) bfin_write16(CAN0_MB29_LENGTH, val)
2577#define bfin_read_CAN0_MB29_TIMESTAMP() bfin_read16(CAN0_MB29_TIMESTAMP)
2578#define bfin_write_CAN0_MB29_TIMESTAMP(val) bfin_write16(CAN0_MB29_TIMESTAMP, val)
2579#define bfin_read_CAN0_MB29_ID0() bfin_read16(CAN0_MB29_ID0)
2580#define bfin_write_CAN0_MB29_ID0(val) bfin_write16(CAN0_MB29_ID0, val)
2581#define bfin_read_CAN0_MB29_ID1() bfin_read16(CAN0_MB29_ID1)
2582#define bfin_write_CAN0_MB29_ID1(val) bfin_write16(CAN0_MB29_ID1, val)
2583#define bfin_read_CAN0_MB30_DATA0() bfin_read16(CAN0_MB30_DATA0)
2584#define bfin_write_CAN0_MB30_DATA0(val) bfin_write16(CAN0_MB30_DATA0, val)
2585#define bfin_read_CAN0_MB30_DATA1() bfin_read16(CAN0_MB30_DATA1)
2586#define bfin_write_CAN0_MB30_DATA1(val) bfin_write16(CAN0_MB30_DATA1, val)
2587#define bfin_read_CAN0_MB30_DATA2() bfin_read16(CAN0_MB30_DATA2)
2588#define bfin_write_CAN0_MB30_DATA2(val) bfin_write16(CAN0_MB30_DATA2, val)
2589#define bfin_read_CAN0_MB30_DATA3() bfin_read16(CAN0_MB30_DATA3)
2590#define bfin_write_CAN0_MB30_DATA3(val) bfin_write16(CAN0_MB30_DATA3, val)
2591#define bfin_read_CAN0_MB30_LENGTH() bfin_read16(CAN0_MB30_LENGTH)
2592#define bfin_write_CAN0_MB30_LENGTH(val) bfin_write16(CAN0_MB30_LENGTH, val)
2593#define bfin_read_CAN0_MB30_TIMESTAMP() bfin_read16(CAN0_MB30_TIMESTAMP)
2594#define bfin_write_CAN0_MB30_TIMESTAMP(val) bfin_write16(CAN0_MB30_TIMESTAMP, val)
2595#define bfin_read_CAN0_MB30_ID0() bfin_read16(CAN0_MB30_ID0)
2596#define bfin_write_CAN0_MB30_ID0(val) bfin_write16(CAN0_MB30_ID0, val)
2597#define bfin_read_CAN0_MB30_ID1() bfin_read16(CAN0_MB30_ID1)
2598#define bfin_write_CAN0_MB30_ID1(val) bfin_write16(CAN0_MB30_ID1, val)
2599#define bfin_read_CAN0_MB31_DATA0() bfin_read16(CAN0_MB31_DATA0)
2600#define bfin_write_CAN0_MB31_DATA0(val) bfin_write16(CAN0_MB31_DATA0, val)
2601#define bfin_read_CAN0_MB31_DATA1() bfin_read16(CAN0_MB31_DATA1)
2602#define bfin_write_CAN0_MB31_DATA1(val) bfin_write16(CAN0_MB31_DATA1, val)
2603#define bfin_read_CAN0_MB31_DATA2() bfin_read16(CAN0_MB31_DATA2)
2604#define bfin_write_CAN0_MB31_DATA2(val) bfin_write16(CAN0_MB31_DATA2, val)
2605#define bfin_read_CAN0_MB31_DATA3() bfin_read16(CAN0_MB31_DATA3)
2606#define bfin_write_CAN0_MB31_DATA3(val) bfin_write16(CAN0_MB31_DATA3, val)
2607#define bfin_read_CAN0_MB31_LENGTH() bfin_read16(CAN0_MB31_LENGTH)
2608#define bfin_write_CAN0_MB31_LENGTH(val) bfin_write16(CAN0_MB31_LENGTH, val)
2609#define bfin_read_CAN0_MB31_TIMESTAMP() bfin_read16(CAN0_MB31_TIMESTAMP)
2610#define bfin_write_CAN0_MB31_TIMESTAMP(val) bfin_write16(CAN0_MB31_TIMESTAMP, val)
2611#define bfin_read_CAN0_MB31_ID0() bfin_read16(CAN0_MB31_ID0)
2612#define bfin_write_CAN0_MB31_ID0(val) bfin_write16(CAN0_MB31_ID0, val)
2613#define bfin_read_CAN0_MB31_ID1() bfin_read16(CAN0_MB31_ID1)
2614#define bfin_write_CAN0_MB31_ID1(val) bfin_write16(CAN0_MB31_ID1, val)
2615
2616/* UART3 Registers */
2617
2618#define bfin_read_UART3_DLL() bfin_read16(UART3_DLL)
2619#define bfin_write_UART3_DLL(val) bfin_write16(UART3_DLL, val)
2620#define bfin_read_UART3_DLH() bfin_read16(UART3_DLH)
2621#define bfin_write_UART3_DLH(val) bfin_write16(UART3_DLH, val)
2622#define bfin_read_UART3_GCTL() bfin_read16(UART3_GCTL)
2623#define bfin_write_UART3_GCTL(val) bfin_write16(UART3_GCTL, val)
2624#define bfin_read_UART3_LCR() bfin_read16(UART3_LCR)
2625#define bfin_write_UART3_LCR(val) bfin_write16(UART3_LCR, val)
2626#define bfin_read_UART3_MCR() bfin_read16(UART3_MCR)
2627#define bfin_write_UART3_MCR(val) bfin_write16(UART3_MCR, val)
2628#define bfin_read_UART3_LSR() bfin_read16(UART3_LSR)
2629#define bfin_write_UART3_LSR(val) bfin_write16(UART3_LSR, val)
2630#define bfin_read_UART3_MSR() bfin_read16(UART3_MSR)
2631#define bfin_write_UART3_MSR(val) bfin_write16(UART3_MSR, val)
2632#define bfin_read_UART3_SCR() bfin_read16(UART3_SCR)
2633#define bfin_write_UART3_SCR(val) bfin_write16(UART3_SCR, val)
2634#define bfin_read_UART3_IER_SET() bfin_read16(UART3_IER_SET)
2635#define bfin_write_UART3_IER_SET(val) bfin_write16(UART3_IER_SET, val)
2636#define bfin_read_UART3_IER_CLEAR() bfin_read16(UART3_IER_CLEAR)
2637#define bfin_write_UART3_IER_CLEAR(val) bfin_write16(UART3_IER_CLEAR, val)
2638#define bfin_read_UART3_THR() bfin_read16(UART3_THR)
2639#define bfin_write_UART3_THR(val) bfin_write16(UART3_THR, val)
2640#define bfin_read_UART3_RBR() bfin_read16(UART3_RBR)
2641#define bfin_write_UART3_RBR(val) bfin_write16(UART3_RBR, val)
2642
2643/* NFC Registers */
2644
2645#define bfin_read_NFC_CTL() bfin_read16(NFC_CTL)
2646#define bfin_write_NFC_CTL(val) bfin_write16(NFC_CTL, val)
2647#define bfin_read_NFC_STAT() bfin_read16(NFC_STAT)
2648#define bfin_write_NFC_STAT(val) bfin_write16(NFC_STAT, val)
2649#define bfin_read_NFC_IRQSTAT() bfin_read16(NFC_IRQSTAT)
2650#define bfin_write_NFC_IRQSTAT(val) bfin_write16(NFC_IRQSTAT, val)
2651#define bfin_read_NFC_IRQMASK() bfin_read16(NFC_IRQMASK)
2652#define bfin_write_NFC_IRQMASK(val) bfin_write16(NFC_IRQMASK, val)
2653#define bfin_read_NFC_ECC0() bfin_read16(NFC_ECC0)
2654#define bfin_write_NFC_ECC0(val) bfin_write16(NFC_ECC0, val)
2655#define bfin_read_NFC_ECC1() bfin_read16(NFC_ECC1)
2656#define bfin_write_NFC_ECC1(val) bfin_write16(NFC_ECC1, val)
2657#define bfin_read_NFC_ECC2() bfin_read16(NFC_ECC2)
2658#define bfin_write_NFC_ECC2(val) bfin_write16(NFC_ECC2, val)
2659#define bfin_read_NFC_ECC3() bfin_read16(NFC_ECC3)
2660#define bfin_write_NFC_ECC3(val) bfin_write16(NFC_ECC3, val)
2661#define bfin_read_NFC_COUNT() bfin_read16(NFC_COUNT)
2662#define bfin_write_NFC_COUNT(val) bfin_write16(NFC_COUNT, val)
2663#define bfin_read_NFC_RST() bfin_read16(NFC_RST)
2664#define bfin_write_NFC_RST(val) bfin_write16(NFC_RST, val)
2665#define bfin_read_NFC_PGCTL() bfin_read16(NFC_PGCTL)
2666#define bfin_write_NFC_PGCTL(val) bfin_write16(NFC_PGCTL, val)
2667#define bfin_read_NFC_READ() bfin_read16(NFC_READ)
2668#define bfin_write_NFC_READ(val) bfin_write16(NFC_READ, val)
2669#define bfin_read_NFC_ADDR() bfin_read16(NFC_ADDR)
2670#define bfin_write_NFC_ADDR(val) bfin_write16(NFC_ADDR, val)
2671#define bfin_read_NFC_CMD() bfin_read16(NFC_CMD)
2672#define bfin_write_NFC_CMD(val) bfin_write16(NFC_CMD, val)
2673#define bfin_read_NFC_DATA_WR() bfin_read16(NFC_DATA_WR)
2674#define bfin_write_NFC_DATA_WR(val) bfin_write16(NFC_DATA_WR, val)
2675#define bfin_read_NFC_DATA_RD() bfin_read16(NFC_DATA_RD)
2676#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
2677
2678/* Counter Registers */
2679
2680#define bfin_read_CNT_CONFIG() bfin_read16(CNT_CONFIG)
2681#define bfin_write_CNT_CONFIG(val) bfin_write16(CNT_CONFIG, val)
2682#define bfin_read_CNT_IMASK() bfin_read16(CNT_IMASK)
2683#define bfin_write_CNT_IMASK(val) bfin_write16(CNT_IMASK, val)
2684#define bfin_read_CNT_STATUS() bfin_read16(CNT_STATUS)
2685#define bfin_write_CNT_STATUS(val) bfin_write16(CNT_STATUS, val)
2686#define bfin_read_CNT_COMMAND() bfin_read16(CNT_COMMAND)
2687#define bfin_write_CNT_COMMAND(val) bfin_write16(CNT_COMMAND, val)
2688#define bfin_read_CNT_DEBOUNCE() bfin_read16(CNT_DEBOUNCE)
2689#define bfin_write_CNT_DEBOUNCE(val) bfin_write16(CNT_DEBOUNCE, val)
2690#define bfin_read_CNT_COUNTER() bfin_read32(CNT_COUNTER)
2691#define bfin_write_CNT_COUNTER(val) bfin_write32(CNT_COUNTER, val)
2692#define bfin_read_CNT_MAX() bfin_read32(CNT_MAX)
2693#define bfin_write_CNT_MAX(val) bfin_write32(CNT_MAX, val)
2694#define bfin_read_CNT_MIN() bfin_read32(CNT_MIN)
2695#define bfin_write_CNT_MIN(val) bfin_write32(CNT_MIN, val)
2696
2697/* OTP/FUSE Registers */
2698
2699#define bfin_read_OTP_CONTROL() bfin_read16(OTP_CONTROL)
2700#define bfin_write_OTP_CONTROL(val) bfin_write16(OTP_CONTROL, val)
2701#define bfin_read_OTP_BEN() bfin_read16(OTP_BEN)
2702#define bfin_write_OTP_BEN(val) bfin_write16(OTP_BEN, val)
2703#define bfin_read_OTP_STATUS() bfin_read16(OTP_STATUS)
2704#define bfin_write_OTP_STATUS(val) bfin_write16(OTP_STATUS, val)
2705#define bfin_read_OTP_TIMING() bfin_read32(OTP_TIMING)
2706#define bfin_write_OTP_TIMING(val) bfin_write32(OTP_TIMING, val)
2707
2708/* Security Registers */
2709
2710#define bfin_read_SECURE_SYSSWT() bfin_read32(SECURE_SYSSWT)
2711#define bfin_write_SECURE_SYSSWT(val) bfin_write32(SECURE_SYSSWT, val)
2712#define bfin_read_SECURE_CONTROL() bfin_read16(SECURE_CONTROL)
2713#define bfin_write_SECURE_CONTROL(val) bfin_write16(SECURE_CONTROL, val)
2714#define bfin_read_SECURE_STATUS() bfin_read16(SECURE_STATUS)
2715#define bfin_write_SECURE_STATUS(val) bfin_write16(SECURE_STATUS, val)
2716
2717/* DMA Peribfin_read_()heral Mux Register */
2718
2719#define bfin_read_DMAC1_PERIMUX() bfin_read16(DMAC1_PERIMUX)
2720#define bfin_write_DMAC1_PERIMUX(val) bfin_write16(DMAC1_PERIMUX, val)
2721
2722/* OTP Read/Write Data Buffer Registers */
2723
2724#define bfin_read_OTP_DATA0() bfin_read32(OTP_DATA0)
2725#define bfin_write_OTP_DATA0(val) bfin_write32(OTP_DATA0, val)
2726#define bfin_read_OTP_DATA1() bfin_read32(OTP_DATA1)
2727#define bfin_write_OTP_DATA1(val) bfin_write32(OTP_DATA1, val)
2728#define bfin_read_OTP_DATA2() bfin_read32(OTP_DATA2)
2729#define bfin_write_OTP_DATA2(val) bfin_write32(OTP_DATA2, val)
2730#define bfin_read_OTP_DATA3() bfin_read32(OTP_DATA3)
2731#define bfin_write_OTP_DATA3(val) bfin_write32(OTP_DATA3, val)
2732
2733/* Handshake MDMA is not defined in the shared file because it is not available on the ADSP-BF542 bfin_read_()rocessor */
2734
2735/* legacy definitions */
2736#define bfin_read_EBIU_AMCBCTL0 bfin_read_EBIU_AMBCTL0
2737#define bfin_write_EBIU_AMCBCTL0 bfin_write_EBIU_AMBCTL0
2738#define bfin_read_EBIU_AMCBCTL1 bfin_read_EBIU_AMBCTL1
2739#define bfin_write_EBIU_AMCBCTL1 bfin_write_EBIU_AMBCTL1
2740#define bfin_read_PINT0_IRQ bfin_read_PINT0_REQUEST
2741#define bfin_write_PINT0_IRQ bfin_write_PINT0_REQUEST
2742#define bfin_read_PINT1_IRQ bfin_read_PINT1_REQUEST
2743#define bfin_write_PINT1_IRQ bfin_write_PINT1_REQUEST
2744#define bfin_read_PINT2_IRQ bfin_read_PINT2_REQUEST
2745#define bfin_write_PINT2_IRQ bfin_write_PINT2_REQUEST
2746#define bfin_read_PINT3_IRQ bfin_read_PINT3_REQUEST
2747#define bfin_write_PINT3_IRQ bfin_write_PINT3_REQUEST
2748
2749#endif /* _CDEF_BF54X_H */
2750
diff --git a/include/asm-blackfin/mach-bf548/defBF542.h b/include/asm-blackfin/mach-bf548/defBF542.h
deleted file mode 100644
index a7c809f29ede..000000000000
--- a/include/asm-blackfin/mach-bf548/defBF542.h
+++ /dev/null
@@ -1,925 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/defBF542.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_BF542_H
32#define _DEF_BF542_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF542 */
38
39/* Include defBF54x_base.h for the set of #defines that are common to all ADSP-BF54x processors */
40#include "defBF54x_base.h"
41
42/* The following are the #defines needed by ADSP-BF542 that are not in the common header */
43
44/* ATAPI Registers */
45
46#define ATAPI_CONTROL 0xffc03800 /* ATAPI Control Register */
47#define ATAPI_STATUS 0xffc03804 /* ATAPI Status Register */
48#define ATAPI_DEV_ADDR 0xffc03808 /* ATAPI Device Register Address */
49#define ATAPI_DEV_TXBUF 0xffc0380c /* ATAPI Device Register Write Data */
50#define ATAPI_DEV_RXBUF 0xffc03810 /* ATAPI Device Register Read Data */
51#define ATAPI_INT_MASK 0xffc03814 /* ATAPI Interrupt Mask Register */
52#define ATAPI_INT_STATUS 0xffc03818 /* ATAPI Interrupt Status Register */
53#define ATAPI_XFER_LEN 0xffc0381c /* ATAPI Length of Transfer */
54#define ATAPI_LINE_STATUS 0xffc03820 /* ATAPI Line Status */
55#define ATAPI_SM_STATE 0xffc03824 /* ATAPI State Machine Status */
56#define ATAPI_TERMINATE 0xffc03828 /* ATAPI Host Terminate */
57#define ATAPI_PIO_TFRCNT 0xffc0382c /* ATAPI PIO mode transfer count */
58#define ATAPI_DMA_TFRCNT 0xffc03830 /* ATAPI DMA mode transfer count */
59#define ATAPI_UMAIN_TFRCNT 0xffc03834 /* ATAPI UDMAIN transfer count */
60#define ATAPI_UDMAOUT_TFRCNT 0xffc03838 /* ATAPI UDMAOUT transfer count */
61#define ATAPI_REG_TIM_0 0xffc03840 /* ATAPI Register Transfer Timing 0 */
62#define ATAPI_PIO_TIM_0 0xffc03844 /* ATAPI PIO Timing 0 Register */
63#define ATAPI_PIO_TIM_1 0xffc03848 /* ATAPI PIO Timing 1 Register */
64#define ATAPI_MULTI_TIM_0 0xffc03850 /* ATAPI Multi-DMA Timing 0 Register */
65#define ATAPI_MULTI_TIM_1 0xffc03854 /* ATAPI Multi-DMA Timing 1 Register */
66#define ATAPI_MULTI_TIM_2 0xffc03858 /* ATAPI Multi-DMA Timing 2 Register */
67#define ATAPI_ULTRA_TIM_0 0xffc03860 /* ATAPI Ultra-DMA Timing 0 Register */
68#define ATAPI_ULTRA_TIM_1 0xffc03864 /* ATAPI Ultra-DMA Timing 1 Register */
69#define ATAPI_ULTRA_TIM_2 0xffc03868 /* ATAPI Ultra-DMA Timing 2 Register */
70#define ATAPI_ULTRA_TIM_3 0xffc0386c /* ATAPI Ultra-DMA Timing 3 Register */
71
72/* SDH Registers */
73
74#define SDH_PWR_CTL 0xffc03900 /* SDH Power Control */
75#define SDH_CLK_CTL 0xffc03904 /* SDH Clock Control */
76#define SDH_ARGUMENT 0xffc03908 /* SDH Argument */
77#define SDH_COMMAND 0xffc0390c /* SDH Command */
78#define SDH_RESP_CMD 0xffc03910 /* SDH Response Command */
79#define SDH_RESPONSE0 0xffc03914 /* SDH Response0 */
80#define SDH_RESPONSE1 0xffc03918 /* SDH Response1 */
81#define SDH_RESPONSE2 0xffc0391c /* SDH Response2 */
82#define SDH_RESPONSE3 0xffc03920 /* SDH Response3 */
83#define SDH_DATA_TIMER 0xffc03924 /* SDH Data Timer */
84#define SDH_DATA_LGTH 0xffc03928 /* SDH Data Length */
85#define SDH_DATA_CTL 0xffc0392c /* SDH Data Control */
86#define SDH_DATA_CNT 0xffc03930 /* SDH Data Counter */
87#define SDH_STATUS 0xffc03934 /* SDH Status */
88#define SDH_STATUS_CLR 0xffc03938 /* SDH Status Clear */
89#define SDH_MASK0 0xffc0393c /* SDH Interrupt0 Mask */
90#define SDH_MASK1 0xffc03940 /* SDH Interrupt1 Mask */
91#define SDH_FIFO_CNT 0xffc03948 /* SDH FIFO Counter */
92#define SDH_FIFO 0xffc03980 /* SDH Data FIFO */
93#define SDH_E_STATUS 0xffc039c0 /* SDH Exception Status */
94#define SDH_E_MASK 0xffc039c4 /* SDH Exception Mask */
95#define SDH_CFG 0xffc039c8 /* SDH Configuration */
96#define SDH_RD_WAIT_EN 0xffc039cc /* SDH Read Wait Enable */
97#define SDH_PID0 0xffc039d0 /* SDH Peripheral Identification0 */
98#define SDH_PID1 0xffc039d4 /* SDH Peripheral Identification1 */
99#define SDH_PID2 0xffc039d8 /* SDH Peripheral Identification2 */
100#define SDH_PID3 0xffc039dc /* SDH Peripheral Identification3 */
101#define SDH_PID4 0xffc039e0 /* SDH Peripheral Identification4 */
102#define SDH_PID5 0xffc039e4 /* SDH Peripheral Identification5 */
103#define SDH_PID6 0xffc039e8 /* SDH Peripheral Identification6 */
104#define SDH_PID7 0xffc039ec /* SDH Peripheral Identification7 */
105
106/* USB Control Registers */
107
108#define USB_FADDR 0xffc03c00 /* Function address register */
109#define USB_POWER 0xffc03c04 /* Power management register */
110#define USB_INTRTX 0xffc03c08 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
111#define USB_INTRRX 0xffc03c0c /* Interrupt register for Rx endpoints 1 to 7 */
112#define USB_INTRTXE 0xffc03c10 /* Interrupt enable register for IntrTx */
113#define USB_INTRRXE 0xffc03c14 /* Interrupt enable register for IntrRx */
114#define USB_INTRUSB 0xffc03c18 /* Interrupt register for common USB interrupts */
115#define USB_INTRUSBE 0xffc03c1c /* Interrupt enable register for IntrUSB */
116#define USB_FRAME 0xffc03c20 /* USB frame number */
117#define USB_INDEX 0xffc03c24 /* Index register for selecting the indexed endpoint registers */
118#define USB_TESTMODE 0xffc03c28 /* Enabled USB 20 test modes */
119#define USB_GLOBINTR 0xffc03c2c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
120#define USB_GLOBAL_CTL 0xffc03c30 /* Global Clock Control for the core */
121
122/* USB Packet Control Registers */
123
124#define USB_TX_MAX_PACKET 0xffc03c40 /* Maximum packet size for Host Tx endpoint */
125#define USB_CSR0 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
126#define USB_TXCSR 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
127#define USB_RX_MAX_PACKET 0xffc03c48 /* Maximum packet size for Host Rx endpoint */
128#define USB_RXCSR 0xffc03c4c /* Control Status register for Host Rx endpoint */
129#define USB_COUNT0 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
130#define USB_RXCOUNT 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
131#define USB_TXTYPE 0xffc03c54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
132#define USB_NAKLIMIT0 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
133#define USB_TXINTERVAL 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
134#define USB_RXTYPE 0xffc03c5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
135#define USB_RXINTERVAL 0xffc03c60 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
136#define USB_TXCOUNT 0xffc03c68 /* Number of bytes to be written to the selected endpoint Tx FIFO */
137
138/* USB Endpoint FIFO Registers */
139
140#define USB_EP0_FIFO 0xffc03c80 /* Endpoint 0 FIFO */
141#define USB_EP1_FIFO 0xffc03c88 /* Endpoint 1 FIFO */
142#define USB_EP2_FIFO 0xffc03c90 /* Endpoint 2 FIFO */
143#define USB_EP3_FIFO 0xffc03c98 /* Endpoint 3 FIFO */
144#define USB_EP4_FIFO 0xffc03ca0 /* Endpoint 4 FIFO */
145#define USB_EP5_FIFO 0xffc03ca8 /* Endpoint 5 FIFO */
146#define USB_EP6_FIFO 0xffc03cb0 /* Endpoint 6 FIFO */
147#define USB_EP7_FIFO 0xffc03cb8 /* Endpoint 7 FIFO */
148
149/* USB OTG Control Registers */
150
151#define USB_OTG_DEV_CTL 0xffc03d00 /* OTG Device Control Register */
152#define USB_OTG_VBUS_IRQ 0xffc03d04 /* OTG VBUS Control Interrupts */
153#define USB_OTG_VBUS_MASK 0xffc03d08 /* VBUS Control Interrupt Enable */
154
155/* USB Phy Control Registers */
156
157#define USB_LINKINFO 0xffc03d48 /* Enables programming of some PHY-side delays */
158#define USB_VPLEN 0xffc03d4c /* Determines duration of VBUS pulse for VBUS charging */
159#define USB_HS_EOF1 0xffc03d50 /* Time buffer for High-Speed transactions */
160#define USB_FS_EOF1 0xffc03d54 /* Time buffer for Full-Speed transactions */
161#define USB_LS_EOF1 0xffc03d58 /* Time buffer for Low-Speed transactions */
162
163/* (APHY_CNTRL is for ADI usage only) */
164
165#define USB_APHY_CNTRL 0xffc03de0 /* Register that increases visibility of Analog PHY */
166
167/* (APHY_CALIB is for ADI usage only) */
168
169#define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */
170#define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
171
172/* (PHY_TEST is for ADI usage only) */
173
174#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */
175#define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */
176#define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
177
178/* USB Endpoint 0 Control Registers */
179
180#define USB_EP_NI0_TXMAXP 0xffc03e00 /* Maximum packet size for Host Tx endpoint0 */
181#define USB_EP_NI0_TXCSR 0xffc03e04 /* Control Status register for endpoint 0 */
182#define USB_EP_NI0_RXMAXP 0xffc03e08 /* Maximum packet size for Host Rx endpoint0 */
183#define USB_EP_NI0_RXCSR 0xffc03e0c /* Control Status register for Host Rx endpoint0 */
184#define USB_EP_NI0_RXCOUNT 0xffc03e10 /* Number of bytes received in endpoint 0 FIFO */
185#define USB_EP_NI0_TXTYPE 0xffc03e14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
186#define USB_EP_NI0_TXINTERVAL 0xffc03e18 /* Sets the NAK response timeout on Endpoint 0 */
187#define USB_EP_NI0_RXTYPE 0xffc03e1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
188#define USB_EP_NI0_RXINTERVAL 0xffc03e20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint0 */
189
190/* USB Endpoint 1 Control Registers */
191
192#define USB_EP_NI0_TXCOUNT 0xffc03e28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
193#define USB_EP_NI1_TXMAXP 0xffc03e40 /* Maximum packet size for Host Tx endpoint1 */
194#define USB_EP_NI1_TXCSR 0xffc03e44 /* Control Status register for endpoint1 */
195#define USB_EP_NI1_RXMAXP 0xffc03e48 /* Maximum packet size for Host Rx endpoint1 */
196#define USB_EP_NI1_RXCSR 0xffc03e4c /* Control Status register for Host Rx endpoint1 */
197#define USB_EP_NI1_RXCOUNT 0xffc03e50 /* Number of bytes received in endpoint1 FIFO */
198#define USB_EP_NI1_TXTYPE 0xffc03e54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
199#define USB_EP_NI1_TXINTERVAL 0xffc03e58 /* Sets the NAK response timeout on Endpoint1 */
200#define USB_EP_NI1_RXTYPE 0xffc03e5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
201#define USB_EP_NI1_RXINTERVAL 0xffc03e60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint1 */
202
203/* USB Endpoint 2 Control Registers */
204
205#define USB_EP_NI1_TXCOUNT 0xffc03e68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
206#define USB_EP_NI2_TXMAXP 0xffc03e80 /* Maximum packet size for Host Tx endpoint2 */
207#define USB_EP_NI2_TXCSR 0xffc03e84 /* Control Status register for endpoint2 */
208#define USB_EP_NI2_RXMAXP 0xffc03e88 /* Maximum packet size for Host Rx endpoint2 */
209#define USB_EP_NI2_RXCSR 0xffc03e8c /* Control Status register for Host Rx endpoint2 */
210#define USB_EP_NI2_RXCOUNT 0xffc03e90 /* Number of bytes received in endpoint2 FIFO */
211#define USB_EP_NI2_TXTYPE 0xffc03e94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
212#define USB_EP_NI2_TXINTERVAL 0xffc03e98 /* Sets the NAK response timeout on Endpoint2 */
213#define USB_EP_NI2_RXTYPE 0xffc03e9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
214#define USB_EP_NI2_RXINTERVAL 0xffc03ea0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint2 */
215
216/* USB Endpoint 3 Control Registers */
217
218#define USB_EP_NI2_TXCOUNT 0xffc03ea8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
219#define USB_EP_NI3_TXMAXP 0xffc03ec0 /* Maximum packet size for Host Tx endpoint3 */
220#define USB_EP_NI3_TXCSR 0xffc03ec4 /* Control Status register for endpoint3 */
221#define USB_EP_NI3_RXMAXP 0xffc03ec8 /* Maximum packet size for Host Rx endpoint3 */
222#define USB_EP_NI3_RXCSR 0xffc03ecc /* Control Status register for Host Rx endpoint3 */
223#define USB_EP_NI3_RXCOUNT 0xffc03ed0 /* Number of bytes received in endpoint3 FIFO */
224#define USB_EP_NI3_TXTYPE 0xffc03ed4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
225#define USB_EP_NI3_TXINTERVAL 0xffc03ed8 /* Sets the NAK response timeout on Endpoint3 */
226#define USB_EP_NI3_RXTYPE 0xffc03edc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
227#define USB_EP_NI3_RXINTERVAL 0xffc03ee0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint3 */
228
229/* USB Endpoint 4 Control Registers */
230
231#define USB_EP_NI3_TXCOUNT 0xffc03ee8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
232#define USB_EP_NI4_TXMAXP 0xffc03f00 /* Maximum packet size for Host Tx endpoint4 */
233#define USB_EP_NI4_TXCSR 0xffc03f04 /* Control Status register for endpoint4 */
234#define USB_EP_NI4_RXMAXP 0xffc03f08 /* Maximum packet size for Host Rx endpoint4 */
235#define USB_EP_NI4_RXCSR 0xffc03f0c /* Control Status register for Host Rx endpoint4 */
236#define USB_EP_NI4_RXCOUNT 0xffc03f10 /* Number of bytes received in endpoint4 FIFO */
237#define USB_EP_NI4_TXTYPE 0xffc03f14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
238#define USB_EP_NI4_TXINTERVAL 0xffc03f18 /* Sets the NAK response timeout on Endpoint4 */
239#define USB_EP_NI4_RXTYPE 0xffc03f1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
240#define USB_EP_NI4_RXINTERVAL 0xffc03f20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint4 */
241
242/* USB Endpoint 5 Control Registers */
243
244#define USB_EP_NI4_TXCOUNT 0xffc03f28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
245#define USB_EP_NI5_TXMAXP 0xffc03f40 /* Maximum packet size for Host Tx endpoint5 */
246#define USB_EP_NI5_TXCSR 0xffc03f44 /* Control Status register for endpoint5 */
247#define USB_EP_NI5_RXMAXP 0xffc03f48 /* Maximum packet size for Host Rx endpoint5 */
248#define USB_EP_NI5_RXCSR 0xffc03f4c /* Control Status register for Host Rx endpoint5 */
249#define USB_EP_NI5_RXCOUNT 0xffc03f50 /* Number of bytes received in endpoint5 FIFO */
250#define USB_EP_NI5_TXTYPE 0xffc03f54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
251#define USB_EP_NI5_TXINTERVAL 0xffc03f58 /* Sets the NAK response timeout on Endpoint5 */
252#define USB_EP_NI5_RXTYPE 0xffc03f5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
253#define USB_EP_NI5_RXINTERVAL 0xffc03f60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint5 */
254
255/* USB Endpoint 6 Control Registers */
256
257#define USB_EP_NI5_TXCOUNT 0xffc03f68 /* Number of bytes to be written to the H145endpoint5 Tx FIFO */
258#define USB_EP_NI6_TXMAXP 0xffc03f80 /* Maximum packet size for Host Tx endpoint6 */
259#define USB_EP_NI6_TXCSR 0xffc03f84 /* Control Status register for endpoint6 */
260#define USB_EP_NI6_RXMAXP 0xffc03f88 /* Maximum packet size for Host Rx endpoint6 */
261#define USB_EP_NI6_RXCSR 0xffc03f8c /* Control Status register for Host Rx endpoint6 */
262#define USB_EP_NI6_RXCOUNT 0xffc03f90 /* Number of bytes received in endpoint6 FIFO */
263#define USB_EP_NI6_TXTYPE 0xffc03f94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
264#define USB_EP_NI6_TXINTERVAL 0xffc03f98 /* Sets the NAK response timeout on Endpoint6 */
265#define USB_EP_NI6_RXTYPE 0xffc03f9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
266#define USB_EP_NI6_RXINTERVAL 0xffc03fa0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint6 */
267
268/* USB Endpoint 7 Control Registers */
269
270#define USB_EP_NI6_TXCOUNT 0xffc03fa8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
271#define USB_EP_NI7_TXMAXP 0xffc03fc0 /* Maximum packet size for Host Tx endpoint7 */
272#define USB_EP_NI7_TXCSR 0xffc03fc4 /* Control Status register for endpoint7 */
273#define USB_EP_NI7_RXMAXP 0xffc03fc8 /* Maximum packet size for Host Rx endpoint7 */
274#define USB_EP_NI7_RXCSR 0xffc03fcc /* Control Status register for Host Rx endpoint7 */
275#define USB_EP_NI7_RXCOUNT 0xffc03fd0 /* Number of bytes received in endpoint7 FIFO */
276#define USB_EP_NI7_TXTYPE 0xffc03fd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
277#define USB_EP_NI7_TXINTERVAL 0xffc03fd8 /* Sets the NAK response timeout on Endpoint7 */
278#define USB_EP_NI7_RXTYPE 0xffc03fdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
279#define USB_EP_NI7_RXINTERVAL 0xffc03ff0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint7 */
280#define USB_EP_NI7_TXCOUNT 0xffc03ff8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
281#define USB_DMA_INTERRUPT 0xffc04000 /* Indicates pending interrupts for the DMA channels */
282
283/* USB Channel 0 Config Registers */
284
285#define USB_DMA0CONTROL 0xffc04004 /* DMA master channel 0 configuration */
286#define USB_DMA0ADDRLOW 0xffc04008 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
287#define USB_DMA0ADDRHIGH 0xffc0400c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
288#define USB_DMA0COUNTLOW 0xffc04010 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
289#define USB_DMA0COUNTHIGH 0xffc04014 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
290
291/* USB Channel 1 Config Registers */
292
293#define USB_DMA1CONTROL 0xffc04024 /* DMA master channel 1 configuration */
294#define USB_DMA1ADDRLOW 0xffc04028 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
295#define USB_DMA1ADDRHIGH 0xffc0402c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
296#define USB_DMA1COUNTLOW 0xffc04030 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
297#define USB_DMA1COUNTHIGH 0xffc04034 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
298
299/* USB Channel 2 Config Registers */
300
301#define USB_DMA2CONTROL 0xffc04044 /* DMA master channel 2 configuration */
302#define USB_DMA2ADDRLOW 0xffc04048 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
303#define USB_DMA2ADDRHIGH 0xffc0404c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
304#define USB_DMA2COUNTLOW 0xffc04050 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
305#define USB_DMA2COUNTHIGH 0xffc04054 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
306
307/* USB Channel 3 Config Registers */
308
309#define USB_DMA3CONTROL 0xffc04064 /* DMA master channel 3 configuration */
310#define USB_DMA3ADDRLOW 0xffc04068 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
311#define USB_DMA3ADDRHIGH 0xffc0406c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
312#define USB_DMA3COUNTLOW 0xffc04070 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
313#define USB_DMA3COUNTHIGH 0xffc04074 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
314
315/* USB Channel 4 Config Registers */
316
317#define USB_DMA4CONTROL 0xffc04084 /* DMA master channel 4 configuration */
318#define USB_DMA4ADDRLOW 0xffc04088 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
319#define USB_DMA4ADDRHIGH 0xffc0408c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
320#define USB_DMA4COUNTLOW 0xffc04090 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
321#define USB_DMA4COUNTHIGH 0xffc04094 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
322
323/* USB Channel 5 Config Registers */
324
325#define USB_DMA5CONTROL 0xffc040a4 /* DMA master channel 5 configuration */
326#define USB_DMA5ADDRLOW 0xffc040a8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
327#define USB_DMA5ADDRHIGH 0xffc040ac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
328#define USB_DMA5COUNTLOW 0xffc040b0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
329#define USB_DMA5COUNTHIGH 0xffc040b4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
330
331/* USB Channel 6 Config Registers */
332
333#define USB_DMA6CONTROL 0xffc040c4 /* DMA master channel 6 configuration */
334#define USB_DMA6ADDRLOW 0xffc040c8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
335#define USB_DMA6ADDRHIGH 0xffc040cc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
336#define USB_DMA6COUNTLOW 0xffc040d0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
337#define USB_DMA6COUNTHIGH 0xffc040d4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
338
339/* USB Channel 7 Config Registers */
340
341#define USB_DMA7CONTROL 0xffc040e4 /* DMA master channel 7 configuration */
342#define USB_DMA7ADDRLOW 0xffc040e8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
343#define USB_DMA7ADDRHIGH 0xffc040ec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
344#define USB_DMA7COUNTLOW 0xffc040f0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
345#define USB_DMA7COUNTHIGH 0xffc040f4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
346
347/* Keypad Registers */
348
349#define KPAD_CTL 0xffc04100 /* Controls keypad module enable and disable */
350#define KPAD_PRESCALE 0xffc04104 /* Establish a time base for programing the KPAD_MSEL register */
351#define KPAD_MSEL 0xffc04108 /* Selects delay parameters for keypad interface sensitivity */
352#define KPAD_ROWCOL 0xffc0410c /* Captures the row and column output values of the keys pressed */
353#define KPAD_STAT 0xffc04110 /* Holds and clears the status of the keypad interface interrupt */
354#define KPAD_SOFTEVAL 0xffc04114 /* Lets software force keypad interface to check for keys being pressed */
355
356
357/* ********************************************************** */
358/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
359/* and MULTI BIT READ MACROS */
360/* ********************************************************** */
361
362/* Bit masks for KPAD_CTL */
363
364#define KPAD_EN 0x1 /* Keypad Enable */
365#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
366#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
367#define KPAD_COLEN 0xe000 /* Column Enable Width */
368
369/* Bit masks for KPAD_PRESCALE */
370
371#define KPAD_PRESCALE_VAL 0x3f /* Key Prescale Value */
372
373/* Bit masks for KPAD_MSEL */
374
375#define DBON_SCALE 0xff /* Debounce Scale Value */
376#define COLDRV_SCALE 0xff00 /* Column Driver Scale Value */
377
378/* Bit masks for KPAD_ROWCOL */
379
380#define KPAD_ROW 0xff /* Rows Pressed */
381#define KPAD_COL 0xff00 /* Columns Pressed */
382
383/* Bit masks for KPAD_STAT */
384
385#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
386#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
387#define KPAD_PRESSED 0x8 /* Key press current status */
388
389/* Bit masks for KPAD_SOFTEVAL */
390
391#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
392
393/* Bit masks for SDH_COMMAND */
394
395#define CMD_IDX 0x3f /* Command Index */
396#define CMD_RSP 0x40 /* Response */
397#define CMD_L_RSP 0x80 /* Long Response */
398#define CMD_INT_E 0x100 /* Command Interrupt */
399#define CMD_PEND_E 0x200 /* Command Pending */
400#define CMD_E 0x400 /* Command Enable */
401
402/* Bit masks for SDH_PWR_CTL */
403
404#define PWR_ON 0x3 /* Power On */
405#if 0
406#define TBD 0x3c /* TBD */
407#endif
408#define SD_CMD_OD 0x40 /* Open Drain Output */
409#define ROD_CTL 0x80 /* Rod Control */
410
411/* Bit masks for SDH_CLK_CTL */
412
413#define CLKDIV 0xff /* MC_CLK Divisor */
414#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
415#define PWR_SV_E 0x200 /* Power Save Enable */
416#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
417#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
418
419/* Bit masks for SDH_RESP_CMD */
420
421#define RESP_CMD 0x3f /* Response Command */
422
423/* Bit masks for SDH_DATA_CTL */
424
425#define DTX_E 0x1 /* Data Transfer Enable */
426#define DTX_DIR 0x2 /* Data Transfer Direction */
427#define DTX_MODE 0x4 /* Data Transfer Mode */
428#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
429#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
430
431/* Bit masks for SDH_STATUS */
432
433#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
434#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
435#define CMD_TIME_OUT 0x4 /* CMD Time Out */
436#define DAT_TIME_OUT 0x8 /* Data Time Out */
437#define TX_UNDERRUN 0x10 /* Transmit Underrun */
438#define RX_OVERRUN 0x20 /* Receive Overrun */
439#define CMD_RESP_END 0x40 /* CMD Response End */
440#define CMD_SENT 0x80 /* CMD Sent */
441#define DAT_END 0x100 /* Data End */
442#define START_BIT_ERR 0x200 /* Start Bit Error */
443#define DAT_BLK_END 0x400 /* Data Block End */
444#define CMD_ACT 0x800 /* CMD Active */
445#define TX_ACT 0x1000 /* Transmit Active */
446#define RX_ACT 0x2000 /* Receive Active */
447#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
448#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
449#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
450#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
451#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
452#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
453#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
454#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
455
456/* Bit masks for SDH_STATUS_CLR */
457
458#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
459#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
460#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
461#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
462#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
463#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
464#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
465#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
466#define DAT_END_STAT 0x100 /* Data End Status */
467#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
468#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
469
470/* Bit masks for SDH_MASK0 */
471
472#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
473#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
474#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
475#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
476#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
477#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
478#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
479#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
480#define DAT_END_MASK 0x100 /* Data End Mask */
481#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
482#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
483#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
484#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
485#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
486#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
487#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
488#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
489#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
490#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
491#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
492#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
493#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
494
495/* Bit masks for SDH_FIFO_CNT */
496
497#define FIFO_COUNT 0x7fff /* FIFO Count */
498
499/* Bit masks for SDH_E_STATUS */
500
501#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
502#define SD_CARD_DET 0x10 /* SD Card Detect */
503
504/* Bit masks for SDH_E_MASK */
505
506#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
507#define SCD_MSK 0x40 /* Mask Card Detect */
508
509/* Bit masks for SDH_CFG */
510
511#define CLKS_EN 0x1 /* Clocks Enable */
512#define SD4E 0x4 /* SDIO 4-Bit Enable */
513#define MWE 0x8 /* Moving Window Enable */
514#define SD_RST 0x10 /* SDMMC Reset */
515#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
516#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
517#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
518
519/* Bit masks for SDH_RD_WAIT_EN */
520
521#define RWR 0x1 /* Read Wait Request */
522
523/* Bit masks for ATAPI_CONTROL */
524
525#define PIO_START 0x1 /* Start PIO/Reg Op */
526#define MULTI_START 0x2 /* Start Multi-DMA Op */
527#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
528#define XFER_DIR 0x8 /* Transfer Direction */
529#define IORDY_EN 0x10 /* IORDY Enable */
530#define FIFO_FLUSH 0x20 /* Flush FIFOs */
531#define SOFT_RST 0x40 /* Soft Reset */
532#define DEV_RST 0x80 /* Device Reset */
533#define TFRCNT_RST 0x100 /* Trans Count Reset */
534#define END_ON_TERM 0x200 /* End/Terminate Select */
535#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
536#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
537
538/* Bit masks for ATAPI_STATUS */
539
540#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
541#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
542#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
543#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
544
545/* Bit masks for ATAPI_DEV_ADDR */
546
547#define DEV_ADDR 0x1f /* Device Address */
548
549/* Bit masks for ATAPI_INT_MASK */
550
551#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
552#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
553#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
554#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
555#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
556#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
557#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
558#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
559#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
560
561/* Bit masks for ATAPI_INT_STATUS */
562
563#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
564#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
565#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
566#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
567#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
568#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
569#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
570#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
571#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
572
573/* Bit masks for ATAPI_LINE_STATUS */
574
575#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
576#define ATAPI_DASP 0x2 /* Device dasp to host line status */
577#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
578#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
579#define ATAPI_ADDR 0x70 /* ATAPI address line status */
580#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
581#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
582#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
583#define ATAPI_DIORN 0x400 /* ATAPI read line status */
584#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
585
586/* Bit masks for ATAPI_SM_STATE */
587
588#define PIO_CSTATE 0xf /* PIO mode state machine current state */
589#define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
590#define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
591#define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
592
593/* Bit masks for ATAPI_TERMINATE */
594
595#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
596
597/* Bit masks for ATAPI_REG_TIM_0 */
598
599#define T2_REG 0xff /* End of cycle time for register access transfers */
600#define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
601
602/* Bit masks for ATAPI_PIO_TIM_0 */
603
604#define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
605#define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
606#define T4_REG 0xf000 /* DIOW data hold */
607
608/* Bit masks for ATAPI_PIO_TIM_1 */
609
610#define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
611
612/* Bit masks for ATAPI_MULTI_TIM_0 */
613
614#define TD 0xff /* DIOR/DIOW asserted pulsewidth */
615#define TM 0xff00 /* Time from address valid to DIOR/DIOW */
616
617/* Bit masks for ATAPI_MULTI_TIM_1 */
618
619#define TKW 0xff /* Selects DIOW negated pulsewidth */
620#define TKR 0xff00 /* Selects DIOR negated pulsewidth */
621
622/* Bit masks for ATAPI_MULTI_TIM_2 */
623
624#define TH 0xff /* Selects DIOW data hold */
625#define TEOC 0xff00 /* Selects end of cycle for DMA */
626
627/* Bit masks for ATAPI_ULTRA_TIM_0 */
628
629#define TACK 0xff /* Selects setup and hold times for TACK */
630#define TENV 0xff00 /* Selects envelope time */
631
632/* Bit masks for ATAPI_ULTRA_TIM_1 */
633
634#define TDVS 0xff /* Selects data valid setup time */
635#define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
636
637/* Bit masks for ATAPI_ULTRA_TIM_2 */
638
639#define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
640#define TMLI 0xff00 /* Selects interlock time */
641
642/* Bit masks for ATAPI_ULTRA_TIM_3 */
643
644#define TZAH 0xff /* Selects minimum delay required for output */
645#define READY_PAUSE 0xff00 /* Selects ready to pause */
646
647/* Bit masks for USB_FADDR */
648
649#define FUNCTION_ADDRESS 0x7f /* Function address */
650
651/* Bit masks for USB_POWER */
652
653#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
654#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
655#define RESUME_MODE 0x4 /* DMA Mode */
656#define RESET 0x8 /* Reset indicator */
657#define HS_MODE 0x10 /* High Speed mode indicator */
658#define HS_ENABLE 0x20 /* high Speed Enable */
659#define SOFT_CONN 0x40 /* Soft connect */
660#define ISO_UPDATE 0x80 /* Isochronous update */
661
662/* Bit masks for USB_INTRTX */
663
664#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
665#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
666#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
667#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
668#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
669#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
670#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
671#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
672
673/* Bit masks for USB_INTRRX */
674
675#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
676#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
677#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
678#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
679#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
680#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
681#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
682
683/* Bit masks for USB_INTRTXE */
684
685#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
686#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
687#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
688#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
689#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
690#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
691#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
692#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
693
694/* Bit masks for USB_INTRRXE */
695
696#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
697#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
698#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
699#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
700#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
701#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
702#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
703
704/* Bit masks for USB_INTRUSB */
705
706#define SUSPEND_B 0x1 /* Suspend indicator */
707#define RESUME_B 0x2 /* Resume indicator */
708#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
709#define SOF_B 0x8 /* Start of frame */
710#define CONN_B 0x10 /* Connection indicator */
711#define DISCON_B 0x20 /* Disconnect indicator */
712#define SESSION_REQ_B 0x40 /* Session Request */
713#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
714
715/* Bit masks for USB_INTRUSBE */
716
717#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
718#define RESUME_BE 0x2 /* Resume indicator int enable */
719#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
720#define SOF_BE 0x8 /* Start of frame int enable */
721#define CONN_BE 0x10 /* Connection indicator int enable */
722#define DISCON_BE 0x20 /* Disconnect indicator int enable */
723#define SESSION_REQ_BE 0x40 /* Session Request int enable */
724#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
725
726/* Bit masks for USB_FRAME */
727
728#define FRAME_NUMBER 0x7ff /* Frame number */
729
730/* Bit masks for USB_INDEX */
731
732#define SELECTED_ENDPOINT 0xf /* selected endpoint */
733
734/* Bit masks for USB_GLOBAL_CTL */
735
736#define GLOBAL_ENA 0x1 /* enables USB module */
737#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
738#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
739#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
740#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
741#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
742#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
743#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
744#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
745#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
746#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
747#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
748#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
749#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
750#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
751
752/* Bit masks for USB_OTG_DEV_CTL */
753
754#define SESSION 0x1 /* session indicator */
755#define HOST_REQ 0x2 /* Host negotiation request */
756#define HOST_MODE 0x4 /* indicates USBDRC is a host */
757#define VBUS0 0x8 /* Vbus level indicator[0] */
758#define VBUS1 0x10 /* Vbus level indicator[1] */
759#define LSDEV 0x20 /* Low-speed indicator */
760#define FSDEV 0x40 /* Full or High-speed indicator */
761#define B_DEVICE 0x80 /* A' or 'B' device indicator */
762
763/* Bit masks for USB_OTG_VBUS_IRQ */
764
765#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
766#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
767#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
768#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
769#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
770#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
771
772/* Bit masks for USB_OTG_VBUS_MASK */
773
774#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
775#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
776#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
777#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
778#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
779#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
780
781/* Bit masks for USB_CSR0 */
782
783#define RXPKTRDY 0x1 /* data packet receive indicator */
784#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
785#define STALL_SENT 0x4 /* STALL handshake sent */
786#define DATAEND 0x8 /* Data end indicator */
787#define SETUPEND 0x10 /* Setup end */
788#define SENDSTALL 0x20 /* Send STALL handshake */
789#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
790#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
791#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
792#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
793#define SETUPPKT_H 0x8 /* send Setup token host mode */
794#define ERROR_H 0x10 /* timeout error indicator host mode */
795#define REQPKT_H 0x20 /* Request an IN transaction host mode */
796#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
797#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
798
799/* Bit masks for USB_COUNT0 */
800
801#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
802
803/* Bit masks for USB_NAKLIMIT0 */
804
805#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
806
807/* Bit masks for USB_TX_MAX_PACKET */
808
809#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
810
811/* Bit masks for USB_RX_MAX_PACKET */
812
813#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
814
815/* Bit masks for USB_TXCSR */
816
817#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
818#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
819#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
820#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
821#define STALL_SEND_T 0x10 /* issue a Stall handshake */
822#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
823#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
824#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
825#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
826#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
827#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
828#define ISO_T 0x4000 /* enable Isochronous transfers */
829#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
830#define ERROR_TH 0x4 /* error condition host mode */
831#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
832#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
833
834/* Bit masks for USB_TXCOUNT */
835
836#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
837
838/* Bit masks for USB_RXCSR */
839
840#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
841#define FIFO_FULL_R 0x2 /* FIFO not empty */
842#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
843#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
844#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
845#define STALL_SEND_R 0x20 /* issue a Stall handshake */
846#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
847#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
848#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
849#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
850#define DISNYET_R 0x1000 /* disable Nyet handshakes */
851#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
852#define ISO_R 0x4000 /* enable Isochronous transfers */
853#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
854#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
855#define REQPKT_RH 0x20 /* request an IN transaction host mode */
856#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
857#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
858#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
859#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
860
861/* Bit masks for USB_RXCOUNT */
862
863#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
864
865/* Bit masks for USB_TXTYPE */
866
867#define TARGET_EP_NO_T 0xf /* EP number */
868#define PROTOCOL_T 0xc /* transfer type */
869
870/* Bit masks for USB_TXINTERVAL */
871
872#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
873
874/* Bit masks for USB_RXTYPE */
875
876#define TARGET_EP_NO_R 0xf /* EP number */
877#define PROTOCOL_R 0xc /* transfer type */
878
879/* Bit masks for USB_RXINTERVAL */
880
881#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
882
883/* Bit masks for USB_DMA_INTERRUPT */
884
885#define DMA0_INT 0x1 /* DMA0 pending interrupt */
886#define DMA1_INT 0x2 /* DMA1 pending interrupt */
887#define DMA2_INT 0x4 /* DMA2 pending interrupt */
888#define DMA3_INT 0x8 /* DMA3 pending interrupt */
889#define DMA4_INT 0x10 /* DMA4 pending interrupt */
890#define DMA5_INT 0x20 /* DMA5 pending interrupt */
891#define DMA6_INT 0x40 /* DMA6 pending interrupt */
892#define DMA7_INT 0x80 /* DMA7 pending interrupt */
893
894/* Bit masks for USB_DMAxCONTROL */
895
896#define DMA_ENA 0x1 /* DMA enable */
897#define DIRECTION 0x2 /* direction of DMA transfer */
898#define MODE 0x4 /* DMA Bus error */
899#define INT_ENA 0x8 /* Interrupt enable */
900#define EPNUM 0xf0 /* EP number */
901#define BUSERROR 0x100 /* DMA Bus error */
902
903/* Bit masks for USB_DMAxADDRHIGH */
904
905#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
906
907/* Bit masks for USB_DMAxADDRLOW */
908
909#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
910
911/* Bit masks for USB_DMAxCOUNTHIGH */
912
913#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
914
915/* Bit masks for USB_DMAxCOUNTLOW */
916
917#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
918
919
920/* ******************************************* */
921/* MULTI BIT MACRO ENUMERATIONS */
922/* ******************************************* */
923
924
925#endif /* _DEF_BF542_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF544.h b/include/asm-blackfin/mach-bf548/defBF544.h
deleted file mode 100644
index b8b9870e2697..000000000000
--- a/include/asm-blackfin/mach-bf548/defBF544.h
+++ /dev/null
@@ -1,707 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/defBF544.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_BF544_H
32#define _DEF_BF544_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF544 */
38
39/* Include defBF54x_base.h for the set of #defines that are common to all ADSP-BF54x processors */
40#include "defBF54x_base.h"
41
42/* The following are the #defines needed by ADSP-BF544 that are not in the common header */
43
44/* Timer Registers */
45
46#define TIMER8_CONFIG 0xffc00600 /* Timer 8 Configuration Register */
47#define TIMER8_COUNTER 0xffc00604 /* Timer 8 Counter Register */
48#define TIMER8_PERIOD 0xffc00608 /* Timer 8 Period Register */
49#define TIMER8_WIDTH 0xffc0060c /* Timer 8 Width Register */
50#define TIMER9_CONFIG 0xffc00610 /* Timer 9 Configuration Register */
51#define TIMER9_COUNTER 0xffc00614 /* Timer 9 Counter Register */
52#define TIMER9_PERIOD 0xffc00618 /* Timer 9 Period Register */
53#define TIMER9_WIDTH 0xffc0061c /* Timer 9 Width Register */
54#define TIMER10_CONFIG 0xffc00620 /* Timer 10 Configuration Register */
55#define TIMER10_COUNTER 0xffc00624 /* Timer 10 Counter Register */
56#define TIMER10_PERIOD 0xffc00628 /* Timer 10 Period Register */
57#define TIMER10_WIDTH 0xffc0062c /* Timer 10 Width Register */
58
59/* Timer Group of 3 Registers */
60
61#define TIMER_ENABLE1 0xffc00640 /* Timer Group of 3 Enable Register */
62#define TIMER_DISABLE1 0xffc00644 /* Timer Group of 3 Disable Register */
63#define TIMER_STATUS1 0xffc00648 /* Timer Group of 3 Status Register */
64
65/* EPPI0 Registers */
66
67#define EPPI0_STATUS 0xffc01000 /* EPPI0 Status Register */
68#define EPPI0_HCOUNT 0xffc01004 /* EPPI0 Horizontal Transfer Count Register */
69#define EPPI0_HDELAY 0xffc01008 /* EPPI0 Horizontal Delay Count Register */
70#define EPPI0_VCOUNT 0xffc0100c /* EPPI0 Vertical Transfer Count Register */
71#define EPPI0_VDELAY 0xffc01010 /* EPPI0 Vertical Delay Count Register */
72#define EPPI0_FRAME 0xffc01014 /* EPPI0 Lines per Frame Register */
73#define EPPI0_LINE 0xffc01018 /* EPPI0 Samples per Line Register */
74#define EPPI0_CLKDIV 0xffc0101c /* EPPI0 Clock Divide Register */
75#define EPPI0_CONTROL 0xffc01020 /* EPPI0 Control Register */
76#define EPPI0_FS1W_HBL 0xffc01024 /* EPPI0 FS1 Width Register / EPPI0 Horizontal Blanking Samples Per Line Register */
77#define EPPI0_FS1P_AVPL 0xffc01028 /* EPPI0 FS1 Period Register / EPPI0 Active Video Samples Per Line Register */
78#define EPPI0_FS2W_LVB 0xffc0102c /* EPPI0 FS2 Width Register / EPPI0 Lines of Vertical Blanking Register */
79#define EPPI0_FS2P_LAVF 0xffc01030 /* EPPI0 FS2 Period Register/ EPPI0 Lines of Active Video Per Field Register */
80#define EPPI0_CLIP 0xffc01034 /* EPPI0 Clipping Register */
81
82/* Two Wire Interface Registers (TWI1) */
83
84#define TWI1_REGBASE 0xffc02200
85#define TWI1_CLKDIV 0xffc02200 /* Clock Divider Register */
86#define TWI1_CONTROL 0xffc02204 /* TWI Control Register */
87#define TWI1_SLAVE_CTRL 0xffc02208 /* TWI Slave Mode Control Register */
88#define TWI1_SLAVE_STAT 0xffc0220c /* TWI Slave Mode Status Register */
89#define TWI1_SLAVE_ADDR 0xffc02210 /* TWI Slave Mode Address Register */
90#define TWI1_MASTER_CTRL 0xffc02214 /* TWI Master Mode Control Register */
91#define TWI1_MASTER_STAT 0xffc02218 /* TWI Master Mode Status Register */
92#define TWI1_MASTER_ADDR 0xffc0221c /* TWI Master Mode Address Register */
93#define TWI1_INT_STAT 0xffc02220 /* TWI Interrupt Status Register */
94#define TWI1_INT_MASK 0xffc02224 /* TWI Interrupt Mask Register */
95#define TWI1_FIFO_CTRL 0xffc02228 /* TWI FIFO Control Register */
96#define TWI1_FIFO_STAT 0xffc0222c /* TWI FIFO Status Register */
97#define TWI1_XMT_DATA8 0xffc02280 /* TWI FIFO Transmit Data Single Byte Register */
98#define TWI1_XMT_DATA16 0xffc02284 /* TWI FIFO Transmit Data Double Byte Register */
99#define TWI1_RCV_DATA8 0xffc02288 /* TWI FIFO Receive Data Single Byte Register */
100#define TWI1_RCV_DATA16 0xffc0228c /* TWI FIFO Receive Data Double Byte Register */
101
102/* CAN Controller 1 Config 1 Registers */
103
104#define CAN1_MC1 0xffc03200 /* CAN Controller 1 Mailbox Configuration Register 1 */
105#define CAN1_MD1 0xffc03204 /* CAN Controller 1 Mailbox Direction Register 1 */
106#define CAN1_TRS1 0xffc03208 /* CAN Controller 1 Transmit Request Set Register 1 */
107#define CAN1_TRR1 0xffc0320c /* CAN Controller 1 Transmit Request Reset Register 1 */
108#define CAN1_TA1 0xffc03210 /* CAN Controller 1 Transmit Acknowledge Register 1 */
109#define CAN1_AA1 0xffc03214 /* CAN Controller 1 Abort Acknowledge Register 1 */
110#define CAN1_RMP1 0xffc03218 /* CAN Controller 1 Receive Message Pending Register 1 */
111#define CAN1_RML1 0xffc0321c /* CAN Controller 1 Receive Message Lost Register 1 */
112#define CAN1_MBTIF1 0xffc03220 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 1 */
113#define CAN1_MBRIF1 0xffc03224 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 1 */
114#define CAN1_MBIM1 0xffc03228 /* CAN Controller 1 Mailbox Interrupt Mask Register 1 */
115#define CAN1_RFH1 0xffc0322c /* CAN Controller 1 Remote Frame Handling Enable Register 1 */
116#define CAN1_OPSS1 0xffc03230 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 1 */
117
118/* CAN Controller 1 Config 2 Registers */
119
120#define CAN1_MC2 0xffc03240 /* CAN Controller 1 Mailbox Configuration Register 2 */
121#define CAN1_MD2 0xffc03244 /* CAN Controller 1 Mailbox Direction Register 2 */
122#define CAN1_TRS2 0xffc03248 /* CAN Controller 1 Transmit Request Set Register 2 */
123#define CAN1_TRR2 0xffc0324c /* CAN Controller 1 Transmit Request Reset Register 2 */
124#define CAN1_TA2 0xffc03250 /* CAN Controller 1 Transmit Acknowledge Register 2 */
125#define CAN1_AA2 0xffc03254 /* CAN Controller 1 Abort Acknowledge Register 2 */
126#define CAN1_RMP2 0xffc03258 /* CAN Controller 1 Receive Message Pending Register 2 */
127#define CAN1_RML2 0xffc0325c /* CAN Controller 1 Receive Message Lost Register 2 */
128#define CAN1_MBTIF2 0xffc03260 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 2 */
129#define CAN1_MBRIF2 0xffc03264 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 2 */
130#define CAN1_MBIM2 0xffc03268 /* CAN Controller 1 Mailbox Interrupt Mask Register 2 */
131#define CAN1_RFH2 0xffc0326c /* CAN Controller 1 Remote Frame Handling Enable Register 2 */
132#define CAN1_OPSS2 0xffc03270 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 2 */
133
134/* CAN Controller 1 Clock/Interrupt/Counter Registers */
135
136#define CAN1_CLOCK 0xffc03280 /* CAN Controller 1 Clock Register */
137#define CAN1_TIMING 0xffc03284 /* CAN Controller 1 Timing Register */
138#define CAN1_DEBUG 0xffc03288 /* CAN Controller 1 Debug Register */
139#define CAN1_STATUS 0xffc0328c /* CAN Controller 1 Global Status Register */
140#define CAN1_CEC 0xffc03290 /* CAN Controller 1 Error Counter Register */
141#define CAN1_GIS 0xffc03294 /* CAN Controller 1 Global Interrupt Status Register */
142#define CAN1_GIM 0xffc03298 /* CAN Controller 1 Global Interrupt Mask Register */
143#define CAN1_GIF 0xffc0329c /* CAN Controller 1 Global Interrupt Flag Register */
144#define CAN1_CONTROL 0xffc032a0 /* CAN Controller 1 Master Control Register */
145#define CAN1_INTR 0xffc032a4 /* CAN Controller 1 Interrupt Pending Register */
146#define CAN1_MBTD 0xffc032ac /* CAN Controller 1 Mailbox Temporary Disable Register */
147#define CAN1_EWR 0xffc032b0 /* CAN Controller 1 Programmable Warning Level Register */
148#define CAN1_ESR 0xffc032b4 /* CAN Controller 1 Error Status Register */
149#define CAN1_UCCNT 0xffc032c4 /* CAN Controller 1 Universal Counter Register */
150#define CAN1_UCRC 0xffc032c8 /* CAN Controller 1 Universal Counter Force Reload Register */
151#define CAN1_UCCNF 0xffc032cc /* CAN Controller 1 Universal Counter Configuration Register */
152
153/* CAN Controller 1 Mailbox Acceptance Registers */
154
155#define CAN1_AM00L 0xffc03300 /* CAN Controller 1 Mailbox 0 Acceptance Mask High Register */
156#define CAN1_AM00H 0xffc03304 /* CAN Controller 1 Mailbox 0 Acceptance Mask Low Register */
157#define CAN1_AM01L 0xffc03308 /* CAN Controller 1 Mailbox 1 Acceptance Mask High Register */
158#define CAN1_AM01H 0xffc0330c /* CAN Controller 1 Mailbox 1 Acceptance Mask Low Register */
159#define CAN1_AM02L 0xffc03310 /* CAN Controller 1 Mailbox 2 Acceptance Mask High Register */
160#define CAN1_AM02H 0xffc03314 /* CAN Controller 1 Mailbox 2 Acceptance Mask Low Register */
161#define CAN1_AM03L 0xffc03318 /* CAN Controller 1 Mailbox 3 Acceptance Mask High Register */
162#define CAN1_AM03H 0xffc0331c /* CAN Controller 1 Mailbox 3 Acceptance Mask Low Register */
163#define CAN1_AM04L 0xffc03320 /* CAN Controller 1 Mailbox 4 Acceptance Mask High Register */
164#define CAN1_AM04H 0xffc03324 /* CAN Controller 1 Mailbox 4 Acceptance Mask Low Register */
165#define CAN1_AM05L 0xffc03328 /* CAN Controller 1 Mailbox 5 Acceptance Mask High Register */
166#define CAN1_AM05H 0xffc0332c /* CAN Controller 1 Mailbox 5 Acceptance Mask Low Register */
167#define CAN1_AM06L 0xffc03330 /* CAN Controller 1 Mailbox 6 Acceptance Mask High Register */
168#define CAN1_AM06H 0xffc03334 /* CAN Controller 1 Mailbox 6 Acceptance Mask Low Register */
169#define CAN1_AM07L 0xffc03338 /* CAN Controller 1 Mailbox 7 Acceptance Mask High Register */
170#define CAN1_AM07H 0xffc0333c /* CAN Controller 1 Mailbox 7 Acceptance Mask Low Register */
171#define CAN1_AM08L 0xffc03340 /* CAN Controller 1 Mailbox 8 Acceptance Mask High Register */
172#define CAN1_AM08H 0xffc03344 /* CAN Controller 1 Mailbox 8 Acceptance Mask Low Register */
173#define CAN1_AM09L 0xffc03348 /* CAN Controller 1 Mailbox 9 Acceptance Mask High Register */
174#define CAN1_AM09H 0xffc0334c /* CAN Controller 1 Mailbox 9 Acceptance Mask Low Register */
175#define CAN1_AM10L 0xffc03350 /* CAN Controller 1 Mailbox 10 Acceptance Mask High Register */
176#define CAN1_AM10H 0xffc03354 /* CAN Controller 1 Mailbox 10 Acceptance Mask Low Register */
177#define CAN1_AM11L 0xffc03358 /* CAN Controller 1 Mailbox 11 Acceptance Mask High Register */
178#define CAN1_AM11H 0xffc0335c /* CAN Controller 1 Mailbox 11 Acceptance Mask Low Register */
179#define CAN1_AM12L 0xffc03360 /* CAN Controller 1 Mailbox 12 Acceptance Mask High Register */
180#define CAN1_AM12H 0xffc03364 /* CAN Controller 1 Mailbox 12 Acceptance Mask Low Register */
181#define CAN1_AM13L 0xffc03368 /* CAN Controller 1 Mailbox 13 Acceptance Mask High Register */
182#define CAN1_AM13H 0xffc0336c /* CAN Controller 1 Mailbox 13 Acceptance Mask Low Register */
183#define CAN1_AM14L 0xffc03370 /* CAN Controller 1 Mailbox 14 Acceptance Mask High Register */
184#define CAN1_AM14H 0xffc03374 /* CAN Controller 1 Mailbox 14 Acceptance Mask Low Register */
185#define CAN1_AM15L 0xffc03378 /* CAN Controller 1 Mailbox 15 Acceptance Mask High Register */
186#define CAN1_AM15H 0xffc0337c /* CAN Controller 1 Mailbox 15 Acceptance Mask Low Register */
187
188/* CAN Controller 1 Mailbox Acceptance Registers */
189
190#define CAN1_AM16L 0xffc03380 /* CAN Controller 1 Mailbox 16 Acceptance Mask High Register */
191#define CAN1_AM16H 0xffc03384 /* CAN Controller 1 Mailbox 16 Acceptance Mask Low Register */
192#define CAN1_AM17L 0xffc03388 /* CAN Controller 1 Mailbox 17 Acceptance Mask High Register */
193#define CAN1_AM17H 0xffc0338c /* CAN Controller 1 Mailbox 17 Acceptance Mask Low Register */
194#define CAN1_AM18L 0xffc03390 /* CAN Controller 1 Mailbox 18 Acceptance Mask High Register */
195#define CAN1_AM18H 0xffc03394 /* CAN Controller 1 Mailbox 18 Acceptance Mask Low Register */
196#define CAN1_AM19L 0xffc03398 /* CAN Controller 1 Mailbox 19 Acceptance Mask High Register */
197#define CAN1_AM19H 0xffc0339c /* CAN Controller 1 Mailbox 19 Acceptance Mask Low Register */
198#define CAN1_AM20L 0xffc033a0 /* CAN Controller 1 Mailbox 20 Acceptance Mask High Register */
199#define CAN1_AM20H 0xffc033a4 /* CAN Controller 1 Mailbox 20 Acceptance Mask Low Register */
200#define CAN1_AM21L 0xffc033a8 /* CAN Controller 1 Mailbox 21 Acceptance Mask High Register */
201#define CAN1_AM21H 0xffc033ac /* CAN Controller 1 Mailbox 21 Acceptance Mask Low Register */
202#define CAN1_AM22L 0xffc033b0 /* CAN Controller 1 Mailbox 22 Acceptance Mask High Register */
203#define CAN1_AM22H 0xffc033b4 /* CAN Controller 1 Mailbox 22 Acceptance Mask Low Register */
204#define CAN1_AM23L 0xffc033b8 /* CAN Controller 1 Mailbox 23 Acceptance Mask High Register */
205#define CAN1_AM23H 0xffc033bc /* CAN Controller 1 Mailbox 23 Acceptance Mask Low Register */
206#define CAN1_AM24L 0xffc033c0 /* CAN Controller 1 Mailbox 24 Acceptance Mask High Register */
207#define CAN1_AM24H 0xffc033c4 /* CAN Controller 1 Mailbox 24 Acceptance Mask Low Register */
208#define CAN1_AM25L 0xffc033c8 /* CAN Controller 1 Mailbox 25 Acceptance Mask High Register */
209#define CAN1_AM25H 0xffc033cc /* CAN Controller 1 Mailbox 25 Acceptance Mask Low Register */
210#define CAN1_AM26L 0xffc033d0 /* CAN Controller 1 Mailbox 26 Acceptance Mask High Register */
211#define CAN1_AM26H 0xffc033d4 /* CAN Controller 1 Mailbox 26 Acceptance Mask Low Register */
212#define CAN1_AM27L 0xffc033d8 /* CAN Controller 1 Mailbox 27 Acceptance Mask High Register */
213#define CAN1_AM27H 0xffc033dc /* CAN Controller 1 Mailbox 27 Acceptance Mask Low Register */
214#define CAN1_AM28L 0xffc033e0 /* CAN Controller 1 Mailbox 28 Acceptance Mask High Register */
215#define CAN1_AM28H 0xffc033e4 /* CAN Controller 1 Mailbox 28 Acceptance Mask Low Register */
216#define CAN1_AM29L 0xffc033e8 /* CAN Controller 1 Mailbox 29 Acceptance Mask High Register */
217#define CAN1_AM29H 0xffc033ec /* CAN Controller 1 Mailbox 29 Acceptance Mask Low Register */
218#define CAN1_AM30L 0xffc033f0 /* CAN Controller 1 Mailbox 30 Acceptance Mask High Register */
219#define CAN1_AM30H 0xffc033f4 /* CAN Controller 1 Mailbox 30 Acceptance Mask Low Register */
220#define CAN1_AM31L 0xffc033f8 /* CAN Controller 1 Mailbox 31 Acceptance Mask High Register */
221#define CAN1_AM31H 0xffc033fc /* CAN Controller 1 Mailbox 31 Acceptance Mask Low Register */
222
223/* CAN Controller 1 Mailbox Data Registers */
224
225#define CAN1_MB00_DATA0 0xffc03400 /* CAN Controller 1 Mailbox 0 Data 0 Register */
226#define CAN1_MB00_DATA1 0xffc03404 /* CAN Controller 1 Mailbox 0 Data 1 Register */
227#define CAN1_MB00_DATA2 0xffc03408 /* CAN Controller 1 Mailbox 0 Data 2 Register */
228#define CAN1_MB00_DATA3 0xffc0340c /* CAN Controller 1 Mailbox 0 Data 3 Register */
229#define CAN1_MB00_LENGTH 0xffc03410 /* CAN Controller 1 Mailbox 0 Length Register */
230#define CAN1_MB00_TIMESTAMP 0xffc03414 /* CAN Controller 1 Mailbox 0 Timestamp Register */
231#define CAN1_MB00_ID0 0xffc03418 /* CAN Controller 1 Mailbox 0 ID0 Register */
232#define CAN1_MB00_ID1 0xffc0341c /* CAN Controller 1 Mailbox 0 ID1 Register */
233#define CAN1_MB01_DATA0 0xffc03420 /* CAN Controller 1 Mailbox 1 Data 0 Register */
234#define CAN1_MB01_DATA1 0xffc03424 /* CAN Controller 1 Mailbox 1 Data 1 Register */
235#define CAN1_MB01_DATA2 0xffc03428 /* CAN Controller 1 Mailbox 1 Data 2 Register */
236#define CAN1_MB01_DATA3 0xffc0342c /* CAN Controller 1 Mailbox 1 Data 3 Register */
237#define CAN1_MB01_LENGTH 0xffc03430 /* CAN Controller 1 Mailbox 1 Length Register */
238#define CAN1_MB01_TIMESTAMP 0xffc03434 /* CAN Controller 1 Mailbox 1 Timestamp Register */
239#define CAN1_MB01_ID0 0xffc03438 /* CAN Controller 1 Mailbox 1 ID0 Register */
240#define CAN1_MB01_ID1 0xffc0343c /* CAN Controller 1 Mailbox 1 ID1 Register */
241#define CAN1_MB02_DATA0 0xffc03440 /* CAN Controller 1 Mailbox 2 Data 0 Register */
242#define CAN1_MB02_DATA1 0xffc03444 /* CAN Controller 1 Mailbox 2 Data 1 Register */
243#define CAN1_MB02_DATA2 0xffc03448 /* CAN Controller 1 Mailbox 2 Data 2 Register */
244#define CAN1_MB02_DATA3 0xffc0344c /* CAN Controller 1 Mailbox 2 Data 3 Register */
245#define CAN1_MB02_LENGTH 0xffc03450 /* CAN Controller 1 Mailbox 2 Length Register */
246#define CAN1_MB02_TIMESTAMP 0xffc03454 /* CAN Controller 1 Mailbox 2 Timestamp Register */
247#define CAN1_MB02_ID0 0xffc03458 /* CAN Controller 1 Mailbox 2 ID0 Register */
248#define CAN1_MB02_ID1 0xffc0345c /* CAN Controller 1 Mailbox 2 ID1 Register */
249#define CAN1_MB03_DATA0 0xffc03460 /* CAN Controller 1 Mailbox 3 Data 0 Register */
250#define CAN1_MB03_DATA1 0xffc03464 /* CAN Controller 1 Mailbox 3 Data 1 Register */
251#define CAN1_MB03_DATA2 0xffc03468 /* CAN Controller 1 Mailbox 3 Data 2 Register */
252#define CAN1_MB03_DATA3 0xffc0346c /* CAN Controller 1 Mailbox 3 Data 3 Register */
253#define CAN1_MB03_LENGTH 0xffc03470 /* CAN Controller 1 Mailbox 3 Length Register */
254#define CAN1_MB03_TIMESTAMP 0xffc03474 /* CAN Controller 1 Mailbox 3 Timestamp Register */
255#define CAN1_MB03_ID0 0xffc03478 /* CAN Controller 1 Mailbox 3 ID0 Register */
256#define CAN1_MB03_ID1 0xffc0347c /* CAN Controller 1 Mailbox 3 ID1 Register */
257#define CAN1_MB04_DATA0 0xffc03480 /* CAN Controller 1 Mailbox 4 Data 0 Register */
258#define CAN1_MB04_DATA1 0xffc03484 /* CAN Controller 1 Mailbox 4 Data 1 Register */
259#define CAN1_MB04_DATA2 0xffc03488 /* CAN Controller 1 Mailbox 4 Data 2 Register */
260#define CAN1_MB04_DATA3 0xffc0348c /* CAN Controller 1 Mailbox 4 Data 3 Register */
261#define CAN1_MB04_LENGTH 0xffc03490 /* CAN Controller 1 Mailbox 4 Length Register */
262#define CAN1_MB04_TIMESTAMP 0xffc03494 /* CAN Controller 1 Mailbox 4 Timestamp Register */
263#define CAN1_MB04_ID0 0xffc03498 /* CAN Controller 1 Mailbox 4 ID0 Register */
264#define CAN1_MB04_ID1 0xffc0349c /* CAN Controller 1 Mailbox 4 ID1 Register */
265#define CAN1_MB05_DATA0 0xffc034a0 /* CAN Controller 1 Mailbox 5 Data 0 Register */
266#define CAN1_MB05_DATA1 0xffc034a4 /* CAN Controller 1 Mailbox 5 Data 1 Register */
267#define CAN1_MB05_DATA2 0xffc034a8 /* CAN Controller 1 Mailbox 5 Data 2 Register */
268#define CAN1_MB05_DATA3 0xffc034ac /* CAN Controller 1 Mailbox 5 Data 3 Register */
269#define CAN1_MB05_LENGTH 0xffc034b0 /* CAN Controller 1 Mailbox 5 Length Register */
270#define CAN1_MB05_TIMESTAMP 0xffc034b4 /* CAN Controller 1 Mailbox 5 Timestamp Register */
271#define CAN1_MB05_ID0 0xffc034b8 /* CAN Controller 1 Mailbox 5 ID0 Register */
272#define CAN1_MB05_ID1 0xffc034bc /* CAN Controller 1 Mailbox 5 ID1 Register */
273#define CAN1_MB06_DATA0 0xffc034c0 /* CAN Controller 1 Mailbox 6 Data 0 Register */
274#define CAN1_MB06_DATA1 0xffc034c4 /* CAN Controller 1 Mailbox 6 Data 1 Register */
275#define CAN1_MB06_DATA2 0xffc034c8 /* CAN Controller 1 Mailbox 6 Data 2 Register */
276#define CAN1_MB06_DATA3 0xffc034cc /* CAN Controller 1 Mailbox 6 Data 3 Register */
277#define CAN1_MB06_LENGTH 0xffc034d0 /* CAN Controller 1 Mailbox 6 Length Register */
278#define CAN1_MB06_TIMESTAMP 0xffc034d4 /* CAN Controller 1 Mailbox 6 Timestamp Register */
279#define CAN1_MB06_ID0 0xffc034d8 /* CAN Controller 1 Mailbox 6 ID0 Register */
280#define CAN1_MB06_ID1 0xffc034dc /* CAN Controller 1 Mailbox 6 ID1 Register */
281#define CAN1_MB07_DATA0 0xffc034e0 /* CAN Controller 1 Mailbox 7 Data 0 Register */
282#define CAN1_MB07_DATA1 0xffc034e4 /* CAN Controller 1 Mailbox 7 Data 1 Register */
283#define CAN1_MB07_DATA2 0xffc034e8 /* CAN Controller 1 Mailbox 7 Data 2 Register */
284#define CAN1_MB07_DATA3 0xffc034ec /* CAN Controller 1 Mailbox 7 Data 3 Register */
285#define CAN1_MB07_LENGTH 0xffc034f0 /* CAN Controller 1 Mailbox 7 Length Register */
286#define CAN1_MB07_TIMESTAMP 0xffc034f4 /* CAN Controller 1 Mailbox 7 Timestamp Register */
287#define CAN1_MB07_ID0 0xffc034f8 /* CAN Controller 1 Mailbox 7 ID0 Register */
288#define CAN1_MB07_ID1 0xffc034fc /* CAN Controller 1 Mailbox 7 ID1 Register */
289#define CAN1_MB08_DATA0 0xffc03500 /* CAN Controller 1 Mailbox 8 Data 0 Register */
290#define CAN1_MB08_DATA1 0xffc03504 /* CAN Controller 1 Mailbox 8 Data 1 Register */
291#define CAN1_MB08_DATA2 0xffc03508 /* CAN Controller 1 Mailbox 8 Data 2 Register */
292#define CAN1_MB08_DATA3 0xffc0350c /* CAN Controller 1 Mailbox 8 Data 3 Register */
293#define CAN1_MB08_LENGTH 0xffc03510 /* CAN Controller 1 Mailbox 8 Length Register */
294#define CAN1_MB08_TIMESTAMP 0xffc03514 /* CAN Controller 1 Mailbox 8 Timestamp Register */
295#define CAN1_MB08_ID0 0xffc03518 /* CAN Controller 1 Mailbox 8 ID0 Register */
296#define CAN1_MB08_ID1 0xffc0351c /* CAN Controller 1 Mailbox 8 ID1 Register */
297#define CAN1_MB09_DATA0 0xffc03520 /* CAN Controller 1 Mailbox 9 Data 0 Register */
298#define CAN1_MB09_DATA1 0xffc03524 /* CAN Controller 1 Mailbox 9 Data 1 Register */
299#define CAN1_MB09_DATA2 0xffc03528 /* CAN Controller 1 Mailbox 9 Data 2 Register */
300#define CAN1_MB09_DATA3 0xffc0352c /* CAN Controller 1 Mailbox 9 Data 3 Register */
301#define CAN1_MB09_LENGTH 0xffc03530 /* CAN Controller 1 Mailbox 9 Length Register */
302#define CAN1_MB09_TIMESTAMP 0xffc03534 /* CAN Controller 1 Mailbox 9 Timestamp Register */
303#define CAN1_MB09_ID0 0xffc03538 /* CAN Controller 1 Mailbox 9 ID0 Register */
304#define CAN1_MB09_ID1 0xffc0353c /* CAN Controller 1 Mailbox 9 ID1 Register */
305#define CAN1_MB10_DATA0 0xffc03540 /* CAN Controller 1 Mailbox 10 Data 0 Register */
306#define CAN1_MB10_DATA1 0xffc03544 /* CAN Controller 1 Mailbox 10 Data 1 Register */
307#define CAN1_MB10_DATA2 0xffc03548 /* CAN Controller 1 Mailbox 10 Data 2 Register */
308#define CAN1_MB10_DATA3 0xffc0354c /* CAN Controller 1 Mailbox 10 Data 3 Register */
309#define CAN1_MB10_LENGTH 0xffc03550 /* CAN Controller 1 Mailbox 10 Length Register */
310#define CAN1_MB10_TIMESTAMP 0xffc03554 /* CAN Controller 1 Mailbox 10 Timestamp Register */
311#define CAN1_MB10_ID0 0xffc03558 /* CAN Controller 1 Mailbox 10 ID0 Register */
312#define CAN1_MB10_ID1 0xffc0355c /* CAN Controller 1 Mailbox 10 ID1 Register */
313#define CAN1_MB11_DATA0 0xffc03560 /* CAN Controller 1 Mailbox 11 Data 0 Register */
314#define CAN1_MB11_DATA1 0xffc03564 /* CAN Controller 1 Mailbox 11 Data 1 Register */
315#define CAN1_MB11_DATA2 0xffc03568 /* CAN Controller 1 Mailbox 11 Data 2 Register */
316#define CAN1_MB11_DATA3 0xffc0356c /* CAN Controller 1 Mailbox 11 Data 3 Register */
317#define CAN1_MB11_LENGTH 0xffc03570 /* CAN Controller 1 Mailbox 11 Length Register */
318#define CAN1_MB11_TIMESTAMP 0xffc03574 /* CAN Controller 1 Mailbox 11 Timestamp Register */
319#define CAN1_MB11_ID0 0xffc03578 /* CAN Controller 1 Mailbox 11 ID0 Register */
320#define CAN1_MB11_ID1 0xffc0357c /* CAN Controller 1 Mailbox 11 ID1 Register */
321#define CAN1_MB12_DATA0 0xffc03580 /* CAN Controller 1 Mailbox 12 Data 0 Register */
322#define CAN1_MB12_DATA1 0xffc03584 /* CAN Controller 1 Mailbox 12 Data 1 Register */
323#define CAN1_MB12_DATA2 0xffc03588 /* CAN Controller 1 Mailbox 12 Data 2 Register */
324#define CAN1_MB12_DATA3 0xffc0358c /* CAN Controller 1 Mailbox 12 Data 3 Register */
325#define CAN1_MB12_LENGTH 0xffc03590 /* CAN Controller 1 Mailbox 12 Length Register */
326#define CAN1_MB12_TIMESTAMP 0xffc03594 /* CAN Controller 1 Mailbox 12 Timestamp Register */
327#define CAN1_MB12_ID0 0xffc03598 /* CAN Controller 1 Mailbox 12 ID0 Register */
328#define CAN1_MB12_ID1 0xffc0359c /* CAN Controller 1 Mailbox 12 ID1 Register */
329#define CAN1_MB13_DATA0 0xffc035a0 /* CAN Controller 1 Mailbox 13 Data 0 Register */
330#define CAN1_MB13_DATA1 0xffc035a4 /* CAN Controller 1 Mailbox 13 Data 1 Register */
331#define CAN1_MB13_DATA2 0xffc035a8 /* CAN Controller 1 Mailbox 13 Data 2 Register */
332#define CAN1_MB13_DATA3 0xffc035ac /* CAN Controller 1 Mailbox 13 Data 3 Register */
333#define CAN1_MB13_LENGTH 0xffc035b0 /* CAN Controller 1 Mailbox 13 Length Register */
334#define CAN1_MB13_TIMESTAMP 0xffc035b4 /* CAN Controller 1 Mailbox 13 Timestamp Register */
335#define CAN1_MB13_ID0 0xffc035b8 /* CAN Controller 1 Mailbox 13 ID0 Register */
336#define CAN1_MB13_ID1 0xffc035bc /* CAN Controller 1 Mailbox 13 ID1 Register */
337#define CAN1_MB14_DATA0 0xffc035c0 /* CAN Controller 1 Mailbox 14 Data 0 Register */
338#define CAN1_MB14_DATA1 0xffc035c4 /* CAN Controller 1 Mailbox 14 Data 1 Register */
339#define CAN1_MB14_DATA2 0xffc035c8 /* CAN Controller 1 Mailbox 14 Data 2 Register */
340#define CAN1_MB14_DATA3 0xffc035cc /* CAN Controller 1 Mailbox 14 Data 3 Register */
341#define CAN1_MB14_LENGTH 0xffc035d0 /* CAN Controller 1 Mailbox 14 Length Register */
342#define CAN1_MB14_TIMESTAMP 0xffc035d4 /* CAN Controller 1 Mailbox 14 Timestamp Register */
343#define CAN1_MB14_ID0 0xffc035d8 /* CAN Controller 1 Mailbox 14 ID0 Register */
344#define CAN1_MB14_ID1 0xffc035dc /* CAN Controller 1 Mailbox 14 ID1 Register */
345#define CAN1_MB15_DATA0 0xffc035e0 /* CAN Controller 1 Mailbox 15 Data 0 Register */
346#define CAN1_MB15_DATA1 0xffc035e4 /* CAN Controller 1 Mailbox 15 Data 1 Register */
347#define CAN1_MB15_DATA2 0xffc035e8 /* CAN Controller 1 Mailbox 15 Data 2 Register */
348#define CAN1_MB15_DATA3 0xffc035ec /* CAN Controller 1 Mailbox 15 Data 3 Register */
349#define CAN1_MB15_LENGTH 0xffc035f0 /* CAN Controller 1 Mailbox 15 Length Register */
350#define CAN1_MB15_TIMESTAMP 0xffc035f4 /* CAN Controller 1 Mailbox 15 Timestamp Register */
351#define CAN1_MB15_ID0 0xffc035f8 /* CAN Controller 1 Mailbox 15 ID0 Register */
352#define CAN1_MB15_ID1 0xffc035fc /* CAN Controller 1 Mailbox 15 ID1 Register */
353
354/* CAN Controller 1 Mailbox Data Registers */
355
356#define CAN1_MB16_DATA0 0xffc03600 /* CAN Controller 1 Mailbox 16 Data 0 Register */
357#define CAN1_MB16_DATA1 0xffc03604 /* CAN Controller 1 Mailbox 16 Data 1 Register */
358#define CAN1_MB16_DATA2 0xffc03608 /* CAN Controller 1 Mailbox 16 Data 2 Register */
359#define CAN1_MB16_DATA3 0xffc0360c /* CAN Controller 1 Mailbox 16 Data 3 Register */
360#define CAN1_MB16_LENGTH 0xffc03610 /* CAN Controller 1 Mailbox 16 Length Register */
361#define CAN1_MB16_TIMESTAMP 0xffc03614 /* CAN Controller 1 Mailbox 16 Timestamp Register */
362#define CAN1_MB16_ID0 0xffc03618 /* CAN Controller 1 Mailbox 16 ID0 Register */
363#define CAN1_MB16_ID1 0xffc0361c /* CAN Controller 1 Mailbox 16 ID1 Register */
364#define CAN1_MB17_DATA0 0xffc03620 /* CAN Controller 1 Mailbox 17 Data 0 Register */
365#define CAN1_MB17_DATA1 0xffc03624 /* CAN Controller 1 Mailbox 17 Data 1 Register */
366#define CAN1_MB17_DATA2 0xffc03628 /* CAN Controller 1 Mailbox 17 Data 2 Register */
367#define CAN1_MB17_DATA3 0xffc0362c /* CAN Controller 1 Mailbox 17 Data 3 Register */
368#define CAN1_MB17_LENGTH 0xffc03630 /* CAN Controller 1 Mailbox 17 Length Register */
369#define CAN1_MB17_TIMESTAMP 0xffc03634 /* CAN Controller 1 Mailbox 17 Timestamp Register */
370#define CAN1_MB17_ID0 0xffc03638 /* CAN Controller 1 Mailbox 17 ID0 Register */
371#define CAN1_MB17_ID1 0xffc0363c /* CAN Controller 1 Mailbox 17 ID1 Register */
372#define CAN1_MB18_DATA0 0xffc03640 /* CAN Controller 1 Mailbox 18 Data 0 Register */
373#define CAN1_MB18_DATA1 0xffc03644 /* CAN Controller 1 Mailbox 18 Data 1 Register */
374#define CAN1_MB18_DATA2 0xffc03648 /* CAN Controller 1 Mailbox 18 Data 2 Register */
375#define CAN1_MB18_DATA3 0xffc0364c /* CAN Controller 1 Mailbox 18 Data 3 Register */
376#define CAN1_MB18_LENGTH 0xffc03650 /* CAN Controller 1 Mailbox 18 Length Register */
377#define CAN1_MB18_TIMESTAMP 0xffc03654 /* CAN Controller 1 Mailbox 18 Timestamp Register */
378#define CAN1_MB18_ID0 0xffc03658 /* CAN Controller 1 Mailbox 18 ID0 Register */
379#define CAN1_MB18_ID1 0xffc0365c /* CAN Controller 1 Mailbox 18 ID1 Register */
380#define CAN1_MB19_DATA0 0xffc03660 /* CAN Controller 1 Mailbox 19 Data 0 Register */
381#define CAN1_MB19_DATA1 0xffc03664 /* CAN Controller 1 Mailbox 19 Data 1 Register */
382#define CAN1_MB19_DATA2 0xffc03668 /* CAN Controller 1 Mailbox 19 Data 2 Register */
383#define CAN1_MB19_DATA3 0xffc0366c /* CAN Controller 1 Mailbox 19 Data 3 Register */
384#define CAN1_MB19_LENGTH 0xffc03670 /* CAN Controller 1 Mailbox 19 Length Register */
385#define CAN1_MB19_TIMESTAMP 0xffc03674 /* CAN Controller 1 Mailbox 19 Timestamp Register */
386#define CAN1_MB19_ID0 0xffc03678 /* CAN Controller 1 Mailbox 19 ID0 Register */
387#define CAN1_MB19_ID1 0xffc0367c /* CAN Controller 1 Mailbox 19 ID1 Register */
388#define CAN1_MB20_DATA0 0xffc03680 /* CAN Controller 1 Mailbox 20 Data 0 Register */
389#define CAN1_MB20_DATA1 0xffc03684 /* CAN Controller 1 Mailbox 20 Data 1 Register */
390#define CAN1_MB20_DATA2 0xffc03688 /* CAN Controller 1 Mailbox 20 Data 2 Register */
391#define CAN1_MB20_DATA3 0xffc0368c /* CAN Controller 1 Mailbox 20 Data 3 Register */
392#define CAN1_MB20_LENGTH 0xffc03690 /* CAN Controller 1 Mailbox 20 Length Register */
393#define CAN1_MB20_TIMESTAMP 0xffc03694 /* CAN Controller 1 Mailbox 20 Timestamp Register */
394#define CAN1_MB20_ID0 0xffc03698 /* CAN Controller 1 Mailbox 20 ID0 Register */
395#define CAN1_MB20_ID1 0xffc0369c /* CAN Controller 1 Mailbox 20 ID1 Register */
396#define CAN1_MB21_DATA0 0xffc036a0 /* CAN Controller 1 Mailbox 21 Data 0 Register */
397#define CAN1_MB21_DATA1 0xffc036a4 /* CAN Controller 1 Mailbox 21 Data 1 Register */
398#define CAN1_MB21_DATA2 0xffc036a8 /* CAN Controller 1 Mailbox 21 Data 2 Register */
399#define CAN1_MB21_DATA3 0xffc036ac /* CAN Controller 1 Mailbox 21 Data 3 Register */
400#define CAN1_MB21_LENGTH 0xffc036b0 /* CAN Controller 1 Mailbox 21 Length Register */
401#define CAN1_MB21_TIMESTAMP 0xffc036b4 /* CAN Controller 1 Mailbox 21 Timestamp Register */
402#define CAN1_MB21_ID0 0xffc036b8 /* CAN Controller 1 Mailbox 21 ID0 Register */
403#define CAN1_MB21_ID1 0xffc036bc /* CAN Controller 1 Mailbox 21 ID1 Register */
404#define CAN1_MB22_DATA0 0xffc036c0 /* CAN Controller 1 Mailbox 22 Data 0 Register */
405#define CAN1_MB22_DATA1 0xffc036c4 /* CAN Controller 1 Mailbox 22 Data 1 Register */
406#define CAN1_MB22_DATA2 0xffc036c8 /* CAN Controller 1 Mailbox 22 Data 2 Register */
407#define CAN1_MB22_DATA3 0xffc036cc /* CAN Controller 1 Mailbox 22 Data 3 Register */
408#define CAN1_MB22_LENGTH 0xffc036d0 /* CAN Controller 1 Mailbox 22 Length Register */
409#define CAN1_MB22_TIMESTAMP 0xffc036d4 /* CAN Controller 1 Mailbox 22 Timestamp Register */
410#define CAN1_MB22_ID0 0xffc036d8 /* CAN Controller 1 Mailbox 22 ID0 Register */
411#define CAN1_MB22_ID1 0xffc036dc /* CAN Controller 1 Mailbox 22 ID1 Register */
412#define CAN1_MB23_DATA0 0xffc036e0 /* CAN Controller 1 Mailbox 23 Data 0 Register */
413#define CAN1_MB23_DATA1 0xffc036e4 /* CAN Controller 1 Mailbox 23 Data 1 Register */
414#define CAN1_MB23_DATA2 0xffc036e8 /* CAN Controller 1 Mailbox 23 Data 2 Register */
415#define CAN1_MB23_DATA3 0xffc036ec /* CAN Controller 1 Mailbox 23 Data 3 Register */
416#define CAN1_MB23_LENGTH 0xffc036f0 /* CAN Controller 1 Mailbox 23 Length Register */
417#define CAN1_MB23_TIMESTAMP 0xffc036f4 /* CAN Controller 1 Mailbox 23 Timestamp Register */
418#define CAN1_MB23_ID0 0xffc036f8 /* CAN Controller 1 Mailbox 23 ID0 Register */
419#define CAN1_MB23_ID1 0xffc036fc /* CAN Controller 1 Mailbox 23 ID1 Register */
420#define CAN1_MB24_DATA0 0xffc03700 /* CAN Controller 1 Mailbox 24 Data 0 Register */
421#define CAN1_MB24_DATA1 0xffc03704 /* CAN Controller 1 Mailbox 24 Data 1 Register */
422#define CAN1_MB24_DATA2 0xffc03708 /* CAN Controller 1 Mailbox 24 Data 2 Register */
423#define CAN1_MB24_DATA3 0xffc0370c /* CAN Controller 1 Mailbox 24 Data 3 Register */
424#define CAN1_MB24_LENGTH 0xffc03710 /* CAN Controller 1 Mailbox 24 Length Register */
425#define CAN1_MB24_TIMESTAMP 0xffc03714 /* CAN Controller 1 Mailbox 24 Timestamp Register */
426#define CAN1_MB24_ID0 0xffc03718 /* CAN Controller 1 Mailbox 24 ID0 Register */
427#define CAN1_MB24_ID1 0xffc0371c /* CAN Controller 1 Mailbox 24 ID1 Register */
428#define CAN1_MB25_DATA0 0xffc03720 /* CAN Controller 1 Mailbox 25 Data 0 Register */
429#define CAN1_MB25_DATA1 0xffc03724 /* CAN Controller 1 Mailbox 25 Data 1 Register */
430#define CAN1_MB25_DATA2 0xffc03728 /* CAN Controller 1 Mailbox 25 Data 2 Register */
431#define CAN1_MB25_DATA3 0xffc0372c /* CAN Controller 1 Mailbox 25 Data 3 Register */
432#define CAN1_MB25_LENGTH 0xffc03730 /* CAN Controller 1 Mailbox 25 Length Register */
433#define CAN1_MB25_TIMESTAMP 0xffc03734 /* CAN Controller 1 Mailbox 25 Timestamp Register */
434#define CAN1_MB25_ID0 0xffc03738 /* CAN Controller 1 Mailbox 25 ID0 Register */
435#define CAN1_MB25_ID1 0xffc0373c /* CAN Controller 1 Mailbox 25 ID1 Register */
436#define CAN1_MB26_DATA0 0xffc03740 /* CAN Controller 1 Mailbox 26 Data 0 Register */
437#define CAN1_MB26_DATA1 0xffc03744 /* CAN Controller 1 Mailbox 26 Data 1 Register */
438#define CAN1_MB26_DATA2 0xffc03748 /* CAN Controller 1 Mailbox 26 Data 2 Register */
439#define CAN1_MB26_DATA3 0xffc0374c /* CAN Controller 1 Mailbox 26 Data 3 Register */
440#define CAN1_MB26_LENGTH 0xffc03750 /* CAN Controller 1 Mailbox 26 Length Register */
441#define CAN1_MB26_TIMESTAMP 0xffc03754 /* CAN Controller 1 Mailbox 26 Timestamp Register */
442#define CAN1_MB26_ID0 0xffc03758 /* CAN Controller 1 Mailbox 26 ID0 Register */
443#define CAN1_MB26_ID1 0xffc0375c /* CAN Controller 1 Mailbox 26 ID1 Register */
444#define CAN1_MB27_DATA0 0xffc03760 /* CAN Controller 1 Mailbox 27 Data 0 Register */
445#define CAN1_MB27_DATA1 0xffc03764 /* CAN Controller 1 Mailbox 27 Data 1 Register */
446#define CAN1_MB27_DATA2 0xffc03768 /* CAN Controller 1 Mailbox 27 Data 2 Register */
447#define CAN1_MB27_DATA3 0xffc0376c /* CAN Controller 1 Mailbox 27 Data 3 Register */
448#define CAN1_MB27_LENGTH 0xffc03770 /* CAN Controller 1 Mailbox 27 Length Register */
449#define CAN1_MB27_TIMESTAMP 0xffc03774 /* CAN Controller 1 Mailbox 27 Timestamp Register */
450#define CAN1_MB27_ID0 0xffc03778 /* CAN Controller 1 Mailbox 27 ID0 Register */
451#define CAN1_MB27_ID1 0xffc0377c /* CAN Controller 1 Mailbox 27 ID1 Register */
452#define CAN1_MB28_DATA0 0xffc03780 /* CAN Controller 1 Mailbox 28 Data 0 Register */
453#define CAN1_MB28_DATA1 0xffc03784 /* CAN Controller 1 Mailbox 28 Data 1 Register */
454#define CAN1_MB28_DATA2 0xffc03788 /* CAN Controller 1 Mailbox 28 Data 2 Register */
455#define CAN1_MB28_DATA3 0xffc0378c /* CAN Controller 1 Mailbox 28 Data 3 Register */
456#define CAN1_MB28_LENGTH 0xffc03790 /* CAN Controller 1 Mailbox 28 Length Register */
457#define CAN1_MB28_TIMESTAMP 0xffc03794 /* CAN Controller 1 Mailbox 28 Timestamp Register */
458#define CAN1_MB28_ID0 0xffc03798 /* CAN Controller 1 Mailbox 28 ID0 Register */
459#define CAN1_MB28_ID1 0xffc0379c /* CAN Controller 1 Mailbox 28 ID1 Register */
460#define CAN1_MB29_DATA0 0xffc037a0 /* CAN Controller 1 Mailbox 29 Data 0 Register */
461#define CAN1_MB29_DATA1 0xffc037a4 /* CAN Controller 1 Mailbox 29 Data 1 Register */
462#define CAN1_MB29_DATA2 0xffc037a8 /* CAN Controller 1 Mailbox 29 Data 2 Register */
463#define CAN1_MB29_DATA3 0xffc037ac /* CAN Controller 1 Mailbox 29 Data 3 Register */
464#define CAN1_MB29_LENGTH 0xffc037b0 /* CAN Controller 1 Mailbox 29 Length Register */
465#define CAN1_MB29_TIMESTAMP 0xffc037b4 /* CAN Controller 1 Mailbox 29 Timestamp Register */
466#define CAN1_MB29_ID0 0xffc037b8 /* CAN Controller 1 Mailbox 29 ID0 Register */
467#define CAN1_MB29_ID1 0xffc037bc /* CAN Controller 1 Mailbox 29 ID1 Register */
468#define CAN1_MB30_DATA0 0xffc037c0 /* CAN Controller 1 Mailbox 30 Data 0 Register */
469#define CAN1_MB30_DATA1 0xffc037c4 /* CAN Controller 1 Mailbox 30 Data 1 Register */
470#define CAN1_MB30_DATA2 0xffc037c8 /* CAN Controller 1 Mailbox 30 Data 2 Register */
471#define CAN1_MB30_DATA3 0xffc037cc /* CAN Controller 1 Mailbox 30 Data 3 Register */
472#define CAN1_MB30_LENGTH 0xffc037d0 /* CAN Controller 1 Mailbox 30 Length Register */
473#define CAN1_MB30_TIMESTAMP 0xffc037d4 /* CAN Controller 1 Mailbox 30 Timestamp Register */
474#define CAN1_MB30_ID0 0xffc037d8 /* CAN Controller 1 Mailbox 30 ID0 Register */
475#define CAN1_MB30_ID1 0xffc037dc /* CAN Controller 1 Mailbox 30 ID1 Register */
476#define CAN1_MB31_DATA0 0xffc037e0 /* CAN Controller 1 Mailbox 31 Data 0 Register */
477#define CAN1_MB31_DATA1 0xffc037e4 /* CAN Controller 1 Mailbox 31 Data 1 Register */
478#define CAN1_MB31_DATA2 0xffc037e8 /* CAN Controller 1 Mailbox 31 Data 2 Register */
479#define CAN1_MB31_DATA3 0xffc037ec /* CAN Controller 1 Mailbox 31 Data 3 Register */
480#define CAN1_MB31_LENGTH 0xffc037f0 /* CAN Controller 1 Mailbox 31 Length Register */
481#define CAN1_MB31_TIMESTAMP 0xffc037f4 /* CAN Controller 1 Mailbox 31 Timestamp Register */
482#define CAN1_MB31_ID0 0xffc037f8 /* CAN Controller 1 Mailbox 31 ID0 Register */
483#define CAN1_MB31_ID1 0xffc037fc /* CAN Controller 1 Mailbox 31 ID1 Register */
484
485/* HOST Port Registers */
486
487#define HOST_CONTROL 0xffc03a00 /* HOST Control Register */
488#define HOST_STATUS 0xffc03a04 /* HOST Status Register */
489#define HOST_TIMEOUT 0xffc03a08 /* HOST Acknowledge Mode Timeout Register */
490
491/* Pixel Compositor (PIXC) Registers */
492
493#define PIXC_CTL 0xffc04400 /* Overlay enable, resampling mode, I/O data format, transparency enable, watermark level, FIFO status */
494#define PIXC_PPL 0xffc04404 /* Holds the number of pixels per line of the display */
495#define PIXC_LPF 0xffc04408 /* Holds the number of lines per frame of the display */
496#define PIXC_AHSTART 0xffc0440c /* Contains horizontal start pixel information of the overlay data (set A) */
497#define PIXC_AHEND 0xffc04410 /* Contains horizontal end pixel information of the overlay data (set A) */
498#define PIXC_AVSTART 0xffc04414 /* Contains vertical start pixel information of the overlay data (set A) */
499#define PIXC_AVEND 0xffc04418 /* Contains vertical end pixel information of the overlay data (set A) */
500#define PIXC_ATRANSP 0xffc0441c /* Contains the transparency ratio (set A) */
501#define PIXC_BHSTART 0xffc04420 /* Contains horizontal start pixel information of the overlay data (set B) */
502#define PIXC_BHEND 0xffc04424 /* Contains horizontal end pixel information of the overlay data (set B) */
503#define PIXC_BVSTART 0xffc04428 /* Contains vertical start pixel information of the overlay data (set B) */
504#define PIXC_BVEND 0xffc0442c /* Contains vertical end pixel information of the overlay data (set B) */
505#define PIXC_BTRANSP 0xffc04430 /* Contains the transparency ratio (set B) */
506#define PIXC_INTRSTAT 0xffc0443c /* Overlay interrupt configuration/status */
507#define PIXC_RYCON 0xffc04440 /* Color space conversion matrix register. Contains the R/Y conversion coefficients */
508#define PIXC_GUCON 0xffc04444 /* Color space conversion matrix register. Contains the G/U conversion coefficients */
509#define PIXC_BVCON 0xffc04448 /* Color space conversion matrix register. Contains the B/V conversion coefficients */
510#define PIXC_CCBIAS 0xffc0444c /* Bias values for the color space conversion matrix */
511#define PIXC_TC 0xffc04450 /* Holds the transparent color value */
512
513/* Handshake MDMA 0 Registers */
514
515#define HMDMA0_CONTROL 0xffc04500 /* Handshake MDMA0 Control Register */
516#define HMDMA0_ECINIT 0xffc04504 /* Handshake MDMA0 Initial Edge Count Register */
517#define HMDMA0_BCINIT 0xffc04508 /* Handshake MDMA0 Initial Block Count Register */
518#define HMDMA0_ECURGENT 0xffc0450c /* Handshake MDMA0 Urgent Edge Count Threshhold Register */
519#define HMDMA0_ECOVERFLOW 0xffc04510 /* Handshake MDMA0 Edge Count Overflow Interrupt Register */
520#define HMDMA0_ECOUNT 0xffc04514 /* Handshake MDMA0 Current Edge Count Register */
521#define HMDMA0_BCOUNT 0xffc04518 /* Handshake MDMA0 Current Block Count Register */
522
523/* Handshake MDMA 1 Registers */
524
525#define HMDMA1_CONTROL 0xffc04540 /* Handshake MDMA1 Control Register */
526#define HMDMA1_ECINIT 0xffc04544 /* Handshake MDMA1 Initial Edge Count Register */
527#define HMDMA1_BCINIT 0xffc04548 /* Handshake MDMA1 Initial Block Count Register */
528#define HMDMA1_ECURGENT 0xffc0454c /* Handshake MDMA1 Urgent Edge Count Threshhold Register */
529#define HMDMA1_ECOVERFLOW 0xffc04550 /* Handshake MDMA1 Edge Count Overflow Interrupt Register */
530#define HMDMA1_ECOUNT 0xffc04554 /* Handshake MDMA1 Current Edge Count Register */
531#define HMDMA1_BCOUNT 0xffc04558 /* Handshake MDMA1 Current Block Count Register */
532
533
534/* ********************************************************** */
535/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
536/* and MULTI BIT READ MACROS */
537/* ********************************************************** */
538
539/* Bit masks for PIXC_CTL */
540
541#define PIXC_EN 0x1 /* Pixel Compositor Enable */
542#define OVR_A_EN 0x2 /* Overlay A Enable */
543#define OVR_B_EN 0x4 /* Overlay B Enable */
544#define IMG_FORM 0x8 /* Image Data Format */
545#define OVR_FORM 0x10 /* Overlay Data Format */
546#define OUT_FORM 0x20 /* Output Data Format */
547#define UDS_MOD 0x40 /* Resampling Mode */
548#define TC_EN 0x80 /* Transparent Color Enable */
549#define IMG_STAT 0x300 /* Image FIFO Status */
550#define OVR_STAT 0xc00 /* Overlay FIFO Status */
551#define WM_LVL 0x3000 /* FIFO Watermark Level */
552
553/* Bit masks for PIXC_AHSTART */
554
555#define A_HSTART 0xfff /* Horizontal Start Coordinates */
556
557/* Bit masks for PIXC_AHEND */
558
559#define A_HEND 0xfff /* Horizontal End Coordinates */
560
561/* Bit masks for PIXC_AVSTART */
562
563#define A_VSTART 0x3ff /* Vertical Start Coordinates */
564
565/* Bit masks for PIXC_AVEND */
566
567#define A_VEND 0x3ff /* Vertical End Coordinates */
568
569/* Bit masks for PIXC_ATRANSP */
570
571#define A_TRANSP 0xf /* Transparency Value */
572
573/* Bit masks for PIXC_BHSTART */
574
575#define B_HSTART 0xfff /* Horizontal Start Coordinates */
576
577/* Bit masks for PIXC_BHEND */
578
579#define B_HEND 0xfff /* Horizontal End Coordinates */
580
581/* Bit masks for PIXC_BVSTART */
582
583#define B_VSTART 0x3ff /* Vertical Start Coordinates */
584
585/* Bit masks for PIXC_BVEND */
586
587#define B_VEND 0x3ff /* Vertical End Coordinates */
588
589/* Bit masks for PIXC_BTRANSP */
590
591#define B_TRANSP 0xf /* Transparency Value */
592
593/* Bit masks for PIXC_INTRSTAT */
594
595#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
596#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
597#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
598#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
599
600/* Bit masks for PIXC_RYCON */
601
602#define A11 0x3ff /* A11 in the Coefficient Matrix */
603#define A12 0xffc00 /* A12 in the Coefficient Matrix */
604#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
605#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
606
607/* Bit masks for PIXC_GUCON */
608
609#define A21 0x3ff /* A21 in the Coefficient Matrix */
610#define A22 0xffc00 /* A22 in the Coefficient Matrix */
611#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
612#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
613
614/* Bit masks for PIXC_BVCON */
615
616#define A31 0x3ff /* A31 in the Coefficient Matrix */
617#define A32 0xffc00 /* A32 in the Coefficient Matrix */
618#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
619#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
620
621/* Bit masks for PIXC_CCBIAS */
622
623#define A14 0x3ff /* A14 in the Bias Vector */
624#define A24 0xffc00 /* A24 in the Bias Vector */
625#define A34 0x3ff00000 /* A34 in the Bias Vector */
626
627/* Bit masks for PIXC_TC */
628
629#define RY_TRANS 0xff /* Transparent Color - R/Y Component */
630#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
631#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
632
633/* Bit masks for HOST_CONTROL */
634
635#define HOST_EN 0x1 /* Host Enable */
636#define HOST_END 0x2 /* Host Endianess */
637#define DATA_SIZE 0x4 /* Data Size */
638#define HOST_RST 0x8 /* Host Reset */
639#define HRDY_OVR 0x20 /* Host Ready Override */
640#define INT_MODE 0x40 /* Interrupt Mode */
641#define BT_EN 0x80 /* Bus Timeout Enable */
642#define EHW 0x100 /* Enable Host Write */
643#define EHR 0x200 /* Enable Host Read */
644#define BDR 0x400 /* Burst DMA Requests */
645
646/* Bit masks for HOST_STATUS */
647
648#define DMA_READY 0x1 /* DMA Ready */
649#define FIFOFULL 0x2 /* FIFO Full */
650#define FIFOEMPTY 0x4 /* FIFO Empty */
651#define COMPLETE 0x8 /* DMA Complete */
652#define HSHK 0x10 /* Host Handshake */
653#define TIMEOUT 0x20 /* Host Timeout */
654#define HIRQ 0x40 /* Host Interrupt Request */
655#define ALLOW_CNFG 0x80 /* Allow New Configuration */
656#define DMA_DIR 0x100 /* DMA Direction */
657#define BTE 0x200 /* Bus Timeout Enabled */
658
659/* Bit masks for HOST_TIMEOUT */
660
661#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
662
663/* Bit masks for TIMER_ENABLE1 */
664
665#define TIMEN8 0x1 /* Timer 8 Enable */
666#define TIMEN9 0x2 /* Timer 9 Enable */
667#define TIMEN10 0x4 /* Timer 10 Enable */
668
669/* Bit masks for TIMER_DISABLE1 */
670
671#define TIMDIS8 0x1 /* Timer 8 Disable */
672#define TIMDIS9 0x2 /* Timer 9 Disable */
673#define TIMDIS10 0x4 /* Timer 10 Disable */
674
675/* Bit masks for TIMER_STATUS1 */
676
677#define TIMIL8 0x1 /* Timer 8 Interrupt */
678#define TIMIL9 0x2 /* Timer 9 Interrupt */
679#define TIMIL10 0x4 /* Timer 10 Interrupt */
680#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
681#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
682#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
683#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
684#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
685#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
686
687/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
688
689/* Bit masks for HMDMAx_CONTROL */
690
691#define HMDMAEN 0x1 /* Handshake MDMA Enable */
692#define REP 0x2 /* Handshake MDMA Request Polarity */
693#define UTE 0x8 /* Urgency Threshold Enable */
694#define OIE 0x10 /* Overflow Interrupt Enable */
695#define BDIE 0x20 /* Block Done Interrupt Enable */
696#define MBDI 0x40 /* Mask Block Done Interrupt */
697#define DRQ 0x300 /* Handshake MDMA Request Type */
698#define RBC 0x1000 /* Force Reload of BCOUNT */
699#define PS 0x2000 /* Pin Status */
700#define OI 0x4000 /* Overflow Interrupt Generated */
701#define BDI 0x8000 /* Block Done Interrupt Generated */
702
703/* ******************************************* */
704/* MULTI BIT MACRO ENUMERATIONS */
705/* ******************************************* */
706
707#endif /* _DEF_BF544_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF547.h b/include/asm-blackfin/mach-bf548/defBF547.h
deleted file mode 100644
index 3a3a18ebb10e..000000000000
--- a/include/asm-blackfin/mach-bf548/defBF547.h
+++ /dev/null
@@ -1,1244 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/defBF547.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_BF548_H
32#define _DEF_BF548_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF548 */
38
39/* Include defBF54x_base.h for the set of #defines that are common to all ADSP-BF54x processors */
40#include "defBF54x_base.h"
41
42/* The following are the #defines needed by ADSP-BF548 that are not in the common header */
43
44/* Timer Registers */
45
46#define TIMER8_CONFIG 0xffc00600 /* Timer 8 Configuration Register */
47#define TIMER8_COUNTER 0xffc00604 /* Timer 8 Counter Register */
48#define TIMER8_PERIOD 0xffc00608 /* Timer 8 Period Register */
49#define TIMER8_WIDTH 0xffc0060c /* Timer 8 Width Register */
50#define TIMER9_CONFIG 0xffc00610 /* Timer 9 Configuration Register */
51#define TIMER9_COUNTER 0xffc00614 /* Timer 9 Counter Register */
52#define TIMER9_PERIOD 0xffc00618 /* Timer 9 Period Register */
53#define TIMER9_WIDTH 0xffc0061c /* Timer 9 Width Register */
54#define TIMER10_CONFIG 0xffc00620 /* Timer 10 Configuration Register */
55#define TIMER10_COUNTER 0xffc00624 /* Timer 10 Counter Register */
56#define TIMER10_PERIOD 0xffc00628 /* Timer 10 Period Register */
57#define TIMER10_WIDTH 0xffc0062c /* Timer 10 Width Register */
58
59/* Timer Group of 3 Registers */
60
61#define TIMER_ENABLE1 0xffc00640 /* Timer Group of 3 Enable Register */
62#define TIMER_DISABLE1 0xffc00644 /* Timer Group of 3 Disable Register */
63#define TIMER_STATUS1 0xffc00648 /* Timer Group of 3 Status Register */
64
65/* SPORT0 Registers */
66
67#define SPORT0_TCR1 0xffc00800 /* SPORT0 Transmit Configuration 1 Register */
68#define SPORT0_TCR2 0xffc00804 /* SPORT0 Transmit Configuration 2 Register */
69#define SPORT0_TCLKDIV 0xffc00808 /* SPORT0 Transmit Serial Clock Divider Register */
70#define SPORT0_TFSDIV 0xffc0080c /* SPORT0 Transmit Frame Sync Divider Register */
71#define SPORT0_TX 0xffc00810 /* SPORT0 Transmit Data Register */
72#define SPORT0_RX 0xffc00818 /* SPORT0 Receive Data Register */
73#define SPORT0_RCR1 0xffc00820 /* SPORT0 Receive Configuration 1 Register */
74#define SPORT0_RCR2 0xffc00824 /* SPORT0 Receive Configuration 2 Register */
75#define SPORT0_RCLKDIV 0xffc00828 /* SPORT0 Receive Serial Clock Divider Register */
76#define SPORT0_RFSDIV 0xffc0082c /* SPORT0 Receive Frame Sync Divider Register */
77#define SPORT0_STAT 0xffc00830 /* SPORT0 Status Register */
78#define SPORT0_CHNL 0xffc00834 /* SPORT0 Current Channel Register */
79#define SPORT0_MCMC1 0xffc00838 /* SPORT0 Multi channel Configuration Register 1 */
80#define SPORT0_MCMC2 0xffc0083c /* SPORT0 Multi channel Configuration Register 2 */
81#define SPORT0_MTCS0 0xffc00840 /* SPORT0 Multi channel Transmit Select Register 0 */
82#define SPORT0_MTCS1 0xffc00844 /* SPORT0 Multi channel Transmit Select Register 1 */
83#define SPORT0_MTCS2 0xffc00848 /* SPORT0 Multi channel Transmit Select Register 2 */
84#define SPORT0_MTCS3 0xffc0084c /* SPORT0 Multi channel Transmit Select Register 3 */
85#define SPORT0_MRCS0 0xffc00850 /* SPORT0 Multi channel Receive Select Register 0 */
86#define SPORT0_MRCS1 0xffc00854 /* SPORT0 Multi channel Receive Select Register 1 */
87#define SPORT0_MRCS2 0xffc00858 /* SPORT0 Multi channel Receive Select Register 2 */
88#define SPORT0_MRCS3 0xffc0085c /* SPORT0 Multi channel Receive Select Register 3 */
89
90/* EPPI0 Registers */
91
92#define EPPI0_STATUS 0xffc01000 /* EPPI0 Status Register */
93#define EPPI0_HCOUNT 0xffc01004 /* EPPI0 Horizontal Transfer Count Register */
94#define EPPI0_HDELAY 0xffc01008 /* EPPI0 Horizontal Delay Count Register */
95#define EPPI0_VCOUNT 0xffc0100c /* EPPI0 Vertical Transfer Count Register */
96#define EPPI0_VDELAY 0xffc01010 /* EPPI0 Vertical Delay Count Register */
97#define EPPI0_FRAME 0xffc01014 /* EPPI0 Lines per Frame Register */
98#define EPPI0_LINE 0xffc01018 /* EPPI0 Samples per Line Register */
99#define EPPI0_CLKDIV 0xffc0101c /* EPPI0 Clock Divide Register */
100#define EPPI0_CONTROL 0xffc01020 /* EPPI0 Control Register */
101#define EPPI0_FS1W_HBL 0xffc01024 /* EPPI0 FS1 Width Register / EPPI0 Horizontal Blanking Samples Per Line Register */
102#define EPPI0_FS1P_AVPL 0xffc01028 /* EPPI0 FS1 Period Register / EPPI0 Active Video Samples Per Line Register */
103#define EPPI0_FS2W_LVB 0xffc0102c /* EPPI0 FS2 Width Register / EPPI0 Lines of Vertical Blanking Register */
104#define EPPI0_FS2P_LAVF 0xffc01030 /* EPPI0 FS2 Period Register/ EPPI0 Lines of Active Video Per Field Register */
105#define EPPI0_CLIP 0xffc01034 /* EPPI0 Clipping Register */
106
107/* UART2 Registers */
108
109#define UART2_DLL 0xffc02100 /* Divisor Latch Low Byte */
110#define UART2_DLH 0xffc02104 /* Divisor Latch High Byte */
111#define UART2_GCTL 0xffc02108 /* Global Control Register */
112#define UART2_LCR 0xffc0210c /* Line Control Register */
113#define UART2_MCR 0xffc02110 /* Modem Control Register */
114#define UART2_LSR 0xffc02114 /* Line Status Register */
115#define UART2_MSR 0xffc02118 /* Modem Status Register */
116#define UART2_SCR 0xffc0211c /* Scratch Register */
117#define UART2_IER_SET 0xffc02120 /* Interrupt Enable Register Set */
118#define UART2_IER_CLEAR 0xffc02124 /* Interrupt Enable Register Clear */
119#define UART2_RBR 0xffc0212c /* Receive Buffer Register */
120
121/* Two Wire Interface Registers (TWI1) */
122
123#define TWI1_REGBASE 0xffc02200
124#define TWI1_CLKDIV 0xffc02200 /* Clock Divider Register */
125#define TWI1_CONTROL 0xffc02204 /* TWI Control Register */
126#define TWI1_SLAVE_CTRL 0xffc02208 /* TWI Slave Mode Control Register */
127#define TWI1_SLAVE_STAT 0xffc0220c /* TWI Slave Mode Status Register */
128#define TWI1_SLAVE_ADDR 0xffc02210 /* TWI Slave Mode Address Register */
129#define TWI1_MASTER_CTRL 0xffc02214 /* TWI Master Mode Control Register */
130#define TWI1_MASTER_STAT 0xffc02218 /* TWI Master Mode Status Register */
131#define TWI1_MASTER_ADDR 0xffc0221c /* TWI Master Mode Address Register */
132#define TWI1_INT_STAT 0xffc02220 /* TWI Interrupt Status Register */
133#define TWI1_INT_MASK 0xffc02224 /* TWI Interrupt Mask Register */
134#define TWI1_FIFO_CTRL 0xffc02228 /* TWI FIFO Control Register */
135#define TWI1_FIFO_STAT 0xffc0222c /* TWI FIFO Status Register */
136#define TWI1_XMT_DATA8 0xffc02280 /* TWI FIFO Transmit Data Single Byte Register */
137#define TWI1_XMT_DATA16 0xffc02284 /* TWI FIFO Transmit Data Double Byte Register */
138#define TWI1_RCV_DATA8 0xffc02288 /* TWI FIFO Receive Data Single Byte Register */
139#define TWI1_RCV_DATA16 0xffc0228c /* TWI FIFO Receive Data Double Byte Register */
140
141/* SPI2 Registers */
142
143#define SPI2_REGBASE 0xffc02400
144#define SPI2_CTL 0xffc02400 /* SPI2 Control Register */
145#define SPI2_FLG 0xffc02404 /* SPI2 Flag Register */
146#define SPI2_STAT 0xffc02408 /* SPI2 Status Register */
147#define SPI2_TDBR 0xffc0240c /* SPI2 Transmit Data Buffer Register */
148#define SPI2_RDBR 0xffc02410 /* SPI2 Receive Data Buffer Register */
149#define SPI2_BAUD 0xffc02414 /* SPI2 Baud Rate Register */
150#define SPI2_SHADOW 0xffc02418 /* SPI2 Receive Data Buffer Shadow Register */
151
152/* ATAPI Registers */
153
154#define ATAPI_CONTROL 0xffc03800 /* ATAPI Control Register */
155#define ATAPI_STATUS 0xffc03804 /* ATAPI Status Register */
156#define ATAPI_DEV_ADDR 0xffc03808 /* ATAPI Device Register Address */
157#define ATAPI_DEV_TXBUF 0xffc0380c /* ATAPI Device Register Write Data */
158#define ATAPI_DEV_RXBUF 0xffc03810 /* ATAPI Device Register Read Data */
159#define ATAPI_INT_MASK 0xffc03814 /* ATAPI Interrupt Mask Register */
160#define ATAPI_INT_STATUS 0xffc03818 /* ATAPI Interrupt Status Register */
161#define ATAPI_XFER_LEN 0xffc0381c /* ATAPI Length of Transfer */
162#define ATAPI_LINE_STATUS 0xffc03820 /* ATAPI Line Status */
163#define ATAPI_SM_STATE 0xffc03824 /* ATAPI State Machine Status */
164#define ATAPI_TERMINATE 0xffc03828 /* ATAPI Host Terminate */
165#define ATAPI_PIO_TFRCNT 0xffc0382c /* ATAPI PIO mode transfer count */
166#define ATAPI_DMA_TFRCNT 0xffc03830 /* ATAPI DMA mode transfer count */
167#define ATAPI_UMAIN_TFRCNT 0xffc03834 /* ATAPI UDMAIN transfer count */
168#define ATAPI_UDMAOUT_TFRCNT 0xffc03838 /* ATAPI UDMAOUT transfer count */
169#define ATAPI_REG_TIM_0 0xffc03840 /* ATAPI Register Transfer Timing 0 */
170#define ATAPI_PIO_TIM_0 0xffc03844 /* ATAPI PIO Timing 0 Register */
171#define ATAPI_PIO_TIM_1 0xffc03848 /* ATAPI PIO Timing 1 Register */
172#define ATAPI_MULTI_TIM_0 0xffc03850 /* ATAPI Multi-DMA Timing 0 Register */
173#define ATAPI_MULTI_TIM_1 0xffc03854 /* ATAPI Multi-DMA Timing 1 Register */
174#define ATAPI_MULTI_TIM_2 0xffc03858 /* ATAPI Multi-DMA Timing 2 Register */
175#define ATAPI_ULTRA_TIM_0 0xffc03860 /* ATAPI Ultra-DMA Timing 0 Register */
176#define ATAPI_ULTRA_TIM_1 0xffc03864 /* ATAPI Ultra-DMA Timing 1 Register */
177#define ATAPI_ULTRA_TIM_2 0xffc03868 /* ATAPI Ultra-DMA Timing 2 Register */
178#define ATAPI_ULTRA_TIM_3 0xffc0386c /* ATAPI Ultra-DMA Timing 3 Register */
179
180/* SDH Registers */
181
182#define SDH_PWR_CTL 0xffc03900 /* SDH Power Control */
183#define SDH_CLK_CTL 0xffc03904 /* SDH Clock Control */
184#define SDH_ARGUMENT 0xffc03908 /* SDH Argument */
185#define SDH_COMMAND 0xffc0390c /* SDH Command */
186#define SDH_RESP_CMD 0xffc03910 /* SDH Response Command */
187#define SDH_RESPONSE0 0xffc03914 /* SDH Response0 */
188#define SDH_RESPONSE1 0xffc03918 /* SDH Response1 */
189#define SDH_RESPONSE2 0xffc0391c /* SDH Response2 */
190#define SDH_RESPONSE3 0xffc03920 /* SDH Response3 */
191#define SDH_DATA_TIMER 0xffc03924 /* SDH Data Timer */
192#define SDH_DATA_LGTH 0xffc03928 /* SDH Data Length */
193#define SDH_DATA_CTL 0xffc0392c /* SDH Data Control */
194#define SDH_DATA_CNT 0xffc03930 /* SDH Data Counter */
195#define SDH_STATUS 0xffc03934 /* SDH Status */
196#define SDH_STATUS_CLR 0xffc03938 /* SDH Status Clear */
197#define SDH_MASK0 0xffc0393c /* SDH Interrupt0 Mask */
198#define SDH_MASK1 0xffc03940 /* SDH Interrupt1 Mask */
199#define SDH_FIFO_CNT 0xffc03948 /* SDH FIFO Counter */
200#define SDH_FIFO 0xffc03980 /* SDH Data FIFO */
201#define SDH_E_STATUS 0xffc039c0 /* SDH Exception Status */
202#define SDH_E_MASK 0xffc039c4 /* SDH Exception Mask */
203#define SDH_CFG 0xffc039c8 /* SDH Configuration */
204#define SDH_RD_WAIT_EN 0xffc039cc /* SDH Read Wait Enable */
205#define SDH_PID0 0xffc039d0 /* SDH Peripheral Identification0 */
206#define SDH_PID1 0xffc039d4 /* SDH Peripheral Identification1 */
207#define SDH_PID2 0xffc039d8 /* SDH Peripheral Identification2 */
208#define SDH_PID3 0xffc039dc /* SDH Peripheral Identification3 */
209#define SDH_PID4 0xffc039e0 /* SDH Peripheral Identification4 */
210#define SDH_PID5 0xffc039e4 /* SDH Peripheral Identification5 */
211#define SDH_PID6 0xffc039e8 /* SDH Peripheral Identification6 */
212#define SDH_PID7 0xffc039ec /* SDH Peripheral Identification7 */
213
214/* HOST Port Registers */
215
216#define HOST_CONTROL 0xffc03a00 /* HOST Control Register */
217#define HOST_STATUS 0xffc03a04 /* HOST Status Register */
218#define HOST_TIMEOUT 0xffc03a08 /* HOST Acknowledge Mode Timeout Register */
219
220/* USB Control Registers */
221
222#define USB_FADDR 0xffc03c00 /* Function address register */
223#define USB_POWER 0xffc03c04 /* Power management register */
224#define USB_INTRTX 0xffc03c08 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
225#define USB_INTRRX 0xffc03c0c /* Interrupt register for Rx endpoints 1 to 7 */
226#define USB_INTRTXE 0xffc03c10 /* Interrupt enable register for IntrTx */
227#define USB_INTRRXE 0xffc03c14 /* Interrupt enable register for IntrRx */
228#define USB_INTRUSB 0xffc03c18 /* Interrupt register for common USB interrupts */
229#define USB_INTRUSBE 0xffc03c1c /* Interrupt enable register for IntrUSB */
230#define USB_FRAME 0xffc03c20 /* USB frame number */
231#define USB_INDEX 0xffc03c24 /* Index register for selecting the indexed endpoint registers */
232#define USB_TESTMODE 0xffc03c28 /* Enabled USB 20 test modes */
233#define USB_GLOBINTR 0xffc03c2c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
234#define USB_GLOBAL_CTL 0xffc03c30 /* Global Clock Control for the core */
235
236/* USB Packet Control Registers */
237
238#define USB_TX_MAX_PACKET 0xffc03c40 /* Maximum packet size for Host Tx endpoint */
239#define USB_CSR0 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
240#define USB_TXCSR 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
241#define USB_RX_MAX_PACKET 0xffc03c48 /* Maximum packet size for Host Rx endpoint */
242#define USB_RXCSR 0xffc03c4c /* Control Status register for Host Rx endpoint */
243#define USB_COUNT0 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
244#define USB_RXCOUNT 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
245#define USB_TXTYPE 0xffc03c54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
246#define USB_NAKLIMIT0 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
247#define USB_TXINTERVAL 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
248#define USB_RXTYPE 0xffc03c5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
249#define USB_RXINTERVAL 0xffc03c60 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
250#define USB_TXCOUNT 0xffc03c68 /* Number of bytes to be written to the selected endpoint Tx FIFO */
251
252/* USB Endpoint FIFO Registers */
253
254#define USB_EP0_FIFO 0xffc03c80 /* Endpoint 0 FIFO */
255#define USB_EP1_FIFO 0xffc03c88 /* Endpoint 1 FIFO */
256#define USB_EP2_FIFO 0xffc03c90 /* Endpoint 2 FIFO */
257#define USB_EP3_FIFO 0xffc03c98 /* Endpoint 3 FIFO */
258#define USB_EP4_FIFO 0xffc03ca0 /* Endpoint 4 FIFO */
259#define USB_EP5_FIFO 0xffc03ca8 /* Endpoint 5 FIFO */
260#define USB_EP6_FIFO 0xffc03cb0 /* Endpoint 6 FIFO */
261#define USB_EP7_FIFO 0xffc03cb8 /* Endpoint 7 FIFO */
262
263/* USB OTG Control Registers */
264
265#define USB_OTG_DEV_CTL 0xffc03d00 /* OTG Device Control Register */
266#define USB_OTG_VBUS_IRQ 0xffc03d04 /* OTG VBUS Control Interrupts */
267#define USB_OTG_VBUS_MASK 0xffc03d08 /* VBUS Control Interrupt Enable */
268
269/* USB Phy Control Registers */
270
271#define USB_LINKINFO 0xffc03d48 /* Enables programming of some PHY-side delays */
272#define USB_VPLEN 0xffc03d4c /* Determines duration of VBUS pulse for VBUS charging */
273#define USB_HS_EOF1 0xffc03d50 /* Time buffer for High-Speed transactions */
274#define USB_FS_EOF1 0xffc03d54 /* Time buffer for Full-Speed transactions */
275#define USB_LS_EOF1 0xffc03d58 /* Time buffer for Low-Speed transactions */
276
277/* (APHY_CNTRL is for ADI usage only) */
278
279#define USB_APHY_CNTRL 0xffc03de0 /* Register that increases visibility of Analog PHY */
280
281/* (APHY_CALIB is for ADI usage only) */
282
283#define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */
284#define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
285
286/* (PHY_TEST is for ADI usage only) */
287
288#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */
289#define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */
290#define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
291
292/* USB Endpoint 0 Control Registers */
293
294#define USB_EP_NI0_TXMAXP 0xffc03e00 /* Maximum packet size for Host Tx endpoint0 */
295#define USB_EP_NI0_TXCSR 0xffc03e04 /* Control Status register for endpoint 0 */
296#define USB_EP_NI0_RXMAXP 0xffc03e08 /* Maximum packet size for Host Rx endpoint0 */
297#define USB_EP_NI0_RXCSR 0xffc03e0c /* Control Status register for Host Rx endpoint0 */
298#define USB_EP_NI0_RXCOUNT 0xffc03e10 /* Number of bytes received in endpoint 0 FIFO */
299#define USB_EP_NI0_TXTYPE 0xffc03e14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
300#define USB_EP_NI0_TXINTERVAL 0xffc03e18 /* Sets the NAK response timeout on Endpoint 0 */
301#define USB_EP_NI0_RXTYPE 0xffc03e1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
302#define USB_EP_NI0_RXINTERVAL 0xffc03e20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint0 */
303
304/* USB Endpoint 1 Control Registers */
305
306#define USB_EP_NI0_TXCOUNT 0xffc03e28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
307#define USB_EP_NI1_TXMAXP 0xffc03e40 /* Maximum packet size for Host Tx endpoint1 */
308#define USB_EP_NI1_TXCSR 0xffc03e44 /* Control Status register for endpoint1 */
309#define USB_EP_NI1_RXMAXP 0xffc03e48 /* Maximum packet size for Host Rx endpoint1 */
310#define USB_EP_NI1_RXCSR 0xffc03e4c /* Control Status register for Host Rx endpoint1 */
311#define USB_EP_NI1_RXCOUNT 0xffc03e50 /* Number of bytes received in endpoint1 FIFO */
312#define USB_EP_NI1_TXTYPE 0xffc03e54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
313#define USB_EP_NI1_TXINTERVAL 0xffc03e58 /* Sets the NAK response timeout on Endpoint1 */
314#define USB_EP_NI1_RXTYPE 0xffc03e5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
315#define USB_EP_NI1_RXINTERVAL 0xffc03e60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint1 */
316
317/* USB Endpoint 2 Control Registers */
318
319#define USB_EP_NI1_TXCOUNT 0xffc03e68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
320#define USB_EP_NI2_TXMAXP 0xffc03e80 /* Maximum packet size for Host Tx endpoint2 */
321#define USB_EP_NI2_TXCSR 0xffc03e84 /* Control Status register for endpoint2 */
322#define USB_EP_NI2_RXMAXP 0xffc03e88 /* Maximum packet size for Host Rx endpoint2 */
323#define USB_EP_NI2_RXCSR 0xffc03e8c /* Control Status register for Host Rx endpoint2 */
324#define USB_EP_NI2_RXCOUNT 0xffc03e90 /* Number of bytes received in endpoint2 FIFO */
325#define USB_EP_NI2_TXTYPE 0xffc03e94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
326#define USB_EP_NI2_TXINTERVAL 0xffc03e98 /* Sets the NAK response timeout on Endpoint2 */
327#define USB_EP_NI2_RXTYPE 0xffc03e9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
328#define USB_EP_NI2_RXINTERVAL 0xffc03ea0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint2 */
329
330/* USB Endpoint 3 Control Registers */
331
332#define USB_EP_NI2_TXCOUNT 0xffc03ea8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
333#define USB_EP_NI3_TXMAXP 0xffc03ec0 /* Maximum packet size for Host Tx endpoint3 */
334#define USB_EP_NI3_TXCSR 0xffc03ec4 /* Control Status register for endpoint3 */
335#define USB_EP_NI3_RXMAXP 0xffc03ec8 /* Maximum packet size for Host Rx endpoint3 */
336#define USB_EP_NI3_RXCSR 0xffc03ecc /* Control Status register for Host Rx endpoint3 */
337#define USB_EP_NI3_RXCOUNT 0xffc03ed0 /* Number of bytes received in endpoint3 FIFO */
338#define USB_EP_NI3_TXTYPE 0xffc03ed4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
339#define USB_EP_NI3_TXINTERVAL 0xffc03ed8 /* Sets the NAK response timeout on Endpoint3 */
340#define USB_EP_NI3_RXTYPE 0xffc03edc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
341#define USB_EP_NI3_RXINTERVAL 0xffc03ee0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint3 */
342
343/* USB Endpoint 4 Control Registers */
344
345#define USB_EP_NI3_TXCOUNT 0xffc03ee8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
346#define USB_EP_NI4_TXMAXP 0xffc03f00 /* Maximum packet size for Host Tx endpoint4 */
347#define USB_EP_NI4_TXCSR 0xffc03f04 /* Control Status register for endpoint4 */
348#define USB_EP_NI4_RXMAXP 0xffc03f08 /* Maximum packet size for Host Rx endpoint4 */
349#define USB_EP_NI4_RXCSR 0xffc03f0c /* Control Status register for Host Rx endpoint4 */
350#define USB_EP_NI4_RXCOUNT 0xffc03f10 /* Number of bytes received in endpoint4 FIFO */
351#define USB_EP_NI4_TXTYPE 0xffc03f14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
352#define USB_EP_NI4_TXINTERVAL 0xffc03f18 /* Sets the NAK response timeout on Endpoint4 */
353#define USB_EP_NI4_RXTYPE 0xffc03f1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
354#define USB_EP_NI4_RXINTERVAL 0xffc03f20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint4 */
355
356/* USB Endpoint 5 Control Registers */
357
358#define USB_EP_NI4_TXCOUNT 0xffc03f28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
359#define USB_EP_NI5_TXMAXP 0xffc03f40 /* Maximum packet size for Host Tx endpoint5 */
360#define USB_EP_NI5_TXCSR 0xffc03f44 /* Control Status register for endpoint5 */
361#define USB_EP_NI5_RXMAXP 0xffc03f48 /* Maximum packet size for Host Rx endpoint5 */
362#define USB_EP_NI5_RXCSR 0xffc03f4c /* Control Status register for Host Rx endpoint5 */
363#define USB_EP_NI5_RXCOUNT 0xffc03f50 /* Number of bytes received in endpoint5 FIFO */
364#define USB_EP_NI5_TXTYPE 0xffc03f54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
365#define USB_EP_NI5_TXINTERVAL 0xffc03f58 /* Sets the NAK response timeout on Endpoint5 */
366#define USB_EP_NI5_RXTYPE 0xffc03f5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
367#define USB_EP_NI5_RXINTERVAL 0xffc03f60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint5 */
368
369/* USB Endpoint 6 Control Registers */
370
371#define USB_EP_NI5_TXCOUNT 0xffc03f68 /* Number of bytes to be written to the H145endpoint5 Tx FIFO */
372#define USB_EP_NI6_TXMAXP 0xffc03f80 /* Maximum packet size for Host Tx endpoint6 */
373#define USB_EP_NI6_TXCSR 0xffc03f84 /* Control Status register for endpoint6 */
374#define USB_EP_NI6_RXMAXP 0xffc03f88 /* Maximum packet size for Host Rx endpoint6 */
375#define USB_EP_NI6_RXCSR 0xffc03f8c /* Control Status register for Host Rx endpoint6 */
376#define USB_EP_NI6_RXCOUNT 0xffc03f90 /* Number of bytes received in endpoint6 FIFO */
377#define USB_EP_NI6_TXTYPE 0xffc03f94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
378#define USB_EP_NI6_TXINTERVAL 0xffc03f98 /* Sets the NAK response timeout on Endpoint6 */
379#define USB_EP_NI6_RXTYPE 0xffc03f9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
380#define USB_EP_NI6_RXINTERVAL 0xffc03fa0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint6 */
381
382/* USB Endpoint 7 Control Registers */
383
384#define USB_EP_NI6_TXCOUNT 0xffc03fa8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
385#define USB_EP_NI7_TXMAXP 0xffc03fc0 /* Maximum packet size for Host Tx endpoint7 */
386#define USB_EP_NI7_TXCSR 0xffc03fc4 /* Control Status register for endpoint7 */
387#define USB_EP_NI7_RXMAXP 0xffc03fc8 /* Maximum packet size for Host Rx endpoint7 */
388#define USB_EP_NI7_RXCSR 0xffc03fcc /* Control Status register for Host Rx endpoint7 */
389#define USB_EP_NI7_RXCOUNT 0xffc03fd0 /* Number of bytes received in endpoint7 FIFO */
390#define USB_EP_NI7_TXTYPE 0xffc03fd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
391#define USB_EP_NI7_TXINTERVAL 0xffc03fd8 /* Sets the NAK response timeout on Endpoint7 */
392#define USB_EP_NI7_RXTYPE 0xffc03fdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
393#define USB_EP_NI7_RXINTERVAL 0xffc03ff0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint7 */
394#define USB_EP_NI7_TXCOUNT 0xffc03ff8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
395#define USB_DMA_INTERRUPT 0xffc04000 /* Indicates pending interrupts for the DMA channels */
396
397/* USB Channel 0 Config Registers */
398
399#define USB_DMA0CONTROL 0xffc04004 /* DMA master channel 0 configuration */
400#define USB_DMA0ADDRLOW 0xffc04008 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
401#define USB_DMA0ADDRHIGH 0xffc0400c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
402#define USB_DMA0COUNTLOW 0xffc04010 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
403#define USB_DMA0COUNTHIGH 0xffc04014 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
404
405/* USB Channel 1 Config Registers */
406
407#define USB_DMA1CONTROL 0xffc04024 /* DMA master channel 1 configuration */
408#define USB_DMA1ADDRLOW 0xffc04028 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
409#define USB_DMA1ADDRHIGH 0xffc0402c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
410#define USB_DMA1COUNTLOW 0xffc04030 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
411#define USB_DMA1COUNTHIGH 0xffc04034 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
412
413/* USB Channel 2 Config Registers */
414
415#define USB_DMA2CONTROL 0xffc04044 /* DMA master channel 2 configuration */
416#define USB_DMA2ADDRLOW 0xffc04048 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
417#define USB_DMA2ADDRHIGH 0xffc0404c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
418#define USB_DMA2COUNTLOW 0xffc04050 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
419#define USB_DMA2COUNTHIGH 0xffc04054 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
420
421/* USB Channel 3 Config Registers */
422
423#define USB_DMA3CONTROL 0xffc04064 /* DMA master channel 3 configuration */
424#define USB_DMA3ADDRLOW 0xffc04068 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
425#define USB_DMA3ADDRHIGH 0xffc0406c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
426#define USB_DMA3COUNTLOW 0xffc04070 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
427#define USB_DMA3COUNTHIGH 0xffc04074 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
428
429/* USB Channel 4 Config Registers */
430
431#define USB_DMA4CONTROL 0xffc04084 /* DMA master channel 4 configuration */
432#define USB_DMA4ADDRLOW 0xffc04088 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
433#define USB_DMA4ADDRHIGH 0xffc0408c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
434#define USB_DMA4COUNTLOW 0xffc04090 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
435#define USB_DMA4COUNTHIGH 0xffc04094 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
436
437/* USB Channel 5 Config Registers */
438
439#define USB_DMA5CONTROL 0xffc040a4 /* DMA master channel 5 configuration */
440#define USB_DMA5ADDRLOW 0xffc040a8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
441#define USB_DMA5ADDRHIGH 0xffc040ac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
442#define USB_DMA5COUNTLOW 0xffc040b0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
443#define USB_DMA5COUNTHIGH 0xffc040b4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
444
445/* USB Channel 6 Config Registers */
446
447#define USB_DMA6CONTROL 0xffc040c4 /* DMA master channel 6 configuration */
448#define USB_DMA6ADDRLOW 0xffc040c8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
449#define USB_DMA6ADDRHIGH 0xffc040cc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
450#define USB_DMA6COUNTLOW 0xffc040d0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
451#define USB_DMA6COUNTHIGH 0xffc040d4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
452
453/* USB Channel 7 Config Registers */
454
455#define USB_DMA7CONTROL 0xffc040e4 /* DMA master channel 7 configuration */
456#define USB_DMA7ADDRLOW 0xffc040e8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
457#define USB_DMA7ADDRHIGH 0xffc040ec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
458#define USB_DMA7COUNTLOW 0xffc040f0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
459#define USB_DMA7COUNTHIGH 0xffc040f4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
460
461/* Keypad Registers */
462
463#define KPAD_CTL 0xffc04100 /* Controls keypad module enable and disable */
464#define KPAD_PRESCALE 0xffc04104 /* Establish a time base for programing the KPAD_MSEL register */
465#define KPAD_MSEL 0xffc04108 /* Selects delay parameters for keypad interface sensitivity */
466#define KPAD_ROWCOL 0xffc0410c /* Captures the row and column output values of the keys pressed */
467#define KPAD_STAT 0xffc04110 /* Holds and clears the status of the keypad interface interrupt */
468#define KPAD_SOFTEVAL 0xffc04114 /* Lets software force keypad interface to check for keys being pressed */
469
470/* Pixel Compositor (PIXC) Registers */
471
472#define PIXC_CTL 0xffc04400 /* Overlay enable, resampling mode, I/O data format, transparency enable, watermark level, FIFO status */
473#define PIXC_PPL 0xffc04404 /* Holds the number of pixels per line of the display */
474#define PIXC_LPF 0xffc04408 /* Holds the number of lines per frame of the display */
475#define PIXC_AHSTART 0xffc0440c /* Contains horizontal start pixel information of the overlay data (set A) */
476#define PIXC_AHEND 0xffc04410 /* Contains horizontal end pixel information of the overlay data (set A) */
477#define PIXC_AVSTART 0xffc04414 /* Contains vertical start pixel information of the overlay data (set A) */
478#define PIXC_AVEND 0xffc04418 /* Contains vertical end pixel information of the overlay data (set A) */
479#define PIXC_ATRANSP 0xffc0441c /* Contains the transparency ratio (set A) */
480#define PIXC_BHSTART 0xffc04420 /* Contains horizontal start pixel information of the overlay data (set B) */
481#define PIXC_BHEND 0xffc04424 /* Contains horizontal end pixel information of the overlay data (set B) */
482#define PIXC_BVSTART 0xffc04428 /* Contains vertical start pixel information of the overlay data (set B) */
483#define PIXC_BVEND 0xffc0442c /* Contains vertical end pixel information of the overlay data (set B) */
484#define PIXC_BTRANSP 0xffc04430 /* Contains the transparency ratio (set B) */
485#define PIXC_INTRSTAT 0xffc0443c /* Overlay interrupt configuration/status */
486#define PIXC_RYCON 0xffc04440 /* Color space conversion matrix register. Contains the R/Y conversion coefficients */
487#define PIXC_GUCON 0xffc04444 /* Color space conversion matrix register. Contains the G/U conversion coefficients */
488#define PIXC_BVCON 0xffc04448 /* Color space conversion matrix register. Contains the B/V conversion coefficients */
489#define PIXC_CCBIAS 0xffc0444c /* Bias values for the color space conversion matrix */
490#define PIXC_TC 0xffc04450 /* Holds the transparent color value */
491
492/* Handshake MDMA 0 Registers */
493
494#define HMDMA0_CONTROL 0xffc04500 /* Handshake MDMA0 Control Register */
495#define HMDMA0_ECINIT 0xffc04504 /* Handshake MDMA0 Initial Edge Count Register */
496#define HMDMA0_BCINIT 0xffc04508 /* Handshake MDMA0 Initial Block Count Register */
497#define HMDMA0_ECURGENT 0xffc0450c /* Handshake MDMA0 Urgent Edge Count Threshhold Register */
498#define HMDMA0_ECOVERFLOW 0xffc04510 /* Handshake MDMA0 Edge Count Overflow Interrupt Register */
499#define HMDMA0_ECOUNT 0xffc04514 /* Handshake MDMA0 Current Edge Count Register */
500#define HMDMA0_BCOUNT 0xffc04518 /* Handshake MDMA0 Current Block Count Register */
501
502/* Handshake MDMA 1 Registers */
503
504#define HMDMA1_CONTROL 0xffc04540 /* Handshake MDMA1 Control Register */
505#define HMDMA1_ECINIT 0xffc04544 /* Handshake MDMA1 Initial Edge Count Register */
506#define HMDMA1_BCINIT 0xffc04548 /* Handshake MDMA1 Initial Block Count Register */
507#define HMDMA1_ECURGENT 0xffc0454c /* Handshake MDMA1 Urgent Edge Count Threshhold Register */
508#define HMDMA1_ECOVERFLOW 0xffc04550 /* Handshake MDMA1 Edge Count Overflow Interrupt Register */
509#define HMDMA1_ECOUNT 0xffc04554 /* Handshake MDMA1 Current Edge Count Register */
510#define HMDMA1_BCOUNT 0xffc04558 /* Handshake MDMA1 Current Block Count Register */
511
512
513/* ********************************************************** */
514/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
515/* and MULTI BIT READ MACROS */
516/* ********************************************************** */
517
518/* Bit masks for PIXC_CTL */
519
520#define PIXC_EN 0x1 /* Pixel Compositor Enable */
521#define OVR_A_EN 0x2 /* Overlay A Enable */
522#define OVR_B_EN 0x4 /* Overlay B Enable */
523#define IMG_FORM 0x8 /* Image Data Format */
524#define OVR_FORM 0x10 /* Overlay Data Format */
525#define OUT_FORM 0x20 /* Output Data Format */
526#define UDS_MOD 0x40 /* Resampling Mode */
527#define TC_EN 0x80 /* Transparent Color Enable */
528#define IMG_STAT 0x300 /* Image FIFO Status */
529#define OVR_STAT 0xc00 /* Overlay FIFO Status */
530#define WM_LVL 0x3000 /* FIFO Watermark Level */
531
532/* Bit masks for PIXC_AHSTART */
533
534#define A_HSTART 0xfff /* Horizontal Start Coordinates */
535
536/* Bit masks for PIXC_AHEND */
537
538#define A_HEND 0xfff /* Horizontal End Coordinates */
539
540/* Bit masks for PIXC_AVSTART */
541
542#define A_VSTART 0x3ff /* Vertical Start Coordinates */
543
544/* Bit masks for PIXC_AVEND */
545
546#define A_VEND 0x3ff /* Vertical End Coordinates */
547
548/* Bit masks for PIXC_ATRANSP */
549
550#define A_TRANSP 0xf /* Transparency Value */
551
552/* Bit masks for PIXC_BHSTART */
553
554#define B_HSTART 0xfff /* Horizontal Start Coordinates */
555
556/* Bit masks for PIXC_BHEND */
557
558#define B_HEND 0xfff /* Horizontal End Coordinates */
559
560/* Bit masks for PIXC_BVSTART */
561
562#define B_VSTART 0x3ff /* Vertical Start Coordinates */
563
564/* Bit masks for PIXC_BVEND */
565
566#define B_VEND 0x3ff /* Vertical End Coordinates */
567
568/* Bit masks for PIXC_BTRANSP */
569
570#define B_TRANSP 0xf /* Transparency Value */
571
572/* Bit masks for PIXC_INTRSTAT */
573
574#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
575#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
576#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
577#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
578
579/* Bit masks for PIXC_RYCON */
580
581#define A11 0x3ff /* A11 in the Coefficient Matrix */
582#define A12 0xffc00 /* A12 in the Coefficient Matrix */
583#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
584#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
585
586/* Bit masks for PIXC_GUCON */
587
588#define A21 0x3ff /* A21 in the Coefficient Matrix */
589#define A22 0xffc00 /* A22 in the Coefficient Matrix */
590#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
591#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
592
593/* Bit masks for PIXC_BVCON */
594
595#define A31 0x3ff /* A31 in the Coefficient Matrix */
596#define A32 0xffc00 /* A32 in the Coefficient Matrix */
597#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
598#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
599
600/* Bit masks for PIXC_CCBIAS */
601
602#define A14 0x3ff /* A14 in the Bias Vector */
603#define A24 0xffc00 /* A24 in the Bias Vector */
604#define A34 0x3ff00000 /* A34 in the Bias Vector */
605
606/* Bit masks for PIXC_TC */
607
608#define RY_TRANS 0xff /* Transparent Color - R/Y Component */
609#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
610#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
611
612/* Bit masks for HOST_CONTROL */
613
614#define HOST_EN 0x1 /* Host Enable */
615#define HOST_END 0x2 /* Host Endianess */
616#define DATA_SIZE 0x4 /* Data Size */
617#define HOST_RST 0x8 /* Host Reset */
618#define HRDY_OVR 0x20 /* Host Ready Override */
619#define INT_MODE 0x40 /* Interrupt Mode */
620#define BT_EN 0x80 /* Bus Timeout Enable */
621#define EHW 0x100 /* Enable Host Write */
622#define EHR 0x200 /* Enable Host Read */
623#define BDR 0x400 /* Burst DMA Requests */
624
625/* Bit masks for HOST_STATUS */
626
627#define DMA_READY 0x1 /* DMA Ready */
628#define FIFOFULL 0x2 /* FIFO Full */
629#define FIFOEMPTY 0x4 /* FIFO Empty */
630#define DMA_COMPLETE 0x8 /* DMA Complete */
631#define HSHK 0x10 /* Host Handshake */
632#define HSTIMEOUT 0x20 /* Host Timeout */
633#define HIRQ 0x40 /* Host Interrupt Request */
634#define ALLOW_CNFG 0x80 /* Allow New Configuration */
635#define DMA_DIR 0x100 /* DMA Direction */
636#define BTE 0x200 /* Bus Timeout Enabled */
637
638/* Bit masks for HOST_TIMEOUT */
639
640#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
641
642/* Bit masks for KPAD_CTL */
643
644#define KPAD_EN 0x1 /* Keypad Enable */
645#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
646#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
647#define KPAD_COLEN 0xe000 /* Column Enable Width */
648
649/* Bit masks for KPAD_PRESCALE */
650
651#define KPAD_PRESCALE_VAL 0x3f /* Key Prescale Value */
652
653/* Bit masks for KPAD_MSEL */
654
655#define DBON_SCALE 0xff /* Debounce Scale Value */
656#define COLDRV_SCALE 0xff00 /* Column Driver Scale Value */
657
658/* Bit masks for KPAD_ROWCOL */
659
660#define KPAD_ROW 0xff /* Rows Pressed */
661#define KPAD_COL 0xff00 /* Columns Pressed */
662
663/* Bit masks for KPAD_STAT */
664
665#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
666#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
667#define KPAD_PRESSED 0x8 /* Key press current status */
668
669/* Bit masks for KPAD_SOFTEVAL */
670
671#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
672
673/* Bit masks for SDH_COMMAND */
674
675#define CMD_IDX 0x3f /* Command Index */
676#define CMD_RSP 0x40 /* Response */
677#define CMD_L_RSP 0x80 /* Long Response */
678#define CMD_INT_E 0x100 /* Command Interrupt */
679#define CMD_PEND_E 0x200 /* Command Pending */
680#define CMD_E 0x400 /* Command Enable */
681
682/* Bit masks for SDH_PWR_CTL */
683
684#define PWR_ON 0x3 /* Power On */
685#if 0
686#define TBD 0x3c /* TBD */
687#endif
688#define SD_CMD_OD 0x40 /* Open Drain Output */
689#define ROD_CTL 0x80 /* Rod Control */
690
691/* Bit masks for SDH_CLK_CTL */
692
693#define CLKDIV 0xff /* MC_CLK Divisor */
694#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
695#define PWR_SV_E 0x200 /* Power Save Enable */
696#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
697#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
698
699/* Bit masks for SDH_RESP_CMD */
700
701#define RESP_CMD 0x3f /* Response Command */
702
703/* Bit masks for SDH_DATA_CTL */
704
705#define DTX_E 0x1 /* Data Transfer Enable */
706#define DTX_DIR 0x2 /* Data Transfer Direction */
707#define DTX_MODE 0x4 /* Data Transfer Mode */
708#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
709#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
710
711/* Bit masks for SDH_STATUS */
712
713#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
714#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
715#define CMD_TIME_OUT 0x4 /* CMD Time Out */
716#define DAT_TIME_OUT 0x8 /* Data Time Out */
717#define TX_UNDERRUN 0x10 /* Transmit Underrun */
718#define RX_OVERRUN 0x20 /* Receive Overrun */
719#define CMD_RESP_END 0x40 /* CMD Response End */
720#define CMD_SENT 0x80 /* CMD Sent */
721#define DAT_END 0x100 /* Data End */
722#define START_BIT_ERR 0x200 /* Start Bit Error */
723#define DAT_BLK_END 0x400 /* Data Block End */
724#define CMD_ACT 0x800 /* CMD Active */
725#define TX_ACT 0x1000 /* Transmit Active */
726#define RX_ACT 0x2000 /* Receive Active */
727#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
728#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
729#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
730#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
731#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
732#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
733#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
734#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
735
736/* Bit masks for SDH_STATUS_CLR */
737
738#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
739#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
740#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
741#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
742#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
743#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
744#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
745#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
746#define DAT_END_STAT 0x100 /* Data End Status */
747#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
748#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
749
750/* Bit masks for SDH_MASK0 */
751
752#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
753#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
754#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
755#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
756#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
757#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
758#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
759#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
760#define DAT_END_MASK 0x100 /* Data End Mask */
761#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
762#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
763#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
764#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
765#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
766#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
767#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
768#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
769#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
770#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
771#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
772#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
773#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
774
775/* Bit masks for SDH_FIFO_CNT */
776
777#define FIFO_COUNT 0x7fff /* FIFO Count */
778
779/* Bit masks for SDH_E_STATUS */
780
781#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
782#define SD_CARD_DET 0x10 /* SD Card Detect */
783
784/* Bit masks for SDH_E_MASK */
785
786#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
787#define SCD_MSK 0x40 /* Mask Card Detect */
788
789/* Bit masks for SDH_CFG */
790
791#define CLKS_EN 0x1 /* Clocks Enable */
792#define SD4E 0x4 /* SDIO 4-Bit Enable */
793#define MWE 0x8 /* Moving Window Enable */
794#define SD_RST 0x10 /* SDMMC Reset */
795#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
796#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
797#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
798
799/* Bit masks for SDH_RD_WAIT_EN */
800
801#define RWR 0x1 /* Read Wait Request */
802
803/* Bit masks for ATAPI_CONTROL */
804
805#define PIO_START 0x1 /* Start PIO/Reg Op */
806#define MULTI_START 0x2 /* Start Multi-DMA Op */
807#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
808#define XFER_DIR 0x8 /* Transfer Direction */
809#define IORDY_EN 0x10 /* IORDY Enable */
810#define FIFO_FLUSH 0x20 /* Flush FIFOs */
811#define SOFT_RST 0x40 /* Soft Reset */
812#define DEV_RST 0x80 /* Device Reset */
813#define TFRCNT_RST 0x100 /* Trans Count Reset */
814#define END_ON_TERM 0x200 /* End/Terminate Select */
815#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
816#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
817
818/* Bit masks for ATAPI_STATUS */
819
820#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
821#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
822#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
823#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
824
825/* Bit masks for ATAPI_DEV_ADDR */
826
827#define DEV_ADDR 0x1f /* Device Address */
828
829/* Bit masks for ATAPI_INT_MASK */
830
831#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
832#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
833#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
834#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
835#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
836#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
837#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
838#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
839#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
840
841/* Bit masks for ATAPI_INT_STATUS */
842
843#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
844#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
845#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
846#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
847#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
848#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
849#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
850#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
851#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
852
853/* Bit masks for ATAPI_LINE_STATUS */
854
855#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
856#define ATAPI_DASP 0x2 /* Device dasp to host line status */
857#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
858#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
859#define ATAPI_ADDR 0x70 /* ATAPI address line status */
860#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
861#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
862#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
863#define ATAPI_DIORN 0x400 /* ATAPI read line status */
864#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
865
866/* Bit masks for ATAPI_SM_STATE */
867
868#define PIO_CSTATE 0xf /* PIO mode state machine current state */
869#define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
870#define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
871#define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
872
873/* Bit masks for ATAPI_TERMINATE */
874
875#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
876
877/* Bit masks for ATAPI_REG_TIM_0 */
878
879#define T2_REG 0xff /* End of cycle time for register access transfers */
880#define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
881
882/* Bit masks for ATAPI_PIO_TIM_0 */
883
884#define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
885#define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
886#define T4_REG 0xf000 /* DIOW data hold */
887
888/* Bit masks for ATAPI_PIO_TIM_1 */
889
890#define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
891
892/* Bit masks for ATAPI_MULTI_TIM_0 */
893
894#define TD 0xff /* DIOR/DIOW asserted pulsewidth */
895#define TM 0xff00 /* Time from address valid to DIOR/DIOW */
896
897/* Bit masks for ATAPI_MULTI_TIM_1 */
898
899#define TKW 0xff /* Selects DIOW negated pulsewidth */
900#define TKR 0xff00 /* Selects DIOR negated pulsewidth */
901
902/* Bit masks for ATAPI_MULTI_TIM_2 */
903
904#define TH 0xff /* Selects DIOW data hold */
905#define TEOC 0xff00 /* Selects end of cycle for DMA */
906
907/* Bit masks for ATAPI_ULTRA_TIM_0 */
908
909#define TACK 0xff /* Selects setup and hold times for TACK */
910#define TENV 0xff00 /* Selects envelope time */
911
912/* Bit masks for ATAPI_ULTRA_TIM_1 */
913
914#define TDVS 0xff /* Selects data valid setup time */
915#define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
916
917/* Bit masks for ATAPI_ULTRA_TIM_2 */
918
919#define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
920#define TMLI 0xff00 /* Selects interlock time */
921
922/* Bit masks for ATAPI_ULTRA_TIM_3 */
923
924#define TZAH 0xff /* Selects minimum delay required for output */
925#define READY_PAUSE 0xff00 /* Selects ready to pause */
926
927/* Bit masks for TIMER_ENABLE1 */
928
929#define TIMEN8 0x1 /* Timer 8 Enable */
930#define TIMEN9 0x2 /* Timer 9 Enable */
931#define TIMEN10 0x4 /* Timer 10 Enable */
932
933/* Bit masks for TIMER_DISABLE1 */
934
935#define TIMDIS8 0x1 /* Timer 8 Disable */
936#define TIMDIS9 0x2 /* Timer 9 Disable */
937#define TIMDIS10 0x4 /* Timer 10 Disable */
938
939/* Bit masks for TIMER_STATUS1 */
940
941#define TIMIL8 0x1 /* Timer 8 Interrupt */
942#define TIMIL9 0x2 /* Timer 9 Interrupt */
943#define TIMIL10 0x4 /* Timer 10 Interrupt */
944#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
945#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
946#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
947#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
948#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
949#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
950
951/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
952
953/* Bit masks for USB_FADDR */
954
955#define FUNCTION_ADDRESS 0x7f /* Function address */
956
957/* Bit masks for USB_POWER */
958
959#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
960#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
961#define RESUME_MODE 0x4 /* DMA Mode */
962#define RESET 0x8 /* Reset indicator */
963#define HS_MODE 0x10 /* High Speed mode indicator */
964#define HS_ENABLE 0x20 /* high Speed Enable */
965#define SOFT_CONN 0x40 /* Soft connect */
966#define ISO_UPDATE 0x80 /* Isochronous update */
967
968/* Bit masks for USB_INTRTX */
969
970#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
971#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
972#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
973#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
974#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
975#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
976#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
977#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
978
979/* Bit masks for USB_INTRRX */
980
981#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
982#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
983#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
984#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
985#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
986#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
987#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
988
989/* Bit masks for USB_INTRTXE */
990
991#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
992#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
993#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
994#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
995#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
996#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
997#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
998#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
999
1000/* Bit masks for USB_INTRRXE */
1001
1002#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
1003#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
1004#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
1005#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
1006#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
1007#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
1008#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
1009
1010/* Bit masks for USB_INTRUSB */
1011
1012#define SUSPEND_B 0x1 /* Suspend indicator */
1013#define RESUME_B 0x2 /* Resume indicator */
1014#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
1015#define SOF_B 0x8 /* Start of frame */
1016#define CONN_B 0x10 /* Connection indicator */
1017#define DISCON_B 0x20 /* Disconnect indicator */
1018#define SESSION_REQ_B 0x40 /* Session Request */
1019#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
1020
1021/* Bit masks for USB_INTRUSBE */
1022
1023#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
1024#define RESUME_BE 0x2 /* Resume indicator int enable */
1025#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
1026#define SOF_BE 0x8 /* Start of frame int enable */
1027#define CONN_BE 0x10 /* Connection indicator int enable */
1028#define DISCON_BE 0x20 /* Disconnect indicator int enable */
1029#define SESSION_REQ_BE 0x40 /* Session Request int enable */
1030#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
1031
1032/* Bit masks for USB_FRAME */
1033
1034#define FRAME_NUMBER 0x7ff /* Frame number */
1035
1036/* Bit masks for USB_INDEX */
1037
1038#define SELECTED_ENDPOINT 0xf /* selected endpoint */
1039
1040/* Bit masks for USB_GLOBAL_CTL */
1041
1042#define GLOBAL_ENA 0x1 /* enables USB module */
1043#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
1044#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
1045#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
1046#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
1047#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
1048#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
1049#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
1050#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
1051#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
1052#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
1053#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
1054#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
1055#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
1056#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
1057
1058/* Bit masks for USB_OTG_DEV_CTL */
1059
1060#define SESSION 0x1 /* session indicator */
1061#define HOST_REQ 0x2 /* Host negotiation request */
1062#define HOST_MODE 0x4 /* indicates USBDRC is a host */
1063#define VBUS0 0x8 /* Vbus level indicator[0] */
1064#define VBUS1 0x10 /* Vbus level indicator[1] */
1065#define LSDEV 0x20 /* Low-speed indicator */
1066#define FSDEV 0x40 /* Full or High-speed indicator */
1067#define B_DEVICE 0x80 /* A' or 'B' device indicator */
1068
1069/* Bit masks for USB_OTG_VBUS_IRQ */
1070
1071#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
1072#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
1073#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
1074#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
1075#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
1076#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
1077
1078/* Bit masks for USB_OTG_VBUS_MASK */
1079
1080#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
1081#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
1082#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
1083#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
1084#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
1085#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
1086
1087/* Bit masks for USB_CSR0 */
1088
1089#define RXPKTRDY 0x1 /* data packet receive indicator */
1090#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
1091#define STALL_SENT 0x4 /* STALL handshake sent */
1092#define DATAEND 0x8 /* Data end indicator */
1093#define SETUPEND 0x10 /* Setup end */
1094#define SENDSTALL 0x20 /* Send STALL handshake */
1095#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
1096#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
1097#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
1098#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
1099#define SETUPPKT_H 0x8 /* send Setup token host mode */
1100#define ERROR_H 0x10 /* timeout error indicator host mode */
1101#define REQPKT_H 0x20 /* Request an IN transaction host mode */
1102#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
1103#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
1104
1105/* Bit masks for USB_COUNT0 */
1106
1107#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
1108
1109/* Bit masks for USB_NAKLIMIT0 */
1110
1111#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
1112
1113/* Bit masks for USB_TX_MAX_PACKET */
1114
1115#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
1116
1117/* Bit masks for USB_RX_MAX_PACKET */
1118
1119#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
1120
1121/* Bit masks for USB_TXCSR */
1122
1123#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
1124#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
1125#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
1126#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
1127#define STALL_SEND_T 0x10 /* issue a Stall handshake */
1128#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
1129#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
1130#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
1131#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
1132#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
1133#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
1134#define ISO_T 0x4000 /* enable Isochronous transfers */
1135#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
1136#define ERROR_TH 0x4 /* error condition host mode */
1137#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
1138#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
1139
1140/* Bit masks for USB_TXCOUNT */
1141
1142#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
1143
1144/* Bit masks for USB_RXCSR */
1145
1146#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
1147#define FIFO_FULL_R 0x2 /* FIFO not empty */
1148#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
1149#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
1150#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
1151#define STALL_SEND_R 0x20 /* issue a Stall handshake */
1152#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
1153#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
1154#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
1155#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
1156#define DISNYET_R 0x1000 /* disable Nyet handshakes */
1157#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1158#define ISO_R 0x4000 /* enable Isochronous transfers */
1159#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1160#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1161#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1162#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1163#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1164#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1165#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1166
1167/* Bit masks for USB_RXCOUNT */
1168
1169#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
1170
1171/* Bit masks for USB_TXTYPE */
1172
1173#define TARGET_EP_NO_T 0xf /* EP number */
1174#define PROTOCOL_T 0xc /* transfer type */
1175
1176/* Bit masks for USB_TXINTERVAL */
1177
1178#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
1179
1180/* Bit masks for USB_RXTYPE */
1181
1182#define TARGET_EP_NO_R 0xf /* EP number */
1183#define PROTOCOL_R 0xc /* transfer type */
1184
1185/* Bit masks for USB_RXINTERVAL */
1186
1187#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
1188
1189/* Bit masks for USB_DMA_INTERRUPT */
1190
1191#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1192#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1193#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1194#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1195#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1196#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1197#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1198#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1199
1200/* Bit masks for USB_DMAxCONTROL */
1201
1202#define DMA_ENA 0x1 /* DMA enable */
1203#define DIRECTION 0x2 /* direction of DMA transfer */
1204#define MODE 0x4 /* DMA Bus error */
1205#define INT_ENA 0x8 /* Interrupt enable */
1206#define EPNUM 0xf0 /* EP number */
1207#define BUSERROR 0x100 /* DMA Bus error */
1208
1209/* Bit masks for USB_DMAxADDRHIGH */
1210
1211#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
1212
1213/* Bit masks for USB_DMAxADDRLOW */
1214
1215#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
1216
1217/* Bit masks for USB_DMAxCOUNTHIGH */
1218
1219#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
1220
1221/* Bit masks for USB_DMAxCOUNTLOW */
1222
1223#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
1224
1225/* Bit masks for HMDMAx_CONTROL */
1226
1227#define HMDMAEN 0x1 /* Handshake MDMA Enable */
1228#define REP 0x2 /* Handshake MDMA Request Polarity */
1229#define UTE 0x8 /* Urgency Threshold Enable */
1230#define OIE 0x10 /* Overflow Interrupt Enable */
1231#define BDIE 0x20 /* Block Done Interrupt Enable */
1232#define MBDI 0x40 /* Mask Block Done Interrupt */
1233#define DRQ 0x300 /* Handshake MDMA Request Type */
1234#define RBC 0x1000 /* Force Reload of BCOUNT */
1235#define PS 0x2000 /* Pin Status */
1236#define OI 0x4000 /* Overflow Interrupt Generated */
1237#define BDI 0x8000 /* Block Done Interrupt Generated */
1238
1239/* ******************************************* */
1240/* MULTI BIT MACRO ENUMERATIONS */
1241/* ******************************************* */
1242
1243
1244#endif /* _DEF_BF548_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF548.h b/include/asm-blackfin/mach-bf548/defBF548.h
deleted file mode 100644
index 1d7c96edb038..000000000000
--- a/include/asm-blackfin/mach-bf548/defBF548.h
+++ /dev/null
@@ -1,1627 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/defBF548.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_BF548_H
32#define _DEF_BF548_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF548 */
38
39/* Include defBF54x_base.h for the set of #defines that are common to all ADSP-BF54x processors */
40#include "defBF54x_base.h"
41
42/* The following are the #defines needed by ADSP-BF548 that are not in the common header */
43
44/* Timer Registers */
45
46#define TIMER8_CONFIG 0xffc00600 /* Timer 8 Configuration Register */
47#define TIMER8_COUNTER 0xffc00604 /* Timer 8 Counter Register */
48#define TIMER8_PERIOD 0xffc00608 /* Timer 8 Period Register */
49#define TIMER8_WIDTH 0xffc0060c /* Timer 8 Width Register */
50#define TIMER9_CONFIG 0xffc00610 /* Timer 9 Configuration Register */
51#define TIMER9_COUNTER 0xffc00614 /* Timer 9 Counter Register */
52#define TIMER9_PERIOD 0xffc00618 /* Timer 9 Period Register */
53#define TIMER9_WIDTH 0xffc0061c /* Timer 9 Width Register */
54#define TIMER10_CONFIG 0xffc00620 /* Timer 10 Configuration Register */
55#define TIMER10_COUNTER 0xffc00624 /* Timer 10 Counter Register */
56#define TIMER10_PERIOD 0xffc00628 /* Timer 10 Period Register */
57#define TIMER10_WIDTH 0xffc0062c /* Timer 10 Width Register */
58
59/* Timer Group of 3 Registers */
60
61#define TIMER_ENABLE1 0xffc00640 /* Timer Group of 3 Enable Register */
62#define TIMER_DISABLE1 0xffc00644 /* Timer Group of 3 Disable Register */
63#define TIMER_STATUS1 0xffc00648 /* Timer Group of 3 Status Register */
64
65/* SPORT0 Registers */
66
67#define SPORT0_TCR1 0xffc00800 /* SPORT0 Transmit Configuration 1 Register */
68#define SPORT0_TCR2 0xffc00804 /* SPORT0 Transmit Configuration 2 Register */
69#define SPORT0_TCLKDIV 0xffc00808 /* SPORT0 Transmit Serial Clock Divider Register */
70#define SPORT0_TFSDIV 0xffc0080c /* SPORT0 Transmit Frame Sync Divider Register */
71#define SPORT0_TX 0xffc00810 /* SPORT0 Transmit Data Register */
72#define SPORT0_RX 0xffc00818 /* SPORT0 Receive Data Register */
73#define SPORT0_RCR1 0xffc00820 /* SPORT0 Receive Configuration 1 Register */
74#define SPORT0_RCR2 0xffc00824 /* SPORT0 Receive Configuration 2 Register */
75#define SPORT0_RCLKDIV 0xffc00828 /* SPORT0 Receive Serial Clock Divider Register */
76#define SPORT0_RFSDIV 0xffc0082c /* SPORT0 Receive Frame Sync Divider Register */
77#define SPORT0_STAT 0xffc00830 /* SPORT0 Status Register */
78#define SPORT0_CHNL 0xffc00834 /* SPORT0 Current Channel Register */
79#define SPORT0_MCMC1 0xffc00838 /* SPORT0 Multi channel Configuration Register 1 */
80#define SPORT0_MCMC2 0xffc0083c /* SPORT0 Multi channel Configuration Register 2 */
81#define SPORT0_MTCS0 0xffc00840 /* SPORT0 Multi channel Transmit Select Register 0 */
82#define SPORT0_MTCS1 0xffc00844 /* SPORT0 Multi channel Transmit Select Register 1 */
83#define SPORT0_MTCS2 0xffc00848 /* SPORT0 Multi channel Transmit Select Register 2 */
84#define SPORT0_MTCS3 0xffc0084c /* SPORT0 Multi channel Transmit Select Register 3 */
85#define SPORT0_MRCS0 0xffc00850 /* SPORT0 Multi channel Receive Select Register 0 */
86#define SPORT0_MRCS1 0xffc00854 /* SPORT0 Multi channel Receive Select Register 1 */
87#define SPORT0_MRCS2 0xffc00858 /* SPORT0 Multi channel Receive Select Register 2 */
88#define SPORT0_MRCS3 0xffc0085c /* SPORT0 Multi channel Receive Select Register 3 */
89
90/* EPPI0 Registers */
91
92#define EPPI0_STATUS 0xffc01000 /* EPPI0 Status Register */
93#define EPPI0_HCOUNT 0xffc01004 /* EPPI0 Horizontal Transfer Count Register */
94#define EPPI0_HDELAY 0xffc01008 /* EPPI0 Horizontal Delay Count Register */
95#define EPPI0_VCOUNT 0xffc0100c /* EPPI0 Vertical Transfer Count Register */
96#define EPPI0_VDELAY 0xffc01010 /* EPPI0 Vertical Delay Count Register */
97#define EPPI0_FRAME 0xffc01014 /* EPPI0 Lines per Frame Register */
98#define EPPI0_LINE 0xffc01018 /* EPPI0 Samples per Line Register */
99#define EPPI0_CLKDIV 0xffc0101c /* EPPI0 Clock Divide Register */
100#define EPPI0_CONTROL 0xffc01020 /* EPPI0 Control Register */
101#define EPPI0_FS1W_HBL 0xffc01024 /* EPPI0 FS1 Width Register / EPPI0 Horizontal Blanking Samples Per Line Register */
102#define EPPI0_FS1P_AVPL 0xffc01028 /* EPPI0 FS1 Period Register / EPPI0 Active Video Samples Per Line Register */
103#define EPPI0_FS2W_LVB 0xffc0102c /* EPPI0 FS2 Width Register / EPPI0 Lines of Vertical Blanking Register */
104#define EPPI0_FS2P_LAVF 0xffc01030 /* EPPI0 FS2 Period Register/ EPPI0 Lines of Active Video Per Field Register */
105#define EPPI0_CLIP 0xffc01034 /* EPPI0 Clipping Register */
106
107/* UART2 Registers */
108
109#define UART2_DLL 0xffc02100 /* Divisor Latch Low Byte */
110#define UART2_DLH 0xffc02104 /* Divisor Latch High Byte */
111#define UART2_GCTL 0xffc02108 /* Global Control Register */
112#define UART2_LCR 0xffc0210c /* Line Control Register */
113#define UART2_MCR 0xffc02110 /* Modem Control Register */
114#define UART2_LSR 0xffc02114 /* Line Status Register */
115#define UART2_MSR 0xffc02118 /* Modem Status Register */
116#define UART2_SCR 0xffc0211c /* Scratch Register */
117#define UART2_IER_SET 0xffc02120 /* Interrupt Enable Register Set */
118#define UART2_IER_CLEAR 0xffc02124 /* Interrupt Enable Register Clear */
119#define UART2_RBR 0xffc0212c /* Receive Buffer Register */
120
121/* Two Wire Interface Registers (TWI1) */
122
123#define TWI1_REGBASE 0xffc02200
124#define TWI1_CLKDIV 0xffc02200 /* Clock Divider Register */
125#define TWI1_CONTROL 0xffc02204 /* TWI Control Register */
126#define TWI1_SLAVE_CTRL 0xffc02208 /* TWI Slave Mode Control Register */
127#define TWI1_SLAVE_STAT 0xffc0220c /* TWI Slave Mode Status Register */
128#define TWI1_SLAVE_ADDR 0xffc02210 /* TWI Slave Mode Address Register */
129#define TWI1_MASTER_CTRL 0xffc02214 /* TWI Master Mode Control Register */
130#define TWI1_MASTER_STAT 0xffc02218 /* TWI Master Mode Status Register */
131#define TWI1_MASTER_ADDR 0xffc0221c /* TWI Master Mode Address Register */
132#define TWI1_INT_STAT 0xffc02220 /* TWI Interrupt Status Register */
133#define TWI1_INT_MASK 0xffc02224 /* TWI Interrupt Mask Register */
134#define TWI1_FIFO_CTRL 0xffc02228 /* TWI FIFO Control Register */
135#define TWI1_FIFO_STAT 0xffc0222c /* TWI FIFO Status Register */
136#define TWI1_XMT_DATA8 0xffc02280 /* TWI FIFO Transmit Data Single Byte Register */
137#define TWI1_XMT_DATA16 0xffc02284 /* TWI FIFO Transmit Data Double Byte Register */
138#define TWI1_RCV_DATA8 0xffc02288 /* TWI FIFO Receive Data Single Byte Register */
139#define TWI1_RCV_DATA16 0xffc0228c /* TWI FIFO Receive Data Double Byte Register */
140
141/* SPI2 Registers */
142
143#define SPI2_REGBASE 0xffc02400
144#define SPI2_CTL 0xffc02400 /* SPI2 Control Register */
145#define SPI2_FLG 0xffc02404 /* SPI2 Flag Register */
146#define SPI2_STAT 0xffc02408 /* SPI2 Status Register */
147#define SPI2_TDBR 0xffc0240c /* SPI2 Transmit Data Buffer Register */
148#define SPI2_RDBR 0xffc02410 /* SPI2 Receive Data Buffer Register */
149#define SPI2_BAUD 0xffc02414 /* SPI2 Baud Rate Register */
150#define SPI2_SHADOW 0xffc02418 /* SPI2 Receive Data Buffer Shadow Register */
151
152/* CAN Controller 1 Config 1 Registers */
153
154#define CAN1_MC1 0xffc03200 /* CAN Controller 1 Mailbox Configuration Register 1 */
155#define CAN1_MD1 0xffc03204 /* CAN Controller 1 Mailbox Direction Register 1 */
156#define CAN1_TRS1 0xffc03208 /* CAN Controller 1 Transmit Request Set Register 1 */
157#define CAN1_TRR1 0xffc0320c /* CAN Controller 1 Transmit Request Reset Register 1 */
158#define CAN1_TA1 0xffc03210 /* CAN Controller 1 Transmit Acknowledge Register 1 */
159#define CAN1_AA1 0xffc03214 /* CAN Controller 1 Abort Acknowledge Register 1 */
160#define CAN1_RMP1 0xffc03218 /* CAN Controller 1 Receive Message Pending Register 1 */
161#define CAN1_RML1 0xffc0321c /* CAN Controller 1 Receive Message Lost Register 1 */
162#define CAN1_MBTIF1 0xffc03220 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 1 */
163#define CAN1_MBRIF1 0xffc03224 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 1 */
164#define CAN1_MBIM1 0xffc03228 /* CAN Controller 1 Mailbox Interrupt Mask Register 1 */
165#define CAN1_RFH1 0xffc0322c /* CAN Controller 1 Remote Frame Handling Enable Register 1 */
166#define CAN1_OPSS1 0xffc03230 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 1 */
167
168/* CAN Controller 1 Config 2 Registers */
169
170#define CAN1_MC2 0xffc03240 /* CAN Controller 1 Mailbox Configuration Register 2 */
171#define CAN1_MD2 0xffc03244 /* CAN Controller 1 Mailbox Direction Register 2 */
172#define CAN1_TRS2 0xffc03248 /* CAN Controller 1 Transmit Request Set Register 2 */
173#define CAN1_TRR2 0xffc0324c /* CAN Controller 1 Transmit Request Reset Register 2 */
174#define CAN1_TA2 0xffc03250 /* CAN Controller 1 Transmit Acknowledge Register 2 */
175#define CAN1_AA2 0xffc03254 /* CAN Controller 1 Abort Acknowledge Register 2 */
176#define CAN1_RMP2 0xffc03258 /* CAN Controller 1 Receive Message Pending Register 2 */
177#define CAN1_RML2 0xffc0325c /* CAN Controller 1 Receive Message Lost Register 2 */
178#define CAN1_MBTIF2 0xffc03260 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 2 */
179#define CAN1_MBRIF2 0xffc03264 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 2 */
180#define CAN1_MBIM2 0xffc03268 /* CAN Controller 1 Mailbox Interrupt Mask Register 2 */
181#define CAN1_RFH2 0xffc0326c /* CAN Controller 1 Remote Frame Handling Enable Register 2 */
182#define CAN1_OPSS2 0xffc03270 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 2 */
183
184/* CAN Controller 1 Clock/Interrupt/Counter Registers */
185
186#define CAN1_CLOCK 0xffc03280 /* CAN Controller 1 Clock Register */
187#define CAN1_TIMING 0xffc03284 /* CAN Controller 1 Timing Register */
188#define CAN1_DEBUG 0xffc03288 /* CAN Controller 1 Debug Register */
189#define CAN1_STATUS 0xffc0328c /* CAN Controller 1 Global Status Register */
190#define CAN1_CEC 0xffc03290 /* CAN Controller 1 Error Counter Register */
191#define CAN1_GIS 0xffc03294 /* CAN Controller 1 Global Interrupt Status Register */
192#define CAN1_GIM 0xffc03298 /* CAN Controller 1 Global Interrupt Mask Register */
193#define CAN1_GIF 0xffc0329c /* CAN Controller 1 Global Interrupt Flag Register */
194#define CAN1_CONTROL 0xffc032a0 /* CAN Controller 1 Master Control Register */
195#define CAN1_INTR 0xffc032a4 /* CAN Controller 1 Interrupt Pending Register */
196#define CAN1_MBTD 0xffc032ac /* CAN Controller 1 Mailbox Temporary Disable Register */
197#define CAN1_EWR 0xffc032b0 /* CAN Controller 1 Programmable Warning Level Register */
198#define CAN1_ESR 0xffc032b4 /* CAN Controller 1 Error Status Register */
199#define CAN1_UCCNT 0xffc032c4 /* CAN Controller 1 Universal Counter Register */
200#define CAN1_UCRC 0xffc032c8 /* CAN Controller 1 Universal Counter Force Reload Register */
201#define CAN1_UCCNF 0xffc032cc /* CAN Controller 1 Universal Counter Configuration Register */
202
203/* CAN Controller 1 Mailbox Acceptance Registers */
204
205#define CAN1_AM00L 0xffc03300 /* CAN Controller 1 Mailbox 0 Acceptance Mask High Register */
206#define CAN1_AM00H 0xffc03304 /* CAN Controller 1 Mailbox 0 Acceptance Mask Low Register */
207#define CAN1_AM01L 0xffc03308 /* CAN Controller 1 Mailbox 1 Acceptance Mask High Register */
208#define CAN1_AM01H 0xffc0330c /* CAN Controller 1 Mailbox 1 Acceptance Mask Low Register */
209#define CAN1_AM02L 0xffc03310 /* CAN Controller 1 Mailbox 2 Acceptance Mask High Register */
210#define CAN1_AM02H 0xffc03314 /* CAN Controller 1 Mailbox 2 Acceptance Mask Low Register */
211#define CAN1_AM03L 0xffc03318 /* CAN Controller 1 Mailbox 3 Acceptance Mask High Register */
212#define CAN1_AM03H 0xffc0331c /* CAN Controller 1 Mailbox 3 Acceptance Mask Low Register */
213#define CAN1_AM04L 0xffc03320 /* CAN Controller 1 Mailbox 4 Acceptance Mask High Register */
214#define CAN1_AM04H 0xffc03324 /* CAN Controller 1 Mailbox 4 Acceptance Mask Low Register */
215#define CAN1_AM05L 0xffc03328 /* CAN Controller 1 Mailbox 5 Acceptance Mask High Register */
216#define CAN1_AM05H 0xffc0332c /* CAN Controller 1 Mailbox 5 Acceptance Mask Low Register */
217#define CAN1_AM06L 0xffc03330 /* CAN Controller 1 Mailbox 6 Acceptance Mask High Register */
218#define CAN1_AM06H 0xffc03334 /* CAN Controller 1 Mailbox 6 Acceptance Mask Low Register */
219#define CAN1_AM07L 0xffc03338 /* CAN Controller 1 Mailbox 7 Acceptance Mask High Register */
220#define CAN1_AM07H 0xffc0333c /* CAN Controller 1 Mailbox 7 Acceptance Mask Low Register */
221#define CAN1_AM08L 0xffc03340 /* CAN Controller 1 Mailbox 8 Acceptance Mask High Register */
222#define CAN1_AM08H 0xffc03344 /* CAN Controller 1 Mailbox 8 Acceptance Mask Low Register */
223#define CAN1_AM09L 0xffc03348 /* CAN Controller 1 Mailbox 9 Acceptance Mask High Register */
224#define CAN1_AM09H 0xffc0334c /* CAN Controller 1 Mailbox 9 Acceptance Mask Low Register */
225#define CAN1_AM10L 0xffc03350 /* CAN Controller 1 Mailbox 10 Acceptance Mask High Register */
226#define CAN1_AM10H 0xffc03354 /* CAN Controller 1 Mailbox 10 Acceptance Mask Low Register */
227#define CAN1_AM11L 0xffc03358 /* CAN Controller 1 Mailbox 11 Acceptance Mask High Register */
228#define CAN1_AM11H 0xffc0335c /* CAN Controller 1 Mailbox 11 Acceptance Mask Low Register */
229#define CAN1_AM12L 0xffc03360 /* CAN Controller 1 Mailbox 12 Acceptance Mask High Register */
230#define CAN1_AM12H 0xffc03364 /* CAN Controller 1 Mailbox 12 Acceptance Mask Low Register */
231#define CAN1_AM13L 0xffc03368 /* CAN Controller 1 Mailbox 13 Acceptance Mask High Register */
232#define CAN1_AM13H 0xffc0336c /* CAN Controller 1 Mailbox 13 Acceptance Mask Low Register */
233#define CAN1_AM14L 0xffc03370 /* CAN Controller 1 Mailbox 14 Acceptance Mask High Register */
234#define CAN1_AM14H 0xffc03374 /* CAN Controller 1 Mailbox 14 Acceptance Mask Low Register */
235#define CAN1_AM15L 0xffc03378 /* CAN Controller 1 Mailbox 15 Acceptance Mask High Register */
236#define CAN1_AM15H 0xffc0337c /* CAN Controller 1 Mailbox 15 Acceptance Mask Low Register */
237
238/* CAN Controller 1 Mailbox Acceptance Registers */
239
240#define CAN1_AM16L 0xffc03380 /* CAN Controller 1 Mailbox 16 Acceptance Mask High Register */
241#define CAN1_AM16H 0xffc03384 /* CAN Controller 1 Mailbox 16 Acceptance Mask Low Register */
242#define CAN1_AM17L 0xffc03388 /* CAN Controller 1 Mailbox 17 Acceptance Mask High Register */
243#define CAN1_AM17H 0xffc0338c /* CAN Controller 1 Mailbox 17 Acceptance Mask Low Register */
244#define CAN1_AM18L 0xffc03390 /* CAN Controller 1 Mailbox 18 Acceptance Mask High Register */
245#define CAN1_AM18H 0xffc03394 /* CAN Controller 1 Mailbox 18 Acceptance Mask Low Register */
246#define CAN1_AM19L 0xffc03398 /* CAN Controller 1 Mailbox 19 Acceptance Mask High Register */
247#define CAN1_AM19H 0xffc0339c /* CAN Controller 1 Mailbox 19 Acceptance Mask Low Register */
248#define CAN1_AM20L 0xffc033a0 /* CAN Controller 1 Mailbox 20 Acceptance Mask High Register */
249#define CAN1_AM20H 0xffc033a4 /* CAN Controller 1 Mailbox 20 Acceptance Mask Low Register */
250#define CAN1_AM21L 0xffc033a8 /* CAN Controller 1 Mailbox 21 Acceptance Mask High Register */
251#define CAN1_AM21H 0xffc033ac /* CAN Controller 1 Mailbox 21 Acceptance Mask Low Register */
252#define CAN1_AM22L 0xffc033b0 /* CAN Controller 1 Mailbox 22 Acceptance Mask High Register */
253#define CAN1_AM22H 0xffc033b4 /* CAN Controller 1 Mailbox 22 Acceptance Mask Low Register */
254#define CAN1_AM23L 0xffc033b8 /* CAN Controller 1 Mailbox 23 Acceptance Mask High Register */
255#define CAN1_AM23H 0xffc033bc /* CAN Controller 1 Mailbox 23 Acceptance Mask Low Register */
256#define CAN1_AM24L 0xffc033c0 /* CAN Controller 1 Mailbox 24 Acceptance Mask High Register */
257#define CAN1_AM24H 0xffc033c4 /* CAN Controller 1 Mailbox 24 Acceptance Mask Low Register */
258#define CAN1_AM25L 0xffc033c8 /* CAN Controller 1 Mailbox 25 Acceptance Mask High Register */
259#define CAN1_AM25H 0xffc033cc /* CAN Controller 1 Mailbox 25 Acceptance Mask Low Register */
260#define CAN1_AM26L 0xffc033d0 /* CAN Controller 1 Mailbox 26 Acceptance Mask High Register */
261#define CAN1_AM26H 0xffc033d4 /* CAN Controller 1 Mailbox 26 Acceptance Mask Low Register */
262#define CAN1_AM27L 0xffc033d8 /* CAN Controller 1 Mailbox 27 Acceptance Mask High Register */
263#define CAN1_AM27H 0xffc033dc /* CAN Controller 1 Mailbox 27 Acceptance Mask Low Register */
264#define CAN1_AM28L 0xffc033e0 /* CAN Controller 1 Mailbox 28 Acceptance Mask High Register */
265#define CAN1_AM28H 0xffc033e4 /* CAN Controller 1 Mailbox 28 Acceptance Mask Low Register */
266#define CAN1_AM29L 0xffc033e8 /* CAN Controller 1 Mailbox 29 Acceptance Mask High Register */
267#define CAN1_AM29H 0xffc033ec /* CAN Controller 1 Mailbox 29 Acceptance Mask Low Register */
268#define CAN1_AM30L 0xffc033f0 /* CAN Controller 1 Mailbox 30 Acceptance Mask High Register */
269#define CAN1_AM30H 0xffc033f4 /* CAN Controller 1 Mailbox 30 Acceptance Mask Low Register */
270#define CAN1_AM31L 0xffc033f8 /* CAN Controller 1 Mailbox 31 Acceptance Mask High Register */
271#define CAN1_AM31H 0xffc033fc /* CAN Controller 1 Mailbox 31 Acceptance Mask Low Register */
272
273/* CAN Controller 1 Mailbox Data Registers */
274
275#define CAN1_MB00_DATA0 0xffc03400 /* CAN Controller 1 Mailbox 0 Data 0 Register */
276#define CAN1_MB00_DATA1 0xffc03404 /* CAN Controller 1 Mailbox 0 Data 1 Register */
277#define CAN1_MB00_DATA2 0xffc03408 /* CAN Controller 1 Mailbox 0 Data 2 Register */
278#define CAN1_MB00_DATA3 0xffc0340c /* CAN Controller 1 Mailbox 0 Data 3 Register */
279#define CAN1_MB00_LENGTH 0xffc03410 /* CAN Controller 1 Mailbox 0 Length Register */
280#define CAN1_MB00_TIMESTAMP 0xffc03414 /* CAN Controller 1 Mailbox 0 Timestamp Register */
281#define CAN1_MB00_ID0 0xffc03418 /* CAN Controller 1 Mailbox 0 ID0 Register */
282#define CAN1_MB00_ID1 0xffc0341c /* CAN Controller 1 Mailbox 0 ID1 Register */
283#define CAN1_MB01_DATA0 0xffc03420 /* CAN Controller 1 Mailbox 1 Data 0 Register */
284#define CAN1_MB01_DATA1 0xffc03424 /* CAN Controller 1 Mailbox 1 Data 1 Register */
285#define CAN1_MB01_DATA2 0xffc03428 /* CAN Controller 1 Mailbox 1 Data 2 Register */
286#define CAN1_MB01_DATA3 0xffc0342c /* CAN Controller 1 Mailbox 1 Data 3 Register */
287#define CAN1_MB01_LENGTH 0xffc03430 /* CAN Controller 1 Mailbox 1 Length Register */
288#define CAN1_MB01_TIMESTAMP 0xffc03434 /* CAN Controller 1 Mailbox 1 Timestamp Register */
289#define CAN1_MB01_ID0 0xffc03438 /* CAN Controller 1 Mailbox 1 ID0 Register */
290#define CAN1_MB01_ID1 0xffc0343c /* CAN Controller 1 Mailbox 1 ID1 Register */
291#define CAN1_MB02_DATA0 0xffc03440 /* CAN Controller 1 Mailbox 2 Data 0 Register */
292#define CAN1_MB02_DATA1 0xffc03444 /* CAN Controller 1 Mailbox 2 Data 1 Register */
293#define CAN1_MB02_DATA2 0xffc03448 /* CAN Controller 1 Mailbox 2 Data 2 Register */
294#define CAN1_MB02_DATA3 0xffc0344c /* CAN Controller 1 Mailbox 2 Data 3 Register */
295#define CAN1_MB02_LENGTH 0xffc03450 /* CAN Controller 1 Mailbox 2 Length Register */
296#define CAN1_MB02_TIMESTAMP 0xffc03454 /* CAN Controller 1 Mailbox 2 Timestamp Register */
297#define CAN1_MB02_ID0 0xffc03458 /* CAN Controller 1 Mailbox 2 ID0 Register */
298#define CAN1_MB02_ID1 0xffc0345c /* CAN Controller 1 Mailbox 2 ID1 Register */
299#define CAN1_MB03_DATA0 0xffc03460 /* CAN Controller 1 Mailbox 3 Data 0 Register */
300#define CAN1_MB03_DATA1 0xffc03464 /* CAN Controller 1 Mailbox 3 Data 1 Register */
301#define CAN1_MB03_DATA2 0xffc03468 /* CAN Controller 1 Mailbox 3 Data 2 Register */
302#define CAN1_MB03_DATA3 0xffc0346c /* CAN Controller 1 Mailbox 3 Data 3 Register */
303#define CAN1_MB03_LENGTH 0xffc03470 /* CAN Controller 1 Mailbox 3 Length Register */
304#define CAN1_MB03_TIMESTAMP 0xffc03474 /* CAN Controller 1 Mailbox 3 Timestamp Register */
305#define CAN1_MB03_ID0 0xffc03478 /* CAN Controller 1 Mailbox 3 ID0 Register */
306#define CAN1_MB03_ID1 0xffc0347c /* CAN Controller 1 Mailbox 3 ID1 Register */
307#define CAN1_MB04_DATA0 0xffc03480 /* CAN Controller 1 Mailbox 4 Data 0 Register */
308#define CAN1_MB04_DATA1 0xffc03484 /* CAN Controller 1 Mailbox 4 Data 1 Register */
309#define CAN1_MB04_DATA2 0xffc03488 /* CAN Controller 1 Mailbox 4 Data 2 Register */
310#define CAN1_MB04_DATA3 0xffc0348c /* CAN Controller 1 Mailbox 4 Data 3 Register */
311#define CAN1_MB04_LENGTH 0xffc03490 /* CAN Controller 1 Mailbox 4 Length Register */
312#define CAN1_MB04_TIMESTAMP 0xffc03494 /* CAN Controller 1 Mailbox 4 Timestamp Register */
313#define CAN1_MB04_ID0 0xffc03498 /* CAN Controller 1 Mailbox 4 ID0 Register */
314#define CAN1_MB04_ID1 0xffc0349c /* CAN Controller 1 Mailbox 4 ID1 Register */
315#define CAN1_MB05_DATA0 0xffc034a0 /* CAN Controller 1 Mailbox 5 Data 0 Register */
316#define CAN1_MB05_DATA1 0xffc034a4 /* CAN Controller 1 Mailbox 5 Data 1 Register */
317#define CAN1_MB05_DATA2 0xffc034a8 /* CAN Controller 1 Mailbox 5 Data 2 Register */
318#define CAN1_MB05_DATA3 0xffc034ac /* CAN Controller 1 Mailbox 5 Data 3 Register */
319#define CAN1_MB05_LENGTH 0xffc034b0 /* CAN Controller 1 Mailbox 5 Length Register */
320#define CAN1_MB05_TIMESTAMP 0xffc034b4 /* CAN Controller 1 Mailbox 5 Timestamp Register */
321#define CAN1_MB05_ID0 0xffc034b8 /* CAN Controller 1 Mailbox 5 ID0 Register */
322#define CAN1_MB05_ID1 0xffc034bc /* CAN Controller 1 Mailbox 5 ID1 Register */
323#define CAN1_MB06_DATA0 0xffc034c0 /* CAN Controller 1 Mailbox 6 Data 0 Register */
324#define CAN1_MB06_DATA1 0xffc034c4 /* CAN Controller 1 Mailbox 6 Data 1 Register */
325#define CAN1_MB06_DATA2 0xffc034c8 /* CAN Controller 1 Mailbox 6 Data 2 Register */
326#define CAN1_MB06_DATA3 0xffc034cc /* CAN Controller 1 Mailbox 6 Data 3 Register */
327#define CAN1_MB06_LENGTH 0xffc034d0 /* CAN Controller 1 Mailbox 6 Length Register */
328#define CAN1_MB06_TIMESTAMP 0xffc034d4 /* CAN Controller 1 Mailbox 6 Timestamp Register */
329#define CAN1_MB06_ID0 0xffc034d8 /* CAN Controller 1 Mailbox 6 ID0 Register */
330#define CAN1_MB06_ID1 0xffc034dc /* CAN Controller 1 Mailbox 6 ID1 Register */
331#define CAN1_MB07_DATA0 0xffc034e0 /* CAN Controller 1 Mailbox 7 Data 0 Register */
332#define CAN1_MB07_DATA1 0xffc034e4 /* CAN Controller 1 Mailbox 7 Data 1 Register */
333#define CAN1_MB07_DATA2 0xffc034e8 /* CAN Controller 1 Mailbox 7 Data 2 Register */
334#define CAN1_MB07_DATA3 0xffc034ec /* CAN Controller 1 Mailbox 7 Data 3 Register */
335#define CAN1_MB07_LENGTH 0xffc034f0 /* CAN Controller 1 Mailbox 7 Length Register */
336#define CAN1_MB07_TIMESTAMP 0xffc034f4 /* CAN Controller 1 Mailbox 7 Timestamp Register */
337#define CAN1_MB07_ID0 0xffc034f8 /* CAN Controller 1 Mailbox 7 ID0 Register */
338#define CAN1_MB07_ID1 0xffc034fc /* CAN Controller 1 Mailbox 7 ID1 Register */
339#define CAN1_MB08_DATA0 0xffc03500 /* CAN Controller 1 Mailbox 8 Data 0 Register */
340#define CAN1_MB08_DATA1 0xffc03504 /* CAN Controller 1 Mailbox 8 Data 1 Register */
341#define CAN1_MB08_DATA2 0xffc03508 /* CAN Controller 1 Mailbox 8 Data 2 Register */
342#define CAN1_MB08_DATA3 0xffc0350c /* CAN Controller 1 Mailbox 8 Data 3 Register */
343#define CAN1_MB08_LENGTH 0xffc03510 /* CAN Controller 1 Mailbox 8 Length Register */
344#define CAN1_MB08_TIMESTAMP 0xffc03514 /* CAN Controller 1 Mailbox 8 Timestamp Register */
345#define CAN1_MB08_ID0 0xffc03518 /* CAN Controller 1 Mailbox 8 ID0 Register */
346#define CAN1_MB08_ID1 0xffc0351c /* CAN Controller 1 Mailbox 8 ID1 Register */
347#define CAN1_MB09_DATA0 0xffc03520 /* CAN Controller 1 Mailbox 9 Data 0 Register */
348#define CAN1_MB09_DATA1 0xffc03524 /* CAN Controller 1 Mailbox 9 Data 1 Register */
349#define CAN1_MB09_DATA2 0xffc03528 /* CAN Controller 1 Mailbox 9 Data 2 Register */
350#define CAN1_MB09_DATA3 0xffc0352c /* CAN Controller 1 Mailbox 9 Data 3 Register */
351#define CAN1_MB09_LENGTH 0xffc03530 /* CAN Controller 1 Mailbox 9 Length Register */
352#define CAN1_MB09_TIMESTAMP 0xffc03534 /* CAN Controller 1 Mailbox 9 Timestamp Register */
353#define CAN1_MB09_ID0 0xffc03538 /* CAN Controller 1 Mailbox 9 ID0 Register */
354#define CAN1_MB09_ID1 0xffc0353c /* CAN Controller 1 Mailbox 9 ID1 Register */
355#define CAN1_MB10_DATA0 0xffc03540 /* CAN Controller 1 Mailbox 10 Data 0 Register */
356#define CAN1_MB10_DATA1 0xffc03544 /* CAN Controller 1 Mailbox 10 Data 1 Register */
357#define CAN1_MB10_DATA2 0xffc03548 /* CAN Controller 1 Mailbox 10 Data 2 Register */
358#define CAN1_MB10_DATA3 0xffc0354c /* CAN Controller 1 Mailbox 10 Data 3 Register */
359#define CAN1_MB10_LENGTH 0xffc03550 /* CAN Controller 1 Mailbox 10 Length Register */
360#define CAN1_MB10_TIMESTAMP 0xffc03554 /* CAN Controller 1 Mailbox 10 Timestamp Register */
361#define CAN1_MB10_ID0 0xffc03558 /* CAN Controller 1 Mailbox 10 ID0 Register */
362#define CAN1_MB10_ID1 0xffc0355c /* CAN Controller 1 Mailbox 10 ID1 Register */
363#define CAN1_MB11_DATA0 0xffc03560 /* CAN Controller 1 Mailbox 11 Data 0 Register */
364#define CAN1_MB11_DATA1 0xffc03564 /* CAN Controller 1 Mailbox 11 Data 1 Register */
365#define CAN1_MB11_DATA2 0xffc03568 /* CAN Controller 1 Mailbox 11 Data 2 Register */
366#define CAN1_MB11_DATA3 0xffc0356c /* CAN Controller 1 Mailbox 11 Data 3 Register */
367#define CAN1_MB11_LENGTH 0xffc03570 /* CAN Controller 1 Mailbox 11 Length Register */
368#define CAN1_MB11_TIMESTAMP 0xffc03574 /* CAN Controller 1 Mailbox 11 Timestamp Register */
369#define CAN1_MB11_ID0 0xffc03578 /* CAN Controller 1 Mailbox 11 ID0 Register */
370#define CAN1_MB11_ID1 0xffc0357c /* CAN Controller 1 Mailbox 11 ID1 Register */
371#define CAN1_MB12_DATA0 0xffc03580 /* CAN Controller 1 Mailbox 12 Data 0 Register */
372#define CAN1_MB12_DATA1 0xffc03584 /* CAN Controller 1 Mailbox 12 Data 1 Register */
373#define CAN1_MB12_DATA2 0xffc03588 /* CAN Controller 1 Mailbox 12 Data 2 Register */
374#define CAN1_MB12_DATA3 0xffc0358c /* CAN Controller 1 Mailbox 12 Data 3 Register */
375#define CAN1_MB12_LENGTH 0xffc03590 /* CAN Controller 1 Mailbox 12 Length Register */
376#define CAN1_MB12_TIMESTAMP 0xffc03594 /* CAN Controller 1 Mailbox 12 Timestamp Register */
377#define CAN1_MB12_ID0 0xffc03598 /* CAN Controller 1 Mailbox 12 ID0 Register */
378#define CAN1_MB12_ID1 0xffc0359c /* CAN Controller 1 Mailbox 12 ID1 Register */
379#define CAN1_MB13_DATA0 0xffc035a0 /* CAN Controller 1 Mailbox 13 Data 0 Register */
380#define CAN1_MB13_DATA1 0xffc035a4 /* CAN Controller 1 Mailbox 13 Data 1 Register */
381#define CAN1_MB13_DATA2 0xffc035a8 /* CAN Controller 1 Mailbox 13 Data 2 Register */
382#define CAN1_MB13_DATA3 0xffc035ac /* CAN Controller 1 Mailbox 13 Data 3 Register */
383#define CAN1_MB13_LENGTH 0xffc035b0 /* CAN Controller 1 Mailbox 13 Length Register */
384#define CAN1_MB13_TIMESTAMP 0xffc035b4 /* CAN Controller 1 Mailbox 13 Timestamp Register */
385#define CAN1_MB13_ID0 0xffc035b8 /* CAN Controller 1 Mailbox 13 ID0 Register */
386#define CAN1_MB13_ID1 0xffc035bc /* CAN Controller 1 Mailbox 13 ID1 Register */
387#define CAN1_MB14_DATA0 0xffc035c0 /* CAN Controller 1 Mailbox 14 Data 0 Register */
388#define CAN1_MB14_DATA1 0xffc035c4 /* CAN Controller 1 Mailbox 14 Data 1 Register */
389#define CAN1_MB14_DATA2 0xffc035c8 /* CAN Controller 1 Mailbox 14 Data 2 Register */
390#define CAN1_MB14_DATA3 0xffc035cc /* CAN Controller 1 Mailbox 14 Data 3 Register */
391#define CAN1_MB14_LENGTH 0xffc035d0 /* CAN Controller 1 Mailbox 14 Length Register */
392#define CAN1_MB14_TIMESTAMP 0xffc035d4 /* CAN Controller 1 Mailbox 14 Timestamp Register */
393#define CAN1_MB14_ID0 0xffc035d8 /* CAN Controller 1 Mailbox 14 ID0 Register */
394#define CAN1_MB14_ID1 0xffc035dc /* CAN Controller 1 Mailbox 14 ID1 Register */
395#define CAN1_MB15_DATA0 0xffc035e0 /* CAN Controller 1 Mailbox 15 Data 0 Register */
396#define CAN1_MB15_DATA1 0xffc035e4 /* CAN Controller 1 Mailbox 15 Data 1 Register */
397#define CAN1_MB15_DATA2 0xffc035e8 /* CAN Controller 1 Mailbox 15 Data 2 Register */
398#define CAN1_MB15_DATA3 0xffc035ec /* CAN Controller 1 Mailbox 15 Data 3 Register */
399#define CAN1_MB15_LENGTH 0xffc035f0 /* CAN Controller 1 Mailbox 15 Length Register */
400#define CAN1_MB15_TIMESTAMP 0xffc035f4 /* CAN Controller 1 Mailbox 15 Timestamp Register */
401#define CAN1_MB15_ID0 0xffc035f8 /* CAN Controller 1 Mailbox 15 ID0 Register */
402#define CAN1_MB15_ID1 0xffc035fc /* CAN Controller 1 Mailbox 15 ID1 Register */
403
404/* CAN Controller 1 Mailbox Data Registers */
405
406#define CAN1_MB16_DATA0 0xffc03600 /* CAN Controller 1 Mailbox 16 Data 0 Register */
407#define CAN1_MB16_DATA1 0xffc03604 /* CAN Controller 1 Mailbox 16 Data 1 Register */
408#define CAN1_MB16_DATA2 0xffc03608 /* CAN Controller 1 Mailbox 16 Data 2 Register */
409#define CAN1_MB16_DATA3 0xffc0360c /* CAN Controller 1 Mailbox 16 Data 3 Register */
410#define CAN1_MB16_LENGTH 0xffc03610 /* CAN Controller 1 Mailbox 16 Length Register */
411#define CAN1_MB16_TIMESTAMP 0xffc03614 /* CAN Controller 1 Mailbox 16 Timestamp Register */
412#define CAN1_MB16_ID0 0xffc03618 /* CAN Controller 1 Mailbox 16 ID0 Register */
413#define CAN1_MB16_ID1 0xffc0361c /* CAN Controller 1 Mailbox 16 ID1 Register */
414#define CAN1_MB17_DATA0 0xffc03620 /* CAN Controller 1 Mailbox 17 Data 0 Register */
415#define CAN1_MB17_DATA1 0xffc03624 /* CAN Controller 1 Mailbox 17 Data 1 Register */
416#define CAN1_MB17_DATA2 0xffc03628 /* CAN Controller 1 Mailbox 17 Data 2 Register */
417#define CAN1_MB17_DATA3 0xffc0362c /* CAN Controller 1 Mailbox 17 Data 3 Register */
418#define CAN1_MB17_LENGTH 0xffc03630 /* CAN Controller 1 Mailbox 17 Length Register */
419#define CAN1_MB17_TIMESTAMP 0xffc03634 /* CAN Controller 1 Mailbox 17 Timestamp Register */
420#define CAN1_MB17_ID0 0xffc03638 /* CAN Controller 1 Mailbox 17 ID0 Register */
421#define CAN1_MB17_ID1 0xffc0363c /* CAN Controller 1 Mailbox 17 ID1 Register */
422#define CAN1_MB18_DATA0 0xffc03640 /* CAN Controller 1 Mailbox 18 Data 0 Register */
423#define CAN1_MB18_DATA1 0xffc03644 /* CAN Controller 1 Mailbox 18 Data 1 Register */
424#define CAN1_MB18_DATA2 0xffc03648 /* CAN Controller 1 Mailbox 18 Data 2 Register */
425#define CAN1_MB18_DATA3 0xffc0364c /* CAN Controller 1 Mailbox 18 Data 3 Register */
426#define CAN1_MB18_LENGTH 0xffc03650 /* CAN Controller 1 Mailbox 18 Length Register */
427#define CAN1_MB18_TIMESTAMP 0xffc03654 /* CAN Controller 1 Mailbox 18 Timestamp Register */
428#define CAN1_MB18_ID0 0xffc03658 /* CAN Controller 1 Mailbox 18 ID0 Register */
429#define CAN1_MB18_ID1 0xffc0365c /* CAN Controller 1 Mailbox 18 ID1 Register */
430#define CAN1_MB19_DATA0 0xffc03660 /* CAN Controller 1 Mailbox 19 Data 0 Register */
431#define CAN1_MB19_DATA1 0xffc03664 /* CAN Controller 1 Mailbox 19 Data 1 Register */
432#define CAN1_MB19_DATA2 0xffc03668 /* CAN Controller 1 Mailbox 19 Data 2 Register */
433#define CAN1_MB19_DATA3 0xffc0366c /* CAN Controller 1 Mailbox 19 Data 3 Register */
434#define CAN1_MB19_LENGTH 0xffc03670 /* CAN Controller 1 Mailbox 19 Length Register */
435#define CAN1_MB19_TIMESTAMP 0xffc03674 /* CAN Controller 1 Mailbox 19 Timestamp Register */
436#define CAN1_MB19_ID0 0xffc03678 /* CAN Controller 1 Mailbox 19 ID0 Register */
437#define CAN1_MB19_ID1 0xffc0367c /* CAN Controller 1 Mailbox 19 ID1 Register */
438#define CAN1_MB20_DATA0 0xffc03680 /* CAN Controller 1 Mailbox 20 Data 0 Register */
439#define CAN1_MB20_DATA1 0xffc03684 /* CAN Controller 1 Mailbox 20 Data 1 Register */
440#define CAN1_MB20_DATA2 0xffc03688 /* CAN Controller 1 Mailbox 20 Data 2 Register */
441#define CAN1_MB20_DATA3 0xffc0368c /* CAN Controller 1 Mailbox 20 Data 3 Register */
442#define CAN1_MB20_LENGTH 0xffc03690 /* CAN Controller 1 Mailbox 20 Length Register */
443#define CAN1_MB20_TIMESTAMP 0xffc03694 /* CAN Controller 1 Mailbox 20 Timestamp Register */
444#define CAN1_MB20_ID0 0xffc03698 /* CAN Controller 1 Mailbox 20 ID0 Register */
445#define CAN1_MB20_ID1 0xffc0369c /* CAN Controller 1 Mailbox 20 ID1 Register */
446#define CAN1_MB21_DATA0 0xffc036a0 /* CAN Controller 1 Mailbox 21 Data 0 Register */
447#define CAN1_MB21_DATA1 0xffc036a4 /* CAN Controller 1 Mailbox 21 Data 1 Register */
448#define CAN1_MB21_DATA2 0xffc036a8 /* CAN Controller 1 Mailbox 21 Data 2 Register */
449#define CAN1_MB21_DATA3 0xffc036ac /* CAN Controller 1 Mailbox 21 Data 3 Register */
450#define CAN1_MB21_LENGTH 0xffc036b0 /* CAN Controller 1 Mailbox 21 Length Register */
451#define CAN1_MB21_TIMESTAMP 0xffc036b4 /* CAN Controller 1 Mailbox 21 Timestamp Register */
452#define CAN1_MB21_ID0 0xffc036b8 /* CAN Controller 1 Mailbox 21 ID0 Register */
453#define CAN1_MB21_ID1 0xffc036bc /* CAN Controller 1 Mailbox 21 ID1 Register */
454#define CAN1_MB22_DATA0 0xffc036c0 /* CAN Controller 1 Mailbox 22 Data 0 Register */
455#define CAN1_MB22_DATA1 0xffc036c4 /* CAN Controller 1 Mailbox 22 Data 1 Register */
456#define CAN1_MB22_DATA2 0xffc036c8 /* CAN Controller 1 Mailbox 22 Data 2 Register */
457#define CAN1_MB22_DATA3 0xffc036cc /* CAN Controller 1 Mailbox 22 Data 3 Register */
458#define CAN1_MB22_LENGTH 0xffc036d0 /* CAN Controller 1 Mailbox 22 Length Register */
459#define CAN1_MB22_TIMESTAMP 0xffc036d4 /* CAN Controller 1 Mailbox 22 Timestamp Register */
460#define CAN1_MB22_ID0 0xffc036d8 /* CAN Controller 1 Mailbox 22 ID0 Register */
461#define CAN1_MB22_ID1 0xffc036dc /* CAN Controller 1 Mailbox 22 ID1 Register */
462#define CAN1_MB23_DATA0 0xffc036e0 /* CAN Controller 1 Mailbox 23 Data 0 Register */
463#define CAN1_MB23_DATA1 0xffc036e4 /* CAN Controller 1 Mailbox 23 Data 1 Register */
464#define CAN1_MB23_DATA2 0xffc036e8 /* CAN Controller 1 Mailbox 23 Data 2 Register */
465#define CAN1_MB23_DATA3 0xffc036ec /* CAN Controller 1 Mailbox 23 Data 3 Register */
466#define CAN1_MB23_LENGTH 0xffc036f0 /* CAN Controller 1 Mailbox 23 Length Register */
467#define CAN1_MB23_TIMESTAMP 0xffc036f4 /* CAN Controller 1 Mailbox 23 Timestamp Register */
468#define CAN1_MB23_ID0 0xffc036f8 /* CAN Controller 1 Mailbox 23 ID0 Register */
469#define CAN1_MB23_ID1 0xffc036fc /* CAN Controller 1 Mailbox 23 ID1 Register */
470#define CAN1_MB24_DATA0 0xffc03700 /* CAN Controller 1 Mailbox 24 Data 0 Register */
471#define CAN1_MB24_DATA1 0xffc03704 /* CAN Controller 1 Mailbox 24 Data 1 Register */
472#define CAN1_MB24_DATA2 0xffc03708 /* CAN Controller 1 Mailbox 24 Data 2 Register */
473#define CAN1_MB24_DATA3 0xffc0370c /* CAN Controller 1 Mailbox 24 Data 3 Register */
474#define CAN1_MB24_LENGTH 0xffc03710 /* CAN Controller 1 Mailbox 24 Length Register */
475#define CAN1_MB24_TIMESTAMP 0xffc03714 /* CAN Controller 1 Mailbox 24 Timestamp Register */
476#define CAN1_MB24_ID0 0xffc03718 /* CAN Controller 1 Mailbox 24 ID0 Register */
477#define CAN1_MB24_ID1 0xffc0371c /* CAN Controller 1 Mailbox 24 ID1 Register */
478#define CAN1_MB25_DATA0 0xffc03720 /* CAN Controller 1 Mailbox 25 Data 0 Register */
479#define CAN1_MB25_DATA1 0xffc03724 /* CAN Controller 1 Mailbox 25 Data 1 Register */
480#define CAN1_MB25_DATA2 0xffc03728 /* CAN Controller 1 Mailbox 25 Data 2 Register */
481#define CAN1_MB25_DATA3 0xffc0372c /* CAN Controller 1 Mailbox 25 Data 3 Register */
482#define CAN1_MB25_LENGTH 0xffc03730 /* CAN Controller 1 Mailbox 25 Length Register */
483#define CAN1_MB25_TIMESTAMP 0xffc03734 /* CAN Controller 1 Mailbox 25 Timestamp Register */
484#define CAN1_MB25_ID0 0xffc03738 /* CAN Controller 1 Mailbox 25 ID0 Register */
485#define CAN1_MB25_ID1 0xffc0373c /* CAN Controller 1 Mailbox 25 ID1 Register */
486#define CAN1_MB26_DATA0 0xffc03740 /* CAN Controller 1 Mailbox 26 Data 0 Register */
487#define CAN1_MB26_DATA1 0xffc03744 /* CAN Controller 1 Mailbox 26 Data 1 Register */
488#define CAN1_MB26_DATA2 0xffc03748 /* CAN Controller 1 Mailbox 26 Data 2 Register */
489#define CAN1_MB26_DATA3 0xffc0374c /* CAN Controller 1 Mailbox 26 Data 3 Register */
490#define CAN1_MB26_LENGTH 0xffc03750 /* CAN Controller 1 Mailbox 26 Length Register */
491#define CAN1_MB26_TIMESTAMP 0xffc03754 /* CAN Controller 1 Mailbox 26 Timestamp Register */
492#define CAN1_MB26_ID0 0xffc03758 /* CAN Controller 1 Mailbox 26 ID0 Register */
493#define CAN1_MB26_ID1 0xffc0375c /* CAN Controller 1 Mailbox 26 ID1 Register */
494#define CAN1_MB27_DATA0 0xffc03760 /* CAN Controller 1 Mailbox 27 Data 0 Register */
495#define CAN1_MB27_DATA1 0xffc03764 /* CAN Controller 1 Mailbox 27 Data 1 Register */
496#define CAN1_MB27_DATA2 0xffc03768 /* CAN Controller 1 Mailbox 27 Data 2 Register */
497#define CAN1_MB27_DATA3 0xffc0376c /* CAN Controller 1 Mailbox 27 Data 3 Register */
498#define CAN1_MB27_LENGTH 0xffc03770 /* CAN Controller 1 Mailbox 27 Length Register */
499#define CAN1_MB27_TIMESTAMP 0xffc03774 /* CAN Controller 1 Mailbox 27 Timestamp Register */
500#define CAN1_MB27_ID0 0xffc03778 /* CAN Controller 1 Mailbox 27 ID0 Register */
501#define CAN1_MB27_ID1 0xffc0377c /* CAN Controller 1 Mailbox 27 ID1 Register */
502#define CAN1_MB28_DATA0 0xffc03780 /* CAN Controller 1 Mailbox 28 Data 0 Register */
503#define CAN1_MB28_DATA1 0xffc03784 /* CAN Controller 1 Mailbox 28 Data 1 Register */
504#define CAN1_MB28_DATA2 0xffc03788 /* CAN Controller 1 Mailbox 28 Data 2 Register */
505#define CAN1_MB28_DATA3 0xffc0378c /* CAN Controller 1 Mailbox 28 Data 3 Register */
506#define CAN1_MB28_LENGTH 0xffc03790 /* CAN Controller 1 Mailbox 28 Length Register */
507#define CAN1_MB28_TIMESTAMP 0xffc03794 /* CAN Controller 1 Mailbox 28 Timestamp Register */
508#define CAN1_MB28_ID0 0xffc03798 /* CAN Controller 1 Mailbox 28 ID0 Register */
509#define CAN1_MB28_ID1 0xffc0379c /* CAN Controller 1 Mailbox 28 ID1 Register */
510#define CAN1_MB29_DATA0 0xffc037a0 /* CAN Controller 1 Mailbox 29 Data 0 Register */
511#define CAN1_MB29_DATA1 0xffc037a4 /* CAN Controller 1 Mailbox 29 Data 1 Register */
512#define CAN1_MB29_DATA2 0xffc037a8 /* CAN Controller 1 Mailbox 29 Data 2 Register */
513#define CAN1_MB29_DATA3 0xffc037ac /* CAN Controller 1 Mailbox 29 Data 3 Register */
514#define CAN1_MB29_LENGTH 0xffc037b0 /* CAN Controller 1 Mailbox 29 Length Register */
515#define CAN1_MB29_TIMESTAMP 0xffc037b4 /* CAN Controller 1 Mailbox 29 Timestamp Register */
516#define CAN1_MB29_ID0 0xffc037b8 /* CAN Controller 1 Mailbox 29 ID0 Register */
517#define CAN1_MB29_ID1 0xffc037bc /* CAN Controller 1 Mailbox 29 ID1 Register */
518#define CAN1_MB30_DATA0 0xffc037c0 /* CAN Controller 1 Mailbox 30 Data 0 Register */
519#define CAN1_MB30_DATA1 0xffc037c4 /* CAN Controller 1 Mailbox 30 Data 1 Register */
520#define CAN1_MB30_DATA2 0xffc037c8 /* CAN Controller 1 Mailbox 30 Data 2 Register */
521#define CAN1_MB30_DATA3 0xffc037cc /* CAN Controller 1 Mailbox 30 Data 3 Register */
522#define CAN1_MB30_LENGTH 0xffc037d0 /* CAN Controller 1 Mailbox 30 Length Register */
523#define CAN1_MB30_TIMESTAMP 0xffc037d4 /* CAN Controller 1 Mailbox 30 Timestamp Register */
524#define CAN1_MB30_ID0 0xffc037d8 /* CAN Controller 1 Mailbox 30 ID0 Register */
525#define CAN1_MB30_ID1 0xffc037dc /* CAN Controller 1 Mailbox 30 ID1 Register */
526#define CAN1_MB31_DATA0 0xffc037e0 /* CAN Controller 1 Mailbox 31 Data 0 Register */
527#define CAN1_MB31_DATA1 0xffc037e4 /* CAN Controller 1 Mailbox 31 Data 1 Register */
528#define CAN1_MB31_DATA2 0xffc037e8 /* CAN Controller 1 Mailbox 31 Data 2 Register */
529#define CAN1_MB31_DATA3 0xffc037ec /* CAN Controller 1 Mailbox 31 Data 3 Register */
530#define CAN1_MB31_LENGTH 0xffc037f0 /* CAN Controller 1 Mailbox 31 Length Register */
531#define CAN1_MB31_TIMESTAMP 0xffc037f4 /* CAN Controller 1 Mailbox 31 Timestamp Register */
532#define CAN1_MB31_ID0 0xffc037f8 /* CAN Controller 1 Mailbox 31 ID0 Register */
533#define CAN1_MB31_ID1 0xffc037fc /* CAN Controller 1 Mailbox 31 ID1 Register */
534
535/* ATAPI Registers */
536
537#define ATAPI_CONTROL 0xffc03800 /* ATAPI Control Register */
538#define ATAPI_STATUS 0xffc03804 /* ATAPI Status Register */
539#define ATAPI_DEV_ADDR 0xffc03808 /* ATAPI Device Register Address */
540#define ATAPI_DEV_TXBUF 0xffc0380c /* ATAPI Device Register Write Data */
541#define ATAPI_DEV_RXBUF 0xffc03810 /* ATAPI Device Register Read Data */
542#define ATAPI_INT_MASK 0xffc03814 /* ATAPI Interrupt Mask Register */
543#define ATAPI_INT_STATUS 0xffc03818 /* ATAPI Interrupt Status Register */
544#define ATAPI_XFER_LEN 0xffc0381c /* ATAPI Length of Transfer */
545#define ATAPI_LINE_STATUS 0xffc03820 /* ATAPI Line Status */
546#define ATAPI_SM_STATE 0xffc03824 /* ATAPI State Machine Status */
547#define ATAPI_TERMINATE 0xffc03828 /* ATAPI Host Terminate */
548#define ATAPI_PIO_TFRCNT 0xffc0382c /* ATAPI PIO mode transfer count */
549#define ATAPI_DMA_TFRCNT 0xffc03830 /* ATAPI DMA mode transfer count */
550#define ATAPI_UMAIN_TFRCNT 0xffc03834 /* ATAPI UDMAIN transfer count */
551#define ATAPI_UDMAOUT_TFRCNT 0xffc03838 /* ATAPI UDMAOUT transfer count */
552#define ATAPI_REG_TIM_0 0xffc03840 /* ATAPI Register Transfer Timing 0 */
553#define ATAPI_PIO_TIM_0 0xffc03844 /* ATAPI PIO Timing 0 Register */
554#define ATAPI_PIO_TIM_1 0xffc03848 /* ATAPI PIO Timing 1 Register */
555#define ATAPI_MULTI_TIM_0 0xffc03850 /* ATAPI Multi-DMA Timing 0 Register */
556#define ATAPI_MULTI_TIM_1 0xffc03854 /* ATAPI Multi-DMA Timing 1 Register */
557#define ATAPI_MULTI_TIM_2 0xffc03858 /* ATAPI Multi-DMA Timing 2 Register */
558#define ATAPI_ULTRA_TIM_0 0xffc03860 /* ATAPI Ultra-DMA Timing 0 Register */
559#define ATAPI_ULTRA_TIM_1 0xffc03864 /* ATAPI Ultra-DMA Timing 1 Register */
560#define ATAPI_ULTRA_TIM_2 0xffc03868 /* ATAPI Ultra-DMA Timing 2 Register */
561#define ATAPI_ULTRA_TIM_3 0xffc0386c /* ATAPI Ultra-DMA Timing 3 Register */
562
563/* SDH Registers */
564
565#define SDH_PWR_CTL 0xffc03900 /* SDH Power Control */
566#define SDH_CLK_CTL 0xffc03904 /* SDH Clock Control */
567#define SDH_ARGUMENT 0xffc03908 /* SDH Argument */
568#define SDH_COMMAND 0xffc0390c /* SDH Command */
569#define SDH_RESP_CMD 0xffc03910 /* SDH Response Command */
570#define SDH_RESPONSE0 0xffc03914 /* SDH Response0 */
571#define SDH_RESPONSE1 0xffc03918 /* SDH Response1 */
572#define SDH_RESPONSE2 0xffc0391c /* SDH Response2 */
573#define SDH_RESPONSE3 0xffc03920 /* SDH Response3 */
574#define SDH_DATA_TIMER 0xffc03924 /* SDH Data Timer */
575#define SDH_DATA_LGTH 0xffc03928 /* SDH Data Length */
576#define SDH_DATA_CTL 0xffc0392c /* SDH Data Control */
577#define SDH_DATA_CNT 0xffc03930 /* SDH Data Counter */
578#define SDH_STATUS 0xffc03934 /* SDH Status */
579#define SDH_STATUS_CLR 0xffc03938 /* SDH Status Clear */
580#define SDH_MASK0 0xffc0393c /* SDH Interrupt0 Mask */
581#define SDH_MASK1 0xffc03940 /* SDH Interrupt1 Mask */
582#define SDH_FIFO_CNT 0xffc03948 /* SDH FIFO Counter */
583#define SDH_FIFO 0xffc03980 /* SDH Data FIFO */
584#define SDH_E_STATUS 0xffc039c0 /* SDH Exception Status */
585#define SDH_E_MASK 0xffc039c4 /* SDH Exception Mask */
586#define SDH_CFG 0xffc039c8 /* SDH Configuration */
587#define SDH_RD_WAIT_EN 0xffc039cc /* SDH Read Wait Enable */
588#define SDH_PID0 0xffc039d0 /* SDH Peripheral Identification0 */
589#define SDH_PID1 0xffc039d4 /* SDH Peripheral Identification1 */
590#define SDH_PID2 0xffc039d8 /* SDH Peripheral Identification2 */
591#define SDH_PID3 0xffc039dc /* SDH Peripheral Identification3 */
592#define SDH_PID4 0xffc039e0 /* SDH Peripheral Identification4 */
593#define SDH_PID5 0xffc039e4 /* SDH Peripheral Identification5 */
594#define SDH_PID6 0xffc039e8 /* SDH Peripheral Identification6 */
595#define SDH_PID7 0xffc039ec /* SDH Peripheral Identification7 */
596
597/* HOST Port Registers */
598
599#define HOST_CONTROL 0xffc03a00 /* HOST Control Register */
600#define HOST_STATUS 0xffc03a04 /* HOST Status Register */
601#define HOST_TIMEOUT 0xffc03a08 /* HOST Acknowledge Mode Timeout Register */
602
603/* USB Control Registers */
604
605#define USB_FADDR 0xffc03c00 /* Function address register */
606#define USB_POWER 0xffc03c04 /* Power management register */
607#define USB_INTRTX 0xffc03c08 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
608#define USB_INTRRX 0xffc03c0c /* Interrupt register for Rx endpoints 1 to 7 */
609#define USB_INTRTXE 0xffc03c10 /* Interrupt enable register for IntrTx */
610#define USB_INTRRXE 0xffc03c14 /* Interrupt enable register for IntrRx */
611#define USB_INTRUSB 0xffc03c18 /* Interrupt register for common USB interrupts */
612#define USB_INTRUSBE 0xffc03c1c /* Interrupt enable register for IntrUSB */
613#define USB_FRAME 0xffc03c20 /* USB frame number */
614#define USB_INDEX 0xffc03c24 /* Index register for selecting the indexed endpoint registers */
615#define USB_TESTMODE 0xffc03c28 /* Enabled USB 20 test modes */
616#define USB_GLOBINTR 0xffc03c2c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
617#define USB_GLOBAL_CTL 0xffc03c30 /* Global Clock Control for the core */
618
619/* USB Packet Control Registers */
620
621#define USB_TX_MAX_PACKET 0xffc03c40 /* Maximum packet size for Host Tx endpoint */
622#define USB_CSR0 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
623#define USB_TXCSR 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
624#define USB_RX_MAX_PACKET 0xffc03c48 /* Maximum packet size for Host Rx endpoint */
625#define USB_RXCSR 0xffc03c4c /* Control Status register for Host Rx endpoint */
626#define USB_COUNT0 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
627#define USB_RXCOUNT 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
628#define USB_TXTYPE 0xffc03c54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
629#define USB_NAKLIMIT0 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
630#define USB_TXINTERVAL 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
631#define USB_RXTYPE 0xffc03c5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
632#define USB_RXINTERVAL 0xffc03c60 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
633#define USB_TXCOUNT 0xffc03c68 /* Number of bytes to be written to the selected endpoint Tx FIFO */
634
635/* USB Endpoint FIFO Registers */
636
637#define USB_EP0_FIFO 0xffc03c80 /* Endpoint 0 FIFO */
638#define USB_EP1_FIFO 0xffc03c88 /* Endpoint 1 FIFO */
639#define USB_EP2_FIFO 0xffc03c90 /* Endpoint 2 FIFO */
640#define USB_EP3_FIFO 0xffc03c98 /* Endpoint 3 FIFO */
641#define USB_EP4_FIFO 0xffc03ca0 /* Endpoint 4 FIFO */
642#define USB_EP5_FIFO 0xffc03ca8 /* Endpoint 5 FIFO */
643#define USB_EP6_FIFO 0xffc03cb0 /* Endpoint 6 FIFO */
644#define USB_EP7_FIFO 0xffc03cb8 /* Endpoint 7 FIFO */
645
646/* USB OTG Control Registers */
647
648#define USB_OTG_DEV_CTL 0xffc03d00 /* OTG Device Control Register */
649#define USB_OTG_VBUS_IRQ 0xffc03d04 /* OTG VBUS Control Interrupts */
650#define USB_OTG_VBUS_MASK 0xffc03d08 /* VBUS Control Interrupt Enable */
651
652/* USB Phy Control Registers */
653
654#define USB_LINKINFO 0xffc03d48 /* Enables programming of some PHY-side delays */
655#define USB_VPLEN 0xffc03d4c /* Determines duration of VBUS pulse for VBUS charging */
656#define USB_HS_EOF1 0xffc03d50 /* Time buffer for High-Speed transactions */
657#define USB_FS_EOF1 0xffc03d54 /* Time buffer for Full-Speed transactions */
658#define USB_LS_EOF1 0xffc03d58 /* Time buffer for Low-Speed transactions */
659
660/* (APHY_CNTRL is for ADI usage only) */
661
662#define USB_APHY_CNTRL 0xffc03de0 /* Register that increases visibility of Analog PHY */
663
664/* (APHY_CALIB is for ADI usage only) */
665
666#define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */
667#define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
668
669/* (PHY_TEST is for ADI usage only) */
670
671#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */
672#define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */
673#define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
674
675/* USB Endpoint 0 Control Registers */
676
677#define USB_EP_NI0_TXMAXP 0xffc03e00 /* Maximum packet size for Host Tx endpoint0 */
678#define USB_EP_NI0_TXCSR 0xffc03e04 /* Control Status register for endpoint 0 */
679#define USB_EP_NI0_RXMAXP 0xffc03e08 /* Maximum packet size for Host Rx endpoint0 */
680#define USB_EP_NI0_RXCSR 0xffc03e0c /* Control Status register for Host Rx endpoint0 */
681#define USB_EP_NI0_RXCOUNT 0xffc03e10 /* Number of bytes received in endpoint 0 FIFO */
682#define USB_EP_NI0_TXTYPE 0xffc03e14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
683#define USB_EP_NI0_TXINTERVAL 0xffc03e18 /* Sets the NAK response timeout on Endpoint 0 */
684#define USB_EP_NI0_RXTYPE 0xffc03e1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
685#define USB_EP_NI0_RXINTERVAL 0xffc03e20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint0 */
686
687/* USB Endpoint 1 Control Registers */
688
689#define USB_EP_NI0_TXCOUNT 0xffc03e28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
690#define USB_EP_NI1_TXMAXP 0xffc03e40 /* Maximum packet size for Host Tx endpoint1 */
691#define USB_EP_NI1_TXCSR 0xffc03e44 /* Control Status register for endpoint1 */
692#define USB_EP_NI1_RXMAXP 0xffc03e48 /* Maximum packet size for Host Rx endpoint1 */
693#define USB_EP_NI1_RXCSR 0xffc03e4c /* Control Status register for Host Rx endpoint1 */
694#define USB_EP_NI1_RXCOUNT 0xffc03e50 /* Number of bytes received in endpoint1 FIFO */
695#define USB_EP_NI1_TXTYPE 0xffc03e54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
696#define USB_EP_NI1_TXINTERVAL 0xffc03e58 /* Sets the NAK response timeout on Endpoint1 */
697#define USB_EP_NI1_RXTYPE 0xffc03e5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
698#define USB_EP_NI1_RXINTERVAL 0xffc03e60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint1 */
699
700/* USB Endpoint 2 Control Registers */
701
702#define USB_EP_NI1_TXCOUNT 0xffc03e68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
703#define USB_EP_NI2_TXMAXP 0xffc03e80 /* Maximum packet size for Host Tx endpoint2 */
704#define USB_EP_NI2_TXCSR 0xffc03e84 /* Control Status register for endpoint2 */
705#define USB_EP_NI2_RXMAXP 0xffc03e88 /* Maximum packet size for Host Rx endpoint2 */
706#define USB_EP_NI2_RXCSR 0xffc03e8c /* Control Status register for Host Rx endpoint2 */
707#define USB_EP_NI2_RXCOUNT 0xffc03e90 /* Number of bytes received in endpoint2 FIFO */
708#define USB_EP_NI2_TXTYPE 0xffc03e94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
709#define USB_EP_NI2_TXINTERVAL 0xffc03e98 /* Sets the NAK response timeout on Endpoint2 */
710#define USB_EP_NI2_RXTYPE 0xffc03e9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
711#define USB_EP_NI2_RXINTERVAL 0xffc03ea0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint2 */
712
713/* USB Endpoint 3 Control Registers */
714
715#define USB_EP_NI2_TXCOUNT 0xffc03ea8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
716#define USB_EP_NI3_TXMAXP 0xffc03ec0 /* Maximum packet size for Host Tx endpoint3 */
717#define USB_EP_NI3_TXCSR 0xffc03ec4 /* Control Status register for endpoint3 */
718#define USB_EP_NI3_RXMAXP 0xffc03ec8 /* Maximum packet size for Host Rx endpoint3 */
719#define USB_EP_NI3_RXCSR 0xffc03ecc /* Control Status register for Host Rx endpoint3 */
720#define USB_EP_NI3_RXCOUNT 0xffc03ed0 /* Number of bytes received in endpoint3 FIFO */
721#define USB_EP_NI3_TXTYPE 0xffc03ed4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
722#define USB_EP_NI3_TXINTERVAL 0xffc03ed8 /* Sets the NAK response timeout on Endpoint3 */
723#define USB_EP_NI3_RXTYPE 0xffc03edc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
724#define USB_EP_NI3_RXINTERVAL 0xffc03ee0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint3 */
725
726/* USB Endpoint 4 Control Registers */
727
728#define USB_EP_NI3_TXCOUNT 0xffc03ee8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
729#define USB_EP_NI4_TXMAXP 0xffc03f00 /* Maximum packet size for Host Tx endpoint4 */
730#define USB_EP_NI4_TXCSR 0xffc03f04 /* Control Status register for endpoint4 */
731#define USB_EP_NI4_RXMAXP 0xffc03f08 /* Maximum packet size for Host Rx endpoint4 */
732#define USB_EP_NI4_RXCSR 0xffc03f0c /* Control Status register for Host Rx endpoint4 */
733#define USB_EP_NI4_RXCOUNT 0xffc03f10 /* Number of bytes received in endpoint4 FIFO */
734#define USB_EP_NI4_TXTYPE 0xffc03f14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
735#define USB_EP_NI4_TXINTERVAL 0xffc03f18 /* Sets the NAK response timeout on Endpoint4 */
736#define USB_EP_NI4_RXTYPE 0xffc03f1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
737#define USB_EP_NI4_RXINTERVAL 0xffc03f20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint4 */
738
739/* USB Endpoint 5 Control Registers */
740
741#define USB_EP_NI4_TXCOUNT 0xffc03f28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
742#define USB_EP_NI5_TXMAXP 0xffc03f40 /* Maximum packet size for Host Tx endpoint5 */
743#define USB_EP_NI5_TXCSR 0xffc03f44 /* Control Status register for endpoint5 */
744#define USB_EP_NI5_RXMAXP 0xffc03f48 /* Maximum packet size for Host Rx endpoint5 */
745#define USB_EP_NI5_RXCSR 0xffc03f4c /* Control Status register for Host Rx endpoint5 */
746#define USB_EP_NI5_RXCOUNT 0xffc03f50 /* Number of bytes received in endpoint5 FIFO */
747#define USB_EP_NI5_TXTYPE 0xffc03f54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
748#define USB_EP_NI5_TXINTERVAL 0xffc03f58 /* Sets the NAK response timeout on Endpoint5 */
749#define USB_EP_NI5_RXTYPE 0xffc03f5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
750#define USB_EP_NI5_RXINTERVAL 0xffc03f60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint5 */
751
752/* USB Endpoint 6 Control Registers */
753
754#define USB_EP_NI5_TXCOUNT 0xffc03f68 /* Number of bytes to be written to the H145endpoint5 Tx FIFO */
755#define USB_EP_NI6_TXMAXP 0xffc03f80 /* Maximum packet size for Host Tx endpoint6 */
756#define USB_EP_NI6_TXCSR 0xffc03f84 /* Control Status register for endpoint6 */
757#define USB_EP_NI6_RXMAXP 0xffc03f88 /* Maximum packet size for Host Rx endpoint6 */
758#define USB_EP_NI6_RXCSR 0xffc03f8c /* Control Status register for Host Rx endpoint6 */
759#define USB_EP_NI6_RXCOUNT 0xffc03f90 /* Number of bytes received in endpoint6 FIFO */
760#define USB_EP_NI6_TXTYPE 0xffc03f94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
761#define USB_EP_NI6_TXINTERVAL 0xffc03f98 /* Sets the NAK response timeout on Endpoint6 */
762#define USB_EP_NI6_RXTYPE 0xffc03f9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
763#define USB_EP_NI6_RXINTERVAL 0xffc03fa0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint6 */
764
765/* USB Endpoint 7 Control Registers */
766
767#define USB_EP_NI6_TXCOUNT 0xffc03fa8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
768#define USB_EP_NI7_TXMAXP 0xffc03fc0 /* Maximum packet size for Host Tx endpoint7 */
769#define USB_EP_NI7_TXCSR 0xffc03fc4 /* Control Status register for endpoint7 */
770#define USB_EP_NI7_RXMAXP 0xffc03fc8 /* Maximum packet size for Host Rx endpoint7 */
771#define USB_EP_NI7_RXCSR 0xffc03fcc /* Control Status register for Host Rx endpoint7 */
772#define USB_EP_NI7_RXCOUNT 0xffc03fd0 /* Number of bytes received in endpoint7 FIFO */
773#define USB_EP_NI7_TXTYPE 0xffc03fd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
774#define USB_EP_NI7_TXINTERVAL 0xffc03fd8 /* Sets the NAK response timeout on Endpoint7 */
775#define USB_EP_NI7_RXTYPE 0xffc03fdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
776#define USB_EP_NI7_RXINTERVAL 0xffc03ff0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint7 */
777#define USB_EP_NI7_TXCOUNT 0xffc03ff8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
778#define USB_DMA_INTERRUPT 0xffc04000 /* Indicates pending interrupts for the DMA channels */
779
780/* USB Channel 0 Config Registers */
781
782#define USB_DMA0CONTROL 0xffc04004 /* DMA master channel 0 configuration */
783#define USB_DMA0ADDRLOW 0xffc04008 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
784#define USB_DMA0ADDRHIGH 0xffc0400c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
785#define USB_DMA0COUNTLOW 0xffc04010 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
786#define USB_DMA0COUNTHIGH 0xffc04014 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
787
788/* USB Channel 1 Config Registers */
789
790#define USB_DMA1CONTROL 0xffc04024 /* DMA master channel 1 configuration */
791#define USB_DMA1ADDRLOW 0xffc04028 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
792#define USB_DMA1ADDRHIGH 0xffc0402c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
793#define USB_DMA1COUNTLOW 0xffc04030 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
794#define USB_DMA1COUNTHIGH 0xffc04034 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
795
796/* USB Channel 2 Config Registers */
797
798#define USB_DMA2CONTROL 0xffc04044 /* DMA master channel 2 configuration */
799#define USB_DMA2ADDRLOW 0xffc04048 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
800#define USB_DMA2ADDRHIGH 0xffc0404c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
801#define USB_DMA2COUNTLOW 0xffc04050 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
802#define USB_DMA2COUNTHIGH 0xffc04054 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
803
804/* USB Channel 3 Config Registers */
805
806#define USB_DMA3CONTROL 0xffc04064 /* DMA master channel 3 configuration */
807#define USB_DMA3ADDRLOW 0xffc04068 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
808#define USB_DMA3ADDRHIGH 0xffc0406c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
809#define USB_DMA3COUNTLOW 0xffc04070 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
810#define USB_DMA3COUNTHIGH 0xffc04074 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
811
812/* USB Channel 4 Config Registers */
813
814#define USB_DMA4CONTROL 0xffc04084 /* DMA master channel 4 configuration */
815#define USB_DMA4ADDRLOW 0xffc04088 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
816#define USB_DMA4ADDRHIGH 0xffc0408c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
817#define USB_DMA4COUNTLOW 0xffc04090 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
818#define USB_DMA4COUNTHIGH 0xffc04094 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
819
820/* USB Channel 5 Config Registers */
821
822#define USB_DMA5CONTROL 0xffc040a4 /* DMA master channel 5 configuration */
823#define USB_DMA5ADDRLOW 0xffc040a8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
824#define USB_DMA5ADDRHIGH 0xffc040ac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
825#define USB_DMA5COUNTLOW 0xffc040b0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
826#define USB_DMA5COUNTHIGH 0xffc040b4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
827
828/* USB Channel 6 Config Registers */
829
830#define USB_DMA6CONTROL 0xffc040c4 /* DMA master channel 6 configuration */
831#define USB_DMA6ADDRLOW 0xffc040c8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
832#define USB_DMA6ADDRHIGH 0xffc040cc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
833#define USB_DMA6COUNTLOW 0xffc040d0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
834#define USB_DMA6COUNTHIGH 0xffc040d4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
835
836/* USB Channel 7 Config Registers */
837
838#define USB_DMA7CONTROL 0xffc040e4 /* DMA master channel 7 configuration */
839#define USB_DMA7ADDRLOW 0xffc040e8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
840#define USB_DMA7ADDRHIGH 0xffc040ec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
841#define USB_DMA7COUNTLOW 0xffc040f0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
842#define USB_DMA7COUNTHIGH 0xffc040f4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
843
844/* Keypad Registers */
845
846#define KPAD_CTL 0xffc04100 /* Controls keypad module enable and disable */
847#define KPAD_PRESCALE 0xffc04104 /* Establish a time base for programing the KPAD_MSEL register */
848#define KPAD_MSEL 0xffc04108 /* Selects delay parameters for keypad interface sensitivity */
849#define KPAD_ROWCOL 0xffc0410c /* Captures the row and column output values of the keys pressed */
850#define KPAD_STAT 0xffc04110 /* Holds and clears the status of the keypad interface interrupt */
851#define KPAD_SOFTEVAL 0xffc04114 /* Lets software force keypad interface to check for keys being pressed */
852
853/* Pixel Compositor (PIXC) Registers */
854
855#define PIXC_CTL 0xffc04400 /* Overlay enable, resampling mode, I/O data format, transparency enable, watermark level, FIFO status */
856#define PIXC_PPL 0xffc04404 /* Holds the number of pixels per line of the display */
857#define PIXC_LPF 0xffc04408 /* Holds the number of lines per frame of the display */
858#define PIXC_AHSTART 0xffc0440c /* Contains horizontal start pixel information of the overlay data (set A) */
859#define PIXC_AHEND 0xffc04410 /* Contains horizontal end pixel information of the overlay data (set A) */
860#define PIXC_AVSTART 0xffc04414 /* Contains vertical start pixel information of the overlay data (set A) */
861#define PIXC_AVEND 0xffc04418 /* Contains vertical end pixel information of the overlay data (set A) */
862#define PIXC_ATRANSP 0xffc0441c /* Contains the transparency ratio (set A) */
863#define PIXC_BHSTART 0xffc04420 /* Contains horizontal start pixel information of the overlay data (set B) */
864#define PIXC_BHEND 0xffc04424 /* Contains horizontal end pixel information of the overlay data (set B) */
865#define PIXC_BVSTART 0xffc04428 /* Contains vertical start pixel information of the overlay data (set B) */
866#define PIXC_BVEND 0xffc0442c /* Contains vertical end pixel information of the overlay data (set B) */
867#define PIXC_BTRANSP 0xffc04430 /* Contains the transparency ratio (set B) */
868#define PIXC_INTRSTAT 0xffc0443c /* Overlay interrupt configuration/status */
869#define PIXC_RYCON 0xffc04440 /* Color space conversion matrix register. Contains the R/Y conversion coefficients */
870#define PIXC_GUCON 0xffc04444 /* Color space conversion matrix register. Contains the G/U conversion coefficients */
871#define PIXC_BVCON 0xffc04448 /* Color space conversion matrix register. Contains the B/V conversion coefficients */
872#define PIXC_CCBIAS 0xffc0444c /* Bias values for the color space conversion matrix */
873#define PIXC_TC 0xffc04450 /* Holds the transparent color value */
874
875/* Handshake MDMA 0 Registers */
876
877#define HMDMA0_CONTROL 0xffc04500 /* Handshake MDMA0 Control Register */
878#define HMDMA0_ECINIT 0xffc04504 /* Handshake MDMA0 Initial Edge Count Register */
879#define HMDMA0_BCINIT 0xffc04508 /* Handshake MDMA0 Initial Block Count Register */
880#define HMDMA0_ECURGENT 0xffc0450c /* Handshake MDMA0 Urgent Edge Count Threshhold Register */
881#define HMDMA0_ECOVERFLOW 0xffc04510 /* Handshake MDMA0 Edge Count Overflow Interrupt Register */
882#define HMDMA0_ECOUNT 0xffc04514 /* Handshake MDMA0 Current Edge Count Register */
883#define HMDMA0_BCOUNT 0xffc04518 /* Handshake MDMA0 Current Block Count Register */
884
885/* Handshake MDMA 1 Registers */
886
887#define HMDMA1_CONTROL 0xffc04540 /* Handshake MDMA1 Control Register */
888#define HMDMA1_ECINIT 0xffc04544 /* Handshake MDMA1 Initial Edge Count Register */
889#define HMDMA1_BCINIT 0xffc04548 /* Handshake MDMA1 Initial Block Count Register */
890#define HMDMA1_ECURGENT 0xffc0454c /* Handshake MDMA1 Urgent Edge Count Threshhold Register */
891#define HMDMA1_ECOVERFLOW 0xffc04550 /* Handshake MDMA1 Edge Count Overflow Interrupt Register */
892#define HMDMA1_ECOUNT 0xffc04554 /* Handshake MDMA1 Current Edge Count Register */
893#define HMDMA1_BCOUNT 0xffc04558 /* Handshake MDMA1 Current Block Count Register */
894
895
896/* ********************************************************** */
897/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
898/* and MULTI BIT READ MACROS */
899/* ********************************************************** */
900
901/* Bit masks for PIXC_CTL */
902
903#define PIXC_EN 0x1 /* Pixel Compositor Enable */
904#define OVR_A_EN 0x2 /* Overlay A Enable */
905#define OVR_B_EN 0x4 /* Overlay B Enable */
906#define IMG_FORM 0x8 /* Image Data Format */
907#define OVR_FORM 0x10 /* Overlay Data Format */
908#define OUT_FORM 0x20 /* Output Data Format */
909#define UDS_MOD 0x40 /* Resampling Mode */
910#define TC_EN 0x80 /* Transparent Color Enable */
911#define IMG_STAT 0x300 /* Image FIFO Status */
912#define OVR_STAT 0xc00 /* Overlay FIFO Status */
913#define WM_LVL 0x3000 /* FIFO Watermark Level */
914
915/* Bit masks for PIXC_AHSTART */
916
917#define A_HSTART 0xfff /* Horizontal Start Coordinates */
918
919/* Bit masks for PIXC_AHEND */
920
921#define A_HEND 0xfff /* Horizontal End Coordinates */
922
923/* Bit masks for PIXC_AVSTART */
924
925#define A_VSTART 0x3ff /* Vertical Start Coordinates */
926
927/* Bit masks for PIXC_AVEND */
928
929#define A_VEND 0x3ff /* Vertical End Coordinates */
930
931/* Bit masks for PIXC_ATRANSP */
932
933#define A_TRANSP 0xf /* Transparency Value */
934
935/* Bit masks for PIXC_BHSTART */
936
937#define B_HSTART 0xfff /* Horizontal Start Coordinates */
938
939/* Bit masks for PIXC_BHEND */
940
941#define B_HEND 0xfff /* Horizontal End Coordinates */
942
943/* Bit masks for PIXC_BVSTART */
944
945#define B_VSTART 0x3ff /* Vertical Start Coordinates */
946
947/* Bit masks for PIXC_BVEND */
948
949#define B_VEND 0x3ff /* Vertical End Coordinates */
950
951/* Bit masks for PIXC_BTRANSP */
952
953#define B_TRANSP 0xf /* Transparency Value */
954
955/* Bit masks for PIXC_INTRSTAT */
956
957#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
958#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
959#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
960#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
961
962/* Bit masks for PIXC_RYCON */
963
964#define A11 0x3ff /* A11 in the Coefficient Matrix */
965#define A12 0xffc00 /* A12 in the Coefficient Matrix */
966#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
967#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
968
969/* Bit masks for PIXC_GUCON */
970
971#define A21 0x3ff /* A21 in the Coefficient Matrix */
972#define A22 0xffc00 /* A22 in the Coefficient Matrix */
973#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
974#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
975
976/* Bit masks for PIXC_BVCON */
977
978#define A31 0x3ff /* A31 in the Coefficient Matrix */
979#define A32 0xffc00 /* A32 in the Coefficient Matrix */
980#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
981#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
982
983/* Bit masks for PIXC_CCBIAS */
984
985#define A14 0x3ff /* A14 in the Bias Vector */
986#define A24 0xffc00 /* A24 in the Bias Vector */
987#define A34 0x3ff00000 /* A34 in the Bias Vector */
988
989/* Bit masks for PIXC_TC */
990
991#define RY_TRANS 0xff /* Transparent Color - R/Y Component */
992#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
993#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
994
995/* Bit masks for HOST_CONTROL */
996
997#define HOST_EN 0x1 /* Host Enable */
998#define HOST_END 0x2 /* Host Endianess */
999#define DATA_SIZE 0x4 /* Data Size */
1000#define HOST_RST 0x8 /* Host Reset */
1001#define HRDY_OVR 0x20 /* Host Ready Override */
1002#define INT_MODE 0x40 /* Interrupt Mode */
1003#define BT_EN 0x80 /* Bus Timeout Enable */
1004#define EHW 0x100 /* Enable Host Write */
1005#define EHR 0x200 /* Enable Host Read */
1006#define BDR 0x400 /* Burst DMA Requests */
1007
1008/* Bit masks for HOST_STATUS */
1009
1010#define DMA_READY 0x1 /* DMA Ready */
1011#define FIFOFULL 0x2 /* FIFO Full */
1012#define FIFOEMPTY 0x4 /* FIFO Empty */
1013#define DMA_COMPLETE 0x8 /* DMA Complete */
1014#define HSHK 0x10 /* Host Handshake */
1015#define HSTIMEOUT 0x20 /* Host Timeout */
1016#define HIRQ 0x40 /* Host Interrupt Request */
1017#define ALLOW_CNFG 0x80 /* Allow New Configuration */
1018#define DMA_DIR 0x100 /* DMA Direction */
1019#define BTE 0x200 /* Bus Timeout Enabled */
1020
1021/* Bit masks for HOST_TIMEOUT */
1022
1023#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
1024
1025/* Bit masks for KPAD_CTL */
1026
1027#define KPAD_EN 0x1 /* Keypad Enable */
1028#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
1029#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
1030#define KPAD_COLEN 0xe000 /* Column Enable Width */
1031
1032/* Bit masks for KPAD_PRESCALE */
1033
1034#define KPAD_PRESCALE_VAL 0x3f /* Key Prescale Value */
1035
1036/* Bit masks for KPAD_MSEL */
1037
1038#define DBON_SCALE 0xff /* Debounce Scale Value */
1039#define COLDRV_SCALE 0xff00 /* Column Driver Scale Value */
1040
1041/* Bit masks for KPAD_ROWCOL */
1042
1043#define KPAD_ROW 0xff /* Rows Pressed */
1044#define KPAD_COL 0xff00 /* Columns Pressed */
1045
1046/* Bit masks for KPAD_STAT */
1047
1048#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
1049#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
1050#define KPAD_PRESSED 0x8 /* Key press current status */
1051
1052/* Bit masks for KPAD_SOFTEVAL */
1053
1054#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
1055
1056/* Bit masks for SDH_COMMAND */
1057
1058#define CMD_IDX 0x3f /* Command Index */
1059#define CMD_RSP 0x40 /* Response */
1060#define CMD_L_RSP 0x80 /* Long Response */
1061#define CMD_INT_E 0x100 /* Command Interrupt */
1062#define CMD_PEND_E 0x200 /* Command Pending */
1063#define CMD_E 0x400 /* Command Enable */
1064
1065/* Bit masks for SDH_PWR_CTL */
1066
1067#define PWR_ON 0x3 /* Power On */
1068#if 0
1069#define TBD 0x3c /* TBD */
1070#endif
1071#define SD_CMD_OD 0x40 /* Open Drain Output */
1072#define ROD_CTL 0x80 /* Rod Control */
1073
1074/* Bit masks for SDH_CLK_CTL */
1075
1076#define CLKDIV 0xff /* MC_CLK Divisor */
1077#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
1078#define PWR_SV_E 0x200 /* Power Save Enable */
1079#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
1080#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
1081
1082/* Bit masks for SDH_RESP_CMD */
1083
1084#define RESP_CMD 0x3f /* Response Command */
1085
1086/* Bit masks for SDH_DATA_CTL */
1087
1088#define DTX_E 0x1 /* Data Transfer Enable */
1089#define DTX_DIR 0x2 /* Data Transfer Direction */
1090#define DTX_MODE 0x4 /* Data Transfer Mode */
1091#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
1092#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
1093
1094/* Bit masks for SDH_STATUS */
1095
1096#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
1097#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
1098#define CMD_TIME_OUT 0x4 /* CMD Time Out */
1099#define DAT_TIME_OUT 0x8 /* Data Time Out */
1100#define TX_UNDERRUN 0x10 /* Transmit Underrun */
1101#define RX_OVERRUN 0x20 /* Receive Overrun */
1102#define CMD_RESP_END 0x40 /* CMD Response End */
1103#define CMD_SENT 0x80 /* CMD Sent */
1104#define DAT_END 0x100 /* Data End */
1105#define START_BIT_ERR 0x200 /* Start Bit Error */
1106#define DAT_BLK_END 0x400 /* Data Block End */
1107#define CMD_ACT 0x800 /* CMD Active */
1108#define TX_ACT 0x1000 /* Transmit Active */
1109#define RX_ACT 0x2000 /* Receive Active */
1110#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
1111#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
1112#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
1113#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
1114#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
1115#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
1116#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
1117#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
1118
1119/* Bit masks for SDH_STATUS_CLR */
1120
1121#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
1122#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
1123#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
1124#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
1125#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
1126#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
1127#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
1128#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
1129#define DAT_END_STAT 0x100 /* Data End Status */
1130#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
1131#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
1132
1133/* Bit masks for SDH_MASK0 */
1134
1135#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
1136#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
1137#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
1138#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
1139#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
1140#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
1141#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
1142#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
1143#define DAT_END_MASK 0x100 /* Data End Mask */
1144#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
1145#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
1146#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
1147#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
1148#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
1149#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
1150#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
1151#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
1152#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
1153#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
1154#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
1155#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
1156#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
1157
1158/* Bit masks for SDH_FIFO_CNT */
1159
1160#define FIFO_COUNT 0x7fff /* FIFO Count */
1161
1162/* Bit masks for SDH_E_STATUS */
1163
1164#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
1165#define SD_CARD_DET 0x10 /* SD Card Detect */
1166
1167/* Bit masks for SDH_E_MASK */
1168
1169#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
1170#define SCD_MSK 0x40 /* Mask Card Detect */
1171
1172/* Bit masks for SDH_CFG */
1173
1174#define CLKS_EN 0x1 /* Clocks Enable */
1175#define SD4E 0x4 /* SDIO 4-Bit Enable */
1176#define MWE 0x8 /* Moving Window Enable */
1177#define SD_RST 0x10 /* SDMMC Reset */
1178#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
1179#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
1180#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
1181
1182/* Bit masks for SDH_RD_WAIT_EN */
1183
1184#define RWR 0x1 /* Read Wait Request */
1185
1186/* Bit masks for ATAPI_CONTROL */
1187
1188#define PIO_START 0x1 /* Start PIO/Reg Op */
1189#define MULTI_START 0x2 /* Start Multi-DMA Op */
1190#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
1191#define XFER_DIR 0x8 /* Transfer Direction */
1192#define IORDY_EN 0x10 /* IORDY Enable */
1193#define FIFO_FLUSH 0x20 /* Flush FIFOs */
1194#define SOFT_RST 0x40 /* Soft Reset */
1195#define DEV_RST 0x80 /* Device Reset */
1196#define TFRCNT_RST 0x100 /* Trans Count Reset */
1197#define END_ON_TERM 0x200 /* End/Terminate Select */
1198#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
1199#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
1200
1201/* Bit masks for ATAPI_STATUS */
1202
1203#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
1204#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
1205#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
1206#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
1207
1208/* Bit masks for ATAPI_DEV_ADDR */
1209
1210#define DEV_ADDR 0x1f /* Device Address */
1211
1212/* Bit masks for ATAPI_INT_MASK */
1213
1214#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
1215#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
1216#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
1217#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
1218#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
1219#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
1220#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
1221#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
1222#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
1223
1224/* Bit masks for ATAPI_INT_STATUS */
1225
1226#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
1227#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
1228#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
1229#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
1230#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
1231#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
1232#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
1233#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
1234#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
1235
1236/* Bit masks for ATAPI_LINE_STATUS */
1237
1238#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
1239#define ATAPI_DASP 0x2 /* Device dasp to host line status */
1240#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
1241#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
1242#define ATAPI_ADDR 0x70 /* ATAPI address line status */
1243#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
1244#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
1245#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
1246#define ATAPI_DIORN 0x400 /* ATAPI read line status */
1247#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
1248
1249/* Bit masks for ATAPI_SM_STATE */
1250
1251#define PIO_CSTATE 0xf /* PIO mode state machine current state */
1252#define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
1253#define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
1254#define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
1255
1256/* Bit masks for ATAPI_TERMINATE */
1257
1258#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
1259
1260/* Bit masks for ATAPI_REG_TIM_0 */
1261
1262#define T2_REG 0xff /* End of cycle time for register access transfers */
1263#define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
1264
1265/* Bit masks for ATAPI_PIO_TIM_0 */
1266
1267#define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
1268#define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
1269#define T4_REG 0xf000 /* DIOW data hold */
1270
1271/* Bit masks for ATAPI_PIO_TIM_1 */
1272
1273#define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
1274
1275/* Bit masks for ATAPI_MULTI_TIM_0 */
1276
1277#define TD 0xff /* DIOR/DIOW asserted pulsewidth */
1278#define TM 0xff00 /* Time from address valid to DIOR/DIOW */
1279
1280/* Bit masks for ATAPI_MULTI_TIM_1 */
1281
1282#define TKW 0xff /* Selects DIOW negated pulsewidth */
1283#define TKR 0xff00 /* Selects DIOR negated pulsewidth */
1284
1285/* Bit masks for ATAPI_MULTI_TIM_2 */
1286
1287#define TH 0xff /* Selects DIOW data hold */
1288#define TEOC 0xff00 /* Selects end of cycle for DMA */
1289
1290/* Bit masks for ATAPI_ULTRA_TIM_0 */
1291
1292#define TACK 0xff /* Selects setup and hold times for TACK */
1293#define TENV 0xff00 /* Selects envelope time */
1294
1295/* Bit masks for ATAPI_ULTRA_TIM_1 */
1296
1297#define TDVS 0xff /* Selects data valid setup time */
1298#define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
1299
1300/* Bit masks for ATAPI_ULTRA_TIM_2 */
1301
1302#define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
1303#define TMLI 0xff00 /* Selects interlock time */
1304
1305/* Bit masks for ATAPI_ULTRA_TIM_3 */
1306
1307#define TZAH 0xff /* Selects minimum delay required for output */
1308#define READY_PAUSE 0xff00 /* Selects ready to pause */
1309
1310/* Bit masks for TIMER_ENABLE1 */
1311
1312#define TIMEN8 0x1 /* Timer 8 Enable */
1313#define TIMEN9 0x2 /* Timer 9 Enable */
1314#define TIMEN10 0x4 /* Timer 10 Enable */
1315
1316/* Bit masks for TIMER_DISABLE1 */
1317
1318#define TIMDIS8 0x1 /* Timer 8 Disable */
1319#define TIMDIS9 0x2 /* Timer 9 Disable */
1320#define TIMDIS10 0x4 /* Timer 10 Disable */
1321
1322/* Bit masks for TIMER_STATUS1 */
1323
1324#define TIMIL8 0x1 /* Timer 8 Interrupt */
1325#define TIMIL9 0x2 /* Timer 9 Interrupt */
1326#define TIMIL10 0x4 /* Timer 10 Interrupt */
1327#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
1328#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
1329#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
1330#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
1331#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
1332#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
1333
1334/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
1335
1336/* Bit masks for USB_FADDR */
1337
1338#define FUNCTION_ADDRESS 0x7f /* Function address */
1339
1340/* Bit masks for USB_POWER */
1341
1342#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
1343#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
1344#define RESUME_MODE 0x4 /* DMA Mode */
1345#define RESET 0x8 /* Reset indicator */
1346#define HS_MODE 0x10 /* High Speed mode indicator */
1347#define HS_ENABLE 0x20 /* high Speed Enable */
1348#define SOFT_CONN 0x40 /* Soft connect */
1349#define ISO_UPDATE 0x80 /* Isochronous update */
1350
1351/* Bit masks for USB_INTRTX */
1352
1353#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
1354#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
1355#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
1356#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
1357#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
1358#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
1359#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
1360#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
1361
1362/* Bit masks for USB_INTRRX */
1363
1364#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
1365#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
1366#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
1367#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
1368#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
1369#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
1370#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
1371
1372/* Bit masks for USB_INTRTXE */
1373
1374#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
1375#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
1376#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
1377#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
1378#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
1379#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
1380#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
1381#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
1382
1383/* Bit masks for USB_INTRRXE */
1384
1385#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
1386#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
1387#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
1388#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
1389#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
1390#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
1391#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
1392
1393/* Bit masks for USB_INTRUSB */
1394
1395#define SUSPEND_B 0x1 /* Suspend indicator */
1396#define RESUME_B 0x2 /* Resume indicator */
1397#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
1398#define SOF_B 0x8 /* Start of frame */
1399#define CONN_B 0x10 /* Connection indicator */
1400#define DISCON_B 0x20 /* Disconnect indicator */
1401#define SESSION_REQ_B 0x40 /* Session Request */
1402#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
1403
1404/* Bit masks for USB_INTRUSBE */
1405
1406#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
1407#define RESUME_BE 0x2 /* Resume indicator int enable */
1408#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
1409#define SOF_BE 0x8 /* Start of frame int enable */
1410#define CONN_BE 0x10 /* Connection indicator int enable */
1411#define DISCON_BE 0x20 /* Disconnect indicator int enable */
1412#define SESSION_REQ_BE 0x40 /* Session Request int enable */
1413#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
1414
1415/* Bit masks for USB_FRAME */
1416
1417#define FRAME_NUMBER 0x7ff /* Frame number */
1418
1419/* Bit masks for USB_INDEX */
1420
1421#define SELECTED_ENDPOINT 0xf /* selected endpoint */
1422
1423/* Bit masks for USB_GLOBAL_CTL */
1424
1425#define GLOBAL_ENA 0x1 /* enables USB module */
1426#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
1427#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
1428#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
1429#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
1430#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
1431#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
1432#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
1433#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
1434#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
1435#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
1436#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
1437#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
1438#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
1439#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
1440
1441/* Bit masks for USB_OTG_DEV_CTL */
1442
1443#define SESSION 0x1 /* session indicator */
1444#define HOST_REQ 0x2 /* Host negotiation request */
1445#define HOST_MODE 0x4 /* indicates USBDRC is a host */
1446#define VBUS0 0x8 /* Vbus level indicator[0] */
1447#define VBUS1 0x10 /* Vbus level indicator[1] */
1448#define LSDEV 0x20 /* Low-speed indicator */
1449#define FSDEV 0x40 /* Full or High-speed indicator */
1450#define B_DEVICE 0x80 /* A' or 'B' device indicator */
1451
1452/* Bit masks for USB_OTG_VBUS_IRQ */
1453
1454#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
1455#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
1456#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
1457#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
1458#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
1459#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
1460
1461/* Bit masks for USB_OTG_VBUS_MASK */
1462
1463#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
1464#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
1465#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
1466#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
1467#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
1468#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
1469
1470/* Bit masks for USB_CSR0 */
1471
1472#define RXPKTRDY 0x1 /* data packet receive indicator */
1473#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
1474#define STALL_SENT 0x4 /* STALL handshake sent */
1475#define DATAEND 0x8 /* Data end indicator */
1476#define SETUPEND 0x10 /* Setup end */
1477#define SENDSTALL 0x20 /* Send STALL handshake */
1478#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
1479#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
1480#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
1481#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
1482#define SETUPPKT_H 0x8 /* send Setup token host mode */
1483#define ERROR_H 0x10 /* timeout error indicator host mode */
1484#define REQPKT_H 0x20 /* Request an IN transaction host mode */
1485#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
1486#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
1487
1488/* Bit masks for USB_COUNT0 */
1489
1490#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
1491
1492/* Bit masks for USB_NAKLIMIT0 */
1493
1494#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
1495
1496/* Bit masks for USB_TX_MAX_PACKET */
1497
1498#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
1499
1500/* Bit masks for USB_RX_MAX_PACKET */
1501
1502#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
1503
1504/* Bit masks for USB_TXCSR */
1505
1506#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
1507#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
1508#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
1509#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
1510#define STALL_SEND_T 0x10 /* issue a Stall handshake */
1511#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
1512#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
1513#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
1514#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
1515#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
1516#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
1517#define ISO_T 0x4000 /* enable Isochronous transfers */
1518#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
1519#define ERROR_TH 0x4 /* error condition host mode */
1520#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
1521#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
1522
1523/* Bit masks for USB_TXCOUNT */
1524
1525#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
1526
1527/* Bit masks for USB_RXCSR */
1528
1529#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
1530#define FIFO_FULL_R 0x2 /* FIFO not empty */
1531#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
1532#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
1533#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
1534#define STALL_SEND_R 0x20 /* issue a Stall handshake */
1535#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
1536#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
1537#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
1538#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
1539#define DISNYET_R 0x1000 /* disable Nyet handshakes */
1540#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1541#define ISO_R 0x4000 /* enable Isochronous transfers */
1542#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1543#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1544#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1545#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1546#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1547#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1548#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1549
1550/* Bit masks for USB_RXCOUNT */
1551
1552#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
1553
1554/* Bit masks for USB_TXTYPE */
1555
1556#define TARGET_EP_NO_T 0xf /* EP number */
1557#define PROTOCOL_T 0xc /* transfer type */
1558
1559/* Bit masks for USB_TXINTERVAL */
1560
1561#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
1562
1563/* Bit masks for USB_RXTYPE */
1564
1565#define TARGET_EP_NO_R 0xf /* EP number */
1566#define PROTOCOL_R 0xc /* transfer type */
1567
1568/* Bit masks for USB_RXINTERVAL */
1569
1570#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
1571
1572/* Bit masks for USB_DMA_INTERRUPT */
1573
1574#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1575#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1576#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1577#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1578#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1579#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1580#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1581#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1582
1583/* Bit masks for USB_DMAxCONTROL */
1584
1585#define DMA_ENA 0x1 /* DMA enable */
1586#define DIRECTION 0x2 /* direction of DMA transfer */
1587#define MODE 0x4 /* DMA Bus error */
1588#define INT_ENA 0x8 /* Interrupt enable */
1589#define EPNUM 0xf0 /* EP number */
1590#define BUSERROR 0x100 /* DMA Bus error */
1591
1592/* Bit masks for USB_DMAxADDRHIGH */
1593
1594#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
1595
1596/* Bit masks for USB_DMAxADDRLOW */
1597
1598#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
1599
1600/* Bit masks for USB_DMAxCOUNTHIGH */
1601
1602#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
1603
1604/* Bit masks for USB_DMAxCOUNTLOW */
1605
1606#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
1607
1608/* Bit masks for HMDMAx_CONTROL */
1609
1610#define HMDMAEN 0x1 /* Handshake MDMA Enable */
1611#define REP 0x2 /* Handshake MDMA Request Polarity */
1612#define UTE 0x8 /* Urgency Threshold Enable */
1613#define OIE 0x10 /* Overflow Interrupt Enable */
1614#define BDIE 0x20 /* Block Done Interrupt Enable */
1615#define MBDI 0x40 /* Mask Block Done Interrupt */
1616#define DRQ 0x300 /* Handshake MDMA Request Type */
1617#define RBC 0x1000 /* Force Reload of BCOUNT */
1618#define PS 0x2000 /* Pin Status */
1619#define OI 0x4000 /* Overflow Interrupt Generated */
1620#define BDI 0x8000 /* Block Done Interrupt Generated */
1621
1622/* ******************************************* */
1623/* MULTI BIT MACRO ENUMERATIONS */
1624/* ******************************************* */
1625
1626
1627#endif /* _DEF_BF548_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF549.h b/include/asm-blackfin/mach-bf548/defBF549.h
deleted file mode 100644
index fcb72b41e007..000000000000
--- a/include/asm-blackfin/mach-bf548/defBF549.h
+++ /dev/null
@@ -1,2737 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/defBF549.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_BF549_H
32#define _DEF_BF549_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37
38/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF549 */
39
40/* Include defBF54x_base.h for the set of #defines that are common to all ADSP-BF54x processors */
41#include "defBF54x_base.h"
42
43/* The following are the #defines needed by ADSP-BF549 that are not in the common header */
44
45/* Timer Registers */
46
47#define TIMER8_CONFIG 0xffc00600 /* Timer 8 Configuration Register */
48#define TIMER8_COUNTER 0xffc00604 /* Timer 8 Counter Register */
49#define TIMER8_PERIOD 0xffc00608 /* Timer 8 Period Register */
50#define TIMER8_WIDTH 0xffc0060c /* Timer 8 Width Register */
51#define TIMER9_CONFIG 0xffc00610 /* Timer 9 Configuration Register */
52#define TIMER9_COUNTER 0xffc00614 /* Timer 9 Counter Register */
53#define TIMER9_PERIOD 0xffc00618 /* Timer 9 Period Register */
54#define TIMER9_WIDTH 0xffc0061c /* Timer 9 Width Register */
55#define TIMER10_CONFIG 0xffc00620 /* Timer 10 Configuration Register */
56#define TIMER10_COUNTER 0xffc00624 /* Timer 10 Counter Register */
57#define TIMER10_PERIOD 0xffc00628 /* Timer 10 Period Register */
58#define TIMER10_WIDTH 0xffc0062c /* Timer 10 Width Register */
59
60/* Timer Group of 3 Registers */
61
62#define TIMER_ENABLE1 0xffc00640 /* Timer Group of 3 Enable Register */
63#define TIMER_DISABLE1 0xffc00644 /* Timer Group of 3 Disable Register */
64#define TIMER_STATUS1 0xffc00648 /* Timer Group of 3 Status Register */
65
66/* SPORT0 Registers */
67
68#define SPORT0_TCR1 0xffc00800 /* SPORT0 Transmit Configuration 1 Register */
69#define SPORT0_TCR2 0xffc00804 /* SPORT0 Transmit Configuration 2 Register */
70#define SPORT0_TCLKDIV 0xffc00808 /* SPORT0 Transmit Serial Clock Divider Register */
71#define SPORT0_TFSDIV 0xffc0080c /* SPORT0 Transmit Frame Sync Divider Register */
72#define SPORT0_TX 0xffc00810 /* SPORT0 Transmit Data Register */
73#define SPORT0_RX 0xffc00818 /* SPORT0 Receive Data Register */
74#define SPORT0_RCR1 0xffc00820 /* SPORT0 Receive Configuration 1 Register */
75#define SPORT0_RCR2 0xffc00824 /* SPORT0 Receive Configuration 2 Register */
76#define SPORT0_RCLKDIV 0xffc00828 /* SPORT0 Receive Serial Clock Divider Register */
77#define SPORT0_RFSDIV 0xffc0082c /* SPORT0 Receive Frame Sync Divider Register */
78#define SPORT0_STAT 0xffc00830 /* SPORT0 Status Register */
79#define SPORT0_CHNL 0xffc00834 /* SPORT0 Current Channel Register */
80#define SPORT0_MCMC1 0xffc00838 /* SPORT0 Multi channel Configuration Register 1 */
81#define SPORT0_MCMC2 0xffc0083c /* SPORT0 Multi channel Configuration Register 2 */
82#define SPORT0_MTCS0 0xffc00840 /* SPORT0 Multi channel Transmit Select Register 0 */
83#define SPORT0_MTCS1 0xffc00844 /* SPORT0 Multi channel Transmit Select Register 1 */
84#define SPORT0_MTCS2 0xffc00848 /* SPORT0 Multi channel Transmit Select Register 2 */
85#define SPORT0_MTCS3 0xffc0084c /* SPORT0 Multi channel Transmit Select Register 3 */
86#define SPORT0_MRCS0 0xffc00850 /* SPORT0 Multi channel Receive Select Register 0 */
87#define SPORT0_MRCS1 0xffc00854 /* SPORT0 Multi channel Receive Select Register 1 */
88#define SPORT0_MRCS2 0xffc00858 /* SPORT0 Multi channel Receive Select Register 2 */
89#define SPORT0_MRCS3 0xffc0085c /* SPORT0 Multi channel Receive Select Register 3 */
90
91/* EPPI0 Registers */
92
93#define EPPI0_STATUS 0xffc01000 /* EPPI0 Status Register */
94#define EPPI0_HCOUNT 0xffc01004 /* EPPI0 Horizontal Transfer Count Register */
95#define EPPI0_HDELAY 0xffc01008 /* EPPI0 Horizontal Delay Count Register */
96#define EPPI0_VCOUNT 0xffc0100c /* EPPI0 Vertical Transfer Count Register */
97#define EPPI0_VDELAY 0xffc01010 /* EPPI0 Vertical Delay Count Register */
98#define EPPI0_FRAME 0xffc01014 /* EPPI0 Lines per Frame Register */
99#define EPPI0_LINE 0xffc01018 /* EPPI0 Samples per Line Register */
100#define EPPI0_CLKDIV 0xffc0101c /* EPPI0 Clock Divide Register */
101#define EPPI0_CONTROL 0xffc01020 /* EPPI0 Control Register */
102#define EPPI0_FS1W_HBL 0xffc01024 /* EPPI0 FS1 Width Register / EPPI0 Horizontal Blanking Samples Per Line Register */
103#define EPPI0_FS1P_AVPL 0xffc01028 /* EPPI0 FS1 Period Register / EPPI0 Active Video Samples Per Line Register */
104#define EPPI0_FS2W_LVB 0xffc0102c /* EPPI0 FS2 Width Register / EPPI0 Lines of Vertical Blanking Register */
105#define EPPI0_FS2P_LAVF 0xffc01030 /* EPPI0 FS2 Period Register/ EPPI0 Lines of Active Video Per Field Register */
106#define EPPI0_CLIP 0xffc01034 /* EPPI0 Clipping Register */
107
108/* UART2 Registers */
109
110#define UART2_DLL 0xffc02100 /* Divisor Latch Low Byte */
111#define UART2_DLH 0xffc02104 /* Divisor Latch High Byte */
112#define UART2_GCTL 0xffc02108 /* Global Control Register */
113#define UART2_LCR 0xffc0210c /* Line Control Register */
114#define UART2_MCR 0xffc02110 /* Modem Control Register */
115#define UART2_LSR 0xffc02114 /* Line Status Register */
116#define UART2_MSR 0xffc02118 /* Modem Status Register */
117#define UART2_SCR 0xffc0211c /* Scratch Register */
118#define UART2_IER_SET 0xffc02120 /* Interrupt Enable Register Set */
119#define UART2_IER_CLEAR 0xffc02124 /* Interrupt Enable Register Clear */
120#define UART2_RBR 0xffc0212c /* Receive Buffer Register */
121
122/* Two Wire Interface Registers (TWI1) */
123
124#define TWI1_REGBASE 0xffc02200
125#define TWI1_CLKDIV 0xffc02200 /* Clock Divider Register */
126#define TWI1_CONTROL 0xffc02204 /* TWI Control Register */
127#define TWI1_SLAVE_CTRL 0xffc02208 /* TWI Slave Mode Control Register */
128#define TWI1_SLAVE_STAT 0xffc0220c /* TWI Slave Mode Status Register */
129#define TWI1_SLAVE_ADDR 0xffc02210 /* TWI Slave Mode Address Register */
130#define TWI1_MASTER_CTRL 0xffc02214 /* TWI Master Mode Control Register */
131#define TWI1_MASTER_STAT 0xffc02218 /* TWI Master Mode Status Register */
132#define TWI1_MASTER_ADDR 0xffc0221c /* TWI Master Mode Address Register */
133#define TWI1_INT_STAT 0xffc02220 /* TWI Interrupt Status Register */
134#define TWI1_INT_MASK 0xffc02224 /* TWI Interrupt Mask Register */
135#define TWI1_FIFO_CTRL 0xffc02228 /* TWI FIFO Control Register */
136#define TWI1_FIFO_STAT 0xffc0222c /* TWI FIFO Status Register */
137#define TWI1_XMT_DATA8 0xffc02280 /* TWI FIFO Transmit Data Single Byte Register */
138#define TWI1_XMT_DATA16 0xffc02284 /* TWI FIFO Transmit Data Double Byte Register */
139#define TWI1_RCV_DATA8 0xffc02288 /* TWI FIFO Receive Data Single Byte Register */
140#define TWI1_RCV_DATA16 0xffc0228c /* TWI FIFO Receive Data Double Byte Register */
141
142/* SPI2 Registers */
143
144#define SPI2_REGBASE 0xffc02400
145#define SPI2_CTL 0xffc02400 /* SPI2 Control Register */
146#define SPI2_FLG 0xffc02404 /* SPI2 Flag Register */
147#define SPI2_STAT 0xffc02408 /* SPI2 Status Register */
148#define SPI2_TDBR 0xffc0240c /* SPI2 Transmit Data Buffer Register */
149#define SPI2_RDBR 0xffc02410 /* SPI2 Receive Data Buffer Register */
150#define SPI2_BAUD 0xffc02414 /* SPI2 Baud Rate Register */
151#define SPI2_SHADOW 0xffc02418 /* SPI2 Receive Data Buffer Shadow Register */
152
153/* MXVR Registers */
154
155#define MXVR_CONFIG 0xffc02700 /* MXVR Configuration Register */
156#define MXVR_STATE_0 0xffc02708 /* MXVR State Register 0 */
157#define MXVR_STATE_1 0xffc0270c /* MXVR State Register 1 */
158#define MXVR_INT_STAT_0 0xffc02710 /* MXVR Interrupt Status Register 0 */
159#define MXVR_INT_STAT_1 0xffc02714 /* MXVR Interrupt Status Register 1 */
160#define MXVR_INT_EN_0 0xffc02718 /* MXVR Interrupt Enable Register 0 */
161#define MXVR_INT_EN_1 0xffc0271c /* MXVR Interrupt Enable Register 1 */
162#define MXVR_POSITION 0xffc02720 /* MXVR Node Position Register */
163#define MXVR_MAX_POSITION 0xffc02724 /* MXVR Maximum Node Position Register */
164#define MXVR_DELAY 0xffc02728 /* MXVR Node Frame Delay Register */
165#define MXVR_MAX_DELAY 0xffc0272c /* MXVR Maximum Node Frame Delay Register */
166#define MXVR_LADDR 0xffc02730 /* MXVR Logical Address Register */
167#define MXVR_GADDR 0xffc02734 /* MXVR Group Address Register */
168#define MXVR_AADDR 0xffc02738 /* MXVR Alternate Address Register */
169
170/* MXVR Allocation Table Registers */
171
172#define MXVR_ALLOC_0 0xffc0273c /* MXVR Allocation Table Register 0 */
173#define MXVR_ALLOC_1 0xffc02740 /* MXVR Allocation Table Register 1 */
174#define MXVR_ALLOC_2 0xffc02744 /* MXVR Allocation Table Register 2 */
175#define MXVR_ALLOC_3 0xffc02748 /* MXVR Allocation Table Register 3 */
176#define MXVR_ALLOC_4 0xffc0274c /* MXVR Allocation Table Register 4 */
177#define MXVR_ALLOC_5 0xffc02750 /* MXVR Allocation Table Register 5 */
178#define MXVR_ALLOC_6 0xffc02754 /* MXVR Allocation Table Register 6 */
179#define MXVR_ALLOC_7 0xffc02758 /* MXVR Allocation Table Register 7 */
180#define MXVR_ALLOC_8 0xffc0275c /* MXVR Allocation Table Register 8 */
181#define MXVR_ALLOC_9 0xffc02760 /* MXVR Allocation Table Register 9 */
182#define MXVR_ALLOC_10 0xffc02764 /* MXVR Allocation Table Register 10 */
183#define MXVR_ALLOC_11 0xffc02768 /* MXVR Allocation Table Register 11 */
184#define MXVR_ALLOC_12 0xffc0276c /* MXVR Allocation Table Register 12 */
185#define MXVR_ALLOC_13 0xffc02770 /* MXVR Allocation Table Register 13 */
186#define MXVR_ALLOC_14 0xffc02774 /* MXVR Allocation Table Register 14 */
187
188/* MXVR Channel Assign Registers */
189
190#define MXVR_SYNC_LCHAN_0 0xffc02778 /* MXVR Sync Data Logical Channel Assign Register 0 */
191#define MXVR_SYNC_LCHAN_1 0xffc0277c /* MXVR Sync Data Logical Channel Assign Register 1 */
192#define MXVR_SYNC_LCHAN_2 0xffc02780 /* MXVR Sync Data Logical Channel Assign Register 2 */
193#define MXVR_SYNC_LCHAN_3 0xffc02784 /* MXVR Sync Data Logical Channel Assign Register 3 */
194#define MXVR_SYNC_LCHAN_4 0xffc02788 /* MXVR Sync Data Logical Channel Assign Register 4 */
195#define MXVR_SYNC_LCHAN_5 0xffc0278c /* MXVR Sync Data Logical Channel Assign Register 5 */
196#define MXVR_SYNC_LCHAN_6 0xffc02790 /* MXVR Sync Data Logical Channel Assign Register 6 */
197#define MXVR_SYNC_LCHAN_7 0xffc02794 /* MXVR Sync Data Logical Channel Assign Register 7 */
198
199/* MXVR DMA0 Registers */
200
201#define MXVR_DMA0_CONFIG 0xffc02798 /* MXVR Sync Data DMA0 Config Register */
202#define MXVR_DMA0_START_ADDR 0xffc0279c /* MXVR Sync Data DMA0 Start Address */
203#define MXVR_DMA0_COUNT 0xffc027a0 /* MXVR Sync Data DMA0 Loop Count Register */
204#define MXVR_DMA0_CURR_ADDR 0xffc027a4 /* MXVR Sync Data DMA0 Current Address */
205#define MXVR_DMA0_CURR_COUNT 0xffc027a8 /* MXVR Sync Data DMA0 Current Loop Count */
206
207/* MXVR DMA1 Registers */
208
209#define MXVR_DMA1_CONFIG 0xffc027ac /* MXVR Sync Data DMA1 Config Register */
210#define MXVR_DMA1_START_ADDR 0xffc027b0 /* MXVR Sync Data DMA1 Start Address */
211#define MXVR_DMA1_COUNT 0xffc027b4 /* MXVR Sync Data DMA1 Loop Count Register */
212#define MXVR_DMA1_CURR_ADDR 0xffc027b8 /* MXVR Sync Data DMA1 Current Address */
213#define MXVR_DMA1_CURR_COUNT 0xffc027bc /* MXVR Sync Data DMA1 Current Loop Count */
214
215/* MXVR DMA2 Registers */
216
217#define MXVR_DMA2_CONFIG 0xffc027c0 /* MXVR Sync Data DMA2 Config Register */
218#define MXVR_DMA2_START_ADDR 0xffc027c4 /* MXVR Sync Data DMA2 Start Address */
219#define MXVR_DMA2_COUNT 0xffc027c8 /* MXVR Sync Data DMA2 Loop Count Register */
220#define MXVR_DMA2_CURR_ADDR 0xffc027cc /* MXVR Sync Data DMA2 Current Address */
221#define MXVR_DMA2_CURR_COUNT 0xffc027d0 /* MXVR Sync Data DMA2 Current Loop Count */
222
223/* MXVR DMA3 Registers */
224
225#define MXVR_DMA3_CONFIG 0xffc027d4 /* MXVR Sync Data DMA3 Config Register */
226#define MXVR_DMA3_START_ADDR 0xffc027d8 /* MXVR Sync Data DMA3 Start Address */
227#define MXVR_DMA3_COUNT 0xffc027dc /* MXVR Sync Data DMA3 Loop Count Register */
228#define MXVR_DMA3_CURR_ADDR 0xffc027e0 /* MXVR Sync Data DMA3 Current Address */
229#define MXVR_DMA3_CURR_COUNT 0xffc027e4 /* MXVR Sync Data DMA3 Current Loop Count */
230
231/* MXVR DMA4 Registers */
232
233#define MXVR_DMA4_CONFIG 0xffc027e8 /* MXVR Sync Data DMA4 Config Register */
234#define MXVR_DMA4_START_ADDR 0xffc027ec /* MXVR Sync Data DMA4 Start Address */
235#define MXVR_DMA4_COUNT 0xffc027f0 /* MXVR Sync Data DMA4 Loop Count Register */
236#define MXVR_DMA4_CURR_ADDR 0xffc027f4 /* MXVR Sync Data DMA4 Current Address */
237#define MXVR_DMA4_CURR_COUNT 0xffc027f8 /* MXVR Sync Data DMA4 Current Loop Count */
238
239/* MXVR DMA5 Registers */
240
241#define MXVR_DMA5_CONFIG 0xffc027fc /* MXVR Sync Data DMA5 Config Register */
242#define MXVR_DMA5_START_ADDR 0xffc02800 /* MXVR Sync Data DMA5 Start Address */
243#define MXVR_DMA5_COUNT 0xffc02804 /* MXVR Sync Data DMA5 Loop Count Register */
244#define MXVR_DMA5_CURR_ADDR 0xffc02808 /* MXVR Sync Data DMA5 Current Address */
245#define MXVR_DMA5_CURR_COUNT 0xffc0280c /* MXVR Sync Data DMA5 Current Loop Count */
246
247/* MXVR DMA6 Registers */
248
249#define MXVR_DMA6_CONFIG 0xffc02810 /* MXVR Sync Data DMA6 Config Register */
250#define MXVR_DMA6_START_ADDR 0xffc02814 /* MXVR Sync Data DMA6 Start Address */
251#define MXVR_DMA6_COUNT 0xffc02818 /* MXVR Sync Data DMA6 Loop Count Register */
252#define MXVR_DMA6_CURR_ADDR 0xffc0281c /* MXVR Sync Data DMA6 Current Address */
253#define MXVR_DMA6_CURR_COUNT 0xffc02820 /* MXVR Sync Data DMA6 Current Loop Count */
254
255/* MXVR DMA7 Registers */
256
257#define MXVR_DMA7_CONFIG 0xffc02824 /* MXVR Sync Data DMA7 Config Register */
258#define MXVR_DMA7_START_ADDR 0xffc02828 /* MXVR Sync Data DMA7 Start Address */
259#define MXVR_DMA7_COUNT 0xffc0282c /* MXVR Sync Data DMA7 Loop Count Register */
260#define MXVR_DMA7_CURR_ADDR 0xffc02830 /* MXVR Sync Data DMA7 Current Address */
261#define MXVR_DMA7_CURR_COUNT 0xffc02834 /* MXVR Sync Data DMA7 Current Loop Count */
262
263/* MXVR Asynch Packet Registers */
264
265#define MXVR_AP_CTL 0xffc02838 /* MXVR Async Packet Control Register */
266#define MXVR_APRB_START_ADDR 0xffc0283c /* MXVR Async Packet RX Buffer Start Addr Register */
267#define MXVR_APRB_CURR_ADDR 0xffc02840 /* MXVR Async Packet RX Buffer Current Addr Register */
268#define MXVR_APTB_START_ADDR 0xffc02844 /* MXVR Async Packet TX Buffer Start Addr Register */
269#define MXVR_APTB_CURR_ADDR 0xffc02848 /* MXVR Async Packet TX Buffer Current Addr Register */
270
271/* MXVR Control Message Registers */
272
273#define MXVR_CM_CTL 0xffc0284c /* MXVR Control Message Control Register */
274#define MXVR_CMRB_START_ADDR 0xffc02850 /* MXVR Control Message RX Buffer Start Addr Register */
275#define MXVR_CMRB_CURR_ADDR 0xffc02854 /* MXVR Control Message RX Buffer Current Address */
276#define MXVR_CMTB_START_ADDR 0xffc02858 /* MXVR Control Message TX Buffer Start Addr Register */
277#define MXVR_CMTB_CURR_ADDR 0xffc0285c /* MXVR Control Message TX Buffer Current Address */
278
279/* MXVR Remote Read Registers */
280
281#define MXVR_RRDB_START_ADDR 0xffc02860 /* MXVR Remote Read Buffer Start Addr Register */
282#define MXVR_RRDB_CURR_ADDR 0xffc02864 /* MXVR Remote Read Buffer Current Addr Register */
283
284/* MXVR Pattern Data Registers */
285
286#define MXVR_PAT_DATA_0 0xffc02868 /* MXVR Pattern Data Register 0 */
287#define MXVR_PAT_EN_0 0xffc0286c /* MXVR Pattern Enable Register 0 */
288#define MXVR_PAT_DATA_1 0xffc02870 /* MXVR Pattern Data Register 1 */
289#define MXVR_PAT_EN_1 0xffc02874 /* MXVR Pattern Enable Register 1 */
290
291/* MXVR Frame Counter Registers */
292
293#define MXVR_FRAME_CNT_0 0xffc02878 /* MXVR Frame Counter 0 */
294#define MXVR_FRAME_CNT_1 0xffc0287c /* MXVR Frame Counter 1 */
295
296/* MXVR Routing Table Registers */
297
298#define MXVR_ROUTING_0 0xffc02880 /* MXVR Routing Table Register 0 */
299#define MXVR_ROUTING_1 0xffc02884 /* MXVR Routing Table Register 1 */
300#define MXVR_ROUTING_2 0xffc02888 /* MXVR Routing Table Register 2 */
301#define MXVR_ROUTING_3 0xffc0288c /* MXVR Routing Table Register 3 */
302#define MXVR_ROUTING_4 0xffc02890 /* MXVR Routing Table Register 4 */
303#define MXVR_ROUTING_5 0xffc02894 /* MXVR Routing Table Register 5 */
304#define MXVR_ROUTING_6 0xffc02898 /* MXVR Routing Table Register 6 */
305#define MXVR_ROUTING_7 0xffc0289c /* MXVR Routing Table Register 7 */
306#define MXVR_ROUTING_8 0xffc028a0 /* MXVR Routing Table Register 8 */
307#define MXVR_ROUTING_9 0xffc028a4 /* MXVR Routing Table Register 9 */
308#define MXVR_ROUTING_10 0xffc028a8 /* MXVR Routing Table Register 10 */
309#define MXVR_ROUTING_11 0xffc028ac /* MXVR Routing Table Register 11 */
310#define MXVR_ROUTING_12 0xffc028b0 /* MXVR Routing Table Register 12 */
311#define MXVR_ROUTING_13 0xffc028b4 /* MXVR Routing Table Register 13 */
312#define MXVR_ROUTING_14 0xffc028b8 /* MXVR Routing Table Register 14 */
313
314/* MXVR Counter-Clock-Control Registers */
315
316#define MXVR_BLOCK_CNT 0xffc028c0 /* MXVR Block Counter */
317#define MXVR_CLK_CTL 0xffc028d0 /* MXVR Clock Control Register */
318#define MXVR_CDRPLL_CTL 0xffc028d4 /* MXVR Clock/Data Recovery PLL Control Register */
319#define MXVR_FMPLL_CTL 0xffc028d8 /* MXVR Frequency Multiply PLL Control Register */
320#define MXVR_PIN_CTL 0xffc028dc /* MXVR Pin Control Register */
321#define MXVR_SCLK_CNT 0xffc028e0 /* MXVR System Clock Counter Register */
322
323/* CAN Controller 1 Config 1 Registers */
324
325#define CAN1_MC1 0xffc03200 /* CAN Controller 1 Mailbox Configuration Register 1 */
326#define CAN1_MD1 0xffc03204 /* CAN Controller 1 Mailbox Direction Register 1 */
327#define CAN1_TRS1 0xffc03208 /* CAN Controller 1 Transmit Request Set Register 1 */
328#define CAN1_TRR1 0xffc0320c /* CAN Controller 1 Transmit Request Reset Register 1 */
329#define CAN1_TA1 0xffc03210 /* CAN Controller 1 Transmit Acknowledge Register 1 */
330#define CAN1_AA1 0xffc03214 /* CAN Controller 1 Abort Acknowledge Register 1 */
331#define CAN1_RMP1 0xffc03218 /* CAN Controller 1 Receive Message Pending Register 1 */
332#define CAN1_RML1 0xffc0321c /* CAN Controller 1 Receive Message Lost Register 1 */
333#define CAN1_MBTIF1 0xffc03220 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 1 */
334#define CAN1_MBRIF1 0xffc03224 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 1 */
335#define CAN1_MBIM1 0xffc03228 /* CAN Controller 1 Mailbox Interrupt Mask Register 1 */
336#define CAN1_RFH1 0xffc0322c /* CAN Controller 1 Remote Frame Handling Enable Register 1 */
337#define CAN1_OPSS1 0xffc03230 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 1 */
338
339/* CAN Controller 1 Config 2 Registers */
340
341#define CAN1_MC2 0xffc03240 /* CAN Controller 1 Mailbox Configuration Register 2 */
342#define CAN1_MD2 0xffc03244 /* CAN Controller 1 Mailbox Direction Register 2 */
343#define CAN1_TRS2 0xffc03248 /* CAN Controller 1 Transmit Request Set Register 2 */
344#define CAN1_TRR2 0xffc0324c /* CAN Controller 1 Transmit Request Reset Register 2 */
345#define CAN1_TA2 0xffc03250 /* CAN Controller 1 Transmit Acknowledge Register 2 */
346#define CAN1_AA2 0xffc03254 /* CAN Controller 1 Abort Acknowledge Register 2 */
347#define CAN1_RMP2 0xffc03258 /* CAN Controller 1 Receive Message Pending Register 2 */
348#define CAN1_RML2 0xffc0325c /* CAN Controller 1 Receive Message Lost Register 2 */
349#define CAN1_MBTIF2 0xffc03260 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 2 */
350#define CAN1_MBRIF2 0xffc03264 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 2 */
351#define CAN1_MBIM2 0xffc03268 /* CAN Controller 1 Mailbox Interrupt Mask Register 2 */
352#define CAN1_RFH2 0xffc0326c /* CAN Controller 1 Remote Frame Handling Enable Register 2 */
353#define CAN1_OPSS2 0xffc03270 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 2 */
354
355/* CAN Controller 1 Clock/Interrupt/Counter Registers */
356
357#define CAN1_CLOCK 0xffc03280 /* CAN Controller 1 Clock Register */
358#define CAN1_TIMING 0xffc03284 /* CAN Controller 1 Timing Register */
359#define CAN1_DEBUG 0xffc03288 /* CAN Controller 1 Debug Register */
360#define CAN1_STATUS 0xffc0328c /* CAN Controller 1 Global Status Register */
361#define CAN1_CEC 0xffc03290 /* CAN Controller 1 Error Counter Register */
362#define CAN1_GIS 0xffc03294 /* CAN Controller 1 Global Interrupt Status Register */
363#define CAN1_GIM 0xffc03298 /* CAN Controller 1 Global Interrupt Mask Register */
364#define CAN1_GIF 0xffc0329c /* CAN Controller 1 Global Interrupt Flag Register */
365#define CAN1_CONTROL 0xffc032a0 /* CAN Controller 1 Master Control Register */
366#define CAN1_INTR 0xffc032a4 /* CAN Controller 1 Interrupt Pending Register */
367#define CAN1_MBTD 0xffc032ac /* CAN Controller 1 Mailbox Temporary Disable Register */
368#define CAN1_EWR 0xffc032b0 /* CAN Controller 1 Programmable Warning Level Register */
369#define CAN1_ESR 0xffc032b4 /* CAN Controller 1 Error Status Register */
370#define CAN1_UCCNT 0xffc032c4 /* CAN Controller 1 Universal Counter Register */
371#define CAN1_UCRC 0xffc032c8 /* CAN Controller 1 Universal Counter Force Reload Register */
372#define CAN1_UCCNF 0xffc032cc /* CAN Controller 1 Universal Counter Configuration Register */
373
374/* CAN Controller 1 Mailbox Acceptance Registers */
375
376#define CAN1_AM00L 0xffc03300 /* CAN Controller 1 Mailbox 0 Acceptance Mask High Register */
377#define CAN1_AM00H 0xffc03304 /* CAN Controller 1 Mailbox 0 Acceptance Mask Low Register */
378#define CAN1_AM01L 0xffc03308 /* CAN Controller 1 Mailbox 1 Acceptance Mask High Register */
379#define CAN1_AM01H 0xffc0330c /* CAN Controller 1 Mailbox 1 Acceptance Mask Low Register */
380#define CAN1_AM02L 0xffc03310 /* CAN Controller 1 Mailbox 2 Acceptance Mask High Register */
381#define CAN1_AM02H 0xffc03314 /* CAN Controller 1 Mailbox 2 Acceptance Mask Low Register */
382#define CAN1_AM03L 0xffc03318 /* CAN Controller 1 Mailbox 3 Acceptance Mask High Register */
383#define CAN1_AM03H 0xffc0331c /* CAN Controller 1 Mailbox 3 Acceptance Mask Low Register */
384#define CAN1_AM04L 0xffc03320 /* CAN Controller 1 Mailbox 4 Acceptance Mask High Register */
385#define CAN1_AM04H 0xffc03324 /* CAN Controller 1 Mailbox 4 Acceptance Mask Low Register */
386#define CAN1_AM05L 0xffc03328 /* CAN Controller 1 Mailbox 5 Acceptance Mask High Register */
387#define CAN1_AM05H 0xffc0332c /* CAN Controller 1 Mailbox 5 Acceptance Mask Low Register */
388#define CAN1_AM06L 0xffc03330 /* CAN Controller 1 Mailbox 6 Acceptance Mask High Register */
389#define CAN1_AM06H 0xffc03334 /* CAN Controller 1 Mailbox 6 Acceptance Mask Low Register */
390#define CAN1_AM07L 0xffc03338 /* CAN Controller 1 Mailbox 7 Acceptance Mask High Register */
391#define CAN1_AM07H 0xffc0333c /* CAN Controller 1 Mailbox 7 Acceptance Mask Low Register */
392#define CAN1_AM08L 0xffc03340 /* CAN Controller 1 Mailbox 8 Acceptance Mask High Register */
393#define CAN1_AM08H 0xffc03344 /* CAN Controller 1 Mailbox 8 Acceptance Mask Low Register */
394#define CAN1_AM09L 0xffc03348 /* CAN Controller 1 Mailbox 9 Acceptance Mask High Register */
395#define CAN1_AM09H 0xffc0334c /* CAN Controller 1 Mailbox 9 Acceptance Mask Low Register */
396#define CAN1_AM10L 0xffc03350 /* CAN Controller 1 Mailbox 10 Acceptance Mask High Register */
397#define CAN1_AM10H 0xffc03354 /* CAN Controller 1 Mailbox 10 Acceptance Mask Low Register */
398#define CAN1_AM11L 0xffc03358 /* CAN Controller 1 Mailbox 11 Acceptance Mask High Register */
399#define CAN1_AM11H 0xffc0335c /* CAN Controller 1 Mailbox 11 Acceptance Mask Low Register */
400#define CAN1_AM12L 0xffc03360 /* CAN Controller 1 Mailbox 12 Acceptance Mask High Register */
401#define CAN1_AM12H 0xffc03364 /* CAN Controller 1 Mailbox 12 Acceptance Mask Low Register */
402#define CAN1_AM13L 0xffc03368 /* CAN Controller 1 Mailbox 13 Acceptance Mask High Register */
403#define CAN1_AM13H 0xffc0336c /* CAN Controller 1 Mailbox 13 Acceptance Mask Low Register */
404#define CAN1_AM14L 0xffc03370 /* CAN Controller 1 Mailbox 14 Acceptance Mask High Register */
405#define CAN1_AM14H 0xffc03374 /* CAN Controller 1 Mailbox 14 Acceptance Mask Low Register */
406#define CAN1_AM15L 0xffc03378 /* CAN Controller 1 Mailbox 15 Acceptance Mask High Register */
407#define CAN1_AM15H 0xffc0337c /* CAN Controller 1 Mailbox 15 Acceptance Mask Low Register */
408
409/* CAN Controller 1 Mailbox Acceptance Registers */
410
411#define CAN1_AM16L 0xffc03380 /* CAN Controller 1 Mailbox 16 Acceptance Mask High Register */
412#define CAN1_AM16H 0xffc03384 /* CAN Controller 1 Mailbox 16 Acceptance Mask Low Register */
413#define CAN1_AM17L 0xffc03388 /* CAN Controller 1 Mailbox 17 Acceptance Mask High Register */
414#define CAN1_AM17H 0xffc0338c /* CAN Controller 1 Mailbox 17 Acceptance Mask Low Register */
415#define CAN1_AM18L 0xffc03390 /* CAN Controller 1 Mailbox 18 Acceptance Mask High Register */
416#define CAN1_AM18H 0xffc03394 /* CAN Controller 1 Mailbox 18 Acceptance Mask Low Register */
417#define CAN1_AM19L 0xffc03398 /* CAN Controller 1 Mailbox 19 Acceptance Mask High Register */
418#define CAN1_AM19H 0xffc0339c /* CAN Controller 1 Mailbox 19 Acceptance Mask Low Register */
419#define CAN1_AM20L 0xffc033a0 /* CAN Controller 1 Mailbox 20 Acceptance Mask High Register */
420#define CAN1_AM20H 0xffc033a4 /* CAN Controller 1 Mailbox 20 Acceptance Mask Low Register */
421#define CAN1_AM21L 0xffc033a8 /* CAN Controller 1 Mailbox 21 Acceptance Mask High Register */
422#define CAN1_AM21H 0xffc033ac /* CAN Controller 1 Mailbox 21 Acceptance Mask Low Register */
423#define CAN1_AM22L 0xffc033b0 /* CAN Controller 1 Mailbox 22 Acceptance Mask High Register */
424#define CAN1_AM22H 0xffc033b4 /* CAN Controller 1 Mailbox 22 Acceptance Mask Low Register */
425#define CAN1_AM23L 0xffc033b8 /* CAN Controller 1 Mailbox 23 Acceptance Mask High Register */
426#define CAN1_AM23H 0xffc033bc /* CAN Controller 1 Mailbox 23 Acceptance Mask Low Register */
427#define CAN1_AM24L 0xffc033c0 /* CAN Controller 1 Mailbox 24 Acceptance Mask High Register */
428#define CAN1_AM24H 0xffc033c4 /* CAN Controller 1 Mailbox 24 Acceptance Mask Low Register */
429#define CAN1_AM25L 0xffc033c8 /* CAN Controller 1 Mailbox 25 Acceptance Mask High Register */
430#define CAN1_AM25H 0xffc033cc /* CAN Controller 1 Mailbox 25 Acceptance Mask Low Register */
431#define CAN1_AM26L 0xffc033d0 /* CAN Controller 1 Mailbox 26 Acceptance Mask High Register */
432#define CAN1_AM26H 0xffc033d4 /* CAN Controller 1 Mailbox 26 Acceptance Mask Low Register */
433#define CAN1_AM27L 0xffc033d8 /* CAN Controller 1 Mailbox 27 Acceptance Mask High Register */
434#define CAN1_AM27H 0xffc033dc /* CAN Controller 1 Mailbox 27 Acceptance Mask Low Register */
435#define CAN1_AM28L 0xffc033e0 /* CAN Controller 1 Mailbox 28 Acceptance Mask High Register */
436#define CAN1_AM28H 0xffc033e4 /* CAN Controller 1 Mailbox 28 Acceptance Mask Low Register */
437#define CAN1_AM29L 0xffc033e8 /* CAN Controller 1 Mailbox 29 Acceptance Mask High Register */
438#define CAN1_AM29H 0xffc033ec /* CAN Controller 1 Mailbox 29 Acceptance Mask Low Register */
439#define CAN1_AM30L 0xffc033f0 /* CAN Controller 1 Mailbox 30 Acceptance Mask High Register */
440#define CAN1_AM30H 0xffc033f4 /* CAN Controller 1 Mailbox 30 Acceptance Mask Low Register */
441#define CAN1_AM31L 0xffc033f8 /* CAN Controller 1 Mailbox 31 Acceptance Mask High Register */
442#define CAN1_AM31H 0xffc033fc /* CAN Controller 1 Mailbox 31 Acceptance Mask Low Register */
443
444/* CAN Controller 1 Mailbox Data Registers */
445
446#define CAN1_MB00_DATA0 0xffc03400 /* CAN Controller 1 Mailbox 0 Data 0 Register */
447#define CAN1_MB00_DATA1 0xffc03404 /* CAN Controller 1 Mailbox 0 Data 1 Register */
448#define CAN1_MB00_DATA2 0xffc03408 /* CAN Controller 1 Mailbox 0 Data 2 Register */
449#define CAN1_MB00_DATA3 0xffc0340c /* CAN Controller 1 Mailbox 0 Data 3 Register */
450#define CAN1_MB00_LENGTH 0xffc03410 /* CAN Controller 1 Mailbox 0 Length Register */
451#define CAN1_MB00_TIMESTAMP 0xffc03414 /* CAN Controller 1 Mailbox 0 Timestamp Register */
452#define CAN1_MB00_ID0 0xffc03418 /* CAN Controller 1 Mailbox 0 ID0 Register */
453#define CAN1_MB00_ID1 0xffc0341c /* CAN Controller 1 Mailbox 0 ID1 Register */
454#define CAN1_MB01_DATA0 0xffc03420 /* CAN Controller 1 Mailbox 1 Data 0 Register */
455#define CAN1_MB01_DATA1 0xffc03424 /* CAN Controller 1 Mailbox 1 Data 1 Register */
456#define CAN1_MB01_DATA2 0xffc03428 /* CAN Controller 1 Mailbox 1 Data 2 Register */
457#define CAN1_MB01_DATA3 0xffc0342c /* CAN Controller 1 Mailbox 1 Data 3 Register */
458#define CAN1_MB01_LENGTH 0xffc03430 /* CAN Controller 1 Mailbox 1 Length Register */
459#define CAN1_MB01_TIMESTAMP 0xffc03434 /* CAN Controller 1 Mailbox 1 Timestamp Register */
460#define CAN1_MB01_ID0 0xffc03438 /* CAN Controller 1 Mailbox 1 ID0 Register */
461#define CAN1_MB01_ID1 0xffc0343c /* CAN Controller 1 Mailbox 1 ID1 Register */
462#define CAN1_MB02_DATA0 0xffc03440 /* CAN Controller 1 Mailbox 2 Data 0 Register */
463#define CAN1_MB02_DATA1 0xffc03444 /* CAN Controller 1 Mailbox 2 Data 1 Register */
464#define CAN1_MB02_DATA2 0xffc03448 /* CAN Controller 1 Mailbox 2 Data 2 Register */
465#define CAN1_MB02_DATA3 0xffc0344c /* CAN Controller 1 Mailbox 2 Data 3 Register */
466#define CAN1_MB02_LENGTH 0xffc03450 /* CAN Controller 1 Mailbox 2 Length Register */
467#define CAN1_MB02_TIMESTAMP 0xffc03454 /* CAN Controller 1 Mailbox 2 Timestamp Register */
468#define CAN1_MB02_ID0 0xffc03458 /* CAN Controller 1 Mailbox 2 ID0 Register */
469#define CAN1_MB02_ID1 0xffc0345c /* CAN Controller 1 Mailbox 2 ID1 Register */
470#define CAN1_MB03_DATA0 0xffc03460 /* CAN Controller 1 Mailbox 3 Data 0 Register */
471#define CAN1_MB03_DATA1 0xffc03464 /* CAN Controller 1 Mailbox 3 Data 1 Register */
472#define CAN1_MB03_DATA2 0xffc03468 /* CAN Controller 1 Mailbox 3 Data 2 Register */
473#define CAN1_MB03_DATA3 0xffc0346c /* CAN Controller 1 Mailbox 3 Data 3 Register */
474#define CAN1_MB03_LENGTH 0xffc03470 /* CAN Controller 1 Mailbox 3 Length Register */
475#define CAN1_MB03_TIMESTAMP 0xffc03474 /* CAN Controller 1 Mailbox 3 Timestamp Register */
476#define CAN1_MB03_ID0 0xffc03478 /* CAN Controller 1 Mailbox 3 ID0 Register */
477#define CAN1_MB03_ID1 0xffc0347c /* CAN Controller 1 Mailbox 3 ID1 Register */
478#define CAN1_MB04_DATA0 0xffc03480 /* CAN Controller 1 Mailbox 4 Data 0 Register */
479#define CAN1_MB04_DATA1 0xffc03484 /* CAN Controller 1 Mailbox 4 Data 1 Register */
480#define CAN1_MB04_DATA2 0xffc03488 /* CAN Controller 1 Mailbox 4 Data 2 Register */
481#define CAN1_MB04_DATA3 0xffc0348c /* CAN Controller 1 Mailbox 4 Data 3 Register */
482#define CAN1_MB04_LENGTH 0xffc03490 /* CAN Controller 1 Mailbox 4 Length Register */
483#define CAN1_MB04_TIMESTAMP 0xffc03494 /* CAN Controller 1 Mailbox 4 Timestamp Register */
484#define CAN1_MB04_ID0 0xffc03498 /* CAN Controller 1 Mailbox 4 ID0 Register */
485#define CAN1_MB04_ID1 0xffc0349c /* CAN Controller 1 Mailbox 4 ID1 Register */
486#define CAN1_MB05_DATA0 0xffc034a0 /* CAN Controller 1 Mailbox 5 Data 0 Register */
487#define CAN1_MB05_DATA1 0xffc034a4 /* CAN Controller 1 Mailbox 5 Data 1 Register */
488#define CAN1_MB05_DATA2 0xffc034a8 /* CAN Controller 1 Mailbox 5 Data 2 Register */
489#define CAN1_MB05_DATA3 0xffc034ac /* CAN Controller 1 Mailbox 5 Data 3 Register */
490#define CAN1_MB05_LENGTH 0xffc034b0 /* CAN Controller 1 Mailbox 5 Length Register */
491#define CAN1_MB05_TIMESTAMP 0xffc034b4 /* CAN Controller 1 Mailbox 5 Timestamp Register */
492#define CAN1_MB05_ID0 0xffc034b8 /* CAN Controller 1 Mailbox 5 ID0 Register */
493#define CAN1_MB05_ID1 0xffc034bc /* CAN Controller 1 Mailbox 5 ID1 Register */
494#define CAN1_MB06_DATA0 0xffc034c0 /* CAN Controller 1 Mailbox 6 Data 0 Register */
495#define CAN1_MB06_DATA1 0xffc034c4 /* CAN Controller 1 Mailbox 6 Data 1 Register */
496#define CAN1_MB06_DATA2 0xffc034c8 /* CAN Controller 1 Mailbox 6 Data 2 Register */
497#define CAN1_MB06_DATA3 0xffc034cc /* CAN Controller 1 Mailbox 6 Data 3 Register */
498#define CAN1_MB06_LENGTH 0xffc034d0 /* CAN Controller 1 Mailbox 6 Length Register */
499#define CAN1_MB06_TIMESTAMP 0xffc034d4 /* CAN Controller 1 Mailbox 6 Timestamp Register */
500#define CAN1_MB06_ID0 0xffc034d8 /* CAN Controller 1 Mailbox 6 ID0 Register */
501#define CAN1_MB06_ID1 0xffc034dc /* CAN Controller 1 Mailbox 6 ID1 Register */
502#define CAN1_MB07_DATA0 0xffc034e0 /* CAN Controller 1 Mailbox 7 Data 0 Register */
503#define CAN1_MB07_DATA1 0xffc034e4 /* CAN Controller 1 Mailbox 7 Data 1 Register */
504#define CAN1_MB07_DATA2 0xffc034e8 /* CAN Controller 1 Mailbox 7 Data 2 Register */
505#define CAN1_MB07_DATA3 0xffc034ec /* CAN Controller 1 Mailbox 7 Data 3 Register */
506#define CAN1_MB07_LENGTH 0xffc034f0 /* CAN Controller 1 Mailbox 7 Length Register */
507#define CAN1_MB07_TIMESTAMP 0xffc034f4 /* CAN Controller 1 Mailbox 7 Timestamp Register */
508#define CAN1_MB07_ID0 0xffc034f8 /* CAN Controller 1 Mailbox 7 ID0 Register */
509#define CAN1_MB07_ID1 0xffc034fc /* CAN Controller 1 Mailbox 7 ID1 Register */
510#define CAN1_MB08_DATA0 0xffc03500 /* CAN Controller 1 Mailbox 8 Data 0 Register */
511#define CAN1_MB08_DATA1 0xffc03504 /* CAN Controller 1 Mailbox 8 Data 1 Register */
512#define CAN1_MB08_DATA2 0xffc03508 /* CAN Controller 1 Mailbox 8 Data 2 Register */
513#define CAN1_MB08_DATA3 0xffc0350c /* CAN Controller 1 Mailbox 8 Data 3 Register */
514#define CAN1_MB08_LENGTH 0xffc03510 /* CAN Controller 1 Mailbox 8 Length Register */
515#define CAN1_MB08_TIMESTAMP 0xffc03514 /* CAN Controller 1 Mailbox 8 Timestamp Register */
516#define CAN1_MB08_ID0 0xffc03518 /* CAN Controller 1 Mailbox 8 ID0 Register */
517#define CAN1_MB08_ID1 0xffc0351c /* CAN Controller 1 Mailbox 8 ID1 Register */
518#define CAN1_MB09_DATA0 0xffc03520 /* CAN Controller 1 Mailbox 9 Data 0 Register */
519#define CAN1_MB09_DATA1 0xffc03524 /* CAN Controller 1 Mailbox 9 Data 1 Register */
520#define CAN1_MB09_DATA2 0xffc03528 /* CAN Controller 1 Mailbox 9 Data 2 Register */
521#define CAN1_MB09_DATA3 0xffc0352c /* CAN Controller 1 Mailbox 9 Data 3 Register */
522#define CAN1_MB09_LENGTH 0xffc03530 /* CAN Controller 1 Mailbox 9 Length Register */
523#define CAN1_MB09_TIMESTAMP 0xffc03534 /* CAN Controller 1 Mailbox 9 Timestamp Register */
524#define CAN1_MB09_ID0 0xffc03538 /* CAN Controller 1 Mailbox 9 ID0 Register */
525#define CAN1_MB09_ID1 0xffc0353c /* CAN Controller 1 Mailbox 9 ID1 Register */
526#define CAN1_MB10_DATA0 0xffc03540 /* CAN Controller 1 Mailbox 10 Data 0 Register */
527#define CAN1_MB10_DATA1 0xffc03544 /* CAN Controller 1 Mailbox 10 Data 1 Register */
528#define CAN1_MB10_DATA2 0xffc03548 /* CAN Controller 1 Mailbox 10 Data 2 Register */
529#define CAN1_MB10_DATA3 0xffc0354c /* CAN Controller 1 Mailbox 10 Data 3 Register */
530#define CAN1_MB10_LENGTH 0xffc03550 /* CAN Controller 1 Mailbox 10 Length Register */
531#define CAN1_MB10_TIMESTAMP 0xffc03554 /* CAN Controller 1 Mailbox 10 Timestamp Register */
532#define CAN1_MB10_ID0 0xffc03558 /* CAN Controller 1 Mailbox 10 ID0 Register */
533#define CAN1_MB10_ID1 0xffc0355c /* CAN Controller 1 Mailbox 10 ID1 Register */
534#define CAN1_MB11_DATA0 0xffc03560 /* CAN Controller 1 Mailbox 11 Data 0 Register */
535#define CAN1_MB11_DATA1 0xffc03564 /* CAN Controller 1 Mailbox 11 Data 1 Register */
536#define CAN1_MB11_DATA2 0xffc03568 /* CAN Controller 1 Mailbox 11 Data 2 Register */
537#define CAN1_MB11_DATA3 0xffc0356c /* CAN Controller 1 Mailbox 11 Data 3 Register */
538#define CAN1_MB11_LENGTH 0xffc03570 /* CAN Controller 1 Mailbox 11 Length Register */
539#define CAN1_MB11_TIMESTAMP 0xffc03574 /* CAN Controller 1 Mailbox 11 Timestamp Register */
540#define CAN1_MB11_ID0 0xffc03578 /* CAN Controller 1 Mailbox 11 ID0 Register */
541#define CAN1_MB11_ID1 0xffc0357c /* CAN Controller 1 Mailbox 11 ID1 Register */
542#define CAN1_MB12_DATA0 0xffc03580 /* CAN Controller 1 Mailbox 12 Data 0 Register */
543#define CAN1_MB12_DATA1 0xffc03584 /* CAN Controller 1 Mailbox 12 Data 1 Register */
544#define CAN1_MB12_DATA2 0xffc03588 /* CAN Controller 1 Mailbox 12 Data 2 Register */
545#define CAN1_MB12_DATA3 0xffc0358c /* CAN Controller 1 Mailbox 12 Data 3 Register */
546#define CAN1_MB12_LENGTH 0xffc03590 /* CAN Controller 1 Mailbox 12 Length Register */
547#define CAN1_MB12_TIMESTAMP 0xffc03594 /* CAN Controller 1 Mailbox 12 Timestamp Register */
548#define CAN1_MB12_ID0 0xffc03598 /* CAN Controller 1 Mailbox 12 ID0 Register */
549#define CAN1_MB12_ID1 0xffc0359c /* CAN Controller 1 Mailbox 12 ID1 Register */
550#define CAN1_MB13_DATA0 0xffc035a0 /* CAN Controller 1 Mailbox 13 Data 0 Register */
551#define CAN1_MB13_DATA1 0xffc035a4 /* CAN Controller 1 Mailbox 13 Data 1 Register */
552#define CAN1_MB13_DATA2 0xffc035a8 /* CAN Controller 1 Mailbox 13 Data 2 Register */
553#define CAN1_MB13_DATA3 0xffc035ac /* CAN Controller 1 Mailbox 13 Data 3 Register */
554#define CAN1_MB13_LENGTH 0xffc035b0 /* CAN Controller 1 Mailbox 13 Length Register */
555#define CAN1_MB13_TIMESTAMP 0xffc035b4 /* CAN Controller 1 Mailbox 13 Timestamp Register */
556#define CAN1_MB13_ID0 0xffc035b8 /* CAN Controller 1 Mailbox 13 ID0 Register */
557#define CAN1_MB13_ID1 0xffc035bc /* CAN Controller 1 Mailbox 13 ID1 Register */
558#define CAN1_MB14_DATA0 0xffc035c0 /* CAN Controller 1 Mailbox 14 Data 0 Register */
559#define CAN1_MB14_DATA1 0xffc035c4 /* CAN Controller 1 Mailbox 14 Data 1 Register */
560#define CAN1_MB14_DATA2 0xffc035c8 /* CAN Controller 1 Mailbox 14 Data 2 Register */
561#define CAN1_MB14_DATA3 0xffc035cc /* CAN Controller 1 Mailbox 14 Data 3 Register */
562#define CAN1_MB14_LENGTH 0xffc035d0 /* CAN Controller 1 Mailbox 14 Length Register */
563#define CAN1_MB14_TIMESTAMP 0xffc035d4 /* CAN Controller 1 Mailbox 14 Timestamp Register */
564#define CAN1_MB14_ID0 0xffc035d8 /* CAN Controller 1 Mailbox 14 ID0 Register */
565#define CAN1_MB14_ID1 0xffc035dc /* CAN Controller 1 Mailbox 14 ID1 Register */
566#define CAN1_MB15_DATA0 0xffc035e0 /* CAN Controller 1 Mailbox 15 Data 0 Register */
567#define CAN1_MB15_DATA1 0xffc035e4 /* CAN Controller 1 Mailbox 15 Data 1 Register */
568#define CAN1_MB15_DATA2 0xffc035e8 /* CAN Controller 1 Mailbox 15 Data 2 Register */
569#define CAN1_MB15_DATA3 0xffc035ec /* CAN Controller 1 Mailbox 15 Data 3 Register */
570#define CAN1_MB15_LENGTH 0xffc035f0 /* CAN Controller 1 Mailbox 15 Length Register */
571#define CAN1_MB15_TIMESTAMP 0xffc035f4 /* CAN Controller 1 Mailbox 15 Timestamp Register */
572#define CAN1_MB15_ID0 0xffc035f8 /* CAN Controller 1 Mailbox 15 ID0 Register */
573#define CAN1_MB15_ID1 0xffc035fc /* CAN Controller 1 Mailbox 15 ID1 Register */
574
575/* CAN Controller 1 Mailbox Data Registers */
576
577#define CAN1_MB16_DATA0 0xffc03600 /* CAN Controller 1 Mailbox 16 Data 0 Register */
578#define CAN1_MB16_DATA1 0xffc03604 /* CAN Controller 1 Mailbox 16 Data 1 Register */
579#define CAN1_MB16_DATA2 0xffc03608 /* CAN Controller 1 Mailbox 16 Data 2 Register */
580#define CAN1_MB16_DATA3 0xffc0360c /* CAN Controller 1 Mailbox 16 Data 3 Register */
581#define CAN1_MB16_LENGTH 0xffc03610 /* CAN Controller 1 Mailbox 16 Length Register */
582#define CAN1_MB16_TIMESTAMP 0xffc03614 /* CAN Controller 1 Mailbox 16 Timestamp Register */
583#define CAN1_MB16_ID0 0xffc03618 /* CAN Controller 1 Mailbox 16 ID0 Register */
584#define CAN1_MB16_ID1 0xffc0361c /* CAN Controller 1 Mailbox 16 ID1 Register */
585#define CAN1_MB17_DATA0 0xffc03620 /* CAN Controller 1 Mailbox 17 Data 0 Register */
586#define CAN1_MB17_DATA1 0xffc03624 /* CAN Controller 1 Mailbox 17 Data 1 Register */
587#define CAN1_MB17_DATA2 0xffc03628 /* CAN Controller 1 Mailbox 17 Data 2 Register */
588#define CAN1_MB17_DATA3 0xffc0362c /* CAN Controller 1 Mailbox 17 Data 3 Register */
589#define CAN1_MB17_LENGTH 0xffc03630 /* CAN Controller 1 Mailbox 17 Length Register */
590#define CAN1_MB17_TIMESTAMP 0xffc03634 /* CAN Controller 1 Mailbox 17 Timestamp Register */
591#define CAN1_MB17_ID0 0xffc03638 /* CAN Controller 1 Mailbox 17 ID0 Register */
592#define CAN1_MB17_ID1 0xffc0363c /* CAN Controller 1 Mailbox 17 ID1 Register */
593#define CAN1_MB18_DATA0 0xffc03640 /* CAN Controller 1 Mailbox 18 Data 0 Register */
594#define CAN1_MB18_DATA1 0xffc03644 /* CAN Controller 1 Mailbox 18 Data 1 Register */
595#define CAN1_MB18_DATA2 0xffc03648 /* CAN Controller 1 Mailbox 18 Data 2 Register */
596#define CAN1_MB18_DATA3 0xffc0364c /* CAN Controller 1 Mailbox 18 Data 3 Register */
597#define CAN1_MB18_LENGTH 0xffc03650 /* CAN Controller 1 Mailbox 18 Length Register */
598#define CAN1_MB18_TIMESTAMP 0xffc03654 /* CAN Controller 1 Mailbox 18 Timestamp Register */
599#define CAN1_MB18_ID0 0xffc03658 /* CAN Controller 1 Mailbox 18 ID0 Register */
600#define CAN1_MB18_ID1 0xffc0365c /* CAN Controller 1 Mailbox 18 ID1 Register */
601#define CAN1_MB19_DATA0 0xffc03660 /* CAN Controller 1 Mailbox 19 Data 0 Register */
602#define CAN1_MB19_DATA1 0xffc03664 /* CAN Controller 1 Mailbox 19 Data 1 Register */
603#define CAN1_MB19_DATA2 0xffc03668 /* CAN Controller 1 Mailbox 19 Data 2 Register */
604#define CAN1_MB19_DATA3 0xffc0366c /* CAN Controller 1 Mailbox 19 Data 3 Register */
605#define CAN1_MB19_LENGTH 0xffc03670 /* CAN Controller 1 Mailbox 19 Length Register */
606#define CAN1_MB19_TIMESTAMP 0xffc03674 /* CAN Controller 1 Mailbox 19 Timestamp Register */
607#define CAN1_MB19_ID0 0xffc03678 /* CAN Controller 1 Mailbox 19 ID0 Register */
608#define CAN1_MB19_ID1 0xffc0367c /* CAN Controller 1 Mailbox 19 ID1 Register */
609#define CAN1_MB20_DATA0 0xffc03680 /* CAN Controller 1 Mailbox 20 Data 0 Register */
610#define CAN1_MB20_DATA1 0xffc03684 /* CAN Controller 1 Mailbox 20 Data 1 Register */
611#define CAN1_MB20_DATA2 0xffc03688 /* CAN Controller 1 Mailbox 20 Data 2 Register */
612#define CAN1_MB20_DATA3 0xffc0368c /* CAN Controller 1 Mailbox 20 Data 3 Register */
613#define CAN1_MB20_LENGTH 0xffc03690 /* CAN Controller 1 Mailbox 20 Length Register */
614#define CAN1_MB20_TIMESTAMP 0xffc03694 /* CAN Controller 1 Mailbox 20 Timestamp Register */
615#define CAN1_MB20_ID0 0xffc03698 /* CAN Controller 1 Mailbox 20 ID0 Register */
616#define CAN1_MB20_ID1 0xffc0369c /* CAN Controller 1 Mailbox 20 ID1 Register */
617#define CAN1_MB21_DATA0 0xffc036a0 /* CAN Controller 1 Mailbox 21 Data 0 Register */
618#define CAN1_MB21_DATA1 0xffc036a4 /* CAN Controller 1 Mailbox 21 Data 1 Register */
619#define CAN1_MB21_DATA2 0xffc036a8 /* CAN Controller 1 Mailbox 21 Data 2 Register */
620#define CAN1_MB21_DATA3 0xffc036ac /* CAN Controller 1 Mailbox 21 Data 3 Register */
621#define CAN1_MB21_LENGTH 0xffc036b0 /* CAN Controller 1 Mailbox 21 Length Register */
622#define CAN1_MB21_TIMESTAMP 0xffc036b4 /* CAN Controller 1 Mailbox 21 Timestamp Register */
623#define CAN1_MB21_ID0 0xffc036b8 /* CAN Controller 1 Mailbox 21 ID0 Register */
624#define CAN1_MB21_ID1 0xffc036bc /* CAN Controller 1 Mailbox 21 ID1 Register */
625#define CAN1_MB22_DATA0 0xffc036c0 /* CAN Controller 1 Mailbox 22 Data 0 Register */
626#define CAN1_MB22_DATA1 0xffc036c4 /* CAN Controller 1 Mailbox 22 Data 1 Register */
627#define CAN1_MB22_DATA2 0xffc036c8 /* CAN Controller 1 Mailbox 22 Data 2 Register */
628#define CAN1_MB22_DATA3 0xffc036cc /* CAN Controller 1 Mailbox 22 Data 3 Register */
629#define CAN1_MB22_LENGTH 0xffc036d0 /* CAN Controller 1 Mailbox 22 Length Register */
630#define CAN1_MB22_TIMESTAMP 0xffc036d4 /* CAN Controller 1 Mailbox 22 Timestamp Register */
631#define CAN1_MB22_ID0 0xffc036d8 /* CAN Controller 1 Mailbox 22 ID0 Register */
632#define CAN1_MB22_ID1 0xffc036dc /* CAN Controller 1 Mailbox 22 ID1 Register */
633#define CAN1_MB23_DATA0 0xffc036e0 /* CAN Controller 1 Mailbox 23 Data 0 Register */
634#define CAN1_MB23_DATA1 0xffc036e4 /* CAN Controller 1 Mailbox 23 Data 1 Register */
635#define CAN1_MB23_DATA2 0xffc036e8 /* CAN Controller 1 Mailbox 23 Data 2 Register */
636#define CAN1_MB23_DATA3 0xffc036ec /* CAN Controller 1 Mailbox 23 Data 3 Register */
637#define CAN1_MB23_LENGTH 0xffc036f0 /* CAN Controller 1 Mailbox 23 Length Register */
638#define CAN1_MB23_TIMESTAMP 0xffc036f4 /* CAN Controller 1 Mailbox 23 Timestamp Register */
639#define CAN1_MB23_ID0 0xffc036f8 /* CAN Controller 1 Mailbox 23 ID0 Register */
640#define CAN1_MB23_ID1 0xffc036fc /* CAN Controller 1 Mailbox 23 ID1 Register */
641#define CAN1_MB24_DATA0 0xffc03700 /* CAN Controller 1 Mailbox 24 Data 0 Register */
642#define CAN1_MB24_DATA1 0xffc03704 /* CAN Controller 1 Mailbox 24 Data 1 Register */
643#define CAN1_MB24_DATA2 0xffc03708 /* CAN Controller 1 Mailbox 24 Data 2 Register */
644#define CAN1_MB24_DATA3 0xffc0370c /* CAN Controller 1 Mailbox 24 Data 3 Register */
645#define CAN1_MB24_LENGTH 0xffc03710 /* CAN Controller 1 Mailbox 24 Length Register */
646#define CAN1_MB24_TIMESTAMP 0xffc03714 /* CAN Controller 1 Mailbox 24 Timestamp Register */
647#define CAN1_MB24_ID0 0xffc03718 /* CAN Controller 1 Mailbox 24 ID0 Register */
648#define CAN1_MB24_ID1 0xffc0371c /* CAN Controller 1 Mailbox 24 ID1 Register */
649#define CAN1_MB25_DATA0 0xffc03720 /* CAN Controller 1 Mailbox 25 Data 0 Register */
650#define CAN1_MB25_DATA1 0xffc03724 /* CAN Controller 1 Mailbox 25 Data 1 Register */
651#define CAN1_MB25_DATA2 0xffc03728 /* CAN Controller 1 Mailbox 25 Data 2 Register */
652#define CAN1_MB25_DATA3 0xffc0372c /* CAN Controller 1 Mailbox 25 Data 3 Register */
653#define CAN1_MB25_LENGTH 0xffc03730 /* CAN Controller 1 Mailbox 25 Length Register */
654#define CAN1_MB25_TIMESTAMP 0xffc03734 /* CAN Controller 1 Mailbox 25 Timestamp Register */
655#define CAN1_MB25_ID0 0xffc03738 /* CAN Controller 1 Mailbox 25 ID0 Register */
656#define CAN1_MB25_ID1 0xffc0373c /* CAN Controller 1 Mailbox 25 ID1 Register */
657#define CAN1_MB26_DATA0 0xffc03740 /* CAN Controller 1 Mailbox 26 Data 0 Register */
658#define CAN1_MB26_DATA1 0xffc03744 /* CAN Controller 1 Mailbox 26 Data 1 Register */
659#define CAN1_MB26_DATA2 0xffc03748 /* CAN Controller 1 Mailbox 26 Data 2 Register */
660#define CAN1_MB26_DATA3 0xffc0374c /* CAN Controller 1 Mailbox 26 Data 3 Register */
661#define CAN1_MB26_LENGTH 0xffc03750 /* CAN Controller 1 Mailbox 26 Length Register */
662#define CAN1_MB26_TIMESTAMP 0xffc03754 /* CAN Controller 1 Mailbox 26 Timestamp Register */
663#define CAN1_MB26_ID0 0xffc03758 /* CAN Controller 1 Mailbox 26 ID0 Register */
664#define CAN1_MB26_ID1 0xffc0375c /* CAN Controller 1 Mailbox 26 ID1 Register */
665#define CAN1_MB27_DATA0 0xffc03760 /* CAN Controller 1 Mailbox 27 Data 0 Register */
666#define CAN1_MB27_DATA1 0xffc03764 /* CAN Controller 1 Mailbox 27 Data 1 Register */
667#define CAN1_MB27_DATA2 0xffc03768 /* CAN Controller 1 Mailbox 27 Data 2 Register */
668#define CAN1_MB27_DATA3 0xffc0376c /* CAN Controller 1 Mailbox 27 Data 3 Register */
669#define CAN1_MB27_LENGTH 0xffc03770 /* CAN Controller 1 Mailbox 27 Length Register */
670#define CAN1_MB27_TIMESTAMP 0xffc03774 /* CAN Controller 1 Mailbox 27 Timestamp Register */
671#define CAN1_MB27_ID0 0xffc03778 /* CAN Controller 1 Mailbox 27 ID0 Register */
672#define CAN1_MB27_ID1 0xffc0377c /* CAN Controller 1 Mailbox 27 ID1 Register */
673#define CAN1_MB28_DATA0 0xffc03780 /* CAN Controller 1 Mailbox 28 Data 0 Register */
674#define CAN1_MB28_DATA1 0xffc03784 /* CAN Controller 1 Mailbox 28 Data 1 Register */
675#define CAN1_MB28_DATA2 0xffc03788 /* CAN Controller 1 Mailbox 28 Data 2 Register */
676#define CAN1_MB28_DATA3 0xffc0378c /* CAN Controller 1 Mailbox 28 Data 3 Register */
677#define CAN1_MB28_LENGTH 0xffc03790 /* CAN Controller 1 Mailbox 28 Length Register */
678#define CAN1_MB28_TIMESTAMP 0xffc03794 /* CAN Controller 1 Mailbox 28 Timestamp Register */
679#define CAN1_MB28_ID0 0xffc03798 /* CAN Controller 1 Mailbox 28 ID0 Register */
680#define CAN1_MB28_ID1 0xffc0379c /* CAN Controller 1 Mailbox 28 ID1 Register */
681#define CAN1_MB29_DATA0 0xffc037a0 /* CAN Controller 1 Mailbox 29 Data 0 Register */
682#define CAN1_MB29_DATA1 0xffc037a4 /* CAN Controller 1 Mailbox 29 Data 1 Register */
683#define CAN1_MB29_DATA2 0xffc037a8 /* CAN Controller 1 Mailbox 29 Data 2 Register */
684#define CAN1_MB29_DATA3 0xffc037ac /* CAN Controller 1 Mailbox 29 Data 3 Register */
685#define CAN1_MB29_LENGTH 0xffc037b0 /* CAN Controller 1 Mailbox 29 Length Register */
686#define CAN1_MB29_TIMESTAMP 0xffc037b4 /* CAN Controller 1 Mailbox 29 Timestamp Register */
687#define CAN1_MB29_ID0 0xffc037b8 /* CAN Controller 1 Mailbox 29 ID0 Register */
688#define CAN1_MB29_ID1 0xffc037bc /* CAN Controller 1 Mailbox 29 ID1 Register */
689#define CAN1_MB30_DATA0 0xffc037c0 /* CAN Controller 1 Mailbox 30 Data 0 Register */
690#define CAN1_MB30_DATA1 0xffc037c4 /* CAN Controller 1 Mailbox 30 Data 1 Register */
691#define CAN1_MB30_DATA2 0xffc037c8 /* CAN Controller 1 Mailbox 30 Data 2 Register */
692#define CAN1_MB30_DATA3 0xffc037cc /* CAN Controller 1 Mailbox 30 Data 3 Register */
693#define CAN1_MB30_LENGTH 0xffc037d0 /* CAN Controller 1 Mailbox 30 Length Register */
694#define CAN1_MB30_TIMESTAMP 0xffc037d4 /* CAN Controller 1 Mailbox 30 Timestamp Register */
695#define CAN1_MB30_ID0 0xffc037d8 /* CAN Controller 1 Mailbox 30 ID0 Register */
696#define CAN1_MB30_ID1 0xffc037dc /* CAN Controller 1 Mailbox 30 ID1 Register */
697#define CAN1_MB31_DATA0 0xffc037e0 /* CAN Controller 1 Mailbox 31 Data 0 Register */
698#define CAN1_MB31_DATA1 0xffc037e4 /* CAN Controller 1 Mailbox 31 Data 1 Register */
699#define CAN1_MB31_DATA2 0xffc037e8 /* CAN Controller 1 Mailbox 31 Data 2 Register */
700#define CAN1_MB31_DATA3 0xffc037ec /* CAN Controller 1 Mailbox 31 Data 3 Register */
701#define CAN1_MB31_LENGTH 0xffc037f0 /* CAN Controller 1 Mailbox 31 Length Register */
702#define CAN1_MB31_TIMESTAMP 0xffc037f4 /* CAN Controller 1 Mailbox 31 Timestamp Register */
703#define CAN1_MB31_ID0 0xffc037f8 /* CAN Controller 1 Mailbox 31 ID0 Register */
704#define CAN1_MB31_ID1 0xffc037fc /* CAN Controller 1 Mailbox 31 ID1 Register */
705
706/* ATAPI Registers */
707
708#define ATAPI_CONTROL 0xffc03800 /* ATAPI Control Register */
709#define ATAPI_STATUS 0xffc03804 /* ATAPI Status Register */
710#define ATAPI_DEV_ADDR 0xffc03808 /* ATAPI Device Register Address */
711#define ATAPI_DEV_TXBUF 0xffc0380c /* ATAPI Device Register Write Data */
712#define ATAPI_DEV_RXBUF 0xffc03810 /* ATAPI Device Register Read Data */
713#define ATAPI_INT_MASK 0xffc03814 /* ATAPI Interrupt Mask Register */
714#define ATAPI_INT_STATUS 0xffc03818 /* ATAPI Interrupt Status Register */
715#define ATAPI_XFER_LEN 0xffc0381c /* ATAPI Length of Transfer */
716#define ATAPI_LINE_STATUS 0xffc03820 /* ATAPI Line Status */
717#define ATAPI_SM_STATE 0xffc03824 /* ATAPI State Machine Status */
718#define ATAPI_TERMINATE 0xffc03828 /* ATAPI Host Terminate */
719#define ATAPI_PIO_TFRCNT 0xffc0382c /* ATAPI PIO mode transfer count */
720#define ATAPI_DMA_TFRCNT 0xffc03830 /* ATAPI DMA mode transfer count */
721#define ATAPI_UMAIN_TFRCNT 0xffc03834 /* ATAPI UDMAIN transfer count */
722#define ATAPI_UDMAOUT_TFRCNT 0xffc03838 /* ATAPI UDMAOUT transfer count */
723#define ATAPI_REG_TIM_0 0xffc03840 /* ATAPI Register Transfer Timing 0 */
724#define ATAPI_PIO_TIM_0 0xffc03844 /* ATAPI PIO Timing 0 Register */
725#define ATAPI_PIO_TIM_1 0xffc03848 /* ATAPI PIO Timing 1 Register */
726#define ATAPI_MULTI_TIM_0 0xffc03850 /* ATAPI Multi-DMA Timing 0 Register */
727#define ATAPI_MULTI_TIM_1 0xffc03854 /* ATAPI Multi-DMA Timing 1 Register */
728#define ATAPI_MULTI_TIM_2 0xffc03858 /* ATAPI Multi-DMA Timing 2 Register */
729#define ATAPI_ULTRA_TIM_0 0xffc03860 /* ATAPI Ultra-DMA Timing 0 Register */
730#define ATAPI_ULTRA_TIM_1 0xffc03864 /* ATAPI Ultra-DMA Timing 1 Register */
731#define ATAPI_ULTRA_TIM_2 0xffc03868 /* ATAPI Ultra-DMA Timing 2 Register */
732#define ATAPI_ULTRA_TIM_3 0xffc0386c /* ATAPI Ultra-DMA Timing 3 Register */
733
734/* SDH Registers */
735
736#define SDH_PWR_CTL 0xffc03900 /* SDH Power Control */
737#define SDH_CLK_CTL 0xffc03904 /* SDH Clock Control */
738#define SDH_ARGUMENT 0xffc03908 /* SDH Argument */
739#define SDH_COMMAND 0xffc0390c /* SDH Command */
740#define SDH_RESP_CMD 0xffc03910 /* SDH Response Command */
741#define SDH_RESPONSE0 0xffc03914 /* SDH Response0 */
742#define SDH_RESPONSE1 0xffc03918 /* SDH Response1 */
743#define SDH_RESPONSE2 0xffc0391c /* SDH Response2 */
744#define SDH_RESPONSE3 0xffc03920 /* SDH Response3 */
745#define SDH_DATA_TIMER 0xffc03924 /* SDH Data Timer */
746#define SDH_DATA_LGTH 0xffc03928 /* SDH Data Length */
747#define SDH_DATA_CTL 0xffc0392c /* SDH Data Control */
748#define SDH_DATA_CNT 0xffc03930 /* SDH Data Counter */
749#define SDH_STATUS 0xffc03934 /* SDH Status */
750#define SDH_STATUS_CLR 0xffc03938 /* SDH Status Clear */
751#define SDH_MASK0 0xffc0393c /* SDH Interrupt0 Mask */
752#define SDH_MASK1 0xffc03940 /* SDH Interrupt1 Mask */
753#define SDH_FIFO_CNT 0xffc03948 /* SDH FIFO Counter */
754#define SDH_FIFO 0xffc03980 /* SDH Data FIFO */
755#define SDH_E_STATUS 0xffc039c0 /* SDH Exception Status */
756#define SDH_E_MASK 0xffc039c4 /* SDH Exception Mask */
757#define SDH_CFG 0xffc039c8 /* SDH Configuration */
758#define SDH_RD_WAIT_EN 0xffc039cc /* SDH Read Wait Enable */
759#define SDH_PID0 0xffc039d0 /* SDH Peripheral Identification0 */
760#define SDH_PID1 0xffc039d4 /* SDH Peripheral Identification1 */
761#define SDH_PID2 0xffc039d8 /* SDH Peripheral Identification2 */
762#define SDH_PID3 0xffc039dc /* SDH Peripheral Identification3 */
763#define SDH_PID4 0xffc039e0 /* SDH Peripheral Identification4 */
764#define SDH_PID5 0xffc039e4 /* SDH Peripheral Identification5 */
765#define SDH_PID6 0xffc039e8 /* SDH Peripheral Identification6 */
766#define SDH_PID7 0xffc039ec /* SDH Peripheral Identification7 */
767
768/* HOST Port Registers */
769
770#define HOST_CONTROL 0xffc03a00 /* HOST Control Register */
771#define HOST_STATUS 0xffc03a04 /* HOST Status Register */
772#define HOST_TIMEOUT 0xffc03a08 /* HOST Acknowledge Mode Timeout Register */
773
774/* USB Control Registers */
775
776#define USB_FADDR 0xffc03c00 /* Function address register */
777#define USB_POWER 0xffc03c04 /* Power management register */
778#define USB_INTRTX 0xffc03c08 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
779#define USB_INTRRX 0xffc03c0c /* Interrupt register for Rx endpoints 1 to 7 */
780#define USB_INTRTXE 0xffc03c10 /* Interrupt enable register for IntrTx */
781#define USB_INTRRXE 0xffc03c14 /* Interrupt enable register for IntrRx */
782#define USB_INTRUSB 0xffc03c18 /* Interrupt register for common USB interrupts */
783#define USB_INTRUSBE 0xffc03c1c /* Interrupt enable register for IntrUSB */
784#define USB_FRAME 0xffc03c20 /* USB frame number */
785#define USB_INDEX 0xffc03c24 /* Index register for selecting the indexed endpoint registers */
786#define USB_TESTMODE 0xffc03c28 /* Enabled USB 20 test modes */
787#define USB_GLOBINTR 0xffc03c2c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
788#define USB_GLOBAL_CTL 0xffc03c30 /* Global Clock Control for the core */
789
790/* USB Packet Control Registers */
791
792#define USB_TX_MAX_PACKET 0xffc03c40 /* Maximum packet size for Host Tx endpoint */
793#define USB_CSR0 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
794#define USB_TXCSR 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
795#define USB_RX_MAX_PACKET 0xffc03c48 /* Maximum packet size for Host Rx endpoint */
796#define USB_RXCSR 0xffc03c4c /* Control Status register for Host Rx endpoint */
797#define USB_COUNT0 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
798#define USB_RXCOUNT 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
799#define USB_TXTYPE 0xffc03c54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
800#define USB_NAKLIMIT0 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
801#define USB_TXINTERVAL 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
802#define USB_RXTYPE 0xffc03c5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
803#define USB_RXINTERVAL 0xffc03c60 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
804#define USB_TXCOUNT 0xffc03c68 /* Number of bytes to be written to the selected endpoint Tx FIFO */
805
806/* USB Endpoint FIFO Registers */
807
808#define USB_EP0_FIFO 0xffc03c80 /* Endpoint 0 FIFO */
809#define USB_EP1_FIFO 0xffc03c88 /* Endpoint 1 FIFO */
810#define USB_EP2_FIFO 0xffc03c90 /* Endpoint 2 FIFO */
811#define USB_EP3_FIFO 0xffc03c98 /* Endpoint 3 FIFO */
812#define USB_EP4_FIFO 0xffc03ca0 /* Endpoint 4 FIFO */
813#define USB_EP5_FIFO 0xffc03ca8 /* Endpoint 5 FIFO */
814#define USB_EP6_FIFO 0xffc03cb0 /* Endpoint 6 FIFO */
815#define USB_EP7_FIFO 0xffc03cb8 /* Endpoint 7 FIFO */
816
817/* USB OTG Control Registers */
818
819#define USB_OTG_DEV_CTL 0xffc03d00 /* OTG Device Control Register */
820#define USB_OTG_VBUS_IRQ 0xffc03d04 /* OTG VBUS Control Interrupts */
821#define USB_OTG_VBUS_MASK 0xffc03d08 /* VBUS Control Interrupt Enable */
822
823/* USB Phy Control Registers */
824
825#define USB_LINKINFO 0xffc03d48 /* Enables programming of some PHY-side delays */
826#define USB_VPLEN 0xffc03d4c /* Determines duration of VBUS pulse for VBUS charging */
827#define USB_HS_EOF1 0xffc03d50 /* Time buffer for High-Speed transactions */
828#define USB_FS_EOF1 0xffc03d54 /* Time buffer for Full-Speed transactions */
829#define USB_LS_EOF1 0xffc03d58 /* Time buffer for Low-Speed transactions */
830
831/* (APHY_CNTRL is for ADI usage only) */
832
833#define USB_APHY_CNTRL 0xffc03de0 /* Register that increases visibility of Analog PHY */
834
835/* (APHY_CALIB is for ADI usage only) */
836
837#define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */
838#define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
839
840/* (PHY_TEST is for ADI usage only) */
841
842#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */
843#define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */
844#define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
845
846/* USB Endpoint 0 Control Registers */
847
848#define USB_EP_NI0_TXMAXP 0xffc03e00 /* Maximum packet size for Host Tx endpoint0 */
849#define USB_EP_NI0_TXCSR 0xffc03e04 /* Control Status register for endpoint 0 */
850#define USB_EP_NI0_RXMAXP 0xffc03e08 /* Maximum packet size for Host Rx endpoint0 */
851#define USB_EP_NI0_RXCSR 0xffc03e0c /* Control Status register for Host Rx endpoint0 */
852#define USB_EP_NI0_RXCOUNT 0xffc03e10 /* Number of bytes received in endpoint 0 FIFO */
853#define USB_EP_NI0_TXTYPE 0xffc03e14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
854#define USB_EP_NI0_TXINTERVAL 0xffc03e18 /* Sets the NAK response timeout on Endpoint 0 */
855#define USB_EP_NI0_RXTYPE 0xffc03e1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
856#define USB_EP_NI0_RXINTERVAL 0xffc03e20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint0 */
857
858/* USB Endpoint 1 Control Registers */
859
860#define USB_EP_NI0_TXCOUNT 0xffc03e28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
861#define USB_EP_NI1_TXMAXP 0xffc03e40 /* Maximum packet size for Host Tx endpoint1 */
862#define USB_EP_NI1_TXCSR 0xffc03e44 /* Control Status register for endpoint1 */
863#define USB_EP_NI1_RXMAXP 0xffc03e48 /* Maximum packet size for Host Rx endpoint1 */
864#define USB_EP_NI1_RXCSR 0xffc03e4c /* Control Status register for Host Rx endpoint1 */
865#define USB_EP_NI1_RXCOUNT 0xffc03e50 /* Number of bytes received in endpoint1 FIFO */
866#define USB_EP_NI1_TXTYPE 0xffc03e54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
867#define USB_EP_NI1_TXINTERVAL 0xffc03e58 /* Sets the NAK response timeout on Endpoint1 */
868#define USB_EP_NI1_RXTYPE 0xffc03e5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
869#define USB_EP_NI1_RXINTERVAL 0xffc03e60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint1 */
870
871/* USB Endpoint 2 Control Registers */
872
873#define USB_EP_NI1_TXCOUNT 0xffc03e68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
874#define USB_EP_NI2_TXMAXP 0xffc03e80 /* Maximum packet size for Host Tx endpoint2 */
875#define USB_EP_NI2_TXCSR 0xffc03e84 /* Control Status register for endpoint2 */
876#define USB_EP_NI2_RXMAXP 0xffc03e88 /* Maximum packet size for Host Rx endpoint2 */
877#define USB_EP_NI2_RXCSR 0xffc03e8c /* Control Status register for Host Rx endpoint2 */
878#define USB_EP_NI2_RXCOUNT 0xffc03e90 /* Number of bytes received in endpoint2 FIFO */
879#define USB_EP_NI2_TXTYPE 0xffc03e94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
880#define USB_EP_NI2_TXINTERVAL 0xffc03e98 /* Sets the NAK response timeout on Endpoint2 */
881#define USB_EP_NI2_RXTYPE 0xffc03e9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
882#define USB_EP_NI2_RXINTERVAL 0xffc03ea0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint2 */
883
884/* USB Endpoint 3 Control Registers */
885
886#define USB_EP_NI2_TXCOUNT 0xffc03ea8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
887#define USB_EP_NI3_TXMAXP 0xffc03ec0 /* Maximum packet size for Host Tx endpoint3 */
888#define USB_EP_NI3_TXCSR 0xffc03ec4 /* Control Status register for endpoint3 */
889#define USB_EP_NI3_RXMAXP 0xffc03ec8 /* Maximum packet size for Host Rx endpoint3 */
890#define USB_EP_NI3_RXCSR 0xffc03ecc /* Control Status register for Host Rx endpoint3 */
891#define USB_EP_NI3_RXCOUNT 0xffc03ed0 /* Number of bytes received in endpoint3 FIFO */
892#define USB_EP_NI3_TXTYPE 0xffc03ed4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
893#define USB_EP_NI3_TXINTERVAL 0xffc03ed8 /* Sets the NAK response timeout on Endpoint3 */
894#define USB_EP_NI3_RXTYPE 0xffc03edc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
895#define USB_EP_NI3_RXINTERVAL 0xffc03ee0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint3 */
896
897/* USB Endpoint 4 Control Registers */
898
899#define USB_EP_NI3_TXCOUNT 0xffc03ee8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
900#define USB_EP_NI4_TXMAXP 0xffc03f00 /* Maximum packet size for Host Tx endpoint4 */
901#define USB_EP_NI4_TXCSR 0xffc03f04 /* Control Status register for endpoint4 */
902#define USB_EP_NI4_RXMAXP 0xffc03f08 /* Maximum packet size for Host Rx endpoint4 */
903#define USB_EP_NI4_RXCSR 0xffc03f0c /* Control Status register for Host Rx endpoint4 */
904#define USB_EP_NI4_RXCOUNT 0xffc03f10 /* Number of bytes received in endpoint4 FIFO */
905#define USB_EP_NI4_TXTYPE 0xffc03f14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
906#define USB_EP_NI4_TXINTERVAL 0xffc03f18 /* Sets the NAK response timeout on Endpoint4 */
907#define USB_EP_NI4_RXTYPE 0xffc03f1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
908#define USB_EP_NI4_RXINTERVAL 0xffc03f20 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint4 */
909
910/* USB Endpoint 5 Control Registers */
911
912#define USB_EP_NI4_TXCOUNT 0xffc03f28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
913#define USB_EP_NI5_TXMAXP 0xffc03f40 /* Maximum packet size for Host Tx endpoint5 */
914#define USB_EP_NI5_TXCSR 0xffc03f44 /* Control Status register for endpoint5 */
915#define USB_EP_NI5_RXMAXP 0xffc03f48 /* Maximum packet size for Host Rx endpoint5 */
916#define USB_EP_NI5_RXCSR 0xffc03f4c /* Control Status register for Host Rx endpoint5 */
917#define USB_EP_NI5_RXCOUNT 0xffc03f50 /* Number of bytes received in endpoint5 FIFO */
918#define USB_EP_NI5_TXTYPE 0xffc03f54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
919#define USB_EP_NI5_TXINTERVAL 0xffc03f58 /* Sets the NAK response timeout on Endpoint5 */
920#define USB_EP_NI5_RXTYPE 0xffc03f5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
921#define USB_EP_NI5_RXINTERVAL 0xffc03f60 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint5 */
922
923/* USB Endpoint 6 Control Registers */
924
925#define USB_EP_NI5_TXCOUNT 0xffc03f68 /* Number of bytes to be written to the H145endpoint5 Tx FIFO */
926#define USB_EP_NI6_TXMAXP 0xffc03f80 /* Maximum packet size for Host Tx endpoint6 */
927#define USB_EP_NI6_TXCSR 0xffc03f84 /* Control Status register for endpoint6 */
928#define USB_EP_NI6_RXMAXP 0xffc03f88 /* Maximum packet size for Host Rx endpoint6 */
929#define USB_EP_NI6_RXCSR 0xffc03f8c /* Control Status register for Host Rx endpoint6 */
930#define USB_EP_NI6_RXCOUNT 0xffc03f90 /* Number of bytes received in endpoint6 FIFO */
931#define USB_EP_NI6_TXTYPE 0xffc03f94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
932#define USB_EP_NI6_TXINTERVAL 0xffc03f98 /* Sets the NAK response timeout on Endpoint6 */
933#define USB_EP_NI6_RXTYPE 0xffc03f9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
934#define USB_EP_NI6_RXINTERVAL 0xffc03fa0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint6 */
935
936/* USB Endpoint 7 Control Registers */
937
938#define USB_EP_NI6_TXCOUNT 0xffc03fa8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
939#define USB_EP_NI7_TXMAXP 0xffc03fc0 /* Maximum packet size for Host Tx endpoint7 */
940#define USB_EP_NI7_TXCSR 0xffc03fc4 /* Control Status register for endpoint7 */
941#define USB_EP_NI7_RXMAXP 0xffc03fc8 /* Maximum packet size for Host Rx endpoint7 */
942#define USB_EP_NI7_RXCSR 0xffc03fcc /* Control Status register for Host Rx endpoint7 */
943#define USB_EP_NI7_RXCOUNT 0xffc03fd0 /* Number of bytes received in endpoint7 FIFO */
944#define USB_EP_NI7_TXTYPE 0xffc03fd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
945#define USB_EP_NI7_TXINTERVAL 0xffc03fd8 /* Sets the NAK response timeout on Endpoint7 */
946#define USB_EP_NI7_RXTYPE 0xffc03fdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
947#define USB_EP_NI7_RXINTERVAL 0xffc03ff0 /* Sets the polling interval for Interrupt/Isochronous transfers or the NAK response timeout on Bulk transfers for Host Rx endpoint7 */
948#define USB_EP_NI7_TXCOUNT 0xffc03ff8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
949#define USB_DMA_INTERRUPT 0xffc04000 /* Indicates pending interrupts for the DMA channels */
950
951/* USB Channel 0 Config Registers */
952
953#define USB_DMA0CONTROL 0xffc04004 /* DMA master channel 0 configuration */
954#define USB_DMA0ADDRLOW 0xffc04008 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
955#define USB_DMA0ADDRHIGH 0xffc0400c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
956#define USB_DMA0COUNTLOW 0xffc04010 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
957#define USB_DMA0COUNTHIGH 0xffc04014 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
958
959/* USB Channel 1 Config Registers */
960
961#define USB_DMA1CONTROL 0xffc04024 /* DMA master channel 1 configuration */
962#define USB_DMA1ADDRLOW 0xffc04028 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
963#define USB_DMA1ADDRHIGH 0xffc0402c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
964#define USB_DMA1COUNTLOW 0xffc04030 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
965#define USB_DMA1COUNTHIGH 0xffc04034 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
966
967/* USB Channel 2 Config Registers */
968
969#define USB_DMA2CONTROL 0xffc04044 /* DMA master channel 2 configuration */
970#define USB_DMA2ADDRLOW 0xffc04048 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
971#define USB_DMA2ADDRHIGH 0xffc0404c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
972#define USB_DMA2COUNTLOW 0xffc04050 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
973#define USB_DMA2COUNTHIGH 0xffc04054 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
974
975/* USB Channel 3 Config Registers */
976
977#define USB_DMA3CONTROL 0xffc04064 /* DMA master channel 3 configuration */
978#define USB_DMA3ADDRLOW 0xffc04068 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
979#define USB_DMA3ADDRHIGH 0xffc0406c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
980#define USB_DMA3COUNTLOW 0xffc04070 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
981#define USB_DMA3COUNTHIGH 0xffc04074 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
982
983/* USB Channel 4 Config Registers */
984
985#define USB_DMA4CONTROL 0xffc04084 /* DMA master channel 4 configuration */
986#define USB_DMA4ADDRLOW 0xffc04088 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
987#define USB_DMA4ADDRHIGH 0xffc0408c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
988#define USB_DMA4COUNTLOW 0xffc04090 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
989#define USB_DMA4COUNTHIGH 0xffc04094 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
990
991/* USB Channel 5 Config Registers */
992
993#define USB_DMA5CONTROL 0xffc040a4 /* DMA master channel 5 configuration */
994#define USB_DMA5ADDRLOW 0xffc040a8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
995#define USB_DMA5ADDRHIGH 0xffc040ac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
996#define USB_DMA5COUNTLOW 0xffc040b0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
997#define USB_DMA5COUNTHIGH 0xffc040b4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
998
999/* USB Channel 6 Config Registers */
1000
1001#define USB_DMA6CONTROL 0xffc040c4 /* DMA master channel 6 configuration */
1002#define USB_DMA6ADDRLOW 0xffc040c8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
1003#define USB_DMA6ADDRHIGH 0xffc040cc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
1004#define USB_DMA6COUNTLOW 0xffc040d0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
1005#define USB_DMA6COUNTHIGH 0xffc040d4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
1006
1007/* USB Channel 7 Config Registers */
1008
1009#define USB_DMA7CONTROL 0xffc040e4 /* DMA master channel 7 configuration */
1010#define USB_DMA7ADDRLOW 0xffc040e8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
1011#define USB_DMA7ADDRHIGH 0xffc040ec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
1012#define USB_DMA7COUNTLOW 0xffc040f0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
1013#define USB_DMA7COUNTHIGH 0xffc040f4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
1014
1015/* Keypad Registers */
1016
1017#define KPAD_CTL 0xffc04100 /* Controls keypad module enable and disable */
1018#define KPAD_PRESCALE 0xffc04104 /* Establish a time base for programing the KPAD_MSEL register */
1019#define KPAD_MSEL 0xffc04108 /* Selects delay parameters for keypad interface sensitivity */
1020#define KPAD_ROWCOL 0xffc0410c /* Captures the row and column output values of the keys pressed */
1021#define KPAD_STAT 0xffc04110 /* Holds and clears the status of the keypad interface interrupt */
1022#define KPAD_SOFTEVAL 0xffc04114 /* Lets software force keypad interface to check for keys being pressed */
1023
1024/* Pixel Compositor (PIXC) Registers */
1025
1026#define PIXC_CTL 0xffc04400 /* Overlay enable, resampling mode, I/O data format, transparency enable, watermark level, FIFO status */
1027#define PIXC_PPL 0xffc04404 /* Holds the number of pixels per line of the display */
1028#define PIXC_LPF 0xffc04408 /* Holds the number of lines per frame of the display */
1029#define PIXC_AHSTART 0xffc0440c /* Contains horizontal start pixel information of the overlay data (set A) */
1030#define PIXC_AHEND 0xffc04410 /* Contains horizontal end pixel information of the overlay data (set A) */
1031#define PIXC_AVSTART 0xffc04414 /* Contains vertical start pixel information of the overlay data (set A) */
1032#define PIXC_AVEND 0xffc04418 /* Contains vertical end pixel information of the overlay data (set A) */
1033#define PIXC_ATRANSP 0xffc0441c /* Contains the transparency ratio (set A) */
1034#define PIXC_BHSTART 0xffc04420 /* Contains horizontal start pixel information of the overlay data (set B) */
1035#define PIXC_BHEND 0xffc04424 /* Contains horizontal end pixel information of the overlay data (set B) */
1036#define PIXC_BVSTART 0xffc04428 /* Contains vertical start pixel information of the overlay data (set B) */
1037#define PIXC_BVEND 0xffc0442c /* Contains vertical end pixel information of the overlay data (set B) */
1038#define PIXC_BTRANSP 0xffc04430 /* Contains the transparency ratio (set B) */
1039#define PIXC_INTRSTAT 0xffc0443c /* Overlay interrupt configuration/status */
1040#define PIXC_RYCON 0xffc04440 /* Color space conversion matrix register. Contains the R/Y conversion coefficients */
1041#define PIXC_GUCON 0xffc04444 /* Color space conversion matrix register. Contains the G/U conversion coefficients */
1042#define PIXC_BVCON 0xffc04448 /* Color space conversion matrix register. Contains the B/V conversion coefficients */
1043#define PIXC_CCBIAS 0xffc0444c /* Bias values for the color space conversion matrix */
1044#define PIXC_TC 0xffc04450 /* Holds the transparent color value */
1045
1046/* Handshake MDMA 0 Registers */
1047
1048#define HMDMA0_CONTROL 0xffc04500 /* Handshake MDMA0 Control Register */
1049#define HMDMA0_ECINIT 0xffc04504 /* Handshake MDMA0 Initial Edge Count Register */
1050#define HMDMA0_BCINIT 0xffc04508 /* Handshake MDMA0 Initial Block Count Register */
1051#define HMDMA0_ECURGENT 0xffc0450c /* Handshake MDMA0 Urgent Edge Count Threshhold Register */
1052#define HMDMA0_ECOVERFLOW 0xffc04510 /* Handshake MDMA0 Edge Count Overflow Interrupt Register */
1053#define HMDMA0_ECOUNT 0xffc04514 /* Handshake MDMA0 Current Edge Count Register */
1054#define HMDMA0_BCOUNT 0xffc04518 /* Handshake MDMA0 Current Block Count Register */
1055
1056/* Handshake MDMA 1 Registers */
1057
1058#define HMDMA1_CONTROL 0xffc04540 /* Handshake MDMA1 Control Register */
1059#define HMDMA1_ECINIT 0xffc04544 /* Handshake MDMA1 Initial Edge Count Register */
1060#define HMDMA1_BCINIT 0xffc04548 /* Handshake MDMA1 Initial Block Count Register */
1061#define HMDMA1_ECURGENT 0xffc0454c /* Handshake MDMA1 Urgent Edge Count Threshhold Register */
1062#define HMDMA1_ECOVERFLOW 0xffc04550 /* Handshake MDMA1 Edge Count Overflow Interrupt Register */
1063#define HMDMA1_ECOUNT 0xffc04554 /* Handshake MDMA1 Current Edge Count Register */
1064#define HMDMA1_BCOUNT 0xffc04558 /* Handshake MDMA1 Current Block Count Register */
1065
1066
1067/* ********************************************************** */
1068/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
1069/* and MULTI BIT READ MACROS */
1070/* ********************************************************** */
1071
1072/* Bit masks for PIXC_CTL */
1073
1074#define PIXC_EN 0x1 /* Pixel Compositor Enable */
1075#define OVR_A_EN 0x2 /* Overlay A Enable */
1076#define OVR_B_EN 0x4 /* Overlay B Enable */
1077#define IMG_FORM 0x8 /* Image Data Format */
1078#define OVR_FORM 0x10 /* Overlay Data Format */
1079#define OUT_FORM 0x20 /* Output Data Format */
1080#define UDS_MOD 0x40 /* Resampling Mode */
1081#define TC_EN 0x80 /* Transparent Color Enable */
1082#define IMG_STAT 0x300 /* Image FIFO Status */
1083#define OVR_STAT 0xc00 /* Overlay FIFO Status */
1084#define WM_LVL 0x3000 /* FIFO Watermark Level */
1085
1086/* Bit masks for PIXC_AHSTART */
1087
1088#define A_HSTART 0xfff /* Horizontal Start Coordinates */
1089
1090/* Bit masks for PIXC_AHEND */
1091
1092#define A_HEND 0xfff /* Horizontal End Coordinates */
1093
1094/* Bit masks for PIXC_AVSTART */
1095
1096#define A_VSTART 0x3ff /* Vertical Start Coordinates */
1097
1098/* Bit masks for PIXC_AVEND */
1099
1100#define A_VEND 0x3ff /* Vertical End Coordinates */
1101
1102/* Bit masks for PIXC_ATRANSP */
1103
1104#define A_TRANSP 0xf /* Transparency Value */
1105
1106/* Bit masks for PIXC_BHSTART */
1107
1108#define B_HSTART 0xfff /* Horizontal Start Coordinates */
1109
1110/* Bit masks for PIXC_BHEND */
1111
1112#define B_HEND 0xfff /* Horizontal End Coordinates */
1113
1114/* Bit masks for PIXC_BVSTART */
1115
1116#define B_VSTART 0x3ff /* Vertical Start Coordinates */
1117
1118/* Bit masks for PIXC_BVEND */
1119
1120#define B_VEND 0x3ff /* Vertical End Coordinates */
1121
1122/* Bit masks for PIXC_BTRANSP */
1123
1124#define B_TRANSP 0xf /* Transparency Value */
1125
1126/* Bit masks for PIXC_INTRSTAT */
1127
1128#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
1129#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
1130#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
1131#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
1132
1133/* Bit masks for PIXC_RYCON */
1134
1135#define A11 0x3ff /* A11 in the Coefficient Matrix */
1136#define A12 0xffc00 /* A12 in the Coefficient Matrix */
1137#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
1138#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
1139
1140/* Bit masks for PIXC_GUCON */
1141
1142#define A21 0x3ff /* A21 in the Coefficient Matrix */
1143#define A22 0xffc00 /* A22 in the Coefficient Matrix */
1144#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
1145#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
1146
1147/* Bit masks for PIXC_BVCON */
1148
1149#define A31 0x3ff /* A31 in the Coefficient Matrix */
1150#define A32 0xffc00 /* A32 in the Coefficient Matrix */
1151#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
1152#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
1153
1154/* Bit masks for PIXC_CCBIAS */
1155
1156#define A14 0x3ff /* A14 in the Bias Vector */
1157#define A24 0xffc00 /* A24 in the Bias Vector */
1158#define A34 0x3ff00000 /* A34 in the Bias Vector */
1159
1160/* Bit masks for PIXC_TC */
1161
1162#define RY_TRANS 0xff /* Transparent Color - R/Y Component */
1163#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
1164#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
1165
1166/* Bit masks for HOST_CONTROL */
1167
1168#define HOST_EN 0x1 /* Host Enable */
1169#define HOST_END 0x2 /* Host Endianess */
1170#define DATA_SIZE 0x4 /* Data Size */
1171#define HOST_RST 0x8 /* Host Reset */
1172#define HRDY_OVR 0x20 /* Host Ready Override */
1173#define INT_MODE 0x40 /* Interrupt Mode */
1174#define BT_EN 0x80 /* Bus Timeout Enable */
1175#define EHW 0x100 /* Enable Host Write */
1176#define EHR 0x200 /* Enable Host Read */
1177#define BDR 0x400 /* Burst DMA Requests */
1178
1179/* Bit masks for HOST_STATUS */
1180
1181#define DMA_READY 0x1 /* DMA Ready */
1182#define FIFOFULL 0x2 /* FIFO Full */
1183#define FIFOEMPTY 0x4 /* FIFO Empty */
1184#define DMA_COMPLETE 0x8 /* DMA Complete */
1185#define HSHK 0x10 /* Host Handshake */
1186#define TIMEOUT 0x20 /* Host Timeout */
1187#define HIRQ 0x40 /* Host Interrupt Request */
1188#define ALLOW_CNFG 0x80 /* Allow New Configuration */
1189#define DMA_DIR 0x100 /* DMA Direction */
1190#define BTE 0x200 /* Bus Timeout Enabled */
1191
1192/* Bit masks for HOST_TIMEOUT */
1193
1194#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
1195
1196/* Bit masks for MXVR_CONFIG */
1197
1198#define MXVREN 0x1 /* MXVR Enable */
1199#define MMSM 0x2 /* MXVR Master/Slave Mode Select */
1200#define ACTIVE 0x4 /* Active Mode */
1201#define SDELAY 0x8 /* Synchronous Data Delay */
1202#define NCMRXEN 0x10 /* Normal Control Message Receive Enable */
1203#define RWRRXEN 0x20 /* Remote Write Receive Enable */
1204#define MTXEN 0x40 /* MXVR Transmit Data Enable */
1205#define MTXONB 0x80 /* MXVR Phy Transmitter On */
1206#define EPARITY 0x100 /* Even Parity Select */
1207#define MSB 0x1e00 /* Master Synchronous Boundary */
1208#define APRXEN 0x2000 /* Asynchronous Packet Receive Enable */
1209#define WAKEUP 0x4000 /* Wake-Up */
1210#define LMECH 0x8000 /* Lock Mechanism Select */
1211
1212/* Bit masks for MXVR_STATE_0 */
1213
1214#define NACT 0x1 /* Network Activity */
1215#define SBLOCK 0x2 /* Super Block Lock */
1216#define FMPLLST 0xc /* Frequency Multiply PLL SM State */
1217#define CDRPLLST 0xe0 /* Clock/Data Recovery PLL SM State */
1218#define APBSY 0x100 /* Asynchronous Packet Transmit Buffer Busy */
1219#define APARB 0x200 /* Asynchronous Packet Arbitrating */
1220#define APTX 0x400 /* Asynchronous Packet Transmitting */
1221#define APRX 0x800 /* Receiving Asynchronous Packet */
1222#define CMBSY 0x1000 /* Control Message Transmit Buffer Busy */
1223#define CMARB 0x2000 /* Control Message Arbitrating */
1224#define CMTX 0x4000 /* Control Message Transmitting */
1225#define CMRX 0x8000 /* Receiving Control Message */
1226#define MRXONB 0x10000 /* MRXONB Pin State */
1227#define RGSIP 0x20000 /* Remote Get Source In Progress */
1228#define DALIP 0x40000 /* Resource Deallocate In Progress */
1229#define ALIP 0x80000 /* Resource Allocate In Progress */
1230#define RRDIP 0x100000 /* Remote Read In Progress */
1231#define RWRIP 0x200000 /* Remote Write In Progress */
1232#define FLOCK 0x400000 /* Frame Lock */
1233#define BLOCK 0x800000 /* Block Lock */
1234#define RSB 0xf000000 /* Received Synchronous Boundary */
1235#define DERRNUM 0xf0000000 /* DMA Error Channel Number */
1236
1237/* Bit masks for MXVR_STATE_1 */
1238
1239#define SRXNUMB 0xf /* Synchronous Receive FIFO Number of Bytes */
1240#define STXNUMB 0xf0 /* Synchronous Transmit FIFO Number of Bytes */
1241#define APCONT 0x100 /* Asynchronous Packet Continuation */
1242#define OBERRNUM 0xe00 /* DMA Out of Bounds Error Channel Number */
1243#define DMAACTIVE0 0x10000 /* DMA0 Active */
1244#define DMAACTIVE1 0x20000 /* DMA1 Active */
1245#define DMAACTIVE2 0x40000 /* DMA2 Active */
1246#define DMAACTIVE3 0x80000 /* DMA3 Active */
1247#define DMAACTIVE4 0x100000 /* DMA4 Active */
1248#define DMAACTIVE5 0x200000 /* DMA5 Active */
1249#define DMAACTIVE6 0x400000 /* DMA6 Active */
1250#define DMAACTIVE7 0x800000 /* DMA7 Active */
1251#define DMAPMEN0 0x1000000 /* DMA0 Pattern Matching Enabled */
1252#define DMAPMEN1 0x2000000 /* DMA1 Pattern Matching Enabled */
1253#define DMAPMEN2 0x4000000 /* DMA2 Pattern Matching Enabled */
1254#define DMAPMEN3 0x8000000 /* DMA3 Pattern Matching Enabled */
1255#define DMAPMEN4 0x10000000 /* DMA4 Pattern Matching Enabled */
1256#define DMAPMEN5 0x20000000 /* DMA5 Pattern Matching Enabled */
1257#define DMAPMEN6 0x40000000 /* DMA6 Pattern Matching Enabled */
1258#define DMAPMEN7 0x80000000 /* DMA7 Pattern Matching Enabled */
1259
1260/* Bit masks for MXVR_INT_STAT_0 */
1261
1262#define NI2A 0x1 /* Network Inactive to Active */
1263#define NA2I 0x2 /* Network Active to Inactive */
1264#define SBU2L 0x4 /* Super Block Unlock to Lock */
1265#define SBL2U 0x8 /* Super Block Lock to Unlock */
1266#define PRU 0x10 /* Position Register Updated */
1267#define MPRU 0x20 /* Maximum Position Register Updated */
1268#define DRU 0x40 /* Delay Register Updated */
1269#define MDRU 0x80 /* Maximum Delay Register Updated */
1270#define SBU 0x100 /* Synchronous Boundary Updated */
1271#define ATU 0x200 /* Allocation Table Updated */
1272#define FCZ0 0x400 /* Frame Counter 0 Zero */
1273#define FCZ1 0x800 /* Frame Counter 1 Zero */
1274#define PERR 0x1000 /* Parity Error */
1275#define MH2L 0x2000 /* MRXONB High to Low */
1276#define ML2H 0x4000 /* MRXONB Low to High */
1277#define WUP 0x8000 /* Wake-Up Preamble Received */
1278#define FU2L 0x10000 /* Frame Unlock to Lock */
1279#define FL2U 0x20000 /* Frame Lock to Unlock */
1280#define BU2L 0x40000 /* Block Unlock to Lock */
1281#define BL2U 0x80000 /* Block Lock to Unlock */
1282#define OBERR 0x100000 /* DMA Out of Bounds Error */
1283#define PFL 0x200000 /* PLL Frequency Locked */
1284#define SCZ 0x400000 /* System Clock Counter Zero */
1285#define FERR 0x800000 /* FIFO Error */
1286#define CMR 0x1000000 /* Control Message Received */
1287#define CMROF 0x2000000 /* Control Message Receive Buffer Overflow */
1288#define CMTS 0x4000000 /* Control Message Transmit Buffer Successfully Sent */
1289#define CMTC 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled */
1290#define RWRC 0x10000000 /* Remote Write Control Message Completed */
1291#define BCZ 0x20000000 /* Block Counter Zero */
1292#define BMERR 0x40000000 /* Biphase Mark Coding Error */
1293#define DERR 0x80000000 /* DMA Error */
1294
1295/* Bit masks for MXVR_INT_STAT_1 */
1296
1297#define HDONE0 0x1 /* DMA0 Half Done */
1298#define DONE0 0x2 /* DMA0 Done */
1299#define APR 0x4 /* Asynchronous Packet Received */
1300#define APROF 0x8 /* Asynchronous Packet Receive Buffer Overflow */
1301#define HDONE1 0x10 /* DMA1 Half Done */
1302#define DONE1 0x20 /* DMA1 Done */
1303#define APTS 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent */
1304#define APTC 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled */
1305#define HDONE2 0x100 /* DMA2 Half Done */
1306#define DONE2 0x200 /* DMA2 Done */
1307#define APRCE 0x400 /* Asynchronous Packet Receive CRC Error */
1308#define APRPE 0x800 /* Asynchronous Packet Receive Packet Error */
1309#define HDONE3 0x1000 /* DMA3 Half Done */
1310#define DONE3 0x2000 /* DMA3 Done */
1311#define HDONE4 0x10000 /* DMA4 Half Done */
1312#define DONE4 0x20000 /* DMA4 Done */
1313#define HDONE5 0x100000 /* DMA5 Half Done */
1314#define DONE5 0x200000 /* DMA5 Done */
1315#define HDONE6 0x1000000 /* DMA6 Half Done */
1316#define DONE6 0x2000000 /* DMA6 Done */
1317#define HDONE7 0x10000000 /* DMA7 Half Done */
1318#define DONE7 0x20000000 /* DMA7 Done */
1319
1320/* Bit masks for MXVR_INT_EN_0 */
1321
1322#define NI2AEN 0x1 /* Network Inactive to Active Interrupt Enable */
1323#define NA2IEN 0x2 /* Network Active to Inactive Interrupt Enable */
1324#define SBU2LEN 0x4 /* Super Block Unlock to Lock Interrupt Enable */
1325#define SBL2UEN 0x8 /* Super Block Lock to Unlock Interrupt Enable */
1326#define PRUEN 0x10 /* Position Register Updated Interrupt Enable */
1327#define MPRUEN 0x20 /* Maximum Position Register Updated Interrupt Enable */
1328#define DRUEN 0x40 /* Delay Register Updated Interrupt Enable */
1329#define MDRUEN 0x80 /* Maximum Delay Register Updated Interrupt Enable */
1330#define SBUEN 0x100 /* Synchronous Boundary Updated Interrupt Enable */
1331#define ATUEN 0x200 /* Allocation Table Updated Interrupt Enable */
1332#define FCZ0EN 0x400 /* Frame Counter 0 Zero Interrupt Enable */
1333#define FCZ1EN 0x800 /* Frame Counter 1 Zero Interrupt Enable */
1334#define PERREN 0x1000 /* Parity Error Interrupt Enable */
1335#define MH2LEN 0x2000 /* MRXONB High to Low Interrupt Enable */
1336#define ML2HEN 0x4000 /* MRXONB Low to High Interrupt Enable */
1337#define WUPEN 0x8000 /* Wake-Up Preamble Received Interrupt Enable */
1338#define FU2LEN 0x10000 /* Frame Unlock to Lock Interrupt Enable */
1339#define FL2UEN 0x20000 /* Frame Lock to Unlock Interrupt Enable */
1340#define BU2LEN 0x40000 /* Block Unlock to Lock Interrupt Enable */
1341#define BL2UEN 0x80000 /* Block Lock to Unlock Interrupt Enable */
1342#define OBERREN 0x100000 /* DMA Out of Bounds Error Interrupt Enable */
1343#define PFLEN 0x200000 /* PLL Frequency Locked Interrupt Enable */
1344#define SCZEN 0x400000 /* System Clock Counter Zero Interrupt Enable */
1345#define FERREN 0x800000 /* FIFO Error Interrupt Enable */
1346#define CMREN 0x1000000 /* Control Message Received Interrupt Enable */
1347#define CMROFEN 0x2000000 /* Control Message Receive Buffer Overflow Interrupt Enable */
1348#define CMTSEN 0x4000000 /* Control Message Transmit Buffer Successfully Sent Interrupt Enable */
1349#define CMTCEN 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled Interrupt Enable */
1350#define RWRCEN 0x10000000 /* Remote Write Control Message Completed Interrupt Enable */
1351#define BCZEN 0x20000000 /* Block Counter Zero Interrupt Enable */
1352#define BMERREN 0x40000000 /* Biphase Mark Coding Error Interrupt Enable */
1353#define DERREN 0x80000000 /* DMA Error Interrupt Enable */
1354
1355/* Bit masks for MXVR_INT_EN_1 */
1356
1357#define HDONEEN0 0x1 /* DMA0 Half Done Interrupt Enable */
1358#define DONEEN0 0x2 /* DMA0 Done Interrupt Enable */
1359#define APREN 0x4 /* Asynchronous Packet Received Interrupt Enable */
1360#define APROFEN 0x8 /* Asynchronous Packet Receive Buffer Overflow Interrupt Enable */
1361#define HDONEEN1 0x10 /* DMA1 Half Done Interrupt Enable */
1362#define DONEEN1 0x20 /* DMA1 Done Interrupt Enable */
1363#define APTSEN 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent Interrupt Enable */
1364#define APTCEN 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled Interrupt Enable */
1365#define HDONEEN2 0x100 /* DMA2 Half Done Interrupt Enable */
1366#define DONEEN2 0x200 /* DMA2 Done Interrupt Enable */
1367#define APRCEEN 0x400 /* Asynchronous Packet Receive CRC Error Interrupt Enable */
1368#define APRPEEN 0x800 /* Asynchronous Packet Receive Packet Error Interrupt Enable */
1369#define HDONEEN3 0x1000 /* DMA3 Half Done Interrupt Enable */
1370#define DONEEN3 0x2000 /* DMA3 Done Interrupt Enable */
1371#define HDONEEN4 0x10000 /* DMA4 Half Done Interrupt Enable */
1372#define DONEEN4 0x20000 /* DMA4 Done Interrupt Enable */
1373#define HDONEEN5 0x100000 /* DMA5 Half Done Interrupt Enable */
1374#define DONEEN5 0x200000 /* DMA5 Done Interrupt Enable */
1375#define HDONEEN6 0x1000000 /* DMA6 Half Done Interrupt Enable */
1376#define DONEEN6 0x2000000 /* DMA6 Done Interrupt Enable */
1377#define HDONEEN7 0x10000000 /* DMA7 Half Done Interrupt Enable */
1378#define DONEEN7 0x20000000 /* DMA7 Done Interrupt Enable */
1379
1380/* Bit masks for MXVR_POSITION */
1381
1382#define POSITION 0x3f /* Node Position */
1383#define PVALID 0x8000 /* Node Position Valid */
1384
1385/* Bit masks for MXVR_MAX_POSITION */
1386
1387#define MPOSITION 0x3f /* Maximum Node Position */
1388#define MPVALID 0x8000 /* Maximum Node Position Valid */
1389
1390/* Bit masks for MXVR_DELAY */
1391
1392#define DELAY 0x3f /* Node Frame Delay */
1393#define DVALID 0x8000 /* Node Frame Delay Valid */
1394
1395/* Bit masks for MXVR_MAX_DELAY */
1396
1397#define MDELAY 0x3f /* Maximum Node Frame Delay */
1398#define MDVALID 0x8000 /* Maximum Node Frame Delay Valid */
1399
1400/* Bit masks for MXVR_LADDR */
1401
1402#define LADDR 0xffff /* Logical Address */
1403#define LVALID 0x80000000 /* Logical Address Valid */
1404
1405/* Bit masks for MXVR_GADDR */
1406
1407#define GADDRL 0xff /* Group Address Lower Byte */
1408#define GVALID 0x8000 /* Group Address Valid */
1409
1410/* Bit masks for MXVR_AADDR */
1411
1412#define AADDR 0xffff /* Alternate Address */
1413#define AVALID 0x80000000 /* Alternate Address Valid */
1414
1415/* Bit masks for MXVR_ALLOC_0 */
1416
1417#define CL0 0x7f /* Channel 0 Connection Label */
1418#define CIU0 0x80 /* Channel 0 In Use */
1419#define CL1 0x7f00 /* Channel 0 Connection Label */
1420#define CIU1 0x8000 /* Channel 0 In Use */
1421#define CL2 0x7f0000 /* Channel 0 Connection Label */
1422#define CIU2 0x800000 /* Channel 0 In Use */
1423#define CL3 0x7f000000 /* Channel 0 Connection Label */
1424#define CIU3 0x80000000 /* Channel 0 In Use */
1425
1426/* Bit masks for MXVR_ALLOC_1 */
1427
1428#define CL4 0x7f /* Channel 4 Connection Label */
1429#define CIU4 0x80 /* Channel 4 In Use */
1430#define CL5 0x7f00 /* Channel 5 Connection Label */
1431#define CIU5 0x8000 /* Channel 5 In Use */
1432#define CL6 0x7f0000 /* Channel 6 Connection Label */
1433#define CIU6 0x800000 /* Channel 6 In Use */
1434#define CL7 0x7f000000 /* Channel 7 Connection Label */
1435#define CIU7 0x80000000 /* Channel 7 In Use */
1436
1437/* Bit masks for MXVR_ALLOC_2 */
1438
1439#define CL8 0x7f /* Channel 8 Connection Label */
1440#define CIU8 0x80 /* Channel 8 In Use */
1441#define CL9 0x7f00 /* Channel 9 Connection Label */
1442#define CIU9 0x8000 /* Channel 9 In Use */
1443#define CL10 0x7f0000 /* Channel 10 Connection Label */
1444#define CIU10 0x800000 /* Channel 10 In Use */
1445#define CL11 0x7f000000 /* Channel 11 Connection Label */
1446#define CIU11 0x80000000 /* Channel 11 In Use */
1447
1448/* Bit masks for MXVR_ALLOC_3 */
1449
1450#define CL12 0x7f /* Channel 12 Connection Label */
1451#define CIU12 0x80 /* Channel 12 In Use */
1452#define CL13 0x7f00 /* Channel 13 Connection Label */
1453#define CIU13 0x8000 /* Channel 13 In Use */
1454#define CL14 0x7f0000 /* Channel 14 Connection Label */
1455#define CIU14 0x800000 /* Channel 14 In Use */
1456#define CL15 0x7f000000 /* Channel 15 Connection Label */
1457#define CIU15 0x80000000 /* Channel 15 In Use */
1458
1459/* Bit masks for MXVR_ALLOC_4 */
1460
1461#define CL16 0x7f /* Channel 16 Connection Label */
1462#define CIU16 0x80 /* Channel 16 In Use */
1463#define CL17 0x7f00 /* Channel 17 Connection Label */
1464#define CIU17 0x8000 /* Channel 17 In Use */
1465#define CL18 0x7f0000 /* Channel 18 Connection Label */
1466#define CIU18 0x800000 /* Channel 18 In Use */
1467#define CL19 0x7f000000 /* Channel 19 Connection Label */
1468#define CIU19 0x80000000 /* Channel 19 In Use */
1469
1470/* Bit masks for MXVR_ALLOC_5 */
1471
1472#define CL20 0x7f /* Channel 20 Connection Label */
1473#define CIU20 0x80 /* Channel 20 In Use */
1474#define CL21 0x7f00 /* Channel 21 Connection Label */
1475#define CIU21 0x8000 /* Channel 21 In Use */
1476#define CL22 0x7f0000 /* Channel 22 Connection Label */
1477#define CIU22 0x800000 /* Channel 22 In Use */
1478#define CL23 0x7f000000 /* Channel 23 Connection Label */
1479#define CIU23 0x80000000 /* Channel 23 In Use */
1480
1481/* Bit masks for MXVR_ALLOC_6 */
1482
1483#define CL24 0x7f /* Channel 24 Connection Label */
1484#define CIU24 0x80 /* Channel 24 In Use */
1485#define CL25 0x7f00 /* Channel 25 Connection Label */
1486#define CIU25 0x8000 /* Channel 25 In Use */
1487#define CL26 0x7f0000 /* Channel 26 Connection Label */
1488#define CIU26 0x800000 /* Channel 26 In Use */
1489#define CL27 0x7f000000 /* Channel 27 Connection Label */
1490#define CIU27 0x80000000 /* Channel 27 In Use */
1491
1492/* Bit masks for MXVR_ALLOC_7 */
1493
1494#define CL28 0x7f /* Channel 28 Connection Label */
1495#define CIU28 0x80 /* Channel 28 In Use */
1496#define CL29 0x7f00 /* Channel 29 Connection Label */
1497#define CIU29 0x8000 /* Channel 29 In Use */
1498#define CL30 0x7f0000 /* Channel 30 Connection Label */
1499#define CIU30 0x800000 /* Channel 30 In Use */
1500#define CL31 0x7f000000 /* Channel 31 Connection Label */
1501#define CIU31 0x80000000 /* Channel 31 In Use */
1502
1503/* Bit masks for MXVR_ALLOC_8 */
1504
1505#define CL32 0x7f /* Channel 32 Connection Label */
1506#define CIU32 0x80 /* Channel 32 In Use */
1507#define CL33 0x7f00 /* Channel 33 Connection Label */
1508#define CIU33 0x8000 /* Channel 33 In Use */
1509#define CL34 0x7f0000 /* Channel 34 Connection Label */
1510#define CIU34 0x800000 /* Channel 34 In Use */
1511#define CL35 0x7f000000 /* Channel 35 Connection Label */
1512#define CIU35 0x80000000 /* Channel 35 In Use */
1513
1514/* Bit masks for MXVR_ALLOC_9 */
1515
1516#define CL36 0x7f /* Channel 36 Connection Label */
1517#define CIU36 0x80 /* Channel 36 In Use */
1518#define CL37 0x7f00 /* Channel 37 Connection Label */
1519#define CIU37 0x8000 /* Channel 37 In Use */
1520#define CL38 0x7f0000 /* Channel 38 Connection Label */
1521#define CIU38 0x800000 /* Channel 38 In Use */
1522#define CL39 0x7f000000 /* Channel 39 Connection Label */
1523#define CIU39 0x80000000 /* Channel 39 In Use */
1524
1525/* Bit masks for MXVR_ALLOC_10 */
1526
1527#define CL40 0x7f /* Channel 40 Connection Label */
1528#define CIU40 0x80 /* Channel 40 In Use */
1529#define CL41 0x7f00 /* Channel 41 Connection Label */
1530#define CIU41 0x8000 /* Channel 41 In Use */
1531#define CL42 0x7f0000 /* Channel 42 Connection Label */
1532#define CIU42 0x800000 /* Channel 42 In Use */
1533#define CL43 0x7f000000 /* Channel 43 Connection Label */
1534#define CIU43 0x80000000 /* Channel 43 In Use */
1535
1536/* Bit masks for MXVR_ALLOC_11 */
1537
1538#define CL44 0x7f /* Channel 44 Connection Label */
1539#define CIU44 0x80 /* Channel 44 In Use */
1540#define CL45 0x7f00 /* Channel 45 Connection Label */
1541#define CIU45 0x8000 /* Channel 45 In Use */
1542#define CL46 0x7f0000 /* Channel 46 Connection Label */
1543#define CIU46 0x800000 /* Channel 46 In Use */
1544#define CL47 0x7f000000 /* Channel 47 Connection Label */
1545#define CIU47 0x80000000 /* Channel 47 In Use */
1546
1547/* Bit masks for MXVR_ALLOC_12 */
1548
1549#define CL48 0x7f /* Channel 48 Connection Label */
1550#define CIU48 0x80 /* Channel 48 In Use */
1551#define CL49 0x7f00 /* Channel 49 Connection Label */
1552#define CIU49 0x8000 /* Channel 49 In Use */
1553#define CL50 0x7f0000 /* Channel 50 Connection Label */
1554#define CIU50 0x800000 /* Channel 50 In Use */
1555#define CL51 0x7f000000 /* Channel 51 Connection Label */
1556#define CIU51 0x80000000 /* Channel 51 In Use */
1557
1558/* Bit masks for MXVR_ALLOC_13 */
1559
1560#define CL52 0x7f /* Channel 52 Connection Label */
1561#define CIU52 0x80 /* Channel 52 In Use */
1562#define CL53 0x7f00 /* Channel 53 Connection Label */
1563#define CIU53 0x8000 /* Channel 53 In Use */
1564#define CL54 0x7f0000 /* Channel 54 Connection Label */
1565#define CIU54 0x800000 /* Channel 54 In Use */
1566#define CL55 0x7f000000 /* Channel 55 Connection Label */
1567#define CIU55 0x80000000 /* Channel 55 In Use */
1568
1569/* Bit masks for MXVR_ALLOC_14 */
1570
1571#define CL56 0x7f /* Channel 56 Connection Label */
1572#define CIU56 0x80 /* Channel 56 In Use */
1573#define CL57 0x7f00 /* Channel 57 Connection Label */
1574#define CIU57 0x8000 /* Channel 57 In Use */
1575#define CL58 0x7f0000 /* Channel 58 Connection Label */
1576#define CIU58 0x800000 /* Channel 58 In Use */
1577#define CL59 0x7f000000 /* Channel 59 Connection Label */
1578#define CIU59 0x80000000 /* Channel 59 In Use */
1579
1580/* MXVR_SYNC_LCHAN_0 Masks */
1581
1582#define LCHANPC0 0x0000000Flu
1583#define LCHANPC1 0x000000F0lu
1584#define LCHANPC2 0x00000F00lu
1585#define LCHANPC3 0x0000F000lu
1586#define LCHANPC4 0x000F0000lu
1587#define LCHANPC5 0x00F00000lu
1588#define LCHANPC6 0x0F000000lu
1589#define LCHANPC7 0xF0000000lu
1590
1591
1592/* MXVR_SYNC_LCHAN_1 Masks */
1593
1594#define LCHANPC8 0x0000000Flu
1595#define LCHANPC9 0x000000F0lu
1596#define LCHANPC10 0x00000F00lu
1597#define LCHANPC11 0x0000F000lu
1598#define LCHANPC12 0x000F0000lu
1599#define LCHANPC13 0x00F00000lu
1600#define LCHANPC14 0x0F000000lu
1601#define LCHANPC15 0xF0000000lu
1602
1603
1604/* MXVR_SYNC_LCHAN_2 Masks */
1605
1606#define LCHANPC16 0x0000000Flu
1607#define LCHANPC17 0x000000F0lu
1608#define LCHANPC18 0x00000F00lu
1609#define LCHANPC19 0x0000F000lu
1610#define LCHANPC20 0x000F0000lu
1611#define LCHANPC21 0x00F00000lu
1612#define LCHANPC22 0x0F000000lu
1613#define LCHANPC23 0xF0000000lu
1614
1615
1616/* MXVR_SYNC_LCHAN_3 Masks */
1617
1618#define LCHANPC24 0x0000000Flu
1619#define LCHANPC25 0x000000F0lu
1620#define LCHANPC26 0x00000F00lu
1621#define LCHANPC27 0x0000F000lu
1622#define LCHANPC28 0x000F0000lu
1623#define LCHANPC29 0x00F00000lu
1624#define LCHANPC30 0x0F000000lu
1625#define LCHANPC31 0xF0000000lu
1626
1627
1628/* MXVR_SYNC_LCHAN_4 Masks */
1629
1630#define LCHANPC32 0x0000000Flu
1631#define LCHANPC33 0x000000F0lu
1632#define LCHANPC34 0x00000F00lu
1633#define LCHANPC35 0x0000F000lu
1634#define LCHANPC36 0x000F0000lu
1635#define LCHANPC37 0x00F00000lu
1636#define LCHANPC38 0x0F000000lu
1637#define LCHANPC39 0xF0000000lu
1638
1639
1640/* MXVR_SYNC_LCHAN_5 Masks */
1641
1642#define LCHANPC40 0x0000000Flu
1643#define LCHANPC41 0x000000F0lu
1644#define LCHANPC42 0x00000F00lu
1645#define LCHANPC43 0x0000F000lu
1646#define LCHANPC44 0x000F0000lu
1647#define LCHANPC45 0x00F00000lu
1648#define LCHANPC46 0x0F000000lu
1649#define LCHANPC47 0xF0000000lu
1650
1651
1652/* MXVR_SYNC_LCHAN_6 Masks */
1653
1654#define LCHANPC48 0x0000000Flu
1655#define LCHANPC49 0x000000F0lu
1656#define LCHANPC50 0x00000F00lu
1657#define LCHANPC51 0x0000F000lu
1658#define LCHANPC52 0x000F0000lu
1659#define LCHANPC53 0x00F00000lu
1660#define LCHANPC54 0x0F000000lu
1661#define LCHANPC55 0xF0000000lu
1662
1663
1664/* MXVR_SYNC_LCHAN_7 Masks */
1665
1666#define LCHANPC56 0x0000000Flu
1667#define LCHANPC57 0x000000F0lu
1668#define LCHANPC58 0x00000F00lu
1669#define LCHANPC59 0x0000F000lu
1670
1671/* Bit masks for MXVR_DMAx_CONFIG */
1672
1673#define MDMAEN 0x1 /* DMA Channel Enable */
1674#define DMADD 0x2 /* DMA Channel Direction */
1675#define BY4SWAPEN 0x20 /* DMA Channel Four Byte Swap Enable */
1676#define LCHAN 0x3c0 /* DMA Channel Logical Channel */
1677#define BITSWAPEN 0x400 /* DMA Channel Bit Swap Enable */
1678#define BY2SWAPEN 0x800 /* DMA Channel Two Byte Swap Enable */
1679#define MFLOW 0x7000 /* DMA Channel Operation Flow */
1680#define FIXEDPM 0x80000 /* DMA Channel Fixed Pattern Matching Select */
1681#define STARTPAT 0x300000 /* DMA Channel Start Pattern Select */
1682#define STOPPAT 0xc00000 /* DMA Channel Stop Pattern Select */
1683#define COUNTPOS 0x1c000000 /* DMA Channel Count Position */
1684
1685/* Bit masks for MXVR_AP_CTL */
1686
1687#define STARTAP 0x1 /* Start Asynchronous Packet Transmission */
1688#define CANCELAP 0x2 /* Cancel Asynchronous Packet Transmission */
1689#define RESETAP 0x4 /* Reset Asynchronous Packet Arbitration */
1690#define APRBE0 0x4000 /* Asynchronous Packet Receive Buffer Entry 0 */
1691#define APRBE1 0x8000 /* Asynchronous Packet Receive Buffer Entry 1 */
1692
1693/* Bit masks for MXVR_APRB_START_ADDR */
1694
1695#define MXVR_APRB_START_ADDR_MASK 0x1fffffe /* Asynchronous Packet Receive Buffer Start Address */
1696
1697/* Bit masks for MXVR_APRB_CURR_ADDR */
1698
1699#define MXVR_APRB_CURR_ADDR_MASK 0xffffffff /* Asynchronous Packet Receive Buffer Current Address */
1700
1701/* Bit masks for MXVR_APTB_START_ADDR */
1702
1703#define MXVR_APTB_START_ADDR_MASK 0x1fffffe /* Asynchronous Packet Transmit Buffer Start Address */
1704
1705/* Bit masks for MXVR_APTB_CURR_ADDR */
1706
1707#define MXVR_APTB_CURR_ADDR_MASK 0xffffffff /* Asynchronous Packet Transmit Buffer Current Address */
1708
1709/* Bit masks for MXVR_CM_CTL */
1710
1711#define STARTCM 0x1 /* Start Control Message Transmission */
1712#define CANCELCM 0x2 /* Cancel Control Message Transmission */
1713#define CMRBE0 0x10000 /* Control Message Receive Buffer Entry 0 */
1714#define CMRBE1 0x20000 /* Control Message Receive Buffer Entry 1 */
1715#define CMRBE2 0x40000 /* Control Message Receive Buffer Entry 2 */
1716#define CMRBE3 0x80000 /* Control Message Receive Buffer Entry 3 */
1717#define CMRBE4 0x100000 /* Control Message Receive Buffer Entry 4 */
1718#define CMRBE5 0x200000 /* Control Message Receive Buffer Entry 5 */
1719#define CMRBE6 0x400000 /* Control Message Receive Buffer Entry 6 */
1720#define CMRBE7 0x800000 /* Control Message Receive Buffer Entry 7 */
1721#define CMRBE8 0x1000000 /* Control Message Receive Buffer Entry 8 */
1722#define CMRBE9 0x2000000 /* Control Message Receive Buffer Entry 9 */
1723#define CMRBE10 0x4000000 /* Control Message Receive Buffer Entry 10 */
1724#define CMRBE11 0x8000000 /* Control Message Receive Buffer Entry 11 */
1725#define CMRBE12 0x10000000 /* Control Message Receive Buffer Entry 12 */
1726#define CMRBE13 0x20000000 /* Control Message Receive Buffer Entry 13 */
1727#define CMRBE14 0x40000000 /* Control Message Receive Buffer Entry 14 */
1728#define CMRBE15 0x80000000 /* Control Message Receive Buffer Entry 15 */
1729
1730/* Bit masks for MXVR_CMRB_START_ADDR */
1731
1732#define MXVR_CMRB_START_ADDR_MASK 0x1fffffe /* Control Message Receive Buffer Start Address */
1733
1734/* Bit masks for MXVR_CMRB_CURR_ADDR */
1735
1736#define MXVR_CMRB_CURR_ADDR_MASK 0xffffffff /* Control Message Receive Buffer Current Address */
1737
1738/* Bit masks for MXVR_CMTB_START_ADDR */
1739
1740#define MXVR_CMTB_START_ADDR_MASK 0x1fffffe /* Control Message Transmit Buffer Start Address */
1741
1742/* Bit masks for MXVR_CMTB_CURR_ADDR */
1743
1744#define MXVR_CMTB_CURR_ADDR_MASK 0xffffffff /* Control Message Transmit Buffer Current Address */
1745
1746/* Bit masks for MXVR_RRDB_START_ADDR */
1747
1748#define MXVR_RRDB_START_ADDR_MASK 0x1fffffe /* Remote Read Buffer Start Address */
1749
1750/* Bit masks for MXVR_RRDB_CURR_ADDR */
1751
1752#define MXVR_RRDB_CURR_ADDR_MASK 0xffffffff /* Remote Read Buffer Current Address */
1753
1754/* Bit masks for MXVR_PAT_DATAx */
1755
1756#define MATCH_DATA_0 0xff /* Pattern Match Data Byte 0 */
1757#define MATCH_DATA_1 0xff00 /* Pattern Match Data Byte 1 */
1758#define MATCH_DATA_2 0xff0000 /* Pattern Match Data Byte 2 */
1759#define MATCH_DATA_3 0xff000000 /* Pattern Match Data Byte 3 */
1760
1761/* Bit masks for MXVR_PAT_EN_0 */
1762
1763#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */
1764#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */
1765#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */
1766#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */
1767#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */
1768#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */
1769#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */
1770#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */
1771#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */
1772#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */
1773#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */
1774#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */
1775#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */
1776#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */
1777#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */
1778#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */
1779#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */
1780#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */
1781#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */
1782#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */
1783#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */
1784#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */
1785#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */
1786#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */
1787#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */
1788#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */
1789#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */
1790#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */
1791#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */
1792#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */
1793#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */
1794#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */
1795
1796/* Bit masks for MXVR_PAT_EN_1 */
1797
1798#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */
1799#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */
1800#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */
1801#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */
1802#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */
1803#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */
1804#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */
1805#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */
1806#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */
1807#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */
1808#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */
1809#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */
1810#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */
1811#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */
1812#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */
1813#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */
1814#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */
1815#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */
1816#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */
1817#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */
1818#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */
1819#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */
1820#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */
1821#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */
1822#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */
1823#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */
1824#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */
1825#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */
1826#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */
1827#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */
1828#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */
1829#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */
1830
1831/* Bit masks for MXVR_FRAME_CNT_0 */
1832
1833#define FCNT 0xffff /* Frame Count */
1834
1835/* Bit masks for MXVR_FRAME_CNT_1 */
1836
1837#define FCNT 0xffff /* Frame Count */
1838
1839/* Bit masks for MXVR_ROUTING_0 */
1840
1841#define TX_CH0 0x3f /* Transmit Channel 0 */
1842#define MUTE_CH0 0x80 /* Mute Channel 0 */
1843#define TX_CH1 0x3f00 /* Transmit Channel 0 */
1844#define MUTE_CH1 0x8000 /* Mute Channel 0 */
1845#define TX_CH2 0x3f0000 /* Transmit Channel 0 */
1846#define MUTE_CH2 0x800000 /* Mute Channel 0 */
1847#define TX_CH3 0x3f000000 /* Transmit Channel 0 */
1848#define MUTE_CH3 0x80000000 /* Mute Channel 0 */
1849
1850/* Bit masks for MXVR_ROUTING_1 */
1851
1852#define TX_CH4 0x3f /* Transmit Channel 4 */
1853#define MUTE_CH4 0x80 /* Mute Channel 4 */
1854#define TX_CH5 0x3f00 /* Transmit Channel 5 */
1855#define MUTE_CH5 0x8000 /* Mute Channel 5 */
1856#define TX_CH6 0x3f0000 /* Transmit Channel 6 */
1857#define MUTE_CH6 0x800000 /* Mute Channel 6 */
1858#define TX_CH7 0x3f000000 /* Transmit Channel 7 */
1859#define MUTE_CH7 0x80000000 /* Mute Channel 7 */
1860
1861/* Bit masks for MXVR_ROUTING_2 */
1862
1863#define TX_CH8 0x3f /* Transmit Channel 8 */
1864#define MUTE_CH8 0x80 /* Mute Channel 8 */
1865#define TX_CH9 0x3f00 /* Transmit Channel 9 */
1866#define MUTE_CH9 0x8000 /* Mute Channel 9 */
1867#define TX_CH10 0x3f0000 /* Transmit Channel 10 */
1868#define MUTE_CH10 0x800000 /* Mute Channel 10 */
1869#define TX_CH11 0x3f000000 /* Transmit Channel 11 */
1870#define MUTE_CH11 0x80000000 /* Mute Channel 11 */
1871
1872/* Bit masks for MXVR_ROUTING_3 */
1873
1874#define TX_CH12 0x3f /* Transmit Channel 12 */
1875#define MUTE_CH12 0x80 /* Mute Channel 12 */
1876#define TX_CH13 0x3f00 /* Transmit Channel 13 */
1877#define MUTE_CH13 0x8000 /* Mute Channel 13 */
1878#define TX_CH14 0x3f0000 /* Transmit Channel 14 */
1879#define MUTE_CH14 0x800000 /* Mute Channel 14 */
1880#define TX_CH15 0x3f000000 /* Transmit Channel 15 */
1881#define MUTE_CH15 0x80000000 /* Mute Channel 15 */
1882
1883/* Bit masks for MXVR_ROUTING_4 */
1884
1885#define TX_CH16 0x3f /* Transmit Channel 16 */
1886#define MUTE_CH16 0x80 /* Mute Channel 16 */
1887#define TX_CH17 0x3f00 /* Transmit Channel 17 */
1888#define MUTE_CH17 0x8000 /* Mute Channel 17 */
1889#define TX_CH18 0x3f0000 /* Transmit Channel 18 */
1890#define MUTE_CH18 0x800000 /* Mute Channel 18 */
1891#define TX_CH19 0x3f000000 /* Transmit Channel 19 */
1892#define MUTE_CH19 0x80000000 /* Mute Channel 19 */
1893
1894/* Bit masks for MXVR_ROUTING_5 */
1895
1896#define TX_CH20 0x3f /* Transmit Channel 20 */
1897#define MUTE_CH20 0x80 /* Mute Channel 20 */
1898#define TX_CH21 0x3f00 /* Transmit Channel 21 */
1899#define MUTE_CH21 0x8000 /* Mute Channel 21 */
1900#define TX_CH22 0x3f0000 /* Transmit Channel 22 */
1901#define MUTE_CH22 0x800000 /* Mute Channel 22 */
1902#define TX_CH23 0x3f000000 /* Transmit Channel 23 */
1903#define MUTE_CH23 0x80000000 /* Mute Channel 23 */
1904
1905/* Bit masks for MXVR_ROUTING_6 */
1906
1907#define TX_CH24 0x3f /* Transmit Channel 24 */
1908#define MUTE_CH24 0x80 /* Mute Channel 24 */
1909#define TX_CH25 0x3f00 /* Transmit Channel 25 */
1910#define MUTE_CH25 0x8000 /* Mute Channel 25 */
1911#define TX_CH26 0x3f0000 /* Transmit Channel 26 */
1912#define MUTE_CH26 0x800000 /* Mute Channel 26 */
1913#define TX_CH27 0x3f000000 /* Transmit Channel 27 */
1914#define MUTE_CH27 0x80000000 /* Mute Channel 27 */
1915
1916/* Bit masks for MXVR_ROUTING_7 */
1917
1918#define TX_CH28 0x3f /* Transmit Channel 28 */
1919#define MUTE_CH28 0x80 /* Mute Channel 28 */
1920#define TX_CH29 0x3f00 /* Transmit Channel 29 */
1921#define MUTE_CH29 0x8000 /* Mute Channel 29 */
1922#define TX_CH30 0x3f0000 /* Transmit Channel 30 */
1923#define MUTE_CH30 0x800000 /* Mute Channel 30 */
1924#define TX_CH31 0x3f000000 /* Transmit Channel 31 */
1925#define MUTE_CH31 0x80000000 /* Mute Channel 31 */
1926
1927/* Bit masks for MXVR_ROUTING_8 */
1928
1929#define TX_CH32 0x3f /* Transmit Channel 32 */
1930#define MUTE_CH32 0x80 /* Mute Channel 32 */
1931#define TX_CH33 0x3f00 /* Transmit Channel 33 */
1932#define MUTE_CH33 0x8000 /* Mute Channel 33 */
1933#define TX_CH34 0x3f0000 /* Transmit Channel 34 */
1934#define MUTE_CH34 0x800000 /* Mute Channel 34 */
1935#define TX_CH35 0x3f000000 /* Transmit Channel 35 */
1936#define MUTE_CH35 0x80000000 /* Mute Channel 35 */
1937
1938/* Bit masks for MXVR_ROUTING_9 */
1939
1940#define TX_CH36 0x3f /* Transmit Channel 36 */
1941#define MUTE_CH36 0x80 /* Mute Channel 36 */
1942#define TX_CH37 0x3f00 /* Transmit Channel 37 */
1943#define MUTE_CH37 0x8000 /* Mute Channel 37 */
1944#define TX_CH38 0x3f0000 /* Transmit Channel 38 */
1945#define MUTE_CH38 0x800000 /* Mute Channel 38 */
1946#define TX_CH39 0x3f000000 /* Transmit Channel 39 */
1947#define MUTE_CH39 0x80000000 /* Mute Channel 39 */
1948
1949/* Bit masks for MXVR_ROUTING_10 */
1950
1951#define TX_CH40 0x3f /* Transmit Channel 40 */
1952#define MUTE_CH40 0x80 /* Mute Channel 40 */
1953#define TX_CH41 0x3f00 /* Transmit Channel 41 */
1954#define MUTE_CH41 0x8000 /* Mute Channel 41 */
1955#define TX_CH42 0x3f0000 /* Transmit Channel 42 */
1956#define MUTE_CH42 0x800000 /* Mute Channel 42 */
1957#define TX_CH43 0x3f000000 /* Transmit Channel 43 */
1958#define MUTE_CH43 0x80000000 /* Mute Channel 43 */
1959
1960/* Bit masks for MXVR_ROUTING_11 */
1961
1962#define TX_CH44 0x3f /* Transmit Channel 44 */
1963#define MUTE_CH44 0x80 /* Mute Channel 44 */
1964#define TX_CH45 0x3f00 /* Transmit Channel 45 */
1965#define MUTE_CH45 0x8000 /* Mute Channel 45 */
1966#define TX_CH46 0x3f0000 /* Transmit Channel 46 */
1967#define MUTE_CH46 0x800000 /* Mute Channel 46 */
1968#define TX_CH47 0x3f000000 /* Transmit Channel 47 */
1969#define MUTE_CH47 0x80000000 /* Mute Channel 47 */
1970
1971/* Bit masks for MXVR_ROUTING_12 */
1972
1973#define TX_CH48 0x3f /* Transmit Channel 48 */
1974#define MUTE_CH48 0x80 /* Mute Channel 48 */
1975#define TX_CH49 0x3f00 /* Transmit Channel 49 */
1976#define MUTE_CH49 0x8000 /* Mute Channel 49 */
1977#define TX_CH50 0x3f0000 /* Transmit Channel 50 */
1978#define MUTE_CH50 0x800000 /* Mute Channel 50 */
1979#define TX_CH51 0x3f000000 /* Transmit Channel 51 */
1980#define MUTE_CH51 0x80000000 /* Mute Channel 51 */
1981
1982/* Bit masks for MXVR_ROUTING_13 */
1983
1984#define TX_CH52 0x3f /* Transmit Channel 52 */
1985#define MUTE_CH52 0x80 /* Mute Channel 52 */
1986#define TX_CH53 0x3f00 /* Transmit Channel 53 */
1987#define MUTE_CH53 0x8000 /* Mute Channel 53 */
1988#define TX_CH54 0x3f0000 /* Transmit Channel 54 */
1989#define MUTE_CH54 0x800000 /* Mute Channel 54 */
1990#define TX_CH55 0x3f000000 /* Transmit Channel 55 */
1991#define MUTE_CH55 0x80000000 /* Mute Channel 55 */
1992
1993/* Bit masks for MXVR_ROUTING_14 */
1994
1995#define TX_CH56 0x3f /* Transmit Channel 56 */
1996#define MUTE_CH56 0x80 /* Mute Channel 56 */
1997#define TX_CH57 0x3f00 /* Transmit Channel 57 */
1998#define MUTE_CH57 0x8000 /* Mute Channel 57 */
1999#define TX_CH58 0x3f0000 /* Transmit Channel 58 */
2000#define MUTE_CH58 0x800000 /* Mute Channel 58 */
2001#define TX_CH59 0x3f000000 /* Transmit Channel 59 */
2002#define MUTE_CH59 0x80000000 /* Mute Channel 59 */
2003
2004/* Bit masks for MXVR_BLOCK_CNT */
2005
2006#define BCNT 0xffff /* Block Count */
2007
2008/* Bit masks for MXVR_CLK_CTL */
2009
2010#define MXTALCEN 0x1 /* MXVR Crystal Oscillator Clock Enable */
2011#define MXTALFEN 0x2 /* MXVR Crystal Oscillator Feedback Enable */
2012#define MXTALMUL 0x30 /* MXVR Crystal Multiplier */
2013#define CLKX3SEL 0x80 /* Clock Generation Source Select */
2014#define MMCLKEN 0x100 /* Master Clock Enable */
2015#define MMCLKMUL 0x1e00 /* Master Clock Multiplication Factor */
2016#define PLLSMPS 0xe000 /* MXVR PLL State Machine Prescaler */
2017#define MBCLKEN 0x10000 /* Bit Clock Enable */
2018#define MBCLKDIV 0x1e0000 /* Bit Clock Divide Factor */
2019#define INVRX 0x800000 /* Invert Receive Data */
2020#define MFSEN 0x1000000 /* Frame Sync Enable */
2021#define MFSDIV 0x1e000000 /* Frame Sync Divide Factor */
2022#define MFSSEL 0x60000000 /* Frame Sync Select */
2023#define MFSSYNC 0x80000000 /* Frame Sync Synchronization Select */
2024
2025/* Bit masks for MXVR_CDRPLL_CTL */
2026
2027#define CDRSMEN 0x1 /* MXVR CDRPLL State Machine Enable */
2028#define CDRRSTB 0x2 /* MXVR CDRPLL Reset */
2029#define CDRSVCO 0x4 /* MXVR CDRPLL Start VCO */
2030#define CDRMODE 0x8 /* MXVR CDRPLL CDR Mode Select */
2031#define CDRSCNT 0x3f0 /* MXVR CDRPLL Start Counter */
2032#define CDRLCNT 0xfc00 /* MXVR CDRPLL Lock Counter */
2033#define CDRSHPSEL 0x3f0000 /* MXVR CDRPLL Shaper Select */
2034#define CDRSHPEN 0x800000 /* MXVR CDRPLL Shaper Enable */
2035#define CDRCPSEL 0xff000000 /* MXVR CDRPLL Charge Pump Current Select */
2036
2037/* Bit masks for MXVR_FMPLL_CTL */
2038
2039#define FMSMEN 0x1 /* MXVR FMPLL State Machine Enable */
2040#define FMRSTB 0x2 /* MXVR FMPLL Reset */
2041#define FMSVCO 0x4 /* MXVR FMPLL Start VCO */
2042#define FMSCNT 0x3f0 /* MXVR FMPLL Start Counter */
2043#define FMLCNT 0xfc00 /* MXVR FMPLL Lock Counter */
2044#define FMCPSEL 0xff000000 /* MXVR FMPLL Charge Pump Current Select */
2045
2046/* Bit masks for MXVR_PIN_CTL */
2047
2048#define MTXONBOD 0x1 /* MTXONB Open Drain Select */
2049#define MTXONBG 0x2 /* MTXONB Gates MTX Select */
2050#define MFSOE 0x10 /* MFS Output Enable */
2051#define MFSGPSEL 0x20 /* MFS General Purpose Output Select */
2052#define MFSGPDAT 0x40 /* MFS General Purpose Output Data */
2053
2054/* Bit masks for MXVR_SCLK_CNT */
2055
2056#define SCNT 0xffff /* System Clock Count */
2057
2058/* Bit masks for KPAD_CTL */
2059
2060#define KPAD_EN 0x1 /* Keypad Enable */
2061#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
2062#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
2063#define KPAD_COLEN 0xe000 /* Column Enable Width */
2064
2065/* Bit masks for KPAD_PRESCALE */
2066
2067#define KPAD_PRESCALE_VAL 0x3f /* Key Prescale Value */
2068
2069/* Bit masks for KPAD_MSEL */
2070
2071#define DBON_SCALE 0xff /* Debounce Scale Value */
2072#define COLDRV_SCALE 0xff00 /* Column Driver Scale Value */
2073
2074/* Bit masks for KPAD_ROWCOL */
2075
2076#define KPAD_ROW 0xff /* Rows Pressed */
2077#define KPAD_COL 0xff00 /* Columns Pressed */
2078
2079/* Bit masks for KPAD_STAT */
2080
2081#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
2082#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
2083#define KPAD_PRESSED 0x8 /* Key press current status */
2084
2085/* Bit masks for KPAD_SOFTEVAL */
2086
2087#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
2088
2089/* Bit masks for SDH_COMMAND */
2090
2091#define CMD_IDX 0x3f /* Command Index */
2092#define CMD_RSP 0x40 /* Response */
2093#define CMD_L_RSP 0x80 /* Long Response */
2094#define CMD_INT_E 0x100 /* Command Interrupt */
2095#define CMD_PEND_E 0x200 /* Command Pending */
2096#define CMD_E 0x400 /* Command Enable */
2097
2098/* Bit masks for SDH_PWR_CTL */
2099
2100#define PWR_ON 0x3 /* Power On */
2101#if 0
2102#define TBD 0x3c /* TBD */
2103#endif
2104#define SD_CMD_OD 0x40 /* Open Drain Output */
2105#define ROD_CTL 0x80 /* Rod Control */
2106
2107/* Bit masks for SDH_CLK_CTL */
2108
2109#define CLKDIV 0xff /* MC_CLK Divisor */
2110#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
2111#define PWR_SV_E 0x200 /* Power Save Enable */
2112#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
2113#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
2114
2115/* Bit masks for SDH_RESP_CMD */
2116
2117#define RESP_CMD 0x3f /* Response Command */
2118
2119/* Bit masks for SDH_DATA_CTL */
2120
2121#define DTX_E 0x1 /* Data Transfer Enable */
2122#define DTX_DIR 0x2 /* Data Transfer Direction */
2123#define DTX_MODE 0x4 /* Data Transfer Mode */
2124#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
2125#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
2126
2127/* Bit masks for SDH_STATUS */
2128
2129#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
2130#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
2131#define CMD_TIME_OUT 0x4 /* CMD Time Out */
2132#define DAT_TIME_OUT 0x8 /* Data Time Out */
2133#define TX_UNDERRUN 0x10 /* Transmit Underrun */
2134#define RX_OVERRUN 0x20 /* Receive Overrun */
2135#define CMD_RESP_END 0x40 /* CMD Response End */
2136#define CMD_SENT 0x80 /* CMD Sent */
2137#define DAT_END 0x100 /* Data End */
2138#define START_BIT_ERR 0x200 /* Start Bit Error */
2139#define DAT_BLK_END 0x400 /* Data Block End */
2140#define CMD_ACT 0x800 /* CMD Active */
2141#define TX_ACT 0x1000 /* Transmit Active */
2142#define RX_ACT 0x2000 /* Receive Active */
2143#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
2144#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
2145#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
2146#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
2147#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
2148#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
2149#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
2150#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
2151
2152/* Bit masks for SDH_STATUS_CLR */
2153
2154#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
2155#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
2156#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
2157#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
2158#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
2159#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
2160#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
2161#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
2162#define DAT_END_STAT 0x100 /* Data End Status */
2163#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
2164#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
2165
2166/* Bit masks for SDH_MASK0 */
2167
2168#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
2169#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
2170#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
2171#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
2172#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
2173#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
2174#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
2175#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
2176#define DAT_END_MASK 0x100 /* Data End Mask */
2177#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
2178#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
2179#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
2180#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
2181#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
2182#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
2183#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
2184#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
2185#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
2186#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
2187#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
2188#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
2189#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
2190
2191/* Bit masks for SDH_FIFO_CNT */
2192
2193#define FIFO_COUNT 0x7fff /* FIFO Count */
2194
2195/* Bit masks for SDH_E_STATUS */
2196
2197#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
2198#define SD_CARD_DET 0x10 /* SD Card Detect */
2199
2200/* Bit masks for SDH_E_MASK */
2201
2202#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
2203#define SCD_MSK 0x40 /* Mask Card Detect */
2204
2205/* Bit masks for SDH_CFG */
2206
2207#define CLKS_EN 0x1 /* Clocks Enable */
2208#define SD4E 0x4 /* SDIO 4-Bit Enable */
2209#define MWE 0x8 /* Moving Window Enable */
2210#define SD_RST 0x10 /* SDMMC Reset */
2211#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
2212#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
2213#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
2214
2215/* Bit masks for SDH_RD_WAIT_EN */
2216
2217#define RWR 0x1 /* Read Wait Request */
2218
2219/* Bit masks for ATAPI_CONTROL */
2220
2221#define PIO_START 0x1 /* Start PIO/Reg Op */
2222#define MULTI_START 0x2 /* Start Multi-DMA Op */
2223#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
2224#define XFER_DIR 0x8 /* Transfer Direction */
2225#define IORDY_EN 0x10 /* IORDY Enable */
2226#define FIFO_FLUSH 0x20 /* Flush FIFOs */
2227#define SOFT_RST 0x40 /* Soft Reset */
2228#define DEV_RST 0x80 /* Device Reset */
2229#define TFRCNT_RST 0x100 /* Trans Count Reset */
2230#define END_ON_TERM 0x200 /* End/Terminate Select */
2231#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
2232#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
2233
2234/* Bit masks for ATAPI_STATUS */
2235
2236#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
2237#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
2238#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
2239#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
2240
2241/* Bit masks for ATAPI_DEV_ADDR */
2242
2243#define DEV_ADDR 0x1f /* Device Address */
2244
2245/* Bit masks for ATAPI_INT_MASK */
2246
2247#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
2248#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
2249#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
2250#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
2251#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
2252#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
2253#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
2254#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
2255#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
2256
2257/* Bit masks for ATAPI_INT_STATUS */
2258
2259#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
2260#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
2261#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
2262#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
2263#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
2264#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
2265#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
2266#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
2267#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
2268
2269/* Bit masks for ATAPI_LINE_STATUS */
2270
2271#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
2272#define ATAPI_DASP 0x2 /* Device dasp to host line status */
2273#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
2274#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
2275#define ATAPI_ADDR 0x70 /* ATAPI address line status */
2276#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
2277#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
2278#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
2279#define ATAPI_DIORN 0x400 /* ATAPI read line status */
2280#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
2281
2282/* Bit masks for ATAPI_SM_STATE */
2283
2284#define PIO_CSTATE 0xf /* PIO mode state machine current state */
2285#define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
2286#define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
2287#define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
2288
2289/* Bit masks for ATAPI_TERMINATE */
2290
2291#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
2292
2293/* Bit masks for ATAPI_REG_TIM_0 */
2294
2295#define T2_REG 0xff /* End of cycle time for register access transfers */
2296#define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
2297
2298/* Bit masks for ATAPI_PIO_TIM_0 */
2299
2300#define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
2301#define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
2302#define T4_REG 0xf000 /* DIOW data hold */
2303
2304/* Bit masks for ATAPI_PIO_TIM_1 */
2305
2306#define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
2307
2308/* Bit masks for ATAPI_MULTI_TIM_0 */
2309
2310#define TD 0xff /* DIOR/DIOW asserted pulsewidth */
2311#define TM 0xff00 /* Time from address valid to DIOR/DIOW */
2312
2313/* Bit masks for ATAPI_MULTI_TIM_1 */
2314
2315#define TKW 0xff /* Selects DIOW negated pulsewidth */
2316#define TKR 0xff00 /* Selects DIOR negated pulsewidth */
2317
2318/* Bit masks for ATAPI_MULTI_TIM_2 */
2319
2320#define TH 0xff /* Selects DIOW data hold */
2321#define TEOC 0xff00 /* Selects end of cycle for DMA */
2322
2323/* Bit masks for ATAPI_ULTRA_TIM_0 */
2324
2325#define TACK 0xff /* Selects setup and hold times for TACK */
2326#define TENV 0xff00 /* Selects envelope time */
2327
2328/* Bit masks for ATAPI_ULTRA_TIM_1 */
2329
2330#define TDVS 0xff /* Selects data valid setup time */
2331#define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
2332
2333/* Bit masks for ATAPI_ULTRA_TIM_2 */
2334
2335#define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
2336#define TMLI 0xff00 /* Selects interlock time */
2337
2338/* Bit masks for ATAPI_ULTRA_TIM_3 */
2339
2340#define TZAH 0xff /* Selects minimum delay required for output */
2341#define READY_PAUSE 0xff00 /* Selects ready to pause */
2342
2343/* Bit masks for TIMER_ENABLE1 */
2344
2345#define TIMEN8 0x1 /* Timer 8 Enable */
2346#define TIMEN9 0x2 /* Timer 9 Enable */
2347#define TIMEN10 0x4 /* Timer 10 Enable */
2348
2349/* Bit masks for TIMER_DISABLE1 */
2350
2351#define TIMDIS8 0x1 /* Timer 8 Disable */
2352#define TIMDIS9 0x2 /* Timer 9 Disable */
2353#define TIMDIS10 0x4 /* Timer 10 Disable */
2354
2355/* Bit masks for TIMER_STATUS1 */
2356
2357#define TIMIL8 0x1 /* Timer 8 Interrupt */
2358#define TIMIL9 0x2 /* Timer 9 Interrupt */
2359#define TIMIL10 0x4 /* Timer 10 Interrupt */
2360#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
2361#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
2362#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
2363#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
2364#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
2365#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
2366
2367/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
2368
2369/* Bit masks for USB_FADDR */
2370
2371#define FUNCTION_ADDRESS 0x7f /* Function address */
2372
2373/* Bit masks for USB_POWER */
2374
2375#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
2376#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
2377#define RESUME_MODE 0x4 /* DMA Mode */
2378#define RESET 0x8 /* Reset indicator */
2379#define HS_MODE 0x10 /* High Speed mode indicator */
2380#define HS_ENABLE 0x20 /* high Speed Enable */
2381#define SOFT_CONN 0x40 /* Soft connect */
2382#define ISO_UPDATE 0x80 /* Isochronous update */
2383
2384/* Bit masks for USB_INTRTX */
2385
2386#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
2387#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
2388#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
2389#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
2390#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
2391#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
2392#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
2393#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
2394
2395/* Bit masks for USB_INTRRX */
2396
2397#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
2398#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
2399#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
2400#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
2401#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
2402#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
2403#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
2404
2405/* Bit masks for USB_INTRTXE */
2406
2407#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
2408#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
2409#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
2410#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
2411#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
2412#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
2413#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
2414#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
2415
2416/* Bit masks for USB_INTRRXE */
2417
2418#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
2419#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
2420#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
2421#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
2422#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
2423#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
2424#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
2425
2426/* Bit masks for USB_INTRUSB */
2427
2428#define SUSPEND_B 0x1 /* Suspend indicator */
2429#define RESUME_B 0x2 /* Resume indicator */
2430#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
2431#define SOF_B 0x8 /* Start of frame */
2432#define CONN_B 0x10 /* Connection indicator */
2433#define DISCON_B 0x20 /* Disconnect indicator */
2434#define SESSION_REQ_B 0x40 /* Session Request */
2435#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
2436
2437/* Bit masks for USB_INTRUSBE */
2438
2439#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
2440#define RESUME_BE 0x2 /* Resume indicator int enable */
2441#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
2442#define SOF_BE 0x8 /* Start of frame int enable */
2443#define CONN_BE 0x10 /* Connection indicator int enable */
2444#define DISCON_BE 0x20 /* Disconnect indicator int enable */
2445#define SESSION_REQ_BE 0x40 /* Session Request int enable */
2446#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
2447
2448/* Bit masks for USB_FRAME */
2449
2450#define FRAME_NUMBER 0x7ff /* Frame number */
2451
2452/* Bit masks for USB_INDEX */
2453
2454#define SELECTED_ENDPOINT 0xf /* selected endpoint */
2455
2456/* Bit masks for USB_GLOBAL_CTL */
2457
2458#define GLOBAL_ENA 0x1 /* enables USB module */
2459#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
2460#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
2461#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
2462#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
2463#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
2464#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
2465#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
2466#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
2467#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
2468#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
2469#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
2470#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
2471#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
2472#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
2473
2474/* Bit masks for USB_OTG_DEV_CTL */
2475
2476#define SESSION 0x1 /* session indicator */
2477#define HOST_REQ 0x2 /* Host negotiation request */
2478#define HOST_MODE 0x4 /* indicates USBDRC is a host */
2479#define VBUS0 0x8 /* Vbus level indicator[0] */
2480#define VBUS1 0x10 /* Vbus level indicator[1] */
2481#define LSDEV 0x20 /* Low-speed indicator */
2482#define FSDEV 0x40 /* Full or High-speed indicator */
2483#define B_DEVICE 0x80 /* A' or 'B' device indicator */
2484
2485/* Bit masks for USB_OTG_VBUS_IRQ */
2486
2487#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
2488#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
2489#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
2490#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
2491#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
2492#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
2493
2494/* Bit masks for USB_OTG_VBUS_MASK */
2495
2496#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
2497#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
2498#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
2499#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
2500#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
2501#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
2502
2503/* Bit masks for USB_CSR0 */
2504
2505#define RXPKTRDY 0x1 /* data packet receive indicator */
2506#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
2507#define STALL_SENT 0x4 /* STALL handshake sent */
2508#define DATAEND 0x8 /* Data end indicator */
2509#define SETUPEND 0x10 /* Setup end */
2510#define SENDSTALL 0x20 /* Send STALL handshake */
2511#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
2512#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
2513#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
2514#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
2515#define SETUPPKT_H 0x8 /* send Setup token host mode */
2516#define ERROR_H 0x10 /* timeout error indicator host mode */
2517#define REQPKT_H 0x20 /* Request an IN transaction host mode */
2518#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
2519#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
2520
2521/* Bit masks for USB_COUNT0 */
2522
2523#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
2524
2525/* Bit masks for USB_NAKLIMIT0 */
2526
2527#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
2528
2529/* Bit masks for USB_TX_MAX_PACKET */
2530
2531#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
2532
2533/* Bit masks for USB_RX_MAX_PACKET */
2534
2535#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
2536
2537/* Bit masks for USB_TXCSR */
2538
2539#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
2540#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
2541#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
2542#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
2543#define STALL_SEND_T 0x10 /* issue a Stall handshake */
2544#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
2545#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
2546#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
2547#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
2548#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
2549#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
2550#define ISO_T 0x4000 /* enable Isochronous transfers */
2551#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
2552#define ERROR_TH 0x4 /* error condition host mode */
2553#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
2554#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
2555
2556/* Bit masks for USB_TXCOUNT */
2557
2558#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
2559
2560/* Bit masks for USB_RXCSR */
2561
2562#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
2563#define FIFO_FULL_R 0x2 /* FIFO not empty */
2564#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
2565#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
2566#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
2567#define STALL_SEND_R 0x20 /* issue a Stall handshake */
2568#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
2569#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
2570#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
2571#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
2572#define DISNYET_R 0x1000 /* disable Nyet handshakes */
2573#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
2574#define ISO_R 0x4000 /* enable Isochronous transfers */
2575#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
2576#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
2577#define REQPKT_RH 0x20 /* request an IN transaction host mode */
2578#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
2579#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
2580#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
2581#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
2582
2583/* Bit masks for USB_RXCOUNT */
2584
2585#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
2586
2587/* Bit masks for USB_TXTYPE */
2588
2589#define TARGET_EP_NO_T 0xf /* EP number */
2590#define PROTOCOL_T 0xc /* transfer type */
2591
2592/* Bit masks for USB_TXINTERVAL */
2593
2594#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
2595
2596/* Bit masks for USB_RXTYPE */
2597
2598#define TARGET_EP_NO_R 0xf /* EP number */
2599#define PROTOCOL_R 0xc /* transfer type */
2600
2601/* Bit masks for USB_RXINTERVAL */
2602
2603#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
2604
2605/* Bit masks for USB_DMA_INTERRUPT */
2606
2607#define DMA0_INT 0x1 /* DMA0 pending interrupt */
2608#define DMA1_INT 0x2 /* DMA1 pending interrupt */
2609#define DMA2_INT 0x4 /* DMA2 pending interrupt */
2610#define DMA3_INT 0x8 /* DMA3 pending interrupt */
2611#define DMA4_INT 0x10 /* DMA4 pending interrupt */
2612#define DMA5_INT 0x20 /* DMA5 pending interrupt */
2613#define DMA6_INT 0x40 /* DMA6 pending interrupt */
2614#define DMA7_INT 0x80 /* DMA7 pending interrupt */
2615
2616/* Bit masks for USB_DMAxCONTROL */
2617
2618#define DMA_ENA 0x1 /* DMA enable */
2619#define DIRECTION 0x2 /* direction of DMA transfer */
2620#define MODE 0x4 /* DMA Bus error */
2621#define INT_ENA 0x8 /* Interrupt enable */
2622#define EPNUM 0xf0 /* EP number */
2623#define BUSERROR 0x100 /* DMA Bus error */
2624
2625/* Bit masks for USB_DMAxADDRHIGH */
2626
2627#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
2628
2629/* Bit masks for USB_DMAxADDRLOW */
2630
2631#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
2632
2633/* Bit masks for USB_DMAxCOUNTHIGH */
2634
2635#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
2636
2637/* Bit masks for USB_DMAxCOUNTLOW */
2638
2639#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
2640
2641/* Bit masks for HMDMAx_CONTROL */
2642
2643#define HMDMAEN 0x1 /* Handshake MDMA Enable */
2644#define REP 0x2 /* Handshake MDMA Request Polarity */
2645#define UTE 0x8 /* Urgency Threshold Enable */
2646#define OIE 0x10 /* Overflow Interrupt Enable */
2647#define BDIE 0x20 /* Block Done Interrupt Enable */
2648#define MBDI 0x40 /* Mask Block Done Interrupt */
2649#define DRQ 0x300 /* Handshake MDMA Request Type */
2650#define RBC 0x1000 /* Force Reload of BCOUNT */
2651#define PS 0x2000 /* Pin Status */
2652#define OI 0x4000 /* Overflow Interrupt Generated */
2653#define BDI 0x8000 /* Block Done Interrupt Generated */
2654
2655/* ******************************************* */
2656/* MULTI BIT MACRO ENUMERATIONS */
2657/* ******************************************* */
2658
2659/* ************************ */
2660/* MXVR Address Offsets */
2661/* ************************ */
2662
2663/* Control Message Receive Buffer (CMRB) Address Offsets */
2664
2665#define CMRB_STRIDE 0x00000016lu
2666
2667#define CMRB_DST_OFFSET 0x00000000lu
2668#define CMRB_SRC_OFFSET 0x00000002lu
2669#define CMRB_DATA_OFFSET 0x00000005lu
2670
2671/* Control Message Transmit Buffer (CMTB) Address Offsets */
2672
2673#define CMTB_PRIO_OFFSET 0x00000000lu
2674#define CMTB_DST_OFFSET 0x00000002lu
2675#define CMTB_SRC_OFFSET 0x00000004lu
2676#define CMTB_TYPE_OFFSET 0x00000006lu
2677#define CMTB_DATA_OFFSET 0x00000007lu
2678
2679#define CMTB_ANSWER_OFFSET 0x0000000Alu
2680
2681#define CMTB_STAT_N_OFFSET 0x00000018lu
2682#define CMTB_STAT_A_OFFSET 0x00000016lu
2683#define CMTB_STAT_D_OFFSET 0x0000000Elu
2684#define CMTB_STAT_R_OFFSET 0x00000014lu
2685#define CMTB_STAT_W_OFFSET 0x00000014lu
2686#define CMTB_STAT_G_OFFSET 0x00000014lu
2687
2688/* Asynchronous Packet Receive Buffer (APRB) Address Offsets */
2689
2690#define APRB_STRIDE 0x00000400lu
2691
2692#define APRB_DST_OFFSET 0x00000000lu
2693#define APRB_LEN_OFFSET 0x00000002lu
2694#define APRB_SRC_OFFSET 0x00000004lu
2695#define APRB_DATA_OFFSET 0x00000006lu
2696
2697/* Asynchronous Packet Transmit Buffer (APTB) Address Offsets */
2698
2699#define APTB_PRIO_OFFSET 0x00000000lu
2700#define APTB_DST_OFFSET 0x00000002lu
2701#define APTB_LEN_OFFSET 0x00000004lu
2702#define APTB_SRC_OFFSET 0x00000006lu
2703#define APTB_DATA_OFFSET 0x00000008lu
2704
2705/* Remote Read Buffer (RRDB) Address Offsets */
2706
2707#define RRDB_WADDR_OFFSET 0x00000100lu
2708#define RRDB_WLEN_OFFSET 0x00000101lu
2709
2710/* **************** */
2711/* MXVR Macros */
2712/* **************** */
2713
2714/* MXVR_CONFIG Macros */
2715
2716#define SET_MSB(x) ( ( (x) & 0xF ) << 9)
2717
2718/* MXVR_INT_STAT_1 Macros */
2719
2720#define DONEX(x) (0x00000002 << (4 * (x)))
2721#define HDONEX(x) (0x00000001 << (4 * (x)))
2722
2723/* MXVR_INT_EN_1 Macros */
2724
2725#define DONEENX(x) (0x00000002 << (4 * (x)))
2726#define HDONEENX(x) (0x00000001 << (4 * (x)))
2727
2728/* MXVR_CDRPLL_CTL Macros */
2729
2730#define SET_CDRSHPSEL(x) ( ( (x) & 0x3F ) << 16)
2731
2732/* MXVR_FMPLL_CTL Macros */
2733
2734#define SET_CDRCPSEL(x) ( ( (x) & 0xFF ) << 24)
2735#define SET_FMCPSEL(x) ( ( (x) & 0xFF ) << 24)
2736
2737#endif /* _DEF_BF549_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF54x_base.h b/include/asm-blackfin/mach-bf548/defBF54x_base.h
deleted file mode 100644
index e022e896cb18..000000000000
--- a/include/asm-blackfin/mach-bf548/defBF54x_base.h
+++ /dev/null
@@ -1,3956 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/defBF54x_base.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_BF54X_H
32#define _DEF_BF54X_H
33
34
35/* ************************************************************** */
36/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */
37/* ************************************************************** */
38
39/* PLL Registers */
40
41#define PLL_CTL 0xffc00000 /* PLL Control Register */
42#define PLL_DIV 0xffc00004 /* PLL Divisor 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
47/* Debug/MP/Emulation Registers (0xFFC00014 - 0xFFC00014) */
48
49#define CHIPID 0xffc00014
50/* CHIPID Masks */
51#define CHIPID_VERSION 0xF0000000
52#define CHIPID_FAMILY 0x0FFFF000
53#define CHIPID_MANUFACTURE 0x00000FFE
54
55/* System Reset and Interrupt Controller (0xFFC00100 - 0xFFC00104) */
56
57#define SWRST 0xffc00100 /* Software Reset Register */
58#define SYSCR 0xffc00104 /* System Configuration register */
59
60/* SIC Registers */
61
62#define SIC_IMASK0 0xffc0010c /* System Interrupt Mask Register 0 */
63#define SIC_IMASK1 0xffc00110 /* System Interrupt Mask Register 1 */
64#define SIC_IMASK2 0xffc00114 /* System Interrupt Mask Register 2 */
65#define SIC_ISR0 0xffc00118 /* System Interrupt Status Register 0 */
66#define SIC_ISR1 0xffc0011c /* System Interrupt Status Register 1 */
67#define SIC_ISR2 0xffc00120 /* System Interrupt Status Register 2 */
68#define SIC_IWR0 0xffc00124 /* System Interrupt Wakeup Register 0 */
69#define SIC_IWR1 0xffc00128 /* System Interrupt Wakeup Register 1 */
70#define SIC_IWR2 0xffc0012c /* System Interrupt Wakeup Register 2 */
71#define SIC_IAR0 0xffc00130 /* System Interrupt Assignment Register 0 */
72#define SIC_IAR1 0xffc00134 /* System Interrupt Assignment Register 1 */
73#define SIC_IAR2 0xffc00138 /* System Interrupt Assignment Register 2 */
74#define SIC_IAR3 0xffc0013c /* System Interrupt Assignment Register 3 */
75#define SIC_IAR4 0xffc00140 /* System Interrupt Assignment Register 4 */
76#define SIC_IAR5 0xffc00144 /* System Interrupt Assignment Register 5 */
77#define SIC_IAR6 0xffc00148 /* System Interrupt Assignment Register 6 */
78#define SIC_IAR7 0xffc0014c /* System Interrupt Assignment Register 7 */
79#define SIC_IAR8 0xffc00150 /* System Interrupt Assignment Register 8 */
80#define SIC_IAR9 0xffc00154 /* System Interrupt Assignment Register 9 */
81#define SIC_IAR10 0xffc00158 /* System Interrupt Assignment Register 10 */
82#define SIC_IAR11 0xffc0015c /* System Interrupt Assignment Register 11 */
83
84/* Watchdog Timer Registers */
85
86#define WDOG_CTL 0xffc00200 /* Watchdog Control Register */
87#define WDOG_CNT 0xffc00204 /* Watchdog Count Register */
88#define WDOG_STAT 0xffc00208 /* Watchdog Status Register */
89
90/* RTC Registers */
91
92#define RTC_STAT 0xffc00300 /* RTC Status Register */
93#define RTC_ICTL 0xffc00304 /* RTC Interrupt Control Register */
94#define RTC_ISTAT 0xffc00308 /* RTC Interrupt Status Register */
95#define RTC_SWCNT 0xffc0030c /* RTC Stopwatch Count Register */
96#define RTC_ALARM 0xffc00310 /* RTC Alarm Register */
97#define RTC_PREN 0xffc00314 /* RTC Prescaler Enable Register */
98
99/* UART0 Registers */
100
101#define UART0_DLL 0xffc00400 /* Divisor Latch Low Byte */
102#define UART0_DLH 0xffc00404 /* Divisor Latch High Byte */
103#define UART0_GCTL 0xffc00408 /* Global Control Register */
104#define UART0_LCR 0xffc0040c /* Line Control Register */
105#define UART0_MCR 0xffc00410 /* Modem Control Register */
106#define UART0_LSR 0xffc00414 /* Line Status Register */
107#define UART0_MSR 0xffc00418 /* Modem Status Register */
108#define UART0_SCR 0xffc0041c /* Scratch Register */
109#define UART0_IER_SET 0xffc00420 /* Interrupt Enable Register Set */
110#define UART0_IER_CLEAR 0xffc00424 /* Interrupt Enable Register Clear */
111#define UART0_THR 0xffc00428 /* Transmit Hold Register */
112#define UART0_RBR 0xffc0042c /* Receive Buffer Register */
113
114/* SPI0 Registers */
115
116#define SPI0_REGBASE 0xffc00500
117#define SPI0_CTL 0xffc00500 /* SPI0 Control Register */
118#define SPI0_FLG 0xffc00504 /* SPI0 Flag Register */
119#define SPI0_STAT 0xffc00508 /* SPI0 Status Register */
120#define SPI0_TDBR 0xffc0050c /* SPI0 Transmit Data Buffer Register */
121#define SPI0_RDBR 0xffc00510 /* SPI0 Receive Data Buffer Register */
122#define SPI0_BAUD 0xffc00514 /* SPI0 Baud Rate Register */
123#define SPI0_SHADOW 0xffc00518 /* SPI0 Receive Data Buffer Shadow Register */
124
125/* Timer Group of 3 registers are not defined in the shared file because they are not available on the ADSP-BF542 processor */
126
127/* Two Wire Interface Registers (TWI0) */
128
129#define TWI0_REGBASE 0xffc00700
130#define TWI0_CLKDIV 0xffc00700 /* Clock Divider Register */
131#define TWI0_CONTROL 0xffc00704 /* TWI Control Register */
132#define TWI0_SLAVE_CTRL 0xffc00708 /* TWI Slave Mode Control Register */
133#define TWI0_SLAVE_STAT 0xffc0070c /* TWI Slave Mode Status Register */
134#define TWI0_SLAVE_ADDR 0xffc00710 /* TWI Slave Mode Address Register */
135#define TWI0_MASTER_CTRL 0xffc00714 /* TWI Master Mode Control Register */
136#define TWI0_MASTER_STAT 0xffc00718 /* TWI Master Mode Status Register */
137#define TWI0_MASTER_ADDR 0xffc0071c /* TWI Master Mode Address Register */
138#define TWI0_INT_STAT 0xffc00720 /* TWI Interrupt Status Register */
139#define TWI0_INT_MASK 0xffc00724 /* TWI Interrupt Mask Register */
140#define TWI0_FIFO_CTRL 0xffc00728 /* TWI FIFO Control Register */
141#define TWI0_FIFO_STAT 0xffc0072c /* TWI FIFO Status Register */
142#define TWI0_XMT_DATA8 0xffc00780 /* TWI FIFO Transmit Data Single Byte Register */
143#define TWI0_XMT_DATA16 0xffc00784 /* TWI FIFO Transmit Data Double Byte Register */
144#define TWI0_RCV_DATA8 0xffc00788 /* TWI FIFO Receive Data Single Byte Register */
145#define TWI0_RCV_DATA16 0xffc0078c /* TWI FIFO Receive Data Double Byte Register */
146
147/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 processors */
148
149/* SPORT1 Registers */
150
151#define SPORT1_TCR1 0xffc00900 /* SPORT1 Transmit Configuration 1 Register */
152#define SPORT1_TCR2 0xffc00904 /* SPORT1 Transmit Configuration 2 Register */
153#define SPORT1_TCLKDIV 0xffc00908 /* SPORT1 Transmit Serial Clock Divider Register */
154#define SPORT1_TFSDIV 0xffc0090c /* SPORT1 Transmit Frame Sync Divider Register */
155#define SPORT1_TX 0xffc00910 /* SPORT1 Transmit Data Register */
156#define SPORT1_RX 0xffc00918 /* SPORT1 Receive Data Register */
157#define SPORT1_RCR1 0xffc00920 /* SPORT1 Receive Configuration 1 Register */
158#define SPORT1_RCR2 0xffc00924 /* SPORT1 Receive Configuration 2 Register */
159#define SPORT1_RCLKDIV 0xffc00928 /* SPORT1 Receive Serial Clock Divider Register */
160#define SPORT1_RFSDIV 0xffc0092c /* SPORT1 Receive Frame Sync Divider Register */
161#define SPORT1_STAT 0xffc00930 /* SPORT1 Status Register */
162#define SPORT1_CHNL 0xffc00934 /* SPORT1 Current Channel Register */
163#define SPORT1_MCMC1 0xffc00938 /* SPORT1 Multi channel Configuration Register 1 */
164#define SPORT1_MCMC2 0xffc0093c /* SPORT1 Multi channel Configuration Register 2 */
165#define SPORT1_MTCS0 0xffc00940 /* SPORT1 Multi channel Transmit Select Register 0 */
166#define SPORT1_MTCS1 0xffc00944 /* SPORT1 Multi channel Transmit Select Register 1 */
167#define SPORT1_MTCS2 0xffc00948 /* SPORT1 Multi channel Transmit Select Register 2 */
168#define SPORT1_MTCS3 0xffc0094c /* SPORT1 Multi channel Transmit Select Register 3 */
169#define SPORT1_MRCS0 0xffc00950 /* SPORT1 Multi channel Receive Select Register 0 */
170#define SPORT1_MRCS1 0xffc00954 /* SPORT1 Multi channel Receive Select Register 1 */
171#define SPORT1_MRCS2 0xffc00958 /* SPORT1 Multi channel Receive Select Register 2 */
172#define SPORT1_MRCS3 0xffc0095c /* SPORT1 Multi channel Receive Select Register 3 */
173
174/* Asynchronous Memory Control Registers */
175
176#define EBIU_AMGCTL 0xffc00a00 /* Asynchronous Memory Global Control Register */
177#define EBIU_AMBCTL0 0xffc00a04 /* Asynchronous Memory Bank Control Register */
178#define EBIU_AMBCTL1 0xffc00a08 /* Asynchronous Memory Bank Control Register */
179#define EBIU_MBSCTL 0xffc00a0c /* Asynchronous Memory Bank Select Control Register */
180#define EBIU_ARBSTAT 0xffc00a10 /* Asynchronous Memory Arbiter Status Register */
181#define EBIU_MODE 0xffc00a14 /* Asynchronous Mode Control Register */
182#define EBIU_FCTL 0xffc00a18 /* Asynchronous Memory Flash Control Register */
183
184/* DDR Memory Control Registers */
185
186#define EBIU_DDRCTL0 0xffc00a20 /* DDR Memory Control 0 Register */
187#define EBIU_DDRCTL1 0xffc00a24 /* DDR Memory Control 1 Register */
188#define EBIU_DDRCTL2 0xffc00a28 /* DDR Memory Control 2 Register */
189#define EBIU_DDRCTL3 0xffc00a2c /* DDR Memory Control 3 Register */
190#define EBIU_DDRQUE 0xffc00a30 /* DDR Queue Configuration Register */
191#define EBIU_ERRADD 0xffc00a34 /* DDR Error Address Register */
192#define EBIU_ERRMST 0xffc00a38 /* DDR Error Master Register */
193#define EBIU_RSTCTL 0xffc00a3c /* DDR Reset Control Register */
194
195/* DDR BankRead and Write Count Registers */
196
197#define EBIU_DDRBRC0 0xffc00a60 /* DDR Bank0 Read Count Register */
198#define EBIU_DDRBRC1 0xffc00a64 /* DDR Bank1 Read Count Register */
199#define EBIU_DDRBRC2 0xffc00a68 /* DDR Bank2 Read Count Register */
200#define EBIU_DDRBRC3 0xffc00a6c /* DDR Bank3 Read Count Register */
201#define EBIU_DDRBRC4 0xffc00a70 /* DDR Bank4 Read Count Register */
202#define EBIU_DDRBRC5 0xffc00a74 /* DDR Bank5 Read Count Register */
203#define EBIU_DDRBRC6 0xffc00a78 /* DDR Bank6 Read Count Register */
204#define EBIU_DDRBRC7 0xffc00a7c /* DDR Bank7 Read Count Register */
205#define EBIU_DDRBWC0 0xffc00a80 /* DDR Bank0 Write Count Register */
206#define EBIU_DDRBWC1 0xffc00a84 /* DDR Bank1 Write Count Register */
207#define EBIU_DDRBWC2 0xffc00a88 /* DDR Bank2 Write Count Register */
208#define EBIU_DDRBWC3 0xffc00a8c /* DDR Bank3 Write Count Register */
209#define EBIU_DDRBWC4 0xffc00a90 /* DDR Bank4 Write Count Register */
210#define EBIU_DDRBWC5 0xffc00a94 /* DDR Bank5 Write Count Register */
211#define EBIU_DDRBWC6 0xffc00a98 /* DDR Bank6 Write Count Register */
212#define EBIU_DDRBWC7 0xffc00a9c /* DDR Bank7 Write Count Register */
213#define EBIU_DDRACCT 0xffc00aa0 /* DDR Activation Count Register */
214#define EBIU_DDRTACT 0xffc00aa8 /* DDR Turn Around Count Register */
215#define EBIU_DDRARCT 0xffc00aac /* DDR Auto-refresh Count Register */
216#define EBIU_DDRGC0 0xffc00ab0 /* DDR Grant Count 0 Register */
217#define EBIU_DDRGC1 0xffc00ab4 /* DDR Grant Count 1 Register */
218#define EBIU_DDRGC2 0xffc00ab8 /* DDR Grant Count 2 Register */
219#define EBIU_DDRGC3 0xffc00abc /* DDR Grant Count 3 Register */
220#define EBIU_DDRMCEN 0xffc00ac0 /* DDR Metrics Counter Enable Register */
221#define EBIU_DDRMCCL 0xffc00ac4 /* DDR Metrics Counter Clear Register */
222
223/* DMAC0 Registers */
224
225#define DMAC0_TCPER 0xffc00b0c /* DMA Controller 0 Traffic Control Periods Register */
226#define DMAC0_TCCNT 0xffc00b10 /* DMA Controller 0 Current Counts Register */
227
228/* DMA Channel 0 Registers */
229
230#define DMA0_NEXT_DESC_PTR 0xffc00c00 /* DMA Channel 0 Next Descriptor Pointer Register */
231#define DMA0_START_ADDR 0xffc00c04 /* DMA Channel 0 Start Address Register */
232#define DMA0_CONFIG 0xffc00c08 /* DMA Channel 0 Configuration Register */
233#define DMA0_X_COUNT 0xffc00c10 /* DMA Channel 0 X Count Register */
234#define DMA0_X_MODIFY 0xffc00c14 /* DMA Channel 0 X Modify Register */
235#define DMA0_Y_COUNT 0xffc00c18 /* DMA Channel 0 Y Count Register */
236#define DMA0_Y_MODIFY 0xffc00c1c /* DMA Channel 0 Y Modify Register */
237#define DMA0_CURR_DESC_PTR 0xffc00c20 /* DMA Channel 0 Current Descriptor Pointer Register */
238#define DMA0_CURR_ADDR 0xffc00c24 /* DMA Channel 0 Current Address Register */
239#define DMA0_IRQ_STATUS 0xffc00c28 /* DMA Channel 0 Interrupt/Status Register */
240#define DMA0_PERIPHERAL_MAP 0xffc00c2c /* DMA Channel 0 Peripheral Map Register */
241#define DMA0_CURR_X_COUNT 0xffc00c30 /* DMA Channel 0 Current X Count Register */
242#define DMA0_CURR_Y_COUNT 0xffc00c38 /* DMA Channel 0 Current Y Count Register */
243
244/* DMA Channel 1 Registers */
245
246#define DMA1_NEXT_DESC_PTR 0xffc00c40 /* DMA Channel 1 Next Descriptor Pointer Register */
247#define DMA1_START_ADDR 0xffc00c44 /* DMA Channel 1 Start Address Register */
248#define DMA1_CONFIG 0xffc00c48 /* DMA Channel 1 Configuration Register */
249#define DMA1_X_COUNT 0xffc00c50 /* DMA Channel 1 X Count Register */
250#define DMA1_X_MODIFY 0xffc00c54 /* DMA Channel 1 X Modify Register */
251#define DMA1_Y_COUNT 0xffc00c58 /* DMA Channel 1 Y Count Register */
252#define DMA1_Y_MODIFY 0xffc00c5c /* DMA Channel 1 Y Modify Register */
253#define DMA1_CURR_DESC_PTR 0xffc00c60 /* DMA Channel 1 Current Descriptor Pointer Register */
254#define DMA1_CURR_ADDR 0xffc00c64 /* DMA Channel 1 Current Address Register */
255#define DMA1_IRQ_STATUS 0xffc00c68 /* DMA Channel 1 Interrupt/Status Register */
256#define DMA1_PERIPHERAL_MAP 0xffc00c6c /* DMA Channel 1 Peripheral Map Register */
257#define DMA1_CURR_X_COUNT 0xffc00c70 /* DMA Channel 1 Current X Count Register */
258#define DMA1_CURR_Y_COUNT 0xffc00c78 /* DMA Channel 1 Current Y Count Register */
259
260/* DMA Channel 2 Registers */
261
262#define DMA2_NEXT_DESC_PTR 0xffc00c80 /* DMA Channel 2 Next Descriptor Pointer Register */
263#define DMA2_START_ADDR 0xffc00c84 /* DMA Channel 2 Start Address Register */
264#define DMA2_CONFIG 0xffc00c88 /* DMA Channel 2 Configuration Register */
265#define DMA2_X_COUNT 0xffc00c90 /* DMA Channel 2 X Count Register */
266#define DMA2_X_MODIFY 0xffc00c94 /* DMA Channel 2 X Modify Register */
267#define DMA2_Y_COUNT 0xffc00c98 /* DMA Channel 2 Y Count Register */
268#define DMA2_Y_MODIFY 0xffc00c9c /* DMA Channel 2 Y Modify Register */
269#define DMA2_CURR_DESC_PTR 0xffc00ca0 /* DMA Channel 2 Current Descriptor Pointer Register */
270#define DMA2_CURR_ADDR 0xffc00ca4 /* DMA Channel 2 Current Address Register */
271#define DMA2_IRQ_STATUS 0xffc00ca8 /* DMA Channel 2 Interrupt/Status Register */
272#define DMA2_PERIPHERAL_MAP 0xffc00cac /* DMA Channel 2 Peripheral Map Register */
273#define DMA2_CURR_X_COUNT 0xffc00cb0 /* DMA Channel 2 Current X Count Register */
274#define DMA2_CURR_Y_COUNT 0xffc00cb8 /* DMA Channel 2 Current Y Count Register */
275
276/* DMA Channel 3 Registers */
277
278#define DMA3_NEXT_DESC_PTR 0xffc00cc0 /* DMA Channel 3 Next Descriptor Pointer Register */
279#define DMA3_START_ADDR 0xffc00cc4 /* DMA Channel 3 Start Address Register */
280#define DMA3_CONFIG 0xffc00cc8 /* DMA Channel 3 Configuration Register */
281#define DMA3_X_COUNT 0xffc00cd0 /* DMA Channel 3 X Count Register */
282#define DMA3_X_MODIFY 0xffc00cd4 /* DMA Channel 3 X Modify Register */
283#define DMA3_Y_COUNT 0xffc00cd8 /* DMA Channel 3 Y Count Register */
284#define DMA3_Y_MODIFY 0xffc00cdc /* DMA Channel 3 Y Modify Register */
285#define DMA3_CURR_DESC_PTR 0xffc00ce0 /* DMA Channel 3 Current Descriptor Pointer Register */
286#define DMA3_CURR_ADDR 0xffc00ce4 /* DMA Channel 3 Current Address Register */
287#define DMA3_IRQ_STATUS 0xffc00ce8 /* DMA Channel 3 Interrupt/Status Register */
288#define DMA3_PERIPHERAL_MAP 0xffc00cec /* DMA Channel 3 Peripheral Map Register */
289#define DMA3_CURR_X_COUNT 0xffc00cf0 /* DMA Channel 3 Current X Count Register */
290#define DMA3_CURR_Y_COUNT 0xffc00cf8 /* DMA Channel 3 Current Y Count Register */
291
292/* DMA Channel 4 Registers */
293
294#define DMA4_NEXT_DESC_PTR 0xffc00d00 /* DMA Channel 4 Next Descriptor Pointer Register */
295#define DMA4_START_ADDR 0xffc00d04 /* DMA Channel 4 Start Address Register */
296#define DMA4_CONFIG 0xffc00d08 /* DMA Channel 4 Configuration Register */
297#define DMA4_X_COUNT 0xffc00d10 /* DMA Channel 4 X Count Register */
298#define DMA4_X_MODIFY 0xffc00d14 /* DMA Channel 4 X Modify Register */
299#define DMA4_Y_COUNT 0xffc00d18 /* DMA Channel 4 Y Count Register */
300#define DMA4_Y_MODIFY 0xffc00d1c /* DMA Channel 4 Y Modify Register */
301#define DMA4_CURR_DESC_PTR 0xffc00d20 /* DMA Channel 4 Current Descriptor Pointer Register */
302#define DMA4_CURR_ADDR 0xffc00d24 /* DMA Channel 4 Current Address Register */
303#define DMA4_IRQ_STATUS 0xffc00d28 /* DMA Channel 4 Interrupt/Status Register */
304#define DMA4_PERIPHERAL_MAP 0xffc00d2c /* DMA Channel 4 Peripheral Map Register */
305#define DMA4_CURR_X_COUNT 0xffc00d30 /* DMA Channel 4 Current X Count Register */
306#define DMA4_CURR_Y_COUNT 0xffc00d38 /* DMA Channel 4 Current Y Count Register */
307
308/* DMA Channel 5 Registers */
309
310#define DMA5_NEXT_DESC_PTR 0xffc00d40 /* DMA Channel 5 Next Descriptor Pointer Register */
311#define DMA5_START_ADDR 0xffc00d44 /* DMA Channel 5 Start Address Register */
312#define DMA5_CONFIG 0xffc00d48 /* DMA Channel 5 Configuration Register */
313#define DMA5_X_COUNT 0xffc00d50 /* DMA Channel 5 X Count Register */
314#define DMA5_X_MODIFY 0xffc00d54 /* DMA Channel 5 X Modify Register */
315#define DMA5_Y_COUNT 0xffc00d58 /* DMA Channel 5 Y Count Register */
316#define DMA5_Y_MODIFY 0xffc00d5c /* DMA Channel 5 Y Modify Register */
317#define DMA5_CURR_DESC_PTR 0xffc00d60 /* DMA Channel 5 Current Descriptor Pointer Register */
318#define DMA5_CURR_ADDR 0xffc00d64 /* DMA Channel 5 Current Address Register */
319#define DMA5_IRQ_STATUS 0xffc00d68 /* DMA Channel 5 Interrupt/Status Register */
320#define DMA5_PERIPHERAL_MAP 0xffc00d6c /* DMA Channel 5 Peripheral Map Register */
321#define DMA5_CURR_X_COUNT 0xffc00d70 /* DMA Channel 5 Current X Count Register */
322#define DMA5_CURR_Y_COUNT 0xffc00d78 /* DMA Channel 5 Current Y Count Register */
323
324/* DMA Channel 6 Registers */
325
326#define DMA6_NEXT_DESC_PTR 0xffc00d80 /* DMA Channel 6 Next Descriptor Pointer Register */
327#define DMA6_START_ADDR 0xffc00d84 /* DMA Channel 6 Start Address Register */
328#define DMA6_CONFIG 0xffc00d88 /* DMA Channel 6 Configuration Register */
329#define DMA6_X_COUNT 0xffc00d90 /* DMA Channel 6 X Count Register */
330#define DMA6_X_MODIFY 0xffc00d94 /* DMA Channel 6 X Modify Register */
331#define DMA6_Y_COUNT 0xffc00d98 /* DMA Channel 6 Y Count Register */
332#define DMA6_Y_MODIFY 0xffc00d9c /* DMA Channel 6 Y Modify Register */
333#define DMA6_CURR_DESC_PTR 0xffc00da0 /* DMA Channel 6 Current Descriptor Pointer Register */
334#define DMA6_CURR_ADDR 0xffc00da4 /* DMA Channel 6 Current Address Register */
335#define DMA6_IRQ_STATUS 0xffc00da8 /* DMA Channel 6 Interrupt/Status Register */
336#define DMA6_PERIPHERAL_MAP 0xffc00dac /* DMA Channel 6 Peripheral Map Register */
337#define DMA6_CURR_X_COUNT 0xffc00db0 /* DMA Channel 6 Current X Count Register */
338#define DMA6_CURR_Y_COUNT 0xffc00db8 /* DMA Channel 6 Current Y Count Register */
339
340/* DMA Channel 7 Registers */
341
342#define DMA7_NEXT_DESC_PTR 0xffc00dc0 /* DMA Channel 7 Next Descriptor Pointer Register */
343#define DMA7_START_ADDR 0xffc00dc4 /* DMA Channel 7 Start Address Register */
344#define DMA7_CONFIG 0xffc00dc8 /* DMA Channel 7 Configuration Register */
345#define DMA7_X_COUNT 0xffc00dd0 /* DMA Channel 7 X Count Register */
346#define DMA7_X_MODIFY 0xffc00dd4 /* DMA Channel 7 X Modify Register */
347#define DMA7_Y_COUNT 0xffc00dd8 /* DMA Channel 7 Y Count Register */
348#define DMA7_Y_MODIFY 0xffc00ddc /* DMA Channel 7 Y Modify Register */
349#define DMA7_CURR_DESC_PTR 0xffc00de0 /* DMA Channel 7 Current Descriptor Pointer Register */
350#define DMA7_CURR_ADDR 0xffc00de4 /* DMA Channel 7 Current Address Register */
351#define DMA7_IRQ_STATUS 0xffc00de8 /* DMA Channel 7 Interrupt/Status Register */
352#define DMA7_PERIPHERAL_MAP 0xffc00dec /* DMA Channel 7 Peripheral Map Register */
353#define DMA7_CURR_X_COUNT 0xffc00df0 /* DMA Channel 7 Current X Count Register */
354#define DMA7_CURR_Y_COUNT 0xffc00df8 /* DMA Channel 7 Current Y Count Register */
355
356/* DMA Channel 8 Registers */
357
358#define DMA8_NEXT_DESC_PTR 0xffc00e00 /* DMA Channel 8 Next Descriptor Pointer Register */
359#define DMA8_START_ADDR 0xffc00e04 /* DMA Channel 8 Start Address Register */
360#define DMA8_CONFIG 0xffc00e08 /* DMA Channel 8 Configuration Register */
361#define DMA8_X_COUNT 0xffc00e10 /* DMA Channel 8 X Count Register */
362#define DMA8_X_MODIFY 0xffc00e14 /* DMA Channel 8 X Modify Register */
363#define DMA8_Y_COUNT 0xffc00e18 /* DMA Channel 8 Y Count Register */
364#define DMA8_Y_MODIFY 0xffc00e1c /* DMA Channel 8 Y Modify Register */
365#define DMA8_CURR_DESC_PTR 0xffc00e20 /* DMA Channel 8 Current Descriptor Pointer Register */
366#define DMA8_CURR_ADDR 0xffc00e24 /* DMA Channel 8 Current Address Register */
367#define DMA8_IRQ_STATUS 0xffc00e28 /* DMA Channel 8 Interrupt/Status Register */
368#define DMA8_PERIPHERAL_MAP 0xffc00e2c /* DMA Channel 8 Peripheral Map Register */
369#define DMA8_CURR_X_COUNT 0xffc00e30 /* DMA Channel 8 Current X Count Register */
370#define DMA8_CURR_Y_COUNT 0xffc00e38 /* DMA Channel 8 Current Y Count Register */
371
372/* DMA Channel 9 Registers */
373
374#define DMA9_NEXT_DESC_PTR 0xffc00e40 /* DMA Channel 9 Next Descriptor Pointer Register */
375#define DMA9_START_ADDR 0xffc00e44 /* DMA Channel 9 Start Address Register */
376#define DMA9_CONFIG 0xffc00e48 /* DMA Channel 9 Configuration Register */
377#define DMA9_X_COUNT 0xffc00e50 /* DMA Channel 9 X Count Register */
378#define DMA9_X_MODIFY 0xffc00e54 /* DMA Channel 9 X Modify Register */
379#define DMA9_Y_COUNT 0xffc00e58 /* DMA Channel 9 Y Count Register */
380#define DMA9_Y_MODIFY 0xffc00e5c /* DMA Channel 9 Y Modify Register */
381#define DMA9_CURR_DESC_PTR 0xffc00e60 /* DMA Channel 9 Current Descriptor Pointer Register */
382#define DMA9_CURR_ADDR 0xffc00e64 /* DMA Channel 9 Current Address Register */
383#define DMA9_IRQ_STATUS 0xffc00e68 /* DMA Channel 9 Interrupt/Status Register */
384#define DMA9_PERIPHERAL_MAP 0xffc00e6c /* DMA Channel 9 Peripheral Map Register */
385#define DMA9_CURR_X_COUNT 0xffc00e70 /* DMA Channel 9 Current X Count Register */
386#define DMA9_CURR_Y_COUNT 0xffc00e78 /* DMA Channel 9 Current Y Count Register */
387
388/* DMA Channel 10 Registers */
389
390#define DMA10_NEXT_DESC_PTR 0xffc00e80 /* DMA Channel 10 Next Descriptor Pointer Register */
391#define DMA10_START_ADDR 0xffc00e84 /* DMA Channel 10 Start Address Register */
392#define DMA10_CONFIG 0xffc00e88 /* DMA Channel 10 Configuration Register */
393#define DMA10_X_COUNT 0xffc00e90 /* DMA Channel 10 X Count Register */
394#define DMA10_X_MODIFY 0xffc00e94 /* DMA Channel 10 X Modify Register */
395#define DMA10_Y_COUNT 0xffc00e98 /* DMA Channel 10 Y Count Register */
396#define DMA10_Y_MODIFY 0xffc00e9c /* DMA Channel 10 Y Modify Register */
397#define DMA10_CURR_DESC_PTR 0xffc00ea0 /* DMA Channel 10 Current Descriptor Pointer Register */
398#define DMA10_CURR_ADDR 0xffc00ea4 /* DMA Channel 10 Current Address Register */
399#define DMA10_IRQ_STATUS 0xffc00ea8 /* DMA Channel 10 Interrupt/Status Register */
400#define DMA10_PERIPHERAL_MAP 0xffc00eac /* DMA Channel 10 Peripheral Map Register */
401#define DMA10_CURR_X_COUNT 0xffc00eb0 /* DMA Channel 10 Current X Count Register */
402#define DMA10_CURR_Y_COUNT 0xffc00eb8 /* DMA Channel 10 Current Y Count Register */
403
404/* DMA Channel 11 Registers */
405
406#define DMA11_NEXT_DESC_PTR 0xffc00ec0 /* DMA Channel 11 Next Descriptor Pointer Register */
407#define DMA11_START_ADDR 0xffc00ec4 /* DMA Channel 11 Start Address Register */
408#define DMA11_CONFIG 0xffc00ec8 /* DMA Channel 11 Configuration Register */
409#define DMA11_X_COUNT 0xffc00ed0 /* DMA Channel 11 X Count Register */
410#define DMA11_X_MODIFY 0xffc00ed4 /* DMA Channel 11 X Modify Register */
411#define DMA11_Y_COUNT 0xffc00ed8 /* DMA Channel 11 Y Count Register */
412#define DMA11_Y_MODIFY 0xffc00edc /* DMA Channel 11 Y Modify Register */
413#define DMA11_CURR_DESC_PTR 0xffc00ee0 /* DMA Channel 11 Current Descriptor Pointer Register */
414#define DMA11_CURR_ADDR 0xffc00ee4 /* DMA Channel 11 Current Address Register */
415#define DMA11_IRQ_STATUS 0xffc00ee8 /* DMA Channel 11 Interrupt/Status Register */
416#define DMA11_PERIPHERAL_MAP 0xffc00eec /* DMA Channel 11 Peripheral Map Register */
417#define DMA11_CURR_X_COUNT 0xffc00ef0 /* DMA Channel 11 Current X Count Register */
418#define DMA11_CURR_Y_COUNT 0xffc00ef8 /* DMA Channel 11 Current Y Count Register */
419
420/* MDMA Stream 0 Registers */
421
422#define MDMA_D0_NEXT_DESC_PTR 0xffc00f00 /* Memory DMA Stream 0 Destination Next Descriptor Pointer Register */
423#define MDMA_D0_START_ADDR 0xffc00f04 /* Memory DMA Stream 0 Destination Start Address Register */
424#define MDMA_D0_CONFIG 0xffc00f08 /* Memory DMA Stream 0 Destination Configuration Register */
425#define MDMA_D0_X_COUNT 0xffc00f10 /* Memory DMA Stream 0 Destination X Count Register */
426#define MDMA_D0_X_MODIFY 0xffc00f14 /* Memory DMA Stream 0 Destination X Modify Register */
427#define MDMA_D0_Y_COUNT 0xffc00f18 /* Memory DMA Stream 0 Destination Y Count Register */
428#define MDMA_D0_Y_MODIFY 0xffc00f1c /* Memory DMA Stream 0 Destination Y Modify Register */
429#define MDMA_D0_CURR_DESC_PTR 0xffc00f20 /* Memory DMA Stream 0 Destination Current Descriptor Pointer Register */
430#define MDMA_D0_CURR_ADDR 0xffc00f24 /* Memory DMA Stream 0 Destination Current Address Register */
431#define MDMA_D0_IRQ_STATUS 0xffc00f28 /* Memory DMA Stream 0 Destination Interrupt/Status Register */
432#define MDMA_D0_PERIPHERAL_MAP 0xffc00f2c /* Memory DMA Stream 0 Destination Peripheral Map Register */
433#define MDMA_D0_CURR_X_COUNT 0xffc00f30 /* Memory DMA Stream 0 Destination Current X Count Register */
434#define MDMA_D0_CURR_Y_COUNT 0xffc00f38 /* Memory DMA Stream 0 Destination Current Y Count Register */
435#define MDMA_S0_NEXT_DESC_PTR 0xffc00f40 /* Memory DMA Stream 0 Source Next Descriptor Pointer Register */
436#define MDMA_S0_START_ADDR 0xffc00f44 /* Memory DMA Stream 0 Source Start Address Register */
437#define MDMA_S0_CONFIG 0xffc00f48 /* Memory DMA Stream 0 Source Configuration Register */
438#define MDMA_S0_X_COUNT 0xffc00f50 /* Memory DMA Stream 0 Source X Count Register */
439#define MDMA_S0_X_MODIFY 0xffc00f54 /* Memory DMA Stream 0 Source X Modify Register */
440#define MDMA_S0_Y_COUNT 0xffc00f58 /* Memory DMA Stream 0 Source Y Count Register */
441#define MDMA_S0_Y_MODIFY 0xffc00f5c /* Memory DMA Stream 0 Source Y Modify Register */
442#define MDMA_S0_CURR_DESC_PTR 0xffc00f60 /* Memory DMA Stream 0 Source Current Descriptor Pointer Register */
443#define MDMA_S0_CURR_ADDR 0xffc00f64 /* Memory DMA Stream 0 Source Current Address Register */
444#define MDMA_S0_IRQ_STATUS 0xffc00f68 /* Memory DMA Stream 0 Source Interrupt/Status Register */
445#define MDMA_S0_PERIPHERAL_MAP 0xffc00f6c /* Memory DMA Stream 0 Source Peripheral Map Register */
446#define MDMA_S0_CURR_X_COUNT 0xffc00f70 /* Memory DMA Stream 0 Source Current X Count Register */
447#define MDMA_S0_CURR_Y_COUNT 0xffc00f78 /* Memory DMA Stream 0 Source Current Y Count Register */
448
449/* MDMA Stream 1 Registers */
450
451#define MDMA_D1_NEXT_DESC_PTR 0xffc00f80 /* Memory DMA Stream 1 Destination Next Descriptor Pointer Register */
452#define MDMA_D1_START_ADDR 0xffc00f84 /* Memory DMA Stream 1 Destination Start Address Register */
453#define MDMA_D1_CONFIG 0xffc00f88 /* Memory DMA Stream 1 Destination Configuration Register */
454#define MDMA_D1_X_COUNT 0xffc00f90 /* Memory DMA Stream 1 Destination X Count Register */
455#define MDMA_D1_X_MODIFY 0xffc00f94 /* Memory DMA Stream 1 Destination X Modify Register */
456#define MDMA_D1_Y_COUNT 0xffc00f98 /* Memory DMA Stream 1 Destination Y Count Register */
457#define MDMA_D1_Y_MODIFY 0xffc00f9c /* Memory DMA Stream 1 Destination Y Modify Register */
458#define MDMA_D1_CURR_DESC_PTR 0xffc00fa0 /* Memory DMA Stream 1 Destination Current Descriptor Pointer Register */
459#define MDMA_D1_CURR_ADDR 0xffc00fa4 /* Memory DMA Stream 1 Destination Current Address Register */
460#define MDMA_D1_IRQ_STATUS 0xffc00fa8 /* Memory DMA Stream 1 Destination Interrupt/Status Register */
461#define MDMA_D1_PERIPHERAL_MAP 0xffc00fac /* Memory DMA Stream 1 Destination Peripheral Map Register */
462#define MDMA_D1_CURR_X_COUNT 0xffc00fb0 /* Memory DMA Stream 1 Destination Current X Count Register */
463#define MDMA_D1_CURR_Y_COUNT 0xffc00fb8 /* Memory DMA Stream 1 Destination Current Y Count Register */
464#define MDMA_S1_NEXT_DESC_PTR 0xffc00fc0 /* Memory DMA Stream 1 Source Next Descriptor Pointer Register */
465#define MDMA_S1_START_ADDR 0xffc00fc4 /* Memory DMA Stream 1 Source Start Address Register */
466#define MDMA_S1_CONFIG 0xffc00fc8 /* Memory DMA Stream 1 Source Configuration Register */
467#define MDMA_S1_X_COUNT 0xffc00fd0 /* Memory DMA Stream 1 Source X Count Register */
468#define MDMA_S1_X_MODIFY 0xffc00fd4 /* Memory DMA Stream 1 Source X Modify Register */
469#define MDMA_S1_Y_COUNT 0xffc00fd8 /* Memory DMA Stream 1 Source Y Count Register */
470#define MDMA_S1_Y_MODIFY 0xffc00fdc /* Memory DMA Stream 1 Source Y Modify Register */
471#define MDMA_S1_CURR_DESC_PTR 0xffc00fe0 /* Memory DMA Stream 1 Source Current Descriptor Pointer Register */
472#define MDMA_S1_CURR_ADDR 0xffc00fe4 /* Memory DMA Stream 1 Source Current Address Register */
473#define MDMA_S1_IRQ_STATUS 0xffc00fe8 /* Memory DMA Stream 1 Source Interrupt/Status Register */
474#define MDMA_S1_PERIPHERAL_MAP 0xffc00fec /* Memory DMA Stream 1 Source Peripheral Map Register */
475#define MDMA_S1_CURR_X_COUNT 0xffc00ff0 /* Memory DMA Stream 1 Source Current X Count Register */
476#define MDMA_S1_CURR_Y_COUNT 0xffc00ff8 /* Memory DMA Stream 1 Source Current Y Count Register */
477
478/* UART3 Registers */
479
480#define UART3_DLL 0xffc03100 /* Divisor Latch Low Byte */
481#define UART3_DLH 0xffc03104 /* Divisor Latch High Byte */
482#define UART3_GCTL 0xffc03108 /* Global Control Register */
483#define UART3_LCR 0xffc0310c /* Line Control Register */
484#define UART3_MCR 0xffc03110 /* Modem Control Register */
485#define UART3_LSR 0xffc03114 /* Line Status Register */
486#define UART3_MSR 0xffc03118 /* Modem Status Register */
487#define UART3_SCR 0xffc0311c /* Scratch Register */
488#define UART3_IER_SET 0xffc03120 /* Interrupt Enable Register Set */
489#define UART3_IER_CLEAR 0xffc03124 /* Interrupt Enable Register Clear */
490#define UART3_THR 0xffc03128 /* Transmit Hold Register */
491#define UART3_RBR 0xffc0312c /* Receive Buffer Register */
492
493/* EPPI1 Registers */
494
495#define EPPI1_STATUS 0xffc01300 /* EPPI1 Status Register */
496#define EPPI1_HCOUNT 0xffc01304 /* EPPI1 Horizontal Transfer Count Register */
497#define EPPI1_HDELAY 0xffc01308 /* EPPI1 Horizontal Delay Count Register */
498#define EPPI1_VCOUNT 0xffc0130c /* EPPI1 Vertical Transfer Count Register */
499#define EPPI1_VDELAY 0xffc01310 /* EPPI1 Vertical Delay Count Register */
500#define EPPI1_FRAME 0xffc01314 /* EPPI1 Lines per Frame Register */
501#define EPPI1_LINE 0xffc01318 /* EPPI1 Samples per Line Register */
502#define EPPI1_CLKDIV 0xffc0131c /* EPPI1 Clock Divide Register */
503#define EPPI1_CONTROL 0xffc01320 /* EPPI1 Control Register */
504#define EPPI1_FS1W_HBL 0xffc01324 /* EPPI1 FS1 Width Register / EPPI1 Horizontal Blanking Samples Per Line Register */
505#define EPPI1_FS1P_AVPL 0xffc01328 /* EPPI1 FS1 Period Register / EPPI1 Active Video Samples Per Line Register */
506#define EPPI1_FS2W_LVB 0xffc0132c /* EPPI1 FS2 Width Register / EPPI1 Lines of Vertical Blanking Register */
507#define EPPI1_FS2P_LAVF 0xffc01330 /* EPPI1 FS2 Period Register/ EPPI1 Lines of Active Video Per Field Register */
508#define EPPI1_CLIP 0xffc01334 /* EPPI1 Clipping Register */
509
510/* Port Interrupt 0 Registers (32-bit) */
511
512#define PINT0_MASK_SET 0xffc01400 /* Pin Interrupt 0 Mask Set Register */
513#define PINT0_MASK_CLEAR 0xffc01404 /* Pin Interrupt 0 Mask Clear Register */
514#define PINT0_REQUEST 0xffc01408 /* Pin Interrupt 0 Interrupt Request Register */
515#define PINT0_ASSIGN 0xffc0140c /* Pin Interrupt 0 Port Assign Register */
516#define PINT0_EDGE_SET 0xffc01410 /* Pin Interrupt 0 Edge-sensitivity Set Register */
517#define PINT0_EDGE_CLEAR 0xffc01414 /* Pin Interrupt 0 Edge-sensitivity Clear Register */
518#define PINT0_INVERT_SET 0xffc01418 /* Pin Interrupt 0 Inversion Set Register */
519#define PINT0_INVERT_CLEAR 0xffc0141c /* Pin Interrupt 0 Inversion Clear Register */
520#define PINT0_PINSTATE 0xffc01420 /* Pin Interrupt 0 Pin Status Register */
521#define PINT0_LATCH 0xffc01424 /* Pin Interrupt 0 Latch Register */
522
523/* Port Interrupt 1 Registers (32-bit) */
524
525#define PINT1_MASK_SET 0xffc01430 /* Pin Interrupt 1 Mask Set Register */
526#define PINT1_MASK_CLEAR 0xffc01434 /* Pin Interrupt 1 Mask Clear Register */
527#define PINT1_REQUEST 0xffc01438 /* Pin Interrupt 1 Interrupt Request Register */
528#define PINT1_ASSIGN 0xffc0143c /* Pin Interrupt 1 Port Assign Register */
529#define PINT1_EDGE_SET 0xffc01440 /* Pin Interrupt 1 Edge-sensitivity Set Register */
530#define PINT1_EDGE_CLEAR 0xffc01444 /* Pin Interrupt 1 Edge-sensitivity Clear Register */
531#define PINT1_INVERT_SET 0xffc01448 /* Pin Interrupt 1 Inversion Set Register */
532#define PINT1_INVERT_CLEAR 0xffc0144c /* Pin Interrupt 1 Inversion Clear Register */
533#define PINT1_PINSTATE 0xffc01450 /* Pin Interrupt 1 Pin Status Register */
534#define PINT1_LATCH 0xffc01454 /* Pin Interrupt 1 Latch Register */
535
536/* Port Interrupt 2 Registers (32-bit) */
537
538#define PINT2_MASK_SET 0xffc01460 /* Pin Interrupt 2 Mask Set Register */
539#define PINT2_MASK_CLEAR 0xffc01464 /* Pin Interrupt 2 Mask Clear Register */
540#define PINT2_REQUEST 0xffc01468 /* Pin Interrupt 2 Interrupt Request Register */
541#define PINT2_ASSIGN 0xffc0146c /* Pin Interrupt 2 Port Assign Register */
542#define PINT2_EDGE_SET 0xffc01470 /* Pin Interrupt 2 Edge-sensitivity Set Register */
543#define PINT2_EDGE_CLEAR 0xffc01474 /* Pin Interrupt 2 Edge-sensitivity Clear Register */
544#define PINT2_INVERT_SET 0xffc01478 /* Pin Interrupt 2 Inversion Set Register */
545#define PINT2_INVERT_CLEAR 0xffc0147c /* Pin Interrupt 2 Inversion Clear Register */
546#define PINT2_PINSTATE 0xffc01480 /* Pin Interrupt 2 Pin Status Register */
547#define PINT2_LATCH 0xffc01484 /* Pin Interrupt 2 Latch Register */
548
549/* Port Interrupt 3 Registers (32-bit) */
550
551#define PINT3_MASK_SET 0xffc01490 /* Pin Interrupt 3 Mask Set Register */
552#define PINT3_MASK_CLEAR 0xffc01494 /* Pin Interrupt 3 Mask Clear Register */
553#define PINT3_REQUEST 0xffc01498 /* Pin Interrupt 3 Interrupt Request Register */
554#define PINT3_ASSIGN 0xffc0149c /* Pin Interrupt 3 Port Assign Register */
555#define PINT3_EDGE_SET 0xffc014a0 /* Pin Interrupt 3 Edge-sensitivity Set Register */
556#define PINT3_EDGE_CLEAR 0xffc014a4 /* Pin Interrupt 3 Edge-sensitivity Clear Register */
557#define PINT3_INVERT_SET 0xffc014a8 /* Pin Interrupt 3 Inversion Set Register */
558#define PINT3_INVERT_CLEAR 0xffc014ac /* Pin Interrupt 3 Inversion Clear Register */
559#define PINT3_PINSTATE 0xffc014b0 /* Pin Interrupt 3 Pin Status Register */
560#define PINT3_LATCH 0xffc014b4 /* Pin Interrupt 3 Latch Register */
561
562/* Port A Registers */
563
564#define PORTA_FER 0xffc014c0 /* Function Enable Register */
565#define PORTA 0xffc014c4 /* GPIO Data Register */
566#define PORTA_SET 0xffc014c8 /* GPIO Data Set Register */
567#define PORTA_CLEAR 0xffc014cc /* GPIO Data Clear Register */
568#define PORTA_DIR_SET 0xffc014d0 /* GPIO Direction Set Register */
569#define PORTA_DIR_CLEAR 0xffc014d4 /* GPIO Direction Clear Register */
570#define PORTA_INEN 0xffc014d8 /* GPIO Input Enable Register */
571#define PORTA_MUX 0xffc014dc /* Multiplexer Control Register */
572
573/* Port B Registers */
574
575#define PORTB_FER 0xffc014e0 /* Function Enable Register */
576#define PORTB 0xffc014e4 /* GPIO Data Register */
577#define PORTB_SET 0xffc014e8 /* GPIO Data Set Register */
578#define PORTB_CLEAR 0xffc014ec /* GPIO Data Clear Register */
579#define PORTB_DIR_SET 0xffc014f0 /* GPIO Direction Set Register */
580#define PORTB_DIR_CLEAR 0xffc014f4 /* GPIO Direction Clear Register */
581#define PORTB_INEN 0xffc014f8 /* GPIO Input Enable Register */
582#define PORTB_MUX 0xffc014fc /* Multiplexer Control Register */
583
584/* Port C Registers */
585
586#define PORTC_FER 0xffc01500 /* Function Enable Register */
587#define PORTC 0xffc01504 /* GPIO Data Register */
588#define PORTC_SET 0xffc01508 /* GPIO Data Set Register */
589#define PORTC_CLEAR 0xffc0150c /* GPIO Data Clear Register */
590#define PORTC_DIR_SET 0xffc01510 /* GPIO Direction Set Register */
591#define PORTC_DIR_CLEAR 0xffc01514 /* GPIO Direction Clear Register */
592#define PORTC_INEN 0xffc01518 /* GPIO Input Enable Register */
593#define PORTC_MUX 0xffc0151c /* Multiplexer Control Register */
594
595/* Port D Registers */
596
597#define PORTD_FER 0xffc01520 /* Function Enable Register */
598#define PORTD 0xffc01524 /* GPIO Data Register */
599#define PORTD_SET 0xffc01528 /* GPIO Data Set Register */
600#define PORTD_CLEAR 0xffc0152c /* GPIO Data Clear Register */
601#define PORTD_DIR_SET 0xffc01530 /* GPIO Direction Set Register */
602#define PORTD_DIR_CLEAR 0xffc01534 /* GPIO Direction Clear Register */
603#define PORTD_INEN 0xffc01538 /* GPIO Input Enable Register */
604#define PORTD_MUX 0xffc0153c /* Multiplexer Control Register */
605
606/* Port E Registers */
607
608#define PORTE_FER 0xffc01540 /* Function Enable Register */
609#define PORTE 0xffc01544 /* GPIO Data Register */
610#define PORTE_SET 0xffc01548 /* GPIO Data Set Register */
611#define PORTE_CLEAR 0xffc0154c /* GPIO Data Clear Register */
612#define PORTE_DIR_SET 0xffc01550 /* GPIO Direction Set Register */
613#define PORTE_DIR_CLEAR 0xffc01554 /* GPIO Direction Clear Register */
614#define PORTE_INEN 0xffc01558 /* GPIO Input Enable Register */
615#define PORTE_MUX 0xffc0155c /* Multiplexer Control Register */
616
617/* Port F Registers */
618
619#define PORTF_FER 0xffc01560 /* Function Enable Register */
620#define PORTF 0xffc01564 /* GPIO Data Register */
621#define PORTF_SET 0xffc01568 /* GPIO Data Set Register */
622#define PORTF_CLEAR 0xffc0156c /* GPIO Data Clear Register */
623#define PORTF_DIR_SET 0xffc01570 /* GPIO Direction Set Register */
624#define PORTF_DIR_CLEAR 0xffc01574 /* GPIO Direction Clear Register */
625#define PORTF_INEN 0xffc01578 /* GPIO Input Enable Register */
626#define PORTF_MUX 0xffc0157c /* Multiplexer Control Register */
627
628/* Port G Registers */
629
630#define PORTG_FER 0xffc01580 /* Function Enable Register */
631#define PORTG 0xffc01584 /* GPIO Data Register */
632#define PORTG_SET 0xffc01588 /* GPIO Data Set Register */
633#define PORTG_CLEAR 0xffc0158c /* GPIO Data Clear Register */
634#define PORTG_DIR_SET 0xffc01590 /* GPIO Direction Set Register */
635#define PORTG_DIR_CLEAR 0xffc01594 /* GPIO Direction Clear Register */
636#define PORTG_INEN 0xffc01598 /* GPIO Input Enable Register */
637#define PORTG_MUX 0xffc0159c /* Multiplexer Control Register */
638
639/* Port H Registers */
640
641#define PORTH_FER 0xffc015a0 /* Function Enable Register */
642#define PORTH 0xffc015a4 /* GPIO Data Register */
643#define PORTH_SET 0xffc015a8 /* GPIO Data Set Register */
644#define PORTH_CLEAR 0xffc015ac /* GPIO Data Clear Register */
645#define PORTH_DIR_SET 0xffc015b0 /* GPIO Direction Set Register */
646#define PORTH_DIR_CLEAR 0xffc015b4 /* GPIO Direction Clear Register */
647#define PORTH_INEN 0xffc015b8 /* GPIO Input Enable Register */
648#define PORTH_MUX 0xffc015bc /* Multiplexer Control Register */
649
650/* Port I Registers */
651
652#define PORTI_FER 0xffc015c0 /* Function Enable Register */
653#define PORTI 0xffc015c4 /* GPIO Data Register */
654#define PORTI_SET 0xffc015c8 /* GPIO Data Set Register */
655#define PORTI_CLEAR 0xffc015cc /* GPIO Data Clear Register */
656#define PORTI_DIR_SET 0xffc015d0 /* GPIO Direction Set Register */
657#define PORTI_DIR_CLEAR 0xffc015d4 /* GPIO Direction Clear Register */
658#define PORTI_INEN 0xffc015d8 /* GPIO Input Enable Register */
659#define PORTI_MUX 0xffc015dc /* Multiplexer Control Register */
660
661/* Port J Registers */
662
663#define PORTJ_FER 0xffc015e0 /* Function Enable Register */
664#define PORTJ 0xffc015e4 /* GPIO Data Register */
665#define PORTJ_SET 0xffc015e8 /* GPIO Data Set Register */
666#define PORTJ_CLEAR 0xffc015ec /* GPIO Data Clear Register */
667#define PORTJ_DIR_SET 0xffc015f0 /* GPIO Direction Set Register */
668#define PORTJ_DIR_CLEAR 0xffc015f4 /* GPIO Direction Clear Register */
669#define PORTJ_INEN 0xffc015f8 /* GPIO Input Enable Register */
670#define PORTJ_MUX 0xffc015fc /* Multiplexer Control Register */
671
672/* PWM Timer Registers */
673
674#define TIMER0_CONFIG 0xffc01600 /* Timer 0 Configuration Register */
675#define TIMER0_COUNTER 0xffc01604 /* Timer 0 Counter Register */
676#define TIMER0_PERIOD 0xffc01608 /* Timer 0 Period Register */
677#define TIMER0_WIDTH 0xffc0160c /* Timer 0 Width Register */
678#define TIMER1_CONFIG 0xffc01610 /* Timer 1 Configuration Register */
679#define TIMER1_COUNTER 0xffc01614 /* Timer 1 Counter Register */
680#define TIMER1_PERIOD 0xffc01618 /* Timer 1 Period Register */
681#define TIMER1_WIDTH 0xffc0161c /* Timer 1 Width Register */
682#define TIMER2_CONFIG 0xffc01620 /* Timer 2 Configuration Register */
683#define TIMER2_COUNTER 0xffc01624 /* Timer 2 Counter Register */
684#define TIMER2_PERIOD 0xffc01628 /* Timer 2 Period Register */
685#define TIMER2_WIDTH 0xffc0162c /* Timer 2 Width Register */
686#define TIMER3_CONFIG 0xffc01630 /* Timer 3 Configuration Register */
687#define TIMER3_COUNTER 0xffc01634 /* Timer 3 Counter Register */
688#define TIMER3_PERIOD 0xffc01638 /* Timer 3 Period Register */
689#define TIMER3_WIDTH 0xffc0163c /* Timer 3 Width Register */
690#define TIMER4_CONFIG 0xffc01640 /* Timer 4 Configuration Register */
691#define TIMER4_COUNTER 0xffc01644 /* Timer 4 Counter Register */
692#define TIMER4_PERIOD 0xffc01648 /* Timer 4 Period Register */
693#define TIMER4_WIDTH 0xffc0164c /* Timer 4 Width Register */
694#define TIMER5_CONFIG 0xffc01650 /* Timer 5 Configuration Register */
695#define TIMER5_COUNTER 0xffc01654 /* Timer 5 Counter Register */
696#define TIMER5_PERIOD 0xffc01658 /* Timer 5 Period Register */
697#define TIMER5_WIDTH 0xffc0165c /* Timer 5 Width Register */
698#define TIMER6_CONFIG 0xffc01660 /* Timer 6 Configuration Register */
699#define TIMER6_COUNTER 0xffc01664 /* Timer 6 Counter Register */
700#define TIMER6_PERIOD 0xffc01668 /* Timer 6 Period Register */
701#define TIMER6_WIDTH 0xffc0166c /* Timer 6 Width Register */
702#define TIMER7_CONFIG 0xffc01670 /* Timer 7 Configuration Register */
703#define TIMER7_COUNTER 0xffc01674 /* Timer 7 Counter Register */
704#define TIMER7_PERIOD 0xffc01678 /* Timer 7 Period Register */
705#define TIMER7_WIDTH 0xffc0167c /* Timer 7 Width Register */
706
707/* Timer Group of 8 */
708
709#define TIMER_ENABLE0 0xffc01680 /* Timer Group of 8 Enable Register */
710#define TIMER_DISABLE0 0xffc01684 /* Timer Group of 8 Disable Register */
711#define TIMER_STATUS0 0xffc01688 /* Timer Group of 8 Status Register */
712
713/* DMAC1 Registers */
714
715#define DMAC1_TCPER 0xffc01b0c /* DMA Controller 1 Traffic Control Periods Register */
716#define DMAC1_TCCNT 0xffc01b10 /* DMA Controller 1 Current Counts Register */
717
718/* DMA Channel 12 Registers */
719
720#define DMA12_NEXT_DESC_PTR 0xffc01c00 /* DMA Channel 12 Next Descriptor Pointer Register */
721#define DMA12_START_ADDR 0xffc01c04 /* DMA Channel 12 Start Address Register */
722#define DMA12_CONFIG 0xffc01c08 /* DMA Channel 12 Configuration Register */
723#define DMA12_X_COUNT 0xffc01c10 /* DMA Channel 12 X Count Register */
724#define DMA12_X_MODIFY 0xffc01c14 /* DMA Channel 12 X Modify Register */
725#define DMA12_Y_COUNT 0xffc01c18 /* DMA Channel 12 Y Count Register */
726#define DMA12_Y_MODIFY 0xffc01c1c /* DMA Channel 12 Y Modify Register */
727#define DMA12_CURR_DESC_PTR 0xffc01c20 /* DMA Channel 12 Current Descriptor Pointer Register */
728#define DMA12_CURR_ADDR 0xffc01c24 /* DMA Channel 12 Current Address Register */
729#define DMA12_IRQ_STATUS 0xffc01c28 /* DMA Channel 12 Interrupt/Status Register */
730#define DMA12_PERIPHERAL_MAP 0xffc01c2c /* DMA Channel 12 Peripheral Map Register */
731#define DMA12_CURR_X_COUNT 0xffc01c30 /* DMA Channel 12 Current X Count Register */
732#define DMA12_CURR_Y_COUNT 0xffc01c38 /* DMA Channel 12 Current Y Count Register */
733
734/* DMA Channel 13 Registers */
735
736#define DMA13_NEXT_DESC_PTR 0xffc01c40 /* DMA Channel 13 Next Descriptor Pointer Register */
737#define DMA13_START_ADDR 0xffc01c44 /* DMA Channel 13 Start Address Register */
738#define DMA13_CONFIG 0xffc01c48 /* DMA Channel 13 Configuration Register */
739#define DMA13_X_COUNT 0xffc01c50 /* DMA Channel 13 X Count Register */
740#define DMA13_X_MODIFY 0xffc01c54 /* DMA Channel 13 X Modify Register */
741#define DMA13_Y_COUNT 0xffc01c58 /* DMA Channel 13 Y Count Register */
742#define DMA13_Y_MODIFY 0xffc01c5c /* DMA Channel 13 Y Modify Register */
743#define DMA13_CURR_DESC_PTR 0xffc01c60 /* DMA Channel 13 Current Descriptor Pointer Register */
744#define DMA13_CURR_ADDR 0xffc01c64 /* DMA Channel 13 Current Address Register */
745#define DMA13_IRQ_STATUS 0xffc01c68 /* DMA Channel 13 Interrupt/Status Register */
746#define DMA13_PERIPHERAL_MAP 0xffc01c6c /* DMA Channel 13 Peripheral Map Register */
747#define DMA13_CURR_X_COUNT 0xffc01c70 /* DMA Channel 13 Current X Count Register */
748#define DMA13_CURR_Y_COUNT 0xffc01c78 /* DMA Channel 13 Current Y Count Register */
749
750/* DMA Channel 14 Registers */
751
752#define DMA14_NEXT_DESC_PTR 0xffc01c80 /* DMA Channel 14 Next Descriptor Pointer Register */
753#define DMA14_START_ADDR 0xffc01c84 /* DMA Channel 14 Start Address Register */
754#define DMA14_CONFIG 0xffc01c88 /* DMA Channel 14 Configuration Register */
755#define DMA14_X_COUNT 0xffc01c90 /* DMA Channel 14 X Count Register */
756#define DMA14_X_MODIFY 0xffc01c94 /* DMA Channel 14 X Modify Register */
757#define DMA14_Y_COUNT 0xffc01c98 /* DMA Channel 14 Y Count Register */
758#define DMA14_Y_MODIFY 0xffc01c9c /* DMA Channel 14 Y Modify Register */
759#define DMA14_CURR_DESC_PTR 0xffc01ca0 /* DMA Channel 14 Current Descriptor Pointer Register */
760#define DMA14_CURR_ADDR 0xffc01ca4 /* DMA Channel 14 Current Address Register */
761#define DMA14_IRQ_STATUS 0xffc01ca8 /* DMA Channel 14 Interrupt/Status Register */
762#define DMA14_PERIPHERAL_MAP 0xffc01cac /* DMA Channel 14 Peripheral Map Register */
763#define DMA14_CURR_X_COUNT 0xffc01cb0 /* DMA Channel 14 Current X Count Register */
764#define DMA14_CURR_Y_COUNT 0xffc01cb8 /* DMA Channel 14 Current Y Count Register */
765
766/* DMA Channel 15 Registers */
767
768#define DMA15_NEXT_DESC_PTR 0xffc01cc0 /* DMA Channel 15 Next Descriptor Pointer Register */
769#define DMA15_START_ADDR 0xffc01cc4 /* DMA Channel 15 Start Address Register */
770#define DMA15_CONFIG 0xffc01cc8 /* DMA Channel 15 Configuration Register */
771#define DMA15_X_COUNT 0xffc01cd0 /* DMA Channel 15 X Count Register */
772#define DMA15_X_MODIFY 0xffc01cd4 /* DMA Channel 15 X Modify Register */
773#define DMA15_Y_COUNT 0xffc01cd8 /* DMA Channel 15 Y Count Register */
774#define DMA15_Y_MODIFY 0xffc01cdc /* DMA Channel 15 Y Modify Register */
775#define DMA15_CURR_DESC_PTR 0xffc01ce0 /* DMA Channel 15 Current Descriptor Pointer Register */
776#define DMA15_CURR_ADDR 0xffc01ce4 /* DMA Channel 15 Current Address Register */
777#define DMA15_IRQ_STATUS 0xffc01ce8 /* DMA Channel 15 Interrupt/Status Register */
778#define DMA15_PERIPHERAL_MAP 0xffc01cec /* DMA Channel 15 Peripheral Map Register */
779#define DMA15_CURR_X_COUNT 0xffc01cf0 /* DMA Channel 15 Current X Count Register */
780#define DMA15_CURR_Y_COUNT 0xffc01cf8 /* DMA Channel 15 Current Y Count Register */
781
782/* DMA Channel 16 Registers */
783
784#define DMA16_NEXT_DESC_PTR 0xffc01d00 /* DMA Channel 16 Next Descriptor Pointer Register */
785#define DMA16_START_ADDR 0xffc01d04 /* DMA Channel 16 Start Address Register */
786#define DMA16_CONFIG 0xffc01d08 /* DMA Channel 16 Configuration Register */
787#define DMA16_X_COUNT 0xffc01d10 /* DMA Channel 16 X Count Register */
788#define DMA16_X_MODIFY 0xffc01d14 /* DMA Channel 16 X Modify Register */
789#define DMA16_Y_COUNT 0xffc01d18 /* DMA Channel 16 Y Count Register */
790#define DMA16_Y_MODIFY 0xffc01d1c /* DMA Channel 16 Y Modify Register */
791#define DMA16_CURR_DESC_PTR 0xffc01d20 /* DMA Channel 16 Current Descriptor Pointer Register */
792#define DMA16_CURR_ADDR 0xffc01d24 /* DMA Channel 16 Current Address Register */
793#define DMA16_IRQ_STATUS 0xffc01d28 /* DMA Channel 16 Interrupt/Status Register */
794#define DMA16_PERIPHERAL_MAP 0xffc01d2c /* DMA Channel 16 Peripheral Map Register */
795#define DMA16_CURR_X_COUNT 0xffc01d30 /* DMA Channel 16 Current X Count Register */
796#define DMA16_CURR_Y_COUNT 0xffc01d38 /* DMA Channel 16 Current Y Count Register */
797
798/* DMA Channel 17 Registers */
799
800#define DMA17_NEXT_DESC_PTR 0xffc01d40 /* DMA Channel 17 Next Descriptor Pointer Register */
801#define DMA17_START_ADDR 0xffc01d44 /* DMA Channel 17 Start Address Register */
802#define DMA17_CONFIG 0xffc01d48 /* DMA Channel 17 Configuration Register */
803#define DMA17_X_COUNT 0xffc01d50 /* DMA Channel 17 X Count Register */
804#define DMA17_X_MODIFY 0xffc01d54 /* DMA Channel 17 X Modify Register */
805#define DMA17_Y_COUNT 0xffc01d58 /* DMA Channel 17 Y Count Register */
806#define DMA17_Y_MODIFY 0xffc01d5c /* DMA Channel 17 Y Modify Register */
807#define DMA17_CURR_DESC_PTR 0xffc01d60 /* DMA Channel 17 Current Descriptor Pointer Register */
808#define DMA17_CURR_ADDR 0xffc01d64 /* DMA Channel 17 Current Address Register */
809#define DMA17_IRQ_STATUS 0xffc01d68 /* DMA Channel 17 Interrupt/Status Register */
810#define DMA17_PERIPHERAL_MAP 0xffc01d6c /* DMA Channel 17 Peripheral Map Register */
811#define DMA17_CURR_X_COUNT 0xffc01d70 /* DMA Channel 17 Current X Count Register */
812#define DMA17_CURR_Y_COUNT 0xffc01d78 /* DMA Channel 17 Current Y Count Register */
813
814/* DMA Channel 18 Registers */
815
816#define DMA18_NEXT_DESC_PTR 0xffc01d80 /* DMA Channel 18 Next Descriptor Pointer Register */
817#define DMA18_START_ADDR 0xffc01d84 /* DMA Channel 18 Start Address Register */
818#define DMA18_CONFIG 0xffc01d88 /* DMA Channel 18 Configuration Register */
819#define DMA18_X_COUNT 0xffc01d90 /* DMA Channel 18 X Count Register */
820#define DMA18_X_MODIFY 0xffc01d94 /* DMA Channel 18 X Modify Register */
821#define DMA18_Y_COUNT 0xffc01d98 /* DMA Channel 18 Y Count Register */
822#define DMA18_Y_MODIFY 0xffc01d9c /* DMA Channel 18 Y Modify Register */
823#define DMA18_CURR_DESC_PTR 0xffc01da0 /* DMA Channel 18 Current Descriptor Pointer Register */
824#define DMA18_CURR_ADDR 0xffc01da4 /* DMA Channel 18 Current Address Register */
825#define DMA18_IRQ_STATUS 0xffc01da8 /* DMA Channel 18 Interrupt/Status Register */
826#define DMA18_PERIPHERAL_MAP 0xffc01dac /* DMA Channel 18 Peripheral Map Register */
827#define DMA18_CURR_X_COUNT 0xffc01db0 /* DMA Channel 18 Current X Count Register */
828#define DMA18_CURR_Y_COUNT 0xffc01db8 /* DMA Channel 18 Current Y Count Register */
829
830/* DMA Channel 19 Registers */
831
832#define DMA19_NEXT_DESC_PTR 0xffc01dc0 /* DMA Channel 19 Next Descriptor Pointer Register */
833#define DMA19_START_ADDR 0xffc01dc4 /* DMA Channel 19 Start Address Register */
834#define DMA19_CONFIG 0xffc01dc8 /* DMA Channel 19 Configuration Register */
835#define DMA19_X_COUNT 0xffc01dd0 /* DMA Channel 19 X Count Register */
836#define DMA19_X_MODIFY 0xffc01dd4 /* DMA Channel 19 X Modify Register */
837#define DMA19_Y_COUNT 0xffc01dd8 /* DMA Channel 19 Y Count Register */
838#define DMA19_Y_MODIFY 0xffc01ddc /* DMA Channel 19 Y Modify Register */
839#define DMA19_CURR_DESC_PTR 0xffc01de0 /* DMA Channel 19 Current Descriptor Pointer Register */
840#define DMA19_CURR_ADDR 0xffc01de4 /* DMA Channel 19 Current Address Register */
841#define DMA19_IRQ_STATUS 0xffc01de8 /* DMA Channel 19 Interrupt/Status Register */
842#define DMA19_PERIPHERAL_MAP 0xffc01dec /* DMA Channel 19 Peripheral Map Register */
843#define DMA19_CURR_X_COUNT 0xffc01df0 /* DMA Channel 19 Current X Count Register */
844#define DMA19_CURR_Y_COUNT 0xffc01df8 /* DMA Channel 19 Current Y Count Register */
845
846/* DMA Channel 20 Registers */
847
848#define DMA20_NEXT_DESC_PTR 0xffc01e00 /* DMA Channel 20 Next Descriptor Pointer Register */
849#define DMA20_START_ADDR 0xffc01e04 /* DMA Channel 20 Start Address Register */
850#define DMA20_CONFIG 0xffc01e08 /* DMA Channel 20 Configuration Register */
851#define DMA20_X_COUNT 0xffc01e10 /* DMA Channel 20 X Count Register */
852#define DMA20_X_MODIFY 0xffc01e14 /* DMA Channel 20 X Modify Register */
853#define DMA20_Y_COUNT 0xffc01e18 /* DMA Channel 20 Y Count Register */
854#define DMA20_Y_MODIFY 0xffc01e1c /* DMA Channel 20 Y Modify Register */
855#define DMA20_CURR_DESC_PTR 0xffc01e20 /* DMA Channel 20 Current Descriptor Pointer Register */
856#define DMA20_CURR_ADDR 0xffc01e24 /* DMA Channel 20 Current Address Register */
857#define DMA20_IRQ_STATUS 0xffc01e28 /* DMA Channel 20 Interrupt/Status Register */
858#define DMA20_PERIPHERAL_MAP 0xffc01e2c /* DMA Channel 20 Peripheral Map Register */
859#define DMA20_CURR_X_COUNT 0xffc01e30 /* DMA Channel 20 Current X Count Register */
860#define DMA20_CURR_Y_COUNT 0xffc01e38 /* DMA Channel 20 Current Y Count Register */
861
862/* DMA Channel 21 Registers */
863
864#define DMA21_NEXT_DESC_PTR 0xffc01e40 /* DMA Channel 21 Next Descriptor Pointer Register */
865#define DMA21_START_ADDR 0xffc01e44 /* DMA Channel 21 Start Address Register */
866#define DMA21_CONFIG 0xffc01e48 /* DMA Channel 21 Configuration Register */
867#define DMA21_X_COUNT 0xffc01e50 /* DMA Channel 21 X Count Register */
868#define DMA21_X_MODIFY 0xffc01e54 /* DMA Channel 21 X Modify Register */
869#define DMA21_Y_COUNT 0xffc01e58 /* DMA Channel 21 Y Count Register */
870#define DMA21_Y_MODIFY 0xffc01e5c /* DMA Channel 21 Y Modify Register */
871#define DMA21_CURR_DESC_PTR 0xffc01e60 /* DMA Channel 21 Current Descriptor Pointer Register */
872#define DMA21_CURR_ADDR 0xffc01e64 /* DMA Channel 21 Current Address Register */
873#define DMA21_IRQ_STATUS 0xffc01e68 /* DMA Channel 21 Interrupt/Status Register */
874#define DMA21_PERIPHERAL_MAP 0xffc01e6c /* DMA Channel 21 Peripheral Map Register */
875#define DMA21_CURR_X_COUNT 0xffc01e70 /* DMA Channel 21 Current X Count Register */
876#define DMA21_CURR_Y_COUNT 0xffc01e78 /* DMA Channel 21 Current Y Count Register */
877
878/* DMA Channel 22 Registers */
879
880#define DMA22_NEXT_DESC_PTR 0xffc01e80 /* DMA Channel 22 Next Descriptor Pointer Register */
881#define DMA22_START_ADDR 0xffc01e84 /* DMA Channel 22 Start Address Register */
882#define DMA22_CONFIG 0xffc01e88 /* DMA Channel 22 Configuration Register */
883#define DMA22_X_COUNT 0xffc01e90 /* DMA Channel 22 X Count Register */
884#define DMA22_X_MODIFY 0xffc01e94 /* DMA Channel 22 X Modify Register */
885#define DMA22_Y_COUNT 0xffc01e98 /* DMA Channel 22 Y Count Register */
886#define DMA22_Y_MODIFY 0xffc01e9c /* DMA Channel 22 Y Modify Register */
887#define DMA22_CURR_DESC_PTR 0xffc01ea0 /* DMA Channel 22 Current Descriptor Pointer Register */
888#define DMA22_CURR_ADDR 0xffc01ea4 /* DMA Channel 22 Current Address Register */
889#define DMA22_IRQ_STATUS 0xffc01ea8 /* DMA Channel 22 Interrupt/Status Register */
890#define DMA22_PERIPHERAL_MAP 0xffc01eac /* DMA Channel 22 Peripheral Map Register */
891#define DMA22_CURR_X_COUNT 0xffc01eb0 /* DMA Channel 22 Current X Count Register */
892#define DMA22_CURR_Y_COUNT 0xffc01eb8 /* DMA Channel 22 Current Y Count Register */
893
894/* DMA Channel 23 Registers */
895
896#define DMA23_NEXT_DESC_PTR 0xffc01ec0 /* DMA Channel 23 Next Descriptor Pointer Register */
897#define DMA23_START_ADDR 0xffc01ec4 /* DMA Channel 23 Start Address Register */
898#define DMA23_CONFIG 0xffc01ec8 /* DMA Channel 23 Configuration Register */
899#define DMA23_X_COUNT 0xffc01ed0 /* DMA Channel 23 X Count Register */
900#define DMA23_X_MODIFY 0xffc01ed4 /* DMA Channel 23 X Modify Register */
901#define DMA23_Y_COUNT 0xffc01ed8 /* DMA Channel 23 Y Count Register */
902#define DMA23_Y_MODIFY 0xffc01edc /* DMA Channel 23 Y Modify Register */
903#define DMA23_CURR_DESC_PTR 0xffc01ee0 /* DMA Channel 23 Current Descriptor Pointer Register */
904#define DMA23_CURR_ADDR 0xffc01ee4 /* DMA Channel 23 Current Address Register */
905#define DMA23_IRQ_STATUS 0xffc01ee8 /* DMA Channel 23 Interrupt/Status Register */
906#define DMA23_PERIPHERAL_MAP 0xffc01eec /* DMA Channel 23 Peripheral Map Register */
907#define DMA23_CURR_X_COUNT 0xffc01ef0 /* DMA Channel 23 Current X Count Register */
908#define DMA23_CURR_Y_COUNT 0xffc01ef8 /* DMA Channel 23 Current Y Count Register */
909
910/* MDMA Stream 2 Registers */
911
912#define MDMA_D2_NEXT_DESC_PTR 0xffc01f00 /* Memory DMA Stream 2 Destination Next Descriptor Pointer Register */
913#define MDMA_D2_START_ADDR 0xffc01f04 /* Memory DMA Stream 2 Destination Start Address Register */
914#define MDMA_D2_CONFIG 0xffc01f08 /* Memory DMA Stream 2 Destination Configuration Register */
915#define MDMA_D2_X_COUNT 0xffc01f10 /* Memory DMA Stream 2 Destination X Count Register */
916#define MDMA_D2_X_MODIFY 0xffc01f14 /* Memory DMA Stream 2 Destination X Modify Register */
917#define MDMA_D2_Y_COUNT 0xffc01f18 /* Memory DMA Stream 2 Destination Y Count Register */
918#define MDMA_D2_Y_MODIFY 0xffc01f1c /* Memory DMA Stream 2 Destination Y Modify Register */
919#define MDMA_D2_CURR_DESC_PTR 0xffc01f20 /* Memory DMA Stream 2 Destination Current Descriptor Pointer Register */
920#define MDMA_D2_CURR_ADDR 0xffc01f24 /* Memory DMA Stream 2 Destination Current Address Register */
921#define MDMA_D2_IRQ_STATUS 0xffc01f28 /* Memory DMA Stream 2 Destination Interrupt/Status Register */
922#define MDMA_D2_PERIPHERAL_MAP 0xffc01f2c /* Memory DMA Stream 2 Destination Peripheral Map Register */
923#define MDMA_D2_CURR_X_COUNT 0xffc01f30 /* Memory DMA Stream 2 Destination Current X Count Register */
924#define MDMA_D2_CURR_Y_COUNT 0xffc01f38 /* Memory DMA Stream 2 Destination Current Y Count Register */
925#define MDMA_S2_NEXT_DESC_PTR 0xffc01f40 /* Memory DMA Stream 2 Source Next Descriptor Pointer Register */
926#define MDMA_S2_START_ADDR 0xffc01f44 /* Memory DMA Stream 2 Source Start Address Register */
927#define MDMA_S2_CONFIG 0xffc01f48 /* Memory DMA Stream 2 Source Configuration Register */
928#define MDMA_S2_X_COUNT 0xffc01f50 /* Memory DMA Stream 2 Source X Count Register */
929#define MDMA_S2_X_MODIFY 0xffc01f54 /* Memory DMA Stream 2 Source X Modify Register */
930#define MDMA_S2_Y_COUNT 0xffc01f58 /* Memory DMA Stream 2 Source Y Count Register */
931#define MDMA_S2_Y_MODIFY 0xffc01f5c /* Memory DMA Stream 2 Source Y Modify Register */
932#define MDMA_S2_CURR_DESC_PTR 0xffc01f60 /* Memory DMA Stream 2 Source Current Descriptor Pointer Register */
933#define MDMA_S2_CURR_ADDR 0xffc01f64 /* Memory DMA Stream 2 Source Current Address Register */
934#define MDMA_S2_IRQ_STATUS 0xffc01f68 /* Memory DMA Stream 2 Source Interrupt/Status Register */
935#define MDMA_S2_PERIPHERAL_MAP 0xffc01f6c /* Memory DMA Stream 2 Source Peripheral Map Register */
936#define MDMA_S2_CURR_X_COUNT 0xffc01f70 /* Memory DMA Stream 2 Source Current X Count Register */
937#define MDMA_S2_CURR_Y_COUNT 0xffc01f78 /* Memory DMA Stream 2 Source Current Y Count Register */
938
939/* MDMA Stream 3 Registers */
940
941#define MDMA_D3_NEXT_DESC_PTR 0xffc01f80 /* Memory DMA Stream 3 Destination Next Descriptor Pointer Register */
942#define MDMA_D3_START_ADDR 0xffc01f84 /* Memory DMA Stream 3 Destination Start Address Register */
943#define MDMA_D3_CONFIG 0xffc01f88 /* Memory DMA Stream 3 Destination Configuration Register */
944#define MDMA_D3_X_COUNT 0xffc01f90 /* Memory DMA Stream 3 Destination X Count Register */
945#define MDMA_D3_X_MODIFY 0xffc01f94 /* Memory DMA Stream 3 Destination X Modify Register */
946#define MDMA_D3_Y_COUNT 0xffc01f98 /* Memory DMA Stream 3 Destination Y Count Register */
947#define MDMA_D3_Y_MODIFY 0xffc01f9c /* Memory DMA Stream 3 Destination Y Modify Register */
948#define MDMA_D3_CURR_DESC_PTR 0xffc01fa0 /* Memory DMA Stream 3 Destination Current Descriptor Pointer Register */
949#define MDMA_D3_CURR_ADDR 0xffc01fa4 /* Memory DMA Stream 3 Destination Current Address Register */
950#define MDMA_D3_IRQ_STATUS 0xffc01fa8 /* Memory DMA Stream 3 Destination Interrupt/Status Register */
951#define MDMA_D3_PERIPHERAL_MAP 0xffc01fac /* Memory DMA Stream 3 Destination Peripheral Map Register */
952#define MDMA_D3_CURR_X_COUNT 0xffc01fb0 /* Memory DMA Stream 3 Destination Current X Count Register */
953#define MDMA_D3_CURR_Y_COUNT 0xffc01fb8 /* Memory DMA Stream 3 Destination Current Y Count Register */
954#define MDMA_S3_NEXT_DESC_PTR 0xffc01fc0 /* Memory DMA Stream 3 Source Next Descriptor Pointer Register */
955#define MDMA_S3_START_ADDR 0xffc01fc4 /* Memory DMA Stream 3 Source Start Address Register */
956#define MDMA_S3_CONFIG 0xffc01fc8 /* Memory DMA Stream 3 Source Configuration Register */
957#define MDMA_S3_X_COUNT 0xffc01fd0 /* Memory DMA Stream 3 Source X Count Register */
958#define MDMA_S3_X_MODIFY 0xffc01fd4 /* Memory DMA Stream 3 Source X Modify Register */
959#define MDMA_S3_Y_COUNT 0xffc01fd8 /* Memory DMA Stream 3 Source Y Count Register */
960#define MDMA_S3_Y_MODIFY 0xffc01fdc /* Memory DMA Stream 3 Source Y Modify Register */
961#define MDMA_S3_CURR_DESC_PTR 0xffc01fe0 /* Memory DMA Stream 3 Source Current Descriptor Pointer Register */
962#define MDMA_S3_CURR_ADDR 0xffc01fe4 /* Memory DMA Stream 3 Source Current Address Register */
963#define MDMA_S3_IRQ_STATUS 0xffc01fe8 /* Memory DMA Stream 3 Source Interrupt/Status Register */
964#define MDMA_S3_PERIPHERAL_MAP 0xffc01fec /* Memory DMA Stream 3 Source Peripheral Map Register */
965#define MDMA_S3_CURR_X_COUNT 0xffc01ff0 /* Memory DMA Stream 3 Source Current X Count Register */
966#define MDMA_S3_CURR_Y_COUNT 0xffc01ff8 /* Memory DMA Stream 3 Source Current Y Count Register */
967
968/* UART1 Registers */
969
970#define UART1_DLL 0xffc02000 /* Divisor Latch Low Byte */
971#define UART1_DLH 0xffc02004 /* Divisor Latch High Byte */
972#define UART1_GCTL 0xffc02008 /* Global Control Register */
973#define UART1_LCR 0xffc0200c /* Line Control Register */
974#define UART1_MCR 0xffc02010 /* Modem Control Register */
975#define UART1_LSR 0xffc02014 /* Line Status Register */
976#define UART1_MSR 0xffc02018 /* Modem Status Register */
977#define UART1_SCR 0xffc0201c /* Scratch Register */
978#define UART1_IER_SET 0xffc02020 /* Interrupt Enable Register Set */
979#define UART1_IER_CLEAR 0xffc02024 /* Interrupt Enable Register Clear */
980#define UART1_THR 0xffc02028 /* Transmit Hold Register */
981#define UART1_RBR 0xffc0202c /* Receive Buffer Register */
982
983/* UART2 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 processors */
984
985/* SPI1 Registers */
986
987#define SPI1_REGBASE 0xffc02300
988#define SPI1_CTL 0xffc02300 /* SPI1 Control Register */
989#define SPI1_FLG 0xffc02304 /* SPI1 Flag Register */
990#define SPI1_STAT 0xffc02308 /* SPI1 Status Register */
991#define SPI1_TDBR 0xffc0230c /* SPI1 Transmit Data Buffer Register */
992#define SPI1_RDBR 0xffc02310 /* SPI1 Receive Data Buffer Register */
993#define SPI1_BAUD 0xffc02314 /* SPI1 Baud Rate Register */
994#define SPI1_SHADOW 0xffc02318 /* SPI1 Receive Data Buffer Shadow Register */
995
996/* SPORT2 Registers */
997
998#define SPORT2_TCR1 0xffc02500 /* SPORT2 Transmit Configuration 1 Register */
999#define SPORT2_TCR2 0xffc02504 /* SPORT2 Transmit Configuration 2 Register */
1000#define SPORT2_TCLKDIV 0xffc02508 /* SPORT2 Transmit Serial Clock Divider Register */
1001#define SPORT2_TFSDIV 0xffc0250c /* SPORT2 Transmit Frame Sync Divider Register */
1002#define SPORT2_TX 0xffc02510 /* SPORT2 Transmit Data Register */
1003#define SPORT2_RX 0xffc02518 /* SPORT2 Receive Data Register */
1004#define SPORT2_RCR1 0xffc02520 /* SPORT2 Receive Configuration 1 Register */
1005#define SPORT2_RCR2 0xffc02524 /* SPORT2 Receive Configuration 2 Register */
1006#define SPORT2_RCLKDIV 0xffc02528 /* SPORT2 Receive Serial Clock Divider Register */
1007#define SPORT2_RFSDIV 0xffc0252c /* SPORT2 Receive Frame Sync Divider Register */
1008#define SPORT2_STAT 0xffc02530 /* SPORT2 Status Register */
1009#define SPORT2_CHNL 0xffc02534 /* SPORT2 Current Channel Register */
1010#define SPORT2_MCMC1 0xffc02538 /* SPORT2 Multi channel Configuration Register 1 */
1011#define SPORT2_MCMC2 0xffc0253c /* SPORT2 Multi channel Configuration Register 2 */
1012#define SPORT2_MTCS0 0xffc02540 /* SPORT2 Multi channel Transmit Select Register 0 */
1013#define SPORT2_MTCS1 0xffc02544 /* SPORT2 Multi channel Transmit Select Register 1 */
1014#define SPORT2_MTCS2 0xffc02548 /* SPORT2 Multi channel Transmit Select Register 2 */
1015#define SPORT2_MTCS3 0xffc0254c /* SPORT2 Multi channel Transmit Select Register 3 */
1016#define SPORT2_MRCS0 0xffc02550 /* SPORT2 Multi channel Receive Select Register 0 */
1017#define SPORT2_MRCS1 0xffc02554 /* SPORT2 Multi channel Receive Select Register 1 */
1018#define SPORT2_MRCS2 0xffc02558 /* SPORT2 Multi channel Receive Select Register 2 */
1019#define SPORT2_MRCS3 0xffc0255c /* SPORT2 Multi channel Receive Select Register 3 */
1020
1021/* SPORT3 Registers */
1022
1023#define SPORT3_TCR1 0xffc02600 /* SPORT3 Transmit Configuration 1 Register */
1024#define SPORT3_TCR2 0xffc02604 /* SPORT3 Transmit Configuration 2 Register */
1025#define SPORT3_TCLKDIV 0xffc02608 /* SPORT3 Transmit Serial Clock Divider Register */
1026#define SPORT3_TFSDIV 0xffc0260c /* SPORT3 Transmit Frame Sync Divider Register */
1027#define SPORT3_TX 0xffc02610 /* SPORT3 Transmit Data Register */
1028#define SPORT3_RX 0xffc02618 /* SPORT3 Receive Data Register */
1029#define SPORT3_RCR1 0xffc02620 /* SPORT3 Receive Configuration 1 Register */
1030#define SPORT3_RCR2 0xffc02624 /* SPORT3 Receive Configuration 2 Register */
1031#define SPORT3_RCLKDIV 0xffc02628 /* SPORT3 Receive Serial Clock Divider Register */
1032#define SPORT3_RFSDIV 0xffc0262c /* SPORT3 Receive Frame Sync Divider Register */
1033#define SPORT3_STAT 0xffc02630 /* SPORT3 Status Register */
1034#define SPORT3_CHNL 0xffc02634 /* SPORT3 Current Channel Register */
1035#define SPORT3_MCMC1 0xffc02638 /* SPORT3 Multi channel Configuration Register 1 */
1036#define SPORT3_MCMC2 0xffc0263c /* SPORT3 Multi channel Configuration Register 2 */
1037#define SPORT3_MTCS0 0xffc02640 /* SPORT3 Multi channel Transmit Select Register 0 */
1038#define SPORT3_MTCS1 0xffc02644 /* SPORT3 Multi channel Transmit Select Register 1 */
1039#define SPORT3_MTCS2 0xffc02648 /* SPORT3 Multi channel Transmit Select Register 2 */
1040#define SPORT3_MTCS3 0xffc0264c /* SPORT3 Multi channel Transmit Select Register 3 */
1041#define SPORT3_MRCS0 0xffc02650 /* SPORT3 Multi channel Receive Select Register 0 */
1042#define SPORT3_MRCS1 0xffc02654 /* SPORT3 Multi channel Receive Select Register 1 */
1043#define SPORT3_MRCS2 0xffc02658 /* SPORT3 Multi channel Receive Select Register 2 */
1044#define SPORT3_MRCS3 0xffc0265c /* SPORT3 Multi channel Receive Select Register 3 */
1045
1046/* EPPI2 Registers */
1047
1048#define EPPI2_STATUS 0xffc02900 /* EPPI2 Status Register */
1049#define EPPI2_HCOUNT 0xffc02904 /* EPPI2 Horizontal Transfer Count Register */
1050#define EPPI2_HDELAY 0xffc02908 /* EPPI2 Horizontal Delay Count Register */
1051#define EPPI2_VCOUNT 0xffc0290c /* EPPI2 Vertical Transfer Count Register */
1052#define EPPI2_VDELAY 0xffc02910 /* EPPI2 Vertical Delay Count Register */
1053#define EPPI2_FRAME 0xffc02914 /* EPPI2 Lines per Frame Register */
1054#define EPPI2_LINE 0xffc02918 /* EPPI2 Samples per Line Register */
1055#define EPPI2_CLKDIV 0xffc0291c /* EPPI2 Clock Divide Register */
1056#define EPPI2_CONTROL 0xffc02920 /* EPPI2 Control Register */
1057#define EPPI2_FS1W_HBL 0xffc02924 /* EPPI2 FS1 Width Register / EPPI2 Horizontal Blanking Samples Per Line Register */
1058#define EPPI2_FS1P_AVPL 0xffc02928 /* EPPI2 FS1 Period Register / EPPI2 Active Video Samples Per Line Register */
1059#define EPPI2_FS2W_LVB 0xffc0292c /* EPPI2 FS2 Width Register / EPPI2 Lines of Vertical Blanking Register */
1060#define EPPI2_FS2P_LAVF 0xffc02930 /* EPPI2 FS2 Period Register/ EPPI2 Lines of Active Video Per Field Register */
1061#define EPPI2_CLIP 0xffc02934 /* EPPI2 Clipping Register */
1062
1063/* CAN Controller 0 Config 1 Registers */
1064
1065#define CAN0_MC1 0xffc02a00 /* CAN Controller 0 Mailbox Configuration Register 1 */
1066#define CAN0_MD1 0xffc02a04 /* CAN Controller 0 Mailbox Direction Register 1 */
1067#define CAN0_TRS1 0xffc02a08 /* CAN Controller 0 Transmit Request Set Register 1 */
1068#define CAN0_TRR1 0xffc02a0c /* CAN Controller 0 Transmit Request Reset Register 1 */
1069#define CAN0_TA1 0xffc02a10 /* CAN Controller 0 Transmit Acknowledge Register 1 */
1070#define CAN0_AA1 0xffc02a14 /* CAN Controller 0 Abort Acknowledge Register 1 */
1071#define CAN0_RMP1 0xffc02a18 /* CAN Controller 0 Receive Message Pending Register 1 */
1072#define CAN0_RML1 0xffc02a1c /* CAN Controller 0 Receive Message Lost Register 1 */
1073#define CAN0_MBTIF1 0xffc02a20 /* CAN Controller 0 Mailbox Transmit Interrupt Flag Register 1 */
1074#define CAN0_MBRIF1 0xffc02a24 /* CAN Controller 0 Mailbox Receive Interrupt Flag Register 1 */
1075#define CAN0_MBIM1 0xffc02a28 /* CAN Controller 0 Mailbox Interrupt Mask Register 1 */
1076#define CAN0_RFH1 0xffc02a2c /* CAN Controller 0 Remote Frame Handling Enable Register 1 */
1077#define CAN0_OPSS1 0xffc02a30 /* CAN Controller 0 Overwrite Protection Single Shot Transmit Register 1 */
1078
1079/* CAN Controller 0 Config 2 Registers */
1080
1081#define CAN0_MC2 0xffc02a40 /* CAN Controller 0 Mailbox Configuration Register 2 */
1082#define CAN0_MD2 0xffc02a44 /* CAN Controller 0 Mailbox Direction Register 2 */
1083#define CAN0_TRS2 0xffc02a48 /* CAN Controller 0 Transmit Request Set Register 2 */
1084#define CAN0_TRR2 0xffc02a4c /* CAN Controller 0 Transmit Request Reset Register 2 */
1085#define CAN0_TA2 0xffc02a50 /* CAN Controller 0 Transmit Acknowledge Register 2 */
1086#define CAN0_AA2 0xffc02a54 /* CAN Controller 0 Abort Acknowledge Register 2 */
1087#define CAN0_RMP2 0xffc02a58 /* CAN Controller 0 Receive Message Pending Register 2 */
1088#define CAN0_RML2 0xffc02a5c /* CAN Controller 0 Receive Message Lost Register 2 */
1089#define CAN0_MBTIF2 0xffc02a60 /* CAN Controller 0 Mailbox Transmit Interrupt Flag Register 2 */
1090#define CAN0_MBRIF2 0xffc02a64 /* CAN Controller 0 Mailbox Receive Interrupt Flag Register 2 */
1091#define CAN0_MBIM2 0xffc02a68 /* CAN Controller 0 Mailbox Interrupt Mask Register 2 */
1092#define CAN0_RFH2 0xffc02a6c /* CAN Controller 0 Remote Frame Handling Enable Register 2 */
1093#define CAN0_OPSS2 0xffc02a70 /* CAN Controller 0 Overwrite Protection Single Shot Transmit Register 2 */
1094
1095/* CAN Controller 0 Clock/Interrupt/Counter Registers */
1096
1097#define CAN0_CLOCK 0xffc02a80 /* CAN Controller 0 Clock Register */
1098#define CAN0_TIMING 0xffc02a84 /* CAN Controller 0 Timing Register */
1099#define CAN0_DEBUG 0xffc02a88 /* CAN Controller 0 Debug Register */
1100#define CAN0_STATUS 0xffc02a8c /* CAN Controller 0 Global Status Register */
1101#define CAN0_CEC 0xffc02a90 /* CAN Controller 0 Error Counter Register */
1102#define CAN0_GIS 0xffc02a94 /* CAN Controller 0 Global Interrupt Status Register */
1103#define CAN0_GIM 0xffc02a98 /* CAN Controller 0 Global Interrupt Mask Register */
1104#define CAN0_GIF 0xffc02a9c /* CAN Controller 0 Global Interrupt Flag Register */
1105#define CAN0_CONTROL 0xffc02aa0 /* CAN Controller 0 Master Control Register */
1106#define CAN0_INTR 0xffc02aa4 /* CAN Controller 0 Interrupt Pending Register */
1107#define CAN0_MBTD 0xffc02aac /* CAN Controller 0 Mailbox Temporary Disable Register */
1108#define CAN0_EWR 0xffc02ab0 /* CAN Controller 0 Programmable Warning Level Register */
1109#define CAN0_ESR 0xffc02ab4 /* CAN Controller 0 Error Status Register */
1110#define CAN0_UCCNT 0xffc02ac4 /* CAN Controller 0 Universal Counter Register */
1111#define CAN0_UCRC 0xffc02ac8 /* CAN Controller 0 Universal Counter Force Reload Register */
1112#define CAN0_UCCNF 0xffc02acc /* CAN Controller 0 Universal Counter Configuration Register */
1113
1114/* CAN Controller 0 Acceptance Registers */
1115
1116#define CAN0_AM00L 0xffc02b00 /* CAN Controller 0 Mailbox 0 Acceptance Mask High Register */
1117#define CAN0_AM00H 0xffc02b04 /* CAN Controller 0 Mailbox 0 Acceptance Mask Low Register */
1118#define CAN0_AM01L 0xffc02b08 /* CAN Controller 0 Mailbox 1 Acceptance Mask High Register */
1119#define CAN0_AM01H 0xffc02b0c /* CAN Controller 0 Mailbox 1 Acceptance Mask Low Register */
1120#define CAN0_AM02L 0xffc02b10 /* CAN Controller 0 Mailbox 2 Acceptance Mask High Register */
1121#define CAN0_AM02H 0xffc02b14 /* CAN Controller 0 Mailbox 2 Acceptance Mask Low Register */
1122#define CAN0_AM03L 0xffc02b18 /* CAN Controller 0 Mailbox 3 Acceptance Mask High Register */
1123#define CAN0_AM03H 0xffc02b1c /* CAN Controller 0 Mailbox 3 Acceptance Mask Low Register */
1124#define CAN0_AM04L 0xffc02b20 /* CAN Controller 0 Mailbox 4 Acceptance Mask High Register */
1125#define CAN0_AM04H 0xffc02b24 /* CAN Controller 0 Mailbox 4 Acceptance Mask Low Register */
1126#define CAN0_AM05L 0xffc02b28 /* CAN Controller 0 Mailbox 5 Acceptance Mask High Register */
1127#define CAN0_AM05H 0xffc02b2c /* CAN Controller 0 Mailbox 5 Acceptance Mask Low Register */
1128#define CAN0_AM06L 0xffc02b30 /* CAN Controller 0 Mailbox 6 Acceptance Mask High Register */
1129#define CAN0_AM06H 0xffc02b34 /* CAN Controller 0 Mailbox 6 Acceptance Mask Low Register */
1130#define CAN0_AM07L 0xffc02b38 /* CAN Controller 0 Mailbox 7 Acceptance Mask High Register */
1131#define CAN0_AM07H 0xffc02b3c /* CAN Controller 0 Mailbox 7 Acceptance Mask Low Register */
1132#define CAN0_AM08L 0xffc02b40 /* CAN Controller 0 Mailbox 8 Acceptance Mask High Register */
1133#define CAN0_AM08H 0xffc02b44 /* CAN Controller 0 Mailbox 8 Acceptance Mask Low Register */
1134#define CAN0_AM09L 0xffc02b48 /* CAN Controller 0 Mailbox 9 Acceptance Mask High Register */
1135#define CAN0_AM09H 0xffc02b4c /* CAN Controller 0 Mailbox 9 Acceptance Mask Low Register */
1136#define CAN0_AM10L 0xffc02b50 /* CAN Controller 0 Mailbox 10 Acceptance Mask High Register */
1137#define CAN0_AM10H 0xffc02b54 /* CAN Controller 0 Mailbox 10 Acceptance Mask Low Register */
1138#define CAN0_AM11L 0xffc02b58 /* CAN Controller 0 Mailbox 11 Acceptance Mask High Register */
1139#define CAN0_AM11H 0xffc02b5c /* CAN Controller 0 Mailbox 11 Acceptance Mask Low Register */
1140#define CAN0_AM12L 0xffc02b60 /* CAN Controller 0 Mailbox 12 Acceptance Mask High Register */
1141#define CAN0_AM12H 0xffc02b64 /* CAN Controller 0 Mailbox 12 Acceptance Mask Low Register */
1142#define CAN0_AM13L 0xffc02b68 /* CAN Controller 0 Mailbox 13 Acceptance Mask High Register */
1143#define CAN0_AM13H 0xffc02b6c /* CAN Controller 0 Mailbox 13 Acceptance Mask Low Register */
1144#define CAN0_AM14L 0xffc02b70 /* CAN Controller 0 Mailbox 14 Acceptance Mask High Register */
1145#define CAN0_AM14H 0xffc02b74 /* CAN Controller 0 Mailbox 14 Acceptance Mask Low Register */
1146#define CAN0_AM15L 0xffc02b78 /* CAN Controller 0 Mailbox 15 Acceptance Mask High Register */
1147#define CAN0_AM15H 0xffc02b7c /* CAN Controller 0 Mailbox 15 Acceptance Mask Low Register */
1148
1149/* CAN Controller 0 Acceptance Registers */
1150
1151#define CAN0_AM16L 0xffc02b80 /* CAN Controller 0 Mailbox 16 Acceptance Mask High Register */
1152#define CAN0_AM16H 0xffc02b84 /* CAN Controller 0 Mailbox 16 Acceptance Mask Low Register */
1153#define CAN0_AM17L 0xffc02b88 /* CAN Controller 0 Mailbox 17 Acceptance Mask High Register */
1154#define CAN0_AM17H 0xffc02b8c /* CAN Controller 0 Mailbox 17 Acceptance Mask Low Register */
1155#define CAN0_AM18L 0xffc02b90 /* CAN Controller 0 Mailbox 18 Acceptance Mask High Register */
1156#define CAN0_AM18H 0xffc02b94 /* CAN Controller 0 Mailbox 18 Acceptance Mask Low Register */
1157#define CAN0_AM19L 0xffc02b98 /* CAN Controller 0 Mailbox 19 Acceptance Mask High Register */
1158#define CAN0_AM19H 0xffc02b9c /* CAN Controller 0 Mailbox 19 Acceptance Mask Low Register */
1159#define CAN0_AM20L 0xffc02ba0 /* CAN Controller 0 Mailbox 20 Acceptance Mask High Register */
1160#define CAN0_AM20H 0xffc02ba4 /* CAN Controller 0 Mailbox 20 Acceptance Mask Low Register */
1161#define CAN0_AM21L 0xffc02ba8 /* CAN Controller 0 Mailbox 21 Acceptance Mask High Register */
1162#define CAN0_AM21H 0xffc02bac /* CAN Controller 0 Mailbox 21 Acceptance Mask Low Register */
1163#define CAN0_AM22L 0xffc02bb0 /* CAN Controller 0 Mailbox 22 Acceptance Mask High Register */
1164#define CAN0_AM22H 0xffc02bb4 /* CAN Controller 0 Mailbox 22 Acceptance Mask Low Register */
1165#define CAN0_AM23L 0xffc02bb8 /* CAN Controller 0 Mailbox 23 Acceptance Mask High Register */
1166#define CAN0_AM23H 0xffc02bbc /* CAN Controller 0 Mailbox 23 Acceptance Mask Low Register */
1167#define CAN0_AM24L 0xffc02bc0 /* CAN Controller 0 Mailbox 24 Acceptance Mask High Register */
1168#define CAN0_AM24H 0xffc02bc4 /* CAN Controller 0 Mailbox 24 Acceptance Mask Low Register */
1169#define CAN0_AM25L 0xffc02bc8 /* CAN Controller 0 Mailbox 25 Acceptance Mask High Register */
1170#define CAN0_AM25H 0xffc02bcc /* CAN Controller 0 Mailbox 25 Acceptance Mask Low Register */
1171#define CAN0_AM26L 0xffc02bd0 /* CAN Controller 0 Mailbox 26 Acceptance Mask High Register */
1172#define CAN0_AM26H 0xffc02bd4 /* CAN Controller 0 Mailbox 26 Acceptance Mask Low Register */
1173#define CAN0_AM27L 0xffc02bd8 /* CAN Controller 0 Mailbox 27 Acceptance Mask High Register */
1174#define CAN0_AM27H 0xffc02bdc /* CAN Controller 0 Mailbox 27 Acceptance Mask Low Register */
1175#define CAN0_AM28L 0xffc02be0 /* CAN Controller 0 Mailbox 28 Acceptance Mask High Register */
1176#define CAN0_AM28H 0xffc02be4 /* CAN Controller 0 Mailbox 28 Acceptance Mask Low Register */
1177#define CAN0_AM29L 0xffc02be8 /* CAN Controller 0 Mailbox 29 Acceptance Mask High Register */
1178#define CAN0_AM29H 0xffc02bec /* CAN Controller 0 Mailbox 29 Acceptance Mask Low Register */
1179#define CAN0_AM30L 0xffc02bf0 /* CAN Controller 0 Mailbox 30 Acceptance Mask High Register */
1180#define CAN0_AM30H 0xffc02bf4 /* CAN Controller 0 Mailbox 30 Acceptance Mask Low Register */
1181#define CAN0_AM31L 0xffc02bf8 /* CAN Controller 0 Mailbox 31 Acceptance Mask High Register */
1182#define CAN0_AM31H 0xffc02bfc /* CAN Controller 0 Mailbox 31 Acceptance Mask Low Register */
1183
1184/* CAN Controller 0 Mailbox Data Registers */
1185
1186#define CAN0_MB00_DATA0 0xffc02c00 /* CAN Controller 0 Mailbox 0 Data 0 Register */
1187#define CAN0_MB00_DATA1 0xffc02c04 /* CAN Controller 0 Mailbox 0 Data 1 Register */
1188#define CAN0_MB00_DATA2 0xffc02c08 /* CAN Controller 0 Mailbox 0 Data 2 Register */
1189#define CAN0_MB00_DATA3 0xffc02c0c /* CAN Controller 0 Mailbox 0 Data 3 Register */
1190#define CAN0_MB00_LENGTH 0xffc02c10 /* CAN Controller 0 Mailbox 0 Length Register */
1191#define CAN0_MB00_TIMESTAMP 0xffc02c14 /* CAN Controller 0 Mailbox 0 Timestamp Register */
1192#define CAN0_MB00_ID0 0xffc02c18 /* CAN Controller 0 Mailbox 0 ID0 Register */
1193#define CAN0_MB00_ID1 0xffc02c1c /* CAN Controller 0 Mailbox 0 ID1 Register */
1194#define CAN0_MB01_DATA0 0xffc02c20 /* CAN Controller 0 Mailbox 1 Data 0 Register */
1195#define CAN0_MB01_DATA1 0xffc02c24 /* CAN Controller 0 Mailbox 1 Data 1 Register */
1196#define CAN0_MB01_DATA2 0xffc02c28 /* CAN Controller 0 Mailbox 1 Data 2 Register */
1197#define CAN0_MB01_DATA3 0xffc02c2c /* CAN Controller 0 Mailbox 1 Data 3 Register */
1198#define CAN0_MB01_LENGTH 0xffc02c30 /* CAN Controller 0 Mailbox 1 Length Register */
1199#define CAN0_MB01_TIMESTAMP 0xffc02c34 /* CAN Controller 0 Mailbox 1 Timestamp Register */
1200#define CAN0_MB01_ID0 0xffc02c38 /* CAN Controller 0 Mailbox 1 ID0 Register */
1201#define CAN0_MB01_ID1 0xffc02c3c /* CAN Controller 0 Mailbox 1 ID1 Register */
1202#define CAN0_MB02_DATA0 0xffc02c40 /* CAN Controller 0 Mailbox 2 Data 0 Register */
1203#define CAN0_MB02_DATA1 0xffc02c44 /* CAN Controller 0 Mailbox 2 Data 1 Register */
1204#define CAN0_MB02_DATA2 0xffc02c48 /* CAN Controller 0 Mailbox 2 Data 2 Register */
1205#define CAN0_MB02_DATA3 0xffc02c4c /* CAN Controller 0 Mailbox 2 Data 3 Register */
1206#define CAN0_MB02_LENGTH 0xffc02c50 /* CAN Controller 0 Mailbox 2 Length Register */
1207#define CAN0_MB02_TIMESTAMP 0xffc02c54 /* CAN Controller 0 Mailbox 2 Timestamp Register */
1208#define CAN0_MB02_ID0 0xffc02c58 /* CAN Controller 0 Mailbox 2 ID0 Register */
1209#define CAN0_MB02_ID1 0xffc02c5c /* CAN Controller 0 Mailbox 2 ID1 Register */
1210#define CAN0_MB03_DATA0 0xffc02c60 /* CAN Controller 0 Mailbox 3 Data 0 Register */
1211#define CAN0_MB03_DATA1 0xffc02c64 /* CAN Controller 0 Mailbox 3 Data 1 Register */
1212#define CAN0_MB03_DATA2 0xffc02c68 /* CAN Controller 0 Mailbox 3 Data 2 Register */
1213#define CAN0_MB03_DATA3 0xffc02c6c /* CAN Controller 0 Mailbox 3 Data 3 Register */
1214#define CAN0_MB03_LENGTH 0xffc02c70 /* CAN Controller 0 Mailbox 3 Length Register */
1215#define CAN0_MB03_TIMESTAMP 0xffc02c74 /* CAN Controller 0 Mailbox 3 Timestamp Register */
1216#define CAN0_MB03_ID0 0xffc02c78 /* CAN Controller 0 Mailbox 3 ID0 Register */
1217#define CAN0_MB03_ID1 0xffc02c7c /* CAN Controller 0 Mailbox 3 ID1 Register */
1218#define CAN0_MB04_DATA0 0xffc02c80 /* CAN Controller 0 Mailbox 4 Data 0 Register */
1219#define CAN0_MB04_DATA1 0xffc02c84 /* CAN Controller 0 Mailbox 4 Data 1 Register */
1220#define CAN0_MB04_DATA2 0xffc02c88 /* CAN Controller 0 Mailbox 4 Data 2 Register */
1221#define CAN0_MB04_DATA3 0xffc02c8c /* CAN Controller 0 Mailbox 4 Data 3 Register */
1222#define CAN0_MB04_LENGTH 0xffc02c90 /* CAN Controller 0 Mailbox 4 Length Register */
1223#define CAN0_MB04_TIMESTAMP 0xffc02c94 /* CAN Controller 0 Mailbox 4 Timestamp Register */
1224#define CAN0_MB04_ID0 0xffc02c98 /* CAN Controller 0 Mailbox 4 ID0 Register */
1225#define CAN0_MB04_ID1 0xffc02c9c /* CAN Controller 0 Mailbox 4 ID1 Register */
1226#define CAN0_MB05_DATA0 0xffc02ca0 /* CAN Controller 0 Mailbox 5 Data 0 Register */
1227#define CAN0_MB05_DATA1 0xffc02ca4 /* CAN Controller 0 Mailbox 5 Data 1 Register */
1228#define CAN0_MB05_DATA2 0xffc02ca8 /* CAN Controller 0 Mailbox 5 Data 2 Register */
1229#define CAN0_MB05_DATA3 0xffc02cac /* CAN Controller 0 Mailbox 5 Data 3 Register */
1230#define CAN0_MB05_LENGTH 0xffc02cb0 /* CAN Controller 0 Mailbox 5 Length Register */
1231#define CAN0_MB05_TIMESTAMP 0xffc02cb4 /* CAN Controller 0 Mailbox 5 Timestamp Register */
1232#define CAN0_MB05_ID0 0xffc02cb8 /* CAN Controller 0 Mailbox 5 ID0 Register */
1233#define CAN0_MB05_ID1 0xffc02cbc /* CAN Controller 0 Mailbox 5 ID1 Register */
1234#define CAN0_MB06_DATA0 0xffc02cc0 /* CAN Controller 0 Mailbox 6 Data 0 Register */
1235#define CAN0_MB06_DATA1 0xffc02cc4 /* CAN Controller 0 Mailbox 6 Data 1 Register */
1236#define CAN0_MB06_DATA2 0xffc02cc8 /* CAN Controller 0 Mailbox 6 Data 2 Register */
1237#define CAN0_MB06_DATA3 0xffc02ccc /* CAN Controller 0 Mailbox 6 Data 3 Register */
1238#define CAN0_MB06_LENGTH 0xffc02cd0 /* CAN Controller 0 Mailbox 6 Length Register */
1239#define CAN0_MB06_TIMESTAMP 0xffc02cd4 /* CAN Controller 0 Mailbox 6 Timestamp Register */
1240#define CAN0_MB06_ID0 0xffc02cd8 /* CAN Controller 0 Mailbox 6 ID0 Register */
1241#define CAN0_MB06_ID1 0xffc02cdc /* CAN Controller 0 Mailbox 6 ID1 Register */
1242#define CAN0_MB07_DATA0 0xffc02ce0 /* CAN Controller 0 Mailbox 7 Data 0 Register */
1243#define CAN0_MB07_DATA1 0xffc02ce4 /* CAN Controller 0 Mailbox 7 Data 1 Register */
1244#define CAN0_MB07_DATA2 0xffc02ce8 /* CAN Controller 0 Mailbox 7 Data 2 Register */
1245#define CAN0_MB07_DATA3 0xffc02cec /* CAN Controller 0 Mailbox 7 Data 3 Register */
1246#define CAN0_MB07_LENGTH 0xffc02cf0 /* CAN Controller 0 Mailbox 7 Length Register */
1247#define CAN0_MB07_TIMESTAMP 0xffc02cf4 /* CAN Controller 0 Mailbox 7 Timestamp Register */
1248#define CAN0_MB07_ID0 0xffc02cf8 /* CAN Controller 0 Mailbox 7 ID0 Register */
1249#define CAN0_MB07_ID1 0xffc02cfc /* CAN Controller 0 Mailbox 7 ID1 Register */
1250#define CAN0_MB08_DATA0 0xffc02d00 /* CAN Controller 0 Mailbox 8 Data 0 Register */
1251#define CAN0_MB08_DATA1 0xffc02d04 /* CAN Controller 0 Mailbox 8 Data 1 Register */
1252#define CAN0_MB08_DATA2 0xffc02d08 /* CAN Controller 0 Mailbox 8 Data 2 Register */
1253#define CAN0_MB08_DATA3 0xffc02d0c /* CAN Controller 0 Mailbox 8 Data 3 Register */
1254#define CAN0_MB08_LENGTH 0xffc02d10 /* CAN Controller 0 Mailbox 8 Length Register */
1255#define CAN0_MB08_TIMESTAMP 0xffc02d14 /* CAN Controller 0 Mailbox 8 Timestamp Register */
1256#define CAN0_MB08_ID0 0xffc02d18 /* CAN Controller 0 Mailbox 8 ID0 Register */
1257#define CAN0_MB08_ID1 0xffc02d1c /* CAN Controller 0 Mailbox 8 ID1 Register */
1258#define CAN0_MB09_DATA0 0xffc02d20 /* CAN Controller 0 Mailbox 9 Data 0 Register */
1259#define CAN0_MB09_DATA1 0xffc02d24 /* CAN Controller 0 Mailbox 9 Data 1 Register */
1260#define CAN0_MB09_DATA2 0xffc02d28 /* CAN Controller 0 Mailbox 9 Data 2 Register */
1261#define CAN0_MB09_DATA3 0xffc02d2c /* CAN Controller 0 Mailbox 9 Data 3 Register */
1262#define CAN0_MB09_LENGTH 0xffc02d30 /* CAN Controller 0 Mailbox 9 Length Register */
1263#define CAN0_MB09_TIMESTAMP 0xffc02d34 /* CAN Controller 0 Mailbox 9 Timestamp Register */
1264#define CAN0_MB09_ID0 0xffc02d38 /* CAN Controller 0 Mailbox 9 ID0 Register */
1265#define CAN0_MB09_ID1 0xffc02d3c /* CAN Controller 0 Mailbox 9 ID1 Register */
1266#define CAN0_MB10_DATA0 0xffc02d40 /* CAN Controller 0 Mailbox 10 Data 0 Register */
1267#define CAN0_MB10_DATA1 0xffc02d44 /* CAN Controller 0 Mailbox 10 Data 1 Register */
1268#define CAN0_MB10_DATA2 0xffc02d48 /* CAN Controller 0 Mailbox 10 Data 2 Register */
1269#define CAN0_MB10_DATA3 0xffc02d4c /* CAN Controller 0 Mailbox 10 Data 3 Register */
1270#define CAN0_MB10_LENGTH 0xffc02d50 /* CAN Controller 0 Mailbox 10 Length Register */
1271#define CAN0_MB10_TIMESTAMP 0xffc02d54 /* CAN Controller 0 Mailbox 10 Timestamp Register */
1272#define CAN0_MB10_ID0 0xffc02d58 /* CAN Controller 0 Mailbox 10 ID0 Register */
1273#define CAN0_MB10_ID1 0xffc02d5c /* CAN Controller 0 Mailbox 10 ID1 Register */
1274#define CAN0_MB11_DATA0 0xffc02d60 /* CAN Controller 0 Mailbox 11 Data 0 Register */
1275#define CAN0_MB11_DATA1 0xffc02d64 /* CAN Controller 0 Mailbox 11 Data 1 Register */
1276#define CAN0_MB11_DATA2 0xffc02d68 /* CAN Controller 0 Mailbox 11 Data 2 Register */
1277#define CAN0_MB11_DATA3 0xffc02d6c /* CAN Controller 0 Mailbox 11 Data 3 Register */
1278#define CAN0_MB11_LENGTH 0xffc02d70 /* CAN Controller 0 Mailbox 11 Length Register */
1279#define CAN0_MB11_TIMESTAMP 0xffc02d74 /* CAN Controller 0 Mailbox 11 Timestamp Register */
1280#define CAN0_MB11_ID0 0xffc02d78 /* CAN Controller 0 Mailbox 11 ID0 Register */
1281#define CAN0_MB11_ID1 0xffc02d7c /* CAN Controller 0 Mailbox 11 ID1 Register */
1282#define CAN0_MB12_DATA0 0xffc02d80 /* CAN Controller 0 Mailbox 12 Data 0 Register */
1283#define CAN0_MB12_DATA1 0xffc02d84 /* CAN Controller 0 Mailbox 12 Data 1 Register */
1284#define CAN0_MB12_DATA2 0xffc02d88 /* CAN Controller 0 Mailbox 12 Data 2 Register */
1285#define CAN0_MB12_DATA3 0xffc02d8c /* CAN Controller 0 Mailbox 12 Data 3 Register */
1286#define CAN0_MB12_LENGTH 0xffc02d90 /* CAN Controller 0 Mailbox 12 Length Register */
1287#define CAN0_MB12_TIMESTAMP 0xffc02d94 /* CAN Controller 0 Mailbox 12 Timestamp Register */
1288#define CAN0_MB12_ID0 0xffc02d98 /* CAN Controller 0 Mailbox 12 ID0 Register */
1289#define CAN0_MB12_ID1 0xffc02d9c /* CAN Controller 0 Mailbox 12 ID1 Register */
1290#define CAN0_MB13_DATA0 0xffc02da0 /* CAN Controller 0 Mailbox 13 Data 0 Register */
1291#define CAN0_MB13_DATA1 0xffc02da4 /* CAN Controller 0 Mailbox 13 Data 1 Register */
1292#define CAN0_MB13_DATA2 0xffc02da8 /* CAN Controller 0 Mailbox 13 Data 2 Register */
1293#define CAN0_MB13_DATA3 0xffc02dac /* CAN Controller 0 Mailbox 13 Data 3 Register */
1294#define CAN0_MB13_LENGTH 0xffc02db0 /* CAN Controller 0 Mailbox 13 Length Register */
1295#define CAN0_MB13_TIMESTAMP 0xffc02db4 /* CAN Controller 0 Mailbox 13 Timestamp Register */
1296#define CAN0_MB13_ID0 0xffc02db8 /* CAN Controller 0 Mailbox 13 ID0 Register */
1297#define CAN0_MB13_ID1 0xffc02dbc /* CAN Controller 0 Mailbox 13 ID1 Register */
1298#define CAN0_MB14_DATA0 0xffc02dc0 /* CAN Controller 0 Mailbox 14 Data 0 Register */
1299#define CAN0_MB14_DATA1 0xffc02dc4 /* CAN Controller 0 Mailbox 14 Data 1 Register */
1300#define CAN0_MB14_DATA2 0xffc02dc8 /* CAN Controller 0 Mailbox 14 Data 2 Register */
1301#define CAN0_MB14_DATA3 0xffc02dcc /* CAN Controller 0 Mailbox 14 Data 3 Register */
1302#define CAN0_MB14_LENGTH 0xffc02dd0 /* CAN Controller 0 Mailbox 14 Length Register */
1303#define CAN0_MB14_TIMESTAMP 0xffc02dd4 /* CAN Controller 0 Mailbox 14 Timestamp Register */
1304#define CAN0_MB14_ID0 0xffc02dd8 /* CAN Controller 0 Mailbox 14 ID0 Register */
1305#define CAN0_MB14_ID1 0xffc02ddc /* CAN Controller 0 Mailbox 14 ID1 Register */
1306#define CAN0_MB15_DATA0 0xffc02de0 /* CAN Controller 0 Mailbox 15 Data 0 Register */
1307#define CAN0_MB15_DATA1 0xffc02de4 /* CAN Controller 0 Mailbox 15 Data 1 Register */
1308#define CAN0_MB15_DATA2 0xffc02de8 /* CAN Controller 0 Mailbox 15 Data 2 Register */
1309#define CAN0_MB15_DATA3 0xffc02dec /* CAN Controller 0 Mailbox 15 Data 3 Register */
1310#define CAN0_MB15_LENGTH 0xffc02df0 /* CAN Controller 0 Mailbox 15 Length Register */
1311#define CAN0_MB15_TIMESTAMP 0xffc02df4 /* CAN Controller 0 Mailbox 15 Timestamp Register */
1312#define CAN0_MB15_ID0 0xffc02df8 /* CAN Controller 0 Mailbox 15 ID0 Register */
1313#define CAN0_MB15_ID1 0xffc02dfc /* CAN Controller 0 Mailbox 15 ID1 Register */
1314
1315/* CAN Controller 0 Mailbox Data Registers */
1316
1317#define CAN0_MB16_DATA0 0xffc02e00 /* CAN Controller 0 Mailbox 16 Data 0 Register */
1318#define CAN0_MB16_DATA1 0xffc02e04 /* CAN Controller 0 Mailbox 16 Data 1 Register */
1319#define CAN0_MB16_DATA2 0xffc02e08 /* CAN Controller 0 Mailbox 16 Data 2 Register */
1320#define CAN0_MB16_DATA3 0xffc02e0c /* CAN Controller 0 Mailbox 16 Data 3 Register */
1321#define CAN0_MB16_LENGTH 0xffc02e10 /* CAN Controller 0 Mailbox 16 Length Register */
1322#define CAN0_MB16_TIMESTAMP 0xffc02e14 /* CAN Controller 0 Mailbox 16 Timestamp Register */
1323#define CAN0_MB16_ID0 0xffc02e18 /* CAN Controller 0 Mailbox 16 ID0 Register */
1324#define CAN0_MB16_ID1 0xffc02e1c /* CAN Controller 0 Mailbox 16 ID1 Register */
1325#define CAN0_MB17_DATA0 0xffc02e20 /* CAN Controller 0 Mailbox 17 Data 0 Register */
1326#define CAN0_MB17_DATA1 0xffc02e24 /* CAN Controller 0 Mailbox 17 Data 1 Register */
1327#define CAN0_MB17_DATA2 0xffc02e28 /* CAN Controller 0 Mailbox 17 Data 2 Register */
1328#define CAN0_MB17_DATA3 0xffc02e2c /* CAN Controller 0 Mailbox 17 Data 3 Register */
1329#define CAN0_MB17_LENGTH 0xffc02e30 /* CAN Controller 0 Mailbox 17 Length Register */
1330#define CAN0_MB17_TIMESTAMP 0xffc02e34 /* CAN Controller 0 Mailbox 17 Timestamp Register */
1331#define CAN0_MB17_ID0 0xffc02e38 /* CAN Controller 0 Mailbox 17 ID0 Register */
1332#define CAN0_MB17_ID1 0xffc02e3c /* CAN Controller 0 Mailbox 17 ID1 Register */
1333#define CAN0_MB18_DATA0 0xffc02e40 /* CAN Controller 0 Mailbox 18 Data 0 Register */
1334#define CAN0_MB18_DATA1 0xffc02e44 /* CAN Controller 0 Mailbox 18 Data 1 Register */
1335#define CAN0_MB18_DATA2 0xffc02e48 /* CAN Controller 0 Mailbox 18 Data 2 Register */
1336#define CAN0_MB18_DATA3 0xffc02e4c /* CAN Controller 0 Mailbox 18 Data 3 Register */
1337#define CAN0_MB18_LENGTH 0xffc02e50 /* CAN Controller 0 Mailbox 18 Length Register */
1338#define CAN0_MB18_TIMESTAMP 0xffc02e54 /* CAN Controller 0 Mailbox 18 Timestamp Register */
1339#define CAN0_MB18_ID0 0xffc02e58 /* CAN Controller 0 Mailbox 18 ID0 Register */
1340#define CAN0_MB18_ID1 0xffc02e5c /* CAN Controller 0 Mailbox 18 ID1 Register */
1341#define CAN0_MB19_DATA0 0xffc02e60 /* CAN Controller 0 Mailbox 19 Data 0 Register */
1342#define CAN0_MB19_DATA1 0xffc02e64 /* CAN Controller 0 Mailbox 19 Data 1 Register */
1343#define CAN0_MB19_DATA2 0xffc02e68 /* CAN Controller 0 Mailbox 19 Data 2 Register */
1344#define CAN0_MB19_DATA3 0xffc02e6c /* CAN Controller 0 Mailbox 19 Data 3 Register */
1345#define CAN0_MB19_LENGTH 0xffc02e70 /* CAN Controller 0 Mailbox 19 Length Register */
1346#define CAN0_MB19_TIMESTAMP 0xffc02e74 /* CAN Controller 0 Mailbox 19 Timestamp Register */
1347#define CAN0_MB19_ID0 0xffc02e78 /* CAN Controller 0 Mailbox 19 ID0 Register */
1348#define CAN0_MB19_ID1 0xffc02e7c /* CAN Controller 0 Mailbox 19 ID1 Register */
1349#define CAN0_MB20_DATA0 0xffc02e80 /* CAN Controller 0 Mailbox 20 Data 0 Register */
1350#define CAN0_MB20_DATA1 0xffc02e84 /* CAN Controller 0 Mailbox 20 Data 1 Register */
1351#define CAN0_MB20_DATA2 0xffc02e88 /* CAN Controller 0 Mailbox 20 Data 2 Register */
1352#define CAN0_MB20_DATA3 0xffc02e8c /* CAN Controller 0 Mailbox 20 Data 3 Register */
1353#define CAN0_MB20_LENGTH 0xffc02e90 /* CAN Controller 0 Mailbox 20 Length Register */
1354#define CAN0_MB20_TIMESTAMP 0xffc02e94 /* CAN Controller 0 Mailbox 20 Timestamp Register */
1355#define CAN0_MB20_ID0 0xffc02e98 /* CAN Controller 0 Mailbox 20 ID0 Register */
1356#define CAN0_MB20_ID1 0xffc02e9c /* CAN Controller 0 Mailbox 20 ID1 Register */
1357#define CAN0_MB21_DATA0 0xffc02ea0 /* CAN Controller 0 Mailbox 21 Data 0 Register */
1358#define CAN0_MB21_DATA1 0xffc02ea4 /* CAN Controller 0 Mailbox 21 Data 1 Register */
1359#define CAN0_MB21_DATA2 0xffc02ea8 /* CAN Controller 0 Mailbox 21 Data 2 Register */
1360#define CAN0_MB21_DATA3 0xffc02eac /* CAN Controller 0 Mailbox 21 Data 3 Register */
1361#define CAN0_MB21_LENGTH 0xffc02eb0 /* CAN Controller 0 Mailbox 21 Length Register */
1362#define CAN0_MB21_TIMESTAMP 0xffc02eb4 /* CAN Controller 0 Mailbox 21 Timestamp Register */
1363#define CAN0_MB21_ID0 0xffc02eb8 /* CAN Controller 0 Mailbox 21 ID0 Register */
1364#define CAN0_MB21_ID1 0xffc02ebc /* CAN Controller 0 Mailbox 21 ID1 Register */
1365#define CAN0_MB22_DATA0 0xffc02ec0 /* CAN Controller 0 Mailbox 22 Data 0 Register */
1366#define CAN0_MB22_DATA1 0xffc02ec4 /* CAN Controller 0 Mailbox 22 Data 1 Register */
1367#define CAN0_MB22_DATA2 0xffc02ec8 /* CAN Controller 0 Mailbox 22 Data 2 Register */
1368#define CAN0_MB22_DATA3 0xffc02ecc /* CAN Controller 0 Mailbox 22 Data 3 Register */
1369#define CAN0_MB22_LENGTH 0xffc02ed0 /* CAN Controller 0 Mailbox 22 Length Register */
1370#define CAN0_MB22_TIMESTAMP 0xffc02ed4 /* CAN Controller 0 Mailbox 22 Timestamp Register */
1371#define CAN0_MB22_ID0 0xffc02ed8 /* CAN Controller 0 Mailbox 22 ID0 Register */
1372#define CAN0_MB22_ID1 0xffc02edc /* CAN Controller 0 Mailbox 22 ID1 Register */
1373#define CAN0_MB23_DATA0 0xffc02ee0 /* CAN Controller 0 Mailbox 23 Data 0 Register */
1374#define CAN0_MB23_DATA1 0xffc02ee4 /* CAN Controller 0 Mailbox 23 Data 1 Register */
1375#define CAN0_MB23_DATA2 0xffc02ee8 /* CAN Controller 0 Mailbox 23 Data 2 Register */
1376#define CAN0_MB23_DATA3 0xffc02eec /* CAN Controller 0 Mailbox 23 Data 3 Register */
1377#define CAN0_MB23_LENGTH 0xffc02ef0 /* CAN Controller 0 Mailbox 23 Length Register */
1378#define CAN0_MB23_TIMESTAMP 0xffc02ef4 /* CAN Controller 0 Mailbox 23 Timestamp Register */
1379#define CAN0_MB23_ID0 0xffc02ef8 /* CAN Controller 0 Mailbox 23 ID0 Register */
1380#define CAN0_MB23_ID1 0xffc02efc /* CAN Controller 0 Mailbox 23 ID1 Register */
1381#define CAN0_MB24_DATA0 0xffc02f00 /* CAN Controller 0 Mailbox 24 Data 0 Register */
1382#define CAN0_MB24_DATA1 0xffc02f04 /* CAN Controller 0 Mailbox 24 Data 1 Register */
1383#define CAN0_MB24_DATA2 0xffc02f08 /* CAN Controller 0 Mailbox 24 Data 2 Register */
1384#define CAN0_MB24_DATA3 0xffc02f0c /* CAN Controller 0 Mailbox 24 Data 3 Register */
1385#define CAN0_MB24_LENGTH 0xffc02f10 /* CAN Controller 0 Mailbox 24 Length Register */
1386#define CAN0_MB24_TIMESTAMP 0xffc02f14 /* CAN Controller 0 Mailbox 24 Timestamp Register */
1387#define CAN0_MB24_ID0 0xffc02f18 /* CAN Controller 0 Mailbox 24 ID0 Register */
1388#define CAN0_MB24_ID1 0xffc02f1c /* CAN Controller 0 Mailbox 24 ID1 Register */
1389#define CAN0_MB25_DATA0 0xffc02f20 /* CAN Controller 0 Mailbox 25 Data 0 Register */
1390#define CAN0_MB25_DATA1 0xffc02f24 /* CAN Controller 0 Mailbox 25 Data 1 Register */
1391#define CAN0_MB25_DATA2 0xffc02f28 /* CAN Controller 0 Mailbox 25 Data 2 Register */
1392#define CAN0_MB25_DATA3 0xffc02f2c /* CAN Controller 0 Mailbox 25 Data 3 Register */
1393#define CAN0_MB25_LENGTH 0xffc02f30 /* CAN Controller 0 Mailbox 25 Length Register */
1394#define CAN0_MB25_TIMESTAMP 0xffc02f34 /* CAN Controller 0 Mailbox 25 Timestamp Register */
1395#define CAN0_MB25_ID0 0xffc02f38 /* CAN Controller 0 Mailbox 25 ID0 Register */
1396#define CAN0_MB25_ID1 0xffc02f3c /* CAN Controller 0 Mailbox 25 ID1 Register */
1397#define CAN0_MB26_DATA0 0xffc02f40 /* CAN Controller 0 Mailbox 26 Data 0 Register */
1398#define CAN0_MB26_DATA1 0xffc02f44 /* CAN Controller 0 Mailbox 26 Data 1 Register */
1399#define CAN0_MB26_DATA2 0xffc02f48 /* CAN Controller 0 Mailbox 26 Data 2 Register */
1400#define CAN0_MB26_DATA3 0xffc02f4c /* CAN Controller 0 Mailbox 26 Data 3 Register */
1401#define CAN0_MB26_LENGTH 0xffc02f50 /* CAN Controller 0 Mailbox 26 Length Register */
1402#define CAN0_MB26_TIMESTAMP 0xffc02f54 /* CAN Controller 0 Mailbox 26 Timestamp Register */
1403#define CAN0_MB26_ID0 0xffc02f58 /* CAN Controller 0 Mailbox 26 ID0 Register */
1404#define CAN0_MB26_ID1 0xffc02f5c /* CAN Controller 0 Mailbox 26 ID1 Register */
1405#define CAN0_MB27_DATA0 0xffc02f60 /* CAN Controller 0 Mailbox 27 Data 0 Register */
1406#define CAN0_MB27_DATA1 0xffc02f64 /* CAN Controller 0 Mailbox 27 Data 1 Register */
1407#define CAN0_MB27_DATA2 0xffc02f68 /* CAN Controller 0 Mailbox 27 Data 2 Register */
1408#define CAN0_MB27_DATA3 0xffc02f6c /* CAN Controller 0 Mailbox 27 Data 3 Register */
1409#define CAN0_MB27_LENGTH 0xffc02f70 /* CAN Controller 0 Mailbox 27 Length Register */
1410#define CAN0_MB27_TIMESTAMP 0xffc02f74 /* CAN Controller 0 Mailbox 27 Timestamp Register */
1411#define CAN0_MB27_ID0 0xffc02f78 /* CAN Controller 0 Mailbox 27 ID0 Register */
1412#define CAN0_MB27_ID1 0xffc02f7c /* CAN Controller 0 Mailbox 27 ID1 Register */
1413#define CAN0_MB28_DATA0 0xffc02f80 /* CAN Controller 0 Mailbox 28 Data 0 Register */
1414#define CAN0_MB28_DATA1 0xffc02f84 /* CAN Controller 0 Mailbox 28 Data 1 Register */
1415#define CAN0_MB28_DATA2 0xffc02f88 /* CAN Controller 0 Mailbox 28 Data 2 Register */
1416#define CAN0_MB28_DATA3 0xffc02f8c /* CAN Controller 0 Mailbox 28 Data 3 Register */
1417#define CAN0_MB28_LENGTH 0xffc02f90 /* CAN Controller 0 Mailbox 28 Length Register */
1418#define CAN0_MB28_TIMESTAMP 0xffc02f94 /* CAN Controller 0 Mailbox 28 Timestamp Register */
1419#define CAN0_MB28_ID0 0xffc02f98 /* CAN Controller 0 Mailbox 28 ID0 Register */
1420#define CAN0_MB28_ID1 0xffc02f9c /* CAN Controller 0 Mailbox 28 ID1 Register */
1421#define CAN0_MB29_DATA0 0xffc02fa0 /* CAN Controller 0 Mailbox 29 Data 0 Register */
1422#define CAN0_MB29_DATA1 0xffc02fa4 /* CAN Controller 0 Mailbox 29 Data 1 Register */
1423#define CAN0_MB29_DATA2 0xffc02fa8 /* CAN Controller 0 Mailbox 29 Data 2 Register */
1424#define CAN0_MB29_DATA3 0xffc02fac /* CAN Controller 0 Mailbox 29 Data 3 Register */
1425#define CAN0_MB29_LENGTH 0xffc02fb0 /* CAN Controller 0 Mailbox 29 Length Register */
1426#define CAN0_MB29_TIMESTAMP 0xffc02fb4 /* CAN Controller 0 Mailbox 29 Timestamp Register */
1427#define CAN0_MB29_ID0 0xffc02fb8 /* CAN Controller 0 Mailbox 29 ID0 Register */
1428#define CAN0_MB29_ID1 0xffc02fbc /* CAN Controller 0 Mailbox 29 ID1 Register */
1429#define CAN0_MB30_DATA0 0xffc02fc0 /* CAN Controller 0 Mailbox 30 Data 0 Register */
1430#define CAN0_MB30_DATA1 0xffc02fc4 /* CAN Controller 0 Mailbox 30 Data 1 Register */
1431#define CAN0_MB30_DATA2 0xffc02fc8 /* CAN Controller 0 Mailbox 30 Data 2 Register */
1432#define CAN0_MB30_DATA3 0xffc02fcc /* CAN Controller 0 Mailbox 30 Data 3 Register */
1433#define CAN0_MB30_LENGTH 0xffc02fd0 /* CAN Controller 0 Mailbox 30 Length Register */
1434#define CAN0_MB30_TIMESTAMP 0xffc02fd4 /* CAN Controller 0 Mailbox 30 Timestamp Register */
1435#define CAN0_MB30_ID0 0xffc02fd8 /* CAN Controller 0 Mailbox 30 ID0 Register */
1436#define CAN0_MB30_ID1 0xffc02fdc /* CAN Controller 0 Mailbox 30 ID1 Register */
1437#define CAN0_MB31_DATA0 0xffc02fe0 /* CAN Controller 0 Mailbox 31 Data 0 Register */
1438#define CAN0_MB31_DATA1 0xffc02fe4 /* CAN Controller 0 Mailbox 31 Data 1 Register */
1439#define CAN0_MB31_DATA2 0xffc02fe8 /* CAN Controller 0 Mailbox 31 Data 2 Register */
1440#define CAN0_MB31_DATA3 0xffc02fec /* CAN Controller 0 Mailbox 31 Data 3 Register */
1441#define CAN0_MB31_LENGTH 0xffc02ff0 /* CAN Controller 0 Mailbox 31 Length Register */
1442#define CAN0_MB31_TIMESTAMP 0xffc02ff4 /* CAN Controller 0 Mailbox 31 Timestamp Register */
1443#define CAN0_MB31_ID0 0xffc02ff8 /* CAN Controller 0 Mailbox 31 ID0 Register */
1444#define CAN0_MB31_ID1 0xffc02ffc /* CAN Controller 0 Mailbox 31 ID1 Register */
1445
1446/* UART3 Registers */
1447
1448#define UART3_DLL 0xffc03100 /* Divisor Latch Low Byte */
1449#define UART3_DLH 0xffc03104 /* Divisor Latch High Byte */
1450#define UART3_GCTL 0xffc03108 /* Global Control Register */
1451#define UART3_LCR 0xffc0310c /* Line Control Register */
1452#define UART3_MCR 0xffc03110 /* Modem Control Register */
1453#define UART3_LSR 0xffc03114 /* Line Status Register */
1454#define UART3_MSR 0xffc03118 /* Modem Status Register */
1455#define UART3_SCR 0xffc0311c /* Scratch Register */
1456#define UART3_IER_SET 0xffc03120 /* Interrupt Enable Register Set */
1457#define UART3_IER_CLEAR 0xffc03124 /* Interrupt Enable Register Clear */
1458#define UART3_THR 0xffc03128 /* Transmit Hold Register */
1459#define UART3_RBR 0xffc0312c /* Receive Buffer Register */
1460
1461/* NFC Registers */
1462
1463#define NFC_CTL 0xffc03b00 /* NAND Control Register */
1464#define NFC_STAT 0xffc03b04 /* NAND Status Register */
1465#define NFC_IRQSTAT 0xffc03b08 /* NAND Interrupt Status Register */
1466#define NFC_IRQMASK 0xffc03b0c /* NAND Interrupt Mask Register */
1467#define NFC_ECC0 0xffc03b10 /* NAND ECC Register 0 */
1468#define NFC_ECC1 0xffc03b14 /* NAND ECC Register 1 */
1469#define NFC_ECC2 0xffc03b18 /* NAND ECC Register 2 */
1470#define NFC_ECC3 0xffc03b1c /* NAND ECC Register 3 */
1471#define NFC_COUNT 0xffc03b20 /* NAND ECC Count Register */
1472#define NFC_RST 0xffc03b24 /* NAND ECC Reset Register */
1473#define NFC_PGCTL 0xffc03b28 /* NAND Page Control Register */
1474#define NFC_READ 0xffc03b2c /* NAND Read Data Register */
1475#define NFC_ADDR 0xffc03b40 /* NAND Address Register */
1476#define NFC_CMD 0xffc03b44 /* NAND Command Register */
1477#define NFC_DATA_WR 0xffc03b48 /* NAND Data Write Register */
1478#define NFC_DATA_RD 0xffc03b4c /* NAND Data Read Register */
1479
1480/* Counter Registers */
1481
1482#define CNT_CONFIG 0xffc04200 /* Configuration Register */
1483#define CNT_IMASK 0xffc04204 /* Interrupt Mask Register */
1484#define CNT_STATUS 0xffc04208 /* Status Register */
1485#define CNT_COMMAND 0xffc0420c /* Command Register */
1486#define CNT_DEBOUNCE 0xffc04210 /* Debounce Register */
1487#define CNT_COUNTER 0xffc04214 /* Counter Register */
1488#define CNT_MAX 0xffc04218 /* Maximal Count Register */
1489#define CNT_MIN 0xffc0421c /* Minimal Count Register */
1490
1491/* OTP/FUSE Registers */
1492
1493#define OTP_CONTROL 0xffc04300 /* OTP/Fuse Control Register */
1494#define OTP_BEN 0xffc04304 /* OTP/Fuse Byte Enable */
1495#define OTP_STATUS 0xffc04308 /* OTP/Fuse Status */
1496#define OTP_TIMING 0xffc0430c /* OTP/Fuse Access Timing */
1497
1498/* Security Registers */
1499
1500#define SECURE_SYSSWT 0xffc04320 /* Secure System Switches */
1501#define SECURE_CONTROL 0xffc04324 /* Secure Control */
1502#define SECURE_STATUS 0xffc04328 /* Secure Status */
1503
1504/* DMA Peripheral Mux Register */
1505
1506#define DMAC1_PERIMUX 0xffc04340 /* DMA Controller 1 Peripheral Multiplexer Register */
1507
1508/* OTP Read/Write Data Buffer Registers */
1509
1510#define OTP_DATA0 0xffc04380 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1511#define OTP_DATA1 0xffc04384 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1512#define OTP_DATA2 0xffc04388 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1513#define OTP_DATA3 0xffc0438c /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1514
1515/* Handshake MDMA is not defined in the shared file because it is not available on the ADSP-BF542 processor */
1516
1517/* ********************************************************** */
1518/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
1519/* and MULTI BIT READ MACROS */
1520/* ********************************************************** */
1521
1522/* SIC_IMASK Masks */
1523#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
1524#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
1525#define SIC_MASK(x) (1 << (x)) /* Mask Peripheral #x interrupt */
1526#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << (x))) /* Unmask Peripheral #x interrupt */
1527
1528/* SIC_IWR Masks */
1529#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
1530#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
1531#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
1532#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
1533
1534/* Bit masks for SIC_IAR0 */
1535
1536#define PLL_WAKEUP 0x1 /* PLL Wakeup */
1537
1538/* Bit masks for SIC_IWR0, SIC_IMASK0, SIC_ISR0 */
1539
1540#define DMA0_ERR 0x2 /* DMA Controller 0 Error */
1541#define EPPI0_ERR 0x4 /* EPPI0 Error */
1542#define SPORT0_ERR 0x8 /* SPORT0 Error */
1543#define SPORT1_ERR 0x10 /* SPORT1 Error */
1544#define SPI0_ERR 0x20 /* SPI0 Error */
1545#define UART0_ERR 0x40 /* UART0 Error */
1546#define RTC 0x80 /* Real-Time Clock */
1547#define DMA12 0x100 /* DMA Channel 12 */
1548#define DMA0 0x200 /* DMA Channel 0 */
1549#define DMA1 0x400 /* DMA Channel 1 */
1550#define DMA2 0x800 /* DMA Channel 2 */
1551#define DMA3 0x1000 /* DMA Channel 3 */
1552#define DMA4 0x2000 /* DMA Channel 4 */
1553#define DMA6 0x4000 /* DMA Channel 6 */
1554#define DMA7 0x8000 /* DMA Channel 7 */
1555#define PINT0 0x80000 /* Pin Interrupt 0 */
1556#define PINT1 0x100000 /* Pin Interrupt 1 */
1557#define MDMA0 0x200000 /* Memory DMA Stream 0 */
1558#define MDMA1 0x400000 /* Memory DMA Stream 1 */
1559#define WDOG 0x800000 /* Watchdog Timer */
1560#define DMA1_ERR 0x1000000 /* DMA Controller 1 Error */
1561#define SPORT2_ERR 0x2000000 /* SPORT2 Error */
1562#define SPORT3_ERR 0x4000000 /* SPORT3 Error */
1563#define MXVR_SD 0x8000000 /* MXVR Synchronous Data */
1564#define SPI1_ERR 0x10000000 /* SPI1 Error */
1565#define SPI2_ERR 0x20000000 /* SPI2 Error */
1566#define UART1_ERR 0x40000000 /* UART1 Error */
1567#define UART2_ERR 0x80000000 /* UART2 Error */
1568
1569/* Bit masks for SIC_IWR1, SIC_IMASK1, SIC_ISR1 */
1570
1571#define CAN0_ERR 0x1 /* CAN0 Error */
1572#define DMA18 0x2 /* DMA Channel 18 */
1573#define DMA19 0x4 /* DMA Channel 19 */
1574#define DMA20 0x8 /* DMA Channel 20 */
1575#define DMA21 0x10 /* DMA Channel 21 */
1576#define DMA13 0x20 /* DMA Channel 13 */
1577#define DMA14 0x40 /* DMA Channel 14 */
1578#define DMA5 0x80 /* DMA Channel 5 */
1579#define DMA23 0x100 /* DMA Channel 23 */
1580#define DMA8 0x200 /* DMA Channel 8 */
1581#define DMA9 0x400 /* DMA Channel 9 */
1582#define DMA10 0x800 /* DMA Channel 10 */
1583#define DMA11 0x1000 /* DMA Channel 11 */
1584#define TWI0 0x2000 /* TWI0 */
1585#define TWI1 0x4000 /* TWI1 */
1586#define CAN0_RX 0x8000 /* CAN0 Receive */
1587#define CAN0_TX 0x10000 /* CAN0 Transmit */
1588#define MDMA2 0x20000 /* Memory DMA Stream 0 */
1589#define MDMA3 0x40000 /* Memory DMA Stream 1 */
1590#define MXVR_STAT 0x80000 /* MXVR Status */
1591#define MXVR_CM 0x100000 /* MXVR Control Message */
1592#define MXVR_AP 0x200000 /* MXVR Asynchronous Packet */
1593#define EPPI1_ERR 0x400000 /* EPPI1 Error */
1594#define EPPI2_ERR 0x800000 /* EPPI2 Error */
1595#define UART3_ERR 0x1000000 /* UART3 Error */
1596#define HOST_ERR 0x2000000 /* Host DMA Port Error */
1597#define USB_ERR 0x4000000 /* USB Error */
1598#define PIXC_ERR 0x8000000 /* Pixel Compositor Error */
1599#define NFC_ERR 0x10000000 /* Nand Flash Controller Error */
1600#define ATAPI_ERR 0x20000000 /* ATAPI Error */
1601#define CAN1_ERR 0x40000000 /* CAN1 Error */
1602#define DMAR0_ERR 0x80000000 /* DMAR0 Overflow Error */
1603#define DMAR1_ERR 0x80000000 /* DMAR1 Overflow Error */
1604#define DMAR0 0x80000000 /* DMAR0 Block */
1605#define DMAR1 0x80000000 /* DMAR1 Block */
1606
1607/* Bit masks for SIC_IWR2, SIC_IMASK2, SIC_ISR2 */
1608
1609#define DMA15 0x1 /* DMA Channel 15 */
1610#define DMA16 0x2 /* DMA Channel 16 */
1611#define DMA17 0x4 /* DMA Channel 17 */
1612#define DMA22 0x8 /* DMA Channel 22 */
1613#define CNT 0x10 /* Counter */
1614#define KEY 0x20 /* Keypad */
1615#define CAN1_RX 0x40 /* CAN1 Receive */
1616#define CAN1_TX 0x80 /* CAN1 Transmit */
1617#define SDH_INT_MASK0 0x100 /* SDH Mask 0 */
1618#define SDH_INT_MASK1 0x200 /* SDH Mask 1 */
1619#define USB_EINT 0x400 /* USB Exception */
1620#define USB_INT0 0x800 /* USB Interrupt 0 */
1621#define USB_INT1 0x1000 /* USB Interrupt 1 */
1622#define USB_INT2 0x2000 /* USB Interrupt 2 */
1623#define USB_DMAINT 0x4000 /* USB DMA */
1624#define OTPSEC 0x8000 /* OTP Access Complete */
1625#define TIMER0 0x400000 /* Timer 0 */
1626#define TIMER1 0x800000 /* Timer 1 */
1627#define TIMER2 0x1000000 /* Timer 2 */
1628#define TIMER3 0x2000000 /* Timer 3 */
1629#define TIMER4 0x4000000 /* Timer 4 */
1630#define TIMER5 0x8000000 /* Timer 5 */
1631#define TIMER6 0x10000000 /* Timer 6 */
1632#define TIMER7 0x20000000 /* Timer 7 */
1633#define PINT2 0x40000000 /* Pin Interrupt 2 */
1634#define PINT3 0x80000000 /* Pin Interrupt 3 */
1635
1636/* Bit masks for DMAx_CONFIG, MDMA_Sx_CONFIG, MDMA_Dx_CONFIG */
1637
1638#define DMAEN 0x1 /* DMA Channel Enable */
1639#define WNR 0x2 /* DMA Direction */
1640#define WDSIZE_8 0x0 /* Transfer Word Size = 8 */
1641#define WDSIZE_16 0x4 /* Transfer Word Size = 16 */
1642#define WDSIZE_32 0x8 /* Transfer Word Size = 32 */
1643#define DMA2D 0x10 /* DMA Mode */
1644#define RESTART 0x20 /* Work Unit Transitions */
1645#define DI_SEL 0x40 /* Data Interrupt Timing Select */
1646#define DI_EN 0x80 /* Data Interrupt Enable */
1647
1648#define NDSIZE 0xf00 /* Flex Descriptor Size */
1649#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1650#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1651#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1652#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1653#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1654#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1655#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1656#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1657#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1658#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1659
1660#define DMAFLOW 0xf000 /* Next Operation */
1661#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1662#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1663#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1664#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1665#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1666
1667/* Bit masks for DMAx_IRQ_STATUS, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */
1668
1669#define DMA_DONE 0x1 /* DMA Completion Interrupt Status */
1670#define DMA_ERR 0x2 /* DMA Error Interrupt Status */
1671#define DFETCH 0x4 /* DMA Descriptor Fetch */
1672#define DMA_RUN 0x8 /* DMA Channel Running */
1673
1674/* Bit masks for DMAx_PERIPHERAL_MAP, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */
1675
1676#define CTYPE 0x40 /* DMA Channel Type */
1677#define PMAP 0xf000 /* Peripheral Mapped To This Channel */
1678
1679/* Bit masks for DMACx_TCPER */
1680
1681#define DCB_TRAFFIC_PERIOD 0xf /* DCB Traffic Control Period */
1682#define DEB_TRAFFIC_PERIOD 0xf0 /* DEB Traffic Control Period */
1683#define DAB_TRAFFIC_PERIOD 0x700 /* DAB Traffic Control Period */
1684#define MDMA_ROUND_ROBIN_PERIOD 0xf800 /* MDMA Round Robin Period */
1685
1686/* Bit masks for DMACx_TCCNT */
1687
1688#define DCB_TRAFFIC_COUNT 0xf /* DCB Traffic Control Count */
1689#define DEB_TRAFFIC_COUNT 0xf0 /* DEB Traffic Control Count */
1690#define DAB_TRAFFIC_COUNT 0x700 /* DAB Traffic Control Count */
1691#define MDMA_ROUND_ROBIN_COUNT 0xf800 /* MDMA Round Robin Count */
1692
1693/* Bit masks for DMAC1_PERIMUX */
1694
1695#define PMUXSDH 0x1 /* Peripheral Select for DMA22 channel */
1696
1697/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS *************************/
1698/* EBIU_AMGCTL Masks */
1699#define AMCKEN 0x0001 /* Enable CLKOUT */
1700#define AMBEN_NONE 0x0000 /* All Banks Disabled */
1701#define AMBEN_B0 0x0002 /* Enable Async Memory Bank 0 only */
1702#define AMBEN_B0_B1 0x0004 /* Enable Async Memory Banks 0 & 1 only */
1703#define AMBEN_B0_B1_B2 0x0006 /* Enable Async Memory Banks 0, 1, and 2 */
1704#define AMBEN_ALL 0x0008 /* Enable Async Memory Banks (all) 0, 1, 2, and 3 */
1705
1706
1707/* Bit masks for EBIU_AMBCTL0 */
1708
1709#define B0RDYEN 0x1 /* Bank 0 ARDY Enable */
1710#define B0RDYPOL 0x2 /* Bank 0 ARDY Polarity */
1711#define B0TT 0xc /* Bank 0 transition time */
1712#define B0ST 0x30 /* Bank 0 Setup time */
1713#define B0HT 0xc0 /* Bank 0 Hold time */
1714#define B0RAT 0xf00 /* Bank 0 Read access time */
1715#define B0WAT 0xf000 /* Bank 0 write access time */
1716#define B1RDYEN 0x10000 /* Bank 1 ARDY Enable */
1717#define B1RDYPOL 0x20000 /* Bank 1 ARDY Polarity */
1718#define B1TT 0xc0000 /* Bank 1 transition time */
1719#define B1ST 0x300000 /* Bank 1 Setup time */
1720#define B1HT 0xc00000 /* Bank 1 Hold time */
1721#define B1RAT 0xf000000 /* Bank 1 Read access time */
1722#define B1WAT 0xf0000000 /* Bank 1 write access time */
1723
1724/* Bit masks for EBIU_AMBCTL1 */
1725
1726#define B2RDYEN 0x1 /* Bank 2 ARDY Enable */
1727#define B2RDYPOL 0x2 /* Bank 2 ARDY Polarity */
1728#define B2TT 0xc /* Bank 2 transition time */
1729#define B2ST 0x30 /* Bank 2 Setup time */
1730#define B2HT 0xc0 /* Bank 2 Hold time */
1731#define B2RAT 0xf00 /* Bank 2 Read access time */
1732#define B2WAT 0xf000 /* Bank 2 write access time */
1733#define B3RDYEN 0x10000 /* Bank 3 ARDY Enable */
1734#define B3RDYPOL 0x20000 /* Bank 3 ARDY Polarity */
1735#define B3TT 0xc0000 /* Bank 3 transition time */
1736#define B3ST 0x300000 /* Bank 3 Setup time */
1737#define B3HT 0xc00000 /* Bank 3 Hold time */
1738#define B3RAT 0xf000000 /* Bank 3 Read access time */
1739#define B3WAT 0xf0000000 /* Bank 3 write access time */
1740
1741/* Bit masks for EBIU_MBSCTL */
1742
1743#define AMSB0CTL 0x3 /* Async Memory Bank 0 select */
1744#define AMSB1CTL 0xc /* Async Memory Bank 1 select */
1745#define AMSB2CTL 0x30 /* Async Memory Bank 2 select */
1746#define AMSB3CTL 0xc0 /* Async Memory Bank 3 select */
1747
1748/* Bit masks for EBIU_MODE */
1749
1750#define B0MODE 0x3 /* Async Memory Bank 0 Access Mode */
1751#define B1MODE 0xc /* Async Memory Bank 1 Access Mode */
1752#define B2MODE 0x30 /* Async Memory Bank 2 Access Mode */
1753#define B3MODE 0xc0 /* Async Memory Bank 3 Access Mode */
1754
1755/* Bit masks for EBIU_FCTL */
1756
1757#define TESTSETLOCK 0x1 /* Test set lock */
1758#define BCLK 0x6 /* Burst clock frequency */
1759#define PGWS 0x38 /* Page wait states */
1760#define PGSZ 0x40 /* Page size */
1761#define RDDL 0x380 /* Read data delay */
1762
1763/* Bit masks for EBIU_ARBSTAT */
1764
1765#define ARBSTAT 0x1 /* Arbitration status */
1766#define BGSTAT 0x2 /* Bus grant status */
1767
1768/* Bit masks for EBIU_DDRCTL0 */
1769
1770#define TREFI 0x3fff /* Refresh Interval */
1771#define TRFC 0x3c000 /* Auto-refresh command period */
1772#define TRP 0x3c0000 /* Pre charge-to-active command period */
1773#define TRAS 0x3c00000 /* Min Active-to-pre charge time */
1774#define TRC 0x3c000000 /* Active-to-active time */
1775#define DDR_TRAS(x) ((x<<22)&TRAS) /* DDR tRAS = (1~15) cycles */
1776#define DDR_TRP(x) ((x<<18)&TRP) /* DDR tRP = (1~15) cycles */
1777#define DDR_TRC(x) ((x<<26)&TRC) /* DDR tRC = (1~15) cycles */
1778#define DDR_TRFC(x) ((x<<14)&TRFC) /* DDR tRFC = (1~15) cycles */
1779#define DDR_TREFI(x) (x&TREFI) /* DDR tRFC = (1~15) cycles */
1780
1781/* Bit masks for EBIU_DDRCTL1 */
1782
1783#define TRCD 0xf /* Active-to-Read/write delay */
1784#define TMRD 0xf0 /* Mode register set to active */
1785#define TWR 0x300 /* Write Recovery time */
1786#define DDRDATWIDTH 0x3000 /* DDR data width */
1787#define EXTBANKS 0xc000 /* External banks */
1788#define DDRDEVWIDTH 0x30000 /* DDR device width */
1789#define DDRDEVSIZE 0xc0000 /* DDR device size */
1790#define TWTR 0xf0000000 /* Write-to-read delay */
1791#define DDR_TWTR(x) ((x<<28)&TWTR) /* DDR tWTR = (1~15) cycles */
1792#define DDR_TMRD(x) ((x<<4)&TMRD) /* DDR tMRD = (1~15) cycles */
1793#define DDR_TWR(x) ((x<<8)&TWR) /* DDR tWR = (1~15) cycles */
1794#define DDR_TRCD(x) (x&TRCD) /* DDR tRCD = (1~15) cycles */
1795#define DDR_DATWIDTH 0x2000 /* DDR data width */
1796#define EXTBANK_1 0 /* 1 external bank */
1797#define EXTBANK_2 0x4000 /* 2 external banks */
1798#define DEVSZ_64 0x40000 /* DDR External Bank Size = 64MB */
1799#define DEVSZ_128 0x80000 /* DDR External Bank Size = 128MB */
1800#define DEVSZ_256 0xc0000 /* DDR External Bank Size = 256MB */
1801#define DEVSZ_512 0 /* DDR External Bank Size = 512MB */
1802#define DEVWD_4 0 /* DDR Device Width = 4 Bits */
1803#define DEVWD_8 0x10000 /* DDR Device Width = 8 Bits */
1804#define DEVWD_16 0x20000 /* DDR Device Width = 16 Bits */
1805
1806/* Bit masks for EBIU_DDRCTL2 */
1807
1808#define BURSTLENGTH 0x7 /* Burst length */
1809#define CASLATENCY 0x70 /* CAS latency */
1810#define DLLRESET 0x100 /* DLL Reset */
1811#define REGE 0x1000 /* Register mode enable */
1812#define CL_1_5 0x50 /* DDR CAS Latency = 1.5 cycles */
1813#define CL_2 0x20 /* DDR CAS Latency = 2 cycles */
1814#define CL_2_5 0x60 /* DDR CAS Latency = 2.5 cycles */
1815#define CL_3 0x30 /* DDR CAS Latency = 3 cycles */
1816
1817/* Bit masks for EBIU_DDRCTL3 */
1818
1819#define PASR 0x7 /* Partial array self-refresh */
1820
1821/* Bit masks for EBIU_DDRQUE */
1822
1823#define DEB1_PFLEN 0x3 /* Pre fetch length for DEB1 accesses */
1824#define DEB2_PFLEN 0xc /* Pre fetch length for DEB2 accesses */
1825#define DEB3_PFLEN 0x30 /* Pre fetch length for DEB3 accesses */
1826#define DEB_ARB_PRIORITY 0x700 /* Arbitration between DEB busses */
1827#define DEB1_URGENT 0x1000 /* DEB1 Urgent */
1828#define DEB2_URGENT 0x2000 /* DEB2 Urgent */
1829#define DEB3_URGENT 0x4000 /* DEB3 Urgent */
1830
1831/* Bit masks for EBIU_ERRMST */
1832
1833#define DEB1_ERROR 0x1 /* DEB1 Error */
1834#define DEB2_ERROR 0x2 /* DEB2 Error */
1835#define DEB3_ERROR 0x4 /* DEB3 Error */
1836#define CORE_ERROR 0x8 /* Core error */
1837#define DEB_MERROR 0x10 /* DEB1 Error (2nd) */
1838#define DEB2_MERROR 0x20 /* DEB2 Error (2nd) */
1839#define DEB3_MERROR 0x40 /* DEB3 Error (2nd) */
1840#define CORE_MERROR 0x80 /* Core Error (2nd) */
1841
1842/* Bit masks for EBIU_ERRADD */
1843
1844#define ERROR_ADDRESS 0xffffffff /* Error Address */
1845
1846/* Bit masks for EBIU_RSTCTL */
1847
1848#define DDRSRESET 0x1 /* DDR soft reset */
1849#define PFTCHSRESET 0x4 /* DDR prefetch reset */
1850#define SRREQ 0x8 /* Self-refresh request */
1851#define SRACK 0x10 /* Self-refresh acknowledge */
1852#define MDDRENABLE 0x20 /* Mobile DDR enable */
1853
1854/* Bit masks for EBIU_DDRBRC0 */
1855
1856#define BRC0 0xffffffff /* Count */
1857
1858/* Bit masks for EBIU_DDRBRC1 */
1859
1860#define BRC1 0xffffffff /* Count */
1861
1862/* Bit masks for EBIU_DDRBRC2 */
1863
1864#define BRC2 0xffffffff /* Count */
1865
1866/* Bit masks for EBIU_DDRBRC3 */
1867
1868#define BRC3 0xffffffff /* Count */
1869
1870/* Bit masks for EBIU_DDRBRC4 */
1871
1872#define BRC4 0xffffffff /* Count */
1873
1874/* Bit masks for EBIU_DDRBRC5 */
1875
1876#define BRC5 0xffffffff /* Count */
1877
1878/* Bit masks for EBIU_DDRBRC6 */
1879
1880#define BRC6 0xffffffff /* Count */
1881
1882/* Bit masks for EBIU_DDRBRC7 */
1883
1884#define BRC7 0xffffffff /* Count */
1885
1886/* Bit masks for EBIU_DDRBWC0 */
1887
1888#define BWC0 0xffffffff /* Count */
1889
1890/* Bit masks for EBIU_DDRBWC1 */
1891
1892#define BWC1 0xffffffff /* Count */
1893
1894/* Bit masks for EBIU_DDRBWC2 */
1895
1896#define BWC2 0xffffffff /* Count */
1897
1898/* Bit masks for EBIU_DDRBWC3 */
1899
1900#define BWC3 0xffffffff /* Count */
1901
1902/* Bit masks for EBIU_DDRBWC4 */
1903
1904#define BWC4 0xffffffff /* Count */
1905
1906/* Bit masks for EBIU_DDRBWC5 */
1907
1908#define BWC5 0xffffffff /* Count */
1909
1910/* Bit masks for EBIU_DDRBWC6 */
1911
1912#define BWC6 0xffffffff /* Count */
1913
1914/* Bit masks for EBIU_DDRBWC7 */
1915
1916#define BWC7 0xffffffff /* Count */
1917
1918/* Bit masks for EBIU_DDRACCT */
1919
1920#define ACCT 0xffffffff /* Count */
1921
1922/* Bit masks for EBIU_DDRTACT */
1923
1924#define TECT 0xffffffff /* Count */
1925
1926/* Bit masks for EBIU_DDRARCT */
1927
1928#define ARCT 0xffffffff /* Count */
1929
1930/* Bit masks for EBIU_DDRGC0 */
1931
1932#define GC0 0xffffffff /* Count */
1933
1934/* Bit masks for EBIU_DDRGC1 */
1935
1936#define GC1 0xffffffff /* Count */
1937
1938/* Bit masks for EBIU_DDRGC2 */
1939
1940#define GC2 0xffffffff /* Count */
1941
1942/* Bit masks for EBIU_DDRGC3 */
1943
1944#define GC3 0xffffffff /* Count */
1945
1946/* Bit masks for EBIU_DDRMCEN */
1947
1948#define B0WCENABLE 0x1 /* Bank 0 write count enable */
1949#define B1WCENABLE 0x2 /* Bank 1 write count enable */
1950#define B2WCENABLE 0x4 /* Bank 2 write count enable */
1951#define B3WCENABLE 0x8 /* Bank 3 write count enable */
1952#define B4WCENABLE 0x10 /* Bank 4 write count enable */
1953#define B5WCENABLE 0x20 /* Bank 5 write count enable */
1954#define B6WCENABLE 0x40 /* Bank 6 write count enable */
1955#define B7WCENABLE 0x80 /* Bank 7 write count enable */
1956#define B0RCENABLE 0x100 /* Bank 0 read count enable */
1957#define B1RCENABLE 0x200 /* Bank 1 read count enable */
1958#define B2RCENABLE 0x400 /* Bank 2 read count enable */
1959#define B3RCENABLE 0x800 /* Bank 3 read count enable */
1960#define B4RCENABLE 0x1000 /* Bank 4 read count enable */
1961#define B5RCENABLE 0x2000 /* Bank 5 read count enable */
1962#define B6RCENABLE 0x4000 /* Bank 6 read count enable */
1963#define B7RCENABLE 0x8000 /* Bank 7 read count enable */
1964#define ROWACTCENABLE 0x10000 /* DDR Row activate count enable */
1965#define RWTCENABLE 0x20000 /* DDR R/W Turn around count enable */
1966#define ARCENABLE 0x40000 /* DDR Auto-refresh count enable */
1967#define GC0ENABLE 0x100000 /* DDR Grant count 0 enable */
1968#define GC1ENABLE 0x200000 /* DDR Grant count 1 enable */
1969#define GC2ENABLE 0x400000 /* DDR Grant count 2 enable */
1970#define GC3ENABLE 0x800000 /* DDR Grant count 3 enable */
1971#define GCCONTROL 0x3000000 /* DDR Grant Count Control */
1972
1973/* Bit masks for EBIU_DDRMCCL */
1974
1975#define CB0WCOUNT 0x1 /* Clear write count 0 */
1976#define CB1WCOUNT 0x2 /* Clear write count 1 */
1977#define CB2WCOUNT 0x4 /* Clear write count 2 */
1978#define CB3WCOUNT 0x8 /* Clear write count 3 */
1979#define CB4WCOUNT 0x10 /* Clear write count 4 */
1980#define CB5WCOUNT 0x20 /* Clear write count 5 */
1981#define CB6WCOUNT 0x40 /* Clear write count 6 */
1982#define CB7WCOUNT 0x80 /* Clear write count 7 */
1983#define CBRCOUNT 0x100 /* Clear read count 0 */
1984#define CB1RCOUNT 0x200 /* Clear read count 1 */
1985#define CB2RCOUNT 0x400 /* Clear read count 2 */
1986#define CB3RCOUNT 0x800 /* Clear read count 3 */
1987#define CB4RCOUNT 0x1000 /* Clear read count 4 */
1988#define CB5RCOUNT 0x2000 /* Clear read count 5 */
1989#define CB6RCOUNT 0x4000 /* Clear read count 6 */
1990#define CB7RCOUNT 0x8000 /* Clear read count 7 */
1991#define CRACOUNT 0x10000 /* Clear row activation count */
1992#define CRWTACOUNT 0x20000 /* Clear R/W turn-around count */
1993#define CARCOUNT 0x40000 /* Clear auto-refresh count */
1994#define CG0COUNT 0x100000 /* Clear grant count 0 */
1995#define CG1COUNT 0x200000 /* Clear grant count 1 */
1996#define CG2COUNT 0x400000 /* Clear grant count 2 */
1997#define CG3COUNT 0x800000 /* Clear grant count 3 */
1998
1999/* Bit masks for (PORTx is PORTA - PORTJ) includes PORTx_FER, PORTx_SET, PORTx_CLEAR, PORTx_DIR_SET, PORTx_DIR_CLEAR, PORTx_INEN */
2000
2001#define Px0 0x1 /* GPIO 0 */
2002#define Px1 0x2 /* GPIO 1 */
2003#define Px2 0x4 /* GPIO 2 */
2004#define Px3 0x8 /* GPIO 3 */
2005#define Px4 0x10 /* GPIO 4 */
2006#define Px5 0x20 /* GPIO 5 */
2007#define Px6 0x40 /* GPIO 6 */
2008#define Px7 0x80 /* GPIO 7 */
2009#define Px8 0x100 /* GPIO 8 */
2010#define Px9 0x200 /* GPIO 9 */
2011#define Px10 0x400 /* GPIO 10 */
2012#define Px11 0x800 /* GPIO 11 */
2013#define Px12 0x1000 /* GPIO 12 */
2014#define Px13 0x2000 /* GPIO 13 */
2015#define Px14 0x4000 /* GPIO 14 */
2016#define Px15 0x8000 /* GPIO 15 */
2017
2018/* Bit masks for PORTA_MUX - PORTJ_MUX */
2019
2020#define PxM0 0x3 /* GPIO Mux 0 */
2021#define PxM1 0xc /* GPIO Mux 1 */
2022#define PxM2 0x30 /* GPIO Mux 2 */
2023#define PxM3 0xc0 /* GPIO Mux 3 */
2024#define PxM4 0x300 /* GPIO Mux 4 */
2025#define PxM5 0xc00 /* GPIO Mux 5 */
2026#define PxM6 0x3000 /* GPIO Mux 6 */
2027#define PxM7 0xc000 /* GPIO Mux 7 */
2028#define PxM8 0x30000 /* GPIO Mux 8 */
2029#define PxM9 0xc0000 /* GPIO Mux 9 */
2030#define PxM10 0x300000 /* GPIO Mux 10 */
2031#define PxM11 0xc00000 /* GPIO Mux 11 */
2032#define PxM12 0x3000000 /* GPIO Mux 12 */
2033#define PxM13 0xc000000 /* GPIO Mux 13 */
2034#define PxM14 0x30000000 /* GPIO Mux 14 */
2035#define PxM15 0xc0000000 /* GPIO Mux 15 */
2036
2037
2038/* Bit masks for PINTx_MASK_SET/CLEAR, PINTx_REQUEST, PINTx_LATCH, PINTx_EDGE_SET/CLEAR, PINTx_INVERT_SET/CLEAR, PINTx_PINTSTATE */
2039
2040#define IB0 0x1 /* Interrupt Bit 0 */
2041#define IB1 0x2 /* Interrupt Bit 1 */
2042#define IB2 0x4 /* Interrupt Bit 2 */
2043#define IB3 0x8 /* Interrupt Bit 3 */
2044#define IB4 0x10 /* Interrupt Bit 4 */
2045#define IB5 0x20 /* Interrupt Bit 5 */
2046#define IB6 0x40 /* Interrupt Bit 6 */
2047#define IB7 0x80 /* Interrupt Bit 7 */
2048#define IB8 0x100 /* Interrupt Bit 8 */
2049#define IB9 0x200 /* Interrupt Bit 9 */
2050#define IB10 0x400 /* Interrupt Bit 10 */
2051#define IB11 0x800 /* Interrupt Bit 11 */
2052#define IB12 0x1000 /* Interrupt Bit 12 */
2053#define IB13 0x2000 /* Interrupt Bit 13 */
2054#define IB14 0x4000 /* Interrupt Bit 14 */
2055#define IB15 0x8000 /* Interrupt Bit 15 */
2056
2057/* Bit masks for TIMERx_CONFIG */
2058
2059#define TMODE 0x3 /* Timer Mode */
2060#define PULSE_HI 0x4 /* Pulse Polarity */
2061#define PERIOD_CNT 0x8 /* Period Count */
2062#define IRQ_ENA 0x10 /* Interrupt Request Enable */
2063#define TIN_SEL 0x20 /* Timer Input Select */
2064#define OUT_DIS 0x40 /* Output Pad Disable */
2065#define CLK_SEL 0x80 /* Timer Clock Select */
2066#define TOGGLE_HI 0x100 /* Toggle Mode */
2067#define EMU_RUN 0x200 /* Emulation Behavior Select */
2068#define ERR_TYP 0xc000 /* Error Type */
2069
2070/* Bit masks for TIMER_ENABLE0 */
2071
2072#define TIMEN0 0x1 /* Timer 0 Enable */
2073#define TIMEN1 0x2 /* Timer 1 Enable */
2074#define TIMEN2 0x4 /* Timer 2 Enable */
2075#define TIMEN3 0x8 /* Timer 3 Enable */
2076#define TIMEN4 0x10 /* Timer 4 Enable */
2077#define TIMEN5 0x20 /* Timer 5 Enable */
2078#define TIMEN6 0x40 /* Timer 6 Enable */
2079#define TIMEN7 0x80 /* Timer 7 Enable */
2080
2081/* Bit masks for TIMER_DISABLE0 */
2082
2083#define TIMDIS0 0x1 /* Timer 0 Disable */
2084#define TIMDIS1 0x2 /* Timer 1 Disable */
2085#define TIMDIS2 0x4 /* Timer 2 Disable */
2086#define TIMDIS3 0x8 /* Timer 3 Disable */
2087#define TIMDIS4 0x10 /* Timer 4 Disable */
2088#define TIMDIS5 0x20 /* Timer 5 Disable */
2089#define TIMDIS6 0x40 /* Timer 6 Disable */
2090#define TIMDIS7 0x80 /* Timer 7 Disable */
2091
2092/* Bit masks for TIMER_STATUS0 */
2093
2094#define TIMIL0 0x1 /* Timer 0 Interrupt */
2095#define TIMIL1 0x2 /* Timer 1 Interrupt */
2096#define TIMIL2 0x4 /* Timer 2 Interrupt */
2097#define TIMIL3 0x8 /* Timer 3 Interrupt */
2098#define TOVF_ERR0 0x10 /* Timer 0 Counter Overflow */
2099#define TOVF_ERR1 0x20 /* Timer 1 Counter Overflow */
2100#define TOVF_ERR2 0x40 /* Timer 2 Counter Overflow */
2101#define TOVF_ERR3 0x80 /* Timer 3 Counter Overflow */
2102#define TRUN0 0x1000 /* Timer 0 Slave Enable Status */
2103#define TRUN1 0x2000 /* Timer 1 Slave Enable Status */
2104#define TRUN2 0x4000 /* Timer 2 Slave Enable Status */
2105#define TRUN3 0x8000 /* Timer 3 Slave Enable Status */
2106#define TIMIL4 0x10000 /* Timer 4 Interrupt */
2107#define TIMIL5 0x20000 /* Timer 5 Interrupt */
2108#define TIMIL6 0x40000 /* Timer 6 Interrupt */
2109#define TIMIL7 0x80000 /* Timer 7 Interrupt */
2110#define TOVF_ERR4 0x100000 /* Timer 4 Counter Overflow */
2111#define TOVF_ERR5 0x200000 /* Timer 5 Counter Overflow */
2112#define TOVF_ERR6 0x400000 /* Timer 6 Counter Overflow */
2113#define TOVF_ERR7 0x800000 /* Timer 7 Counter Overflow */
2114#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
2115#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
2116#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
2117#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
2118
2119/* Bit masks for WDOG_CTL */
2120
2121#define WDEV 0x6 /* Watchdog Event */
2122#define WDEN 0xff0 /* Watchdog Enable */
2123#define WDRO 0x8000 /* Watchdog Rolled Over */
2124
2125/* Bit masks for CNT_CONFIG */
2126
2127#define CNTE 0x1 /* Counter Enable */
2128#define DEBE 0x2 /* Debounce Enable */
2129#define CDGINV 0x10 /* CDG Pin Polarity Invert */
2130#define CUDINV 0x20 /* CUD Pin Polarity Invert */
2131#define CZMINV 0x40 /* CZM Pin Polarity Invert */
2132#define CNTMODE 0x700 /* Counter Operating Mode */
2133#define ZMZC 0x800 /* CZM Zeroes Counter Enable */
2134#define BNDMODE 0x3000 /* Boundary register Mode */
2135#define INPDIS 0x8000 /* CUG and CDG Input Disable */
2136
2137/* Bit masks for CNT_IMASK */
2138
2139#define ICIE 0x1 /* Illegal Gray/Binary Code Interrupt Enable */
2140#define UCIE 0x2 /* Up count Interrupt Enable */
2141#define DCIE 0x4 /* Down count Interrupt Enable */
2142#define MINCIE 0x8 /* Min Count Interrupt Enable */
2143#define MAXCIE 0x10 /* Max Count Interrupt Enable */
2144#define COV31IE 0x20 /* Bit 31 Overflow Interrupt Enable */
2145#define COV15IE 0x40 /* Bit 15 Overflow Interrupt Enable */
2146#define CZEROIE 0x80 /* Count to Zero Interrupt Enable */
2147#define CZMIE 0x100 /* CZM Pin Interrupt Enable */
2148#define CZMEIE 0x200 /* CZM Error Interrupt Enable */
2149#define CZMZIE 0x400 /* CZM Zeroes Counter Interrupt Enable */
2150
2151/* Bit masks for CNT_STATUS */
2152
2153#define ICII 0x1 /* Illegal Gray/Binary Code Interrupt Identifier */
2154#define UCII 0x2 /* Up count Interrupt Identifier */
2155#define DCII 0x4 /* Down count Interrupt Identifier */
2156#define MINCII 0x8 /* Min Count Interrupt Identifier */
2157#define MAXCII 0x10 /* Max Count Interrupt Identifier */
2158#define COV31II 0x20 /* Bit 31 Overflow Interrupt Identifier */
2159#define COV15II 0x40 /* Bit 15 Overflow Interrupt Identifier */
2160#define CZEROII 0x80 /* Count to Zero Interrupt Identifier */
2161#define CZMII 0x100 /* CZM Pin Interrupt Identifier */
2162#define CZMEII 0x200 /* CZM Error Interrupt Identifier */
2163#define CZMZII 0x400 /* CZM Zeroes Counter Interrupt Identifier */
2164
2165/* Bit masks for CNT_COMMAND */
2166
2167#define W1LCNT 0xf /* Load Counter Register */
2168#define W1LMIN 0xf0 /* Load Min Register */
2169#define W1LMAX 0xf00 /* Load Max Register */
2170#define W1ZMONCE 0x1000 /* Enable CZM Clear Counter Once */
2171
2172/* Bit masks for CNT_DEBOUNCE */
2173
2174#define DPRESCALE 0xf /* Load Counter Register */
2175
2176/* Bit masks for RTC_STAT */
2177
2178#define SECONDS 0x3f /* Seconds */
2179#define MINUTES 0xfc0 /* Minutes */
2180#define HOURS 0x1f000 /* Hours */
2181#define DAY_COUNTER 0xfffe0000 /* Day Counter */
2182
2183/* Bit masks for RTC_ICTL */
2184
2185#define STOPWATCH_INTERRUPT_ENABLE 0x1 /* Stopwatch Interrupt Enable */
2186#define ALARM_INTERRUPT_ENABLE 0x2 /* Alarm Interrupt Enable */
2187#define SECONDS_INTERRUPT_ENABLE 0x4 /* Seconds Interrupt Enable */
2188#define MINUTES_INTERRUPT_ENABLE 0x8 /* Minutes Interrupt Enable */
2189#define HOURS_INTERRUPT_ENABLE 0x10 /* Hours Interrupt Enable */
2190#define TWENTY_FOUR_HOURS_INTERRUPT_ENABLE 0x20 /* 24 Hours Interrupt Enable */
2191#define DAY_ALARM_INTERRUPT_ENABLE 0x40 /* Day Alarm Interrupt Enable */
2192#define WRITE_COMPLETE_INTERRUPT_ENABLE 0x8000 /* Write Complete Interrupt Enable */
2193
2194/* Bit masks for RTC_ISTAT */
2195
2196#define STOPWATCH_EVENT_FLAG 0x1 /* Stopwatch Event Flag */
2197#define ALARM_EVENT_FLAG 0x2 /* Alarm Event Flag */
2198#define SECONDS_EVENT_FLAG 0x4 /* Seconds Event Flag */
2199#define MINUTES_EVENT_FLAG 0x8 /* Minutes Event Flag */
2200#define HOURS_EVENT_FLAG 0x10 /* Hours Event Flag */
2201#define TWENTY_FOUR_HOURS_EVENT_FLAG 0x20 /* 24 Hours Event Flag */
2202#define DAY_ALARM_EVENT_FLAG 0x40 /* Day Alarm Event Flag */
2203#define WRITE_PENDING__STATUS 0x4000 /* Write Pending Status */
2204#define WRITE_COMPLETE 0x8000 /* Write Complete */
2205
2206/* Bit masks for RTC_SWCNT */
2207
2208#define STOPWATCH_COUNT 0xffff /* Stopwatch Count */
2209
2210/* Bit masks for RTC_ALARM */
2211
2212#define SECONDS 0x3f /* Seconds */
2213#define MINUTES 0xfc0 /* Minutes */
2214#define HOURS 0x1f000 /* Hours */
2215#define DAY 0xfffe0000 /* Day */
2216
2217/* Bit masks for RTC_PREN */
2218
2219#define PREN 0x1 /* Prescaler Enable */
2220
2221/* Bit masks for OTP_CONTROL */
2222
2223#define FUSE_FADDR 0x1ff /* OTP/Fuse Address */
2224#define FIEN 0x800 /* OTP/Fuse Interrupt Enable */
2225#define FTESTDEC 0x1000 /* OTP/Fuse Test Decoder */
2226#define FWRTEST 0x2000 /* OTP/Fuse Write Test */
2227#define FRDEN 0x4000 /* OTP/Fuse Read Enable */
2228#define FWREN 0x8000 /* OTP/Fuse Write Enable */
2229
2230/* Bit masks for OTP_BEN */
2231
2232#define FBEN 0xffff /* OTP/Fuse Byte Enable */
2233
2234/* Bit masks for OTP_STATUS */
2235
2236#define FCOMP 0x1 /* OTP/Fuse Access Complete */
2237#define FERROR 0x2 /* OTP/Fuse Access Error */
2238#define MMRGLOAD 0x10 /* Memory Mapped Register Gasket Load */
2239#define MMRGLOCK 0x20 /* Memory Mapped Register Gasket Lock */
2240#define FPGMEN 0x40 /* OTP/Fuse Program Enable */
2241
2242/* Bit masks for OTP_TIMING */
2243
2244#define USECDIV 0xff /* Micro Second Divider */
2245#define READACC 0x7f00 /* Read Access Time */
2246#define CPUMPRL 0x38000 /* Charge Pump Release Time */
2247#define CPUMPSU 0xc0000 /* Charge Pump Setup Time */
2248#define CPUMPHD 0xf00000 /* Charge Pump Hold Time */
2249#define PGMTIME 0xff000000 /* Program Time */
2250
2251/* Bit masks for SECURE_SYSSWT */
2252
2253#define EMUDABL 0x1 /* Emulation Disable. */
2254#define RSTDABL 0x2 /* Reset Disable */
2255#define L1IDABL 0x1c /* L1 Instruction Memory Disable. */
2256#define L1DADABL 0xe0 /* L1 Data Bank A Memory Disable. */
2257#define L1DBDABL 0x700 /* L1 Data Bank B Memory Disable. */
2258#define DMA0OVR 0x800 /* DMA0 Memory Access Override */
2259#define DMA1OVR 0x1000 /* DMA1 Memory Access Override */
2260#define EMUOVR 0x4000 /* Emulation Override */
2261#define OTPSEN 0x8000 /* OTP Secrets Enable. */
2262#define L2DABL 0x70000 /* L2 Memory Disable. */
2263
2264/* Bit masks for SECURE_CONTROL */
2265
2266#define SECURE0 0x1 /* SECURE 0 */
2267#define SECURE1 0x2 /* SECURE 1 */
2268#define SECURE2 0x4 /* SECURE 2 */
2269#define SECURE3 0x8 /* SECURE 3 */
2270
2271/* Bit masks for SECURE_STATUS */
2272
2273#define SECMODE 0x3 /* Secured Mode Control State */
2274#define NMI 0x4 /* Non Maskable Interrupt */
2275#define AFVALID 0x8 /* Authentication Firmware Valid */
2276#define AFEXIT 0x10 /* Authentication Firmware Exit */
2277#define SECSTAT 0xe0 /* Secure Status */
2278
2279/* Bit masks for PLL_DIV */
2280
2281#define CSEL 0x30 /* Core Select */
2282#define SSEL 0xf /* System Select */
2283#define CSEL_DIV1 0x0000 /* CCLK = VCO / 1 */
2284#define CSEL_DIV2 0x0010 /* CCLK = VCO / 2 */
2285#define CSEL_DIV4 0x0020 /* CCLK = VCO / 4 */
2286#define CSEL_DIV8 0x0030 /* CCLK = VCO / 8 */
2287
2288/* Bit masks for PLL_CTL */
2289
2290#define MSEL 0x7e00 /* Multiplier Select */
2291#define BYPASS 0x100 /* PLL Bypass Enable */
2292#define OUTPUT_DELAY 0x80 /* External Memory Output Delay Enable */
2293#define INPUT_DELAY 0x40 /* External Memory Input Delay Enable */
2294#define PDWN 0x20 /* Power Down */
2295#define STOPCK 0x8 /* Stop Clock */
2296#define PLL_OFF 0x2 /* Disable PLL */
2297#define DF 0x1 /* Divide Frequency */
2298
2299/* SWRST Masks */
2300#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
2301#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
2302#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
2303#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
2304#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
2305
2306/* Bit masks for PLL_STAT */
2307
2308#define PLL_LOCKED 0x20 /* PLL Locked Status */
2309#define ACTIVE_PLLDISABLED 0x4 /* Active Mode With PLL Disabled */
2310#define FULL_ON 0x2 /* Full-On Mode */
2311#define ACTIVE_PLLENABLED 0x1 /* Active Mode With PLL Enabled */
2312#define RTCWS 0x400 /* RTC/Reset Wake-Up Status */
2313#define CANWS 0x800 /* CAN Wake-Up Status */
2314#define USBWS 0x2000 /* USB Wake-Up Status */
2315#define KPADWS 0x4000 /* Keypad Wake-Up Status */
2316#define ROTWS 0x8000 /* Rotary Wake-Up Status */
2317#define GPWS 0x1000 /* General-Purpose Wake-Up Status */
2318
2319/* Bit masks for VR_CTL */
2320
2321#define FREQ 0x3 /* Regulator Switching Frequency */
2322#define GAIN 0xc /* Voltage Output Level Gain */
2323#define VLEV 0xf0 /* Internal Voltage Level */
2324#define SCKELOW 0x8000 /* Drive SCKE Low During Reset Enable */
2325#define WAKE 0x100 /* RTC/Reset Wake-Up Enable */
2326#define CANWE 0x200 /* CAN0/1 Wake-Up Enable */
2327#define GPWE 0x400 /* General-Purpose Wake-Up Enable */
2328#define USBWE 0x800 /* USB Wake-Up Enable */
2329#define KPADWE 0x1000 /* Keypad Wake-Up Enable */
2330#define ROTWE 0x2000 /* Rotary Wake-Up Enable */
2331
2332#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
2333#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
2334#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
2335
2336#define GAIN_5 0x0000 /* GAIN = 5*/
2337#define GAIN_10 0x0004 /* GAIN = 1*/
2338#define GAIN_20 0x0008 /* GAIN = 2*/
2339#define GAIN_50 0x000C /* GAIN = 5*/
2340
2341#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
2342#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
2343#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
2344#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
2345#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
2346#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
2347#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
2348#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
2349#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
2350#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
2351
2352/* Bit masks for NFC_CTL */
2353
2354#define WR_DLY 0xf /* Write Strobe Delay */
2355#define RD_DLY 0xf0 /* Read Strobe Delay */
2356#define NWIDTH 0x100 /* NAND Data Width */
2357#define PG_SIZE 0x200 /* Page Size */
2358
2359/* Bit masks for NFC_STAT */
2360
2361#define NBUSY 0x1 /* Not Busy */
2362#define WB_FULL 0x2 /* Write Buffer Full */
2363#define PG_WR_STAT 0x4 /* Page Write Pending */
2364#define PG_RD_STAT 0x8 /* Page Read Pending */
2365#define WB_EMPTY 0x10 /* Write Buffer Empty */
2366
2367/* Bit masks for NFC_IRQSTAT */
2368
2369#define NBUSYIRQ 0x1 /* Not Busy IRQ */
2370#define WB_OVF 0x2 /* Write Buffer Overflow */
2371#define WB_EDGE 0x4 /* Write Buffer Edge Detect */
2372#define RD_RDY 0x8 /* Read Data Ready */
2373#define WR_DONE 0x10 /* Page Write Done */
2374
2375/* Bit masks for NFC_IRQMASK */
2376
2377#define MASK_BUSYIRQ 0x1 /* Mask Not Busy IRQ */
2378#define MASK_WBOVF 0x2 /* Mask Write Buffer Overflow */
2379#define MASK_WBEMPTY 0x4 /* Mask Write Buffer Empty */
2380#define MASK_RDRDY 0x8 /* Mask Read Data Ready */
2381#define MASK_WRDONE 0x10 /* Mask Write Done */
2382
2383/* Bit masks for NFC_RST */
2384
2385#define ECC_RST 0x1 /* ECC (and NFC counters) Reset */
2386
2387/* Bit masks for NFC_PGCTL */
2388
2389#define PG_RD_START 0x1 /* Page Read Start */
2390#define PG_WR_START 0x2 /* Page Write Start */
2391
2392/* Bit masks for NFC_ECC0 */
2393
2394#define ECC0 0x7ff /* Parity Calculation Result0 */
2395
2396/* Bit masks for NFC_ECC1 */
2397
2398#define ECC1 0x7ff /* Parity Calculation Result1 */
2399
2400/* Bit masks for NFC_ECC2 */
2401
2402#define ECC2 0x7ff /* Parity Calculation Result2 */
2403
2404/* Bit masks for NFC_ECC3 */
2405
2406#define ECC3 0x7ff /* Parity Calculation Result3 */
2407
2408/* Bit masks for NFC_COUNT */
2409
2410#define ECCCNT 0x3ff /* Transfer Count */
2411
2412/* Bit masks for CAN0_CONTROL */
2413
2414#define SRS 0x1 /* Software Reset */
2415#define DNM 0x2 /* DeviceNet Mode */
2416#define ABO 0x4 /* Auto Bus On */
2417#define WBA 0x10 /* Wakeup On CAN Bus Activity */
2418#define SMR 0x20 /* Sleep Mode Request */
2419#define CSR 0x40 /* CAN Suspend Mode Request */
2420#define CCR 0x80 /* CAN Configuration Mode Request */
2421
2422/* Bit masks for CAN0_STATUS */
2423
2424#define WT 0x1 /* CAN Transmit Warning Flag */
2425#define WR 0x2 /* CAN Receive Warning Flag */
2426#define EP 0x4 /* CAN Error Passive Mode */
2427#define EBO 0x8 /* CAN Error Bus Off Mode */
2428#define CSA 0x40 /* CAN Suspend Mode Acknowledge */
2429#define CCA 0x80 /* CAN Configuration Mode Acknowledge */
2430#define MBPTR 0x1f00 /* Mailbox Pointer */
2431#define TRM 0x4000 /* Transmit Mode Status */
2432#define REC 0x8000 /* Receive Mode Status */
2433
2434/* Bit masks for CAN0_DEBUG */
2435
2436#define DEC 0x1 /* Disable Transmit/Receive Error Counters */
2437#define DRI 0x2 /* Disable CANRX Input Pin */
2438#define DTO 0x4 /* Disable CANTX Output Pin */
2439#define DIL 0x8 /* Disable Internal Loop */
2440#define MAA 0x10 /* Mode Auto-Acknowledge */
2441#define MRB 0x20 /* Mode Read Back */
2442#define CDE 0x8000 /* CAN Debug Mode Enable */
2443
2444/* Bit masks for CAN0_CLOCK */
2445
2446#define BRP 0x3ff /* CAN Bit Rate Prescaler */
2447
2448/* Bit masks for CAN0_TIMING */
2449
2450#define SJW 0x300 /* Synchronization Jump Width */
2451#define SAM 0x80 /* Sampling */
2452#define TSEG2 0x70 /* Time Segment 2 */
2453#define TSEG1 0xf /* Time Segment 1 */
2454
2455/* Bit masks for CAN0_INTR */
2456
2457#define CANRX 0x80 /* Serial Input From Transceiver */
2458#define CANTX 0x40 /* Serial Output To Transceiver */
2459#define SMACK 0x8 /* Sleep Mode Acknowledge */
2460#define GIRQ 0x4 /* Global Interrupt Request Status */
2461#define MBTIRQ 0x2 /* Mailbox Transmit Interrupt Request */
2462#define MBRIRQ 0x1 /* Mailbox Receive Interrupt Request */
2463
2464/* Bit masks for CAN0_GIM */
2465
2466#define EWTIM 0x1 /* Error Warning Transmit Interrupt Mask */
2467#define EWRIM 0x2 /* Error Warning Receive Interrupt Mask */
2468#define EPIM 0x4 /* Error Passive Interrupt Mask */
2469#define BOIM 0x8 /* Bus Off Interrupt Mask */
2470#define WUIM 0x10 /* Wakeup Interrupt Mask */
2471#define UIAIM 0x20 /* Unimplemented Address Interrupt Mask */
2472#define AAIM 0x40 /* Abort Acknowledge Interrupt Mask */
2473#define RMLIM 0x80 /* Receive Message Lost Interrupt Mask */
2474#define UCEIM 0x100 /* Universal Counter Exceeded Interrupt Mask */
2475#define ADIM 0x400 /* Access Denied Interrupt Mask */
2476
2477/* Bit masks for CAN0_GIS */
2478
2479#define EWTIS 0x1 /* Error Warning Transmit Interrupt Status */
2480#define EWRIS 0x2 /* Error Warning Receive Interrupt Status */
2481#define EPIS 0x4 /* Error Passive Interrupt Status */
2482#define BOIS 0x8 /* Bus Off Interrupt Status */
2483#define WUIS 0x10 /* Wakeup Interrupt Status */
2484#define UIAIS 0x20 /* Unimplemented Address Interrupt Status */
2485#define AAIS 0x40 /* Abort Acknowledge Interrupt Status */
2486#define RMLIS 0x80 /* Receive Message Lost Interrupt Status */
2487#define UCEIS 0x100 /* Universal Counter Exceeded Interrupt Status */
2488#define ADIS 0x400 /* Access Denied Interrupt Status */
2489
2490/* Bit masks for CAN0_GIF */
2491
2492#define EWTIF 0x1 /* Error Warning Transmit Interrupt Flag */
2493#define EWRIF 0x2 /* Error Warning Receive Interrupt Flag */
2494#define EPIF 0x4 /* Error Passive Interrupt Flag */
2495#define BOIF 0x8 /* Bus Off Interrupt Flag */
2496#define WUIF 0x10 /* Wakeup Interrupt Flag */
2497#define UIAIF 0x20 /* Unimplemented Address Interrupt Flag */
2498#define AAIF 0x40 /* Abort Acknowledge Interrupt Flag */
2499#define RMLIF 0x80 /* Receive Message Lost Interrupt Flag */
2500#define UCEIF 0x100 /* Universal Counter Exceeded Interrupt Flag */
2501#define ADIF 0x400 /* Access Denied Interrupt Flag */
2502
2503/* Bit masks for CAN0_MBTD */
2504
2505#define TDR 0x80 /* Temporary Disable Request */
2506#define TDA 0x40 /* Temporary Disable Acknowledge */
2507#define TDPTR 0x1f /* Temporary Disable Pointer */
2508
2509/* Bit masks for CAN0_UCCNF */
2510
2511#define UCCNF 0xf /* Universal Counter Configuration */
2512#define UCRC 0x20 /* Universal Counter Reload/Clear */
2513#define UCCT 0x40 /* Universal Counter CAN Trigger */
2514#define UCE 0x80 /* Universal Counter Enable */
2515
2516/* Bit masks for CAN0_UCCNT */
2517
2518#define UCCNT 0xffff /* Universal Counter Count Value */
2519
2520/* Bit masks for CAN0_UCRC */
2521
2522#define UCVAL 0xffff /* Universal Counter Reload/Capture Value */
2523
2524/* Bit masks for CAN0_CEC */
2525
2526#define RXECNT 0xff /* Receive Error Counter */
2527#define TXECNT 0xff00 /* Transmit Error Counter */
2528
2529/* Bit masks for CAN0_ESR */
2530
2531#define FER 0x80 /* Form Error */
2532#define BEF 0x40 /* Bit Error Flag */
2533#define SA0 0x20 /* Stuck At Dominant */
2534#define CRCE 0x10 /* CRC Error */
2535#define SER 0x8 /* Stuff Bit Error */
2536#define ACKE 0x4 /* Acknowledge Error */
2537
2538/* Bit masks for CAN0_EWR */
2539
2540#define EWLTEC 0xff00 /* Transmit Error Warning Limit */
2541#define EWLREC 0xff /* Receive Error Warning Limit */
2542
2543/* Bit masks for CAN0_AMxx_H */
2544
2545#define FDF 0x8000 /* Filter On Data Field */
2546#define FMD 0x4000 /* Full Mask Data */
2547#define AMIDE 0x2000 /* Acceptance Mask Identifier Extension */
2548#define BASEID 0x1ffc /* Base Identifier */
2549#define EXTID_HI 0x3 /* Extended Identifier High Bits */
2550
2551/* Bit masks for CAN0_AMxx_L */
2552
2553#define EXTID_LO 0xffff /* Extended Identifier Low Bits */
2554#define DFM 0xffff /* Data Field Mask */
2555
2556/* Bit masks for CAN0_MBxx_ID1 */
2557
2558#define AME 0x8000 /* Acceptance Mask Enable */
2559#define RTR 0x4000 /* Remote Transmission Request */
2560#define IDE 0x2000 /* Identifier Extension */
2561#define BASEID 0x1ffc /* Base Identifier */
2562#define EXTID_HI 0x3 /* Extended Identifier High Bits */
2563
2564/* Bit masks for CAN0_MBxx_ID0 */
2565
2566#define EXTID_LO 0xffff /* Extended Identifier Low Bits */
2567#define DFM 0xffff /* Data Field Mask */
2568
2569/* Bit masks for CAN0_MBxx_TIMESTAMP */
2570
2571#define TSV 0xffff /* Time Stamp Value */
2572
2573/* Bit masks for CAN0_MBxx_LENGTH */
2574
2575#define DLC 0xf /* Data Length Code */
2576
2577/* Bit masks for CAN0_MBxx_DATA3 */
2578
2579#define CAN_BYTE0 0xff00 /* Data Field Byte 0 */
2580#define CAN_BYTE1 0xff /* Data Field Byte 1 */
2581
2582/* Bit masks for CAN0_MBxx_DATA2 */
2583
2584#define CAN_BYTE2 0xff00 /* Data Field Byte 2 */
2585#define CAN_BYTE3 0xff /* Data Field Byte 3 */
2586
2587/* Bit masks for CAN0_MBxx_DATA1 */
2588
2589#define CAN_BYTE4 0xff00 /* Data Field Byte 4 */
2590#define CAN_BYTE5 0xff /* Data Field Byte 5 */
2591
2592/* Bit masks for CAN0_MBxx_DATA0 */
2593
2594#define CAN_BYTE6 0xff00 /* Data Field Byte 6 */
2595#define CAN_BYTE7 0xff /* Data Field Byte 7 */
2596
2597/* Bit masks for CAN0_MC1 */
2598
2599#define MC0 0x1 /* Mailbox 0 Enable */
2600#define MC1 0x2 /* Mailbox 1 Enable */
2601#define MC2 0x4 /* Mailbox 2 Enable */
2602#define MC3 0x8 /* Mailbox 3 Enable */
2603#define MC4 0x10 /* Mailbox 4 Enable */
2604#define MC5 0x20 /* Mailbox 5 Enable */
2605#define MC6 0x40 /* Mailbox 6 Enable */
2606#define MC7 0x80 /* Mailbox 7 Enable */
2607#define MC8 0x100 /* Mailbox 8 Enable */
2608#define MC9 0x200 /* Mailbox 9 Enable */
2609#define MC10 0x400 /* Mailbox 10 Enable */
2610#define MC11 0x800 /* Mailbox 11 Enable */
2611#define MC12 0x1000 /* Mailbox 12 Enable */
2612#define MC13 0x2000 /* Mailbox 13 Enable */
2613#define MC14 0x4000 /* Mailbox 14 Enable */
2614#define MC15 0x8000 /* Mailbox 15 Enable */
2615
2616/* Bit masks for CAN0_MC2 */
2617
2618#define MC16 0x1 /* Mailbox 16 Enable */
2619#define MC17 0x2 /* Mailbox 17 Enable */
2620#define MC18 0x4 /* Mailbox 18 Enable */
2621#define MC19 0x8 /* Mailbox 19 Enable */
2622#define MC20 0x10 /* Mailbox 20 Enable */
2623#define MC21 0x20 /* Mailbox 21 Enable */
2624#define MC22 0x40 /* Mailbox 22 Enable */
2625#define MC23 0x80 /* Mailbox 23 Enable */
2626#define MC24 0x100 /* Mailbox 24 Enable */
2627#define MC25 0x200 /* Mailbox 25 Enable */
2628#define MC26 0x400 /* Mailbox 26 Enable */
2629#define MC27 0x800 /* Mailbox 27 Enable */
2630#define MC28 0x1000 /* Mailbox 28 Enable */
2631#define MC29 0x2000 /* Mailbox 29 Enable */
2632#define MC30 0x4000 /* Mailbox 30 Enable */
2633#define MC31 0x8000 /* Mailbox 31 Enable */
2634
2635/* Bit masks for CAN0_MD1 */
2636
2637#define MD0 0x1 /* Mailbox 0 Receive Enable */
2638#define MD1 0x2 /* Mailbox 1 Receive Enable */
2639#define MD2 0x4 /* Mailbox 2 Receive Enable */
2640#define MD3 0x8 /* Mailbox 3 Receive Enable */
2641#define MD4 0x10 /* Mailbox 4 Receive Enable */
2642#define MD5 0x20 /* Mailbox 5 Receive Enable */
2643#define MD6 0x40 /* Mailbox 6 Receive Enable */
2644#define MD7 0x80 /* Mailbox 7 Receive Enable */
2645#define MD8 0x100 /* Mailbox 8 Receive Enable */
2646#define MD9 0x200 /* Mailbox 9 Receive Enable */
2647#define MD10 0x400 /* Mailbox 10 Receive Enable */
2648#define MD11 0x800 /* Mailbox 11 Receive Enable */
2649#define MD12 0x1000 /* Mailbox 12 Receive Enable */
2650#define MD13 0x2000 /* Mailbox 13 Receive Enable */
2651#define MD14 0x4000 /* Mailbox 14 Receive Enable */
2652#define MD15 0x8000 /* Mailbox 15 Receive Enable */
2653
2654/* Bit masks for CAN0_MD2 */
2655
2656#define MD16 0x1 /* Mailbox 16 Receive Enable */
2657#define MD17 0x2 /* Mailbox 17 Receive Enable */
2658#define MD18 0x4 /* Mailbox 18 Receive Enable */
2659#define MD19 0x8 /* Mailbox 19 Receive Enable */
2660#define MD20 0x10 /* Mailbox 20 Receive Enable */
2661#define MD21 0x20 /* Mailbox 21 Receive Enable */
2662#define MD22 0x40 /* Mailbox 22 Receive Enable */
2663#define MD23 0x80 /* Mailbox 23 Receive Enable */
2664#define MD24 0x100 /* Mailbox 24 Receive Enable */
2665#define MD25 0x200 /* Mailbox 25 Receive Enable */
2666#define MD26 0x400 /* Mailbox 26 Receive Enable */
2667#define MD27 0x800 /* Mailbox 27 Receive Enable */
2668#define MD28 0x1000 /* Mailbox 28 Receive Enable */
2669#define MD29 0x2000 /* Mailbox 29 Receive Enable */
2670#define MD30 0x4000 /* Mailbox 30 Receive Enable */
2671#define MD31 0x8000 /* Mailbox 31 Receive Enable */
2672
2673/* Bit masks for CAN0_RMP1 */
2674
2675#define RMP0 0x1 /* Mailbox 0 Receive Message Pending */
2676#define RMP1 0x2 /* Mailbox 1 Receive Message Pending */
2677#define RMP2 0x4 /* Mailbox 2 Receive Message Pending */
2678#define RMP3 0x8 /* Mailbox 3 Receive Message Pending */
2679#define RMP4 0x10 /* Mailbox 4 Receive Message Pending */
2680#define RMP5 0x20 /* Mailbox 5 Receive Message Pending */
2681#define RMP6 0x40 /* Mailbox 6 Receive Message Pending */
2682#define RMP7 0x80 /* Mailbox 7 Receive Message Pending */
2683#define RMP8 0x100 /* Mailbox 8 Receive Message Pending */
2684#define RMP9 0x200 /* Mailbox 9 Receive Message Pending */
2685#define RMP10 0x400 /* Mailbox 10 Receive Message Pending */
2686#define RMP11 0x800 /* Mailbox 11 Receive Message Pending */
2687#define RMP12 0x1000 /* Mailbox 12 Receive Message Pending */
2688#define RMP13 0x2000 /* Mailbox 13 Receive Message Pending */
2689#define RMP14 0x4000 /* Mailbox 14 Receive Message Pending */
2690#define RMP15 0x8000 /* Mailbox 15 Receive Message Pending */
2691
2692/* Bit masks for CAN0_RMP2 */
2693
2694#define RMP16 0x1 /* Mailbox 16 Receive Message Pending */
2695#define RMP17 0x2 /* Mailbox 17 Receive Message Pending */
2696#define RMP18 0x4 /* Mailbox 18 Receive Message Pending */
2697#define RMP19 0x8 /* Mailbox 19 Receive Message Pending */
2698#define RMP20 0x10 /* Mailbox 20 Receive Message Pending */
2699#define RMP21 0x20 /* Mailbox 21 Receive Message Pending */
2700#define RMP22 0x40 /* Mailbox 22 Receive Message Pending */
2701#define RMP23 0x80 /* Mailbox 23 Receive Message Pending */
2702#define RMP24 0x100 /* Mailbox 24 Receive Message Pending */
2703#define RMP25 0x200 /* Mailbox 25 Receive Message Pending */
2704#define RMP26 0x400 /* Mailbox 26 Receive Message Pending */
2705#define RMP27 0x800 /* Mailbox 27 Receive Message Pending */
2706#define RMP28 0x1000 /* Mailbox 28 Receive Message Pending */
2707#define RMP29 0x2000 /* Mailbox 29 Receive Message Pending */
2708#define RMP30 0x4000 /* Mailbox 30 Receive Message Pending */
2709#define RMP31 0x8000 /* Mailbox 31 Receive Message Pending */
2710
2711/* Bit masks for CAN0_RML1 */
2712
2713#define RML0 0x1 /* Mailbox 0 Receive Message Lost */
2714#define RML1 0x2 /* Mailbox 1 Receive Message Lost */
2715#define RML2 0x4 /* Mailbox 2 Receive Message Lost */
2716#define RML3 0x8 /* Mailbox 3 Receive Message Lost */
2717#define RML4 0x10 /* Mailbox 4 Receive Message Lost */
2718#define RML5 0x20 /* Mailbox 5 Receive Message Lost */
2719#define RML6 0x40 /* Mailbox 6 Receive Message Lost */
2720#define RML7 0x80 /* Mailbox 7 Receive Message Lost */
2721#define RML8 0x100 /* Mailbox 8 Receive Message Lost */
2722#define RML9 0x200 /* Mailbox 9 Receive Message Lost */
2723#define RML10 0x400 /* Mailbox 10 Receive Message Lost */
2724#define RML11 0x800 /* Mailbox 11 Receive Message Lost */
2725#define RML12 0x1000 /* Mailbox 12 Receive Message Lost */
2726#define RML13 0x2000 /* Mailbox 13 Receive Message Lost */
2727#define RML14 0x4000 /* Mailbox 14 Receive Message Lost */
2728#define RML15 0x8000 /* Mailbox 15 Receive Message Lost */
2729
2730/* Bit masks for CAN0_RML2 */
2731
2732#define RML16 0x1 /* Mailbox 16 Receive Message Lost */
2733#define RML17 0x2 /* Mailbox 17 Receive Message Lost */
2734#define RML18 0x4 /* Mailbox 18 Receive Message Lost */
2735#define RML19 0x8 /* Mailbox 19 Receive Message Lost */
2736#define RML20 0x10 /* Mailbox 20 Receive Message Lost */
2737#define RML21 0x20 /* Mailbox 21 Receive Message Lost */
2738#define RML22 0x40 /* Mailbox 22 Receive Message Lost */
2739#define RML23 0x80 /* Mailbox 23 Receive Message Lost */
2740#define RML24 0x100 /* Mailbox 24 Receive Message Lost */
2741#define RML25 0x200 /* Mailbox 25 Receive Message Lost */
2742#define RML26 0x400 /* Mailbox 26 Receive Message Lost */
2743#define RML27 0x800 /* Mailbox 27 Receive Message Lost */
2744#define RML28 0x1000 /* Mailbox 28 Receive Message Lost */
2745#define RML29 0x2000 /* Mailbox 29 Receive Message Lost */
2746#define RML30 0x4000 /* Mailbox 30 Receive Message Lost */
2747#define RML31 0x8000 /* Mailbox 31 Receive Message Lost */
2748
2749/* Bit masks for CAN0_OPSS1 */
2750
2751#define OPSS0 0x1 /* Mailbox 0 Overwrite Protection/Single-Shot Transmission Enable */
2752#define OPSS1 0x2 /* Mailbox 1 Overwrite Protection/Single-Shot Transmission Enable */
2753#define OPSS2 0x4 /* Mailbox 2 Overwrite Protection/Single-Shot Transmission Enable */
2754#define OPSS3 0x8 /* Mailbox 3 Overwrite Protection/Single-Shot Transmission Enable */
2755#define OPSS4 0x10 /* Mailbox 4 Overwrite Protection/Single-Shot Transmission Enable */
2756#define OPSS5 0x20 /* Mailbox 5 Overwrite Protection/Single-Shot Transmission Enable */
2757#define OPSS6 0x40 /* Mailbox 6 Overwrite Protection/Single-Shot Transmission Enable */
2758#define OPSS7 0x80 /* Mailbox 7 Overwrite Protection/Single-Shot Transmission Enable */
2759#define OPSS8 0x100 /* Mailbox 8 Overwrite Protection/Single-Shot Transmission Enable */
2760#define OPSS9 0x200 /* Mailbox 9 Overwrite Protection/Single-Shot Transmission Enable */
2761#define OPSS10 0x400 /* Mailbox 10 Overwrite Protection/Single-Shot Transmission Enable */
2762#define OPSS11 0x800 /* Mailbox 11 Overwrite Protection/Single-Shot Transmission Enable */
2763#define OPSS12 0x1000 /* Mailbox 12 Overwrite Protection/Single-Shot Transmission Enable */
2764#define OPSS13 0x2000 /* Mailbox 13 Overwrite Protection/Single-Shot Transmission Enable */
2765#define OPSS14 0x4000 /* Mailbox 14 Overwrite Protection/Single-Shot Transmission Enable */
2766#define OPSS15 0x8000 /* Mailbox 15 Overwrite Protection/Single-Shot Transmission Enable */
2767
2768/* Bit masks for CAN0_OPSS2 */
2769
2770#define OPSS16 0x1 /* Mailbox 16 Overwrite Protection/Single-Shot Transmission Enable */
2771#define OPSS17 0x2 /* Mailbox 17 Overwrite Protection/Single-Shot Transmission Enable */
2772#define OPSS18 0x4 /* Mailbox 18 Overwrite Protection/Single-Shot Transmission Enable */
2773#define OPSS19 0x8 /* Mailbox 19 Overwrite Protection/Single-Shot Transmission Enable */
2774#define OPSS20 0x10 /* Mailbox 20 Overwrite Protection/Single-Shot Transmission Enable */
2775#define OPSS21 0x20 /* Mailbox 21 Overwrite Protection/Single-Shot Transmission Enable */
2776#define OPSS22 0x40 /* Mailbox 22 Overwrite Protection/Single-Shot Transmission Enable */
2777#define OPSS23 0x80 /* Mailbox 23 Overwrite Protection/Single-Shot Transmission Enable */
2778#define OPSS24 0x100 /* Mailbox 24 Overwrite Protection/Single-Shot Transmission Enable */
2779#define OPSS25 0x200 /* Mailbox 25 Overwrite Protection/Single-Shot Transmission Enable */
2780#define OPSS26 0x400 /* Mailbox 26 Overwrite Protection/Single-Shot Transmission Enable */
2781#define OPSS27 0x800 /* Mailbox 27 Overwrite Protection/Single-Shot Transmission Enable */
2782#define OPSS28 0x1000 /* Mailbox 28 Overwrite Protection/Single-Shot Transmission Enable */
2783#define OPSS29 0x2000 /* Mailbox 29 Overwrite Protection/Single-Shot Transmission Enable */
2784#define OPSS30 0x4000 /* Mailbox 30 Overwrite Protection/Single-Shot Transmission Enable */
2785#define OPSS31 0x8000 /* Mailbox 31 Overwrite Protection/Single-Shot Transmission Enable */
2786
2787/* Bit masks for CAN0_TRS1 */
2788
2789#define TRS0 0x1 /* Mailbox 0 Transmit Request Set */
2790#define TRS1 0x2 /* Mailbox 1 Transmit Request Set */
2791#define TRS2 0x4 /* Mailbox 2 Transmit Request Set */
2792#define TRS3 0x8 /* Mailbox 3 Transmit Request Set */
2793#define TRS4 0x10 /* Mailbox 4 Transmit Request Set */
2794#define TRS5 0x20 /* Mailbox 5 Transmit Request Set */
2795#define TRS6 0x40 /* Mailbox 6 Transmit Request Set */
2796#define TRS7 0x80 /* Mailbox 7 Transmit Request Set */
2797#define TRS8 0x100 /* Mailbox 8 Transmit Request Set */
2798#define TRS9 0x200 /* Mailbox 9 Transmit Request Set */
2799#define TRS10 0x400 /* Mailbox 10 Transmit Request Set */
2800#define TRS11 0x800 /* Mailbox 11 Transmit Request Set */
2801#define TRS12 0x1000 /* Mailbox 12 Transmit Request Set */
2802#define TRS13 0x2000 /* Mailbox 13 Transmit Request Set */
2803#define TRS14 0x4000 /* Mailbox 14 Transmit Request Set */
2804#define TRS15 0x8000 /* Mailbox 15 Transmit Request Set */
2805
2806/* Bit masks for CAN0_TRS2 */
2807
2808#define TRS16 0x1 /* Mailbox 16 Transmit Request Set */
2809#define TRS17 0x2 /* Mailbox 17 Transmit Request Set */
2810#define TRS18 0x4 /* Mailbox 18 Transmit Request Set */
2811#define TRS19 0x8 /* Mailbox 19 Transmit Request Set */
2812#define TRS20 0x10 /* Mailbox 20 Transmit Request Set */
2813#define TRS21 0x20 /* Mailbox 21 Transmit Request Set */
2814#define TRS22 0x40 /* Mailbox 22 Transmit Request Set */
2815#define TRS23 0x80 /* Mailbox 23 Transmit Request Set */
2816#define TRS24 0x100 /* Mailbox 24 Transmit Request Set */
2817#define TRS25 0x200 /* Mailbox 25 Transmit Request Set */
2818#define TRS26 0x400 /* Mailbox 26 Transmit Request Set */
2819#define TRS27 0x800 /* Mailbox 27 Transmit Request Set */
2820#define TRS28 0x1000 /* Mailbox 28 Transmit Request Set */
2821#define TRS29 0x2000 /* Mailbox 29 Transmit Request Set */
2822#define TRS30 0x4000 /* Mailbox 30 Transmit Request Set */
2823#define TRS31 0x8000 /* Mailbox 31 Transmit Request Set */
2824
2825/* Bit masks for CAN0_TRR1 */
2826
2827#define TRR0 0x1 /* Mailbox 0 Transmit Request Reset */
2828#define TRR1 0x2 /* Mailbox 1 Transmit Request Reset */
2829#define TRR2 0x4 /* Mailbox 2 Transmit Request Reset */
2830#define TRR3 0x8 /* Mailbox 3 Transmit Request Reset */
2831#define TRR4 0x10 /* Mailbox 4 Transmit Request Reset */
2832#define TRR5 0x20 /* Mailbox 5 Transmit Request Reset */
2833#define TRR6 0x40 /* Mailbox 6 Transmit Request Reset */
2834#define TRR7 0x80 /* Mailbox 7 Transmit Request Reset */
2835#define TRR8 0x100 /* Mailbox 8 Transmit Request Reset */
2836#define TRR9 0x200 /* Mailbox 9 Transmit Request Reset */
2837#define TRR10 0x400 /* Mailbox 10 Transmit Request Reset */
2838#define TRR11 0x800 /* Mailbox 11 Transmit Request Reset */
2839#define TRR12 0x1000 /* Mailbox 12 Transmit Request Reset */
2840#define TRR13 0x2000 /* Mailbox 13 Transmit Request Reset */
2841#define TRR14 0x4000 /* Mailbox 14 Transmit Request Reset */
2842#define TRR15 0x8000 /* Mailbox 15 Transmit Request Reset */
2843
2844/* Bit masks for CAN0_TRR2 */
2845
2846#define TRR16 0x1 /* Mailbox 16 Transmit Request Reset */
2847#define TRR17 0x2 /* Mailbox 17 Transmit Request Reset */
2848#define TRR18 0x4 /* Mailbox 18 Transmit Request Reset */
2849#define TRR19 0x8 /* Mailbox 19 Transmit Request Reset */
2850#define TRR20 0x10 /* Mailbox 20 Transmit Request Reset */
2851#define TRR21 0x20 /* Mailbox 21 Transmit Request Reset */
2852#define TRR22 0x40 /* Mailbox 22 Transmit Request Reset */
2853#define TRR23 0x80 /* Mailbox 23 Transmit Request Reset */
2854#define TRR24 0x100 /* Mailbox 24 Transmit Request Reset */
2855#define TRR25 0x200 /* Mailbox 25 Transmit Request Reset */
2856#define TRR26 0x400 /* Mailbox 26 Transmit Request Reset */
2857#define TRR27 0x800 /* Mailbox 27 Transmit Request Reset */
2858#define TRR28 0x1000 /* Mailbox 28 Transmit Request Reset */
2859#define TRR29 0x2000 /* Mailbox 29 Transmit Request Reset */
2860#define TRR30 0x4000 /* Mailbox 30 Transmit Request Reset */
2861#define TRR31 0x8000 /* Mailbox 31 Transmit Request Reset */
2862
2863/* Bit masks for CAN0_AA1 */
2864
2865#define AA0 0x1 /* Mailbox 0 Abort Acknowledge */
2866#define AA1 0x2 /* Mailbox 1 Abort Acknowledge */
2867#define AA2 0x4 /* Mailbox 2 Abort Acknowledge */
2868#define AA3 0x8 /* Mailbox 3 Abort Acknowledge */
2869#define AA4 0x10 /* Mailbox 4 Abort Acknowledge */
2870#define AA5 0x20 /* Mailbox 5 Abort Acknowledge */
2871#define AA6 0x40 /* Mailbox 6 Abort Acknowledge */
2872#define AA7 0x80 /* Mailbox 7 Abort Acknowledge */
2873#define AA8 0x100 /* Mailbox 8 Abort Acknowledge */
2874#define AA9 0x200 /* Mailbox 9 Abort Acknowledge */
2875#define AA10 0x400 /* Mailbox 10 Abort Acknowledge */
2876#define AA11 0x800 /* Mailbox 11 Abort Acknowledge */
2877#define AA12 0x1000 /* Mailbox 12 Abort Acknowledge */
2878#define AA13 0x2000 /* Mailbox 13 Abort Acknowledge */
2879#define AA14 0x4000 /* Mailbox 14 Abort Acknowledge */
2880#define AA15 0x8000 /* Mailbox 15 Abort Acknowledge */
2881
2882/* Bit masks for CAN0_AA2 */
2883
2884#define AA16 0x1 /* Mailbox 16 Abort Acknowledge */
2885#define AA17 0x2 /* Mailbox 17 Abort Acknowledge */
2886#define AA18 0x4 /* Mailbox 18 Abort Acknowledge */
2887#define AA19 0x8 /* Mailbox 19 Abort Acknowledge */
2888#define AA20 0x10 /* Mailbox 20 Abort Acknowledge */
2889#define AA21 0x20 /* Mailbox 21 Abort Acknowledge */
2890#define AA22 0x40 /* Mailbox 22 Abort Acknowledge */
2891#define AA23 0x80 /* Mailbox 23 Abort Acknowledge */
2892#define AA24 0x100 /* Mailbox 24 Abort Acknowledge */
2893#define AA25 0x200 /* Mailbox 25 Abort Acknowledge */
2894#define AA26 0x400 /* Mailbox 26 Abort Acknowledge */
2895#define AA27 0x800 /* Mailbox 27 Abort Acknowledge */
2896#define AA28 0x1000 /* Mailbox 28 Abort Acknowledge */
2897#define AA29 0x2000 /* Mailbox 29 Abort Acknowledge */
2898#define AA30 0x4000 /* Mailbox 30 Abort Acknowledge */
2899#define AA31 0x8000 /* Mailbox 31 Abort Acknowledge */
2900
2901/* Bit masks for CAN0_TA1 */
2902
2903#define TA0 0x1 /* Mailbox 0 Transmit Acknowledge */
2904#define TA1 0x2 /* Mailbox 1 Transmit Acknowledge */
2905#define TA2 0x4 /* Mailbox 2 Transmit Acknowledge */
2906#define TA3 0x8 /* Mailbox 3 Transmit Acknowledge */
2907#define TA4 0x10 /* Mailbox 4 Transmit Acknowledge */
2908#define TA5 0x20 /* Mailbox 5 Transmit Acknowledge */
2909#define TA6 0x40 /* Mailbox 6 Transmit Acknowledge */
2910#define TA7 0x80 /* Mailbox 7 Transmit Acknowledge */
2911#define TA8 0x100 /* Mailbox 8 Transmit Acknowledge */
2912#define TA9 0x200 /* Mailbox 9 Transmit Acknowledge */
2913#define TA10 0x400 /* Mailbox 10 Transmit Acknowledge */
2914#define TA11 0x800 /* Mailbox 11 Transmit Acknowledge */
2915#define TA12 0x1000 /* Mailbox 12 Transmit Acknowledge */
2916#define TA13 0x2000 /* Mailbox 13 Transmit Acknowledge */
2917#define TA14 0x4000 /* Mailbox 14 Transmit Acknowledge */
2918#define TA15 0x8000 /* Mailbox 15 Transmit Acknowledge */
2919
2920/* Bit masks for CAN0_TA2 */
2921
2922#define TA16 0x1 /* Mailbox 16 Transmit Acknowledge */
2923#define TA17 0x2 /* Mailbox 17 Transmit Acknowledge */
2924#define TA18 0x4 /* Mailbox 18 Transmit Acknowledge */
2925#define TA19 0x8 /* Mailbox 19 Transmit Acknowledge */
2926#define TA20 0x10 /* Mailbox 20 Transmit Acknowledge */
2927#define TA21 0x20 /* Mailbox 21 Transmit Acknowledge */
2928#define TA22 0x40 /* Mailbox 22 Transmit Acknowledge */
2929#define TA23 0x80 /* Mailbox 23 Transmit Acknowledge */
2930#define TA24 0x100 /* Mailbox 24 Transmit Acknowledge */
2931#define TA25 0x200 /* Mailbox 25 Transmit Acknowledge */
2932#define TA26 0x400 /* Mailbox 26 Transmit Acknowledge */
2933#define TA27 0x800 /* Mailbox 27 Transmit Acknowledge */
2934#define TA28 0x1000 /* Mailbox 28 Transmit Acknowledge */
2935#define TA29 0x2000 /* Mailbox 29 Transmit Acknowledge */
2936#define TA30 0x4000 /* Mailbox 30 Transmit Acknowledge */
2937#define TA31 0x8000 /* Mailbox 31 Transmit Acknowledge */
2938
2939/* Bit masks for CAN0_RFH1 */
2940
2941#define RFH0 0x1 /* Mailbox 0 Remote Frame Handling Enable */
2942#define RFH1 0x2 /* Mailbox 1 Remote Frame Handling Enable */
2943#define RFH2 0x4 /* Mailbox 2 Remote Frame Handling Enable */
2944#define RFH3 0x8 /* Mailbox 3 Remote Frame Handling Enable */
2945#define RFH4 0x10 /* Mailbox 4 Remote Frame Handling Enable */
2946#define RFH5 0x20 /* Mailbox 5 Remote Frame Handling Enable */
2947#define RFH6 0x40 /* Mailbox 6 Remote Frame Handling Enable */
2948#define RFH7 0x80 /* Mailbox 7 Remote Frame Handling Enable */
2949#define RFH8 0x100 /* Mailbox 8 Remote Frame Handling Enable */
2950#define RFH9 0x200 /* Mailbox 9 Remote Frame Handling Enable */
2951#define RFH10 0x400 /* Mailbox 10 Remote Frame Handling Enable */
2952#define RFH11 0x800 /* Mailbox 11 Remote Frame Handling Enable */
2953#define RFH12 0x1000 /* Mailbox 12 Remote Frame Handling Enable */
2954#define RFH13 0x2000 /* Mailbox 13 Remote Frame Handling Enable */
2955#define RFH14 0x4000 /* Mailbox 14 Remote Frame Handling Enable */
2956#define RFH15 0x8000 /* Mailbox 15 Remote Frame Handling Enable */
2957
2958/* Bit masks for CAN0_RFH2 */
2959
2960#define RFH16 0x1 /* Mailbox 16 Remote Frame Handling Enable */
2961#define RFH17 0x2 /* Mailbox 17 Remote Frame Handling Enable */
2962#define RFH18 0x4 /* Mailbox 18 Remote Frame Handling Enable */
2963#define RFH19 0x8 /* Mailbox 19 Remote Frame Handling Enable */
2964#define RFH20 0x10 /* Mailbox 20 Remote Frame Handling Enable */
2965#define RFH21 0x20 /* Mailbox 21 Remote Frame Handling Enable */
2966#define RFH22 0x40 /* Mailbox 22 Remote Frame Handling Enable */
2967#define RFH23 0x80 /* Mailbox 23 Remote Frame Handling Enable */
2968#define RFH24 0x100 /* Mailbox 24 Remote Frame Handling Enable */
2969#define RFH25 0x200 /* Mailbox 25 Remote Frame Handling Enable */
2970#define RFH26 0x400 /* Mailbox 26 Remote Frame Handling Enable */
2971#define RFH27 0x800 /* Mailbox 27 Remote Frame Handling Enable */
2972#define RFH28 0x1000 /* Mailbox 28 Remote Frame Handling Enable */
2973#define RFH29 0x2000 /* Mailbox 29 Remote Frame Handling Enable */
2974#define RFH30 0x4000 /* Mailbox 30 Remote Frame Handling Enable */
2975#define RFH31 0x8000 /* Mailbox 31 Remote Frame Handling Enable */
2976
2977/* Bit masks for CAN0_MBIM1 */
2978
2979#define MBIM0 0x1 /* Mailbox 0 Mailbox Interrupt Mask */
2980#define MBIM1 0x2 /* Mailbox 1 Mailbox Interrupt Mask */
2981#define MBIM2 0x4 /* Mailbox 2 Mailbox Interrupt Mask */
2982#define MBIM3 0x8 /* Mailbox 3 Mailbox Interrupt Mask */
2983#define MBIM4 0x10 /* Mailbox 4 Mailbox Interrupt Mask */
2984#define MBIM5 0x20 /* Mailbox 5 Mailbox Interrupt Mask */
2985#define MBIM6 0x40 /* Mailbox 6 Mailbox Interrupt Mask */
2986#define MBIM7 0x80 /* Mailbox 7 Mailbox Interrupt Mask */
2987#define MBIM8 0x100 /* Mailbox 8 Mailbox Interrupt Mask */
2988#define MBIM9 0x200 /* Mailbox 9 Mailbox Interrupt Mask */
2989#define MBIM10 0x400 /* Mailbox 10 Mailbox Interrupt Mask */
2990#define MBIM11 0x800 /* Mailbox 11 Mailbox Interrupt Mask */
2991#define MBIM12 0x1000 /* Mailbox 12 Mailbox Interrupt Mask */
2992#define MBIM13 0x2000 /* Mailbox 13 Mailbox Interrupt Mask */
2993#define MBIM14 0x4000 /* Mailbox 14 Mailbox Interrupt Mask */
2994#define MBIM15 0x8000 /* Mailbox 15 Mailbox Interrupt Mask */
2995
2996/* Bit masks for CAN0_MBIM2 */
2997
2998#define MBIM16 0x1 /* Mailbox 16 Mailbox Interrupt Mask */
2999#define MBIM17 0x2 /* Mailbox 17 Mailbox Interrupt Mask */
3000#define MBIM18 0x4 /* Mailbox 18 Mailbox Interrupt Mask */
3001#define MBIM19 0x8 /* Mailbox 19 Mailbox Interrupt Mask */
3002#define MBIM20 0x10 /* Mailbox 20 Mailbox Interrupt Mask */
3003#define MBIM21 0x20 /* Mailbox 21 Mailbox Interrupt Mask */
3004#define MBIM22 0x40 /* Mailbox 22 Mailbox Interrupt Mask */
3005#define MBIM23 0x80 /* Mailbox 23 Mailbox Interrupt Mask */
3006#define MBIM24 0x100 /* Mailbox 24 Mailbox Interrupt Mask */
3007#define MBIM25 0x200 /* Mailbox 25 Mailbox Interrupt Mask */
3008#define MBIM26 0x400 /* Mailbox 26 Mailbox Interrupt Mask */
3009#define MBIM27 0x800 /* Mailbox 27 Mailbox Interrupt Mask */
3010#define MBIM28 0x1000 /* Mailbox 28 Mailbox Interrupt Mask */
3011#define MBIM29 0x2000 /* Mailbox 29 Mailbox Interrupt Mask */
3012#define MBIM30 0x4000 /* Mailbox 30 Mailbox Interrupt Mask */
3013#define MBIM31 0x8000 /* Mailbox 31 Mailbox Interrupt Mask */
3014
3015/* Bit masks for CAN0_MBTIF1 */
3016
3017#define MBTIF0 0x1 /* Mailbox 0 Mailbox Transmit Interrupt Flag */
3018#define MBTIF1 0x2 /* Mailbox 1 Mailbox Transmit Interrupt Flag */
3019#define MBTIF2 0x4 /* Mailbox 2 Mailbox Transmit Interrupt Flag */
3020#define MBTIF3 0x8 /* Mailbox 3 Mailbox Transmit Interrupt Flag */
3021#define MBTIF4 0x10 /* Mailbox 4 Mailbox Transmit Interrupt Flag */
3022#define MBTIF5 0x20 /* Mailbox 5 Mailbox Transmit Interrupt Flag */
3023#define MBTIF6 0x40 /* Mailbox 6 Mailbox Transmit Interrupt Flag */
3024#define MBTIF7 0x80 /* Mailbox 7 Mailbox Transmit Interrupt Flag */
3025#define MBTIF8 0x100 /* Mailbox 8 Mailbox Transmit Interrupt Flag */
3026#define MBTIF9 0x200 /* Mailbox 9 Mailbox Transmit Interrupt Flag */
3027#define MBTIF10 0x400 /* Mailbox 10 Mailbox Transmit Interrupt Flag */
3028#define MBTIF11 0x800 /* Mailbox 11 Mailbox Transmit Interrupt Flag */
3029#define MBTIF12 0x1000 /* Mailbox 12 Mailbox Transmit Interrupt Flag */
3030#define MBTIF13 0x2000 /* Mailbox 13 Mailbox Transmit Interrupt Flag */
3031#define MBTIF14 0x4000 /* Mailbox 14 Mailbox Transmit Interrupt Flag */
3032#define MBTIF15 0x8000 /* Mailbox 15 Mailbox Transmit Interrupt Flag */
3033
3034/* Bit masks for CAN0_MBTIF2 */
3035
3036#define MBTIF16 0x1 /* Mailbox 16 Mailbox Transmit Interrupt Flag */
3037#define MBTIF17 0x2 /* Mailbox 17 Mailbox Transmit Interrupt Flag */
3038#define MBTIF18 0x4 /* Mailbox 18 Mailbox Transmit Interrupt Flag */
3039#define MBTIF19 0x8 /* Mailbox 19 Mailbox Transmit Interrupt Flag */
3040#define MBTIF20 0x10 /* Mailbox 20 Mailbox Transmit Interrupt Flag */
3041#define MBTIF21 0x20 /* Mailbox 21 Mailbox Transmit Interrupt Flag */
3042#define MBTIF22 0x40 /* Mailbox 22 Mailbox Transmit Interrupt Flag */
3043#define MBTIF23 0x80 /* Mailbox 23 Mailbox Transmit Interrupt Flag */
3044#define MBTIF24 0x100 /* Mailbox 24 Mailbox Transmit Interrupt Flag */
3045#define MBTIF25 0x200 /* Mailbox 25 Mailbox Transmit Interrupt Flag */
3046#define MBTIF26 0x400 /* Mailbox 26 Mailbox Transmit Interrupt Flag */
3047#define MBTIF27 0x800 /* Mailbox 27 Mailbox Transmit Interrupt Flag */
3048#define MBTIF28 0x1000 /* Mailbox 28 Mailbox Transmit Interrupt Flag */
3049#define MBTIF29 0x2000 /* Mailbox 29 Mailbox Transmit Interrupt Flag */
3050#define MBTIF30 0x4000 /* Mailbox 30 Mailbox Transmit Interrupt Flag */
3051#define MBTIF31 0x8000 /* Mailbox 31 Mailbox Transmit Interrupt Flag */
3052
3053/* Bit masks for CAN0_MBRIF1 */
3054
3055#define MBRIF0 0x1 /* Mailbox 0 Mailbox Receive Interrupt Flag */
3056#define MBRIF1 0x2 /* Mailbox 1 Mailbox Receive Interrupt Flag */
3057#define MBRIF2 0x4 /* Mailbox 2 Mailbox Receive Interrupt Flag */
3058#define MBRIF3 0x8 /* Mailbox 3 Mailbox Receive Interrupt Flag */
3059#define MBRIF4 0x10 /* Mailbox 4 Mailbox Receive Interrupt Flag */
3060#define MBRIF5 0x20 /* Mailbox 5 Mailbox Receive Interrupt Flag */
3061#define MBRIF6 0x40 /* Mailbox 6 Mailbox Receive Interrupt Flag */
3062#define MBRIF7 0x80 /* Mailbox 7 Mailbox Receive Interrupt Flag */
3063#define MBRIF8 0x100 /* Mailbox 8 Mailbox Receive Interrupt Flag */
3064#define MBRIF9 0x200 /* Mailbox 9 Mailbox Receive Interrupt Flag */
3065#define MBRIF10 0x400 /* Mailbox 10 Mailbox Receive Interrupt Flag */
3066#define MBRIF11 0x800 /* Mailbox 11 Mailbox Receive Interrupt Flag */
3067#define MBRIF12 0x1000 /* Mailbox 12 Mailbox Receive Interrupt Flag */
3068#define MBRIF13 0x2000 /* Mailbox 13 Mailbox Receive Interrupt Flag */
3069#define MBRIF14 0x4000 /* Mailbox 14 Mailbox Receive Interrupt Flag */
3070#define MBRIF15 0x8000 /* Mailbox 15 Mailbox Receive Interrupt Flag */
3071
3072/* Bit masks for CAN0_MBRIF2 */
3073
3074#define MBRIF16 0x1 /* Mailbox 16 Mailbox Receive Interrupt Flag */
3075#define MBRIF17 0x2 /* Mailbox 17 Mailbox Receive Interrupt Flag */
3076#define MBRIF18 0x4 /* Mailbox 18 Mailbox Receive Interrupt Flag */
3077#define MBRIF19 0x8 /* Mailbox 19 Mailbox Receive Interrupt Flag */
3078#define MBRIF20 0x10 /* Mailbox 20 Mailbox Receive Interrupt Flag */
3079#define MBRIF21 0x20 /* Mailbox 21 Mailbox Receive Interrupt Flag */
3080#define MBRIF22 0x40 /* Mailbox 22 Mailbox Receive Interrupt Flag */
3081#define MBRIF23 0x80 /* Mailbox 23 Mailbox Receive Interrupt Flag */
3082#define MBRIF24 0x100 /* Mailbox 24 Mailbox Receive Interrupt Flag */
3083#define MBRIF25 0x200 /* Mailbox 25 Mailbox Receive Interrupt Flag */
3084#define MBRIF26 0x400 /* Mailbox 26 Mailbox Receive Interrupt Flag */
3085#define MBRIF27 0x800 /* Mailbox 27 Mailbox Receive Interrupt Flag */
3086#define MBRIF28 0x1000 /* Mailbox 28 Mailbox Receive Interrupt Flag */
3087#define MBRIF29 0x2000 /* Mailbox 29 Mailbox Receive Interrupt Flag */
3088#define MBRIF30 0x4000 /* Mailbox 30 Mailbox Receive Interrupt Flag */
3089#define MBRIF31 0x8000 /* Mailbox 31 Mailbox Receive Interrupt Flag */
3090
3091/* Bit masks for EPPIx_STATUS */
3092
3093#define CFIFO_ERR 0x1 /* Chroma FIFO Error */
3094#define YFIFO_ERR 0x2 /* Luma FIFO Error */
3095#define LTERR_OVR 0x4 /* Line Track Overflow */
3096#define LTERR_UNDR 0x8 /* Line Track Underflow */
3097#define FTERR_OVR 0x10 /* Frame Track Overflow */
3098#define FTERR_UNDR 0x20 /* Frame Track Underflow */
3099#define ERR_NCOR 0x40 /* Preamble Error Not Corrected */
3100#define DMA1URQ 0x80 /* DMA1 Urgent Request */
3101#define DMA0URQ 0x100 /* DMA0 Urgent Request */
3102#define ERR_DET 0x4000 /* Preamble Error Detected */
3103#define FLD 0x8000 /* Field */
3104
3105/* Bit masks for EPPIx_CONTROL */
3106
3107#define EPPI_EN 0x1 /* Enable */
3108#define EPPI_DIR 0x2 /* Direction */
3109#define XFR_TYPE 0xc /* Operating Mode */
3110#define FS_CFG 0x30 /* Frame Sync Configuration */
3111#define FLD_SEL 0x40 /* Field Select/Trigger */
3112#define ITU_TYPE 0x80 /* ITU Interlaced or Progressive */
3113#define BLANKGEN 0x100 /* ITU Output Mode with Internal Blanking Generation */
3114#define ICLKGEN 0x200 /* Internal Clock Generation */
3115#define IFSGEN 0x400 /* Internal Frame Sync Generation */
3116#define POLC 0x1800 /* Frame Sync and Data Driving/Sampling Edges */
3117#define POLS 0x6000 /* Frame Sync Polarity */
3118#define DLENGTH 0x38000 /* Data Length */
3119#define SKIP_EN 0x40000 /* Skip Enable */
3120#define SKIP_EO 0x80000 /* Skip Even or Odd */
3121#define PACKEN 0x100000 /* Packing/Unpacking Enable */
3122#define SWAPEN 0x200000 /* Swap Enable */
3123#define SIGN_EXT 0x400000 /* Sign Extension or Zero-filled / Data Split Format */
3124#define SPLT_EVEN_ODD 0x800000 /* Split Even and Odd Data Samples */
3125#define SUBSPLT_ODD 0x1000000 /* Sub-split Odd Samples */
3126#define DMACFG 0x2000000 /* One or Two DMA Channels Mode */
3127#define RGB_FMT_EN 0x4000000 /* RGB Formatting Enable */
3128#define FIFO_RWM 0x18000000 /* FIFO Regular Watermarks */
3129#define FIFO_UWM 0x60000000 /* FIFO Urgent Watermarks */
3130
3131#define DLEN_8 (0 << 15) /* 000 - 8 bits */
3132#define DLEN_10 (1 << 15) /* 001 - 10 bits */
3133#define DLEN_12 (2 << 15) /* 010 - 12 bits */
3134#define DLEN_14 (3 << 15) /* 011 - 14 bits */
3135#define DLEN_16 (4 << 15) /* 100 - 16 bits */
3136#define DLEN_18 (5 << 15) /* 101 - 18 bits */
3137#define DLEN_24 (6 << 15) /* 110 - 24 bits */
3138
3139
3140/* Bit masks for EPPIx_FS2W_LVB */
3141
3142#define F1VB_BD 0xff /* Vertical Blanking before Field 1 Active Data */
3143#define F1VB_AD 0xff00 /* Vertical Blanking after Field 1 Active Data */
3144#define F2VB_BD 0xff0000 /* Vertical Blanking before Field 2 Active Data */
3145#define F2VB_AD 0xff000000 /* Vertical Blanking after Field 2 Active Data */
3146
3147/* Bit masks for EPPIx_FS2W_LAVF */
3148
3149#define F1_ACT 0xffff /* Number of Lines of Active Data in Field 1 */
3150#define F2_ACT 0xffff0000 /* Number of Lines of Active Data in Field 2 */
3151
3152/* Bit masks for EPPIx_CLIP */
3153
3154#define LOW_ODD 0xff /* Lower Limit for Odd Bytes (Chroma) */
3155#define HIGH_ODD 0xff00 /* Upper Limit for Odd Bytes (Chroma) */
3156#define LOW_EVEN 0xff0000 /* Lower Limit for Even Bytes (Luma) */
3157#define HIGH_EVEN 0xff000000 /* Upper Limit for Even Bytes (Luma) */
3158
3159/* Bit masks for SPIx_BAUD */
3160
3161#define SPI_BAUD 0xffff /* Baud Rate */
3162
3163/* Bit masks for SPIx_CTL */
3164
3165#define SPE 0x4000 /* SPI Enable */
3166#define WOM 0x2000 /* Write Open Drain Master */
3167#define MSTR 0x1000 /* Master Mode */
3168#define CPOL 0x800 /* Clock Polarity */
3169#define CPHA 0x400 /* Clock Phase */
3170#define LSBF 0x200 /* LSB First */
3171#define SIZE 0x100 /* Size of Words */
3172#define EMISO 0x20 /* Enable MISO Output */
3173#define PSSE 0x10 /* Slave-Select Enable */
3174#define GM 0x8 /* Get More Data */
3175#define SZ 0x4 /* Send Zero */
3176#define TIMOD 0x3 /* Transfer Initiation Mode */
3177
3178/* Bit masks for SPIx_FLG */
3179
3180#define FLS1 0x2 /* Slave Select Enable 1 */
3181#define FLS2 0x4 /* Slave Select Enable 2 */
3182#define FLS3 0x8 /* Slave Select Enable 3 */
3183#define FLG1 0x200 /* Slave Select Value 1 */
3184#define FLG2 0x400 /* Slave Select Value 2 */
3185#define FLG3 0x800 /* Slave Select Value 3 */
3186
3187/* Bit masks for SPIx_STAT */
3188
3189#define TXCOL 0x40 /* Transmit Collision Error */
3190#define RXS 0x20 /* RDBR Data Buffer Status */
3191#define RBSY 0x10 /* Receive Error */
3192#define TXS 0x8 /* TDBR Data Buffer Status */
3193#define TXE 0x4 /* Transmission Error */
3194#define MODF 0x2 /* Mode Fault Error */
3195#define SPIF 0x1 /* SPI Finished */
3196
3197/* Bit masks for SPIx_TDBR */
3198
3199#define TDBR 0xffff /* Transmit Data Buffer */
3200
3201/* Bit masks for SPIx_RDBR */
3202
3203#define RDBR 0xffff /* Receive Data Buffer */
3204
3205/* Bit masks for SPIx_SHADOW */
3206
3207#define SHADOW 0xffff /* RDBR Shadow */
3208
3209/* ************************************************ */
3210/* The TWI bit masks fields are from the ADSP-BF538 */
3211/* and they have not been verified as the final */
3212/* ones for the Moab processors ... bz 1/19/2007 */
3213/* ************************************************ */
3214
3215/* Bit masks for TWIx_CONTROL */
3216
3217#define PRESCALE 0x7f /* Prescale Value */
3218#define TWI_ENA 0x80 /* TWI Enable */
3219#define SCCB 0x200 /* Serial Camera Control Bus */
3220
3221/* Bit maskes for TWIx_CLKDIV */
3222
3223#define CLKLOW 0xff /* Clock Low */
3224#define CLKHI 0xff00 /* Clock High */
3225
3226/* Bit maskes for TWIx_SLAVE_CTL */
3227
3228#define SEN 0x1 /* Slave Enable */
3229#define STDVAL 0x4 /* Slave Transmit Data Valid */
3230#define NAK 0x8 /* Not Acknowledge */
3231#define GEN 0x10 /* General Call Enable */
3232
3233/* Bit maskes for TWIx_SLAVE_ADDR */
3234
3235#define SADDR 0x7f /* Slave Mode Address */
3236
3237/* Bit maskes for TWIx_SLAVE_STAT */
3238
3239#define SDIR 0x1 /* Slave Transfer Direction */
3240#define GCALL 0x2 /* General Call */
3241
3242/* Bit maskes for TWIx_MASTER_CTL */
3243
3244#define MEN 0x1 /* Master Mode Enable */
3245#define MDIR 0x4 /* Master Transfer Direction */
3246#define FAST 0x8 /* Fast Mode */
3247#define STOP 0x10 /* Issue Stop Condition */
3248#define RSTART 0x20 /* Repeat Start */
3249#define DCNT 0x3fc0 /* Data Transfer Count */
3250#define SDAOVR 0x4000 /* Serial Data Override */
3251#define SCLOVR 0x8000 /* Serial Clock Override */
3252
3253/* Bit maskes for TWIx_MASTER_ADDR */
3254
3255#define MADDR 0x7f /* Master Mode Address */
3256
3257/* Bit maskes for TWIx_MASTER_STAT */
3258
3259#define MPROG 0x1 /* Master Transfer in Progress */
3260#define LOSTARB 0x2 /* Lost Arbitration */
3261#define ANAK 0x4 /* Address Not Acknowledged */
3262#define DNAK 0x8 /* Data Not Acknowledged */
3263#define BUFRDERR 0x10 /* Buffer Read Error */
3264#define BUFWRERR 0x20 /* Buffer Write Error */
3265#define SDASEN 0x40 /* Serial Data Sense */
3266#define SCLSEN 0x80 /* Serial Clock Sense */
3267#define BUSBUSY 0x100 /* Bus Busy */
3268
3269/* Bit maskes for TWIx_FIFO_CTL */
3270
3271#define XMTFLUSH 0x1 /* Transmit Buffer Flush */
3272#define RCVFLUSH 0x2 /* Receive Buffer Flush */
3273#define XMTINTLEN 0x4 /* Transmit Buffer Interrupt Length */
3274#define RCVINTLEN 0x8 /* Receive Buffer Interrupt Length */
3275
3276/* Bit maskes for TWIx_FIFO_STAT */
3277
3278#define XMTSTAT 0x3 /* Transmit FIFO Status */
3279#define RCVSTAT 0xc /* Receive FIFO Status */
3280
3281/* Bit maskes for TWIx_INT_MASK */
3282
3283#define SINITM 0x1 /* Slave Transfer Initiated Interrupt Mask */
3284#define SCOMPM 0x2 /* Slave Transfer Complete Interrupt Mask */
3285#define SERRM 0x4 /* Slave Transfer Error Interrupt Mask */
3286#define SOVFM 0x8 /* Slave Overflow Interrupt Mask */
3287#define MCOMPM 0x10 /* Master Transfer Complete Interrupt Mask */
3288#define MERRM 0x20 /* Master Transfer Error Interrupt Mask */
3289#define XMTSERVM 0x40 /* Transmit FIFO Service Interrupt Mask */
3290#define RCVSERVM 0x80 /* Receive FIFO Service Interrupt Mask */
3291
3292/* Bit maskes for TWIx_INT_STAT */
3293
3294#define SINIT 0x1 /* Slave Transfer Initiated */
3295#define SCOMP 0x2 /* Slave Transfer Complete */
3296#define SERR 0x4 /* Slave Transfer Error */
3297#define SOVF 0x8 /* Slave Overflow */
3298#define MCOMP 0x10 /* Master Transfer Complete */
3299#define MERR 0x20 /* Master Transfer Error */
3300#define XMTSERV 0x40 /* Transmit FIFO Service */
3301#define RCVSERV 0x80 /* Receive FIFO Service */
3302
3303/* Bit maskes for TWIx_XMT_DATA8 */
3304
3305#define XMTDATA8 0xff /* Transmit FIFO 8-Bit Data */
3306
3307/* Bit maskes for TWIx_XMT_DATA16 */
3308
3309#define XMTDATA16 0xffff /* Transmit FIFO 16-Bit Data */
3310
3311/* Bit maskes for TWIx_RCV_DATA8 */
3312
3313#define RCVDATA8 0xff /* Receive FIFO 8-Bit Data */
3314
3315/* Bit maskes for TWIx_RCV_DATA16 */
3316
3317#define RCVDATA16 0xffff /* Receive FIFO 16-Bit Data */
3318
3319/* Bit masks for SPORTx_TCR1 */
3320
3321#define TCKFE 0x4000 /* Clock Falling Edge Select */
3322#define LATFS 0x2000 /* Late Transmit Frame Sync */
3323#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
3324#define DITFS 0x800 /* Data-Independent Transmit Frame Sync Select */
3325#define TFSR 0x400 /* Transmit Frame Sync Required Select */
3326#define ITFS 0x200 /* Internal Transmit Frame Sync Select */
3327#define TLSBIT 0x10 /* Transmit Bit Order */
3328#define TDTYPE 0xc /* Data Formatting Type Select */
3329#define ITCLK 0x2 /* Internal Transmit Clock Select */
3330#define TSPEN 0x1 /* Transmit Enable */
3331
3332/* Bit masks for SPORTx_TCR2 */
3333
3334#define TRFST 0x400 /* Left/Right Order */
3335#define TSFSE 0x200 /* Transmit Stereo Frame Sync Enable */
3336#define TXSE 0x100 /* TxSEC Enable */
3337#define SLEN_T 0x1f /* SPORT Word Length */
3338
3339/* Bit masks for SPORTx_RCR1 */
3340
3341#define RCKFE 0x4000 /* Clock Falling Edge Select */
3342#define LARFS 0x2000 /* Late Receive Frame Sync */
3343#define LRFS 0x1000 /* Low Receive Frame Sync Select */
3344#define RFSR 0x400 /* Receive Frame Sync Required Select */
3345#define IRFS 0x200 /* Internal Receive Frame Sync Select */
3346#define RLSBIT 0x10 /* Receive Bit Order */
3347#define RDTYPE 0xc /* Data Formatting Type Select */
3348#define IRCLK 0x2 /* Internal Receive Clock Select */
3349#define RSPEN 0x1 /* Receive Enable */
3350
3351/* Bit masks for SPORTx_RCR2 */
3352
3353#define RRFST 0x400 /* Left/Right Order */
3354#define RSFSE 0x200 /* Receive Stereo Frame Sync Enable */
3355#define RXSE 0x100 /* RxSEC Enable */
3356#define SLEN_R 0x1f /* SPORT Word Length */
3357
3358/* Bit masks for SPORTx_STAT */
3359
3360#define TXHRE 0x40 /* Transmit Hold Register Empty */
3361#define TOVF 0x20 /* Sticky Transmit Overflow Status */
3362#define TUVF 0x10 /* Sticky Transmit Underflow Status */
3363#define TXF 0x8 /* Transmit FIFO Full Status */
3364#define ROVF 0x4 /* Sticky Receive Overflow Status */
3365#define RUVF 0x2 /* Sticky Receive Underflow Status */
3366#define RXNE 0x1 /* Receive FIFO Not Empty Status */
3367
3368/* Bit masks for SPORTx_MCMC1 */
3369
3370#define SP_WSIZE 0xf000 /* Window Size */
3371#define SP_WOFF 0x3ff /* Windows Offset */
3372
3373/* Bit masks for SPORTx_MCMC2 */
3374
3375#define MFD 0xf000 /* Multi channel Frame Delay */
3376#define FSDR 0x80 /* Frame Sync to Data Relationship */
3377#define MCMEN 0x10 /* Multi channel Frame Mode Enable */
3378#define MCDRXPE 0x8 /* Multi channel DMA Receive Packing */
3379#define MCDTXPE 0x4 /* Multi channel DMA Transmit Packing */
3380#define MCCRM 0x3 /* 2X Clock Recovery Mode */
3381
3382/* Bit masks for SPORTx_CHNL */
3383
3384#define CUR_CHNL 0x3ff /* Current Channel Indicator */
3385
3386/* Bit masks for UARTx_LCR */
3387
3388#if 0
3389/* conflicts with legacy one in last section */
3390#define WLS 0x3 /* Word Length Select */
3391#endif
3392#define STB 0x4 /* Stop Bits */
3393#define PEN 0x8 /* Parity Enable */
3394#define EPS 0x10 /* Even Parity Select */
3395#define STP 0x20 /* Sticky Parity */
3396#define SB 0x40 /* Set Break */
3397
3398/* Bit masks for UARTx_MCR */
3399
3400#define XOFF 0x1 /* Transmitter Off */
3401#define MRTS 0x2 /* Manual Request To Send */
3402#define RFIT 0x4 /* Receive FIFO IRQ Threshold */
3403#define RFRT 0x8 /* Receive FIFO RTS Threshold */
3404#define LOOP_ENA 0x10 /* Loopback Mode Enable */
3405#define FCPOL 0x20 /* Flow Control Pin Polarity */
3406#define ARTS 0x40 /* Automatic Request To Send */
3407#define ACTS 0x80 /* Automatic Clear To Send */
3408
3409/* Bit masks for UARTx_LSR */
3410
3411#define DR 0x1 /* Data Ready */
3412#define OE 0x2 /* Overrun Error */
3413#define PE 0x4 /* Parity Error */
3414#define FE 0x8 /* Framing Error */
3415#define BI 0x10 /* Break Interrupt */
3416#define THRE 0x20 /* THR Empty */
3417#define TEMT 0x40 /* Transmitter Empty */
3418#define TFI 0x80 /* Transmission Finished Indicator */
3419
3420/* Bit masks for UARTx_MSR */
3421
3422#define SCTS 0x1 /* Sticky CTS */
3423#define CTS 0x10 /* Clear To Send */
3424#define RFCS 0x20 /* Receive FIFO Count Status */
3425
3426/* Bit masks for UARTx_IER_SET & UARTx_IER_CLEAR */
3427
3428#define ERBFI 0x1 /* Enable Receive Buffer Full Interrupt */
3429#define ETBEI 0x2 /* Enable Transmit Buffer Empty Interrupt */
3430#define ELSI 0x4 /* Enable Receive Status Interrupt */
3431#define EDSSI 0x8 /* Enable Modem Status Interrupt */
3432#define EDTPTI 0x10 /* Enable DMA Transmit PIRQ Interrupt */
3433#define ETFI 0x20 /* Enable Transmission Finished Interrupt */
3434#define ERFCI 0x40 /* Enable Receive FIFO Count Interrupt */
3435
3436/* Bit masks for UARTx_GCTL */
3437
3438#define UCEN 0x1 /* UART Enable */
3439#define IREN 0x2 /* IrDA Mode Enable */
3440#define TPOLC 0x4 /* IrDA TX Polarity Change */
3441#define RPOLC 0x8 /* IrDA RX Polarity Change */
3442#define FPE 0x10 /* Force Parity Error */
3443#define FFE 0x20 /* Force Framing Error */
3444#define EDBO 0x40 /* Enable Divide-by-One */
3445#define EGLSI 0x80 /* Enable Global LS Interrupt */
3446
3447
3448/* ******************************************* */
3449/* MULTI BIT MACRO ENUMERATIONS */
3450/* ******************************************* */
3451
3452/* BCODE bit field options (SYSCFG register) */
3453
3454#define BCODE_WAKEUP 0x0000 /* boot according to wake-up condition */
3455#define BCODE_FULLBOOT 0x0010 /* always perform full boot */
3456#define BCODE_QUICKBOOT 0x0020 /* always perform quick boot */
3457#define BCODE_NOBOOT 0x0030 /* always perform full boot */
3458
3459/* CNT_COMMAND bit field options */
3460
3461#define W1LCNT_ZERO 0x0001 /* write 1 to load CNT_COUNTER with zero */
3462#define W1LCNT_MIN 0x0004 /* write 1 to load CNT_COUNTER from CNT_MIN */
3463#define W1LCNT_MAX 0x0008 /* write 1 to load CNT_COUNTER from CNT_MAX */
3464
3465#define W1LMIN_ZERO 0x0010 /* write 1 to load CNT_MIN with zero */
3466#define W1LMIN_CNT 0x0020 /* write 1 to load CNT_MIN from CNT_COUNTER */
3467#define W1LMIN_MAX 0x0080 /* write 1 to load CNT_MIN from CNT_MAX */
3468
3469#define W1LMAX_ZERO 0x0100 /* write 1 to load CNT_MAX with zero */
3470#define W1LMAX_CNT 0x0200 /* write 1 to load CNT_MAX from CNT_COUNTER */
3471#define W1LMAX_MIN 0x0400 /* write 1 to load CNT_MAX from CNT_MIN */
3472
3473/* CNT_CONFIG bit field options */
3474
3475#define CNTMODE_QUADENC 0x0000 /* quadrature encoder mode */
3476#define CNTMODE_BINENC 0x0100 /* binary encoder mode */
3477#define CNTMODE_UDCNT 0x0200 /* up/down counter mode */
3478#define CNTMODE_DIRCNT 0x0400 /* direction counter mode */
3479#define CNTMODE_DIRTMR 0x0500 /* direction timer mode */
3480
3481#define BNDMODE_COMP 0x0000 /* boundary compare mode */
3482#define BNDMODE_ZERO 0x1000 /* boundary compare and zero mode */
3483#define BNDMODE_CAPT 0x2000 /* boundary capture mode */
3484#define BNDMODE_AEXT 0x3000 /* boundary auto-extend mode */
3485
3486/* TMODE in TIMERx_CONFIG bit field options */
3487
3488#define PWM_OUT 0x0001
3489#define WDTH_CAP 0x0002
3490#define EXT_CLK 0x0003
3491
3492/* UARTx_LCR bit field options */
3493
3494#define WLS_5 0x0000 /* 5 data bits */
3495#define WLS_6 0x0001 /* 6 data bits */
3496#define WLS_7 0x0002 /* 7 data bits */
3497#define WLS_8 0x0003 /* 8 data bits */
3498
3499/* PINTx Register Bit Definitions */
3500
3501#define PIQ0 0x00000001
3502#define PIQ1 0x00000002
3503#define PIQ2 0x00000004
3504#define PIQ3 0x00000008
3505
3506#define PIQ4 0x00000010
3507#define PIQ5 0x00000020
3508#define PIQ6 0x00000040
3509#define PIQ7 0x00000080
3510
3511#define PIQ8 0x00000100
3512#define PIQ9 0x00000200
3513#define PIQ10 0x00000400
3514#define PIQ11 0x00000800
3515
3516#define PIQ12 0x00001000
3517#define PIQ13 0x00002000
3518#define PIQ14 0x00004000
3519#define PIQ15 0x00008000
3520
3521#define PIQ16 0x00010000
3522#define PIQ17 0x00020000
3523#define PIQ18 0x00040000
3524#define PIQ19 0x00080000
3525
3526#define PIQ20 0x00100000
3527#define PIQ21 0x00200000
3528#define PIQ22 0x00400000
3529#define PIQ23 0x00800000
3530
3531#define PIQ24 0x01000000
3532#define PIQ25 0x02000000
3533#define PIQ26 0x04000000
3534#define PIQ27 0x08000000
3535
3536#define PIQ28 0x10000000
3537#define PIQ29 0x20000000
3538#define PIQ30 0x40000000
3539#define PIQ31 0x80000000
3540
3541/* PORT A Bit Definitions for the registers
3542PORTA, PORTA_SET, PORTA_CLEAR,
3543PORTA_DIR_SET, PORTA_DIR_CLEAR, PORTA_INEN,
3544PORTA_FER registers
3545*/
3546
3547#define PA0 0x0001
3548#define PA1 0x0002
3549#define PA2 0x0004
3550#define PA3 0x0008
3551#define PA4 0x0010
3552#define PA5 0x0020
3553#define PA6 0x0040
3554#define PA7 0x0080
3555#define PA8 0x0100
3556#define PA9 0x0200
3557#define PA10 0x0400
3558#define PA11 0x0800
3559#define PA12 0x1000
3560#define PA13 0x2000
3561#define PA14 0x4000
3562#define PA15 0x8000
3563
3564/* PORT B Bit Definitions for the registers
3565PORTB, PORTB_SET, PORTB_CLEAR,
3566PORTB_DIR_SET, PORTB_DIR_CLEAR, PORTB_INEN,
3567PORTB_FER registers
3568*/
3569
3570#define PB0 0x0001
3571#define PB1 0x0002
3572#define PB2 0x0004
3573#define PB3 0x0008
3574#define PB4 0x0010
3575#define PB5 0x0020
3576#define PB6 0x0040
3577#define PB7 0x0080
3578#define PB8 0x0100
3579#define PB9 0x0200
3580#define PB10 0x0400
3581#define PB11 0x0800
3582#define PB12 0x1000
3583#define PB13 0x2000
3584#define PB14 0x4000
3585
3586
3587/* PORT C Bit Definitions for the registers
3588PORTC, PORTC_SET, PORTC_CLEAR,
3589PORTC_DIR_SET, PORTC_DIR_CLEAR, PORTC_INEN,
3590PORTC_FER registers
3591*/
3592
3593
3594#define PC0 0x0001
3595#define PC1 0x0002
3596#define PC2 0x0004
3597#define PC3 0x0008
3598#define PC4 0x0010
3599#define PC5 0x0020
3600#define PC6 0x0040
3601#define PC7 0x0080
3602#define PC8 0x0100
3603#define PC9 0x0200
3604#define PC10 0x0400
3605#define PC11 0x0800
3606#define PC12 0x1000
3607#define PC13 0x2000
3608
3609
3610/* PORT D Bit Definitions for the registers
3611PORTD, PORTD_SET, PORTD_CLEAR,
3612PORTD_DIR_SET, PORTD_DIR_CLEAR, PORTD_INEN,
3613PORTD_FER registers
3614*/
3615
3616#define PD0 0x0001
3617#define PD1 0x0002
3618#define PD2 0x0004
3619#define PD3 0x0008
3620#define PD4 0x0010
3621#define PD5 0x0020
3622#define PD6 0x0040
3623#define PD7 0x0080
3624#define PD8 0x0100
3625#define PD9 0x0200
3626#define PD10 0x0400
3627#define PD11 0x0800
3628#define PD12 0x1000
3629#define PD13 0x2000
3630#define PD14 0x4000
3631#define PD15 0x8000
3632
3633/* PORT E Bit Definitions for the registers
3634PORTE, PORTE_SET, PORTE_CLEAR,
3635PORTE_DIR_SET, PORTE_DIR_CLEAR, PORTE_INEN,
3636PORTE_FER registers
3637*/
3638
3639
3640#define PE0 0x0001
3641#define PE1 0x0002
3642#define PE2 0x0004
3643#define PE3 0x0008
3644#define PE4 0x0010
3645#define PE5 0x0020
3646#define PE6 0x0040
3647#define PE7 0x0080
3648#define PE8 0x0100
3649#define PE9 0x0200
3650#define PE10 0x0400
3651#define PE11 0x0800
3652#define PE12 0x1000
3653#define PE13 0x2000
3654#define PE14 0x4000
3655#define PE15 0x8000
3656
3657/* PORT F Bit Definitions for the registers
3658PORTF, PORTF_SET, PORTF_CLEAR,
3659PORTF_DIR_SET, PORTF_DIR_CLEAR, PORTF_INEN,
3660PORTF_FER registers
3661*/
3662
3663
3664#define PF0 0x0001
3665#define PF1 0x0002
3666#define PF2 0x0004
3667#define PF3 0x0008
3668#define PF4 0x0010
3669#define PF5 0x0020
3670#define PF6 0x0040
3671#define PF7 0x0080
3672#define PF8 0x0100
3673#define PF9 0x0200
3674#define PF10 0x0400
3675#define PF11 0x0800
3676#define PF12 0x1000
3677#define PF13 0x2000
3678#define PF14 0x4000
3679#define PF15 0x8000
3680
3681/* PORT G Bit Definitions for the registers
3682PORTG, PORTG_SET, PORTG_CLEAR,
3683PORTG_DIR_SET, PORTG_DIR_CLEAR, PORTG_INEN,
3684PORTG_FER registers
3685*/
3686
3687
3688#define PG0 0x0001
3689#define PG1 0x0002
3690#define PG2 0x0004
3691#define PG3 0x0008
3692#define PG4 0x0010
3693#define PG5 0x0020
3694#define PG6 0x0040
3695#define PG7 0x0080
3696#define PG8 0x0100
3697#define PG9 0x0200
3698#define PG10 0x0400
3699#define PG11 0x0800
3700#define PG12 0x1000
3701#define PG13 0x2000
3702#define PG14 0x4000
3703#define PG15 0x8000
3704
3705/* PORT H Bit Definitions for the registers
3706PORTH, PORTH_SET, PORTH_CLEAR,
3707PORTH_DIR_SET, PORTH_DIR_CLEAR, PORTH_INEN,
3708PORTH_FER registers
3709*/
3710
3711
3712#define PH0 0x0001
3713#define PH1 0x0002
3714#define PH2 0x0004
3715#define PH3 0x0008
3716#define PH4 0x0010
3717#define PH5 0x0020
3718#define PH6 0x0040
3719#define PH7 0x0080
3720#define PH8 0x0100
3721#define PH9 0x0200
3722#define PH10 0x0400
3723#define PH11 0x0800
3724#define PH12 0x1000
3725#define PH13 0x2000
3726
3727
3728/* PORT I Bit Definitions for the registers
3729PORTI, PORTI_SET, PORTI_CLEAR,
3730PORTI_DIR_SET, PORTI_DIR_CLEAR, PORTI_INEN,
3731PORTI_FER registers
3732*/
3733
3734
3735#define PI0 0x0001
3736#define PI1 0x0002
3737#define PI2 0x0004
3738#define PI3 0x0008
3739#define PI4 0x0010
3740#define PI5 0x0020
3741#define PI6 0x0040
3742#define PI7 0x0080
3743#define PI8 0x0100
3744#define PI9 0x0200
3745#define PI10 0x0400
3746#define PI11 0x0800
3747#define PI12 0x1000
3748#define PI13 0x2000
3749#define PI14 0x4000
3750#define PI15 0x8000
3751
3752/* PORT J Bit Definitions for the registers
3753PORTJ, PORTJ_SET, PORTJ_CLEAR,
3754PORTJ_DIR_SET, PORTJ_DIR_CLEAR, PORTJ_INEN,
3755PORTJ_FER registers
3756*/
3757
3758
3759#define PJ0 0x0001
3760#define PJ1 0x0002
3761#define PJ2 0x0004
3762#define PJ3 0x0008
3763#define PJ4 0x0010
3764#define PJ5 0x0020
3765#define PJ6 0x0040
3766#define PJ7 0x0080
3767#define PJ8 0x0100
3768#define PJ9 0x0200
3769#define PJ10 0x0400
3770#define PJ11 0x0800
3771#define PJ12 0x1000
3772#define PJ13 0x2000
3773
3774
3775/* Port Muxing Bit Fields for PORTx_MUX Registers */
3776
3777#define MUX0 0x00000003
3778#define MUX0_0 0x00000000
3779#define MUX0_1 0x00000001
3780#define MUX0_2 0x00000002
3781#define MUX0_3 0x00000003
3782
3783#define MUX1 0x0000000C
3784#define MUX1_0 0x00000000
3785#define MUX1_1 0x00000004
3786#define MUX1_2 0x00000008
3787#define MUX1_3 0x0000000C
3788
3789#define MUX2 0x00000030
3790#define MUX2_0 0x00000000
3791#define MUX2_1 0x00000010
3792#define MUX2_2 0x00000020
3793#define MUX2_3 0x00000030
3794
3795#define MUX3 0x000000C0
3796#define MUX3_0 0x00000000
3797#define MUX3_1 0x00000040
3798#define MUX3_2 0x00000080
3799#define MUX3_3 0x000000C0
3800
3801#define MUX4 0x00000300
3802#define MUX4_0 0x00000000
3803#define MUX4_1 0x00000100
3804#define MUX4_2 0x00000200
3805#define MUX4_3 0x00000300
3806
3807#define MUX5 0x00000C00
3808#define MUX5_0 0x00000000
3809#define MUX5_1 0x00000400
3810#define MUX5_2 0x00000800
3811#define MUX5_3 0x00000C00
3812
3813#define MUX6 0x00003000
3814#define MUX6_0 0x00000000
3815#define MUX6_1 0x00001000
3816#define MUX6_2 0x00002000
3817#define MUX6_3 0x00003000
3818
3819#define MUX7 0x0000C000
3820#define MUX7_0 0x00000000
3821#define MUX7_1 0x00004000
3822#define MUX7_2 0x00008000
3823#define MUX7_3 0x0000C000
3824
3825#define MUX8 0x00030000
3826#define MUX8_0 0x00000000
3827#define MUX8_1 0x00010000
3828#define MUX8_2 0x00020000
3829#define MUX8_3 0x00030000
3830
3831#define MUX9 0x000C0000
3832#define MUX9_0 0x00000000
3833#define MUX9_1 0x00040000
3834#define MUX9_2 0x00080000
3835#define MUX9_3 0x000C0000
3836
3837#define MUX10 0x00300000
3838#define MUX10_0 0x00000000
3839#define MUX10_1 0x00100000
3840#define MUX10_2 0x00200000
3841#define MUX10_3 0x00300000
3842
3843#define MUX11 0x00C00000
3844#define MUX11_0 0x00000000
3845#define MUX11_1 0x00400000
3846#define MUX11_2 0x00800000
3847#define MUX11_3 0x00C00000
3848
3849#define MUX12 0x03000000
3850#define MUX12_0 0x00000000
3851#define MUX12_1 0x01000000
3852#define MUX12_2 0x02000000
3853#define MUX12_3 0x03000000
3854
3855#define MUX13 0x0C000000
3856#define MUX13_0 0x00000000
3857#define MUX13_1 0x04000000
3858#define MUX13_2 0x08000000
3859#define MUX13_3 0x0C000000
3860
3861#define MUX14 0x30000000
3862#define MUX14_0 0x00000000
3863#define MUX14_1 0x10000000
3864#define MUX14_2 0x20000000
3865#define MUX14_3 0x30000000
3866
3867#define MUX15 0xC0000000
3868#define MUX15_0 0x00000000
3869#define MUX15_1 0x40000000
3870#define MUX15_2 0x80000000
3871#define MUX15_3 0xC0000000
3872
3873#define MUX(b15,b14,b13,b12,b11,b10,b9,b8,b7,b6,b5,b4,b3,b2,b1,b0) \
3874 ((((b15)&3) << 30) | \
3875 (((b14)&3) << 28) | \
3876 (((b13)&3) << 26) | \
3877 (((b12)&3) << 24) | \
3878 (((b11)&3) << 22) | \
3879 (((b10)&3) << 20) | \
3880 (((b9) &3) << 18) | \
3881 (((b8) &3) << 16) | \
3882 (((b7) &3) << 14) | \
3883 (((b6) &3) << 12) | \
3884 (((b5) &3) << 10) | \
3885 (((b4) &3) << 8) | \
3886 (((b3) &3) << 6) | \
3887 (((b2) &3) << 4) | \
3888 (((b1) &3) << 2) | \
3889 (((b0) &3)))
3890
3891/* Bit fields for PINT0_ASSIGN and PINT1_ASSIGN registers */
3892
3893#define B0MAP 0x000000FF /* Byte 0 Lower Half Port Mapping */
3894#define B0MAP_PAL 0x00000000 /* Map Port A Low to Byte 0 */
3895#define B0MAP_PBL 0x00000001 /* Map Port B Low to Byte 0 */
3896#define B1MAP 0x0000FF00 /* Byte 1 Upper Half Port Mapping */
3897#define B1MAP_PAH 0x00000000 /* Map Port A High to Byte 1 */
3898#define B1MAP_PBH 0x00000100 /* Map Port B High to Byte 1 */
3899#define B2MAP 0x00FF0000 /* Byte 2 Lower Half Port Mapping */
3900#define B2MAP_PAL 0x00000000 /* Map Port A Low to Byte 2 */
3901#define B2MAP_PBL 0x00010000 /* Map Port B Low to Byte 2 */
3902#define B3MAP 0xFF000000 /* Byte 3 Upper Half Port Mapping */
3903#define B3MAP_PAH 0x00000000 /* Map Port A High to Byte 3 */
3904#define B3MAP_PBH 0x01000000 /* Map Port B High to Byte 3 */
3905
3906/* Bit fields for PINT2_ASSIGN and PINT3_ASSIGN registers */
3907
3908#define B0MAP_PCL 0x00000000 /* Map Port C Low to Byte 0 */
3909#define B0MAP_PDL 0x00000001 /* Map Port D Low to Byte 0 */
3910#define B0MAP_PEL 0x00000002 /* Map Port E Low to Byte 0 */
3911#define B0MAP_PFL 0x00000003 /* Map Port F Low to Byte 0 */
3912#define B0MAP_PGL 0x00000004 /* Map Port G Low to Byte 0 */
3913#define B0MAP_PHL 0x00000005 /* Map Port H Low to Byte 0 */
3914#define B0MAP_PIL 0x00000006 /* Map Port I Low to Byte 0 */
3915#define B0MAP_PJL 0x00000007 /* Map Port J Low to Byte 0 */
3916
3917#define B1MAP_PCH 0x00000000 /* Map Port C High to Byte 1 */
3918#define B1MAP_PDH 0x00000100 /* Map Port D High to Byte 1 */
3919#define B1MAP_PEH 0x00000200 /* Map Port E High to Byte 1 */
3920#define B1MAP_PFH 0x00000300 /* Map Port F High to Byte 1 */
3921#define B1MAP_PGH 0x00000400 /* Map Port G High to Byte 1 */
3922#define B1MAP_PHH 0x00000500 /* Map Port H High to Byte 1 */
3923#define B1MAP_PIH 0x00000600 /* Map Port I High to Byte 1 */
3924#define B1MAP_PJH 0x00000700 /* Map Port J High to Byte 1 */
3925
3926#define B2MAP_PCL 0x00000000 /* Map Port C Low to Byte 2 */
3927#define B2MAP_PDL 0x00010000 /* Map Port D Low to Byte 2 */
3928#define B2MAP_PEL 0x00020000 /* Map Port E Low to Byte 2 */
3929#define B2MAP_PFL 0x00030000 /* Map Port F Low to Byte 2 */
3930#define B2MAP_PGL 0x00040000 /* Map Port G Low to Byte 2 */
3931#define B2MAP_PHL 0x00050000 /* Map Port H Low to Byte 2 */
3932#define B2MAP_PIL 0x00060000 /* Map Port I Low to Byte 2 */
3933#define B2MAP_PJL 0x00070000 /* Map Port J Low to Byte 2 */
3934
3935#define B3MAP_PCH 0x00000000 /* Map Port C High to Byte 3 */
3936#define B3MAP_PDH 0x01000000 /* Map Port D High to Byte 3 */
3937#define B3MAP_PEH 0x02000000 /* Map Port E High to Byte 3 */
3938#define B3MAP_PFH 0x03000000 /* Map Port F High to Byte 3 */
3939#define B3MAP_PGH 0x04000000 /* Map Port G High to Byte 3 */
3940#define B3MAP_PHH 0x05000000 /* Map Port H High to Byte 3 */
3941#define B3MAP_PIH 0x06000000 /* Map Port I High to Byte 3 */
3942#define B3MAP_PJH 0x07000000 /* Map Port J High to Byte 3 */
3943
3944
3945/* for legacy compatibility */
3946
3947#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
3948#define W1LMAX_MAX W1LMAX_MIN
3949#define EBIU_AMCBCTL0 EBIU_AMBCTL0
3950#define EBIU_AMCBCTL1 EBIU_AMBCTL1
3951#define PINT0_IRQ PINT0_REQUEST
3952#define PINT1_IRQ PINT1_REQUEST
3953#define PINT2_IRQ PINT2_REQUEST
3954#define PINT3_IRQ PINT3_REQUEST
3955
3956#endif /* _DEF_BF54X_H */
diff --git a/include/asm-blackfin/mach-bf548/dma.h b/include/asm-blackfin/mach-bf548/dma.h
deleted file mode 100644
index 36a2ef7e7849..000000000000
--- a/include/asm-blackfin/mach-bf548/dma.h
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf548/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 CH_SPORT0_RX 0
36#define CH_SPORT0_TX 1
37#define CH_SPORT1_RX 2
38#define CH_SPORT1_TX 3
39#define CH_SPI0 4
40#define CH_SPI1 5
41#define CH_UART0_RX 6
42#define CH_UART0_TX 7
43#define CH_UART1_RX 8
44#define CH_UART1_TX 9
45#define CH_ATAPI_RX 10
46#define CH_ATAPI_TX 11
47#define CH_EPPI0 12
48#define CH_EPPI1 13
49#define CH_EPPI2 14
50#define CH_PIXC_IMAGE 15
51#define CH_PIXC_OVERLAY 16
52#define CH_PIXC_OUTPUT 17
53#define CH_SPORT2_RX 18
54#define CH_UART2_RX 18
55#define CH_SPORT2_TX 19
56#define CH_UART2_TX 19
57#define CH_SPORT3_RX 20
58#define CH_UART3_RX 20
59#define CH_SPORT3_TX 21
60#define CH_UART3_TX 21
61#define CH_SDH 22
62#define CH_NFC 22
63#define CH_SPI2 23
64
65#define CH_MEM_STREAM0_DEST 24
66#define CH_MEM_STREAM0_SRC 25
67#define CH_MEM_STREAM1_DEST 26
68#define CH_MEM_STREAM1_SRC 27
69#define CH_MEM_STREAM2_DEST 28
70#define CH_MEM_STREAM2_SRC 29
71#define CH_MEM_STREAM3_DEST 30
72#define CH_MEM_STREAM3_SRC 31
73
74#define MAX_BLACKFIN_DMA_CHANNEL 32
75
76#endif
diff --git a/include/asm-blackfin/mach-bf548/gpio.h b/include/asm-blackfin/mach-bf548/gpio.h
deleted file mode 100644
index bba82dc75f16..000000000000
--- a/include/asm-blackfin/mach-bf548/gpio.h
+++ /dev/null
@@ -1,219 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/gpio.h
3 * Based on:
4 * Author: Michael Hennerich (hennerich@blackfin.uclinux.org)
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
32#define GPIO_PA0 0
33#define GPIO_PA1 1
34#define GPIO_PA2 2
35#define GPIO_PA3 3
36#define GPIO_PA4 4
37#define GPIO_PA5 5
38#define GPIO_PA6 6
39#define GPIO_PA7 7
40#define GPIO_PA8 8
41#define GPIO_PA9 9
42#define GPIO_PA10 10
43#define GPIO_PA11 11
44#define GPIO_PA12 12
45#define GPIO_PA13 13
46#define GPIO_PA14 14
47#define GPIO_PA15 15
48#define GPIO_PB0 16
49#define GPIO_PB1 17
50#define GPIO_PB2 18
51#define GPIO_PB3 19
52#define GPIO_PB4 20
53#define GPIO_PB5 21
54#define GPIO_PB6 22
55#define GPIO_PB7 23
56#define GPIO_PB8 24
57#define GPIO_PB9 25
58#define GPIO_PB10 26
59#define GPIO_PB11 27
60#define GPIO_PB12 28
61#define GPIO_PB13 29
62#define GPIO_PB14 30
63#define GPIO_PB15 31 /* N/A */
64#define GPIO_PC0 32
65#define GPIO_PC1 33
66#define GPIO_PC2 34
67#define GPIO_PC3 35
68#define GPIO_PC4 36
69#define GPIO_PC5 37
70#define GPIO_PC6 38
71#define GPIO_PC7 39
72#define GPIO_PC8 40
73#define GPIO_PC9 41
74#define GPIO_PC10 42
75#define GPIO_PC11 43
76#define GPIO_PC12 44
77#define GPIO_PC13 45
78#define GPIO_PC14 46 /* N/A */
79#define GPIO_PC15 47 /* N/A */
80#define GPIO_PD0 48
81#define GPIO_PD1 49
82#define GPIO_PD2 50
83#define GPIO_PD3 51
84#define GPIO_PD4 52
85#define GPIO_PD5 53
86#define GPIO_PD6 54
87#define GPIO_PD7 55
88#define GPIO_PD8 56
89#define GPIO_PD9 57
90#define GPIO_PD10 58
91#define GPIO_PD11 59
92#define GPIO_PD12 60
93#define GPIO_PD13 61
94#define GPIO_PD14 62
95#define GPIO_PD15 63
96#define GPIO_PE0 64
97#define GPIO_PE1 65
98#define GPIO_PE2 66
99#define GPIO_PE3 67
100#define GPIO_PE4 68
101#define GPIO_PE5 69
102#define GPIO_PE6 70
103#define GPIO_PE7 71
104#define GPIO_PE8 72
105#define GPIO_PE9 73
106#define GPIO_PE10 74
107#define GPIO_PE11 75
108#define GPIO_PE12 76
109#define GPIO_PE13 77
110#define GPIO_PE14 78
111#define GPIO_PE15 79
112#define GPIO_PF0 80
113#define GPIO_PF1 81
114#define GPIO_PF2 82
115#define GPIO_PF3 83
116#define GPIO_PF4 84
117#define GPIO_PF5 85
118#define GPIO_PF6 86
119#define GPIO_PF7 87
120#define GPIO_PF8 88
121#define GPIO_PF9 89
122#define GPIO_PF10 90
123#define GPIO_PF11 91
124#define GPIO_PF12 92
125#define GPIO_PF13 93
126#define GPIO_PF14 94
127#define GPIO_PF15 95
128#define GPIO_PG0 96
129#define GPIO_PG1 97
130#define GPIO_PG2 98
131#define GPIO_PG3 99
132#define GPIO_PG4 100
133#define GPIO_PG5 101
134#define GPIO_PG6 102
135#define GPIO_PG7 103
136#define GPIO_PG8 104
137#define GPIO_PG9 105
138#define GPIO_PG10 106
139#define GPIO_PG11 107
140#define GPIO_PG12 108
141#define GPIO_PG13 109
142#define GPIO_PG14 110
143#define GPIO_PG15 111
144#define GPIO_PH0 112
145#define GPIO_PH1 113
146#define GPIO_PH2 114
147#define GPIO_PH3 115
148#define GPIO_PH4 116
149#define GPIO_PH5 117
150#define GPIO_PH6 118
151#define GPIO_PH7 119
152#define GPIO_PH8 120
153#define GPIO_PH9 121
154#define GPIO_PH10 122
155#define GPIO_PH11 123
156#define GPIO_PH12 124
157#define GPIO_PH13 125
158#define GPIO_PH14 126 /* N/A */
159#define GPIO_PH15 127 /* N/A */
160#define GPIO_PI0 128
161#define GPIO_PI1 129
162#define GPIO_PI2 130
163#define GPIO_PI3 131
164#define GPIO_PI4 132
165#define GPIO_PI5 133
166#define GPIO_PI6 134
167#define GPIO_PI7 135
168#define GPIO_PI8 136
169#define GPIO_PI9 137
170#define GPIO_PI10 138
171#define GPIO_PI11 139
172#define GPIO_PI12 140
173#define GPIO_PI13 141
174#define GPIO_PI14 142
175#define GPIO_PI15 143
176#define GPIO_PJ0 144
177#define GPIO_PJ1 145
178#define GPIO_PJ2 146
179#define GPIO_PJ3 147
180#define GPIO_PJ4 148
181#define GPIO_PJ5 149
182#define GPIO_PJ6 150
183#define GPIO_PJ7 151
184#define GPIO_PJ8 152
185#define GPIO_PJ9 153
186#define GPIO_PJ10 154
187#define GPIO_PJ11 155
188#define GPIO_PJ12 156
189#define GPIO_PJ13 157
190#define GPIO_PJ14 158 /* N/A */
191#define GPIO_PJ15 159 /* N/A */
192
193#define MAX_BLACKFIN_GPIOS 160
194
195struct gpio_port_t {
196 unsigned short port_fer;
197 unsigned short dummy1;
198 unsigned short port_data;
199 unsigned short dummy2;
200 unsigned short port_set;
201 unsigned short dummy3;
202 unsigned short port_clear;
203 unsigned short dummy4;
204 unsigned short port_dir_set;
205 unsigned short dummy5;
206 unsigned short port_dir_clear;
207 unsigned short dummy6;
208 unsigned short port_inen;
209 unsigned short dummy7;
210 unsigned int port_mux;
211};
212
213struct gpio_port_s {
214 unsigned short fer;
215 unsigned short data;
216 unsigned short dir;
217 unsigned short inen;
218 unsigned int mux;
219};
diff --git a/include/asm-blackfin/mach-bf548/irq.h b/include/asm-blackfin/mach-bf548/irq.h
deleted file mode 100644
index ad380d1f5872..000000000000
--- a/include/asm-blackfin/mach-bf548/irq.h
+++ /dev/null
@@ -1,501 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf548/irq.h
3 * based on: include/asm-blackfin/mach-bf537/irq.h
4 * author: Roy Huang (roy.huang@analog.com)
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 _BF548_IRQ_H_
33#define _BF548_IRQ_H_
34
35/*
36 * Interrupt source definitions
37 Event Source Core Event Name
38Core Emulation **
39Events (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 NR_PERI_INTS (32 * 3)
55
56/* The ABSTRACT IRQ definitions */
57/** the first seven of the following are fixed, the rest you change if you need to **/
58#define IRQ_EMU 0 /* Emulation */
59#define IRQ_RST 1 /* reset */
60#define IRQ_NMI 2 /* Non Maskable */
61#define IRQ_EVX 3 /* Exception */
62#define IRQ_UNUSED 4 /* - unused interrupt*/
63#define IRQ_HWERR 5 /* Hardware Error */
64#define IRQ_CORETMR 6 /* Core timer */
65
66#define BFIN_IRQ(x) ((x) + 7)
67
68#define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */
69#define IRQ_DMAC0_ERROR BFIN_IRQ(1) /* DMAC0 Status Interrupt */
70#define IRQ_EPPI0_ERROR BFIN_IRQ(2) /* EPPI0 Error Interrupt */
71#define IRQ_SPORT0_ERROR BFIN_IRQ(3) /* SPORT0 Error Interrupt */
72#define IRQ_SPORT1_ERROR BFIN_IRQ(4) /* SPORT1 Error Interrupt */
73#define IRQ_SPI0_ERROR BFIN_IRQ(5) /* SPI0 Status(Error) Interrupt */
74#define IRQ_UART0_ERROR BFIN_IRQ(6) /* UART0 Status(Error) Interrupt */
75#define IRQ_RTC BFIN_IRQ(7) /* RTC Interrupt */
76#define IRQ_EPPI0 BFIN_IRQ(8) /* EPPI0 Interrupt (DMA12) */
77#define IRQ_SPORT0_RX BFIN_IRQ(9) /* SPORT0 RX Interrupt (DMA0) */
78#define IRQ_SPORT0_TX BFIN_IRQ(10) /* SPORT0 TX Interrupt (DMA1) */
79#define IRQ_SPORT1_RX BFIN_IRQ(11) /* SPORT1 RX Interrupt (DMA2) */
80#define IRQ_SPORT1_TX BFIN_IRQ(12) /* SPORT1 TX Interrupt (DMA3) */
81#define IRQ_SPI0 BFIN_IRQ(13) /* SPI0 Interrupt (DMA4) */
82#define IRQ_UART0_RX BFIN_IRQ(14) /* UART0 RX Interrupt (DMA6) */
83#define IRQ_UART0_TX BFIN_IRQ(15) /* UART0 TX Interrupt (DMA7) */
84#define IRQ_TIMER8 BFIN_IRQ(16) /* TIMER 8 Interrupt */
85#define IRQ_TIMER9 BFIN_IRQ(17) /* TIMER 9 Interrupt */
86#define IRQ_TIMER10 BFIN_IRQ(18) /* TIMER 10 Interrupt */
87#define IRQ_PINT0 BFIN_IRQ(19) /* PINT0 Interrupt */
88#define IRQ_PINT1 BFIN_IRQ(20) /* PINT1 Interrupt */
89#define IRQ_MDMAS0 BFIN_IRQ(21) /* MDMA Stream 0 Interrupt */
90#define IRQ_MDMAS1 BFIN_IRQ(22) /* MDMA Stream 1 Interrupt */
91#define IRQ_WATCH BFIN_IRQ(23) /* Watchdog Interrupt */
92#define IRQ_DMAC1_ERROR BFIN_IRQ(24) /* DMAC1 Status (Error) Interrupt */
93#define IRQ_SPORT2_ERROR BFIN_IRQ(25) /* SPORT2 Error Interrupt */
94#define IRQ_SPORT3_ERROR BFIN_IRQ(26) /* SPORT3 Error Interrupt */
95#define IRQ_MXVR_DATA BFIN_IRQ(27) /* MXVR Data Interrupt */
96#define IRQ_SPI1_ERROR BFIN_IRQ(28) /* SPI1 Status (Error) Interrupt */
97#define IRQ_SPI2_ERROR BFIN_IRQ(29) /* SPI2 Status (Error) Interrupt */
98#define IRQ_UART1_ERROR BFIN_IRQ(30) /* UART1 Status (Error) Interrupt */
99#define IRQ_UART2_ERROR BFIN_IRQ(31) /* UART2 Status (Error) Interrupt */
100#define IRQ_CAN0_ERROR BFIN_IRQ(32) /* CAN0 Status (Error) Interrupt */
101#define IRQ_SPORT2_RX BFIN_IRQ(33) /* SPORT2 RX (DMA18) Interrupt */
102#define IRQ_UART2_RX BFIN_IRQ(33) /* UART2 RX (DMA18) Interrupt */
103#define IRQ_SPORT2_TX BFIN_IRQ(34) /* SPORT2 TX (DMA19) Interrupt */
104#define IRQ_UART2_TX BFIN_IRQ(34) /* UART2 TX (DMA19) Interrupt */
105#define IRQ_SPORT3_RX BFIN_IRQ(35) /* SPORT3 RX (DMA20) Interrupt */
106#define IRQ_UART3_RX BFIN_IRQ(35) /* UART3 RX (DMA20) Interrupt */
107#define IRQ_SPORT3_TX BFIN_IRQ(36) /* SPORT3 TX (DMA21) Interrupt */
108#define IRQ_UART3_TX BFIN_IRQ(36) /* UART3 TX (DMA21) Interrupt */
109#define IRQ_EPPI1 BFIN_IRQ(37) /* EPP1 (DMA13) Interrupt */
110#define IRQ_EPPI2 BFIN_IRQ(38) /* EPP2 (DMA14) Interrupt */
111#define IRQ_SPI1 BFIN_IRQ(39) /* SPI1 (DMA5) Interrupt */
112#define IRQ_SPI2 BFIN_IRQ(40) /* SPI2 (DMA23) Interrupt */
113#define IRQ_UART1_RX BFIN_IRQ(41) /* UART1 RX (DMA8) Interrupt */
114#define IRQ_UART1_TX BFIN_IRQ(42) /* UART1 TX (DMA9) Interrupt */
115#define IRQ_ATAPI_RX BFIN_IRQ(43) /* ATAPI RX (DMA10) Interrupt */
116#define IRQ_ATAPI_TX BFIN_IRQ(44) /* ATAPI TX (DMA11) Interrupt */
117#define IRQ_TWI0 BFIN_IRQ(45) /* TWI0 Interrupt */
118#define IRQ_TWI1 BFIN_IRQ(46) /* TWI1 Interrupt */
119#define IRQ_CAN0_RX BFIN_IRQ(47) /* CAN0 Receive Interrupt */
120#define IRQ_CAN0_TX BFIN_IRQ(48) /* CAN0 Transmit Interrupt */
121#define IRQ_MDMAS2 BFIN_IRQ(49) /* MDMA Stream 2 Interrupt */
122#define IRQ_MDMAS3 BFIN_IRQ(50) /* MDMA Stream 3 Interrupt */
123#define IRQ_MXVR_ERROR BFIN_IRQ(51) /* MXVR Status (Error) Interrupt */
124#define IRQ_MXVR_MSG BFIN_IRQ(52) /* MXVR Message Interrupt */
125#define IRQ_MXVR_PKT BFIN_IRQ(53) /* MXVR Packet Interrupt */
126#define IRQ_EPP1_ERROR BFIN_IRQ(54) /* EPPI1 Error Interrupt */
127#define IRQ_EPP2_ERROR BFIN_IRQ(55) /* EPPI2 Error Interrupt */
128#define IRQ_UART3_ERROR BFIN_IRQ(56) /* UART3 Status (Error) Interrupt */
129#define IRQ_HOST_ERROR BFIN_IRQ(57) /* HOST Status (Error) Interrupt */
130#define IRQ_PIXC_ERROR BFIN_IRQ(59) /* PIXC Status (Error) Interrupt */
131#define IRQ_NFC_ERROR BFIN_IRQ(60) /* NFC Error Interrupt */
132#define IRQ_ATAPI_ERROR BFIN_IRQ(61) /* ATAPI Error Interrupt */
133#define IRQ_CAN1_ERROR BFIN_IRQ(62) /* CAN1 Status (Error) Interrupt */
134#define IRQ_HS_DMA_ERROR BFIN_IRQ(63) /* Handshake DMA Status Interrupt */
135#define IRQ_PIXC_IN0 BFIN_IRQ(64) /* PIXC IN0 (DMA15) Interrupt */
136#define IRQ_PIXC_IN1 BFIN_IRQ(65) /* PIXC IN1 (DMA16) Interrupt */
137#define IRQ_PIXC_OUT BFIN_IRQ(66) /* PIXC OUT (DMA17) Interrupt */
138#define IRQ_SDH BFIN_IRQ(67) /* SDH/NFC (DMA22) Interrupt */
139#define IRQ_CNT BFIN_IRQ(68) /* CNT Interrupt */
140#define IRQ_KEY BFIN_IRQ(69) /* KEY Interrupt */
141#define IRQ_CAN1_RX BFIN_IRQ(70) /* CAN1 RX Interrupt */
142#define IRQ_CAN1_TX BFIN_IRQ(71) /* CAN1 TX Interrupt */
143#define IRQ_SDH_MASK0 BFIN_IRQ(72) /* SDH Mask 0 Interrupt */
144#define IRQ_SDH_MASK1 BFIN_IRQ(73) /* SDH Mask 1 Interrupt */
145#define IRQ_USB_INT0 BFIN_IRQ(75) /* USB INT0 Interrupt */
146#define IRQ_USB_INT1 BFIN_IRQ(76) /* USB INT1 Interrupt */
147#define IRQ_USB_INT2 BFIN_IRQ(77) /* USB INT2 Interrupt */
148#define IRQ_USB_DMA BFIN_IRQ(78) /* USB DMA Interrupt */
149#define IRQ_OPTSEC BFIN_IRQ(79) /* OTPSEC Interrupt */
150#define IRQ_TIMER0 BFIN_IRQ(86) /* Timer 0 Interrupt */
151#define IRQ_TIMER1 BFIN_IRQ(87) /* Timer 1 Interrupt */
152#define IRQ_TIMER2 BFIN_IRQ(88) /* Timer 2 Interrupt */
153#define IRQ_TIMER3 BFIN_IRQ(89) /* Timer 3 Interrupt */
154#define IRQ_TIMER4 BFIN_IRQ(90) /* Timer 4 Interrupt */
155#define IRQ_TIMER5 BFIN_IRQ(91) /* Timer 5 Interrupt */
156#define IRQ_TIMER6 BFIN_IRQ(92) /* Timer 6 Interrupt */
157#define IRQ_TIMER7 BFIN_IRQ(93) /* Timer 7 Interrupt */
158#define IRQ_PINT2 BFIN_IRQ(94) /* PINT2 Interrupt */
159#define IRQ_PINT3 BFIN_IRQ(95) /* PINT3 Interrupt */
160
161#define SYS_IRQS IRQ_PINT3
162
163#define BFIN_PA_IRQ(x) ((x) + SYS_IRQS + 1)
164#define IRQ_PA0 BFIN_PA_IRQ(0)
165#define IRQ_PA1 BFIN_PA_IRQ(1)
166#define IRQ_PA2 BFIN_PA_IRQ(2)
167#define IRQ_PA3 BFIN_PA_IRQ(3)
168#define IRQ_PA4 BFIN_PA_IRQ(4)
169#define IRQ_PA5 BFIN_PA_IRQ(5)
170#define IRQ_PA6 BFIN_PA_IRQ(6)
171#define IRQ_PA7 BFIN_PA_IRQ(7)
172#define IRQ_PA8 BFIN_PA_IRQ(8)
173#define IRQ_PA9 BFIN_PA_IRQ(9)
174#define IRQ_PA10 BFIN_PA_IRQ(10)
175#define IRQ_PA11 BFIN_PA_IRQ(11)
176#define IRQ_PA12 BFIN_PA_IRQ(12)
177#define IRQ_PA13 BFIN_PA_IRQ(13)
178#define IRQ_PA14 BFIN_PA_IRQ(14)
179#define IRQ_PA15 BFIN_PA_IRQ(15)
180
181#define BFIN_PB_IRQ(x) ((x) + IRQ_PA15 + 1)
182#define IRQ_PB0 BFIN_PB_IRQ(0)
183#define IRQ_PB1 BFIN_PB_IRQ(1)
184#define IRQ_PB2 BFIN_PB_IRQ(2)
185#define IRQ_PB3 BFIN_PB_IRQ(3)
186#define IRQ_PB4 BFIN_PB_IRQ(4)
187#define IRQ_PB5 BFIN_PB_IRQ(5)
188#define IRQ_PB6 BFIN_PB_IRQ(6)
189#define IRQ_PB7 BFIN_PB_IRQ(7)
190#define IRQ_PB8 BFIN_PB_IRQ(8)
191#define IRQ_PB9 BFIN_PB_IRQ(9)
192#define IRQ_PB10 BFIN_PB_IRQ(10)
193#define IRQ_PB11 BFIN_PB_IRQ(11)
194#define IRQ_PB12 BFIN_PB_IRQ(12)
195#define IRQ_PB13 BFIN_PB_IRQ(13)
196#define IRQ_PB14 BFIN_PB_IRQ(14)
197#define IRQ_PB15 BFIN_PB_IRQ(15) /* N/A */
198
199#define BFIN_PC_IRQ(x) ((x) + IRQ_PB15 + 1)
200#define IRQ_PC0 BFIN_PC_IRQ(0)
201#define IRQ_PC1 BFIN_PC_IRQ(1)
202#define IRQ_PC2 BFIN_PC_IRQ(2)
203#define IRQ_PC3 BFIN_PC_IRQ(3)
204#define IRQ_PC4 BFIN_PC_IRQ(4)
205#define IRQ_PC5 BFIN_PC_IRQ(5)
206#define IRQ_PC6 BFIN_PC_IRQ(6)
207#define IRQ_PC7 BFIN_PC_IRQ(7)
208#define IRQ_PC8 BFIN_PC_IRQ(8)
209#define IRQ_PC9 BFIN_PC_IRQ(9)
210#define IRQ_PC10 BFIN_PC_IRQ(10)
211#define IRQ_PC11 BFIN_PC_IRQ(11)
212#define IRQ_PC12 BFIN_PC_IRQ(12)
213#define IRQ_PC13 BFIN_PC_IRQ(13)
214#define IRQ_PC14 BFIN_PC_IRQ(14) /* N/A */
215#define IRQ_PC15 BFIN_PC_IRQ(15) /* N/A */
216
217#define BFIN_PD_IRQ(x) ((x) + IRQ_PC15 + 1)
218#define IRQ_PD0 BFIN_PD_IRQ(0)
219#define IRQ_PD1 BFIN_PD_IRQ(1)
220#define IRQ_PD2 BFIN_PD_IRQ(2)
221#define IRQ_PD3 BFIN_PD_IRQ(3)
222#define IRQ_PD4 BFIN_PD_IRQ(4)
223#define IRQ_PD5 BFIN_PD_IRQ(5)
224#define IRQ_PD6 BFIN_PD_IRQ(6)
225#define IRQ_PD7 BFIN_PD_IRQ(7)
226#define IRQ_PD8 BFIN_PD_IRQ(8)
227#define IRQ_PD9 BFIN_PD_IRQ(9)
228#define IRQ_PD10 BFIN_PD_IRQ(10)
229#define IRQ_PD11 BFIN_PD_IRQ(11)
230#define IRQ_PD12 BFIN_PD_IRQ(12)
231#define IRQ_PD13 BFIN_PD_IRQ(13)
232#define IRQ_PD14 BFIN_PD_IRQ(14)
233#define IRQ_PD15 BFIN_PD_IRQ(15)
234
235#define BFIN_PE_IRQ(x) ((x) + IRQ_PD15 + 1)
236#define IRQ_PE0 BFIN_PE_IRQ(0)
237#define IRQ_PE1 BFIN_PE_IRQ(1)
238#define IRQ_PE2 BFIN_PE_IRQ(2)
239#define IRQ_PE3 BFIN_PE_IRQ(3)
240#define IRQ_PE4 BFIN_PE_IRQ(4)
241#define IRQ_PE5 BFIN_PE_IRQ(5)
242#define IRQ_PE6 BFIN_PE_IRQ(6)
243#define IRQ_PE7 BFIN_PE_IRQ(7)
244#define IRQ_PE8 BFIN_PE_IRQ(8)
245#define IRQ_PE9 BFIN_PE_IRQ(9)
246#define IRQ_PE10 BFIN_PE_IRQ(10)
247#define IRQ_PE11 BFIN_PE_IRQ(11)
248#define IRQ_PE12 BFIN_PE_IRQ(12)
249#define IRQ_PE13 BFIN_PE_IRQ(13)
250#define IRQ_PE14 BFIN_PE_IRQ(14)
251#define IRQ_PE15 BFIN_PE_IRQ(15)
252
253#define BFIN_PF_IRQ(x) ((x) + IRQ_PE15 + 1)
254#define IRQ_PF0 BFIN_PF_IRQ(0)
255#define IRQ_PF1 BFIN_PF_IRQ(1)
256#define IRQ_PF2 BFIN_PF_IRQ(2)
257#define IRQ_PF3 BFIN_PF_IRQ(3)
258#define IRQ_PF4 BFIN_PF_IRQ(4)
259#define IRQ_PF5 BFIN_PF_IRQ(5)
260#define IRQ_PF6 BFIN_PF_IRQ(6)
261#define IRQ_PF7 BFIN_PF_IRQ(7)
262#define IRQ_PF8 BFIN_PF_IRQ(8)
263#define IRQ_PF9 BFIN_PF_IRQ(9)
264#define IRQ_PF10 BFIN_PF_IRQ(10)
265#define IRQ_PF11 BFIN_PF_IRQ(11)
266#define IRQ_PF12 BFIN_PF_IRQ(12)
267#define IRQ_PF13 BFIN_PF_IRQ(13)
268#define IRQ_PF14 BFIN_PF_IRQ(14)
269#define IRQ_PF15 BFIN_PF_IRQ(15)
270
271#define BFIN_PG_IRQ(x) ((x) + IRQ_PF15 + 1)
272#define IRQ_PG0 BFIN_PG_IRQ(0)
273#define IRQ_PG1 BFIN_PG_IRQ(1)
274#define IRQ_PG2 BFIN_PG_IRQ(2)
275#define IRQ_PG3 BFIN_PG_IRQ(3)
276#define IRQ_PG4 BFIN_PG_IRQ(4)
277#define IRQ_PG5 BFIN_PG_IRQ(5)
278#define IRQ_PG6 BFIN_PG_IRQ(6)
279#define IRQ_PG7 BFIN_PG_IRQ(7)
280#define IRQ_PG8 BFIN_PG_IRQ(8)
281#define IRQ_PG9 BFIN_PG_IRQ(9)
282#define IRQ_PG10 BFIN_PG_IRQ(10)
283#define IRQ_PG11 BFIN_PG_IRQ(11)
284#define IRQ_PG12 BFIN_PG_IRQ(12)
285#define IRQ_PG13 BFIN_PG_IRQ(13)
286#define IRQ_PG14 BFIN_PG_IRQ(14)
287#define IRQ_PG15 BFIN_PG_IRQ(15)
288
289#define BFIN_PH_IRQ(x) ((x) + IRQ_PG15 + 1)
290#define IRQ_PH0 BFIN_PH_IRQ(0)
291#define IRQ_PH1 BFIN_PH_IRQ(1)
292#define IRQ_PH2 BFIN_PH_IRQ(2)
293#define IRQ_PH3 BFIN_PH_IRQ(3)
294#define IRQ_PH4 BFIN_PH_IRQ(4)
295#define IRQ_PH5 BFIN_PH_IRQ(5)
296#define IRQ_PH6 BFIN_PH_IRQ(6)
297#define IRQ_PH7 BFIN_PH_IRQ(7)
298#define IRQ_PH8 BFIN_PH_IRQ(8)
299#define IRQ_PH9 BFIN_PH_IRQ(9)
300#define IRQ_PH10 BFIN_PH_IRQ(10)
301#define IRQ_PH11 BFIN_PH_IRQ(11)
302#define IRQ_PH12 BFIN_PH_IRQ(12)
303#define IRQ_PH13 BFIN_PH_IRQ(13)
304#define IRQ_PH14 BFIN_PH_IRQ(14) /* N/A */
305#define IRQ_PH15 BFIN_PH_IRQ(15) /* N/A */
306
307#define BFIN_PI_IRQ(x) ((x) + IRQ_PH15 + 1)
308#define IRQ_PI0 BFIN_PI_IRQ(0)
309#define IRQ_PI1 BFIN_PI_IRQ(1)
310#define IRQ_PI2 BFIN_PI_IRQ(2)
311#define IRQ_PI3 BFIN_PI_IRQ(3)
312#define IRQ_PI4 BFIN_PI_IRQ(4)
313#define IRQ_PI5 BFIN_PI_IRQ(5)
314#define IRQ_PI6 BFIN_PI_IRQ(6)
315#define IRQ_PI7 BFIN_PI_IRQ(7)
316#define IRQ_PI8 BFIN_PI_IRQ(8)
317#define IRQ_PI9 BFIN_PI_IRQ(9)
318#define IRQ_PI10 BFIN_PI_IRQ(10)
319#define IRQ_PI11 BFIN_PI_IRQ(11)
320#define IRQ_PI12 BFIN_PI_IRQ(12)
321#define IRQ_PI13 BFIN_PI_IRQ(13)
322#define IRQ_PI14 BFIN_PI_IRQ(14)
323#define IRQ_PI15 BFIN_PI_IRQ(15)
324
325#define BFIN_PJ_IRQ(x) ((x) + IRQ_PI15 + 1)
326#define IRQ_PJ0 BFIN_PJ_IRQ(0)
327#define IRQ_PJ1 BFIN_PJ_IRQ(1)
328#define IRQ_PJ2 BFIN_PJ_IRQ(2)
329#define IRQ_PJ3 BFIN_PJ_IRQ(3)
330#define IRQ_PJ4 BFIN_PJ_IRQ(4)
331#define IRQ_PJ5 BFIN_PJ_IRQ(5)
332#define IRQ_PJ6 BFIN_PJ_IRQ(6)
333#define IRQ_PJ7 BFIN_PJ_IRQ(7)
334#define IRQ_PJ8 BFIN_PJ_IRQ(8)
335#define IRQ_PJ9 BFIN_PJ_IRQ(9)
336#define IRQ_PJ10 BFIN_PJ_IRQ(10)
337#define IRQ_PJ11 BFIN_PJ_IRQ(11)
338#define IRQ_PJ12 BFIN_PJ_IRQ(12)
339#define IRQ_PJ13 BFIN_PJ_IRQ(13)
340#define IRQ_PJ14 BFIN_PJ_IRQ(14) /* N/A */
341#define IRQ_PJ15 BFIN_PJ_IRQ(15) /* N/A */
342
343#define GPIO_IRQ_BASE IRQ_PA0
344
345#define NR_IRQS (IRQ_PJ15+1)
346
347/* For compatibility reasons with existing code */
348
349#define IRQ_DMAC0_ERR IRQ_DMAC0_ERROR
350#define IRQ_EPPI0_ERR IRQ_EPPI0_ERROR
351#define IRQ_SPORT0_ERR IRQ_SPORT0_ERROR
352#define IRQ_SPORT1_ERR IRQ_SPORT1_ERROR
353#define IRQ_SPI0_ERR IRQ_SPI0_ERROR
354#define IRQ_UART0_ERR IRQ_UART0_ERROR
355#define IRQ_DMAC1_ERR IRQ_DMAC1_ERROR
356#define IRQ_SPORT2_ERR IRQ_SPORT2_ERROR
357#define IRQ_SPORT3_ERR IRQ_SPORT3_ERROR
358#define IRQ_SPI1_ERR IRQ_SPI1_ERROR
359#define IRQ_SPI2_ERR IRQ_SPI2_ERROR
360#define IRQ_UART1_ERR IRQ_UART1_ERROR
361#define IRQ_UART2_ERR IRQ_UART2_ERROR
362#define IRQ_CAN0_ERR IRQ_CAN0_ERROR
363#define IRQ_MXVR_ERR IRQ_MXVR_ERROR
364#define IRQ_EPP1_ERR IRQ_EPP1_ERROR
365#define IRQ_EPP2_ERR IRQ_EPP2_ERROR
366#define IRQ_UART3_ERR IRQ_UART3_ERROR
367#define IRQ_HOST_ERR IRQ_HOST_ERROR
368#define IRQ_PIXC_ERR IRQ_PIXC_ERROR
369#define IRQ_NFC_ERR IRQ_NFC_ERROR
370#define IRQ_ATAPI_ERR IRQ_ATAPI_ERROR
371#define IRQ_CAN1_ERR IRQ_CAN1_ERROR
372#define IRQ_HS_DMA_ERR IRQ_HS_DMA_ERROR
373
374
375#define IVG7 7
376#define IVG8 8
377#define IVG9 9
378#define IVG10 10
379#define IVG11 11
380#define IVG12 12
381#define IVG13 13
382#define IVG14 14
383#define IVG15 15
384
385/* IAR0 BIT FIELDS */
386#define IRQ_PLL_WAKEUP_POS 0
387#define IRQ_DMAC0_ERR_POS 4
388#define IRQ_EPPI0_ERR_POS 8
389#define IRQ_SPORT0_ERR_POS 12
390#define IRQ_SPORT1_ERR_POS 16
391#define IRQ_SPI0_ERR_POS 20
392#define IRQ_UART0_ERR_POS 24
393#define IRQ_RTC_POS 28
394
395/* IAR1 BIT FIELDS */
396#define IRQ_EPPI0_POS 0
397#define IRQ_SPORT0_RX_POS 4
398#define IRQ_SPORT0_TX_POS 8
399#define IRQ_SPORT1_RX_POS 12
400#define IRQ_SPORT1_TX_POS 16
401#define IRQ_SPI0_POS 20
402#define IRQ_UART0_RX_POS 24
403#define IRQ_UART0_TX_POS 28
404
405/* IAR2 BIT FIELDS */
406#define IRQ_TIMER8_POS 0
407#define IRQ_TIMER9_POS 4
408#define IRQ_TIMER10_POS 8
409#define IRQ_PINT0_POS 12
410#define IRQ_PINT1_POS 16
411#define IRQ_MDMAS0_POS 20
412#define IRQ_MDMAS1_POS 24
413#define IRQ_WATCH_POS 28
414
415/* IAR3 BIT FIELDS */
416#define IRQ_DMAC1_ERR_POS 0
417#define IRQ_SPORT2_ERR_POS 4
418#define IRQ_SPORT3_ERR_POS 8
419#define IRQ_MXVR_DATA_POS 12
420#define IRQ_SPI1_ERR_POS 16
421#define IRQ_SPI2_ERR_POS 20
422#define IRQ_UART1_ERR_POS 24
423#define IRQ_UART2_ERR_POS 28
424
425/* IAR4 BIT FILEDS */
426#define IRQ_CAN0_ERR_POS 0
427#define IRQ_SPORT2_RX_POS 4
428#define IRQ_UART2_RX_POS 4
429#define IRQ_SPORT2_TX_POS 8
430#define IRQ_UART2_TX_POS 8
431#define IRQ_SPORT3_RX_POS 12
432#define IRQ_UART3_RX_POS 12
433#define IRQ_SPORT3_TX_POS 16
434#define IRQ_UART3_TX_POS 16
435#define IRQ_EPPI1_POS 20
436#define IRQ_EPPI2_POS 24
437#define IRQ_SPI1_POS 28
438
439/* IAR5 BIT FIELDS */
440#define IRQ_SPI2_POS 0
441#define IRQ_UART1_RX_POS 4
442#define IRQ_UART1_TX_POS 8
443#define IRQ_ATAPI_RX_POS 12
444#define IRQ_ATAPI_TX_POS 16
445#define IRQ_TWI0_POS 20
446#define IRQ_TWI1_POS 24
447#define IRQ_CAN0_RX_POS 28
448
449/* IAR6 BIT FIELDS */
450#define IRQ_CAN0_TX_POS 0
451#define IRQ_MDMAS2_POS 4
452#define IRQ_MDMAS3_POS 8
453#define IRQ_MXVR_ERR_POS 12
454#define IRQ_MXVR_MSG_POS 16
455#define IRQ_MXVR_PKT_POS 20
456#define IRQ_EPPI1_ERR_POS 24
457#define IRQ_EPPI2_ERR_POS 28
458
459/* IAR7 BIT FIELDS */
460#define IRQ_UART3_ERR_POS 0
461#define IRQ_HOST_ERR_POS 4
462#define IRQ_PIXC_ERR_POS 12
463#define IRQ_NFC_ERR_POS 16
464#define IRQ_ATAPI_ERR_POS 20
465#define IRQ_CAN1_ERR_POS 24
466#define IRQ_HS_DMA_ERR_POS 28
467
468/* IAR8 BIT FIELDS */
469#define IRQ_PIXC_IN0_POS 0
470#define IRQ_PIXC_IN1_POS 4
471#define IRQ_PIXC_OUT_POS 8
472#define IRQ_SDH_POS 12
473#define IRQ_CNT_POS 16
474#define IRQ_KEY_POS 20
475#define IRQ_CAN1_RX_POS 24
476#define IRQ_CAN1_TX_POS 28
477
478/* IAR9 BIT FIELDS */
479#define IRQ_SDH_MASK0_POS 0
480#define IRQ_SDH_MASK1_POS 4
481#define IRQ_USB_INT0_POS 12
482#define IRQ_USB_INT1_POS 16
483#define IRQ_USB_INT2_POS 20
484#define IRQ_USB_DMA_POS 24
485#define IRQ_OTPSEC_POS 28
486
487/* IAR10 BIT FIELDS */
488#define IRQ_TIMER0_POS 24
489#define IRQ_TIMER1_POS 28
490
491/* IAR11 BIT FIELDS */
492#define IRQ_TIMER2_POS 0
493#define IRQ_TIMER3_POS 4
494#define IRQ_TIMER4_POS 8
495#define IRQ_TIMER5_POS 12
496#define IRQ_TIMER6_POS 16
497#define IRQ_TIMER7_POS 20
498#define IRQ_PINT2_POS 24
499#define IRQ_PINT3_POS 28
500
501#endif /* _BF548_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf548/mem_init.h b/include/asm-blackfin/mach-bf548/mem_init.h
deleted file mode 100644
index ab0b863eee66..000000000000
--- a/include/asm-blackfin/mach-bf548/mem_init.h
+++ /dev/null
@@ -1,255 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/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#define MIN_DDR_SCLK(x) (x*(CONFIG_SCLK_HZ/1000/1000)/1000 + 1)
32#define MAX_DDR_SCLK(x) (x*(CONFIG_SCLK_HZ/1000/1000)/1000)
33#define DDR_CLK_HZ(x) (1000*1000*1000/x)
34
35#if (CONFIG_MEM_MT46V32M16_6T)
36#define DDR_SIZE DEVSZ_512
37#define DDR_WIDTH DEVWD_16
38#define DDR_MAX_tCK 13
39
40#define DDR_tRC DDR_TRC(MIN_DDR_SCLK(60))
41#define DDR_tRAS DDR_TRAS(MIN_DDR_SCLK(42))
42#define DDR_tRP DDR_TRP(MIN_DDR_SCLK(15))
43#define DDR_tRFC DDR_TRFC(MIN_DDR_SCLK(72))
44#define DDR_tREFI DDR_TREFI(MAX_DDR_SCLK(7800))
45
46#define DDR_tRCD DDR_TRCD(MIN_DDR_SCLK(15))
47#define DDR_tWTR DDR_TWTR(1)
48#define DDR_tMRD DDR_TMRD(MIN_DDR_SCLK(12))
49#define DDR_tWR DDR_TWR(MIN_DDR_SCLK(15))
50#endif
51
52#if (CONFIG_MEM_MT46V32M16_5B)
53#define DDR_SIZE DEVSZ_512
54#define DDR_WIDTH DEVWD_16
55#define DDR_MAX_tCK 13
56
57#define DDR_tRC DDR_TRC(MIN_DDR_SCLK(55))
58#define DDR_tRAS DDR_TRAS(MIN_DDR_SCLK(40))
59#define DDR_tRP DDR_TRP(MIN_DDR_SCLK(15))
60#define DDR_tRFC DDR_TRFC(MIN_DDR_SCLK(70))
61#define DDR_tREFI DDR_TREFI(MAX_DDR_SCLK(7800))
62
63#define DDR_tRCD DDR_TRCD(MIN_DDR_SCLK(15))
64#define DDR_tWTR DDR_TWTR(2)
65#define DDR_tMRD DDR_TMRD(MIN_DDR_SCLK(10))
66#define DDR_tWR DDR_TWR(MIN_DDR_SCLK(15))
67#endif
68
69#if (CONFIG_MEM_GENERIC_BOARD)
70#define DDR_SIZE DEVSZ_512
71#define DDR_WIDTH DEVWD_16
72#define DDR_MAX_tCK 13
73
74#define DDR_tRCD DDR_TRCD(3)
75#define DDR_tWTR DDR_TWTR(2)
76#define DDR_tWR DDR_TWR(2)
77#define DDR_tMRD DDR_TMRD(2)
78#define DDR_tRP DDR_TRP(3)
79#define DDR_tRAS DDR_TRAS(7)
80#define DDR_tRC DDR_TRC(10)
81#define DDR_tRFC DDR_TRFC(12)
82#define DDR_tREFI DDR_TREFI(1288)
83#endif
84
85#if (CONFIG_SCLK_HZ < DDR_CLK_HZ(DDR_MAX_tCK))
86# error "CONFIG_SCLK_HZ is too small (<DDR_CLK_HZ(DDR_MAX_tCK) Hz)."
87#elif(CONFIG_SCLK_HZ <= 133333333)
88# define DDR_CL CL_2
89#else
90# error "CONFIG_SCLK_HZ is too large (>133333333 Hz)."
91#endif
92
93
94#define mem_DDRCTL0 (DDR_tRP | DDR_tRAS | DDR_tRC | DDR_tRFC | DDR_tREFI)
95#define mem_DDRCTL1 (DDR_DATWIDTH | EXTBANK_1 | DDR_SIZE | DDR_WIDTH | DDR_tWTR \
96 | DDR_tMRD | DDR_tWR | DDR_tRCD)
97#define mem_DDRCTL2 DDR_CL
98
99
100#if defined CONFIG_CLKIN_HALF
101#define CLKIN_HALF 1
102#else
103#define CLKIN_HALF 0
104#endif
105
106#if defined CONFIG_PLL_BYPASS
107#define PLL_BYPASS 1
108#else
109#define PLL_BYPASS 0
110#endif
111
112/***************************************Currently Not Being Used *********************************/
113#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
114#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
115#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
116#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
117#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
118
119#if (flash_EBIU_AMBCTL_TT > 3)
120#define flash_EBIU_AMBCTL0_TT B0TT_4
121#endif
122#if (flash_EBIU_AMBCTL_TT == 3)
123#define flash_EBIU_AMBCTL0_TT B0TT_3
124#endif
125#if (flash_EBIU_AMBCTL_TT == 2)
126#define flash_EBIU_AMBCTL0_TT B0TT_2
127#endif
128#if (flash_EBIU_AMBCTL_TT < 2)
129#define flash_EBIU_AMBCTL0_TT B0TT_1
130#endif
131
132#if (flash_EBIU_AMBCTL_ST > 3)
133#define flash_EBIU_AMBCTL0_ST B0ST_4
134#endif
135#if (flash_EBIU_AMBCTL_ST == 3)
136#define flash_EBIU_AMBCTL0_ST B0ST_3
137#endif
138#if (flash_EBIU_AMBCTL_ST == 2)
139#define flash_EBIU_AMBCTL0_ST B0ST_2
140#endif
141#if (flash_EBIU_AMBCTL_ST < 2)
142#define flash_EBIU_AMBCTL0_ST B0ST_1
143#endif
144
145#if (flash_EBIU_AMBCTL_HT > 2)
146#define flash_EBIU_AMBCTL0_HT B0HT_3
147#endif
148#if (flash_EBIU_AMBCTL_HT == 2)
149#define flash_EBIU_AMBCTL0_HT B0HT_2
150#endif
151#if (flash_EBIU_AMBCTL_HT == 1)
152#define flash_EBIU_AMBCTL0_HT B0HT_1
153#endif
154#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
155#define flash_EBIU_AMBCTL0_HT B0HT_0
156#endif
157#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
158#define flash_EBIU_AMBCTL0_HT B0HT_1
159#endif
160
161#if (flash_EBIU_AMBCTL_WAT > 14)
162#define flash_EBIU_AMBCTL0_WAT B0WAT_15
163#endif
164#if (flash_EBIU_AMBCTL_WAT == 14)
165#define flash_EBIU_AMBCTL0_WAT B0WAT_14
166#endif
167#if (flash_EBIU_AMBCTL_WAT == 13)
168#define flash_EBIU_AMBCTL0_WAT B0WAT_13
169#endif
170#if (flash_EBIU_AMBCTL_WAT == 12)
171#define flash_EBIU_AMBCTL0_WAT B0WAT_12
172#endif
173#if (flash_EBIU_AMBCTL_WAT == 11)
174#define flash_EBIU_AMBCTL0_WAT B0WAT_11
175#endif
176#if (flash_EBIU_AMBCTL_WAT == 10)
177#define flash_EBIU_AMBCTL0_WAT B0WAT_10
178#endif
179#if (flash_EBIU_AMBCTL_WAT == 9)
180#define flash_EBIU_AMBCTL0_WAT B0WAT_9
181#endif
182#if (flash_EBIU_AMBCTL_WAT == 8)
183#define flash_EBIU_AMBCTL0_WAT B0WAT_8
184#endif
185#if (flash_EBIU_AMBCTL_WAT == 7)
186#define flash_EBIU_AMBCTL0_WAT B0WAT_7
187#endif
188#if (flash_EBIU_AMBCTL_WAT == 6)
189#define flash_EBIU_AMBCTL0_WAT B0WAT_6
190#endif
191#if (flash_EBIU_AMBCTL_WAT == 5)
192#define flash_EBIU_AMBCTL0_WAT B0WAT_5
193#endif
194#if (flash_EBIU_AMBCTL_WAT == 4)
195#define flash_EBIU_AMBCTL0_WAT B0WAT_4
196#endif
197#if (flash_EBIU_AMBCTL_WAT == 3)
198#define flash_EBIU_AMBCTL0_WAT B0WAT_3
199#endif
200#if (flash_EBIU_AMBCTL_WAT == 2)
201#define flash_EBIU_AMBCTL0_WAT B0WAT_2
202#endif
203#if (flash_EBIU_AMBCTL_WAT == 1)
204#define flash_EBIU_AMBCTL0_WAT B0WAT_1
205#endif
206
207#if (flash_EBIU_AMBCTL_RAT > 14)
208#define flash_EBIU_AMBCTL0_RAT B0RAT_15
209#endif
210#if (flash_EBIU_AMBCTL_RAT == 14)
211#define flash_EBIU_AMBCTL0_RAT B0RAT_14
212#endif
213#if (flash_EBIU_AMBCTL_RAT == 13)
214#define flash_EBIU_AMBCTL0_RAT B0RAT_13
215#endif
216#if (flash_EBIU_AMBCTL_RAT == 12)
217#define flash_EBIU_AMBCTL0_RAT B0RAT_12
218#endif
219#if (flash_EBIU_AMBCTL_RAT == 11)
220#define flash_EBIU_AMBCTL0_RAT B0RAT_11
221#endif
222#if (flash_EBIU_AMBCTL_RAT == 10)
223#define flash_EBIU_AMBCTL0_RAT B0RAT_10
224#endif
225#if (flash_EBIU_AMBCTL_RAT == 9)
226#define flash_EBIU_AMBCTL0_RAT B0RAT_9
227#endif
228#if (flash_EBIU_AMBCTL_RAT == 8)
229#define flash_EBIU_AMBCTL0_RAT B0RAT_8
230#endif
231#if (flash_EBIU_AMBCTL_RAT == 7)
232#define flash_EBIU_AMBCTL0_RAT B0RAT_7
233#endif
234#if (flash_EBIU_AMBCTL_RAT == 6)
235#define flash_EBIU_AMBCTL0_RAT B0RAT_6
236#endif
237#if (flash_EBIU_AMBCTL_RAT == 5)
238#define flash_EBIU_AMBCTL0_RAT B0RAT_5
239#endif
240#if (flash_EBIU_AMBCTL_RAT == 4)
241#define flash_EBIU_AMBCTL0_RAT B0RAT_4
242#endif
243#if (flash_EBIU_AMBCTL_RAT == 3)
244#define flash_EBIU_AMBCTL0_RAT B0RAT_3
245#endif
246#if (flash_EBIU_AMBCTL_RAT == 2)
247#define flash_EBIU_AMBCTL0_RAT B0RAT_2
248#endif
249#if (flash_EBIU_AMBCTL_RAT == 1)
250#define flash_EBIU_AMBCTL0_RAT B0RAT_1
251#endif
252
253#define flash_EBIU_AMBCTL0 \
254 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
255 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/include/asm-blackfin/mach-bf548/mem_map.h b/include/asm-blackfin/mach-bf548/mem_map.h
deleted file mode 100644
index f99f47bc3a07..000000000000
--- a/include/asm-blackfin/mach-bf548/mem_map.h
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf548/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_548_H_
32#define _MEM_MAP_548_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 0x2C000000 /* Async Bank 3 */
39#define ASYNC_BANK3_SIZE 0x04000000 /* 64M */
40#define ASYNC_BANK2_BASE 0x28000000 /* Async Bank 2 */
41#define ASYNC_BANK2_SIZE 0x04000000 /* 64M */
42#define ASYNC_BANK1_BASE 0x24000000 /* Async Bank 1 */
43#define ASYNC_BANK1_SIZE 0x04000000 /* 64M */
44#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
45#define ASYNC_BANK0_SIZE 0x04000000 /* 64M */
46
47/* Boot ROM Memory */
48
49#define BOOT_ROM_START 0xEF000000
50#define BOOT_ROM_LENGTH 0x1000
51
52/* L1 Instruction ROM */
53
54#define L1_ROM_START 0xFFA14000
55#define L1_ROM_LENGTH 0x10000
56
57/* Level 1 Memory */
58
59/* Memory Map for ADSP-BF548 processors */
60#ifdef CONFIG_BFIN_ICACHE
61#define BFIN_ICACHESIZE (16*1024)
62#else
63#define BFIN_ICACHESIZE (0*1024)
64#endif
65
66#define L1_CODE_START 0xFFA00000
67#define L1_DATA_A_START 0xFF800000
68#define L1_DATA_B_START 0xFF900000
69
70#define L1_CODE_LENGTH 0xC000
71
72#ifdef CONFIG_BFIN_DCACHE
73
74#ifdef CONFIG_BFIN_DCACHE_BANKA
75#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
76#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
77#define L1_DATA_B_LENGTH 0x8000
78#define BFIN_DCACHESIZE (16*1024)
79#define BFIN_DSUPBANKS 1
80#else
81#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
82#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
83#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
84#define BFIN_DCACHESIZE (32*1024)
85#define BFIN_DSUPBANKS 2
86#endif
87
88#else
89#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
90#define L1_DATA_A_LENGTH 0x8000
91#define L1_DATA_B_LENGTH 0x8000
92#define BFIN_DCACHESIZE (0*1024)
93#define BFIN_DSUPBANKS 0
94#endif /*CONFIG_BFIN_DCACHE*/
95
96/* Level 2 Memory */
97#if !defined(CONFIG_BF542)
98# define L2_START 0xFEB00000
99# if defined(CONFIG_BF544)
100# define L2_LENGTH 0x10000
101# else
102# define L2_LENGTH 0x20000
103# endif
104#endif
105
106/* Scratch Pad Memory */
107
108#define L1_SCRATCH_START 0xFFB00000
109#define L1_SCRATCH_LENGTH 0x1000
110
111#endif/* _MEM_MAP_548_H_ */
diff --git a/include/asm-blackfin/mach-bf548/portmux.h b/include/asm-blackfin/mach-bf548/portmux.h
deleted file mode 100644
index 8177a567dcdb..000000000000
--- a/include/asm-blackfin/mach-bf548/portmux.h
+++ /dev/null
@@ -1,286 +0,0 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
5
6#define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0))
7#define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0))
8#define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0))
9#define P_SPORT2_TSCLK (P_DEFINED | P_IDENT(GPIO_PA3) | P_FUNCT(0))
10#define P_SPORT2_RFS (P_DEFINED | P_IDENT(GPIO_PA4) | P_FUNCT(0))
11#define P_SPORT2_DRSEC (P_DEFINED | P_IDENT(GPIO_PA5) | P_FUNCT(0))
12#define P_SPORT2_DRPRI (P_DEFINED | P_IDENT(GPIO_PA6) | P_FUNCT(0))
13#define P_SPORT2_RSCLK (P_DEFINED | P_IDENT(GPIO_PA7) | P_FUNCT(0))
14#define P_SPORT3_TFS (P_DEFINED | P_IDENT(GPIO_PA8) | P_FUNCT(0))
15#define P_SPORT3_DTSEC (P_DEFINED | P_IDENT(GPIO_PA9) | P_FUNCT(0))
16#define P_SPORT3_DTPRI (P_DEFINED | P_IDENT(GPIO_PA10) | P_FUNCT(0))
17#define P_SPORT3_TSCLK (P_DEFINED | P_IDENT(GPIO_PA11) | P_FUNCT(0))
18#define P_SPORT3_RFS (P_DEFINED | P_IDENT(GPIO_PA12) | P_FUNCT(0))
19#define P_SPORT3_DRSEC (P_DEFINED | P_IDENT(GPIO_PA13) | P_FUNCT(0))
20#define P_SPORT3_DRPRI (P_DEFINED | P_IDENT(GPIO_PA14) | P_FUNCT(0))
21#define P_SPORT3_RSCLK (P_DEFINED | P_IDENT(GPIO_PA15) | P_FUNCT(0))
22#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(1))
23#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PA5) | P_FUNCT(1))
24#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PA9) | P_FUNCT(1))
25#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PA13) | P_FUNCT(1))
26
27#define P_TWI1_SCL (P_DEFINED | P_IDENT(GPIO_PB0) | P_FUNCT(0))
28#define P_TWI1_SDA (P_DEFINED | P_IDENT(GPIO_PB1) | P_FUNCT(0))
29#define P_UART3_RTS (P_DEFINED | P_IDENT(GPIO_PB2) | P_FUNCT(0))
30#define P_UART3_CTS (P_DEFINED | P_IDENT(GPIO_PB3) | P_FUNCT(0))
31#define P_UART2_TX (P_DEFINED | P_IDENT(GPIO_PB4) | P_FUNCT(0))
32#define P_UART2_RX (P_DEFINED | P_IDENT(GPIO_PB5) | P_FUNCT(0))
33#define P_UART3_TX (P_DEFINED | P_IDENT(GPIO_PB6) | P_FUNCT(0))
34#define P_UART3_RX (P_DEFINED | P_IDENT(GPIO_PB7) | P_FUNCT(0))
35#define P_SPI2_SS (P_DEFINED | P_IDENT(GPIO_PB8) | P_FUNCT(0))
36#define P_SPI2_SSEL1 (P_DEFINED | P_IDENT(GPIO_PB9) | P_FUNCT(0))
37#define P_SPI2_SSEL2 (P_DEFINED | P_IDENT(GPIO_PB10) | P_FUNCT(0))
38#define P_SPI2_SSEL3 (P_DEFINED | P_IDENT(GPIO_PB11) | P_FUNCT(0))
39#define P_SPI2_SCK (P_DEFINED | P_IDENT(GPIO_PB12) | P_FUNCT(0))
40#define P_SPI2_MOSI (P_DEFINED | P_IDENT(GPIO_PB13) | P_FUNCT(0))
41#define P_SPI2_MISO (P_DEFINED | P_IDENT(GPIO_PB14) | P_FUNCT(0))
42#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PB8) | P_FUNCT(1))
43#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PB9) | P_FUNCT(1))
44#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PB10) | P_FUNCT(1))
45#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PB11) | P_FUNCT(1))
46
47#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PC0) | P_FUNCT(0))
48#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PC1) | P_FUNCT(0))
49#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PC2) | P_FUNCT(0))
50#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PC3) | P_FUNCT(0))
51#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PC4) | P_FUNCT(0))
52#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PC5) | P_FUNCT(0))
53#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PC6) | P_FUNCT(0))
54#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PC7) | P_FUNCT(0))
55#define P_SD_D0 (P_DEFINED | P_IDENT(GPIO_PC8) | P_FUNCT(0))
56#define P_SD_D1 (P_DEFINED | P_IDENT(GPIO_PC9) | P_FUNCT(0))
57#define P_SD_D2 (P_DEFINED | P_IDENT(GPIO_PC10) | P_FUNCT(0))
58#define P_SD_D3 (P_DEFINED | P_IDENT(GPIO_PC11) | P_FUNCT(0))
59#define P_SD_CLK (P_DEFINED | P_IDENT(GPIO_PC12) | P_FUNCT(0))
60#define P_SD_CMD (P_DEFINED | P_IDENT(GPIO_PC13) | P_FUNCT(0))
61#define P_MMCLK (P_DEFINED | P_IDENT(GPIO_PC1) | P_FUNCT(1))
62#define P_MBCLK (P_DEFINED | P_IDENT(GPIO_PC5) | P_FUNCT(1))
63
64#define P_PPI1_D0 (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(0))
65#define P_PPI1_D1 (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(0))
66#define P_PPI1_D2 (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(0))
67#define P_PPI1_D3 (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(0))
68#define P_PPI1_D4 (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(0))
69#define P_PPI1_D5 (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(0))
70#define P_PPI1_D6 (P_DEFINED | P_IDENT(GPIO_PD6) | P_FUNCT(0))
71#define P_PPI1_D7 (P_DEFINED | P_IDENT(GPIO_PD7) | P_FUNCT(0))
72#define P_PPI1_D8 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(0))
73#define P_PPI1_D9 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(0))
74#define P_PPI1_D10 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(0))
75#define P_PPI1_D11 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(0))
76#define P_PPI1_D12 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(0))
77#define P_PPI1_D13 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(0))
78#define P_PPI1_D14 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(0))
79#define P_PPI1_D15 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(0))
80
81#define P_HOST_D8 (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(1))
82#define P_HOST_D9 (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(1))
83#define P_HOST_D10 (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(1))
84#define P_HOST_D11 (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(1))
85#define P_HOST_D12 (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(1))
86#define P_HOST_D13 (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(1))
87#define P_HOST_D14 (P_DEFINED | P_IDENT(GPIO_PD6) | P_FUNCT(1))
88#define P_HOST_D15 (P_DEFINED | P_IDENT(GPIO_PD7) | P_FUNCT(1))
89#define P_HOST_D0 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(1))
90#define P_HOST_D1 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(1))
91#define P_HOST_D2 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(1))
92#define P_HOST_D3 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(1))
93#define P_HOST_D4 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(1))
94#define P_HOST_D5 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(1))
95#define P_HOST_D6 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(1))
96#define P_HOST_D7 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(1))
97#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(2))
98#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(2))
99#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(2))
100#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(2))
101#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(2))
102#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(2))
103#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PD6) | P_FUNCT(2))
104#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PD7) | P_FUNCT(2))
105#define P_PPI2_D0 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(2))
106#define P_PPI2_D1 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(2))
107#define P_PPI2_D2 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(2))
108#define P_PPI2_D3 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(2))
109#define P_PPI2_D4 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(2))
110#define P_PPI2_D5 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(2))
111#define P_PPI2_D6 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(2))
112#define P_PPI2_D7 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(2))
113#define P_PPI0_D18 (P_DEFINED | P_IDENT(GPIO_PD0) | P_FUNCT(3))
114#define P_PPI0_D19 (P_DEFINED | P_IDENT(GPIO_PD1) | P_FUNCT(3))
115#define P_PPI0_D20 (P_DEFINED | P_IDENT(GPIO_PD2) | P_FUNCT(3))
116#define P_PPI0_D21 (P_DEFINED | P_IDENT(GPIO_PD3) | P_FUNCT(3))
117#define P_PPI0_D22 (P_DEFINED | P_IDENT(GPIO_PD4) | P_FUNCT(3))
118#define P_PPI0_D23 (P_DEFINED | P_IDENT(GPIO_PD5) | P_FUNCT(3))
119#define P_KEY_ROW0 (P_DEFINED | P_IDENT(GPIO_PD8) | P_FUNCT(3))
120#define P_KEY_ROW1 (P_DEFINED | P_IDENT(GPIO_PD9) | P_FUNCT(3))
121#define P_KEY_ROW2 (P_DEFINED | P_IDENT(GPIO_PD10) | P_FUNCT(3))
122#define P_KEY_ROW3 (P_DEFINED | P_IDENT(GPIO_PD11) | P_FUNCT(3))
123#define P_KEY_COL0 (P_DEFINED | P_IDENT(GPIO_PD12) | P_FUNCT(3))
124#define P_KEY_COL1 (P_DEFINED | P_IDENT(GPIO_PD13) | P_FUNCT(3))
125#define P_KEY_COL2 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(3))
126#define P_KEY_COL3 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(3))
127
128#define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PE0) | P_FUNCT(0))
129#define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PE1) | P_FUNCT(0))
130#define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PE2) | P_FUNCT(0))
131#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PE3) | P_FUNCT(0))
132#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PE4) | P_FUNCT(0))
133#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PE5) | P_FUNCT(0))
134#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PE6) | P_FUNCT(0))
135#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PE7) | P_FUNCT(0))
136#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PE8) | P_FUNCT(0))
137#define P_UART1_RTS (P_DEFINED | P_IDENT(GPIO_PE9) | P_FUNCT(0))
138#define P_UART1_CTS (P_DEFINED | P_IDENT(GPIO_PE10) | P_FUNCT(0))
139#define P_PPI1_CLK (P_DEFINED | P_IDENT(GPIO_PE11) | P_FUNCT(0))
140#define P_PPI1_FS1 (P_DEFINED | P_IDENT(GPIO_PE12) | P_FUNCT(0))
141#define P_PPI1_FS2 (P_DEFINED | P_IDENT(GPIO_PE13) | P_FUNCT(0))
142#define P_TWI0_SCL (P_DEFINED | P_IDENT(GPIO_PE14) | P_FUNCT(0))
143#define P_TWI0_SDA (P_DEFINED | P_IDENT(GPIO_PE15) | P_FUNCT(0))
144#define P_KEY_COL7 (P_DEFINED | P_IDENT(GPIO_PE0) | P_FUNCT(1))
145#define P_KEY_ROW6 (P_DEFINED | P_IDENT(GPIO_PE1) | P_FUNCT(1))
146#define P_KEY_COL6 (P_DEFINED | P_IDENT(GPIO_PE2) | P_FUNCT(1))
147#define P_KEY_ROW5 (P_DEFINED | P_IDENT(GPIO_PE3) | P_FUNCT(1))
148#define P_KEY_COL5 (P_DEFINED | P_IDENT(GPIO_PE4) | P_FUNCT(1))
149#define P_KEY_ROW4 (P_DEFINED | P_IDENT(GPIO_PE5) | P_FUNCT(1))
150#define P_KEY_COL4 (P_DEFINED | P_IDENT(GPIO_PE6) | P_FUNCT(1))
151#define P_KEY_ROW7 (P_DEFINED | P_IDENT(GPIO_PE7) | P_FUNCT(1))
152
153#define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
154#define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
155#define P_PPI0_D2 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
156#define P_PPI0_D3 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
157#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
158#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
159#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
160#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
161#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
162#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
163#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
164#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
165#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
166#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
167#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
168#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
169#define P_ATAPI_D0A (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
170#define P_ATAPI_D1A (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
171#define P_ATAPI_D2A (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
172#define P_ATAPI_D3A (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
173#define P_ATAPI_D4A (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
174#define P_ATAPI_D5A (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
175#define P_ATAPI_D6A (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
176#define P_ATAPI_D7A (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
177#define P_ATAPI_D8A (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
178#define P_ATAPI_D9A (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
179#define P_ATAPI_D10A (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(1))
180#define P_ATAPI_D11A (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(1))
181#define P_ATAPI_D12A (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(1))
182#define P_ATAPI_D13A (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(1))
183#define P_ATAPI_D14A (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
184#define P_ATAPI_D15A (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
185
186#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
187#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
188#define P_PPI0_FS2 (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(0))
189#define P_PPI0_D16 (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
190#define P_PPI0_D17 (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
191#define P_SPI1_SSEL1 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
192#define P_SPI1_SSEL2 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
193#define P_SPI1_SSEL3 (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
194#define P_SPI1_SCK (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
195#define P_SPI1_MISO (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
196#define P_SPI1_MOSI (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
197#define P_SPI1_SS (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0))
198#define P_CAN0_TX (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
199#define P_CAN0_RX (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
200#define P_CAN1_TX (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
201#define P_CAN1_RX (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
202#define P_ATAPI_A0A (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(1))
203#define P_ATAPI_A1A (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1))
204#define P_ATAPI_A2A (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(1))
205#define P_HOST_CE (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(1))
206#define P_HOST_RD (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(1))
207#define P_HOST_WR (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1))
208#define P_MTXONB (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
209#define P_PPI2_FS2 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(2))
210#define P_PPI2_FS1 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(2))
211#define P_PPI2_CLK (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(2))
212#define P_CNT_CZM (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(3))
213
214#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
215#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
216#define P_ATAPI_RESET (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
217#define P_HOST_ADDR (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(0))
218#define P_HOST_ACK (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(0))
219#define P_MTX (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(0))
220#define P_MRX (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(0))
221#define P_MRXONB (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(0))
222#define P_A4 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(0))
223#define P_A5 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(0))
224#define P_A6 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(0))
225#define P_A7 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(0))
226#define P_A8 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(0))
227#define P_A9 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(0))
228#define P_PPI1_FS3 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(1))
229#define P_PPI2_FS3 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(1))
230#define P_TMR8 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(1))
231#define P_TMR9 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(1))
232#define P_TMR10 (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(1))
233#define P_DMAR0 (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(1))
234#define P_DMAR1 (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(1))
235#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(2))
236#define P_CNT_CDG (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(2))
237#define P_CNT_CUD (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(2))
238
239#define P_A10 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI0) | P_FUNCT(0))
240#define P_A11 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI1) | P_FUNCT(0))
241#define P_A12 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI2) | P_FUNCT(0))
242#define P_A13 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI3) | P_FUNCT(0))
243#define P_A14 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI4) | P_FUNCT(0))
244#define P_A15 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI5) | P_FUNCT(0))
245#define P_A16 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI6) | P_FUNCT(0))
246#define P_A17 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI7) | P_FUNCT(0))
247#define P_A18 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI8) | P_FUNCT(0))
248#define P_A19 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI9) | P_FUNCT(0))
249#define P_A20 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI10) | P_FUNCT(0))
250#define P_A21 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI11) | P_FUNCT(0))
251#define P_A22 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI12) | P_FUNCT(0))
252#define P_A23 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI13) | P_FUNCT(0))
253#define P_A24 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI14) | P_FUNCT(0))
254#define P_A25 (P_MAYSHARE | P_DEFINED | P_IDENT(GPIO_PI15) | P_FUNCT(0))
255#define P_NOR_CLK (P_DEFINED | P_IDENT(GPIO_PI15) | P_FUNCT(1))
256
257#define P_AMC_ARDY_NOR_WAIT (P_DEFINED | P_IDENT(GPIO_PJ0) | P_FUNCT(0))
258#define P_NAND_CE (P_DEFINED | P_IDENT(GPIO_PJ1) | P_FUNCT(0))
259#define P_NAND_RB (P_DEFINED | P_IDENT(GPIO_PJ2) | P_FUNCT(0))
260#define P_ATAPI_DIOR (P_DEFINED | P_IDENT(GPIO_PJ3) | P_FUNCT(0))
261#define P_ATAPI_DIOW (P_DEFINED | P_IDENT(GPIO_PJ4) | P_FUNCT(0))
262#define P_ATAPI_CS0 (P_DEFINED | P_IDENT(GPIO_PJ5) | P_FUNCT(0))
263#define P_ATAPI_CS1 (P_DEFINED | P_IDENT(GPIO_PJ6) | P_FUNCT(0))
264#define P_ATAPI_DMACK (P_DEFINED | P_IDENT(GPIO_PJ7) | P_FUNCT(0))
265#define P_ATAPI_DMARQ (P_DEFINED | P_IDENT(GPIO_PJ8) | P_FUNCT(0))
266#define P_ATAPI_INTRQ (P_DEFINED | P_IDENT(GPIO_PJ9) | P_FUNCT(0))
267#define P_ATAPI_IORDY (P_DEFINED | P_IDENT(GPIO_PJ10) | P_FUNCT(0))
268#define P_AMC_BR (P_DEFINED | P_IDENT(GPIO_PJ11) | P_FUNCT(0))
269#define P_AMC_BG (P_DEFINED | P_IDENT(GPIO_PJ12) | P_FUNCT(0))
270#define P_AMC_BGH (P_DEFINED | P_IDENT(GPIO_PJ13) | P_FUNCT(0))
271
272
273#define P_NAND_D0 (P_DONTCARE)
274#define P_NAND_D1 (P_DONTCARE)
275#define P_NAND_D2 (P_DONTCARE)
276#define P_NAND_D3 (P_DONTCARE)
277#define P_NAND_D4 (P_DONTCARE)
278#define P_NAND_D5 (P_DONTCARE)
279#define P_NAND_D6 (P_DONTCARE)
280#define P_NAND_D7 (P_DONTCARE)
281#define P_NAND_WE (P_DONTCARE)
282#define P_NAND_RE (P_DONTCARE)
283#define P_NAND_CLE (P_DONTCARE)
284#define P_NAND_ALE (P_DONTCARE)
285
286#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-bf561/anomaly.h b/include/asm-blackfin/mach-bf561/anomaly.h
deleted file mode 100644
index 5c5d7d7d695f..000000000000
--- a/include/asm-blackfin/mach-bf561/anomaly.h
+++ /dev/null
@@ -1,274 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf561/anomaly.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2004-2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9/* This file shoule be up to date with:
10 * - Revision P, 02/08/2008; ADSP-BF561 Blackfin Processor Anomaly List
11 */
12
13#ifndef _MACH_ANOMALY_H_
14#define _MACH_ANOMALY_H_
15
16/* We do not support 0.1, 0.2, or 0.4 silicon - sorry */
17#if __SILICON_REVISION__ < 3 || __SILICON_REVISION__ == 4
18# error will not work on BF561 silicon version 0.0, 0.1, 0.2, or 0.4
19#endif
20
21/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot 2 Not Supported */
22#define ANOMALY_05000074 (1)
23/* UART Line Status Register (UART_LSR) Bits Are Not Updated at the Same Time */
24#define ANOMALY_05000099 (__SILICON_REVISION__ < 5)
25/* Trace Buffers may contain errors in emulation mode and/or exception, NMI, reset handlers */
26#define ANOMALY_05000116 (__SILICON_REVISION__ < 3)
27/* Testset instructions restricted to 32-bit aligned memory locations */
28#define ANOMALY_05000120 (1)
29/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
30#define ANOMALY_05000122 (1)
31/* Erroneous exception when enabling cache */
32#define ANOMALY_05000125 (__SILICON_REVISION__ < 3)
33/* Signbits instruction not functional under certain conditions */
34#define ANOMALY_05000127 (1)
35/* Two bits in the Watchpoint Status Register (WPSTAT) are swapped */
36#define ANOMALY_05000134 (__SILICON_REVISION__ < 3)
37/* Enable wires from the Data Watchpoint Address Control Register (WPDACTL) are swapped */
38#define ANOMALY_05000135 (__SILICON_REVISION__ < 3)
39/* Stall in multi-unit DMA operations */
40#define ANOMALY_05000136 (__SILICON_REVISION__ < 3)
41/* Allowing the SPORT RX FIFO to fill will cause an overflow */
42#define ANOMALY_05000140 (__SILICON_REVISION__ < 3)
43/* Infinite Stall may occur with a particular sequence of consecutive dual dag events */
44#define ANOMALY_05000141 (__SILICON_REVISION__ < 3)
45/* Interrupts may be lost when a programmable input flag is configured to be edge sensitive */
46#define ANOMALY_05000142 (__SILICON_REVISION__ < 3)
47/* DMA and TESTSET conflict when both are accessing external memory */
48#define ANOMALY_05000144 (__SILICON_REVISION__ < 3)
49/* In PWM_OUT mode, you must enable the PPI block to generate a waveform from PPI_CLK */
50#define ANOMALY_05000145 (__SILICON_REVISION__ < 3)
51/* MDMA may lose the first few words of a descriptor chain */
52#define ANOMALY_05000146 (__SILICON_REVISION__ < 3)
53/* Source MDMA descriptor may stop with a DMA Error near beginning of descriptor fetch */
54#define ANOMALY_05000147 (__SILICON_REVISION__ < 3)
55/* IMDMA S1/D1 channel may stall */
56#define ANOMALY_05000149 (1)
57/* DMA engine may lose data due to incorrect handshaking */
58#define ANOMALY_05000150 (__SILICON_REVISION__ < 3)
59/* DMA stalls when all three controllers read data from the same source */
60#define ANOMALY_05000151 (__SILICON_REVISION__ < 3)
61/* Execution stall when executing in L2 and doing external accesses */
62#define ANOMALY_05000152 (__SILICON_REVISION__ < 3)
63/* Frame Delay in SPORT Multichannel Mode */
64#define ANOMALY_05000153 (__SILICON_REVISION__ < 3)
65/* SPORT TFS signal stays active in multichannel mode outside of valid channels */
66#define ANOMALY_05000154 (__SILICON_REVISION__ < 3)
67/* Timers in PWM-Out Mode with PPI GP Receive (Input) Mode with 0 Frame Syncs */
68#define ANOMALY_05000156 (__SILICON_REVISION__ < 4)
69/* Killed 32-bit MMR write leads to next system MMR access thinking it should be 32-bit */
70#define ANOMALY_05000157 (__SILICON_REVISION__ < 3)
71/* DMA Lock-up at CCLK to SCLK ratios of 4:1, 2:1, or 1:1 */
72#define ANOMALY_05000159 (__SILICON_REVISION__ < 3)
73/* A read from external memory may return a wrong value with data cache enabled */
74#define ANOMALY_05000160 (__SILICON_REVISION__ < 3)
75/* Data Cache Fill data can be corrupted after/during Instruction DMA if certain core stalls exist */
76#define ANOMALY_05000161 (__SILICON_REVISION__ < 3)
77/* DMEM_CONTROL<12> is not set on Reset */
78#define ANOMALY_05000162 (__SILICON_REVISION__ < 3)
79/* SPORT transmit data is not gated by external frame sync in certain conditions */
80#define ANOMALY_05000163 (__SILICON_REVISION__ < 3)
81/* PPI Data Lengths Between 8 and 16 Do Not Zero Out Upper Bits */
82#define ANOMALY_05000166 (1)
83/* Turning Serial Ports on with External Frame Syncs */
84#define ANOMALY_05000167 (1)
85/* SDRAM auto-refresh and subsequent Power Ups */
86#define ANOMALY_05000168 (__SILICON_REVISION__ < 5)
87/* DATA CPLB page miss can result in lost write-through cache data writes */
88#define ANOMALY_05000169 (__SILICON_REVISION__ < 5)
89/* Boot-ROM code modifies SICA_IWRx wakeup registers */
90#define ANOMALY_05000171 (__SILICON_REVISION__ < 5)
91/* DSPID register values incorrect */
92#define ANOMALY_05000172 (__SILICON_REVISION__ < 3)
93/* DMA vs Core accesses to external memory */
94#define ANOMALY_05000173 (__SILICON_REVISION__ < 3)
95/* Cache Fill Buffer Data lost */
96#define ANOMALY_05000174 (__SILICON_REVISION__ < 5)
97/* Overlapping Sequencer and Memory Stalls */
98#define ANOMALY_05000175 (__SILICON_REVISION__ < 5)
99/* Multiplication of (-1) by (-1) followed by an accumulator saturation */
100#define ANOMALY_05000176 (__SILICON_REVISION__ < 5)
101/* PPI_COUNT Cannot Be Programmed to 0 in General Purpose TX or RX Modes */
102#define ANOMALY_05000179 (__SILICON_REVISION__ < 5)
103/* PPI_DELAY Not Functional in PPI Modes with 0 Frame Syncs */
104#define ANOMALY_05000180 (1)
105/* Disabling the PPI resets the PPI configuration registers */
106#define ANOMALY_05000181 (__SILICON_REVISION__ < 5)
107/* IMDMA does not operate to full speed for 600MHz and higher devices */
108#define ANOMALY_05000182 (1)
109/* Timer Pin limitations for PPI TX Modes with External Frame Syncs */
110#define ANOMALY_05000184 (__SILICON_REVISION__ < 5)
111/* PPI TX Mode with 2 External Frame Syncs */
112#define ANOMALY_05000185 (__SILICON_REVISION__ < 5)
113/* PPI packing with Data Length greater than 8 bits (not a meaningful mode) */
114#define ANOMALY_05000186 (__SILICON_REVISION__ < 5)
115/* IMDMA Corrupted Data after a Halt */
116#define ANOMALY_05000187 (1)
117/* IMDMA Restrictions on Descriptor and Buffer Placement in Memory */
118#define ANOMALY_05000188 (__SILICON_REVISION__ < 5)
119/* False Protection Exceptions */
120#define ANOMALY_05000189 (__SILICON_REVISION__ < 5)
121/* PPI not functional at core voltage < 1Volt */
122#define ANOMALY_05000190 (1)
123/* PPI does not invert the Driving PPICLK edge in Transmit Modes */
124#define ANOMALY_05000191 (__SILICON_REVISION__ < 3)
125/* False I/O Pin Interrupts on Edge-Sensitive Inputs When Polarity Setting Is Changed */
126#define ANOMALY_05000193 (__SILICON_REVISION__ < 5)
127/* Restarting SPORT in Specific Modes May Cause Data Corruption */
128#define ANOMALY_05000194 (__SILICON_REVISION__ < 5)
129/* Failing MMR Accesses When Stalled by Preceding Memory Read */
130#define ANOMALY_05000198 (__SILICON_REVISION__ < 5)
131/* Current DMA Address Shows Wrong Value During Carry Fix */
132#define ANOMALY_05000199 (__SILICON_REVISION__ < 5)
133/* SPORT TFS and DT Are Incorrectly Driven During Inactive Channels in Certain Conditions */
134#define ANOMALY_05000200 (__SILICON_REVISION__ < 5)
135/* Possible Infinite Stall with Specific Dual-DAG Situation */
136#define ANOMALY_05000202 (__SILICON_REVISION__ < 5)
137/* Incorrect data read with write-through cache and allocate cache lines on reads only mode */
138#define ANOMALY_05000204 (__SILICON_REVISION__ < 5)
139/* Specific sequence that can cause DMA error or DMA stopping */
140#define ANOMALY_05000205 (__SILICON_REVISION__ < 5)
141/* Recovery from "Brown-Out" Condition */
142#define ANOMALY_05000207 (__SILICON_REVISION__ < 5)
143/* VSTAT Status Bit in PLL_STAT Register Is Not Functional */
144#define ANOMALY_05000208 (1)
145/* Speed Path in Computational Unit Affects Certain Instructions */
146#define ANOMALY_05000209 (__SILICON_REVISION__ < 5)
147/* UART TX Interrupt Masked Erroneously */
148#define ANOMALY_05000215 (__SILICON_REVISION__ < 5)
149/* NMI Event at Boot Time Results in Unpredictable State */
150#define ANOMALY_05000219 (__SILICON_REVISION__ < 5)
151/* Data Corruption with Cached External Memory and Non-Cached On-Chip L2 Memory */
152#define ANOMALY_05000220 (__SILICON_REVISION__ < 5)
153/* Incorrect Pulse-Width of UART Start Bit */
154#define ANOMALY_05000225 (__SILICON_REVISION__ < 5)
155/* Scratchpad Memory Bank Reads May Return Incorrect Data */
156#define ANOMALY_05000227 (__SILICON_REVISION__ < 5)
157/* UART Receiver is Less Robust Against Baudrate Differences in Certain Conditions */
158#define ANOMALY_05000230 (__SILICON_REVISION__ < 5)
159/* UART STB Bit Incorrectly Affects Receiver Setting */
160#define ANOMALY_05000231 (__SILICON_REVISION__ < 5)
161/* SPORT data transmit lines are incorrectly driven in multichannel mode */
162#define ANOMALY_05000232 (__SILICON_REVISION__ < 5)
163/* DF Bit in PLL_CTL Register Does Not Respond to Hardware Reset */
164#define ANOMALY_05000242 (__SILICON_REVISION__ < 5)
165/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */
166#define ANOMALY_05000244 (__SILICON_REVISION__ < 5)
167/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */
168#define ANOMALY_05000245 (__SILICON_REVISION__ < 5)
169/* TESTSET operation forces stall on the other core */
170#define ANOMALY_05000248 (__SILICON_REVISION__ < 5)
171/* Incorrect Bit Shift of Data Word in Multichannel (TDM) Mode in Certain Conditions */
172#define ANOMALY_05000250 (__SILICON_REVISION__ > 2 && __SILICON_REVISION__ < 5)
173/* Exception Not Generated for MMR Accesses in Reserved Region */
174#define ANOMALY_05000251 (__SILICON_REVISION__ < 5)
175/* Maximum External Clock Speed for Timers */
176#define ANOMALY_05000253 (__SILICON_REVISION__ < 5)
177/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */
178#define ANOMALY_05000254 (__SILICON_REVISION__ > 3)
179/* Interrupt/Exception During Short Hardware Loop May Cause Bad Instruction Fetches */
180#define ANOMALY_05000257 (__SILICON_REVISION__ < 5)
181/* Instruction Cache Is Corrupted When Bits 9 and 12 of the ICPLB Data Registers Differ */
182#define ANOMALY_05000258 (__SILICON_REVISION__ < 5)
183/* ICPLB_STATUS MMR Register May Be Corrupted */
184#define ANOMALY_05000260 (__SILICON_REVISION__ < 5)
185/* DCPLB_FAULT_ADDR MMR Register May Be Corrupted */
186#define ANOMALY_05000261 (__SILICON_REVISION__ < 5)
187/* Stores To Data Cache May Be Lost */
188#define ANOMALY_05000262 (__SILICON_REVISION__ < 5)
189/* Hardware Loop Corrupted When Taking an ICPLB Exception */
190#define ANOMALY_05000263 (__SILICON_REVISION__ < 5)
191/* CSYNC/SSYNC/IDLE Causes Infinite Stall in Penultimate Instruction in Hardware Loop */
192#define ANOMALY_05000264 (__SILICON_REVISION__ < 5)
193/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
194#define ANOMALY_05000265 (__SILICON_REVISION__ < 5)
195/* IMDMA destination IRQ status must be read prior to using IMDMA */
196#define ANOMALY_05000266 (__SILICON_REVISION__ > 3)
197/* IMDMA may corrupt data under certain conditions */
198#define ANOMALY_05000267 (1)
199/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Increase */
200#define ANOMALY_05000269 (1)
201/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */
202#define ANOMALY_05000270 (1)
203/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
204#define ANOMALY_05000272 (1)
205/* Data cache write back to external synchronous memory may be lost */
206#define ANOMALY_05000274 (1)
207/* PPI Timing and Sampling Information Updates */
208#define ANOMALY_05000275 (__SILICON_REVISION__ > 2)
209/* Timing Requirements Change for External Frame Sync PPI Modes with Non-Zero PPI_DELAY */
210#define ANOMALY_05000276 (__SILICON_REVISION__ < 5)
211/* Writes to an I/O data register one SCLK cycle after an edge is detected may clear interrupt */
212#define ANOMALY_05000277 (__SILICON_REVISION__ < 3)
213/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
214#define ANOMALY_05000278 (__SILICON_REVISION__ < 5)
215/* False Hardware Error Exception When ISR Context Is Not Restored */
216#define ANOMALY_05000281 (__SILICON_REVISION__ < 5)
217/* System MMR Write Is Stalled Indefinitely When Killed in a Particular Stage */
218#define ANOMALY_05000283 (1)
219/* A read will receive incorrect data under certain conditions */
220#define ANOMALY_05000287 (__SILICON_REVISION__ < 5)
221/* SPORTs May Receive Bad Data If FIFOs Fill Up */
222#define ANOMALY_05000288 (__SILICON_REVISION__ < 5)
223/* Memory-To-Memory DMA Source/Destination Descriptors Must Be in Same Memory Space */
224#define ANOMALY_05000301 (1)
225/* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */
226#define ANOMALY_05000302 (1)
227/* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */
228#define ANOMALY_05000305 (__SILICON_REVISION__ < 5)
229/* SCKELOW Bit Does Not Maintain State Through Hibernate */
230#define ANOMALY_05000307 (__SILICON_REVISION__ < 5)
231/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
232#define ANOMALY_05000310 (1)
233/* Errors When SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
234#define ANOMALY_05000312 (1)
235/* PPI Is Level-Sensitive on First Transfer */
236#define ANOMALY_05000313 (1)
237/* Killed System MMR Write Completes Erroneously On Next System MMR Access */
238#define ANOMALY_05000315 (1)
239/* PF2 Output Remains Asserted After SPI Master Boot */
240#define ANOMALY_05000320 (__SILICON_REVISION__ > 3)
241/* Erroneous GPIO Flag Pin Operations Under Specific Sequences */
242#define ANOMALY_05000323 (1)
243/* SPORT Secondary Receive Channel Not Functional When Word Length Exceeds 16 Bits */
244#define ANOMALY_05000326 (__SILICON_REVISION__ > 3)
245/* New Feature: 24-Bit SPI Boot Mode Support (Not Available On Older Silicon) */
246#define ANOMALY_05000331 (__SILICON_REVISION__ < 5)
247/* New Feature: Slave SPI Boot Mode Supported (Not Available On Older Silicon) */
248#define ANOMALY_05000332 (__SILICON_REVISION__ < 5)
249/* Flag Data Register Writes One SCLK Cycle After Edge Is Detected May Clear Interrupt Status */
250#define ANOMALY_05000333 (__SILICON_REVISION__ < 5)
251/* New Feature: Additional PPI Frame Sync Sampling Options (Not Available on Older Silicon) */
252#define ANOMALY_05000339 (__SILICON_REVISION__ < 5)
253/* Memory DMA FIFO Causes Throughput Degradation on Writes to External Memory */
254#define ANOMALY_05000343 (__SILICON_REVISION__ < 5)
255/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
256#define ANOMALY_05000357 (1)
257/* Conflicting Column Address Widths Causes SDRAM Errors */
258#define ANOMALY_05000362 (1)
259/* UART Break Signal Issues */
260#define ANOMALY_05000363 (__SILICON_REVISION__ < 5)
261/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
262#define ANOMALY_05000366 (1)
263/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
264#define ANOMALY_05000371 (1)
265/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
266#define ANOMALY_05000403 (1)
267
268/* Anomalies that don't exist on this proc */
269#define ANOMALY_05000158 (0)
270#define ANOMALY_05000183 (0)
271#define ANOMALY_05000273 (0)
272#define ANOMALY_05000311 (0)
273
274#endif
diff --git a/include/asm-blackfin/mach-bf561/bf561.h b/include/asm-blackfin/mach-bf561/bf561.h
deleted file mode 100644
index 3ef9e5f36136..000000000000
--- a/include/asm-blackfin/mach-bf561/bf561.h
+++ /dev/null
@@ -1,223 +0,0 @@
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
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 * Blackfin Cache setup
54 */
55
56
57#define BFIN_ISUBBANKS 4
58#define BFIN_IWAYS 4
59#define BFIN_ILINES 32
60
61#define BFIN_DSUBBANKS 4
62#define BFIN_DWAYS 2
63#define BFIN_DLINES 64
64
65#define WAY0_L 0x1
66#define WAY1_L 0x2
67#define WAY01_L 0x3
68#define WAY2_L 0x4
69#define WAY02_L 0x5
70#define WAY12_L 0x6
71#define WAY012_L 0x7
72
73#define WAY3_L 0x8
74#define WAY03_L 0x9
75#define WAY13_L 0xA
76#define WAY013_L 0xB
77
78#define WAY32_L 0xC
79#define WAY320_L 0xD
80#define WAY321_L 0xE
81#define WAYALL_L 0xF
82
83#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
84
85/* IAR0 BIT FIELDS */
86#define PLL_WAKEUP_BIT 0xFFFFFFFF
87#define DMA1_ERROR_BIT 0xFFFFFF0F
88#define DMA2_ERROR_BIT 0xFFFFF0FF
89#define IMDMA_ERROR_BIT 0xFFFF0FFF
90#define PPI1_ERROR_BIT 0xFFF0FFFF
91#define PPI2_ERROR_BIT 0xFF0FFFFF
92#define SPORT0_ERROR_BIT 0xF0FFFFFF
93#define SPORT1_ERROR_BIT 0x0FFFFFFF
94/* IAR1 BIT FIELDS */
95#define SPI_ERROR_BIT 0xFFFFFFFF
96#define UART_ERROR_BIT 0xFFFFFF0F
97#define RESERVED_ERROR_BIT 0xFFFFF0FF
98#define DMA1_0_BIT 0xFFFF0FFF
99#define DMA1_1_BIT 0xFFF0FFFF
100#define DMA1_2_BIT 0xFF0FFFFF
101#define DMA1_3_BIT 0xF0FFFFFF
102#define DMA1_4_BIT 0x0FFFFFFF
103/* IAR2 BIT FIELDS */
104#define DMA1_5_BIT 0xFFFFFFFF
105#define DMA1_6_BIT 0xFFFFFF0F
106#define DMA1_7_BIT 0xFFFFF0FF
107#define DMA1_8_BIT 0xFFFF0FFF
108#define DMA1_9_BIT 0xFFF0FFFF
109#define DMA1_10_BIT 0xFF0FFFFF
110#define DMA1_11_BIT 0xF0FFFFFF
111#define DMA2_0_BIT 0x0FFFFFFF
112/* IAR3 BIT FIELDS */
113#define DMA2_1_BIT 0xFFFFFFFF
114#define DMA2_2_BIT 0xFFFFFF0F
115#define DMA2_3_BIT 0xFFFFF0FF
116#define DMA2_4_BIT 0xFFFF0FFF
117#define DMA2_5_BIT 0xFFF0FFFF
118#define DMA2_6_BIT 0xFF0FFFFF
119#define DMA2_7_BIT 0xF0FFFFFF
120#define DMA2_8_BIT 0x0FFFFFFF
121/* IAR4 BIT FIELDS */
122#define DMA2_9_BIT 0xFFFFFFFF
123#define DMA2_10_BIT 0xFFFFFF0F
124#define DMA2_11_BIT 0xFFFFF0FF
125#define TIMER0_BIT 0xFFFF0FFF
126#define TIMER1_BIT 0xFFF0FFFF
127#define TIMER2_BIT 0xFF0FFFFF
128#define TIMER3_BIT 0xF0FFFFFF
129#define TIMER4_BIT 0x0FFFFFFF
130/* IAR5 BIT FIELDS */
131#define TIMER5_BIT 0xFFFFFFFF
132#define TIMER6_BIT 0xFFFFFF0F
133#define TIMER7_BIT 0xFFFFF0FF
134#define TIMER8_BIT 0xFFFF0FFF
135#define TIMER9_BIT 0xFFF0FFFF
136#define TIMER10_BIT 0xFF0FFFFF
137#define TIMER11_BIT 0xF0FFFFFF
138#define PROG0_INTA_BIT 0x0FFFFFFF
139/* IAR6 BIT FIELDS */
140#define PROG0_INTB_BIT 0xFFFFFFFF
141#define PROG1_INTA_BIT 0xFFFFFF0F
142#define PROG1_INTB_BIT 0xFFFFF0FF
143#define PROG2_INTA_BIT 0xFFFF0FFF
144#define PROG2_INTB_BIT 0xFFF0FFFF
145#define DMA1_WRRD0_BIT 0xFF0FFFFF
146#define DMA1_WRRD1_BIT 0xF0FFFFFF
147#define DMA2_WRRD0_BIT 0x0FFFFFFF
148/* IAR7 BIT FIELDS */
149#define DMA2_WRRD1_BIT 0xFFFFFFFF
150#define IMDMA_WRRD0_BIT 0xFFFFFF0F
151#define IMDMA_WRRD1_BIT 0xFFFFF0FF
152#define WATCH_BIT 0xFFFF0FFF
153#define RESERVED_1_BIT 0xFFF0FFFF
154#define RESERVED_2_BIT 0xFF0FFFFF
155#define SUPPLE_0_BIT 0xF0FFFFFF
156#define SUPPLE_1_BIT 0x0FFFFFFF
157
158/* Miscellaneous Values */
159
160/****************************** EBIU Settings ********************************/
161#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
162#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
163
164#if defined(CONFIG_C_AMBEN_ALL)
165#define V_AMBEN AMBEN_ALL
166#elif defined(CONFIG_C_AMBEN)
167#define V_AMBEN 0x0
168#elif defined(CONFIG_C_AMBEN_B0)
169#define V_AMBEN AMBEN_B0
170#elif defined(CONFIG_C_AMBEN_B0_B1)
171#define V_AMBEN AMBEN_B0_B1
172#elif defined(CONFIG_C_AMBEN_B0_B1_B2)
173#define V_AMBEN AMBEN_B0_B1_B2
174#endif
175
176#ifdef CONFIG_C_AMCKEN
177#define V_AMCKEN AMCKEN
178#else
179#define V_AMCKEN 0x0
180#endif
181
182#ifdef CONFIG_C_B0PEN
183#define V_B0PEN 0x10
184#else
185#define V_B0PEN 0x00
186#endif
187
188#ifdef CONFIG_C_B1PEN
189#define V_B1PEN 0x20
190#else
191#define V_B1PEN 0x00
192#endif
193
194#ifdef CONFIG_C_B2PEN
195#define V_B2PEN 0x40
196#else
197#define V_B2PEN 0x00
198#endif
199
200#ifdef CONFIG_C_B3PEN
201#define V_B3PEN 0x80
202#else
203#define V_B3PEN 0x00
204#endif
205
206#ifdef CONFIG_C_CDPRIO
207#define V_CDPRIO 0x100
208#else
209#define V_CDPRIO 0x0
210#endif
211
212#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO | V_B0PEN | V_B1PEN | V_B2PEN | V_B3PEN | 0x0002)
213
214#ifdef CONFIG_BF561
215#define CPU "BF561"
216#define CPUID 0x027bb000
217#endif
218#ifndef CPU
219#define CPU "UNKNOWN"
220#define CPUID 0x0
221#endif
222
223#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
deleted file mode 100644
index 8aa02780e642..000000000000
--- a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * file: include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * blackfin serial driver head file
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#include <linux/serial.h>
33#include <asm/dma.h>
34#include <asm/portmux.h>
35
36#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
37#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
38#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
39#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
40#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
41#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
42#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
43
44#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
45#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
46#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
47#define UART_SET_IER(uart,v) UART_PUT_IER(uart, UART_GET_IER(uart) | (v))
48#define UART_CLEAR_IER(uart,v) UART_PUT_IER(uart, UART_GET_IER(uart) & ~(v))
49#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
50#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
51#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
60#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
61
62#ifdef CONFIG_BFIN_UART0_CTSRTS
63# define CONFIG_SERIAL_BFIN_CTSRTS
64# ifndef CONFIG_UART0_CTS_PIN
65# define CONFIG_UART0_CTS_PIN -1
66# endif
67# ifndef CONFIG_UART0_RTS_PIN
68# define CONFIG_UART0_RTS_PIN -1
69# endif
70#endif
71
72struct bfin_serial_port {
73 struct uart_port port;
74 unsigned int old_status;
75 unsigned int lsr;
76#ifdef CONFIG_SERIAL_BFIN_DMA
77 int tx_done;
78 int tx_count;
79 struct circ_buf rx_dma_buf;
80 struct timer_list rx_dma_timer;
81 int rx_dma_nrows;
82 unsigned int tx_dma_channel;
83 unsigned int rx_dma_channel;
84 struct work_struct tx_dma_workqueue;
85#else
86# if ANOMALY_05000230
87 unsigned int anomaly_threshold;
88# endif
89#endif
90#ifdef CONFIG_SERIAL_BFIN_CTSRTS
91 struct timer_list cts_timer;
92 int cts_pin;
93 int rts_pin;
94#endif
95};
96
97/* The hardware clears the LSR bits upon read, so we need to cache
98 * some of the more fun bits in software so they don't get lost
99 * when checking the LSR in other code paths (TX).
100 */
101static inline unsigned int UART_GET_LSR(struct bfin_serial_port *uart)
102{
103 unsigned int lsr = bfin_read16(uart->port.membase + OFFSET_LSR);
104 uart->lsr |= (lsr & (BI|FE|PE|OE));
105 return lsr | uart->lsr;
106}
107
108static inline void UART_CLEAR_LSR(struct bfin_serial_port *uart)
109{
110 uart->lsr = 0;
111 bfin_write16(uart->port.membase + OFFSET_LSR, -1);
112}
113
114struct bfin_serial_port bfin_serial_ports[BFIN_UART_NR_PORTS];
115struct bfin_serial_res {
116 unsigned long uart_base_addr;
117 int uart_irq;
118#ifdef CONFIG_SERIAL_BFIN_DMA
119 unsigned int uart_tx_dma_channel;
120 unsigned int uart_rx_dma_channel;
121#endif
122#ifdef CONFIG_SERIAL_BFIN_CTSRTS
123 int uart_cts_pin;
124 int uart_rts_pin;
125#endif
126};
127
128struct bfin_serial_res bfin_serial_resource[] = {
129 {
130 0xFFC00400,
131 IRQ_UART_RX,
132#ifdef CONFIG_SERIAL_BFIN_DMA
133 CH_UART_TX,
134 CH_UART_RX,
135#endif
136#ifdef CONFIG_BFIN_UART0_CTSRTS
137 CONFIG_UART0_CTS_PIN,
138 CONFIG_UART0_RTS_PIN,
139#endif
140 }
141};
142
143#define DRIVER_NAME "bfin-uart"
144
145int nr_ports = BFIN_UART_NR_PORTS;
146static void bfin_serial_hw_init(struct bfin_serial_port *uart)
147{
148
149#ifdef CONFIG_SERIAL_BFIN_UART0
150 peripheral_request(P_UART0_TX, DRIVER_NAME);
151 peripheral_request(P_UART0_RX, DRIVER_NAME);
152#endif
153
154#ifdef CONFIG_SERIAL_BFIN_CTSRTS
155 if (uart->cts_pin >= 0) {
156 gpio_request(uart->cts_pin, DRIVER_NAME);
157 gpio_direction_input(uart->cts_pin);
158 }
159 if (uart->rts_pin >= 0) {
160 gpio_request(uart->rts_pin, DRIVER_NAME);
161 gpio_direction_input(uart->rts_pin, 0);
162 }
163#endif
164}
diff --git a/include/asm-blackfin/mach-bf561/bfin_sir.h b/include/asm-blackfin/mach-bf561/bfin_sir.h
deleted file mode 100644
index 9bb87e9e2e9b..000000000000
--- a/include/asm-blackfin/mach-bf561/bfin_sir.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART_RX,
69 CH_UART_RX,
70 CH_UART_TX,
71 },
72#endif
73};
74
75int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
76
77struct bfin_sir_self {
78 struct bfin_sir_port *sir_port;
79 spinlock_t lock;
80 unsigned int open;
81 int speed;
82 int newspeed;
83
84 struct sk_buff *txskb;
85 struct sk_buff *rxskb;
86 struct net_device_stats stats;
87 struct device *dev;
88 struct irlap_cb *irlap;
89 struct qos_info qos;
90
91 iobuff_t tx_buff;
92 iobuff_t rx_buff;
93
94 struct work_struct work;
95 int mtt;
96};
97
98static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
99{
100 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
101 port->lsr |= (lsr & (BI|FE|PE|OE));
102 return lsr | port->lsr;
103}
104
105static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
106{
107 port->lsr = 0;
108 bfin_read16(port->membase + OFFSET_LSR);
109}
110
111#define DRIVER_NAME "bfin_sir"
112
113static int bfin_sir_hw_init(void)
114{
115 int ret = -ENODEV;
116#ifdef CONFIG_BFIN_SIR0
117 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
118 if (ret)
119 return ret;
120 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
121 if (ret)
122 return ret;
123#endif
124 return ret;
125}
diff --git a/include/asm-blackfin/mach-bf561/blackfin.h b/include/asm-blackfin/mach-bf561/blackfin.h
deleted file mode 100644
index 0ea8666e6764..000000000000
--- a/include/asm-blackfin/mach-bf561/blackfin.h
+++ /dev/null
@@ -1,87 +0,0 @@
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__)
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#define SIC_IWR0 SICA_IWR0
53#define SIC_IWR1 SICA_IWR1
54#define SIC_IAR0 SICA_IAR0
55#define bfin_write_SIC_IMASK0 bfin_write_SICA_IMASK0
56#define bfin_write_SIC_IMASK1 bfin_write_SICA_IMASK1
57#define bfin_write_SIC_IWR0 bfin_write_SICA_IWR0
58#define bfin_write_SIC_IWR1 bfin_write_SICA_IWR1
59
60#define bfin_read_SIC_IMASK0 bfin_read_SICA_IMASK0
61#define bfin_read_SIC_IMASK1 bfin_read_SICA_IMASK1
62#define bfin_read_SIC_IWR0 bfin_read_SICA_IWR0
63#define bfin_read_SIC_IWR1 bfin_read_SICA_IWR1
64#define bfin_read_SIC_ISR0 bfin_read_SICA_ISR0
65#define bfin_read_SIC_ISR1 bfin_read_SICA_ISR1
66
67#define bfin_read_SIC_IMASK(x) bfin_read32(SICA_IMASK0 + (x << 2))
68#define bfin_write_SIC_IMASK(x, val) bfin_write32((SICA_IMASK0 + (x << 2)), val)
69#define bfin_read_SIC_ISR(x) bfin_read32(SICA_ISR0 + (x << 2))
70#define bfin_write_SIC_ISR(x, val) bfin_write32((SICA_ISR0 + (x << 2)), val)
71
72#define BFIN_UART_NR_PORTS 1
73
74#define OFFSET_THR 0x00 /* Transmit Holding register */
75#define OFFSET_RBR 0x00 /* Receive Buffer register */
76#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
77#define OFFSET_IER 0x04 /* Interrupt Enable Register */
78#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
79#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
80#define OFFSET_LCR 0x0C /* Line Control Register */
81#define OFFSET_MCR 0x10 /* Modem Control Register */
82#define OFFSET_LSR 0x14 /* Line Status Register */
83#define OFFSET_MSR 0x18 /* Modem Status Register */
84#define OFFSET_SCR 0x1C /* SCR Scratch Register */
85#define OFFSET_GCTL 0x24 /* Global Control Register */
86
87#endif /* _MACH_BLACKFIN_H_ */
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h b/include/asm-blackfin/mach-bf561/cdefBF561.h
deleted file mode 100644
index b07ffccd66dd..000000000000
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ /dev/null
@@ -1,1579 +0,0 @@
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#include <asm/blackfin.h>
35
36/* include all Core registers and bit definitions */
37#include "defBF561.h"
38
39/*include core specific register pointer definitions*/
40#include <asm/mach-common/cdef_LPBlackfin.h>
41
42#include <asm/system.h>
43
44/*********************************************************************************** */
45/* System MMR Register Map */
46/*********************************************************************************** */
47
48/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
49#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
50/* Writing to PLL_CTL initiates a PLL relock sequence. */
51static __inline__ void bfin_write_PLL_CTL(unsigned int val)
52{
53 unsigned long flags, iwr0, iwr1;
54
55 if (val == bfin_read_PLL_CTL())
56 return;
57
58 local_irq_save(flags);
59 /* Enable the PLL Wakeup bit in SIC IWR */
60 iwr0 = bfin_read32(SICA_IWR0);
61 iwr1 = bfin_read32(SICA_IWR1);
62 /* Only allow PPL Wakeup) */
63 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
64 bfin_write32(SICA_IWR1, 0);
65
66 bfin_write16(PLL_CTL, val);
67 SSYNC();
68 asm("IDLE;");
69
70 bfin_write32(SICA_IWR0, iwr0);
71 bfin_write32(SICA_IWR1, iwr1);
72 local_irq_restore(flags);
73}
74#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
75#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
76#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
77/* Writing to VR_CTL initiates a PLL relock sequence. */
78static __inline__ void bfin_write_VR_CTL(unsigned int val)
79{
80 unsigned long flags, iwr0, iwr1;
81
82 if (val == bfin_read_VR_CTL())
83 return;
84
85 local_irq_save(flags);
86 /* Enable the PLL Wakeup bit in SIC IWR */
87 iwr0 = bfin_read32(SICA_IWR0);
88 iwr1 = bfin_read32(SICA_IWR1);
89 /* Only allow PPL Wakeup) */
90 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
91 bfin_write32(SICA_IWR1, 0);
92
93 bfin_write16(VR_CTL, val);
94 SSYNC();
95 asm("IDLE;");
96
97 bfin_write32(SICA_IWR0, iwr0);
98 bfin_write32(SICA_IWR1, iwr1);
99 local_irq_restore(flags);
100}
101#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
102#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
103#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
104#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
105#define bfin_read_CHIPID() bfin_read32(CHIPID)
106
107/* For MMR's that are reserved on Core B, set up defines to better integrate with other ports */
108#define bfin_read_SWRST() bfin_read_SICA_SWRST()
109#define bfin_write_SWRST(val) bfin_write_SICA_SWRST(val)
110#define bfin_read_SYSCR() bfin_read_SICA_SYSCR()
111#define bfin_write_SYSCR(val) bfin_write_SICA_SYSCR(val)
112
113/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
114#define bfin_read_SICA_SWRST() bfin_read16(SICA_SWRST)
115#define bfin_write_SICA_SWRST(val) bfin_write16(SICA_SWRST,val)
116#define bfin_read_SICA_SYSCR() bfin_read16(SICA_SYSCR)
117#define bfin_write_SICA_SYSCR(val) bfin_write16(SICA_SYSCR,val)
118#define bfin_read_SICA_RVECT() bfin_read16(SICA_RVECT)
119#define bfin_write_SICA_RVECT(val) bfin_write16(SICA_RVECT,val)
120#define bfin_read_SICA_IMASK() bfin_read32(SICA_IMASK)
121#define bfin_write_SICA_IMASK(val) bfin_write32(SICA_IMASK,val)
122#define bfin_read_SICA_IMASK0() bfin_read32(SICA_IMASK0)
123#define bfin_write_SICA_IMASK0(val) bfin_write32(SICA_IMASK0,val)
124#define bfin_read_SICA_IMASK1() bfin_read32(SICA_IMASK1)
125#define bfin_write_SICA_IMASK1(val) bfin_write32(SICA_IMASK1,val)
126#define bfin_read_SICA_IAR0() bfin_read32(SICA_IAR0)
127#define bfin_write_SICA_IAR0(val) bfin_write32(SICA_IAR0,val)
128#define bfin_read_SICA_IAR1() bfin_read32(SICA_IAR1)
129#define bfin_write_SICA_IAR1(val) bfin_write32(SICA_IAR1,val)
130#define bfin_read_SICA_IAR2() bfin_read32(SICA_IAR2)
131#define bfin_write_SICA_IAR2(val) bfin_write32(SICA_IAR2,val)
132#define bfin_read_SICA_IAR3() bfin_read32(SICA_IAR3)
133#define bfin_write_SICA_IAR3(val) bfin_write32(SICA_IAR3,val)
134#define bfin_read_SICA_IAR4() bfin_read32(SICA_IAR4)
135#define bfin_write_SICA_IAR4(val) bfin_write32(SICA_IAR4,val)
136#define bfin_read_SICA_IAR5() bfin_read32(SICA_IAR5)
137#define bfin_write_SICA_IAR5(val) bfin_write32(SICA_IAR5,val)
138#define bfin_read_SICA_IAR6() bfin_read32(SICA_IAR6)
139#define bfin_write_SICA_IAR6(val) bfin_write32(SICA_IAR6,val)
140#define bfin_read_SICA_IAR7() bfin_read32(SICA_IAR7)
141#define bfin_write_SICA_IAR7(val) bfin_write32(SICA_IAR7,val)
142#define bfin_read_SICA_ISR0() bfin_read32(SICA_ISR0)
143#define bfin_write_SICA_ISR0(val) bfin_write32(SICA_ISR0,val)
144#define bfin_read_SICA_ISR1() bfin_read32(SICA_ISR1)
145#define bfin_write_SICA_ISR1(val) bfin_write32(SICA_ISR1,val)
146#define bfin_read_SICA_IWR0() bfin_read32(SICA_IWR0)
147#define bfin_write_SICA_IWR0(val) bfin_write32(SICA_IWR0,val)
148#define bfin_read_SICA_IWR1() bfin_read32(SICA_IWR1)
149#define bfin_write_SICA_IWR1(val) bfin_write32(SICA_IWR1,val)
150
151/* System Reset and Interrupt Controller registers for Core B (0xFFC0 1100-0xFFC0 11FF) */
152#define bfin_read_SICB_SWRST() bfin_read16(SICB_SWRST)
153#define bfin_write_SICB_SWRST(val) bfin_write16(SICB_SWRST,val)
154#define bfin_read_SICB_SYSCR() bfin_read16(SICB_SYSCR)
155#define bfin_write_SICB_SYSCR(val) bfin_write16(SICB_SYSCR,val)
156#define bfin_read_SICB_RVECT() bfin_read16(SICB_RVECT)
157#define bfin_write_SICB_RVECT(val) bfin_write16(SICB_RVECT,val)
158#define bfin_read_SICB_IMASK0() bfin_read32(SICB_IMASK0)
159#define bfin_write_SICB_IMASK0(val) bfin_write32(SICB_IMASK0,val)
160#define bfin_read_SICB_IMASK1() bfin_read32(SICB_IMASK1)
161#define bfin_write_SICB_IMASK1(val) bfin_write32(SICB_IMASK1,val)
162#define bfin_read_SICB_IAR0() bfin_read32(SICB_IAR0)
163#define bfin_write_SICB_IAR0(val) bfin_write32(SICB_IAR0,val)
164#define bfin_read_SICB_IAR1() bfin_read32(SICB_IAR1)
165#define bfin_write_SICB_IAR1(val) bfin_write32(SICB_IAR1,val)
166#define bfin_read_SICB_IAR2() bfin_read32(SICB_IAR2)
167#define bfin_write_SICB_IAR2(val) bfin_write32(SICB_IAR2,val)
168#define bfin_read_SICB_IAR3() bfin_read32(SICB_IAR3)
169#define bfin_write_SICB_IAR3(val) bfin_write32(SICB_IAR3,val)
170#define bfin_read_SICB_IAR4() bfin_read32(SICB_IAR4)
171#define bfin_write_SICB_IAR4(val) bfin_write32(SICB_IAR4,val)
172#define bfin_read_SICB_IAR5() bfin_read32(SICB_IAR5)
173#define bfin_write_SICB_IAR5(val) bfin_write32(SICB_IAR5,val)
174#define bfin_read_SICB_IAR6() bfin_read32(SICB_IAR6)
175#define bfin_write_SICB_IAR6(val) bfin_write32(SICB_IAR6,val)
176#define bfin_read_SICB_IAR7() bfin_read32(SICB_IAR7)
177#define bfin_write_SICB_IAR7(val) bfin_write32(SICB_IAR7,val)
178#define bfin_read_SICB_ISR0() bfin_read32(SICB_ISR0)
179#define bfin_write_SICB_ISR0(val) bfin_write32(SICB_ISR0,val)
180#define bfin_read_SICB_ISR1() bfin_read32(SICB_ISR1)
181#define bfin_write_SICB_ISR1(val) bfin_write32(SICB_ISR1,val)
182#define bfin_read_SICB_IWR0() bfin_read32(SICB_IWR0)
183#define bfin_write_SICB_IWR0(val) bfin_write32(SICB_IWR0,val)
184#define bfin_read_SICB_IWR1() bfin_read32(SICB_IWR1)
185#define bfin_write_SICB_IWR1(val) bfin_write32(SICB_IWR1,val)
186/* Watchdog Timer registers for Core A (0xFFC0 0200-0xFFC0 02FF) */
187#define bfin_read_WDOGA_CTL() bfin_read16(WDOGA_CTL)
188#define bfin_write_WDOGA_CTL(val) bfin_write16(WDOGA_CTL,val)
189#define bfin_read_WDOGA_CNT() bfin_read32(WDOGA_CNT)
190#define bfin_write_WDOGA_CNT(val) bfin_write32(WDOGA_CNT,val)
191#define bfin_read_WDOGA_STAT() bfin_read32(WDOGA_STAT)
192#define bfin_write_WDOGA_STAT(val) bfin_write32(WDOGA_STAT,val)
193
194/* Watchdog Timer registers for Core B (0xFFC0 1200-0xFFC0 12FF) */
195#define bfin_read_WDOGB_CTL() bfin_read16(WDOGB_CTL)
196#define bfin_write_WDOGB_CTL(val) bfin_write16(WDOGB_CTL,val)
197#define bfin_read_WDOGB_CNT() bfin_read32(WDOGB_CNT)
198#define bfin_write_WDOGB_CNT(val) bfin_write32(WDOGB_CNT,val)
199#define bfin_read_WDOGB_STAT() bfin_read32(WDOGB_STAT)
200#define bfin_write_WDOGB_STAT(val) bfin_write32(WDOGB_STAT,val)
201
202/* UART Controller (0xFFC00400 - 0xFFC004FF) */
203#define bfin_read_UART_THR() bfin_read16(UART_THR)
204#define bfin_write_UART_THR(val) bfin_write16(UART_THR,val)
205#define bfin_read_UART_RBR() bfin_read16(UART_RBR)
206#define bfin_write_UART_RBR(val) bfin_write16(UART_RBR,val)
207#define bfin_read_UART_DLL() bfin_read16(UART_DLL)
208#define bfin_write_UART_DLL(val) bfin_write16(UART_DLL,val)
209#define bfin_read_UART_IER() bfin_read16(UART_IER)
210#define bfin_write_UART_IER(val) bfin_write16(UART_IER,val)
211#define bfin_read_UART_DLH() bfin_read16(UART_DLH)
212#define bfin_write_UART_DLH(val) bfin_write16(UART_DLH,val)
213#define bfin_read_UART_IIR() bfin_read16(UART_IIR)
214#define bfin_write_UART_IIR(val) bfin_write16(UART_IIR,val)
215#define bfin_read_UART_LCR() bfin_read16(UART_LCR)
216#define bfin_write_UART_LCR(val) bfin_write16(UART_LCR,val)
217#define bfin_read_UART_MCR() bfin_read16(UART_MCR)
218#define bfin_write_UART_MCR(val) bfin_write16(UART_MCR,val)
219#define bfin_read_UART_LSR() bfin_read16(UART_LSR)
220#define bfin_write_UART_LSR(val) bfin_write16(UART_LSR,val)
221#define bfin_read_UART_MSR() bfin_read16(UART_MSR)
222#define bfin_write_UART_MSR(val) bfin_write16(UART_MSR,val)
223#define bfin_read_UART_SCR() bfin_read16(UART_SCR)
224#define bfin_write_UART_SCR(val) bfin_write16(UART_SCR,val)
225#define bfin_read_UART_GCTL() bfin_read16(UART_GCTL)
226#define bfin_write_UART_GCTL(val) bfin_write16(UART_GCTL,val)
227
228/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
229#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
230#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL,val)
231#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
232#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG,val)
233#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
234#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT,val)
235#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
236#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR,val)
237#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
238#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR,val)
239#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
240#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD,val)
241#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
242#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW,val)
243
244/* Timer 0-7 registers (0xFFC0 0600-0xFFC0 06FF) */
245#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
246#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG,val)
247#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
248#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER,val)
249#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
250#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD,val)
251#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
252#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH,val)
253#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
254#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG,val)
255#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
256#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER,val)
257#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
258#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD,val)
259#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
260#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH,val)
261#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
262#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG,val)
263#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
264#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER,val)
265#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
266#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD,val)
267#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
268#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH,val)
269#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
270#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG,val)
271#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
272#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER,val)
273#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
274#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD,val)
275#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
276#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH,val)
277#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
278#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG,val)
279#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
280#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER,val)
281#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
282#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD,val)
283#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
284#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH,val)
285#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
286#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG,val)
287#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
288#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER,val)
289#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
290#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD,val)
291#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
292#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH,val)
293#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
294#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG,val)
295#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
296#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER,val)
297#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
298#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD,val)
299#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
300#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH,val)
301#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
302#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG,val)
303#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
304#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER,val)
305#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
306#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD,val)
307#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
308#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH,val)
309
310/* Timer registers 8-11 (0xFFC0 1600-0xFFC0 16FF) */
311#define bfin_read_TMRS8_ENABLE() bfin_read16(TMRS8_ENABLE)
312#define bfin_write_TMRS8_ENABLE(val) bfin_write16(TMRS8_ENABLE,val)
313#define bfin_read_TMRS8_DISABLE() bfin_read16(TMRS8_DISABLE)
314#define bfin_write_TMRS8_DISABLE(val) bfin_write16(TMRS8_DISABLE,val)
315#define bfin_read_TMRS8_STATUS() bfin_read32(TMRS8_STATUS)
316#define bfin_write_TMRS8_STATUS(val) bfin_write32(TMRS8_STATUS,val)
317#define bfin_read_TIMER8_CONFIG() bfin_read16(TIMER8_CONFIG)
318#define bfin_write_TIMER8_CONFIG(val) bfin_write16(TIMER8_CONFIG,val)
319#define bfin_read_TIMER8_COUNTER() bfin_read32(TIMER8_COUNTER)
320#define bfin_write_TIMER8_COUNTER(val) bfin_write32(TIMER8_COUNTER,val)
321#define bfin_read_TIMER8_PERIOD() bfin_read32(TIMER8_PERIOD)
322#define bfin_write_TIMER8_PERIOD(val) bfin_write32(TIMER8_PERIOD,val)
323#define bfin_read_TIMER8_WIDTH() bfin_read32(TIMER8_WIDTH)
324#define bfin_write_TIMER8_WIDTH(val) bfin_write32(TIMER8_WIDTH,val)
325#define bfin_read_TIMER9_CONFIG() bfin_read16(TIMER9_CONFIG)
326#define bfin_write_TIMER9_CONFIG(val) bfin_write16(TIMER9_CONFIG,val)
327#define bfin_read_TIMER9_COUNTER() bfin_read32(TIMER9_COUNTER)
328#define bfin_write_TIMER9_COUNTER(val) bfin_write32(TIMER9_COUNTER,val)
329#define bfin_read_TIMER9_PERIOD() bfin_read32(TIMER9_PERIOD)
330#define bfin_write_TIMER9_PERIOD(val) bfin_write32(TIMER9_PERIOD,val)
331#define bfin_read_TIMER9_WIDTH() bfin_read32(TIMER9_WIDTH)
332#define bfin_write_TIMER9_WIDTH(val) bfin_write32(TIMER9_WIDTH,val)
333#define bfin_read_TIMER10_CONFIG() bfin_read16(TIMER10_CONFIG)
334#define bfin_write_TIMER10_CONFIG(val) bfin_write16(TIMER10_CONFIG,val)
335#define bfin_read_TIMER10_COUNTER() bfin_read32(TIMER10_COUNTER)
336#define bfin_write_TIMER10_COUNTER(val) bfin_write32(TIMER10_COUNTER,val)
337#define bfin_read_TIMER10_PERIOD() bfin_read32(TIMER10_PERIOD)
338#define bfin_write_TIMER10_PERIOD(val) bfin_write32(TIMER10_PERIOD,val)
339#define bfin_read_TIMER10_WIDTH() bfin_read32(TIMER10_WIDTH)
340#define bfin_write_TIMER10_WIDTH(val) bfin_write32(TIMER10_WIDTH,val)
341#define bfin_read_TIMER11_CONFIG() bfin_read16(TIMER11_CONFIG)
342#define bfin_write_TIMER11_CONFIG(val) bfin_write16(TIMER11_CONFIG,val)
343#define bfin_read_TIMER11_COUNTER() bfin_read32(TIMER11_COUNTER)
344#define bfin_write_TIMER11_COUNTER(val) bfin_write32(TIMER11_COUNTER,val)
345#define bfin_read_TIMER11_PERIOD() bfin_read32(TIMER11_PERIOD)
346#define bfin_write_TIMER11_PERIOD(val) bfin_write32(TIMER11_PERIOD,val)
347#define bfin_read_TIMER11_WIDTH() bfin_read32(TIMER11_WIDTH)
348#define bfin_write_TIMER11_WIDTH(val) bfin_write32(TIMER11_WIDTH,val)
349#define bfin_read_TMRS4_ENABLE() bfin_read16(TMRS4_ENABLE)
350#define bfin_write_TMRS4_ENABLE(val) bfin_write16(TMRS4_ENABLE,val)
351#define bfin_read_TMRS4_DISABLE() bfin_read16(TMRS4_DISABLE)
352#define bfin_write_TMRS4_DISABLE(val) bfin_write16(TMRS4_DISABLE,val)
353#define bfin_read_TMRS4_STATUS() bfin_read32(TMRS4_STATUS)
354#define bfin_write_TMRS4_STATUS(val) bfin_write32(TMRS4_STATUS,val)
355
356/* Programmable Flag 0 registers (0xFFC0 0700-0xFFC0 07FF) */
357#define bfin_read_FIO0_FLAG_D() bfin_read16(FIO0_FLAG_D)
358#define bfin_write_FIO0_FLAG_D(val) bfin_write16(FIO0_FLAG_D,val)
359#define bfin_read_FIO0_FLAG_C() bfin_read16(FIO0_FLAG_C)
360#define bfin_write_FIO0_FLAG_C(val) bfin_write16(FIO0_FLAG_C,val)
361#define bfin_read_FIO0_FLAG_S() bfin_read16(FIO0_FLAG_S)
362#define bfin_write_FIO0_FLAG_S(val) bfin_write16(FIO0_FLAG_S,val)
363#define bfin_read_FIO0_FLAG_T() bfin_read16(FIO0_FLAG_T)
364#define bfin_write_FIO0_FLAG_T(val) bfin_write16(FIO0_FLAG_T,val)
365#define bfin_read_FIO0_MASKA_D() bfin_read16(FIO0_MASKA_D)
366#define bfin_write_FIO0_MASKA_D(val) bfin_write16(FIO0_MASKA_D,val)
367#define bfin_read_FIO0_MASKA_C() bfin_read16(FIO0_MASKA_C)
368#define bfin_write_FIO0_MASKA_C(val) bfin_write16(FIO0_MASKA_C,val)
369#define bfin_read_FIO0_MASKA_S() bfin_read16(FIO0_MASKA_S)
370#define bfin_write_FIO0_MASKA_S(val) bfin_write16(FIO0_MASKA_S,val)
371#define bfin_read_FIO0_MASKA_T() bfin_read16(FIO0_MASKA_T)
372#define bfin_write_FIO0_MASKA_T(val) bfin_write16(FIO0_MASKA_T,val)
373#define bfin_read_FIO0_MASKB_D() bfin_read16(FIO0_MASKB_D)
374#define bfin_write_FIO0_MASKB_D(val) bfin_write16(FIO0_MASKB_D,val)
375#define bfin_read_FIO0_MASKB_C() bfin_read16(FIO0_MASKB_C)
376#define bfin_write_FIO0_MASKB_C(val) bfin_write16(FIO0_MASKB_C,val)
377#define bfin_read_FIO0_MASKB_S() bfin_read16(FIO0_MASKB_S)
378#define bfin_write_FIO0_MASKB_S(val) bfin_write16(FIO0_MASKB_S,val)
379#define bfin_read_FIO0_MASKB_T() bfin_read16(FIO0_MASKB_T)
380#define bfin_write_FIO0_MASKB_T(val) bfin_write16(FIO0_MASKB_T,val)
381#define bfin_read_FIO0_DIR() bfin_read16(FIO0_DIR)
382#define bfin_write_FIO0_DIR(val) bfin_write16(FIO0_DIR,val)
383#define bfin_read_FIO0_POLAR() bfin_read16(FIO0_POLAR)
384#define bfin_write_FIO0_POLAR(val) bfin_write16(FIO0_POLAR,val)
385#define bfin_read_FIO0_EDGE() bfin_read16(FIO0_EDGE)
386#define bfin_write_FIO0_EDGE(val) bfin_write16(FIO0_EDGE,val)
387#define bfin_read_FIO0_BOTH() bfin_read16(FIO0_BOTH)
388#define bfin_write_FIO0_BOTH(val) bfin_write16(FIO0_BOTH,val)
389#define bfin_read_FIO0_INEN() bfin_read16(FIO0_INEN)
390#define bfin_write_FIO0_INEN(val) bfin_write16(FIO0_INEN,val)
391/* Programmable Flag 1 registers (0xFFC0 1500-0xFFC0 15FF) */
392#define bfin_read_FIO1_FLAG_D() bfin_read16(FIO1_FLAG_D)
393#define bfin_write_FIO1_FLAG_D(val) bfin_write16(FIO1_FLAG_D,val)
394#define bfin_read_FIO1_FLAG_C() bfin_read16(FIO1_FLAG_C)
395#define bfin_write_FIO1_FLAG_C(val) bfin_write16(FIO1_FLAG_C,val)
396#define bfin_read_FIO1_FLAG_S() bfin_read16(FIO1_FLAG_S)
397#define bfin_write_FIO1_FLAG_S(val) bfin_write16(FIO1_FLAG_S,val)
398#define bfin_read_FIO1_FLAG_T() bfin_read16(FIO1_FLAG_T)
399#define bfin_write_FIO1_FLAG_T(val) bfin_write16(FIO1_FLAG_T,val)
400#define bfin_read_FIO1_MASKA_D() bfin_read16(FIO1_MASKA_D)
401#define bfin_write_FIO1_MASKA_D(val) bfin_write16(FIO1_MASKA_D,val)
402#define bfin_read_FIO1_MASKA_C() bfin_read16(FIO1_MASKA_C)
403#define bfin_write_FIO1_MASKA_C(val) bfin_write16(FIO1_MASKA_C,val)
404#define bfin_read_FIO1_MASKA_S() bfin_read16(FIO1_MASKA_S)
405#define bfin_write_FIO1_MASKA_S(val) bfin_write16(FIO1_MASKA_S,val)
406#define bfin_read_FIO1_MASKA_T() bfin_read16(FIO1_MASKA_T)
407#define bfin_write_FIO1_MASKA_T(val) bfin_write16(FIO1_MASKA_T,val)
408#define bfin_read_FIO1_MASKB_D() bfin_read16(FIO1_MASKB_D)
409#define bfin_write_FIO1_MASKB_D(val) bfin_write16(FIO1_MASKB_D,val)
410#define bfin_read_FIO1_MASKB_C() bfin_read16(FIO1_MASKB_C)
411#define bfin_write_FIO1_MASKB_C(val) bfin_write16(FIO1_MASKB_C,val)
412#define bfin_read_FIO1_MASKB_S() bfin_read16(FIO1_MASKB_S)
413#define bfin_write_FIO1_MASKB_S(val) bfin_write16(FIO1_MASKB_S,val)
414#define bfin_read_FIO1_MASKB_T() bfin_read16(FIO1_MASKB_T)
415#define bfin_write_FIO1_MASKB_T(val) bfin_write16(FIO1_MASKB_T,val)
416#define bfin_read_FIO1_DIR() bfin_read16(FIO1_DIR)
417#define bfin_write_FIO1_DIR(val) bfin_write16(FIO1_DIR,val)
418#define bfin_read_FIO1_POLAR() bfin_read16(FIO1_POLAR)
419#define bfin_write_FIO1_POLAR(val) bfin_write16(FIO1_POLAR,val)
420#define bfin_read_FIO1_EDGE() bfin_read16(FIO1_EDGE)
421#define bfin_write_FIO1_EDGE(val) bfin_write16(FIO1_EDGE,val)
422#define bfin_read_FIO1_BOTH() bfin_read16(FIO1_BOTH)
423#define bfin_write_FIO1_BOTH(val) bfin_write16(FIO1_BOTH,val)
424#define bfin_read_FIO1_INEN() bfin_read16(FIO1_INEN)
425#define bfin_write_FIO1_INEN(val) bfin_write16(FIO1_INEN,val)
426/* Programmable Flag registers (0xFFC0 1700-0xFFC0 17FF) */
427#define bfin_read_FIO2_FLAG_D() bfin_read16(FIO2_FLAG_D)
428#define bfin_write_FIO2_FLAG_D(val) bfin_write16(FIO2_FLAG_D,val)
429#define bfin_read_FIO2_FLAG_C() bfin_read16(FIO2_FLAG_C)
430#define bfin_write_FIO2_FLAG_C(val) bfin_write16(FIO2_FLAG_C,val)
431#define bfin_read_FIO2_FLAG_S() bfin_read16(FIO2_FLAG_S)
432#define bfin_write_FIO2_FLAG_S(val) bfin_write16(FIO2_FLAG_S,val)
433#define bfin_read_FIO2_FLAG_T() bfin_read16(FIO2_FLAG_T)
434#define bfin_write_FIO2_FLAG_T(val) bfin_write16(FIO2_FLAG_T,val)
435#define bfin_read_FIO2_MASKA_D() bfin_read16(FIO2_MASKA_D)
436#define bfin_write_FIO2_MASKA_D(val) bfin_write16(FIO2_MASKA_D,val)
437#define bfin_read_FIO2_MASKA_C() bfin_read16(FIO2_MASKA_C)
438#define bfin_write_FIO2_MASKA_C(val) bfin_write16(FIO2_MASKA_C,val)
439#define bfin_read_FIO2_MASKA_S() bfin_read16(FIO2_MASKA_S)
440#define bfin_write_FIO2_MASKA_S(val) bfin_write16(FIO2_MASKA_S,val)
441#define bfin_read_FIO2_MASKA_T() bfin_read16(FIO2_MASKA_T)
442#define bfin_write_FIO2_MASKA_T(val) bfin_write16(FIO2_MASKA_T,val)
443#define bfin_read_FIO2_MASKB_D() bfin_read16(FIO2_MASKB_D)
444#define bfin_write_FIO2_MASKB_D(val) bfin_write16(FIO2_MASKB_D,val)
445#define bfin_read_FIO2_MASKB_C() bfin_read16(FIO2_MASKB_C)
446#define bfin_write_FIO2_MASKB_C(val) bfin_write16(FIO2_MASKB_C,val)
447#define bfin_read_FIO2_MASKB_S() bfin_read16(FIO2_MASKB_S)
448#define bfin_write_FIO2_MASKB_S(val) bfin_write16(FIO2_MASKB_S,val)
449#define bfin_read_FIO2_MASKB_T() bfin_read16(FIO2_MASKB_T)
450#define bfin_write_FIO2_MASKB_T(val) bfin_write16(FIO2_MASKB_T,val)
451#define bfin_read_FIO2_DIR() bfin_read16(FIO2_DIR)
452#define bfin_write_FIO2_DIR(val) bfin_write16(FIO2_DIR,val)
453#define bfin_read_FIO2_POLAR() bfin_read16(FIO2_POLAR)
454#define bfin_write_FIO2_POLAR(val) bfin_write16(FIO2_POLAR,val)
455#define bfin_read_FIO2_EDGE() bfin_read16(FIO2_EDGE)
456#define bfin_write_FIO2_EDGE(val) bfin_write16(FIO2_EDGE,val)
457#define bfin_read_FIO2_BOTH() bfin_read16(FIO2_BOTH)
458#define bfin_write_FIO2_BOTH(val) bfin_write16(FIO2_BOTH,val)
459#define bfin_read_FIO2_INEN() bfin_read16(FIO2_INEN)
460#define bfin_write_FIO2_INEN(val) bfin_write16(FIO2_INEN,val)
461/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
462#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
463#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1,val)
464#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
465#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2,val)
466#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
467#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV,val)
468#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
469#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV,val)
470#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
471#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX,val)
472#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
473#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX,val)
474#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX)
475#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX,val)
476#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX)
477#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX,val)
478#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX)
479#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX,val)
480#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX)
481#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX,val)
482#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
483#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1,val)
484#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
485#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2,val)
486#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
487#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV,val)
488#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
489#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV,val)
490#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
491#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT,val)
492#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
493#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL,val)
494#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
495#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1,val)
496#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
497#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2,val)
498#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
499#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0,val)
500#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
501#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1,val)
502#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
503#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2,val)
504#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
505#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3,val)
506#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
507#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0,val)
508#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
509#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1,val)
510#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
511#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2,val)
512#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
513#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3,val)
514/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
515#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
516#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1,val)
517#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
518#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2,val)
519#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
520#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV,val)
521#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
522#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV,val)
523#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
524#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val)
525#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
526#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX,val)
527#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX)
528#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val)
529#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX)
530#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX,val)
531#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX)
532#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
533#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX)
534#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX,val)
535#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
536#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1,val)
537#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
538#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2,val)
539#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
540#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV,val)
541#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
542#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV,val)
543#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
544#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT,val)
545#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
546#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL,val)
547#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
548#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1,val)
549#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
550#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2,val)
551#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
552#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0,val)
553#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
554#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1,val)
555#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
556#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2,val)
557#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
558#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3,val)
559#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
560#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0,val)
561#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
562#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1,val)
563#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
564#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2,val)
565#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
566#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3,val)
567/* Asynchronous Memory Controller - External Bus Interface Unit */
568#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
569#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL,val)
570#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
571#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0,val)
572#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
573#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1,val)
574/* SDRAM Controller External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
575#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
576#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL,val)
577#define bfin_read_EBIU_SDBCTL() bfin_read32(EBIU_SDBCTL)
578#define bfin_write_EBIU_SDBCTL(val) bfin_write32(EBIU_SDBCTL,val)
579#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
580#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC,val)
581#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
582#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
583/* Parallel Peripheral Interface (PPI) 0 registers (0xFFC0 1000-0xFFC0 10FF) */
584#define bfin_read_PPI0_CONTROL() bfin_read16(PPI0_CONTROL)
585#define bfin_write_PPI0_CONTROL(val) bfin_write16(PPI0_CONTROL,val)
586#define bfin_read_PPI0_STATUS() bfin_read16(PPI0_STATUS)
587#define bfin_write_PPI0_STATUS(val) bfin_write16(PPI0_STATUS,val)
588#define bfin_clear_PPI0_STATUS() bfin_read_PPI0_STATUS()
589#define bfin_read_PPI0_COUNT() bfin_read16(PPI0_COUNT)
590#define bfin_write_PPI0_COUNT(val) bfin_write16(PPI0_COUNT,val)
591#define bfin_read_PPI0_DELAY() bfin_read16(PPI0_DELAY)
592#define bfin_write_PPI0_DELAY(val) bfin_write16(PPI0_DELAY,val)
593#define bfin_read_PPI0_FRAME() bfin_read16(PPI0_FRAME)
594#define bfin_write_PPI0_FRAME(val) bfin_write16(PPI0_FRAME,val)
595/* Parallel Peripheral Interface (PPI) 1 registers (0xFFC0 1300-0xFFC0 13FF) */
596#define bfin_read_PPI1_CONTROL() bfin_read16(PPI1_CONTROL)
597#define bfin_write_PPI1_CONTROL(val) bfin_write16(PPI1_CONTROL,val)
598#define bfin_read_PPI1_STATUS() bfin_read16(PPI1_STATUS)
599#define bfin_write_PPI1_STATUS(val) bfin_write16(PPI1_STATUS,val)
600#define bfin_clear_PPI1_STATUS() bfin_read_PPI1_STATUS()
601#define bfin_read_PPI1_COUNT() bfin_read16(PPI1_COUNT)
602#define bfin_write_PPI1_COUNT(val) bfin_write16(PPI1_COUNT,val)
603#define bfin_read_PPI1_DELAY() bfin_read16(PPI1_DELAY)
604#define bfin_write_PPI1_DELAY(val) bfin_write16(PPI1_DELAY,val)
605#define bfin_read_PPI1_FRAME() bfin_read16(PPI1_FRAME)
606#define bfin_write_PPI1_FRAME(val) bfin_write16(PPI1_FRAME,val)
607/*DMA traffic control registers */
608#define bfin_read_DMA1_TC_PER() bfin_read16(DMA1_TC_PER)
609#define bfin_write_DMA1_TC_PER(val) bfin_write16(DMA1_TC_PER,val)
610#define bfin_read_DMA1_TC_CNT() bfin_read16(DMA1_TC_CNT)
611#define bfin_write_DMA1_TC_CNT(val) bfin_write16(DMA1_TC_CNT,val)
612#define bfin_read_DMA2_TC_PER() bfin_read16(DMA2_TC_PER)
613#define bfin_write_DMA2_TC_PER(val) bfin_write16(DMA2_TC_PER,val)
614#define bfin_read_DMA2_TC_CNT() bfin_read16(DMA2_TC_CNT)
615#define bfin_write_DMA2_TC_CNT(val) bfin_write16(DMA2_TC_CNT,val)
616/* DMA1 Controller registers (0xFFC0 1C00-0xFFC0 1FFF) */
617#define bfin_read_DMA1_0_CONFIG() bfin_read16(DMA1_0_CONFIG)
618#define bfin_write_DMA1_0_CONFIG(val) bfin_write16(DMA1_0_CONFIG,val)
619#define bfin_read_DMA1_0_NEXT_DESC_PTR() bfin_read32(DMA1_0_NEXT_DESC_PTR)
620#define bfin_write_DMA1_0_NEXT_DESC_PTR(val) bfin_write32(DMA1_0_NEXT_DESC_PTR,val)
621#define bfin_read_DMA1_0_START_ADDR() bfin_read32(DMA1_0_START_ADDR)
622#define bfin_write_DMA1_0_START_ADDR(val) bfin_write32(DMA1_0_START_ADDR,val)
623#define bfin_read_DMA1_0_X_COUNT() bfin_read16(DMA1_0_X_COUNT)
624#define bfin_write_DMA1_0_X_COUNT(val) bfin_write16(DMA1_0_X_COUNT,val)
625#define bfin_read_DMA1_0_Y_COUNT() bfin_read16(DMA1_0_Y_COUNT)
626#define bfin_write_DMA1_0_Y_COUNT(val) bfin_write16(DMA1_0_Y_COUNT,val)
627#define bfin_read_DMA1_0_X_MODIFY() bfin_read16(DMA1_0_X_MODIFY)
628#define bfin_write_DMA1_0_X_MODIFY(val) bfin_write16(DMA1_0_X_MODIFY,val)
629#define bfin_read_DMA1_0_Y_MODIFY() bfin_read16(DMA1_0_Y_MODIFY)
630#define bfin_write_DMA1_0_Y_MODIFY(val) bfin_write16(DMA1_0_Y_MODIFY,val)
631#define bfin_read_DMA1_0_CURR_DESC_PTR() bfin_read32(DMA1_0_CURR_DESC_PTR)
632#define bfin_write_DMA1_0_CURR_DESC_PTR(val) bfin_write32(DMA1_0_CURR_DESC_PTR,val)
633#define bfin_read_DMA1_0_CURR_ADDR() bfin_read32(DMA1_0_CURR_ADDR)
634#define bfin_write_DMA1_0_CURR_ADDR(val) bfin_write32(DMA1_0_CURR_ADDR,val)
635#define bfin_read_DMA1_0_CURR_X_COUNT() bfin_read16(DMA1_0_CURR_X_COUNT)
636#define bfin_write_DMA1_0_CURR_X_COUNT(val) bfin_write16(DMA1_0_CURR_X_COUNT,val)
637#define bfin_read_DMA1_0_CURR_Y_COUNT() bfin_read16(DMA1_0_CURR_Y_COUNT)
638#define bfin_write_DMA1_0_CURR_Y_COUNT(val) bfin_write16(DMA1_0_CURR_Y_COUNT,val)
639#define bfin_read_DMA1_0_IRQ_STATUS() bfin_read16(DMA1_0_IRQ_STATUS)
640#define bfin_write_DMA1_0_IRQ_STATUS(val) bfin_write16(DMA1_0_IRQ_STATUS,val)
641#define bfin_read_DMA1_0_PERIPHERAL_MAP() bfin_read16(DMA1_0_PERIPHERAL_MAP)
642#define bfin_write_DMA1_0_PERIPHERAL_MAP(val) bfin_write16(DMA1_0_PERIPHERAL_MAP,val)
643#define bfin_read_DMA1_1_CONFIG() bfin_read16(DMA1_1_CONFIG)
644#define bfin_write_DMA1_1_CONFIG(val) bfin_write16(DMA1_1_CONFIG,val)
645#define bfin_read_DMA1_1_NEXT_DESC_PTR() bfin_read32(DMA1_1_NEXT_DESC_PTR)
646#define bfin_write_DMA1_1_NEXT_DESC_PTR(val) bfin_write32(DMA1_1_NEXT_DESC_PTR,val)
647#define bfin_read_DMA1_1_START_ADDR() bfin_read32(DMA1_1_START_ADDR)
648#define bfin_write_DMA1_1_START_ADDR(val) bfin_write32(DMA1_1_START_ADDR,val)
649#define bfin_read_DMA1_1_X_COUNT() bfin_read16(DMA1_1_X_COUNT)
650#define bfin_write_DMA1_1_X_COUNT(val) bfin_write16(DMA1_1_X_COUNT,val)
651#define bfin_read_DMA1_1_Y_COUNT() bfin_read16(DMA1_1_Y_COUNT)
652#define bfin_write_DMA1_1_Y_COUNT(val) bfin_write16(DMA1_1_Y_COUNT,val)
653#define bfin_read_DMA1_1_X_MODIFY() bfin_read16(DMA1_1_X_MODIFY)
654#define bfin_write_DMA1_1_X_MODIFY(val) bfin_write16(DMA1_1_X_MODIFY,val)
655#define bfin_read_DMA1_1_Y_MODIFY() bfin_read16(DMA1_1_Y_MODIFY)
656#define bfin_write_DMA1_1_Y_MODIFY(val) bfin_write16(DMA1_1_Y_MODIFY,val)
657#define bfin_read_DMA1_1_CURR_DESC_PTR() bfin_read32(DMA1_1_CURR_DESC_PTR)
658#define bfin_write_DMA1_1_CURR_DESC_PTR(val) bfin_write32(DMA1_1_CURR_DESC_PTR,val)
659#define bfin_read_DMA1_1_CURR_ADDR() bfin_read32(DMA1_1_CURR_ADDR)
660#define bfin_write_DMA1_1_CURR_ADDR(val) bfin_write32(DMA1_1_CURR_ADDR,val)
661#define bfin_read_DMA1_1_CURR_X_COUNT() bfin_read16(DMA1_1_CURR_X_COUNT)
662#define bfin_write_DMA1_1_CURR_X_COUNT(val) bfin_write16(DMA1_1_CURR_X_COUNT,val)
663#define bfin_read_DMA1_1_CURR_Y_COUNT() bfin_read16(DMA1_1_CURR_Y_COUNT)
664#define bfin_write_DMA1_1_CURR_Y_COUNT(val) bfin_write16(DMA1_1_CURR_Y_COUNT,val)
665#define bfin_read_DMA1_1_IRQ_STATUS() bfin_read16(DMA1_1_IRQ_STATUS)
666#define bfin_write_DMA1_1_IRQ_STATUS(val) bfin_write16(DMA1_1_IRQ_STATUS,val)
667#define bfin_read_DMA1_1_PERIPHERAL_MAP() bfin_read16(DMA1_1_PERIPHERAL_MAP)
668#define bfin_write_DMA1_1_PERIPHERAL_MAP(val) bfin_write16(DMA1_1_PERIPHERAL_MAP,val)
669#define bfin_read_DMA1_2_CONFIG() bfin_read16(DMA1_2_CONFIG)
670#define bfin_write_DMA1_2_CONFIG(val) bfin_write16(DMA1_2_CONFIG,val)
671#define bfin_read_DMA1_2_NEXT_DESC_PTR() bfin_read32(DMA1_2_NEXT_DESC_PTR)
672#define bfin_write_DMA1_2_NEXT_DESC_PTR(val) bfin_write32(DMA1_2_NEXT_DESC_PTR,val)
673#define bfin_read_DMA1_2_START_ADDR() bfin_read32(DMA1_2_START_ADDR)
674#define bfin_write_DMA1_2_START_ADDR(val) bfin_write32(DMA1_2_START_ADDR,val)
675#define bfin_read_DMA1_2_X_COUNT() bfin_read16(DMA1_2_X_COUNT)
676#define bfin_write_DMA1_2_X_COUNT(val) bfin_write16(DMA1_2_X_COUNT,val)
677#define bfin_read_DMA1_2_Y_COUNT() bfin_read16(DMA1_2_Y_COUNT)
678#define bfin_write_DMA1_2_Y_COUNT(val) bfin_write16(DMA1_2_Y_COUNT,val)
679#define bfin_read_DMA1_2_X_MODIFY() bfin_read16(DMA1_2_X_MODIFY)
680#define bfin_write_DMA1_2_X_MODIFY(val) bfin_write16(DMA1_2_X_MODIFY,val)
681#define bfin_read_DMA1_2_Y_MODIFY() bfin_read16(DMA1_2_Y_MODIFY)
682#define bfin_write_DMA1_2_Y_MODIFY(val) bfin_write16(DMA1_2_Y_MODIFY,val)
683#define bfin_read_DMA1_2_CURR_DESC_PTR() bfin_read32(DMA1_2_CURR_DESC_PTR)
684#define bfin_write_DMA1_2_CURR_DESC_PTR(val) bfin_write32(DMA1_2_CURR_DESC_PTR,val)
685#define bfin_read_DMA1_2_CURR_ADDR() bfin_read32(DMA1_2_CURR_ADDR)
686#define bfin_write_DMA1_2_CURR_ADDR(val) bfin_write32(DMA1_2_CURR_ADDR,val)
687#define bfin_read_DMA1_2_CURR_X_COUNT() bfin_read16(DMA1_2_CURR_X_COUNT)
688#define bfin_write_DMA1_2_CURR_X_COUNT(val) bfin_write16(DMA1_2_CURR_X_COUNT,val)
689#define bfin_read_DMA1_2_CURR_Y_COUNT() bfin_read16(DMA1_2_CURR_Y_COUNT)
690#define bfin_write_DMA1_2_CURR_Y_COUNT(val) bfin_write16(DMA1_2_CURR_Y_COUNT,val)
691#define bfin_read_DMA1_2_IRQ_STATUS() bfin_read16(DMA1_2_IRQ_STATUS)
692#define bfin_write_DMA1_2_IRQ_STATUS(val) bfin_write16(DMA1_2_IRQ_STATUS,val)
693#define bfin_read_DMA1_2_PERIPHERAL_MAP() bfin_read16(DMA1_2_PERIPHERAL_MAP)
694#define bfin_write_DMA1_2_PERIPHERAL_MAP(val) bfin_write16(DMA1_2_PERIPHERAL_MAP,val)
695#define bfin_read_DMA1_3_CONFIG() bfin_read16(DMA1_3_CONFIG)
696#define bfin_write_DMA1_3_CONFIG(val) bfin_write16(DMA1_3_CONFIG,val)
697#define bfin_read_DMA1_3_NEXT_DESC_PTR() bfin_read32(DMA1_3_NEXT_DESC_PTR)
698#define bfin_write_DMA1_3_NEXT_DESC_PTR(val) bfin_write32(DMA1_3_NEXT_DESC_PTR,val)
699#define bfin_read_DMA1_3_START_ADDR() bfin_read32(DMA1_3_START_ADDR)
700#define bfin_write_DMA1_3_START_ADDR(val) bfin_write32(DMA1_3_START_ADDR,val)
701#define bfin_read_DMA1_3_X_COUNT() bfin_read16(DMA1_3_X_COUNT)
702#define bfin_write_DMA1_3_X_COUNT(val) bfin_write16(DMA1_3_X_COUNT,val)
703#define bfin_read_DMA1_3_Y_COUNT() bfin_read16(DMA1_3_Y_COUNT)
704#define bfin_write_DMA1_3_Y_COUNT(val) bfin_write16(DMA1_3_Y_COUNT,val)
705#define bfin_read_DMA1_3_X_MODIFY() bfin_read16(DMA1_3_X_MODIFY)
706#define bfin_write_DMA1_3_X_MODIFY(val) bfin_write16(DMA1_3_X_MODIFY,val)
707#define bfin_read_DMA1_3_Y_MODIFY() bfin_read16(DMA1_3_Y_MODIFY)
708#define bfin_write_DMA1_3_Y_MODIFY(val) bfin_write16(DMA1_3_Y_MODIFY,val)
709#define bfin_read_DMA1_3_CURR_DESC_PTR() bfin_read32(DMA1_3_CURR_DESC_PTR)
710#define bfin_write_DMA1_3_CURR_DESC_PTR(val) bfin_write32(DMA1_3_CURR_DESC_PTR,val)
711#define bfin_read_DMA1_3_CURR_ADDR() bfin_read32(DMA1_3_CURR_ADDR)
712#define bfin_write_DMA1_3_CURR_ADDR(val) bfin_write32(DMA1_3_CURR_ADDR,val)
713#define bfin_read_DMA1_3_CURR_X_COUNT() bfin_read16(DMA1_3_CURR_X_COUNT)
714#define bfin_write_DMA1_3_CURR_X_COUNT(val) bfin_write16(DMA1_3_CURR_X_COUNT,val)
715#define bfin_read_DMA1_3_CURR_Y_COUNT() bfin_read16(DMA1_3_CURR_Y_COUNT)
716#define bfin_write_DMA1_3_CURR_Y_COUNT(val) bfin_write16(DMA1_3_CURR_Y_COUNT,val)
717#define bfin_read_DMA1_3_IRQ_STATUS() bfin_read16(DMA1_3_IRQ_STATUS)
718#define bfin_write_DMA1_3_IRQ_STATUS(val) bfin_write16(DMA1_3_IRQ_STATUS,val)
719#define bfin_read_DMA1_3_PERIPHERAL_MAP() bfin_read16(DMA1_3_PERIPHERAL_MAP)
720#define bfin_write_DMA1_3_PERIPHERAL_MAP(val) bfin_write16(DMA1_3_PERIPHERAL_MAP,val)
721#define bfin_read_DMA1_4_CONFIG() bfin_read16(DMA1_4_CONFIG)
722#define bfin_write_DMA1_4_CONFIG(val) bfin_write16(DMA1_4_CONFIG,val)
723#define bfin_read_DMA1_4_NEXT_DESC_PTR() bfin_read32(DMA1_4_NEXT_DESC_PTR)
724#define bfin_write_DMA1_4_NEXT_DESC_PTR(val) bfin_write32(DMA1_4_NEXT_DESC_PTR,val)
725#define bfin_read_DMA1_4_START_ADDR() bfin_read32(DMA1_4_START_ADDR)
726#define bfin_write_DMA1_4_START_ADDR(val) bfin_write32(DMA1_4_START_ADDR,val)
727#define bfin_read_DMA1_4_X_COUNT() bfin_read16(DMA1_4_X_COUNT)
728#define bfin_write_DMA1_4_X_COUNT(val) bfin_write16(DMA1_4_X_COUNT,val)
729#define bfin_read_DMA1_4_Y_COUNT() bfin_read16(DMA1_4_Y_COUNT)
730#define bfin_write_DMA1_4_Y_COUNT(val) bfin_write16(DMA1_4_Y_COUNT,val)
731#define bfin_read_DMA1_4_X_MODIFY() bfin_read16(DMA1_4_X_MODIFY)
732#define bfin_write_DMA1_4_X_MODIFY(val) bfin_write16(DMA1_4_X_MODIFY,val)
733#define bfin_read_DMA1_4_Y_MODIFY() bfin_read16(DMA1_4_Y_MODIFY)
734#define bfin_write_DMA1_4_Y_MODIFY(val) bfin_write16(DMA1_4_Y_MODIFY,val)
735#define bfin_read_DMA1_4_CURR_DESC_PTR() bfin_read32(DMA1_4_CURR_DESC_PTR)
736#define bfin_write_DMA1_4_CURR_DESC_PTR(val) bfin_write32(DMA1_4_CURR_DESC_PTR,val)
737#define bfin_read_DMA1_4_CURR_ADDR() bfin_read32(DMA1_4_CURR_ADDR)
738#define bfin_write_DMA1_4_CURR_ADDR(val) bfin_write32(DMA1_4_CURR_ADDR,val)
739#define bfin_read_DMA1_4_CURR_X_COUNT() bfin_read16(DMA1_4_CURR_X_COUNT)
740#define bfin_write_DMA1_4_CURR_X_COUNT(val) bfin_write16(DMA1_4_CURR_X_COUNT,val)
741#define bfin_read_DMA1_4_CURR_Y_COUNT() bfin_read16(DMA1_4_CURR_Y_COUNT)
742#define bfin_write_DMA1_4_CURR_Y_COUNT(val) bfin_write16(DMA1_4_CURR_Y_COUNT,val)
743#define bfin_read_DMA1_4_IRQ_STATUS() bfin_read16(DMA1_4_IRQ_STATUS)
744#define bfin_write_DMA1_4_IRQ_STATUS(val) bfin_write16(DMA1_4_IRQ_STATUS,val)
745#define bfin_read_DMA1_4_PERIPHERAL_MAP() bfin_read16(DMA1_4_PERIPHERAL_MAP)
746#define bfin_write_DMA1_4_PERIPHERAL_MAP(val) bfin_write16(DMA1_4_PERIPHERAL_MAP,val)
747#define bfin_read_DMA1_5_CONFIG() bfin_read16(DMA1_5_CONFIG)
748#define bfin_write_DMA1_5_CONFIG(val) bfin_write16(DMA1_5_CONFIG,val)
749#define bfin_read_DMA1_5_NEXT_DESC_PTR() bfin_read32(DMA1_5_NEXT_DESC_PTR)
750#define bfin_write_DMA1_5_NEXT_DESC_PTR(val) bfin_write32(DMA1_5_NEXT_DESC_PTR,val)
751#define bfin_read_DMA1_5_START_ADDR() bfin_read32(DMA1_5_START_ADDR)
752#define bfin_write_DMA1_5_START_ADDR(val) bfin_write32(DMA1_5_START_ADDR,val)
753#define bfin_read_DMA1_5_X_COUNT() bfin_read16(DMA1_5_X_COUNT)
754#define bfin_write_DMA1_5_X_COUNT(val) bfin_write16(DMA1_5_X_COUNT,val)
755#define bfin_read_DMA1_5_Y_COUNT() bfin_read16(DMA1_5_Y_COUNT)
756#define bfin_write_DMA1_5_Y_COUNT(val) bfin_write16(DMA1_5_Y_COUNT,val)
757#define bfin_read_DMA1_5_X_MODIFY() bfin_read16(DMA1_5_X_MODIFY)
758#define bfin_write_DMA1_5_X_MODIFY(val) bfin_write16(DMA1_5_X_MODIFY,val)
759#define bfin_read_DMA1_5_Y_MODIFY() bfin_read16(DMA1_5_Y_MODIFY)
760#define bfin_write_DMA1_5_Y_MODIFY(val) bfin_write16(DMA1_5_Y_MODIFY,val)
761#define bfin_read_DMA1_5_CURR_DESC_PTR() bfin_read32(DMA1_5_CURR_DESC_PTR)
762#define bfin_write_DMA1_5_CURR_DESC_PTR(val) bfin_write32(DMA1_5_CURR_DESC_PTR,val)
763#define bfin_read_DMA1_5_CURR_ADDR() bfin_read32(DMA1_5_CURR_ADDR)
764#define bfin_write_DMA1_5_CURR_ADDR(val) bfin_write32(DMA1_5_CURR_ADDR,val)
765#define bfin_read_DMA1_5_CURR_X_COUNT() bfin_read16(DMA1_5_CURR_X_COUNT)
766#define bfin_write_DMA1_5_CURR_X_COUNT(val) bfin_write16(DMA1_5_CURR_X_COUNT,val)
767#define bfin_read_DMA1_5_CURR_Y_COUNT() bfin_read16(DMA1_5_CURR_Y_COUNT)
768#define bfin_write_DMA1_5_CURR_Y_COUNT(val) bfin_write16(DMA1_5_CURR_Y_COUNT,val)
769#define bfin_read_DMA1_5_IRQ_STATUS() bfin_read16(DMA1_5_IRQ_STATUS)
770#define bfin_write_DMA1_5_IRQ_STATUS(val) bfin_write16(DMA1_5_IRQ_STATUS,val)
771#define bfin_read_DMA1_5_PERIPHERAL_MAP() bfin_read16(DMA1_5_PERIPHERAL_MAP)
772#define bfin_write_DMA1_5_PERIPHERAL_MAP(val) bfin_write16(DMA1_5_PERIPHERAL_MAP,val)
773#define bfin_read_DMA1_6_CONFIG() bfin_read16(DMA1_6_CONFIG)
774#define bfin_write_DMA1_6_CONFIG(val) bfin_write16(DMA1_6_CONFIG,val)
775#define bfin_read_DMA1_6_NEXT_DESC_PTR() bfin_read32(DMA1_6_NEXT_DESC_PTR)
776#define bfin_write_DMA1_6_NEXT_DESC_PTR(val) bfin_write32(DMA1_6_NEXT_DESC_PTR,val)
777#define bfin_read_DMA1_6_START_ADDR() bfin_read32(DMA1_6_START_ADDR)
778#define bfin_write_DMA1_6_START_ADDR(val) bfin_write32(DMA1_6_START_ADDR,val)
779#define bfin_read_DMA1_6_X_COUNT() bfin_read16(DMA1_6_X_COUNT)
780#define bfin_write_DMA1_6_X_COUNT(val) bfin_write16(DMA1_6_X_COUNT,val)
781#define bfin_read_DMA1_6_Y_COUNT() bfin_read16(DMA1_6_Y_COUNT)
782#define bfin_write_DMA1_6_Y_COUNT(val) bfin_write16(DMA1_6_Y_COUNT,val)
783#define bfin_read_DMA1_6_X_MODIFY() bfin_read16(DMA1_6_X_MODIFY)
784#define bfin_write_DMA1_6_X_MODIFY(val) bfin_write16(DMA1_6_X_MODIFY,val)
785#define bfin_read_DMA1_6_Y_MODIFY() bfin_read16(DMA1_6_Y_MODIFY)
786#define bfin_write_DMA1_6_Y_MODIFY(val) bfin_write16(DMA1_6_Y_MODIFY,val)
787#define bfin_read_DMA1_6_CURR_DESC_PTR() bfin_read32(DMA1_6_CURR_DESC_PTR)
788#define bfin_write_DMA1_6_CURR_DESC_PTR(val) bfin_write32(DMA1_6_CURR_DESC_PTR,val)
789#define bfin_read_DMA1_6_CURR_ADDR() bfin_read32(DMA1_6_CURR_ADDR)
790#define bfin_write_DMA1_6_CURR_ADDR(val) bfin_write32(DMA1_6_CURR_ADDR,val)
791#define bfin_read_DMA1_6_CURR_X_COUNT() bfin_read16(DMA1_6_CURR_X_COUNT)
792#define bfin_write_DMA1_6_CURR_X_COUNT(val) bfin_write16(DMA1_6_CURR_X_COUNT,val)
793#define bfin_read_DMA1_6_CURR_Y_COUNT() bfin_read16(DMA1_6_CURR_Y_COUNT)
794#define bfin_write_DMA1_6_CURR_Y_COUNT(val) bfin_write16(DMA1_6_CURR_Y_COUNT,val)
795#define bfin_read_DMA1_6_IRQ_STATUS() bfin_read16(DMA1_6_IRQ_STATUS)
796#define bfin_write_DMA1_6_IRQ_STATUS(val) bfin_write16(DMA1_6_IRQ_STATUS,val)
797#define bfin_read_DMA1_6_PERIPHERAL_MAP() bfin_read16(DMA1_6_PERIPHERAL_MAP)
798#define bfin_write_DMA1_6_PERIPHERAL_MAP(val) bfin_write16(DMA1_6_PERIPHERAL_MAP,val)
799#define bfin_read_DMA1_7_CONFIG() bfin_read16(DMA1_7_CONFIG)
800#define bfin_write_DMA1_7_CONFIG(val) bfin_write16(DMA1_7_CONFIG,val)
801#define bfin_read_DMA1_7_NEXT_DESC_PTR() bfin_read32(DMA1_7_NEXT_DESC_PTR)
802#define bfin_write_DMA1_7_NEXT_DESC_PTR(val) bfin_write32(DMA1_7_NEXT_DESC_PTR,val)
803#define bfin_read_DMA1_7_START_ADDR() bfin_read32(DMA1_7_START_ADDR)
804#define bfin_write_DMA1_7_START_ADDR(val) bfin_write32(DMA1_7_START_ADDR,val)
805#define bfin_read_DMA1_7_X_COUNT() bfin_read16(DMA1_7_X_COUNT)
806#define bfin_write_DMA1_7_X_COUNT(val) bfin_write16(DMA1_7_X_COUNT,val)
807#define bfin_read_DMA1_7_Y_COUNT() bfin_read16(DMA1_7_Y_COUNT)
808#define bfin_write_DMA1_7_Y_COUNT(val) bfin_write16(DMA1_7_Y_COUNT,val)
809#define bfin_read_DMA1_7_X_MODIFY() bfin_read16(DMA1_7_X_MODIFY)
810#define bfin_write_DMA1_7_X_MODIFY(val) bfin_write16(DMA1_7_X_MODIFY,val)
811#define bfin_read_DMA1_7_Y_MODIFY() bfin_read16(DMA1_7_Y_MODIFY)
812#define bfin_write_DMA1_7_Y_MODIFY(val) bfin_write16(DMA1_7_Y_MODIFY,val)
813#define bfin_read_DMA1_7_CURR_DESC_PTR() bfin_read32(DMA1_7_CURR_DESC_PTR)
814#define bfin_write_DMA1_7_CURR_DESC_PTR(val) bfin_write32(DMA1_7_CURR_DESC_PTR,val)
815#define bfin_read_DMA1_7_CURR_ADDR() bfin_read32(DMA1_7_CURR_ADDR)
816#define bfin_write_DMA1_7_CURR_ADDR(val) bfin_write32(DMA1_7_CURR_ADDR,val)
817#define bfin_read_DMA1_7_CURR_X_COUNT() bfin_read16(DMA1_7_CURR_X_COUNT)
818#define bfin_write_DMA1_7_CURR_X_COUNT(val) bfin_write16(DMA1_7_CURR_X_COUNT,val)
819#define bfin_read_DMA1_7_CURR_Y_COUNT() bfin_read16(DMA1_7_CURR_Y_COUNT)
820#define bfin_write_DMA1_7_CURR_Y_COUNT(val) bfin_write16(DMA1_7_CURR_Y_COUNT,val)
821#define bfin_read_DMA1_7_IRQ_STATUS() bfin_read16(DMA1_7_IRQ_STATUS)
822#define bfin_write_DMA1_7_IRQ_STATUS(val) bfin_write16(DMA1_7_IRQ_STATUS,val)
823#define bfin_read_DMA1_7_PERIPHERAL_MAP() bfin_read16(DMA1_7_PERIPHERAL_MAP)
824#define bfin_write_DMA1_7_PERIPHERAL_MAP(val) bfin_write16(DMA1_7_PERIPHERAL_MAP,val)
825#define bfin_read_DMA1_8_CONFIG() bfin_read16(DMA1_8_CONFIG)
826#define bfin_write_DMA1_8_CONFIG(val) bfin_write16(DMA1_8_CONFIG,val)
827#define bfin_read_DMA1_8_NEXT_DESC_PTR() bfin_read32(DMA1_8_NEXT_DESC_PTR)
828#define bfin_write_DMA1_8_NEXT_DESC_PTR(val) bfin_write32(DMA1_8_NEXT_DESC_PTR,val)
829#define bfin_read_DMA1_8_START_ADDR() bfin_read32(DMA1_8_START_ADDR)
830#define bfin_write_DMA1_8_START_ADDR(val) bfin_write32(DMA1_8_START_ADDR,val)
831#define bfin_read_DMA1_8_X_COUNT() bfin_read16(DMA1_8_X_COUNT)
832#define bfin_write_DMA1_8_X_COUNT(val) bfin_write16(DMA1_8_X_COUNT,val)
833#define bfin_read_DMA1_8_Y_COUNT() bfin_read16(DMA1_8_Y_COUNT)
834#define bfin_write_DMA1_8_Y_COUNT(val) bfin_write16(DMA1_8_Y_COUNT,val)
835#define bfin_read_DMA1_8_X_MODIFY() bfin_read16(DMA1_8_X_MODIFY)
836#define bfin_write_DMA1_8_X_MODIFY(val) bfin_write16(DMA1_8_X_MODIFY,val)
837#define bfin_read_DMA1_8_Y_MODIFY() bfin_read16(DMA1_8_Y_MODIFY)
838#define bfin_write_DMA1_8_Y_MODIFY(val) bfin_write16(DMA1_8_Y_MODIFY,val)
839#define bfin_read_DMA1_8_CURR_DESC_PTR() bfin_read32(DMA1_8_CURR_DESC_PTR)
840#define bfin_write_DMA1_8_CURR_DESC_PTR(val) bfin_write32(DMA1_8_CURR_DESC_PTR,val)
841#define bfin_read_DMA1_8_CURR_ADDR() bfin_read32(DMA1_8_CURR_ADDR)
842#define bfin_write_DMA1_8_CURR_ADDR(val) bfin_write32(DMA1_8_CURR_ADDR,val)
843#define bfin_read_DMA1_8_CURR_X_COUNT() bfin_read16(DMA1_8_CURR_X_COUNT)
844#define bfin_write_DMA1_8_CURR_X_COUNT(val) bfin_write16(DMA1_8_CURR_X_COUNT,val)
845#define bfin_read_DMA1_8_CURR_Y_COUNT() bfin_read16(DMA1_8_CURR_Y_COUNT)
846#define bfin_write_DMA1_8_CURR_Y_COUNT(val) bfin_write16(DMA1_8_CURR_Y_COUNT,val)
847#define bfin_read_DMA1_8_IRQ_STATUS() bfin_read16(DMA1_8_IRQ_STATUS)
848#define bfin_write_DMA1_8_IRQ_STATUS(val) bfin_write16(DMA1_8_IRQ_STATUS,val)
849#define bfin_read_DMA1_8_PERIPHERAL_MAP() bfin_read16(DMA1_8_PERIPHERAL_MAP)
850#define bfin_write_DMA1_8_PERIPHERAL_MAP(val) bfin_write16(DMA1_8_PERIPHERAL_MAP,val)
851#define bfin_read_DMA1_9_CONFIG() bfin_read16(DMA1_9_CONFIG)
852#define bfin_write_DMA1_9_CONFIG(val) bfin_write16(DMA1_9_CONFIG,val)
853#define bfin_read_DMA1_9_NEXT_DESC_PTR() bfin_read32(DMA1_9_NEXT_DESC_PTR)
854#define bfin_write_DMA1_9_NEXT_DESC_PTR(val) bfin_write32(DMA1_9_NEXT_DESC_PTR,val)
855#define bfin_read_DMA1_9_START_ADDR() bfin_read32(DMA1_9_START_ADDR)
856#define bfin_write_DMA1_9_START_ADDR(val) bfin_write32(DMA1_9_START_ADDR,val)
857#define bfin_read_DMA1_9_X_COUNT() bfin_read16(DMA1_9_X_COUNT)
858#define bfin_write_DMA1_9_X_COUNT(val) bfin_write16(DMA1_9_X_COUNT,val)
859#define bfin_read_DMA1_9_Y_COUNT() bfin_read16(DMA1_9_Y_COUNT)
860#define bfin_write_DMA1_9_Y_COUNT(val) bfin_write16(DMA1_9_Y_COUNT,val)
861#define bfin_read_DMA1_9_X_MODIFY() bfin_read16(DMA1_9_X_MODIFY)
862#define bfin_write_DMA1_9_X_MODIFY(val) bfin_write16(DMA1_9_X_MODIFY,val)
863#define bfin_read_DMA1_9_Y_MODIFY() bfin_read16(DMA1_9_Y_MODIFY)
864#define bfin_write_DMA1_9_Y_MODIFY(val) bfin_write16(DMA1_9_Y_MODIFY,val)
865#define bfin_read_DMA1_9_CURR_DESC_PTR() bfin_read32(DMA1_9_CURR_DESC_PTR)
866#define bfin_write_DMA1_9_CURR_DESC_PTR(val) bfin_write32(DMA1_9_CURR_DESC_PTR,val)
867#define bfin_read_DMA1_9_CURR_ADDR() bfin_read32(DMA1_9_CURR_ADDR)
868#define bfin_write_DMA1_9_CURR_ADDR(val) bfin_write32(DMA1_9_CURR_ADDR,val)
869#define bfin_read_DMA1_9_CURR_X_COUNT() bfin_read16(DMA1_9_CURR_X_COUNT)
870#define bfin_write_DMA1_9_CURR_X_COUNT(val) bfin_write16(DMA1_9_CURR_X_COUNT,val)
871#define bfin_read_DMA1_9_CURR_Y_COUNT() bfin_read16(DMA1_9_CURR_Y_COUNT)
872#define bfin_write_DMA1_9_CURR_Y_COUNT(val) bfin_write16(DMA1_9_CURR_Y_COUNT,val)
873#define bfin_read_DMA1_9_IRQ_STATUS() bfin_read16(DMA1_9_IRQ_STATUS)
874#define bfin_write_DMA1_9_IRQ_STATUS(val) bfin_write16(DMA1_9_IRQ_STATUS,val)
875#define bfin_read_DMA1_9_PERIPHERAL_MAP() bfin_read16(DMA1_9_PERIPHERAL_MAP)
876#define bfin_write_DMA1_9_PERIPHERAL_MAP(val) bfin_write16(DMA1_9_PERIPHERAL_MAP,val)
877#define bfin_read_DMA1_10_CONFIG() bfin_read16(DMA1_10_CONFIG)
878#define bfin_write_DMA1_10_CONFIG(val) bfin_write16(DMA1_10_CONFIG,val)
879#define bfin_read_DMA1_10_NEXT_DESC_PTR() bfin_read32(DMA1_10_NEXT_DESC_PTR)
880#define bfin_write_DMA1_10_NEXT_DESC_PTR(val) bfin_write32(DMA1_10_NEXT_DESC_PTR,val)
881#define bfin_read_DMA1_10_START_ADDR() bfin_read32(DMA1_10_START_ADDR)
882#define bfin_write_DMA1_10_START_ADDR(val) bfin_write32(DMA1_10_START_ADDR,val)
883#define bfin_read_DMA1_10_X_COUNT() bfin_read16(DMA1_10_X_COUNT)
884#define bfin_write_DMA1_10_X_COUNT(val) bfin_write16(DMA1_10_X_COUNT,val)
885#define bfin_read_DMA1_10_Y_COUNT() bfin_read16(DMA1_10_Y_COUNT)
886#define bfin_write_DMA1_10_Y_COUNT(val) bfin_write16(DMA1_10_Y_COUNT,val)
887#define bfin_read_DMA1_10_X_MODIFY() bfin_read16(DMA1_10_X_MODIFY)
888#define bfin_write_DMA1_10_X_MODIFY(val) bfin_write16(DMA1_10_X_MODIFY,val)
889#define bfin_read_DMA1_10_Y_MODIFY() bfin_read16(DMA1_10_Y_MODIFY)
890#define bfin_write_DMA1_10_Y_MODIFY(val) bfin_write16(DMA1_10_Y_MODIFY,val)
891#define bfin_read_DMA1_10_CURR_DESC_PTR() bfin_read32(DMA1_10_CURR_DESC_PTR)
892#define bfin_write_DMA1_10_CURR_DESC_PTR(val) bfin_write32(DMA1_10_CURR_DESC_PTR,val)
893#define bfin_read_DMA1_10_CURR_ADDR() bfin_read32(DMA1_10_CURR_ADDR)
894#define bfin_write_DMA1_10_CURR_ADDR(val) bfin_write32(DMA1_10_CURR_ADDR,val)
895#define bfin_read_DMA1_10_CURR_X_COUNT() bfin_read16(DMA1_10_CURR_X_COUNT)
896#define bfin_write_DMA1_10_CURR_X_COUNT(val) bfin_write16(DMA1_10_CURR_X_COUNT,val)
897#define bfin_read_DMA1_10_CURR_Y_COUNT() bfin_read16(DMA1_10_CURR_Y_COUNT)
898#define bfin_write_DMA1_10_CURR_Y_COUNT(val) bfin_write16(DMA1_10_CURR_Y_COUNT,val)
899#define bfin_read_DMA1_10_IRQ_STATUS() bfin_read16(DMA1_10_IRQ_STATUS)
900#define bfin_write_DMA1_10_IRQ_STATUS(val) bfin_write16(DMA1_10_IRQ_STATUS,val)
901#define bfin_read_DMA1_10_PERIPHERAL_MAP() bfin_read16(DMA1_10_PERIPHERAL_MAP)
902#define bfin_write_DMA1_10_PERIPHERAL_MAP(val) bfin_write16(DMA1_10_PERIPHERAL_MAP,val)
903#define bfin_read_DMA1_11_CONFIG() bfin_read16(DMA1_11_CONFIG)
904#define bfin_write_DMA1_11_CONFIG(val) bfin_write16(DMA1_11_CONFIG,val)
905#define bfin_read_DMA1_11_NEXT_DESC_PTR() bfin_read32(DMA1_11_NEXT_DESC_PTR)
906#define bfin_write_DMA1_11_NEXT_DESC_PTR(val) bfin_write32(DMA1_11_NEXT_DESC_PTR,val)
907#define bfin_read_DMA1_11_START_ADDR() bfin_read32(DMA1_11_START_ADDR)
908#define bfin_write_DMA1_11_START_ADDR(val) bfin_write32(DMA1_11_START_ADDR,val)
909#define bfin_read_DMA1_11_X_COUNT() bfin_read16(DMA1_11_X_COUNT)
910#define bfin_write_DMA1_11_X_COUNT(val) bfin_write16(DMA1_11_X_COUNT,val)
911#define bfin_read_DMA1_11_Y_COUNT() bfin_read16(DMA1_11_Y_COUNT)
912#define bfin_write_DMA1_11_Y_COUNT(val) bfin_write16(DMA1_11_Y_COUNT,val)
913#define bfin_read_DMA1_11_X_MODIFY() bfin_read16(DMA1_11_X_MODIFY)
914#define bfin_write_DMA1_11_X_MODIFY(val) bfin_write16(DMA1_11_X_MODIFY,val)
915#define bfin_read_DMA1_11_Y_MODIFY() bfin_read16(DMA1_11_Y_MODIFY)
916#define bfin_write_DMA1_11_Y_MODIFY(val) bfin_write16(DMA1_11_Y_MODIFY,val)
917#define bfin_read_DMA1_11_CURR_DESC_PTR() bfin_read32(DMA1_11_CURR_DESC_PTR)
918#define bfin_write_DMA1_11_CURR_DESC_PTR(val) bfin_write32(DMA1_11_CURR_DESC_PTR,val)
919#define bfin_read_DMA1_11_CURR_ADDR() bfin_read32(DMA1_11_CURR_ADDR)
920#define bfin_write_DMA1_11_CURR_ADDR(val) bfin_write32(DMA1_11_CURR_ADDR,val)
921#define bfin_read_DMA1_11_CURR_X_COUNT() bfin_read16(DMA1_11_CURR_X_COUNT)
922#define bfin_write_DMA1_11_CURR_X_COUNT(val) bfin_write16(DMA1_11_CURR_X_COUNT,val)
923#define bfin_read_DMA1_11_CURR_Y_COUNT() bfin_read16(DMA1_11_CURR_Y_COUNT)
924#define bfin_write_DMA1_11_CURR_Y_COUNT(val) bfin_write16(DMA1_11_CURR_Y_COUNT,val)
925#define bfin_read_DMA1_11_IRQ_STATUS() bfin_read16(DMA1_11_IRQ_STATUS)
926#define bfin_write_DMA1_11_IRQ_STATUS(val) bfin_write16(DMA1_11_IRQ_STATUS,val)
927#define bfin_read_DMA1_11_PERIPHERAL_MAP() bfin_read16(DMA1_11_PERIPHERAL_MAP)
928#define bfin_write_DMA1_11_PERIPHERAL_MAP(val) bfin_write16(DMA1_11_PERIPHERAL_MAP,val)
929/* Memory DMA1 Controller registers (0xFFC0 1E80-0xFFC0 1FFF) */
930#define bfin_read_MDMA1_D0_CONFIG() bfin_read16(MDMA1_D0_CONFIG)
931#define bfin_write_MDMA1_D0_CONFIG(val) bfin_write16(MDMA1_D0_CONFIG,val)
932#define bfin_read_MDMA1_D0_NEXT_DESC_PTR() bfin_read32(MDMA1_D0_NEXT_DESC_PTR)
933#define bfin_write_MDMA1_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA1_D0_NEXT_DESC_PTR,val)
934#define bfin_read_MDMA1_D0_START_ADDR() bfin_read32(MDMA1_D0_START_ADDR)
935#define bfin_write_MDMA1_D0_START_ADDR(val) bfin_write32(MDMA1_D0_START_ADDR,val)
936#define bfin_read_MDMA1_D0_X_COUNT() bfin_read16(MDMA1_D0_X_COUNT)
937#define bfin_write_MDMA1_D0_X_COUNT(val) bfin_write16(MDMA1_D0_X_COUNT,val)
938#define bfin_read_MDMA1_D0_Y_COUNT() bfin_read16(MDMA1_D0_Y_COUNT)
939#define bfin_write_MDMA1_D0_Y_COUNT(val) bfin_write16(MDMA1_D0_Y_COUNT,val)
940#define bfin_read_MDMA1_D0_X_MODIFY() bfin_read16(MDMA1_D0_X_MODIFY)
941#define bfin_write_MDMA1_D0_X_MODIFY(val) bfin_write16(MDMA1_D0_X_MODIFY,val)
942#define bfin_read_MDMA1_D0_Y_MODIFY() bfin_read16(MDMA1_D0_Y_MODIFY)
943#define bfin_write_MDMA1_D0_Y_MODIFY(val) bfin_write16(MDMA1_D0_Y_MODIFY,val)
944#define bfin_read_MDMA1_D0_CURR_DESC_PTR() bfin_read32(MDMA1_D0_CURR_DESC_PTR)
945#define bfin_write_MDMA1_D0_CURR_DESC_PTR(val) bfin_write32(MDMA1_D0_CURR_DESC_PTR,val)
946#define bfin_read_MDMA1_D0_CURR_ADDR() bfin_read32(MDMA1_D0_CURR_ADDR)
947#define bfin_write_MDMA1_D0_CURR_ADDR(val) bfin_write32(MDMA1_D0_CURR_ADDR,val)
948#define bfin_read_MDMA1_D0_CURR_X_COUNT() bfin_read16(MDMA1_D0_CURR_X_COUNT)
949#define bfin_write_MDMA1_D0_CURR_X_COUNT(val) bfin_write16(MDMA1_D0_CURR_X_COUNT,val)
950#define bfin_read_MDMA1_D0_CURR_Y_COUNT() bfin_read16(MDMA1_D0_CURR_Y_COUNT)
951#define bfin_write_MDMA1_D0_CURR_Y_COUNT(val) bfin_write16(MDMA1_D0_CURR_Y_COUNT,val)
952#define bfin_read_MDMA1_D0_IRQ_STATUS() bfin_read16(MDMA1_D0_IRQ_STATUS)
953#define bfin_write_MDMA1_D0_IRQ_STATUS(val) bfin_write16(MDMA1_D0_IRQ_STATUS,val)
954#define bfin_read_MDMA1_D0_PERIPHERAL_MAP() bfin_read16(MDMA1_D0_PERIPHERAL_MAP)
955#define bfin_write_MDMA1_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA1_D0_PERIPHERAL_MAP,val)
956#define bfin_read_MDMA1_S0_CONFIG() bfin_read16(MDMA1_S0_CONFIG)
957#define bfin_write_MDMA1_S0_CONFIG(val) bfin_write16(MDMA1_S0_CONFIG,val)
958#define bfin_read_MDMA1_S0_NEXT_DESC_PTR() bfin_read32(MDMA1_S0_NEXT_DESC_PTR)
959#define bfin_write_MDMA1_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA1_S0_NEXT_DESC_PTR,val)
960#define bfin_read_MDMA1_S0_START_ADDR() bfin_read32(MDMA1_S0_START_ADDR)
961#define bfin_write_MDMA1_S0_START_ADDR(val) bfin_write32(MDMA1_S0_START_ADDR,val)
962#define bfin_read_MDMA1_S0_X_COUNT() bfin_read16(MDMA1_S0_X_COUNT)
963#define bfin_write_MDMA1_S0_X_COUNT(val) bfin_write16(MDMA1_S0_X_COUNT,val)
964#define bfin_read_MDMA1_S0_Y_COUNT() bfin_read16(MDMA1_S0_Y_COUNT)
965#define bfin_write_MDMA1_S0_Y_COUNT(val) bfin_write16(MDMA1_S0_Y_COUNT,val)
966#define bfin_read_MDMA1_S0_X_MODIFY() bfin_read16(MDMA1_S0_X_MODIFY)
967#define bfin_write_MDMA1_S0_X_MODIFY(val) bfin_write16(MDMA1_S0_X_MODIFY,val)
968#define bfin_read_MDMA1_S0_Y_MODIFY() bfin_read16(MDMA1_S0_Y_MODIFY)
969#define bfin_write_MDMA1_S0_Y_MODIFY(val) bfin_write16(MDMA1_S0_Y_MODIFY,val)
970#define bfin_read_MDMA1_S0_CURR_DESC_PTR() bfin_read32(MDMA1_S0_CURR_DESC_PTR)
971#define bfin_write_MDMA1_S0_CURR_DESC_PTR(val) bfin_write32(MDMA1_S0_CURR_DESC_PTR,val)
972#define bfin_read_MDMA1_S0_CURR_ADDR() bfin_read32(MDMA1_S0_CURR_ADDR)
973#define bfin_write_MDMA1_S0_CURR_ADDR(val) bfin_write32(MDMA1_S0_CURR_ADDR,val)
974#define bfin_read_MDMA1_S0_CURR_X_COUNT() bfin_read16(MDMA1_S0_CURR_X_COUNT)
975#define bfin_write_MDMA1_S0_CURR_X_COUNT(val) bfin_write16(MDMA1_S0_CURR_X_COUNT,val)
976#define bfin_read_MDMA1_S0_CURR_Y_COUNT() bfin_read16(MDMA1_S0_CURR_Y_COUNT)
977#define bfin_write_MDMA1_S0_CURR_Y_COUNT(val) bfin_write16(MDMA1_S0_CURR_Y_COUNT,val)
978#define bfin_read_MDMA1_S0_IRQ_STATUS() bfin_read16(MDMA1_S0_IRQ_STATUS)
979#define bfin_write_MDMA1_S0_IRQ_STATUS(val) bfin_write16(MDMA1_S0_IRQ_STATUS,val)
980#define bfin_read_MDMA1_S0_PERIPHERAL_MAP() bfin_read16(MDMA1_S0_PERIPHERAL_MAP)
981#define bfin_write_MDMA1_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA1_S0_PERIPHERAL_MAP,val)
982#define bfin_read_MDMA1_D1_CONFIG() bfin_read16(MDMA1_D1_CONFIG)
983#define bfin_write_MDMA1_D1_CONFIG(val) bfin_write16(MDMA1_D1_CONFIG,val)
984#define bfin_read_MDMA1_D1_NEXT_DESC_PTR() bfin_read32(MDMA1_D1_NEXT_DESC_PTR)
985#define bfin_write_MDMA1_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA1_D1_NEXT_DESC_PTR,val)
986#define bfin_read_MDMA1_D1_START_ADDR() bfin_read32(MDMA1_D1_START_ADDR)
987#define bfin_write_MDMA1_D1_START_ADDR(val) bfin_write32(MDMA1_D1_START_ADDR,val)
988#define bfin_read_MDMA1_D1_X_COUNT() bfin_read16(MDMA1_D1_X_COUNT)
989#define bfin_write_MDMA1_D1_X_COUNT(val) bfin_write16(MDMA1_D1_X_COUNT,val)
990#define bfin_read_MDMA1_D1_Y_COUNT() bfin_read16(MDMA1_D1_Y_COUNT)
991#define bfin_write_MDMA1_D1_Y_COUNT(val) bfin_write16(MDMA1_D1_Y_COUNT,val)
992#define bfin_read_MDMA1_D1_X_MODIFY() bfin_read16(MDMA1_D1_X_MODIFY)
993#define bfin_write_MDMA1_D1_X_MODIFY(val) bfin_write16(MDMA1_D1_X_MODIFY,val)
994#define bfin_read_MDMA1_D1_Y_MODIFY() bfin_read16(MDMA1_D1_Y_MODIFY)
995#define bfin_write_MDMA1_D1_Y_MODIFY(val) bfin_write16(MDMA1_D1_Y_MODIFY,val)
996#define bfin_read_MDMA1_D1_CURR_DESC_PTR() bfin_read32(MDMA1_D1_CURR_DESC_PTR)
997#define bfin_write_MDMA1_D1_CURR_DESC_PTR(val) bfin_write32(MDMA1_D1_CURR_DESC_PTR,val)
998#define bfin_read_MDMA1_D1_CURR_ADDR() bfin_read32(MDMA1_D1_CURR_ADDR)
999#define bfin_write_MDMA1_D1_CURR_ADDR(val) bfin_write32(MDMA1_D1_CURR_ADDR,val)
1000#define bfin_read_MDMA1_D1_CURR_X_COUNT() bfin_read16(MDMA1_D1_CURR_X_COUNT)
1001#define bfin_write_MDMA1_D1_CURR_X_COUNT(val) bfin_write16(MDMA1_D1_CURR_X_COUNT,val)
1002#define bfin_read_MDMA1_D1_CURR_Y_COUNT() bfin_read16(MDMA1_D1_CURR_Y_COUNT)
1003#define bfin_write_MDMA1_D1_CURR_Y_COUNT(val) bfin_write16(MDMA1_D1_CURR_Y_COUNT,val)
1004#define bfin_read_MDMA1_D1_IRQ_STATUS() bfin_read16(MDMA1_D1_IRQ_STATUS)
1005#define bfin_write_MDMA1_D1_IRQ_STATUS(val) bfin_write16(MDMA1_D1_IRQ_STATUS,val)
1006#define bfin_read_MDMA1_D1_PERIPHERAL_MAP() bfin_read16(MDMA1_D1_PERIPHERAL_MAP)
1007#define bfin_write_MDMA1_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA1_D1_PERIPHERAL_MAP,val)
1008#define bfin_read_MDMA1_S1_CONFIG() bfin_read16(MDMA1_S1_CONFIG)
1009#define bfin_write_MDMA1_S1_CONFIG(val) bfin_write16(MDMA1_S1_CONFIG,val)
1010#define bfin_read_MDMA1_S1_NEXT_DESC_PTR() bfin_read32(MDMA1_S1_NEXT_DESC_PTR)
1011#define bfin_write_MDMA1_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA1_S1_NEXT_DESC_PTR,val)
1012#define bfin_read_MDMA1_S1_START_ADDR() bfin_read32(MDMA1_S1_START_ADDR)
1013#define bfin_write_MDMA1_S1_START_ADDR(val) bfin_write32(MDMA1_S1_START_ADDR,val)
1014#define bfin_read_MDMA1_S1_X_COUNT() bfin_read16(MDMA1_S1_X_COUNT)
1015#define bfin_write_MDMA1_S1_X_COUNT(val) bfin_write16(MDMA1_S1_X_COUNT,val)
1016#define bfin_read_MDMA1_S1_Y_COUNT() bfin_read16(MDMA1_S1_Y_COUNT)
1017#define bfin_write_MDMA1_S1_Y_COUNT(val) bfin_write16(MDMA1_S1_Y_COUNT,val)
1018#define bfin_read_MDMA1_S1_X_MODIFY() bfin_read16(MDMA1_S1_X_MODIFY)
1019#define bfin_write_MDMA1_S1_X_MODIFY(val) bfin_write16(MDMA1_S1_X_MODIFY,val)
1020#define bfin_read_MDMA1_S1_Y_MODIFY() bfin_read16(MDMA1_S1_Y_MODIFY)
1021#define bfin_write_MDMA1_S1_Y_MODIFY(val) bfin_write16(MDMA1_S1_Y_MODIFY,val)
1022#define bfin_read_MDMA1_S1_CURR_DESC_PTR() bfin_read32(MDMA1_S1_CURR_DESC_PTR)
1023#define bfin_write_MDMA1_S1_CURR_DESC_PTR(val) bfin_write32(MDMA1_S1_CURR_DESC_PTR,val)
1024#define bfin_read_MDMA1_S1_CURR_ADDR() bfin_read32(MDMA1_S1_CURR_ADDR)
1025#define bfin_write_MDMA1_S1_CURR_ADDR(val) bfin_write32(MDMA1_S1_CURR_ADDR,val)
1026#define bfin_read_MDMA1_S1_CURR_X_COUNT() bfin_read16(MDMA1_S1_CURR_X_COUNT)
1027#define bfin_write_MDMA1_S1_CURR_X_COUNT(val) bfin_write16(MDMA1_S1_CURR_X_COUNT,val)
1028#define bfin_read_MDMA1_S1_CURR_Y_COUNT() bfin_read16(MDMA1_S1_CURR_Y_COUNT)
1029#define bfin_write_MDMA1_S1_CURR_Y_COUNT(val) bfin_write16(MDMA1_S1_CURR_Y_COUNT,val)
1030#define bfin_read_MDMA1_S1_IRQ_STATUS() bfin_read16(MDMA1_S1_IRQ_STATUS)
1031#define bfin_write_MDMA1_S1_IRQ_STATUS(val) bfin_write16(MDMA1_S1_IRQ_STATUS,val)
1032#define bfin_read_MDMA1_S1_PERIPHERAL_MAP() bfin_read16(MDMA1_S1_PERIPHERAL_MAP)
1033#define bfin_write_MDMA1_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA1_S1_PERIPHERAL_MAP,val)
1034/* DMA2 Controller registers (0xFFC0 0C00-0xFFC0 0DFF) */
1035#define bfin_read_DMA2_0_CONFIG() bfin_read16(DMA2_0_CONFIG)
1036#define bfin_write_DMA2_0_CONFIG(val) bfin_write16(DMA2_0_CONFIG,val)
1037#define bfin_read_DMA2_0_NEXT_DESC_PTR() bfin_read32(DMA2_0_NEXT_DESC_PTR)
1038#define bfin_write_DMA2_0_NEXT_DESC_PTR(val) bfin_write32(DMA2_0_NEXT_DESC_PTR,val)
1039#define bfin_read_DMA2_0_START_ADDR() bfin_read32(DMA2_0_START_ADDR)
1040#define bfin_write_DMA2_0_START_ADDR(val) bfin_write32(DMA2_0_START_ADDR,val)
1041#define bfin_read_DMA2_0_X_COUNT() bfin_read16(DMA2_0_X_COUNT)
1042#define bfin_write_DMA2_0_X_COUNT(val) bfin_write16(DMA2_0_X_COUNT,val)
1043#define bfin_read_DMA2_0_Y_COUNT() bfin_read16(DMA2_0_Y_COUNT)
1044#define bfin_write_DMA2_0_Y_COUNT(val) bfin_write16(DMA2_0_Y_COUNT,val)
1045#define bfin_read_DMA2_0_X_MODIFY() bfin_read16(DMA2_0_X_MODIFY)
1046#define bfin_write_DMA2_0_X_MODIFY(val) bfin_write16(DMA2_0_X_MODIFY,val)
1047#define bfin_read_DMA2_0_Y_MODIFY() bfin_read16(DMA2_0_Y_MODIFY)
1048#define bfin_write_DMA2_0_Y_MODIFY(val) bfin_write16(DMA2_0_Y_MODIFY,val)
1049#define bfin_read_DMA2_0_CURR_DESC_PTR() bfin_read32(DMA2_0_CURR_DESC_PTR)
1050#define bfin_write_DMA2_0_CURR_DESC_PTR(val) bfin_write32(DMA2_0_CURR_DESC_PTR,val)
1051#define bfin_read_DMA2_0_CURR_ADDR() bfin_read32(DMA2_0_CURR_ADDR)
1052#define bfin_write_DMA2_0_CURR_ADDR(val) bfin_write32(DMA2_0_CURR_ADDR,val)
1053#define bfin_read_DMA2_0_CURR_X_COUNT() bfin_read16(DMA2_0_CURR_X_COUNT)
1054#define bfin_write_DMA2_0_CURR_X_COUNT(val) bfin_write16(DMA2_0_CURR_X_COUNT,val)
1055#define bfin_read_DMA2_0_CURR_Y_COUNT() bfin_read16(DMA2_0_CURR_Y_COUNT)
1056#define bfin_write_DMA2_0_CURR_Y_COUNT(val) bfin_write16(DMA2_0_CURR_Y_COUNT,val)
1057#define bfin_read_DMA2_0_IRQ_STATUS() bfin_read16(DMA2_0_IRQ_STATUS)
1058#define bfin_write_DMA2_0_IRQ_STATUS(val) bfin_write16(DMA2_0_IRQ_STATUS,val)
1059#define bfin_read_DMA2_0_PERIPHERAL_MAP() bfin_read16(DMA2_0_PERIPHERAL_MAP)
1060#define bfin_write_DMA2_0_PERIPHERAL_MAP(val) bfin_write16(DMA2_0_PERIPHERAL_MAP,val)
1061#define bfin_read_DMA2_1_CONFIG() bfin_read16(DMA2_1_CONFIG)
1062#define bfin_write_DMA2_1_CONFIG(val) bfin_write16(DMA2_1_CONFIG,val)
1063#define bfin_read_DMA2_1_NEXT_DESC_PTR() bfin_read32(DMA2_1_NEXT_DESC_PTR)
1064#define bfin_write_DMA2_1_NEXT_DESC_PTR(val) bfin_write32(DMA2_1_NEXT_DESC_PTR,val)
1065#define bfin_read_DMA2_1_START_ADDR() bfin_read32(DMA2_1_START_ADDR)
1066#define bfin_write_DMA2_1_START_ADDR(val) bfin_write32(DMA2_1_START_ADDR,val)
1067#define bfin_read_DMA2_1_X_COUNT() bfin_read16(DMA2_1_X_COUNT)
1068#define bfin_write_DMA2_1_X_COUNT(val) bfin_write16(DMA2_1_X_COUNT,val)
1069#define bfin_read_DMA2_1_Y_COUNT() bfin_read16(DMA2_1_Y_COUNT)
1070#define bfin_write_DMA2_1_Y_COUNT(val) bfin_write16(DMA2_1_Y_COUNT,val)
1071#define bfin_read_DMA2_1_X_MODIFY() bfin_read16(DMA2_1_X_MODIFY)
1072#define bfin_write_DMA2_1_X_MODIFY(val) bfin_write16(DMA2_1_X_MODIFY,val)
1073#define bfin_read_DMA2_1_Y_MODIFY() bfin_read16(DMA2_1_Y_MODIFY)
1074#define bfin_write_DMA2_1_Y_MODIFY(val) bfin_write16(DMA2_1_Y_MODIFY,val)
1075#define bfin_read_DMA2_1_CURR_DESC_PTR() bfin_read32(DMA2_1_CURR_DESC_PTR)
1076#define bfin_write_DMA2_1_CURR_DESC_PTR(val) bfin_write32(DMA2_1_CURR_DESC_PTR,val)
1077#define bfin_read_DMA2_1_CURR_ADDR() bfin_read32(DMA2_1_CURR_ADDR)
1078#define bfin_write_DMA2_1_CURR_ADDR(val) bfin_write32(DMA2_1_CURR_ADDR,val)
1079#define bfin_read_DMA2_1_CURR_X_COUNT() bfin_read16(DMA2_1_CURR_X_COUNT)
1080#define bfin_write_DMA2_1_CURR_X_COUNT(val) bfin_write16(DMA2_1_CURR_X_COUNT,val)
1081#define bfin_read_DMA2_1_CURR_Y_COUNT() bfin_read16(DMA2_1_CURR_Y_COUNT)
1082#define bfin_write_DMA2_1_CURR_Y_COUNT(val) bfin_write16(DMA2_1_CURR_Y_COUNT,val)
1083#define bfin_read_DMA2_1_IRQ_STATUS() bfin_read16(DMA2_1_IRQ_STATUS)
1084#define bfin_write_DMA2_1_IRQ_STATUS(val) bfin_write16(DMA2_1_IRQ_STATUS,val)
1085#define bfin_read_DMA2_1_PERIPHERAL_MAP() bfin_read16(DMA2_1_PERIPHERAL_MAP)
1086#define bfin_write_DMA2_1_PERIPHERAL_MAP(val) bfin_write16(DMA2_1_PERIPHERAL_MAP,val)
1087#define bfin_read_DMA2_2_CONFIG() bfin_read16(DMA2_2_CONFIG)
1088#define bfin_write_DMA2_2_CONFIG(val) bfin_write16(DMA2_2_CONFIG,val)
1089#define bfin_read_DMA2_2_NEXT_DESC_PTR() bfin_read32(DMA2_2_NEXT_DESC_PTR)
1090#define bfin_write_DMA2_2_NEXT_DESC_PTR(val) bfin_write32(DMA2_2_NEXT_DESC_PTR,val)
1091#define bfin_read_DMA2_2_START_ADDR() bfin_read32(DMA2_2_START_ADDR)
1092#define bfin_write_DMA2_2_START_ADDR(val) bfin_write32(DMA2_2_START_ADDR,val)
1093#define bfin_read_DMA2_2_X_COUNT() bfin_read16(DMA2_2_X_COUNT)
1094#define bfin_write_DMA2_2_X_COUNT(val) bfin_write16(DMA2_2_X_COUNT,val)
1095#define bfin_read_DMA2_2_Y_COUNT() bfin_read16(DMA2_2_Y_COUNT)
1096#define bfin_write_DMA2_2_Y_COUNT(val) bfin_write16(DMA2_2_Y_COUNT,val)
1097#define bfin_read_DMA2_2_X_MODIFY() bfin_read16(DMA2_2_X_MODIFY)
1098#define bfin_write_DMA2_2_X_MODIFY(val) bfin_write16(DMA2_2_X_MODIFY,val)
1099#define bfin_read_DMA2_2_Y_MODIFY() bfin_read16(DMA2_2_Y_MODIFY)
1100#define bfin_write_DMA2_2_Y_MODIFY(val) bfin_write16(DMA2_2_Y_MODIFY,val)
1101#define bfin_read_DMA2_2_CURR_DESC_PTR() bfin_read32(DMA2_2_CURR_DESC_PTR)
1102#define bfin_write_DMA2_2_CURR_DESC_PTR(val) bfin_write32(DMA2_2_CURR_DESC_PTR,val)
1103#define bfin_read_DMA2_2_CURR_ADDR() bfin_read32(DMA2_2_CURR_ADDR)
1104#define bfin_write_DMA2_2_CURR_ADDR(val) bfin_write32(DMA2_2_CURR_ADDR,val)
1105#define bfin_read_DMA2_2_CURR_X_COUNT() bfin_read16(DMA2_2_CURR_X_COUNT)
1106#define bfin_write_DMA2_2_CURR_X_COUNT(val) bfin_write16(DMA2_2_CURR_X_COUNT,val)
1107#define bfin_read_DMA2_2_CURR_Y_COUNT() bfin_read16(DMA2_2_CURR_Y_COUNT)
1108#define bfin_write_DMA2_2_CURR_Y_COUNT(val) bfin_write16(DMA2_2_CURR_Y_COUNT,val)
1109#define bfin_read_DMA2_2_IRQ_STATUS() bfin_read16(DMA2_2_IRQ_STATUS)
1110#define bfin_write_DMA2_2_IRQ_STATUS(val) bfin_write16(DMA2_2_IRQ_STATUS,val)
1111#define bfin_read_DMA2_2_PERIPHERAL_MAP() bfin_read16(DMA2_2_PERIPHERAL_MAP)
1112#define bfin_write_DMA2_2_PERIPHERAL_MAP(val) bfin_write16(DMA2_2_PERIPHERAL_MAP,val)
1113#define bfin_read_DMA2_3_CONFIG() bfin_read16(DMA2_3_CONFIG)
1114#define bfin_write_DMA2_3_CONFIG(val) bfin_write16(DMA2_3_CONFIG,val)
1115#define bfin_read_DMA2_3_NEXT_DESC_PTR() bfin_read32(DMA2_3_NEXT_DESC_PTR)
1116#define bfin_write_DMA2_3_NEXT_DESC_PTR(val) bfin_write32(DMA2_3_NEXT_DESC_PTR,val)
1117#define bfin_read_DMA2_3_START_ADDR() bfin_read32(DMA2_3_START_ADDR)
1118#define bfin_write_DMA2_3_START_ADDR(val) bfin_write32(DMA2_3_START_ADDR,val)
1119#define bfin_read_DMA2_3_X_COUNT() bfin_read16(DMA2_3_X_COUNT)
1120#define bfin_write_DMA2_3_X_COUNT(val) bfin_write16(DMA2_3_X_COUNT,val)
1121#define bfin_read_DMA2_3_Y_COUNT() bfin_read16(DMA2_3_Y_COUNT)
1122#define bfin_write_DMA2_3_Y_COUNT(val) bfin_write16(DMA2_3_Y_COUNT,val)
1123#define bfin_read_DMA2_3_X_MODIFY() bfin_read16(DMA2_3_X_MODIFY)
1124#define bfin_write_DMA2_3_X_MODIFY(val) bfin_write16(DMA2_3_X_MODIFY,val)
1125#define bfin_read_DMA2_3_Y_MODIFY() bfin_read16(DMA2_3_Y_MODIFY)
1126#define bfin_write_DMA2_3_Y_MODIFY(val) bfin_write16(DMA2_3_Y_MODIFY,val)
1127#define bfin_read_DMA2_3_CURR_DESC_PTR() bfin_read32(DMA2_3_CURR_DESC_PTR)
1128#define bfin_write_DMA2_3_CURR_DESC_PTR(val) bfin_write32(DMA2_3_CURR_DESC_PTR,val)
1129#define bfin_read_DMA2_3_CURR_ADDR() bfin_read32(DMA2_3_CURR_ADDR)
1130#define bfin_write_DMA2_3_CURR_ADDR(val) bfin_write32(DMA2_3_CURR_ADDR,val)
1131#define bfin_read_DMA2_3_CURR_X_COUNT() bfin_read16(DMA2_3_CURR_X_COUNT)
1132#define bfin_write_DMA2_3_CURR_X_COUNT(val) bfin_write16(DMA2_3_CURR_X_COUNT,val)
1133#define bfin_read_DMA2_3_CURR_Y_COUNT() bfin_read16(DMA2_3_CURR_Y_COUNT)
1134#define bfin_write_DMA2_3_CURR_Y_COUNT(val) bfin_write16(DMA2_3_CURR_Y_COUNT,val)
1135#define bfin_read_DMA2_3_IRQ_STATUS() bfin_read16(DMA2_3_IRQ_STATUS)
1136#define bfin_write_DMA2_3_IRQ_STATUS(val) bfin_write16(DMA2_3_IRQ_STATUS,val)
1137#define bfin_read_DMA2_3_PERIPHERAL_MAP() bfin_read16(DMA2_3_PERIPHERAL_MAP)
1138#define bfin_write_DMA2_3_PERIPHERAL_MAP(val) bfin_write16(DMA2_3_PERIPHERAL_MAP,val)
1139#define bfin_read_DMA2_4_CONFIG() bfin_read16(DMA2_4_CONFIG)
1140#define bfin_write_DMA2_4_CONFIG(val) bfin_write16(DMA2_4_CONFIG,val)
1141#define bfin_read_DMA2_4_NEXT_DESC_PTR() bfin_read32(DMA2_4_NEXT_DESC_PTR)
1142#define bfin_write_DMA2_4_NEXT_DESC_PTR(val) bfin_write32(DMA2_4_NEXT_DESC_PTR,val)
1143#define bfin_read_DMA2_4_START_ADDR() bfin_read32(DMA2_4_START_ADDR)
1144#define bfin_write_DMA2_4_START_ADDR(val) bfin_write32(DMA2_4_START_ADDR,val)
1145#define bfin_read_DMA2_4_X_COUNT() bfin_read16(DMA2_4_X_COUNT)
1146#define bfin_write_DMA2_4_X_COUNT(val) bfin_write16(DMA2_4_X_COUNT,val)
1147#define bfin_read_DMA2_4_Y_COUNT() bfin_read16(DMA2_4_Y_COUNT)
1148#define bfin_write_DMA2_4_Y_COUNT(val) bfin_write16(DMA2_4_Y_COUNT,val)
1149#define bfin_read_DMA2_4_X_MODIFY() bfin_read16(DMA2_4_X_MODIFY)
1150#define bfin_write_DMA2_4_X_MODIFY(val) bfin_write16(DMA2_4_X_MODIFY,val)
1151#define bfin_read_DMA2_4_Y_MODIFY() bfin_read16(DMA2_4_Y_MODIFY)
1152#define bfin_write_DMA2_4_Y_MODIFY(val) bfin_write16(DMA2_4_Y_MODIFY,val)
1153#define bfin_read_DMA2_4_CURR_DESC_PTR() bfin_read32(DMA2_4_CURR_DESC_PTR)
1154#define bfin_write_DMA2_4_CURR_DESC_PTR(val) bfin_write32(DMA2_4_CURR_DESC_PTR,val)
1155#define bfin_read_DMA2_4_CURR_ADDR() bfin_read32(DMA2_4_CURR_ADDR)
1156#define bfin_write_DMA2_4_CURR_ADDR(val) bfin_write32(DMA2_4_CURR_ADDR,val)
1157#define bfin_read_DMA2_4_CURR_X_COUNT() bfin_read16(DMA2_4_CURR_X_COUNT)
1158#define bfin_write_DMA2_4_CURR_X_COUNT(val) bfin_write16(DMA2_4_CURR_X_COUNT,val)
1159#define bfin_read_DMA2_4_CURR_Y_COUNT() bfin_read16(DMA2_4_CURR_Y_COUNT)
1160#define bfin_write_DMA2_4_CURR_Y_COUNT(val) bfin_write16(DMA2_4_CURR_Y_COUNT,val)
1161#define bfin_read_DMA2_4_IRQ_STATUS() bfin_read16(DMA2_4_IRQ_STATUS)
1162#define bfin_write_DMA2_4_IRQ_STATUS(val) bfin_write16(DMA2_4_IRQ_STATUS,val)
1163#define bfin_read_DMA2_4_PERIPHERAL_MAP() bfin_read16(DMA2_4_PERIPHERAL_MAP)
1164#define bfin_write_DMA2_4_PERIPHERAL_MAP(val) bfin_write16(DMA2_4_PERIPHERAL_MAP,val)
1165#define bfin_read_DMA2_5_CONFIG() bfin_read16(DMA2_5_CONFIG)
1166#define bfin_write_DMA2_5_CONFIG(val) bfin_write16(DMA2_5_CONFIG,val)
1167#define bfin_read_DMA2_5_NEXT_DESC_PTR() bfin_read32(DMA2_5_NEXT_DESC_PTR)
1168#define bfin_write_DMA2_5_NEXT_DESC_PTR(val) bfin_write32(DMA2_5_NEXT_DESC_PTR,val)
1169#define bfin_read_DMA2_5_START_ADDR() bfin_read32(DMA2_5_START_ADDR)
1170#define bfin_write_DMA2_5_START_ADDR(val) bfin_write32(DMA2_5_START_ADDR,val)
1171#define bfin_read_DMA2_5_X_COUNT() bfin_read16(DMA2_5_X_COUNT)
1172#define bfin_write_DMA2_5_X_COUNT(val) bfin_write16(DMA2_5_X_COUNT,val)
1173#define bfin_read_DMA2_5_Y_COUNT() bfin_read16(DMA2_5_Y_COUNT)
1174#define bfin_write_DMA2_5_Y_COUNT(val) bfin_write16(DMA2_5_Y_COUNT,val)
1175#define bfin_read_DMA2_5_X_MODIFY() bfin_read16(DMA2_5_X_MODIFY)
1176#define bfin_write_DMA2_5_X_MODIFY(val) bfin_write16(DMA2_5_X_MODIFY,val)
1177#define bfin_read_DMA2_5_Y_MODIFY() bfin_read16(DMA2_5_Y_MODIFY)
1178#define bfin_write_DMA2_5_Y_MODIFY(val) bfin_write16(DMA2_5_Y_MODIFY,val)
1179#define bfin_read_DMA2_5_CURR_DESC_PTR() bfin_read32(DMA2_5_CURR_DESC_PTR)
1180#define bfin_write_DMA2_5_CURR_DESC_PTR(val) bfin_write32(DMA2_5_CURR_DESC_PTR,val)
1181#define bfin_read_DMA2_5_CURR_ADDR() bfin_read32(DMA2_5_CURR_ADDR)
1182#define bfin_write_DMA2_5_CURR_ADDR(val) bfin_write32(DMA2_5_CURR_ADDR,val)
1183#define bfin_read_DMA2_5_CURR_X_COUNT() bfin_read16(DMA2_5_CURR_X_COUNT)
1184#define bfin_write_DMA2_5_CURR_X_COUNT(val) bfin_write16(DMA2_5_CURR_X_COUNT,val)
1185#define bfin_read_DMA2_5_CURR_Y_COUNT() bfin_read16(DMA2_5_CURR_Y_COUNT)
1186#define bfin_write_DMA2_5_CURR_Y_COUNT(val) bfin_write16(DMA2_5_CURR_Y_COUNT,val)
1187#define bfin_read_DMA2_5_IRQ_STATUS() bfin_read16(DMA2_5_IRQ_STATUS)
1188#define bfin_write_DMA2_5_IRQ_STATUS(val) bfin_write16(DMA2_5_IRQ_STATUS,val)
1189#define bfin_read_DMA2_5_PERIPHERAL_MAP() bfin_read16(DMA2_5_PERIPHERAL_MAP)
1190#define bfin_write_DMA2_5_PERIPHERAL_MAP(val) bfin_write16(DMA2_5_PERIPHERAL_MAP,val)
1191#define bfin_read_DMA2_6_CONFIG() bfin_read16(DMA2_6_CONFIG)
1192#define bfin_write_DMA2_6_CONFIG(val) bfin_write16(DMA2_6_CONFIG,val)
1193#define bfin_read_DMA2_6_NEXT_DESC_PTR() bfin_read32(DMA2_6_NEXT_DESC_PTR)
1194#define bfin_write_DMA2_6_NEXT_DESC_PTR(val) bfin_write32(DMA2_6_NEXT_DESC_PTR,val)
1195#define bfin_read_DMA2_6_START_ADDR() bfin_read32(DMA2_6_START_ADDR)
1196#define bfin_write_DMA2_6_START_ADDR(val) bfin_write32(DMA2_6_START_ADDR,val)
1197#define bfin_read_DMA2_6_X_COUNT() bfin_read16(DMA2_6_X_COUNT)
1198#define bfin_write_DMA2_6_X_COUNT(val) bfin_write16(DMA2_6_X_COUNT,val)
1199#define bfin_read_DMA2_6_Y_COUNT() bfin_read16(DMA2_6_Y_COUNT)
1200#define bfin_write_DMA2_6_Y_COUNT(val) bfin_write16(DMA2_6_Y_COUNT,val)
1201#define bfin_read_DMA2_6_X_MODIFY() bfin_read16(DMA2_6_X_MODIFY)
1202#define bfin_write_DMA2_6_X_MODIFY(val) bfin_write16(DMA2_6_X_MODIFY,val)
1203#define bfin_read_DMA2_6_Y_MODIFY() bfin_read16(DMA2_6_Y_MODIFY)
1204#define bfin_write_DMA2_6_Y_MODIFY(val) bfin_write16(DMA2_6_Y_MODIFY,val)
1205#define bfin_read_DMA2_6_CURR_DESC_PTR() bfin_read32(DMA2_6_CURR_DESC_PTR)
1206#define bfin_write_DMA2_6_CURR_DESC_PTR(val) bfin_write32(DMA2_6_CURR_DESC_PTR,val)
1207#define bfin_read_DMA2_6_CURR_ADDR() bfin_read32(DMA2_6_CURR_ADDR)
1208#define bfin_write_DMA2_6_CURR_ADDR(val) bfin_write32(DMA2_6_CURR_ADDR,val)
1209#define bfin_read_DMA2_6_CURR_X_COUNT() bfin_read16(DMA2_6_CURR_X_COUNT)
1210#define bfin_write_DMA2_6_CURR_X_COUNT(val) bfin_write16(DMA2_6_CURR_X_COUNT,val)
1211#define bfin_read_DMA2_6_CURR_Y_COUNT() bfin_read16(DMA2_6_CURR_Y_COUNT)
1212#define bfin_write_DMA2_6_CURR_Y_COUNT(val) bfin_write16(DMA2_6_CURR_Y_COUNT,val)
1213#define bfin_read_DMA2_6_IRQ_STATUS() bfin_read16(DMA2_6_IRQ_STATUS)
1214#define bfin_write_DMA2_6_IRQ_STATUS(val) bfin_write16(DMA2_6_IRQ_STATUS,val)
1215#define bfin_read_DMA2_6_PERIPHERAL_MAP() bfin_read16(DMA2_6_PERIPHERAL_MAP)
1216#define bfin_write_DMA2_6_PERIPHERAL_MAP(val) bfin_write16(DMA2_6_PERIPHERAL_MAP,val)
1217#define bfin_read_DMA2_7_CONFIG() bfin_read16(DMA2_7_CONFIG)
1218#define bfin_write_DMA2_7_CONFIG(val) bfin_write16(DMA2_7_CONFIG,val)
1219#define bfin_read_DMA2_7_NEXT_DESC_PTR() bfin_read32(DMA2_7_NEXT_DESC_PTR)
1220#define bfin_write_DMA2_7_NEXT_DESC_PTR(val) bfin_write32(DMA2_7_NEXT_DESC_PTR,val)
1221#define bfin_read_DMA2_7_START_ADDR() bfin_read32(DMA2_7_START_ADDR)
1222#define bfin_write_DMA2_7_START_ADDR(val) bfin_write32(DMA2_7_START_ADDR,val)
1223#define bfin_read_DMA2_7_X_COUNT() bfin_read16(DMA2_7_X_COUNT)
1224#define bfin_write_DMA2_7_X_COUNT(val) bfin_write16(DMA2_7_X_COUNT,val)
1225#define bfin_read_DMA2_7_Y_COUNT() bfin_read16(DMA2_7_Y_COUNT)
1226#define bfin_write_DMA2_7_Y_COUNT(val) bfin_write16(DMA2_7_Y_COUNT,val)
1227#define bfin_read_DMA2_7_X_MODIFY() bfin_read16(DMA2_7_X_MODIFY)
1228#define bfin_write_DMA2_7_X_MODIFY(val) bfin_write16(DMA2_7_X_MODIFY,val)
1229#define bfin_read_DMA2_7_Y_MODIFY() bfin_read16(DMA2_7_Y_MODIFY)
1230#define bfin_write_DMA2_7_Y_MODIFY(val) bfin_write16(DMA2_7_Y_MODIFY,val)
1231#define bfin_read_DMA2_7_CURR_DESC_PTR() bfin_read32(DMA2_7_CURR_DESC_PTR)
1232#define bfin_write_DMA2_7_CURR_DESC_PTR(val) bfin_write32(DMA2_7_CURR_DESC_PTR,val)
1233#define bfin_read_DMA2_7_CURR_ADDR() bfin_read32(DMA2_7_CURR_ADDR)
1234#define bfin_write_DMA2_7_CURR_ADDR(val) bfin_write32(DMA2_7_CURR_ADDR,val)
1235#define bfin_read_DMA2_7_CURR_X_COUNT() bfin_read16(DMA2_7_CURR_X_COUNT)
1236#define bfin_write_DMA2_7_CURR_X_COUNT(val) bfin_write16(DMA2_7_CURR_X_COUNT,val)
1237#define bfin_read_DMA2_7_CURR_Y_COUNT() bfin_read16(DMA2_7_CURR_Y_COUNT)
1238#define bfin_write_DMA2_7_CURR_Y_COUNT(val) bfin_write16(DMA2_7_CURR_Y_COUNT,val)
1239#define bfin_read_DMA2_7_IRQ_STATUS() bfin_read16(DMA2_7_IRQ_STATUS)
1240#define bfin_write_DMA2_7_IRQ_STATUS(val) bfin_write16(DMA2_7_IRQ_STATUS,val)
1241#define bfin_read_DMA2_7_PERIPHERAL_MAP() bfin_read16(DMA2_7_PERIPHERAL_MAP)
1242#define bfin_write_DMA2_7_PERIPHERAL_MAP(val) bfin_write16(DMA2_7_PERIPHERAL_MAP,val)
1243#define bfin_read_DMA2_8_CONFIG() bfin_read16(DMA2_8_CONFIG)
1244#define bfin_write_DMA2_8_CONFIG(val) bfin_write16(DMA2_8_CONFIG,val)
1245#define bfin_read_DMA2_8_NEXT_DESC_PTR() bfin_read32(DMA2_8_NEXT_DESC_PTR)
1246#define bfin_write_DMA2_8_NEXT_DESC_PTR(val) bfin_write32(DMA2_8_NEXT_DESC_PTR,val)
1247#define bfin_read_DMA2_8_START_ADDR() bfin_read32(DMA2_8_START_ADDR)
1248#define bfin_write_DMA2_8_START_ADDR(val) bfin_write32(DMA2_8_START_ADDR,val)
1249#define bfin_read_DMA2_8_X_COUNT() bfin_read16(DMA2_8_X_COUNT)
1250#define bfin_write_DMA2_8_X_COUNT(val) bfin_write16(DMA2_8_X_COUNT,val)
1251#define bfin_read_DMA2_8_Y_COUNT() bfin_read16(DMA2_8_Y_COUNT)
1252#define bfin_write_DMA2_8_Y_COUNT(val) bfin_write16(DMA2_8_Y_COUNT,val)
1253#define bfin_read_DMA2_8_X_MODIFY() bfin_read16(DMA2_8_X_MODIFY)
1254#define bfin_write_DMA2_8_X_MODIFY(val) bfin_write16(DMA2_8_X_MODIFY,val)
1255#define bfin_read_DMA2_8_Y_MODIFY() bfin_read16(DMA2_8_Y_MODIFY)
1256#define bfin_write_DMA2_8_Y_MODIFY(val) bfin_write16(DMA2_8_Y_MODIFY,val)
1257#define bfin_read_DMA2_8_CURR_DESC_PTR() bfin_read32(DMA2_8_CURR_DESC_PTR)
1258#define bfin_write_DMA2_8_CURR_DESC_PTR(val) bfin_write32(DMA2_8_CURR_DESC_PTR,val)
1259#define bfin_read_DMA2_8_CURR_ADDR() bfin_read32(DMA2_8_CURR_ADDR)
1260#define bfin_write_DMA2_8_CURR_ADDR(val) bfin_write32(DMA2_8_CURR_ADDR,val)
1261#define bfin_read_DMA2_8_CURR_X_COUNT() bfin_read16(DMA2_8_CURR_X_COUNT)
1262#define bfin_write_DMA2_8_CURR_X_COUNT(val) bfin_write16(DMA2_8_CURR_X_COUNT,val)
1263#define bfin_read_DMA2_8_CURR_Y_COUNT() bfin_read16(DMA2_8_CURR_Y_COUNT)
1264#define bfin_write_DMA2_8_CURR_Y_COUNT(val) bfin_write16(DMA2_8_CURR_Y_COUNT,val)
1265#define bfin_read_DMA2_8_IRQ_STATUS() bfin_read16(DMA2_8_IRQ_STATUS)
1266#define bfin_write_DMA2_8_IRQ_STATUS(val) bfin_write16(DMA2_8_IRQ_STATUS,val)
1267#define bfin_read_DMA2_8_PERIPHERAL_MAP() bfin_read16(DMA2_8_PERIPHERAL_MAP)
1268#define bfin_write_DMA2_8_PERIPHERAL_MAP(val) bfin_write16(DMA2_8_PERIPHERAL_MAP,val)
1269#define bfin_read_DMA2_9_CONFIG() bfin_read16(DMA2_9_CONFIG)
1270#define bfin_write_DMA2_9_CONFIG(val) bfin_write16(DMA2_9_CONFIG,val)
1271#define bfin_read_DMA2_9_NEXT_DESC_PTR() bfin_read32(DMA2_9_NEXT_DESC_PTR)
1272#define bfin_write_DMA2_9_NEXT_DESC_PTR(val) bfin_write32(DMA2_9_NEXT_DESC_PTR,val)
1273#define bfin_read_DMA2_9_START_ADDR() bfin_read32(DMA2_9_START_ADDR)
1274#define bfin_write_DMA2_9_START_ADDR(val) bfin_write32(DMA2_9_START_ADDR,val)
1275#define bfin_read_DMA2_9_X_COUNT() bfin_read16(DMA2_9_X_COUNT)
1276#define bfin_write_DMA2_9_X_COUNT(val) bfin_write16(DMA2_9_X_COUNT,val)
1277#define bfin_read_DMA2_9_Y_COUNT() bfin_read16(DMA2_9_Y_COUNT)
1278#define bfin_write_DMA2_9_Y_COUNT(val) bfin_write16(DMA2_9_Y_COUNT,val)
1279#define bfin_read_DMA2_9_X_MODIFY() bfin_read16(DMA2_9_X_MODIFY)
1280#define bfin_write_DMA2_9_X_MODIFY(val) bfin_write16(DMA2_9_X_MODIFY,val)
1281#define bfin_read_DMA2_9_Y_MODIFY() bfin_read16(DMA2_9_Y_MODIFY)
1282#define bfin_write_DMA2_9_Y_MODIFY(val) bfin_write16(DMA2_9_Y_MODIFY,val)
1283#define bfin_read_DMA2_9_CURR_DESC_PTR() bfin_read32(DMA2_9_CURR_DESC_PTR)
1284#define bfin_write_DMA2_9_CURR_DESC_PTR(val) bfin_write32(DMA2_9_CURR_DESC_PTR,val)
1285#define bfin_read_DMA2_9_CURR_ADDR() bfin_read32(DMA2_9_CURR_ADDR)
1286#define bfin_write_DMA2_9_CURR_ADDR(val) bfin_write32(DMA2_9_CURR_ADDR,val)
1287#define bfin_read_DMA2_9_CURR_X_COUNT() bfin_read16(DMA2_9_CURR_X_COUNT)
1288#define bfin_write_DMA2_9_CURR_X_COUNT(val) bfin_write16(DMA2_9_CURR_X_COUNT,val)
1289#define bfin_read_DMA2_9_CURR_Y_COUNT() bfin_read16(DMA2_9_CURR_Y_COUNT)
1290#define bfin_write_DMA2_9_CURR_Y_COUNT(val) bfin_write16(DMA2_9_CURR_Y_COUNT,val)
1291#define bfin_read_DMA2_9_IRQ_STATUS() bfin_read16(DMA2_9_IRQ_STATUS)
1292#define bfin_write_DMA2_9_IRQ_STATUS(val) bfin_write16(DMA2_9_IRQ_STATUS,val)
1293#define bfin_read_DMA2_9_PERIPHERAL_MAP() bfin_read16(DMA2_9_PERIPHERAL_MAP)
1294#define bfin_write_DMA2_9_PERIPHERAL_MAP(val) bfin_write16(DMA2_9_PERIPHERAL_MAP,val)
1295#define bfin_read_DMA2_10_CONFIG() bfin_read16(DMA2_10_CONFIG)
1296#define bfin_write_DMA2_10_CONFIG(val) bfin_write16(DMA2_10_CONFIG,val)
1297#define bfin_read_DMA2_10_NEXT_DESC_PTR() bfin_read32(DMA2_10_NEXT_DESC_PTR)
1298#define bfin_write_DMA2_10_NEXT_DESC_PTR(val) bfin_write32(DMA2_10_NEXT_DESC_PTR,val)
1299#define bfin_read_DMA2_10_START_ADDR() bfin_read32(DMA2_10_START_ADDR)
1300#define bfin_write_DMA2_10_START_ADDR(val) bfin_write32(DMA2_10_START_ADDR,val)
1301#define bfin_read_DMA2_10_X_COUNT() bfin_read16(DMA2_10_X_COUNT)
1302#define bfin_write_DMA2_10_X_COUNT(val) bfin_write16(DMA2_10_X_COUNT,val)
1303#define bfin_read_DMA2_10_Y_COUNT() bfin_read16(DMA2_10_Y_COUNT)
1304#define bfin_write_DMA2_10_Y_COUNT(val) bfin_write16(DMA2_10_Y_COUNT,val)
1305#define bfin_read_DMA2_10_X_MODIFY() bfin_read16(DMA2_10_X_MODIFY)
1306#define bfin_write_DMA2_10_X_MODIFY(val) bfin_write16(DMA2_10_X_MODIFY,val)
1307#define bfin_read_DMA2_10_Y_MODIFY() bfin_read16(DMA2_10_Y_MODIFY)
1308#define bfin_write_DMA2_10_Y_MODIFY(val) bfin_write16(DMA2_10_Y_MODIFY,val)
1309#define bfin_read_DMA2_10_CURR_DESC_PTR() bfin_read32(DMA2_10_CURR_DESC_PTR)
1310#define bfin_write_DMA2_10_CURR_DESC_PTR(val) bfin_write32(DMA2_10_CURR_DESC_PTR,val)
1311#define bfin_read_DMA2_10_CURR_ADDR() bfin_read32(DMA2_10_CURR_ADDR)
1312#define bfin_write_DMA2_10_CURR_ADDR(val) bfin_write32(DMA2_10_CURR_ADDR,val)
1313#define bfin_read_DMA2_10_CURR_X_COUNT() bfin_read16(DMA2_10_CURR_X_COUNT)
1314#define bfin_write_DMA2_10_CURR_X_COUNT(val) bfin_write16(DMA2_10_CURR_X_COUNT,val)
1315#define bfin_read_DMA2_10_CURR_Y_COUNT() bfin_read16(DMA2_10_CURR_Y_COUNT)
1316#define bfin_write_DMA2_10_CURR_Y_COUNT(val) bfin_write16(DMA2_10_CURR_Y_COUNT,val)
1317#define bfin_read_DMA2_10_IRQ_STATUS() bfin_read16(DMA2_10_IRQ_STATUS)
1318#define bfin_write_DMA2_10_IRQ_STATUS(val) bfin_write16(DMA2_10_IRQ_STATUS,val)
1319#define bfin_read_DMA2_10_PERIPHERAL_MAP() bfin_read16(DMA2_10_PERIPHERAL_MAP)
1320#define bfin_write_DMA2_10_PERIPHERAL_MAP(val) bfin_write16(DMA2_10_PERIPHERAL_MAP,val)
1321#define bfin_read_DMA2_11_CONFIG() bfin_read16(DMA2_11_CONFIG)
1322#define bfin_write_DMA2_11_CONFIG(val) bfin_write16(DMA2_11_CONFIG,val)
1323#define bfin_read_DMA2_11_NEXT_DESC_PTR() bfin_read32(DMA2_11_NEXT_DESC_PTR)
1324#define bfin_write_DMA2_11_NEXT_DESC_PTR(val) bfin_write32(DMA2_11_NEXT_DESC_PTR,val)
1325#define bfin_read_DMA2_11_START_ADDR() bfin_read32(DMA2_11_START_ADDR)
1326#define bfin_write_DMA2_11_START_ADDR(val) bfin_write32(DMA2_11_START_ADDR,val)
1327#define bfin_read_DMA2_11_X_COUNT() bfin_read16(DMA2_11_X_COUNT)
1328#define bfin_write_DMA2_11_X_COUNT(val) bfin_write16(DMA2_11_X_COUNT,val)
1329#define bfin_read_DMA2_11_Y_COUNT() bfin_read16(DMA2_11_Y_COUNT)
1330#define bfin_write_DMA2_11_Y_COUNT(val) bfin_write16(DMA2_11_Y_COUNT,val)
1331#define bfin_read_DMA2_11_X_MODIFY() bfin_read16(DMA2_11_X_MODIFY)
1332#define bfin_write_DMA2_11_X_MODIFY(val) bfin_write16(DMA2_11_X_MODIFY,val)
1333#define bfin_read_DMA2_11_Y_MODIFY() bfin_read16(DMA2_11_Y_MODIFY)
1334#define bfin_write_DMA2_11_Y_MODIFY(val) bfin_write16(DMA2_11_Y_MODIFY,val)
1335#define bfin_read_DMA2_11_CURR_DESC_PTR() bfin_read32(DMA2_11_CURR_DESC_PTR)
1336#define bfin_write_DMA2_11_CURR_DESC_PTR(val) bfin_write32(DMA2_11_CURR_DESC_PTR,val)
1337#define bfin_read_DMA2_11_CURR_ADDR() bfin_read32(DMA2_11_CURR_ADDR)
1338#define bfin_write_DMA2_11_CURR_ADDR(val) bfin_write32(DMA2_11_CURR_ADDR,val)
1339#define bfin_read_DMA2_11_CURR_X_COUNT() bfin_read16(DMA2_11_CURR_X_COUNT)
1340#define bfin_write_DMA2_11_CURR_X_COUNT(val) bfin_write16(DMA2_11_CURR_X_COUNT,val)
1341#define bfin_read_DMA2_11_CURR_Y_COUNT() bfin_read16(DMA2_11_CURR_Y_COUNT)
1342#define bfin_write_DMA2_11_CURR_Y_COUNT(val) bfin_write16(DMA2_11_CURR_Y_COUNT,val)
1343#define bfin_read_DMA2_11_IRQ_STATUS() bfin_read16(DMA2_11_IRQ_STATUS)
1344#define bfin_write_DMA2_11_IRQ_STATUS(val) bfin_write16(DMA2_11_IRQ_STATUS,val)
1345#define bfin_read_DMA2_11_PERIPHERAL_MAP() bfin_read16(DMA2_11_PERIPHERAL_MAP)
1346#define bfin_write_DMA2_11_PERIPHERAL_MAP(val) bfin_write16(DMA2_11_PERIPHERAL_MAP,val)
1347/* Memory DMA2 Controller registers (0xFFC0 0E80-0xFFC0 0FFF) */
1348#define bfin_read_MDMA2_D0_CONFIG() bfin_read16(MDMA2_D0_CONFIG)
1349#define bfin_write_MDMA2_D0_CONFIG(val) bfin_write16(MDMA2_D0_CONFIG,val)
1350#define bfin_read_MDMA2_D0_NEXT_DESC_PTR() bfin_read32(MDMA2_D0_NEXT_DESC_PTR)
1351#define bfin_write_MDMA2_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA2_D0_NEXT_DESC_PTR,val)
1352#define bfin_read_MDMA2_D0_START_ADDR() bfin_read32(MDMA2_D0_START_ADDR)
1353#define bfin_write_MDMA2_D0_START_ADDR(val) bfin_write32(MDMA2_D0_START_ADDR,val)
1354#define bfin_read_MDMA2_D0_X_COUNT() bfin_read16(MDMA2_D0_X_COUNT)
1355#define bfin_write_MDMA2_D0_X_COUNT(val) bfin_write16(MDMA2_D0_X_COUNT,val)
1356#define bfin_read_MDMA2_D0_Y_COUNT() bfin_read16(MDMA2_D0_Y_COUNT)
1357#define bfin_write_MDMA2_D0_Y_COUNT(val) bfin_write16(MDMA2_D0_Y_COUNT,val)
1358#define bfin_read_MDMA2_D0_X_MODIFY() bfin_read16(MDMA2_D0_X_MODIFY)
1359#define bfin_write_MDMA2_D0_X_MODIFY(val) bfin_write16(MDMA2_D0_X_MODIFY,val)
1360#define bfin_read_MDMA2_D0_Y_MODIFY() bfin_read16(MDMA2_D0_Y_MODIFY)
1361#define bfin_write_MDMA2_D0_Y_MODIFY(val) bfin_write16(MDMA2_D0_Y_MODIFY,val)
1362#define bfin_read_MDMA2_D0_CURR_DESC_PTR() bfin_read32(MDMA2_D0_CURR_DESC_PTR)
1363#define bfin_write_MDMA2_D0_CURR_DESC_PTR(val) bfin_write32(MDMA2_D0_CURR_DESC_PTR,val)
1364#define bfin_read_MDMA2_D0_CURR_ADDR() bfin_read32(MDMA2_D0_CURR_ADDR)
1365#define bfin_write_MDMA2_D0_CURR_ADDR(val) bfin_write32(MDMA2_D0_CURR_ADDR,val)
1366#define bfin_read_MDMA2_D0_CURR_X_COUNT() bfin_read16(MDMA2_D0_CURR_X_COUNT)
1367#define bfin_write_MDMA2_D0_CURR_X_COUNT(val) bfin_write16(MDMA2_D0_CURR_X_COUNT,val)
1368#define bfin_read_MDMA2_D0_CURR_Y_COUNT() bfin_read16(MDMA2_D0_CURR_Y_COUNT)
1369#define bfin_write_MDMA2_D0_CURR_Y_COUNT(val) bfin_write16(MDMA2_D0_CURR_Y_COUNT,val)
1370#define bfin_read_MDMA2_D0_IRQ_STATUS() bfin_read16(MDMA2_D0_IRQ_STATUS)
1371#define bfin_write_MDMA2_D0_IRQ_STATUS(val) bfin_write16(MDMA2_D0_IRQ_STATUS,val)
1372#define bfin_read_MDMA2_D0_PERIPHERAL_MAP() bfin_read16(MDMA2_D0_PERIPHERAL_MAP)
1373#define bfin_write_MDMA2_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA2_D0_PERIPHERAL_MAP,val)
1374#define bfin_read_MDMA2_S0_CONFIG() bfin_read16(MDMA2_S0_CONFIG)
1375#define bfin_write_MDMA2_S0_CONFIG(val) bfin_write16(MDMA2_S0_CONFIG,val)
1376#define bfin_read_MDMA2_S0_NEXT_DESC_PTR() bfin_read32(MDMA2_S0_NEXT_DESC_PTR)
1377#define bfin_write_MDMA2_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA2_S0_NEXT_DESC_PTR,val)
1378#define bfin_read_MDMA2_S0_START_ADDR() bfin_read32(MDMA2_S0_START_ADDR)
1379#define bfin_write_MDMA2_S0_START_ADDR(val) bfin_write32(MDMA2_S0_START_ADDR,val)
1380#define bfin_read_MDMA2_S0_X_COUNT() bfin_read16(MDMA2_S0_X_COUNT)
1381#define bfin_write_MDMA2_S0_X_COUNT(val) bfin_write16(MDMA2_S0_X_COUNT,val)
1382#define bfin_read_MDMA2_S0_Y_COUNT() bfin_read16(MDMA2_S0_Y_COUNT)
1383#define bfin_write_MDMA2_S0_Y_COUNT(val) bfin_write16(MDMA2_S0_Y_COUNT,val)
1384#define bfin_read_MDMA2_S0_X_MODIFY() bfin_read16(MDMA2_S0_X_MODIFY)
1385#define bfin_write_MDMA2_S0_X_MODIFY(val) bfin_write16(MDMA2_S0_X_MODIFY,val)
1386#define bfin_read_MDMA2_S0_Y_MODIFY() bfin_read16(MDMA2_S0_Y_MODIFY)
1387#define bfin_write_MDMA2_S0_Y_MODIFY(val) bfin_write16(MDMA2_S0_Y_MODIFY,val)
1388#define bfin_read_MDMA2_S0_CURR_DESC_PTR() bfin_read32(MDMA2_S0_CURR_DESC_PTR)
1389#define bfin_write_MDMA2_S0_CURR_DESC_PTR(val) bfin_write32(MDMA2_S0_CURR_DESC_PTR,val)
1390#define bfin_read_MDMA2_S0_CURR_ADDR() bfin_read32(MDMA2_S0_CURR_ADDR)
1391#define bfin_write_MDMA2_S0_CURR_ADDR(val) bfin_write32(MDMA2_S0_CURR_ADDR,val)
1392#define bfin_read_MDMA2_S0_CURR_X_COUNT() bfin_read16(MDMA2_S0_CURR_X_COUNT)
1393#define bfin_write_MDMA2_S0_CURR_X_COUNT(val) bfin_write16(MDMA2_S0_CURR_X_COUNT,val)
1394#define bfin_read_MDMA2_S0_CURR_Y_COUNT() bfin_read16(MDMA2_S0_CURR_Y_COUNT)
1395#define bfin_write_MDMA2_S0_CURR_Y_COUNT(val) bfin_write16(MDMA2_S0_CURR_Y_COUNT,val)
1396#define bfin_read_MDMA2_S0_IRQ_STATUS() bfin_read16(MDMA2_S0_IRQ_STATUS)
1397#define bfin_write_MDMA2_S0_IRQ_STATUS(val) bfin_write16(MDMA2_S0_IRQ_STATUS,val)
1398#define bfin_read_MDMA2_S0_PERIPHERAL_MAP() bfin_read16(MDMA2_S0_PERIPHERAL_MAP)
1399#define bfin_write_MDMA2_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA2_S0_PERIPHERAL_MAP,val)
1400#define bfin_read_MDMA2_D1_CONFIG() bfin_read16(MDMA2_D1_CONFIG)
1401#define bfin_write_MDMA2_D1_CONFIG(val) bfin_write16(MDMA2_D1_CONFIG,val)
1402#define bfin_read_MDMA2_D1_NEXT_DESC_PTR() bfin_read32(MDMA2_D1_NEXT_DESC_PTR)
1403#define bfin_write_MDMA2_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA2_D1_NEXT_DESC_PTR,val)
1404#define bfin_read_MDMA2_D1_START_ADDR() bfin_read32(MDMA2_D1_START_ADDR)
1405#define bfin_write_MDMA2_D1_START_ADDR(val) bfin_write32(MDMA2_D1_START_ADDR,val)
1406#define bfin_read_MDMA2_D1_X_COUNT() bfin_read16(MDMA2_D1_X_COUNT)
1407#define bfin_write_MDMA2_D1_X_COUNT(val) bfin_write16(MDMA2_D1_X_COUNT,val)
1408#define bfin_read_MDMA2_D1_Y_COUNT() bfin_read16(MDMA2_D1_Y_COUNT)
1409#define bfin_write_MDMA2_D1_Y_COUNT(val) bfin_write16(MDMA2_D1_Y_COUNT,val)
1410#define bfin_read_MDMA2_D1_X_MODIFY() bfin_read16(MDMA2_D1_X_MODIFY)
1411#define bfin_write_MDMA2_D1_X_MODIFY(val) bfin_write16(MDMA2_D1_X_MODIFY,val)
1412#define bfin_read_MDMA2_D1_Y_MODIFY() bfin_read16(MDMA2_D1_Y_MODIFY)
1413#define bfin_write_MDMA2_D1_Y_MODIFY(val) bfin_write16(MDMA2_D1_Y_MODIFY,val)
1414#define bfin_read_MDMA2_D1_CURR_DESC_PTR() bfin_read32(MDMA2_D1_CURR_DESC_PTR)
1415#define bfin_write_MDMA2_D1_CURR_DESC_PTR(val) bfin_write32(MDMA2_D1_CURR_DESC_PTR,val)
1416#define bfin_read_MDMA2_D1_CURR_ADDR() bfin_read32(MDMA2_D1_CURR_ADDR)
1417#define bfin_write_MDMA2_D1_CURR_ADDR(val) bfin_write32(MDMA2_D1_CURR_ADDR,val)
1418#define bfin_read_MDMA2_D1_CURR_X_COUNT() bfin_read16(MDMA2_D1_CURR_X_COUNT)
1419#define bfin_write_MDMA2_D1_CURR_X_COUNT(val) bfin_write16(MDMA2_D1_CURR_X_COUNT,val)
1420#define bfin_read_MDMA2_D1_CURR_Y_COUNT() bfin_read16(MDMA2_D1_CURR_Y_COUNT)
1421#define bfin_write_MDMA2_D1_CURR_Y_COUNT(val) bfin_write16(MDMA2_D1_CURR_Y_COUNT,val)
1422#define bfin_read_MDMA2_D1_IRQ_STATUS() bfin_read16(MDMA2_D1_IRQ_STATUS)
1423#define bfin_write_MDMA2_D1_IRQ_STATUS(val) bfin_write16(MDMA2_D1_IRQ_STATUS,val)
1424#define bfin_read_MDMA2_D1_PERIPHERAL_MAP() bfin_read16(MDMA2_D1_PERIPHERAL_MAP)
1425#define bfin_write_MDMA2_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA2_D1_PERIPHERAL_MAP,val)
1426#define bfin_read_MDMA2_S1_CONFIG() bfin_read16(MDMA2_S1_CONFIG)
1427#define bfin_write_MDMA2_S1_CONFIG(val) bfin_write16(MDMA2_S1_CONFIG,val)
1428#define bfin_read_MDMA2_S1_NEXT_DESC_PTR() bfin_read32(MDMA2_S1_NEXT_DESC_PTR)
1429#define bfin_write_MDMA2_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA2_S1_NEXT_DESC_PTR,val)
1430#define bfin_read_MDMA2_S1_START_ADDR() bfin_read32(MDMA2_S1_START_ADDR)
1431#define bfin_write_MDMA2_S1_START_ADDR(val) bfin_write32(MDMA2_S1_START_ADDR,val)
1432#define bfin_read_MDMA2_S1_X_COUNT() bfin_read16(MDMA2_S1_X_COUNT)
1433#define bfin_write_MDMA2_S1_X_COUNT(val) bfin_write16(MDMA2_S1_X_COUNT,val)
1434#define bfin_read_MDMA2_S1_Y_COUNT() bfin_read16(MDMA2_S1_Y_COUNT)
1435#define bfin_write_MDMA2_S1_Y_COUNT(val) bfin_write16(MDMA2_S1_Y_COUNT,val)
1436#define bfin_read_MDMA2_S1_X_MODIFY() bfin_read16(MDMA2_S1_X_MODIFY)
1437#define bfin_write_MDMA2_S1_X_MODIFY(val) bfin_write16(MDMA2_S1_X_MODIFY,val)
1438#define bfin_read_MDMA2_S1_Y_MODIFY() bfin_read16(MDMA2_S1_Y_MODIFY)
1439#define bfin_write_MDMA2_S1_Y_MODIFY(val) bfin_write16(MDMA2_S1_Y_MODIFY,val)
1440#define bfin_read_MDMA2_S1_CURR_DESC_PTR() bfin_read32(MDMA2_S1_CURR_DESC_PTR)
1441#define bfin_write_MDMA2_S1_CURR_DESC_PTR(val) bfin_write32(MDMA2_S1_CURR_DESC_PTR,val)
1442#define bfin_read_MDMA2_S1_CURR_ADDR() bfin_read32(MDMA2_S1_CURR_ADDR)
1443#define bfin_write_MDMA2_S1_CURR_ADDR(val) bfin_write32(MDMA2_S1_CURR_ADDR,val)
1444#define bfin_read_MDMA2_S1_CURR_X_COUNT() bfin_read16(MDMA2_S1_CURR_X_COUNT)
1445#define bfin_write_MDMA2_S1_CURR_X_COUNT(val) bfin_write16(MDMA2_S1_CURR_X_COUNT,val)
1446#define bfin_read_MDMA2_S1_CURR_Y_COUNT() bfin_read16(MDMA2_S1_CURR_Y_COUNT)
1447#define bfin_write_MDMA2_S1_CURR_Y_COUNT(val) bfin_write16(MDMA2_S1_CURR_Y_COUNT,val)
1448#define bfin_read_MDMA2_S1_IRQ_STATUS() bfin_read16(MDMA2_S1_IRQ_STATUS)
1449#define bfin_write_MDMA2_S1_IRQ_STATUS(val) bfin_write16(MDMA2_S1_IRQ_STATUS,val)
1450#define bfin_read_MDMA2_S1_PERIPHERAL_MAP() bfin_read16(MDMA2_S1_PERIPHERAL_MAP)
1451#define bfin_write_MDMA2_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA2_S1_PERIPHERAL_MAP,val)
1452/* Internal Memory DMA Registers (0xFFC0_1800 - 0xFFC0_19FF) */
1453#define bfin_read_IMDMA_D0_CONFIG() bfin_read16(IMDMA_D0_CONFIG)
1454#define bfin_write_IMDMA_D0_CONFIG(val) bfin_write16(IMDMA_D0_CONFIG,val)
1455#define bfin_read_IMDMA_D0_NEXT_DESC_PTR() bfin_read32(IMDMA_D0_NEXT_DESC_PTR)
1456#define bfin_write_IMDMA_D0_NEXT_DESC_PTR(val) bfin_write32(IMDMA_D0_NEXT_DESC_PTR,val)
1457#define bfin_read_IMDMA_D0_START_ADDR() bfin_read32(IMDMA_D0_START_ADDR)
1458#define bfin_write_IMDMA_D0_START_ADDR(val) bfin_write32(IMDMA_D0_START_ADDR,val)
1459#define bfin_read_IMDMA_D0_X_COUNT() bfin_read16(IMDMA_D0_X_COUNT)
1460#define bfin_write_IMDMA_D0_X_COUNT(val) bfin_write16(IMDMA_D0_X_COUNT,val)
1461#define bfin_read_IMDMA_D0_Y_COUNT() bfin_read16(IMDMA_D0_Y_COUNT)
1462#define bfin_write_IMDMA_D0_Y_COUNT(val) bfin_write16(IMDMA_D0_Y_COUNT,val)
1463#define bfin_read_IMDMA_D0_X_MODIFY() bfin_read16(IMDMA_D0_X_MODIFY)
1464#define bfin_write_IMDMA_D0_X_MODIFY(val) bfin_write16(IMDMA_D0_X_MODIFY,val)
1465#define bfin_read_IMDMA_D0_Y_MODIFY() bfin_read16(IMDMA_D0_Y_MODIFY)
1466#define bfin_write_IMDMA_D0_Y_MODIFY(val) bfin_write16(IMDMA_D0_Y_MODIFY,val)
1467#define bfin_read_IMDMA_D0_CURR_DESC_PTR() bfin_read32(IMDMA_D0_CURR_DESC_PTR)
1468#define bfin_write_IMDMA_D0_CURR_DESC_PTR(val) bfin_write32(IMDMA_D0_CURR_DESC_PTR,val)
1469#define bfin_read_IMDMA_D0_CURR_ADDR() bfin_read32(IMDMA_D0_CURR_ADDR)
1470#define bfin_write_IMDMA_D0_CURR_ADDR(val) bfin_write32(IMDMA_D0_CURR_ADDR,val)
1471#define bfin_read_IMDMA_D0_CURR_X_COUNT() bfin_read16(IMDMA_D0_CURR_X_COUNT)
1472#define bfin_write_IMDMA_D0_CURR_X_COUNT(val) bfin_write16(IMDMA_D0_CURR_X_COUNT,val)
1473#define bfin_read_IMDMA_D0_CURR_Y_COUNT() bfin_read16(IMDMA_D0_CURR_Y_COUNT)
1474#define bfin_write_IMDMA_D0_CURR_Y_COUNT(val) bfin_write16(IMDMA_D0_CURR_Y_COUNT,val)
1475#define bfin_read_IMDMA_D0_IRQ_STATUS() bfin_read16(IMDMA_D0_IRQ_STATUS)
1476#define bfin_write_IMDMA_D0_IRQ_STATUS(val) bfin_write16(IMDMA_D0_IRQ_STATUS,val)
1477#define bfin_read_IMDMA_S0_CONFIG() bfin_read16(IMDMA_S0_CONFIG)
1478#define bfin_write_IMDMA_S0_CONFIG(val) bfin_write16(IMDMA_S0_CONFIG,val)
1479#define bfin_read_IMDMA_S0_NEXT_DESC_PTR() bfin_read32(IMDMA_S0_NEXT_DESC_PTR)
1480#define bfin_write_IMDMA_S0_NEXT_DESC_PTR(val) bfin_write32(IMDMA_S0_NEXT_DESC_PTR,val)
1481#define bfin_read_IMDMA_S0_START_ADDR() bfin_read32(IMDMA_S0_START_ADDR)
1482#define bfin_write_IMDMA_S0_START_ADDR(val) bfin_write32(IMDMA_S0_START_ADDR,val)
1483#define bfin_read_IMDMA_S0_X_COUNT() bfin_read16(IMDMA_S0_X_COUNT)
1484#define bfin_write_IMDMA_S0_X_COUNT(val) bfin_write16(IMDMA_S0_X_COUNT,val)
1485#define bfin_read_IMDMA_S0_Y_COUNT() bfin_read16(IMDMA_S0_Y_COUNT)
1486#define bfin_write_IMDMA_S0_Y_COUNT(val) bfin_write16(IMDMA_S0_Y_COUNT,val)
1487#define bfin_read_IMDMA_S0_X_MODIFY() bfin_read16(IMDMA_S0_X_MODIFY)
1488#define bfin_write_IMDMA_S0_X_MODIFY(val) bfin_write16(IMDMA_S0_X_MODIFY,val)
1489#define bfin_read_IMDMA_S0_Y_MODIFY() bfin_read16(IMDMA_S0_Y_MODIFY)
1490#define bfin_write_IMDMA_S0_Y_MODIFY(val) bfin_write16(IMDMA_S0_Y_MODIFY,val)
1491#define bfin_read_IMDMA_S0_CURR_DESC_PTR() bfin_read32(IMDMA_S0_CURR_DESC_PTR)
1492#define bfin_write_IMDMA_S0_CURR_DESC_PTR(val) bfin_write32(IMDMA_S0_CURR_DESC_PTR,val)
1493#define bfin_read_IMDMA_S0_CURR_ADDR() bfin_read32(IMDMA_S0_CURR_ADDR)
1494#define bfin_write_IMDMA_S0_CURR_ADDR(val) bfin_write32(IMDMA_S0_CURR_ADDR,val)
1495#define bfin_read_IMDMA_S0_CURR_X_COUNT() bfin_read16(IMDMA_S0_CURR_X_COUNT)
1496#define bfin_write_IMDMA_S0_CURR_X_COUNT(val) bfin_write16(IMDMA_S0_CURR_X_COUNT,val)
1497#define bfin_read_IMDMA_S0_CURR_Y_COUNT() bfin_read16(IMDMA_S0_CURR_Y_COUNT)
1498#define bfin_write_IMDMA_S0_CURR_Y_COUNT(val) bfin_write16(IMDMA_S0_CURR_Y_COUNT,val)
1499#define bfin_read_IMDMA_S0_IRQ_STATUS() bfin_read16(IMDMA_S0_IRQ_STATUS)
1500#define bfin_write_IMDMA_S0_IRQ_STATUS(val) bfin_write16(IMDMA_S0_IRQ_STATUS,val)
1501#define bfin_read_IMDMA_D1_CONFIG() bfin_read16(IMDMA_D1_CONFIG)
1502#define bfin_write_IMDMA_D1_CONFIG(val) bfin_write16(IMDMA_D1_CONFIG,val)
1503#define bfin_read_IMDMA_D1_NEXT_DESC_PTR() bfin_read32(IMDMA_D1_NEXT_DESC_PTR)
1504#define bfin_write_IMDMA_D1_NEXT_DESC_PTR(val) bfin_write32(IMDMA_D1_NEXT_DESC_PTR,val)
1505#define bfin_read_IMDMA_D1_START_ADDR() bfin_read32(IMDMA_D1_START_ADDR)
1506#define bfin_write_IMDMA_D1_START_ADDR(val) bfin_write32(IMDMA_D1_START_ADDR,val)
1507#define bfin_read_IMDMA_D1_X_COUNT() bfin_read16(IMDMA_D1_X_COUNT)
1508#define bfin_write_IMDMA_D1_X_COUNT(val) bfin_write16(IMDMA_D1_X_COUNT,val)
1509#define bfin_read_IMDMA_D1_Y_COUNT() bfin_read16(IMDMA_D1_Y_COUNT)
1510#define bfin_write_IMDMA_D1_Y_COUNT(val) bfin_write16(IMDMA_D1_Y_COUNT,val)
1511#define bfin_read_IMDMA_D1_X_MODIFY() bfin_read16(IMDMA_D1_X_MODIFY)
1512#define bfin_write_IMDMA_D1_X_MODIFY(val) bfin_write16(IMDMA_D1_X_MODIFY,val)
1513#define bfin_read_IMDMA_D1_Y_MODIFY() bfin_read16(IMDMA_D1_Y_MODIFY)
1514#define bfin_write_IMDMA_D1_Y_MODIFY(val) bfin_write16(IMDMA_D1_Y_MODIFY,val)
1515#define bfin_read_IMDMA_D1_CURR_DESC_PTR() bfin_read32(IMDMA_D1_CURR_DESC_PTR)
1516#define bfin_write_IMDMA_D1_CURR_DESC_PTR(val) bfin_write32(IMDMA_D1_CURR_DESC_PTR,val)
1517#define bfin_read_IMDMA_D1_CURR_ADDR() bfin_read32(IMDMA_D1_CURR_ADDR)
1518#define bfin_write_IMDMA_D1_CURR_ADDR(val) bfin_write32(IMDMA_D1_CURR_ADDR,val)
1519#define bfin_read_IMDMA_D1_CURR_X_COUNT() bfin_read16(IMDMA_D1_CURR_X_COUNT)
1520#define bfin_write_IMDMA_D1_CURR_X_COUNT(val) bfin_write16(IMDMA_D1_CURR_X_COUNT,val)
1521#define bfin_read_IMDMA_D1_CURR_Y_COUNT() bfin_read16(IMDMA_D1_CURR_Y_COUNT)
1522#define bfin_write_IMDMA_D1_CURR_Y_COUNT(val) bfin_write16(IMDMA_D1_CURR_Y_COUNT,val)
1523#define bfin_read_IMDMA_D1_IRQ_STATUS() bfin_read16(IMDMA_D1_IRQ_STATUS)
1524#define bfin_write_IMDMA_D1_IRQ_STATUS(val) bfin_write16(IMDMA_D1_IRQ_STATUS,val)
1525#define bfin_read_IMDMA_S1_CONFIG() bfin_read16(IMDMA_S1_CONFIG)
1526#define bfin_write_IMDMA_S1_CONFIG(val) bfin_write16(IMDMA_S1_CONFIG,val)
1527#define bfin_read_IMDMA_S1_NEXT_DESC_PTR() bfin_read32(IMDMA_S1_NEXT_DESC_PTR)
1528#define bfin_write_IMDMA_S1_NEXT_DESC_PTR(val) bfin_write32(IMDMA_S1_NEXT_DESC_PTR,val)
1529#define bfin_read_IMDMA_S1_START_ADDR() bfin_read32(IMDMA_S1_START_ADDR)
1530#define bfin_write_IMDMA_S1_START_ADDR(val) bfin_write32(IMDMA_S1_START_ADDR,val)
1531#define bfin_read_IMDMA_S1_X_COUNT() bfin_read16(IMDMA_S1_X_COUNT)
1532#define bfin_write_IMDMA_S1_X_COUNT(val) bfin_write16(IMDMA_S1_X_COUNT,val)
1533#define bfin_read_IMDMA_S1_Y_COUNT() bfin_read16(IMDMA_S1_Y_COUNT)
1534#define bfin_write_IMDMA_S1_Y_COUNT(val) bfin_write16(IMDMA_S1_Y_COUNT,val)
1535#define bfin_read_IMDMA_S1_X_MODIFY() bfin_read16(IMDMA_S1_X_MODIFY)
1536#define bfin_write_IMDMA_S1_X_MODIFY(val) bfin_write16(IMDMA_S1_X_MODIFY,val)
1537#define bfin_read_IMDMA_S1_Y_MODIFY() bfin_read16(IMDMA_S1_Y_MODIFY)
1538#define bfin_write_IMDMA_S1_Y_MODIFY(val) bfin_write16(IMDMA_S1_Y_MODIFY,val)
1539#define bfin_read_IMDMA_S1_CURR_DESC_PTR() bfin_read32(IMDMA_S1_CURR_DESC_PTR)
1540#define bfin_write_IMDMA_S1_CURR_DESC_PTR(val) bfin_write32(IMDMA_S1_CURR_DESC_PTR,val)
1541#define bfin_read_IMDMA_S1_CURR_ADDR() bfin_read32(IMDMA_S1_CURR_ADDR)
1542#define bfin_write_IMDMA_S1_CURR_ADDR(val) bfin_write32(IMDMA_S1_CURR_ADDR,val)
1543#define bfin_read_IMDMA_S1_CURR_X_COUNT() bfin_read16(IMDMA_S1_CURR_X_COUNT)
1544#define bfin_write_IMDMA_S1_CURR_X_COUNT(val) bfin_write16(IMDMA_S1_CURR_X_COUNT,val)
1545#define bfin_read_IMDMA_S1_CURR_Y_COUNT() bfin_read16(IMDMA_S1_CURR_Y_COUNT)
1546#define bfin_write_IMDMA_S1_CURR_Y_COUNT(val) bfin_write16(IMDMA_S1_CURR_Y_COUNT,val)
1547#define bfin_read_IMDMA_S1_IRQ_STATUS() bfin_read16(IMDMA_S1_IRQ_STATUS)
1548#define bfin_write_IMDMA_S1_IRQ_STATUS(val) bfin_write16(IMDMA_S1_IRQ_STATUS,val)
1549
1550#define bfin_read_MDMA_S0_CONFIG() bfin_read_MDMA1_S0_CONFIG()
1551#define bfin_write_MDMA_S0_CONFIG(val) bfin_write_MDMA1_S0_CONFIG(val)
1552#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read_MDMA1_S0_IRQ_STATUS()
1553#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write_MDMA1_S0_IRQ_STATUS(val)
1554#define bfin_read_MDMA_S0_X_MODIFY() bfin_read_MDMA1_S0_X_MODIFY()
1555#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write_MDMA1_S0_X_MODIFY(val)
1556#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read_MDMA1_S0_Y_MODIFY()
1557#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write_MDMA1_S0_Y_MODIFY(val)
1558#define bfin_read_MDMA_S0_X_COUNT() bfin_read_MDMA1_S0_X_COUNT()
1559#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write_MDMA1_S0_X_COUNT(val)
1560#define bfin_read_MDMA_S0_Y_COUNT() bfin_read_MDMA1_S0_Y_COUNT()
1561#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write_MDMA1_S0_Y_COUNT(val)
1562#define bfin_read_MDMA_S0_START_ADDR() bfin_read_MDMA1_S0_START_ADDR()
1563#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write_MDMA1_S0_START_ADDR(val)
1564#define bfin_read_MDMA_D0_CONFIG() bfin_read_MDMA1_D0_CONFIG()
1565#define bfin_write_MDMA_D0_CONFIG(val) bfin_write_MDMA1_D0_CONFIG(val)
1566#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read_MDMA1_D0_IRQ_STATUS()
1567#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write_MDMA1_D0_IRQ_STATUS(val)
1568#define bfin_read_MDMA_D0_X_MODIFY() bfin_read_MDMA1_D0_X_MODIFY()
1569#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write_MDMA1_D0_X_MODIFY(val)
1570#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read_MDMA1_D0_Y_MODIFY()
1571#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write_MDMA1_D0_Y_MODIFY(val)
1572#define bfin_read_MDMA_D0_X_COUNT() bfin_read_MDMA1_D0_X_COUNT()
1573#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write_MDMA1_D0_X_COUNT(val)
1574#define bfin_read_MDMA_D0_Y_COUNT() bfin_read_MDMA1_D0_Y_COUNT()
1575#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write_MDMA1_D0_Y_COUNT(val)
1576#define bfin_read_MDMA_D0_START_ADDR() bfin_read_MDMA1_D0_START_ADDR()
1577#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val)
1578
1579#endif /* _CDEF_BF561_H */
diff --git a/include/asm-blackfin/mach-bf561/defBF561.h b/include/asm-blackfin/mach-bf561/defBF561.h
deleted file mode 100644
index 1ab50e906fe7..000000000000
--- a/include/asm-blackfin/mach-bf561/defBF561.h
+++ /dev/null
@@ -1,1758 +0,0 @@
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/* For MMR's that are reserved on Core B, set up defines to better integrate with other ports */
56#define SWRST SICA_SWRST
57#define SYSCR SICA_SYSCR
58#define DOUBLE_FAULT (DOUBLE_FAULT_B|DOUBLE_FAULT_A)
59#define RESET_DOUBLE (SWRST_DBL_FAULT_B|SWRST_DBL_FAULT_A)
60#define RESET_WDOG (SWRST_WDT_B|SWRST_WDT_A)
61#define RESET_SOFTWARE (SWRST_OCCURRED)
62
63/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
64#define SICA_SWRST 0xFFC00100 /* Software Reset register */
65#define SICA_SYSCR 0xFFC00104 /* System Reset Configuration register */
66#define SICA_RVECT 0xFFC00108 /* SIC Reset Vector Address Register */
67#define SICA_IMASK 0xFFC0010C /* SIC Interrupt Mask register 0 - hack to fix old tests */
68#define SICA_IMASK0 0xFFC0010C /* SIC Interrupt Mask register 0 */
69#define SICA_IMASK1 0xFFC00110 /* SIC Interrupt Mask register 1 */
70#define SICA_IAR0 0xFFC00124 /* SIC Interrupt Assignment Register 0 */
71#define SICA_IAR1 0xFFC00128 /* SIC Interrupt Assignment Register 1 */
72#define SICA_IAR2 0xFFC0012C /* SIC Interrupt Assignment Register 2 */
73#define SICA_IAR3 0xFFC00130 /* SIC Interrupt Assignment Register 3 */
74#define SICA_IAR4 0xFFC00134 /* SIC Interrupt Assignment Register 4 */
75#define SICA_IAR5 0xFFC00138 /* SIC Interrupt Assignment Register 5 */
76#define SICA_IAR6 0xFFC0013C /* SIC Interrupt Assignment Register 6 */
77#define SICA_IAR7 0xFFC00140 /* SIC Interrupt Assignment Register 7 */
78#define SICA_ISR0 0xFFC00114 /* SIC Interrupt Status register 0 */
79#define SICA_ISR1 0xFFC00118 /* SIC Interrupt Status register 1 */
80#define SICA_IWR0 0xFFC0011C /* SIC Interrupt Wakeup-Enable register 0 */
81#define SICA_IWR1 0xFFC00120 /* SIC Interrupt Wakeup-Enable register 1 */
82
83/* System Reset and Interrupt Controller registers for Core B (0xFFC0 1100-0xFFC0 11FF) */
84#define SICB_SWRST 0xFFC01100 /* reserved */
85#define SICB_SYSCR 0xFFC01104 /* reserved */
86#define SICB_RVECT 0xFFC01108 /* SIC Reset Vector Address Register */
87#define SICB_IMASK0 0xFFC0110C /* SIC Interrupt Mask register 0 */
88#define SICB_IMASK1 0xFFC01110 /* SIC Interrupt Mask register 1 */
89#define SICB_IAR0 0xFFC01124 /* SIC Interrupt Assignment Register 0 */
90#define SICB_IAR1 0xFFC01128 /* SIC Interrupt Assignment Register 1 */
91#define SICB_IAR2 0xFFC0112C /* SIC Interrupt Assignment Register 2 */
92#define SICB_IAR3 0xFFC01130 /* SIC Interrupt Assignment Register 3 */
93#define SICB_IAR4 0xFFC01134 /* SIC Interrupt Assignment Register 4 */
94#define SICB_IAR5 0xFFC01138 /* SIC Interrupt Assignment Register 5 */
95#define SICB_IAR6 0xFFC0113C /* SIC Interrupt Assignment Register 6 */
96#define SICB_IAR7 0xFFC01140 /* SIC Interrupt Assignment Register 7 */
97#define SICB_ISR0 0xFFC01114 /* SIC Interrupt Status register 0 */
98#define SICB_ISR1 0xFFC01118 /* SIC Interrupt Status register 1 */
99#define SICB_IWR0 0xFFC0111C /* SIC Interrupt Wakeup-Enable register 0 */
100#define SICB_IWR1 0xFFC01120 /* SIC Interrupt Wakeup-Enable register 1 */
101
102/* Watchdog Timer registers for Core A (0xFFC0 0200-0xFFC0 02FF) */
103#define WDOGA_CTL 0xFFC00200 /* Watchdog Control register */
104#define WDOGA_CNT 0xFFC00204 /* Watchdog Count register */
105#define WDOGA_STAT 0xFFC00208 /* Watchdog Status register */
106
107/* Watchdog Timer registers for Core B (0xFFC0 1200-0xFFC0 12FF) */
108#define WDOGB_CTL 0xFFC01200 /* Watchdog Control register */
109#define WDOGB_CNT 0xFFC01204 /* Watchdog Count register */
110#define WDOGB_STAT 0xFFC01208 /* Watchdog Status register */
111
112/* UART Controller (0xFFC00400 - 0xFFC004FF) */
113
114/*
115 * Because include/linux/serial_reg.h have defined UART_*,
116 * So we define blackfin uart regs to BFIN_UART0_*.
117 */
118#define BFIN_UART_THR 0xFFC00400 /* Transmit Holding register */
119#define BFIN_UART_RBR 0xFFC00400 /* Receive Buffer register */
120#define BFIN_UART_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
121#define BFIN_UART_IER 0xFFC00404 /* Interrupt Enable Register */
122#define BFIN_UART_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
123#define BFIN_UART_IIR 0xFFC00408 /* Interrupt Identification Register */
124#define BFIN_UART_LCR 0xFFC0040C /* Line Control Register */
125#define BFIN_UART_MCR 0xFFC00410 /* Modem Control Register */
126#define BFIN_UART_LSR 0xFFC00414 /* Line Status Register */
127#define BFIN_UART_MSR 0xFFC00418 /* Modem Status Register */
128#define BFIN_UART_SCR 0xFFC0041C /* SCR Scratch Register */
129#define BFIN_UART_GCTL 0xFFC00424 /* Global Control Register */
130
131/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
132#define SPI0_REGBASE 0xFFC00500
133#define SPI_CTL 0xFFC00500 /* SPI Control Register */
134#define SPI_FLG 0xFFC00504 /* SPI Flag register */
135#define SPI_STAT 0xFFC00508 /* SPI Status register */
136#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
137#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
138#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
139#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
140
141/* Timer 0-7 registers (0xFFC0 0600-0xFFC0 06FF) */
142#define TIMER0_CONFIG 0xFFC00600 /* Timer0 Configuration register */
143#define TIMER0_COUNTER 0xFFC00604 /* Timer0 Counter register */
144#define TIMER0_PERIOD 0xFFC00608 /* Timer0 Period register */
145#define TIMER0_WIDTH 0xFFC0060C /* Timer0 Width register */
146
147#define TIMER1_CONFIG 0xFFC00610 /* Timer1 Configuration register */
148#define TIMER1_COUNTER 0xFFC00614 /* Timer1 Counter register */
149#define TIMER1_PERIOD 0xFFC00618 /* Timer1 Period register */
150#define TIMER1_WIDTH 0xFFC0061C /* Timer1 Width register */
151
152#define TIMER2_CONFIG 0xFFC00620 /* Timer2 Configuration register */
153#define TIMER2_COUNTER 0xFFC00624 /* Timer2 Counter register */
154#define TIMER2_PERIOD 0xFFC00628 /* Timer2 Period register */
155#define TIMER2_WIDTH 0xFFC0062C /* Timer2 Width register */
156
157#define TIMER3_CONFIG 0xFFC00630 /* Timer3 Configuration register */
158#define TIMER3_COUNTER 0xFFC00634 /* Timer3 Counter register */
159#define TIMER3_PERIOD 0xFFC00638 /* Timer3 Period register */
160#define TIMER3_WIDTH 0xFFC0063C /* Timer3 Width register */
161
162#define TIMER4_CONFIG 0xFFC00640 /* Timer4 Configuration register */
163#define TIMER4_COUNTER 0xFFC00644 /* Timer4 Counter register */
164#define TIMER4_PERIOD 0xFFC00648 /* Timer4 Period register */
165#define TIMER4_WIDTH 0xFFC0064C /* Timer4 Width register */
166
167#define TIMER5_CONFIG 0xFFC00650 /* Timer5 Configuration register */
168#define TIMER5_COUNTER 0xFFC00654 /* Timer5 Counter register */
169#define TIMER5_PERIOD 0xFFC00658 /* Timer5 Period register */
170#define TIMER5_WIDTH 0xFFC0065C /* Timer5 Width register */
171
172#define TIMER6_CONFIG 0xFFC00660 /* Timer6 Configuration register */
173#define TIMER6_COUNTER 0xFFC00664 /* Timer6 Counter register */
174#define TIMER6_PERIOD 0xFFC00668 /* Timer6 Period register */
175#define TIMER6_WIDTH 0xFFC0066C /* Timer6 Width register */
176
177#define TIMER7_CONFIG 0xFFC00670 /* Timer7 Configuration register */
178#define TIMER7_COUNTER 0xFFC00674 /* Timer7 Counter register */
179#define TIMER7_PERIOD 0xFFC00678 /* Timer7 Period register */
180#define TIMER7_WIDTH 0xFFC0067C /* Timer7 Width register */
181
182#define TMRS8_ENABLE 0xFFC00680 /* Timer Enable Register */
183#define TMRS8_DISABLE 0xFFC00684 /* Timer Disable register */
184#define TMRS8_STATUS 0xFFC00688 /* Timer Status register */
185
186/* Timer registers 8-11 (0xFFC0 1600-0xFFC0 16FF) */
187#define TIMER8_CONFIG 0xFFC01600 /* Timer8 Configuration register */
188#define TIMER8_COUNTER 0xFFC01604 /* Timer8 Counter register */
189#define TIMER8_PERIOD 0xFFC01608 /* Timer8 Period register */
190#define TIMER8_WIDTH 0xFFC0160C /* Timer8 Width register */
191
192#define TIMER9_CONFIG 0xFFC01610 /* Timer9 Configuration register */
193#define TIMER9_COUNTER 0xFFC01614 /* Timer9 Counter register */
194#define TIMER9_PERIOD 0xFFC01618 /* Timer9 Period register */
195#define TIMER9_WIDTH 0xFFC0161C /* Timer9 Width register */
196
197#define TIMER10_CONFIG 0xFFC01620 /* Timer10 Configuration register */
198#define TIMER10_COUNTER 0xFFC01624 /* Timer10 Counter register */
199#define TIMER10_PERIOD 0xFFC01628 /* Timer10 Period register */
200#define TIMER10_WIDTH 0xFFC0162C /* Timer10 Width register */
201
202#define TIMER11_CONFIG 0xFFC01630 /* Timer11 Configuration register */
203#define TIMER11_COUNTER 0xFFC01634 /* Timer11 Counter register */
204#define TIMER11_PERIOD 0xFFC01638 /* Timer11 Period register */
205#define TIMER11_WIDTH 0xFFC0163C /* Timer11 Width register */
206
207#define TMRS4_ENABLE 0xFFC01640 /* Timer Enable Register */
208#define TMRS4_DISABLE 0xFFC01644 /* Timer Disable register */
209#define TMRS4_STATUS 0xFFC01648 /* Timer Status register */
210
211/* Programmable Flag 0 registers (0xFFC0 0700-0xFFC0 07FF) */
212#define FIO0_FLAG_D 0xFFC00700 /* Flag Data register */
213#define FIO0_FLAG_C 0xFFC00704 /* Flag Clear register */
214#define FIO0_FLAG_S 0xFFC00708 /* Flag Set register */
215#define FIO0_FLAG_T 0xFFC0070C /* Flag Toggle register */
216#define FIO0_MASKA_D 0xFFC00710 /* Flag Mask Interrupt A Data register */
217#define FIO0_MASKA_C 0xFFC00714 /* Flag Mask Interrupt A Clear register */
218#define FIO0_MASKA_S 0xFFC00718 /* Flag Mask Interrupt A Set register */
219#define FIO0_MASKA_T 0xFFC0071C /* Flag Mask Interrupt A Toggle register */
220#define FIO0_MASKB_D 0xFFC00720 /* Flag Mask Interrupt B Data register */
221#define FIO0_MASKB_C 0xFFC00724 /* Flag Mask Interrupt B Clear register */
222#define FIO0_MASKB_S 0xFFC00728 /* Flag Mask Interrupt B Set register */
223#define FIO0_MASKB_T 0xFFC0072C /* Flag Mask Interrupt B Toggle register */
224#define FIO0_DIR 0xFFC00730 /* Flag Direction register */
225#define FIO0_POLAR 0xFFC00734 /* Flag Polarity register */
226#define FIO0_EDGE 0xFFC00738 /* Flag Interrupt Sensitivity register */
227#define FIO0_BOTH 0xFFC0073C /* Flag Set on Both Edges register */
228#define FIO0_INEN 0xFFC00740 /* Flag Input Enable register */
229
230/* Programmable Flag 1 registers (0xFFC0 1500-0xFFC0 15FF) */
231#define FIO1_FLAG_D 0xFFC01500 /* Flag Data register (mask used to directly */
232#define FIO1_FLAG_C 0xFFC01504 /* Flag Clear register */
233#define FIO1_FLAG_S 0xFFC01508 /* Flag Set register */
234#define FIO1_FLAG_T 0xFFC0150C /* Flag Toggle register (mask used to */
235#define FIO1_MASKA_D 0xFFC01510 /* Flag Mask Interrupt A Data register */
236#define FIO1_MASKA_C 0xFFC01514 /* Flag Mask Interrupt A Clear register */
237#define FIO1_MASKA_S 0xFFC01518 /* Flag Mask Interrupt A Set register */
238#define FIO1_MASKA_T 0xFFC0151C /* Flag Mask Interrupt A Toggle register */
239#define FIO1_MASKB_D 0xFFC01520 /* Flag Mask Interrupt B Data register */
240#define FIO1_MASKB_C 0xFFC01524 /* Flag Mask Interrupt B Clear register */
241#define FIO1_MASKB_S 0xFFC01528 /* Flag Mask Interrupt B Set register */
242#define FIO1_MASKB_T 0xFFC0152C /* Flag Mask Interrupt B Toggle register */
243#define FIO1_DIR 0xFFC01530 /* Flag Direction register */
244#define FIO1_POLAR 0xFFC01534 /* Flag Polarity register */
245#define FIO1_EDGE 0xFFC01538 /* Flag Interrupt Sensitivity register */
246#define FIO1_BOTH 0xFFC0153C /* Flag Set on Both Edges register */
247#define FIO1_INEN 0xFFC01540 /* Flag Input Enable register */
248
249/* Programmable Flag registers (0xFFC0 1700-0xFFC0 17FF) */
250#define FIO2_FLAG_D 0xFFC01700 /* Flag Data register (mask used to directly */
251#define FIO2_FLAG_C 0xFFC01704 /* Flag Clear register */
252#define FIO2_FLAG_S 0xFFC01708 /* Flag Set register */
253#define FIO2_FLAG_T 0xFFC0170C /* Flag Toggle register (mask used to */
254#define FIO2_MASKA_D 0xFFC01710 /* Flag Mask Interrupt A Data register */
255#define FIO2_MASKA_C 0xFFC01714 /* Flag Mask Interrupt A Clear register */
256#define FIO2_MASKA_S 0xFFC01718 /* Flag Mask Interrupt A Set register */
257#define FIO2_MASKA_T 0xFFC0171C /* Flag Mask Interrupt A Toggle register */
258#define FIO2_MASKB_D 0xFFC01720 /* Flag Mask Interrupt B Data register */
259#define FIO2_MASKB_C 0xFFC01724 /* Flag Mask Interrupt B Clear register */
260#define FIO2_MASKB_S 0xFFC01728 /* Flag Mask Interrupt B Set register */
261#define FIO2_MASKB_T 0xFFC0172C /* Flag Mask Interrupt B Toggle register */
262#define FIO2_DIR 0xFFC01730 /* Flag Direction register */
263#define FIO2_POLAR 0xFFC01734 /* Flag Polarity register */
264#define FIO2_EDGE 0xFFC01738 /* Flag Interrupt Sensitivity register */
265#define FIO2_BOTH 0xFFC0173C /* Flag Set on Both Edges register */
266#define FIO2_INEN 0xFFC01740 /* Flag Input Enable register */
267
268/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
269#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
270#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
271#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
272#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
273#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
274#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
275#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
276#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
277#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
278#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
279#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
280#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
281#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
282#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
283#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
284#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
285#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
286#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
287#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
288#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
289#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
290#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
291
292/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
293#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
294#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
295#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
296#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
297#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
298#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
299#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
300#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
301#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
302#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
303#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
304#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
305#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
306#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
307#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
308#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
309#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
310#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
311#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
312#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
313#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
314#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
315
316/* Asynchronous Memory Controller - External Bus Interface Unit */
317#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
318#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
319#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
320
321/* SDRAM Controller External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
322#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
323#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
324#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
325#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
326
327/* Parallel Peripheral Interface (PPI) 0 registers (0xFFC0 1000-0xFFC0 10FF) */
328#define PPI0_CONTROL 0xFFC01000 /* PPI0 Control register */
329#define PPI0_STATUS 0xFFC01004 /* PPI0 Status register */
330#define PPI0_COUNT 0xFFC01008 /* PPI0 Transfer Count register */
331#define PPI0_DELAY 0xFFC0100C /* PPI0 Delay Count register */
332#define PPI0_FRAME 0xFFC01010 /* PPI0 Frame Length register */
333
334/*Parallel Peripheral Interface (PPI) 1 registers (0xFFC0 1300-0xFFC0 13FF) */
335#define PPI1_CONTROL 0xFFC01300 /* PPI1 Control register */
336#define PPI1_STATUS 0xFFC01304 /* PPI1 Status register */
337#define PPI1_COUNT 0xFFC01308 /* PPI1 Transfer Count register */
338#define PPI1_DELAY 0xFFC0130C /* PPI1 Delay Count register */
339#define PPI1_FRAME 0xFFC01310 /* PPI1 Frame Length register */
340
341/*DMA traffic control registers */
342#define DMA1_TC_PER 0xFFC01B0C /* Traffic control periods */
343#define DMA1_TC_CNT 0xFFC01B10 /* Traffic control current counts */
344#define DMA2_TC_PER 0xFFC00B0C /* Traffic control periods */
345#define DMA2_TC_CNT 0xFFC00B10 /* Traffic control current counts */
346
347/* DMA1 Controller registers (0xFFC0 1C00-0xFFC0 1FFF) */
348#define DMA1_0_CONFIG 0xFFC01C08 /* DMA1 Channel 0 Configuration register */
349#define DMA1_0_NEXT_DESC_PTR 0xFFC01C00 /* DMA1 Channel 0 Next Descripter Ptr Reg */
350#define DMA1_0_START_ADDR 0xFFC01C04 /* DMA1 Channel 0 Start Address */
351#define DMA1_0_X_COUNT 0xFFC01C10 /* DMA1 Channel 0 Inner Loop Count */
352#define DMA1_0_Y_COUNT 0xFFC01C18 /* DMA1 Channel 0 Outer Loop Count */
353#define DMA1_0_X_MODIFY 0xFFC01C14 /* DMA1 Channel 0 Inner Loop Addr Increment */
354#define DMA1_0_Y_MODIFY 0xFFC01C1C /* DMA1 Channel 0 Outer Loop Addr Increment */
355#define DMA1_0_CURR_DESC_PTR 0xFFC01C20 /* DMA1 Channel 0 Current Descriptor Pointer */
356#define DMA1_0_CURR_ADDR 0xFFC01C24 /* DMA1 Channel 0 Current Address Pointer */
357#define DMA1_0_CURR_X_COUNT 0xFFC01C30 /* DMA1 Channel 0 Current Inner Loop Count */
358#define DMA1_0_CURR_Y_COUNT 0xFFC01C38 /* DMA1 Channel 0 Current Outer Loop Count */
359#define DMA1_0_IRQ_STATUS 0xFFC01C28 /* DMA1 Channel 0 Interrupt/Status Register */
360#define DMA1_0_PERIPHERAL_MAP 0xFFC01C2C /* DMA1 Channel 0 Peripheral Map Register */
361
362#define DMA1_1_CONFIG 0xFFC01C48 /* DMA1 Channel 1 Configuration register */
363#define DMA1_1_NEXT_DESC_PTR 0xFFC01C40 /* DMA1 Channel 1 Next Descripter Ptr Reg */
364#define DMA1_1_START_ADDR 0xFFC01C44 /* DMA1 Channel 1 Start Address */
365#define DMA1_1_X_COUNT 0xFFC01C50 /* DMA1 Channel 1 Inner Loop Count */
366#define DMA1_1_Y_COUNT 0xFFC01C58 /* DMA1 Channel 1 Outer Loop Count */
367#define DMA1_1_X_MODIFY 0xFFC01C54 /* DMA1 Channel 1 Inner Loop Addr Increment */
368#define DMA1_1_Y_MODIFY 0xFFC01C5C /* DMA1 Channel 1 Outer Loop Addr Increment */
369#define DMA1_1_CURR_DESC_PTR 0xFFC01C60 /* DMA1 Channel 1 Current Descriptor Pointer */
370#define DMA1_1_CURR_ADDR 0xFFC01C64 /* DMA1 Channel 1 Current Address Pointer */
371#define DMA1_1_CURR_X_COUNT 0xFFC01C70 /* DMA1 Channel 1 Current Inner Loop Count */
372#define DMA1_1_CURR_Y_COUNT 0xFFC01C78 /* DMA1 Channel 1 Current Outer Loop Count */
373#define DMA1_1_IRQ_STATUS 0xFFC01C68 /* DMA1 Channel 1 Interrupt/Status Register */
374#define DMA1_1_PERIPHERAL_MAP 0xFFC01C6C /* DMA1 Channel 1 Peripheral Map Register */
375
376#define DMA1_2_CONFIG 0xFFC01C88 /* DMA1 Channel 2 Configuration register */
377#define DMA1_2_NEXT_DESC_PTR 0xFFC01C80 /* DMA1 Channel 2 Next Descripter Ptr Reg */
378#define DMA1_2_START_ADDR 0xFFC01C84 /* DMA1 Channel 2 Start Address */
379#define DMA1_2_X_COUNT 0xFFC01C90 /* DMA1 Channel 2 Inner Loop Count */
380#define DMA1_2_Y_COUNT 0xFFC01C98 /* DMA1 Channel 2 Outer Loop Count */
381#define DMA1_2_X_MODIFY 0xFFC01C94 /* DMA1 Channel 2 Inner Loop Addr Increment */
382#define DMA1_2_Y_MODIFY 0xFFC01C9C /* DMA1 Channel 2 Outer Loop Addr Increment */
383#define DMA1_2_CURR_DESC_PTR 0xFFC01CA0 /* DMA1 Channel 2 Current Descriptor Pointer */
384#define DMA1_2_CURR_ADDR 0xFFC01CA4 /* DMA1 Channel 2 Current Address Pointer */
385#define DMA1_2_CURR_X_COUNT 0xFFC01CB0 /* DMA1 Channel 2 Current Inner Loop Count */
386#define DMA1_2_CURR_Y_COUNT 0xFFC01CB8 /* DMA1 Channel 2 Current Outer Loop Count */
387#define DMA1_2_IRQ_STATUS 0xFFC01CA8 /* DMA1 Channel 2 Interrupt/Status Register */
388#define DMA1_2_PERIPHERAL_MAP 0xFFC01CAC /* DMA1 Channel 2 Peripheral Map Register */
389
390#define DMA1_3_CONFIG 0xFFC01CC8 /* DMA1 Channel 3 Configuration register */
391#define DMA1_3_NEXT_DESC_PTR 0xFFC01CC0 /* DMA1 Channel 3 Next Descripter Ptr Reg */
392#define DMA1_3_START_ADDR 0xFFC01CC4 /* DMA1 Channel 3 Start Address */
393#define DMA1_3_X_COUNT 0xFFC01CD0 /* DMA1 Channel 3 Inner Loop Count */
394#define DMA1_3_Y_COUNT 0xFFC01CD8 /* DMA1 Channel 3 Outer Loop Count */
395#define DMA1_3_X_MODIFY 0xFFC01CD4 /* DMA1 Channel 3 Inner Loop Addr Increment */
396#define DMA1_3_Y_MODIFY 0xFFC01CDC /* DMA1 Channel 3 Outer Loop Addr Increment */
397#define DMA1_3_CURR_DESC_PTR 0xFFC01CE0 /* DMA1 Channel 3 Current Descriptor Pointer */
398#define DMA1_3_CURR_ADDR 0xFFC01CE4 /* DMA1 Channel 3 Current Address Pointer */
399#define DMA1_3_CURR_X_COUNT 0xFFC01CF0 /* DMA1 Channel 3 Current Inner Loop Count */
400#define DMA1_3_CURR_Y_COUNT 0xFFC01CF8 /* DMA1 Channel 3 Current Outer Loop Count */
401#define DMA1_3_IRQ_STATUS 0xFFC01CE8 /* DMA1 Channel 3 Interrupt/Status Register */
402#define DMA1_3_PERIPHERAL_MAP 0xFFC01CEC /* DMA1 Channel 3 Peripheral Map Register */
403
404#define DMA1_4_CONFIG 0xFFC01D08 /* DMA1 Channel 4 Configuration register */
405#define DMA1_4_NEXT_DESC_PTR 0xFFC01D00 /* DMA1 Channel 4 Next Descripter Ptr Reg */
406#define DMA1_4_START_ADDR 0xFFC01D04 /* DMA1 Channel 4 Start Address */
407#define DMA1_4_X_COUNT 0xFFC01D10 /* DMA1 Channel 4 Inner Loop Count */
408#define DMA1_4_Y_COUNT 0xFFC01D18 /* DMA1 Channel 4 Outer Loop Count */
409#define DMA1_4_X_MODIFY 0xFFC01D14 /* DMA1 Channel 4 Inner Loop Addr Increment */
410#define DMA1_4_Y_MODIFY 0xFFC01D1C /* DMA1 Channel 4 Outer Loop Addr Increment */
411#define DMA1_4_CURR_DESC_PTR 0xFFC01D20 /* DMA1 Channel 4 Current Descriptor Pointer */
412#define DMA1_4_CURR_ADDR 0xFFC01D24 /* DMA1 Channel 4 Current Address Pointer */
413#define DMA1_4_CURR_X_COUNT 0xFFC01D30 /* DMA1 Channel 4 Current Inner Loop Count */
414#define DMA1_4_CURR_Y_COUNT 0xFFC01D38 /* DMA1 Channel 4 Current Outer Loop Count */
415#define DMA1_4_IRQ_STATUS 0xFFC01D28 /* DMA1 Channel 4 Interrupt/Status Register */
416#define DMA1_4_PERIPHERAL_MAP 0xFFC01D2C /* DMA1 Channel 4 Peripheral Map Register */
417
418#define DMA1_5_CONFIG 0xFFC01D48 /* DMA1 Channel 5 Configuration register */
419#define DMA1_5_NEXT_DESC_PTR 0xFFC01D40 /* DMA1 Channel 5 Next Descripter Ptr Reg */
420#define DMA1_5_START_ADDR 0xFFC01D44 /* DMA1 Channel 5 Start Address */
421#define DMA1_5_X_COUNT 0xFFC01D50 /* DMA1 Channel 5 Inner Loop Count */
422#define DMA1_5_Y_COUNT 0xFFC01D58 /* DMA1 Channel 5 Outer Loop Count */
423#define DMA1_5_X_MODIFY 0xFFC01D54 /* DMA1 Channel 5 Inner Loop Addr Increment */
424#define DMA1_5_Y_MODIFY 0xFFC01D5C /* DMA1 Channel 5 Outer Loop Addr Increment */
425#define DMA1_5_CURR_DESC_PTR 0xFFC01D60 /* DMA1 Channel 5 Current Descriptor Pointer */
426#define DMA1_5_CURR_ADDR 0xFFC01D64 /* DMA1 Channel 5 Current Address Pointer */
427#define DMA1_5_CURR_X_COUNT 0xFFC01D70 /* DMA1 Channel 5 Current Inner Loop Count */
428#define DMA1_5_CURR_Y_COUNT 0xFFC01D78 /* DMA1 Channel 5 Current Outer Loop Count */
429#define DMA1_5_IRQ_STATUS 0xFFC01D68 /* DMA1 Channel 5 Interrupt/Status Register */
430#define DMA1_5_PERIPHERAL_MAP 0xFFC01D6C /* DMA1 Channel 5 Peripheral Map Register */
431
432#define DMA1_6_CONFIG 0xFFC01D88 /* DMA1 Channel 6 Configuration register */
433#define DMA1_6_NEXT_DESC_PTR 0xFFC01D80 /* DMA1 Channel 6 Next Descripter Ptr Reg */
434#define DMA1_6_START_ADDR 0xFFC01D84 /* DMA1 Channel 6 Start Address */
435#define DMA1_6_X_COUNT 0xFFC01D90 /* DMA1 Channel 6 Inner Loop Count */
436#define DMA1_6_Y_COUNT 0xFFC01D98 /* DMA1 Channel 6 Outer Loop Count */
437#define DMA1_6_X_MODIFY 0xFFC01D94 /* DMA1 Channel 6 Inner Loop Addr Increment */
438#define DMA1_6_Y_MODIFY 0xFFC01D9C /* DMA1 Channel 6 Outer Loop Addr Increment */
439#define DMA1_6_CURR_DESC_PTR 0xFFC01DA0 /* DMA1 Channel 6 Current Descriptor Pointer */
440#define DMA1_6_CURR_ADDR 0xFFC01DA4 /* DMA1 Channel 6 Current Address Pointer */
441#define DMA1_6_CURR_X_COUNT 0xFFC01DB0 /* DMA1 Channel 6 Current Inner Loop Count */
442#define DMA1_6_CURR_Y_COUNT 0xFFC01DB8 /* DMA1 Channel 6 Current Outer Loop Count */
443#define DMA1_6_IRQ_STATUS 0xFFC01DA8 /* DMA1 Channel 6 Interrupt/Status Register */
444#define DMA1_6_PERIPHERAL_MAP 0xFFC01DAC /* DMA1 Channel 6 Peripheral Map Register */
445
446#define DMA1_7_CONFIG 0xFFC01DC8 /* DMA1 Channel 7 Configuration register */
447#define DMA1_7_NEXT_DESC_PTR 0xFFC01DC0 /* DMA1 Channel 7 Next Descripter Ptr Reg */
448#define DMA1_7_START_ADDR 0xFFC01DC4 /* DMA1 Channel 7 Start Address */
449#define DMA1_7_X_COUNT 0xFFC01DD0 /* DMA1 Channel 7 Inner Loop Count */
450#define DMA1_7_Y_COUNT 0xFFC01DD8 /* DMA1 Channel 7 Outer Loop Count */
451#define DMA1_7_X_MODIFY 0xFFC01DD4 /* DMA1 Channel 7 Inner Loop Addr Increment */
452#define DMA1_7_Y_MODIFY 0xFFC01DDC /* DMA1 Channel 7 Outer Loop Addr Increment */
453#define DMA1_7_CURR_DESC_PTR 0xFFC01DE0 /* DMA1 Channel 7 Current Descriptor Pointer */
454#define DMA1_7_CURR_ADDR 0xFFC01DE4 /* DMA1 Channel 7 Current Address Pointer */
455#define DMA1_7_CURR_X_COUNT 0xFFC01DF0 /* DMA1 Channel 7 Current Inner Loop Count */
456#define DMA1_7_CURR_Y_COUNT 0xFFC01DF8 /* DMA1 Channel 7 Current Outer Loop Count */
457#define DMA1_7_IRQ_STATUS 0xFFC01DE8 /* DMA1 Channel 7 Interrupt/Status Register */
458#define DMA1_7_PERIPHERAL_MAP 0xFFC01DEC /* DMA1 Channel 7 Peripheral Map Register */
459
460#define DMA1_8_CONFIG 0xFFC01E08 /* DMA1 Channel 8 Configuration register */
461#define DMA1_8_NEXT_DESC_PTR 0xFFC01E00 /* DMA1 Channel 8 Next Descripter Ptr Reg */
462#define DMA1_8_START_ADDR 0xFFC01E04 /* DMA1 Channel 8 Start Address */
463#define DMA1_8_X_COUNT 0xFFC01E10 /* DMA1 Channel 8 Inner Loop Count */
464#define DMA1_8_Y_COUNT 0xFFC01E18 /* DMA1 Channel 8 Outer Loop Count */
465#define DMA1_8_X_MODIFY 0xFFC01E14 /* DMA1 Channel 8 Inner Loop Addr Increment */
466#define DMA1_8_Y_MODIFY 0xFFC01E1C /* DMA1 Channel 8 Outer Loop Addr Increment */
467#define DMA1_8_CURR_DESC_PTR 0xFFC01E20 /* DMA1 Channel 8 Current Descriptor Pointer */
468#define DMA1_8_CURR_ADDR 0xFFC01E24 /* DMA1 Channel 8 Current Address Pointer */
469#define DMA1_8_CURR_X_COUNT 0xFFC01E30 /* DMA1 Channel 8 Current Inner Loop Count */
470#define DMA1_8_CURR_Y_COUNT 0xFFC01E38 /* DMA1 Channel 8 Current Outer Loop Count */
471#define DMA1_8_IRQ_STATUS 0xFFC01E28 /* DMA1 Channel 8 Interrupt/Status Register */
472#define DMA1_8_PERIPHERAL_MAP 0xFFC01E2C /* DMA1 Channel 8 Peripheral Map Register */
473
474#define DMA1_9_CONFIG 0xFFC01E48 /* DMA1 Channel 9 Configuration register */
475#define DMA1_9_NEXT_DESC_PTR 0xFFC01E40 /* DMA1 Channel 9 Next Descripter Ptr Reg */
476#define DMA1_9_START_ADDR 0xFFC01E44 /* DMA1 Channel 9 Start Address */
477#define DMA1_9_X_COUNT 0xFFC01E50 /* DMA1 Channel 9 Inner Loop Count */
478#define DMA1_9_Y_COUNT 0xFFC01E58 /* DMA1 Channel 9 Outer Loop Count */
479#define DMA1_9_X_MODIFY 0xFFC01E54 /* DMA1 Channel 9 Inner Loop Addr Increment */
480#define DMA1_9_Y_MODIFY 0xFFC01E5C /* DMA1 Channel 9 Outer Loop Addr Increment */
481#define DMA1_9_CURR_DESC_PTR 0xFFC01E60 /* DMA1 Channel 9 Current Descriptor Pointer */
482#define DMA1_9_CURR_ADDR 0xFFC01E64 /* DMA1 Channel 9 Current Address Pointer */
483#define DMA1_9_CURR_X_COUNT 0xFFC01E70 /* DMA1 Channel 9 Current Inner Loop Count */
484#define DMA1_9_CURR_Y_COUNT 0xFFC01E78 /* DMA1 Channel 9 Current Outer Loop Count */
485#define DMA1_9_IRQ_STATUS 0xFFC01E68 /* DMA1 Channel 9 Interrupt/Status Register */
486#define DMA1_9_PERIPHERAL_MAP 0xFFC01E6C /* DMA1 Channel 9 Peripheral Map Register */
487
488#define DMA1_10_CONFIG 0xFFC01E88 /* DMA1 Channel 10 Configuration register */
489#define DMA1_10_NEXT_DESC_PTR 0xFFC01E80 /* DMA1 Channel 10 Next Descripter Ptr Reg */
490#define DMA1_10_START_ADDR 0xFFC01E84 /* DMA1 Channel 10 Start Address */
491#define DMA1_10_X_COUNT 0xFFC01E90 /* DMA1 Channel 10 Inner Loop Count */
492#define DMA1_10_Y_COUNT 0xFFC01E98 /* DMA1 Channel 10 Outer Loop Count */
493#define DMA1_10_X_MODIFY 0xFFC01E94 /* DMA1 Channel 10 Inner Loop Addr Increment */
494#define DMA1_10_Y_MODIFY 0xFFC01E9C /* DMA1 Channel 10 Outer Loop Addr Increment */
495#define DMA1_10_CURR_DESC_PTR 0xFFC01EA0 /* DMA1 Channel 10 Current Descriptor Pointer */
496#define DMA1_10_CURR_ADDR 0xFFC01EA4 /* DMA1 Channel 10 Current Address Pointer */
497#define DMA1_10_CURR_X_COUNT 0xFFC01EB0 /* DMA1 Channel 10 Current Inner Loop Count */
498#define DMA1_10_CURR_Y_COUNT 0xFFC01EB8 /* DMA1 Channel 10 Current Outer Loop Count */
499#define DMA1_10_IRQ_STATUS 0xFFC01EA8 /* DMA1 Channel 10 Interrupt/Status Register */
500#define DMA1_10_PERIPHERAL_MAP 0xFFC01EAC /* DMA1 Channel 10 Peripheral Map Register */
501
502#define DMA1_11_CONFIG 0xFFC01EC8 /* DMA1 Channel 11 Configuration register */
503#define DMA1_11_NEXT_DESC_PTR 0xFFC01EC0 /* DMA1 Channel 11 Next Descripter Ptr Reg */
504#define DMA1_11_START_ADDR 0xFFC01EC4 /* DMA1 Channel 11 Start Address */
505#define DMA1_11_X_COUNT 0xFFC01ED0 /* DMA1 Channel 11 Inner Loop Count */
506#define DMA1_11_Y_COUNT 0xFFC01ED8 /* DMA1 Channel 11 Outer Loop Count */
507#define DMA1_11_X_MODIFY 0xFFC01ED4 /* DMA1 Channel 11 Inner Loop Addr Increment */
508#define DMA1_11_Y_MODIFY 0xFFC01EDC /* DMA1 Channel 11 Outer Loop Addr Increment */
509#define DMA1_11_CURR_DESC_PTR 0xFFC01EE0 /* DMA1 Channel 11 Current Descriptor Pointer */
510#define DMA1_11_CURR_ADDR 0xFFC01EE4 /* DMA1 Channel 11 Current Address Pointer */
511#define DMA1_11_CURR_X_COUNT 0xFFC01EF0 /* DMA1 Channel 11 Current Inner Loop Count */
512#define DMA1_11_CURR_Y_COUNT 0xFFC01EF8 /* DMA1 Channel 11 Current Outer Loop Count */
513#define DMA1_11_IRQ_STATUS 0xFFC01EE8 /* DMA1 Channel 11 Interrupt/Status Register */
514#define DMA1_11_PERIPHERAL_MAP 0xFFC01EEC /* DMA1 Channel 11 Peripheral Map Register */
515
516/* Memory DMA1 Controller registers (0xFFC0 1E80-0xFFC0 1FFF) */
517#define MDMA1_D0_CONFIG 0xFFC01F08 /*MemDMA1 Stream 0 Destination Configuration */
518#define MDMA1_D0_NEXT_DESC_PTR 0xFFC01F00 /*MemDMA1 Stream 0 Destination Next Descriptor Ptr Reg */
519#define MDMA1_D0_START_ADDR 0xFFC01F04 /*MemDMA1 Stream 0 Destination Start Address */
520#define MDMA1_D0_X_COUNT 0xFFC01F10 /*MemDMA1 Stream 0 Destination Inner-Loop Count */
521#define MDMA1_D0_Y_COUNT 0xFFC01F18 /*MemDMA1 Stream 0 Destination Outer-Loop Count */
522#define MDMA1_D0_X_MODIFY 0xFFC01F14 /*MemDMA1 Stream 0 Dest Inner-Loop Address-Increment */
523#define MDMA1_D0_Y_MODIFY 0xFFC01F1C /*MemDMA1 Stream 0 Dest Outer-Loop Address-Increment */
524#define MDMA1_D0_CURR_DESC_PTR 0xFFC01F20 /*MemDMA1 Stream 0 Dest Current Descriptor Ptr reg */
525#define MDMA1_D0_CURR_ADDR 0xFFC01F24 /*MemDMA1 Stream 0 Destination Current Address */
526#define MDMA1_D0_CURR_X_COUNT 0xFFC01F30 /*MemDMA1 Stream 0 Dest Current Inner-Loop Count */
527#define MDMA1_D0_CURR_Y_COUNT 0xFFC01F38 /*MemDMA1 Stream 0 Dest Current Outer-Loop Count */
528#define MDMA1_D0_IRQ_STATUS 0xFFC01F28 /*MemDMA1 Stream 0 Destination Interrupt/Status */
529#define MDMA1_D0_PERIPHERAL_MAP 0xFFC01F2C /*MemDMA1 Stream 0 Destination Peripheral Map */
530
531#define MDMA1_S0_CONFIG 0xFFC01F48 /*MemDMA1 Stream 0 Source Configuration */
532#define MDMA1_S0_NEXT_DESC_PTR 0xFFC01F40 /*MemDMA1 Stream 0 Source Next Descriptor Ptr Reg */
533#define MDMA1_S0_START_ADDR 0xFFC01F44 /*MemDMA1 Stream 0 Source Start Address */
534#define MDMA1_S0_X_COUNT 0xFFC01F50 /*MemDMA1 Stream 0 Source Inner-Loop Count */
535#define MDMA1_S0_Y_COUNT 0xFFC01F58 /*MemDMA1 Stream 0 Source Outer-Loop Count */
536#define MDMA1_S0_X_MODIFY 0xFFC01F54 /*MemDMA1 Stream 0 Source Inner-Loop Address-Increment */
537#define MDMA1_S0_Y_MODIFY 0xFFC01F5C /*MemDMA1 Stream 0 Source Outer-Loop Address-Increment */
538#define MDMA1_S0_CURR_DESC_PTR 0xFFC01F60 /*MemDMA1 Stream 0 Source Current Descriptor Ptr reg */
539#define MDMA1_S0_CURR_ADDR 0xFFC01F64 /*MemDMA1 Stream 0 Source Current Address */
540#define MDMA1_S0_CURR_X_COUNT 0xFFC01F70 /*MemDMA1 Stream 0 Source Current Inner-Loop Count */
541#define MDMA1_S0_CURR_Y_COUNT 0xFFC01F78 /*MemDMA1 Stream 0 Source Current Outer-Loop Count */
542#define MDMA1_S0_IRQ_STATUS 0xFFC01F68 /*MemDMA1 Stream 0 Source Interrupt/Status */
543#define MDMA1_S0_PERIPHERAL_MAP 0xFFC01F6C /*MemDMA1 Stream 0 Source Peripheral Map */
544
545#define MDMA1_D1_CONFIG 0xFFC01F88 /*MemDMA1 Stream 1 Destination Configuration */
546#define MDMA1_D1_NEXT_DESC_PTR 0xFFC01F80 /*MemDMA1 Stream 1 Destination Next Descriptor Ptr Reg */
547#define MDMA1_D1_START_ADDR 0xFFC01F84 /*MemDMA1 Stream 1 Destination Start Address */
548#define MDMA1_D1_X_COUNT 0xFFC01F90 /*MemDMA1 Stream 1 Destination Inner-Loop Count */
549#define MDMA1_D1_Y_COUNT 0xFFC01F98 /*MemDMA1 Stream 1 Destination Outer-Loop Count */
550#define MDMA1_D1_X_MODIFY 0xFFC01F94 /*MemDMA1 Stream 1 Dest Inner-Loop Address-Increment */
551#define MDMA1_D1_Y_MODIFY 0xFFC01F9C /*MemDMA1 Stream 1 Dest Outer-Loop Address-Increment */
552#define MDMA1_D1_CURR_DESC_PTR 0xFFC01FA0 /*MemDMA1 Stream 1 Dest Current Descriptor Ptr reg */
553#define MDMA1_D1_CURR_ADDR 0xFFC01FA4 /*MemDMA1 Stream 1 Dest Current Address */
554#define MDMA1_D1_CURR_X_COUNT 0xFFC01FB0 /*MemDMA1 Stream 1 Dest Current Inner-Loop Count */
555#define MDMA1_D1_CURR_Y_COUNT 0xFFC01FB8 /*MemDMA1 Stream 1 Dest Current Outer-Loop Count */
556#define MDMA1_D1_IRQ_STATUS 0xFFC01FA8 /*MemDMA1 Stream 1 Dest Interrupt/Status */
557#define MDMA1_D1_PERIPHERAL_MAP 0xFFC01FAC /*MemDMA1 Stream 1 Dest Peripheral Map */
558
559#define MDMA1_S1_CONFIG 0xFFC01FC8 /*MemDMA1 Stream 1 Source Configuration */
560#define MDMA1_S1_NEXT_DESC_PTR 0xFFC01FC0 /*MemDMA1 Stream 1 Source Next Descriptor Ptr Reg */
561#define MDMA1_S1_START_ADDR 0xFFC01FC4 /*MemDMA1 Stream 1 Source Start Address */
562#define MDMA1_S1_X_COUNT 0xFFC01FD0 /*MemDMA1 Stream 1 Source Inner-Loop Count */
563#define MDMA1_S1_Y_COUNT 0xFFC01FD8 /*MemDMA1 Stream 1 Source Outer-Loop Count */
564#define MDMA1_S1_X_MODIFY 0xFFC01FD4 /*MemDMA1 Stream 1 Source Inner-Loop Address-Increment */
565#define MDMA1_S1_Y_MODIFY 0xFFC01FDC /*MemDMA1 Stream 1 Source Outer-Loop Address-Increment */
566#define MDMA1_S1_CURR_DESC_PTR 0xFFC01FE0 /*MemDMA1 Stream 1 Source Current Descriptor Ptr reg */
567#define MDMA1_S1_CURR_ADDR 0xFFC01FE4 /*MemDMA1 Stream 1 Source Current Address */
568#define MDMA1_S1_CURR_X_COUNT 0xFFC01FF0 /*MemDMA1 Stream 1 Source Current Inner-Loop Count */
569#define MDMA1_S1_CURR_Y_COUNT 0xFFC01FF8 /*MemDMA1 Stream 1 Source Current Outer-Loop Count */
570#define MDMA1_S1_IRQ_STATUS 0xFFC01FE8 /*MemDMA1 Stream 1 Source Interrupt/Status */
571#define MDMA1_S1_PERIPHERAL_MAP 0xFFC01FEC /*MemDMA1 Stream 1 Source Peripheral Map */
572
573/* DMA2 Controller registers (0xFFC0 0C00-0xFFC0 0DFF) */
574#define DMA2_0_CONFIG 0xFFC00C08 /* DMA2 Channel 0 Configuration register */
575#define DMA2_0_NEXT_DESC_PTR 0xFFC00C00 /* DMA2 Channel 0 Next Descripter Ptr Reg */
576#define DMA2_0_START_ADDR 0xFFC00C04 /* DMA2 Channel 0 Start Address */
577#define DMA2_0_X_COUNT 0xFFC00C10 /* DMA2 Channel 0 Inner Loop Count */
578#define DMA2_0_Y_COUNT 0xFFC00C18 /* DMA2 Channel 0 Outer Loop Count */
579#define DMA2_0_X_MODIFY 0xFFC00C14 /* DMA2 Channel 0 Inner Loop Addr Increment */
580#define DMA2_0_Y_MODIFY 0xFFC00C1C /* DMA2 Channel 0 Outer Loop Addr Increment */
581#define DMA2_0_CURR_DESC_PTR 0xFFC00C20 /* DMA2 Channel 0 Current Descriptor Pointer */
582#define DMA2_0_CURR_ADDR 0xFFC00C24 /* DMA2 Channel 0 Current Address Pointer */
583#define DMA2_0_CURR_X_COUNT 0xFFC00C30 /* DMA2 Channel 0 Current Inner Loop Count */
584#define DMA2_0_CURR_Y_COUNT 0xFFC00C38 /* DMA2 Channel 0 Current Outer Loop Count */
585#define DMA2_0_IRQ_STATUS 0xFFC00C28 /* DMA2 Channel 0 Interrupt/Status Register */
586#define DMA2_0_PERIPHERAL_MAP 0xFFC00C2C /* DMA2 Channel 0 Peripheral Map Register */
587
588#define DMA2_1_CONFIG 0xFFC00C48 /* DMA2 Channel 1 Configuration register */
589#define DMA2_1_NEXT_DESC_PTR 0xFFC00C40 /* DMA2 Channel 1 Next Descripter Ptr Reg */
590#define DMA2_1_START_ADDR 0xFFC00C44 /* DMA2 Channel 1 Start Address */
591#define DMA2_1_X_COUNT 0xFFC00C50 /* DMA2 Channel 1 Inner Loop Count */
592#define DMA2_1_Y_COUNT 0xFFC00C58 /* DMA2 Channel 1 Outer Loop Count */
593#define DMA2_1_X_MODIFY 0xFFC00C54 /* DMA2 Channel 1 Inner Loop Addr Increment */
594#define DMA2_1_Y_MODIFY 0xFFC00C5C /* DMA2 Channel 1 Outer Loop Addr Increment */
595#define DMA2_1_CURR_DESC_PTR 0xFFC00C60 /* DMA2 Channel 1 Current Descriptor Pointer */
596#define DMA2_1_CURR_ADDR 0xFFC00C64 /* DMA2 Channel 1 Current Address Pointer */
597#define DMA2_1_CURR_X_COUNT 0xFFC00C70 /* DMA2 Channel 1 Current Inner Loop Count */
598#define DMA2_1_CURR_Y_COUNT 0xFFC00C78 /* DMA2 Channel 1 Current Outer Loop Count */
599#define DMA2_1_IRQ_STATUS 0xFFC00C68 /* DMA2 Channel 1 Interrupt/Status Register */
600#define DMA2_1_PERIPHERAL_MAP 0xFFC00C6C /* DMA2 Channel 1 Peripheral Map Register */
601
602#define DMA2_2_CONFIG 0xFFC00C88 /* DMA2 Channel 2 Configuration register */
603#define DMA2_2_NEXT_DESC_PTR 0xFFC00C80 /* DMA2 Channel 2 Next Descripter Ptr Reg */
604#define DMA2_2_START_ADDR 0xFFC00C84 /* DMA2 Channel 2 Start Address */
605#define DMA2_2_X_COUNT 0xFFC00C90 /* DMA2 Channel 2 Inner Loop Count */
606#define DMA2_2_Y_COUNT 0xFFC00C98 /* DMA2 Channel 2 Outer Loop Count */
607#define DMA2_2_X_MODIFY 0xFFC00C94 /* DMA2 Channel 2 Inner Loop Addr Increment */
608#define DMA2_2_Y_MODIFY 0xFFC00C9C /* DMA2 Channel 2 Outer Loop Addr Increment */
609#define DMA2_2_CURR_DESC_PTR 0xFFC00CA0 /* DMA2 Channel 2 Current Descriptor Pointer */
610#define DMA2_2_CURR_ADDR 0xFFC00CA4 /* DMA2 Channel 2 Current Address Pointer */
611#define DMA2_2_CURR_X_COUNT 0xFFC00CB0 /* DMA2 Channel 2 Current Inner Loop Count */
612#define DMA2_2_CURR_Y_COUNT 0xFFC00CB8 /* DMA2 Channel 2 Current Outer Loop Count */
613#define DMA2_2_IRQ_STATUS 0xFFC00CA8 /* DMA2 Channel 2 Interrupt/Status Register */
614#define DMA2_2_PERIPHERAL_MAP 0xFFC00CAC /* DMA2 Channel 2 Peripheral Map Register */
615
616#define DMA2_3_CONFIG 0xFFC00CC8 /* DMA2 Channel 3 Configuration register */
617#define DMA2_3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA2 Channel 3 Next Descripter Ptr Reg */
618#define DMA2_3_START_ADDR 0xFFC00CC4 /* DMA2 Channel 3 Start Address */
619#define DMA2_3_X_COUNT 0xFFC00CD0 /* DMA2 Channel 3 Inner Loop Count */
620#define DMA2_3_Y_COUNT 0xFFC00CD8 /* DMA2 Channel 3 Outer Loop Count */
621#define DMA2_3_X_MODIFY 0xFFC00CD4 /* DMA2 Channel 3 Inner Loop Addr Increment */
622#define DMA2_3_Y_MODIFY 0xFFC00CDC /* DMA2 Channel 3 Outer Loop Addr Increment */
623#define DMA2_3_CURR_DESC_PTR 0xFFC00CE0 /* DMA2 Channel 3 Current Descriptor Pointer */
624#define DMA2_3_CURR_ADDR 0xFFC00CE4 /* DMA2 Channel 3 Current Address Pointer */
625#define DMA2_3_CURR_X_COUNT 0xFFC00CF0 /* DMA2 Channel 3 Current Inner Loop Count */
626#define DMA2_3_CURR_Y_COUNT 0xFFC00CF8 /* DMA2 Channel 3 Current Outer Loop Count */
627#define DMA2_3_IRQ_STATUS 0xFFC00CE8 /* DMA2 Channel 3 Interrupt/Status Register */
628#define DMA2_3_PERIPHERAL_MAP 0xFFC00CEC /* DMA2 Channel 3 Peripheral Map Register */
629
630#define DMA2_4_CONFIG 0xFFC00D08 /* DMA2 Channel 4 Configuration register */
631#define DMA2_4_NEXT_DESC_PTR 0xFFC00D00 /* DMA2 Channel 4 Next Descripter Ptr Reg */
632#define DMA2_4_START_ADDR 0xFFC00D04 /* DMA2 Channel 4 Start Address */
633#define DMA2_4_X_COUNT 0xFFC00D10 /* DMA2 Channel 4 Inner Loop Count */
634#define DMA2_4_Y_COUNT 0xFFC00D18 /* DMA2 Channel 4 Outer Loop Count */
635#define DMA2_4_X_MODIFY 0xFFC00D14 /* DMA2 Channel 4 Inner Loop Addr Increment */
636#define DMA2_4_Y_MODIFY 0xFFC00D1C /* DMA2 Channel 4 Outer Loop Addr Increment */
637#define DMA2_4_CURR_DESC_PTR 0xFFC00D20 /* DMA2 Channel 4 Current Descriptor Pointer */
638#define DMA2_4_CURR_ADDR 0xFFC00D24 /* DMA2 Channel 4 Current Address Pointer */
639#define DMA2_4_CURR_X_COUNT 0xFFC00D30 /* DMA2 Channel 4 Current Inner Loop Count */
640#define DMA2_4_CURR_Y_COUNT 0xFFC00D38 /* DMA2 Channel 4 Current Outer Loop Count */
641#define DMA2_4_IRQ_STATUS 0xFFC00D28 /* DMA2 Channel 4 Interrupt/Status Register */
642#define DMA2_4_PERIPHERAL_MAP 0xFFC00D2C /* DMA2 Channel 4 Peripheral Map Register */
643
644#define DMA2_5_CONFIG 0xFFC00D48 /* DMA2 Channel 5 Configuration register */
645#define DMA2_5_NEXT_DESC_PTR 0xFFC00D40 /* DMA2 Channel 5 Next Descripter Ptr Reg */
646#define DMA2_5_START_ADDR 0xFFC00D44 /* DMA2 Channel 5 Start Address */
647#define DMA2_5_X_COUNT 0xFFC00D50 /* DMA2 Channel 5 Inner Loop Count */
648#define DMA2_5_Y_COUNT 0xFFC00D58 /* DMA2 Channel 5 Outer Loop Count */
649#define DMA2_5_X_MODIFY 0xFFC00D54 /* DMA2 Channel 5 Inner Loop Addr Increment */
650#define DMA2_5_Y_MODIFY 0xFFC00D5C /* DMA2 Channel 5 Outer Loop Addr Increment */
651#define DMA2_5_CURR_DESC_PTR 0xFFC00D60 /* DMA2 Channel 5 Current Descriptor Pointer */
652#define DMA2_5_CURR_ADDR 0xFFC00D64 /* DMA2 Channel 5 Current Address Pointer */
653#define DMA2_5_CURR_X_COUNT 0xFFC00D70 /* DMA2 Channel 5 Current Inner Loop Count */
654#define DMA2_5_CURR_Y_COUNT 0xFFC00D78 /* DMA2 Channel 5 Current Outer Loop Count */
655#define DMA2_5_IRQ_STATUS 0xFFC00D68 /* DMA2 Channel 5 Interrupt/Status Register */
656#define DMA2_5_PERIPHERAL_MAP 0xFFC00D6C /* DMA2 Channel 5 Peripheral Map Register */
657
658#define DMA2_6_CONFIG 0xFFC00D88 /* DMA2 Channel 6 Configuration register */
659#define DMA2_6_NEXT_DESC_PTR 0xFFC00D80 /* DMA2 Channel 6 Next Descripter Ptr Reg */
660#define DMA2_6_START_ADDR 0xFFC00D84 /* DMA2 Channel 6 Start Address */
661#define DMA2_6_X_COUNT 0xFFC00D90 /* DMA2 Channel 6 Inner Loop Count */
662#define DMA2_6_Y_COUNT 0xFFC00D98 /* DMA2 Channel 6 Outer Loop Count */
663#define DMA2_6_X_MODIFY 0xFFC00D94 /* DMA2 Channel 6 Inner Loop Addr Increment */
664#define DMA2_6_Y_MODIFY 0xFFC00D9C /* DMA2 Channel 6 Outer Loop Addr Increment */
665#define DMA2_6_CURR_DESC_PTR 0xFFC00DA0 /* DMA2 Channel 6 Current Descriptor Pointer */
666#define DMA2_6_CURR_ADDR 0xFFC00DA4 /* DMA2 Channel 6 Current Address Pointer */
667#define DMA2_6_CURR_X_COUNT 0xFFC00DB0 /* DMA2 Channel 6 Current Inner Loop Count */
668#define DMA2_6_CURR_Y_COUNT 0xFFC00DB8 /* DMA2 Channel 6 Current Outer Loop Count */
669#define DMA2_6_IRQ_STATUS 0xFFC00DA8 /* DMA2 Channel 6 Interrupt/Status Register */
670#define DMA2_6_PERIPHERAL_MAP 0xFFC00DAC /* DMA2 Channel 6 Peripheral Map Register */
671
672#define DMA2_7_CONFIG 0xFFC00DC8 /* DMA2 Channel 7 Configuration register */
673#define DMA2_7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA2 Channel 7 Next Descripter Ptr Reg */
674#define DMA2_7_START_ADDR 0xFFC00DC4 /* DMA2 Channel 7 Start Address */
675#define DMA2_7_X_COUNT 0xFFC00DD0 /* DMA2 Channel 7 Inner Loop Count */
676#define DMA2_7_Y_COUNT 0xFFC00DD8 /* DMA2 Channel 7 Outer Loop Count */
677#define DMA2_7_X_MODIFY 0xFFC00DD4 /* DMA2 Channel 7 Inner Loop Addr Increment */
678#define DMA2_7_Y_MODIFY 0xFFC00DDC /* DMA2 Channel 7 Outer Loop Addr Increment */
679#define DMA2_7_CURR_DESC_PTR 0xFFC00DE0 /* DMA2 Channel 7 Current Descriptor Pointer */
680#define DMA2_7_CURR_ADDR 0xFFC00DE4 /* DMA2 Channel 7 Current Address Pointer */
681#define DMA2_7_CURR_X_COUNT 0xFFC00DF0 /* DMA2 Channel 7 Current Inner Loop Count */
682#define DMA2_7_CURR_Y_COUNT 0xFFC00DF8 /* DMA2 Channel 7 Current Outer Loop Count */
683#define DMA2_7_IRQ_STATUS 0xFFC00DE8 /* DMA2 Channel 7 Interrupt/Status Register */
684#define DMA2_7_PERIPHERAL_MAP 0xFFC00DEC /* DMA2 Channel 7 Peripheral Map Register */
685
686#define DMA2_8_CONFIG 0xFFC00E08 /* DMA2 Channel 8 Configuration register */
687#define DMA2_8_NEXT_DESC_PTR 0xFFC00E00 /* DMA2 Channel 8 Next Descripter Ptr Reg */
688#define DMA2_8_START_ADDR 0xFFC00E04 /* DMA2 Channel 8 Start Address */
689#define DMA2_8_X_COUNT 0xFFC00E10 /* DMA2 Channel 8 Inner Loop Count */
690#define DMA2_8_Y_COUNT 0xFFC00E18 /* DMA2 Channel 8 Outer Loop Count */
691#define DMA2_8_X_MODIFY 0xFFC00E14 /* DMA2 Channel 8 Inner Loop Addr Increment */
692#define DMA2_8_Y_MODIFY 0xFFC00E1C /* DMA2 Channel 8 Outer Loop Addr Increment */
693#define DMA2_8_CURR_DESC_PTR 0xFFC00E20 /* DMA2 Channel 8 Current Descriptor Pointer */
694#define DMA2_8_CURR_ADDR 0xFFC00E24 /* DMA2 Channel 8 Current Address Pointer */
695#define DMA2_8_CURR_X_COUNT 0xFFC00E30 /* DMA2 Channel 8 Current Inner Loop Count */
696#define DMA2_8_CURR_Y_COUNT 0xFFC00E38 /* DMA2 Channel 8 Current Outer Loop Count */
697#define DMA2_8_IRQ_STATUS 0xFFC00E28 /* DMA2 Channel 8 Interrupt/Status Register */
698#define DMA2_8_PERIPHERAL_MAP 0xFFC00E2C /* DMA2 Channel 8 Peripheral Map Register */
699
700#define DMA2_9_CONFIG 0xFFC00E48 /* DMA2 Channel 9 Configuration register */
701#define DMA2_9_NEXT_DESC_PTR 0xFFC00E40 /* DMA2 Channel 9 Next Descripter Ptr Reg */
702#define DMA2_9_START_ADDR 0xFFC00E44 /* DMA2 Channel 9 Start Address */
703#define DMA2_9_X_COUNT 0xFFC00E50 /* DMA2 Channel 9 Inner Loop Count */
704#define DMA2_9_Y_COUNT 0xFFC00E58 /* DMA2 Channel 9 Outer Loop Count */
705#define DMA2_9_X_MODIFY 0xFFC00E54 /* DMA2 Channel 9 Inner Loop Addr Increment */
706#define DMA2_9_Y_MODIFY 0xFFC00E5C /* DMA2 Channel 9 Outer Loop Addr Increment */
707#define DMA2_9_CURR_DESC_PTR 0xFFC00E60 /* DMA2 Channel 9 Current Descriptor Pointer */
708#define DMA2_9_CURR_ADDR 0xFFC00E64 /* DMA2 Channel 9 Current Address Pointer */
709#define DMA2_9_CURR_X_COUNT 0xFFC00E70 /* DMA2 Channel 9 Current Inner Loop Count */
710#define DMA2_9_CURR_Y_COUNT 0xFFC00E78 /* DMA2 Channel 9 Current Outer Loop Count */
711#define DMA2_9_IRQ_STATUS 0xFFC00E68 /* DMA2 Channel 9 Interrupt/Status Register */
712#define DMA2_9_PERIPHERAL_MAP 0xFFC00E6C /* DMA2 Channel 9 Peripheral Map Register */
713
714#define DMA2_10_CONFIG 0xFFC00E88 /* DMA2 Channel 10 Configuration register */
715#define DMA2_10_NEXT_DESC_PTR 0xFFC00E80 /* DMA2 Channel 10 Next Descripter Ptr Reg */
716#define DMA2_10_START_ADDR 0xFFC00E84 /* DMA2 Channel 10 Start Address */
717#define DMA2_10_X_COUNT 0xFFC00E90 /* DMA2 Channel 10 Inner Loop Count */
718#define DMA2_10_Y_COUNT 0xFFC00E98 /* DMA2 Channel 10 Outer Loop Count */
719#define DMA2_10_X_MODIFY 0xFFC00E94 /* DMA2 Channel 10 Inner Loop Addr Increment */
720#define DMA2_10_Y_MODIFY 0xFFC00E9C /* DMA2 Channel 10 Outer Loop Addr Increment */
721#define DMA2_10_CURR_DESC_PTR 0xFFC00EA0 /* DMA2 Channel 10 Current Descriptor Pointer */
722#define DMA2_10_CURR_ADDR 0xFFC00EA4 /* DMA2 Channel 10 Current Address Pointer */
723#define DMA2_10_CURR_X_COUNT 0xFFC00EB0 /* DMA2 Channel 10 Current Inner Loop Count */
724#define DMA2_10_CURR_Y_COUNT 0xFFC00EB8 /* DMA2 Channel 10 Current Outer Loop Count */
725#define DMA2_10_IRQ_STATUS 0xFFC00EA8 /* DMA2 Channel 10 Interrupt/Status Register */
726#define DMA2_10_PERIPHERAL_MAP 0xFFC00EAC /* DMA2 Channel 10 Peripheral Map Register */
727
728#define DMA2_11_CONFIG 0xFFC00EC8 /* DMA2 Channel 11 Configuration register */
729#define DMA2_11_NEXT_DESC_PTR 0xFFC00EC0 /* DMA2 Channel 11 Next Descripter Ptr Reg */
730#define DMA2_11_START_ADDR 0xFFC00EC4 /* DMA2 Channel 11 Start Address */
731#define DMA2_11_X_COUNT 0xFFC00ED0 /* DMA2 Channel 11 Inner Loop Count */
732#define DMA2_11_Y_COUNT 0xFFC00ED8 /* DMA2 Channel 11 Outer Loop Count */
733#define DMA2_11_X_MODIFY 0xFFC00ED4 /* DMA2 Channel 11 Inner Loop Addr Increment */
734#define DMA2_11_Y_MODIFY 0xFFC00EDC /* DMA2 Channel 11 Outer Loop Addr Increment */
735#define DMA2_11_CURR_DESC_PTR 0xFFC00EE0 /* DMA2 Channel 11 Current Descriptor Pointer */
736#define DMA2_11_CURR_ADDR 0xFFC00EE4 /* DMA2 Channel 11 Current Address Pointer */
737#define DMA2_11_CURR_X_COUNT 0xFFC00EF0 /* DMA2 Channel 11 Current Inner Loop Count */
738#define DMA2_11_CURR_Y_COUNT 0xFFC00EF8 /* DMA2 Channel 11 Current Outer Loop Count */
739#define DMA2_11_IRQ_STATUS 0xFFC00EE8 /* DMA2 Channel 11 Interrupt/Status Register */
740#define DMA2_11_PERIPHERAL_MAP 0xFFC00EEC /* DMA2 Channel 11 Peripheral Map Register */
741
742/* Memory DMA2 Controller registers (0xFFC0 0E80-0xFFC0 0FFF) */
743#define MDMA2_D0_CONFIG 0xFFC00F08 /*MemDMA2 Stream 0 Destination Configuration register */
744#define MDMA2_D0_NEXT_DESC_PTR 0xFFC00F00 /*MemDMA2 Stream 0 Destination Next Descriptor Ptr Reg */
745#define MDMA2_D0_START_ADDR 0xFFC00F04 /*MemDMA2 Stream 0 Destination Start Address */
746#define MDMA2_D0_X_COUNT 0xFFC00F10 /*MemDMA2 Stream 0 Dest Inner-Loop Count register */
747#define MDMA2_D0_Y_COUNT 0xFFC00F18 /*MemDMA2 Stream 0 Dest Outer-Loop Count register */
748#define MDMA2_D0_X_MODIFY 0xFFC00F14 /*MemDMA2 Stream 0 Dest Inner-Loop Address-Increment */
749#define MDMA2_D0_Y_MODIFY 0xFFC00F1C /*MemDMA2 Stream 0 Dest Outer-Loop Address-Increment */
750#define MDMA2_D0_CURR_DESC_PTR 0xFFC00F20 /*MemDMA2 Stream 0 Dest Current Descriptor Ptr reg */
751#define MDMA2_D0_CURR_ADDR 0xFFC00F24 /*MemDMA2 Stream 0 Destination Current Address */
752#define MDMA2_D0_CURR_X_COUNT 0xFFC00F30 /*MemDMA2 Stream 0 Dest Current Inner-Loop Count reg */
753#define MDMA2_D0_CURR_Y_COUNT 0xFFC00F38 /*MemDMA2 Stream 0 Dest Current Outer-Loop Count reg */
754#define MDMA2_D0_IRQ_STATUS 0xFFC00F28 /*MemDMA2 Stream 0 Dest Interrupt/Status Register */
755#define MDMA2_D0_PERIPHERAL_MAP 0xFFC00F2C /*MemDMA2 Stream 0 Destination Peripheral Map register */
756
757#define MDMA2_S0_CONFIG 0xFFC00F48 /*MemDMA2 Stream 0 Source Configuration register */
758#define MDMA2_S0_NEXT_DESC_PTR 0xFFC00F40 /*MemDMA2 Stream 0 Source Next Descriptor Ptr Reg */
759#define MDMA2_S0_START_ADDR 0xFFC00F44 /*MemDMA2 Stream 0 Source Start Address */
760#define MDMA2_S0_X_COUNT 0xFFC00F50 /*MemDMA2 Stream 0 Source Inner-Loop Count register */
761#define MDMA2_S0_Y_COUNT 0xFFC00F58 /*MemDMA2 Stream 0 Source Outer-Loop Count register */
762#define MDMA2_S0_X_MODIFY 0xFFC00F54 /*MemDMA2 Stream 0 Src Inner-Loop Addr-Increment reg */
763#define MDMA2_S0_Y_MODIFY 0xFFC00F5C /*MemDMA2 Stream 0 Src Outer-Loop Addr-Increment reg */
764#define MDMA2_S0_CURR_DESC_PTR 0xFFC00F60 /*MemDMA2 Stream 0 Source Current Descriptor Ptr reg */
765#define MDMA2_S0_CURR_ADDR 0xFFC00F64 /*MemDMA2 Stream 0 Source Current Address */
766#define MDMA2_S0_CURR_X_COUNT 0xFFC00F70 /*MemDMA2 Stream 0 Src Current Inner-Loop Count reg */
767#define MDMA2_S0_CURR_Y_COUNT 0xFFC00F78 /*MemDMA2 Stream 0 Src Current Outer-Loop Count reg */
768#define MDMA2_S0_IRQ_STATUS 0xFFC00F68 /*MemDMA2 Stream 0 Source Interrupt/Status Register */
769#define MDMA2_S0_PERIPHERAL_MAP 0xFFC00F6C /*MemDMA2 Stream 0 Source Peripheral Map register */
770
771#define MDMA2_D1_CONFIG 0xFFC00F88 /*MemDMA2 Stream 1 Destination Configuration register */
772#define MDMA2_D1_NEXT_DESC_PTR 0xFFC00F80 /*MemDMA2 Stream 1 Destination Next Descriptor Ptr Reg */
773#define MDMA2_D1_START_ADDR 0xFFC00F84 /*MemDMA2 Stream 1 Destination Start Address */
774#define MDMA2_D1_X_COUNT 0xFFC00F90 /*MemDMA2 Stream 1 Dest Inner-Loop Count register */
775#define MDMA2_D1_Y_COUNT 0xFFC00F98 /*MemDMA2 Stream 1 Dest Outer-Loop Count register */
776#define MDMA2_D1_X_MODIFY 0xFFC00F94 /*MemDMA2 Stream 1 Dest Inner-Loop Address-Increment */
777#define MDMA2_D1_Y_MODIFY 0xFFC00F9C /*MemDMA2 Stream 1 Dest Outer-Loop Address-Increment */
778#define MDMA2_D1_CURR_DESC_PTR 0xFFC00FA0 /*MemDMA2 Stream 1 Destination Current Descriptor Ptr */
779#define MDMA2_D1_CURR_ADDR 0xFFC00FA4 /*MemDMA2 Stream 1 Destination Current Address reg */
780#define MDMA2_D1_CURR_X_COUNT 0xFFC00FB0 /*MemDMA2 Stream 1 Dest Current Inner-Loop Count reg */
781#define MDMA2_D1_CURR_Y_COUNT 0xFFC00FB8 /*MemDMA2 Stream 1 Dest Current Outer-Loop Count reg */
782#define MDMA2_D1_IRQ_STATUS 0xFFC00FA8 /*MemDMA2 Stream 1 Destination Interrupt/Status Reg */
783#define MDMA2_D1_PERIPHERAL_MAP 0xFFC00FAC /*MemDMA2 Stream 1 Destination Peripheral Map register */
784
785#define MDMA2_S1_CONFIG 0xFFC00FC8 /*MemDMA2 Stream 1 Source Configuration register */
786#define MDMA2_S1_NEXT_DESC_PTR 0xFFC00FC0 /*MemDMA2 Stream 1 Source Next Descriptor Ptr Reg */
787#define MDMA2_S1_START_ADDR 0xFFC00FC4 /*MemDMA2 Stream 1 Source Start Address */
788#define MDMA2_S1_X_COUNT 0xFFC00FD0 /*MemDMA2 Stream 1 Source Inner-Loop Count register */
789#define MDMA2_S1_Y_COUNT 0xFFC00FD8 /*MemDMA2 Stream 1 Source Outer-Loop Count register */
790#define MDMA2_S1_X_MODIFY 0xFFC00FD4 /*MemDMA2 Stream 1 Src Inner-Loop Address-Increment */
791#define MDMA2_S1_Y_MODIFY 0xFFC00FDC /*MemDMA2 Stream 1 Source Outer-Loop Address-Increment */
792#define MDMA2_S1_CURR_DESC_PTR 0xFFC00FE0 /*MemDMA2 Stream 1 Source Current Descriptor Ptr reg */
793#define MDMA2_S1_CURR_ADDR 0xFFC00FE4 /*MemDMA2 Stream 1 Source Current Address */
794#define MDMA2_S1_CURR_X_COUNT 0xFFC00FF0 /*MemDMA2 Stream 1 Source Current Inner-Loop Count */
795#define MDMA2_S1_CURR_Y_COUNT 0xFFC00FF8 /*MemDMA2 Stream 1 Source Current Outer-Loop Count */
796#define MDMA2_S1_IRQ_STATUS 0xFFC00FE8 /*MemDMA2 Stream 1 Source Interrupt/Status Register */
797#define MDMA2_S1_PERIPHERAL_MAP 0xFFC00FEC /*MemDMA2 Stream 1 Source Peripheral Map register */
798
799/* Internal Memory DMA Registers (0xFFC0_1800 - 0xFFC0_19FF) */
800#define IMDMA_D0_CONFIG 0xFFC01808 /*IMDMA Stream 0 Destination Configuration */
801#define IMDMA_D0_NEXT_DESC_PTR 0xFFC01800 /*IMDMA Stream 0 Destination Next Descriptor Ptr Reg */
802#define IMDMA_D0_START_ADDR 0xFFC01804 /*IMDMA Stream 0 Destination Start Address */
803#define IMDMA_D0_X_COUNT 0xFFC01810 /*IMDMA Stream 0 Destination Inner-Loop Count */
804#define IMDMA_D0_Y_COUNT 0xFFC01818 /*IMDMA Stream 0 Destination Outer-Loop Count */
805#define IMDMA_D0_X_MODIFY 0xFFC01814 /*IMDMA Stream 0 Dest Inner-Loop Address-Increment */
806#define IMDMA_D0_Y_MODIFY 0xFFC0181C /*IMDMA Stream 0 Dest Outer-Loop Address-Increment */
807#define IMDMA_D0_CURR_DESC_PTR 0xFFC01820 /*IMDMA Stream 0 Destination Current Descriptor Ptr */
808#define IMDMA_D0_CURR_ADDR 0xFFC01824 /*IMDMA Stream 0 Destination Current Address */
809#define IMDMA_D0_CURR_X_COUNT 0xFFC01830 /*IMDMA Stream 0 Destination Current Inner-Loop Count */
810#define IMDMA_D0_CURR_Y_COUNT 0xFFC01838 /*IMDMA Stream 0 Destination Current Outer-Loop Count */
811#define IMDMA_D0_IRQ_STATUS 0xFFC01828 /*IMDMA Stream 0 Destination Interrupt/Status */
812
813#define IMDMA_S0_CONFIG 0xFFC01848 /*IMDMA Stream 0 Source Configuration */
814#define IMDMA_S0_NEXT_DESC_PTR 0xFFC01840 /*IMDMA Stream 0 Source Next Descriptor Ptr Reg */
815#define IMDMA_S0_START_ADDR 0xFFC01844 /*IMDMA Stream 0 Source Start Address */
816#define IMDMA_S0_X_COUNT 0xFFC01850 /*IMDMA Stream 0 Source Inner-Loop Count */
817#define IMDMA_S0_Y_COUNT 0xFFC01858 /*IMDMA Stream 0 Source Outer-Loop Count */
818#define IMDMA_S0_X_MODIFY 0xFFC01854 /*IMDMA Stream 0 Source Inner-Loop Address-Increment */
819#define IMDMA_S0_Y_MODIFY 0xFFC0185C /*IMDMA Stream 0 Source Outer-Loop Address-Increment */
820#define IMDMA_S0_CURR_DESC_PTR 0xFFC01860 /*IMDMA Stream 0 Source Current Descriptor Ptr reg */
821#define IMDMA_S0_CURR_ADDR 0xFFC01864 /*IMDMA Stream 0 Source Current Address */
822#define IMDMA_S0_CURR_X_COUNT 0xFFC01870 /*IMDMA Stream 0 Source Current Inner-Loop Count */
823#define IMDMA_S0_CURR_Y_COUNT 0xFFC01878 /*IMDMA Stream 0 Source Current Outer-Loop Count */
824#define IMDMA_S0_IRQ_STATUS 0xFFC01868 /*IMDMA Stream 0 Source Interrupt/Status */
825
826#define IMDMA_D1_CONFIG 0xFFC01888 /*IMDMA Stream 1 Destination Configuration */
827#define IMDMA_D1_NEXT_DESC_PTR 0xFFC01880 /*IMDMA Stream 1 Destination Next Descriptor Ptr Reg */
828#define IMDMA_D1_START_ADDR 0xFFC01884 /*IMDMA Stream 1 Destination Start Address */
829#define IMDMA_D1_X_COUNT 0xFFC01890 /*IMDMA Stream 1 Destination Inner-Loop Count */
830#define IMDMA_D1_Y_COUNT 0xFFC01898 /*IMDMA Stream 1 Destination Outer-Loop Count */
831#define IMDMA_D1_X_MODIFY 0xFFC01894 /*IMDMA Stream 1 Dest Inner-Loop Address-Increment */
832#define IMDMA_D1_Y_MODIFY 0xFFC0189C /*IMDMA Stream 1 Dest Outer-Loop Address-Increment */
833#define IMDMA_D1_CURR_DESC_PTR 0xFFC018A0 /*IMDMA Stream 1 Destination Current Descriptor Ptr */
834#define IMDMA_D1_CURR_ADDR 0xFFC018A4 /*IMDMA Stream 1 Destination Current Address */
835#define IMDMA_D1_CURR_X_COUNT 0xFFC018B0 /*IMDMA Stream 1 Destination Current Inner-Loop Count */
836#define IMDMA_D1_CURR_Y_COUNT 0xFFC018B8 /*IMDMA Stream 1 Destination Current Outer-Loop Count */
837#define IMDMA_D1_IRQ_STATUS 0xFFC018A8 /*IMDMA Stream 1 Destination Interrupt/Status */
838
839#define IMDMA_S1_CONFIG 0xFFC018C8 /*IMDMA Stream 1 Source Configuration */
840#define IMDMA_S1_NEXT_DESC_PTR 0xFFC018C0 /*IMDMA Stream 1 Source Next Descriptor Ptr Reg */
841#define IMDMA_S1_START_ADDR 0xFFC018C4 /*IMDMA Stream 1 Source Start Address */
842#define IMDMA_S1_X_COUNT 0xFFC018D0 /*IMDMA Stream 1 Source Inner-Loop Count */
843#define IMDMA_S1_Y_COUNT 0xFFC018D8 /*IMDMA Stream 1 Source Outer-Loop Count */
844#define IMDMA_S1_X_MODIFY 0xFFC018D4 /*IMDMA Stream 1 Source Inner-Loop Address-Increment */
845#define IMDMA_S1_Y_MODIFY 0xFFC018DC /*IMDMA Stream 1 Source Outer-Loop Address-Increment */
846#define IMDMA_S1_CURR_DESC_PTR 0xFFC018E0 /*IMDMA Stream 1 Source Current Descriptor Ptr reg */
847#define IMDMA_S1_CURR_ADDR 0xFFC018E4 /*IMDMA Stream 1 Source Current Address */
848#define IMDMA_S1_CURR_X_COUNT 0xFFC018F0 /*IMDMA Stream 1 Source Current Inner-Loop Count */
849#define IMDMA_S1_CURR_Y_COUNT 0xFFC018F8 /*IMDMA Stream 1 Source Current Outer-Loop Count */
850#define IMDMA_S1_IRQ_STATUS 0xFFC018E8 /*IMDMA Stream 1 Source Interrupt/Status */
851
852/*********************************************************************************** */
853/* System MMR Register Bits */
854/******************************************************************************* */
855
856/* ********************* PLL AND RESET MASKS ************************ */
857
858/* PLL_CTL Masks */
859#define PLL_CLKIN 0x00000000 /* Pass CLKIN to PLL */
860#define PLL_CLKIN_DIV2 0x00000001 /* Pass CLKIN/2 to PLL */
861#define PLL_OFF 0x00000002 /* Shut off PLL clocks */
862#define STOPCK_OFF 0x00000008 /* Core clock off */
863#define PDWN 0x00000020 /* Put the PLL in a Deep Sleep state */
864#define BYPASS 0x00000100 /* Bypass the PLL */
865
866/* CHIPID Masks */
867#define CHIPID_VERSION 0xF0000000
868#define CHIPID_FAMILY 0x0FFFF000
869#define CHIPID_MANUFACTURE 0x00000FFE
870
871/* VR_CTL Masks */
872#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
873#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
874#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
875#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
876#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
877
878#define GAIN 0x000C /* Voltage Level Gain */
879#define GAIN_5 0x0000 /* GAIN = 5*/
880#define GAIN_10 0x0004 /* GAIN = 1*/
881#define GAIN_20 0x0008 /* GAIN = 2*/
882#define GAIN_50 0x000C /* GAIN = 5*/
883
884#define VLEV 0x00F0 /* Internal Voltage Level */
885#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
886#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
887#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
888#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
889#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
890#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
891#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
892#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
893#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
894#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
895
896#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
897#define SCKELOW 0x8000 /* Do Not Drive SCKE High During Reset After Hibernate */
898
899/* PLL_DIV Masks */
900#define SCLK_DIV(x) (x) /* SCLK = VCO / x */
901
902#define CSEL 0x30 /* Core Select */
903#define SSEL 0xf /* System Select */
904#define CCLK_DIV1 0x00000000 /* CCLK = VCO / 1 */
905#define CCLK_DIV2 0x00000010 /* CCLK = VCO / 2 */
906#define CCLK_DIV4 0x00000020 /* CCLK = VCO / 4 */
907#define CCLK_DIV8 0x00000030 /* CCLK = VCO / 8 */
908
909/* PLL_STAT Masks */
910#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
911#define FULL_ON 0x0002 /* Processor In Full On Mode */
912#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
913#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
914
915/* SWRST Mask */
916#define SYSTEM_RESET 0x0007 /* Initiates a system software reset */
917#define DOUBLE_FAULT_A 0x0008 /* Core A Double Fault Causes Reset */
918#define DOUBLE_FAULT_B 0x0010 /* Core B Double Fault Causes Reset */
919#define SWRST_DBL_FAULT_A 0x0800 /* SWRST Core A Double Fault */
920#define SWRST_DBL_FAULT_B 0x1000 /* SWRST Core B Double Fault */
921#define SWRST_WDT_B 0x2000 /* SWRST Watchdog B */
922#define SWRST_WDT_A 0x4000 /* SWRST Watchdog A */
923#define SWRST_OCCURRED 0x8000 /* SWRST Status */
924
925/* ************* SYSTEM INTERRUPT CONTROLLER MASKS ***************** */
926
927/* SICu_IARv Masks */
928/* u = A or B */
929/* v = 0 to 7 */
930/* w = 0 or 1 */
931
932/* Per_number = 0 to 63 */
933/* IVG_number = 7 to 15 */
934#define Peripheral_IVG(Per_number, IVG_number) \
935 ((IVG_number) - 7) << (((Per_number) % 8) * 4) /* Peripheral #Per_number assigned IVG #IVG_number */
936 /* Usage: r0.l = lo(Peripheral_IVG(62, 10)); */
937 /* r0.h = hi(Peripheral_IVG(62, 10)); */
938
939/* SICx_IMASKw Masks */
940/* masks are 32 bit wide, so two writes reguired for "64 bit" wide registers */
941#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
942#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
943#define SIC_MASK(x) (1 << (x)) /* Mask Peripheral #x interrupt */
944#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << (x))) /* Unmask Peripheral #x interrupt */
945
946/* SIC_IWR Masks */
947#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
948#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
949/* x = pos 0 to 31, for 32-63 use value-32 */
950#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
951#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
952
953/* ***************************** UART CONTROLLER MASKS ********************** */
954
955/* UART_LCR Register */
956
957#define DLAB 0x80
958#define SB 0x40
959#define STP 0x20
960#define EPS 0x10
961#define PEN 0x08
962#define STB 0x04
963#define WLS(x) ((x-5) & 0x03)
964
965#define DLAB_P 0x07
966#define SB_P 0x06
967#define STP_P 0x05
968#define EPS_P 0x04
969#define PEN_P 0x03
970#define STB_P 0x02
971#define WLS_P1 0x01
972#define WLS_P0 0x00
973
974/* UART_MCR Register */
975#define LOOP_ENA 0x10
976#define LOOP_ENA_P 0x04
977
978/* UART_LSR Register */
979#define TEMT 0x40
980#define THRE 0x20
981#define BI 0x10
982#define FE 0x08
983#define PE 0x04
984#define OE 0x02
985#define DR 0x01
986
987#define TEMP_P 0x06
988#define THRE_P 0x05
989#define BI_P 0x04
990#define FE_P 0x03
991#define PE_P 0x02
992#define OE_P 0x01
993#define DR_P 0x00
994
995/* UART_IER Register */
996#define ELSI 0x04
997#define ETBEI 0x02
998#define ERBFI 0x01
999
1000#define ELSI_P 0x02
1001#define ETBEI_P 0x01
1002#define ERBFI_P 0x00
1003
1004/* UART_IIR Register */
1005#define STATUS(x) ((x << 1) & 0x06)
1006#define NINT 0x01
1007#define STATUS_P1 0x02
1008#define STATUS_P0 0x01
1009#define NINT_P 0x00
1010#define IIR_TX_READY 0x02 /* UART_THR empty */
1011#define IIR_RX_READY 0x04 /* Receive data ready */
1012#define IIR_LINE_CHANGE 0x06 /* Receive line status */
1013#define IIR_STATUS 0x06
1014
1015/* UART_GCTL Register */
1016#define FFE 0x20
1017#define FPE 0x10
1018#define RPOLC 0x08
1019#define TPOLC 0x04
1020#define IREN 0x02
1021#define UCEN 0x01
1022
1023#define FFE_P 0x05
1024#define FPE_P 0x04
1025#define RPOLC_P 0x03
1026#define TPOLC_P 0x02
1027#define IREN_P 0x01
1028#define UCEN_P 0x00
1029
1030/* ********** SERIAL PORT MASKS ********************** */
1031
1032/* SPORTx_TCR1 Masks */
1033#define TSPEN 0x0001 /* TX enable */
1034#define ITCLK 0x0002 /* Internal TX Clock Select */
1035#define TDTYPE 0x000C /* TX Data Formatting Select */
1036#define TLSBIT 0x0010 /* TX Bit Order */
1037#define ITFS 0x0200 /* Internal TX Frame Sync Select */
1038#define TFSR 0x0400 /* TX Frame Sync Required Select */
1039#define DITFS 0x0800 /* Data Independent TX Frame Sync Select */
1040#define LTFS 0x1000 /* Low TX Frame Sync Select */
1041#define LATFS 0x2000 /* Late TX Frame Sync Select */
1042#define TCKFE 0x4000 /* TX Clock Falling Edge Select */
1043
1044/* SPORTx_TCR2 Masks */
1045#define SLEN 0x001F /*TX Word Length */
1046#define TXSE 0x0100 /*TX Secondary Enable */
1047#define TSFSE 0x0200 /*TX Stereo Frame Sync Enable */
1048#define TRFST 0x0400 /*TX Right-First Data Order */
1049
1050/* SPORTx_RCR1 Masks */
1051#define RSPEN 0x0001 /* RX enable */
1052#define IRCLK 0x0002 /* Internal RX Clock Select */
1053#define RDTYPE 0x000C /* RX Data Formatting Select */
1054#define RULAW 0x0008 /* u-Law enable */
1055#define RALAW 0x000C /* A-Law enable */
1056#define RLSBIT 0x0010 /* RX Bit Order */
1057#define IRFS 0x0200 /* Internal RX Frame Sync Select */
1058#define RFSR 0x0400 /* RX Frame Sync Required Select */
1059#define LRFS 0x1000 /* Low RX Frame Sync Select */
1060#define LARFS 0x2000 /* Late RX Frame Sync Select */
1061#define RCKFE 0x4000 /* RX Clock Falling Edge Select */
1062
1063/* SPORTx_RCR2 Masks */
1064#define SLEN 0x001F /*RX Word Length */
1065#define RXSE 0x0100 /*RX Secondary Enable */
1066#define RSFSE 0x0200 /*RX Stereo Frame Sync Enable */
1067#define RRFST 0x0400 /*Right-First Data Order */
1068
1069/*SPORTx_STAT Masks */
1070#define RXNE 0x0001 /*RX FIFO Not Empty Status */
1071#define RUVF 0x0002 /*RX Underflow Status */
1072#define ROVF 0x0004 /*RX Overflow Status */
1073#define TXF 0x0008 /*TX FIFO Full Status */
1074#define TUVF 0x0010 /*TX Underflow Status */
1075#define TOVF 0x0020 /*TX Overflow Status */
1076#define TXHRE 0x0040 /*TX Hold Register Empty */
1077
1078/*SPORTx_MCMC1 Masks */
1079#define SP_WSIZE 0x0000F000 /*Multichannel Window Size Field */
1080#define SP_WOFF 0x000003FF /*Multichannel Window Offset Field */
1081
1082/*SPORTx_MCMC2 Masks */
1083#define MCCRM 0x00000003 /*Multichannel Clock Recovery Mode */
1084#define MCDTXPE 0x00000004 /*Multichannel DMA Transmit Packing */
1085#define MCDRXPE 0x00000008 /*Multichannel DMA Receive Packing */
1086#define MCMEN 0x00000010 /*Multichannel Frame Mode Enable */
1087#define FSDR 0x00000080 /*Multichannel Frame Sync to Data Relationship */
1088#define MFD 0x0000F000 /*Multichannel Frame Delay */
1089
1090/* ********* PARALLEL PERIPHERAL INTERFACE (PPI) MASKS **************** */
1091
1092/* PPI_CONTROL Masks */
1093#define PORT_EN 0x00000001 /* PPI Port Enable */
1094#define PORT_DIR 0x00000002 /* PPI Port Direction */
1095#define XFR_TYPE 0x0000000C /* PPI Transfer Type */
1096#define PORT_CFG 0x00000030 /* PPI Port Configuration */
1097#define FLD_SEL 0x00000040 /* PPI Active Field Select */
1098#define PACK_EN 0x00000080 /* PPI Packing Mode */
1099#define DMA32 0x00000100 /* PPI 32-bit DMA Enable */
1100#define SKIP_EN 0x00000200 /* PPI Skip Element Enable */
1101#define SKIP_EO 0x00000400 /* PPI Skip Even/Odd Elements */
1102#define DLENGTH 0x00003800 /* PPI Data Length */
1103#define DLEN_8 0x0 /* PPI Data Length mask for DLEN=8 */
1104#define DLEN(x) (((x-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */
1105#define POL 0x0000C000 /* PPI Signal Polarities */
1106
1107/* PPI_STATUS Masks */
1108#define FLD 0x00000400 /* Field Indicator */
1109#define FT_ERR 0x00000800 /* Frame Track Error */
1110#define OVR 0x00001000 /* FIFO Overflow Error */
1111#define UNDR 0x00002000 /* FIFO Underrun Error */
1112#define ERR_DET 0x00004000 /* Error Detected Indicator */
1113#define ERR_NCOR 0x00008000 /* Error Not Corrected Indicator */
1114
1115/* ********** DMA CONTROLLER MASKS *********************8 */
1116
1117/* DMAx_CONFIG, MDMA_yy_CONFIG, IMDMA_yy_CONFIG Masks */
1118#define DMAEN 0x00000001 /* Channel Enable */
1119#define WNR 0x00000002 /* Channel Direction (W/R*) */
1120#define WDSIZE_8 0x00000000 /* Word Size 8 bits */
1121#define WDSIZE_16 0x00000004 /* Word Size 16 bits */
1122#define WDSIZE_32 0x00000008 /* Word Size 32 bits */
1123#define DMA2D 0x00000010 /* 2D/1D* Mode */
1124#define RESTART 0x00000020 /* Restart */
1125#define DI_SEL 0x00000040 /* Data Interrupt Select */
1126#define DI_EN 0x00000080 /* Data Interrupt Enable */
1127#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1128#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1129#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1130#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1131#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1132#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1133#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1134#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1135#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1136#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1137#define NDSIZE 0x00000900 /* Next Descriptor Size */
1138#define DMAFLOW 0x00007000 /* Flow Control */
1139#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1140#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1141#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1142#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1143#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1144
1145#define DMAEN_P 0 /* Channel Enable */
1146#define WNR_P 1 /* Channel Direction (W/R*) */
1147#define DMA2D_P 4 /* 2D/1D* Mode */
1148#define RESTART_P 5 /* Restart */
1149#define DI_SEL_P 6 /* Data Interrupt Select */
1150#define DI_EN_P 7 /* Data Interrupt Enable */
1151
1152/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS, IMDMA_yy_IRQ_STATUS Masks */
1153
1154#define DMA_DONE 0x00000001 /* DMA Done Indicator */
1155#define DMA_ERR 0x00000002 /* DMA Error Indicator */
1156#define DFETCH 0x00000004 /* Descriptor Fetch Indicator */
1157#define DMA_RUN 0x00000008 /* DMA Running Indicator */
1158
1159#define DMA_DONE_P 0 /* DMA Done Indicator */
1160#define DMA_ERR_P 1 /* DMA Error Indicator */
1161#define DFETCH_P 2 /* Descriptor Fetch Indicator */
1162#define DMA_RUN_P 3 /* DMA Running Indicator */
1163
1164/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP, IMDMA_yy_PERIPHERAL_MAP Masks */
1165
1166#define CTYPE 0x00000040 /* DMA Channel Type Indicator */
1167#define CTYPE_P 6 /* DMA Channel Type Indicator BIT POSITION */
1168#define PCAP8 0x00000080 /* DMA 8-bit Operation Indicator */
1169#define PCAP16 0x00000100 /* DMA 16-bit Operation Indicator */
1170#define PCAP32 0x00000200 /* DMA 32-bit Operation Indicator */
1171#define PCAPWR 0x00000400 /* DMA Write Operation Indicator */
1172#define PCAPRD 0x00000800 /* DMA Read Operation Indicator */
1173#define PMAP 0x00007000 /* DMA Peripheral Map Field */
1174
1175/* ************* GENERAL PURPOSE TIMER MASKS ******************** */
1176
1177/* PWM Timer bit definitions */
1178
1179/* TIMER_ENABLE Register */
1180#define TIMEN0 0x0001
1181#define TIMEN1 0x0002
1182#define TIMEN2 0x0004
1183#define TIMEN3 0x0008
1184#define TIMEN4 0x0010
1185#define TIMEN5 0x0020
1186#define TIMEN6 0x0040
1187#define TIMEN7 0x0080
1188#define TIMEN8 0x0001
1189#define TIMEN9 0x0002
1190#define TIMEN10 0x0004
1191#define TIMEN11 0x0008
1192
1193#define TIMEN0_P 0x00
1194#define TIMEN1_P 0x01
1195#define TIMEN2_P 0x02
1196#define TIMEN3_P 0x03
1197#define TIMEN4_P 0x04
1198#define TIMEN5_P 0x05
1199#define TIMEN6_P 0x06
1200#define TIMEN7_P 0x07
1201#define TIMEN8_P 0x00
1202#define TIMEN9_P 0x01
1203#define TIMEN10_P 0x02
1204#define TIMEN11_P 0x03
1205
1206/* TIMER_DISABLE Register */
1207#define TIMDIS0 0x0001
1208#define TIMDIS1 0x0002
1209#define TIMDIS2 0x0004
1210#define TIMDIS3 0x0008
1211#define TIMDIS4 0x0010
1212#define TIMDIS5 0x0020
1213#define TIMDIS6 0x0040
1214#define TIMDIS7 0x0080
1215#define TIMDIS8 0x0001
1216#define TIMDIS9 0x0002
1217#define TIMDIS10 0x0004
1218#define TIMDIS11 0x0008
1219
1220#define TIMDIS0_P 0x00
1221#define TIMDIS1_P 0x01
1222#define TIMDIS2_P 0x02
1223#define TIMDIS3_P 0x03
1224#define TIMDIS4_P 0x04
1225#define TIMDIS5_P 0x05
1226#define TIMDIS6_P 0x06
1227#define TIMDIS7_P 0x07
1228#define TIMDIS8_P 0x00
1229#define TIMDIS9_P 0x01
1230#define TIMDIS10_P 0x02
1231#define TIMDIS11_P 0x03
1232
1233/* TIMER_STATUS Register */
1234#define TIMIL0 0x00000001
1235#define TIMIL1 0x00000002
1236#define TIMIL2 0x00000004
1237#define TIMIL3 0x00000008
1238#define TIMIL4 0x00010000
1239#define TIMIL5 0x00020000
1240#define TIMIL6 0x00040000
1241#define TIMIL7 0x00080000
1242#define TIMIL8 0x0001
1243#define TIMIL9 0x0002
1244#define TIMIL10 0x0004
1245#define TIMIL11 0x0008
1246#define TOVF_ERR0 0x00000010
1247#define TOVF_ERR1 0x00000020
1248#define TOVF_ERR2 0x00000040
1249#define TOVF_ERR3 0x00000080
1250#define TOVF_ERR4 0x00100000
1251#define TOVF_ERR5 0x00200000
1252#define TOVF_ERR6 0x00400000
1253#define TOVF_ERR7 0x00800000
1254#define TOVF_ERR8 0x0010
1255#define TOVF_ERR9 0x0020
1256#define TOVF_ERR10 0x0040
1257#define TOVF_ERR11 0x0080
1258#define TRUN0 0x00001000
1259#define TRUN1 0x00002000
1260#define TRUN2 0x00004000
1261#define TRUN3 0x00008000
1262#define TRUN4 0x10000000
1263#define TRUN5 0x20000000
1264#define TRUN6 0x40000000
1265#define TRUN7 0x80000000
1266#define TRUN8 0x1000
1267#define TRUN9 0x2000
1268#define TRUN10 0x4000
1269#define TRUN11 0x8000
1270
1271#define TIMIL0_P 0x00
1272#define TIMIL1_P 0x01
1273#define TIMIL2_P 0x02
1274#define TIMIL3_P 0x03
1275#define TIMIL4_P 0x10
1276#define TIMIL5_P 0x11
1277#define TIMIL6_P 0x12
1278#define TIMIL7_P 0x13
1279#define TIMIL8_P 0x00
1280#define TIMIL9_P 0x01
1281#define TIMIL10_P 0x02
1282#define TIMIL11_P 0x03
1283#define TOVF_ERR0_P 0x04
1284#define TOVF_ERR1_P 0x05
1285#define TOVF_ERR2_P 0x06
1286#define TOVF_ERR3_P 0x07
1287#define TOVF_ERR4_P 0x14
1288#define TOVF_ERR5_P 0x15
1289#define TOVF_ERR6_P 0x16
1290#define TOVF_ERR7_P 0x17
1291#define TOVF_ERR8_P 0x04
1292#define TOVF_ERR9_P 0x05
1293#define TOVF_ERR10_P 0x06
1294#define TOVF_ERR11_P 0x07
1295#define TRUN0_P 0x0C
1296#define TRUN1_P 0x0D
1297#define TRUN2_P 0x0E
1298#define TRUN3_P 0x0F
1299#define TRUN4_P 0x1C
1300#define TRUN5_P 0x1D
1301#define TRUN6_P 0x1E
1302#define TRUN7_P 0x1F
1303#define TRUN8_P 0x0C
1304#define TRUN9_P 0x0D
1305#define TRUN10_P 0x0E
1306#define TRUN11_P 0x0F
1307
1308/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
1309#define TOVL_ERR0 TOVF_ERR0
1310#define TOVL_ERR1 TOVF_ERR1
1311#define TOVL_ERR2 TOVF_ERR2
1312#define TOVL_ERR3 TOVF_ERR3
1313#define TOVL_ERR4 TOVF_ERR4
1314#define TOVL_ERR5 TOVF_ERR5
1315#define TOVL_ERR6 TOVF_ERR6
1316#define TOVL_ERR7 TOVF_ERR7
1317#define TOVL_ERR8 TOVF_ERR8
1318#define TOVL_ERR9 TOVF_ERR9
1319#define TOVL_ERR10 TOVF_ERR10
1320#define TOVL_ERR11 TOVF_ERR11
1321#define TOVL_ERR0_P TOVF_ERR0_P
1322#define TOVL_ERR1_P TOVF_ERR1_P
1323#define TOVL_ERR2_P TOVF_ERR2_P
1324#define TOVL_ERR3_P TOVF_ERR3_P
1325#define TOVL_ERR4_P TOVF_ERR4_P
1326#define TOVL_ERR5_P TOVF_ERR5_P
1327#define TOVL_ERR6_P TOVF_ERR6_P
1328#define TOVL_ERR7_P TOVF_ERR7_P
1329#define TOVL_ERR8_P TOVF_ERR8_P
1330#define TOVL_ERR9_P TOVF_ERR9_P
1331#define TOVL_ERR10_P TOVF_ERR10_P
1332#define TOVL_ERR11_P TOVF_ERR11_P
1333
1334/* TIMERx_CONFIG Registers */
1335#define PWM_OUT 0x0001
1336#define WDTH_CAP 0x0002
1337#define EXT_CLK 0x0003
1338#define PULSE_HI 0x0004
1339#define PERIOD_CNT 0x0008
1340#define IRQ_ENA 0x0010
1341#define TIN_SEL 0x0020
1342#define OUT_DIS 0x0040
1343#define CLK_SEL 0x0080
1344#define TOGGLE_HI 0x0100
1345#define EMU_RUN 0x0200
1346#define ERR_TYP(x) ((x & 0x03) << 14)
1347
1348#define TMODE_P0 0x00
1349#define TMODE_P1 0x01
1350#define PULSE_HI_P 0x02
1351#define PERIOD_CNT_P 0x03
1352#define IRQ_ENA_P 0x04
1353#define TIN_SEL_P 0x05
1354#define OUT_DIS_P 0x06
1355#define CLK_SEL_P 0x07
1356#define TOGGLE_HI_P 0x08
1357#define EMU_RUN_P 0x09
1358#define ERR_TYP_P0 0x0E
1359#define ERR_TYP_P1 0x0F
1360
1361/*/ ****************** PROGRAMMABLE FLAG MASKS ********************* */
1362
1363/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
1364#define PF0 0x0001
1365#define PF1 0x0002
1366#define PF2 0x0004
1367#define PF3 0x0008
1368#define PF4 0x0010
1369#define PF5 0x0020
1370#define PF6 0x0040
1371#define PF7 0x0080
1372#define PF8 0x0100
1373#define PF9 0x0200
1374#define PF10 0x0400
1375#define PF11 0x0800
1376#define PF12 0x1000
1377#define PF13 0x2000
1378#define PF14 0x4000
1379#define PF15 0x8000
1380
1381/* General Purpose IO (0xFFC00700 - 0xFFC007FF) BIT POSITIONS */
1382#define PF0_P 0
1383#define PF1_P 1
1384#define PF2_P 2
1385#define PF3_P 3
1386#define PF4_P 4
1387#define PF5_P 5
1388#define PF6_P 6
1389#define PF7_P 7
1390#define PF8_P 8
1391#define PF9_P 9
1392#define PF10_P 10
1393#define PF11_P 11
1394#define PF12_P 12
1395#define PF13_P 13
1396#define PF14_P 14
1397#define PF15_P 15
1398
1399/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS **************** */
1400
1401/* SPI_CTL Masks */
1402#define TIMOD 0x00000003 /* Transfer initiation mode and interrupt generation */
1403#define SZ 0x00000004 /* Send Zero (=0) or last (=1) word when TDBR empty. */
1404#define GM 0x00000008 /* When RDBR full, get more (=1) data or discard (=0) incoming Data */
1405#define PSSE 0x00000010 /* Enable (=1) Slave-Select input for Master. */
1406#define EMISO 0x00000020 /* Enable (=1) MISO pin as an output. */
1407#define SIZE 0x00000100 /* Word length (0 => 8 bits, 1 => 16 bits) */
1408#define LSBF 0x00000200 /* Data format (0 => MSB sent/received first 1 => LSB sent/received first) */
1409#define CPHA 0x00000400 /* Clock phase (0 => SPICLK starts toggling in middle of xfer, 1 => SPICLK toggles at the beginning of xfer. */
1410#define CPOL 0x00000800 /* Clock polarity (0 => active-high, 1 => active-low) */
1411#define MSTR 0x00001000 /* Configures SPI as master (=1) or slave (=0) */
1412#define WOM 0x00002000 /* Open drain (=1) data output enable (for MOSI and MISO) */
1413#define SPE 0x00004000 /* SPI module enable (=1), disable (=0) */
1414
1415/* SPI_FLG Masks */
1416#define FLS1 0x00000002 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
1417#define FLS2 0x00000004 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
1418#define FLS3 0x00000008 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
1419#define FLS4 0x00000010 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
1420#define FLS5 0x00000020 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
1421#define FLS6 0x00000040 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
1422#define FLS7 0x00000080 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
1423#define FLG1 0x00000200 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
1424#define FLG2 0x00000400 /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
1425#define FLG3 0x00000800 /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
1426#define FLG4 0x00001000 /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
1427#define FLG5 0x00002000 /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
1428#define FLG6 0x00004000 /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
1429#define FLG7 0x00008000 /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
1430
1431/* SPI_FLG Bit Positions */
1432#define FLS1_P 0x00000001 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
1433#define FLS2_P 0x00000002 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
1434#define FLS3_P 0x00000003 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
1435#define FLS4_P 0x00000004 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
1436#define FLS5_P 0x00000005 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
1437#define FLS6_P 0x00000006 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
1438#define FLS7_P 0x00000007 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
1439#define FLG1_P 0x00000009 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
1440#define FLG2_P 0x0000000A /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
1441#define FLG3_P 0x0000000B /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
1442#define FLG4_P 0x0000000C /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
1443#define FLG5_P 0x0000000D /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
1444#define FLG6_P 0x0000000E /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
1445#define FLG7_P 0x0000000F /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
1446
1447/* SPI_STAT Masks */
1448#define SPIF 0x00000001 /* Set (=1) when SPI single-word transfer complete */
1449#define MODF 0x00000002 /* Set (=1) in a master device when some other device tries to become master */
1450#define TXE 0x00000004 /* Set (=1) when transmission occurs with no new data in SPI_TDBR */
1451#define TXS 0x00000008 /* SPI_TDBR Data Buffer Status (0=Empty, 1=Full) */
1452#define RBSY 0x00000010 /* Set (=1) when data is received with RDBR full */
1453#define RXS 0x00000020 /* SPI_RDBR Data Buffer Status (0=Empty, 1=Full) */
1454#define TXCOL 0x00000040 /* When set (=1), corrupt data may have been transmitted */
1455
1456/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS ************* */
1457
1458/* AMGCTL Masks */
1459#define AMCKEN 0x0001 /* Enable CLKOUT */
1460#define AMBEN_B0 0x0002 /* Enable Asynchronous Memory Bank 0 only */
1461#define AMBEN_B0_B1 0x0004 /* Enable Asynchronous Memory Banks 0 & 1 only */
1462#define AMBEN_B0_B1_B2 0x0006 /* Enable Asynchronous Memory Banks 0, 1, and 2 */
1463#define AMBEN_ALL 0x0008 /* Enable Asynchronous Memory Banks (all) 0, 1, 2, and 3 */
1464#define B0_PEN 0x0010 /* Enable 16-bit packing Bank 0 */
1465#define B1_PEN 0x0020 /* Enable 16-bit packing Bank 1 */
1466#define B2_PEN 0x0040 /* Enable 16-bit packing Bank 2 */
1467#define B3_PEN 0x0080 /* Enable 16-bit packing Bank 3 */
1468
1469/* AMGCTL Bit Positions */
1470#define AMCKEN_P 0x00000000 /* Enable CLKOUT */
1471#define AMBEN_P0 0x00000001 /* Asynchronous Memory Enable, 000 - banks 0-3 disabled, 001 - Bank 0 enabled */
1472#define AMBEN_P1 0x00000002 /* Asynchronous Memory Enable, 010 - banks 0&1 enabled, 011 - banks 0-3 enabled */
1473#define AMBEN_P2 0x00000003 /* Asynchronous Memory Enable, 1xx - All banks (bank 0, 1, 2, and 3) enabled */
1474#define B0_PEN_P 0x004 /* Enable 16-bit packing Bank 0 */
1475#define B1_PEN_P 0x005 /* Enable 16-bit packing Bank 1 */
1476#define B2_PEN_P 0x006 /* Enable 16-bit packing Bank 2 */
1477#define B3_PEN_P 0x007 /* Enable 16-bit packing Bank 3 */
1478
1479/* AMBCTL0 Masks */
1480#define B0RDYEN 0x00000001 /* Bank 0 RDY Enable, 0=disable, 1=enable */
1481#define B0RDYPOL 0x00000002 /* Bank 0 RDY Active high, 0=active low, 1=active high */
1482#define B0TT_1 0x00000004 /* Bank 0 Transition Time from Read to Write = 1 cycle */
1483#define B0TT_2 0x00000008 /* Bank 0 Transition Time from Read to Write = 2 cycles */
1484#define B0TT_3 0x0000000C /* Bank 0 Transition Time from Read to Write = 3 cycles */
1485#define B0TT_4 0x00000000 /* Bank 0 Transition Time from Read to Write = 4 cycles */
1486#define B0ST_1 0x00000010 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=1 cycle */
1487#define B0ST_2 0x00000020 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=2 cycles */
1488#define B0ST_3 0x00000030 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=3 cycles */
1489#define B0ST_4 0x00000000 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=4 cycles */
1490#define B0HT_1 0x00000040 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 1 cycle */
1491#define B0HT_2 0x00000080 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */
1492#define B0HT_3 0x000000C0 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 3 cycles */
1493#define B0HT_0 0x00000000 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 0 cycles */
1494#define B0RAT_1 0x00000100 /* Bank 0 Read Access Time = 1 cycle */
1495#define B0RAT_2 0x00000200 /* Bank 0 Read Access Time = 2 cycles */
1496#define B0RAT_3 0x00000300 /* Bank 0 Read Access Time = 3 cycles */
1497#define B0RAT_4 0x00000400 /* Bank 0 Read Access Time = 4 cycles */
1498#define B0RAT_5 0x00000500 /* Bank 0 Read Access Time = 5 cycles */
1499#define B0RAT_6 0x00000600 /* Bank 0 Read Access Time = 6 cycles */
1500#define B0RAT_7 0x00000700 /* Bank 0 Read Access Time = 7 cycles */
1501#define B0RAT_8 0x00000800 /* Bank 0 Read Access Time = 8 cycles */
1502#define B0RAT_9 0x00000900 /* Bank 0 Read Access Time = 9 cycles */
1503#define B0RAT_10 0x00000A00 /* Bank 0 Read Access Time = 10 cycles */
1504#define B0RAT_11 0x00000B00 /* Bank 0 Read Access Time = 11 cycles */
1505#define B0RAT_12 0x00000C00 /* Bank 0 Read Access Time = 12 cycles */
1506#define B0RAT_13 0x00000D00 /* Bank 0 Read Access Time = 13 cycles */
1507#define B0RAT_14 0x00000E00 /* Bank 0 Read Access Time = 14 cycles */
1508#define B0RAT_15 0x00000F00 /* Bank 0 Read Access Time = 15 cycles */
1509#define B0WAT_1 0x00001000 /* Bank 0 Write Access Time = 1 cycle */
1510#define B0WAT_2 0x00002000 /* Bank 0 Write Access Time = 2 cycles */
1511#define B0WAT_3 0x00003000 /* Bank 0 Write Access Time = 3 cycles */
1512#define B0WAT_4 0x00004000 /* Bank 0 Write Access Time = 4 cycles */
1513#define B0WAT_5 0x00005000 /* Bank 0 Write Access Time = 5 cycles */
1514#define B0WAT_6 0x00006000 /* Bank 0 Write Access Time = 6 cycles */
1515#define B0WAT_7 0x00007000 /* Bank 0 Write Access Time = 7 cycles */
1516#define B0WAT_8 0x00008000 /* Bank 0 Write Access Time = 8 cycles */
1517#define B0WAT_9 0x00009000 /* Bank 0 Write Access Time = 9 cycles */
1518#define B0WAT_10 0x0000A000 /* Bank 0 Write Access Time = 10 cycles */
1519#define B0WAT_11 0x0000B000 /* Bank 0 Write Access Time = 11 cycles */
1520#define B0WAT_12 0x0000C000 /* Bank 0 Write Access Time = 12 cycles */
1521#define B0WAT_13 0x0000D000 /* Bank 0 Write Access Time = 13 cycles */
1522#define B0WAT_14 0x0000E000 /* Bank 0 Write Access Time = 14 cycles */
1523#define B0WAT_15 0x0000F000 /* Bank 0 Write Access Time = 15 cycles */
1524#define B1RDYEN 0x00010000 /* Bank 1 RDY enable, 0=disable, 1=enable */
1525#define B1RDYPOL 0x00020000 /* Bank 1 RDY Active high, 0=active low, 1=active high */
1526#define B1TT_1 0x00040000 /* Bank 1 Transition Time from Read to Write = 1 cycle */
1527#define B1TT_2 0x00080000 /* Bank 1 Transition Time from Read to Write = 2 cycles */
1528#define B1TT_3 0x000C0000 /* Bank 1 Transition Time from Read to Write = 3 cycles */
1529#define B1TT_4 0x00000000 /* Bank 1 Transition Time from Read to Write = 4 cycles */
1530#define B1ST_1 0x00100000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1531#define B1ST_2 0x00200000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1532#define B1ST_3 0x00300000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1533#define B1ST_4 0x00000000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1534#define B1HT_1 0x00400000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1535#define B1HT_2 0x00800000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1536#define B1HT_3 0x00C00000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1537#define B1HT_0 0x00000000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1538#define B1RAT_1 0x01000000 /* Bank 1 Read Access Time = 1 cycle */
1539#define B1RAT_2 0x02000000 /* Bank 1 Read Access Time = 2 cycles */
1540#define B1RAT_3 0x03000000 /* Bank 1 Read Access Time = 3 cycles */
1541#define B1RAT_4 0x04000000 /* Bank 1 Read Access Time = 4 cycles */
1542#define B1RAT_5 0x05000000 /* Bank 1 Read Access Time = 5 cycles */
1543#define B1RAT_6 0x06000000 /* Bank 1 Read Access Time = 6 cycles */
1544#define B1RAT_7 0x07000000 /* Bank 1 Read Access Time = 7 cycles */
1545#define B1RAT_8 0x08000000 /* Bank 1 Read Access Time = 8 cycles */
1546#define B1RAT_9 0x09000000 /* Bank 1 Read Access Time = 9 cycles */
1547#define B1RAT_10 0x0A000000 /* Bank 1 Read Access Time = 10 cycles */
1548#define B1RAT_11 0x0B000000 /* Bank 1 Read Access Time = 11 cycles */
1549#define B1RAT_12 0x0C000000 /* Bank 1 Read Access Time = 12 cycles */
1550#define B1RAT_13 0x0D000000 /* Bank 1 Read Access Time = 13 cycles */
1551#define B1RAT_14 0x0E000000 /* Bank 1 Read Access Time = 14 cycles */
1552#define B1RAT_15 0x0F000000 /* Bank 1 Read Access Time = 15 cycles */
1553#define B1WAT_1 0x10000000 /* Bank 1 Write Access Time = 1 cycle */
1554#define B1WAT_2 0x20000000 /* Bank 1 Write Access Time = 2 cycles */
1555#define B1WAT_3 0x30000000 /* Bank 1 Write Access Time = 3 cycles */
1556#define B1WAT_4 0x40000000 /* Bank 1 Write Access Time = 4 cycles */
1557#define B1WAT_5 0x50000000 /* Bank 1 Write Access Time = 5 cycles */
1558#define B1WAT_6 0x60000000 /* Bank 1 Write Access Time = 6 cycles */
1559#define B1WAT_7 0x70000000 /* Bank 1 Write Access Time = 7 cycles */
1560#define B1WAT_8 0x80000000 /* Bank 1 Write Access Time = 8 cycles */
1561#define B1WAT_9 0x90000000 /* Bank 1 Write Access Time = 9 cycles */
1562#define B1WAT_10 0xA0000000 /* Bank 1 Write Access Time = 10 cycles */
1563#define B1WAT_11 0xB0000000 /* Bank 1 Write Access Time = 11 cycles */
1564#define B1WAT_12 0xC0000000 /* Bank 1 Write Access Time = 12 cycles */
1565#define B1WAT_13 0xD0000000 /* Bank 1 Write Access Time = 13 cycles */
1566#define B1WAT_14 0xE0000000 /* Bank 1 Write Access Time = 14 cycles */
1567#define B1WAT_15 0xF0000000 /* Bank 1 Write Access Time = 15 cycles */
1568
1569/* AMBCTL1 Masks */
1570#define B2RDYEN 0x00000001 /* Bank 2 RDY Enable, 0=disable, 1=enable */
1571#define B2RDYPOL 0x00000002 /* Bank 2 RDY Active high, 0=active low, 1=active high */
1572#define B2TT_1 0x00000004 /* Bank 2 Transition Time from Read to Write = 1 cycle */
1573#define B2TT_2 0x00000008 /* Bank 2 Transition Time from Read to Write = 2 cycles */
1574#define B2TT_3 0x0000000C /* Bank 2 Transition Time from Read to Write = 3 cycles */
1575#define B2TT_4 0x00000000 /* Bank 2 Transition Time from Read to Write = 4 cycles */
1576#define B2ST_1 0x00000010 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1577#define B2ST_2 0x00000020 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1578#define B2ST_3 0x00000030 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1579#define B2ST_4 0x00000000 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1580#define B2HT_1 0x00000040 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1581#define B2HT_2 0x00000080 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1582#define B2HT_3 0x000000C0 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1583#define B2HT_0 0x00000000 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1584#define B2RAT_1 0x00000100 /* Bank 2 Read Access Time = 1 cycle */
1585#define B2RAT_2 0x00000200 /* Bank 2 Read Access Time = 2 cycles */
1586#define B2RAT_3 0x00000300 /* Bank 2 Read Access Time = 3 cycles */
1587#define B2RAT_4 0x00000400 /* Bank 2 Read Access Time = 4 cycles */
1588#define B2RAT_5 0x00000500 /* Bank 2 Read Access Time = 5 cycles */
1589#define B2RAT_6 0x00000600 /* Bank 2 Read Access Time = 6 cycles */
1590#define B2RAT_7 0x00000700 /* Bank 2 Read Access Time = 7 cycles */
1591#define B2RAT_8 0x00000800 /* Bank 2 Read Access Time = 8 cycles */
1592#define B2RAT_9 0x00000900 /* Bank 2 Read Access Time = 9 cycles */
1593#define B2RAT_10 0x00000A00 /* Bank 2 Read Access Time = 10 cycles */
1594#define B2RAT_11 0x00000B00 /* Bank 2 Read Access Time = 11 cycles */
1595#define B2RAT_12 0x00000C00 /* Bank 2 Read Access Time = 12 cycles */
1596#define B2RAT_13 0x00000D00 /* Bank 2 Read Access Time = 13 cycles */
1597#define B2RAT_14 0x00000E00 /* Bank 2 Read Access Time = 14 cycles */
1598#define B2RAT_15 0x00000F00 /* Bank 2 Read Access Time = 15 cycles */
1599#define B2WAT_1 0x00001000 /* Bank 2 Write Access Time = 1 cycle */
1600#define B2WAT_2 0x00002000 /* Bank 2 Write Access Time = 2 cycles */
1601#define B2WAT_3 0x00003000 /* Bank 2 Write Access Time = 3 cycles */
1602#define B2WAT_4 0x00004000 /* Bank 2 Write Access Time = 4 cycles */
1603#define B2WAT_5 0x00005000 /* Bank 2 Write Access Time = 5 cycles */
1604#define B2WAT_6 0x00006000 /* Bank 2 Write Access Time = 6 cycles */
1605#define B2WAT_7 0x00007000 /* Bank 2 Write Access Time = 7 cycles */
1606#define B2WAT_8 0x00008000 /* Bank 2 Write Access Time = 8 cycles */
1607#define B2WAT_9 0x00009000 /* Bank 2 Write Access Time = 9 cycles */
1608#define B2WAT_10 0x0000A000 /* Bank 2 Write Access Time = 10 cycles */
1609#define B2WAT_11 0x0000B000 /* Bank 2 Write Access Time = 11 cycles */
1610#define B2WAT_12 0x0000C000 /* Bank 2 Write Access Time = 12 cycles */
1611#define B2WAT_13 0x0000D000 /* Bank 2 Write Access Time = 13 cycles */
1612#define B2WAT_14 0x0000E000 /* Bank 2 Write Access Time = 14 cycles */
1613#define B2WAT_15 0x0000F000 /* Bank 2 Write Access Time = 15 cycles */
1614#define B3RDYEN 0x00010000 /* Bank 3 RDY enable, 0=disable, 1=enable */
1615#define B3RDYPOL 0x00020000 /* Bank 3 RDY Active high, 0=active low, 1=active high */
1616#define B3TT_1 0x00040000 /* Bank 3 Transition Time from Read to Write = 1 cycle */
1617#define B3TT_2 0x00080000 /* Bank 3 Transition Time from Read to Write = 2 cycles */
1618#define B3TT_3 0x000C0000 /* Bank 3 Transition Time from Read to Write = 3 cycles */
1619#define B3TT_4 0x00000000 /* Bank 3 Transition Time from Read to Write = 4 cycles */
1620#define B3ST_1 0x00100000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1621#define B3ST_2 0x00200000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1622#define B3ST_3 0x00300000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1623#define B3ST_4 0x00000000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1624#define B3HT_1 0x00400000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1625#define B3HT_2 0x00800000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1626#define B3HT_3 0x00C00000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1627#define B3HT_0 0x00000000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1628#define B3RAT_1 0x01000000 /* Bank 3 Read Access Time = 1 cycle */
1629#define B3RAT_2 0x02000000 /* Bank 3 Read Access Time = 2 cycles */
1630#define B3RAT_3 0x03000000 /* Bank 3 Read Access Time = 3 cycles */
1631#define B3RAT_4 0x04000000 /* Bank 3 Read Access Time = 4 cycles */
1632#define B3RAT_5 0x05000000 /* Bank 3 Read Access Time = 5 cycles */
1633#define B3RAT_6 0x06000000 /* Bank 3 Read Access Time = 6 cycles */
1634#define B3RAT_7 0x07000000 /* Bank 3 Read Access Time = 7 cycles */
1635#define B3RAT_8 0x08000000 /* Bank 3 Read Access Time = 8 cycles */
1636#define B3RAT_9 0x09000000 /* Bank 3 Read Access Time = 9 cycles */
1637#define B3RAT_10 0x0A000000 /* Bank 3 Read Access Time = 10 cycles */
1638#define B3RAT_11 0x0B000000 /* Bank 3 Read Access Time = 11 cycles */
1639#define B3RAT_12 0x0C000000 /* Bank 3 Read Access Time = 12 cycles */
1640#define B3RAT_13 0x0D000000 /* Bank 3 Read Access Time = 13 cycles */
1641#define B3RAT_14 0x0E000000 /* Bank 3 Read Access Time = 14 cycles */
1642#define B3RAT_15 0x0F000000 /* Bank 3 Read Access Time = 15 cycles */
1643#define B3WAT_1 0x10000000 /* Bank 3 Write Access Time = 1 cycle */
1644#define B3WAT_2 0x20000000 /* Bank 3 Write Access Time = 2 cycles */
1645#define B3WAT_3 0x30000000 /* Bank 3 Write Access Time = 3 cycles */
1646#define B3WAT_4 0x40000000 /* Bank 3 Write Access Time = 4 cycles */
1647#define B3WAT_5 0x50000000 /* Bank 3 Write Access Time = 5 cycles */
1648#define B3WAT_6 0x60000000 /* Bank 3 Write Access Time = 6 cycles */
1649#define B3WAT_7 0x70000000 /* Bank 3 Write Access Time = 7 cycles */
1650#define B3WAT_8 0x80000000 /* Bank 3 Write Access Time = 8 cycles */
1651#define B3WAT_9 0x90000000 /* Bank 3 Write Access Time = 9 cycles */
1652#define B3WAT_10 0xA0000000 /* Bank 3 Write Access Time = 10 cycles */
1653#define B3WAT_11 0xB0000000 /* Bank 3 Write Access Time = 11 cycles */
1654#define B3WAT_12 0xC0000000 /* Bank 3 Write Access Time = 12 cycles */
1655#define B3WAT_13 0xD0000000 /* Bank 3 Write Access Time = 13 cycles */
1656#define B3WAT_14 0xE0000000 /* Bank 3 Write Access Time = 14 cycles */
1657#define B3WAT_15 0xF0000000 /* Bank 3 Write Access Time = 15 cycles */
1658
1659/* ********************** SDRAM CONTROLLER MASKS *************************** */
1660
1661/* EBIU_SDGCTL Masks */
1662#define SCTLE 0x00000001 /* Enable SCLK[0], /SRAS, /SCAS, /SWE, SDQM[3:0] */
1663#define CL_2 0x00000008 /* SDRAM CAS latency = 2 cycles */
1664#define CL_3 0x0000000C /* SDRAM CAS latency = 3 cycles */
1665#define PFE 0x00000010 /* Enable SDRAM prefetch */
1666#define PFP 0x00000020 /* Prefetch has priority over AMC requests */
1667#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1668#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1669#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1670#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1671#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1672#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1673#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1674#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1675#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1676#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1677#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1678#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1679#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1680#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1681#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1682#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1683#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1684#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1685#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1686#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1687#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1688#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1689#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1690#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1691#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1692#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1693#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1694#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1695#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1696#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1697#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1698#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1699#define PUPSD 0x00200000 /*Power-up start delay */
1700#define PSM 0x00400000 /* SDRAM power-up sequence = Precharge, mode register set, 8 CBR refresh cycles */
1701#define PSS 0x00800000 /* enable SDRAM power-up sequence on next SDRAM access */
1702#define SRFS 0x01000000 /* Start SDRAM self-refresh mode */
1703#define EBUFE 0x02000000 /* Enable external buffering timing */
1704#define FBBRW 0x04000000 /* Fast back-to-back read write enable */
1705#define EMREN 0x10000000 /* Extended mode register enable */
1706#define TCSR 0x20000000 /* Temp compensated self refresh value 85 deg C */
1707#define CDDBG 0x40000000 /* Tristate SDRAM controls during bus grant */
1708
1709/* EBIU_SDBCTL Masks */
1710#define EB0_E 0x00000001 /* Enable SDRAM external bank 0 */
1711#define EB0_SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1712#define EB0_SZ_32 0x00000002 /* SDRAM external bank size = 32MB */
1713#define EB0_SZ_64 0x00000004 /* SDRAM external bank size = 64MB */
1714#define EB0_SZ_128 0x00000006 /* SDRAM external bank size = 128MB */
1715#define EB0_CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1716#define EB0_CAW_9 0x00000010 /* SDRAM external bank column address width = 9 bits */
1717#define EB0_CAW_10 0x00000020 /* SDRAM external bank column address width = 9 bits */
1718#define EB0_CAW_11 0x00000030 /* SDRAM external bank column address width = 9 bits */
1719
1720#define EB1_E 0x00000100 /* Enable SDRAM external bank 1 */
1721#define EB1__SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1722#define EB1__SZ_32 0x00000200 /* SDRAM external bank size = 32MB */
1723#define EB1__SZ_64 0x00000400 /* SDRAM external bank size = 64MB */
1724#define EB1__SZ_128 0x00000600 /* SDRAM external bank size = 128MB */
1725#define EB1__CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1726#define EB1__CAW_9 0x00001000 /* SDRAM external bank column address width = 9 bits */
1727#define EB1__CAW_10 0x00002000 /* SDRAM external bank column address width = 9 bits */
1728#define EB1__CAW_11 0x00003000 /* SDRAM external bank column address width = 9 bits */
1729
1730#define EB2__E 0x00010000 /* Enable SDRAM external bank 2 */
1731#define EB2__SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1732#define EB2__SZ_32 0x00020000 /* SDRAM external bank size = 32MB */
1733#define EB2__SZ_64 0x00040000 /* SDRAM external bank size = 64MB */
1734#define EB2__SZ_128 0x00060000 /* SDRAM external bank size = 128MB */
1735#define EB2__CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1736#define EB2__CAW_9 0x00100000 /* SDRAM external bank column address width = 9 bits */
1737#define EB2__CAW_10 0x00200000 /* SDRAM external bank column address width = 9 bits */
1738#define EB2__CAW_11 0x00300000 /* SDRAM external bank column address width = 9 bits */
1739
1740#define EB3__E 0x01000000 /* Enable SDRAM external bank 3 */
1741#define EB3__SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1742#define EB3__SZ_32 0x02000000 /* SDRAM external bank size = 32MB */
1743#define EB3__SZ_64 0x04000000 /* SDRAM external bank size = 64MB */
1744#define EB3__SZ_128 0x06000000 /* SDRAM external bank size = 128MB */
1745#define EB3__CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1746#define EB3__CAW_9 0x10000000 /* SDRAM external bank column address width = 9 bits */
1747#define EB3__CAW_10 0x20000000 /* SDRAM external bank column address width = 9 bits */
1748#define EB3__CAW_11 0x30000000 /* SDRAM external bank column address width = 9 bits */
1749
1750/* EBIU_SDSTAT Masks */
1751#define SDCI 0x00000001 /* SDRAM controller is idle */
1752#define SDSRA 0x00000002 /* SDRAM SDRAM self refresh is active */
1753#define SDPUA 0x00000004 /* SDRAM power up active */
1754#define SDRS 0x00000008 /* SDRAM is in reset state */
1755#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */
1756#define BGSTAT 0x00000020 /* Bus granted */
1757
1758#endif /* _DEF_BF561_H */
diff --git a/include/asm-blackfin/mach-bf561/dma.h b/include/asm-blackfin/mach-bf561/dma.h
deleted file mode 100644
index 8bc46cd89a02..000000000000
--- a/include/asm-blackfin/mach-bf561/dma.h
+++ /dev/null
@@ -1,35 +0,0 @@
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_DEST 30
29#define CH_MEM_STREAM3_SRC 31
30#define CH_IMEM_STREAM0_DEST 32
31#define CH_IMEM_STREAM0_SRC 33
32#define CH_IMEM_STREAM1_DEST 34
33#define CH_IMEM_STREAM1_SRC 35
34
35#endif
diff --git a/include/asm-blackfin/mach-bf561/irq.h b/include/asm-blackfin/mach-bf561/irq.h
deleted file mode 100644
index 6698389c5564..000000000000
--- a/include/asm-blackfin/mach-bf561/irq.h
+++ /dev/null
@@ -1,447 +0,0 @@
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 Softirq IVG14
122 System Call --
123 (lowest priority) IVG15
124
125 **********************************************************************/
126
127#define SYS_IRQS 71
128#define NR_PERI_INTS 64
129
130/*
131 * The ABSTRACT IRQ definitions
132 * the first seven of the following are fixed,
133 * the rest you change if you need to.
134 */
135/* IVG 0-6*/
136#define IRQ_EMU 0 /* Emulation */
137#define IRQ_RST 1 /* Reset */
138#define IRQ_NMI 2 /* Non Maskable Interrupt */
139#define IRQ_EVX 3 /* Exception */
140#define IRQ_UNUSED 4 /* Reserved interrupt */
141#define IRQ_HWERR 5 /* Hardware Error */
142#define IRQ_CORETMR 6 /* Core timer */
143
144#define IVG_BASE 7
145/* IVG 7 */
146#define IRQ_PLL_WAKEUP (IVG_BASE + 0) /* PLL Wakeup Interrupt */
147#define IRQ_DMA1_ERROR (IVG_BASE + 1) /* DMA1 Error (general) */
148#define IRQ_DMA_ERROR IRQ_DMA1_ERROR /* DMA1 Error (general) */
149#define IRQ_DMA2_ERROR (IVG_BASE + 2) /* DMA2 Error (general) */
150#define IRQ_IMDMA_ERROR (IVG_BASE + 3) /* IMDMA Error Interrupt */
151#define IRQ_PPI1_ERROR (IVG_BASE + 4) /* PPI1 Error Interrupt */
152#define IRQ_PPI_ERROR IRQ_PPI1_ERROR /* PPI1 Error Interrupt */
153#define IRQ_PPI2_ERROR (IVG_BASE + 5) /* PPI2 Error Interrupt */
154#define IRQ_SPORT0_ERROR (IVG_BASE + 6) /* SPORT0 Error Interrupt */
155#define IRQ_SPORT1_ERROR (IVG_BASE + 7) /* SPORT1 Error Interrupt */
156#define IRQ_SPI_ERROR (IVG_BASE + 8) /* SPI Error Interrupt */
157#define IRQ_UART_ERROR (IVG_BASE + 9) /* UART Error Interrupt */
158#define IRQ_RESERVED_ERROR (IVG_BASE + 10) /* Reversed Interrupt */
159/* IVG 8 */
160#define IRQ_DMA1_0 (IVG_BASE + 11) /* DMA1 0 Interrupt(PPI1) */
161#define IRQ_PPI IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */
162#define IRQ_PPI0 IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */
163#define IRQ_DMA1_1 (IVG_BASE + 12) /* DMA1 1 Interrupt(PPI2) */
164#define IRQ_PPI1 IRQ_DMA1_1 /* DMA1 1 Interrupt(PPI2) */
165#define IRQ_DMA1_2 (IVG_BASE + 13) /* DMA1 2 Interrupt */
166#define IRQ_DMA1_3 (IVG_BASE + 14) /* DMA1 3 Interrupt */
167#define IRQ_DMA1_4 (IVG_BASE + 15) /* DMA1 4 Interrupt */
168#define IRQ_DMA1_5 (IVG_BASE + 16) /* DMA1 5 Interrupt */
169#define IRQ_DMA1_6 (IVG_BASE + 17) /* DMA1 6 Interrupt */
170#define IRQ_DMA1_7 (IVG_BASE + 18) /* DMA1 7 Interrupt */
171#define IRQ_DMA1_8 (IVG_BASE + 19) /* DMA1 8 Interrupt */
172#define IRQ_DMA1_9 (IVG_BASE + 20) /* DMA1 9 Interrupt */
173#define IRQ_DMA1_10 (IVG_BASE + 21) /* DMA1 10 Interrupt */
174#define IRQ_DMA1_11 (IVG_BASE + 22) /* DMA1 11 Interrupt */
175/* IVG 9 */
176#define IRQ_DMA2_0 (IVG_BASE + 23) /* DMA2 0 (SPORT0 RX) */
177#define IRQ_SPORT0_RX IRQ_DMA2_0 /* DMA2 0 (SPORT0 RX) */
178#define IRQ_DMA2_1 (IVG_BASE + 24) /* DMA2 1 (SPORT0 TX) */
179#define IRQ_SPORT0_TX IRQ_DMA2_1 /* DMA2 1 (SPORT0 TX) */
180#define IRQ_DMA2_2 (IVG_BASE + 25) /* DMA2 2 (SPORT1 RX) */
181#define IRQ_SPORT1_RX IRQ_DMA2_2 /* DMA2 2 (SPORT1 RX) */
182#define IRQ_DMA2_3 (IVG_BASE + 26) /* DMA2 3 (SPORT2 TX) */
183#define IRQ_SPORT1_TX IRQ_DMA2_3 /* DMA2 3 (SPORT2 TX) */
184#define IRQ_DMA2_4 (IVG_BASE + 27) /* DMA2 4 (SPI) */
185#define IRQ_SPI IRQ_DMA2_4 /* DMA2 4 (SPI) */
186#define IRQ_DMA2_5 (IVG_BASE + 28) /* DMA2 5 (UART RX) */
187#define IRQ_UART_RX IRQ_DMA2_5 /* DMA2 5 (UART RX) */
188#define IRQ_DMA2_6 (IVG_BASE + 29) /* DMA2 6 (UART TX) */
189#define IRQ_UART_TX IRQ_DMA2_6 /* DMA2 6 (UART TX) */
190#define IRQ_DMA2_7 (IVG_BASE + 30) /* DMA2 7 Interrupt */
191#define IRQ_DMA2_8 (IVG_BASE + 31) /* DMA2 8 Interrupt */
192#define IRQ_DMA2_9 (IVG_BASE + 32) /* DMA2 9 Interrupt */
193#define IRQ_DMA2_10 (IVG_BASE + 33) /* DMA2 10 Interrupt */
194#define IRQ_DMA2_11 (IVG_BASE + 34) /* DMA2 11 Interrupt */
195/* IVG 10 */
196#define IRQ_TIMER0 (IVG_BASE + 35) /* TIMER 0 Interrupt */
197#define IRQ_TIMER1 (IVG_BASE + 36) /* TIMER 1 Interrupt */
198#define IRQ_TIMER2 (IVG_BASE + 37) /* TIMER 2 Interrupt */
199#define IRQ_TIMER3 (IVG_BASE + 38) /* TIMER 3 Interrupt */
200#define IRQ_TIMER4 (IVG_BASE + 39) /* TIMER 4 Interrupt */
201#define IRQ_TIMER5 (IVG_BASE + 40) /* TIMER 5 Interrupt */
202#define IRQ_TIMER6 (IVG_BASE + 41) /* TIMER 6 Interrupt */
203#define IRQ_TIMER7 (IVG_BASE + 42) /* TIMER 7 Interrupt */
204#define IRQ_TIMER8 (IVG_BASE + 43) /* TIMER 8 Interrupt */
205#define IRQ_TIMER9 (IVG_BASE + 44) /* TIMER 9 Interrupt */
206#define IRQ_TIMER10 (IVG_BASE + 45) /* TIMER 10 Interrupt */
207#define IRQ_TIMER11 (IVG_BASE + 46) /* TIMER 11 Interrupt */
208/* IVG 11 */
209#define IRQ_PROG0_INTA (IVG_BASE + 47) /* Programmable Flags0 A (8) */
210#define IRQ_PROG_INTA IRQ_PROG0_INTA /* Programmable Flags0 A (8) */
211#define IRQ_PROG0_INTB (IVG_BASE + 48) /* Programmable Flags0 B (8) */
212#define IRQ_PROG_INTB IRQ_PROG0_INTB /* Programmable Flags0 B (8) */
213#define IRQ_PROG1_INTA (IVG_BASE + 49) /* Programmable Flags1 A (8) */
214#define IRQ_PROG1_INTB (IVG_BASE + 50) /* Programmable Flags1 B (8) */
215#define IRQ_PROG2_INTA (IVG_BASE + 51) /* Programmable Flags2 A (8) */
216#define IRQ_PROG2_INTB (IVG_BASE + 52) /* Programmable Flags2 B (8) */
217/* IVG 8 */
218#define IRQ_DMA1_WRRD0 (IVG_BASE + 53) /* MDMA1 0 write/read INT */
219#define IRQ_DMA_WRRD0 IRQ_DMA1_WRRD0 /* MDMA1 0 write/read INT */
220#define IRQ_MEM_DMA0 IRQ_DMA1_WRRD0
221#define IRQ_DMA1_WRRD1 (IVG_BASE + 54) /* MDMA1 1 write/read INT */
222#define IRQ_DMA_WRRD1 IRQ_DMA1_WRRD1 /* MDMA1 1 write/read INT */
223#define IRQ_MEM_DMA1 IRQ_DMA1_WRRD1
224/* IVG 9 */
225#define IRQ_DMA2_WRRD0 (IVG_BASE + 55) /* MDMA2 0 write/read INT */
226#define IRQ_MEM_DMA2 IRQ_DMA2_WRRD0
227#define IRQ_DMA2_WRRD1 (IVG_BASE + 56) /* MDMA2 1 write/read INT */
228#define IRQ_MEM_DMA3 IRQ_DMA2_WRRD1
229/* IVG 12 */
230#define IRQ_IMDMA_WRRD0 (IVG_BASE + 57) /* IMDMA 0 write/read INT */
231#define IRQ_IMEM_DMA0 IRQ_IMDMA_WRRD0
232#define IRQ_IMDMA_WRRD1 (IVG_BASE + 58) /* IMDMA 1 write/read INT */
233#define IRQ_IMEM_DMA1 IRQ_IMDMA_WRRD1
234/* IVG 13 */
235#define IRQ_WATCH (IVG_BASE + 59) /* Watch Dog Timer */
236/* IVG 7 */
237#define IRQ_RESERVED_1 (IVG_BASE + 60) /* Reserved interrupt */
238#define IRQ_RESERVED_2 (IVG_BASE + 61) /* Reserved interrupt */
239#define IRQ_SUPPLE_0 (IVG_BASE + 62) /* Supplemental interrupt 0 */
240#define IRQ_SUPPLE_1 (IVG_BASE + 63) /* supplemental interrupt 1 */
241
242#define IRQ_PF0 73
243#define IRQ_PF1 74
244#define IRQ_PF2 75
245#define IRQ_PF3 76
246#define IRQ_PF4 77
247#define IRQ_PF5 78
248#define IRQ_PF6 79
249#define IRQ_PF7 80
250#define IRQ_PF8 81
251#define IRQ_PF9 82
252#define IRQ_PF10 83
253#define IRQ_PF11 84
254#define IRQ_PF12 85
255#define IRQ_PF13 86
256#define IRQ_PF14 87
257#define IRQ_PF15 88
258#define IRQ_PF16 89
259#define IRQ_PF17 90
260#define IRQ_PF18 91
261#define IRQ_PF19 92
262#define IRQ_PF20 93
263#define IRQ_PF21 94
264#define IRQ_PF22 95
265#define IRQ_PF23 96
266#define IRQ_PF24 97
267#define IRQ_PF25 98
268#define IRQ_PF26 99
269#define IRQ_PF27 100
270#define IRQ_PF28 101
271#define IRQ_PF29 102
272#define IRQ_PF30 103
273#define IRQ_PF31 104
274#define IRQ_PF32 105
275#define IRQ_PF33 106
276#define IRQ_PF34 107
277#define IRQ_PF35 108
278#define IRQ_PF36 109
279#define IRQ_PF37 110
280#define IRQ_PF38 111
281#define IRQ_PF39 112
282#define IRQ_PF40 113
283#define IRQ_PF41 114
284#define IRQ_PF42 115
285#define IRQ_PF43 116
286#define IRQ_PF44 117
287#define IRQ_PF45 118
288#define IRQ_PF46 119
289#define IRQ_PF47 120
290
291#define GPIO_IRQ_BASE IRQ_PF0
292
293#define NR_IRQS (IRQ_PF47 + 1)
294
295#define IVG7 7
296#define IVG8 8
297#define IVG9 9
298#define IVG10 10
299#define IVG11 11
300#define IVG12 12
301#define IVG13 13
302#define IVG14 14
303#define IVG15 15
304
305/*
306 * DEFAULT PRIORITIES:
307 */
308
309#define CONFIG_DEF_PLL_WAKEUP 7
310#define CONFIG_DEF_DMA1_ERROR 7
311#define CONFIG_DEF_DMA2_ERROR 7
312#define CONFIG_DEF_IMDMA_ERROR 7
313#define CONFIG_DEF_PPI1_ERROR 7
314#define CONFIG_DEF_PPI2_ERROR 7
315#define CONFIG_DEF_SPORT0_ERROR 7
316#define CONFIG_DEF_SPORT1_ERROR 7
317#define CONFIG_DEF_SPI_ERROR 7
318#define CONFIG_DEF_UART_ERROR 7
319#define CONFIG_DEF_RESERVED_ERROR 7
320#define CONFIG_DEF_DMA1_0 8
321#define CONFIG_DEF_DMA1_1 8
322#define CONFIG_DEF_DMA1_2 8
323#define CONFIG_DEF_DMA1_3 8
324#define CONFIG_DEF_DMA1_4 8
325#define CONFIG_DEF_DMA1_5 8
326#define CONFIG_DEF_DMA1_6 8
327#define CONFIG_DEF_DMA1_7 8
328#define CONFIG_DEF_DMA1_8 8
329#define CONFIG_DEF_DMA1_9 8
330#define CONFIG_DEF_DMA1_10 8
331#define CONFIG_DEF_DMA1_11 8
332#define CONFIG_DEF_DMA2_0 9
333#define CONFIG_DEF_DMA2_1 9
334#define CONFIG_DEF_DMA2_2 9
335#define CONFIG_DEF_DMA2_3 9
336#define CONFIG_DEF_DMA2_4 9
337#define CONFIG_DEF_DMA2_5 9
338#define CONFIG_DEF_DMA2_6 9
339#define CONFIG_DEF_DMA2_7 9
340#define CONFIG_DEF_DMA2_8 9
341#define CONFIG_DEF_DMA2_9 9
342#define CONFIG_DEF_DMA2_10 9
343#define CONFIG_DEF_DMA2_11 9
344#define CONFIG_DEF_TIMER0 10
345#define CONFIG_DEF_TIMER1 10
346#define CONFIG_DEF_TIMER2 10
347#define CONFIG_DEF_TIMER3 10
348#define CONFIG_DEF_TIMER4 10
349#define CONFIG_DEF_TIMER5 10
350#define CONFIG_DEF_TIMER6 10
351#define CONFIG_DEF_TIMER7 10
352#define CONFIG_DEF_TIMER8 10
353#define CONFIG_DEF_TIMER9 10
354#define CONFIG_DEF_TIMER10 10
355#define CONFIG_DEF_TIMER11 10
356#define CONFIG_DEF_PROG0_INTA 11
357#define CONFIG_DEF_PROG0_INTB 11
358#define CONFIG_DEF_PROG1_INTA 11
359#define CONFIG_DEF_PROG1_INTB 11
360#define CONFIG_DEF_PROG2_INTA 11
361#define CONFIG_DEF_PROG2_INTB 11
362#define CONFIG_DEF_DMA1_WRRD0 8
363#define CONFIG_DEF_DMA1_WRRD1 8
364#define CONFIG_DEF_DMA2_WRRD0 9
365#define CONFIG_DEF_DMA2_WRRD1 9
366#define CONFIG_DEF_IMDMA_WRRD0 12
367#define CONFIG_DEF_IMDMA_WRRD1 12
368#define CONFIG_DEF_WATCH 13
369#define CONFIG_DEF_RESERVED_1 7
370#define CONFIG_DEF_RESERVED_2 7
371#define CONFIG_DEF_SUPPLE_0 7
372#define CONFIG_DEF_SUPPLE_1 7
373
374/* IAR0 BIT FIELDS */
375#define IRQ_PLL_WAKEUP_POS 0
376#define IRQ_DMA1_ERROR_POS 4
377#define IRQ_DMA2_ERROR_POS 8
378#define IRQ_IMDMA_ERROR_POS 12
379#define IRQ_PPI0_ERROR_POS 16
380#define IRQ_PPI1_ERROR_POS 20
381#define IRQ_SPORT0_ERROR_POS 24
382#define IRQ_SPORT1_ERROR_POS 28
383/* IAR1 BIT FIELDS */
384#define IRQ_SPI_ERROR_POS 0
385#define IRQ_UART_ERROR_POS 4
386#define IRQ_RESERVED_ERROR_POS 8
387#define IRQ_DMA1_0_POS 12
388#define IRQ_DMA1_1_POS 16
389#define IRQ_DMA1_2_POS 20
390#define IRQ_DMA1_3_POS 24
391#define IRQ_DMA1_4_POS 28
392/* IAR2 BIT FIELDS */
393#define IRQ_DMA1_5_POS 0
394#define IRQ_DMA1_6_POS 4
395#define IRQ_DMA1_7_POS 8
396#define IRQ_DMA1_8_POS 12
397#define IRQ_DMA1_9_POS 16
398#define IRQ_DMA1_10_POS 20
399#define IRQ_DMA1_11_POS 24
400#define IRQ_DMA2_0_POS 28
401/* IAR3 BIT FIELDS */
402#define IRQ_DMA2_1_POS 0
403#define IRQ_DMA2_2_POS 4
404#define IRQ_DMA2_3_POS 8
405#define IRQ_DMA2_4_POS 12
406#define IRQ_DMA2_5_POS 16
407#define IRQ_DMA2_6_POS 20
408#define IRQ_DMA2_7_POS 24
409#define IRQ_DMA2_8_POS 28
410/* IAR4 BIT FIELDS */
411#define IRQ_DMA2_9_POS 0
412#define IRQ_DMA2_10_POS 4
413#define IRQ_DMA2_11_POS 8
414#define IRQ_TIMER0_POS 12
415#define IRQ_TIMER1_POS 16
416#define IRQ_TIMER2_POS 20
417#define IRQ_TIMER3_POS 24
418#define IRQ_TIMER4_POS 28
419/* IAR5 BIT FIELDS */
420#define IRQ_TIMER5_POS 0
421#define IRQ_TIMER6_POS 4
422#define IRQ_TIMER7_POS 8
423#define IRQ_TIMER8_POS 12
424#define IRQ_TIMER9_POS 16
425#define IRQ_TIMER10_POS 20
426#define IRQ_TIMER11_POS 24
427#define IRQ_PROG0_INTA_POS 28
428/* IAR6 BIT FIELDS */
429#define IRQ_PROG0_INTB_POS 0
430#define IRQ_PROG1_INTA_POS 4
431#define IRQ_PROG1_INTB_POS 8
432#define IRQ_PROG2_INTA_POS 12
433#define IRQ_PROG2_INTB_POS 16
434#define IRQ_DMA1_WRRD0_POS 20
435#define IRQ_DMA1_WRRD1_POS 24
436#define IRQ_DMA2_WRRD0_POS 28
437/* IAR7 BIT FIELDS */
438#define IRQ_DMA2_WRRD1_POS 0
439#define IRQ_IMDMA_WRRD0_POS 4
440#define IRQ_IMDMA_WRRD1_POS 8
441#define IRQ_WDTIMER_POS 12
442#define IRQ_RESERVED_1_POS 16
443#define IRQ_RESERVED_2_POS 20
444#define IRQ_SUPPLE_0_POS 24
445#define IRQ_SUPPLE_1_POS 28
446
447#endif /* _BF561_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf561/mem_init.h b/include/asm-blackfin/mach-bf561/mem_init.h
deleted file mode 100644
index e163260bca18..000000000000
--- a/include/asm-blackfin/mach-bf561/mem_init.h
+++ /dev/null
@@ -1,295 +0,0 @@
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/* Equation from section 17 (p17-46) of BF533 HRM */
135#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
136
137/* Enable SCLK Out */
138#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
139
140#if defined CONFIG_CLKIN_HALF
141#define CLKIN_HALF 1
142#else
143#define CLKIN_HALF 0
144#endif
145
146#if defined CONFIG_PLL_BYPASS
147#define PLL_BYPASS 1
148#else
149#define PLL_BYPASS 0
150#endif
151
152/***************************************Currently Not Being Used *********************************/
153#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
154#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
155#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
156#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
157#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
158
159#if (flash_EBIU_AMBCTL_TT > 3)
160#define flash_EBIU_AMBCTL0_TT B0TT_4
161#endif
162#if (flash_EBIU_AMBCTL_TT == 3)
163#define flash_EBIU_AMBCTL0_TT B0TT_3
164#endif
165#if (flash_EBIU_AMBCTL_TT == 2)
166#define flash_EBIU_AMBCTL0_TT B0TT_2
167#endif
168#if (flash_EBIU_AMBCTL_TT < 2)
169#define flash_EBIU_AMBCTL0_TT B0TT_1
170#endif
171
172#if (flash_EBIU_AMBCTL_ST > 3)
173#define flash_EBIU_AMBCTL0_ST B0ST_4
174#endif
175#if (flash_EBIU_AMBCTL_ST == 3)
176#define flash_EBIU_AMBCTL0_ST B0ST_3
177#endif
178#if (flash_EBIU_AMBCTL_ST == 2)
179#define flash_EBIU_AMBCTL0_ST B0ST_2
180#endif
181#if (flash_EBIU_AMBCTL_ST < 2)
182#define flash_EBIU_AMBCTL0_ST B0ST_1
183#endif
184
185#if (flash_EBIU_AMBCTL_HT > 2)
186#define flash_EBIU_AMBCTL0_HT B0HT_3
187#endif
188#if (flash_EBIU_AMBCTL_HT == 2)
189#define flash_EBIU_AMBCTL0_HT B0HT_2
190#endif
191#if (flash_EBIU_AMBCTL_HT == 1)
192#define flash_EBIU_AMBCTL0_HT B0HT_1
193#endif
194#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
195#define flash_EBIU_AMBCTL0_HT B0HT_0
196#endif
197#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
198#define flash_EBIU_AMBCTL0_HT B0HT_1
199#endif
200
201#if (flash_EBIU_AMBCTL_WAT > 14)
202#define flash_EBIU_AMBCTL0_WAT B0WAT_15
203#endif
204#if (flash_EBIU_AMBCTL_WAT == 14)
205#define flash_EBIU_AMBCTL0_WAT B0WAT_14
206#endif
207#if (flash_EBIU_AMBCTL_WAT == 13)
208#define flash_EBIU_AMBCTL0_WAT B0WAT_13
209#endif
210#if (flash_EBIU_AMBCTL_WAT == 12)
211#define flash_EBIU_AMBCTL0_WAT B0WAT_12
212#endif
213#if (flash_EBIU_AMBCTL_WAT == 11)
214#define flash_EBIU_AMBCTL0_WAT B0WAT_11
215#endif
216#if (flash_EBIU_AMBCTL_WAT == 10)
217#define flash_EBIU_AMBCTL0_WAT B0WAT_10
218#endif
219#if (flash_EBIU_AMBCTL_WAT == 9)
220#define flash_EBIU_AMBCTL0_WAT B0WAT_9
221#endif
222#if (flash_EBIU_AMBCTL_WAT == 8)
223#define flash_EBIU_AMBCTL0_WAT B0WAT_8
224#endif
225#if (flash_EBIU_AMBCTL_WAT == 7)
226#define flash_EBIU_AMBCTL0_WAT B0WAT_7
227#endif
228#if (flash_EBIU_AMBCTL_WAT == 6)
229#define flash_EBIU_AMBCTL0_WAT B0WAT_6
230#endif
231#if (flash_EBIU_AMBCTL_WAT == 5)
232#define flash_EBIU_AMBCTL0_WAT B0WAT_5
233#endif
234#if (flash_EBIU_AMBCTL_WAT == 4)
235#define flash_EBIU_AMBCTL0_WAT B0WAT_4
236#endif
237#if (flash_EBIU_AMBCTL_WAT == 3)
238#define flash_EBIU_AMBCTL0_WAT B0WAT_3
239#endif
240#if (flash_EBIU_AMBCTL_WAT == 2)
241#define flash_EBIU_AMBCTL0_WAT B0WAT_2
242#endif
243#if (flash_EBIU_AMBCTL_WAT == 1)
244#define flash_EBIU_AMBCTL0_WAT B0WAT_1
245#endif
246
247#if (flash_EBIU_AMBCTL_RAT > 14)
248#define flash_EBIU_AMBCTL0_RAT B0RAT_15
249#endif
250#if (flash_EBIU_AMBCTL_RAT == 14)
251#define flash_EBIU_AMBCTL0_RAT B0RAT_14
252#endif
253#if (flash_EBIU_AMBCTL_RAT == 13)
254#define flash_EBIU_AMBCTL0_RAT B0RAT_13
255#endif
256#if (flash_EBIU_AMBCTL_RAT == 12)
257#define flash_EBIU_AMBCTL0_RAT B0RAT_12
258#endif
259#if (flash_EBIU_AMBCTL_RAT == 11)
260#define flash_EBIU_AMBCTL0_RAT B0RAT_11
261#endif
262#if (flash_EBIU_AMBCTL_RAT == 10)
263#define flash_EBIU_AMBCTL0_RAT B0RAT_10
264#endif
265#if (flash_EBIU_AMBCTL_RAT == 9)
266#define flash_EBIU_AMBCTL0_RAT B0RAT_9
267#endif
268#if (flash_EBIU_AMBCTL_RAT == 8)
269#define flash_EBIU_AMBCTL0_RAT B0RAT_8
270#endif
271#if (flash_EBIU_AMBCTL_RAT == 7)
272#define flash_EBIU_AMBCTL0_RAT B0RAT_7
273#endif
274#if (flash_EBIU_AMBCTL_RAT == 6)
275#define flash_EBIU_AMBCTL0_RAT B0RAT_6
276#endif
277#if (flash_EBIU_AMBCTL_RAT == 5)
278#define flash_EBIU_AMBCTL0_RAT B0RAT_5
279#endif
280#if (flash_EBIU_AMBCTL_RAT == 4)
281#define flash_EBIU_AMBCTL0_RAT B0RAT_4
282#endif
283#if (flash_EBIU_AMBCTL_RAT == 3)
284#define flash_EBIU_AMBCTL0_RAT B0RAT_3
285#endif
286#if (flash_EBIU_AMBCTL_RAT == 2)
287#define flash_EBIU_AMBCTL0_RAT B0RAT_2
288#endif
289#if (flash_EBIU_AMBCTL_RAT == 1)
290#define flash_EBIU_AMBCTL0_RAT B0RAT_1
291#endif
292
293#define flash_EBIU_AMBCTL0 \
294 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
295 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
deleted file mode 100644
index c26d8486cc4b..000000000000
--- a/include/asm-blackfin/mach-bf561/mem_map.h
+++ /dev/null
@@ -1,78 +0,0 @@
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/* Boot ROM Memory */
23
24#define BOOT_ROM_START 0xEF000000
25#define BOOT_ROM_LENGTH 0x800
26
27/* Level 1 Memory */
28
29#ifdef CONFIG_BFIN_ICACHE
30#define BFIN_ICACHESIZE (16*1024)
31#else
32#define BFIN_ICACHESIZE (0*1024)
33#endif
34
35/* Memory Map for ADSP-BF561 processors */
36
37#ifdef CONFIG_BF561
38#define L1_CODE_START 0xFFA00000
39#define L1_DATA_A_START 0xFF800000
40#define L1_DATA_B_START 0xFF900000
41
42#define L1_CODE_LENGTH 0x4000
43
44#ifdef CONFIG_BFIN_DCACHE
45
46#ifdef CONFIG_BFIN_DCACHE_BANKA
47#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
48#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
49#define L1_DATA_B_LENGTH 0x8000
50#define BFIN_DCACHESIZE (16*1024)
51#define BFIN_DSUPBANKS 1
52#else
53#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
54#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
55#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
56#define BFIN_DCACHESIZE (32*1024)
57#define BFIN_DSUPBANKS 2
58#endif
59
60#else
61#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
62#define L1_DATA_A_LENGTH 0x8000
63#define L1_DATA_B_LENGTH 0x8000
64#define BFIN_DCACHESIZE (0*1024)
65#define BFIN_DSUPBANKS 0
66#endif /*CONFIG_BFIN_DCACHE*/
67#endif
68
69/* Level 2 Memory */
70#define L2_START 0xFEB00000
71#define L2_LENGTH 0x20000
72
73/* Scratch Pad Memory */
74
75#define L1_SCRATCH_START 0xFFB00000
76#define L1_SCRATCH_LENGTH 0x1000
77
78#endif /* _MEM_MAP_533_H_ */
diff --git a/include/asm-blackfin/mach-bf561/portmux.h b/include/asm-blackfin/mach-bf561/portmux.h
deleted file mode 100644
index a6ee8206efb6..000000000000
--- a/include/asm-blackfin/mach-bf561/portmux.h
+++ /dev/null
@@ -1,89 +0,0 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
5
6#define P_PPI0_CLK (P_DONTCARE)
7#define P_PPI0_FS1 (P_DONTCARE)
8#define P_PPI0_FS2 (P_DONTCARE)
9#define P_PPI0_FS3 (P_DONTCARE)
10#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF47))
11#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF46))
12#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF45))
13#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF44))
14#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF43))
15#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF42))
16#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF41))
17#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF40))
18#define P_PPI0_D0 (P_DONTCARE)
19#define P_PPI0_D1 (P_DONTCARE)
20#define P_PPI0_D2 (P_DONTCARE)
21#define P_PPI0_D3 (P_DONTCARE)
22#define P_PPI0_D4 (P_DONTCARE)
23#define P_PPI0_D5 (P_DONTCARE)
24#define P_PPI0_D6 (P_DONTCARE)
25#define P_PPI0_D7 (P_DONTCARE)
26#define P_PPI1_CLK (P_DONTCARE)
27#define P_PPI1_FS1 (P_DONTCARE)
28#define P_PPI1_FS2 (P_DONTCARE)
29#define P_PPI1_FS3 (P_DONTCARE)
30#define P_PPI1_D15 (P_DEFINED | P_IDENT(GPIO_PF39))
31#define P_PPI1_D14 (P_DEFINED | P_IDENT(GPIO_PF38))
32#define P_PPI1_D13 (P_DEFINED | P_IDENT(GPIO_PF37))
33#define P_PPI1_D12 (P_DEFINED | P_IDENT(GPIO_PF36))
34#define P_PPI1_D11 (P_DEFINED | P_IDENT(GPIO_PF35))
35#define P_PPI1_D10 (P_DEFINED | P_IDENT(GPIO_PF34))
36#define P_PPI1_D9 (P_DEFINED | P_IDENT(GPIO_PF33))
37#define P_PPI1_D8 (P_DEFINED | P_IDENT(GPIO_PF32))
38#define P_PPI1_D0 (P_DONTCARE)
39#define P_PPI1_D1 (P_DONTCARE)
40#define P_PPI1_D2 (P_DONTCARE)
41#define P_PPI1_D3 (P_DONTCARE)
42#define P_PPI1_D4 (P_DONTCARE)
43#define P_PPI1_D5 (P_DONTCARE)
44#define P_PPI1_D6 (P_DONTCARE)
45#define P_PPI1_D7 (P_DONTCARE)
46#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PF31))
47#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PF30))
48#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PF29))
49#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PF28))
50#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PF27))
51#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PF26))
52#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PF25))
53#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PF24))
54#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PF23))
55#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PF22))
56#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PF21))
57#define P_SPORT1_DRPRI (P_DONTCARE)
58#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PF20))
59#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PF19))
60#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PF18))
61#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PF17))
62#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PF16))
63#define P_SPORT0_DRPRI (P_DONTCARE)
64#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15))
65#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(GPIO_PF7))
66#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF6))
67#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5))
68#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF4))
69#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PF3))
70#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2))
71#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1))
72#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0))
73#define P_TMR11 (P_DONTCARE)
74#define P_TMR10 (P_DONTCARE)
75#define P_TMR9 (P_DONTCARE)
76#define P_TMR8 (P_DONTCARE)
77#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PF7))
78#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PF6))
79#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PF5))
80#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PF4))
81#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PF3))
82#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PF2))
83#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PF1))
84#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PF0))
85#define P_SPI0_MOSI (P_DONTCARE)
86#define P_SPI0_MISO (P_DONTCARE)
87#define P_SPI0_SCK (P_DONTCARE)
88
89#endif /* _MACH_PORTMUX_H_ */
diff --git a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
deleted file mode 100644
index d39c396f850d..000000000000
--- a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
+++ /dev/null
@@ -1,328 +0,0 @@
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 bfin_read_SRAM_BASE_ADDRESS() bfin_read32(SRAM_BASE_ADDRESS)
40#define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val)
41#define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL)
42#define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val)
43#define bfin_read_DCPLB_STATUS() bfin_read32(DCPLB_STATUS)
44#define bfin_write_DCPLB_STATUS(val) bfin_write32(DCPLB_STATUS,val)
45#define bfin_read_DCPLB_FAULT_ADDR() bfin_read32(DCPLB_FAULT_ADDR)
46#define bfin_write_DCPLB_FAULT_ADDR(val) bfin_write32(DCPLB_FAULT_ADDR,val)
47/*
48#define MMR_TIMEOUT 0xFFE00010
49*/
50#define bfin_read_DCPLB_ADDR0() bfin_read32(DCPLB_ADDR0)
51#define bfin_write_DCPLB_ADDR0(val) bfin_write32(DCPLB_ADDR0,val)
52#define bfin_read_DCPLB_ADDR1() bfin_read32(DCPLB_ADDR1)
53#define bfin_write_DCPLB_ADDR1(val) bfin_write32(DCPLB_ADDR1,val)
54#define bfin_read_DCPLB_ADDR2() bfin_read32(DCPLB_ADDR2)
55#define bfin_write_DCPLB_ADDR2(val) bfin_write32(DCPLB_ADDR2,val)
56#define bfin_read_DCPLB_ADDR3() bfin_read32(DCPLB_ADDR3)
57#define bfin_write_DCPLB_ADDR3(val) bfin_write32(DCPLB_ADDR3,val)
58#define bfin_read_DCPLB_ADDR4() bfin_read32(DCPLB_ADDR4)
59#define bfin_write_DCPLB_ADDR4(val) bfin_write32(DCPLB_ADDR4,val)
60#define bfin_read_DCPLB_ADDR5() bfin_read32(DCPLB_ADDR5)
61#define bfin_write_DCPLB_ADDR5(val) bfin_write32(DCPLB_ADDR5,val)
62#define bfin_read_DCPLB_ADDR6() bfin_read32(DCPLB_ADDR6)
63#define bfin_write_DCPLB_ADDR6(val) bfin_write32(DCPLB_ADDR6,val)
64#define bfin_read_DCPLB_ADDR7() bfin_read32(DCPLB_ADDR7)
65#define bfin_write_DCPLB_ADDR7(val) bfin_write32(DCPLB_ADDR7,val)
66#define bfin_read_DCPLB_ADDR8() bfin_read32(DCPLB_ADDR8)
67#define bfin_write_DCPLB_ADDR8(val) bfin_write32(DCPLB_ADDR8,val)
68#define bfin_read_DCPLB_ADDR9() bfin_read32(DCPLB_ADDR9)
69#define bfin_write_DCPLB_ADDR9(val) bfin_write32(DCPLB_ADDR9,val)
70#define bfin_read_DCPLB_ADDR10() bfin_read32(DCPLB_ADDR10)
71#define bfin_write_DCPLB_ADDR10(val) bfin_write32(DCPLB_ADDR10,val)
72#define bfin_read_DCPLB_ADDR11() bfin_read32(DCPLB_ADDR11)
73#define bfin_write_DCPLB_ADDR11(val) bfin_write32(DCPLB_ADDR11,val)
74#define bfin_read_DCPLB_ADDR12() bfin_read32(DCPLB_ADDR12)
75#define bfin_write_DCPLB_ADDR12(val) bfin_write32(DCPLB_ADDR12,val)
76#define bfin_read_DCPLB_ADDR13() bfin_read32(DCPLB_ADDR13)
77#define bfin_write_DCPLB_ADDR13(val) bfin_write32(DCPLB_ADDR13,val)
78#define bfin_read_DCPLB_ADDR14() bfin_read32(DCPLB_ADDR14)
79#define bfin_write_DCPLB_ADDR14(val) bfin_write32(DCPLB_ADDR14,val)
80#define bfin_read_DCPLB_ADDR15() bfin_read32(DCPLB_ADDR15)
81#define bfin_write_DCPLB_ADDR15(val) bfin_write32(DCPLB_ADDR15,val)
82#define bfin_read_DCPLB_DATA0() bfin_read32(DCPLB_DATA0)
83#define bfin_write_DCPLB_DATA0(val) bfin_write32(DCPLB_DATA0,val)
84#define bfin_read_DCPLB_DATA1() bfin_read32(DCPLB_DATA1)
85#define bfin_write_DCPLB_DATA1(val) bfin_write32(DCPLB_DATA1,val)
86#define bfin_read_DCPLB_DATA2() bfin_read32(DCPLB_DATA2)
87#define bfin_write_DCPLB_DATA2(val) bfin_write32(DCPLB_DATA2,val)
88#define bfin_read_DCPLB_DATA3() bfin_read32(DCPLB_DATA3)
89#define bfin_write_DCPLB_DATA3(val) bfin_write32(DCPLB_DATA3,val)
90#define bfin_read_DCPLB_DATA4() bfin_read32(DCPLB_DATA4)
91#define bfin_write_DCPLB_DATA4(val) bfin_write32(DCPLB_DATA4,val)
92#define bfin_read_DCPLB_DATA5() bfin_read32(DCPLB_DATA5)
93#define bfin_write_DCPLB_DATA5(val) bfin_write32(DCPLB_DATA5,val)
94#define bfin_read_DCPLB_DATA6() bfin_read32(DCPLB_DATA6)
95#define bfin_write_DCPLB_DATA6(val) bfin_write32(DCPLB_DATA6,val)
96#define bfin_read_DCPLB_DATA7() bfin_read32(DCPLB_DATA7)
97#define bfin_write_DCPLB_DATA7(val) bfin_write32(DCPLB_DATA7,val)
98#define bfin_read_DCPLB_DATA8() bfin_read32(DCPLB_DATA8)
99#define bfin_write_DCPLB_DATA8(val) bfin_write32(DCPLB_DATA8,val)
100#define bfin_read_DCPLB_DATA9() bfin_read32(DCPLB_DATA9)
101#define bfin_write_DCPLB_DATA9(val) bfin_write32(DCPLB_DATA9,val)
102#define bfin_read_DCPLB_DATA10() bfin_read32(DCPLB_DATA10)
103#define bfin_write_DCPLB_DATA10(val) bfin_write32(DCPLB_DATA10,val)
104#define bfin_read_DCPLB_DATA11() bfin_read32(DCPLB_DATA11)
105#define bfin_write_DCPLB_DATA11(val) bfin_write32(DCPLB_DATA11,val)
106#define bfin_read_DCPLB_DATA12() bfin_read32(DCPLB_DATA12)
107#define bfin_write_DCPLB_DATA12(val) bfin_write32(DCPLB_DATA12,val)
108#define bfin_read_DCPLB_DATA13() bfin_read32(DCPLB_DATA13)
109#define bfin_write_DCPLB_DATA13(val) bfin_write32(DCPLB_DATA13,val)
110#define bfin_read_DCPLB_DATA14() bfin_read32(DCPLB_DATA14)
111#define bfin_write_DCPLB_DATA14(val) bfin_write32(DCPLB_DATA14,val)
112#define bfin_read_DCPLB_DATA15() bfin_read32(DCPLB_DATA15)
113#define bfin_write_DCPLB_DATA15(val) bfin_write32(DCPLB_DATA15,val)
114#define bfin_read_DTEST_COMMAND() bfin_read32(DTEST_COMMAND)
115#define bfin_write_DTEST_COMMAND(val) bfin_write32(DTEST_COMMAND,val)
116/*
117#define DTEST_INDEX 0xFFE00304
118*/
119#define bfin_read_DTEST_DATA0() bfin_read32(DTEST_DATA0)
120#define bfin_write_DTEST_DATA0(val) bfin_write32(DTEST_DATA0,val)
121#define bfin_read_DTEST_DATA1() bfin_read32(DTEST_DATA1)
122#define bfin_write_DTEST_DATA1(val) bfin_write32(DTEST_DATA1,val)
123/*
124#define DTEST_DATA2 0xFFE00408
125#define DTEST_DATA3 0xFFE0040C
126*/
127#define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL)
128#define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val)
129#define bfin_read_ICPLB_STATUS() bfin_read32(ICPLB_STATUS)
130#define bfin_write_ICPLB_STATUS(val) bfin_write32(ICPLB_STATUS,val)
131#define bfin_read_ICPLB_FAULT_ADDR() bfin_read32(ICPLB_FAULT_ADDR)
132#define bfin_write_ICPLB_FAULT_ADDR(val) bfin_write32(ICPLB_FAULT_ADDR,val)
133#define bfin_read_ICPLB_ADDR0() bfin_read32(ICPLB_ADDR0)
134#define bfin_write_ICPLB_ADDR0(val) bfin_write32(ICPLB_ADDR0,val)
135#define bfin_read_ICPLB_ADDR1() bfin_read32(ICPLB_ADDR1)
136#define bfin_write_ICPLB_ADDR1(val) bfin_write32(ICPLB_ADDR1,val)
137#define bfin_read_ICPLB_ADDR2() bfin_read32(ICPLB_ADDR2)
138#define bfin_write_ICPLB_ADDR2(val) bfin_write32(ICPLB_ADDR2,val)
139#define bfin_read_ICPLB_ADDR3() bfin_read32(ICPLB_ADDR3)
140#define bfin_write_ICPLB_ADDR3(val) bfin_write32(ICPLB_ADDR3,val)
141#define bfin_read_ICPLB_ADDR4() bfin_read32(ICPLB_ADDR4)
142#define bfin_write_ICPLB_ADDR4(val) bfin_write32(ICPLB_ADDR4,val)
143#define bfin_read_ICPLB_ADDR5() bfin_read32(ICPLB_ADDR5)
144#define bfin_write_ICPLB_ADDR5(val) bfin_write32(ICPLB_ADDR5,val)
145#define bfin_read_ICPLB_ADDR6() bfin_read32(ICPLB_ADDR6)
146#define bfin_write_ICPLB_ADDR6(val) bfin_write32(ICPLB_ADDR6,val)
147#define bfin_read_ICPLB_ADDR7() bfin_read32(ICPLB_ADDR7)
148#define bfin_write_ICPLB_ADDR7(val) bfin_write32(ICPLB_ADDR7,val)
149#define bfin_read_ICPLB_ADDR8() bfin_read32(ICPLB_ADDR8)
150#define bfin_write_ICPLB_ADDR8(val) bfin_write32(ICPLB_ADDR8,val)
151#define bfin_read_ICPLB_ADDR9() bfin_read32(ICPLB_ADDR9)
152#define bfin_write_ICPLB_ADDR9(val) bfin_write32(ICPLB_ADDR9,val)
153#define bfin_read_ICPLB_ADDR10() bfin_read32(ICPLB_ADDR10)
154#define bfin_write_ICPLB_ADDR10(val) bfin_write32(ICPLB_ADDR10,val)
155#define bfin_read_ICPLB_ADDR11() bfin_read32(ICPLB_ADDR11)
156#define bfin_write_ICPLB_ADDR11(val) bfin_write32(ICPLB_ADDR11,val)
157#define bfin_read_ICPLB_ADDR12() bfin_read32(ICPLB_ADDR12)
158#define bfin_write_ICPLB_ADDR12(val) bfin_write32(ICPLB_ADDR12,val)
159#define bfin_read_ICPLB_ADDR13() bfin_read32(ICPLB_ADDR13)
160#define bfin_write_ICPLB_ADDR13(val) bfin_write32(ICPLB_ADDR13,val)
161#define bfin_read_ICPLB_ADDR14() bfin_read32(ICPLB_ADDR14)
162#define bfin_write_ICPLB_ADDR14(val) bfin_write32(ICPLB_ADDR14,val)
163#define bfin_read_ICPLB_ADDR15() bfin_read32(ICPLB_ADDR15)
164#define bfin_write_ICPLB_ADDR15(val) bfin_write32(ICPLB_ADDR15,val)
165#define bfin_read_ICPLB_DATA0() bfin_read32(ICPLB_DATA0)
166#define bfin_write_ICPLB_DATA0(val) bfin_write32(ICPLB_DATA0,val)
167#define bfin_read_ICPLB_DATA1() bfin_read32(ICPLB_DATA1)
168#define bfin_write_ICPLB_DATA1(val) bfin_write32(ICPLB_DATA1,val)
169#define bfin_read_ICPLB_DATA2() bfin_read32(ICPLB_DATA2)
170#define bfin_write_ICPLB_DATA2(val) bfin_write32(ICPLB_DATA2,val)
171#define bfin_read_ICPLB_DATA3() bfin_read32(ICPLB_DATA3)
172#define bfin_write_ICPLB_DATA3(val) bfin_write32(ICPLB_DATA3,val)
173#define bfin_read_ICPLB_DATA4() bfin_read32(ICPLB_DATA4)
174#define bfin_write_ICPLB_DATA4(val) bfin_write32(ICPLB_DATA4,val)
175#define bfin_read_ICPLB_DATA5() bfin_read32(ICPLB_DATA5)
176#define bfin_write_ICPLB_DATA5(val) bfin_write32(ICPLB_DATA5,val)
177#define bfin_read_ICPLB_DATA6() bfin_read32(ICPLB_DATA6)
178#define bfin_write_ICPLB_DATA6(val) bfin_write32(ICPLB_DATA6,val)
179#define bfin_read_ICPLB_DATA7() bfin_read32(ICPLB_DATA7)
180#define bfin_write_ICPLB_DATA7(val) bfin_write32(ICPLB_DATA7,val)
181#define bfin_read_ICPLB_DATA8() bfin_read32(ICPLB_DATA8)
182#define bfin_write_ICPLB_DATA8(val) bfin_write32(ICPLB_DATA8,val)
183#define bfin_read_ICPLB_DATA9() bfin_read32(ICPLB_DATA9)
184#define bfin_write_ICPLB_DATA9(val) bfin_write32(ICPLB_DATA9,val)
185#define bfin_read_ICPLB_DATA10() bfin_read32(ICPLB_DATA10)
186#define bfin_write_ICPLB_DATA10(val) bfin_write32(ICPLB_DATA10,val)
187#define bfin_read_ICPLB_DATA11() bfin_read32(ICPLB_DATA11)
188#define bfin_write_ICPLB_DATA11(val) bfin_write32(ICPLB_DATA11,val)
189#define bfin_read_ICPLB_DATA12() bfin_read32(ICPLB_DATA12)
190#define bfin_write_ICPLB_DATA12(val) bfin_write32(ICPLB_DATA12,val)
191#define bfin_read_ICPLB_DATA13() bfin_read32(ICPLB_DATA13)
192#define bfin_write_ICPLB_DATA13(val) bfin_write32(ICPLB_DATA13,val)
193#define bfin_read_ICPLB_DATA14() bfin_read32(ICPLB_DATA14)
194#define bfin_write_ICPLB_DATA14(val) bfin_write32(ICPLB_DATA14,val)
195#define bfin_read_ICPLB_DATA15() bfin_read32(ICPLB_DATA15)
196#define bfin_write_ICPLB_DATA15(val) bfin_write32(ICPLB_DATA15,val)
197#define bfin_read_ITEST_COMMAND() bfin_read32(ITEST_COMMAND)
198#define bfin_write_ITEST_COMMAND(val) bfin_write32(ITEST_COMMAND,val)
199#if 0
200#define ITEST_INDEX 0xFFE01304 /* Instruction Test Index Register */
201#endif
202#define bfin_read_ITEST_DATA0() bfin_read32(ITEST_DATA0)
203#define bfin_write_ITEST_DATA0(val) bfin_write32(ITEST_DATA0,val)
204#define bfin_read_ITEST_DATA1() bfin_read32(ITEST_DATA1)
205#define bfin_write_ITEST_DATA1(val) bfin_write32(ITEST_DATA1,val)
206
207/* Event/Interrupt Registers*/
208
209#define bfin_read_EVT0() bfin_read32(EVT0)
210#define bfin_write_EVT0(val) bfin_write32(EVT0,val)
211#define bfin_read_EVT1() bfin_read32(EVT1)
212#define bfin_write_EVT1(val) bfin_write32(EVT1,val)
213#define bfin_read_EVT2() bfin_read32(EVT2)
214#define bfin_write_EVT2(val) bfin_write32(EVT2,val)
215#define bfin_read_EVT3() bfin_read32(EVT3)
216#define bfin_write_EVT3(val) bfin_write32(EVT3,val)
217#define bfin_read_EVT4() bfin_read32(EVT4)
218#define bfin_write_EVT4(val) bfin_write32(EVT4,val)
219#define bfin_read_EVT5() bfin_read32(EVT5)
220#define bfin_write_EVT5(val) bfin_write32(EVT5,val)
221#define bfin_read_EVT6() bfin_read32(EVT6)
222#define bfin_write_EVT6(val) bfin_write32(EVT6,val)
223#define bfin_read_EVT7() bfin_read32(EVT7)
224#define bfin_write_EVT7(val) bfin_write32(EVT7,val)
225#define bfin_read_EVT8() bfin_read32(EVT8)
226#define bfin_write_EVT8(val) bfin_write32(EVT8,val)
227#define bfin_read_EVT9() bfin_read32(EVT9)
228#define bfin_write_EVT9(val) bfin_write32(EVT9,val)
229#define bfin_read_EVT10() bfin_read32(EVT10)
230#define bfin_write_EVT10(val) bfin_write32(EVT10,val)
231#define bfin_read_EVT11() bfin_read32(EVT11)
232#define bfin_write_EVT11(val) bfin_write32(EVT11,val)
233#define bfin_read_EVT12() bfin_read32(EVT12)
234#define bfin_write_EVT12(val) bfin_write32(EVT12,val)
235#define bfin_read_EVT13() bfin_read32(EVT13)
236#define bfin_write_EVT13(val) bfin_write32(EVT13,val)
237#define bfin_read_EVT14() bfin_read32(EVT14)
238#define bfin_write_EVT14(val) bfin_write32(EVT14,val)
239#define bfin_read_EVT15() bfin_read32(EVT15)
240#define bfin_write_EVT15(val) bfin_write32(EVT15,val)
241#define bfin_read_IMASK() bfin_read32(IMASK)
242#define bfin_write_IMASK(val) bfin_write32(IMASK,val)
243#define bfin_read_IPEND() bfin_read32(IPEND)
244#define bfin_write_IPEND(val) bfin_write32(IPEND,val)
245#define bfin_read_ILAT() bfin_read32(ILAT)
246#define bfin_write_ILAT(val) bfin_write32(ILAT,val)
247
248/*Core Timer Registers*/
249#define bfin_read_TCNTL() bfin_read32(TCNTL)
250#define bfin_write_TCNTL(val) bfin_write32(TCNTL,val)
251#define bfin_read_TPERIOD() bfin_read32(TPERIOD)
252#define bfin_write_TPERIOD(val) bfin_write32(TPERIOD,val)
253#define bfin_read_TSCALE() bfin_read32(TSCALE)
254#define bfin_write_TSCALE(val) bfin_write32(TSCALE,val)
255#define bfin_read_TCOUNT() bfin_read32(TCOUNT)
256#define bfin_write_TCOUNT(val) bfin_write32(TCOUNT,val)
257
258/*Debug/MP/Emulation Registers*/
259#define bfin_read_DSPID() bfin_read32(DSPID)
260#define bfin_write_DSPID(val) bfin_write32(DSPID,val)
261#define bfin_read_DBGCTL() bfin_read32(DBGCTL)
262#define bfin_write_DBGCTL(val) bfin_write32(DBGCTL,val)
263#define bfin_read_DBGSTAT() bfin_read32(DBGSTAT)
264#define bfin_write_DBGSTAT(val) bfin_write32(DBGSTAT,val)
265#define bfin_read_EMUDAT() bfin_read32(EMUDAT)
266#define bfin_write_EMUDAT(val) bfin_write32(EMUDAT,val)
267
268/*Trace Buffer Registers*/
269#define bfin_read_TBUFCTL() bfin_read32(TBUFCTL)
270#define bfin_write_TBUFCTL(val) bfin_write32(TBUFCTL,val)
271#define bfin_read_TBUFSTAT() bfin_read32(TBUFSTAT)
272#define bfin_write_TBUFSTAT(val) bfin_write32(TBUFSTAT,val)
273#define bfin_read_TBUF() bfin_read32(TBUF)
274#define bfin_write_TBUF(val) bfin_write32(TBUF,val)
275
276/*Watch Point Control Registers*/
277#define bfin_read_WPIACTL() bfin_read32(WPIACTL)
278#define bfin_write_WPIACTL(val) bfin_write32(WPIACTL,val)
279#define bfin_read_WPIA0() bfin_read32(WPIA0)
280#define bfin_write_WPIA0(val) bfin_write32(WPIA0,val)
281#define bfin_read_WPIA1() bfin_read32(WPIA1)
282#define bfin_write_WPIA1(val) bfin_write32(WPIA1,val)
283#define bfin_read_WPIA2() bfin_read32(WPIA2)
284#define bfin_write_WPIA2(val) bfin_write32(WPIA2,val)
285#define bfin_read_WPIA3() bfin_read32(WPIA3)
286#define bfin_write_WPIA3(val) bfin_write32(WPIA3,val)
287#define bfin_read_WPIA4() bfin_read32(WPIA4)
288#define bfin_write_WPIA4(val) bfin_write32(WPIA4,val)
289#define bfin_read_WPIA5() bfin_read32(WPIA5)
290#define bfin_write_WPIA5(val) bfin_write32(WPIA5,val)
291#define bfin_read_WPIACNT0() bfin_read32(WPIACNT0)
292#define bfin_write_WPIACNT0(val) bfin_write32(WPIACNT0,val)
293#define bfin_read_WPIACNT1() bfin_read32(WPIACNT1)
294#define bfin_write_WPIACNT1(val) bfin_write32(WPIACNT1,val)
295#define bfin_read_WPIACNT2() bfin_read32(WPIACNT2)
296#define bfin_write_WPIACNT2(val) bfin_write32(WPIACNT2,val)
297#define bfin_read_WPIACNT3() bfin_read32(WPIACNT3)
298#define bfin_write_WPIACNT3(val) bfin_write32(WPIACNT3,val)
299#define bfin_read_WPIACNT4() bfin_read32(WPIACNT4)
300#define bfin_write_WPIACNT4(val) bfin_write32(WPIACNT4,val)
301#define bfin_read_WPIACNT5() bfin_read32(WPIACNT5)
302#define bfin_write_WPIACNT5(val) bfin_write32(WPIACNT5,val)
303#define bfin_read_WPDACTL() bfin_read32(WPDACTL)
304#define bfin_write_WPDACTL(val) bfin_write32(WPDACTL,val)
305#define bfin_read_WPDA0() bfin_read32(WPDA0)
306#define bfin_write_WPDA0(val) bfin_write32(WPDA0,val)
307#define bfin_read_WPDA1() bfin_read32(WPDA1)
308#define bfin_write_WPDA1(val) bfin_write32(WPDA1,val)
309#define bfin_read_WPDACNT0() bfin_read32(WPDACNT0)
310#define bfin_write_WPDACNT0(val) bfin_write32(WPDACNT0,val)
311#define bfin_read_WPDACNT1() bfin_read32(WPDACNT1)
312#define bfin_write_WPDACNT1(val) bfin_write32(WPDACNT1,val)
313#define bfin_read_WPSTAT() bfin_read32(WPSTAT)
314#define bfin_write_WPSTAT(val) bfin_write32(WPSTAT,val)
315
316/*Performance Monitor Registers*/
317#define bfin_read_PFCTL() bfin_read32(PFCTL)
318#define bfin_write_PFCTL(val) bfin_write32(PFCTL,val)
319#define bfin_read_PFCNTR0() bfin_read32(PFCNTR0)
320#define bfin_write_PFCNTR0(val) bfin_write32(PFCNTR0,val)
321#define bfin_read_PFCNTR1() bfin_read32(PFCNTR1)
322#define bfin_write_PFCNTR1(val) bfin_write32(PFCNTR1,val)
323
324/*
325#define IPRIO 0xFFE02110
326*/
327
328#endif /* _CDEF_LPBLACKFIN_H */
diff --git a/include/asm-blackfin/mach-common/clocks.h b/include/asm-blackfin/mach-common/clocks.h
deleted file mode 100644
index 033bba92d61c..000000000000
--- a/include/asm-blackfin/mach-common/clocks.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-common/clocks.h
3 * Based on: include/asm-blackfin/mach-bf537/bf537.h
4 * Author: Robin Getz <rgetz@blackfin.uclinux.org>
5 *
6 * Created: 25Jul07
7 * Description: Common Clock definitions for various kernel files
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#ifndef _BFIN_CLOCKS_H
31#define _BFIN_CLOCKS_H
32
33#ifdef CONFIG_CCLK_DIV_1
34# define CONFIG_CCLK_ACT_DIV CCLK_DIV1
35# define CONFIG_CCLK_DIV 1
36#endif
37
38#ifdef CONFIG_CCLK_DIV_2
39# define CONFIG_CCLK_ACT_DIV CCLK_DIV2
40# define CONFIG_CCLK_DIV 2
41#endif
42
43#ifdef CONFIG_CCLK_DIV_4
44# define CONFIG_CCLK_ACT_DIV CCLK_DIV4
45# define CONFIG_CCLK_DIV 4
46#endif
47
48#ifdef CONFIG_CCLK_DIV_8
49# define CONFIG_CCLK_ACT_DIV CCLK_DIV8
50# define CONFIG_CCLK_DIV 8
51#endif
52
53#ifndef CONFIG_PLL_BYPASS
54# ifndef CONFIG_CLKIN_HALF
55# define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
56# else
57# define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
58# endif
59
60# define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
61# define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
62
63#else
64# define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ)
65# define CONFIG_CCLK_HZ (CONFIG_CLKIN_HZ)
66# define CONFIG_SCLK_HZ (CONFIG_CLKIN_HZ)
67# define CONFIG_VCO_MULT 0
68#endif
69
70#endif
diff --git a/include/asm-blackfin/mach-common/context.S b/include/asm-blackfin/mach-common/context.S
deleted file mode 100644
index c0e630edfb9a..000000000000
--- a/include/asm-blackfin/mach-common/context.S
+++ /dev/null
@@ -1,355 +0,0 @@
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 * NOTE! The single-stepping code assumes that all interrupt handlers
32 * start by saving SYSCFG on the stack with their first instruction.
33 */
34
35/*
36 * Code to save processor context.
37 * We even save the register which are preserved by a function call
38 * - r4, r5, r6, r7, p3, p4, p5
39 */
40.macro save_context_with_interrupts
41 [--sp] = SYSCFG;
42
43 [--sp] = P0; /*orig_p0*/
44 [--sp] = R0; /*orig_r0*/
45
46 [--sp] = ( R7:0, P5:0 );
47 [--sp] = fp;
48 [--sp] = usp;
49
50 [--sp] = i0;
51 [--sp] = i1;
52 [--sp] = i2;
53 [--sp] = i3;
54
55 [--sp] = m0;
56 [--sp] = m1;
57 [--sp] = m2;
58 [--sp] = m3;
59
60 [--sp] = l0;
61 [--sp] = l1;
62 [--sp] = l2;
63 [--sp] = l3;
64
65 [--sp] = b0;
66 [--sp] = b1;
67 [--sp] = b2;
68 [--sp] = b3;
69 [--sp] = a0.x;
70 [--sp] = a0.w;
71 [--sp] = a1.x;
72 [--sp] = a1.w;
73
74 [--sp] = LC0;
75 [--sp] = LC1;
76 [--sp] = LT0;
77 [--sp] = LT1;
78 [--sp] = LB0;
79 [--sp] = LB1;
80
81 [--sp] = ASTAT;
82
83 [--sp] = r0; /* Skip reserved */
84 [--sp] = RETS;
85 r0 = RETI;
86 [--sp] = r0;
87 [--sp] = RETX;
88 [--sp] = RETN;
89 [--sp] = RETE;
90 [--sp] = SEQSTAT;
91 [--sp] = r0; /* Skip IPEND as well. */
92 /* Switch to other method of keeping interrupts disabled. */
93#ifdef CONFIG_DEBUG_HWERR
94 r0 = 0x3f;
95 sti r0;
96#else
97 cli r0;
98#endif
99 [--sp] = RETI; /*orig_pc*/
100 /* Clear all L registers. */
101 r0 = 0 (x);
102 l0 = r0;
103 l1 = r0;
104 l2 = r0;
105 l3 = r0;
106.endm
107
108.macro save_context_syscall
109 [--sp] = SYSCFG;
110
111 [--sp] = P0; /*orig_p0*/
112 [--sp] = R0; /*orig_r0*/
113 [--sp] = ( R7:0, P5:0 );
114 [--sp] = fp;
115 [--sp] = usp;
116
117 [--sp] = i0;
118 [--sp] = i1;
119 [--sp] = i2;
120 [--sp] = i3;
121
122 [--sp] = m0;
123 [--sp] = m1;
124 [--sp] = m2;
125 [--sp] = m3;
126
127 [--sp] = l0;
128 [--sp] = l1;
129 [--sp] = l2;
130 [--sp] = l3;
131
132 [--sp] = b0;
133 [--sp] = b1;
134 [--sp] = b2;
135 [--sp] = b3;
136 [--sp] = a0.x;
137 [--sp] = a0.w;
138 [--sp] = a1.x;
139 [--sp] = a1.w;
140
141 [--sp] = LC0;
142 [--sp] = LC1;
143 [--sp] = LT0;
144 [--sp] = LT1;
145 [--sp] = LB0;
146 [--sp] = LB1;
147
148 [--sp] = ASTAT;
149
150 [--sp] = r0; /* Skip reserved */
151 [--sp] = RETS;
152 r0 = RETI;
153 [--sp] = r0;
154 [--sp] = RETX;
155 [--sp] = RETN;
156 [--sp] = RETE;
157 [--sp] = SEQSTAT;
158 [--sp] = r0; /* Skip IPEND as well. */
159 [--sp] = RETI; /*orig_pc*/
160 /* Clear all L registers. */
161 r0 = 0 (x);
162 l0 = r0;
163 l1 = r0;
164 l2 = r0;
165 l3 = r0;
166.endm
167
168.macro save_context_no_interrupts
169 [--sp] = SYSCFG;
170 [--sp] = P0; /* orig_p0 */
171 [--sp] = R0; /* orig_r0 */
172 [--sp] = ( R7:0, P5:0 );
173 [--sp] = fp;
174 [--sp] = usp;
175
176 [--sp] = i0;
177 [--sp] = i1;
178 [--sp] = i2;
179 [--sp] = i3;
180
181 [--sp] = m0;
182 [--sp] = m1;
183 [--sp] = m2;
184 [--sp] = m3;
185
186 [--sp] = l0;
187 [--sp] = l1;
188 [--sp] = l2;
189 [--sp] = l3;
190
191 [--sp] = b0;
192 [--sp] = b1;
193 [--sp] = b2;
194 [--sp] = b3;
195 [--sp] = a0.x;
196 [--sp] = a0.w;
197 [--sp] = a1.x;
198 [--sp] = a1.w;
199
200 [--sp] = LC0;
201 [--sp] = LC1;
202 [--sp] = LT0;
203 [--sp] = LT1;
204 [--sp] = LB0;
205 [--sp] = LB1;
206
207 [--sp] = ASTAT;
208
209#ifdef CONFIG_KGDB
210 fp = 0(Z);
211 r1 = sp;
212 r1 += 60;
213 r1 += 60;
214 r1 += 60;
215 [--sp] = r1;
216#else
217 [--sp] = r0; /* Skip reserved */
218#endif
219 [--sp] = RETS;
220 r0 = RETI;
221 [--sp] = r0;
222 [--sp] = RETX;
223 [--sp] = RETN;
224 [--sp] = RETE;
225 [--sp] = SEQSTAT;
226#ifdef CONFIG_KGDB
227 r1.l = lo(IPEND);
228 r1.h = hi(IPEND);
229 [--sp] = r1;
230#else
231 [--sp] = r0; /* Skip IPEND as well. */
232#endif
233 [--sp] = r0; /*orig_pc*/
234 /* Clear all L registers. */
235 r0 = 0 (x);
236 l0 = r0;
237 l1 = r0;
238 l2 = r0;
239 l3 = r0;
240.endm
241
242.macro restore_context_no_interrupts
243 sp += 4; /* Skip orig_pc */
244 sp += 4; /* Skip IPEND */
245 SEQSTAT = [sp++];
246 RETE = [sp++];
247 RETN = [sp++];
248 RETX = [sp++];
249 r0 = [sp++];
250 RETI = r0; /* Restore RETI indirectly when in exception */
251 RETS = [sp++];
252
253 sp += 4; /* Skip Reserved */
254
255 ASTAT = [sp++];
256
257 LB1 = [sp++];
258 LB0 = [sp++];
259 LT1 = [sp++];
260 LT0 = [sp++];
261 LC1 = [sp++];
262 LC0 = [sp++];
263
264 a1.w = [sp++];
265 a1.x = [sp++];
266 a0.w = [sp++];
267 a0.x = [sp++];
268 b3 = [sp++];
269 b2 = [sp++];
270 b1 = [sp++];
271 b0 = [sp++];
272
273 l3 = [sp++];
274 l2 = [sp++];
275 l1 = [sp++];
276 l0 = [sp++];
277
278 m3 = [sp++];
279 m2 = [sp++];
280 m1 = [sp++];
281 m0 = [sp++];
282
283 i3 = [sp++];
284 i2 = [sp++];
285 i1 = [sp++];
286 i0 = [sp++];
287
288 sp += 4;
289 fp = [sp++];
290
291 ( R7 : 0, P5 : 0) = [ SP ++ ];
292 sp += 8; /* Skip orig_r0/orig_p0 */
293 SYSCFG = [sp++];
294.endm
295
296.macro restore_context_with_interrupts
297 sp += 4; /* Skip orig_pc */
298 sp += 4; /* Skip IPEND */
299 SEQSTAT = [sp++];
300 RETE = [sp++];
301 RETN = [sp++];
302 RETX = [sp++];
303 RETI = [sp++];
304 RETS = [sp++];
305
306 p0.h = _irq_flags;
307 p0.l = _irq_flags;
308 r0 = [p0];
309 sti r0;
310
311 sp += 4; /* Skip Reserved */
312
313 ASTAT = [sp++];
314
315 LB1 = [sp++];
316 LB0 = [sp++];
317 LT1 = [sp++];
318 LT0 = [sp++];
319 LC1 = [sp++];
320 LC0 = [sp++];
321
322 a1.w = [sp++];
323 a1.x = [sp++];
324 a0.w = [sp++];
325 a0.x = [sp++];
326 b3 = [sp++];
327 b2 = [sp++];
328 b1 = [sp++];
329 b0 = [sp++];
330
331 l3 = [sp++];
332 l2 = [sp++];
333 l1 = [sp++];
334 l0 = [sp++];
335
336 m3 = [sp++];
337 m2 = [sp++];
338 m1 = [sp++];
339 m0 = [sp++];
340
341 i3 = [sp++];
342 i2 = [sp++];
343 i1 = [sp++];
344 i0 = [sp++];
345
346 sp += 4;
347 fp = [sp++];
348
349 ( R7 : 0, P5 : 0) = [ SP ++ ];
350 sp += 8; /* Skip orig_r0/orig_p0 */
351 csync;
352 SYSCFG = [sp++];
353 csync;
354.endm
355
diff --git a/include/asm-blackfin/mach-common/def_LPBlackfin.h b/include/asm-blackfin/mach-common/def_LPBlackfin.h
deleted file mode 100644
index e8967f6124f7..000000000000
--- a/include/asm-blackfin/mach-common/def_LPBlackfin.h
+++ /dev/null
@@ -1,712 +0,0 @@
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#define MK_BMSK_(x) (1<<x)
37
38#ifndef __ASSEMBLY__
39
40#include <linux/types.h>
41
42#if ANOMALY_05000198
43# define NOP_PAD_ANOMALY_05000198 "nop;"
44#else
45# define NOP_PAD_ANOMALY_05000198
46#endif
47
48#define bfin_read8(addr) ({ \
49 uint32_t __v; \
50 __asm__ __volatile__( \
51 NOP_PAD_ANOMALY_05000198 \
52 "%0 = b[%1] (z);" \
53 : "=d" (__v) \
54 : "a" (addr) \
55 ); \
56 __v; })
57
58#define bfin_read16(addr) ({ \
59 uint32_t __v; \
60 __asm__ __volatile__( \
61 NOP_PAD_ANOMALY_05000198 \
62 "%0 = w[%1] (z);" \
63 : "=d" (__v) \
64 : "a" (addr) \
65 ); \
66 __v; })
67
68#define bfin_read32(addr) ({ \
69 uint32_t __v; \
70 __asm__ __volatile__( \
71 NOP_PAD_ANOMALY_05000198 \
72 "%0 = [%1];" \
73 : "=d" (__v) \
74 : "a" (addr) \
75 ); \
76 __v; })
77
78#define bfin_write8(addr, val) \
79 __asm__ __volatile__( \
80 NOP_PAD_ANOMALY_05000198 \
81 "b[%0] = %1;" \
82 : \
83 : "a" (addr), "d" ((uint8_t)(val)) \
84 : "memory" \
85 )
86
87#define bfin_write16(addr, val) \
88 __asm__ __volatile__( \
89 NOP_PAD_ANOMALY_05000198 \
90 "w[%0] = %1;" \
91 : \
92 : "a" (addr), "d" ((uint16_t)(val)) \
93 : "memory" \
94 )
95
96#define bfin_write32(addr, val) \
97 __asm__ __volatile__( \
98 NOP_PAD_ANOMALY_05000198 \
99 "[%0] = %1;" \
100 : \
101 : "a" (addr), "d" (val) \
102 : "memory" \
103 )
104
105#endif /* __ASSEMBLY__ */
106
107/**************************************************
108 * System Register Bits
109 **************************************************/
110
111/**************************************************
112 * ASTAT register
113 **************************************************/
114
115/* definitions of ASTAT bit positions*/
116
117/*Result of last ALU0 or shifter operation is zero*/
118#define ASTAT_AZ_P 0x00000000
119/*Result of last ALU0 or shifter operation is negative*/
120#define ASTAT_AN_P 0x00000001
121/*Condition Code, used for holding comparison results*/
122#define ASTAT_CC_P 0x00000005
123/*Quotient Bit*/
124#define ASTAT_AQ_P 0x00000006
125/*Rounding mode, set for biased, clear for unbiased*/
126#define ASTAT_RND_MOD_P 0x00000008
127/*Result of last ALU0 operation generated a carry*/
128#define ASTAT_AC0_P 0x0000000C
129/*Result of last ALU0 operation generated a carry*/
130#define ASTAT_AC0_COPY_P 0x00000002
131/*Result of last ALU1 operation generated a carry*/
132#define ASTAT_AC1_P 0x0000000D
133/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
134#define ASTAT_AV0_P 0x00000010
135/*Sticky version of ASTAT_AV0 */
136#define ASTAT_AV0S_P 0x00000011
137/*Result of last MAC1 operation overflowed, sticky for MAC*/
138#define ASTAT_AV1_P 0x00000012
139/*Sticky version of ASTAT_AV1 */
140#define ASTAT_AV1S_P 0x00000013
141/*Result of last ALU0 or MAC0 operation overflowed*/
142#define ASTAT_V_P 0x00000018
143/*Result of last ALU0 or MAC0 operation overflowed*/
144#define ASTAT_V_COPY_P 0x00000003
145/*Sticky version of ASTAT_V*/
146#define ASTAT_VS_P 0x00000019
147
148/* Masks */
149
150/*Result of last ALU0 or shifter operation is zero*/
151#define ASTAT_AZ MK_BMSK_(ASTAT_AZ_P)
152/*Result of last ALU0 or shifter operation is negative*/
153#define ASTAT_AN MK_BMSK_(ASTAT_AN_P)
154/*Result of last ALU0 operation generated a carry*/
155#define ASTAT_AC0 MK_BMSK_(ASTAT_AC0_P)
156/*Result of last ALU0 operation generated a carry*/
157#define ASTAT_AC0_COPY MK_BMSK_(ASTAT_AC0_COPY_P)
158/*Result of last ALU0 operation generated a carry*/
159#define ASTAT_AC1 MK_BMSK_(ASTAT_AC1_P)
160/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
161#define ASTAT_AV0 MK_BMSK_(ASTAT_AV0_P)
162/*Result of last MAC1 operation overflowed, sticky for MAC*/
163#define ASTAT_AV1 MK_BMSK_(ASTAT_AV1_P)
164/*Condition Code, used for holding comparison results*/
165#define ASTAT_CC MK_BMSK_(ASTAT_CC_P)
166/*Quotient Bit*/
167#define ASTAT_AQ MK_BMSK_(ASTAT_AQ_P)
168/*Rounding mode, set for biased, clear for unbiased*/
169#define ASTAT_RND_MOD MK_BMSK_(ASTAT_RND_MOD_P)
170/*Overflow Bit*/
171#define ASTAT_V MK_BMSK_(ASTAT_V_P)
172/*Overflow Bit*/
173#define ASTAT_V_COPY MK_BMSK_(ASTAT_V_COPY_P)
174
175/**************************************************
176 * SEQSTAT register
177 **************************************************/
178
179/* Bit Positions */
180#define SEQSTAT_EXCAUSE0_P 0x00000000 /* Last exception cause bit 0 */
181#define SEQSTAT_EXCAUSE1_P 0x00000001 /* Last exception cause bit 1 */
182#define SEQSTAT_EXCAUSE2_P 0x00000002 /* Last exception cause bit 2 */
183#define SEQSTAT_EXCAUSE3_P 0x00000003 /* Last exception cause bit 3 */
184#define SEQSTAT_EXCAUSE4_P 0x00000004 /* Last exception cause bit 4 */
185#define SEQSTAT_EXCAUSE5_P 0x00000005 /* Last exception cause bit 5 */
186#define SEQSTAT_IDLE_REQ_P 0x0000000C /* Pending idle mode request,
187 * set by IDLE instruction.
188 */
189#define SEQSTAT_SFTRESET_P 0x0000000D /* Indicates whether the last
190 * reset was a software reset
191 * (=1)
192 */
193#define SEQSTAT_HWERRCAUSE0_P 0x0000000E /* Last hw error cause bit 0 */
194#define SEQSTAT_HWERRCAUSE1_P 0x0000000F /* Last hw error cause bit 1 */
195#define SEQSTAT_HWERRCAUSE2_P 0x00000010 /* Last hw error cause bit 2 */
196#define SEQSTAT_HWERRCAUSE3_P 0x00000011 /* Last hw error cause bit 3 */
197#define SEQSTAT_HWERRCAUSE4_P 0x00000012 /* Last hw error cause bit 4 */
198/* Masks */
199/* Exception cause */
200#define SEQSTAT_EXCAUSE (MK_BMSK_(SEQSTAT_EXCAUSE0_P) | \
201 MK_BMSK_(SEQSTAT_EXCAUSE1_P) | \
202 MK_BMSK_(SEQSTAT_EXCAUSE2_P) | \
203 MK_BMSK_(SEQSTAT_EXCAUSE3_P) | \
204 MK_BMSK_(SEQSTAT_EXCAUSE4_P) | \
205 MK_BMSK_(SEQSTAT_EXCAUSE5_P) | \
206 0)
207
208/* Indicates whether the last reset was a software reset (=1) */
209#define SEQSTAT_SFTRESET (MK_BMSK_(SEQSTAT_SFTRESET_P))
210
211/* Last hw error cause */
212#define SEQSTAT_HWERRCAUSE (MK_BMSK_(SEQSTAT_HWERRCAUSE0_P) | \
213 MK_BMSK_(SEQSTAT_HWERRCAUSE1_P) | \
214 MK_BMSK_(SEQSTAT_HWERRCAUSE2_P) | \
215 MK_BMSK_(SEQSTAT_HWERRCAUSE3_P) | \
216 MK_BMSK_(SEQSTAT_HWERRCAUSE4_P) | \
217 0)
218
219/* Translate bits to something useful */
220
221/* Last hw error cause */
222#define SEQSTAT_HWERRCAUSE_SHIFT (14)
223#define SEQSTAT_HWERRCAUSE_SYSTEM_MMR (0x02 << SEQSTAT_HWERRCAUSE_SHIFT)
224#define SEQSTAT_HWERRCAUSE_EXTERN_ADDR (0x03 << SEQSTAT_HWERRCAUSE_SHIFT)
225#define SEQSTAT_HWERRCAUSE_PERF_FLOW (0x12 << SEQSTAT_HWERRCAUSE_SHIFT)
226#define SEQSTAT_HWERRCAUSE_RAISE_5 (0x18 << SEQSTAT_HWERRCAUSE_SHIFT)
227
228/**************************************************
229 * SYSCFG register
230 **************************************************/
231
232/* Bit Positions */
233#define SYSCFG_SSSTEP_P 0x00000000 /* Supervisor single step, when
234 * set it forces an exception
235 * for each instruction executed
236 */
237#define SYSCFG_CCEN_P 0x00000001 /* Enable cycle counter (=1) */
238#define SYSCFG_SNEN_P 0x00000002 /* Self nesting Interrupt Enable */
239
240/* Masks */
241
242/* Supervisor single step, when set it forces an exception for each
243 *instruction executed
244 */
245#define SYSCFG_SSSTEP MK_BMSK_(SYSCFG_SSSTEP_P )
246/* Enable cycle counter (=1) */
247#define SYSCFG_CCEN MK_BMSK_(SYSCFG_CCEN_P )
248/* Self Nesting Interrupt Enable */
249#define SYSCFG_SNEN MK_BMSK_(SYSCFG_SNEN_P)
250/* Backward-compatibility for typos in prior releases */
251#define SYSCFG_SSSSTEP SYSCFG_SSSTEP
252#define SYSCFG_CCCEN SYSCFG_CCEN
253
254/****************************************************
255 * Core MMR Register Map
256 ****************************************************/
257
258/* Data Cache & SRAM Memory (0xFFE00000 - 0xFFE00404) */
259
260#define SRAM_BASE_ADDRESS 0xFFE00000 /* SRAM Base Address Register */
261#define DMEM_CONTROL 0xFFE00004 /* Data memory control */
262#define DCPLB_STATUS 0xFFE00008 /* Data Cache Programmable Look-Aside
263 * Buffer Status
264 */
265#define DCPLB_FAULT_STATUS 0xFFE00008 /* "" (older define) */
266#define DCPLB_FAULT_ADDR 0xFFE0000C /* Data Cache Programmable Look-Aside
267 * Buffer Fault Address
268 */
269#define DCPLB_ADDR0 0xFFE00100 /* Data Cache Protection Lookaside
270 * Buffer 0
271 */
272#define DCPLB_ADDR1 0xFFE00104 /* Data Cache Protection Lookaside
273 * Buffer 1
274 */
275#define DCPLB_ADDR2 0xFFE00108 /* Data Cache Protection Lookaside
276 * Buffer 2
277 */
278#define DCPLB_ADDR3 0xFFE0010C /* Data Cacheability Protection
279 * Lookaside Buffer 3
280 */
281#define DCPLB_ADDR4 0xFFE00110 /* Data Cacheability Protection
282 * Lookaside Buffer 4
283 */
284#define DCPLB_ADDR5 0xFFE00114 /* Data Cacheability Protection
285 * Lookaside Buffer 5
286 */
287#define DCPLB_ADDR6 0xFFE00118 /* Data Cacheability Protection
288 * Lookaside Buffer 6
289 */
290#define DCPLB_ADDR7 0xFFE0011C /* Data Cacheability Protection
291 * Lookaside Buffer 7
292 */
293#define DCPLB_ADDR8 0xFFE00120 /* Data Cacheability Protection
294 * Lookaside Buffer 8
295 */
296#define DCPLB_ADDR9 0xFFE00124 /* Data Cacheability Protection
297 * Lookaside Buffer 9
298 */
299#define DCPLB_ADDR10 0xFFE00128 /* Data Cacheability Protection
300 * Lookaside Buffer 10
301 */
302#define DCPLB_ADDR11 0xFFE0012C /* Data Cacheability Protection
303 * Lookaside Buffer 11
304 */
305#define DCPLB_ADDR12 0xFFE00130 /* Data Cacheability Protection
306 * Lookaside Buffer 12
307 */
308#define DCPLB_ADDR13 0xFFE00134 /* Data Cacheability Protection
309 * Lookaside Buffer 13
310 */
311#define DCPLB_ADDR14 0xFFE00138 /* Data Cacheability Protection
312 * Lookaside Buffer 14
313 */
314#define DCPLB_ADDR15 0xFFE0013C /* Data Cacheability Protection
315 * Lookaside Buffer 15
316 */
317#define DCPLB_DATA0 0xFFE00200 /* Data Cache 0 Status */
318#define DCPLB_DATA1 0xFFE00204 /* Data Cache 1 Status */
319#define DCPLB_DATA2 0xFFE00208 /* Data Cache 2 Status */
320#define DCPLB_DATA3 0xFFE0020C /* Data Cache 3 Status */
321#define DCPLB_DATA4 0xFFE00210 /* Data Cache 4 Status */
322#define DCPLB_DATA5 0xFFE00214 /* Data Cache 5 Status */
323#define DCPLB_DATA6 0xFFE00218 /* Data Cache 6 Status */
324#define DCPLB_DATA7 0xFFE0021C /* Data Cache 7 Status */
325#define DCPLB_DATA8 0xFFE00220 /* Data Cache 8 Status */
326#define DCPLB_DATA9 0xFFE00224 /* Data Cache 9 Status */
327#define DCPLB_DATA10 0xFFE00228 /* Data Cache 10 Status */
328#define DCPLB_DATA11 0xFFE0022C /* Data Cache 11 Status */
329#define DCPLB_DATA12 0xFFE00230 /* Data Cache 12 Status */
330#define DCPLB_DATA13 0xFFE00234 /* Data Cache 13 Status */
331#define DCPLB_DATA14 0xFFE00238 /* Data Cache 14 Status */
332#define DCPLB_DATA15 0xFFE0023C /* Data Cache 15 Status */
333#define DCPLB_DATA16 0xFFE00240 /* Extra Dummy entry */
334
335#define DTEST_COMMAND 0xFFE00300 /* Data Test Command Register */
336#define DTEST_DATA0 0xFFE00400 /* Data Test Data Register */
337#define DTEST_DATA1 0xFFE00404 /* Data Test Data Register */
338
339/* Instruction Cache & SRAM Memory (0xFFE01004 - 0xFFE01404) */
340
341#define IMEM_CONTROL 0xFFE01004 /* Instruction Memory Control */
342#define ICPLB_STATUS 0xFFE01008 /* Instruction Cache miss status */
343#define CODE_FAULT_STATUS 0xFFE01008 /* "" (older define) */
344#define ICPLB_FAULT_ADDR 0xFFE0100C /* Instruction Cache miss address */
345#define CODE_FAULT_ADDR 0xFFE0100C /* "" (older define) */
346#define ICPLB_ADDR0 0xFFE01100 /* Instruction Cacheability
347 * Protection Lookaside Buffer 0
348 */
349#define ICPLB_ADDR1 0xFFE01104 /* Instruction Cacheability
350 * Protection Lookaside Buffer 1
351 */
352#define ICPLB_ADDR2 0xFFE01108 /* Instruction Cacheability
353 * Protection Lookaside Buffer 2
354 */
355#define ICPLB_ADDR3 0xFFE0110C /* Instruction Cacheability
356 * Protection Lookaside Buffer 3
357 */
358#define ICPLB_ADDR4 0xFFE01110 /* Instruction Cacheability
359 * Protection Lookaside Buffer 4
360 */
361#define ICPLB_ADDR5 0xFFE01114 /* Instruction Cacheability
362 * Protection Lookaside Buffer 5
363 */
364#define ICPLB_ADDR6 0xFFE01118 /* Instruction Cacheability
365 * Protection Lookaside Buffer 6
366 */
367#define ICPLB_ADDR7 0xFFE0111C /* Instruction Cacheability
368 * Protection Lookaside Buffer 7
369 */
370#define ICPLB_ADDR8 0xFFE01120 /* Instruction Cacheability
371 * Protection Lookaside Buffer 8
372 */
373#define ICPLB_ADDR9 0xFFE01124 /* Instruction Cacheability
374 * Protection Lookaside Buffer 9
375 */
376#define ICPLB_ADDR10 0xFFE01128 /* Instruction Cacheability
377 * Protection Lookaside Buffer 10
378 */
379#define ICPLB_ADDR11 0xFFE0112C /* Instruction Cacheability
380 * Protection Lookaside Buffer 11
381 */
382#define ICPLB_ADDR12 0xFFE01130 /* Instruction Cacheability
383 * Protection Lookaside Buffer 12
384 */
385#define ICPLB_ADDR13 0xFFE01134 /* Instruction Cacheability
386 * Protection Lookaside Buffer 13
387 */
388#define ICPLB_ADDR14 0xFFE01138 /* Instruction Cacheability
389 * Protection Lookaside Buffer 14
390 */
391#define ICPLB_ADDR15 0xFFE0113C /* Instruction Cacheability
392 * Protection Lookaside Buffer 15
393 */
394#define ICPLB_DATA0 0xFFE01200 /* Instruction Cache 0 Status */
395#define ICPLB_DATA1 0xFFE01204 /* Instruction Cache 1 Status */
396#define ICPLB_DATA2 0xFFE01208 /* Instruction Cache 2 Status */
397#define ICPLB_DATA3 0xFFE0120C /* Instruction Cache 3 Status */
398#define ICPLB_DATA4 0xFFE01210 /* Instruction Cache 4 Status */
399#define ICPLB_DATA5 0xFFE01214 /* Instruction Cache 5 Status */
400#define ICPLB_DATA6 0xFFE01218 /* Instruction Cache 6 Status */
401#define ICPLB_DATA7 0xFFE0121C /* Instruction Cache 7 Status */
402#define ICPLB_DATA8 0xFFE01220 /* Instruction Cache 8 Status */
403#define ICPLB_DATA9 0xFFE01224 /* Instruction Cache 9 Status */
404#define ICPLB_DATA10 0xFFE01228 /* Instruction Cache 10 Status */
405#define ICPLB_DATA11 0xFFE0122C /* Instruction Cache 11 Status */
406#define ICPLB_DATA12 0xFFE01230 /* Instruction Cache 12 Status */
407#define ICPLB_DATA13 0xFFE01234 /* Instruction Cache 13 Status */
408#define ICPLB_DATA14 0xFFE01238 /* Instruction Cache 14 Status */
409#define ICPLB_DATA15 0xFFE0123C /* Instruction Cache 15 Status */
410#define ITEST_COMMAND 0xFFE01300 /* Instruction Test Command Register */
411#define ITEST_DATA0 0xFFE01400 /* Instruction Test Data Register */
412#define ITEST_DATA1 0xFFE01404 /* Instruction Test Data Register */
413
414/* Event/Interrupt Controller Registers (0xFFE02000 - 0xFFE02110) */
415
416#define EVT0 0xFFE02000 /* Event Vector 0 ESR Address */
417#define EVT1 0xFFE02004 /* Event Vector 1 ESR Address */
418#define EVT2 0xFFE02008 /* Event Vector 2 ESR Address */
419#define EVT3 0xFFE0200C /* Event Vector 3 ESR Address */
420#define EVT4 0xFFE02010 /* Event Vector 4 ESR Address */
421#define EVT5 0xFFE02014 /* Event Vector 5 ESR Address */
422#define EVT6 0xFFE02018 /* Event Vector 6 ESR Address */
423#define EVT7 0xFFE0201C /* Event Vector 7 ESR Address */
424#define EVT8 0xFFE02020 /* Event Vector 8 ESR Address */
425#define EVT9 0xFFE02024 /* Event Vector 9 ESR Address */
426#define EVT10 0xFFE02028 /* Event Vector 10 ESR Address */
427#define EVT11 0xFFE0202C /* Event Vector 11 ESR Address */
428#define EVT12 0xFFE02030 /* Event Vector 12 ESR Address */
429#define EVT13 0xFFE02034 /* Event Vector 13 ESR Address */
430#define EVT14 0xFFE02038 /* Event Vector 14 ESR Address */
431#define EVT15 0xFFE0203C /* Event Vector 15 ESR Address */
432#define IMASK 0xFFE02104 /* Interrupt Mask Register */
433#define IPEND 0xFFE02108 /* Interrupt Pending Register */
434#define ILAT 0xFFE0210C /* Interrupt Latch Register */
435#define IPRIO 0xFFE02110 /* Core Interrupt Priority Register */
436
437/* Core Timer Registers (0xFFE03000 - 0xFFE0300C) */
438
439#define TCNTL 0xFFE03000 /* Core Timer Control Register */
440#define TPERIOD 0xFFE03004 /* Core Timer Period Register */
441#define TSCALE 0xFFE03008 /* Core Timer Scale Register */
442#define TCOUNT 0xFFE0300C /* Core Timer Count Register */
443
444/* Debug/MP/Emulation Registers (0xFFE05000 - 0xFFE05008) */
445#define DSPID 0xFFE05000 /* DSP Processor ID Register for
446 * MP implementations
447 */
448
449#define DBGSTAT 0xFFE05008 /* Debug Status Register */
450
451/* Trace Buffer Registers (0xFFE06000 - 0xFFE06100) */
452
453#define TBUFCTL 0xFFE06000 /* Trace Buffer Control Register */
454#define TBUFSTAT 0xFFE06004 /* Trace Buffer Status Register */
455#define TBUF 0xFFE06100 /* Trace Buffer */
456
457/* Watchpoint Control Registers (0xFFE07000 - 0xFFE07200) */
458
459/* Watchpoint Instruction Address Control Register */
460#define WPIACTL 0xFFE07000
461/* Watchpoint Instruction Address Register 0 */
462#define WPIA0 0xFFE07040
463/* Watchpoint Instruction Address Register 1 */
464#define WPIA1 0xFFE07044
465/* Watchpoint Instruction Address Register 2 */
466#define WPIA2 0xFFE07048
467/* Watchpoint Instruction Address Register 3 */
468#define WPIA3 0xFFE0704C
469/* Watchpoint Instruction Address Register 4 */
470#define WPIA4 0xFFE07050
471/* Watchpoint Instruction Address Register 5 */
472#define WPIA5 0xFFE07054
473/* Watchpoint Instruction Address Count Register 0 */
474#define WPIACNT0 0xFFE07080
475/* Watchpoint Instruction Address Count Register 1 */
476#define WPIACNT1 0xFFE07084
477/* Watchpoint Instruction Address Count Register 2 */
478#define WPIACNT2 0xFFE07088
479/* Watchpoint Instruction Address Count Register 3 */
480#define WPIACNT3 0xFFE0708C
481/* Watchpoint Instruction Address Count Register 4 */
482#define WPIACNT4 0xFFE07090
483/* Watchpoint Instruction Address Count Register 5 */
484#define WPIACNT5 0xFFE07094
485/* Watchpoint Data Address Control Register */
486#define WPDACTL 0xFFE07100
487/* Watchpoint Data Address Register 0 */
488#define WPDA0 0xFFE07140
489/* Watchpoint Data Address Register 1 */
490#define WPDA1 0xFFE07144
491/* Watchpoint Data Address Count Value Register 0 */
492#define WPDACNT0 0xFFE07180
493/* Watchpoint Data Address Count Value Register 1 */
494#define WPDACNT1 0xFFE07184
495/* Watchpoint Status Register */
496#define WPSTAT 0xFFE07200
497
498/* Performance Monitor Registers (0xFFE08000 - 0xFFE08104) */
499
500/* Performance Monitor Control Register */
501#define PFCTL 0xFFE08000
502/* Performance Monitor Counter Register 0 */
503#define PFCNTR0 0xFFE08100
504/* Performance Monitor Counter Register 1 */
505#define PFCNTR1 0xFFE08104
506
507/****************************************************
508 * Core MMR Register Bits
509 ****************************************************/
510
511/**************************************************
512 * EVT registers (ILAT, IMASK, and IPEND).
513 **************************************************/
514
515/* Bit Positions */
516#define EVT_EMU_P 0x00000000 /* Emulator interrupt bit position */
517#define EVT_RST_P 0x00000001 /* Reset interrupt bit position */
518#define EVT_NMI_P 0x00000002 /* Non Maskable interrupt bit position */
519#define EVT_EVX_P 0x00000003 /* Exception bit position */
520#define EVT_IRPTEN_P 0x00000004 /* Global interrupt enable bit position */
521#define EVT_IVHW_P 0x00000005 /* Hardware Error interrupt bit position */
522#define EVT_IVTMR_P 0x00000006 /* Timer interrupt bit position */
523#define EVT_IVG7_P 0x00000007 /* IVG7 interrupt bit position */
524#define EVT_IVG8_P 0x00000008 /* IVG8 interrupt bit position */
525#define EVT_IVG9_P 0x00000009 /* IVG9 interrupt bit position */
526#define EVT_IVG10_P 0x0000000a /* IVG10 interrupt bit position */
527#define EVT_IVG11_P 0x0000000b /* IVG11 interrupt bit position */
528#define EVT_IVG12_P 0x0000000c /* IVG12 interrupt bit position */
529#define EVT_IVG13_P 0x0000000d /* IVG13 interrupt bit position */
530#define EVT_IVG14_P 0x0000000e /* IVG14 interrupt bit position */
531#define EVT_IVG15_P 0x0000000f /* IVG15 interrupt bit position */
532
533/* Masks */
534#define EVT_EMU MK_BMSK_(EVT_EMU_P ) /* Emulator interrupt mask */
535#define EVT_RST MK_BMSK_(EVT_RST_P ) /* Reset interrupt mask */
536#define EVT_NMI MK_BMSK_(EVT_NMI_P ) /* Non Maskable interrupt mask */
537#define EVT_EVX MK_BMSK_(EVT_EVX_P ) /* Exception mask */
538#define EVT_IRPTEN MK_BMSK_(EVT_IRPTEN_P) /* Global interrupt enable mask */
539#define EVT_IVHW MK_BMSK_(EVT_IVHW_P ) /* Hardware Error interrupt mask */
540#define EVT_IVTMR MK_BMSK_(EVT_IVTMR_P ) /* Timer interrupt mask */
541#define EVT_IVG7 MK_BMSK_(EVT_IVG7_P ) /* IVG7 interrupt mask */
542#define EVT_IVG8 MK_BMSK_(EVT_IVG8_P ) /* IVG8 interrupt mask */
543#define EVT_IVG9 MK_BMSK_(EVT_IVG9_P ) /* IVG9 interrupt mask */
544#define EVT_IVG10 MK_BMSK_(EVT_IVG10_P ) /* IVG10 interrupt mask */
545#define EVT_IVG11 MK_BMSK_(EVT_IVG11_P ) /* IVG11 interrupt mask */
546#define EVT_IVG12 MK_BMSK_(EVT_IVG12_P ) /* IVG12 interrupt mask */
547#define EVT_IVG13 MK_BMSK_(EVT_IVG13_P ) /* IVG13 interrupt mask */
548#define EVT_IVG14 MK_BMSK_(EVT_IVG14_P ) /* IVG14 interrupt mask */
549#define EVT_IVG15 MK_BMSK_(EVT_IVG15_P ) /* IVG15 interrupt mask */
550
551/**************************************************
552 * DMEM_CONTROL Register
553 **************************************************/
554/* Bit Positions */
555#define ENDM_P 0x00 /* (doesn't really exist) Enable
556 *Data Memory L1
557 */
558#define DMCTL_ENDM_P ENDM_P /* "" (older define) */
559
560#define ENDCPLB_P 0x01 /* Enable DCPLBS */
561#define DMCTL_ENDCPLB_P ENDCPLB_P /* "" (older define) */
562#define DMC0_P 0x02 /* L1 Data Memory Configure bit 0 */
563#define DMCTL_DMC0_P DMC0_P /* "" (older define) */
564#define DMC1_P 0x03 /* L1 Data Memory Configure bit 1 */
565#define DMCTL_DMC1_P DMC1_P /* "" (older define) */
566#define DCBS_P 0x04 /* L1 Data Cache Bank Select */
567#define PORT_PREF0_P 0x12 /* DAG0 Port Preference */
568#define PORT_PREF1_P 0x13 /* DAG1 Port Preference */
569
570/* Masks */
571#define ENDM 0x00000001 /* (doesn't really exist) Enable
572 * Data Memory L1
573 */
574#define ENDCPLB 0x00000002 /* Enable DCPLB */
575#define ASRAM_BSRAM 0x00000000
576#define ACACHE_BSRAM 0x00000008
577#define ACACHE_BCACHE 0x0000000C
578#define DCBS 0x00000010 /* L1 Data Cache Bank Select */
579#define PORT_PREF0 0x00001000 /* DAG0 Port Preference */
580#define PORT_PREF1 0x00002000 /* DAG1 Port Preference */
581
582/* IMEM_CONTROL Register */
583/* Bit Positions */
584#define ENIM_P 0x00 /* Enable L1 Code Memory */
585#define IMCTL_ENIM_P 0x00 /* "" (older define) */
586#define ENICPLB_P 0x01 /* Enable ICPLB */
587#define IMCTL_ENICPLB_P 0x01 /* "" (older define) */
588#define IMC_P 0x02 /* Enable */
589#define IMCTL_IMC_P 0x02 /* Configure L1 code memory as
590 * cache (0=SRAM)
591 */
592#define ILOC0_P 0x03 /* Lock Way 0 */
593#define ILOC1_P 0x04 /* Lock Way 1 */
594#define ILOC2_P 0x05 /* Lock Way 2 */
595#define ILOC3_P 0x06 /* Lock Way 3 */
596#define LRUPRIORST_P 0x0D /* Least Recently Used Replacement
597 * Priority
598 */
599/* Masks */
600#define ENIM 0x00000001 /* Enable L1 Code Memory */
601#define ENICPLB 0x00000002 /* Enable ICPLB */
602#define IMC 0x00000004 /* Configure L1 code memory as
603 * cache (0=SRAM)
604 */
605#define ILOC0 0x00000008 /* Lock Way 0 */
606#define ILOC1 0x00000010 /* Lock Way 1 */
607#define ILOC2 0x00000020 /* Lock Way 2 */
608#define ILOC3 0x00000040 /* Lock Way 3 */
609#define LRUPRIORST 0x00002000 /* Least Recently Used Replacement
610 * Priority
611 */
612
613/* TCNTL Masks */
614#define TMPWR 0x00000001 /* Timer Low Power Control,
615 * 0=low power mode, 1=active state
616 */
617#define TMREN 0x00000002 /* Timer enable, 0=disable, 1=enable */
618#define TAUTORLD 0x00000004 /* Timer auto reload */
619#define TINT 0x00000008 /* Timer generated interrupt 0=no
620 * interrupt has been generated,
621 * 1=interrupt has been generated
622 * (sticky)
623 */
624
625/* DCPLB_DATA and ICPLB_DATA Registers */
626/* Bit Positions */
627#define CPLB_VALID_P 0x00000000 /* 0=invalid entry, 1=valid entry */
628#define CPLB_LOCK_P 0x00000001 /* 0=entry may be replaced, 1=entry
629 * locked
630 */
631#define CPLB_USER_RD_P 0x00000002 /* 0=no read access, 1=read access
632 * allowed (user mode)
633 */
634/* Masks */
635#define CPLB_VALID 0x00000001 /* 0=invalid entry, 1=valid entry */
636#define CPLB_LOCK 0x00000002 /* 0=entry may be replaced, 1=entry
637 * locked
638 */
639#define CPLB_USER_RD 0x00000004 /* 0=no read access, 1=read access
640 * allowed (user mode)
641 */
642
643#define PAGE_SIZE_1KB 0x00000000 /* 1 KB page size */
644#define PAGE_SIZE_4KB 0x00010000 /* 4 KB page size */
645#define PAGE_SIZE_1MB 0x00020000 /* 1 MB page size */
646#define PAGE_SIZE_4MB 0x00030000 /* 4 MB page size */
647#define CPLB_L1SRAM 0x00000020 /* 0=SRAM mapped in L1, 0=SRAM not
648 * mapped to L1
649 */
650#define CPLB_PORTPRIO 0x00000200 /* 0=low priority port, 1= high
651 * priority port
652 */
653#define CPLB_L1_CHBL 0x00001000 /* 0=non-cacheable in L1, 1=cacheable
654 * in L1
655 */
656/* ICPLB_DATA only */
657#define CPLB_LRUPRIO 0x00000100 /* 0=can be replaced by any line,
658 * 1=priority for non-replacement
659 */
660/* DCPLB_DATA only */
661#define CPLB_USER_WR 0x00000008 /* 0=no write access, 0=write
662 * access allowed (user mode)
663 */
664#define CPLB_SUPV_WR 0x00000010 /* 0=no write access, 0=write
665 * access allowed (supervisor mode)
666 */
667#define CPLB_DIRTY 0x00000080 /* 1=dirty, 0=clean */
668#define CPLB_L1_AOW 0x00008000 /* 0=do not allocate cache lines on
669 * write-through writes,
670 * 1= allocate cache lines on
671 * write-through writes.
672 */
673#define CPLB_WT 0x00004000 /* 0=write-back, 1=write-through */
674
675#define CPLB_ALL_ACCESS CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR
676
677/* TBUFCTL Masks */
678#define TBUFPWR 0x0001
679#define TBUFEN 0x0002
680#define TBUFOVF 0x0004
681#define TBUFCMPLP_SINGLE 0x0008
682#define TBUFCMPLP_DOUBLE 0x0010
683#define TBUFCMPLP (TBUFCMPLP_SINGLE | TBUFCMPLP_DOUBLE)
684
685/* TBUFSTAT Masks */
686#define TBUFCNT 0x001F
687
688/* ITEST_COMMAND and DTEST_COMMAND Registers */
689/* Masks */
690#define TEST_READ 0x00000000 /* Read Access */
691#define TEST_WRITE 0x00000002 /* Write Access */
692#define TEST_TAG 0x00000000 /* Access TAG */
693#define TEST_DATA 0x00000004 /* Access DATA */
694#define TEST_DW0 0x00000000 /* Select Double Word 0 */
695#define TEST_DW1 0x00000008 /* Select Double Word 1 */
696#define TEST_DW2 0x00000010 /* Select Double Word 2 */
697#define TEST_DW3 0x00000018 /* Select Double Word 3 */
698#define TEST_MB0 0x00000000 /* Select Mini-Bank 0 */
699#define TEST_MB1 0x00010000 /* Select Mini-Bank 1 */
700#define TEST_MB2 0x00020000 /* Select Mini-Bank 2 */
701#define TEST_MB3 0x00030000 /* Select Mini-Bank 3 */
702#define TEST_SET(x) ((x << 5) & 0x03E0) /* Set Index 0->31 */
703#define TEST_WAY0 0x00000000 /* Access Way0 */
704#define TEST_WAY1 0x04000000 /* Access Way1 */
705/* ITEST_COMMAND only */
706#define TEST_WAY2 0x08000000 /* Access Way2 */
707#define TEST_WAY3 0x0C000000 /* Access Way3 */
708/* DTEST_COMMAND only */
709#define TEST_BNKSELA 0x00000000 /* Access SuperBank A */
710#define TEST_BNKSELB 0x00800000 /* Access SuperBank B */
711
712#endif /* _DEF_LPBLACKFIN_H */
diff --git a/include/asm-blackfin/mem_map.h b/include/asm-blackfin/mem_map.h
deleted file mode 100644
index 42d1f37f6d9c..000000000000
--- a/include/asm-blackfin/mem_map.h
+++ /dev/null
@@ -1,12 +0,0 @@
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
deleted file mode 100644
index b58f5ad3f024..000000000000
--- a/include/asm-blackfin/mman.h
+++ /dev/null
@@ -1,43 +0,0 @@
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
26#define MS_ASYNC 1 /* sync memory asynchronously */
27#define MS_INVALIDATE 2 /* invalidate the caches */
28#define MS_SYNC 4 /* synchronous memory sync */
29
30#define MCL_CURRENT 1 /* lock all current mappings */
31#define MCL_FUTURE 2 /* lock all future mappings */
32
33#define MADV_NORMAL 0x0 /* default page-in behavior */
34#define MADV_RANDOM 0x1 /* page-in minimum required */
35#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */
38
39/* compatibility flags */
40#define MAP_ANON MAP_ANONYMOUS
41#define MAP_FILE 0
42
43#endif /* __BFIN_MMAN_H__ */
diff --git a/include/asm-blackfin/mmu.h b/include/asm-blackfin/mmu.h
deleted file mode 100644
index 757e43906ed4..000000000000
--- a/include/asm-blackfin/mmu.h
+++ /dev/null
@@ -1,32 +0,0 @@
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#ifdef CONFIG_MPU
28 unsigned long *page_rwx_mask;
29#endif
30} mm_context_t;
31
32#endif
diff --git a/include/asm-blackfin/mmu_context.h b/include/asm-blackfin/mmu_context.h
deleted file mode 100644
index f55ec3c23a92..000000000000
--- a/include/asm-blackfin/mmu_context.h
+++ /dev/null
@@ -1,181 +0,0 @@
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 <linux/gfp.h>
34#include <linux/sched.h>
35#include <asm/setup.h>
36#include <asm/page.h>
37#include <asm/pgalloc.h>
38#include <asm/cplbinit.h>
39
40extern void *current_l1_stack_save;
41extern int nr_l1stack_tasks;
42extern void *l1_stack_base;
43extern unsigned long l1_stack_len;
44
45extern int l1sram_free(const void*);
46extern void *l1sram_alloc_max(void*);
47
48static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
49{
50}
51
52/* Called when creating a new context during fork() or execve(). */
53static inline int
54init_new_context(struct task_struct *tsk, struct mm_struct *mm)
55{
56#ifdef CONFIG_MPU
57 unsigned long p = __get_free_pages(GFP_KERNEL, page_mask_order);
58 mm->context.page_rwx_mask = (unsigned long *)p;
59 memset(mm->context.page_rwx_mask, 0,
60 page_mask_nelts * 3 * sizeof(long));
61#endif
62 return 0;
63}
64
65static inline void free_l1stack(void)
66{
67 nr_l1stack_tasks--;
68 if (nr_l1stack_tasks == 0)
69 l1sram_free(l1_stack_base);
70}
71static inline void destroy_context(struct mm_struct *mm)
72{
73 struct sram_list_struct *tmp;
74
75 if (current_l1_stack_save == mm->context.l1_stack_save)
76 current_l1_stack_save = NULL;
77 if (mm->context.l1_stack_save)
78 free_l1stack();
79
80 while ((tmp = mm->context.sram_list)) {
81 mm->context.sram_list = tmp->next;
82 sram_free(tmp->addr);
83 kfree(tmp);
84 }
85#ifdef CONFIG_MPU
86 if (current_rwx_mask == mm->context.page_rwx_mask)
87 current_rwx_mask = NULL;
88 free_pages((unsigned long)mm->context.page_rwx_mask, page_mask_order);
89#endif
90}
91
92static inline unsigned long
93alloc_l1stack(unsigned long length, unsigned long *stack_base)
94{
95 if (nr_l1stack_tasks == 0) {
96 l1_stack_base = l1sram_alloc_max(&l1_stack_len);
97 if (!l1_stack_base)
98 return 0;
99 }
100
101 if (l1_stack_len < length) {
102 if (nr_l1stack_tasks == 0)
103 l1sram_free(l1_stack_base);
104 return 0;
105 }
106 *stack_base = (unsigned long)l1_stack_base;
107 nr_l1stack_tasks++;
108 return l1_stack_len;
109}
110
111static inline int
112activate_l1stack(struct mm_struct *mm, unsigned long sp_base)
113{
114 if (current_l1_stack_save)
115 memcpy(current_l1_stack_save, l1_stack_base, l1_stack_len);
116 mm->context.l1_stack_save = current_l1_stack_save = (void*)sp_base;
117 memcpy(l1_stack_base, current_l1_stack_save, l1_stack_len);
118 return 1;
119}
120
121#define deactivate_mm(tsk,mm) do { } while (0)
122
123#define activate_mm(prev, next) switch_mm(prev, next, NULL)
124
125static inline void switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
126 struct task_struct *tsk)
127{
128 if (prev_mm == next_mm)
129 return;
130#ifdef CONFIG_MPU
131 if (prev_mm->context.page_rwx_mask == current_rwx_mask) {
132 flush_switched_cplbs();
133 set_mask_dcplbs(next_mm->context.page_rwx_mask);
134 }
135#endif
136
137 /* L1 stack switching. */
138 if (!next_mm->context.l1_stack_save)
139 return;
140 if (next_mm->context.l1_stack_save == current_l1_stack_save)
141 return;
142 if (current_l1_stack_save) {
143 memcpy(current_l1_stack_save, l1_stack_base, l1_stack_len);
144 }
145 current_l1_stack_save = next_mm->context.l1_stack_save;
146 memcpy(l1_stack_base, current_l1_stack_save, l1_stack_len);
147}
148
149#ifdef CONFIG_MPU
150static inline void protect_page(struct mm_struct *mm, unsigned long addr,
151 unsigned long flags)
152{
153 unsigned long *mask = mm->context.page_rwx_mask;
154 unsigned long page = addr >> 12;
155 unsigned long idx = page >> 5;
156 unsigned long bit = 1 << (page & 31);
157
158 if (flags & VM_MAYREAD)
159 mask[idx] |= bit;
160 else
161 mask[idx] &= ~bit;
162 mask += page_mask_nelts;
163 if (flags & VM_MAYWRITE)
164 mask[idx] |= bit;
165 else
166 mask[idx] &= ~bit;
167 mask += page_mask_nelts;
168 if (flags & VM_MAYEXEC)
169 mask[idx] |= bit;
170 else
171 mask[idx] &= ~bit;
172}
173
174static inline void update_protections(struct mm_struct *mm)
175{
176 flush_switched_cplbs();
177 set_mask_dcplbs(mm->context.page_rwx_mask);
178}
179#endif
180
181#endif
diff --git a/include/asm-blackfin/module.h b/include/asm-blackfin/module.h
deleted file mode 100644
index e3128df139d6..000000000000
--- a/include/asm-blackfin/module.h
+++ /dev/null
@@ -1,20 +0,0 @@
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
10struct mod_arch_specific {
11 Elf_Shdr *text_l1;
12 Elf_Shdr *data_a_l1;
13 Elf_Shdr *bss_a_l1;
14 Elf_Shdr *data_b_l1;
15 Elf_Shdr *bss_b_l1;
16 Elf_Shdr *text_l2;
17 Elf_Shdr *data_l2;
18 Elf_Shdr *bss_l2;
19};
20#endif /* _ASM_BFIN_MODULE_H */
diff --git a/include/asm-blackfin/msgbuf.h b/include/asm-blackfin/msgbuf.h
deleted file mode 100644
index 6fcbe8cd801d..000000000000
--- a/include/asm-blackfin/msgbuf.h
+++ /dev/null
@@ -1,31 +0,0 @@
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
deleted file mode 100644
index 458c1f7fbc18..000000000000
--- a/include/asm-blackfin/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
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/nand.h b/include/asm-blackfin/nand.h
deleted file mode 100644
index afbaafa793f1..000000000000
--- a/include/asm-blackfin/nand.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/* linux/include/asm-blackfin/nand.h
2 *
3 * Copyright (c) 2007 Analog Devices, Inc.
4 * Bryan Wu <bryan.wu@analog.com>
5 *
6 * BF5XX - NAND flash controller platfrom_device info
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/* struct bf5xx_nand_platform
14 *
15 * define a interface between platfrom board specific code and
16 * bf54x NFC driver.
17 *
18 * nr_partitions = number of partitions pointed to be partitoons (or zero)
19 * partitions = mtd partition list
20 */
21
22#define NFC_PG_SIZE_256 0
23#define NFC_PG_SIZE_512 1
24#define NFC_PG_SIZE_OFFSET 9
25
26#define NFC_NWIDTH_8 0
27#define NFC_NWIDTH_16 1
28#define NFC_NWIDTH_OFFSET 8
29
30#define NFC_RDDLY_OFFSET 4
31#define NFC_WRDLY_OFFSET 0
32
33#define NFC_STAT_NBUSY 1
34
35struct bf5xx_nand_platform {
36 /* NAND chip information */
37 unsigned short page_size;
38 unsigned short data_width;
39
40 /* RD/WR strobe delay timing information, all times in SCLK cycles */
41 unsigned short rd_dly;
42 unsigned short wr_dly;
43
44 /* NAND MTD partition information */
45 int nr_partitions;
46 struct mtd_partition *partitions;
47};
diff --git a/include/asm-blackfin/page.h b/include/asm-blackfin/page.h
deleted file mode 100644
index 344f6a8c1f22..000000000000
--- a/include/asm-blackfin/page.h
+++ /dev/null
@@ -1,88 +0,0 @@
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#ifdef __ASSEMBLY__
8#define PAGE_SIZE (1 << PAGE_SHIFT)
9#else
10#define PAGE_SIZE (1UL << PAGE_SHIFT)
11#endif
12#define PAGE_MASK (~(PAGE_SIZE-1))
13
14#include <asm/setup.h>
15
16#ifndef __ASSEMBLY__
17
18#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
19#define free_user_page(page, addr) free_page(addr)
20
21#define clear_page(page) memset((page), 0, PAGE_SIZE)
22#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
23
24#define clear_user_page(page, vaddr,pg) clear_page(page)
25#define copy_user_page(to, from, vaddr,pg) copy_page(to, from)
26
27/*
28 * These are used to make use of C type-checking..
29 */
30typedef struct {
31 unsigned long pte;
32} pte_t;
33typedef struct {
34 unsigned long pmd[16];
35} pmd_t;
36typedef struct {
37 unsigned long pgd;
38} pgd_t;
39typedef struct {
40 unsigned long pgprot;
41} pgprot_t;
42typedef struct page *pgtable_t;
43
44#define pte_val(x) ((x).pte)
45#define pmd_val(x) ((&x)->pmd[0])
46#define pgd_val(x) ((x).pgd)
47#define pgprot_val(x) ((x).pgprot)
48
49#define __pte(x) ((pte_t) { (x) } )
50#define __pmd(x) ((pmd_t) { (x) } )
51#define __pgd(x) ((pgd_t) { (x) } )
52#define __pgprot(x) ((pgprot_t) { (x) } )
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
88#endif /* _BLACKFIN_PAGE_H */
diff --git a/include/asm-blackfin/page_offset.h b/include/asm-blackfin/page_offset.h
deleted file mode 100644
index cbaff24b4b25..000000000000
--- a/include/asm-blackfin/page_offset.h
+++ /dev/null
@@ -1,6 +0,0 @@
1
2/* This handles the memory map.. */
3
4#ifdef CONFIG_BLACKFIN
5#define PAGE_OFFSET_RAW 0x00000000
6#endif
diff --git a/include/asm-blackfin/param.h b/include/asm-blackfin/param.h
deleted file mode 100644
index 41564a6347f8..000000000000
--- a/include/asm-blackfin/param.h
+++ /dev/null
@@ -1,22 +0,0 @@
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
deleted file mode 100644
index 61277358c865..000000000000
--- a/include/asm-blackfin/pci.h
+++ /dev/null
@@ -1,148 +0,0 @@
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
deleted file mode 100644
index 78dd61f6b39f..000000000000
--- a/include/asm-blackfin/percpu.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index c686e0542fd0..000000000000
--- a/include/asm-blackfin/pgalloc.h
+++ /dev/null
@@ -1,8 +0,0 @@
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
deleted file mode 100644
index b11b114689c0..000000000000
--- a/include/asm-blackfin/pgtable.h
+++ /dev/null
@@ -1,96 +0,0 @@
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/mach-common/def_LPBlackfin.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
deleted file mode 100644
index 94cc2636e0e2..000000000000
--- a/include/asm-blackfin/poll.h
+++ /dev/null
@@ -1,24 +0,0 @@
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/portmux.h b/include/asm-blackfin/portmux.h
deleted file mode 100644
index 0807b286cd9e..000000000000
--- a/include/asm-blackfin/portmux.h
+++ /dev/null
@@ -1,1188 +0,0 @@
1/*
2 * Common header file for blackfin family of processors.
3 *
4 */
5
6#ifndef _PORTMUX_H_
7#define _PORTMUX_H_
8
9#define P_IDENT(x) ((x) & 0x1FF)
10#define P_FUNCT(x) (((x) & 0x3) << 9)
11#define P_FUNCT2MUX(x) (((x) >> 9) & 0x3)
12#define P_DEFINED 0x8000
13#define P_UNDEF 0x4000
14#define P_MAYSHARE 0x2000
15#define P_DONTCARE 0x1000
16
17
18int peripheral_request(unsigned short per, const char *label);
19void peripheral_free(unsigned short per);
20int peripheral_request_list(const unsigned short per[], const char *label);
21void peripheral_free_list(const unsigned short per[]);
22
23#include <asm/gpio.h>
24#include <asm/mach/portmux.h>
25
26#ifndef P_SPORT2_TFS
27#define P_SPORT2_TFS P_UNDEF
28#endif
29
30#ifndef P_SPORT2_DTSEC
31#define P_SPORT2_DTSEC P_UNDEF
32#endif
33
34#ifndef P_SPORT2_DTPRI
35#define P_SPORT2_DTPRI P_UNDEF
36#endif
37
38#ifndef P_SPORT2_TSCLK
39#define P_SPORT2_TSCLK P_UNDEF
40#endif
41
42#ifndef P_SPORT2_RFS
43#define P_SPORT2_RFS P_UNDEF
44#endif
45
46#ifndef P_SPORT2_DRSEC
47#define P_SPORT2_DRSEC P_UNDEF
48#endif
49
50#ifndef P_SPORT2_DRPRI
51#define P_SPORT2_DRPRI P_UNDEF
52#endif
53
54#ifndef P_SPORT2_RSCLK
55#define P_SPORT2_RSCLK P_UNDEF
56#endif
57
58#ifndef P_SPORT3_TFS
59#define P_SPORT3_TFS P_UNDEF
60#endif
61
62#ifndef P_SPORT3_DTSEC
63#define P_SPORT3_DTSEC P_UNDEF
64#endif
65
66#ifndef P_SPORT3_DTPRI
67#define P_SPORT3_DTPRI P_UNDEF
68#endif
69
70#ifndef P_SPORT3_TSCLK
71#define P_SPORT3_TSCLK P_UNDEF
72#endif
73
74#ifndef P_SPORT3_RFS
75#define P_SPORT3_RFS P_UNDEF
76#endif
77
78#ifndef P_SPORT3_DRSEC
79#define P_SPORT3_DRSEC P_UNDEF
80#endif
81
82#ifndef P_SPORT3_DRPRI
83#define P_SPORT3_DRPRI P_UNDEF
84#endif
85
86#ifndef P_SPORT3_RSCLK
87#define P_SPORT3_RSCLK P_UNDEF
88#endif
89
90#ifndef P_TMR4
91#define P_TMR4 P_UNDEF
92#endif
93
94#ifndef P_TMR5
95#define P_TMR5 P_UNDEF
96#endif
97
98#ifndef P_TMR6
99#define P_TMR6 P_UNDEF
100#endif
101
102#ifndef P_TMR7
103#define P_TMR7 P_UNDEF
104#endif
105
106#ifndef P_TWI1_SCL
107#define P_TWI1_SCL P_UNDEF
108#endif
109
110#ifndef P_TWI1_SDA
111#define P_TWI1_SDA P_UNDEF
112#endif
113
114#ifndef P_UART3_RTS
115#define P_UART3_RTS P_UNDEF
116#endif
117
118#ifndef P_UART3_CTS
119#define P_UART3_CTS P_UNDEF
120#endif
121
122#ifndef P_UART2_TX
123#define P_UART2_TX P_UNDEF
124#endif
125
126#ifndef P_UART2_RX
127#define P_UART2_RX P_UNDEF
128#endif
129
130#ifndef P_UART3_TX
131#define P_UART3_TX P_UNDEF
132#endif
133
134#ifndef P_UART3_RX
135#define P_UART3_RX P_UNDEF
136#endif
137
138#ifndef P_SPI2_SS
139#define P_SPI2_SS P_UNDEF
140#endif
141
142#ifndef P_SPI2_SSEL1
143#define P_SPI2_SSEL1 P_UNDEF
144#endif
145
146#ifndef P_SPI2_SSEL2
147#define P_SPI2_SSEL2 P_UNDEF
148#endif
149
150#ifndef P_SPI2_SSEL3
151#define P_SPI2_SSEL3 P_UNDEF
152#endif
153
154#ifndef P_SPI2_SSEL4
155#define P_SPI2_SSEL4 P_UNDEF
156#endif
157
158#ifndef P_SPI2_SSEL5
159#define P_SPI2_SSEL5 P_UNDEF
160#endif
161
162#ifndef P_SPI2_SSEL6
163#define P_SPI2_SSEL6 P_UNDEF
164#endif
165
166#ifndef P_SPI2_SSEL7
167#define P_SPI2_SSEL7 P_UNDEF
168#endif
169
170#ifndef P_SPI2_SCK
171#define P_SPI2_SCK P_UNDEF
172#endif
173
174#ifndef P_SPI2_MOSI
175#define P_SPI2_MOSI P_UNDEF
176#endif
177
178#ifndef P_SPI2_MISO
179#define P_SPI2_MISO P_UNDEF
180#endif
181
182#ifndef P_TMR0
183#define P_TMR0 P_UNDEF
184#endif
185
186#ifndef P_TMR1
187#define P_TMR1 P_UNDEF
188#endif
189
190#ifndef P_TMR2
191#define P_TMR2 P_UNDEF
192#endif
193
194#ifndef P_TMR3
195#define P_TMR3 P_UNDEF
196#endif
197
198#ifndef P_SPORT0_TFS
199#define P_SPORT0_TFS P_UNDEF
200#endif
201
202#ifndef P_SPORT0_DTSEC
203#define P_SPORT0_DTSEC P_UNDEF
204#endif
205
206#ifndef P_SPORT0_DTPRI
207#define P_SPORT0_DTPRI P_UNDEF
208#endif
209
210#ifndef P_SPORT0_TSCLK
211#define P_SPORT0_TSCLK P_UNDEF
212#endif
213
214#ifndef P_SPORT0_RFS
215#define P_SPORT0_RFS P_UNDEF
216#endif
217
218#ifndef P_SPORT0_DRSEC
219#define P_SPORT0_DRSEC P_UNDEF
220#endif
221
222#ifndef P_SPORT0_DRPRI
223#define P_SPORT0_DRPRI P_UNDEF
224#endif
225
226#ifndef P_SPORT0_RSCLK
227#define P_SPORT0_RSCLK P_UNDEF
228#endif
229
230#ifndef P_SD_D0
231#define P_SD_D0 P_UNDEF
232#endif
233
234#ifndef P_SD_D1
235#define P_SD_D1 P_UNDEF
236#endif
237
238#ifndef P_SD_D2
239#define P_SD_D2 P_UNDEF
240#endif
241
242#ifndef P_SD_D3
243#define P_SD_D3 P_UNDEF
244#endif
245
246#ifndef P_SD_CLK
247#define P_SD_CLK P_UNDEF
248#endif
249
250#ifndef P_SD_CMD
251#define P_SD_CMD P_UNDEF
252#endif
253
254#ifndef P_MMCLK
255#define P_MMCLK P_UNDEF
256#endif
257
258#ifndef P_MBCLK
259#define P_MBCLK P_UNDEF
260#endif
261
262#ifndef P_PPI1_D0
263#define P_PPI1_D0 P_UNDEF
264#endif
265
266#ifndef P_PPI1_D1
267#define P_PPI1_D1 P_UNDEF
268#endif
269
270#ifndef P_PPI1_D2
271#define P_PPI1_D2 P_UNDEF
272#endif
273
274#ifndef P_PPI1_D3
275#define P_PPI1_D3 P_UNDEF
276#endif
277
278#ifndef P_PPI1_D4
279#define P_PPI1_D4 P_UNDEF
280#endif
281
282#ifndef P_PPI1_D5
283#define P_PPI1_D5 P_UNDEF
284#endif
285
286#ifndef P_PPI1_D6
287#define P_PPI1_D6 P_UNDEF
288#endif
289
290#ifndef P_PPI1_D7
291#define P_PPI1_D7 P_UNDEF
292#endif
293
294#ifndef P_PPI1_D8
295#define P_PPI1_D8 P_UNDEF
296#endif
297
298#ifndef P_PPI1_D9
299#define P_PPI1_D9 P_UNDEF
300#endif
301
302#ifndef P_PPI1_D10
303#define P_PPI1_D10 P_UNDEF
304#endif
305
306#ifndef P_PPI1_D11
307#define P_PPI1_D11 P_UNDEF
308#endif
309
310#ifndef P_PPI1_D12
311#define P_PPI1_D12 P_UNDEF
312#endif
313
314#ifndef P_PPI1_D13
315#define P_PPI1_D13 P_UNDEF
316#endif
317
318#ifndef P_PPI1_D14
319#define P_PPI1_D14 P_UNDEF
320#endif
321
322#ifndef P_PPI1_D15
323#define P_PPI1_D15 P_UNDEF
324#endif
325
326#ifndef P_HOST_D8
327#define P_HOST_D8 P_UNDEF
328#endif
329
330#ifndef P_HOST_D9
331#define P_HOST_D9 P_UNDEF
332#endif
333
334#ifndef P_HOST_D10
335#define P_HOST_D10 P_UNDEF
336#endif
337
338#ifndef P_HOST_D11
339#define P_HOST_D11 P_UNDEF
340#endif
341
342#ifndef P_HOST_D12
343#define P_HOST_D12 P_UNDEF
344#endif
345
346#ifndef P_HOST_D13
347#define P_HOST_D13 P_UNDEF
348#endif
349
350#ifndef P_HOST_D14
351#define P_HOST_D14 P_UNDEF
352#endif
353
354#ifndef P_HOST_D15
355#define P_HOST_D15 P_UNDEF
356#endif
357
358#ifndef P_HOST_D0
359#define P_HOST_D0 P_UNDEF
360#endif
361
362#ifndef P_HOST_D1
363#define P_HOST_D1 P_UNDEF
364#endif
365
366#ifndef P_HOST_D2
367#define P_HOST_D2 P_UNDEF
368#endif
369
370#ifndef P_HOST_D3
371#define P_HOST_D3 P_UNDEF
372#endif
373
374#ifndef P_HOST_D4
375#define P_HOST_D4 P_UNDEF
376#endif
377
378#ifndef P_HOST_D5
379#define P_HOST_D5 P_UNDEF
380#endif
381
382#ifndef P_HOST_D6
383#define P_HOST_D6 P_UNDEF
384#endif
385
386#ifndef P_HOST_D7
387#define P_HOST_D7 P_UNDEF
388#endif
389
390#ifndef P_SPORT1_TFS
391#define P_SPORT1_TFS P_UNDEF
392#endif
393
394#ifndef P_SPORT1_DTSEC
395#define P_SPORT1_DTSEC P_UNDEF
396#endif
397
398#ifndef P_SPORT1_DTPRI
399#define P_SPORT1_DTPRI P_UNDEF
400#endif
401
402#ifndef P_SPORT1_TSCLK
403#define P_SPORT1_TSCLK P_UNDEF
404#endif
405
406#ifndef P_SPORT1_RFS
407#define P_SPORT1_RFS P_UNDEF
408#endif
409
410#ifndef P_SPORT1_DRSEC
411#define P_SPORT1_DRSEC P_UNDEF
412#endif
413
414#ifndef P_SPORT1_DRPRI
415#define P_SPORT1_DRPRI P_UNDEF
416#endif
417
418#ifndef P_SPORT1_RSCLK
419#define P_SPORT1_RSCLK P_UNDEF
420#endif
421
422#ifndef P_PPI2_D0
423#define P_PPI2_D0 P_UNDEF
424#endif
425
426#ifndef P_PPI2_D1
427#define P_PPI2_D1 P_UNDEF
428#endif
429
430#ifndef P_PPI2_D2
431#define P_PPI2_D2 P_UNDEF
432#endif
433
434#ifndef P_PPI2_D3
435#define P_PPI2_D3 P_UNDEF
436#endif
437
438#ifndef P_PPI2_D4
439#define P_PPI2_D4 P_UNDEF
440#endif
441
442#ifndef P_PPI2_D5
443#define P_PPI2_D5 P_UNDEF
444#endif
445
446#ifndef P_PPI2_D6
447#define P_PPI2_D6 P_UNDEF
448#endif
449
450#ifndef P_PPI2_D7
451#define P_PPI2_D7 P_UNDEF
452#endif
453
454#ifndef P_PPI0_D18
455#define P_PPI0_D18 P_UNDEF
456#endif
457
458#ifndef P_PPI0_D19
459#define P_PPI0_D19 P_UNDEF
460#endif
461
462#ifndef P_PPI0_D20
463#define P_PPI0_D20 P_UNDEF
464#endif
465
466#ifndef P_PPI0_D21
467#define P_PPI0_D21 P_UNDEF
468#endif
469
470#ifndef P_PPI0_D22
471#define P_PPI0_D22 P_UNDEF
472#endif
473
474#ifndef P_PPI0_D23
475#define P_PPI0_D23 P_UNDEF
476#endif
477
478#ifndef P_KEY_ROW0
479#define P_KEY_ROW0 P_UNDEF
480#endif
481
482#ifndef P_KEY_ROW1
483#define P_KEY_ROW1 P_UNDEF
484#endif
485
486#ifndef P_KEY_ROW2
487#define P_KEY_ROW2 P_UNDEF
488#endif
489
490#ifndef P_KEY_ROW3
491#define P_KEY_ROW3 P_UNDEF
492#endif
493
494#ifndef P_KEY_COL0
495#define P_KEY_COL0 P_UNDEF
496#endif
497
498#ifndef P_KEY_COL1
499#define P_KEY_COL1 P_UNDEF
500#endif
501
502#ifndef P_KEY_COL2
503#define P_KEY_COL2 P_UNDEF
504#endif
505
506#ifndef P_KEY_COL3
507#define P_KEY_COL3 P_UNDEF
508#endif
509
510#ifndef P_SPI0_SCK
511#define P_SPI0_SCK P_UNDEF
512#endif
513
514#ifndef P_SPI0_MISO
515#define P_SPI0_MISO P_UNDEF
516#endif
517
518#ifndef P_SPI0_MOSI
519#define P_SPI0_MOSI P_UNDEF
520#endif
521
522#ifndef P_SPI0_SS
523#define P_SPI0_SS P_UNDEF
524#endif
525
526#ifndef P_SPI0_SSEL1
527#define P_SPI0_SSEL1 P_UNDEF
528#endif
529
530#ifndef P_SPI0_SSEL2
531#define P_SPI0_SSEL2 P_UNDEF
532#endif
533
534#ifndef P_SPI0_SSEL3
535#define P_SPI0_SSEL3 P_UNDEF
536#endif
537
538#ifndef P_SPI0_SSEL4
539#define P_SPI0_SSEL4 P_UNDEF
540#endif
541
542#ifndef P_SPI0_SSEL5
543#define P_SPI0_SSEL5 P_UNDEF
544#endif
545
546#ifndef P_SPI0_SSEL6
547#define P_SPI0_SSEL6 P_UNDEF
548#endif
549
550#ifndef P_SPI0_SSEL7
551#define P_SPI0_SSEL7 P_UNDEF
552#endif
553
554#ifndef P_UART0_TX
555#define P_UART0_TX P_UNDEF
556#endif
557
558#ifndef P_UART0_RX
559#define P_UART0_RX P_UNDEF
560#endif
561
562#ifndef P_UART1_RTS
563#define P_UART1_RTS P_UNDEF
564#endif
565
566#ifndef P_UART1_CTS
567#define P_UART1_CTS P_UNDEF
568#endif
569
570#ifndef P_PPI1_CLK
571#define P_PPI1_CLK P_UNDEF
572#endif
573
574#ifndef P_PPI1_FS1
575#define P_PPI1_FS1 P_UNDEF
576#endif
577
578#ifndef P_PPI1_FS2
579#define P_PPI1_FS2 P_UNDEF
580#endif
581
582#ifndef P_TWI0_SCL
583#define P_TWI0_SCL P_UNDEF
584#endif
585
586#ifndef P_TWI0_SDA
587#define P_TWI0_SDA P_UNDEF
588#endif
589
590#ifndef P_KEY_COL7
591#define P_KEY_COL7 P_UNDEF
592#endif
593
594#ifndef P_KEY_ROW6
595#define P_KEY_ROW6 P_UNDEF
596#endif
597
598#ifndef P_KEY_COL6
599#define P_KEY_COL6 P_UNDEF
600#endif
601
602#ifndef P_KEY_ROW5
603#define P_KEY_ROW5 P_UNDEF
604#endif
605
606#ifndef P_KEY_COL5
607#define P_KEY_COL5 P_UNDEF
608#endif
609
610#ifndef P_KEY_ROW4
611#define P_KEY_ROW4 P_UNDEF
612#endif
613
614#ifndef P_KEY_COL4
615#define P_KEY_COL4 P_UNDEF
616#endif
617
618#ifndef P_KEY_ROW7
619#define P_KEY_ROW7 P_UNDEF
620#endif
621
622#ifndef P_PPI0_D0
623#define P_PPI0_D0 P_UNDEF
624#endif
625
626#ifndef P_PPI0_D1
627#define P_PPI0_D1 P_UNDEF
628#endif
629
630#ifndef P_PPI0_D2
631#define P_PPI0_D2 P_UNDEF
632#endif
633
634#ifndef P_PPI0_D3
635#define P_PPI0_D3 P_UNDEF
636#endif
637
638#ifndef P_PPI0_D4
639#define P_PPI0_D4 P_UNDEF
640#endif
641
642#ifndef P_PPI0_D5
643#define P_PPI0_D5 P_UNDEF
644#endif
645
646#ifndef P_PPI0_D6
647#define P_PPI0_D6 P_UNDEF
648#endif
649
650#ifndef P_PPI0_D7
651#define P_PPI0_D7 P_UNDEF
652#endif
653
654#ifndef P_PPI0_D8
655#define P_PPI0_D8 P_UNDEF
656#endif
657
658#ifndef P_PPI0_D9
659#define P_PPI0_D9 P_UNDEF
660#endif
661
662#ifndef P_PPI0_D10
663#define P_PPI0_D10 P_UNDEF
664#endif
665
666#ifndef P_PPI0_D11
667#define P_PPI0_D11 P_UNDEF
668#endif
669
670#ifndef P_PPI0_D12
671#define P_PPI0_D12 P_UNDEF
672#endif
673
674#ifndef P_PPI0_D13
675#define P_PPI0_D13 P_UNDEF
676#endif
677
678#ifndef P_PPI0_D14
679#define P_PPI0_D14 P_UNDEF
680#endif
681
682#ifndef P_PPI0_D15
683#define P_PPI0_D15 P_UNDEF
684#endif
685
686#ifndef P_ATAPI_D0A
687#define P_ATAPI_D0A P_UNDEF
688#endif
689
690#ifndef P_ATAPI_D1A
691#define P_ATAPI_D1A P_UNDEF
692#endif
693
694#ifndef P_ATAPI_D2A
695#define P_ATAPI_D2A P_UNDEF
696#endif
697
698#ifndef P_ATAPI_D3A
699#define P_ATAPI_D3A P_UNDEF
700#endif
701
702#ifndef P_ATAPI_D4A
703#define P_ATAPI_D4A P_UNDEF
704#endif
705
706#ifndef P_ATAPI_D5A
707#define P_ATAPI_D5A P_UNDEF
708#endif
709
710#ifndef P_ATAPI_D6A
711#define P_ATAPI_D6A P_UNDEF
712#endif
713
714#ifndef P_ATAPI_D7A
715#define P_ATAPI_D7A P_UNDEF
716#endif
717
718#ifndef P_ATAPI_D8A
719#define P_ATAPI_D8A P_UNDEF
720#endif
721
722#ifndef P_ATAPI_D9A
723#define P_ATAPI_D9A P_UNDEF
724#endif
725
726#ifndef P_ATAPI_D10A
727#define P_ATAPI_D10A P_UNDEF
728#endif
729
730#ifndef P_ATAPI_D11A
731#define P_ATAPI_D11A P_UNDEF
732#endif
733
734#ifndef P_ATAPI_D12A
735#define P_ATAPI_D12A P_UNDEF
736#endif
737
738#ifndef P_ATAPI_D13A
739#define P_ATAPI_D13A P_UNDEF
740#endif
741
742#ifndef P_ATAPI_D14A
743#define P_ATAPI_D14A P_UNDEF
744#endif
745
746#ifndef P_ATAPI_D15A
747#define P_ATAPI_D15A P_UNDEF
748#endif
749
750#ifndef P_PPI0_CLK
751#define P_PPI0_CLK P_UNDEF
752#endif
753
754#ifndef P_PPI0_FS1
755#define P_PPI0_FS1 P_UNDEF
756#endif
757
758#ifndef P_PPI0_FS2
759#define P_PPI0_FS2 P_UNDEF
760#endif
761
762#ifndef P_PPI0_D16
763#define P_PPI0_D16 P_UNDEF
764#endif
765
766#ifndef P_PPI0_D17
767#define P_PPI0_D17 P_UNDEF
768#endif
769
770#ifndef P_SPI1_SSEL1
771#define P_SPI1_SSEL1 P_UNDEF
772#endif
773
774#ifndef P_SPI1_SSEL2
775#define P_SPI1_SSEL2 P_UNDEF
776#endif
777
778#ifndef P_SPI1_SSEL3
779#define P_SPI1_SSEL3 P_UNDEF
780#endif
781
782
783#ifndef P_SPI1_SSEL4
784#define P_SPI1_SSEL4 P_UNDEF
785#endif
786
787#ifndef P_SPI1_SSEL5
788#define P_SPI1_SSEL5 P_UNDEF
789#endif
790
791#ifndef P_SPI1_SSEL6
792#define P_SPI1_SSEL6 P_UNDEF
793#endif
794
795#ifndef P_SPI1_SSEL7
796#define P_SPI1_SSEL7 P_UNDEF
797#endif
798
799#ifndef P_SPI1_SCK
800#define P_SPI1_SCK P_UNDEF
801#endif
802
803#ifndef P_SPI1_MISO
804#define P_SPI1_MISO P_UNDEF
805#endif
806
807#ifndef P_SPI1_MOSI
808#define P_SPI1_MOSI P_UNDEF
809#endif
810
811#ifndef P_SPI1_SS
812#define P_SPI1_SS P_UNDEF
813#endif
814
815#ifndef P_CAN0_TX
816#define P_CAN0_TX P_UNDEF
817#endif
818
819#ifndef P_CAN0_RX
820#define P_CAN0_RX P_UNDEF
821#endif
822
823#ifndef P_CAN1_TX
824#define P_CAN1_TX P_UNDEF
825#endif
826
827#ifndef P_CAN1_RX
828#define P_CAN1_RX P_UNDEF
829#endif
830
831#ifndef P_ATAPI_A0A
832#define P_ATAPI_A0A P_UNDEF
833#endif
834
835#ifndef P_ATAPI_A1A
836#define P_ATAPI_A1A P_UNDEF
837#endif
838
839#ifndef P_ATAPI_A2A
840#define P_ATAPI_A2A P_UNDEF
841#endif
842
843#ifndef P_HOST_CE
844#define P_HOST_CE P_UNDEF
845#endif
846
847#ifndef P_HOST_RD
848#define P_HOST_RD P_UNDEF
849#endif
850
851#ifndef P_HOST_WR
852#define P_HOST_WR P_UNDEF
853#endif
854
855#ifndef P_MTXONB
856#define P_MTXONB P_UNDEF
857#endif
858
859#ifndef P_PPI2_FS2
860#define P_PPI2_FS2 P_UNDEF
861#endif
862
863#ifndef P_PPI2_FS1
864#define P_PPI2_FS1 P_UNDEF
865#endif
866
867#ifndef P_PPI2_CLK
868#define P_PPI2_CLK P_UNDEF
869#endif
870
871#ifndef P_CNT_CZM
872#define P_CNT_CZM P_UNDEF
873#endif
874
875#ifndef P_UART1_TX
876#define P_UART1_TX P_UNDEF
877#endif
878
879#ifndef P_UART1_RX
880#define P_UART1_RX P_UNDEF
881#endif
882
883#ifndef P_ATAPI_RESET
884#define P_ATAPI_RESET P_UNDEF
885#endif
886
887#ifndef P_HOST_ADDR
888#define P_HOST_ADDR P_UNDEF
889#endif
890
891#ifndef P_HOST_ACK
892#define P_HOST_ACK P_UNDEF
893#endif
894
895#ifndef P_MTX
896#define P_MTX P_UNDEF
897#endif
898
899#ifndef P_MRX
900#define P_MRX P_UNDEF
901#endif
902
903#ifndef P_MRXONB
904#define P_MRXONB P_UNDEF
905#endif
906
907#ifndef P_A4
908#define P_A4 P_UNDEF
909#endif
910
911#ifndef P_A5
912#define P_A5 P_UNDEF
913#endif
914
915#ifndef P_A6
916#define P_A6 P_UNDEF
917#endif
918
919#ifndef P_A7
920#define P_A7 P_UNDEF
921#endif
922
923#ifndef P_A8
924#define P_A8 P_UNDEF
925#endif
926
927#ifndef P_A9
928#define P_A9 P_UNDEF
929#endif
930
931#ifndef P_PPI1_FS3
932#define P_PPI1_FS3 P_UNDEF
933#endif
934
935#ifndef P_PPI2_FS3
936#define P_PPI2_FS3 P_UNDEF
937#endif
938
939#ifndef P_TMR8
940#define P_TMR8 P_UNDEF
941#endif
942
943#ifndef P_TMR9
944#define P_TMR9 P_UNDEF
945#endif
946
947#ifndef P_TMR10
948#define P_TMR10 P_UNDEF
949#endif
950#ifndef P_TMR11
951#define P_TMR11 P_UNDEF
952#endif
953
954#ifndef P_DMAR0
955#define P_DMAR0 P_UNDEF
956#endif
957
958#ifndef P_DMAR1
959#define P_DMAR1 P_UNDEF
960#endif
961
962#ifndef P_PPI0_FS3
963#define P_PPI0_FS3 P_UNDEF
964#endif
965
966#ifndef P_CNT_CDG
967#define P_CNT_CDG P_UNDEF
968#endif
969
970#ifndef P_CNT_CUD
971#define P_CNT_CUD P_UNDEF
972#endif
973
974#ifndef P_A10
975#define P_A10 P_UNDEF
976#endif
977
978#ifndef P_A11
979#define P_A11 P_UNDEF
980#endif
981
982#ifndef P_A12
983#define P_A12 P_UNDEF
984#endif
985
986#ifndef P_A13
987#define P_A13 P_UNDEF
988#endif
989
990#ifndef P_A14
991#define P_A14 P_UNDEF
992#endif
993
994#ifndef P_A15
995#define P_A15 P_UNDEF
996#endif
997
998#ifndef P_A16
999#define P_A16 P_UNDEF
1000#endif
1001
1002#ifndef P_A17
1003#define P_A17 P_UNDEF
1004#endif
1005
1006#ifndef P_A18
1007#define P_A18 P_UNDEF
1008#endif
1009
1010#ifndef P_A19
1011#define P_A19 P_UNDEF
1012#endif
1013
1014#ifndef P_A20
1015#define P_A20 P_UNDEF
1016#endif
1017
1018#ifndef P_A21
1019#define P_A21 P_UNDEF
1020#endif
1021
1022#ifndef P_A22
1023#define P_A22 P_UNDEF
1024#endif
1025
1026#ifndef P_A23
1027#define P_A23 P_UNDEF
1028#endif
1029
1030#ifndef P_A24
1031#define P_A24 P_UNDEF
1032#endif
1033
1034#ifndef P_A25
1035#define P_A25 P_UNDEF
1036#endif
1037
1038#ifndef P_NOR_CLK
1039#define P_NOR_CLK P_UNDEF
1040#endif
1041
1042#ifndef P_TMRCLK
1043#define P_TMRCLK P_UNDEF
1044#endif
1045
1046#ifndef P_AMC_ARDY_NOR_WAIT
1047#define P_AMC_ARDY_NOR_WAIT P_UNDEF
1048#endif
1049
1050#ifndef P_NAND_CE
1051#define P_NAND_CE P_UNDEF
1052#endif
1053
1054#ifndef P_NAND_RB
1055#define P_NAND_RB P_UNDEF
1056#endif
1057
1058#ifndef P_ATAPI_DIOR
1059#define P_ATAPI_DIOR P_UNDEF
1060#endif
1061
1062#ifndef P_ATAPI_DIOW
1063#define P_ATAPI_DIOW P_UNDEF
1064#endif
1065
1066#ifndef P_ATAPI_CS0
1067#define P_ATAPI_CS0 P_UNDEF
1068#endif
1069
1070#ifndef P_ATAPI_CS1
1071#define P_ATAPI_CS1 P_UNDEF
1072#endif
1073
1074#ifndef P_ATAPI_DMACK
1075#define P_ATAPI_DMACK P_UNDEF
1076#endif
1077
1078#ifndef P_ATAPI_DMARQ
1079#define P_ATAPI_DMARQ P_UNDEF
1080#endif
1081
1082#ifndef P_ATAPI_INTRQ
1083#define P_ATAPI_INTRQ P_UNDEF
1084#endif
1085
1086#ifndef P_ATAPI_IORDY
1087#define P_ATAPI_IORDY P_UNDEF
1088#endif
1089
1090#ifndef P_AMC_BR
1091#define P_AMC_BR P_UNDEF
1092#endif
1093
1094#ifndef P_AMC_BG
1095#define P_AMC_BG P_UNDEF
1096#endif
1097
1098#ifndef P_AMC_BGH
1099#define P_AMC_BGH P_UNDEF
1100#endif
1101
1102/* EMAC */
1103
1104#ifndef P_MII0_ETxD0
1105#define P_MII0_ETxD0 P_UNDEF
1106#endif
1107
1108#ifndef P_MII0_ETxD1
1109#define P_MII0_ETxD1 P_UNDEF
1110#endif
1111
1112#ifndef P_MII0_ETxD2
1113#define P_MII0_ETxD2 P_UNDEF
1114#endif
1115
1116#ifndef P_MII0_ETxD3
1117#define P_MII0_ETxD3 P_UNDEF
1118#endif
1119
1120#ifndef P_MII0_ETxEN
1121#define P_MII0_ETxEN P_UNDEF
1122#endif
1123
1124#ifndef P_MII0_TxCLK
1125#define P_MII0_TxCLK P_UNDEF
1126#endif
1127
1128#ifndef P_MII0_PHYINT
1129#define P_MII0_PHYINT P_UNDEF
1130#endif
1131
1132#ifndef P_MII0_COL
1133#define P_MII0_COL P_UNDEF
1134#endif
1135
1136#ifndef P_MII0_ERxD0
1137#define P_MII0_ERxD0 P_UNDEF
1138#endif
1139
1140#ifndef P_MII0_ERxD1
1141#define P_MII0_ERxD1 P_UNDEF
1142#endif
1143
1144#ifndef P_MII0_ERxD2
1145#define P_MII0_ERxD2 P_UNDEF
1146#endif
1147
1148#ifndef P_MII0_ERxD3
1149#define P_MII0_ERxD3 P_UNDEF
1150#endif
1151
1152#ifndef P_MII0_ERxDV
1153#define P_MII0_ERxDV P_UNDEF
1154#endif
1155
1156#ifndef P_MII0_ERxCLK
1157#define P_MII0_ERxCLK P_UNDEF
1158#endif
1159
1160#ifndef P_MII0_ERxER
1161#define P_MII0_ERxER P_UNDEF
1162#endif
1163
1164#ifndef P_MII0_CRS
1165#define P_MII0_CRS P_UNDEF
1166#endif
1167
1168#ifndef P_RMII0_REF_CLK
1169#define P_RMII0_REF_CLK P_UNDEF
1170#endif
1171
1172#ifndef P_RMII0_MDINT
1173#define P_RMII0_MDINT P_UNDEF
1174#endif
1175
1176#ifndef P_RMII0_CRS_DV
1177#define P_RMII0_CRS_DV P_UNDEF
1178#endif
1179
1180#ifndef P_MDC
1181#define P_MDC P_UNDEF
1182#endif
1183
1184#ifndef P_MDIO
1185#define P_MDIO P_UNDEF
1186#endif
1187
1188#endif /* _PORTMUX_H_ */
diff --git a/include/asm-blackfin/posix_types.h b/include/asm-blackfin/posix_types.h
deleted file mode 100644
index 23aa1f8c1bd1..000000000000
--- a/include/asm-blackfin/posix_types.h
+++ /dev/null
@@ -1,61 +0,0 @@
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 int val[2];
43} __kernel_fsid_t;
44
45#if defined(__KERNEL__)
46
47#undef __FD_SET
48#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
49
50#undef __FD_CLR
51#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
52
53#undef __FD_ISSET
54#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
55
56#undef __FD_ZERO
57#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
58
59#endif /* defined(__KERNEL__) */
60
61#endif
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h
deleted file mode 100644
index 6f3995b119d8..000000000000
--- a/include/asm-blackfin/processor.h
+++ /dev/null
@@ -1,158 +0,0 @@
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 * Fairly meaningless on nommu. Parts of user programs can be scattered
30 * in a lot of places, so just disable this by setting it to 0xFFFFFFFF.
31 */
32#define TASK_SIZE 0xFFFFFFFF
33
34#ifdef __KERNEL__
35#define STACK_TOP TASK_SIZE
36#endif
37
38#define TASK_UNMAPPED_BASE 0
39
40struct thread_struct {
41 unsigned long ksp; /* kernel stack pointer */
42 unsigned long usp; /* user stack pointer */
43 unsigned short seqstat; /* saved status register */
44 unsigned long esp0; /* points to SR of stack frame pt_regs */
45 unsigned long pc; /* instruction pointer */
46 void * debuggerinfo;
47};
48
49#define INIT_THREAD { \
50 sizeof(init_stack) + (unsigned long) init_stack, 0, \
51 PS_S, 0, 0 \
52}
53
54/*
55 * Do necessary setup to start up a newly executed thread.
56 *
57 * pass the data segment into user programs if it exists,
58 * it can't hurt anything as far as I can tell
59 */
60#define start_thread(_regs, _pc, _usp) \
61do { \
62 set_fs(USER_DS); \
63 (_regs)->pc = (_pc); \
64 if (current->mm) \
65 (_regs)->p5 = current->mm->start_data; \
66 task_thread_info(current)->l1_task_info.stack_start \
67 = (void *)current->mm->context.stack_start; \
68 task_thread_info(current)->l1_task_info.lowest_sp = (void *)(_usp); \
69 memcpy(L1_SCRATCH_TASK_INFO, &task_thread_info(current)->l1_task_info, \
70 sizeof(*L1_SCRATCH_TASK_INFO)); \
71 wrusp(_usp); \
72} while(0)
73
74/* Forward declaration, a strange C thing */
75struct task_struct;
76
77/* Free all resources held by a thread. */
78static inline void release_thread(struct task_struct *dead_task)
79{
80}
81
82#define prepare_to_copy(tsk) do { } while (0)
83
84extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags);
85
86/*
87 * Free current thread data structures etc..
88 */
89static inline void exit_thread(void)
90{
91}
92
93/*
94 * Return saved PC of a blocked thread.
95 */
96#define thread_saved_pc(tsk) (tsk->thread.pc)
97
98unsigned long get_wchan(struct task_struct *p);
99
100#define KSTK_EIP(tsk) \
101 ({ \
102 unsigned long eip = 0; \
103 if ((tsk)->thread.esp0 > PAGE_SIZE && \
104 MAP_NR((tsk)->thread.esp0) < max_mapnr) \
105 eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
106 eip; })
107#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
108
109#define cpu_relax() barrier()
110
111/* Get the Silicon Revision of the chip */
112static inline uint32_t __pure bfin_revid(void)
113{
114 /* stored in the upper 4 bits */
115 uint32_t revid = bfin_read_CHIPID() >> 28;
116
117#ifdef CONFIG_BF52x
118 /* ANOMALY_05000357
119 * Incorrect Revision Number in DSPID Register
120 */
121 if (revid == 0)
122 switch (bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI)) {
123 case 0x0010:
124 revid = 0;
125 break;
126 case 0x2796:
127 revid = 1;
128 break;
129 default:
130 revid = 0xFFFF;
131 break;
132 }
133#endif
134 return revid;
135}
136
137static inline uint32_t __pure bfin_compiled_revid(void)
138{
139#if defined(CONFIG_BF_REV_0_0)
140 return 0;
141#elif defined(CONFIG_BF_REV_0_1)
142 return 1;
143#elif defined(CONFIG_BF_REV_0_2)
144 return 2;
145#elif defined(CONFIG_BF_REV_0_3)
146 return 3;
147#elif defined(CONFIG_BF_REV_0_4)
148 return 4;
149#elif defined(CONFIG_BF_REV_0_5)
150 return 5;
151#elif defined(CONFIG_BF_REV_ANY)
152 return 0xffff;
153#else
154 return -1;
155#endif
156}
157
158#endif
diff --git a/include/asm-blackfin/ptrace.h b/include/asm-blackfin/ptrace.h
deleted file mode 100644
index a45a80e54adc..000000000000
--- a/include/asm-blackfin/ptrace.h
+++ /dev/null
@@ -1,168 +0,0 @@
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#define PTRACE_GETFDPIC 31
87#define PTRACE_GETFDPIC_EXEC 0
88#define PTRACE_GETFDPIC_INTERP 1
89
90#define PS_S (0x0002)
91
92#ifdef __KERNEL__
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 /* __KERNEL__ */
102
103#endif /* __ASSEMBLY__ */
104
105/*
106 * Offsets used by 'ptrace' system call interface.
107 */
108
109#define PT_R0 204
110#define PT_R1 200
111#define PT_R2 196
112#define PT_R3 192
113#define PT_R4 188
114#define PT_R5 184
115#define PT_R6 180
116#define PT_R7 176
117#define PT_P0 172
118#define PT_P1 168
119#define PT_P2 164
120#define PT_P3 160
121#define PT_P4 156
122#define PT_P5 152
123#define PT_FP 148
124#define PT_USP 144
125#define PT_I0 140
126#define PT_I1 136
127#define PT_I2 132
128#define PT_I3 128
129#define PT_M0 124
130#define PT_M1 120
131#define PT_M2 116
132#define PT_M3 112
133#define PT_L0 108
134#define PT_L1 104
135#define PT_L2 100
136#define PT_L3 96
137#define PT_B0 92
138#define PT_B1 88
139#define PT_B2 84
140#define PT_B3 80
141#define PT_A0X 76
142#define PT_A0W 72
143#define PT_A1X 68
144#define PT_A1W 64
145#define PT_LC0 60
146#define PT_LC1 56
147#define PT_LT0 52
148#define PT_LT1 48
149#define PT_LB0 44
150#define PT_LB1 40
151#define PT_ASTAT 36
152#define PT_RESERVED 32
153#define PT_RETS 28
154#define PT_PC 24
155#define PT_RETX 20
156#define PT_RETN 16
157#define PT_RETE 12
158#define PT_SEQSTAT 8
159#define PT_IPEND 4
160
161#define PT_SYSCFG 216
162#define PT_TEXT_ADDR 220
163#define PT_TEXT_END_ADDR 224
164#define PT_DATA_ADDR 228
165#define PT_FDPIC_EXEC 232
166#define PT_FDPIC_INTERP 236
167
168#endif /* _BFIN_PTRACE_H */
diff --git a/include/asm-blackfin/reboot.h b/include/asm-blackfin/reboot.h
deleted file mode 100644
index 6d448b5f5985..000000000000
--- a/include/asm-blackfin/reboot.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * include/asm-blackfin/reboot.h - shutdown/reboot header
3 *
4 * Copyright 2004-2007 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __ASM_REBOOT_H__
10#define __ASM_REBOOT_H__
11
12/* optional board specific hooks */
13extern void native_machine_restart(char *cmd);
14extern void native_machine_halt(void);
15extern void native_machine_power_off(void);
16
17/* common reboot workarounds */
18extern void bfin_gpio_reset_spi0_ssel1(void);
19
20#endif
diff --git a/include/asm-blackfin/resource.h b/include/asm-blackfin/resource.h
deleted file mode 100644
index 091355ab3495..000000000000
--- a/include/asm-blackfin/resource.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index 04f448711cd0..000000000000
--- a/include/asm-blackfin/scatterlist.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef _BLACKFIN_SCATTERLIST_H
2#define _BLACKFIN_SCATTERLIST_H
3
4#include <linux/mm.h>
5
6struct scatterlist {
7#ifdef CONFIG_DEBUG_SG
8 unsigned long sg_magic;
9#endif
10 unsigned long page_link;
11 unsigned int offset;
12 dma_addr_t dma_address;
13 unsigned int length;
14};
15
16/*
17 * These macros should be used after a pci_map_sg call has been done
18 * to get bus addresses of each of the SG entries and their lengths.
19 * You should only work with the number of sg entries pci_map_sg
20 * returns, or alternatively stop on the first sg_dma_len(sg) which
21 * is 0.
22 */
23#define sg_dma_address(sg) ((sg)->dma_address)
24#define sg_dma_len(sg) ((sg)->length)
25
26#define ISA_DMA_THRESHOLD (0xffffffff)
27
28#endif /* !(_BLACKFIN_SCATTERLIST_H) */
diff --git a/include/asm-blackfin/sections.h b/include/asm-blackfin/sections.h
deleted file mode 100644
index 1443c3353a8c..000000000000
--- a/include/asm-blackfin/sections.h
+++ /dev/null
@@ -1,7 +0,0 @@
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
deleted file mode 100644
index 02cfd09b5a99..000000000000
--- a/include/asm-blackfin/segment.h
+++ /dev/null
@@ -1,7 +0,0 @@
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/sembuf.h b/include/asm-blackfin/sembuf.h
deleted file mode 100644
index 18deb5c7fa5d..000000000000
--- a/include/asm-blackfin/sembuf.h
+++ /dev/null
@@ -1,25 +0,0 @@
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/serial.h b/include/asm-blackfin/serial.h
deleted file mode 100644
index 994dd869558c..000000000000
--- a/include/asm-blackfin/serial.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * include/asm-blackfin/serial.h
3 */
4
5#define SERIAL_EXTRA_IRQ_FLAGS IRQF_TRIGGER_HIGH
diff --git a/include/asm-blackfin/setup.h b/include/asm-blackfin/setup.h
deleted file mode 100644
index 01c8c6cbe6fc..000000000000
--- a/include/asm-blackfin/setup.h
+++ /dev/null
@@ -1,17 +0,0 @@
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
deleted file mode 100644
index 612436303e89..000000000000
--- a/include/asm-blackfin/shmbuf.h
+++ /dev/null
@@ -1,42 +0,0 @@
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
deleted file mode 100644
index 3c03906b7664..000000000000
--- a/include/asm-blackfin/shmparam.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index ce00b03c2775..000000000000
--- a/include/asm-blackfin/sigcontext.h
+++ /dev/null
@@ -1,55 +0,0 @@
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
deleted file mode 100644
index eca4565cea37..000000000000
--- a/include/asm-blackfin/siginfo.h
+++ /dev/null
@@ -1,35 +0,0 @@
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
deleted file mode 100644
index 87951d251458..000000000000
--- a/include/asm-blackfin/signal.h
+++ /dev/null
@@ -1,160 +0,0 @@
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 __user *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
deleted file mode 100644
index 2ca702e44d47..000000000000
--- a/include/asm-blackfin/socket.h
+++ /dev/null
@@ -1,56 +0,0 @@
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
54#define SO_MARK 36
55
56#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-blackfin/sockios.h b/include/asm-blackfin/sockios.h
deleted file mode 100644
index 426b89bfaa8b..000000000000
--- a/include/asm-blackfin/sockios.h
+++ /dev/null
@@ -1,13 +0,0 @@
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
deleted file mode 100644
index 64e908a50646..000000000000
--- a/include/asm-blackfin/spinlock.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index d2b6f11ec231..000000000000
--- a/include/asm-blackfin/stat.h
+++ /dev/null
@@ -1,63 +0,0 @@
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
deleted file mode 100644
index 350672091ba3..000000000000
--- a/include/asm-blackfin/statfs.h
+++ /dev/null
@@ -1,6 +0,0 @@
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
deleted file mode 100644
index 321f4d96e4ae..000000000000
--- a/include/asm-blackfin/string.h
+++ /dev/null
@@ -1,137 +0,0 @@
1#ifndef _BLACKFIN_STRING_H_
2#define _BLACKFIN_STRING_H_
3
4#include <linux/types.h>
5
6#ifdef __KERNEL__ /* only set these up for kernel code */
7
8#define __HAVE_ARCH_STRCPY
9extern inline char *strcpy(char *dest, const char *src)
10{
11 char *xdest = dest;
12 char temp = 0;
13
14 __asm__ __volatile__ (
15 "1:"
16 "%2 = B [%1++] (Z);"
17 "B [%0++] = %2;"
18 "CC = %2;"
19 "if cc jump 1b (bp);"
20 : "+&a" (dest), "+&a" (src), "=&d" (temp)
21 :
22 : "memory", "CC");
23
24 return xdest;
25}
26
27#define __HAVE_ARCH_STRNCPY
28extern inline char *strncpy(char *dest, const char *src, size_t n)
29{
30 char *xdest = dest;
31 char temp = 0;
32
33 if (n == 0)
34 return xdest;
35
36 __asm__ __volatile__ (
37 "1:"
38 "%3 = B [%1++] (Z);"
39 "B [%0++] = %3;"
40 "CC = %3;"
41 "if ! cc jump 2f;"
42 "%2 += -1;"
43 "CC = %2 == 0;"
44 "if ! cc jump 1b (bp);"
45 "jump 4f;"
46 "2:"
47 /* if src is shorter than n, we need to null pad bytes now */
48 "%3 = 0;"
49 "3:"
50 "%2 += -1;"
51 "CC = %2 == 0;"
52 "if cc jump 4f;"
53 "B [%0++] = %3;"
54 "jump 3b;"
55 "4:"
56 : "+&a" (dest), "+&a" (src), "+&da" (n), "=&d" (temp)
57 :
58 : "memory", "CC");
59
60 return xdest;
61}
62
63#define __HAVE_ARCH_STRCMP
64extern inline int strcmp(const char *cs, const char *ct)
65{
66 /* need to use int's here so the char's in the assembly don't get
67 * sign extended incorrectly when we don't want them to be
68 */
69 int __res1, __res2;
70
71 __asm__ __volatile__ (
72 "1:"
73 "%2 = B[%0++] (Z);" /* get *cs */
74 "%3 = B[%1++] (Z);" /* get *ct */
75 "CC = %2 == %3;" /* compare a byte */
76 "if ! cc jump 2f;" /* not equal, break out */
77 "CC = %2;" /* at end of cs? */
78 "if cc jump 1b (bp);" /* no, keep going */
79 "jump.s 3f;" /* strings are equal */
80 "2:"
81 "%2 = %2 - %3;" /* *cs - *ct */
82 "3:"
83 : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2)
84 :
85 : "memory", "CC");
86
87 return __res1;
88}
89
90#define __HAVE_ARCH_STRNCMP
91extern inline int strncmp(const char *cs, const char *ct, size_t count)
92{
93 /* need to use int's here so the char's in the assembly don't get
94 * sign extended incorrectly when we don't want them to be
95 */
96 int __res1, __res2;
97
98 if (!count)
99 return 0;
100
101 __asm__ __volatile__ (
102 "1:"
103 "%3 = B[%0++] (Z);" /* get *cs */
104 "%4 = B[%1++] (Z);" /* get *ct */
105 "CC = %3 == %4;" /* compare a byte */
106 "if ! cc jump 3f;" /* not equal, break out */
107 "CC = %3;" /* at end of cs? */
108 "if ! cc jump 4f;" /* yes, all done */
109 "%2 += -1;" /* no, adjust count */
110 "CC = %2 == 0;"
111 "if ! cc jump 1b;" /* more to do, keep going */
112 "2:"
113 "%3 = 0;" /* strings are equal */
114 "jump.s 4f;"
115 "3:"
116 "%3 = %3 - %4;" /* *cs - *ct */
117 "4:"
118 : "+&a" (cs), "+&a" (ct), "+&da" (count), "=&d" (__res1), "=&d" (__res2)
119 :
120 : "memory", "CC");
121
122 return __res1;
123}
124
125#define __HAVE_ARCH_MEMSET
126extern void *memset(void *s, int c, size_t count);
127#define __HAVE_ARCH_MEMCPY
128extern void *memcpy(void *d, const void *s, size_t count);
129#define __HAVE_ARCH_MEMCMP
130extern int memcmp(const void *, const void *, __kernel_size_t);
131#define __HAVE_ARCH_MEMCHR
132extern void *memchr(const void *s, int c, size_t n);
133#define __HAVE_ARCH_MEMMOVE
134extern void *memmove(void *dest, const void *src, size_t count);
135
136#endif /*__KERNEL__*/
137#endif /* _BLACKFIN_STRING_H_ */
diff --git a/include/asm-blackfin/system.h b/include/asm-blackfin/system.h
deleted file mode 100644
index 51494ef5bb41..000000000000
--- a/include/asm-blackfin/system.h
+++ /dev/null
@@ -1,221 +0,0 @@
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#include <asm/mach/anomaly.h>
40
41/*
42 * Interrupt configuring macros.
43 */
44
45extern unsigned long irq_flags;
46
47#define local_irq_enable() \
48 __asm__ __volatile__( \
49 "sti %0;" \
50 : \
51 : "d" (irq_flags) \
52 )
53
54#define local_irq_disable() \
55 do { \
56 int __tmp_dummy; \
57 __asm__ __volatile__( \
58 "cli %0;" \
59 : "=d" (__tmp_dummy) \
60 ); \
61 } while (0)
62
63#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
64# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
65#else
66# define NOP_PAD_ANOMALY_05000244
67#endif
68
69#define idle_with_irq_disabled() \
70 __asm__ __volatile__( \
71 NOP_PAD_ANOMALY_05000244 \
72 ".align 8;" \
73 "sti %0;" \
74 "idle;" \
75 : \
76 : "d" (irq_flags) \
77 )
78
79#ifdef CONFIG_DEBUG_HWERR
80# define __save_and_cli(x) \
81 __asm__ __volatile__( \
82 "cli %0;" \
83 "sti %1;" \
84 : "=&d" (x) \
85 : "d" (0x3F) \
86 )
87#else
88# define __save_and_cli(x) \
89 __asm__ __volatile__( \
90 "cli %0;" \
91 : "=&d" (x) \
92 )
93#endif
94
95#define local_save_flags(x) \
96 __asm__ __volatile__( \
97 "cli %0;" \
98 "sti %0;" \
99 : "=d" (x) \
100 )
101
102#ifdef CONFIG_DEBUG_HWERR
103#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
104#else
105#define irqs_enabled_from_flags(x) ((x) != 0x1f)
106#endif
107
108#define local_irq_restore(x) \
109 do { \
110 if (irqs_enabled_from_flags(x)) \
111 local_irq_enable(); \
112 } while (0)
113
114/* For spinlocks etc */
115#define local_irq_save(x) __save_and_cli(x)
116
117#define irqs_disabled() \
118({ \
119 unsigned long flags; \
120 local_save_flags(flags); \
121 !irqs_enabled_from_flags(flags); \
122})
123
124/*
125 * Force strict CPU ordering.
126 */
127#define nop() asm volatile ("nop;\n\t"::)
128#define mb() asm volatile ("" : : :"memory")
129#define rmb() asm volatile ("" : : :"memory")
130#define wmb() asm volatile ("" : : :"memory")
131#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
132
133#define read_barrier_depends() do { } while(0)
134
135#ifdef CONFIG_SMP
136#define smp_mb() mb()
137#define smp_rmb() rmb()
138#define smp_wmb() wmb()
139#define smp_read_barrier_depends() read_barrier_depends()
140#else
141#define smp_mb() barrier()
142#define smp_rmb() barrier()
143#define smp_wmb() barrier()
144#define smp_read_barrier_depends() do { } while(0)
145#endif
146
147#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
148
149struct __xchg_dummy {
150 unsigned long a[100];
151};
152#define __xg(x) ((volatile struct __xchg_dummy *)(x))
153
154static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
155 int size)
156{
157 unsigned long tmp = 0;
158 unsigned long flags = 0;
159
160 local_irq_save(flags);
161
162 switch (size) {
163 case 1:
164 __asm__ __volatile__
165 ("%0 = b%2 (z);\n\t"
166 "b%2 = %1;\n\t"
167 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
168 break;
169 case 2:
170 __asm__ __volatile__
171 ("%0 = w%2 (z);\n\t"
172 "w%2 = %1;\n\t"
173 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
174 break;
175 case 4:
176 __asm__ __volatile__
177 ("%0 = %2;\n\t"
178 "%2 = %1;\n\t"
179 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
180 break;
181 }
182 local_irq_restore(flags);
183 return tmp;
184}
185
186#include <asm-generic/cmpxchg-local.h>
187
188/*
189 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
190 * them available.
191 */
192#define cmpxchg_local(ptr, o, n) \
193 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
194 (unsigned long)(n), sizeof(*(ptr))))
195#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
196
197#ifndef CONFIG_SMP
198#include <asm-generic/cmpxchg.h>
199#endif
200
201#define prepare_to_switch() do { } while(0)
202
203/*
204 * switch_to(n) should switch tasks to task ptr, first checking that
205 * ptr isn't the current task, in which case it does nothing.
206 */
207
208#include <asm/blackfin.h>
209
210asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next);
211
212#define switch_to(prev,next,last) \
213do { \
214 memcpy (&task_thread_info(prev)->l1_task_info, L1_SCRATCH_TASK_INFO, \
215 sizeof *L1_SCRATCH_TASK_INFO); \
216 memcpy (L1_SCRATCH_TASK_INFO, &task_thread_info(next)->l1_task_info, \
217 sizeof *L1_SCRATCH_TASK_INFO); \
218 (last) = resume (prev, next); \
219} while (0)
220
221#endif /* _BLACKFIN_SYSTEM_H */
diff --git a/include/asm-blackfin/termbits.h b/include/asm-blackfin/termbits.h
deleted file mode 100644
index f37feb7cf895..000000000000
--- a/include/asm-blackfin/termbits.h
+++ /dev/null
@@ -1,198 +0,0 @@
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 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
31struct ktermios {
32 tcflag_t c_iflag; /* input mode flags */
33 tcflag_t c_oflag; /* output mode flags */
34 tcflag_t c_cflag; /* control mode flags */
35 tcflag_t c_lflag; /* local mode flags */
36 cc_t c_line; /* line discipline */
37 cc_t c_cc[NCCS]; /* control characters */
38 speed_t c_ispeed; /* input speed */
39 speed_t c_ospeed; /* output speed */
40};
41
42/* c_cc characters */
43#define VINTR 0
44#define VQUIT 1
45#define VERASE 2
46#define VKILL 3
47#define VEOF 4
48#define VTIME 5
49#define VMIN 6
50#define VSWTC 7
51#define VSTART 8
52#define VSTOP 9
53#define VSUSP 10
54#define VEOL 11
55#define VREPRINT 12
56#define VDISCARD 13
57#define VWERASE 14
58#define VLNEXT 15
59#define VEOL2 16
60
61/* c_iflag bits */
62#define IGNBRK 0000001
63#define BRKINT 0000002
64#define IGNPAR 0000004
65#define PARMRK 0000010
66#define INPCK 0000020
67#define ISTRIP 0000040
68#define INLCR 0000100
69#define IGNCR 0000200
70#define ICRNL 0000400
71#define IUCLC 0001000
72#define IXON 0002000
73#define IXANY 0004000
74#define IXOFF 0010000
75#define IMAXBEL 0020000
76#define IUTF8 0040000
77
78/* c_oflag bits */
79#define OPOST 0000001
80#define OLCUC 0000002
81#define ONLCR 0000004
82#define OCRNL 0000010
83#define ONOCR 0000020
84#define ONLRET 0000040
85#define OFILL 0000100
86#define OFDEL 0000200
87#define NLDLY 0000400
88#define NL0 0000000
89#define NL1 0000400
90#define CRDLY 0003000
91#define CR0 0000000
92#define CR1 0001000
93#define CR2 0002000
94#define CR3 0003000
95#define TABDLY 0014000
96#define TAB0 0000000
97#define TAB1 0004000
98#define TAB2 0010000
99#define TAB3 0014000
100#define XTABS 0014000
101#define BSDLY 0020000
102#define BS0 0000000
103#define BS1 0020000
104#define VTDLY 0040000
105#define VT0 0000000
106#define VT1 0040000
107#define FFDLY 0100000
108#define FF0 0000000
109#define FF1 0100000
110
111/* c_cflag bit meaning */
112#define CBAUD 0010017
113#define B0 0000000 /* hang up */
114#define B50 0000001
115#define B75 0000002
116#define B110 0000003
117#define B134 0000004
118#define B150 0000005
119#define B200 0000006
120#define B300 0000007
121#define B600 0000010
122#define B1200 0000011
123#define B1800 0000012
124#define B2400 0000013
125#define B4800 0000014
126#define B9600 0000015
127#define B19200 0000016
128#define B38400 0000017
129#define EXTA B19200
130#define EXTB B38400
131#define CSIZE 0000060
132#define CS5 0000000
133#define CS6 0000020
134#define CS7 0000040
135#define CS8 0000060
136#define CSTOPB 0000100
137#define CREAD 0000200
138#define PARENB 0000400
139#define PARODD 0001000
140#define HUPCL 0002000
141#define CLOCAL 0004000
142#define CBAUDEX 0010000
143#define BOTHER 0010000
144#define B57600 0010001
145#define B115200 0010002
146#define B230400 0010003
147#define B460800 0010004
148#define B500000 0010005
149#define B576000 0010006
150#define B921600 0010007
151#define B1000000 0010010
152#define B1152000 0010011
153#define B1500000 0010012
154#define B2000000 0010013
155#define B2500000 0010014
156#define B3000000 0010015
157#define B3500000 0010016
158#define B4000000 0010017
159#define CIBAUD 002003600000 /* input baud rate */
160#define CMSPAR 010000000000 /* mark or space (stick) parity */
161#define CRTSCTS 020000000000 /* flow control */
162
163#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
164
165/* c_lflag bits */
166#define ISIG 0000001
167#define ICANON 0000002
168#define XCASE 0000004
169#define ECHO 0000010
170#define ECHOE 0000020
171#define ECHOK 0000040
172#define ECHONL 0000100
173#define NOFLSH 0000200
174#define TOSTOP 0000400
175#define ECHOCTL 0001000
176#define ECHOPRT 0002000
177#define ECHOKE 0004000
178#define FLUSHO 0010000
179#define PENDIN 0040000
180#define IEXTEN 0100000
181
182/* tcflow() and TCXONC use these */
183#define TCOOFF 0
184#define TCOON 1
185#define TCIOFF 2
186#define TCION 3
187
188/* tcflush() and TCFLSH use these */
189#define TCIFLUSH 0
190#define TCOFLUSH 1
191#define TCIOFLUSH 2
192
193/* tcsetattr uses these */
194#define TCSANOW 0
195#define TCSADRAIN 1
196#define TCSAFLUSH 2
197
198#endif /* __ARCH_BFIN_TERMBITS_H__ */
diff --git a/include/asm-blackfin/termios.h b/include/asm-blackfin/termios.h
deleted file mode 100644
index d50d063c605a..000000000000
--- a/include/asm-blackfin/termios.h
+++ /dev/null
@@ -1,94 +0,0 @@
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#ifdef __KERNEL__
43
44/* intr=^C quit=^\ erase=del kill=^U
45 eof=^D vtime=\0 vmin=\1 sxtc=\0
46 start=^Q stop=^S susp=^Z eol=\0
47 reprint=^R discard=^U werase=^W lnext=^V
48 eol2=\0
49*/
50#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
51
52/*
53 * Translate a "termio" structure into a "termios". Ugh.
54 */
55#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
56 unsigned short __tmp; \
57 get_user(__tmp,&(termio)->x); \
58 *(unsigned short *) &(termios)->x = __tmp; \
59}
60
61#define user_termio_to_kernel_termios(termios, termio) \
62({ \
63 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
64 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
65 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
66 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
67 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
68})
69
70/*
71 * Translate a "termios" structure into a "termio". Ugh.
72 */
73#define kernel_termios_to_user_termio(termio, termios) \
74({ \
75 put_user((termios)->c_iflag, &(termio)->c_iflag); \
76 put_user((termios)->c_oflag, &(termio)->c_oflag); \
77 put_user((termios)->c_cflag, &(termio)->c_cflag); \
78 put_user((termios)->c_lflag, &(termio)->c_lflag); \
79 put_user((termios)->c_line, &(termio)->c_line); \
80 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
81})
82
83#define user_termios_to_kernel_termios(k, u) \
84 copy_from_user(k, u, sizeof(struct termios2))
85#define kernel_termios_to_user_termios(u, k) \
86 copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) \
88 copy_from_user(k, u, sizeof(struct termios))
89#define kernel_termios_to_user_termios_1(u, k) \
90 copy_to_user(u, k, sizeof(struct termios))
91
92#endif /* __KERNEL__ */
93
94#endif /* __BFIN_TERMIOS_H__ */
diff --git a/include/asm-blackfin/thread_info.h b/include/asm-blackfin/thread_info.h
deleted file mode 100644
index 642769329d12..000000000000
--- a/include/asm-blackfin/thread_info.h
+++ /dev/null
@@ -1,135 +0,0 @@
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/*
43 * Size of kernel stack for each process. This must be a power of 2...
44 */
45#define THREAD_SIZE_ORDER 1
46#define THREAD_SIZE 8192 /* 2 pages */
47
48#ifndef __ASSEMBLY__
49
50typedef unsigned long mm_segment_t;
51
52/*
53 * low level task data.
54 * If you change this, change the TI_* offsets below to match.
55 */
56
57struct thread_info {
58 struct task_struct *task; /* main task structure */
59 struct exec_domain *exec_domain; /* execution domain */
60 unsigned long flags; /* low level flags */
61 int cpu; /* cpu we're on */
62 int preempt_count; /* 0 => preemptable, <0 => BUG */
63 mm_segment_t addr_limit; /* address limit */
64 struct restart_block restart_block;
65 struct l1_scratch_task_info l1_task_info;
66};
67
68/*
69 * macros/functions for gaining access to the thread information structure
70 */
71#define INIT_THREAD_INFO(tsk) \
72{ \
73 .task = &tsk, \
74 .exec_domain = &default_exec_domain, \
75 .flags = 0, \
76 .cpu = 0, \
77 .preempt_count = 1, \
78 .restart_block = { \
79 .fn = do_no_restart_syscall, \
80 }, \
81}
82#define init_thread_info (init_thread_union.thread_info)
83#define init_stack (init_thread_union.stack)
84
85/* Given a task stack pointer, you can find its corresponding
86 * thread_info structure just by masking it to the THREAD_SIZE
87 * boundary (currently 8K as you can see above).
88 */
89__attribute_const__
90static inline struct thread_info *current_thread_info(void)
91{
92 struct thread_info *ti;
93 __asm__("%0 = sp;": "=&d"(ti):
94 );
95 return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1));
96}
97
98#endif /* __ASSEMBLY__ */
99
100/*
101 * Offsets in thread_info structure, used in assembly code
102 */
103#define TI_TASK 0
104#define TI_EXECDOMAIN 4
105#define TI_FLAGS 8
106#define TI_CPU 12
107#define TI_PREEMPT 16
108
109#define PREEMPT_ACTIVE 0x4000000
110
111/*
112 * thread information flag bit numbers
113 */
114#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
115#define TIF_SIGPENDING 1 /* signal pending */
116#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
117#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
118 TIF_NEED_RESCHED */
119#define TIF_MEMDIE 4
120#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
121#define TIF_FREEZE 6 /* is freezing for suspend */
122
123/* as above, but as bit values */
124#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
125#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
126#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
127#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
128#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
129#define _TIF_FREEZE (1<<TIF_FREEZE)
130
131#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
132
133#endif /* __KERNEL__ */
134
135#endif /* _ASM_THREAD_INFO_H */
diff --git a/include/asm-blackfin/time.h b/include/asm-blackfin/time.h
deleted file mode 100644
index ddc43ce38533..000000000000
--- a/include/asm-blackfin/time.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * asm-blackfin/time.h:
3 *
4 * Copyright 2004-2008 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef _ASM_BLACKFIN_TIME_H
10#define _ASM_BLACKFIN_TIME_H
11
12/*
13 * The way that the Blackfin core timer works is:
14 * - CCLK is divided by a programmable 8-bit pre-scaler (TSCALE)
15 * - Every time TSCALE ticks, a 32bit is counted down (TCOUNT)
16 *
17 * If you take the fastest clock (1ns, or 1GHz to make the math work easier)
18 * 10ms is 10,000,000 clock ticks, which fits easy into a 32-bit counter
19 * (32 bit counter is 4,294,967,296ns or 4.2 seconds) so, we don't need
20 * to use TSCALE, and program it to zero (which is pass CCLK through).
21 * If you feel like using it, try to keep HZ * TIMESCALE to some
22 * value that divides easy (like power of 2).
23 */
24
25#ifndef CONFIG_CPU_FREQ
26#define TIME_SCALE 1
27#define __bfin_cycles_off (0)
28#define __bfin_cycles_mod (0)
29#else
30/*
31 * Blackfin CPU frequency scaling supports max Core Clock 1, 1/2 and 1/4 .
32 * Whenever we change the Core Clock frequency changes we immediately
33 * adjust the Core Timer Presale Register. This way we don't lose time.
34 */
35#define TIME_SCALE 4
36extern unsigned long long __bfin_cycles_off;
37extern unsigned int __bfin_cycles_mod;
38#endif
39
40#endif
diff --git a/include/asm-blackfin/timex.h b/include/asm-blackfin/timex.h
deleted file mode 100644
index 22b0806161bb..000000000000
--- a/include/asm-blackfin/timex.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * asm-blackfin/timex.h: cpu cycles!
3 *
4 * Copyright 2004-2008 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef _ASM_BLACKFIN_TIMEX_H
10#define _ASM_BLACKFIN_TIMEX_H
11
12#define CLOCK_TICK_RATE 1000000 /* Underlying HZ */
13
14typedef unsigned long long cycles_t;
15
16static inline cycles_t get_cycles(void)
17{
18 unsigned long tmp, tmp2;
19 __asm__("%0 = cycles; %1 = cycles2;" : "=d"(tmp), "=d"(tmp2));
20 return tmp | ((cycles_t)tmp2 << 32);
21}
22
23#endif
diff --git a/include/asm-blackfin/tlb.h b/include/asm-blackfin/tlb.h
deleted file mode 100644
index 89a12ee916d8..000000000000
--- a/include/asm-blackfin/tlb.h
+++ /dev/null
@@ -1,16 +0,0 @@
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
deleted file mode 100644
index 277b400924b8..000000000000
--- a/include/asm-blackfin/tlbflush.h
+++ /dev/null
@@ -1,56 +0,0 @@
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
56#endif
diff --git a/include/asm-blackfin/topology.h b/include/asm-blackfin/topology.h
deleted file mode 100644
index acee23987897..000000000000
--- a/include/asm-blackfin/topology.h
+++ /dev/null
@@ -1,6 +0,0 @@
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/trace.h b/include/asm-blackfin/trace.h
deleted file mode 100644
index 312b596b9731..000000000000
--- a/include/asm-blackfin/trace.h
+++ /dev/null
@@ -1,94 +0,0 @@
1/*
2 * Common header file for blackfin family of processors.
3 *
4 */
5
6#ifndef _BLACKFIN_TRACE_
7#define _BLACKFIN_TRACE_
8
9/* Normally, we use ON, but you can't turn on software expansion until
10 * interrupts subsystem is ready
11 */
12
13#define BFIN_TRACE_INIT ((CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION << 4) | 0x03)
14#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
15#define BFIN_TRACE_ON (BFIN_TRACE_INIT | (CONFIG_DEBUG_BFIN_HWTRACE_EXPAND << 2))
16#else
17#define BFIN_TRACE_ON (BFIN_TRACE_INIT)
18#endif
19
20#ifndef __ASSEMBLY__
21extern unsigned long trace_buff_offset;
22extern unsigned long software_trace_buff[];
23
24/* Trace Macros for C files */
25
26#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
27
28#define trace_buffer_save(x) \
29 do { \
30 (x) = bfin_read_TBUFCTL(); \
31 bfin_write_TBUFCTL((x) & ~TBUFEN); \
32 } while (0)
33
34#define trace_buffer_restore(x) \
35 do { \
36 bfin_write_TBUFCTL((x)); \
37 } while (0)
38#else /* DEBUG_BFIN_HWTRACE_ON */
39
40#define trace_buffer_save(x)
41#define trace_buffer_restore(x)
42#endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
43
44#else
45/* Trace Macros for Assembly files */
46
47#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
48
49#define trace_buffer_stop(preg, dreg) \
50 preg.L = LO(TBUFCTL); \
51 preg.H = HI(TBUFCTL); \
52 dreg = 0x1; \
53 [preg] = dreg;
54
55#define trace_buffer_init(preg, dreg) \
56 preg.L = LO(TBUFCTL); \
57 preg.H = HI(TBUFCTL); \
58 dreg = BFIN_TRACE_INIT; \
59 [preg] = dreg;
60
61#define trace_buffer_save(preg, dreg) \
62 preg.L = LO(TBUFCTL); \
63 preg.H = HI(TBUFCTL); \
64 dreg = [preg]; \
65 [--sp] = dreg; \
66 dreg = 0x1; \
67 [preg] = dreg;
68
69#define trace_buffer_restore(preg, dreg) \
70 preg.L = LO(TBUFCTL); \
71 preg.H = HI(TBUFCTL); \
72 dreg = [sp++]; \
73 [preg] = dreg;
74
75#else /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
76
77#define trace_buffer_stop(preg, dreg)
78#define trace_buffer_init(preg, dreg)
79#define trace_buffer_save(preg, dreg)
80#define trace_buffer_restore(preg, dreg)
81
82#endif /* CONFIG_DEBUG_BFIN_HWTRACE_ON */
83
84#ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
85# define DEBUG_HWTRACE_SAVE(preg, dreg) trace_buffer_save(preg, dreg)
86# define DEBUG_HWTRACE_RESTORE(preg, dreg) trace_buffer_restore(preg, dreg)
87#else
88# define DEBUG_HWTRACE_SAVE(preg, dreg)
89# define DEBUG_HWTRACE_RESTORE(preg, dreg)
90#endif
91
92#endif /* __ASSEMBLY__ */
93
94#endif /* _BLACKFIN_TRACE_ */
diff --git a/include/asm-blackfin/traps.h b/include/asm-blackfin/traps.h
deleted file mode 100644
index f0e5f940d9ca..000000000000
--- a/include/asm-blackfin/traps.h
+++ /dev/null
@@ -1,131 +0,0 @@
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/* The hardware reserves (63) for future use - we use it to tell our
49 * normal exception handling code we have a hardware error
50 */
51#define VEC_HWERR (63)
52
53#ifndef __ASSEMBLY__
54
55#define HWC_x2(level) \
56 "System MMR Error\n" \
57 level " - An error occurred due to an invalid access to an System MMR location\n" \
58 level " Possible reason: a 32-bit register is accessed with a 16-bit instruction\n" \
59 level " or a 16-bit register is accessed with a 32-bit instruction.\n"
60#define HWC_x3(level) \
61 "External Memory Addressing Error\n"
62#define HWC_x12(level) \
63 "Performance Monitor Overflow\n"
64#define HWC_x18(level) \
65 "RAISE 5 instruction\n" \
66 level " Software issued a RAISE 5 instruction to invoke the Hardware\n"
67#define HWC_default(level) \
68 "Reserved\n"
69#define EXC_0x03(level) \
70 "Application stack overflow\n" \
71 level " - Please increase the stack size of the application using elf2flt -s option,\n" \
72 level " and/or reduce the stack use of the application.\n"
73#define EXC_0x10(level) \
74 "Single step\n" \
75 level " - When the processor is in single step mode, every instruction\n" \
76 level " generates an exception. Primarily used for debugging.\n"
77#define EXC_0x11(level) \
78 "Exception caused by a trace buffer full condition\n" \
79 level " - The processor takes this exception when the trace\n" \
80 level " buffer overflows (only when enabled by the Trace Unit Control register).\n"
81#define EXC_0x21(level) \
82 "Undefined instruction\n" \
83 level " - May be used to emulate instructions that are not defined for\n" \
84 level " a particular processor implementation.\n"
85#define EXC_0x22(level) \
86 "Illegal instruction combination\n" \
87 level " - See section for multi-issue rules in the ADSP-BF53x Blackfin\n" \
88 level " Processor Instruction Set Reference.\n"
89#define EXC_0x23(level) \
90 "Data access CPLB protection violation\n" \
91 level " - Attempted read or write to Supervisor resource,\n" \
92 level " or illegal data memory access. \n"
93#define EXC_0x24(level) \
94 "Data access misaligned address violation\n" \
95 level " - Attempted misaligned data memory or data cache access.\n"
96#define EXC_0x25(level) \
97 "Unrecoverable event\n" \
98 level " - For example, an exception generated while processing a previous exception.\n"
99#define EXC_0x26(level) \
100 "Data access CPLB miss\n" \
101 level " - Used by the MMU to signal a CPLB miss on a data access.\n"
102#define EXC_0x27(level) \
103 "Data access multiple CPLB hits\n" \
104 level " - More than one CPLB entry matches data fetch address.\n"
105#define EXC_0x28(level) \
106 "Program Sequencer Exception caused by an emulation watchpoint match\n" \
107 level " - There is a watchpoint match, and one of the EMUSW\n" \
108 level " bits in the Watchpoint Instruction Address Control register (WPIACTL) is set.\n"
109#define EXC_0x2A(level) \
110 "Instruction fetch misaligned address violation\n" \
111 level " - Attempted misaligned instruction cache fetch. On a misaligned instruction fetch\n" \
112 level " exception, the return address provided in RETX is the destination address which is\n" \
113 level " misaligned, rather than the address of the offending instruction.\n"
114#define EXC_0x2B(level) \
115 "CPLB protection violation\n" \
116 level " - Illegal instruction fetch access (memory protection violation).\n"
117#define EXC_0x2C(level) \
118 "Instruction fetch CPLB miss\n" \
119 level " - CPLB miss on an instruction fetch.\n"
120#define EXC_0x2D(level) \
121 "Instruction fetch multiple CPLB hits\n" \
122 level " - More than one CPLB entry matches instruction fetch address.\n"
123#define EXC_0x2E(level) \
124 "Illegal use of supervisor resource\n" \
125 level " - Attempted to use a Supervisor register or instruction from User mode.\n" \
126 level " Supervisor resources are registers and instructions that are reserved\n" \
127 level " for Supervisor use: Supervisor only registers, all MMRs, and Supervisor\n" \
128 level " only instructions.\n"
129
130#endif /* __ASSEMBLY__ */
131#endif /* _BFIN_TRAPS_H */
diff --git a/include/asm-blackfin/types.h b/include/asm-blackfin/types.h
deleted file mode 100644
index 8441cbc2bf9e..000000000000
--- a/include/asm-blackfin/types.h
+++ /dev/null
@@ -1,36 +0,0 @@
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#include <asm-generic/int-ll64.h>
12
13#ifndef __ASSEMBLY__
14
15typedef unsigned short umode_t;
16
17#endif /* __ASSEMBLY__ */
18/*
19 * These aren't exported outside the kernel to avoid name space clashes
20 */
21#ifdef __KERNEL__
22
23#define BITS_PER_LONG 32
24
25#ifndef __ASSEMBLY__
26
27/* Dma addresses are 32-bits wide. */
28
29typedef u32 dma_addr_t;
30typedef u64 dma64_addr_t;
31
32#endif /* __ASSEMBLY__ */
33
34#endif /* __KERNEL__ */
35
36#endif /* _BFIN_TYPES_H */
diff --git a/include/asm-blackfin/uaccess.h b/include/asm-blackfin/uaccess.h
deleted file mode 100644
index d928b8099056..000000000000
--- a/include/asm-blackfin/uaccess.h
+++ /dev/null
@@ -1,271 +0,0 @@
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#ifdef CONFIG_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#ifndef CONFIG_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__, __func__),\
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__, __func__); \
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
deleted file mode 100644
index 4a4e3856beba..000000000000
--- a/include/asm-blackfin/ucontext.h
+++ /dev/null
@@ -1,17 +0,0 @@
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
deleted file mode 100644
index fd8a1d634945..000000000000
--- a/include/asm-blackfin/unaligned.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef _ASM_BLACKFIN_UNALIGNED_H
2#define _ASM_BLACKFIN_UNALIGNED_H
3
4#include <linux/unaligned/le_struct.h>
5#include <linux/unaligned/be_byteshift.h>
6#include <linux/unaligned/generic.h>
7
8#define get_unaligned __get_unaligned_le
9#define put_unaligned __put_unaligned_le
10
11#endif /* _ASM_BLACKFIN_UNALIGNED_H */
diff --git a/include/asm-blackfin/unistd.h b/include/asm-blackfin/unistd.h
deleted file mode 100644
index 1e57b636e0bc..000000000000
--- a/include/asm-blackfin/unistd.h
+++ /dev/null
@@ -1,438 +0,0 @@
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_restart_syscall 0
7#define __NR_exit 1
8#define __NR_fork 2
9#define __NR_read 3
10#define __NR_write 4
11#define __NR_open 5
12#define __NR_close 6
13 /* 7 __NR_waitpid obsolete */
14#define __NR_creat 8
15#define __NR_link 9
16#define __NR_unlink 10
17#define __NR_execve 11
18#define __NR_chdir 12
19#define __NR_time 13
20#define __NR_mknod 14
21#define __NR_chmod 15
22#define __NR_chown 16
23 /* 17 __NR_break obsolete */
24 /* 18 __NR_oldstat obsolete */
25#define __NR_lseek 19
26#define __NR_getpid 20
27#define __NR_mount 21
28 /* 22 __NR_umount obsolete */
29#define __NR_setuid 23
30#define __NR_getuid 24
31#define __NR_stime 25
32#define __NR_ptrace 26
33#define __NR_alarm 27
34 /* 28 __NR_oldfstat obsolete */
35#define __NR_pause 29
36 /* 30 __NR_utime obsolete */
37 /* 31 __NR_stty obsolete */
38 /* 32 __NR_gtty obsolete */
39#define __NR_access 33
40#define __NR_nice 34
41 /* 35 __NR_ftime obsolete */
42#define __NR_sync 36
43#define __NR_kill 37
44#define __NR_rename 38
45#define __NR_mkdir 39
46#define __NR_rmdir 40
47#define __NR_dup 41
48#define __NR_pipe 42
49#define __NR_times 43
50 /* 44 __NR_prof obsolete */
51#define __NR_brk 45
52#define __NR_setgid 46
53#define __NR_getgid 47
54 /* 48 __NR_signal obsolete */
55#define __NR_geteuid 49
56#define __NR_getegid 50
57#define __NR_acct 51
58#define __NR_umount2 52
59 /* 53 __NR_lock obsolete */
60#define __NR_ioctl 54
61#define __NR_fcntl 55
62 /* 56 __NR_mpx obsolete */
63#define __NR_setpgid 57
64 /* 58 __NR_ulimit obsolete */
65 /* 59 __NR_oldolduname obsolete */
66#define __NR_umask 60
67#define __NR_chroot 61
68#define __NR_ustat 62
69#define __NR_dup2 63
70#define __NR_getppid 64
71#define __NR_getpgrp 65
72#define __NR_setsid 66
73 /* 67 __NR_sigaction obsolete */
74#define __NR_sgetmask 68
75#define __NR_ssetmask 69
76#define __NR_setreuid 70
77#define __NR_setregid 71
78 /* 72 __NR_sigsuspend obsolete */
79 /* 73 __NR_sigpending obsolete */
80#define __NR_sethostname 74
81#define __NR_setrlimit 75
82 /* 76 __NR_old_getrlimit obsolete */
83#define __NR_getrusage 77
84#define __NR_gettimeofday 78
85#define __NR_settimeofday 79
86#define __NR_getgroups 80
87#define __NR_setgroups 81
88 /* 82 __NR_select obsolete */
89#define __NR_symlink 83
90 /* 84 __NR_oldlstat obsolete */
91#define __NR_readlink 85
92 /* 86 __NR_uselib obsolete */
93 /* 87 __NR_swapon obsolete */
94#define __NR_reboot 88
95 /* 89 __NR_readdir obsolete */
96 /* 90 __NR_mmap obsolete */
97#define __NR_munmap 91
98#define __NR_truncate 92
99#define __NR_ftruncate 93
100#define __NR_fchmod 94
101#define __NR_fchown 95
102#define __NR_getpriority 96
103#define __NR_setpriority 97
104 /* 98 __NR_profil obsolete */
105#define __NR_statfs 99
106#define __NR_fstatfs 100
107 /* 101 __NR_ioperm */
108 /* 102 __NR_socketcall obsolete */
109#define __NR_syslog 103
110#define __NR_setitimer 104
111#define __NR_getitimer 105
112#define __NR_stat 106
113#define __NR_lstat 107
114#define __NR_fstat 108
115 /* 109 __NR_olduname obsolete */
116 /* 110 __NR_iopl obsolete */
117#define __NR_vhangup 111
118 /* 112 __NR_idle obsolete */
119 /* 113 __NR_vm86old */
120#define __NR_wait4 114
121 /* 115 __NR_swapoff obsolete */
122#define __NR_sysinfo 116
123 /* 117 __NR_ipc oboslete */
124#define __NR_fsync 118
125 /* 119 __NR_sigreturn obsolete */
126#define __NR_clone 120
127#define __NR_setdomainname 121
128#define __NR_uname 122
129 /* 123 __NR_modify_ldt obsolete */
130#define __NR_adjtimex 124
131#define __NR_mprotect 125
132 /* 126 __NR_sigprocmask obsolete */
133 /* 127 __NR_create_module obsolete */
134#define __NR_init_module 128
135#define __NR_delete_module 129
136 /* 130 __NR_get_kernel_syms obsolete */
137#define __NR_quotactl 131
138#define __NR_getpgid 132
139#define __NR_fchdir 133
140#define __NR_bdflush 134
141 /* 135 was sysfs */
142#define __NR_personality 136
143 /* 137 __NR_afs_syscall */
144#define __NR_setfsuid 138
145#define __NR_setfsgid 139
146#define __NR__llseek 140
147#define __NR_getdents 141
148 /* 142 __NR__newselect obsolete */
149#define __NR_flock 143
150 /* 144 __NR_msync obsolete */
151#define __NR_readv 145
152#define __NR_writev 146
153#define __NR_getsid 147
154#define __NR_fdatasync 148
155#define __NR__sysctl 149
156 /* 150 __NR_mlock */
157 /* 151 __NR_munlock */
158 /* 152 __NR_mlockall */
159 /* 153 __NR_munlockall */
160#define __NR_sched_setparam 154
161#define __NR_sched_getparam 155
162#define __NR_sched_setscheduler 156
163#define __NR_sched_getscheduler 157
164#define __NR_sched_yield 158
165#define __NR_sched_get_priority_max 159
166#define __NR_sched_get_priority_min 160
167#define __NR_sched_rr_get_interval 161
168#define __NR_nanosleep 162
169#define __NR_mremap 163
170#define __NR_setresuid 164
171#define __NR_getresuid 165
172 /* 166 __NR_vm86 */
173 /* 167 __NR_query_module */
174 /* 168 __NR_poll */
175#define __NR_nfsservctl 169
176#define __NR_setresgid 170
177#define __NR_getresgid 171
178#define __NR_prctl 172
179#define __NR_rt_sigreturn 173
180#define __NR_rt_sigaction 174
181#define __NR_rt_sigprocmask 175
182#define __NR_rt_sigpending 176
183#define __NR_rt_sigtimedwait 177
184#define __NR_rt_sigqueueinfo 178
185#define __NR_rt_sigsuspend 179
186#define __NR_pread 180
187#define __NR_pwrite 181
188#define __NR_lchown 182
189#define __NR_getcwd 183
190#define __NR_capget 184
191#define __NR_capset 185
192#define __NR_sigaltstack 186
193#define __NR_sendfile 187
194 /* 188 __NR_getpmsg */
195 /* 189 __NR_putpmsg */
196#define __NR_vfork 190
197#define __NR_getrlimit 191
198#define __NR_mmap2 192
199#define __NR_truncate64 193
200#define __NR_ftruncate64 194
201#define __NR_stat64 195
202#define __NR_lstat64 196
203#define __NR_fstat64 197
204#define __NR_chown32 198
205#define __NR_getuid32 199
206#define __NR_getgid32 200
207#define __NR_geteuid32 201
208#define __NR_getegid32 202
209#define __NR_setreuid32 203
210#define __NR_setregid32 204
211#define __NR_getgroups32 205
212#define __NR_setgroups32 206
213#define __NR_fchown32 207
214#define __NR_setresuid32 208
215#define __NR_getresuid32 209
216#define __NR_setresgid32 210
217#define __NR_getresgid32 211
218#define __NR_lchown32 212
219#define __NR_setuid32 213
220#define __NR_setgid32 214
221#define __NR_setfsuid32 215
222#define __NR_setfsgid32 216
223#define __NR_pivot_root 217
224 /* 218 __NR_mincore */
225 /* 219 __NR_madvise */
226#define __NR_getdents64 220
227#define __NR_fcntl64 221
228 /* 222 reserved for TUX */
229 /* 223 reserved for TUX */
230#define __NR_gettid 224
231#define __NR_readahead 225
232#define __NR_setxattr 226
233#define __NR_lsetxattr 227
234#define __NR_fsetxattr 228
235#define __NR_getxattr 229
236#define __NR_lgetxattr 230
237#define __NR_fgetxattr 231
238#define __NR_listxattr 232
239#define __NR_llistxattr 233
240#define __NR_flistxattr 234
241#define __NR_removexattr 235
242#define __NR_lremovexattr 236
243#define __NR_fremovexattr 237
244#define __NR_tkill 238
245#define __NR_sendfile64 239
246#define __NR_futex 240
247#define __NR_sched_setaffinity 241
248#define __NR_sched_getaffinity 242
249 /* 243 __NR_set_thread_area */
250 /* 244 __NR_get_thread_area */
251#define __NR_io_setup 245
252#define __NR_io_destroy 246
253#define __NR_io_getevents 247
254#define __NR_io_submit 248
255#define __NR_io_cancel 249
256 /* 250 __NR_alloc_hugepages */
257 /* 251 __NR_free_hugepages */
258#define __NR_exit_group 252
259#define __NR_lookup_dcookie 253
260#define __NR_bfin_spinlock 254
261
262#define __NR_epoll_create 255
263#define __NR_epoll_ctl 256
264#define __NR_epoll_wait 257
265 /* 258 __NR_remap_file_pages */
266#define __NR_set_tid_address 259
267#define __NR_timer_create 260
268#define __NR_timer_settime 261
269#define __NR_timer_gettime 262
270#define __NR_timer_getoverrun 263
271#define __NR_timer_delete 264
272#define __NR_clock_settime 265
273#define __NR_clock_gettime 266
274#define __NR_clock_getres 267
275#define __NR_clock_nanosleep 268
276#define __NR_statfs64 269
277#define __NR_fstatfs64 270
278#define __NR_tgkill 271
279#define __NR_utimes 272
280#define __NR_fadvise64_64 273
281 /* 274 __NR_vserver */
282 /* 275 __NR_mbind */
283 /* 276 __NR_get_mempolicy */
284 /* 277 __NR_set_mempolicy */
285#define __NR_mq_open 278
286#define __NR_mq_unlink 279
287#define __NR_mq_timedsend 280
288#define __NR_mq_timedreceive 281
289#define __NR_mq_notify 282
290#define __NR_mq_getsetattr 283
291#define __NR_kexec_load 284
292#define __NR_waitid 285
293#define __NR_add_key 286
294#define __NR_request_key 287
295#define __NR_keyctl 288
296#define __NR_ioprio_set 289
297#define __NR_ioprio_get 290
298#define __NR_inotify_init 291
299#define __NR_inotify_add_watch 292
300#define __NR_inotify_rm_watch 293
301 /* 294 __NR_migrate_pages */
302#define __NR_openat 295
303#define __NR_mkdirat 296
304#define __NR_mknodat 297
305#define __NR_fchownat 298
306#define __NR_futimesat 299
307#define __NR_fstatat64 300
308#define __NR_unlinkat 301
309#define __NR_renameat 302
310#define __NR_linkat 303
311#define __NR_symlinkat 304
312#define __NR_readlinkat 305
313#define __NR_fchmodat 306
314#define __NR_faccessat 307
315#define __NR_pselect6 308
316#define __NR_ppoll 309
317#define __NR_unshare 310
318
319/* Blackfin private syscalls */
320#define __NR_sram_alloc 311
321#define __NR_sram_free 312
322#define __NR_dma_memcpy 313
323
324/* socket syscalls */
325#define __NR_accept 314
326#define __NR_bind 315
327#define __NR_connect 316
328#define __NR_getpeername 317
329#define __NR_getsockname 318
330#define __NR_getsockopt 319
331#define __NR_listen 320
332#define __NR_recv 321
333#define __NR_recvfrom 322
334#define __NR_recvmsg 323
335#define __NR_send 324
336#define __NR_sendmsg 325
337#define __NR_sendto 326
338#define __NR_setsockopt 327
339#define __NR_shutdown 328
340#define __NR_socket 329
341#define __NR_socketpair 330
342
343/* sysv ipc syscalls */
344#define __NR_semctl 331
345#define __NR_semget 332
346#define __NR_semop 333
347#define __NR_msgctl 334
348#define __NR_msgget 335
349#define __NR_msgrcv 336
350#define __NR_msgsnd 337
351#define __NR_shmat 338
352#define __NR_shmctl 339
353#define __NR_shmdt 340
354#define __NR_shmget 341
355
356#define __NR_splice 342
357#define __NR_sync_file_range 343
358#define __NR_tee 344
359#define __NR_vmsplice 345
360
361#define __NR_epoll_pwait 346
362#define __NR_utimensat 347
363#define __NR_signalfd 348
364#define __NR_timerfd_create 349
365#define __NR_eventfd 350
366#define __NR_pread64 351
367#define __NR_pwrite64 352
368#define __NR_fadvise64 353
369#define __NR_set_robust_list 354
370#define __NR_get_robust_list 355
371#define __NR_fallocate 356
372#define __NR_semtimedop 357
373#define __NR_timerfd_settime 358
374#define __NR_timerfd_gettime 359
375#define __NR_signalfd4 360
376#define __NR_eventfd2 361
377#define __NR_epoll_create1 362
378#define __NR_dup3 363
379#define __NR_pipe2 364
380#define __NR_inotify_init1 365
381
382#define __NR_syscall 366
383#define NR_syscalls __NR_syscall
384
385/* Old optional stuff no one actually uses */
386#define __IGNORE_sysfs
387#define __IGNORE_uselib
388
389/* Implement the newer interfaces */
390#define __IGNORE_mmap
391#define __IGNORE_poll
392#define __IGNORE_select
393#define __IGNORE_utime
394
395/* Not relevant on no-mmu */
396#define __IGNORE_swapon
397#define __IGNORE_swapoff
398#define __IGNORE_msync
399#define __IGNORE_mlock
400#define __IGNORE_munlock
401#define __IGNORE_mlockall
402#define __IGNORE_munlockall
403#define __IGNORE_mincore
404#define __IGNORE_madvise
405#define __IGNORE_remap_file_pages
406#define __IGNORE_mbind
407#define __IGNORE_get_mempolicy
408#define __IGNORE_set_mempolicy
409#define __IGNORE_migrate_pages
410#define __IGNORE_move_pages
411#define __IGNORE_getcpu
412
413#ifdef __KERNEL__
414#define __ARCH_WANT_IPC_PARSE_VERSION
415#define __ARCH_WANT_STAT64
416#define __ARCH_WANT_SYS_ALARM
417#define __ARCH_WANT_SYS_GETHOSTNAME
418#define __ARCH_WANT_SYS_PAUSE
419#define __ARCH_WANT_SYS_SGETMASK
420#define __ARCH_WANT_SYS_TIME
421#define __ARCH_WANT_SYS_FADVISE64
422#define __ARCH_WANT_SYS_GETPGRP
423#define __ARCH_WANT_SYS_LLSEEK
424#define __ARCH_WANT_SYS_NICE
425#define __ARCH_WANT_SYS_RT_SIGACTION
426#define __ARCH_WANT_SYS_RT_SIGSUSPEND
427
428/*
429 * "Conditional" syscalls
430 *
431 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
432 * but it doesn't work on all toolchains, so we just do it by hand
433 */
434#define cond_syscall(x) asm(".weak\t_" #x "\n\t.set\t_" #x ",_sys_ni_syscall");
435
436#endif /* __KERNEL__ */
437
438#endif /* __ASM_BFIN_UNISTD_H */
diff --git a/include/asm-blackfin/user.h b/include/asm-blackfin/user.h
deleted file mode 100644
index afe6a0e1f7ce..000000000000
--- a/include/asm-blackfin/user.h
+++ /dev/null
@@ -1,89 +0,0 @@
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 unsigned long 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/a.out.h b/include/asm-cris/a.out.h
deleted file mode 100644
index c82e9f9b75f6..000000000000
--- a/include/asm-cris/a.out.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef __CRIS_A_OUT_H__
2#define __CRIS_A_OUT_H__
3
4/* we don't support a.out binaries on Linux/CRIS anyway, so this is
5 * not really used but still needed because binfmt_elf.c for some reason
6 * wants to know about a.out even if there is no interpreter available...
7 */
8
9struct exec
10{
11 unsigned long a_info; /* Use macros N_MAGIC, etc for access */
12 unsigned a_text; /* length of text, in bytes */
13 unsigned a_data; /* length of data, in bytes */
14 unsigned a_bss; /* length of uninitialized data area for file, in bytes */
15 unsigned a_syms; /* length of symbol table data in file, in bytes */
16 unsigned a_entry; /* start address */
17 unsigned a_trsize; /* length of relocation info for text, in bytes */
18 unsigned a_drsize; /* length of relocation info for data, in bytes */
19};
20
21
22#define N_TRSIZE(a) ((a).a_trsize)
23#define N_DRSIZE(a) ((a).a_drsize)
24#define N_SYMSIZE(a) ((a).a_syms)
25
26#endif
diff --git a/include/asm-cris/elf.h b/include/asm-cris/elf.h
index 001f64ad11e8..f0d17fbc81ba 100644
--- a/include/asm-cris/elf.h
+++ b/include/asm-cris/elf.h
@@ -88,6 +88,6 @@ typedef unsigned long elf_fpregset_t;
88 88
89#define ELF_PLATFORM (NULL) 89#define ELF_PLATFORM (NULL)
90 90
91#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) 91#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
92 92
93#endif 93#endif
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h
index 9fb946bb7dc9..7279ec07d62e 100644
--- a/include/asm-frv/elf.h
+++ b/include/asm-frv/elf.h
@@ -137,6 +137,6 @@ do { \
137 137
138#define ELF_PLATFORM (NULL) 138#define ELF_PLATFORM (NULL)
139 139
140#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) 140#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
141 141
142#endif 142#endif
diff --git a/include/asm-frv/unaligned.h b/include/asm-frv/unaligned.h
index 839a2fbffa0f..6c61c05b2e0c 100644
--- a/include/asm-frv/unaligned.h
+++ b/include/asm-frv/unaligned.h
@@ -13,7 +13,7 @@
13#define _ASM_UNALIGNED_H 13#define _ASM_UNALIGNED_H
14 14
15#include <linux/unaligned/le_byteshift.h> 15#include <linux/unaligned/le_byteshift.h>
16#include <linux/unaligned/be_byteshift.h> 16#include <linux/unaligned/be_struct.h>
17#include <linux/unaligned/generic.h> 17#include <linux/unaligned/generic.h>
18 18
19#define get_unaligned __get_unaligned_be 19#define get_unaligned __get_unaligned_be
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index 1170dc60e638..1870d5e05f1c 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -1,8 +1,10 @@
1ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) 1ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
2 $(srctree)/include/asm-$(SRCARCH)/kvm.h),)
2header-y += kvm.h 3header-y += kvm.h
3endif 4endif
4 5
5ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) 6ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
7 $(srctree)/include/asm-$(SRCARCH)/a.out.h),)
6unifdef-y += a.out.h 8unifdef-y += a.out.h
7endif 9endif
8unifdef-y += auxvec.h 10unifdef-y += auxvec.h
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index a3f738cffdb6..0f6dabd4b517 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -22,7 +22,7 @@ struct bug_entry {
22 22
23#ifndef HAVE_ARCH_BUG 23#ifndef HAVE_ARCH_BUG
24#define BUG() do { \ 24#define BUG() do { \
25 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ 25 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
26 panic("BUG!"); \ 26 panic("BUG!"); \
27} while (0) 27} while (0)
28#endif 28#endif
@@ -97,6 +97,16 @@ extern void warn_slowpath(const char *file, const int line,
97 unlikely(__ret_warn_once); \ 97 unlikely(__ret_warn_once); \
98}) 98})
99 99
100#define WARN_ONCE(condition, format...) ({ \
101 static int __warned; \
102 int __ret_warn_once = !!(condition); \
103 \
104 if (unlikely(__ret_warn_once)) \
105 if (WARN(!__warned, format)) \
106 __warned = 1; \
107 unlikely(__ret_warn_once); \
108})
109
100#define WARN_ON_RATELIMIT(condition, state) \ 110#define WARN_ON_RATELIMIT(condition, state) \
101 WARN_ON((condition) && __ratelimit(state)) 111 WARN_ON((condition) && __ratelimit(state))
102 112
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 0f99ad38b012..81797ec9ab29 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -35,11 +35,17 @@ struct module;
35 * @label: for diagnostics 35 * @label: for diagnostics
36 * @dev: optional device providing the GPIOs 36 * @dev: optional device providing the GPIOs
37 * @owner: helps prevent removal of modules exporting active GPIOs 37 * @owner: helps prevent removal of modules exporting active GPIOs
38 * @request: optional hook for chip-specific activation, such as
39 * enabling module power and clock; may sleep
40 * @free: optional hook for chip-specific deactivation, such as
41 * disabling module power and clock; may sleep
38 * @direction_input: configures signal "offset" as input, or returns error 42 * @direction_input: configures signal "offset" as input, or returns error
39 * @get: returns value for signal "offset"; for output signals this 43 * @get: returns value for signal "offset"; for output signals this
40 * returns either the value actually sensed, or zero 44 * returns either the value actually sensed, or zero
41 * @direction_output: configures signal "offset" as output, or returns error 45 * @direction_output: configures signal "offset" as output, or returns error
42 * @set: assigns output value for signal "offset" 46 * @set: assigns output value for signal "offset"
47 * @to_irq: optional hook supporting non-static gpio_to_irq() mappings;
48 * implementation may not sleep
43 * @dbg_show: optional routine to show contents in debugfs; default code 49 * @dbg_show: optional routine to show contents in debugfs; default code
44 * will be used when this is omitted, but custom code can show extra 50 * will be used when this is omitted, but custom code can show extra
45 * state (such as pullup/pulldown configuration). 51 * state (such as pullup/pulldown configuration).
@@ -61,10 +67,15 @@ struct module;
61 * is calculated by subtracting @base from the gpio number. 67 * is calculated by subtracting @base from the gpio number.
62 */ 68 */
63struct gpio_chip { 69struct gpio_chip {
64 char *label; 70 const char *label;
65 struct device *dev; 71 struct device *dev;
66 struct module *owner; 72 struct module *owner;
67 73
74 int (*request)(struct gpio_chip *chip,
75 unsigned offset);
76 void (*free)(struct gpio_chip *chip,
77 unsigned offset);
78
68 int (*direction_input)(struct gpio_chip *chip, 79 int (*direction_input)(struct gpio_chip *chip,
69 unsigned offset); 80 unsigned offset);
70 int (*get)(struct gpio_chip *chip, 81 int (*get)(struct gpio_chip *chip,
@@ -73,6 +84,10 @@ struct gpio_chip {
73 unsigned offset, int value); 84 unsigned offset, int value);
74 void (*set)(struct gpio_chip *chip, 85 void (*set)(struct gpio_chip *chip,
75 unsigned offset, int value); 86 unsigned offset, int value);
87
88 int (*to_irq)(struct gpio_chip *chip,
89 unsigned offset);
90
76 void (*dbg_show)(struct seq_file *s, 91 void (*dbg_show)(struct seq_file *s,
77 struct gpio_chip *chip); 92 struct gpio_chip *chip);
78 int base; 93 int base;
@@ -112,6 +127,7 @@ extern void __gpio_set_value(unsigned gpio, int value);
112 127
113extern int __gpio_cansleep(unsigned gpio); 128extern int __gpio_cansleep(unsigned gpio);
114 129
130extern int __gpio_to_irq(unsigned gpio);
115 131
116#ifdef CONFIG_GPIO_SYSFS 132#ifdef CONFIG_GPIO_SYSFS
117 133
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h
index be4af0029ac0..71ef3f0b9685 100644
--- a/include/asm-generic/rtc.h
+++ b/include/asm-generic/rtc.h
@@ -15,6 +15,7 @@
15#include <linux/mc146818rtc.h> 15#include <linux/mc146818rtc.h>
16#include <linux/rtc.h> 16#include <linux/rtc.h>
17#include <linux/bcd.h> 17#include <linux/bcd.h>
18#include <linux/delay.h>
18 19
19#define RTC_PIE 0x40 /* periodic interrupt enable */ 20#define RTC_PIE 0x40 /* periodic interrupt enable */
20#define RTC_AIE 0x20 /* alarm interrupt enable */ 21#define RTC_AIE 0x20 /* alarm interrupt enable */
@@ -43,7 +44,6 @@ static inline unsigned char rtc_is_updating(void)
43 44
44static inline unsigned int get_rtc_time(struct rtc_time *time) 45static inline unsigned int get_rtc_time(struct rtc_time *time)
45{ 46{
46 unsigned long uip_watchdog = jiffies;
47 unsigned char ctrl; 47 unsigned char ctrl;
48 unsigned long flags; 48 unsigned long flags;
49 49
@@ -53,19 +53,15 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
53 53
54 /* 54 /*
55 * read RTC once any update in progress is done. The update 55 * read RTC once any update in progress is done. The update
56 * can take just over 2ms. We wait 10 to 20ms. There is no need to 56 * can take just over 2ms. We wait 20ms. There is no need to
57 * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. 57 * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP.
58 * If you need to know *exactly* when a second has started, enable 58 * If you need to know *exactly* when a second has started, enable
59 * periodic update complete interrupts, (via ioctl) and then 59 * periodic update complete interrupts, (via ioctl) and then
60 * immediately read /dev/rtc which will block until you get the IRQ. 60 * immediately read /dev/rtc which will block until you get the IRQ.
61 * Once the read clears, read the RTC time (again via ioctl). Easy. 61 * Once the read clears, read the RTC time (again via ioctl). Easy.
62 */ 62 */
63 63 if (rtc_is_updating())
64 if (rtc_is_updating() != 0) 64 mdelay(20);
65 while (jiffies - uip_watchdog < 2*HZ/100) {
66 barrier();
67 cpu_relax();
68 }
69 65
70 /* 66 /*
71 * Only the values that we read from the RTC are set. We leave 67 * Only the values that we read from the RTC are set. We leave
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 8feeae1f2369..79a7ff925bf8 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -14,4 +14,10 @@ extern char __kprobes_text_start[], __kprobes_text_end[];
14extern char __initdata_begin[], __initdata_end[]; 14extern char __initdata_begin[], __initdata_end[];
15extern char __start_rodata[], __end_rodata[]; 15extern char __start_rodata[], __end_rodata[];
16 16
17/* function descriptor handling (if any). Override
18 * in asm/sections.h */
19#ifndef dereference_function_descriptor
20#define dereference_function_descriptor(p) (p)
21#endif
22
17#endif /* _ASM_GENERIC_SECTIONS_H_ */ 23#endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
index 8786e01e0db8..969570167e9e 100644
--- a/include/asm-generic/siginfo.h
+++ b/include/asm-generic/siginfo.h
@@ -199,6 +199,8 @@ typedef struct siginfo {
199 */ 199 */
200#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */ 200#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */
201#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */ 201#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
202#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
203#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */
202#define NSIGTRAP 2 204#define NSIGTRAP 2
203 205
204/* 206/*
diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h
index 1d01043e797d..6129d6802149 100644
--- a/include/asm-generic/statfs.h
+++ b/include/asm-generic/statfs.h
@@ -6,33 +6,64 @@
6typedef __kernel_fsid_t fsid_t; 6typedef __kernel_fsid_t fsid_t;
7#endif 7#endif
8 8
9/*
10 * Most 64-bit platforms use 'long', while most 32-bit platforms use '__u32'.
11 * Yes, they differ in signedness as well as size.
12 * Special cases can override it for themselves -- except for S390x, which
13 * is just a little too special for us. And MIPS, which I'm not touching
14 * with a 10' pole.
15 */
16#ifndef __statfs_word
17#if BITS_PER_LONG == 64
18#define __statfs_word long
19#else
20#define __statfs_word __u32
21#endif
22#endif
23
9struct statfs { 24struct statfs {
10 __u32 f_type; 25 __statfs_word f_type;
11 __u32 f_bsize; 26 __statfs_word f_bsize;
12 __u32 f_blocks; 27 __statfs_word f_blocks;
13 __u32 f_bfree; 28 __statfs_word f_bfree;
14 __u32 f_bavail; 29 __statfs_word f_bavail;
15 __u32 f_files; 30 __statfs_word f_files;
16 __u32 f_ffree; 31 __statfs_word f_ffree;
17 __kernel_fsid_t f_fsid; 32 __kernel_fsid_t f_fsid;
18 __u32 f_namelen; 33 __statfs_word f_namelen;
19 __u32 f_frsize; 34 __statfs_word f_frsize;
20 __u32 f_spare[5]; 35 __statfs_word f_spare[5];
21}; 36};
22 37
38/*
39 * ARM needs to avoid the 32-bit padding at the end, for consistency
40 * between EABI and OABI
41 */
42#ifndef ARCH_PACK_STATFS64
43#define ARCH_PACK_STATFS64
44#endif
45
23struct statfs64 { 46struct statfs64 {
24 __u32 f_type; 47 __statfs_word f_type;
25 __u32 f_bsize; 48 __statfs_word f_bsize;
26 __u64 f_blocks; 49 __u64 f_blocks;
27 __u64 f_bfree; 50 __u64 f_bfree;
28 __u64 f_bavail; 51 __u64 f_bavail;
29 __u64 f_files; 52 __u64 f_files;
30 __u64 f_ffree; 53 __u64 f_ffree;
31 __kernel_fsid_t f_fsid; 54 __kernel_fsid_t f_fsid;
32 __u32 f_namelen; 55 __statfs_word f_namelen;
33 __u32 f_frsize; 56 __statfs_word f_frsize;
34 __u32 f_spare[5]; 57 __statfs_word f_spare[5];
35}; 58} ARCH_PACK_STATFS64;
59
60/*
61 * IA64 and x86_64 need to avoid the 32-bit padding at the end,
62 * to be compatible with the i386 ABI
63 */
64#ifndef ARCH_PACK_COMPAT_STATFS64
65#define ARCH_PACK_COMPAT_STATFS64
66#endif
36 67
37struct compat_statfs64 { 68struct compat_statfs64 {
38 __u32 f_type; 69 __u32 f_type;
@@ -46,6 +77,6 @@ struct compat_statfs64 {
46 __u32 f_namelen; 77 __u32 f_namelen;
47 __u32 f_frsize; 78 __u32 f_frsize;
48 __u32 f_spare[5]; 79 __u32 f_spare[5];
49}; 80} ARCH_PACK_COMPAT_STATFS64;
50 81
51#endif 82#endif
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index abcf34c2fdc7..ea8087b55ffc 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -126,7 +126,7 @@ void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
126 * @args: array of argument values to store 126 * @args: array of argument values to store
127 * 127 *
128 * Changes @n arguments to the system call starting with the @i'th argument. 128 * Changes @n arguments to the system call starting with the @i'th argument.
129 * @n'th argument to @val. Argument @i gets value @args[0], and so on. 129 * Argument @i gets value @args[0], and so on.
130 * An arch inline version is probably optimal when @i and @n are constants. 130 * An arch inline version is probably optimal when @i and @n are constants.
131 * 131 *
132 * It's only valid to call this when @task is stopped for tracing on 132 * It's only valid to call this when @task is stopped for tracing on
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index cb752ba72466..74c5faf26c05 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -268,7 +268,15 @@
268 CPU_DISCARD(init.data) \ 268 CPU_DISCARD(init.data) \
269 CPU_DISCARD(init.rodata) \ 269 CPU_DISCARD(init.rodata) \
270 MEM_DISCARD(init.data) \ 270 MEM_DISCARD(init.data) \
271 MEM_DISCARD(init.rodata) 271 MEM_DISCARD(init.rodata) \
272 /* implement dynamic printk debug */ \
273 VMLINUX_SYMBOL(__start___verbose_strings) = .; \
274 *(__verbose_strings) \
275 VMLINUX_SYMBOL(__stop___verbose_strings) = .; \
276 . = ALIGN(8); \
277 VMLINUX_SYMBOL(__start___verbose) = .; \
278 *(__verbose) \
279 VMLINUX_SYMBOL(__stop___verbose) = .;
272 280
273#define INIT_TEXT \ 281#define INIT_TEXT \
274 *(.init.text) \ 282 *(.init.text) \
@@ -385,6 +393,7 @@
385 . = ALIGN(align); \ 393 . = ALIGN(align); \
386 VMLINUX_SYMBOL(__per_cpu_start) = .; \ 394 VMLINUX_SYMBOL(__per_cpu_start) = .; \
387 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ 395 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
396 *(.data.percpu.page_aligned) \
388 *(.data.percpu) \ 397 *(.data.percpu) \
389 *(.data.percpu.shared_aligned) \ 398 *(.data.percpu.shared_aligned) \
390 } \ 399 } \
diff --git a/include/asm-h8300/timer.h b/include/asm-h8300/timer.h
new file mode 100644
index 000000000000..def80464d38f
--- /dev/null
+++ b/include/asm-h8300/timer.h
@@ -0,0 +1,25 @@
1#ifndef __H8300_TIMER_H
2#define __H8300_TIMER_H
3
4void h8300_timer_tick(void);
5void h8300_timer_setup(void);
6void h8300_gettod(unsigned int *year, unsigned int *mon, unsigned int *day,
7 unsigned int *hour, unsigned int *min, unsigned int *sec);
8
9#define TIMER_FREQ (CONFIG_CPU_CLOCK*10000) /* Timer input freq. */
10
11#define calc_param(cnt, div, rate, limit) \
12do { \
13 cnt = TIMER_FREQ / HZ; \
14 for (div = 0; div < ARRAY_SIZE(divide_rate); div++) { \
15 if (rate[div] == 0) \
16 continue; \
17 if ((cnt / rate[div]) > limit) \
18 break; \
19 } \
20 if (div == ARRAY_SIZE(divide_rate)) \
21 panic("Timer counter overflow"); \
22 cnt /= divide_rate[div]; \
23} while(0)
24
25#endif
diff --git a/include/asm-m32r/a.out.h b/include/asm-m32r/a.out.h
deleted file mode 100644
index ab150f5c1666..000000000000
--- a/include/asm-m32r/a.out.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _ASM_M32R_A_OUT_H
2#define _ASM_M32R_A_OUT_H
3
4struct exec
5{
6 unsigned long a_info; /* Use macros N_MAGIC, etc for access */
7 unsigned a_text; /* length of text, in bytes */
8 unsigned a_data; /* length of data, in bytes */
9 unsigned a_bss; /* length of uninitialized data area for file, in bytes */
10 unsigned a_syms; /* length of symbol table data in file, in bytes */
11 unsigned a_entry; /* start address */
12 unsigned a_trsize; /* length of relocation info for text, in bytes */
13 unsigned a_drsize; /* length of relocation info for data, in bytes */
14};
15
16#define N_TRSIZE(a) ((a).a_trsize)
17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms)
19
20#endif /* _ASM_M32R_A_OUT_H */
diff --git a/include/asm-m32r/elf.h b/include/asm-m32r/elf.h
index 67bcd77494a5..0cc34c94bf2b 100644
--- a/include/asm-m32r/elf.h
+++ b/include/asm-m32r/elf.h
@@ -129,6 +129,6 @@ typedef elf_fpreg_t elf_fpregset_t;
129 intent than poking at uname or /proc/cpuinfo. */ 129 intent than poking at uname or /proc/cpuinfo. */
130#define ELF_PLATFORM (NULL) 130#define ELF_PLATFORM (NULL)
131 131
132#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX) 132#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
133 133
134#endif /* _ASM_M32R__ELF_H */ 134#endif /* _ASM_M32R__ELF_H */
diff --git a/include/asm-m68k/atarihw.h b/include/asm-m68k/atarihw.h
index ecf007df7743..1412b4ab202f 100644
--- a/include/asm-m68k/atarihw.h
+++ b/include/asm-m68k/atarihw.h
@@ -39,7 +39,6 @@ extern int atari_dont_touch_floppy_select;
39#define MACH_IS_TT ((atari_mch_cookie >> 16) == ATARI_MCH_TT) 39#define MACH_IS_TT ((atari_mch_cookie >> 16) == ATARI_MCH_TT)
40#define MACH_IS_FALCON ((atari_mch_cookie >> 16) == ATARI_MCH_FALCON) 40#define MACH_IS_FALCON ((atari_mch_cookie >> 16) == ATARI_MCH_FALCON)
41#define MACH_IS_MEDUSA (atari_mch_type == ATARI_MACH_MEDUSA) 41#define MACH_IS_MEDUSA (atari_mch_type == ATARI_MACH_MEDUSA)
42#define MACH_IS_HADES (atari_mch_type == ATARI_MACH_HADES)
43#define MACH_IS_AB40 (atari_mch_type == ATARI_MACH_AB40) 42#define MACH_IS_AB40 (atari_mch_type == ATARI_MACH_AB40)
44 43
45/* values for atari_switches */ 44/* values for atari_switches */
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h
index 91f7944333d4..26f505488c11 100644
--- a/include/asm-m68k/dma-mapping.h
+++ b/include/asm-m68k/dma-mapping.h
@@ -74,6 +74,14 @@ extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
74extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int, 74extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
75 enum dma_data_direction); 75 enum dma_data_direction);
76 76
77static inline void dma_sync_single_range_for_device(struct device *dev,
78 dma_addr_t dma_handle, unsigned long offset, size_t size,
79 enum dma_data_direction direction)
80{
81 /* just sync everything for now */
82 dma_sync_single_for_device(dev, dma_handle, offset + size, direction);
83}
84
77static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, 85static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
78 size_t size, enum dma_data_direction dir) 86 size_t size, enum dma_data_direction dir)
79{ 87{
@@ -84,6 +92,14 @@ static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *s
84{ 92{
85} 93}
86 94
95static inline void dma_sync_single_range_for_cpu(struct device *dev,
96 dma_addr_t dma_handle, unsigned long offset, size_t size,
97 enum dma_data_direction direction)
98{
99 /* just sync everything for now */
100 dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction);
101}
102
87static inline int dma_mapping_error(struct device *dev, dma_addr_t handle) 103static inline int dma_mapping_error(struct device *dev, dma_addr_t handle)
88{ 104{
89 return 0; 105 return 0;
diff --git a/include/asm-m68k/dma.h b/include/asm-m68k/dma.h
index d0c9e61e57b4..4240fbc946f8 100644
--- a/include/asm-m68k/dma.h
+++ b/include/asm-m68k/dma.h
@@ -11,10 +11,6 @@
11extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */ 11extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
12extern void free_dma(unsigned int dmanr); /* release it again */ 12extern void free_dma(unsigned int dmanr); /* release it again */
13 13
14#ifdef CONFIG_PCI
15extern int isa_dma_bridge_buggy;
16#else
17#define isa_dma_bridge_buggy (0) 14#define isa_dma_bridge_buggy (0)
18#endif
19 15
20#endif /* _M68K_DMA_H */ 16#endif /* _M68K_DMA_H */
diff --git a/include/asm-m68k/elf.h b/include/asm-m68k/elf.h
index 14ea42152b97..0b0f49eb876b 100644
--- a/include/asm-m68k/elf.h
+++ b/include/asm-m68k/elf.h
@@ -114,6 +114,6 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
114 114
115#define ELF_PLATFORM (NULL) 115#define ELF_PLATFORM (NULL)
116 116
117#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) 117#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
118 118
119#endif 119#endif
diff --git a/include/asm-m68k/entry.h b/include/asm-m68k/entry.h
index f8f6b185d793..5202f5a5b420 100644
--- a/include/asm-m68k/entry.h
+++ b/include/asm-m68k/entry.h
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33/* the following macro is used when enabling interrupts */ 33/* the following macro is used when enabling interrupts */
34#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES) 34#if defined(MACH_ATARI_ONLY)
35 /* block out HSYNC on the atari */ 35 /* block out HSYNC on the atari */
36#define ALLOWINT (~0x400) 36#define ALLOWINT (~0x400)
37#define MAX_NOINT_IPL 3 37#define MAX_NOINT_IPL 3
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index 657187f0c7c2..9e673e3bd434 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -7,15 +7,12 @@
7 * - added skeleton for GG-II and Amiga PCMCIA 7 * - added skeleton for GG-II and Amiga PCMCIA
8 * 2/3/01 RZ: - moved a few more defs into raw_io.h 8 * 2/3/01 RZ: - moved a few more defs into raw_io.h
9 * 9 *
10 * inX/outX/readX/writeX should not be used by any driver unless it does 10 * inX/outX should not be used by any driver unless it does
11 * ISA or PCI access. Other drivers should use function defined in raw_io.h 11 * ISA access. Other drivers should use function defined in raw_io.h
12 * or define its own macros on top of these. 12 * or define its own macros on top of these.
13 * 13 *
14 * inX(),outX() are for PCI and ISA I/O 14 * inX(),outX() are for ISA I/O
15 * readX(),writeX() are for PCI memory
16 * isa_readX(),isa_writeX() are for ISA memory 15 * isa_readX(),isa_writeX() are for ISA memory
17 *
18 * moved mem{cpy,set}_*io inside CONFIG_PCI
19 */ 16 */
20 17
21#ifndef _IO_H 18#ifndef _IO_H
@@ -256,10 +253,7 @@ static inline void isa_delay(void)
256 (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \ 253 (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \
257 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) 254 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
258 255
259#endif /* CONFIG_ISA */
260
261 256
262#if defined(CONFIG_ISA) && !defined(CONFIG_PCI)
263#define inb isa_inb 257#define inb isa_inb
264#define inb_p isa_inb_p 258#define inb_p isa_inb_p
265#define outb isa_outb 259#define outb isa_outb
@@ -282,55 +276,9 @@ static inline void isa_delay(void)
282#define readw isa_readw 276#define readw isa_readw
283#define writeb isa_writeb 277#define writeb isa_writeb
284#define writew isa_writew 278#define writew isa_writew
285#endif /* CONFIG_ISA */
286
287#if defined(CONFIG_PCI)
288
289#define readl(addr) in_le32(addr)
290#define writel(val,addr) out_le32((addr),(val))
291
292/* those can be defined for both ISA and PCI - it won't work though */
293#define readb(addr) in_8(addr)
294#define readw(addr) in_le16(addr)
295#define writeb(val,addr) out_8((addr),(val))
296#define writew(val,addr) out_le16((addr),(val))
297 279
298#define readb_relaxed(addr) readb(addr) 280#else /* CONFIG_ISA */
299#define readw_relaxed(addr) readw(addr)
300#define readl_relaxed(addr) readl(addr)
301 281
302#ifndef CONFIG_ISA
303#define inb(port) in_8(port)
304#define outb(val,port) out_8((port),(val))
305#define inw(port) in_le16(port)
306#define outw(val,port) out_le16((port),(val))
307#define inl(port) in_le32(port)
308#define outl(val,port) out_le32((port),(val))
309
310#else
311/*
312 * kernel with both ISA and PCI compiled in, those have
313 * conflicting defs for in/out. Simply consider port < 1024
314 * ISA and everything else PCI. read,write not defined
315 * in this case
316 */
317#define inb(port) ((port)<1024 ? isa_inb(port) : in_8(port))
318#define inb_p(port) ((port)<1024 ? isa_inb_p(port) : in_8(port))
319#define inw(port) ((port)<1024 ? isa_inw(port) : in_le16(port))
320#define inw_p(port) ((port)<1024 ? isa_inw_p(port) : in_le16(port))
321#define inl(port) ((port)<1024 ? isa_inl(port) : in_le32(port))
322#define inl_p(port) ((port)<1024 ? isa_inl_p(port) : in_le32(port))
323
324#define outb(val,port) ((port)<1024 ? isa_outb((val),(port)) : out_8((port),(val)))
325#define outb_p(val,port) ((port)<1024 ? isa_outb_p((val),(port)) : out_8((port),(val)))
326#define outw(val,port) ((port)<1024 ? isa_outw((val),(port)) : out_le16((port),(val)))
327#define outw_p(val,port) ((port)<1024 ? isa_outw_p((val),(port)) : out_le16((port),(val)))
328#define outl(val,port) ((port)<1024 ? isa_outl((val),(port)) : out_le32((port),(val)))
329#define outl_p(val,port) ((port)<1024 ? isa_outl_p((val),(port)) : out_le32((port),(val)))
330#endif
331#endif /* CONFIG_PCI */
332
333#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI)
334/* 282/*
335 * We need to define dummy functions for GENERIC_IOMAP support. 283 * We need to define dummy functions for GENERIC_IOMAP support.
336 */ 284 */
@@ -357,11 +305,11 @@ static inline void isa_delay(void)
357#define writeb(val,addr) out_8((addr),(val)) 305#define writeb(val,addr) out_8((addr),(val))
358#define readw(addr) in_le16(addr) 306#define readw(addr) in_le16(addr)
359#define writew(val,addr) out_le16((addr),(val)) 307#define writew(val,addr) out_le16((addr),(val))
360#endif 308
361#if !defined(CONFIG_PCI) 309#endif /* CONFIG_ISA */
310
362#define readl(addr) in_le32(addr) 311#define readl(addr) in_le32(addr)
363#define writel(val,addr) out_le32((addr),(val)) 312#define writel(val,addr) out_le32((addr),(val))
364#endif
365 313
366#define mmiowb() 314#define mmiowb()
367 315
diff --git a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h
index 678cb0b52314..4ad0aea48ab4 100644
--- a/include/asm-m68k/pci.h
+++ b/include/asm-m68k/pci.h
@@ -1,52 +1,7 @@
1#ifndef _ASM_M68K_PCI_H 1#ifndef _ASM_M68K_PCI_H
2#define _ASM_M68K_PCI_H 2#define _ASM_M68K_PCI_H
3 3
4/* 4#include <asm-generic/pci-dma-compat.h>
5 * asm-m68k/pci_m68k.h - m68k specific PCI declarations.
6 *
7 * Written by Wout Klaren.
8 */
9
10#include <asm/scatterlist.h>
11
12struct pci_ops;
13
14/*
15 * Structure with hardware dependent information and functions of the
16 * PCI bus.
17 */
18
19struct pci_bus_info
20{
21 /*
22 * Resources of the PCI bus.
23 */
24
25 struct resource mem_space;
26 struct resource io_space;
27
28 /*
29 * System dependent functions.
30 */
31
32 struct pci_ops *m68k_pci_ops;
33
34 void (*fixup)(int pci_modify);
35 void (*conf_device)(struct pci_dev *dev);
36};
37
38#define pcibios_assign_all_busses() 0
39#define pcibios_scan_all_fns(a, b) 0
40
41static inline void pcibios_set_master(struct pci_dev *dev)
42{
43 /* No special bus mastering setup handling */
44}
45
46static inline void pcibios_penalize_isa_irq(int irq, int active)
47{
48 /* We don't do dynamic PCI IRQ allocation */
49}
50 5
51/* The PCI address space does equal the physical memory 6/* The PCI address space does equal the physical memory
52 * address space. The networking and block device layers use 7 * address space. The networking and block device layers use
diff --git a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h
index dea32fbc7e51..22ab05c9c52b 100644
--- a/include/asm-m68k/virtconvert.h
+++ b/include/asm-m68k/virtconvert.h
@@ -40,15 +40,9 @@ static inline void *phys_to_virt(unsigned long address)
40 40
41/* 41/*
42 * IO bus memory addresses are 1:1 with the physical address, 42 * IO bus memory addresses are 1:1 with the physical address,
43 * except on the PCI bus of the Hades.
44 */ 43 */
45#ifdef CONFIG_HADES
46#define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0))
47#define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0)))
48#else
49#define virt_to_bus virt_to_phys 44#define virt_to_bus virt_to_phys
50#define bus_to_virt phys_to_virt 45#define bus_to_virt phys_to_virt
51#endif
52 46
53#endif 47#endif
54#endif 48#endif
diff --git a/include/asm-mips/Kbuild b/include/asm-mips/Kbuild
deleted file mode 100644
index 7897f05e3165..000000000000
--- a/include/asm-mips/Kbuild
+++ /dev/null
@@ -1,3 +0,0 @@
1include include/asm-generic/Kbuild.asm
2
3header-y += cachectl.h sgidefs.h sysmips.h
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h
deleted file mode 100644
index cad8371422ab..000000000000
--- a/include/asm-mips/a.out.h
+++ /dev/null
@@ -1,35 +0,0 @@
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 * Copyright (C) 1994 - 1999, 2003 by Ralf Baechle
7 */
8#ifndef _ASM_A_OUT_H
9#define _ASM_A_OUT_H
10
11#ifdef __KERNEL__
12
13
14#endif
15
16struct exec
17{
18 unsigned long a_info; /* Use macros N_MAGIC, etc for access */
19 unsigned a_text; /* length of text, in bytes */
20 unsigned a_data; /* length of data, in bytes */
21 unsigned a_bss; /* length of uninitialized data area for
22 file, in bytes */
23 unsigned a_syms; /* length of symbol table data in file,
24 in bytes */
25 unsigned a_entry; /* start address */
26 unsigned a_trsize; /* length of relocation info for text, in
27 bytes */
28 unsigned a_drsize; /* length of relocation info for data, in bytes */
29};
30
31#define N_TRSIZE(a) ((a).a_trsize)
32#define N_DRSIZE(a) ((a).a_drsize)
33#define N_SYMSIZE(a) ((a).a_syms)
34
35#endif /* _ASM_A_OUT_H */
diff --git a/include/asm-mips/abi.h b/include/asm-mips/abi.h
deleted file mode 100644
index 1dd74fbdc09b..000000000000
--- a/include/asm-mips/abi.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2005, 06 by Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (C) 2005 MIPS Technologies, Inc.
8 */
9#ifndef _ASM_ABI_H
10#define _ASM_ABI_H
11
12#include <asm/signal.h>
13#include <asm/siginfo.h>
14
15struct mips_abi {
16 int (* const setup_frame)(struct k_sigaction * ka,
17 struct pt_regs *regs, int signr,
18 sigset_t *set);
19 int (* const setup_rt_frame)(struct k_sigaction * ka,
20 struct pt_regs *regs, int signr,
21 sigset_t *set, siginfo_t *info);
22 const unsigned long restart;
23};
24
25#endif /* _ASM_ABI_H */
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
deleted file mode 100644
index 569f80aacbd2..000000000000
--- a/include/asm-mips/addrspace.h
+++ /dev/null
@@ -1,154 +0,0 @@
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 * Copyright (C) 1996, 99 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999 by Silicon Graphics, Inc.
9 */
10#ifndef _ASM_ADDRSPACE_H
11#define _ASM_ADDRSPACE_H
12
13#include <spaces.h>
14
15/*
16 * Configure language
17 */
18#ifdef __ASSEMBLY__
19#define _ATYPE_
20#define _ATYPE32_
21#define _ATYPE64_
22#define _CONST64_(x) x
23#else
24#define _ATYPE_ __PTRDIFF_TYPE__
25#define _ATYPE32_ int
26#define _ATYPE64_ __s64
27#ifdef CONFIG_64BIT
28#define _CONST64_(x) x ## L
29#else
30#define _CONST64_(x) x ## LL
31#endif
32#endif
33
34/*
35 * 32-bit MIPS address spaces
36 */
37#ifdef __ASSEMBLY__
38#define _ACAST32_
39#define _ACAST64_
40#else
41#define _ACAST32_ (_ATYPE_)(_ATYPE32_) /* widen if necessary */
42#define _ACAST64_ (_ATYPE64_) /* do _not_ narrow */
43#endif
44
45/*
46 * Returns the kernel segment base of a given address
47 */
48#define KSEGX(a) ((_ACAST32_ (a)) & 0xe0000000)
49
50/*
51 * Returns the physical address of a CKSEGx / XKPHYS address
52 */
53#define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff)
54#define XPHYSADDR(a) ((_ACAST64_(a)) & \
55 _CONST64_(0x000000ffffffffff))
56
57#ifdef CONFIG_64BIT
58
59/*
60 * Memory segments (64bit kernel mode addresses)
61 * The compatibility segments use the full 64-bit sign extended value. Note
62 * the R8000 doesn't have them so don't reference these in generic MIPS code.
63 */
64#define XKUSEG _CONST64_(0x0000000000000000)
65#define XKSSEG _CONST64_(0x4000000000000000)
66#define XKPHYS _CONST64_(0x8000000000000000)
67#define XKSEG _CONST64_(0xc000000000000000)
68#define CKSEG0 _CONST64_(0xffffffff80000000)
69#define CKSEG1 _CONST64_(0xffffffffa0000000)
70#define CKSSEG _CONST64_(0xffffffffc0000000)
71#define CKSEG3 _CONST64_(0xffffffffe0000000)
72
73#define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0)
74#define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1)
75#define CKSEG2ADDR(a) (CPHYSADDR(a) | CKSEG2)
76#define CKSEG3ADDR(a) (CPHYSADDR(a) | CKSEG3)
77
78#else
79
80#define CKSEG0ADDR(a) (CPHYSADDR(a) | KSEG0)
81#define CKSEG1ADDR(a) (CPHYSADDR(a) | KSEG1)
82#define CKSEG2ADDR(a) (CPHYSADDR(a) | KSEG2)
83#define CKSEG3ADDR(a) (CPHYSADDR(a) | KSEG3)
84
85/*
86 * Map an address to a certain kernel segment
87 */
88#define KSEG0ADDR(a) (CPHYSADDR(a) | KSEG0)
89#define KSEG1ADDR(a) (CPHYSADDR(a) | KSEG1)
90#define KSEG2ADDR(a) (CPHYSADDR(a) | KSEG2)
91#define KSEG3ADDR(a) (CPHYSADDR(a) | KSEG3)
92
93/*
94 * Memory segments (32bit kernel mode addresses)
95 * These are the traditional names used in the 32-bit universe.
96 */
97#define KUSEG 0x00000000
98#define KSEG0 0x80000000
99#define KSEG1 0xa0000000
100#define KSEG2 0xc0000000
101#define KSEG3 0xe0000000
102
103#define CKUSEG 0x00000000
104#define CKSEG0 0x80000000
105#define CKSEG1 0xa0000000
106#define CKSEG2 0xc0000000
107#define CKSEG3 0xe0000000
108
109#endif
110
111/*
112 * Cache modes for XKPHYS address conversion macros
113 */
114#define K_CALG_COH_EXCL1_NOL2 0
115#define K_CALG_COH_SHRL1_NOL2 1
116#define K_CALG_UNCACHED 2
117#define K_CALG_NONCOHERENT 3
118#define K_CALG_COH_EXCL 4
119#define K_CALG_COH_SHAREABLE 5
120#define K_CALG_NOTUSED 6
121#define K_CALG_UNCACHED_ACCEL 7
122
123/*
124 * 64-bit address conversions
125 */
126#define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED, (p))
127#define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE, (p))
128#define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK)
129#define PHYS_TO_XKPHYS(cm, a) (_CONST64_(0x8000000000000000) | \
130 (_CONST64_(cm) << 59) | (a))
131
132/*
133 * The ultimate limited of the 64-bit MIPS architecture: 2 bits for selecting
134 * the region, 3 bits for the CCA mode. This leaves 59 bits of which the
135 * R8000 implements most with its 48-bit physical address space.
136 */
137#define TO_PHYS_MASK _CONST64_(0x07ffffffffffffff) /* 2^^59 - 1 */
138
139#ifndef CONFIG_CPU_R8000
140
141/*
142 * The R8000 doesn't have the 32-bit compat spaces so we don't define them
143 * in order to catch bugs in the source code.
144 */
145
146#define COMPAT_K1BASE32 _CONST64_(0xffffffffa0000000)
147#define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */
148
149#endif
150
151#define KDM_TO_PHYS(x) (_ACAST64_ (x) & TO_PHYS_MASK)
152#define PHYS_TO_K0(x) (_ACAST64_ (x) | CAC_BASE)
153
154#endif /* _ASM_ADDRSPACE_H */
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h
deleted file mode 100644
index 608cfcfbb3ea..000000000000
--- a/include/asm-mips/asm.h
+++ /dev/null
@@ -1,409 +0,0 @@
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 * Copyright (C) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle
7 * Copyright (C) 1999 by Silicon Graphics, Inc.
8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 * Copyright (C) 2002 Maciej W. Rozycki
10 *
11 * Some useful macros for MIPS assembler code
12 *
13 * Some of the routines below contain useless nops that will be optimized
14 * away by gas in -O mode. These nops are however required to fill delay
15 * slots in noreorder mode.
16 */
17#ifndef __ASM_ASM_H
18#define __ASM_ASM_H
19
20#include <asm/sgidefs.h>
21
22#ifndef CAT
23#ifdef __STDC__
24#define __CAT(str1, str2) str1##str2
25#else
26#define __CAT(str1, str2) str1/**/str2
27#endif
28#define CAT(str1, str2) __CAT(str1, str2)
29#endif
30
31/*
32 * PIC specific declarations
33 * Not used for the kernel but here seems to be the right place.
34 */
35#ifdef __PIC__
36#define CPRESTORE(register) \
37 .cprestore register
38#define CPADD(register) \
39 .cpadd register
40#define CPLOAD(register) \
41 .cpload register
42#else
43#define CPRESTORE(register)
44#define CPADD(register)
45#define CPLOAD(register)
46#endif
47
48/*
49 * LEAF - declare leaf routine
50 */
51#define LEAF(symbol) \
52 .globl symbol; \
53 .align 2; \
54 .type symbol, @function; \
55 .ent symbol, 0; \
56symbol: .frame sp, 0, ra
57
58/*
59 * NESTED - declare nested routine entry point
60 */
61#define NESTED(symbol, framesize, rpc) \
62 .globl symbol; \
63 .align 2; \
64 .type symbol, @function; \
65 .ent symbol, 0; \
66symbol: .frame sp, framesize, rpc
67
68/*
69 * END - mark end of function
70 */
71#define END(function) \
72 .end function; \
73 .size function, .-function
74
75/*
76 * EXPORT - export definition of symbol
77 */
78#define EXPORT(symbol) \
79 .globl symbol; \
80symbol:
81
82/*
83 * FEXPORT - export definition of a function symbol
84 */
85#define FEXPORT(symbol) \
86 .globl symbol; \
87 .type symbol, @function; \
88symbol:
89
90/*
91 * ABS - export absolute symbol
92 */
93#define ABS(symbol,value) \
94 .globl symbol; \
95symbol = value
96
97#define PANIC(msg) \
98 .set push; \
99 .set reorder; \
100 PTR_LA a0, 8f; \
101 jal panic; \
1029: b 9b; \
103 .set pop; \
104 TEXT(msg)
105
106/*
107 * Print formatted string
108 */
109#ifdef CONFIG_PRINTK
110#define PRINT(string) \
111 .set push; \
112 .set reorder; \
113 PTR_LA a0, 8f; \
114 jal printk; \
115 .set pop; \
116 TEXT(string)
117#else
118#define PRINT(string)
119#endif
120
121#define TEXT(msg) \
122 .pushsection .data; \
1238: .asciiz msg; \
124 .popsection;
125
126/*
127 * Build text tables
128 */
129#define TTABLE(string) \
130 .pushsection .text; \
131 .word 1f; \
132 .popsection \
133 .pushsection .data; \
1341: .asciiz string; \
135 .popsection
136
137/*
138 * MIPS IV pref instruction.
139 * Use with .set noreorder only!
140 *
141 * MIPS IV implementations are free to treat this as a nop. The R5000
142 * is one of them. So we should have an option not to use this instruction.
143 */
144#ifdef CONFIG_CPU_HAS_PREFETCH
145
146#define PREF(hint,addr) \
147 .set push; \
148 .set mips4; \
149 pref hint, addr; \
150 .set pop
151
152#define PREFX(hint,addr) \
153 .set push; \
154 .set mips4; \
155 prefx hint, addr; \
156 .set pop
157
158#else /* !CONFIG_CPU_HAS_PREFETCH */
159
160#define PREF(hint, addr)
161#define PREFX(hint, addr)
162
163#endif /* !CONFIG_CPU_HAS_PREFETCH */
164
165/*
166 * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs.
167 */
168#if (_MIPS_ISA == _MIPS_ISA_MIPS1)
169#define MOVN(rd, rs, rt) \
170 .set push; \
171 .set reorder; \
172 beqz rt, 9f; \
173 move rd, rs; \
174 .set pop; \
1759:
176#define MOVZ(rd, rs, rt) \
177 .set push; \
178 .set reorder; \
179 bnez rt, 9f; \
180 move rd, rs; \
181 .set pop; \
1829:
183#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */
184#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3)
185#define MOVN(rd, rs, rt) \
186 .set push; \
187 .set noreorder; \
188 bnezl rt, 9f; \
189 move rd, rs; \
190 .set pop; \
1919:
192#define MOVZ(rd, rs, rt) \
193 .set push; \
194 .set noreorder; \
195 beqzl rt, 9f; \
196 move rd, rs; \
197 .set pop; \
1989:
199#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */
200#if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
201 (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
202#define MOVN(rd, rs, rt) \
203 movn rd, rs, rt
204#define MOVZ(rd, rs, rt) \
205 movz rd, rs, rt
206#endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */
207
208/*
209 * Stack alignment
210 */
211#if (_MIPS_SIM == _MIPS_SIM_ABI32)
212#define ALSZ 7
213#define ALMASK ~7
214#endif
215#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
216#define ALSZ 15
217#define ALMASK ~15
218#endif
219
220/*
221 * Macros to handle different pointer/register sizes for 32/64-bit code
222 */
223
224/*
225 * Size of a register
226 */
227#ifdef __mips64
228#define SZREG 8
229#else
230#define SZREG 4
231#endif
232
233/*
234 * Use the following macros in assemblercode to load/store registers,
235 * pointers etc.
236 */
237#if (_MIPS_SIM == _MIPS_SIM_ABI32)
238#define REG_S sw
239#define REG_L lw
240#define REG_SUBU subu
241#define REG_ADDU addu
242#endif
243#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
244#define REG_S sd
245#define REG_L ld
246#define REG_SUBU dsubu
247#define REG_ADDU daddu
248#endif
249
250/*
251 * How to add/sub/load/store/shift C int variables.
252 */
253#if (_MIPS_SZINT == 32)
254#define INT_ADD add
255#define INT_ADDU addu
256#define INT_ADDI addi
257#define INT_ADDIU addiu
258#define INT_SUB sub
259#define INT_SUBU subu
260#define INT_L lw
261#define INT_S sw
262#define INT_SLL sll
263#define INT_SLLV sllv
264#define INT_SRL srl
265#define INT_SRLV srlv
266#define INT_SRA sra
267#define INT_SRAV srav
268#endif
269
270#if (_MIPS_SZINT == 64)
271#define INT_ADD dadd
272#define INT_ADDU daddu
273#define INT_ADDI daddi
274#define INT_ADDIU daddiu
275#define INT_SUB dsub
276#define INT_SUBU dsubu
277#define INT_L ld
278#define INT_S sd
279#define INT_SLL dsll
280#define INT_SLLV dsllv
281#define INT_SRL dsrl
282#define INT_SRLV dsrlv
283#define INT_SRA dsra
284#define INT_SRAV dsrav
285#endif
286
287/*
288 * How to add/sub/load/store/shift C long variables.
289 */
290#if (_MIPS_SZLONG == 32)
291#define LONG_ADD add
292#define LONG_ADDU addu
293#define LONG_ADDI addi
294#define LONG_ADDIU addiu
295#define LONG_SUB sub
296#define LONG_SUBU subu
297#define LONG_L lw
298#define LONG_S sw
299#define LONG_SLL sll
300#define LONG_SLLV sllv
301#define LONG_SRL srl
302#define LONG_SRLV srlv
303#define LONG_SRA sra
304#define LONG_SRAV srav
305
306#define LONG .word
307#define LONGSIZE 4
308#define LONGMASK 3
309#define LONGLOG 2
310#endif
311
312#if (_MIPS_SZLONG == 64)
313#define LONG_ADD dadd
314#define LONG_ADDU daddu
315#define LONG_ADDI daddi
316#define LONG_ADDIU daddiu
317#define LONG_SUB dsub
318#define LONG_SUBU dsubu
319#define LONG_L ld
320#define LONG_S sd
321#define LONG_SLL dsll
322#define LONG_SLLV dsllv
323#define LONG_SRL dsrl
324#define LONG_SRLV dsrlv
325#define LONG_SRA dsra
326#define LONG_SRAV dsrav
327
328#define LONG .dword
329#define LONGSIZE 8
330#define LONGMASK 7
331#define LONGLOG 3
332#endif
333
334/*
335 * How to add/sub/load/store/shift pointers.
336 */
337#if (_MIPS_SZPTR == 32)
338#define PTR_ADD add
339#define PTR_ADDU addu
340#define PTR_ADDI addi
341#define PTR_ADDIU addiu
342#define PTR_SUB sub
343#define PTR_SUBU subu
344#define PTR_L lw
345#define PTR_S sw
346#define PTR_LA la
347#define PTR_LI li
348#define PTR_SLL sll
349#define PTR_SLLV sllv
350#define PTR_SRL srl
351#define PTR_SRLV srlv
352#define PTR_SRA sra
353#define PTR_SRAV srav
354
355#define PTR_SCALESHIFT 2
356
357#define PTR .word
358#define PTRSIZE 4
359#define PTRLOG 2
360#endif
361
362#if (_MIPS_SZPTR == 64)
363#define PTR_ADD dadd
364#define PTR_ADDU daddu
365#define PTR_ADDI daddi
366#define PTR_ADDIU daddiu
367#define PTR_SUB dsub
368#define PTR_SUBU dsubu
369#define PTR_L ld
370#define PTR_S sd
371#define PTR_LA dla
372#define PTR_LI dli
373#define PTR_SLL dsll
374#define PTR_SLLV dsllv
375#define PTR_SRL dsrl
376#define PTR_SRLV dsrlv
377#define PTR_SRA dsra
378#define PTR_SRAV dsrav
379
380#define PTR_SCALESHIFT 3
381
382#define PTR .dword
383#define PTRSIZE 8
384#define PTRLOG 3
385#endif
386
387/*
388 * Some cp0 registers were extended to 64bit for MIPS III.
389 */
390#if (_MIPS_SIM == _MIPS_SIM_ABI32)
391#define MFC0 mfc0
392#define MTC0 mtc0
393#endif
394#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
395#define MFC0 dmfc0
396#define MTC0 dmtc0
397#endif
398
399#define SSNOP sll zero, zero, 1
400
401#ifdef CONFIG_SGI_IP28
402/* Inhibit speculative stores to volatile (e.g.DMA) or invalid addresses. */
403#include <asm/cacheops.h>
404#define R10KCBARRIER(addr) cache Cache_Barrier, addr;
405#else
406#define R10KCBARRIER(addr)
407#endif
408
409#endif /* __ASM_ASM_H */
diff --git a/include/asm-mips/asmmacro-32.h b/include/asm-mips/asmmacro-32.h
deleted file mode 100644
index 5de3963f511e..000000000000
--- a/include/asm-mips/asmmacro-32.h
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * asmmacro.h: Assembler macros to make things easier to read.
3 *
4 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
5 * Copyright (C) 1998, 1999, 2003 Ralf Baechle
6 */
7#ifndef _ASM_ASMMACRO_32_H
8#define _ASM_ASMMACRO_32_H
9
10#include <asm/asm-offsets.h>
11#include <asm/regdef.h>
12#include <asm/fpregdef.h>
13#include <asm/mipsregs.h>
14
15 .macro fpu_save_double thread status tmp1=t0
16 cfc1 \tmp1, fcr31
17 sdc1 $f0, THREAD_FPR0(\thread)
18 sdc1 $f2, THREAD_FPR2(\thread)
19 sdc1 $f4, THREAD_FPR4(\thread)
20 sdc1 $f6, THREAD_FPR6(\thread)
21 sdc1 $f8, THREAD_FPR8(\thread)
22 sdc1 $f10, THREAD_FPR10(\thread)
23 sdc1 $f12, THREAD_FPR12(\thread)
24 sdc1 $f14, THREAD_FPR14(\thread)
25 sdc1 $f16, THREAD_FPR16(\thread)
26 sdc1 $f18, THREAD_FPR18(\thread)
27 sdc1 $f20, THREAD_FPR20(\thread)
28 sdc1 $f22, THREAD_FPR22(\thread)
29 sdc1 $f24, THREAD_FPR24(\thread)
30 sdc1 $f26, THREAD_FPR26(\thread)
31 sdc1 $f28, THREAD_FPR28(\thread)
32 sdc1 $f30, THREAD_FPR30(\thread)
33 sw \tmp1, THREAD_FCR31(\thread)
34 .endm
35
36 .macro fpu_save_single thread tmp=t0
37 cfc1 \tmp, fcr31
38 swc1 $f0, THREAD_FPR0(\thread)
39 swc1 $f1, THREAD_FPR1(\thread)
40 swc1 $f2, THREAD_FPR2(\thread)
41 swc1 $f3, THREAD_FPR3(\thread)
42 swc1 $f4, THREAD_FPR4(\thread)
43 swc1 $f5, THREAD_FPR5(\thread)
44 swc1 $f6, THREAD_FPR6(\thread)
45 swc1 $f7, THREAD_FPR7(\thread)
46 swc1 $f8, THREAD_FPR8(\thread)
47 swc1 $f9, THREAD_FPR9(\thread)
48 swc1 $f10, THREAD_FPR10(\thread)
49 swc1 $f11, THREAD_FPR11(\thread)
50 swc1 $f12, THREAD_FPR12(\thread)
51 swc1 $f13, THREAD_FPR13(\thread)
52 swc1 $f14, THREAD_FPR14(\thread)
53 swc1 $f15, THREAD_FPR15(\thread)
54 swc1 $f16, THREAD_FPR16(\thread)
55 swc1 $f17, THREAD_FPR17(\thread)
56 swc1 $f18, THREAD_FPR18(\thread)
57 swc1 $f19, THREAD_FPR19(\thread)
58 swc1 $f20, THREAD_FPR20(\thread)
59 swc1 $f21, THREAD_FPR21(\thread)
60 swc1 $f22, THREAD_FPR22(\thread)
61 swc1 $f23, THREAD_FPR23(\thread)
62 swc1 $f24, THREAD_FPR24(\thread)
63 swc1 $f25, THREAD_FPR25(\thread)
64 swc1 $f26, THREAD_FPR26(\thread)
65 swc1 $f27, THREAD_FPR27(\thread)
66 swc1 $f28, THREAD_FPR28(\thread)
67 swc1 $f29, THREAD_FPR29(\thread)
68 swc1 $f30, THREAD_FPR30(\thread)
69 swc1 $f31, THREAD_FPR31(\thread)
70 sw \tmp, THREAD_FCR31(\thread)
71 .endm
72
73 .macro fpu_restore_double thread status tmp=t0
74 lw \tmp, THREAD_FCR31(\thread)
75 ldc1 $f0, THREAD_FPR0(\thread)
76 ldc1 $f2, THREAD_FPR2(\thread)
77 ldc1 $f4, THREAD_FPR4(\thread)
78 ldc1 $f6, THREAD_FPR6(\thread)
79 ldc1 $f8, THREAD_FPR8(\thread)
80 ldc1 $f10, THREAD_FPR10(\thread)
81 ldc1 $f12, THREAD_FPR12(\thread)
82 ldc1 $f14, THREAD_FPR14(\thread)
83 ldc1 $f16, THREAD_FPR16(\thread)
84 ldc1 $f18, THREAD_FPR18(\thread)
85 ldc1 $f20, THREAD_FPR20(\thread)
86 ldc1 $f22, THREAD_FPR22(\thread)
87 ldc1 $f24, THREAD_FPR24(\thread)
88 ldc1 $f26, THREAD_FPR26(\thread)
89 ldc1 $f28, THREAD_FPR28(\thread)
90 ldc1 $f30, THREAD_FPR30(\thread)
91 ctc1 \tmp, fcr31
92 .endm
93
94 .macro fpu_restore_single thread tmp=t0
95 lw \tmp, THREAD_FCR31(\thread)
96 lwc1 $f0, THREAD_FPR0(\thread)
97 lwc1 $f1, THREAD_FPR1(\thread)
98 lwc1 $f2, THREAD_FPR2(\thread)
99 lwc1 $f3, THREAD_FPR3(\thread)
100 lwc1 $f4, THREAD_FPR4(\thread)
101 lwc1 $f5, THREAD_FPR5(\thread)
102 lwc1 $f6, THREAD_FPR6(\thread)
103 lwc1 $f7, THREAD_FPR7(\thread)
104 lwc1 $f8, THREAD_FPR8(\thread)
105 lwc1 $f9, THREAD_FPR9(\thread)
106 lwc1 $f10, THREAD_FPR10(\thread)
107 lwc1 $f11, THREAD_FPR11(\thread)
108 lwc1 $f12, THREAD_FPR12(\thread)
109 lwc1 $f13, THREAD_FPR13(\thread)
110 lwc1 $f14, THREAD_FPR14(\thread)
111 lwc1 $f15, THREAD_FPR15(\thread)
112 lwc1 $f16, THREAD_FPR16(\thread)
113 lwc1 $f17, THREAD_FPR17(\thread)
114 lwc1 $f18, THREAD_FPR18(\thread)
115 lwc1 $f19, THREAD_FPR19(\thread)
116 lwc1 $f20, THREAD_FPR20(\thread)
117 lwc1 $f21, THREAD_FPR21(\thread)
118 lwc1 $f22, THREAD_FPR22(\thread)
119 lwc1 $f23, THREAD_FPR23(\thread)
120 lwc1 $f24, THREAD_FPR24(\thread)
121 lwc1 $f25, THREAD_FPR25(\thread)
122 lwc1 $f26, THREAD_FPR26(\thread)
123 lwc1 $f27, THREAD_FPR27(\thread)
124 lwc1 $f28, THREAD_FPR28(\thread)
125 lwc1 $f29, THREAD_FPR29(\thread)
126 lwc1 $f30, THREAD_FPR30(\thread)
127 lwc1 $f31, THREAD_FPR31(\thread)
128 ctc1 \tmp, fcr31
129 .endm
130
131 .macro cpu_save_nonscratch thread
132 LONG_S s0, THREAD_REG16(\thread)
133 LONG_S s1, THREAD_REG17(\thread)
134 LONG_S s2, THREAD_REG18(\thread)
135 LONG_S s3, THREAD_REG19(\thread)
136 LONG_S s4, THREAD_REG20(\thread)
137 LONG_S s5, THREAD_REG21(\thread)
138 LONG_S s6, THREAD_REG22(\thread)
139 LONG_S s7, THREAD_REG23(\thread)
140 LONG_S sp, THREAD_REG29(\thread)
141 LONG_S fp, THREAD_REG30(\thread)
142 .endm
143
144 .macro cpu_restore_nonscratch thread
145 LONG_L s0, THREAD_REG16(\thread)
146 LONG_L s1, THREAD_REG17(\thread)
147 LONG_L s2, THREAD_REG18(\thread)
148 LONG_L s3, THREAD_REG19(\thread)
149 LONG_L s4, THREAD_REG20(\thread)
150 LONG_L s5, THREAD_REG21(\thread)
151 LONG_L s6, THREAD_REG22(\thread)
152 LONG_L s7, THREAD_REG23(\thread)
153 LONG_L sp, THREAD_REG29(\thread)
154 LONG_L fp, THREAD_REG30(\thread)
155 LONG_L ra, THREAD_REG31(\thread)
156 .endm
157
158#endif /* _ASM_ASMMACRO_32_H */
diff --git a/include/asm-mips/asmmacro-64.h b/include/asm-mips/asmmacro-64.h
deleted file mode 100644
index 225feefcb25d..000000000000
--- a/include/asm-mips/asmmacro-64.h
+++ /dev/null
@@ -1,139 +0,0 @@
1/*
2 * asmmacro.h: Assembler macros to make things easier to read.
3 *
4 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
5 * Copyright (C) 1998, 1999 Ralf Baechle
6 * Copyright (C) 1999 Silicon Graphics, Inc.
7 */
8#ifndef _ASM_ASMMACRO_64_H
9#define _ASM_ASMMACRO_64_H
10
11#include <asm/asm-offsets.h>
12#include <asm/regdef.h>
13#include <asm/fpregdef.h>
14#include <asm/mipsregs.h>
15
16 .macro fpu_save_16even thread tmp=t0
17 cfc1 \tmp, fcr31
18 sdc1 $f0, THREAD_FPR0(\thread)
19 sdc1 $f2, THREAD_FPR2(\thread)
20 sdc1 $f4, THREAD_FPR4(\thread)
21 sdc1 $f6, THREAD_FPR6(\thread)
22 sdc1 $f8, THREAD_FPR8(\thread)
23 sdc1 $f10, THREAD_FPR10(\thread)
24 sdc1 $f12, THREAD_FPR12(\thread)
25 sdc1 $f14, THREAD_FPR14(\thread)
26 sdc1 $f16, THREAD_FPR16(\thread)
27 sdc1 $f18, THREAD_FPR18(\thread)
28 sdc1 $f20, THREAD_FPR20(\thread)
29 sdc1 $f22, THREAD_FPR22(\thread)
30 sdc1 $f24, THREAD_FPR24(\thread)
31 sdc1 $f26, THREAD_FPR26(\thread)
32 sdc1 $f28, THREAD_FPR28(\thread)
33 sdc1 $f30, THREAD_FPR30(\thread)
34 sw \tmp, THREAD_FCR31(\thread)
35 .endm
36
37 .macro fpu_save_16odd thread
38 sdc1 $f1, THREAD_FPR1(\thread)
39 sdc1 $f3, THREAD_FPR3(\thread)
40 sdc1 $f5, THREAD_FPR5(\thread)
41 sdc1 $f7, THREAD_FPR7(\thread)
42 sdc1 $f9, THREAD_FPR9(\thread)
43 sdc1 $f11, THREAD_FPR11(\thread)
44 sdc1 $f13, THREAD_FPR13(\thread)
45 sdc1 $f15, THREAD_FPR15(\thread)
46 sdc1 $f17, THREAD_FPR17(\thread)
47 sdc1 $f19, THREAD_FPR19(\thread)
48 sdc1 $f21, THREAD_FPR21(\thread)
49 sdc1 $f23, THREAD_FPR23(\thread)
50 sdc1 $f25, THREAD_FPR25(\thread)
51 sdc1 $f27, THREAD_FPR27(\thread)
52 sdc1 $f29, THREAD_FPR29(\thread)
53 sdc1 $f31, THREAD_FPR31(\thread)
54 .endm
55
56 .macro fpu_save_double thread status tmp
57 sll \tmp, \status, 5
58 bgez \tmp, 2f
59 fpu_save_16odd \thread
602:
61 fpu_save_16even \thread \tmp
62 .endm
63
64 .macro fpu_restore_16even thread tmp=t0
65 lw \tmp, THREAD_FCR31(\thread)
66 ldc1 $f0, THREAD_FPR0(\thread)
67 ldc1 $f2, THREAD_FPR2(\thread)
68 ldc1 $f4, THREAD_FPR4(\thread)
69 ldc1 $f6, THREAD_FPR6(\thread)
70 ldc1 $f8, THREAD_FPR8(\thread)
71 ldc1 $f10, THREAD_FPR10(\thread)
72 ldc1 $f12, THREAD_FPR12(\thread)
73 ldc1 $f14, THREAD_FPR14(\thread)
74 ldc1 $f16, THREAD_FPR16(\thread)
75 ldc1 $f18, THREAD_FPR18(\thread)
76 ldc1 $f20, THREAD_FPR20(\thread)
77 ldc1 $f22, THREAD_FPR22(\thread)
78 ldc1 $f24, THREAD_FPR24(\thread)
79 ldc1 $f26, THREAD_FPR26(\thread)
80 ldc1 $f28, THREAD_FPR28(\thread)
81 ldc1 $f30, THREAD_FPR30(\thread)
82 ctc1 \tmp, fcr31
83 .endm
84
85 .macro fpu_restore_16odd thread
86 ldc1 $f1, THREAD_FPR1(\thread)
87 ldc1 $f3, THREAD_FPR3(\thread)
88 ldc1 $f5, THREAD_FPR5(\thread)
89 ldc1 $f7, THREAD_FPR7(\thread)
90 ldc1 $f9, THREAD_FPR9(\thread)
91 ldc1 $f11, THREAD_FPR11(\thread)
92 ldc1 $f13, THREAD_FPR13(\thread)
93 ldc1 $f15, THREAD_FPR15(\thread)
94 ldc1 $f17, THREAD_FPR17(\thread)
95 ldc1 $f19, THREAD_FPR19(\thread)
96 ldc1 $f21, THREAD_FPR21(\thread)
97 ldc1 $f23, THREAD_FPR23(\thread)
98 ldc1 $f25, THREAD_FPR25(\thread)
99 ldc1 $f27, THREAD_FPR27(\thread)
100 ldc1 $f29, THREAD_FPR29(\thread)
101 ldc1 $f31, THREAD_FPR31(\thread)
102 .endm
103
104 .macro fpu_restore_double thread status tmp
105 sll \tmp, \status, 5
106 bgez \tmp, 1f # 16 register mode?
107
108 fpu_restore_16odd \thread
1091: fpu_restore_16even \thread \tmp
110 .endm
111
112 .macro cpu_save_nonscratch thread
113 LONG_S s0, THREAD_REG16(\thread)
114 LONG_S s1, THREAD_REG17(\thread)
115 LONG_S s2, THREAD_REG18(\thread)
116 LONG_S s3, THREAD_REG19(\thread)
117 LONG_S s4, THREAD_REG20(\thread)
118 LONG_S s5, THREAD_REG21(\thread)
119 LONG_S s6, THREAD_REG22(\thread)
120 LONG_S s7, THREAD_REG23(\thread)
121 LONG_S sp, THREAD_REG29(\thread)
122 LONG_S fp, THREAD_REG30(\thread)
123 .endm
124
125 .macro cpu_restore_nonscratch thread
126 LONG_L s0, THREAD_REG16(\thread)
127 LONG_L s1, THREAD_REG17(\thread)
128 LONG_L s2, THREAD_REG18(\thread)
129 LONG_L s3, THREAD_REG19(\thread)
130 LONG_L s4, THREAD_REG20(\thread)
131 LONG_L s5, THREAD_REG21(\thread)
132 LONG_L s6, THREAD_REG22(\thread)
133 LONG_L s7, THREAD_REG23(\thread)
134 LONG_L sp, THREAD_REG29(\thread)
135 LONG_L fp, THREAD_REG30(\thread)
136 LONG_L ra, THREAD_REG31(\thread)
137 .endm
138
139#endif /* _ASM_ASMMACRO_64_H */
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h
deleted file mode 100644
index 7a881755800f..000000000000
--- a/include/asm-mips/asmmacro.h
+++ /dev/null
@@ -1,82 +0,0 @@
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 * Copyright (C) 2003 Ralf Baechle
7 */
8#ifndef _ASM_ASMMACRO_H
9#define _ASM_ASMMACRO_H
10
11#include <asm/hazards.h>
12
13#ifdef CONFIG_32BIT
14#include <asm/asmmacro-32.h>
15#endif
16#ifdef CONFIG_64BIT
17#include <asm/asmmacro-64.h>
18#endif
19#ifdef CONFIG_MIPS_MT_SMTC
20#include <asm/mipsmtregs.h>
21#endif
22
23#ifdef CONFIG_MIPS_MT_SMTC
24 .macro local_irq_enable reg=t0
25 mfc0 \reg, CP0_TCSTATUS
26 ori \reg, \reg, TCSTATUS_IXMT
27 xori \reg, \reg, TCSTATUS_IXMT
28 mtc0 \reg, CP0_TCSTATUS
29 _ehb
30 .endm
31
32 .macro local_irq_disable reg=t0
33 mfc0 \reg, CP0_TCSTATUS
34 ori \reg, \reg, TCSTATUS_IXMT
35 mtc0 \reg, CP0_TCSTATUS
36 _ehb
37 .endm
38#else
39 .macro local_irq_enable reg=t0
40 mfc0 \reg, CP0_STATUS
41 ori \reg, \reg, 1
42 mtc0 \reg, CP0_STATUS
43 irq_enable_hazard
44 .endm
45
46 .macro local_irq_disable reg=t0
47 mfc0 \reg, CP0_STATUS
48 ori \reg, \reg, 1
49 xori \reg, \reg, 1
50 mtc0 \reg, CP0_STATUS
51 irq_disable_hazard
52 .endm
53#endif /* CONFIG_MIPS_MT_SMTC */
54
55/*
56 * Temporary until all gas have MT ASE support
57 */
58 .macro DMT reg=0
59 .word 0x41600bc1 | (\reg << 16)
60 .endm
61
62 .macro EMT reg=0
63 .word 0x41600be1 | (\reg << 16)
64 .endm
65
66 .macro DVPE reg=0
67 .word 0x41600001 | (\reg << 16)
68 .endm
69
70 .macro EVPE reg=0
71 .word 0x41600021 | (\reg << 16)
72 .endm
73
74 .macro MFTR rt=0, rd=0, u=0, sel=0
75 .word 0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
76 .endm
77
78 .macro MTTR rt=0, rd=0, u=0, sel=0
79 .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
80 .endm
81
82#endif /* _ASM_ASMMACRO_H */
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
deleted file mode 100644
index 1232be3885b0..000000000000
--- a/include/asm-mips/atomic.h
+++ /dev/null
@@ -1,801 +0,0 @@
1/*
2 * Atomic operations that C can't guarantee us. Useful for
3 * resource counting etc..
4 *
5 * But use these as seldom as possible since they are much more slower
6 * than regular operations.
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 * Copyright (C) 1996, 97, 99, 2000, 03, 04, 06 by Ralf Baechle
13 */
14#ifndef _ASM_ATOMIC_H
15#define _ASM_ATOMIC_H
16
17#include <linux/irqflags.h>
18#include <asm/barrier.h>
19#include <asm/cpu-features.h>
20#include <asm/war.h>
21#include <asm/system.h>
22
23typedef struct { volatile int counter; } atomic_t;
24
25#define ATOMIC_INIT(i) { (i) }
26
27/*
28 * atomic_read - read atomic variable
29 * @v: pointer of type atomic_t
30 *
31 * Atomically reads the value of @v.
32 */
33#define atomic_read(v) ((v)->counter)
34
35/*
36 * atomic_set - set atomic variable
37 * @v: pointer of type atomic_t
38 * @i: required value
39 *
40 * Atomically sets the value of @v to @i.
41 */
42#define atomic_set(v, i) ((v)->counter = (i))
43
44/*
45 * atomic_add - add integer to atomic variable
46 * @i: integer value to add
47 * @v: pointer of type atomic_t
48 *
49 * Atomically adds @i to @v.
50 */
51static __inline__ void atomic_add(int i, atomic_t * v)
52{
53 if (cpu_has_llsc && R10000_LLSC_WAR) {
54 unsigned long temp;
55
56 __asm__ __volatile__(
57 " .set mips3 \n"
58 "1: ll %0, %1 # atomic_add \n"
59 " addu %0, %2 \n"
60 " sc %0, %1 \n"
61 " beqzl %0, 1b \n"
62 " .set mips0 \n"
63 : "=&r" (temp), "=m" (v->counter)
64 : "Ir" (i), "m" (v->counter));
65 } else if (cpu_has_llsc) {
66 unsigned long temp;
67
68 __asm__ __volatile__(
69 " .set mips3 \n"
70 "1: ll %0, %1 # atomic_add \n"
71 " addu %0, %2 \n"
72 " sc %0, %1 \n"
73 " beqz %0, 2f \n"
74 " .subsection 2 \n"
75 "2: b 1b \n"
76 " .previous \n"
77 " .set mips0 \n"
78 : "=&r" (temp), "=m" (v->counter)
79 : "Ir" (i), "m" (v->counter));
80 } else {
81 unsigned long flags;
82
83 raw_local_irq_save(flags);
84 v->counter += i;
85 raw_local_irq_restore(flags);
86 }
87}
88
89/*
90 * atomic_sub - subtract the atomic variable
91 * @i: integer value to subtract
92 * @v: pointer of type atomic_t
93 *
94 * Atomically subtracts @i from @v.
95 */
96static __inline__ void atomic_sub(int i, atomic_t * v)
97{
98 if (cpu_has_llsc && R10000_LLSC_WAR) {
99 unsigned long temp;
100
101 __asm__ __volatile__(
102 " .set mips3 \n"
103 "1: ll %0, %1 # atomic_sub \n"
104 " subu %0, %2 \n"
105 " sc %0, %1 \n"
106 " beqzl %0, 1b \n"
107 " .set mips0 \n"
108 : "=&r" (temp), "=m" (v->counter)
109 : "Ir" (i), "m" (v->counter));
110 } else if (cpu_has_llsc) {
111 unsigned long temp;
112
113 __asm__ __volatile__(
114 " .set mips3 \n"
115 "1: ll %0, %1 # atomic_sub \n"
116 " subu %0, %2 \n"
117 " sc %0, %1 \n"
118 " beqz %0, 2f \n"
119 " .subsection 2 \n"
120 "2: b 1b \n"
121 " .previous \n"
122 " .set mips0 \n"
123 : "=&r" (temp), "=m" (v->counter)
124 : "Ir" (i), "m" (v->counter));
125 } else {
126 unsigned long flags;
127
128 raw_local_irq_save(flags);
129 v->counter -= i;
130 raw_local_irq_restore(flags);
131 }
132}
133
134/*
135 * Same as above, but return the result value
136 */
137static __inline__ int atomic_add_return(int i, atomic_t * v)
138{
139 unsigned long result;
140
141 smp_llsc_mb();
142
143 if (cpu_has_llsc && R10000_LLSC_WAR) {
144 unsigned long temp;
145
146 __asm__ __volatile__(
147 " .set mips3 \n"
148 "1: ll %1, %2 # atomic_add_return \n"
149 " addu %0, %1, %3 \n"
150 " sc %0, %2 \n"
151 " beqzl %0, 1b \n"
152 " addu %0, %1, %3 \n"
153 " .set mips0 \n"
154 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
155 : "Ir" (i), "m" (v->counter)
156 : "memory");
157 } else if (cpu_has_llsc) {
158 unsigned long temp;
159
160 __asm__ __volatile__(
161 " .set mips3 \n"
162 "1: ll %1, %2 # atomic_add_return \n"
163 " addu %0, %1, %3 \n"
164 " sc %0, %2 \n"
165 " beqz %0, 2f \n"
166 " addu %0, %1, %3 \n"
167 " .subsection 2 \n"
168 "2: b 1b \n"
169 " .previous \n"
170 " .set mips0 \n"
171 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
172 : "Ir" (i), "m" (v->counter)
173 : "memory");
174 } else {
175 unsigned long flags;
176
177 raw_local_irq_save(flags);
178 result = v->counter;
179 result += i;
180 v->counter = result;
181 raw_local_irq_restore(flags);
182 }
183
184 smp_llsc_mb();
185
186 return result;
187}
188
189static __inline__ int atomic_sub_return(int i, atomic_t * v)
190{
191 unsigned long result;
192
193 smp_llsc_mb();
194
195 if (cpu_has_llsc && R10000_LLSC_WAR) {
196 unsigned long temp;
197
198 __asm__ __volatile__(
199 " .set mips3 \n"
200 "1: ll %1, %2 # atomic_sub_return \n"
201 " subu %0, %1, %3 \n"
202 " sc %0, %2 \n"
203 " beqzl %0, 1b \n"
204 " subu %0, %1, %3 \n"
205 " .set mips0 \n"
206 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
207 : "Ir" (i), "m" (v->counter)
208 : "memory");
209 } else if (cpu_has_llsc) {
210 unsigned long temp;
211
212 __asm__ __volatile__(
213 " .set mips3 \n"
214 "1: ll %1, %2 # atomic_sub_return \n"
215 " subu %0, %1, %3 \n"
216 " sc %0, %2 \n"
217 " beqz %0, 2f \n"
218 " subu %0, %1, %3 \n"
219 " .subsection 2 \n"
220 "2: b 1b \n"
221 " .previous \n"
222 " .set mips0 \n"
223 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
224 : "Ir" (i), "m" (v->counter)
225 : "memory");
226 } else {
227 unsigned long flags;
228
229 raw_local_irq_save(flags);
230 result = v->counter;
231 result -= i;
232 v->counter = result;
233 raw_local_irq_restore(flags);
234 }
235
236 smp_llsc_mb();
237
238 return result;
239}
240
241/*
242 * atomic_sub_if_positive - conditionally subtract integer from atomic variable
243 * @i: integer value to subtract
244 * @v: pointer of type atomic_t
245 *
246 * Atomically test @v and subtract @i if @v is greater or equal than @i.
247 * The function returns the old value of @v minus @i.
248 */
249static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
250{
251 unsigned long result;
252
253 smp_llsc_mb();
254
255 if (cpu_has_llsc && R10000_LLSC_WAR) {
256 unsigned long temp;
257
258 __asm__ __volatile__(
259 " .set mips3 \n"
260 "1: ll %1, %2 # atomic_sub_if_positive\n"
261 " subu %0, %1, %3 \n"
262 " bltz %0, 1f \n"
263 " sc %0, %2 \n"
264 " .set noreorder \n"
265 " beqzl %0, 1b \n"
266 " subu %0, %1, %3 \n"
267 " .set reorder \n"
268 "1: \n"
269 " .set mips0 \n"
270 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
271 : "Ir" (i), "m" (v->counter)
272 : "memory");
273 } else if (cpu_has_llsc) {
274 unsigned long temp;
275
276 __asm__ __volatile__(
277 " .set mips3 \n"
278 "1: ll %1, %2 # atomic_sub_if_positive\n"
279 " subu %0, %1, %3 \n"
280 " bltz %0, 1f \n"
281 " sc %0, %2 \n"
282 " .set noreorder \n"
283 " beqz %0, 2f \n"
284 " subu %0, %1, %3 \n"
285 " .set reorder \n"
286 " .subsection 2 \n"
287 "2: b 1b \n"
288 " .previous \n"
289 "1: \n"
290 " .set mips0 \n"
291 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
292 : "Ir" (i), "m" (v->counter)
293 : "memory");
294 } else {
295 unsigned long flags;
296
297 raw_local_irq_save(flags);
298 result = v->counter;
299 result -= i;
300 if (result >= 0)
301 v->counter = result;
302 raw_local_irq_restore(flags);
303 }
304
305 smp_llsc_mb();
306
307 return result;
308}
309
310#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
311#define atomic_xchg(v, new) (xchg(&((v)->counter), (new)))
312
313/**
314 * atomic_add_unless - add unless the number is a given value
315 * @v: pointer of type atomic_t
316 * @a: the amount to add to v...
317 * @u: ...unless v is equal to u.
318 *
319 * Atomically adds @a to @v, so long as it was not @u.
320 * Returns non-zero if @v was not @u, and zero otherwise.
321 */
322static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
323{
324 int c, old;
325 c = atomic_read(v);
326 for (;;) {
327 if (unlikely(c == (u)))
328 break;
329 old = atomic_cmpxchg((v), c, c + (a));
330 if (likely(old == c))
331 break;
332 c = old;
333 }
334 return c != (u);
335}
336#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
337
338#define atomic_dec_return(v) atomic_sub_return(1, (v))
339#define atomic_inc_return(v) atomic_add_return(1, (v))
340
341/*
342 * atomic_sub_and_test - subtract value from variable and test result
343 * @i: integer value to subtract
344 * @v: pointer of type atomic_t
345 *
346 * Atomically subtracts @i from @v and returns
347 * true if the result is zero, or false for all
348 * other cases.
349 */
350#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
351
352/*
353 * atomic_inc_and_test - increment and test
354 * @v: pointer of type atomic_t
355 *
356 * Atomically increments @v by 1
357 * and returns true if the result is zero, or false for all
358 * other cases.
359 */
360#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
361
362/*
363 * atomic_dec_and_test - decrement by 1 and test
364 * @v: pointer of type atomic_t
365 *
366 * Atomically decrements @v by 1 and
367 * returns true if the result is 0, or false for all other
368 * cases.
369 */
370#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
371
372/*
373 * atomic_dec_if_positive - decrement by 1 if old value positive
374 * @v: pointer of type atomic_t
375 */
376#define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v)
377
378/*
379 * atomic_inc - increment atomic variable
380 * @v: pointer of type atomic_t
381 *
382 * Atomically increments @v by 1.
383 */
384#define atomic_inc(v) atomic_add(1, (v))
385
386/*
387 * atomic_dec - decrement and test
388 * @v: pointer of type atomic_t
389 *
390 * Atomically decrements @v by 1.
391 */
392#define atomic_dec(v) atomic_sub(1, (v))
393
394/*
395 * atomic_add_negative - add and test if negative
396 * @v: pointer of type atomic_t
397 * @i: integer value to add
398 *
399 * Atomically adds @i to @v and returns true
400 * if the result is negative, or false when
401 * result is greater than or equal to zero.
402 */
403#define atomic_add_negative(i, v) (atomic_add_return(i, (v)) < 0)
404
405#ifdef CONFIG_64BIT
406
407typedef struct { volatile long counter; } atomic64_t;
408
409#define ATOMIC64_INIT(i) { (i) }
410
411/*
412 * atomic64_read - read atomic variable
413 * @v: pointer of type atomic64_t
414 *
415 */
416#define atomic64_read(v) ((v)->counter)
417
418/*
419 * atomic64_set - set atomic variable
420 * @v: pointer of type atomic64_t
421 * @i: required value
422 */
423#define atomic64_set(v, i) ((v)->counter = (i))
424
425/*
426 * atomic64_add - add integer to atomic variable
427 * @i: integer value to add
428 * @v: pointer of type atomic64_t
429 *
430 * Atomically adds @i to @v.
431 */
432static __inline__ void atomic64_add(long i, atomic64_t * v)
433{
434 if (cpu_has_llsc && R10000_LLSC_WAR) {
435 unsigned long temp;
436
437 __asm__ __volatile__(
438 " .set mips3 \n"
439 "1: lld %0, %1 # atomic64_add \n"
440 " addu %0, %2 \n"
441 " scd %0, %1 \n"
442 " beqzl %0, 1b \n"
443 " .set mips0 \n"
444 : "=&r" (temp), "=m" (v->counter)
445 : "Ir" (i), "m" (v->counter));
446 } else if (cpu_has_llsc) {
447 unsigned long temp;
448
449 __asm__ __volatile__(
450 " .set mips3 \n"
451 "1: lld %0, %1 # atomic64_add \n"
452 " addu %0, %2 \n"
453 " scd %0, %1 \n"
454 " beqz %0, 2f \n"
455 " .subsection 2 \n"
456 "2: b 1b \n"
457 " .previous \n"
458 " .set mips0 \n"
459 : "=&r" (temp), "=m" (v->counter)
460 : "Ir" (i), "m" (v->counter));
461 } else {
462 unsigned long flags;
463
464 raw_local_irq_save(flags);
465 v->counter += i;
466 raw_local_irq_restore(flags);
467 }
468}
469
470/*
471 * atomic64_sub - subtract the atomic variable
472 * @i: integer value to subtract
473 * @v: pointer of type atomic64_t
474 *
475 * Atomically subtracts @i from @v.
476 */
477static __inline__ void atomic64_sub(long i, atomic64_t * v)
478{
479 if (cpu_has_llsc && R10000_LLSC_WAR) {
480 unsigned long temp;
481
482 __asm__ __volatile__(
483 " .set mips3 \n"
484 "1: lld %0, %1 # atomic64_sub \n"
485 " subu %0, %2 \n"
486 " scd %0, %1 \n"
487 " beqzl %0, 1b \n"
488 " .set mips0 \n"
489 : "=&r" (temp), "=m" (v->counter)
490 : "Ir" (i), "m" (v->counter));
491 } else if (cpu_has_llsc) {
492 unsigned long temp;
493
494 __asm__ __volatile__(
495 " .set mips3 \n"
496 "1: lld %0, %1 # atomic64_sub \n"
497 " subu %0, %2 \n"
498 " scd %0, %1 \n"
499 " beqz %0, 2f \n"
500 " .subsection 2 \n"
501 "2: b 1b \n"
502 " .previous \n"
503 " .set mips0 \n"
504 : "=&r" (temp), "=m" (v->counter)
505 : "Ir" (i), "m" (v->counter));
506 } else {
507 unsigned long flags;
508
509 raw_local_irq_save(flags);
510 v->counter -= i;
511 raw_local_irq_restore(flags);
512 }
513}
514
515/*
516 * Same as above, but return the result value
517 */
518static __inline__ long atomic64_add_return(long i, atomic64_t * v)
519{
520 unsigned long result;
521
522 smp_llsc_mb();
523
524 if (cpu_has_llsc && R10000_LLSC_WAR) {
525 unsigned long temp;
526
527 __asm__ __volatile__(
528 " .set mips3 \n"
529 "1: lld %1, %2 # atomic64_add_return \n"
530 " addu %0, %1, %3 \n"
531 " scd %0, %2 \n"
532 " beqzl %0, 1b \n"
533 " addu %0, %1, %3 \n"
534 " .set mips0 \n"
535 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
536 : "Ir" (i), "m" (v->counter)
537 : "memory");
538 } else if (cpu_has_llsc) {
539 unsigned long temp;
540
541 __asm__ __volatile__(
542 " .set mips3 \n"
543 "1: lld %1, %2 # atomic64_add_return \n"
544 " addu %0, %1, %3 \n"
545 " scd %0, %2 \n"
546 " beqz %0, 2f \n"
547 " addu %0, %1, %3 \n"
548 " .subsection 2 \n"
549 "2: b 1b \n"
550 " .previous \n"
551 " .set mips0 \n"
552 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
553 : "Ir" (i), "m" (v->counter)
554 : "memory");
555 } else {
556 unsigned long flags;
557
558 raw_local_irq_save(flags);
559 result = v->counter;
560 result += i;
561 v->counter = result;
562 raw_local_irq_restore(flags);
563 }
564
565 smp_llsc_mb();
566
567 return result;
568}
569
570static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
571{
572 unsigned long result;
573
574 smp_llsc_mb();
575
576 if (cpu_has_llsc && R10000_LLSC_WAR) {
577 unsigned long temp;
578
579 __asm__ __volatile__(
580 " .set mips3 \n"
581 "1: lld %1, %2 # atomic64_sub_return \n"
582 " subu %0, %1, %3 \n"
583 " scd %0, %2 \n"
584 " beqzl %0, 1b \n"
585 " subu %0, %1, %3 \n"
586 " .set mips0 \n"
587 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
588 : "Ir" (i), "m" (v->counter)
589 : "memory");
590 } else if (cpu_has_llsc) {
591 unsigned long temp;
592
593 __asm__ __volatile__(
594 " .set mips3 \n"
595 "1: lld %1, %2 # atomic64_sub_return \n"
596 " subu %0, %1, %3 \n"
597 " scd %0, %2 \n"
598 " beqz %0, 2f \n"
599 " subu %0, %1, %3 \n"
600 " .subsection 2 \n"
601 "2: b 1b \n"
602 " .previous \n"
603 " .set mips0 \n"
604 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
605 : "Ir" (i), "m" (v->counter)
606 : "memory");
607 } else {
608 unsigned long flags;
609
610 raw_local_irq_save(flags);
611 result = v->counter;
612 result -= i;
613 v->counter = result;
614 raw_local_irq_restore(flags);
615 }
616
617 smp_llsc_mb();
618
619 return result;
620}
621
622/*
623 * atomic64_sub_if_positive - conditionally subtract integer from atomic variable
624 * @i: integer value to subtract
625 * @v: pointer of type atomic64_t
626 *
627 * Atomically test @v and subtract @i if @v is greater or equal than @i.
628 * The function returns the old value of @v minus @i.
629 */
630static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
631{
632 unsigned long result;
633
634 smp_llsc_mb();
635
636 if (cpu_has_llsc && R10000_LLSC_WAR) {
637 unsigned long temp;
638
639 __asm__ __volatile__(
640 " .set mips3 \n"
641 "1: lld %1, %2 # atomic64_sub_if_positive\n"
642 " dsubu %0, %1, %3 \n"
643 " bltz %0, 1f \n"
644 " scd %0, %2 \n"
645 " .set noreorder \n"
646 " beqzl %0, 1b \n"
647 " dsubu %0, %1, %3 \n"
648 " .set reorder \n"
649 "1: \n"
650 " .set mips0 \n"
651 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
652 : "Ir" (i), "m" (v->counter)
653 : "memory");
654 } else if (cpu_has_llsc) {
655 unsigned long temp;
656
657 __asm__ __volatile__(
658 " .set mips3 \n"
659 "1: lld %1, %2 # atomic64_sub_if_positive\n"
660 " dsubu %0, %1, %3 \n"
661 " bltz %0, 1f \n"
662 " scd %0, %2 \n"
663 " .set noreorder \n"
664 " beqz %0, 2f \n"
665 " dsubu %0, %1, %3 \n"
666 " .set reorder \n"
667 " .subsection 2 \n"
668 "2: b 1b \n"
669 " .previous \n"
670 "1: \n"
671 " .set mips0 \n"
672 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
673 : "Ir" (i), "m" (v->counter)
674 : "memory");
675 } else {
676 unsigned long flags;
677
678 raw_local_irq_save(flags);
679 result = v->counter;
680 result -= i;
681 if (result >= 0)
682 v->counter = result;
683 raw_local_irq_restore(flags);
684 }
685
686 smp_llsc_mb();
687
688 return result;
689}
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
721#define atomic64_dec_return(v) atomic64_sub_return(1, (v))
722#define atomic64_inc_return(v) atomic64_add_return(1, (v))
723
724/*
725 * atomic64_sub_and_test - subtract value from variable and test result
726 * @i: integer value to subtract
727 * @v: pointer of type atomic64_t
728 *
729 * Atomically subtracts @i from @v and returns
730 * true if the result is zero, or false for all
731 * other cases.
732 */
733#define atomic64_sub_and_test(i, v) (atomic64_sub_return((i), (v)) == 0)
734
735/*
736 * atomic64_inc_and_test - increment and test
737 * @v: pointer of type atomic64_t
738 *
739 * Atomically increments @v by 1
740 * and returns true if the result is zero, or false for all
741 * other cases.
742 */
743#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
744
745/*
746 * atomic64_dec_and_test - decrement by 1 and test
747 * @v: pointer of type atomic64_t
748 *
749 * Atomically decrements @v by 1 and
750 * returns true if the result is 0, or false for all other
751 * cases.
752 */
753#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
754
755/*
756 * atomic64_dec_if_positive - decrement by 1 if old value positive
757 * @v: pointer of type atomic64_t
758 */
759#define atomic64_dec_if_positive(v) atomic64_sub_if_positive(1, v)
760
761/*
762 * atomic64_inc - increment atomic variable
763 * @v: pointer of type atomic64_t
764 *
765 * Atomically increments @v by 1.
766 */
767#define atomic64_inc(v) atomic64_add(1, (v))
768
769/*
770 * atomic64_dec - decrement and test
771 * @v: pointer of type atomic64_t
772 *
773 * Atomically decrements @v by 1.
774 */
775#define atomic64_dec(v) atomic64_sub(1, (v))
776
777/*
778 * atomic64_add_negative - add and test if negative
779 * @v: pointer of type atomic64_t
780 * @i: integer value to add
781 *
782 * Atomically adds @i to @v and returns true
783 * if the result is negative, or false when
784 * result is greater than or equal to zero.
785 */
786#define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0)
787
788#endif /* CONFIG_64BIT */
789
790/*
791 * atomic*_return operations are serializing but not the non-*_return
792 * versions.
793 */
794#define smp_mb__before_atomic_dec() smp_llsc_mb()
795#define smp_mb__after_atomic_dec() smp_llsc_mb()
796#define smp_mb__before_atomic_inc() smp_llsc_mb()
797#define smp_mb__after_atomic_inc() smp_llsc_mb()
798
799#include <asm-generic/atomic.h>
800
801#endif /* _ASM_ATOMIC_H */
diff --git a/include/asm-mips/auxvec.h b/include/asm-mips/auxvec.h
deleted file mode 100644
index 7cf7f2d21943..000000000000
--- a/include/asm-mips/auxvec.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef _ASM_AUXVEC_H
2#define _ASM_AUXVEC_H
3
4#endif /* _ASM_AUXVEC_H */
diff --git a/include/asm-mips/barrier.h b/include/asm-mips/barrier.h
deleted file mode 100644
index 8e9ac313ca3b..000000000000
--- a/include/asm-mips/barrier.h
+++ /dev/null
@@ -1,155 +0,0 @@
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 * Copyright (C) 2006 by Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_BARRIER_H
9#define __ASM_BARRIER_H
10
11/*
12 * read_barrier_depends - Flush all pending reads that subsequents reads
13 * depend on.
14 *
15 * No data-dependent reads from memory-like regions are ever reordered
16 * over this barrier. All reads preceding this primitive are guaranteed
17 * to access memory (but not necessarily other CPUs' caches) before any
18 * reads following this primitive that depend on the data return by
19 * any of the preceding reads. This primitive is much lighter weight than
20 * rmb() on most CPUs, and is never heavier weight than is
21 * rmb().
22 *
23 * These ordering constraints are respected by both the local CPU
24 * and the compiler.
25 *
26 * Ordering is not guaranteed by anything other than these primitives,
27 * not even by data dependencies. See the documentation for
28 * memory_barrier() for examples and URLs to more information.
29 *
30 * For example, the following code would force ordering (the initial
31 * value of "a" is zero, "b" is one, and "p" is "&a"):
32 *
33 * <programlisting>
34 * CPU 0 CPU 1
35 *
36 * b = 2;
37 * memory_barrier();
38 * p = &b; q = p;
39 * read_barrier_depends();
40 * d = *q;
41 * </programlisting>
42 *
43 * because the read of "*q" depends on the read of "p" and these
44 * two reads are separated by a read_barrier_depends(). However,
45 * the following code, with the same initial values for "a" and "b":
46 *
47 * <programlisting>
48 * CPU 0 CPU 1
49 *
50 * a = 2;
51 * memory_barrier();
52 * b = 3; y = b;
53 * read_barrier_depends();
54 * x = a;
55 * </programlisting>
56 *
57 * does not enforce ordering, since there is no data dependency between
58 * the read of "a" and the read of "b". Therefore, on some CPUs, such
59 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
60 * in cases like this where there are no data dependencies.
61 */
62
63#define read_barrier_depends() do { } while(0)
64#define smp_read_barrier_depends() do { } while(0)
65
66#ifdef CONFIG_CPU_HAS_SYNC
67#define __sync() \
68 __asm__ __volatile__( \
69 ".set push\n\t" \
70 ".set noreorder\n\t" \
71 ".set mips2\n\t" \
72 "sync\n\t" \
73 ".set pop" \
74 : /* no output */ \
75 : /* no input */ \
76 : "memory")
77#else
78#define __sync() do { } while(0)
79#endif
80
81#define __fast_iob() \
82 __asm__ __volatile__( \
83 ".set push\n\t" \
84 ".set noreorder\n\t" \
85 "lw $0,%0\n\t" \
86 "nop\n\t" \
87 ".set pop" \
88 : /* no output */ \
89 : "m" (*(int *)CKSEG1) \
90 : "memory")
91
92#define fast_wmb() __sync()
93#define fast_rmb() __sync()
94#define fast_mb() __sync()
95#ifdef CONFIG_SGI_IP28
96#define fast_iob() \
97 __asm__ __volatile__( \
98 ".set push\n\t" \
99 ".set noreorder\n\t" \
100 "lw $0,%0\n\t" \
101 "sync\n\t" \
102 "lw $0,%0\n\t" \
103 ".set pop" \
104 : /* no output */ \
105 : "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \
106 : "memory")
107#else
108#define fast_iob() \
109 do { \
110 __sync(); \
111 __fast_iob(); \
112 } while (0)
113#endif
114
115#ifdef CONFIG_CPU_HAS_WB
116
117#include <asm/wbflush.h>
118
119#define wmb() fast_wmb()
120#define rmb() fast_rmb()
121#define mb() wbflush()
122#define iob() wbflush()
123
124#else /* !CONFIG_CPU_HAS_WB */
125
126#define wmb() fast_wmb()
127#define rmb() fast_rmb()
128#define mb() fast_mb()
129#define iob() fast_iob()
130
131#endif /* !CONFIG_CPU_HAS_WB */
132
133#if defined(CONFIG_WEAK_ORDERING) && defined(CONFIG_SMP)
134#define __WEAK_ORDERING_MB " sync \n"
135#else
136#define __WEAK_ORDERING_MB " \n"
137#endif
138#if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP)
139#define __WEAK_LLSC_MB " sync \n"
140#else
141#define __WEAK_LLSC_MB " \n"
142#endif
143
144#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
145#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
146#define smp_wmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
147
148#define set_mb(var, value) \
149 do { var = value; smp_mb(); } while (0)
150
151#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
152#define smp_llsc_rmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
153#define smp_llsc_wmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
154
155#endif /* __ASM_BARRIER_H */
diff --git a/include/asm-mips/bcache.h b/include/asm-mips/bcache.h
deleted file mode 100644
index 0ba9d6ef76a7..000000000000
--- a/include/asm-mips/bcache.h
+++ /dev/null
@@ -1,60 +0,0 @@
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 * Copyright (c) 1997, 1999 by Ralf Baechle
7 * Copyright (c) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_BCACHE_H
10#define _ASM_BCACHE_H
11
12
13/* Some R4000 / R4400 / R4600 / R5000 machines may have a non-dma-coherent,
14 chipset implemented caches. On machines with other CPUs the CPU does the
15 cache thing itself. */
16struct bcache_ops {
17 void (*bc_enable)(void);
18 void (*bc_disable)(void);
19 void (*bc_wback_inv)(unsigned long page, unsigned long size);
20 void (*bc_inv)(unsigned long page, unsigned long size);
21};
22
23extern void indy_sc_init(void);
24
25#ifdef CONFIG_BOARD_SCACHE
26
27extern struct bcache_ops *bcops;
28
29static inline void bc_enable(void)
30{
31 bcops->bc_enable();
32}
33
34static inline void bc_disable(void)
35{
36 bcops->bc_disable();
37}
38
39static inline void bc_wback_inv(unsigned long page, unsigned long size)
40{
41 bcops->bc_wback_inv(page, size);
42}
43
44static inline void bc_inv(unsigned long page, unsigned long size)
45{
46 bcops->bc_inv(page, size);
47}
48
49#else /* !defined(CONFIG_BOARD_SCACHE) */
50
51/* Not R4000 / R4400 / R4600 / R5000. */
52
53#define bc_enable() do { } while (0)
54#define bc_disable() do { } while (0)
55#define bc_wback_inv(page, size) do { } while (0)
56#define bc_inv(page, size) do { } while (0)
57
58#endif /* !defined(CONFIG_BOARD_SCACHE) */
59
60#endif /* _ASM_BCACHE_H */
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
deleted file mode 100644
index 49df8c4c9d25..000000000000
--- a/include/asm-mips/bitops.h
+++ /dev/null
@@ -1,672 +0,0 @@
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 * Copyright (c) 1994 - 1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (c) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_BITOPS_H
10#define _ASM_BITOPS_H
11
12#ifndef _LINUX_BITOPS_H
13#error only <linux/bitops.h> can be included directly
14#endif
15
16#include <linux/compiler.h>
17#include <linux/irqflags.h>
18#include <linux/types.h>
19#include <asm/barrier.h>
20#include <asm/bug.h>
21#include <asm/byteorder.h> /* sigh ... */
22#include <asm/cpu-features.h>
23#include <asm/sgidefs.h>
24#include <asm/war.h>
25
26#if _MIPS_SZLONG == 32
27#define SZLONG_LOG 5
28#define SZLONG_MASK 31UL
29#define __LL "ll "
30#define __SC "sc "
31#define __INS "ins "
32#define __EXT "ext "
33#elif _MIPS_SZLONG == 64
34#define SZLONG_LOG 6
35#define SZLONG_MASK 63UL
36#define __LL "lld "
37#define __SC "scd "
38#define __INS "dins "
39#define __EXT "dext "
40#endif
41
42/*
43 * clear_bit() doesn't provide any barrier for the compiler.
44 */
45#define smp_mb__before_clear_bit() smp_llsc_mb()
46#define smp_mb__after_clear_bit() smp_llsc_mb()
47
48/*
49 * set_bit - Atomically set a bit in memory
50 * @nr: the bit to set
51 * @addr: the address to start counting from
52 *
53 * This function is atomic and may not be reordered. See __set_bit()
54 * if you do not require the atomic guarantees.
55 * Note that @nr may be almost arbitrarily large; this function is not
56 * restricted to acting on a single-word quantity.
57 */
58static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
59{
60 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
61 unsigned short bit = nr & SZLONG_MASK;
62 unsigned long temp;
63
64 if (cpu_has_llsc && R10000_LLSC_WAR) {
65 __asm__ __volatile__(
66 " .set mips3 \n"
67 "1: " __LL "%0, %1 # set_bit \n"
68 " or %0, %2 \n"
69 " " __SC "%0, %1 \n"
70 " beqzl %0, 1b \n"
71 " .set mips0 \n"
72 : "=&r" (temp), "=m" (*m)
73 : "ir" (1UL << bit), "m" (*m));
74#ifdef CONFIG_CPU_MIPSR2
75 } else if (__builtin_constant_p(bit)) {
76 __asm__ __volatile__(
77 "1: " __LL "%0, %1 # set_bit \n"
78 " " __INS "%0, %4, %2, 1 \n"
79 " " __SC "%0, %1 \n"
80 " beqz %0, 2f \n"
81 " .subsection 2 \n"
82 "2: b 1b \n"
83 " .previous \n"
84 : "=&r" (temp), "=m" (*m)
85 : "ir" (bit), "m" (*m), "r" (~0));
86#endif /* CONFIG_CPU_MIPSR2 */
87 } else if (cpu_has_llsc) {
88 __asm__ __volatile__(
89 " .set mips3 \n"
90 "1: " __LL "%0, %1 # set_bit \n"
91 " or %0, %2 \n"
92 " " __SC "%0, %1 \n"
93 " beqz %0, 2f \n"
94 " .subsection 2 \n"
95 "2: b 1b \n"
96 " .previous \n"
97 " .set mips0 \n"
98 : "=&r" (temp), "=m" (*m)
99 : "ir" (1UL << bit), "m" (*m));
100 } else {
101 volatile unsigned long *a = addr;
102 unsigned long mask;
103 unsigned long flags;
104
105 a += nr >> SZLONG_LOG;
106 mask = 1UL << bit;
107 raw_local_irq_save(flags);
108 *a |= mask;
109 raw_local_irq_restore(flags);
110 }
111}
112
113/*
114 * clear_bit - Clears a bit in memory
115 * @nr: Bit to clear
116 * @addr: Address to start counting from
117 *
118 * clear_bit() is atomic and may not be reordered. However, it does
119 * not contain a memory barrier, so if it is used for locking purposes,
120 * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit()
121 * in order to ensure changes are visible on other processors.
122 */
123static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
124{
125 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
126 unsigned short bit = nr & SZLONG_MASK;
127 unsigned long temp;
128
129 if (cpu_has_llsc && R10000_LLSC_WAR) {
130 __asm__ __volatile__(
131 " .set mips3 \n"
132 "1: " __LL "%0, %1 # clear_bit \n"
133 " and %0, %2 \n"
134 " " __SC "%0, %1 \n"
135 " beqzl %0, 1b \n"
136 " .set mips0 \n"
137 : "=&r" (temp), "=m" (*m)
138 : "ir" (~(1UL << bit)), "m" (*m));
139#ifdef CONFIG_CPU_MIPSR2
140 } else if (__builtin_constant_p(bit)) {
141 __asm__ __volatile__(
142 "1: " __LL "%0, %1 # clear_bit \n"
143 " " __INS "%0, $0, %2, 1 \n"
144 " " __SC "%0, %1 \n"
145 " beqz %0, 2f \n"
146 " .subsection 2 \n"
147 "2: b 1b \n"
148 " .previous \n"
149 : "=&r" (temp), "=m" (*m)
150 : "ir" (bit), "m" (*m));
151#endif /* CONFIG_CPU_MIPSR2 */
152 } else if (cpu_has_llsc) {
153 __asm__ __volatile__(
154 " .set mips3 \n"
155 "1: " __LL "%0, %1 # clear_bit \n"
156 " and %0, %2 \n"
157 " " __SC "%0, %1 \n"
158 " beqz %0, 2f \n"
159 " .subsection 2 \n"
160 "2: b 1b \n"
161 " .previous \n"
162 " .set mips0 \n"
163 : "=&r" (temp), "=m" (*m)
164 : "ir" (~(1UL << bit)), "m" (*m));
165 } else {
166 volatile unsigned long *a = addr;
167 unsigned long mask;
168 unsigned long flags;
169
170 a += nr >> SZLONG_LOG;
171 mask = 1UL << bit;
172 raw_local_irq_save(flags);
173 *a &= ~mask;
174 raw_local_irq_restore(flags);
175 }
176}
177
178/*
179 * clear_bit_unlock - Clears a bit in memory
180 * @nr: Bit to clear
181 * @addr: Address to start counting from
182 *
183 * clear_bit() is atomic and implies release semantics before the memory
184 * operation. It can be used for an unlock.
185 */
186static inline void clear_bit_unlock(unsigned long nr, volatile unsigned long *addr)
187{
188 smp_mb__before_clear_bit();
189 clear_bit(nr, addr);
190}
191
192/*
193 * change_bit - Toggle a bit in memory
194 * @nr: Bit to change
195 * @addr: Address to start counting from
196 *
197 * change_bit() is atomic and may not be reordered.
198 * Note that @nr may be almost arbitrarily large; this function is not
199 * restricted to acting on a single-word quantity.
200 */
201static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
202{
203 unsigned short bit = nr & SZLONG_MASK;
204
205 if (cpu_has_llsc && R10000_LLSC_WAR) {
206 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
207 unsigned long temp;
208
209 __asm__ __volatile__(
210 " .set mips3 \n"
211 "1: " __LL "%0, %1 # change_bit \n"
212 " xor %0, %2 \n"
213 " " __SC "%0, %1 \n"
214 " beqzl %0, 1b \n"
215 " .set mips0 \n"
216 : "=&r" (temp), "=m" (*m)
217 : "ir" (1UL << bit), "m" (*m));
218 } else if (cpu_has_llsc) {
219 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
220 unsigned long temp;
221
222 __asm__ __volatile__(
223 " .set mips3 \n"
224 "1: " __LL "%0, %1 # change_bit \n"
225 " xor %0, %2 \n"
226 " " __SC "%0, %1 \n"
227 " beqz %0, 2f \n"
228 " .subsection 2 \n"
229 "2: b 1b \n"
230 " .previous \n"
231 " .set mips0 \n"
232 : "=&r" (temp), "=m" (*m)
233 : "ir" (1UL << bit), "m" (*m));
234 } else {
235 volatile unsigned long *a = addr;
236 unsigned long mask;
237 unsigned long flags;
238
239 a += nr >> SZLONG_LOG;
240 mask = 1UL << bit;
241 raw_local_irq_save(flags);
242 *a ^= mask;
243 raw_local_irq_restore(flags);
244 }
245}
246
247/*
248 * test_and_set_bit - Set a bit and return its old value
249 * @nr: Bit to set
250 * @addr: Address to count from
251 *
252 * This operation is atomic and cannot be reordered.
253 * It also implies a memory barrier.
254 */
255static inline int test_and_set_bit(unsigned long nr,
256 volatile unsigned long *addr)
257{
258 unsigned short bit = nr & SZLONG_MASK;
259 unsigned long res;
260
261 smp_llsc_mb();
262
263 if (cpu_has_llsc && R10000_LLSC_WAR) {
264 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
265 unsigned long temp;
266
267 __asm__ __volatile__(
268 " .set mips3 \n"
269 "1: " __LL "%0, %1 # test_and_set_bit \n"
270 " or %2, %0, %3 \n"
271 " " __SC "%2, %1 \n"
272 " beqzl %2, 1b \n"
273 " and %2, %0, %3 \n"
274 " .set mips0 \n"
275 : "=&r" (temp), "=m" (*m), "=&r" (res)
276 : "r" (1UL << bit), "m" (*m)
277 : "memory");
278 } else if (cpu_has_llsc) {
279 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
280 unsigned long temp;
281
282 __asm__ __volatile__(
283 " .set push \n"
284 " .set noreorder \n"
285 " .set mips3 \n"
286 "1: " __LL "%0, %1 # test_and_set_bit \n"
287 " or %2, %0, %3 \n"
288 " " __SC "%2, %1 \n"
289 " beqz %2, 2f \n"
290 " and %2, %0, %3 \n"
291 " .subsection 2 \n"
292 "2: b 1b \n"
293 " nop \n"
294 " .previous \n"
295 " .set pop \n"
296 : "=&r" (temp), "=m" (*m), "=&r" (res)
297 : "r" (1UL << bit), "m" (*m)
298 : "memory");
299 } else {
300 volatile unsigned long *a = addr;
301 unsigned long mask;
302 unsigned long flags;
303
304 a += nr >> SZLONG_LOG;
305 mask = 1UL << bit;
306 raw_local_irq_save(flags);
307 res = (mask & *a);
308 *a |= mask;
309 raw_local_irq_restore(flags);
310 }
311
312 smp_llsc_mb();
313
314 return res != 0;
315}
316
317/*
318 * test_and_set_bit_lock - Set a bit and return its old value
319 * @nr: Bit to set
320 * @addr: Address to count from
321 *
322 * This operation is atomic and implies acquire ordering semantics
323 * after the memory operation.
324 */
325static inline int test_and_set_bit_lock(unsigned long nr,
326 volatile unsigned long *addr)
327{
328 unsigned short bit = nr & SZLONG_MASK;
329 unsigned long res;
330
331 if (cpu_has_llsc && R10000_LLSC_WAR) {
332 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
333 unsigned long temp;
334
335 __asm__ __volatile__(
336 " .set mips3 \n"
337 "1: " __LL "%0, %1 # test_and_set_bit \n"
338 " or %2, %0, %3 \n"
339 " " __SC "%2, %1 \n"
340 " beqzl %2, 1b \n"
341 " and %2, %0, %3 \n"
342 " .set mips0 \n"
343 : "=&r" (temp), "=m" (*m), "=&r" (res)
344 : "r" (1UL << bit), "m" (*m)
345 : "memory");
346 } else if (cpu_has_llsc) {
347 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
348 unsigned long temp;
349
350 __asm__ __volatile__(
351 " .set push \n"
352 " .set noreorder \n"
353 " .set mips3 \n"
354 "1: " __LL "%0, %1 # test_and_set_bit \n"
355 " or %2, %0, %3 \n"
356 " " __SC "%2, %1 \n"
357 " beqz %2, 2f \n"
358 " and %2, %0, %3 \n"
359 " .subsection 2 \n"
360 "2: b 1b \n"
361 " nop \n"
362 " .previous \n"
363 " .set pop \n"
364 : "=&r" (temp), "=m" (*m), "=&r" (res)
365 : "r" (1UL << bit), "m" (*m)
366 : "memory");
367 } else {
368 volatile unsigned long *a = addr;
369 unsigned long mask;
370 unsigned long flags;
371
372 a += nr >> SZLONG_LOG;
373 mask = 1UL << bit;
374 raw_local_irq_save(flags);
375 res = (mask & *a);
376 *a |= mask;
377 raw_local_irq_restore(flags);
378 }
379
380 smp_llsc_mb();
381
382 return res != 0;
383}
384/*
385 * test_and_clear_bit - Clear a bit and return its old value
386 * @nr: Bit to clear
387 * @addr: Address to count from
388 *
389 * This operation is atomic and cannot be reordered.
390 * It also implies a memory barrier.
391 */
392static inline int test_and_clear_bit(unsigned long nr,
393 volatile unsigned long *addr)
394{
395 unsigned short bit = nr & SZLONG_MASK;
396 unsigned long res;
397
398 smp_llsc_mb();
399
400 if (cpu_has_llsc && R10000_LLSC_WAR) {
401 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
402 unsigned long temp;
403
404 __asm__ __volatile__(
405 " .set mips3 \n"
406 "1: " __LL "%0, %1 # test_and_clear_bit \n"
407 " or %2, %0, %3 \n"
408 " xor %2, %3 \n"
409 " " __SC "%2, %1 \n"
410 " beqzl %2, 1b \n"
411 " and %2, %0, %3 \n"
412 " .set mips0 \n"
413 : "=&r" (temp), "=m" (*m), "=&r" (res)
414 : "r" (1UL << bit), "m" (*m)
415 : "memory");
416#ifdef CONFIG_CPU_MIPSR2
417 } else if (__builtin_constant_p(nr)) {
418 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
419 unsigned long temp;
420
421 __asm__ __volatile__(
422 "1: " __LL "%0, %1 # test_and_clear_bit \n"
423 " " __EXT "%2, %0, %3, 1 \n"
424 " " __INS "%0, $0, %3, 1 \n"
425 " " __SC "%0, %1 \n"
426 " beqz %0, 2f \n"
427 " .subsection 2 \n"
428 "2: b 1b \n"
429 " .previous \n"
430 : "=&r" (temp), "=m" (*m), "=&r" (res)
431 : "ir" (bit), "m" (*m)
432 : "memory");
433#endif
434 } else if (cpu_has_llsc) {
435 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
436 unsigned long temp;
437
438 __asm__ __volatile__(
439 " .set push \n"
440 " .set noreorder \n"
441 " .set mips3 \n"
442 "1: " __LL "%0, %1 # test_and_clear_bit \n"
443 " or %2, %0, %3 \n"
444 " xor %2, %3 \n"
445 " " __SC "%2, %1 \n"
446 " beqz %2, 2f \n"
447 " and %2, %0, %3 \n"
448 " .subsection 2 \n"
449 "2: b 1b \n"
450 " nop \n"
451 " .previous \n"
452 " .set pop \n"
453 : "=&r" (temp), "=m" (*m), "=&r" (res)
454 : "r" (1UL << bit), "m" (*m)
455 : "memory");
456 } else {
457 volatile unsigned long *a = addr;
458 unsigned long mask;
459 unsigned long flags;
460
461 a += nr >> SZLONG_LOG;
462 mask = 1UL << bit;
463 raw_local_irq_save(flags);
464 res = (mask & *a);
465 *a &= ~mask;
466 raw_local_irq_restore(flags);
467 }
468
469 smp_llsc_mb();
470
471 return res != 0;
472}
473
474/*
475 * test_and_change_bit - Change a bit and return its old value
476 * @nr: Bit to change
477 * @addr: Address to count from
478 *
479 * This operation is atomic and cannot be reordered.
480 * It also implies a memory barrier.
481 */
482static inline int test_and_change_bit(unsigned long nr,
483 volatile unsigned long *addr)
484{
485 unsigned short bit = nr & SZLONG_MASK;
486 unsigned long res;
487
488 smp_llsc_mb();
489
490 if (cpu_has_llsc && R10000_LLSC_WAR) {
491 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
492 unsigned long temp;
493
494 __asm__ __volatile__(
495 " .set mips3 \n"
496 "1: " __LL "%0, %1 # test_and_change_bit \n"
497 " xor %2, %0, %3 \n"
498 " " __SC "%2, %1 \n"
499 " beqzl %2, 1b \n"
500 " and %2, %0, %3 \n"
501 " .set mips0 \n"
502 : "=&r" (temp), "=m" (*m), "=&r" (res)
503 : "r" (1UL << bit), "m" (*m)
504 : "memory");
505 } else if (cpu_has_llsc) {
506 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
507 unsigned long temp;
508
509 __asm__ __volatile__(
510 " .set push \n"
511 " .set noreorder \n"
512 " .set mips3 \n"
513 "1: " __LL "%0, %1 # test_and_change_bit \n"
514 " xor %2, %0, %3 \n"
515 " " __SC "\t%2, %1 \n"
516 " beqz %2, 2f \n"
517 " and %2, %0, %3 \n"
518 " .subsection 2 \n"
519 "2: b 1b \n"
520 " nop \n"
521 " .previous \n"
522 " .set pop \n"
523 : "=&r" (temp), "=m" (*m), "=&r" (res)
524 : "r" (1UL << bit), "m" (*m)
525 : "memory");
526 } else {
527 volatile unsigned long *a = addr;
528 unsigned long mask;
529 unsigned long flags;
530
531 a += nr >> SZLONG_LOG;
532 mask = 1UL << bit;
533 raw_local_irq_save(flags);
534 res = (mask & *a);
535 *a ^= mask;
536 raw_local_irq_restore(flags);
537 }
538
539 smp_llsc_mb();
540
541 return res != 0;
542}
543
544#include <asm-generic/bitops/non-atomic.h>
545
546/*
547 * __clear_bit_unlock - Clears a bit in memory
548 * @nr: Bit to clear
549 * @addr: Address to start counting from
550 *
551 * __clear_bit() is non-atomic and implies release semantics before the memory
552 * operation. It can be used for an unlock if no other CPUs can concurrently
553 * modify other bits in the word.
554 */
555static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *addr)
556{
557 smp_mb();
558 __clear_bit(nr, addr);
559}
560
561#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
562
563/*
564 * Return the bit position (0..63) of the most significant 1 bit in a word
565 * Returns -1 if no 1 bit exists
566 */
567static inline unsigned long __fls(unsigned long x)
568{
569 int lz;
570
571 if (sizeof(x) == 4) {
572 __asm__(
573 " .set push \n"
574 " .set mips32 \n"
575 " clz %0, %1 \n"
576 " .set pop \n"
577 : "=r" (lz)
578 : "r" (x));
579
580 return 31 - lz;
581 }
582
583 BUG_ON(sizeof(x) != 8);
584
585 __asm__(
586 " .set push \n"
587 " .set mips64 \n"
588 " dclz %0, %1 \n"
589 " .set pop \n"
590 : "=r" (lz)
591 : "r" (x));
592
593 return 63 - lz;
594}
595
596/*
597 * __ffs - find first bit in word.
598 * @word: The word to search
599 *
600 * Returns 0..SZLONG-1
601 * Undefined if no bit exists, so code should check against 0 first.
602 */
603static inline unsigned long __ffs(unsigned long word)
604{
605 return __fls(word & -word);
606}
607
608/*
609 * fls - find last bit set.
610 * @word: The word to search
611 *
612 * This is defined the same way as ffs.
613 * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
614 */
615static inline int fls(int word)
616{
617 __asm__("clz %0, %1" : "=r" (word) : "r" (word));
618
619 return 32 - word;
620}
621
622#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPS64)
623static inline int fls64(__u64 word)
624{
625 __asm__("dclz %0, %1" : "=r" (word) : "r" (word));
626
627 return 64 - word;
628}
629#else
630#include <asm-generic/bitops/fls64.h>
631#endif
632
633/*
634 * ffs - find first bit set.
635 * @word: The word to search
636 *
637 * This is defined the same way as
638 * the libc and compiler builtin ffs routines, therefore
639 * differs in spirit from the above ffz (man ffs).
640 */
641static inline int ffs(int word)
642{
643 if (!word)
644 return 0;
645
646 return fls(word & -word);
647}
648
649#else
650
651#include <asm-generic/bitops/__ffs.h>
652#include <asm-generic/bitops/__fls.h>
653#include <asm-generic/bitops/ffs.h>
654#include <asm-generic/bitops/fls.h>
655#include <asm-generic/bitops/fls64.h>
656
657#endif /*defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) */
658
659#include <asm-generic/bitops/ffz.h>
660#include <asm-generic/bitops/find.h>
661
662#ifdef __KERNEL__
663
664#include <asm-generic/bitops/sched.h>
665#include <asm-generic/bitops/hweight.h>
666#include <asm-generic/bitops/ext2-non-atomic.h>
667#include <asm-generic/bitops/ext2-atomic.h>
668#include <asm-generic/bitops/minix.h>
669
670#endif /* __KERNEL__ */
671
672#endif /* _ASM_BITOPS_H */
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
deleted file mode 100644
index 610fe3af7a03..000000000000
--- a/include/asm-mips/bootinfo.h
+++ /dev/null
@@ -1,110 +0,0 @@
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 * Copyright (C) 1995, 1996, 2003 by Ralf Baechle
7 * Copyright (C) 1995, 1996 Andreas Busse
8 * Copyright (C) 1995, 1996 Stoned Elipot
9 * Copyright (C) 1995, 1996 Paul M. Antoine.
10 */
11#ifndef _ASM_BOOTINFO_H
12#define _ASM_BOOTINFO_H
13
14#include <linux/types.h>
15#include <asm/setup.h>
16
17/*
18 * The MACH_ IDs are sort of equivalent to PCI product IDs. As such the
19 * numbers do not necessarily reflect technical relations or similarities
20 * between systems.
21 */
22
23/*
24 * Valid machtype values for group unknown
25 */
26#define MACH_UNKNOWN 0 /* whatever... */
27
28/*
29 * Valid machtype for group DEC
30 */
31#define MACH_DSUNKNOWN 0
32#define MACH_DS23100 1 /* DECstation 2100 or 3100 */
33#define MACH_DS5100 2 /* DECsystem 5100 */
34#define MACH_DS5000_200 3 /* DECstation 5000/200 */
35#define MACH_DS5000_1XX 4 /* DECstation 5000/120, 125, 133, 150 */
36#define MACH_DS5000_XX 5 /* DECstation 5000/20, 25, 33, 50 */
37#define MACH_DS5000_2X0 6 /* DECstation 5000/240, 260 */
38#define MACH_DS5400 7 /* DECsystem 5400 */
39#define MACH_DS5500 8 /* DECsystem 5500 */
40#define MACH_DS5800 9 /* DECsystem 5800 */
41#define MACH_DS5900 10 /* DECsystem 5900 */
42
43/*
44 * Valid machtype for group PMC-MSP
45 */
46#define MACH_MSP4200_EVAL 0 /* PMC-Sierra MSP4200 Evaluation */
47#define MACH_MSP4200_GW 1 /* PMC-Sierra MSP4200 Gateway demo */
48#define MACH_MSP4200_FPGA 2 /* PMC-Sierra MSP4200 Emulation */
49#define MACH_MSP7120_EVAL 3 /* PMC-Sierra MSP7120 Evaluation */
50#define MACH_MSP7120_GW 4 /* PMC-Sierra MSP7120 Residential GW */
51#define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */
52#define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */
53
54/*
55 * Valid machtype for group Mikrotik
56 */
57#define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */
58#define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */
59
60#define CL_SIZE COMMAND_LINE_SIZE
61
62extern char *system_type;
63const char *get_system_type(void);
64
65extern unsigned long mips_machtype;
66
67#define BOOT_MEM_MAP_MAX 32
68#define BOOT_MEM_RAM 1
69#define BOOT_MEM_ROM_DATA 2
70#define BOOT_MEM_RESERVED 3
71
72/*
73 * A memory map that's built upon what was determined
74 * or specified on the command line.
75 */
76struct boot_mem_map {
77 int nr_map;
78 struct boot_mem_map_entry {
79 phys_t addr; /* start of memory segment */
80 phys_t size; /* size of memory segment */
81 long type; /* type of memory segment */
82 } map[BOOT_MEM_MAP_MAX];
83};
84
85extern struct boot_mem_map boot_mem_map;
86
87extern void add_memory_region(phys_t start, phys_t size, long type);
88
89extern void prom_init(void);
90extern void prom_free_prom_memory(void);
91
92extern void free_init_pages(const char *what,
93 unsigned long begin, unsigned long end);
94
95/*
96 * Initial kernel command line, usually setup by prom_init()
97 */
98extern char arcs_cmdline[CL_SIZE];
99
100/*
101 * Registers a0, a1, a3 and a4 as passed to the kernel entry by firmware
102 */
103extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
104
105/*
106 * Platform memory detection hook called by setup_arch
107 */
108extern void plat_mem_setup(void);
109
110#endif /* _ASM_BOOTINFO_H */
diff --git a/include/asm-mips/branch.h b/include/asm-mips/branch.h
deleted file mode 100644
index 37c6857c8d4a..000000000000
--- a/include/asm-mips/branch.h
+++ /dev/null
@@ -1,38 +0,0 @@
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 * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
7 */
8#ifndef _ASM_BRANCH_H
9#define _ASM_BRANCH_H
10
11#include <asm/ptrace.h>
12
13static inline int delay_slot(struct pt_regs *regs)
14{
15 return regs->cp0_cause & CAUSEF_BD;
16}
17
18static inline unsigned long exception_epc(struct pt_regs *regs)
19{
20 if (!delay_slot(regs))
21 return regs->cp0_epc;
22
23 return regs->cp0_epc + 4;
24}
25
26extern int __compute_return_epc(struct pt_regs *regs);
27
28static inline int compute_return_epc(struct pt_regs *regs)
29{
30 if (!delay_slot(regs)) {
31 regs->cp0_epc += 4;
32 return 0;
33 }
34
35 return __compute_return_epc(regs);
36}
37
38#endif /* _ASM_BRANCH_H */
diff --git a/include/asm-mips/break.h b/include/asm-mips/break.h
deleted file mode 100644
index 25b980c91e7e..000000000000
--- a/include/asm-mips/break.h
+++ /dev/null
@@ -1,34 +0,0 @@
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 * Copyright (C) 1995, 2003 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef __ASM_BREAK_H
10#define __ASM_BREAK_H
11
12/*
13 * The following break codes are or were in use for specific purposes in
14 * other MIPS operating systems. Linux/MIPS doesn't use all of them. The
15 * unused ones are here as placeholders; we might encounter them in
16 * non-Linux/MIPS object files or make use of them in the future.
17 */
18#define BRK_USERBP 0 /* User bp (used by debuggers) */
19#define BRK_KERNELBP 1 /* Break in the kernel */
20#define BRK_ABORT 2 /* Sometimes used by abort(3) to SIGIOT */
21#define BRK_BD_TAKEN 3 /* For bd slot emulation - not implemented */
22#define BRK_BD_NOTTAKEN 4 /* For bd slot emulation - not implemented */
23#define BRK_SSTEPBP 5 /* User bp (used by debuggers) */
24#define BRK_OVERFLOW 6 /* Overflow check */
25#define BRK_DIVZERO 7 /* Divide by zero check */
26#define BRK_RANGE 8 /* Range error check */
27#define BRK_STACKOVERFLOW 9 /* For Ada stackchecking */
28#define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */
29#define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */
30#define BRK_BUG 512 /* Used by BUG() */
31#define BRK_KDB 513 /* Used in KDB_ENTER() */
32#define BRK_MULOVF 1023 /* Multiply overflow */
33
34#endif /* __ASM_BREAK_H */
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h
deleted file mode 100644
index 7eb63de808bc..000000000000
--- a/include/asm-mips/bug.h
+++ /dev/null
@@ -1,33 +0,0 @@
1#ifndef __ASM_BUG_H
2#define __ASM_BUG_H
3
4#include <asm/sgidefs.h>
5
6#ifdef CONFIG_BUG
7
8#include <asm/break.h>
9
10#define BUG() \
11do { \
12 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \
13} while (0)
14
15#define HAVE_ARCH_BUG
16
17#if (_MIPS_ISA > _MIPS_ISA_MIPS1)
18
19#define BUG_ON(condition) \
20do { \
21 __asm__ __volatile__("tne $0, %0, %1" \
22 : : "r" (condition), "i" (BRK_BUG)); \
23} while (0)
24
25#define HAVE_ARCH_BUG_ON
26
27#endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
28
29#endif
30
31#include <asm-generic/bug.h>
32
33#endif /* __ASM_BUG_H */
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h
deleted file mode 100644
index 9dc10df32078..000000000000
--- a/include/asm-mips/bugs.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * This is included by init/main.c to check for architecture-dependent bugs.
3 *
4 * Copyright (C) 2007 Maciej W. Rozycki
5 *
6 * Needs:
7 * void check_bugs(void);
8 */
9#ifndef _ASM_BUGS_H
10#define _ASM_BUGS_H
11
12#include <linux/bug.h>
13#include <linux/delay.h>
14
15#include <asm/cpu.h>
16#include <asm/cpu-info.h>
17
18extern int daddiu_bug;
19
20extern void check_bugs64_early(void);
21
22extern void check_bugs32(void);
23extern void check_bugs64(void);
24
25static inline void check_bugs_early(void)
26{
27#ifdef CONFIG_64BIT
28 check_bugs64_early();
29#endif
30}
31
32static inline void check_bugs(void)
33{
34 unsigned int cpu = smp_processor_id();
35
36 cpu_data[cpu].udelay_val = loops_per_jiffy;
37 check_bugs32();
38#ifdef CONFIG_64BIT
39 check_bugs64();
40#endif
41}
42
43static inline int r4k_daddiu_bug(void)
44{
45#ifdef CONFIG_64BIT
46 WARN_ON(daddiu_bug < 0);
47 return daddiu_bug != 0;
48#else
49 return 0;
50#endif
51}
52
53#endif /* _ASM_BUGS_H */
diff --git a/include/asm-mips/byteorder.h b/include/asm-mips/byteorder.h
deleted file mode 100644
index fe7dc2d59b69..000000000000
--- a/include/asm-mips/byteorder.h
+++ /dev/null
@@ -1,76 +0,0 @@
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 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
7 */
8#ifndef _ASM_BYTEORDER_H
9#define _ASM_BYTEORDER_H
10
11#include <linux/compiler.h>
12#include <asm/types.h>
13
14#ifdef __GNUC__
15
16#ifdef CONFIG_CPU_MIPSR2
17
18static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
19{
20 __asm__(
21 " wsbh %0, %1 \n"
22 : "=r" (x)
23 : "r" (x));
24
25 return x;
26}
27#define __arch__swab16(x) ___arch__swab16(x)
28
29static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
30{
31 __asm__(
32 " wsbh %0, %1 \n"
33 " rotr %0, %0, 16 \n"
34 : "=r" (x)
35 : "r" (x));
36
37 return x;
38}
39#define __arch__swab32(x) ___arch__swab32(x)
40
41#ifdef CONFIG_CPU_MIPS64_R2
42
43static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
44{
45 __asm__(
46 " dsbh %0, %1 \n"
47 " dshd %0, %0 \n"
48 " drotr %0, %0, 32 \n"
49 : "=r" (x)
50 : "r" (x));
51
52 return x;
53}
54
55#define __arch__swab64(x) ___arch__swab64(x)
56
57#endif /* CONFIG_CPU_MIPS64_R2 */
58
59#endif /* CONFIG_CPU_MIPSR2 */
60
61#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
62# define __BYTEORDER_HAS_U64__
63# define __SWAB_64_THRU_32__
64#endif
65
66#endif /* __GNUC__ */
67
68#if defined(__MIPSEB__)
69# include <linux/byteorder/big_endian.h>
70#elif defined(__MIPSEL__)
71# include <linux/byteorder/little_endian.h>
72#else
73# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
74#endif
75
76#endif /* _ASM_BYTEORDER_H */
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h
deleted file mode 100644
index 37f175c42bb5..000000000000
--- a/include/asm-mips/cache.h
+++ /dev/null
@@ -1,20 +0,0 @@
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 * Copyright (C) 1997, 98, 99, 2000, 2003 Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_CACHE_H
10#define _ASM_CACHE_H
11
12#include <kmalloc.h>
13
14#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT
15#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
16
17#define SMP_CACHE_SHIFT L1_CACHE_SHIFT
18#define SMP_CACHE_BYTES L1_CACHE_BYTES
19
20#endif /* _ASM_CACHE_H */
diff --git a/include/asm-mips/cachectl.h b/include/asm-mips/cachectl.h
deleted file mode 100644
index f3ce721861d3..000000000000
--- a/include/asm-mips/cachectl.h
+++ /dev/null
@@ -1,26 +0,0 @@
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 * Copyright (C) 1994, 1995, 1996 by Ralf Baechle
7 */
8#ifndef _ASM_CACHECTL
9#define _ASM_CACHECTL
10
11/*
12 * Options for cacheflush system call
13 */
14#define ICACHE (1<<0) /* flush instruction cache */
15#define DCACHE (1<<1) /* writeback and flush data cache */
16#define BCACHE (ICACHE|DCACHE) /* flush both caches */
17
18/*
19 * Caching modes for the cachectl(2) call
20 *
21 * cachectl(2) is currently not supported and returns ENOSYS.
22 */
23#define CACHEABLE 0 /* make pages cacheable */
24#define UNCACHEABLE 1 /* make pages uncacheable */
25
26#endif /* _ASM_CACHECTL */
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
deleted file mode 100644
index d5c0f2fda51b..000000000000
--- a/include/asm-mips/cacheflush.h
+++ /dev/null
@@ -1,115 +0,0 @@
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 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
7 * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_CACHEFLUSH_H
10#define _ASM_CACHEFLUSH_H
11
12/* Keep includes the same across arches. */
13#include <linux/mm.h>
14#include <asm/cpu-features.h>
15
16/* Cache flushing:
17 *
18 * - flush_cache_all() flushes entire cache
19 * - flush_cache_mm(mm) flushes the specified mm context's cache lines
20 * - flush_cache_dup mm(mm) handles cache flushing when forking
21 * - flush_cache_page(mm, vmaddr, pfn) flushes a single page
22 * - flush_cache_range(vma, start, end) flushes a range of pages
23 * - flush_icache_range(start, end) flush a range of instructions
24 * - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
25 *
26 * MIPS specific flush operations:
27 *
28 * - flush_cache_sigtramp() flush signal trampoline
29 * - flush_icache_all() flush the entire instruction cache
30 * - flush_data_cache_page() flushes a page from the data cache
31 */
32extern void (*flush_cache_all)(void);
33extern void (*__flush_cache_all)(void);
34extern void (*flush_cache_mm)(struct mm_struct *mm);
35#define flush_cache_dup_mm(mm) do { (void) (mm); } while (0)
36extern void (*flush_cache_range)(struct vm_area_struct *vma,
37 unsigned long start, unsigned long end);
38extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
39extern void __flush_dcache_page(struct page *page);
40
41static inline void flush_dcache_page(struct page *page)
42{
43 if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc)
44 __flush_dcache_page(page);
45
46}
47
48#define flush_dcache_mmap_lock(mapping) do { } while (0)
49#define flush_dcache_mmap_unlock(mapping) do { } while (0)
50
51#define ARCH_HAS_FLUSH_ANON_PAGE
52extern void __flush_anon_page(struct page *, unsigned long);
53static inline void flush_anon_page(struct vm_area_struct *vma,
54 struct page *page, unsigned long vmaddr)
55{
56 if (cpu_has_dc_aliases && PageAnon(page))
57 __flush_anon_page(page, vmaddr);
58}
59
60static inline void flush_icache_page(struct vm_area_struct *vma,
61 struct page *page)
62{
63}
64
65extern void (*flush_icache_range)(unsigned long start, unsigned long end);
66
67extern void (*__flush_cache_vmap)(void);
68
69static inline void flush_cache_vmap(unsigned long start, unsigned long end)
70{
71 if (cpu_has_dc_aliases)
72 __flush_cache_vmap();
73}
74
75extern void (*__flush_cache_vunmap)(void);
76
77static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
78{
79 if (cpu_has_dc_aliases)
80 __flush_cache_vunmap();
81}
82
83extern void copy_to_user_page(struct vm_area_struct *vma,
84 struct page *page, unsigned long vaddr, void *dst, const void *src,
85 unsigned long len);
86
87extern void copy_from_user_page(struct vm_area_struct *vma,
88 struct page *page, unsigned long vaddr, void *dst, const void *src,
89 unsigned long len);
90
91extern void (*flush_cache_sigtramp)(unsigned long addr);
92extern void (*flush_icache_all)(void);
93extern void (*local_flush_data_cache_page)(void * addr);
94extern void (*flush_data_cache_page)(unsigned long addr);
95
96/*
97 * This flag is used to indicate that the page pointed to by a pte
98 * is dirty and requires cleaning before returning it to the user.
99 */
100#define PG_dcache_dirty PG_arch_1
101
102#define Page_dcache_dirty(page) \
103 test_bit(PG_dcache_dirty, &(page)->flags)
104#define SetPageDcacheDirty(page) \
105 set_bit(PG_dcache_dirty, &(page)->flags)
106#define ClearPageDcacheDirty(page) \
107 clear_bit(PG_dcache_dirty, &(page)->flags)
108
109/* Run kernel code uncached, useful for cache probing functions. */
110unsigned long run_uncached(void *func);
111
112extern void *kmap_coherent(struct page *page, unsigned long addr);
113extern void kunmap_coherent(void);
114
115#endif /* _ASM_CACHEFLUSH_H */
diff --git a/include/asm-mips/cacheops.h b/include/asm-mips/cacheops.h
deleted file mode 100644
index 256ad2cc6eb8..000000000000
--- a/include/asm-mips/cacheops.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Cache operations for the cache instruction.
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 * (C) Copyright 1996, 97, 99, 2002, 03 Ralf Baechle
9 * (C) Copyright 1999 Silicon Graphics, Inc.
10 */
11#ifndef __ASM_CACHEOPS_H
12#define __ASM_CACHEOPS_H
13
14/*
15 * Cache Operations available on all MIPS processors with R4000-style caches
16 */
17#define Index_Invalidate_I 0x00
18#define Index_Writeback_Inv_D 0x01
19#define Index_Load_Tag_I 0x04
20#define Index_Load_Tag_D 0x05
21#define Index_Store_Tag_I 0x08
22#define Index_Store_Tag_D 0x09
23#if defined(CONFIG_CPU_LOONGSON2)
24#define Hit_Invalidate_I 0x00
25#else
26#define Hit_Invalidate_I 0x10
27#endif
28#define Hit_Invalidate_D 0x11
29#define Hit_Writeback_Inv_D 0x15
30
31/*
32 * R4000-specific cacheops
33 */
34#define Create_Dirty_Excl_D 0x0d
35#define Fill 0x14
36#define Hit_Writeback_I 0x18
37#define Hit_Writeback_D 0x19
38
39/*
40 * R4000SC and R4400SC-specific cacheops
41 */
42#define Index_Invalidate_SI 0x02
43#define Index_Writeback_Inv_SD 0x03
44#define Index_Load_Tag_SI 0x06
45#define Index_Load_Tag_SD 0x07
46#define Index_Store_Tag_SI 0x0A
47#define Index_Store_Tag_SD 0x0B
48#define Create_Dirty_Excl_SD 0x0f
49#define Hit_Invalidate_SI 0x12
50#define Hit_Invalidate_SD 0x13
51#define Hit_Writeback_Inv_SD 0x17
52#define Hit_Writeback_SD 0x1b
53#define Hit_Set_Virtual_SI 0x1e
54#define Hit_Set_Virtual_SD 0x1f
55
56/*
57 * R5000-specific cacheops
58 */
59#define R5K_Page_Invalidate_S 0x17
60
61/*
62 * RM7000-specific cacheops
63 */
64#define Page_Invalidate_T 0x16
65
66/*
67 * R10000-specific cacheops
68 *
69 * Cacheops 0x02, 0x06, 0x0a, 0x0c-0x0e, 0x16, 0x1a and 0x1e are unused.
70 * Most of the _S cacheops are identical to the R4000SC _SD cacheops.
71 */
72#define Index_Writeback_Inv_S 0x03
73#define Index_Load_Tag_S 0x07
74#define Index_Store_Tag_S 0x0B
75#define Hit_Invalidate_S 0x13
76#define Cache_Barrier 0x14
77#define Hit_Writeback_Inv_S 0x17
78#define Index_Load_Data_I 0x18
79#define Index_Load_Data_D 0x19
80#define Index_Load_Data_S 0x1b
81#define Index_Store_Data_I 0x1c
82#define Index_Store_Data_D 0x1d
83#define Index_Store_Data_S 0x1f
84
85#endif /* __ASM_CACHEOPS_H */
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
deleted file mode 100644
index 290485ac5407..000000000000
--- a/include/asm-mips/checksum.h
+++ /dev/null
@@ -1,260 +0,0 @@
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 * Copyright (C) 1995, 96, 97, 98, 99, 2001 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 * Copyright (C) 2001 Thiemo Seufer.
9 * Copyright (C) 2002 Maciej W. Rozycki
10 */
11#ifndef _ASM_CHECKSUM_H
12#define _ASM_CHECKSUM_H
13
14#include <linux/in6.h>
15
16#include <asm/uaccess.h>
17
18/*
19 * computes the checksum of a memory block at buff, length len,
20 * and adds in "sum" (32-bit)
21 *
22 * returns a 32-bit number suitable for feeding into itself
23 * or csum_tcpudp_magic
24 *
25 * this function must be called with even lengths, except
26 * for the last fragment, which may be odd
27 *
28 * it's best to have buff aligned on a 32-bit boundary
29 */
30__wsum csum_partial(const void *buff, int len, __wsum sum);
31
32__wsum __csum_partial_copy_user(const void *src, void *dst,
33 int len, __wsum sum, int *err_ptr);
34
35/*
36 * this is a new version of the above that records errors it finds in *errp,
37 * but continues and zeros the rest of the buffer.
38 */
39static inline
40__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len,
41 __wsum sum, int *err_ptr)
42{
43 might_sleep();
44 return __csum_partial_copy_user((__force void *)src, dst,
45 len, sum, err_ptr);
46}
47
48/*
49 * Copy and checksum to user
50 */
51#define HAVE_CSUM_COPY_USER
52static inline
53__wsum csum_and_copy_to_user(const void *src, void __user *dst, int len,
54 __wsum sum, int *err_ptr)
55{
56 might_sleep();
57 if (access_ok(VERIFY_WRITE, dst, len))
58 return __csum_partial_copy_user(src, (__force void *)dst,
59 len, sum, err_ptr);
60 if (len)
61 *err_ptr = -EFAULT;
62
63 return (__force __wsum)-1; /* invalid checksum */
64}
65
66/*
67 * the same as csum_partial, but copies from user space (but on MIPS
68 * we have just one address space, so this is identical to the above)
69 */
70__wsum csum_partial_copy_nocheck(const void *src, void *dst,
71 int len, __wsum sum);
72
73/*
74 * Fold a partial checksum without adding pseudo headers
75 */
76static inline __sum16 csum_fold(__wsum sum)
77{
78 __asm__(
79 " .set push # csum_fold\n"
80 " .set noat \n"
81 " sll $1, %0, 16 \n"
82 " addu %0, $1 \n"
83 " sltu $1, %0, $1 \n"
84 " srl %0, %0, 16 \n"
85 " addu %0, $1 \n"
86 " xori %0, 0xffff \n"
87 " .set pop"
88 : "=r" (sum)
89 : "0" (sum));
90
91 return (__force __sum16)sum;
92}
93
94/*
95 * This is a version of ip_compute_csum() optimized for IP headers,
96 * which always checksum on 4 octet boundaries.
97 *
98 * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by
99 * Arnt Gulbrandsen.
100 */
101static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
102{
103 const unsigned int *word = iph;
104 const unsigned int *stop = word + ihl;
105 unsigned int csum;
106 int carry;
107
108 csum = word[0];
109 csum += word[1];
110 carry = (csum < word[1]);
111 csum += carry;
112
113 csum += word[2];
114 carry = (csum < word[2]);
115 csum += carry;
116
117 csum += word[3];
118 carry = (csum < word[3]);
119 csum += carry;
120
121 word += 4;
122 do {
123 csum += *word;
124 carry = (csum < *word);
125 csum += carry;
126 word++;
127 } while (word != stop);
128
129 return csum_fold(csum);
130}
131
132static inline __wsum csum_tcpudp_nofold(__be32 saddr,
133 __be32 daddr, unsigned short len, unsigned short proto,
134 __wsum sum)
135{
136 __asm__(
137 " .set push # csum_tcpudp_nofold\n"
138 " .set noat \n"
139#ifdef CONFIG_32BIT
140 " addu %0, %2 \n"
141 " sltu $1, %0, %2 \n"
142 " addu %0, $1 \n"
143
144 " addu %0, %3 \n"
145 " sltu $1, %0, %3 \n"
146 " addu %0, $1 \n"
147
148 " addu %0, %4 \n"
149 " sltu $1, %0, %4 \n"
150 " addu %0, $1 \n"
151#endif
152#ifdef CONFIG_64BIT
153 " daddu %0, %2 \n"
154 " daddu %0, %3 \n"
155 " daddu %0, %4 \n"
156 " dsll32 $1, %0, 0 \n"
157 " daddu %0, $1 \n"
158 " dsra32 %0, %0, 0 \n"
159#endif
160 " .set pop"
161 : "=r" (sum)
162 : "0" ((__force unsigned long)daddr),
163 "r" ((__force unsigned long)saddr),
164#ifdef __MIPSEL__
165 "r" ((proto + len) << 8),
166#else
167 "r" (proto + len),
168#endif
169 "r" ((__force unsigned long)sum));
170
171 return sum;
172}
173
174/*
175 * computes the checksum of the TCP/UDP pseudo-header
176 * returns a 16-bit checksum, already complemented
177 */
178static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
179 unsigned short len,
180 unsigned short proto,
181 __wsum sum)
182{
183 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
184}
185
186/*
187 * this routine is used for miscellaneous IP-like checksums, mainly
188 * in icmp.c
189 */
190static inline __sum16 ip_compute_csum(const void *buff, int len)
191{
192 return csum_fold(csum_partial(buff, len, 0));
193}
194
195#define _HAVE_ARCH_IPV6_CSUM
196static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
197 const struct in6_addr *daddr,
198 __u32 len, unsigned short proto,
199 __wsum sum)
200{
201 __asm__(
202 " .set push # csum_ipv6_magic\n"
203 " .set noreorder \n"
204 " .set noat \n"
205 " addu %0, %5 # proto (long in network byte order)\n"
206 " sltu $1, %0, %5 \n"
207 " addu %0, $1 \n"
208
209 " addu %0, %6 # csum\n"
210 " sltu $1, %0, %6 \n"
211 " lw %1, 0(%2) # four words source address\n"
212 " addu %0, $1 \n"
213 " addu %0, %1 \n"
214 " sltu $1, %0, %1 \n"
215
216 " lw %1, 4(%2) \n"
217 " addu %0, $1 \n"
218 " addu %0, %1 \n"
219 " sltu $1, %0, %1 \n"
220
221 " lw %1, 8(%2) \n"
222 " addu %0, $1 \n"
223 " addu %0, %1 \n"
224 " sltu $1, %0, %1 \n"
225
226 " lw %1, 12(%2) \n"
227 " addu %0, $1 \n"
228 " addu %0, %1 \n"
229 " sltu $1, %0, %1 \n"
230
231 " lw %1, 0(%3) \n"
232 " addu %0, $1 \n"
233 " addu %0, %1 \n"
234 " sltu $1, %0, %1 \n"
235
236 " lw %1, 4(%3) \n"
237 " addu %0, $1 \n"
238 " addu %0, %1 \n"
239 " sltu $1, %0, %1 \n"
240
241 " lw %1, 8(%3) \n"
242 " addu %0, $1 \n"
243 " addu %0, %1 \n"
244 " sltu $1, %0, %1 \n"
245
246 " lw %1, 12(%3) \n"
247 " addu %0, $1 \n"
248 " addu %0, %1 \n"
249 " sltu $1, %0, %1 \n"
250
251 " addu %0, $1 # Add final carry\n"
252 " .set pop"
253 : "=r" (sum), "=r" (proto)
254 : "r" (saddr), "r" (daddr),
255 "0" (htonl(len)), "1" (htonl(proto)), "r" (sum));
256
257 return csum_fold(sum);
258}
259
260#endif /* _ASM_CHECKSUM_H */
diff --git a/include/asm-mips/cmp.h b/include/asm-mips/cmp.h
deleted file mode 100644
index 89a73fb93ae6..000000000000
--- a/include/asm-mips/cmp.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _ASM_CMP_H
2#define _ASM_CMP_H
3
4/*
5 * Definitions for CMP multitasking on MIPS cores
6 */
7struct task_struct;
8
9extern void cmp_smp_setup(void);
10extern void cmp_smp_finish(void);
11extern void cmp_boot_secondary(int cpu, struct task_struct *t);
12extern void cmp_init_secondary(void);
13extern void cmp_cpus_done(void);
14extern void cmp_prepare_cpus(unsigned int max_cpus);
15
16/* This is platform specific */
17extern void cmp_send_ipi(int cpu, unsigned int action);
18#endif /* _ASM_CMP_H */
diff --git a/include/asm-mips/cmpxchg.h b/include/asm-mips/cmpxchg.h
deleted file mode 100644
index 4a812c3ceb90..000000000000
--- a/include/asm-mips/cmpxchg.h
+++ /dev/null
@@ -1,124 +0,0 @@
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 * Copyright (C) 2003, 06, 07 by Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_CMPXCHG_H
9#define __ASM_CMPXCHG_H
10
11#include <linux/irqflags.h>
12
13#define __HAVE_ARCH_CMPXCHG 1
14
15#define __cmpxchg_asm(ld, st, m, old, new) \
16({ \
17 __typeof(*(m)) __ret; \
18 \
19 if (cpu_has_llsc && R10000_LLSC_WAR) { \
20 __asm__ __volatile__( \
21 " .set push \n" \
22 " .set noat \n" \
23 " .set mips3 \n" \
24 "1: " ld " %0, %2 # __cmpxchg_asm \n" \
25 " bne %0, %z3, 2f \n" \
26 " .set mips0 \n" \
27 " move $1, %z4 \n" \
28 " .set mips3 \n" \
29 " " st " $1, %1 \n" \
30 " beqzl $1, 1b \n" \
31 "2: \n" \
32 " .set pop \n" \
33 : "=&r" (__ret), "=R" (*m) \
34 : "R" (*m), "Jr" (old), "Jr" (new) \
35 : "memory"); \
36 } else if (cpu_has_llsc) { \
37 __asm__ __volatile__( \
38 " .set push \n" \
39 " .set noat \n" \
40 " .set mips3 \n" \
41 "1: " ld " %0, %2 # __cmpxchg_asm \n" \
42 " bne %0, %z3, 2f \n" \
43 " .set mips0 \n" \
44 " move $1, %z4 \n" \
45 " .set mips3 \n" \
46 " " st " $1, %1 \n" \
47 " beqz $1, 3f \n" \
48 "2: \n" \
49 " .subsection 2 \n" \
50 "3: b 1b \n" \
51 " .previous \n" \
52 " .set pop \n" \
53 : "=&r" (__ret), "=R" (*m) \
54 : "R" (*m), "Jr" (old), "Jr" (new) \
55 : "memory"); \
56 } else { \
57 unsigned long __flags; \
58 \
59 raw_local_irq_save(__flags); \
60 __ret = *m; \
61 if (__ret == old) \
62 *m = new; \
63 raw_local_irq_restore(__flags); \
64 } \
65 \
66 __ret; \
67})
68
69/*
70 * This function doesn't exist, so you'll get a linker error
71 * if something tries to do an invalid cmpxchg().
72 */
73extern void __cmpxchg_called_with_bad_pointer(void);
74
75#define __cmpxchg(ptr, old, new, barrier) \
76({ \
77 __typeof__(ptr) __ptr = (ptr); \
78 __typeof__(*(ptr)) __old = (old); \
79 __typeof__(*(ptr)) __new = (new); \
80 __typeof__(*(ptr)) __res = 0; \
81 \
82 barrier; \
83 \
84 switch (sizeof(*(__ptr))) { \
85 case 4: \
86 __res = __cmpxchg_asm("ll", "sc", __ptr, __old, __new); \
87 break; \
88 case 8: \
89 if (sizeof(long) == 8) { \
90 __res = __cmpxchg_asm("lld", "scd", __ptr, \
91 __old, __new); \
92 break; \
93 } \
94 default: \
95 __cmpxchg_called_with_bad_pointer(); \
96 break; \
97 } \
98 \
99 barrier; \
100 \
101 __res; \
102})
103
104#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb())
105#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, )
106
107#define cmpxchg64(ptr, o, n) \
108 ({ \
109 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
110 cmpxchg((ptr), (o), (n)); \
111 })
112
113#ifdef CONFIG_64BIT
114#define cmpxchg64_local(ptr, o, n) \
115 ({ \
116 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
117 cmpxchg_local((ptr), (o), (n)); \
118 })
119#else
120#include <asm-generic/cmpxchg-local.h>
121#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
122#endif
123
124#endif /* __ASM_CMPXCHG_H */
diff --git a/include/asm-mips/compat-signal.h b/include/asm-mips/compat-signal.h
deleted file mode 100644
index 368a99e5c3e1..000000000000
--- a/include/asm-mips/compat-signal.h
+++ /dev/null
@@ -1,119 +0,0 @@
1#ifndef __ASM_COMPAT_SIGNAL_H
2#define __ASM_COMPAT_SIGNAL_H
3
4#include <linux/bug.h>
5#include <linux/compat.h>
6#include <linux/compiler.h>
7
8#include <asm/signal.h>
9#include <asm/siginfo.h>
10
11#include <asm/uaccess.h>
12
13#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
14
15typedef struct compat_siginfo {
16 int si_signo;
17 int si_code;
18 int si_errno;
19
20 union {
21 int _pad[SI_PAD_SIZE32];
22
23 /* kill() */
24 struct {
25 compat_pid_t _pid; /* sender's pid */
26 compat_uid_t _uid; /* sender's uid */
27 } _kill;
28
29 /* SIGCHLD */
30 struct {
31 compat_pid_t _pid; /* which child */
32 compat_uid_t _uid; /* sender's uid */
33 int _status; /* exit code */
34 compat_clock_t _utime;
35 compat_clock_t _stime;
36 } _sigchld;
37
38 /* IRIX SIGCHLD */
39 struct {
40 compat_pid_t _pid; /* which child */
41 compat_clock_t _utime;
42 int _status; /* exit code */
43 compat_clock_t _stime;
44 } _irix_sigchld;
45
46 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
47 struct {
48 s32 _addr; /* faulting insn/memory ref. */
49 } _sigfault;
50
51 /* SIGPOLL, SIGXFSZ (To do ...) */
52 struct {
53 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
54 int _fd;
55 } _sigpoll;
56
57 /* POSIX.1b timers */
58 struct {
59 timer_t _tid; /* timer id */
60 int _overrun; /* overrun count */
61 compat_sigval_t _sigval;/* same as below */
62 int _sys_private; /* not to be passed to user */
63 } _timer;
64
65 /* POSIX.1b signals */
66 struct {
67 compat_pid_t _pid; /* sender's pid */
68 compat_uid_t _uid; /* sender's uid */
69 compat_sigval_t _sigval;
70 } _rt;
71
72 } _sifields;
73} compat_siginfo_t;
74
75static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d,
76 const sigset_t *s)
77{
78 int err;
79
80 BUG_ON(sizeof(*d) != sizeof(*s));
81 BUG_ON(_NSIG_WORDS != 2);
82
83 err = __put_user(s->sig[0], &d->sig[0]);
84 err |= __put_user(s->sig[0] >> 32, &d->sig[1]);
85 err |= __put_user(s->sig[1], &d->sig[2]);
86 err |= __put_user(s->sig[1] >> 32, &d->sig[3]);
87
88 return err;
89}
90
91static inline int __copy_conv_sigset_from_user(sigset_t *d,
92 const compat_sigset_t __user *s)
93{
94 int err;
95 union sigset_u {
96 sigset_t s;
97 compat_sigset_t c;
98 } *u = (union sigset_u *) d;
99
100 BUG_ON(sizeof(*d) != sizeof(*s));
101 BUG_ON(_NSIG_WORDS != 2);
102
103#ifdef CONFIG_CPU_BIG_ENDIAN
104 err = __get_user(u->c.sig[1], &s->sig[0]);
105 err |= __get_user(u->c.sig[0], &s->sig[1]);
106 err |= __get_user(u->c.sig[3], &s->sig[2]);
107 err |= __get_user(u->c.sig[2], &s->sig[3]);
108#endif
109#ifdef CONFIG_CPU_LITTLE_ENDIAN
110 err = __get_user(u->c.sig[0], &s->sig[0]);
111 err |= __get_user(u->c.sig[1], &s->sig[1]);
112 err |= __get_user(u->c.sig[2], &s->sig[2]);
113 err |= __get_user(u->c.sig[3], &s->sig[3]);
114#endif
115
116 return err;
117}
118
119#endif /* __ASM_COMPAT_SIGNAL_H */
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
deleted file mode 100644
index ac5d541368e9..000000000000
--- a/include/asm-mips/compat.h
+++ /dev/null
@@ -1,221 +0,0 @@
1#ifndef _ASM_COMPAT_H
2#define _ASM_COMPAT_H
3/*
4 * Architecture specific compatibility types
5 */
6#include <linux/types.h>
7#include <asm/page.h>
8#include <asm/ptrace.h>
9
10#define COMPAT_USER_HZ 100
11
12typedef u32 compat_size_t;
13typedef s32 compat_ssize_t;
14typedef s32 compat_time_t;
15typedef s32 compat_clock_t;
16typedef s32 compat_suseconds_t;
17
18typedef s32 compat_pid_t;
19typedef s32 __compat_uid_t;
20typedef s32 __compat_gid_t;
21typedef __compat_uid_t __compat_uid32_t;
22typedef __compat_gid_t __compat_gid32_t;
23typedef u32 compat_mode_t;
24typedef u32 compat_ino_t;
25typedef u32 compat_dev_t;
26typedef s32 compat_off_t;
27typedef s64 compat_loff_t;
28typedef u32 compat_nlink_t;
29typedef s32 compat_ipc_pid_t;
30typedef s32 compat_daddr_t;
31typedef s32 compat_caddr_t;
32typedef struct {
33 s32 val[2];
34} compat_fsid_t;
35typedef s32 compat_timer_t;
36typedef s32 compat_key_t;
37
38typedef s32 compat_int_t;
39typedef s32 compat_long_t;
40typedef s64 compat_s64;
41typedef u32 compat_uint_t;
42typedef u32 compat_ulong_t;
43typedef u64 compat_u64;
44
45struct compat_timespec {
46 compat_time_t tv_sec;
47 s32 tv_nsec;
48};
49
50struct compat_timeval {
51 compat_time_t tv_sec;
52 s32 tv_usec;
53};
54
55struct compat_stat {
56 compat_dev_t st_dev;
57 s32 st_pad1[3];
58 compat_ino_t st_ino;
59 compat_mode_t st_mode;
60 compat_nlink_t st_nlink;
61 __compat_uid_t st_uid;
62 __compat_gid_t st_gid;
63 compat_dev_t st_rdev;
64 s32 st_pad2[2];
65 compat_off_t st_size;
66 s32 st_pad3;
67 compat_time_t st_atime;
68 s32 st_atime_nsec;
69 compat_time_t st_mtime;
70 s32 st_mtime_nsec;
71 compat_time_t st_ctime;
72 s32 st_ctime_nsec;
73 s32 st_blksize;
74 s32 st_blocks;
75 s32 st_pad4[14];
76};
77
78struct compat_flock {
79 short l_type;
80 short l_whence;
81 compat_off_t l_start;
82 compat_off_t l_len;
83 s32 l_sysid;
84 compat_pid_t l_pid;
85 short __unused;
86 s32 pad[4];
87};
88
89#define F_GETLK64 33
90#define F_SETLK64 34
91#define F_SETLKW64 35
92
93struct compat_flock64 {
94 short l_type;
95 short l_whence;
96 compat_loff_t l_start;
97 compat_loff_t l_len;
98 compat_pid_t l_pid;
99};
100
101struct compat_statfs {
102 int f_type;
103 int f_bsize;
104 int f_frsize;
105 int f_blocks;
106 int f_bfree;
107 int f_files;
108 int f_ffree;
109 int f_bavail;
110 compat_fsid_t f_fsid;
111 int f_namelen;
112 int f_spare[6];
113};
114
115#define COMPAT_RLIM_INFINITY 0x7fffffffUL
116
117typedef u32 compat_old_sigset_t; /* at least 32 bits */
118
119#define _COMPAT_NSIG 128 /* Don't ask !$@#% ... */
120#define _COMPAT_NSIG_BPW 32
121
122typedef u32 compat_sigset_word;
123
124#define COMPAT_OFF_T_MAX 0x7fffffff
125#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
126
127/*
128 * A pointer passed in from user mode. This should not
129 * be used for syscall parameters, just declare them
130 * as pointers because the syscall entry code will have
131 * appropriately converted them already.
132 */
133typedef u32 compat_uptr_t;
134
135static inline void __user *compat_ptr(compat_uptr_t uptr)
136{
137 /* cast to a __user pointer via "unsigned long" makes sparse happy */
138 return (void __user *)(unsigned long)(long)uptr;
139}
140
141static inline compat_uptr_t ptr_to_compat(void __user *uptr)
142{
143 return (u32)(unsigned long)uptr;
144}
145
146static inline void __user *compat_alloc_user_space(long len)
147{
148 struct pt_regs *regs = (struct pt_regs *)
149 ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1;
150
151 return (void __user *) (regs->regs[29] - len);
152}
153
154struct compat_ipc64_perm {
155 compat_key_t key;
156 __compat_uid32_t uid;
157 __compat_gid32_t gid;
158 __compat_uid32_t cuid;
159 __compat_gid32_t cgid;
160 compat_mode_t mode;
161 unsigned short seq;
162 unsigned short __pad2;
163 compat_ulong_t __unused1;
164 compat_ulong_t __unused2;
165};
166
167struct compat_semid64_ds {
168 struct compat_ipc64_perm sem_perm;
169 compat_time_t sem_otime;
170 compat_time_t sem_ctime;
171 compat_ulong_t sem_nsems;
172 compat_ulong_t __unused1;
173 compat_ulong_t __unused2;
174};
175
176struct compat_msqid64_ds {
177 struct compat_ipc64_perm msg_perm;
178#ifndef CONFIG_CPU_LITTLE_ENDIAN
179 compat_ulong_t __unused1;
180#endif
181 compat_time_t msg_stime;
182#ifdef CONFIG_CPU_LITTLE_ENDIAN
183 compat_ulong_t __unused1;
184#endif
185#ifndef CONFIG_CPU_LITTLE_ENDIAN
186 compat_ulong_t __unused2;
187#endif
188 compat_time_t msg_rtime;
189#ifdef CONFIG_CPU_LITTLE_ENDIAN
190 compat_ulong_t __unused2;
191#endif
192#ifndef CONFIG_CPU_LITTLE_ENDIAN
193 compat_ulong_t __unused3;
194#endif
195 compat_time_t msg_ctime;
196#ifdef CONFIG_CPU_LITTLE_ENDIAN
197 compat_ulong_t __unused3;
198#endif
199 compat_ulong_t msg_cbytes;
200 compat_ulong_t msg_qnum;
201 compat_ulong_t msg_qbytes;
202 compat_pid_t msg_lspid;
203 compat_pid_t msg_lrpid;
204 compat_ulong_t __unused4;
205 compat_ulong_t __unused5;
206};
207
208struct compat_shmid64_ds {
209 struct compat_ipc64_perm shm_perm;
210 compat_size_t shm_segsz;
211 compat_time_t shm_atime;
212 compat_time_t shm_dtime;
213 compat_time_t shm_ctime;
214 compat_pid_t shm_cpid;
215 compat_pid_t shm_lpid;
216 compat_ulong_t shm_nattch;
217 compat_ulong_t __unused1;
218 compat_ulong_t __unused2;
219};
220
221#endif /* _ASM_COMPAT_H */
diff --git a/include/asm-mips/compiler.h b/include/asm-mips/compiler.h
deleted file mode 100644
index 71f5c5cfc58a..000000000000
--- a/include/asm-mips/compiler.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (C) 2004, 2007 Maciej W. Rozycki
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#ifndef _ASM_COMPILER_H
9#define _ASM_COMPILER_H
10
11#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
12#define GCC_IMM_ASM() "n"
13#define GCC_REG_ACCUM "$0"
14#else
15#define GCC_IMM_ASM() "rn"
16#define GCC_REG_ACCUM "accum"
17#endif
18
19#endif /* _ASM_COMPILER_H */
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
deleted file mode 100644
index 5ea701fc3425..000000000000
--- a/include/asm-mips/cpu-features.h
+++ /dev/null
@@ -1,219 +0,0 @@
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 * Copyright (C) 2003, 2004 Ralf Baechle
7 * Copyright (C) 2004 Maciej W. Rozycki
8 */
9#ifndef __ASM_CPU_FEATURES_H
10#define __ASM_CPU_FEATURES_H
11
12#include <asm/cpu.h>
13#include <asm/cpu-info.h>
14#include <cpu-feature-overrides.h>
15
16#ifndef current_cpu_type
17#define current_cpu_type() current_cpu_data.cputype
18#endif
19
20/*
21 * SMP assumption: Options of CPU 0 are a superset of all processors.
22 * This is true for all known MIPS systems.
23 */
24#ifndef cpu_has_tlb
25#define cpu_has_tlb (cpu_data[0].options & MIPS_CPU_TLB)
26#endif
27#ifndef cpu_has_4kex
28#define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX)
29#endif
30#ifndef cpu_has_3k_cache
31#define cpu_has_3k_cache (cpu_data[0].options & MIPS_CPU_3K_CACHE)
32#endif
33#define cpu_has_6k_cache 0
34#define cpu_has_8k_cache 0
35#ifndef cpu_has_4k_cache
36#define cpu_has_4k_cache (cpu_data[0].options & MIPS_CPU_4K_CACHE)
37#endif
38#ifndef cpu_has_tx39_cache
39#define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE)
40#endif
41#ifndef cpu_has_fpu
42#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU)
43#define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU)
44#else
45#define raw_cpu_has_fpu cpu_has_fpu
46#endif
47#ifndef cpu_has_32fpr
48#define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR)
49#endif
50#ifndef cpu_has_counter
51#define cpu_has_counter (cpu_data[0].options & MIPS_CPU_COUNTER)
52#endif
53#ifndef cpu_has_watch
54#define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH)
55#endif
56#ifndef cpu_has_divec
57#define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC)
58#endif
59#ifndef cpu_has_vce
60#define cpu_has_vce (cpu_data[0].options & MIPS_CPU_VCE)
61#endif
62#ifndef cpu_has_cache_cdex_p
63#define cpu_has_cache_cdex_p (cpu_data[0].options & MIPS_CPU_CACHE_CDEX_P)
64#endif
65#ifndef cpu_has_cache_cdex_s
66#define cpu_has_cache_cdex_s (cpu_data[0].options & MIPS_CPU_CACHE_CDEX_S)
67#endif
68#ifndef cpu_has_prefetch
69#define cpu_has_prefetch (cpu_data[0].options & MIPS_CPU_PREFETCH)
70#endif
71#ifndef cpu_has_mcheck
72#define cpu_has_mcheck (cpu_data[0].options & MIPS_CPU_MCHECK)
73#endif
74#ifndef cpu_has_ejtag
75#define cpu_has_ejtag (cpu_data[0].options & MIPS_CPU_EJTAG)
76#endif
77#ifndef cpu_has_llsc
78#define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC)
79#endif
80#ifndef cpu_has_mips16
81#define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16)
82#endif
83#ifndef cpu_has_mdmx
84#define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX)
85#endif
86#ifndef cpu_has_mips3d
87#define cpu_has_mips3d (cpu_data[0].ases & MIPS_ASE_MIPS3D)
88#endif
89#ifndef cpu_has_smartmips
90#define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS)
91#endif
92#ifndef cpu_has_vtag_icache
93#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
94#endif
95#ifndef cpu_has_dc_aliases
96#define cpu_has_dc_aliases (cpu_data[0].dcache.flags & MIPS_CACHE_ALIASES)
97#endif
98#ifndef cpu_has_ic_fills_f_dc
99#define cpu_has_ic_fills_f_dc (cpu_data[0].icache.flags & MIPS_CACHE_IC_F_DC)
100#endif
101#ifndef cpu_has_pindexed_dcache
102#define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
103#endif
104
105/*
106 * I-Cache snoops remote store. This only matters on SMP. Some multiprocessors
107 * such as the R10000 have I-Caches that snoop local stores; the embedded ones
108 * don't. For maintaining I-cache coherency this means we need to flush the
109 * D-cache all the way back to whever the I-cache does refills from, so the
110 * I-cache has a chance to see the new data at all. Then we have to flush the
111 * I-cache also.
112 * Note we may have been rescheduled and may no longer be running on the CPU
113 * that did the store so we can't optimize this into only doing the flush on
114 * the local CPU.
115 */
116#ifndef cpu_icache_snoops_remote_store
117#ifdef CONFIG_SMP
118#define cpu_icache_snoops_remote_store (cpu_data[0].icache.flags & MIPS_IC_SNOOPS_REMOTE)
119#else
120#define cpu_icache_snoops_remote_store 1
121#endif
122#endif
123
124# ifndef cpu_has_mips32r1
125# define cpu_has_mips32r1 (cpu_data[0].isa_level & MIPS_CPU_ISA_M32R1)
126# endif
127# ifndef cpu_has_mips32r2
128# define cpu_has_mips32r2 (cpu_data[0].isa_level & MIPS_CPU_ISA_M32R2)
129# endif
130# ifndef cpu_has_mips64r1
131# define cpu_has_mips64r1 (cpu_data[0].isa_level & MIPS_CPU_ISA_M64R1)
132# endif
133# ifndef cpu_has_mips64r2
134# define cpu_has_mips64r2 (cpu_data[0].isa_level & MIPS_CPU_ISA_M64R2)
135# endif
136
137/*
138 * Shortcuts ...
139 */
140#define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2)
141#define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2)
142#define cpu_has_mips_r1 (cpu_has_mips32r1 | cpu_has_mips64r1)
143#define cpu_has_mips_r2 (cpu_has_mips32r2 | cpu_has_mips64r2)
144
145#ifndef cpu_has_dsp
146#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP)
147#endif
148
149#ifndef cpu_has_mipsmt
150#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT)
151#endif
152
153#ifndef cpu_has_userlocal
154#define cpu_has_userlocal (cpu_data[0].options & MIPS_CPU_ULRI)
155#endif
156
157#ifdef CONFIG_32BIT
158# ifndef cpu_has_nofpuex
159# define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX)
160# endif
161# ifndef cpu_has_64bits
162# define cpu_has_64bits (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT)
163# endif
164# ifndef cpu_has_64bit_zero_reg
165# define cpu_has_64bit_zero_reg (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT)
166# endif
167# ifndef cpu_has_64bit_gp_regs
168# define cpu_has_64bit_gp_regs 0
169# endif
170# ifndef cpu_has_64bit_addresses
171# define cpu_has_64bit_addresses 0
172# endif
173#endif
174
175#ifdef CONFIG_64BIT
176# ifndef cpu_has_nofpuex
177# define cpu_has_nofpuex 0
178# endif
179# ifndef cpu_has_64bits
180# define cpu_has_64bits 1
181# endif
182# ifndef cpu_has_64bit_zero_reg
183# define cpu_has_64bit_zero_reg 1
184# endif
185# ifndef cpu_has_64bit_gp_regs
186# define cpu_has_64bit_gp_regs 1
187# endif
188# ifndef cpu_has_64bit_addresses
189# define cpu_has_64bit_addresses 1
190# endif
191#endif
192
193#if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint)
194# define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT)
195#elif !defined(cpu_has_vint)
196# define cpu_has_vint 0
197#endif
198
199#if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic)
200# define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC)
201#elif !defined(cpu_has_veic)
202# define cpu_has_veic 0
203#endif
204
205#ifndef cpu_has_inclusive_pcaches
206#define cpu_has_inclusive_pcaches (cpu_data[0].options & MIPS_CPU_INCLUSIVE_CACHES)
207#endif
208
209#ifndef cpu_dcache_line_size
210#define cpu_dcache_line_size() cpu_data[0].dcache.linesz
211#endif
212#ifndef cpu_icache_line_size
213#define cpu_icache_line_size() cpu_data[0].icache.linesz
214#endif
215#ifndef cpu_scache_line_size
216#define cpu_scache_line_size() cpu_data[0].scache.linesz
217#endif
218
219#endif /* __ASM_CPU_FEATURES_H */
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h
deleted file mode 100644
index 2de73dbb2e9e..000000000000
--- a/include/asm-mips/cpu-info.h
+++ /dev/null
@@ -1,84 +0,0 @@
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 * Copyright (C) 1994 Waldorf GMBH
7 * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle
8 * Copyright (C) 1996 Paul M. Antoine
9 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
10 * Copyright (C) 2004 Maciej W. Rozycki
11 */
12#ifndef __ASM_CPU_INFO_H
13#define __ASM_CPU_INFO_H
14
15#include <asm/cache.h>
16
17/*
18 * Descriptor for a cache
19 */
20struct cache_desc {
21 unsigned int waysize; /* Bytes per way */
22 unsigned short sets; /* Number of lines per set */
23 unsigned char ways; /* Number of ways */
24 unsigned char linesz; /* Size of line in bytes */
25 unsigned char waybit; /* Bits to select in a cache set */
26 unsigned char flags; /* Flags describing cache properties */
27};
28
29/*
30 * Flag definitions
31 */
32#define MIPS_CACHE_NOT_PRESENT 0x00000001
33#define MIPS_CACHE_VTAG 0x00000002 /* Virtually tagged cache */
34#define MIPS_CACHE_ALIASES 0x00000004 /* Cache could have aliases */
35#define MIPS_CACHE_IC_F_DC 0x00000008 /* Ic can refill from D-cache */
36#define MIPS_IC_SNOOPS_REMOTE 0x00000010 /* Ic snoops remote stores */
37#define MIPS_CACHE_PINDEX 0x00000020 /* Physically indexed cache */
38
39struct cpuinfo_mips {
40 unsigned long udelay_val;
41 unsigned long asid_cache;
42
43 /*
44 * Capability and feature descriptor structure for MIPS CPU
45 */
46 unsigned long options;
47 unsigned long ases;
48 unsigned int processor_id;
49 unsigned int fpu_id;
50 unsigned int cputype;
51 int isa_level;
52 int tlbsize;
53 struct cache_desc icache; /* Primary I-cache */
54 struct cache_desc dcache; /* Primary D or combined I/D cache */
55 struct cache_desc scache; /* Secondary cache */
56 struct cache_desc tcache; /* Tertiary/split secondary cache */
57 int srsets; /* Shadow register sets */
58 int core; /* physical core number */
59#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
60 /*
61 * In the MIPS MT "SMTC" model, each TC is considered
62 * to be a "CPU" for the purposes of scheduling, but
63 * exception resources, ASID spaces, etc, are common
64 * to all TCs within the same VPE.
65 */
66 int vpe_id; /* Virtual Processor number */
67#endif
68#ifdef CONFIG_MIPS_MT_SMTC
69 int tc_id; /* Thread Context number */
70#endif
71 void *data; /* Additional data */
72} __attribute__((aligned(SMP_CACHE_BYTES)));
73
74extern struct cpuinfo_mips cpu_data[];
75#define current_cpu_data cpu_data[smp_processor_id()]
76#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
77
78extern void cpu_probe(void);
79extern void cpu_report(void);
80
81extern const char *__cpu_name[];
82#define cpu_name_string() __cpu_name[smp_processor_id()]
83
84#endif /* __ASM_CPU_INFO_H */
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
deleted file mode 100644
index 229a786101d9..000000000000
--- a/include/asm-mips/cpu.h
+++ /dev/null
@@ -1,267 +0,0 @@
1/*
2 * cpu.h: Values of the PRId register used to match up
3 * various MIPS cpu types.
4 *
5 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
6 * Copyright (C) 2004 Maciej W. Rozycki
7 */
8#ifndef _ASM_CPU_H
9#define _ASM_CPU_H
10
11/* Assigned Company values for bits 23:16 of the PRId Register
12 (CP0 register 15, select 0). As of the MIPS32 and MIPS64 specs from
13 MTI, the PRId register is defined in this (backwards compatible)
14 way:
15
16 +----------------+----------------+----------------+----------------+
17 | Company Options| Company ID | Processor ID | Revision |
18 +----------------+----------------+----------------+----------------+
19 31 24 23 16 15 8 7
20
21 I don't have docs for all the previous processors, but my impression is
22 that bits 16-23 have been 0 for all MIPS processors before the MIPS32/64
23 spec.
24*/
25
26#define PRID_COMP_LEGACY 0x000000
27#define PRID_COMP_MIPS 0x010000
28#define PRID_COMP_BROADCOM 0x020000
29#define PRID_COMP_ALCHEMY 0x030000
30#define PRID_COMP_SIBYTE 0x040000
31#define PRID_COMP_SANDCRAFT 0x050000
32#define PRID_COMP_NXP 0x060000
33#define PRID_COMP_TOSHIBA 0x070000
34#define PRID_COMP_LSI 0x080000
35#define PRID_COMP_LEXRA 0x0b0000
36
37
38/*
39 * Assigned values for the product ID register. In order to detect a
40 * certain CPU type exactly eventually additional registers may need to
41 * be examined. These are valid when 23:16 == PRID_COMP_LEGACY
42 */
43#define PRID_IMP_R2000 0x0100
44#define PRID_IMP_AU1_REV1 0x0100
45#define PRID_IMP_AU1_REV2 0x0200
46#define PRID_IMP_R3000 0x0200 /* Same as R2000A */
47#define PRID_IMP_R6000 0x0300 /* Same as R3000A */
48#define PRID_IMP_R4000 0x0400
49#define PRID_IMP_R6000A 0x0600
50#define PRID_IMP_R10000 0x0900
51#define PRID_IMP_R4300 0x0b00
52#define PRID_IMP_VR41XX 0x0c00
53#define PRID_IMP_R12000 0x0e00
54#define PRID_IMP_R14000 0x0f00
55#define PRID_IMP_R8000 0x1000
56#define PRID_IMP_PR4450 0x1200
57#define PRID_IMP_R4600 0x2000
58#define PRID_IMP_R4700 0x2100
59#define PRID_IMP_TX39 0x2200
60#define PRID_IMP_R4640 0x2200
61#define PRID_IMP_R4650 0x2200 /* Same as R4640 */
62#define PRID_IMP_R5000 0x2300
63#define PRID_IMP_TX49 0x2d00
64#define PRID_IMP_SONIC 0x2400
65#define PRID_IMP_MAGIC 0x2500
66#define PRID_IMP_RM7000 0x2700
67#define PRID_IMP_NEVADA 0x2800 /* RM5260 ??? */
68#define PRID_IMP_RM9000 0x3400
69#define PRID_IMP_LOONGSON1 0x4200
70#define PRID_IMP_R5432 0x5400
71#define PRID_IMP_R5500 0x5500
72#define PRID_IMP_LOONGSON2 0x6300
73
74#define PRID_IMP_UNKNOWN 0xff00
75
76/*
77 * These are the PRID's for when 23:16 == PRID_COMP_MIPS
78 */
79
80#define PRID_IMP_4KC 0x8000
81#define PRID_IMP_5KC 0x8100
82#define PRID_IMP_20KC 0x8200
83#define PRID_IMP_4KEC 0x8400
84#define PRID_IMP_4KSC 0x8600
85#define PRID_IMP_25KF 0x8800
86#define PRID_IMP_5KE 0x8900
87#define PRID_IMP_4KECR2 0x9000
88#define PRID_IMP_4KEMPR2 0x9100
89#define PRID_IMP_4KSD 0x9200
90#define PRID_IMP_24K 0x9300
91#define PRID_IMP_34K 0x9500
92#define PRID_IMP_24KE 0x9600
93#define PRID_IMP_74K 0x9700
94#define PRID_IMP_1004K 0x9900
95
96/*
97 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
98 */
99
100#define PRID_IMP_SB1 0x0100
101#define PRID_IMP_SB1A 0x1100
102
103/*
104 * These are the PRID's for when 23:16 == PRID_COMP_SANDCRAFT
105 */
106
107#define PRID_IMP_SR71000 0x0400
108
109/*
110 * These are the PRID's for when 23:16 == PRID_COMP_BROADCOM
111 */
112
113#define PRID_IMP_BCM4710 0x4000
114#define PRID_IMP_BCM3302 0x9000
115
116/*
117 * Definitions for 7:0 on legacy processors
118 */
119
120#define PRID_REV_MASK 0x00ff
121
122#define PRID_REV_TX4927 0x0022
123#define PRID_REV_TX4937 0x0030
124#define PRID_REV_R4400 0x0040
125#define PRID_REV_R3000A 0x0030
126#define PRID_REV_R3000 0x0020
127#define PRID_REV_R2000A 0x0010
128#define PRID_REV_TX3912 0x0010
129#define PRID_REV_TX3922 0x0030
130#define PRID_REV_TX3927 0x0040
131#define PRID_REV_VR4111 0x0050
132#define PRID_REV_VR4181 0x0050 /* Same as VR4111 */
133#define PRID_REV_VR4121 0x0060
134#define PRID_REV_VR4122 0x0070
135#define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */
136#define PRID_REV_VR4130 0x0080
137#define PRID_REV_34K_V1_0_2 0x0022
138
139/*
140 * Older processors used to encode processor version and revision in two
141 * 4-bit bitfields, the 4K seems to simply count up and even newer MTI cores
142 * have switched to use the 8-bits as 3:3:2 bitfield with the last field as
143 * the patch number. *ARGH*
144 */
145#define PRID_REV_ENCODE_44(ver, rev) \
146 ((ver) << 4 | (rev))
147#define PRID_REV_ENCODE_332(ver, rev, patch) \
148 ((ver) << 5 | (rev) << 2 | (patch))
149
150/*
151 * FPU implementation/revision register (CP1 control register 0).
152 *
153 * +---------------------------------+----------------+----------------+
154 * | 0 | Implementation | Revision |
155 * +---------------------------------+----------------+----------------+
156 * 31 16 15 8 7 0
157 */
158
159#define FPIR_IMP_NONE 0x0000
160
161enum cpu_type_enum {
162 CPU_UNKNOWN,
163
164 /*
165 * R2000 class processors
166 */
167 CPU_R2000, CPU_R3000, CPU_R3000A, CPU_R3041, CPU_R3051, CPU_R3052,
168 CPU_R3081, CPU_R3081E,
169
170 /*
171 * R6000 class processors
172 */
173 CPU_R6000, CPU_R6000A,
174
175 /*
176 * R4000 class processors
177 */
178 CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310,
179 CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650,
180 CPU_R4700, CPU_R5000, CPU_R5000A, CPU_R5500, CPU_NEVADA, CPU_R5432,
181 CPU_R10000, CPU_R12000, CPU_R14000, CPU_VR41XX, CPU_VR4111, CPU_VR4121,
182 CPU_VR4122, CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000,
183 CPU_SR71000, CPU_RM9000, CPU_TX49XX,
184
185 /*
186 * R8000 class processors
187 */
188 CPU_R8000,
189
190 /*
191 * TX3900 class processors
192 */
193 CPU_TX3912, CPU_TX3922, CPU_TX3927,
194
195 /*
196 * MIPS32 class processors
197 */
198 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K,
199 CPU_AU1000, CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500,
200 CPU_AU1550, CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
201
202 /*
203 * MIPS64 class processors
204 */
205 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
206
207 CPU_LAST
208};
209
210
211/*
212 * ISA Level encodings
213 *
214 */
215#define MIPS_CPU_ISA_I 0x00000001
216#define MIPS_CPU_ISA_II 0x00000002
217#define MIPS_CPU_ISA_III 0x00000004
218#define MIPS_CPU_ISA_IV 0x00000008
219#define MIPS_CPU_ISA_V 0x00000010
220#define MIPS_CPU_ISA_M32R1 0x00000020
221#define MIPS_CPU_ISA_M32R2 0x00000040
222#define MIPS_CPU_ISA_M64R1 0x00000080
223#define MIPS_CPU_ISA_M64R2 0x00000100
224
225#define MIPS_CPU_ISA_32BIT (MIPS_CPU_ISA_I | MIPS_CPU_ISA_II | \
226 MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 )
227#define MIPS_CPU_ISA_64BIT (MIPS_CPU_ISA_III | MIPS_CPU_ISA_IV | \
228 MIPS_CPU_ISA_V | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)
229
230/*
231 * CPU Option encodings
232 */
233#define MIPS_CPU_TLB 0x00000001 /* CPU has TLB */
234#define MIPS_CPU_4KEX 0x00000002 /* "R4K" exception model */
235#define MIPS_CPU_3K_CACHE 0x00000004 /* R3000-style caches */
236#define MIPS_CPU_4K_CACHE 0x00000008 /* R4000-style caches */
237#define MIPS_CPU_TX39_CACHE 0x00000010 /* TX3900-style caches */
238#define MIPS_CPU_FPU 0x00000020 /* CPU has FPU */
239#define MIPS_CPU_32FPR 0x00000040 /* 32 dbl. prec. FP registers */
240#define MIPS_CPU_COUNTER 0x00000080 /* Cycle count/compare */
241#define MIPS_CPU_WATCH 0x00000100 /* watchpoint registers */
242#define MIPS_CPU_DIVEC 0x00000200 /* dedicated interrupt vector */
243#define MIPS_CPU_VCE 0x00000400 /* virt. coherence conflict possible */
244#define MIPS_CPU_CACHE_CDEX_P 0x00000800 /* Create_Dirty_Exclusive CACHE op */
245#define MIPS_CPU_CACHE_CDEX_S 0x00001000 /* ... same for seconary cache ... */
246#define MIPS_CPU_MCHECK 0x00002000 /* Machine check exception */
247#define MIPS_CPU_EJTAG 0x00004000 /* EJTAG exception */
248#define MIPS_CPU_NOFPUEX 0x00008000 /* no FPU exception */
249#define MIPS_CPU_LLSC 0x00010000 /* CPU has ll/sc instructions */
250#define MIPS_CPU_INCLUSIVE_CACHES 0x00020000 /* P-cache subset enforced */
251#define MIPS_CPU_PREFETCH 0x00040000 /* CPU has usable prefetch */
252#define MIPS_CPU_VINT 0x00080000 /* CPU supports MIPSR2 vectored interrupts */
253#define MIPS_CPU_VEIC 0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */
254#define MIPS_CPU_ULRI 0x00200000 /* CPU has ULRI feature */
255
256/*
257 * CPU ASE encodings
258 */
259#define MIPS_ASE_MIPS16 0x00000001 /* code compression */
260#define MIPS_ASE_MDMX 0x00000002 /* MIPS digital media extension */
261#define MIPS_ASE_MIPS3D 0x00000004 /* MIPS-3D */
262#define MIPS_ASE_SMARTMIPS 0x00000008 /* SmartMIPS */
263#define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */
264#define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */
265
266
267#endif /* _ASM_CPU_H */
diff --git a/include/asm-mips/cputime.h b/include/asm-mips/cputime.h
deleted file mode 100644
index c00eacbdd979..000000000000
--- a/include/asm-mips/cputime.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __MIPS_CPUTIME_H
2#define __MIPS_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* __MIPS_CPUTIME_H */
diff --git a/include/asm-mips/current.h b/include/asm-mips/current.h
deleted file mode 100644
index 559db66b9790..000000000000
--- a/include/asm-mips/current.h
+++ /dev/null
@@ -1,23 +0,0 @@
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 * Copyright (C) 1998, 2002 Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_CURRENT_H
10#define _ASM_CURRENT_H
11
12#include <linux/thread_info.h>
13
14struct task_struct;
15
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 /* _ASM_CURRENT_H */
diff --git a/include/asm-mips/debug.h b/include/asm-mips/debug.h
deleted file mode 100644
index 1fd5a2b39445..000000000000
--- a/include/asm-mips/debug.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Debug macros for run-time debugging.
3 * Turned on/off with CONFIG_RUNTIME_DEBUG option.
4 *
5 * Copyright (C) 2001 MontaVista Software Inc.
6 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef _ASM_DEBUG_H
16#define _ASM_DEBUG_H
17
18
19/*
20 * run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in
21 * kernel hacking config menu to use them.
22 *
23 * Use them as run-time debugging aid. NEVER USE THEM AS ERROR HANDLING CODE!!!
24 */
25
26#ifdef CONFIG_RUNTIME_DEBUG
27
28#include <linux/kernel.h>
29
30#define db_assert(x) if (!(x)) { \
31 panic("assertion failed at %s:%d: %s", __FILE__, __LINE__, #x); }
32#define db_warn(x) if (!(x)) { \
33 printk(KERN_WARNING "warning at %s:%d: %s", __FILE__, __LINE__, #x); }
34#define db_verify(x, y) db_assert(x y)
35#define db_verify_warn(x, y) db_warn(x y)
36#define db_run(x) do { x; } while (0)
37
38#else
39
40#define db_assert(x)
41#define db_warn(x)
42#define db_verify(x, y) x
43#define db_verify_warn(x, y) x
44#define db_run(x)
45
46#endif
47
48#endif /* _ASM_DEBUG_H */
diff --git a/include/asm-mips/dec/ecc.h b/include/asm-mips/dec/ecc.h
deleted file mode 100644
index 707ffdbc9add..000000000000
--- a/include/asm-mips/dec/ecc.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * include/asm-mips/dec/ecc.h
3 *
4 * ECC handling logic definitions common to DECstation/DECsystem
5 * 5000/200 (KN02), 5000/240 (KN03), 5000/260 (KN05) and
6 * DECsystem 5900 (KN03), 5900/260 (KN05) systems.
7 *
8 * Copyright (C) 2003 Maciej W. Rozycki
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15#ifndef __ASM_MIPS_DEC_ECC_H
16#define __ASM_MIPS_DEC_ECC_H
17
18/*
19 * Error Address Register bits.
20 * The register is r/wc -- any write clears it.
21 */
22#define KN0X_EAR_VALID (1<<31) /* error data valid, bus IRQ */
23#define KN0X_EAR_CPU (1<<30) /* CPU/DMA transaction */
24#define KN0X_EAR_WRITE (1<<29) /* write/read transaction */
25#define KN0X_EAR_ECCERR (1<<28) /* ECC/timeout or overrun */
26#define KN0X_EAR_RES_27 (1<<27) /* unused */
27#define KN0X_EAR_ADDRESS (0x7ffffff<<0) /* address involved */
28
29/*
30 * Error Syndrome Register bits.
31 * The register is frozen when EAR.VALID is set, otherwise it records bits
32 * from the last memory read. The register is r/wc -- any write clears it.
33 */
34#define KN0X_ESR_VLDHI (1<<31) /* error data valid hi word */
35#define KN0X_ESR_CHKHI (0x7f<<24) /* check bits read from mem */
36#define KN0X_ESR_SNGHI (1<<23) /* single/double bit error */
37#define KN0X_ESR_SYNHI (0x7f<<16) /* syndrome from ECC logic */
38#define KN0X_ESR_VLDLO (1<<15) /* error data valid lo word */
39#define KN0X_ESR_CHKLO (0x7f<<8) /* check bits read from mem */
40#define KN0X_ESR_SNGLO (1<<7) /* single/double bit error */
41#define KN0X_ESR_SYNLO (0x7f<<0) /* syndrome from ECC logic */
42
43
44#ifndef __ASSEMBLY__
45
46#include <linux/interrupt.h>
47
48struct pt_regs;
49
50extern void dec_ecc_be_init(void);
51extern int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup);
52extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id);
53#endif
54
55#endif /* __ASM_MIPS_DEC_ECC_H */
diff --git a/include/asm-mips/dec/interrupts.h b/include/asm-mips/dec/interrupts.h
deleted file mode 100644
index e10d341067c8..000000000000
--- a/include/asm-mips/dec/interrupts.h
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 * Miscellaneous definitions used to initialise the interrupt vector table
3 * with the machine-specific interrupt routines.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1997 by Paul M. Antoine.
10 * reworked 1998 by Harald Koerfgen.
11 * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki
12 */
13
14#ifndef __ASM_DEC_INTERRUPTS_H
15#define __ASM_DEC_INTERRUPTS_H
16
17#include <irq.h>
18#include <asm/mipsregs.h>
19
20
21/*
22 * The list of possible system devices which provide an
23 * interrupt. Not all devices exist on a given system.
24 */
25#define DEC_IRQ_CASCADE 0 /* cascade from CSR or I/O ASIC */
26
27/* Ordinary interrupts */
28#define DEC_IRQ_AB_RECV 1 /* ACCESS.bus receive */
29#define DEC_IRQ_AB_XMIT 2 /* ACCESS.bus transmit */
30#define DEC_IRQ_DZ11 3 /* DZ11 (DC7085) serial */
31#define DEC_IRQ_ASC 4 /* ASC (NCR53C94) SCSI */
32#define DEC_IRQ_FLOPPY 5 /* 82077 FDC */
33#define DEC_IRQ_FPU 6 /* R3k FPU */
34#define DEC_IRQ_HALT 7 /* HALT button or from ACCESS.Bus */
35#define DEC_IRQ_ISDN 8 /* Am79C30A ISDN */
36#define DEC_IRQ_LANCE 9 /* LANCE (Am7990) Ethernet */
37#define DEC_IRQ_BUS 10 /* memory, I/O bus read/write errors */
38#define DEC_IRQ_PSU 11 /* power supply unit warning */
39#define DEC_IRQ_RTC 12 /* DS1287 RTC */
40#define DEC_IRQ_SCC0 13 /* SCC (Z85C30) serial #0 */
41#define DEC_IRQ_SCC1 14 /* SCC (Z85C30) serial #1 */
42#define DEC_IRQ_SII 15 /* SII (DC7061) SCSI */
43#define DEC_IRQ_TC0 16 /* TURBOchannel slot #0 */
44#define DEC_IRQ_TC1 17 /* TURBOchannel slot #1 */
45#define DEC_IRQ_TC2 18 /* TURBOchannel slot #2 */
46#define DEC_IRQ_TIMER 19 /* ARC periodic timer */
47#define DEC_IRQ_VIDEO 20 /* framebuffer */
48
49/* I/O ASIC DMA interrupts */
50#define DEC_IRQ_ASC_MERR 21 /* ASC memory read error */
51#define DEC_IRQ_ASC_ERR 22 /* ASC page overrun */
52#define DEC_IRQ_ASC_DMA 23 /* ASC buffer pointer loaded */
53#define DEC_IRQ_FLOPPY_ERR 24 /* FDC error */
54#define DEC_IRQ_ISDN_ERR 25 /* ISDN memory read/overrun error */
55#define DEC_IRQ_ISDN_RXDMA 26 /* ISDN recv buffer pointer loaded */
56#define DEC_IRQ_ISDN_TXDMA 27 /* ISDN xmit buffer pointer loaded */
57#define DEC_IRQ_LANCE_MERR 28 /* LANCE memory read error */
58#define DEC_IRQ_SCC0A_RXERR 29 /* SCC0A (printer) receive overrun */
59#define DEC_IRQ_SCC0A_RXDMA 30 /* SCC0A receive half page */
60#define DEC_IRQ_SCC0A_TXERR 31 /* SCC0A xmit memory read/overrun */
61#define DEC_IRQ_SCC0A_TXDMA 32 /* SCC0A transmit page end */
62#define DEC_IRQ_AB_RXERR 33 /* ACCESS.bus receive overrun */
63#define DEC_IRQ_AB_RXDMA 34 /* ACCESS.bus receive half page */
64#define DEC_IRQ_AB_TXERR 35 /* ACCESS.bus xmit memory read/ovrn */
65#define DEC_IRQ_AB_TXDMA 36 /* ACCESS.bus transmit page end */
66#define DEC_IRQ_SCC1A_RXERR 37 /* SCC1A (modem) receive overrun */
67#define DEC_IRQ_SCC1A_RXDMA 38 /* SCC1A receive half page */
68#define DEC_IRQ_SCC1A_TXERR 39 /* SCC1A xmit memory read/overrun */
69#define DEC_IRQ_SCC1A_TXDMA 40 /* SCC1A transmit page end */
70
71/* TC5 & TC6 are virtual slots for KN02's onboard devices */
72#define DEC_IRQ_TC5 DEC_IRQ_ASC /* virtual PMAZ-AA */
73#define DEC_IRQ_TC6 DEC_IRQ_LANCE /* virtual PMAD-AA */
74
75#define DEC_NR_INTS 41
76
77
78/* Largest of cpu mask_nr tables. */
79#define DEC_MAX_CPU_INTS 6
80/* Largest of asic mask_nr tables. */
81#define DEC_MAX_ASIC_INTS 9
82
83
84/*
85 * CPU interrupt bits common to all systems.
86 */
87#define DEC_CPU_INR_FPU 7 /* R3k FPU */
88#define DEC_CPU_INR_SW1 1 /* software #1 */
89#define DEC_CPU_INR_SW0 0 /* software #0 */
90
91#define DEC_CPU_IRQ_BASE MIPS_CPU_IRQ_BASE /* first IRQ assigned to CPU */
92
93#define DEC_CPU_IRQ_NR(n) ((n) + DEC_CPU_IRQ_BASE)
94#define DEC_CPU_IRQ_MASK(n) (1 << ((n) + CAUSEB_IP))
95#define DEC_CPU_IRQ_ALL (0xff << CAUSEB_IP)
96
97
98#ifndef __ASSEMBLY__
99
100/*
101 * Interrupt table structures to hide differences between systems.
102 */
103typedef union { int i; void *p; } int_ptr;
104extern int dec_interrupt[DEC_NR_INTS];
105extern int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2];
106extern int_ptr asic_mask_nr_tbl[DEC_MAX_ASIC_INTS][2];
107extern int cpu_fpu_mask;
108
109
110/*
111 * Common interrupt routine prototypes for all DECStations
112 */
113extern void kn02_io_int(void);
114extern void kn02xa_io_int(void);
115extern void kn03_io_int(void);
116extern void asic_dma_int(void);
117extern void asic_all_int(void);
118extern void kn02_all_int(void);
119extern void cpu_all_int(void);
120
121extern void dec_intr_unimplemented(void);
122extern void asic_intr_unimplemented(void);
123
124#endif /* __ASSEMBLY__ */
125
126#endif
diff --git a/include/asm-mips/dec/ioasic.h b/include/asm-mips/dec/ioasic.h
deleted file mode 100644
index 98badd6bf22d..000000000000
--- a/include/asm-mips/dec/ioasic.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * include/asm-mips/dec/ioasic.h
3 *
4 * DEC I/O ASIC access operations.
5 *
6 * Copyright (C) 2000, 2002, 2003 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#ifndef __ASM_DEC_IOASIC_H
15#define __ASM_DEC_IOASIC_H
16
17#include <linux/spinlock.h>
18#include <linux/types.h>
19
20extern spinlock_t ioasic_ssr_lock;
21
22extern volatile u32 *ioasic_base;
23
24static inline void ioasic_write(unsigned int reg, u32 v)
25{
26 ioasic_base[reg / 4] = v;
27}
28
29static inline u32 ioasic_read(unsigned int reg)
30{
31 return ioasic_base[reg / 4];
32}
33
34extern void init_ioasic_irqs(int base);
35
36extern void dec_ioasic_clocksource_init(void);
37
38#endif /* __ASM_DEC_IOASIC_H */
diff --git a/include/asm-mips/dec/ioasic_addrs.h b/include/asm-mips/dec/ioasic_addrs.h
deleted file mode 100644
index 4cbc1f8a1129..000000000000
--- a/include/asm-mips/dec/ioasic_addrs.h
+++ /dev/null
@@ -1,152 +0,0 @@
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 * Definitions for the address map in the JUNKIO Asic
7 *
8 * Created with Information from:
9 *
10 * "DEC 3000 300/400/500/600/700/800/900 AXP Models System Programmer's Manual"
11 *
12 * and the Mach Sources
13 *
14 * Copyright (C) 199x the Anonymous
15 * Copyright (C) 2002, 2003 Maciej W. Rozycki
16 */
17
18#ifndef __ASM_MIPS_DEC_IOASIC_ADDRS_H
19#define __ASM_MIPS_DEC_IOASIC_ADDRS_H
20
21#define IOASIC_SLOT_SIZE 0x00040000
22
23/*
24 * Address ranges decoded by the I/O ASIC for onboard devices.
25 */
26#define IOASIC_SYS_ROM (0*IOASIC_SLOT_SIZE) /* system board ROM */
27#define IOASIC_IOCTL (1*IOASIC_SLOT_SIZE) /* I/O ASIC */
28#define IOASIC_ESAR (2*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */
29#define IOASIC_LANCE (3*IOASIC_SLOT_SIZE) /* LANCE Ethernet */
30#define IOASIC_SCC0 (4*IOASIC_SLOT_SIZE) /* SCC #0 */
31#define IOASIC_VDAC_HI (5*IOASIC_SLOT_SIZE) /* VDAC (maxine) */
32#define IOASIC_SCC1 (6*IOASIC_SLOT_SIZE) /* SCC #1 (3min, 3max+) */
33#define IOASIC_VDAC_LO (7*IOASIC_SLOT_SIZE) /* VDAC (maxine) */
34#define IOASIC_TOY (8*IOASIC_SLOT_SIZE) /* RTC */
35#define IOASIC_ISDN (9*IOASIC_SLOT_SIZE) /* ISDN (maxine) */
36#define IOASIC_ERRADDR (9*IOASIC_SLOT_SIZE) /* bus error address (3max+) */
37#define IOASIC_CHKSYN (10*IOASIC_SLOT_SIZE) /* ECC syndrome (3max+) */
38#define IOASIC_ACC_BUS (10*IOASIC_SLOT_SIZE) /* ACCESS.bus (maxine) */
39#define IOASIC_MCR (11*IOASIC_SLOT_SIZE) /* memory control (3max+) */
40#define IOASIC_FLOPPY (11*IOASIC_SLOT_SIZE) /* FDC (maxine) */
41#define IOASIC_SCSI (12*IOASIC_SLOT_SIZE) /* ASC SCSI */
42#define IOASIC_FDC_DMA (13*IOASIC_SLOT_SIZE) /* FDC DMA (maxine) */
43#define IOASIC_SCSI_DMA (14*IOASIC_SLOT_SIZE) /* ??? */
44#define IOASIC_RES_15 (15*IOASIC_SLOT_SIZE) /* unused? */
45
46
47/*
48 * Offsets for I/O ASIC registers
49 * (relative to (dec_kn_slot_base + IOASIC_IOCTL)).
50 */
51 /* all systems */
52#define IO_REG_SCSI_DMA_P 0x00 /* SCSI DMA Pointer */
53#define IO_REG_SCSI_DMA_BP 0x10 /* SCSI DMA Buffer Pointer */
54#define IO_REG_LANCE_DMA_P 0x20 /* LANCE DMA Pointer */
55#define IO_REG_SCC0A_T_DMA_P 0x30 /* SCC0A Transmit DMA Pointer */
56#define IO_REG_SCC0A_R_DMA_P 0x40 /* SCC0A Receive DMA Pointer */
57
58 /* except Maxine */
59#define IO_REG_SCC1A_T_DMA_P 0x50 /* SCC1A Transmit DMA Pointer */
60#define IO_REG_SCC1A_R_DMA_P 0x60 /* SCC1A Receive DMA Pointer */
61
62 /* Maxine */
63#define IO_REG_AB_T_DMA_P 0x50 /* ACCESS.bus Transmit DMA Pointer */
64#define IO_REG_AB_R_DMA_P 0x60 /* ACCESS.bus Receive DMA Pointer */
65#define IO_REG_FLOPPY_DMA_P 0x70 /* Floppy DMA Pointer */
66#define IO_REG_ISDN_T_DMA_P 0x80 /* ISDN Transmit DMA Pointer */
67#define IO_REG_ISDN_T_DMA_BP 0x90 /* ISDN Transmit DMA Buffer Pointer */
68#define IO_REG_ISDN_R_DMA_P 0xa0 /* ISDN Receive DMA Pointer */
69#define IO_REG_ISDN_R_DMA_BP 0xb0 /* ISDN Receive DMA Buffer Pointer */
70
71 /* all systems */
72#define IO_REG_DATA_0 0xc0 /* System Data Buffer 0 */
73#define IO_REG_DATA_1 0xd0 /* System Data Buffer 1 */
74#define IO_REG_DATA_2 0xe0 /* System Data Buffer 2 */
75#define IO_REG_DATA_3 0xf0 /* System Data Buffer 3 */
76
77 /* all systems */
78#define IO_REG_SSR 0x100 /* System Support Register */
79#define IO_REG_SIR 0x110 /* System Interrupt Register */
80#define IO_REG_SIMR 0x120 /* System Interrupt Mask Reg. */
81#define IO_REG_SAR 0x130 /* System Address Register */
82
83 /* Maxine */
84#define IO_REG_ISDN_T_DATA 0x140 /* ISDN Xmit Data Register */
85#define IO_REG_ISDN_R_DATA 0x150 /* ISDN Receive Data Register */
86
87 /* all systems */
88#define IO_REG_LANCE_SLOT 0x160 /* LANCE I/O Slot Register */
89#define IO_REG_SCSI_SLOT 0x170 /* SCSI Slot Register */
90#define IO_REG_SCC0A_SLOT 0x180 /* SCC0A DMA Slot Register */
91
92 /* except Maxine */
93#define IO_REG_SCC1A_SLOT 0x190 /* SCC1A DMA Slot Register */
94
95 /* Maxine */
96#define IO_REG_AB_SLOT 0x190 /* ACCESS.bus DMA Slot Register */
97#define IO_REG_FLOPPY_SLOT 0x1a0 /* Floppy Slot Register */
98
99 /* all systems */
100#define IO_REG_SCSI_SCR 0x1b0 /* SCSI Partial-Word DMA Control */
101#define IO_REG_SCSI_SDR0 0x1c0 /* SCSI DMA Partial Word 0 */
102#define IO_REG_SCSI_SDR1 0x1d0 /* SCSI DMA Partial Word 1 */
103#define IO_REG_FCTR 0x1e0 /* Free-Running Counter */
104#define IO_REG_RES_31 0x1f0 /* unused */
105
106
107/*
108 * The upper 16 bits of the System Support Register are a part of the
109 * I/O ASIC's internal DMA engine and thus are common to all I/O ASIC
110 * machines. The exception is the Maxine, which makes use of the
111 * FLOPPY and ISDN bits (otherwise unused) and has a different SCC
112 * wiring.
113 */
114 /* all systems */
115#define IO_SSR_SCC0A_TX_DMA_EN (1<<31) /* SCC0A transmit DMA enable */
116#define IO_SSR_SCC0A_RX_DMA_EN (1<<30) /* SCC0A receive DMA enable */
117#define IO_SSR_RES_27 (1<<27) /* unused */
118#define IO_SSR_RES_26 (1<<26) /* unused */
119#define IO_SSR_RES_25 (1<<25) /* unused */
120#define IO_SSR_RES_24 (1<<24) /* unused */
121#define IO_SSR_RES_23 (1<<23) /* unused */
122#define IO_SSR_SCSI_DMA_DIR (1<<18) /* SCSI DMA direction */
123#define IO_SSR_SCSI_DMA_EN (1<<17) /* SCSI DMA enable */
124#define IO_SSR_LANCE_DMA_EN (1<<16) /* LANCE DMA enable */
125
126 /* except Maxine */
127#define IO_SSR_SCC1A_TX_DMA_EN (1<<29) /* SCC1A transmit DMA enable */
128#define IO_SSR_SCC1A_RX_DMA_EN (1<<28) /* SCC1A receive DMA enable */
129#define IO_SSR_RES_22 (1<<22) /* unused */
130#define IO_SSR_RES_21 (1<<21) /* unused */
131#define IO_SSR_RES_20 (1<<20) /* unused */
132#define IO_SSR_RES_19 (1<<19) /* unused */
133
134 /* Maxine */
135#define IO_SSR_AB_TX_DMA_EN (1<<29) /* ACCESS.bus xmit DMA enable */
136#define IO_SSR_AB_RX_DMA_EN (1<<28) /* ACCESS.bus recv DMA enable */
137#define IO_SSR_FLOPPY_DMA_DIR (1<<22) /* Floppy DMA direction */
138#define IO_SSR_FLOPPY_DMA_EN (1<<21) /* Floppy DMA enable */
139#define IO_SSR_ISDN_TX_DMA_EN (1<<20) /* ISDN transmit DMA enable */
140#define IO_SSR_ISDN_RX_DMA_EN (1<<19) /* ISDN receive DMA enable */
141
142/*
143 * The lower 16 bits are system-specific. Bits 15,11:8 are common and
144 * defined here. The rest is defined in system-specific headers.
145 */
146#define KN0X_IO_SSR_DIAGDN (1<<15) /* diagnostic jumper */
147#define KN0X_IO_SSR_SCC_RST (1<<11) /* ~SCC0,1 (Z85C30) reset */
148#define KN0X_IO_SSR_RTC_RST (1<<10) /* ~RTC (DS1287) reset */
149#define KN0X_IO_SSR_ASC_RST (1<<9) /* ~ASC (NCR53C94) reset */
150#define KN0X_IO_SSR_LANCE_RST (1<<8) /* ~LANCE (Am7990) reset */
151
152#endif /* __ASM_MIPS_DEC_IOASIC_ADDRS_H */
diff --git a/include/asm-mips/dec/ioasic_ints.h b/include/asm-mips/dec/ioasic_ints.h
deleted file mode 100644
index 9aaa9869615f..000000000000
--- a/include/asm-mips/dec/ioasic_ints.h
+++ /dev/null
@@ -1,74 +0,0 @@
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 * Definitions for the interrupt related bits in the I/O ASIC
7 * interrupt status register (and the interrupt mask register, of course)
8 *
9 * Created with Information from:
10 *
11 * "DEC 3000 300/400/500/600/700/800/900 AXP Models System Programmer's Manual"
12 *
13 * and the Mach Sources
14 *
15 * Copyright (C) 199x the Anonymous
16 * Copyright (C) 2002 Maciej W. Rozycki
17 */
18
19#ifndef __ASM_DEC_IOASIC_INTS_H
20#define __ASM_DEC_IOASIC_INTS_H
21
22/*
23 * The upper 16 bits are a part of the I/O ASIC's internal DMA engine
24 * and thus are common to all I/O ASIC machines. The exception is
25 * the Maxine, which makes use of the FLOPPY and ISDN bits (otherwise
26 * unused) and has a different SCC wiring.
27 */
28 /* all systems */
29#define IO_INR_SCC0A_TXDMA 31 /* SCC0A transmit page end */
30#define IO_INR_SCC0A_TXERR 30 /* SCC0A transmit memory read error */
31#define IO_INR_SCC0A_RXDMA 29 /* SCC0A receive half page */
32#define IO_INR_SCC0A_RXERR 28 /* SCC0A receive overrun */
33#define IO_INR_ASC_DMA 19 /* ASC buffer pointer loaded */
34#define IO_INR_ASC_ERR 18 /* ASC page overrun */
35#define IO_INR_ASC_MERR 17 /* ASC memory read error */
36#define IO_INR_LANCE_MERR 16 /* LANCE memory read error */
37
38 /* except Maxine */
39#define IO_INR_SCC1A_TXDMA 27 /* SCC1A transmit page end */
40#define IO_INR_SCC1A_TXERR 26 /* SCC1A transmit memory read error */
41#define IO_INR_SCC1A_RXDMA 25 /* SCC1A receive half page */
42#define IO_INR_SCC1A_RXERR 24 /* SCC1A receive overrun */
43#define IO_INR_RES_23 23 /* unused */
44#define IO_INR_RES_22 22 /* unused */
45#define IO_INR_RES_21 21 /* unused */
46#define IO_INR_RES_20 20 /* unused */
47
48 /* Maxine */
49#define IO_INR_AB_TXDMA 27 /* ACCESS.bus transmit page end */
50#define IO_INR_AB_TXERR 26 /* ACCESS.bus xmit memory read error */
51#define IO_INR_AB_RXDMA 25 /* ACCESS.bus receive half page */
52#define IO_INR_AB_RXERR 24 /* ACCESS.bus receive overrun */
53#define IO_INR_FLOPPY_ERR 23 /* FDC error */
54#define IO_INR_ISDN_TXDMA 22 /* ISDN xmit buffer pointer loaded */
55#define IO_INR_ISDN_RXDMA 21 /* ISDN recv buffer pointer loaded */
56#define IO_INR_ISDN_ERR 20 /* ISDN memory read/overrun error */
57
58#define IO_INR_DMA 16 /* first DMA IRQ */
59
60/*
61 * The lower 16 bits are system-specific and thus defined in
62 * system-specific headers.
63 */
64
65
66#define IO_IRQ_BASE 8 /* first IRQ assigned to I/O ASIC */
67#define IO_IRQ_LINES 32 /* number of I/O ASIC interrupts */
68
69#define IO_IRQ_NR(n) ((n) + IO_IRQ_BASE)
70#define IO_IRQ_MASK(n) (1 << (n))
71#define IO_IRQ_ALL 0x0000ffff
72#define IO_IRQ_DMA 0xffff0000
73
74#endif /* __ASM_DEC_IOASIC_INTS_H */
diff --git a/include/asm-mips/dec/kn01.h b/include/asm-mips/dec/kn01.h
deleted file mode 100644
index 28fa717ac423..000000000000
--- a/include/asm-mips/dec/kn01.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * Hardware info about DECstation DS2100/3100 systems (otherwise known as
3 * pmin/pmax or KN01).
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
10 * are by courtesy of Chris Fraser.
11 * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki
12 */
13#ifndef __ASM_MIPS_DEC_KN01_H
14#define __ASM_MIPS_DEC_KN01_H
15
16#define KN01_SLOT_BASE 0x10000000
17#define KN01_SLOT_SIZE 0x01000000
18
19/*
20 * Address ranges for devices.
21 */
22#define KN01_PMASK (0*KN01_SLOT_SIZE) /* color plane mask */
23#define KN01_PCC (1*KN01_SLOT_SIZE) /* PCC (DC503) cursor */
24#define KN01_VDAC (2*KN01_SLOT_SIZE) /* color map */
25#define KN01_RES_3 (3*KN01_SLOT_SIZE) /* unused */
26#define KN01_RES_4 (4*KN01_SLOT_SIZE) /* unused */
27#define KN01_RES_5 (5*KN01_SLOT_SIZE) /* unused */
28#define KN01_RES_6 (6*KN01_SLOT_SIZE) /* unused */
29#define KN01_ERRADDR (7*KN01_SLOT_SIZE) /* write error address */
30#define KN01_LANCE (8*KN01_SLOT_SIZE) /* LANCE (Am7990) Ethernet */
31#define KN01_LANCE_MEM (9*KN01_SLOT_SIZE) /* LANCE buffer memory */
32#define KN01_SII (10*KN01_SLOT_SIZE) /* SII (DC7061) SCSI */
33#define KN01_SII_MEM (11*KN01_SLOT_SIZE) /* SII buffer memory */
34#define KN01_DZ11 (12*KN01_SLOT_SIZE) /* DZ11 (DC7085) serial */
35#define KN01_RTC (13*KN01_SLOT_SIZE) /* DS1287 RTC (bytes #0) */
36#define KN01_ESAR (13*KN01_SLOT_SIZE) /* MAC address (bytes #1) */
37#define KN01_CSR (14*KN01_SLOT_SIZE) /* system ctrl & status reg */
38#define KN01_SYS_ROM (15*KN01_SLOT_SIZE) /* system board ROM */
39
40
41/*
42 * Frame buffer memory address.
43 */
44#define KN01_VFB_MEM 0x0fc00000
45
46/*
47 * CPU interrupt bits.
48 */
49#define KN01_CPU_INR_BUS 6 /* memory, I/O bus read/write errors */
50#define KN01_CPU_INR_VIDEO 6 /* PCC area detect #2 */
51#define KN01_CPU_INR_RTC 5 /* DS1287 RTC */
52#define KN01_CPU_INR_DZ11 4 /* DZ11 (DC7085) serial */
53#define KN01_CPU_INR_LANCE 3 /* LANCE (Am7990) Ethernet */
54#define KN01_CPU_INR_SII 2 /* SII (DC7061) SCSI */
55
56
57/*
58 * System Control & Status Register bits.
59 */
60#define KN01_CSR_MNFMOD (1<<15) /* MNFMOD manufacturing jumper */
61#define KN01_CSR_STATUS (1<<14) /* self-test result status output */
62#define KN01_CSR_PARDIS (1<<13) /* parity error disable */
63#define KN01_CSR_CRSRTST (1<<12) /* PCC test output */
64#define KN01_CSR_MONO (1<<11) /* mono/color fb SIMM installed */
65#define KN01_CSR_MEMERR (1<<10) /* write timeout error status & ack*/
66#define KN01_CSR_VINT (1<<9) /* PCC area detect #2 status & ack */
67#define KN01_CSR_TXDIS (1<<8) /* DZ11 transmit disable */
68#define KN01_CSR_VBGTRG (1<<2) /* blue DAC voltage over green (r/o) */
69#define KN01_CSR_VRGTRG (1<<1) /* red DAC voltage over green (r/o) */
70#define KN01_CSR_VRGTRB (1<<0) /* red DAC voltage over blue (r/o) */
71#define KN01_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */
72
73
74#ifndef __ASSEMBLY__
75
76#include <linux/interrupt.h>
77#include <linux/spinlock.h>
78#include <linux/types.h>
79
80struct pt_regs;
81
82extern u16 cached_kn01_csr;
83extern spinlock_t kn01_lock;
84
85extern void dec_kn01_be_init(void);
86extern int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup);
87extern irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id);
88#endif
89
90#endif /* __ASM_MIPS_DEC_KN01_H */
diff --git a/include/asm-mips/dec/kn02.h b/include/asm-mips/dec/kn02.h
deleted file mode 100644
index 93430b5f4724..000000000000
--- a/include/asm-mips/dec/kn02.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * Hardware info about DECstation 5000/200 systems (otherwise known as
3 * 3max or KN02).
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
10 * are by courtesy of Chris Fraser.
11 * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki
12 */
13#ifndef __ASM_MIPS_DEC_KN02_H
14#define __ASM_MIPS_DEC_KN02_H
15
16#define KN02_SLOT_BASE 0x1fc00000
17#define KN02_SLOT_SIZE 0x00080000
18
19/*
20 * Address ranges decoded by the "system slot" logic for onboard devices.
21 */
22#define KN02_SYS_ROM (0*KN02_SLOT_SIZE) /* system board ROM */
23#define KN02_RES_1 (1*KN02_SLOT_SIZE) /* unused */
24#define KN02_CHKSYN (2*KN02_SLOT_SIZE) /* ECC syndrome */
25#define KN02_ERRADDR (3*KN02_SLOT_SIZE) /* bus error address */
26#define KN02_DZ11 (4*KN02_SLOT_SIZE) /* DZ11 (DC7085) serial */
27#define KN02_RTC (5*KN02_SLOT_SIZE) /* DS1287 RTC */
28#define KN02_CSR (6*KN02_SLOT_SIZE) /* system ctrl & status reg */
29#define KN02_SYS_ROM_7 (7*KN02_SLOT_SIZE) /* system board ROM (alias) */
30
31
32/*
33 * System Control & Status Register bits.
34 */
35#define KN02_CSR_RES_28 (0xf<<28) /* unused */
36#define KN02_CSR_PSU (1<<27) /* power supply unit warning */
37#define KN02_CSR_NVRAM (1<<26) /* ~NVRAM clear jumper */
38#define KN02_CSR_REFEVEN (1<<25) /* mem refresh bank toggle */
39#define KN02_CSR_NRMOD (1<<24) /* ~NRMOD manufact. jumper */
40#define KN02_CSR_IOINTEN (0xff<<16) /* IRQ mask bits */
41#define KN02_CSR_DIAGCHK (1<<15) /* diagn/norml ECC reads */
42#define KN02_CSR_DIAGGEN (1<<14) /* diagn/norml ECC writes */
43#define KN02_CSR_CORRECT (1<<13) /* ECC correct/check */
44#define KN02_CSR_LEDIAG (1<<12) /* ECC diagn. latch strobe */
45#define KN02_CSR_TXDIS (1<<11) /* DZ11 transmit disable */
46#define KN02_CSR_BNK32M (1<<10) /* 32M/8M stride */
47#define KN02_CSR_DIAGDN (1<<9) /* DIAGDN manufact. jumper */
48#define KN02_CSR_BAUD38 (1<<8) /* DZ11 38/19kbps ext. rate */
49#define KN02_CSR_IOINT (0xff<<0) /* IRQ status bits (r/o) */
50#define KN02_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */
51
52
53/*
54 * CPU interrupt bits.
55 */
56#define KN02_CPU_INR_RES_6 6 /* unused */
57#define KN02_CPU_INR_BUS 5 /* memory, I/O bus read/write errors */
58#define KN02_CPU_INR_RES_4 4 /* unused */
59#define KN02_CPU_INR_RTC 3 /* DS1287 RTC */
60#define KN02_CPU_INR_CASCADE 2 /* CSR cascade */
61
62/*
63 * CSR interrupt bits.
64 */
65#define KN02_CSR_INR_DZ11 7 /* DZ11 (DC7085) serial */
66#define KN02_CSR_INR_LANCE 6 /* LANCE (Am7990) Ethernet */
67#define KN02_CSR_INR_ASC 5 /* ASC (NCR53C94) SCSI */
68#define KN02_CSR_INR_RES_4 4 /* unused */
69#define KN02_CSR_INR_RES_3 3 /* unused */
70#define KN02_CSR_INR_TC2 2 /* TURBOchannel slot #2 */
71#define KN02_CSR_INR_TC1 1 /* TURBOchannel slot #1 */
72#define KN02_CSR_INR_TC0 0 /* TURBOchannel slot #0 */
73
74
75#define KN02_IRQ_BASE 8 /* first IRQ assigned to CSR */
76#define KN02_IRQ_LINES 8 /* number of CSR interrupts */
77
78#define KN02_IRQ_NR(n) ((n) + KN02_IRQ_BASE)
79#define KN02_IRQ_MASK(n) (1 << (n))
80#define KN02_IRQ_ALL 0xff
81
82
83#ifndef __ASSEMBLY__
84
85#include <linux/types.h>
86
87extern u32 cached_kn02_csr;
88extern void init_kn02_irqs(int base);
89#endif
90
91#endif /* __ASM_MIPS_DEC_KN02_H */
diff --git a/include/asm-mips/dec/kn02ba.h b/include/asm-mips/dec/kn02ba.h
deleted file mode 100644
index c957a4f1b32d..000000000000
--- a/include/asm-mips/dec/kn02ba.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * include/asm-mips/dec/kn02ba.h
3 *
4 * DECstation 5000/1xx (3min or KN02-BA) definitions.
5 *
6 * Copyright (C) 2002, 2003 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef __ASM_MIPS_DEC_KN02BA_H
14#define __ASM_MIPS_DEC_KN02BA_H
15
16#include <asm/dec/kn02xa.h> /* For common definitions. */
17
18/*
19 * CPU interrupt bits.
20 */
21#define KN02BA_CPU_INR_HALT 6 /* HALT button */
22#define KN02BA_CPU_INR_CASCADE 5 /* I/O ASIC cascade */
23#define KN02BA_CPU_INR_TC2 4 /* TURBOchannel slot #2 */
24#define KN02BA_CPU_INR_TC1 3 /* TURBOchannel slot #1 */
25#define KN02BA_CPU_INR_TC0 2 /* TURBOchannel slot #0 */
26
27/*
28 * I/O ASIC interrupt bits. Star marks denote non-IRQ status bits.
29 */
30#define KN02BA_IO_INR_RES_15 15 /* unused */
31#define KN02BA_IO_INR_NVRAM 14 /* (*) NVRAM clear jumper */
32#define KN02BA_IO_INR_RES_13 13 /* unused */
33#define KN02BA_IO_INR_BUS 12 /* memory, I/O bus read/write errors */
34#define KN02BA_IO_INR_RES_11 11 /* unused */
35#define KN02BA_IO_INR_NRMOD 10 /* (*) NRMOD manufacturing jumper */
36#define KN02BA_IO_INR_ASC 9 /* ASC (NCR53C94) SCSI */
37#define KN02BA_IO_INR_LANCE 8 /* LANCE (Am7990) Ethernet */
38#define KN02BA_IO_INR_SCC1 7 /* SCC (Z85C30) serial #1 */
39#define KN02BA_IO_INR_SCC0 6 /* SCC (Z85C30) serial #0 */
40#define KN02BA_IO_INR_RTC 5 /* DS1287 RTC */
41#define KN02BA_IO_INR_PSU 4 /* power supply unit warning */
42#define KN02BA_IO_INR_RES_3 3 /* unused */
43#define KN02BA_IO_INR_ASC_DATA 2 /* SCSI data ready (for PIO) */
44#define KN02BA_IO_INR_PBNC 1 /* ~HALT button debouncer */
45#define KN02BA_IO_INR_PBNO 0 /* HALT button debouncer */
46
47
48/*
49 * Memory Error Register bits.
50 */
51#define KN02BA_MER_RES_27 (1<<27) /* unused */
52
53/*
54 * Memory Size Register bits.
55 */
56#define KN02BA_MSR_RES_17 (0x3ff<<17) /* unused */
57
58/*
59 * I/O ASIC System Support Register bits.
60 */
61#define KN02BA_IO_SSR_TXDIS1 (1<<14) /* SCC1 transmit disable */
62#define KN02BA_IO_SSR_TXDIS0 (1<<13) /* SCC0 transmit disable */
63#define KN02BA_IO_SSR_RES_12 (1<<12) /* unused */
64
65#define KN02BA_IO_SSR_LEDS (0xff<<0) /* ~diagnostic LEDs */
66
67#endif /* __ASM_MIPS_DEC_KN02BA_H */
diff --git a/include/asm-mips/dec/kn02ca.h b/include/asm-mips/dec/kn02ca.h
deleted file mode 100644
index 92c0fe256099..000000000000
--- a/include/asm-mips/dec/kn02ca.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * include/asm-mips/dec/kn02ca.h
3 *
4 * Personal DECstation 5000/xx (Maxine or KN02-CA) definitions.
5 *
6 * Copyright (C) 2002, 2003 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef __ASM_MIPS_DEC_KN02CA_H
14#define __ASM_MIPS_DEC_KN02CA_H
15
16#include <asm/dec/kn02xa.h> /* For common definitions. */
17
18/*
19 * CPU interrupt bits.
20 */
21#define KN02CA_CPU_INR_HALT 6 /* HALT from ACCESS.Bus */
22#define KN02CA_CPU_INR_CASCADE 5 /* I/O ASIC cascade */
23#define KN02CA_CPU_INR_BUS 4 /* memory, I/O bus read/write errors */
24#define KN02CA_CPU_INR_RTC 3 /* DS1287 RTC */
25#define KN02CA_CPU_INR_TIMER 2 /* ARC periodic timer */
26
27/*
28 * I/O ASIC interrupt bits. Star marks denote non-IRQ status bits.
29 */
30#define KN02CA_IO_INR_FLOPPY 15 /* 82077 FDC */
31#define KN02CA_IO_INR_NVRAM 14 /* (*) NVRAM clear jumper */
32#define KN02CA_IO_INR_POWERON 13 /* (*) ACCESS.Bus/power-on reset */
33#define KN02CA_IO_INR_TC0 12 /* TURBOchannel slot #0 */
34#define KN02CA_IO_INR_TIMER 12 /* ARC periodic timer (?) */
35#define KN02CA_IO_INR_ISDN 11 /* Am79C30A ISDN */
36#define KN02CA_IO_INR_NRMOD 10 /* (*) NRMOD manufacturing jumper */
37#define KN02CA_IO_INR_ASC 9 /* ASC (NCR53C94) SCSI */
38#define KN02CA_IO_INR_LANCE 8 /* LANCE (Am7990) Ethernet */
39#define KN02CA_IO_INR_HDFLOPPY 7 /* (*) HD (1.44MB) floppy status */
40#define KN02CA_IO_INR_SCC0 6 /* SCC (Z85C30) serial #0 */
41#define KN02CA_IO_INR_TC1 5 /* TURBOchannel slot #1 */
42#define KN02CA_IO_INR_XDFLOPPY 4 /* (*) XD (2.88MB) floppy status */
43#define KN02CA_IO_INR_VIDEO 3 /* framebuffer */
44#define KN02CA_IO_INR_XVIDEO 2 /* ~framebuffer */
45#define KN02CA_IO_INR_AB_XMIT 1 /* ACCESS.bus transmit */
46#define KN02CA_IO_INR_AB_RECV 0 /* ACCESS.bus receive */
47
48
49/*
50 * Memory Error Register bits.
51 */
52#define KN02CA_MER_INTR (1<<27) /* ARC IRQ status & ack */
53
54/*
55 * Memory Size Register bits.
56 */
57#define KN02CA_MSR_INTREN (1<<26) /* ARC periodic IRQ enable */
58#define KN02CA_MSR_MS10EN (1<<25) /* 10/1ms IRQ period select */
59#define KN02CA_MSR_PFORCE (0xf<<21) /* byte lane error force */
60#define KN02CA_MSR_MABEN (1<<20) /* A side VFB address enable */
61#define KN02CA_MSR_LASTBANK (0x7<<17) /* onboard RAM bank # */
62
63/*
64 * I/O ASIC System Support Register bits.
65 */
66#define KN03CA_IO_SSR_RES_14 (1<<14) /* unused */
67#define KN03CA_IO_SSR_RES_13 (1<<13) /* unused */
68#define KN03CA_IO_SSR_ISDN_RST (1<<12) /* ~ISDN (Am79C30A) reset */
69
70#define KN03CA_IO_SSR_FLOPPY_RST (1<<7) /* ~FDC (82077) reset */
71#define KN03CA_IO_SSR_VIDEO_RST (1<<6) /* ~framebuffer reset */
72#define KN03CA_IO_SSR_AB_RST (1<<5) /* ACCESS.bus reset */
73#define KN03CA_IO_SSR_RES_4 (1<<4) /* unused */
74#define KN03CA_IO_SSR_RES_3 (1<<4) /* unused */
75#define KN03CA_IO_SSR_RES_2 (1<<2) /* unused */
76#define KN03CA_IO_SSR_RES_1 (1<<1) /* unused */
77#define KN03CA_IO_SSR_LED (1<<0) /* power LED */
78
79#endif /* __ASM_MIPS_DEC_KN02CA_H */
diff --git a/include/asm-mips/dec/kn02xa.h b/include/asm-mips/dec/kn02xa.h
deleted file mode 100644
index b56b4577f6ef..000000000000
--- a/include/asm-mips/dec/kn02xa.h
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * Hardware info common to DECstation 5000/1xx systems (otherwise
3 * known as 3min or kn02ba) and Personal DECstations 5000/xx ones
4 * (otherwise known as maxine or kn02ca).
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
11 * are by courtesy of Chris Fraser.
12 * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki
13 *
14 * These are addresses which have to be known early in the boot process.
15 * For other addresses refer to tc.h, ioasic_addrs.h and friends.
16 */
17#ifndef __ASM_MIPS_DEC_KN02XA_H
18#define __ASM_MIPS_DEC_KN02XA_H
19
20#include <asm/dec/ioasic_addrs.h>
21
22#define KN02XA_SLOT_BASE 0x1c000000
23
24/*
25 * Memory control ASIC registers.
26 */
27#define KN02XA_MER 0x0c400000 /* memory error register */
28#define KN02XA_MSR 0x0c800000 /* memory size register */
29
30/*
31 * CPU control ASIC registers.
32 */
33#define KN02XA_MEM_CONF 0x0e000000 /* write timeout config */
34#define KN02XA_EAR 0x0e000004 /* error address register */
35#define KN02XA_BOOT0 0x0e000008 /* boot 0 register */
36#define KN02XA_MEM_INTR 0x0e00000c /* write err IRQ stat & ack */
37
38/*
39 * Memory Error Register bits, common definitions.
40 * The rest is defined in system-specific headers.
41 */
42#define KN02XA_MER_RES_28 (0xf<<28) /* unused */
43#define KN02XA_MER_RES_17 (0x3ff<<17) /* unused */
44#define KN02XA_MER_PAGERR (1<<16) /* 2k page boundary error */
45#define KN02XA_MER_TRANSERR (1<<15) /* transfer length error */
46#define KN02XA_MER_PARDIS (1<<14) /* parity error disable */
47#define KN02XA_MER_SIZE (1<<13) /* r/o mirror of MSR_SIZE */
48#define KN02XA_MER_RES_12 (1<<12) /* unused */
49#define KN02XA_MER_BYTERR (0xf<<8) /* byte lane error bitmask: */
50#define KN02XA_MER_BYTERR_3 (0x8<<8) /* byte lane #3 */
51#define KN02XA_MER_BYTERR_2 (0x4<<8) /* byte lane #2 */
52#define KN02XA_MER_BYTERR_1 (0x2<<8) /* byte lane #1 */
53#define KN02XA_MER_BYTERR_0 (0x1<<8) /* byte lane #0 */
54#define KN02XA_MER_RES_0 (0xff<<0) /* unused */
55
56/*
57 * Memory Size Register bits, common definitions.
58 * The rest is defined in system-specific headers.
59 */
60#define KN02XA_MSR_RES_27 (0x1f<<27) /* unused */
61#define KN02XA_MSR_RES_14 (0x7<<14) /* unused */
62#define KN02XA_MSR_SIZE (1<<13) /* 16M/4M stride */
63#define KN02XA_MSR_RES_0 (0x1fff<<0) /* unused */
64
65/*
66 * Error Address Register bits.
67 */
68#define KN02XA_EAR_RES_29 (0x7<<29) /* unused */
69#define KN02XA_EAR_ADDRESS (0x7ffffff<<2) /* address involved */
70#define KN02XA_EAR_RES_0 (0x3<<0) /* unused */
71
72
73#ifndef __ASSEMBLY__
74
75#include <linux/interrupt.h>
76
77struct pt_regs;
78
79extern void dec_kn02xa_be_init(void);
80extern int dec_kn02xa_be_handler(struct pt_regs *regs, int is_fixup);
81extern irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id);
82#endif
83
84#endif /* __ASM_MIPS_DEC_KN02XA_H */
diff --git a/include/asm-mips/dec/kn03.h b/include/asm-mips/dec/kn03.h
deleted file mode 100644
index edede923ffb8..000000000000
--- a/include/asm-mips/dec/kn03.h
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * Hardware info about DECstation 5000/2x0 systems (otherwise known as
3 * 3max+) and DECsystem 5900 systems (otherwise known as bigmax) which
4 * differ mechanically but are otherwise identical (both are known as
5 * KN03).
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions
12 * are by courtesy of Chris Fraser.
13 * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki
14 */
15#ifndef __ASM_MIPS_DEC_KN03_H
16#define __ASM_MIPS_DEC_KN03_H
17
18#include <asm/dec/ecc.h>
19#include <asm/dec/ioasic_addrs.h>
20
21#define KN03_SLOT_BASE 0x1f800000
22
23/*
24 * CPU interrupt bits.
25 */
26#define KN03_CPU_INR_HALT 6 /* HALT button */
27#define KN03_CPU_INR_BUS 5 /* memory, I/O bus read/write errors */
28#define KN03_CPU_INR_RES_4 4 /* unused */
29#define KN03_CPU_INR_RTC 3 /* DS1287 RTC */
30#define KN03_CPU_INR_CASCADE 2 /* I/O ASIC cascade */
31
32/*
33 * I/O ASIC interrupt bits. Star marks denote non-IRQ status bits.
34 */
35#define KN03_IO_INR_3MAXP 15 /* (*) 3max+/bigmax ID */
36#define KN03_IO_INR_NVRAM 14 /* (*) NVRAM clear jumper */
37#define KN03_IO_INR_TC2 13 /* TURBOchannel slot #2 */
38#define KN03_IO_INR_TC1 12 /* TURBOchannel slot #1 */
39#define KN03_IO_INR_TC0 11 /* TURBOchannel slot #0 */
40#define KN03_IO_INR_NRMOD 10 /* (*) NRMOD manufacturing jumper */
41#define KN03_IO_INR_ASC 9 /* ASC (NCR53C94) SCSI */
42#define KN03_IO_INR_LANCE 8 /* LANCE (Am7990) Ethernet */
43#define KN03_IO_INR_SCC1 7 /* SCC (Z85C30) serial #1 */
44#define KN03_IO_INR_SCC0 6 /* SCC (Z85C30) serial #0 */
45#define KN03_IO_INR_RTC 5 /* DS1287 RTC */
46#define KN03_IO_INR_PSU 4 /* power supply unit warning */
47#define KN03_IO_INR_RES_3 3 /* unused */
48#define KN03_IO_INR_ASC_DATA 2 /* SCSI data ready (for PIO) */
49#define KN03_IO_INR_PBNC 1 /* ~HALT button debouncer */
50#define KN03_IO_INR_PBNO 0 /* HALT button debouncer */
51
52
53/*
54 * Memory Control Register bits.
55 */
56#define KN03_MCR_RES_16 (0xffff<<16) /* unused */
57#define KN03_MCR_DIAGCHK (1<<15) /* diagn/norml ECC reads */
58#define KN03_MCR_DIAGGEN (1<<14) /* diagn/norml ECC writes */
59#define KN03_MCR_CORRECT (1<<13) /* ECC correct/check */
60#define KN03_MCR_RES_11 (0x3<<12) /* unused */
61#define KN03_MCR_BNK32M (1<<10) /* 32M/8M stride */
62#define KN03_MCR_RES_7 (0x7<<7) /* unused */
63#define KN03_MCR_CHECK (0x7f<<0) /* diagnostic check bits */
64
65/*
66 * I/O ASIC System Support Register bits.
67 */
68#define KN03_IO_SSR_TXDIS1 (1<<14) /* SCC1 transmit disable */
69#define KN03_IO_SSR_TXDIS0 (1<<13) /* SCC0 transmit disable */
70#define KN03_IO_SSR_RES_12 (1<<12) /* unused */
71
72#define KN03_IO_SSR_LEDS (0xff<<0) /* ~diagnostic LEDs */
73
74#endif /* __ASM_MIPS_DEC_KN03_H */
diff --git a/include/asm-mips/dec/kn05.h b/include/asm-mips/dec/kn05.h
deleted file mode 100644
index 56d22dc8803a..000000000000
--- a/include/asm-mips/dec/kn05.h
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * include/asm-mips/dec/kn05.h
3 *
4 * DECstation/DECsystem 5000/260 (4max+ or KN05), 5000/150 (4min
5 * or KN04-BA), Personal DECstation/DECsystem 5000/50 (4maxine or
6 * KN04-CA) and DECsystem 5900/260 (KN05) R4k CPU card MB ASIC
7 * definitions.
8 *
9 * Copyright (C) 2002, 2003, 2005, 2008 Maciej W. Rozycki
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 *
16 * WARNING! All this information is pure guesswork based on the
17 * ROM. It is provided here in hope it will give someone some
18 * food for thought. No documentation for the KN05 nor the KN04
19 * module has been located so far.
20 */
21#ifndef __ASM_MIPS_DEC_KN05_H
22#define __ASM_MIPS_DEC_KN05_H
23
24#include <asm/dec/ioasic_addrs.h>
25
26/*
27 * The oncard MB (Memory Buffer) ASIC provides an additional address
28 * decoder. Certain address ranges within the "high" 16 slots are
29 * passed to the I/O ASIC's decoder like with the KN03 or KN02-BA/CA.
30 * Others are handled locally. "Low" slots are always passed.
31 */
32#define KN4K_SLOT_BASE 0x1fc00000
33
34#define KN4K_MB_ROM (0*IOASIC_SLOT_SIZE) /* KN05/KN04 card ROM */
35#define KN4K_IOCTL (1*IOASIC_SLOT_SIZE) /* I/O ASIC */
36#define KN4K_ESAR (2*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */
37#define KN4K_LANCE (3*IOASIC_SLOT_SIZE) /* LANCE Ethernet */
38#define KN4K_MB_INT (4*IOASIC_SLOT_SIZE) /* MB interrupt register */
39#define KN4K_MB_EA (5*IOASIC_SLOT_SIZE) /* MB error address? */
40#define KN4K_MB_EC (6*IOASIC_SLOT_SIZE) /* MB error ??? */
41#define KN4K_MB_CSR (7*IOASIC_SLOT_SIZE) /* MB control & status */
42#define KN4K_RES_08 (8*IOASIC_SLOT_SIZE) /* unused? */
43#define KN4K_RES_09 (9*IOASIC_SLOT_SIZE) /* unused? */
44#define KN4K_RES_10 (10*IOASIC_SLOT_SIZE) /* unused? */
45#define KN4K_RES_11 (11*IOASIC_SLOT_SIZE) /* unused? */
46#define KN4K_SCSI (12*IOASIC_SLOT_SIZE) /* ASC SCSI */
47#define KN4K_RES_13 (13*IOASIC_SLOT_SIZE) /* unused? */
48#define KN4K_RES_14 (14*IOASIC_SLOT_SIZE) /* unused? */
49#define KN4K_RES_15 (15*IOASIC_SLOT_SIZE) /* unused? */
50
51/*
52 * Bits for the MB interrupt register.
53 * The register appears read-only.
54 */
55#define KN4K_MB_INT_TC (1<<0) /* TURBOchannel? */
56#define KN4K_MB_INT_RTC (1<<1) /* RTC? */
57#define KN4K_MB_INT_MT (1<<3) /* I/O ASIC cascade */
58
59/*
60 * Bits for the MB control & status register.
61 * Set to 0x00bf8001 for KN05 and to 0x003f8000 for KN04 by the firmware.
62 */
63#define KN4K_MB_CSR_PF (1<<0) /* PreFetching enable? */
64#define KN4K_MB_CSR_F (1<<1) /* ??? */
65#define KN4K_MB_CSR_ECC (0xff<<2) /* ??? */
66#define KN4K_MB_CSR_OD (1<<10) /* ??? */
67#define KN4K_MB_CSR_CP (1<<11) /* ??? */
68#define KN4K_MB_CSR_UNC (1<<12) /* ??? */
69#define KN4K_MB_CSR_IM (1<<13) /* ??? */
70#define KN4K_MB_CSR_NC (1<<14) /* ??? */
71#define KN4K_MB_CSR_EE (1<<15) /* (bus) Exception Enable? */
72#define KN4K_MB_CSR_MSK (0x1f<<16) /* CPU Int[4:0] mask */
73#define KN4K_MB_CSR_FW (1<<21) /* ??? */
74#define KN4K_MB_CSR_W (1<<31) /* ??? */
75
76#endif /* __ASM_MIPS_DEC_KN05_H */
diff --git a/include/asm-mips/dec/kn230.h b/include/asm-mips/dec/kn230.h
deleted file mode 100644
index ff1bf17de8d8..000000000000
--- a/include/asm-mips/dec/kn230.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * include/asm-mips/dec/kn230.h
3 *
4 * DECsystem 5100 (MIPSmate or KN230) definitions.
5 *
6 * Copyright (C) 2002, 2003 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef __ASM_MIPS_DEC_KN230_H
14#define __ASM_MIPS_DEC_KN230_H
15
16/*
17 * CPU interrupt bits.
18 */
19#define KN230_CPU_INR_HALT 6 /* HALT button */
20#define KN230_CPU_INR_BUS 5 /* memory, I/O bus read/write errors */
21#define KN230_CPU_INR_RTC 4 /* DS1287 RTC */
22#define KN230_CPU_INR_SII 3 /* SII (DC7061) SCSI */
23#define KN230_CPU_INR_LANCE 3 /* LANCE (Am7990) Ethernet */
24#define KN230_CPU_INR_DZ11 2 /* DZ11 (DC7085) serial */
25
26#endif /* __ASM_MIPS_DEC_KN230_H */
diff --git a/include/asm-mips/dec/machtype.h b/include/asm-mips/dec/machtype.h
deleted file mode 100644
index a6ecdebc430a..000000000000
--- a/include/asm-mips/dec/machtype.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Various machine type macros
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 (c) 1998, 2000 Harald Koerfgen
9 */
10
11#ifndef __ASM_DEC_MACHTYPE_H
12#define __ASM_DEC_MACHTYPE_H
13
14#include <asm/bootinfo.h>
15
16#define TURBOCHANNEL (mips_machtype == MACH_DS5000_200 || \
17 mips_machtype == MACH_DS5000_1XX || \
18 mips_machtype == MACH_DS5000_XX || \
19 mips_machtype == MACH_DS5000_2X0 || \
20 mips_machtype == MACH_DS5900)
21
22#define IOASIC (mips_machtype == MACH_DS5000_1XX || \
23 mips_machtype == MACH_DS5000_XX || \
24 mips_machtype == MACH_DS5000_2X0 || \
25 mips_machtype == MACH_DS5900)
26
27#endif
diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h
deleted file mode 100644
index b9c8203688d5..000000000000
--- a/include/asm-mips/dec/prom.h
+++ /dev/null
@@ -1,174 +0,0 @@
1/*
2 * include/asm-mips/dec/prom.h
3 *
4 * DECstation PROM interface.
5 *
6 * Copyright (C) 2002 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 *
13 * Based on arch/mips/dec/prom/prom.h by the Anonymous.
14 */
15#ifndef _ASM_DEC_PROM_H
16#define _ASM_DEC_PROM_H
17
18#include <linux/types.h>
19
20#include <asm/addrspace.h>
21
22/*
23 * PMAX/3MAX PROM entry points for DS2100/3100's and DS5000/2xx's.
24 * Many of these will work for MIPSen as well!
25 */
26#define VEC_RESET (u64 *)CKSEG1ADDR(0x1fc00000)
27 /* Prom base address */
28
29#define PMAX_PROM_ENTRY(x) (VEC_RESET + (x)) /* Prom jump table */
30
31#define PMAX_PROM_HALT PMAX_PROM_ENTRY(2) /* valid on MIPSen */
32#define PMAX_PROM_AUTOBOOT PMAX_PROM_ENTRY(5) /* valid on MIPSen */
33#define PMAX_PROM_OPEN PMAX_PROM_ENTRY(6)
34#define PMAX_PROM_READ PMAX_PROM_ENTRY(7)
35#define PMAX_PROM_CLOSE PMAX_PROM_ENTRY(10)
36#define PMAX_PROM_LSEEK PMAX_PROM_ENTRY(11)
37#define PMAX_PROM_GETCHAR PMAX_PROM_ENTRY(12)
38#define PMAX_PROM_PUTCHAR PMAX_PROM_ENTRY(13) /* 12 on MIPSen */
39#define PMAX_PROM_GETS PMAX_PROM_ENTRY(15)
40#define PMAX_PROM_PRINTF PMAX_PROM_ENTRY(17)
41#define PMAX_PROM_GETENV PMAX_PROM_ENTRY(33) /* valid on MIPSen */
42
43
44/*
45 * Magic number indicating REX PROM available on DECstation. Found in
46 * register a2 on transfer of control to program from PROM.
47 */
48#define REX_PROM_MAGIC 0x30464354
49
50#ifdef CONFIG_64BIT
51
52#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */
53
54#else /* !CONFIG_64BIT */
55
56#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC)
57
58#endif /* !CONFIG_64BIT */
59
60
61/*
62 * 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and
63 * DS5000/2x0.
64 */
65#define REX_PROM_GETBITMAP 0x84/4 /* get mem bitmap */
66#define REX_PROM_GETCHAR 0x24/4 /* getch() */
67#define REX_PROM_GETENV 0x64/4 /* get env. variable */
68#define REX_PROM_GETSYSID 0x80/4 /* get system id */
69#define REX_PROM_GETTCINFO 0xa4/4
70#define REX_PROM_PRINTF 0x30/4 /* printf() */
71#define REX_PROM_SLOTADDR 0x6c/4 /* slotaddr */
72#define REX_PROM_BOOTINIT 0x54/4 /* open() */
73#define REX_PROM_BOOTREAD 0x58/4 /* read() */
74#define REX_PROM_CLEARCACHE 0x7c/4
75
76
77/*
78 * Used by rex_getbitmap().
79 */
80typedef struct {
81 int pagesize;
82 unsigned char bitmap[0];
83} memmap;
84
85
86/*
87 * Function pointers as read from a PROM's callback vector.
88 */
89extern int (*__rex_bootinit)(void);
90extern int (*__rex_bootread)(void);
91extern int (*__rex_getbitmap)(memmap *);
92extern unsigned long *(*__rex_slot_address)(int);
93extern void *(*__rex_gettcinfo)(void);
94extern int (*__rex_getsysid)(void);
95extern void (*__rex_clear_cache)(void);
96
97extern int (*__prom_getchar)(void);
98extern char *(*__prom_getenv)(char *);
99extern int (*__prom_printf)(char *, ...);
100
101extern int (*__pmax_open)(char*, int);
102extern int (*__pmax_lseek)(int, long, int);
103extern int (*__pmax_read)(int, void *, int);
104extern int (*__pmax_close)(int);
105
106
107#ifdef CONFIG_64BIT
108
109/*
110 * On MIPS64 we have to call PROM functions via a helper
111 * dispatcher to accomodate ABI incompatibilities.
112 */
113#define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \
114 __asm__(#fun " = call_o32")
115
116int __DEC_PROM_O32(_rex_bootinit, (int (*)(void)));
117int __DEC_PROM_O32(_rex_bootread, (int (*)(void)));
118int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), memmap *));
119unsigned long *__DEC_PROM_O32(_rex_slot_address,
120 (unsigned long *(*)(int), int));
121void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void)));
122int __DEC_PROM_O32(_rex_getsysid, (int (*)(void)));
123void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void)));
124
125int __DEC_PROM_O32(_prom_getchar, (int (*)(void)));
126char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), char *));
127int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), char *, ...));
128
129
130#define rex_bootinit() _rex_bootinit(__rex_bootinit)
131#define rex_bootread() _rex_bootread(__rex_bootread)
132#define rex_getbitmap(x) _rex_getbitmap(__rex_getbitmap, x)
133#define rex_slot_address(x) _rex_slot_address(__rex_slot_address, x)
134#define rex_gettcinfo() _rex_gettcinfo(__rex_gettcinfo)
135#define rex_getsysid() _rex_getsysid(__rex_getsysid)
136#define rex_clear_cache() _rex_clear_cache(__rex_clear_cache)
137
138#define prom_getchar() _prom_getchar(__prom_getchar)
139#define prom_getenv(x) _prom_getenv(__prom_getenv, x)
140#define prom_printf(x...) _prom_printf(__prom_printf, x)
141
142#else /* !CONFIG_64BIT */
143
144/*
145 * On plain MIPS we just call PROM functions directly.
146 */
147#define rex_bootinit __rex_bootinit
148#define rex_bootread __rex_bootread
149#define rex_getbitmap __rex_getbitmap
150#define rex_slot_address __rex_slot_address
151#define rex_gettcinfo __rex_gettcinfo
152#define rex_getsysid __rex_getsysid
153#define rex_clear_cache __rex_clear_cache
154
155#define prom_getchar __prom_getchar
156#define prom_getenv __prom_getenv
157#define prom_printf __prom_printf
158
159#define pmax_open __pmax_open
160#define pmax_lseek __pmax_lseek
161#define pmax_read __pmax_read
162#define pmax_close __pmax_close
163
164#endif /* !CONFIG_64BIT */
165
166
167extern void prom_meminit(u32);
168extern void prom_identify_arch(u32);
169extern void prom_init_cmdline(s32, s32 *, u32);
170
171extern void register_prom_console(void);
172extern void unregister_prom_console(void);
173
174#endif /* _ASM_DEC_PROM_H */
diff --git a/include/asm-mips/dec/system.h b/include/asm-mips/dec/system.h
deleted file mode 100644
index b2afaccd6831..000000000000
--- a/include/asm-mips/dec/system.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * include/asm-mips/dec/system.h
3 *
4 * Generic DECstation/DECsystem bits.
5 *
6 * Copyright (C) 2005, 2006 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef __ASM_DEC_SYSTEM_H
14#define __ASM_DEC_SYSTEM_H
15
16extern unsigned long dec_kn_slot_base, dec_kn_slot_size;
17extern int dec_tc_bus;
18
19#endif /* __ASM_DEC_SYSTEM_H */
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
deleted file mode 100644
index b0bccd2c4ed5..000000000000
--- a/include/asm-mips/delay.h
+++ /dev/null
@@ -1,112 +0,0 @@
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 * Copyright (C) 1994 by Waldorf Electronics
7 * Copyright (C) 1995 - 2000, 01, 03 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 * Copyright (C) 2007 Maciej W. Rozycki
10 */
11#ifndef _ASM_DELAY_H
12#define _ASM_DELAY_H
13
14#include <linux/param.h>
15#include <linux/smp.h>
16
17#include <asm/compiler.h>
18#include <asm/war.h>
19
20static inline void __delay(unsigned long loops)
21{
22 if (sizeof(long) == 4)
23 __asm__ __volatile__ (
24 " .set noreorder \n"
25 " .align 3 \n"
26 "1: bnez %0, 1b \n"
27 " subu %0, 1 \n"
28 " .set reorder \n"
29 : "=r" (loops)
30 : "0" (loops));
31 else if (sizeof(long) == 8 && !DADDI_WAR)
32 __asm__ __volatile__ (
33 " .set noreorder \n"
34 " .align 3 \n"
35 "1: bnez %0, 1b \n"
36 " dsubu %0, 1 \n"
37 " .set reorder \n"
38 : "=r" (loops)
39 : "0" (loops));
40 else if (sizeof(long) == 8 && DADDI_WAR)
41 __asm__ __volatile__ (
42 " .set noreorder \n"
43 " .align 3 \n"
44 "1: bnez %0, 1b \n"
45 " dsubu %0, %2 \n"
46 " .set reorder \n"
47 : "=r" (loops)
48 : "0" (loops), "r" (1));
49}
50
51
52/*
53 * Division by multiplication: you don't have to worry about
54 * loss of precision.
55 *
56 * Use only for very small delays ( < 1 msec). Should probably use a
57 * lookup table, really, as the multiplications take much too long with
58 * short delays. This is a "reasonable" implementation, though (and the
59 * first constant multiplications gets optimized away if the delay is
60 * a constant)
61 */
62
63static inline void __udelay(unsigned long usecs, unsigned long lpj)
64{
65 unsigned long hi, lo;
66
67 /*
68 * The rates of 128 is rounded wrongly by the catchall case
69 * for 64-bit. Excessive precission? Probably ...
70 */
71#if defined(CONFIG_64BIT) && (HZ == 128)
72 usecs *= 0x0008637bd05af6c7UL; /* 2**64 / (1000000 / HZ) */
73#elif defined(CONFIG_64BIT)
74 usecs *= (0x8000000000000000UL / (500000 / HZ));
75#else /* 32-bit junk follows here */
76 usecs *= (unsigned long) (((0x8000000000000000ULL / (500000 / HZ)) +
77 0x80000000ULL) >> 32);
78#endif
79
80 if (sizeof(long) == 4)
81 __asm__("multu\t%2, %3"
82 : "=h" (usecs), "=l" (lo)
83 : "r" (usecs), "r" (lpj)
84 : GCC_REG_ACCUM);
85 else if (sizeof(long) == 8 && !R4000_WAR)
86 __asm__("dmultu\t%2, %3"
87 : "=h" (usecs), "=l" (lo)
88 : "r" (usecs), "r" (lpj)
89 : GCC_REG_ACCUM);
90 else if (sizeof(long) == 8 && R4000_WAR)
91 __asm__("dmultu\t%3, %4\n\tmfhi\t%0"
92 : "=r" (usecs), "=h" (hi), "=l" (lo)
93 : "r" (usecs), "r" (lpj)
94 : GCC_REG_ACCUM);
95
96 __delay(usecs);
97}
98
99#define __udelay_val cpu_data[raw_smp_processor_id()].udelay_val
100
101#define udelay(usecs) __udelay((usecs), __udelay_val)
102
103/* make sure "usecs *= ..." in udelay do not overflow. */
104#if HZ >= 1000
105#define MAX_UDELAY_MS 1
106#elif HZ <= 200
107#define MAX_UDELAY_MS 5
108#else
109#define MAX_UDELAY_MS (1000 / HZ)
110#endif
111
112#endif /* _ASM_DELAY_H */
diff --git a/include/asm-mips/device.h b/include/asm-mips/device.h
deleted file mode 100644
index d8f9872b0e2d..000000000000
--- a/include/asm-mips/device.h
+++ /dev/null
@@ -1,7 +0,0 @@
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-mips/div64.h b/include/asm-mips/div64.h
deleted file mode 100644
index d1d699105c11..000000000000
--- a/include/asm-mips/div64.h
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * Copyright (C) 2000, 2004 Maciej W. Rozycki
3 * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9#ifndef _ASM_DIV64_H
10#define _ASM_DIV64_H
11
12#include <linux/types.h>
13
14#if (_MIPS_SZLONG == 32)
15
16#include <asm/compiler.h>
17
18/*
19 * No traps on overflows for any of these...
20 */
21
22#define do_div64_32(res, high, low, base) ({ \
23 unsigned long __quot32, __mod32; \
24 unsigned long __cf, __tmp, __tmp2, __i; \
25 \
26 __asm__(".set push\n\t" \
27 ".set noat\n\t" \
28 ".set noreorder\n\t" \
29 "move %2, $0\n\t" \
30 "move %3, $0\n\t" \
31 "b 1f\n\t" \
32 " li %4, 0x21\n" \
33 "0:\n\t" \
34 "sll $1, %0, 0x1\n\t" \
35 "srl %3, %0, 0x1f\n\t" \
36 "or %0, $1, %5\n\t" \
37 "sll %1, %1, 0x1\n\t" \
38 "sll %2, %2, 0x1\n" \
39 "1:\n\t" \
40 "bnez %3, 2f\n\t" \
41 " sltu %5, %0, %z6\n\t" \
42 "bnez %5, 3f\n" \
43 "2:\n\t" \
44 " addiu %4, %4, -1\n\t" \
45 "subu %0, %0, %z6\n\t" \
46 "addiu %2, %2, 1\n" \
47 "3:\n\t" \
48 "bnez %4, 0b\n\t" \
49 " srl %5, %1, 0x1f\n\t" \
50 ".set pop" \
51 : "=&r" (__mod32), "=&r" (__tmp), \
52 "=&r" (__quot32), "=&r" (__cf), \
53 "=&r" (__i), "=&r" (__tmp2) \
54 : "Jr" (base), "0" (high), "1" (low)); \
55 \
56 (res) = __quot32; \
57 __mod32; })
58
59#define do_div(n, base) ({ \
60 unsigned long long __quot; \
61 unsigned long __mod; \
62 unsigned long long __div; \
63 unsigned long __upper, __low, __high, __base; \
64 \
65 __div = (n); \
66 __base = (base); \
67 \
68 __high = __div >> 32; \
69 __low = __div; \
70 __upper = __high; \
71 \
72 if (__high) \
73 __asm__("divu $0, %z2, %z3" \
74 : "=h" (__upper), "=l" (__high) \
75 : "Jr" (__high), "Jr" (__base) \
76 : GCC_REG_ACCUM); \
77 \
78 __mod = do_div64_32(__low, __upper, __low, __base); \
79 \
80 __quot = __high; \
81 __quot = __quot << 32 | __low; \
82 (n) = __quot; \
83 __mod; })
84
85#endif /* (_MIPS_SZLONG == 32) */
86
87#if (_MIPS_SZLONG == 64)
88
89/*
90 * Hey, we're already 64-bit, no
91 * need to play games..
92 */
93#define do_div(n, base) ({ \
94 unsigned long __quot; \
95 unsigned int __mod; \
96 unsigned long __div; \
97 unsigned int __base; \
98 \
99 __div = (n); \
100 __base = (base); \
101 \
102 __mod = __div % __base; \
103 __quot = __div / __base; \
104 \
105 (n) = __quot; \
106 __mod; })
107
108#endif /* (_MIPS_SZLONG == 64) */
109
110#endif /* _ASM_DIV64_H */
diff --git a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h
deleted file mode 100644
index c64afb40cd06..000000000000
--- a/include/asm-mips/dma-mapping.h
+++ /dev/null
@@ -1,81 +0,0 @@
1#ifndef _ASM_DMA_MAPPING_H
2#define _ASM_DMA_MAPPING_H
3
4#include <asm/scatterlist.h>
5#include <asm/cache.h>
6
7void *dma_alloc_noncoherent(struct device *dev, size_t size,
8 dma_addr_t *dma_handle, gfp_t flag);
9
10void dma_free_noncoherent(struct device *dev, size_t size,
11 void *vaddr, dma_addr_t dma_handle);
12
13void *dma_alloc_coherent(struct device *dev, size_t size,
14 dma_addr_t *dma_handle, gfp_t flag);
15
16void dma_free_coherent(struct device *dev, size_t size,
17 void *vaddr, dma_addr_t dma_handle);
18
19extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
20 enum dma_data_direction direction);
21extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
22 size_t size, enum dma_data_direction direction);
23extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
24 enum dma_data_direction direction);
25extern dma_addr_t dma_map_page(struct device *dev, struct page *page,
26 unsigned long offset, size_t size, enum dma_data_direction direction);
27extern void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
28 size_t size, enum dma_data_direction direction);
29extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
30 int nhwentries, enum dma_data_direction direction);
31extern void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
32 size_t size, enum dma_data_direction direction);
33extern void dma_sync_single_for_device(struct device *dev,
34 dma_addr_t dma_handle, size_t size, enum dma_data_direction direction);
35extern void dma_sync_single_range_for_cpu(struct device *dev,
36 dma_addr_t dma_handle, unsigned long offset, size_t size,
37 enum dma_data_direction direction);
38extern void dma_sync_single_range_for_device(struct device *dev,
39 dma_addr_t dma_handle, unsigned long offset, size_t size,
40 enum dma_data_direction direction);
41extern void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
42 int nelems, enum dma_data_direction direction);
43extern void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
44 int nelems, enum dma_data_direction direction);
45extern int dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
46extern int dma_supported(struct device *dev, u64 mask);
47
48static inline int
49dma_set_mask(struct device *dev, u64 mask)
50{
51 if(!dev->dma_mask || !dma_supported(dev, mask))
52 return -EIO;
53
54 *dev->dma_mask = mask;
55
56 return 0;
57}
58
59static inline int
60dma_get_cache_alignment(void)
61{
62 /* XXX Largest on any MIPS */
63 return 128;
64}
65
66extern int dma_is_consistent(struct device *dev, dma_addr_t dma_addr);
67
68extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
69 enum dma_data_direction direction);
70
71#if 0
72#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
73
74extern int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
75 dma_addr_t device_addr, size_t size, int flags);
76extern void dma_release_declared_memory(struct device *dev);
77extern void * dma_mark_declared_memory_occupied(struct device *dev,
78 dma_addr_t device_addr, size_t size);
79#endif
80
81#endif /* _ASM_DMA_MAPPING_H */
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h
deleted file mode 100644
index 1353c81065d1..000000000000
--- a/include/asm-mips/dma.h
+++ /dev/null
@@ -1,315 +0,0 @@
1/*
2 * linux/include/asm/dma.h: Defines for using and allocating dma channels.
3 * Written by Hennus Bergman, 1992.
4 * High DMA channel support & info by Hannu Savolainen
5 * and John Boyd, Nov. 1992.
6 *
7 * NOTE: all this is true *only* for ISA/EISA expansions on Mips boards
8 * and can only be used for expansion cards. Onboard DMA controllers, such
9 * as the R4030 on Jazz boards behave totally different!
10 */
11
12#ifndef _ASM_DMA_H
13#define _ASM_DMA_H
14
15#include <asm/io.h> /* need byte IO */
16#include <linux/spinlock.h> /* And spinlocks */
17#include <linux/delay.h>
18#include <asm/system.h>
19
20
21#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
22#define dma_outb outb_p
23#else
24#define dma_outb outb
25#endif
26
27#define dma_inb inb
28
29/*
30 * NOTES about DMA transfers:
31 *
32 * controller 1: channels 0-3, byte operations, ports 00-1F
33 * controller 2: channels 4-7, word operations, ports C0-DF
34 *
35 * - ALL registers are 8 bits only, regardless of transfer size
36 * - channel 4 is not used - cascades 1 into 2.
37 * - channels 0-3 are byte - addresses/counts are for physical bytes
38 * - channels 5-7 are word - addresses/counts are for physical words
39 * - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries
40 * - transfer count loaded to registers is 1 less than actual count
41 * - controller 2 offsets are all even (2x offsets for controller 1)
42 * - page registers for 5-7 don't use data bit 0, represent 128K pages
43 * - page registers for 0-3 use bit 0, represent 64K pages
44 *
45 * DMA transfers are limited to the lower 16MB of _physical_ memory.
46 * Note that addresses loaded into registers must be _physical_ addresses,
47 * not logical addresses (which may differ if paging is active).
48 *
49 * Address mapping for channels 0-3:
50 *
51 * A23 ... A16 A15 ... A8 A7 ... A0 (Physical addresses)
52 * | ... | | ... | | ... |
53 * | ... | | ... | | ... |
54 * | ... | | ... | | ... |
55 * P7 ... P0 A7 ... A0 A7 ... A0
56 * | Page | Addr MSB | Addr LSB | (DMA registers)
57 *
58 * Address mapping for channels 5-7:
59 *
60 * A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0 (Physical addresses)
61 * | ... | \ \ ... \ \ \ ... \ \
62 * | ... | \ \ ... \ \ \ ... \ (not used)
63 * | ... | \ \ ... \ \ \ ... \
64 * P7 ... P1 (0) A7 A6 ... A0 A7 A6 ... A0
65 * | Page | Addr MSB | Addr LSB | (DMA registers)
66 *
67 * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses
68 * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at
69 * the hardware level, so odd-byte transfers aren't possible).
70 *
71 * Transfer count (_not # bytes_) is limited to 64K, represented as actual
72 * count - 1 : 64K => 0xFFFF, 1 => 0x0000. Thus, count is always 1 or more,
73 * and up to 128K bytes may be transferred on channels 5-7 in one operation.
74 *
75 */
76
77#ifndef CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN
78#define MAX_DMA_CHANNELS 8
79#endif
80
81/*
82 * The maximum address in KSEG0 that we can perform a DMA transfer to on this
83 * platform. This describes only the PC style part of the DMA logic like on
84 * Deskstations or Acer PICA but not the much more versatile DMA logic used
85 * for the local devices on Acer PICA or Magnums.
86 */
87#if defined(CONFIG_SGI_IP22) || defined(CONFIG_SGI_IP28)
88/* don't care; ISA bus master won't work, ISA slave DMA supports 32bit addr */
89#define MAX_DMA_ADDRESS PAGE_OFFSET
90#else
91#define MAX_DMA_ADDRESS (PAGE_OFFSET + 0x01000000)
92#endif
93#define MAX_DMA_PFN PFN_DOWN(virt_to_phys((void *)MAX_DMA_ADDRESS))
94#define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT))
95
96/* 8237 DMA controllers */
97#define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */
98#define IO_DMA2_BASE 0xC0 /* 16 bit master DMA, ch 4(=slave input)..7 */
99
100/* DMA controller registers */
101#define DMA1_CMD_REG 0x08 /* command register (w) */
102#define DMA1_STAT_REG 0x08 /* status register (r) */
103#define DMA1_REQ_REG 0x09 /* request register (w) */
104#define DMA1_MASK_REG 0x0A /* single-channel mask (w) */
105#define DMA1_MODE_REG 0x0B /* mode register (w) */
106#define DMA1_CLEAR_FF_REG 0x0C /* clear pointer flip-flop (w) */
107#define DMA1_TEMP_REG 0x0D /* Temporary Register (r) */
108#define DMA1_RESET_REG 0x0D /* Master Clear (w) */
109#define DMA1_CLR_MASK_REG 0x0E /* Clear Mask */
110#define DMA1_MASK_ALL_REG 0x0F /* all-channels mask (w) */
111
112#define DMA2_CMD_REG 0xD0 /* command register (w) */
113#define DMA2_STAT_REG 0xD0 /* status register (r) */
114#define DMA2_REQ_REG 0xD2 /* request register (w) */
115#define DMA2_MASK_REG 0xD4 /* single-channel mask (w) */
116#define DMA2_MODE_REG 0xD6 /* mode register (w) */
117#define DMA2_CLEAR_FF_REG 0xD8 /* clear pointer flip-flop (w) */
118#define DMA2_TEMP_REG 0xDA /* Temporary Register (r) */
119#define DMA2_RESET_REG 0xDA /* Master Clear (w) */
120#define DMA2_CLR_MASK_REG 0xDC /* Clear Mask */
121#define DMA2_MASK_ALL_REG 0xDE /* all-channels mask (w) */
122
123#define DMA_ADDR_0 0x00 /* DMA address registers */
124#define DMA_ADDR_1 0x02
125#define DMA_ADDR_2 0x04
126#define DMA_ADDR_3 0x06
127#define DMA_ADDR_4 0xC0
128#define DMA_ADDR_5 0xC4
129#define DMA_ADDR_6 0xC8
130#define DMA_ADDR_7 0xCC
131
132#define DMA_CNT_0 0x01 /* DMA count registers */
133#define DMA_CNT_1 0x03
134#define DMA_CNT_2 0x05
135#define DMA_CNT_3 0x07
136#define DMA_CNT_4 0xC2
137#define DMA_CNT_5 0xC6
138#define DMA_CNT_6 0xCA
139#define DMA_CNT_7 0xCE
140
141#define DMA_PAGE_0 0x87 /* DMA page registers */
142#define DMA_PAGE_1 0x83
143#define DMA_PAGE_2 0x81
144#define DMA_PAGE_3 0x82
145#define DMA_PAGE_5 0x8B
146#define DMA_PAGE_6 0x89
147#define DMA_PAGE_7 0x8A
148
149#define DMA_MODE_READ 0x44 /* I/O to memory, no autoinit, increment, single mode */
150#define DMA_MODE_WRITE 0x48 /* memory to I/O, no autoinit, increment, single mode */
151#define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */
152
153#define DMA_AUTOINIT 0x10
154
155extern spinlock_t dma_spin_lock;
156
157static __inline__ unsigned long claim_dma_lock(void)
158{
159 unsigned long flags;
160 spin_lock_irqsave(&dma_spin_lock, flags);
161 return flags;
162}
163
164static __inline__ void release_dma_lock(unsigned long flags)
165{
166 spin_unlock_irqrestore(&dma_spin_lock, flags);
167}
168
169/* enable/disable a specific DMA channel */
170static __inline__ void enable_dma(unsigned int dmanr)
171{
172 if (dmanr<=3)
173 dma_outb(dmanr, DMA1_MASK_REG);
174 else
175 dma_outb(dmanr & 3, DMA2_MASK_REG);
176}
177
178static __inline__ void disable_dma(unsigned int dmanr)
179{
180 if (dmanr<=3)
181 dma_outb(dmanr | 4, DMA1_MASK_REG);
182 else
183 dma_outb((dmanr & 3) | 4, DMA2_MASK_REG);
184}
185
186/* Clear the 'DMA Pointer Flip Flop'.
187 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
188 * Use this once to initialize the FF to a known state.
189 * After that, keep track of it. :-)
190 * --- In order to do that, the DMA routines below should ---
191 * --- only be used while holding the DMA lock ! ---
192 */
193static __inline__ void clear_dma_ff(unsigned int dmanr)
194{
195 if (dmanr<=3)
196 dma_outb(0, DMA1_CLEAR_FF_REG);
197 else
198 dma_outb(0, DMA2_CLEAR_FF_REG);
199}
200
201/* set mode (above) for a specific DMA channel */
202static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
203{
204 if (dmanr<=3)
205 dma_outb(mode | dmanr, DMA1_MODE_REG);
206 else
207 dma_outb(mode | (dmanr&3), DMA2_MODE_REG);
208}
209
210/* Set only the page register bits of the transfer address.
211 * This is used for successive transfers when we know the contents of
212 * the lower 16 bits of the DMA current address register, but a 64k boundary
213 * may have been crossed.
214 */
215static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
216{
217 switch(dmanr) {
218 case 0:
219 dma_outb(pagenr, DMA_PAGE_0);
220 break;
221 case 1:
222 dma_outb(pagenr, DMA_PAGE_1);
223 break;
224 case 2:
225 dma_outb(pagenr, DMA_PAGE_2);
226 break;
227 case 3:
228 dma_outb(pagenr, DMA_PAGE_3);
229 break;
230 case 5:
231 dma_outb(pagenr & 0xfe, DMA_PAGE_5);
232 break;
233 case 6:
234 dma_outb(pagenr & 0xfe, DMA_PAGE_6);
235 break;
236 case 7:
237 dma_outb(pagenr & 0xfe, DMA_PAGE_7);
238 break;
239 }
240}
241
242
243/* Set transfer address & page bits for specific DMA channel.
244 * Assumes dma flipflop is clear.
245 */
246static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
247{
248 set_dma_page(dmanr, a>>16);
249 if (dmanr <= 3) {
250 dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
251 dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
252 } else {
253 dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
254 dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
255 }
256}
257
258
259/* Set transfer size (max 64k for DMA0..3, 128k for DMA5..7) for
260 * a specific DMA channel.
261 * You must ensure the parameters are valid.
262 * NOTE: from a manual: "the number of transfers is one more
263 * than the initial word count"! This is taken into account.
264 * Assumes dma flip-flop is clear.
265 * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.
266 */
267static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
268{
269 count--;
270 if (dmanr <= 3) {
271 dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
272 dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
273 } else {
274 dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
275 dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
276 }
277}
278
279
280/* Get DMA residue count. After a DMA transfer, this
281 * should return zero. Reading this while a DMA transfer is
282 * still in progress will return unpredictable results.
283 * If called before the channel has been used, it may return 1.
284 * Otherwise, it returns the number of _bytes_ left to transfer.
285 *
286 * Assumes DMA flip-flop is clear.
287 */
288static __inline__ int get_dma_residue(unsigned int dmanr)
289{
290 unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE
291 : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE;
292
293 /* using short to get 16-bit wrap around */
294 unsigned short count;
295
296 count = 1 + dma_inb(io_port);
297 count += dma_inb(io_port) << 8;
298
299 return (dmanr<=3)? count : (count<<1);
300}
301
302
303/* These are in kernel/dma.c: */
304extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
305extern void free_dma(unsigned int dmanr); /* release it again */
306
307/* From PCI */
308
309#ifdef CONFIG_PCI
310extern int isa_dma_bridge_buggy;
311#else
312#define isa_dma_bridge_buggy (0)
313#endif
314
315#endif /* _ASM_DMA_H */
diff --git a/include/asm-mips/ds1286.h b/include/asm-mips/ds1286.h
deleted file mode 100644
index 6983b6ff0af3..000000000000
--- a/include/asm-mips/ds1286.h
+++ /dev/null
@@ -1,15 +0,0 @@
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 * Machine dependent access functions for RTC registers.
7 *
8 * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org)
9 */
10#ifndef _ASM_DS1286_H
11#define _ASM_DS1286_H
12
13#include <ds1286.h>
14
15#endif /* _ASM_DS1286_H */
diff --git a/include/asm-mips/ds1287.h b/include/asm-mips/ds1287.h
deleted file mode 100644
index ba1702e86931..000000000000
--- a/include/asm-mips/ds1287.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * DS1287 timer functions.
3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#ifndef __ASM_DS1287_H
21#define __ASM_DS1287_H
22
23extern int ds1287_timer_state(void);
24extern void ds1287_set_base_clock(unsigned int clock);
25extern int ds1287_clockevent_init(int irq);
26
27#endif
diff --git a/include/asm-mips/dsp.h b/include/asm-mips/dsp.h
deleted file mode 100644
index e9bfc0813c72..000000000000
--- a/include/asm-mips/dsp.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Copyright (C) 2005 Mips Technologies
3 * Author: Chris Dearman, chris@mips.com derived from fpu.h
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#ifndef _ASM_DSP_H
11#define _ASM_DSP_H
12
13#include <asm/cpu.h>
14#include <asm/cpu-features.h>
15#include <asm/hazards.h>
16#include <asm/mipsregs.h>
17
18#define DSP_DEFAULT 0x00000000
19#define DSP_MASK 0x3ff
20
21#define __enable_dsp_hazard() \
22do { \
23 asm("_ehb"); \
24} while (0)
25
26static inline void __init_dsp(void)
27{
28 mthi1(0);
29 mtlo1(0);
30 mthi2(0);
31 mtlo2(0);
32 mthi3(0);
33 mtlo3(0);
34 wrdsp(DSP_DEFAULT, DSP_MASK);
35}
36
37static inline void init_dsp(void)
38{
39 if (cpu_has_dsp)
40 __init_dsp();
41}
42
43#define __save_dsp(tsk) \
44do { \
45 tsk->thread.dsp.dspr[0] = mfhi1(); \
46 tsk->thread.dsp.dspr[1] = mflo1(); \
47 tsk->thread.dsp.dspr[2] = mfhi2(); \
48 tsk->thread.dsp.dspr[3] = mflo2(); \
49 tsk->thread.dsp.dspr[4] = mfhi3(); \
50 tsk->thread.dsp.dspr[5] = mflo3(); \
51 tsk->thread.dsp.dspcontrol = rddsp(DSP_MASK); \
52} while (0)
53
54#define save_dsp(tsk) \
55do { \
56 if (cpu_has_dsp) \
57 __save_dsp(tsk); \
58} while (0)
59
60#define __restore_dsp(tsk) \
61do { \
62 mthi1(tsk->thread.dsp.dspr[0]); \
63 mtlo1(tsk->thread.dsp.dspr[1]); \
64 mthi2(tsk->thread.dsp.dspr[2]); \
65 mtlo2(tsk->thread.dsp.dspr[3]); \
66 mthi3(tsk->thread.dsp.dspr[4]); \
67 mtlo3(tsk->thread.dsp.dspr[5]); \
68 wrdsp(tsk->thread.dsp.dspcontrol, DSP_MASK); \
69} while (0)
70
71#define restore_dsp(tsk) \
72do { \
73 if (cpu_has_dsp) \
74 __restore_dsp(tsk); \
75} while (0)
76
77#define __get_dsp_regs(tsk) \
78({ \
79 if (tsk == current) \
80 __save_dsp(current); \
81 \
82 tsk->thread.dsp.dspr; \
83})
84
85#endif /* _ASM_DSP_H */
diff --git a/include/asm-mips/edac.h b/include/asm-mips/edac.h
deleted file mode 100644
index 4da0c1fe30d9..000000000000
--- a/include/asm-mips/edac.h
+++ /dev/null
@@ -1,34 +0,0 @@
1#ifndef ASM_EDAC_H
2#define ASM_EDAC_H
3
4/* ECC atomic, DMA, SMP and interrupt safe scrub function */
5
6static inline void atomic_scrub(void *va, u32 size)
7{
8 unsigned long *virt_addr = va;
9 unsigned long temp;
10 u32 i;
11
12 for (i = 0; i < size / sizeof(unsigned long); i++) {
13 /*
14 * Very carefully read and write to memory atomically
15 * so we are interrupt, DMA and SMP safe.
16 *
17 * Intel: asm("lock; addl $0, %0"::"m"(*virt_addr));
18 */
19
20 __asm__ __volatile__ (
21 " .set mips2 \n"
22 "1: ll %0, %1 # atomic_scrub \n"
23 " addu %0, $0 \n"
24 " sc %0, %1 \n"
25 " beqz %0, 1b \n"
26 " .set mips0 \n"
27 : "=&r" (temp), "=m" (*virt_addr)
28 : "m" (*virt_addr));
29
30 virt_addr++;
31 }
32}
33
34#endif
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
deleted file mode 100644
index f69f7acba637..000000000000
--- a/include/asm-mips/elf.h
+++ /dev/null
@@ -1,371 +0,0 @@
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 * Much of this is taken from binutils and GNU libc ...
7 */
8#ifndef _ASM_ELF_H
9#define _ASM_ELF_H
10
11
12/* ELF header e_flags defines. */
13/* MIPS architecture level. */
14#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
15#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
16#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
17#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
18#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
19#define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */
20#define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */
21#define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32 R2 code. */
22#define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64 R2 code. */
23
24/* The ABI of a file. */
25#define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */
26#define EF_MIPS_ABI_O64 0x00002000 /* O32 extended for 64 bit. */
27
28#define PT_MIPS_REGINFO 0x70000000
29#define PT_MIPS_RTPROC 0x70000001
30#define PT_MIPS_OPTIONS 0x70000002
31
32/* Flags in the e_flags field of the header */
33#define EF_MIPS_NOREORDER 0x00000001
34#define EF_MIPS_PIC 0x00000002
35#define EF_MIPS_CPIC 0x00000004
36#define EF_MIPS_ABI2 0x00000020
37#define EF_MIPS_OPTIONS_FIRST 0x00000080
38#define EF_MIPS_32BITMODE 0x00000100
39#define EF_MIPS_ABI 0x0000f000
40#define EF_MIPS_ARCH 0xf0000000
41
42#define DT_MIPS_RLD_VERSION 0x70000001
43#define DT_MIPS_TIME_STAMP 0x70000002
44#define DT_MIPS_ICHECKSUM 0x70000003
45#define DT_MIPS_IVERSION 0x70000004
46#define DT_MIPS_FLAGS 0x70000005
47 #define RHF_NONE 0x00000000
48 #define RHF_HARDWAY 0x00000001
49 #define RHF_NOTPOT 0x00000002
50 #define RHF_SGI_ONLY 0x00000010
51#define DT_MIPS_BASE_ADDRESS 0x70000006
52#define DT_MIPS_CONFLICT 0x70000008
53#define DT_MIPS_LIBLIST 0x70000009
54#define DT_MIPS_LOCAL_GOTNO 0x7000000a
55#define DT_MIPS_CONFLICTNO 0x7000000b
56#define DT_MIPS_LIBLISTNO 0x70000010
57#define DT_MIPS_SYMTABNO 0x70000011
58#define DT_MIPS_UNREFEXTNO 0x70000012
59#define DT_MIPS_GOTSYM 0x70000013
60#define DT_MIPS_HIPAGENO 0x70000014
61#define DT_MIPS_RLD_MAP 0x70000016
62
63#define R_MIPS_NONE 0
64#define R_MIPS_16 1
65#define R_MIPS_32 2
66#define R_MIPS_REL32 3
67#define R_MIPS_26 4
68#define R_MIPS_HI16 5
69#define R_MIPS_LO16 6
70#define R_MIPS_GPREL16 7
71#define R_MIPS_LITERAL 8
72#define R_MIPS_GOT16 9
73#define R_MIPS_PC16 10
74#define R_MIPS_CALL16 11
75#define R_MIPS_GPREL32 12
76/* The remaining relocs are defined on Irix, although they are not
77 in the MIPS ELF ABI. */
78#define R_MIPS_UNUSED1 13
79#define R_MIPS_UNUSED2 14
80#define R_MIPS_UNUSED3 15
81#define R_MIPS_SHIFT5 16
82#define R_MIPS_SHIFT6 17
83#define R_MIPS_64 18
84#define R_MIPS_GOT_DISP 19
85#define R_MIPS_GOT_PAGE 20
86#define R_MIPS_GOT_OFST 21
87/*
88 * The following two relocation types are specified in the MIPS ABI
89 * conformance guide version 1.2 but not yet in the psABI.
90 */
91#define R_MIPS_GOTHI16 22
92#define R_MIPS_GOTLO16 23
93#define R_MIPS_SUB 24
94#define R_MIPS_INSERT_A 25
95#define R_MIPS_INSERT_B 26
96#define R_MIPS_DELETE 27
97#define R_MIPS_HIGHER 28
98#define R_MIPS_HIGHEST 29
99/*
100 * The following two relocation types are specified in the MIPS ABI
101 * conformance guide version 1.2 but not yet in the psABI.
102 */
103#define R_MIPS_CALLHI16 30
104#define R_MIPS_CALLLO16 31
105/*
106 * This range is reserved for vendor specific relocations.
107 */
108#define R_MIPS_LOVENDOR 100
109#define R_MIPS_HIVENDOR 127
110
111#define SHN_MIPS_ACCOMON 0xff00 /* Allocated common symbols */
112#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */
113#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */
114#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
115#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
116
117#define SHT_MIPS_LIST 0x70000000
118#define SHT_MIPS_CONFLICT 0x70000002
119#define SHT_MIPS_GPTAB 0x70000003
120#define SHT_MIPS_UCODE 0x70000004
121#define SHT_MIPS_DEBUG 0x70000005
122#define SHT_MIPS_REGINFO 0x70000006
123#define SHT_MIPS_PACKAGE 0x70000007
124#define SHT_MIPS_PACKSYM 0x70000008
125#define SHT_MIPS_RELD 0x70000009
126#define SHT_MIPS_IFACE 0x7000000b
127#define SHT_MIPS_CONTENT 0x7000000c
128#define SHT_MIPS_OPTIONS 0x7000000d
129#define SHT_MIPS_SHDR 0x70000010
130#define SHT_MIPS_FDESC 0x70000011
131#define SHT_MIPS_EXTSYM 0x70000012
132#define SHT_MIPS_DENSE 0x70000013
133#define SHT_MIPS_PDESC 0x70000014
134#define SHT_MIPS_LOCSYM 0x70000015
135#define SHT_MIPS_AUXSYM 0x70000016
136#define SHT_MIPS_OPTSYM 0x70000017
137#define SHT_MIPS_LOCSTR 0x70000018
138#define SHT_MIPS_LINE 0x70000019
139#define SHT_MIPS_RFDESC 0x7000001a
140#define SHT_MIPS_DELTASYM 0x7000001b
141#define SHT_MIPS_DELTAINST 0x7000001c
142#define SHT_MIPS_DELTACLASS 0x7000001d
143#define SHT_MIPS_DWARF 0x7000001e
144#define SHT_MIPS_DELTADECL 0x7000001f
145#define SHT_MIPS_SYMBOL_LIB 0x70000020
146#define SHT_MIPS_EVENTS 0x70000021
147#define SHT_MIPS_TRANSLATE 0x70000022
148#define SHT_MIPS_PIXIE 0x70000023
149#define SHT_MIPS_XLATE 0x70000024
150#define SHT_MIPS_XLATE_DEBUG 0x70000025
151#define SHT_MIPS_WHIRL 0x70000026
152#define SHT_MIPS_EH_REGION 0x70000027
153#define SHT_MIPS_XLATE_OLD 0x70000028
154#define SHT_MIPS_PDR_EXCEPTION 0x70000029
155
156#define SHF_MIPS_GPREL 0x10000000
157#define SHF_MIPS_MERGE 0x20000000
158#define SHF_MIPS_ADDR 0x40000000
159#define SHF_MIPS_STRING 0x80000000
160#define SHF_MIPS_NOSTRIP 0x08000000
161#define SHF_MIPS_LOCAL 0x04000000
162#define SHF_MIPS_NAMES 0x02000000
163#define SHF_MIPS_NODUPES 0x01000000
164
165#ifndef ELF_ARCH
166/* ELF register definitions */
167#define ELF_NGREG 45
168#define ELF_NFPREG 33
169
170typedef unsigned long elf_greg_t;
171typedef elf_greg_t elf_gregset_t[ELF_NGREG];
172
173typedef double elf_fpreg_t;
174typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
175
176#ifdef CONFIG_32BIT
177
178/*
179 * This is used to ensure we don't load something for the wrong architecture.
180 */
181#define elf_check_arch(hdr) \
182({ \
183 int __res = 1; \
184 struct elfhdr *__h = (hdr); \
185 \
186 if (__h->e_machine != EM_MIPS) \
187 __res = 0; \
188 if (__h->e_ident[EI_CLASS] != ELFCLASS32) \
189 __res = 0; \
190 if ((__h->e_flags & EF_MIPS_ABI2) != 0) \
191 __res = 0; \
192 if (((__h->e_flags & EF_MIPS_ABI) != 0) && \
193 ((__h->e_flags & EF_MIPS_ABI) != EF_MIPS_ABI_O32)) \
194 __res = 0; \
195 \
196 __res; \
197})
198
199/*
200 * These are used to set parameters in the core dumps.
201 */
202#define ELF_CLASS ELFCLASS32
203
204#endif /* CONFIG_32BIT */
205
206#ifdef CONFIG_64BIT
207/*
208 * This is used to ensure we don't load something for the wrong architecture.
209 */
210#define elf_check_arch(hdr) \
211({ \
212 int __res = 1; \
213 struct elfhdr *__h = (hdr); \
214 \
215 if (__h->e_machine != EM_MIPS) \
216 __res = 0; \
217 if (__h->e_ident[EI_CLASS] != ELFCLASS64) \
218 __res = 0; \
219 \
220 __res; \
221})
222
223/*
224 * These are used to set parameters in the core dumps.
225 */
226#define ELF_CLASS ELFCLASS64
227
228#endif /* CONFIG_64BIT */
229
230/*
231 * These are used to set parameters in the core dumps.
232 */
233#ifdef __MIPSEB__
234#define ELF_DATA ELFDATA2MSB
235#elif __MIPSEL__
236#define ELF_DATA ELFDATA2LSB
237#endif
238#define ELF_ARCH EM_MIPS
239
240#endif /* !defined(ELF_ARCH) */
241
242struct mips_abi;
243
244extern struct mips_abi mips_abi;
245extern struct mips_abi mips_abi_32;
246extern struct mips_abi mips_abi_n32;
247
248#ifdef CONFIG_32BIT
249
250#define SET_PERSONALITY(ex, ibcs2) \
251do { \
252 if (ibcs2) \
253 set_personality(PER_SVR4); \
254 set_personality(PER_LINUX); \
255 \
256 current->thread.abi = &mips_abi; \
257} while (0)
258
259#endif /* CONFIG_32BIT */
260
261#ifdef CONFIG_64BIT
262
263#ifdef CONFIG_MIPS32_N32
264#define __SET_PERSONALITY32_N32() \
265 do { \
266 set_thread_flag(TIF_32BIT_ADDR); \
267 current->thread.abi = &mips_abi_n32; \
268 } while (0)
269#else
270#define __SET_PERSONALITY32_N32() \
271 do { } while (0)
272#endif
273
274#ifdef CONFIG_MIPS32_O32
275#define __SET_PERSONALITY32_O32() \
276 do { \
277 set_thread_flag(TIF_32BIT_REGS); \
278 set_thread_flag(TIF_32BIT_ADDR); \
279 current->thread.abi = &mips_abi_32; \
280 } while (0)
281#else
282#define __SET_PERSONALITY32_O32() \
283 do { } while (0)
284#endif
285
286#ifdef CONFIG_MIPS32_COMPAT
287#define __SET_PERSONALITY32(ex) \
288do { \
289 if ((((ex).e_flags & EF_MIPS_ABI2) != 0) && \
290 ((ex).e_flags & EF_MIPS_ABI) == 0) \
291 __SET_PERSONALITY32_N32(); \
292 else \
293 __SET_PERSONALITY32_O32(); \
294} while (0)
295#else
296#define __SET_PERSONALITY32(ex) do { } while (0)
297#endif
298
299#define SET_PERSONALITY(ex, ibcs2) \
300do { \
301 clear_thread_flag(TIF_32BIT_REGS); \
302 clear_thread_flag(TIF_32BIT_ADDR); \
303 \
304 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
305 __SET_PERSONALITY32(ex); \
306 else \
307 current->thread.abi = &mips_abi; \
308 \
309 if (ibcs2) \
310 set_personality(PER_SVR4); \
311 else if (current->personality != PER_LINUX32) \
312 set_personality(PER_LINUX); \
313} while (0)
314
315#endif /* CONFIG_64BIT */
316
317struct task_struct;
318
319extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs);
320extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
321extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
322
323#define ELF_CORE_COPY_REGS(elf_regs, regs) \
324 elf_dump_regs((elf_greg_t *)&(elf_regs), regs);
325#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
326#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \
327 dump_task_fpu(tsk, elf_fpregs)
328
329#define USE_ELF_CORE_DUMP
330#define ELF_EXEC_PAGESIZE PAGE_SIZE
331
332/* This yields a mask that user programs can use to figure out what
333 instruction set this cpu supports. This could be done in userspace,
334 but it's not easy, and we've already done it here. */
335
336#define ELF_HWCAP (0)
337
338/* This yields a string that ld.so will use to load implementation
339 specific libraries for optimization. This is more specific in
340 intent than poking at uname or /proc/cpuinfo.
341
342 For the moment, we have only optimizations for the Intel generations,
343 but that could change... */
344
345#define ELF_PLATFORM (NULL)
346
347/*
348 * See comments in asm-alpha/elf.h, this is the same thing
349 * on the MIPS.
350 */
351#define ELF_PLAT_INIT(_r, load_addr) do { \
352 _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0; \
353 _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0; \
354 _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0; \
355 _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0; \
356 _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0; \
357 _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0; \
358 _r->regs[25] = _r->regs[26] = _r->regs[27] = _r->regs[28] = 0; \
359 _r->regs[30] = _r->regs[31] = 0; \
360} while (0)
361
362/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
363 use of this is to invoke "./ld.so someprog" to test out a new version of
364 the loader. We need to make sure that it is out of the way of the program
365 that it will "exec", and that there is sufficient room for the brk. */
366
367#ifndef ELF_ET_DYN_BASE
368#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
369#endif
370
371#endif /* _ASM_ELF_H */
diff --git a/include/asm-mips/emergency-restart.h b/include/asm-mips/emergency-restart.h
deleted file mode 100644
index 108d8c48e42e..000000000000
--- a/include/asm-mips/emergency-restart.h
+++ /dev/null
@@ -1,6 +0,0 @@
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-mips/emma2rh/emma2rh.h b/include/asm-mips/emma2rh/emma2rh.h
deleted file mode 100644
index 6a1af0af51e3..000000000000
--- a/include/asm-mips/emma2rh/emma2rh.h
+++ /dev/null
@@ -1,333 +0,0 @@
1/*
2 * include/asm-mips/emma2rh/emma2rh.h
3 * This file is EMMA2RH common header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006
6 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
8 * Copyright 2001 MontaVista Software Inc.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24#ifndef __ASM_EMMA2RH_EMMA2RH_H
25#define __ASM_EMMA2RH_EMMA2RH_H
26
27#include <irq.h>
28
29/*
30 * EMMA2RH registers
31 */
32#define REGBASE 0x10000000
33
34#define EMMA2RH_BHIF_STRAP_0 (0x000010+REGBASE)
35#define EMMA2RH_BHIF_INT_ST_0 (0x000030+REGBASE)
36#define EMMA2RH_BHIF_INT_ST_1 (0x000034+REGBASE)
37#define EMMA2RH_BHIF_INT_ST_2 (0x000038+REGBASE)
38#define EMMA2RH_BHIF_INT_EN_0 (0x000040+REGBASE)
39#define EMMA2RH_BHIF_INT_EN_1 (0x000044+REGBASE)
40#define EMMA2RH_BHIF_INT_EN_2 (0x000048+REGBASE)
41#define EMMA2RH_BHIF_INT1_EN_0 (0x000050+REGBASE)
42#define EMMA2RH_BHIF_INT1_EN_1 (0x000054+REGBASE)
43#define EMMA2RH_BHIF_INT1_EN_2 (0x000058+REGBASE)
44#define EMMA2RH_BHIF_SW_INT (0x000070+REGBASE)
45#define EMMA2RH_BHIF_SW_INT_EN (0x000080+REGBASE)
46#define EMMA2RH_BHIF_SW_INT_CLR (0x000090+REGBASE)
47#define EMMA2RH_BHIF_MAIN_CTRL (0x0000b4+REGBASE)
48#define EMMA2RH_BHIF_EXCEPT_VECT_BASE_ADDRESS (0x0000c0+REGBASE)
49#define EMMA2RH_GPIO_DIR (0x110d20+REGBASE)
50#define EMMA2RH_GPIO_INT_ST (0x110d30+REGBASE)
51#define EMMA2RH_GPIO_INT_MASK (0x110d3c+REGBASE)
52#define EMMA2RH_GPIO_INT_MODE (0x110d48+REGBASE)
53#define EMMA2RH_GPIO_INT_CND_A (0x110d54+REGBASE)
54#define EMMA2RH_GPIO_INT_CND_B (0x110d60+REGBASE)
55#define EMMA2RH_PBRD_INT_EN (0x100010+REGBASE)
56#define EMMA2RH_PBRD_CLKSEL (0x100028+REGBASE)
57#define EMMA2RH_PFUR0_BASE (0x101000+REGBASE)
58#define EMMA2RH_PFUR1_BASE (0x102000+REGBASE)
59#define EMMA2RH_PFUR2_BASE (0x103000+REGBASE)
60#define EMMA2RH_PIIC0_BASE (0x107000+REGBASE)
61#define EMMA2RH_PIIC1_BASE (0x108000+REGBASE)
62#define EMMA2RH_PIIC2_BASE (0x109000+REGBASE)
63#define EMMA2RH_PCI_CONTROL (0x200000+REGBASE)
64#define EMMA2RH_PCI_ARBIT_CTR (0x200004+REGBASE)
65#define EMMA2RH_PCI_IWIN0_CTR (0x200010+REGBASE)
66#define EMMA2RH_PCI_IWIN1_CTR (0x200014+REGBASE)
67#define EMMA2RH_PCI_INIT_ESWP (0x200018+REGBASE)
68#define EMMA2RH_PCI_INT (0x200020+REGBASE)
69#define EMMA2RH_PCI_INT_EN (0x200024+REGBASE)
70#define EMMA2RH_PCI_TWIN_CTR (0x200030+REGBASE)
71#define EMMA2RH_PCI_TWIN_BADR (0x200034+REGBASE)
72#define EMMA2RH_PCI_TWIN0_DADR (0x200038+REGBASE)
73#define EMMA2RH_PCI_TWIN1_DADR (0x20003c+REGBASE)
74
75/*
76 * Memory map (physical address)
77 *
78 * Note most of the following address must be properly aligned by the
79 * corresponding size. For example, if PCI_IO_SIZE is 16MB, then
80 * PCI_IO_BASE must be aligned along 16MB boundary.
81 */
82
83/* the actual ram size is detected at run-time */
84#define EMMA2RH_RAM_BASE 0x00000000
85#define EMMA2RH_RAM_SIZE 0x10000000 /* less than 256MB */
86
87#define EMMA2RH_IO_BASE 0x10000000
88#define EMMA2RH_IO_SIZE 0x01000000 /* 16 MB */
89
90#define EMMA2RH_GENERALIO_BASE 0x11000000
91#define EMMA2RH_GENERALIO_SIZE 0x01000000 /* 16 MB */
92
93#define EMMA2RH_PCI_IO_BASE 0x12000000
94#define EMMA2RH_PCI_IO_SIZE 0x02000000 /* 32 MB */
95
96#define EMMA2RH_PCI_MEM_BASE 0x14000000
97#define EMMA2RH_PCI_MEM_SIZE 0x08000000 /* 128 MB */
98
99#define EMMA2RH_ROM_BASE 0x1c000000
100#define EMMA2RH_ROM_SIZE 0x04000000 /* 64 MB */
101
102#define EMMA2RH_PCI_CONFIG_BASE EMMA2RH_PCI_IO_BASE
103#define EMMA2RH_PCI_CONFIG_SIZE EMMA2RH_PCI_IO_SIZE
104
105#define NUM_CPU_IRQ 8
106#define NUM_EMMA2RH_IRQ 96
107
108#define CPU_EMMA2RH_CASCADE 2
109#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
110#define EMMA2RH_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
111
112/*
113 * emma2rh irq defs
114 */
115
116#define EMMA2RH_IRQ_INT0 (0 + EMMA2RH_IRQ_BASE)
117#define EMMA2RH_IRQ_INT1 (1 + EMMA2RH_IRQ_BASE)
118#define EMMA2RH_IRQ_INT2 (2 + EMMA2RH_IRQ_BASE)
119#define EMMA2RH_IRQ_INT3 (3 + EMMA2RH_IRQ_BASE)
120#define EMMA2RH_IRQ_INT4 (4 + EMMA2RH_IRQ_BASE)
121#define EMMA2RH_IRQ_INT5 (5 + EMMA2RH_IRQ_BASE)
122#define EMMA2RH_IRQ_INT6 (6 + EMMA2RH_IRQ_BASE)
123#define EMMA2RH_IRQ_INT7 (7 + EMMA2RH_IRQ_BASE)
124#define EMMA2RH_IRQ_INT8 (8 + EMMA2RH_IRQ_BASE)
125#define EMMA2RH_IRQ_INT9 (9 + EMMA2RH_IRQ_BASE)
126#define EMMA2RH_IRQ_INT10 (10 + EMMA2RH_IRQ_BASE)
127#define EMMA2RH_IRQ_INT11 (11 + EMMA2RH_IRQ_BASE)
128#define EMMA2RH_IRQ_INT12 (12 + EMMA2RH_IRQ_BASE)
129#define EMMA2RH_IRQ_INT13 (13 + EMMA2RH_IRQ_BASE)
130#define EMMA2RH_IRQ_INT14 (14 + EMMA2RH_IRQ_BASE)
131#define EMMA2RH_IRQ_INT15 (15 + EMMA2RH_IRQ_BASE)
132#define EMMA2RH_IRQ_INT16 (16 + EMMA2RH_IRQ_BASE)
133#define EMMA2RH_IRQ_INT17 (17 + EMMA2RH_IRQ_BASE)
134#define EMMA2RH_IRQ_INT18 (18 + EMMA2RH_IRQ_BASE)
135#define EMMA2RH_IRQ_INT19 (19 + EMMA2RH_IRQ_BASE)
136#define EMMA2RH_IRQ_INT20 (20 + EMMA2RH_IRQ_BASE)
137#define EMMA2RH_IRQ_INT21 (21 + EMMA2RH_IRQ_BASE)
138#define EMMA2RH_IRQ_INT22 (22 + EMMA2RH_IRQ_BASE)
139#define EMMA2RH_IRQ_INT23 (23 + EMMA2RH_IRQ_BASE)
140#define EMMA2RH_IRQ_INT24 (24 + EMMA2RH_IRQ_BASE)
141#define EMMA2RH_IRQ_INT25 (25 + EMMA2RH_IRQ_BASE)
142#define EMMA2RH_IRQ_INT26 (26 + EMMA2RH_IRQ_BASE)
143#define EMMA2RH_IRQ_INT27 (27 + EMMA2RH_IRQ_BASE)
144#define EMMA2RH_IRQ_INT28 (28 + EMMA2RH_IRQ_BASE)
145#define EMMA2RH_IRQ_INT29 (29 + EMMA2RH_IRQ_BASE)
146#define EMMA2RH_IRQ_INT30 (30 + EMMA2RH_IRQ_BASE)
147#define EMMA2RH_IRQ_INT31 (31 + EMMA2RH_IRQ_BASE)
148#define EMMA2RH_IRQ_INT32 (32 + EMMA2RH_IRQ_BASE)
149#define EMMA2RH_IRQ_INT33 (33 + EMMA2RH_IRQ_BASE)
150#define EMMA2RH_IRQ_INT34 (34 + EMMA2RH_IRQ_BASE)
151#define EMMA2RH_IRQ_INT35 (35 + EMMA2RH_IRQ_BASE)
152#define EMMA2RH_IRQ_INT36 (36 + EMMA2RH_IRQ_BASE)
153#define EMMA2RH_IRQ_INT37 (37 + EMMA2RH_IRQ_BASE)
154#define EMMA2RH_IRQ_INT38 (38 + EMMA2RH_IRQ_BASE)
155#define EMMA2RH_IRQ_INT39 (39 + EMMA2RH_IRQ_BASE)
156#define EMMA2RH_IRQ_INT40 (40 + EMMA2RH_IRQ_BASE)
157#define EMMA2RH_IRQ_INT41 (41 + EMMA2RH_IRQ_BASE)
158#define EMMA2RH_IRQ_INT42 (42 + EMMA2RH_IRQ_BASE)
159#define EMMA2RH_IRQ_INT43 (43 + EMMA2RH_IRQ_BASE)
160#define EMMA2RH_IRQ_INT44 (44 + EMMA2RH_IRQ_BASE)
161#define EMMA2RH_IRQ_INT45 (45 + EMMA2RH_IRQ_BASE)
162#define EMMA2RH_IRQ_INT46 (46 + EMMA2RH_IRQ_BASE)
163#define EMMA2RH_IRQ_INT47 (47 + EMMA2RH_IRQ_BASE)
164#define EMMA2RH_IRQ_INT48 (48 + EMMA2RH_IRQ_BASE)
165#define EMMA2RH_IRQ_INT49 (49 + EMMA2RH_IRQ_BASE)
166#define EMMA2RH_IRQ_INT50 (50 + EMMA2RH_IRQ_BASE)
167#define EMMA2RH_IRQ_INT51 (51 + EMMA2RH_IRQ_BASE)
168#define EMMA2RH_IRQ_INT52 (52 + EMMA2RH_IRQ_BASE)
169#define EMMA2RH_IRQ_INT53 (53 + EMMA2RH_IRQ_BASE)
170#define EMMA2RH_IRQ_INT54 (54 + EMMA2RH_IRQ_BASE)
171#define EMMA2RH_IRQ_INT55 (55 + EMMA2RH_IRQ_BASE)
172#define EMMA2RH_IRQ_INT56 (56 + EMMA2RH_IRQ_BASE)
173#define EMMA2RH_IRQ_INT57 (57 + EMMA2RH_IRQ_BASE)
174#define EMMA2RH_IRQ_INT58 (58 + EMMA2RH_IRQ_BASE)
175#define EMMA2RH_IRQ_INT59 (59 + EMMA2RH_IRQ_BASE)
176#define EMMA2RH_IRQ_INT60 (60 + EMMA2RH_IRQ_BASE)
177#define EMMA2RH_IRQ_INT61 (61 + EMMA2RH_IRQ_BASE)
178#define EMMA2RH_IRQ_INT62 (62 + EMMA2RH_IRQ_BASE)
179#define EMMA2RH_IRQ_INT63 (63 + EMMA2RH_IRQ_BASE)
180
181#define EMMA2RH_IRQ_PFUR0 EMMA2RH_IRQ_INT49
182#define EMMA2RH_IRQ_PFUR1 EMMA2RH_IRQ_INT50
183#define EMMA2RH_IRQ_PFUR2 EMMA2RH_IRQ_INT51
184#define EMMA2RH_IRQ_PIIC0 EMMA2RH_IRQ_INT56
185#define EMMA2RH_IRQ_PIIC1 EMMA2RH_IRQ_INT57
186#define EMMA2RH_IRQ_PIIC2 EMMA2RH_IRQ_INT58
187
188/*
189 * EMMA2RH Register Access
190 */
191
192#define EMMA2RH_BASE (0xa0000000)
193
194static inline void emma2rh_sync(void)
195{
196 volatile u32 *p = (volatile u32 *)0xbfc00000;
197 (void)(*p);
198}
199
200static inline void emma2rh_out32(u32 offset, u32 val)
201{
202 *(volatile u32 *)(EMMA2RH_BASE | offset) = val;
203 emma2rh_sync();
204}
205
206static inline u32 emma2rh_in32(u32 offset)
207{
208 u32 val = *(volatile u32 *)(EMMA2RH_BASE | offset);
209 emma2rh_sync();
210 return val;
211}
212
213static inline void emma2rh_out16(u32 offset, u16 val)
214{
215 *(volatile u16 *)(EMMA2RH_BASE | offset) = val;
216 emma2rh_sync();
217}
218
219static inline u16 emma2rh_in16(u32 offset)
220{
221 u16 val = *(volatile u16 *)(EMMA2RH_BASE | offset);
222 emma2rh_sync();
223 return val;
224}
225
226static inline void emma2rh_out8(u32 offset, u8 val)
227{
228 *(volatile u8 *)(EMMA2RH_BASE | offset) = val;
229 emma2rh_sync();
230}
231
232static inline u8 emma2rh_in8(u32 offset)
233{
234 u8 val = *(volatile u8 *)(EMMA2RH_BASE | offset);
235 emma2rh_sync();
236 return val;
237}
238
239/**
240 * IIC registers map
241 **/
242
243/*---------------------------------------------------------------------------*/
244/* CNT - Control register (00H R/W) */
245/*---------------------------------------------------------------------------*/
246#define SPT 0x00000001
247#define STT 0x00000002
248#define ACKE 0x00000004
249#define WTIM 0x00000008
250#define SPIE 0x00000010
251#define WREL 0x00000020
252#define LREL 0x00000040
253#define IICE 0x00000080
254#define CNT_RESERVED 0x000000ff /* reserved bit 0 */
255
256#define I2C_EMMA_START (IICE | STT)
257#define I2C_EMMA_STOP (IICE | SPT)
258#define I2C_EMMA_REPSTART I2C_EMMA_START
259
260/*---------------------------------------------------------------------------*/
261/* STA - Status register (10H Read) */
262/*---------------------------------------------------------------------------*/
263#define MSTS 0x00000080
264#define ALD 0x00000040
265#define EXC 0x00000020
266#define COI 0x00000010
267#define TRC 0x00000008
268#define ACKD 0x00000004
269#define STD 0x00000002
270#define SPD 0x00000001
271
272/*---------------------------------------------------------------------------*/
273/* CSEL - Clock select register (20H R/W) */
274/*---------------------------------------------------------------------------*/
275#define FCL 0x00000080
276#define ND50 0x00000040
277#define CLD 0x00000020
278#define DAD 0x00000010
279#define SMC 0x00000008
280#define DFC 0x00000004
281#define CL 0x00000003
282#define CSEL_RESERVED 0x000000ff /* reserved bit 0 */
283
284#define FAST397 0x0000008b
285#define FAST297 0x0000008a
286#define FAST347 0x0000000b
287#define FAST260 0x0000000a
288#define FAST130 0x00000008
289#define STANDARD108 0x00000083
290#define STANDARD83 0x00000082
291#define STANDARD95 0x00000003
292#define STANDARD73 0x00000002
293#define STANDARD36 0x00000001
294#define STANDARD71 0x00000000
295
296/*---------------------------------------------------------------------------*/
297/* SVA - Slave address register (30H R/W) */
298/*---------------------------------------------------------------------------*/
299#define SVA 0x000000fe
300
301/*---------------------------------------------------------------------------*/
302/* SHR - Shift register (40H R/W) */
303/*---------------------------------------------------------------------------*/
304#define SR 0x000000ff
305
306/*---------------------------------------------------------------------------*/
307/* INT - Interrupt register (50H R/W) */
308/* INTM - Interrupt mask register (60H R/W) */
309/*---------------------------------------------------------------------------*/
310#define INTE0 0x00000001
311
312/***********************************************************************
313 * I2C registers
314 ***********************************************************************
315 */
316#define I2C_EMMA_CNT 0x00
317#define I2C_EMMA_STA 0x10
318#define I2C_EMMA_CSEL 0x20
319#define I2C_EMMA_SVA 0x30
320#define I2C_EMMA_SHR 0x40
321#define I2C_EMMA_INT 0x50
322#define I2C_EMMA_INTM 0x60
323
324/*
325 * include the board dependent part
326 */
327#if defined(CONFIG_MARKEINS)
328#include <asm/emma2rh/markeins.h>
329#else
330#error "Unknown EMMA2RH board!"
331#endif
332
333#endif /* __ASM_EMMA2RH_EMMA2RH_H */
diff --git a/include/asm-mips/emma2rh/markeins.h b/include/asm-mips/emma2rh/markeins.h
deleted file mode 100644
index 973b0628490d..000000000000
--- a/include/asm-mips/emma2rh/markeins.h
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * include/asm-mips/emma2rh/markeins.h
3 * This file is EMMA2RH board depended header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006
6 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
8 * Copyright 2001 MontaVista Software Inc.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#ifndef MARKEINS_H
26#define MARKEINS_H
27
28#define NUM_EMMA2RH_IRQ_SW 32
29#define NUM_EMMA2RH_IRQ_GPIO 32
30
31#define EMMA2RH_SW_CASCADE (EMMA2RH_IRQ_INT7 - EMMA2RH_IRQ_INT0)
32#define EMMA2RH_GPIO_CASCADE (EMMA2RH_IRQ_INT46 - EMMA2RH_IRQ_INT0)
33
34#define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ)
35#define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW)
36
37#define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE)
38#define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE)
39#define EMMA2RH_SW_IRQ_INT2 (2+EMMA2RH_SW_IRQ_BASE)
40#define EMMA2RH_SW_IRQ_INT3 (3+EMMA2RH_SW_IRQ_BASE)
41#define EMMA2RH_SW_IRQ_INT4 (4+EMMA2RH_SW_IRQ_BASE)
42#define EMMA2RH_SW_IRQ_INT5 (5+EMMA2RH_SW_IRQ_BASE)
43#define EMMA2RH_SW_IRQ_INT6 (6+EMMA2RH_SW_IRQ_BASE)
44#define EMMA2RH_SW_IRQ_INT7 (7+EMMA2RH_SW_IRQ_BASE)
45#define EMMA2RH_SW_IRQ_INT8 (8+EMMA2RH_SW_IRQ_BASE)
46#define EMMA2RH_SW_IRQ_INT9 (9+EMMA2RH_SW_IRQ_BASE)
47#define EMMA2RH_SW_IRQ_INT10 (10+EMMA2RH_SW_IRQ_BASE)
48#define EMMA2RH_SW_IRQ_INT11 (11+EMMA2RH_SW_IRQ_BASE)
49#define EMMA2RH_SW_IRQ_INT12 (12+EMMA2RH_SW_IRQ_BASE)
50#define EMMA2RH_SW_IRQ_INT13 (13+EMMA2RH_SW_IRQ_BASE)
51#define EMMA2RH_SW_IRQ_INT14 (14+EMMA2RH_SW_IRQ_BASE)
52#define EMMA2RH_SW_IRQ_INT15 (15+EMMA2RH_SW_IRQ_BASE)
53#define EMMA2RH_SW_IRQ_INT16 (16+EMMA2RH_SW_IRQ_BASE)
54#define EMMA2RH_SW_IRQ_INT17 (17+EMMA2RH_SW_IRQ_BASE)
55#define EMMA2RH_SW_IRQ_INT18 (18+EMMA2RH_SW_IRQ_BASE)
56#define EMMA2RH_SW_IRQ_INT19 (19+EMMA2RH_SW_IRQ_BASE)
57#define EMMA2RH_SW_IRQ_INT20 (20+EMMA2RH_SW_IRQ_BASE)
58#define EMMA2RH_SW_IRQ_INT21 (21+EMMA2RH_SW_IRQ_BASE)
59#define EMMA2RH_SW_IRQ_INT22 (22+EMMA2RH_SW_IRQ_BASE)
60#define EMMA2RH_SW_IRQ_INT23 (23+EMMA2RH_SW_IRQ_BASE)
61#define EMMA2RH_SW_IRQ_INT24 (24+EMMA2RH_SW_IRQ_BASE)
62#define EMMA2RH_SW_IRQ_INT25 (25+EMMA2RH_SW_IRQ_BASE)
63#define EMMA2RH_SW_IRQ_INT26 (26+EMMA2RH_SW_IRQ_BASE)
64#define EMMA2RH_SW_IRQ_INT27 (27+EMMA2RH_SW_IRQ_BASE)
65#define EMMA2RH_SW_IRQ_INT28 (28+EMMA2RH_SW_IRQ_BASE)
66#define EMMA2RH_SW_IRQ_INT29 (29+EMMA2RH_SW_IRQ_BASE)
67#define EMMA2RH_SW_IRQ_INT30 (30+EMMA2RH_SW_IRQ_BASE)
68#define EMMA2RH_SW_IRQ_INT31 (31+EMMA2RH_SW_IRQ_BASE)
69
70#define MARKEINS_PCI_IRQ_INTA EMMA2RH_GPIO_IRQ_BASE+15
71#define MARKEINS_PCI_IRQ_INTB EMMA2RH_GPIO_IRQ_BASE+16
72#define MARKEINS_PCI_IRQ_INTC EMMA2RH_GPIO_IRQ_BASE+17
73#define MARKEINS_PCI_IRQ_INTD EMMA2RH_GPIO_IRQ_BASE+18
74
75#endif /* CONFIG_MARKEINS */
diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h
deleted file mode 100644
index 3c0d840e4577..000000000000
--- a/include/asm-mips/errno.h
+++ /dev/null
@@ -1,131 +0,0 @@
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 * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
7 */
8#ifndef _ASM_ERRNO_H
9#define _ASM_ERRNO_H
10
11/*
12 * These error numbers are intended to be MIPS ABI compatible
13 */
14
15#include <asm-generic/errno-base.h>
16
17#define ENOMSG 35 /* No message of desired type */
18#define EIDRM 36 /* Identifier removed */
19#define ECHRNG 37 /* Channel number out of range */
20#define EL2NSYNC 38 /* Level 2 not synchronized */
21#define EL3HLT 39 /* Level 3 halted */
22#define EL3RST 40 /* Level 3 reset */
23#define ELNRNG 41 /* Link number out of range */
24#define EUNATCH 42 /* Protocol driver not attached */
25#define ENOCSI 43 /* No CSI structure available */
26#define EL2HLT 44 /* Level 2 halted */
27#define EDEADLK 45 /* Resource deadlock would occur */
28#define ENOLCK 46 /* No record locks available */
29#define EBADE 50 /* Invalid exchange */
30#define EBADR 51 /* Invalid request descriptor */
31#define EXFULL 52 /* Exchange full */
32#define ENOANO 53 /* No anode */
33#define EBADRQC 54 /* Invalid request code */
34#define EBADSLT 55 /* Invalid slot */
35#define EDEADLOCK 56 /* File locking deadlock error */
36#define EBFONT 59 /* Bad font file format */
37#define ENOSTR 60 /* Device not a stream */
38#define ENODATA 61 /* No data available */
39#define ETIME 62 /* Timer expired */
40#define ENOSR 63 /* Out of streams resources */
41#define ENONET 64 /* Machine is not on the network */
42#define ENOPKG 65 /* Package not installed */
43#define EREMOTE 66 /* Object is remote */
44#define ENOLINK 67 /* Link has been severed */
45#define EADV 68 /* Advertise error */
46#define ESRMNT 69 /* Srmount error */
47#define ECOMM 70 /* Communication error on send */
48#define EPROTO 71 /* Protocol error */
49#define EDOTDOT 73 /* RFS specific error */
50#define EMULTIHOP 74 /* Multihop attempted */
51#define EBADMSG 77 /* Not a data message */
52#define ENAMETOOLONG 78 /* File name too long */
53#define EOVERFLOW 79 /* Value too large for defined data type */
54#define ENOTUNIQ 80 /* Name not unique on network */
55#define EBADFD 81 /* File descriptor in bad state */
56#define EREMCHG 82 /* Remote address changed */
57#define ELIBACC 83 /* Can not access a needed shared library */
58#define ELIBBAD 84 /* Accessing a corrupted shared library */
59#define ELIBSCN 85 /* .lib section in a.out corrupted */
60#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
61#define ELIBEXEC 87 /* Cannot exec a shared library directly */
62#define EILSEQ 88 /* Illegal byte sequence */
63#define ENOSYS 89 /* Function not implemented */
64#define ELOOP 90 /* Too many symbolic links encountered */
65#define ERESTART 91 /* Interrupted system call should be restarted */
66#define ESTRPIPE 92 /* Streams pipe error */
67#define ENOTEMPTY 93 /* Directory not empty */
68#define EUSERS 94 /* Too many users */
69#define ENOTSOCK 95 /* Socket operation on non-socket */
70#define EDESTADDRREQ 96 /* Destination address required */
71#define EMSGSIZE 97 /* Message too long */
72#define EPROTOTYPE 98 /* Protocol wrong type for socket */
73#define ENOPROTOOPT 99 /* Protocol not available */
74#define EPROTONOSUPPORT 120 /* Protocol not supported */
75#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
76#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
77#define EPFNOSUPPORT 123 /* Protocol family not supported */
78#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
79#define EADDRINUSE 125 /* Address already in use */
80#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
81#define ENETDOWN 127 /* Network is down */
82#define ENETUNREACH 128 /* Network is unreachable */
83#define ENETRESET 129 /* Network dropped connection because of reset */
84#define ECONNABORTED 130 /* Software caused connection abort */
85#define ECONNRESET 131 /* Connection reset by peer */
86#define ENOBUFS 132 /* No buffer space available */
87#define EISCONN 133 /* Transport endpoint is already connected */
88#define ENOTCONN 134 /* Transport endpoint is not connected */
89#define EUCLEAN 135 /* Structure needs cleaning */
90#define ENOTNAM 137 /* Not a XENIX named type file */
91#define ENAVAIL 138 /* No XENIX semaphores available */
92#define EISNAM 139 /* Is a named type file */
93#define EREMOTEIO 140 /* Remote I/O error */
94#define EINIT 141 /* Reserved */
95#define EREMDEV 142 /* Error 142 */
96#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
97#define ETOOMANYREFS 144 /* Too many references: cannot splice */
98#define ETIMEDOUT 145 /* Connection timed out */
99#define ECONNREFUSED 146 /* Connection refused */
100#define EHOSTDOWN 147 /* Host is down */
101#define EHOSTUNREACH 148 /* No route to host */
102#define EWOULDBLOCK EAGAIN /* Operation would block */
103#define EALREADY 149 /* Operation already in progress */
104#define EINPROGRESS 150 /* Operation now in progress */
105#define ESTALE 151 /* Stale NFS file handle */
106#define ECANCELED 158 /* AIO operation canceled */
107
108/*
109 * These error are Linux extensions.
110 */
111#define ENOMEDIUM 159 /* No medium found */
112#define EMEDIUMTYPE 160 /* Wrong medium type */
113#define ENOKEY 161 /* Required key not available */
114#define EKEYEXPIRED 162 /* Key has expired */
115#define EKEYREVOKED 163 /* Key has been revoked */
116#define EKEYREJECTED 164 /* Key was rejected by service */
117
118/* for robust mutexes */
119#define EOWNERDEAD 165 /* Owner died */
120#define ENOTRECOVERABLE 166 /* State not recoverable */
121
122#define EDQUOT 1133 /* Quota exceeded */
123
124#ifdef __KERNEL__
125
126/* The biggest error number defined here or in <linux/errno.h>. */
127#define EMAXERRNO 1133
128
129#endif /* __KERNEL__ */
130
131#endif /* _ASM_ERRNO_H */
diff --git a/include/asm-mips/fb.h b/include/asm-mips/fb.h
deleted file mode 100644
index bd3f68c9ddfc..000000000000
--- a/include/asm-mips/fb.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7
8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
9 unsigned long off)
10{
11 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
12}
13
14static inline int fb_is_primary_device(struct fb_info *info)
15{
16 return 0;
17}
18
19#endif /* _ASM_FB_H_ */
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
deleted file mode 100644
index 2a52333a062d..000000000000
--- a/include/asm-mips/fcntl.h
+++ /dev/null
@@ -1,61 +0,0 @@
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 * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
7 */
8#ifndef _ASM_FCNTL_H
9#define _ASM_FCNTL_H
10
11
12#define O_APPEND 0x0008
13#define O_SYNC 0x0010
14#define O_NONBLOCK 0x0080
15#define O_CREAT 0x0100 /* not fcntl */
16#define O_TRUNC 0x0200 /* not fcntl */
17#define O_EXCL 0x0400 /* not fcntl */
18#define O_NOCTTY 0x0800 /* not fcntl */
19#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
20#define O_LARGEFILE 0x2000 /* allow large file opens */
21#define O_DIRECT 0x8000 /* direct disk access hint */
22
23#define F_GETLK 14
24#define F_SETLK 6
25#define F_SETLKW 7
26
27#define F_SETOWN 24 /* for sockets. */
28#define F_GETOWN 23 /* for sockets. */
29
30#ifndef __mips64
31#define F_GETLK64 33 /* using 'struct flock64' */
32#define F_SETLK64 34
33#define F_SETLKW64 35
34#endif
35
36/*
37 * The flavours of struct flock. "struct flock" is the ABI compliant
38 * variant. Finally struct flock64 is the LFS variant of struct flock. As
39 * a historic accident and inconsistence with the ABI definition it doesn't
40 * contain all the same fields as struct flock.
41 */
42
43#ifdef CONFIG_32BIT
44
45struct flock {
46 short l_type;
47 short l_whence;
48 off_t l_start;
49 off_t l_len;
50 long l_sysid;
51 __kernel_pid_t l_pid;
52 long pad[4];
53};
54
55#define HAVE_ARCH_STRUCT_FLOCK
56
57#endif /* CONFIG_32BIT */
58
59#include <asm-generic/fcntl.h>
60
61#endif /* _ASM_FCNTL_H */
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h
deleted file mode 100644
index 9cc8522a394f..000000000000
--- a/include/asm-mips/fixmap.h
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * fixmap.h: compile-time virtual memory allocation
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 (C) 1998 Ingo Molnar
9 *
10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11 */
12
13#ifndef _ASM_FIXMAP_H
14#define _ASM_FIXMAP_H
15
16#include <asm/page.h>
17#ifdef CONFIG_HIGHMEM
18#include <linux/threads.h>
19#include <asm/kmap_types.h>
20#endif
21
22/*
23 * Here we define all the compile-time 'special' virtual
24 * addresses. The point is to have a constant address at
25 * compile time, but to set the physical address only
26 * in the boot process. We allocate these special addresses
27 * from the end of virtual memory (0xfffff000) backwards.
28 * Also this lets us do fail-safe vmalloc(), we
29 * can guarantee that these special addresses and
30 * vmalloc()-ed addresses never overlap.
31 *
32 * these 'compile-time allocated' memory buffers are
33 * fixed-size 4k pages. (or larger if used with an increment
34 * highger than 1) use fixmap_set(idx,phys) to associate
35 * physical memory with fixmap indices.
36 *
37 * TLB entries of such buffers will not be flushed across
38 * task switches.
39 */
40
41/*
42 * on UP currently we will have no trace of the fixmap mechanizm,
43 * no page table allocations, etc. This might change in the
44 * future, say framebuffers for the console driver(s) could be
45 * fix-mapped?
46 */
47enum fixed_addresses {
48#define FIX_N_COLOURS 8
49 FIX_CMAP_BEGIN,
50#ifdef CONFIG_MIPS_MT_SMTC
51 FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS),
52#else
53 FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
54#endif
55#ifdef CONFIG_HIGHMEM
56 /* reserved pte's for temporary kernel mappings */
57 FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
58 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
59#endif
60 __end_of_fixed_addresses
61};
62
63/*
64 * used by vmalloc.c.
65 *
66 * Leave one empty page between vmalloc'ed areas and
67 * the start of the fixmap, and leave one page empty
68 * at the top of mem..
69 */
70#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
71#define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000))
72#else
73#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
74#endif
75#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
76#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
77
78#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
79#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
80
81extern void __this_fixmap_does_not_exist(void);
82
83/*
84 * 'index to address' translation. If anyone tries to use the idx
85 * directly without tranlation, we catch the bug with a NULL-deference
86 * kernel oops. Illegal ranges of incoming indices are caught too.
87 */
88static inline unsigned long fix_to_virt(const unsigned int idx)
89{
90 /*
91 * this branch gets completely eliminated after inlining,
92 * except when someone tries to use fixaddr indices in an
93 * illegal way. (such as mixing up address types or using
94 * out-of-range indices).
95 *
96 * If it doesn't get removed, the linker will complain
97 * loudly with a reasonably clear error message..
98 */
99 if (idx >= __end_of_fixed_addresses)
100 __this_fixmap_does_not_exist();
101
102 return __fix_to_virt(idx);
103}
104
105static inline unsigned long virt_to_fix(const unsigned long vaddr)
106{
107 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
108 return __virt_to_fix(vaddr);
109}
110
111/*
112 * Called from pgtable_init()
113 */
114extern void fixrange_init(unsigned long start, unsigned long end,
115 pgd_t *pgd_base);
116
117
118#endif
diff --git a/include/asm-mips/floppy.h b/include/asm-mips/floppy.h
deleted file mode 100644
index 992d232adc83..000000000000
--- a/include/asm-mips/floppy.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * Architecture specific parts of the Floppy driver
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 (C) 1995 - 2000 Ralf Baechle
9 */
10#ifndef _ASM_FLOPPY_H
11#define _ASM_FLOPPY_H
12
13#include <linux/dma-mapping.h>
14
15static inline void fd_cacheflush(char * addr, long size)
16{
17 dma_cache_sync(NULL, addr, size, DMA_BIDIRECTIONAL);
18}
19
20#define MAX_BUFFER_SECTORS 24
21
22
23/*
24 * And on Mips's the CMOS info fails also ...
25 *
26 * FIXME: This information should come from the ARC configuration tree
27 * or whereever a particular machine has stored this ...
28 */
29#define FLOPPY0_TYPE fd_drive_type(0)
30#define FLOPPY1_TYPE fd_drive_type(1)
31
32#define FDC1 fd_getfdaddr1();
33
34#define N_FDC 1 /* do you *really* want a second controller? */
35#define N_DRIVE 8
36
37/*
38 * The DMA channel used by the floppy controller cannot access data at
39 * addresses >= 16MB
40 *
41 * Went back to the 1MB limit, as some people had problems with the floppy
42 * driver otherwise. It doesn't matter much for performance anyway, as most
43 * floppy accesses go through the track buffer.
44 *
45 * On MIPSes using vdma, this actually means that *all* transfers go thru
46 * the * track buffer since 0x1000000 is always smaller than KSEG0/1.
47 * Actually this needs to be a bit more complicated since the so much different
48 * hardware available with MIPS CPUs ...
49 */
50#define CROSS_64KB(a, s) ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)
51
52#define EXTRA_FLOPPY_PARAMS
53
54#include <floppy.h>
55
56#endif /* _ASM_FLOPPY_H */
diff --git a/include/asm-mips/fpregdef.h b/include/asm-mips/fpregdef.h
deleted file mode 100644
index 2b5fddc8f487..000000000000
--- a/include/asm-mips/fpregdef.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Definitions for the FPU register names
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 (C) 1995, 1999 Ralf Baechle
9 * Copyright (C) 1985 MIPS Computer Systems, Inc.
10 * Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc.
11 */
12#ifndef _ASM_FPREGDEF_H
13#define _ASM_FPREGDEF_H
14
15#include <asm/sgidefs.h>
16
17#if _MIPS_SIM == _MIPS_SIM_ABI32
18
19/*
20 * These definitions only cover the R3000-ish 16/32 register model.
21 * But we're trying to be R3000 friendly anyway ...
22 */
23#define fv0 $f0 /* return value */
24#define fv0f $f1
25#define fv1 $f2
26#define fv1f $f3
27#define fa0 $f12 /* argument registers */
28#define fa0f $f13
29#define fa1 $f14
30#define fa1f $f15
31#define ft0 $f4 /* caller saved */
32#define ft0f $f5
33#define ft1 $f6
34#define ft1f $f7
35#define ft2 $f8
36#define ft2f $f9
37#define ft3 $f10
38#define ft3f $f11
39#define ft4 $f16
40#define ft4f $f17
41#define ft5 $f18
42#define ft5f $f19
43#define fs0 $f20 /* callee saved */
44#define fs0f $f21
45#define fs1 $f22
46#define fs1f $f23
47#define fs2 $f24
48#define fs2f $f25
49#define fs3 $f26
50#define fs3f $f27
51#define fs4 $f28
52#define fs4f $f29
53#define fs5 $f30
54#define fs5f $f31
55
56#define fcr31 $31 /* FPU status register */
57
58#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
59
60#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
61
62#define fv0 $f0 /* return value */
63#define fv1 $f2
64#define fa0 $f12 /* argument registers */
65#define fa1 $f13
66#define fa2 $f14
67#define fa3 $f15
68#define fa4 $f16
69#define fa5 $f17
70#define fa6 $f18
71#define fa7 $f19
72#define ft0 $f4 /* caller saved */
73#define ft1 $f5
74#define ft2 $f6
75#define ft3 $f7
76#define ft4 $f8
77#define ft5 $f9
78#define ft6 $f10
79#define ft7 $f11
80#define ft8 $f20
81#define ft9 $f21
82#define ft10 $f22
83#define ft11 $f23
84#define ft12 $f1
85#define ft13 $f3
86#define fs0 $f24 /* callee saved */
87#define fs1 $f25
88#define fs2 $f26
89#define fs3 $f27
90#define fs4 $f28
91#define fs5 $f29
92#define fs6 $f30
93#define fs7 $f31
94
95#define fcr31 $31
96
97#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
98
99#endif /* _ASM_FPREGDEF_H */
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
deleted file mode 100644
index 8a3ef247659a..000000000000
--- a/include/asm-mips/fpu.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * Copyright (C) 2002 MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#ifndef _ASM_FPU_H
11#define _ASM_FPU_H
12
13#include <linux/sched.h>
14#include <linux/thread_info.h>
15#include <linux/bitops.h>
16
17#include <asm/mipsregs.h>
18#include <asm/cpu.h>
19#include <asm/cpu-features.h>
20#include <asm/hazards.h>
21#include <asm/processor.h>
22#include <asm/current.h>
23
24#ifdef CONFIG_MIPS_MT_FPAFF
25#include <asm/mips_mt.h>
26#endif
27
28struct sigcontext;
29struct sigcontext32;
30
31extern asmlinkage int (*save_fp_context)(struct sigcontext __user *sc);
32extern asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc);
33
34extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);
35extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);
36
37extern void fpu_emulator_init_fpu(void);
38extern int fpu_emulator_save_context(struct sigcontext __user *sc);
39extern int fpu_emulator_restore_context(struct sigcontext __user *sc);
40extern void _init_fpu(void);
41extern void _save_fp(struct task_struct *);
42extern void _restore_fp(struct task_struct *);
43
44#define __enable_fpu() \
45do { \
46 set_c0_status(ST0_CU1); \
47 enable_fpu_hazard(); \
48} while (0)
49
50#define __disable_fpu() \
51do { \
52 clear_c0_status(ST0_CU1); \
53 disable_fpu_hazard(); \
54} while (0)
55
56#define enable_fpu() \
57do { \
58 if (cpu_has_fpu) \
59 __enable_fpu(); \
60} while (0)
61
62#define disable_fpu() \
63do { \
64 if (cpu_has_fpu) \
65 __disable_fpu(); \
66} while (0)
67
68
69#define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU)
70
71static inline int __is_fpu_owner(void)
72{
73 return test_thread_flag(TIF_USEDFPU);
74}
75
76static inline int is_fpu_owner(void)
77{
78 return cpu_has_fpu && __is_fpu_owner();
79}
80
81static inline void __own_fpu(void)
82{
83 __enable_fpu();
84 KSTK_STATUS(current) |= ST0_CU1;
85 set_thread_flag(TIF_USEDFPU);
86}
87
88static inline void own_fpu_inatomic(int restore)
89{
90 if (cpu_has_fpu && !__is_fpu_owner()) {
91 __own_fpu();
92 if (restore)
93 _restore_fp(current);
94 }
95}
96
97static inline void own_fpu(int restore)
98{
99 preempt_disable();
100 own_fpu_inatomic(restore);
101 preempt_enable();
102}
103
104static inline void lose_fpu(int save)
105{
106 preempt_disable();
107 if (is_fpu_owner()) {
108 if (save)
109 _save_fp(current);
110 KSTK_STATUS(current) &= ~ST0_CU1;
111 clear_thread_flag(TIF_USEDFPU);
112 __disable_fpu();
113 }
114 preempt_enable();
115}
116
117static inline void init_fpu(void)
118{
119 preempt_disable();
120 if (cpu_has_fpu) {
121 __own_fpu();
122 _init_fpu();
123 } else {
124 fpu_emulator_init_fpu();
125 }
126 preempt_enable();
127}
128
129static inline void save_fp(struct task_struct *tsk)
130{
131 if (cpu_has_fpu)
132 _save_fp(tsk);
133}
134
135static inline void restore_fp(struct task_struct *tsk)
136{
137 if (cpu_has_fpu)
138 _restore_fp(tsk);
139}
140
141static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
142{
143 if (tsk == current) {
144 preempt_disable();
145 if (is_fpu_owner())
146 _save_fp(current);
147 preempt_enable();
148 }
149
150 return tsk->thread.fpu.fpr;
151}
152
153#endif /* _ASM_FPU_H */
diff --git a/include/asm-mips/fpu_emulator.h b/include/asm-mips/fpu_emulator.h
deleted file mode 100644
index 2731c38bd7ae..000000000000
--- a/include/asm-mips/fpu_emulator.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * This program is free software; you can distribute it and/or modify it
3 * under the terms of the GNU General Public License (Version 2) as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
9 * for more details.
10 *
11 * You should have received a copy of the GNU General Public License along
12 * with this program; if not, write to the Free Software Foundation, Inc.,
13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
14 *
15 * Further private data for which no space exists in mips_fpu_struct.
16 * This should be subsumed into the mips_fpu_struct structure as
17 * defined in processor.h as soon as the absurd wired absolute assembler
18 * offsets become dynamic at compile time.
19 *
20 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
21 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
22 */
23#ifndef _ASM_FPU_EMULATOR_H
24#define _ASM_FPU_EMULATOR_H
25
26struct mips_fpu_emulator_stats {
27 unsigned int emulated;
28 unsigned int loads;
29 unsigned int stores;
30 unsigned int cp1ops;
31 unsigned int cp1xops;
32 unsigned int errors;
33};
34
35extern struct mips_fpu_emulator_stats fpuemustats;
36
37#endif /* _ASM_FPU_EMULATOR_H */
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
deleted file mode 100644
index b9cce90346cf..000000000000
--- a/include/asm-mips/futex.h
+++ /dev/null
@@ -1,203 +0,0 @@
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 * Copyright (c) 2006 Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef _ASM_FUTEX_H
9#define _ASM_FUTEX_H
10
11#ifdef __KERNEL__
12
13#include <linux/futex.h>
14#include <linux/uaccess.h>
15#include <asm/barrier.h>
16#include <asm/errno.h>
17#include <asm/war.h>
18
19#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
20{ \
21 if (cpu_has_llsc && R10000_LLSC_WAR) { \
22 __asm__ __volatile__( \
23 " .set push \n" \
24 " .set noat \n" \
25 " .set mips3 \n" \
26 "1: ll %1, %4 # __futex_atomic_op \n" \
27 " .set mips0 \n" \
28 " " insn " \n" \
29 " .set mips3 \n" \
30 "2: sc $1, %2 \n" \
31 " beqzl $1, 1b \n" \
32 __WEAK_LLSC_MB \
33 "3: \n" \
34 " .set pop \n" \
35 " .set mips0 \n" \
36 " .section .fixup,\"ax\" \n" \
37 "4: li %0, %6 \n" \
38 " j 3b \n" \
39 " .previous \n" \
40 " .section __ex_table,\"a\" \n" \
41 " "__UA_ADDR "\t1b, 4b \n" \
42 " "__UA_ADDR "\t2b, 4b \n" \
43 " .previous \n" \
44 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
45 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
46 : "memory"); \
47 } else if (cpu_has_llsc) { \
48 __asm__ __volatile__( \
49 " .set push \n" \
50 " .set noat \n" \
51 " .set mips3 \n" \
52 "1: ll %1, %4 # __futex_atomic_op \n" \
53 " .set mips0 \n" \
54 " " insn " \n" \
55 " .set mips3 \n" \
56 "2: sc $1, %2 \n" \
57 " beqz $1, 1b \n" \
58 __WEAK_LLSC_MB \
59 "3: \n" \
60 " .set pop \n" \
61 " .set mips0 \n" \
62 " .section .fixup,\"ax\" \n" \
63 "4: li %0, %6 \n" \
64 " j 3b \n" \
65 " .previous \n" \
66 " .section __ex_table,\"a\" \n" \
67 " "__UA_ADDR "\t1b, 4b \n" \
68 " "__UA_ADDR "\t2b, 4b \n" \
69 " .previous \n" \
70 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
71 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
72 : "memory"); \
73 } else \
74 ret = -ENOSYS; \
75}
76
77static inline int
78futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
79{
80 int op = (encoded_op >> 28) & 7;
81 int cmp = (encoded_op >> 24) & 15;
82 int oparg = (encoded_op << 8) >> 20;
83 int cmparg = (encoded_op << 20) >> 20;
84 int oldval = 0, ret;
85 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
86 oparg = 1 << oparg;
87
88 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
89 return -EFAULT;
90
91 pagefault_disable();
92
93 switch (op) {
94 case FUTEX_OP_SET:
95 __futex_atomic_op("move $1, %z5", ret, oldval, uaddr, oparg);
96 break;
97
98 case FUTEX_OP_ADD:
99 __futex_atomic_op("addu $1, %1, %z5",
100 ret, oldval, uaddr, oparg);
101 break;
102 case FUTEX_OP_OR:
103 __futex_atomic_op("or $1, %1, %z5",
104 ret, oldval, uaddr, oparg);
105 break;
106 case FUTEX_OP_ANDN:
107 __futex_atomic_op("and $1, %1, %z5",
108 ret, oldval, uaddr, ~oparg);
109 break;
110 case FUTEX_OP_XOR:
111 __futex_atomic_op("xor $1, %1, %z5",
112 ret, oldval, uaddr, oparg);
113 break;
114 default:
115 ret = -ENOSYS;
116 }
117
118 pagefault_enable();
119
120 if (!ret) {
121 switch (cmp) {
122 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
123 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
124 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
125 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
126 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
127 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
128 default: ret = -ENOSYS;
129 }
130 }
131 return ret;
132}
133
134static inline int
135futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
136{
137 int retval;
138
139 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
140 return -EFAULT;
141
142 if (cpu_has_llsc && R10000_LLSC_WAR) {
143 __asm__ __volatile__(
144 "# futex_atomic_cmpxchg_inatomic \n"
145 " .set push \n"
146 " .set noat \n"
147 " .set mips3 \n"
148 "1: ll %0, %2 \n"
149 " bne %0, %z3, 3f \n"
150 " .set mips0 \n"
151 " move $1, %z4 \n"
152 " .set mips3 \n"
153 "2: sc $1, %1 \n"
154 " beqzl $1, 1b \n"
155 __WEAK_LLSC_MB
156 "3: \n"
157 " .set pop \n"
158 " .section .fixup,\"ax\" \n"
159 "4: li %0, %5 \n"
160 " j 3b \n"
161 " .previous \n"
162 " .section __ex_table,\"a\" \n"
163 " "__UA_ADDR "\t1b, 4b \n"
164 " "__UA_ADDR "\t2b, 4b \n"
165 " .previous \n"
166 : "=&r" (retval), "=R" (*uaddr)
167 : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT)
168 : "memory");
169 } else if (cpu_has_llsc) {
170 __asm__ __volatile__(
171 "# futex_atomic_cmpxchg_inatomic \n"
172 " .set push \n"
173 " .set noat \n"
174 " .set mips3 \n"
175 "1: ll %0, %2 \n"
176 " bne %0, %z3, 3f \n"
177 " .set mips0 \n"
178 " move $1, %z4 \n"
179 " .set mips3 \n"
180 "2: sc $1, %1 \n"
181 " beqz $1, 1b \n"
182 __WEAK_LLSC_MB
183 "3: \n"
184 " .set pop \n"
185 " .section .fixup,\"ax\" \n"
186 "4: li %0, %5 \n"
187 " j 3b \n"
188 " .previous \n"
189 " .section __ex_table,\"a\" \n"
190 " "__UA_ADDR "\t1b, 4b \n"
191 " "__UA_ADDR "\t2b, 4b \n"
192 " .previous \n"
193 : "=&r" (retval), "=R" (*uaddr)
194 : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT)
195 : "memory");
196 } else
197 return -ENOSYS;
198
199 return retval;
200}
201
202#endif
203#endif /* _ASM_FUTEX_H */
diff --git a/include/asm-mips/fw/arc/hinv.h b/include/asm-mips/fw/arc/hinv.h
deleted file mode 100644
index e6ff4add04e2..000000000000
--- a/include/asm-mips/fw/arc/hinv.h
+++ /dev/null
@@ -1,175 +0,0 @@
1/*
2 * ARCS hardware/memory inventory/configuration and system ID definitions.
3 */
4#ifndef _ASM_ARC_HINV_H
5#define _ASM_ARC_HINV_H
6
7#include <asm/sgidefs.h>
8#include <asm/fw/arc/types.h>
9
10/* configuration query defines */
11typedef enum configclass {
12 SystemClass,
13 ProcessorClass,
14 CacheClass,
15#ifndef _NT_PROM
16 MemoryClass,
17 AdapterClass,
18 ControllerClass,
19 PeripheralClass
20#else /* _NT_PROM */
21 AdapterClass,
22 ControllerClass,
23 PeripheralClass,
24 MemoryClass
25#endif /* _NT_PROM */
26} CONFIGCLASS;
27
28typedef enum configtype {
29 ARC,
30 CPU,
31 FPU,
32 PrimaryICache,
33 PrimaryDCache,
34 SecondaryICache,
35 SecondaryDCache,
36 SecondaryCache,
37#ifndef _NT_PROM
38 Memory,
39#endif
40 EISAAdapter,
41 TCAdapter,
42 SCSIAdapter,
43 DTIAdapter,
44 MultiFunctionAdapter,
45 DiskController,
46 TapeController,
47 CDROMController,
48 WORMController,
49 SerialController,
50 NetworkController,
51 DisplayController,
52 ParallelController,
53 PointerController,
54 KeyboardController,
55 AudioController,
56 OtherController,
57 DiskPeripheral,
58 FloppyDiskPeripheral,
59 TapePeripheral,
60 ModemPeripheral,
61 MonitorPeripheral,
62 PrinterPeripheral,
63 PointerPeripheral,
64 KeyboardPeripheral,
65 TerminalPeripheral,
66 LinePeripheral,
67 NetworkPeripheral,
68#ifdef _NT_PROM
69 Memory,
70#endif
71 OtherPeripheral,
72
73 /* new stuff for IP30 */
74 /* added without moving anything */
75 /* except ANONYMOUS. */
76
77 XTalkAdapter,
78 PCIAdapter,
79 GIOAdapter,
80 TPUAdapter,
81
82 Anonymous
83} CONFIGTYPE;
84
85typedef enum {
86 Failed = 1,
87 ReadOnly = 2,
88 Removable = 4,
89 ConsoleIn = 8,
90 ConsoleOut = 16,
91 Input = 32,
92 Output = 64
93} IDENTIFIERFLAG;
94
95#ifndef NULL /* for GetChild(NULL); */
96#define NULL 0
97#endif
98
99union key_u {
100 struct {
101#ifdef _MIPSEB
102 unsigned char c_bsize; /* block size in lines */
103 unsigned char c_lsize; /* line size in bytes/tag */
104 unsigned short c_size; /* cache size in 4K pages */
105#else /* _MIPSEL */
106 unsigned short c_size; /* cache size in 4K pages */
107 unsigned char c_lsize; /* line size in bytes/tag */
108 unsigned char c_bsize; /* block size in lines */
109#endif /* _MIPSEL */
110 } cache;
111 ULONG FullKey;
112};
113
114#if _MIPS_SIM == _MIPS_SIM_ABI64
115#define SGI_ARCS_VERS 64 /* sgi 64-bit version */
116#define SGI_ARCS_REV 0 /* rev .00 */
117#else
118#define SGI_ARCS_VERS 1 /* first version */
119#define SGI_ARCS_REV 10 /* rev .10, 3/04/92 */
120#endif
121
122typedef struct component {
123 CONFIGCLASS Class;
124 CONFIGTYPE Type;
125 IDENTIFIERFLAG Flags;
126 USHORT Version;
127 USHORT Revision;
128 ULONG Key;
129 ULONG AffinityMask;
130 ULONG ConfigurationDataSize;
131 ULONG IdentifierLength;
132 char *Identifier;
133} COMPONENT;
134
135/* internal structure that holds pathname parsing data */
136struct cfgdata {
137 char *name; /* full name */
138 int minlen; /* minimum length to match */
139 CONFIGTYPE type; /* type of token */
140};
141
142/* System ID */
143typedef struct systemid {
144 CHAR VendorId[8];
145 CHAR ProductId[8];
146} SYSTEMID;
147
148/* memory query functions */
149typedef enum memorytype {
150 ExceptionBlock,
151 SPBPage, /* ARCS == SystemParameterBlock */
152#ifndef _NT_PROM
153 FreeContiguous,
154 FreeMemory,
155 BadMemory,
156 LoadedProgram,
157 FirmwareTemporary,
158 FirmwarePermanent
159#else /* _NT_PROM */
160 FreeMemory,
161 BadMemory,
162 LoadedProgram,
163 FirmwareTemporary,
164 FirmwarePermanent,
165 FreeContiguous
166#endif /* _NT_PROM */
167} MEMORYTYPE;
168
169typedef struct memorydescriptor {
170 MEMORYTYPE Type;
171 LONG BasePage;
172 LONG PageCount;
173} MEMORYDESCRIPTOR;
174
175#endif /* _ASM_ARC_HINV_H */
diff --git a/include/asm-mips/fw/arc/types.h b/include/asm-mips/fw/arc/types.h
deleted file mode 100644
index b9adcd6f0860..000000000000
--- a/include/asm-mips/fw/arc/types.h
+++ /dev/null
@@ -1,86 +0,0 @@
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 * Copyright 1999 Ralf Baechle (ralf@gnu.org)
7 * Copyright 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_ARC_TYPES_H
10#define _ASM_ARC_TYPES_H
11
12
13#ifdef CONFIG_ARC32
14
15typedef char CHAR;
16typedef short SHORT;
17typedef long LARGE_INTEGER __attribute__ ((__mode__ (__DI__)));
18typedef long LONG __attribute__ ((__mode__ (__SI__)));
19typedef unsigned char UCHAR;
20typedef unsigned short USHORT;
21typedef unsigned long ULONG __attribute__ ((__mode__ (__SI__)));
22typedef void VOID;
23
24/* The pointer types. Note that we're using a 64-bit compiler but all
25 pointer in the ARC structures are only 32-bit, so we need some disgusting
26 workarounds. Keep your vomit bag handy. */
27typedef LONG _PCHAR;
28typedef LONG _PSHORT;
29typedef LONG _PLARGE_INTEGER;
30typedef LONG _PLONG;
31typedef LONG _PUCHAR;
32typedef LONG _PUSHORT;
33typedef LONG _PULONG;
34typedef LONG _PVOID;
35
36#endif /* CONFIG_ARC32 */
37
38#ifdef CONFIG_ARC64
39
40typedef char CHAR;
41typedef short SHORT;
42typedef long LARGE_INTEGER __attribute__ ((__mode__ (__DI__)));
43typedef long LONG __attribute__ ((__mode__ (__DI__)));
44typedef unsigned char UCHAR;
45typedef unsigned short USHORT;
46typedef unsigned long ULONG __attribute__ ((__mode__ (__DI__)));
47typedef void VOID;
48
49/* The pointer types. We're 64-bit and the firmware is also 64-bit, so
50 live is sane ... */
51typedef CHAR *_PCHAR;
52typedef SHORT *_PSHORT;
53typedef LARGE_INTEGER *_PLARGE_INTEGER;
54typedef LONG *_PLONG;
55typedef UCHAR *_PUCHAR;
56typedef USHORT *_PUSHORT;
57typedef ULONG *_PULONG;
58typedef VOID *_PVOID;
59
60#endif /* CONFIG_ARC64 */
61
62typedef CHAR *PCHAR;
63typedef SHORT *PSHORT;
64typedef LARGE_INTEGER *PLARGE_INTEGER;
65typedef LONG *PLONG;
66typedef UCHAR *PUCHAR;
67typedef USHORT *PUSHORT;
68typedef ULONG *PULONG;
69typedef VOID *PVOID;
70
71/*
72 * Return type of ArcGetDisplayStatus()
73 */
74typedef struct {
75 USHORT CursorXPosition;
76 USHORT CursorYPosition;
77 USHORT CursorMaxXPosition;
78 USHORT CursorMaxYPosition;
79 USHORT ForegroundColor;
80 USHORT BackgroundColor;
81 UCHAR HighIntensity;
82 UCHAR Underscored;
83 UCHAR ReverseVideo;
84} DISPLAY_STATUS;
85
86#endif /* _ASM_ARC_TYPES_H */
diff --git a/include/asm-mips/fw/cfe/cfe_api.h b/include/asm-mips/fw/cfe/cfe_api.h
deleted file mode 100644
index 0995575db320..000000000000
--- a/include/asm-mips/fw/cfe/cfe_api.h
+++ /dev/null
@@ -1,122 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18/*
19 * Broadcom Common Firmware Environment (CFE)
20 *
21 * This file contains declarations for doing callbacks to
22 * cfe from an application. It should be the only header
23 * needed by the application to use this library
24 *
25 * Authors: Mitch Lichtenberg, Chris Demetriou
26 */
27#ifndef CFE_API_H
28#define CFE_API_H
29
30#include <linux/types.h>
31#include <linux/string.h>
32
33typedef long intptr_t;
34
35
36/*
37 * Constants
38 */
39
40/* Seal indicating CFE's presence, passed to user program. */
41#define CFE_EPTSEAL 0x43464531
42
43#define CFE_MI_RESERVED 0 /* memory is reserved, do not use */
44#define CFE_MI_AVAILABLE 1 /* memory is available */
45
46#define CFE_FLG_WARMSTART 0x00000001
47#define CFE_FLG_FULL_ARENA 0x00000001
48#define CFE_FLG_ENV_PERMANENT 0x00000001
49
50#define CFE_CPU_CMD_START 1
51#define CFE_CPU_CMD_STOP 0
52
53#define CFE_STDHANDLE_CONSOLE 0
54
55#define CFE_DEV_NETWORK 1
56#define CFE_DEV_DISK 2
57#define CFE_DEV_FLASH 3
58#define CFE_DEV_SERIAL 4
59#define CFE_DEV_CPU 5
60#define CFE_DEV_NVRAM 6
61#define CFE_DEV_CLOCK 7
62#define CFE_DEV_OTHER 8
63#define CFE_DEV_MASK 0x0F
64
65#define CFE_CACHE_FLUSH_D 1
66#define CFE_CACHE_INVAL_I 2
67#define CFE_CACHE_INVAL_D 4
68#define CFE_CACHE_INVAL_L2 8
69
70#define CFE_FWI_64BIT 0x00000001
71#define CFE_FWI_32BIT 0x00000002
72#define CFE_FWI_RELOC 0x00000004
73#define CFE_FWI_UNCACHED 0x00000008
74#define CFE_FWI_MULTICPU 0x00000010
75#define CFE_FWI_FUNCSIM 0x00000020
76#define CFE_FWI_RTLSIM 0x00000040
77
78typedef struct {
79 int64_t fwi_version; /* major, minor, eco version */
80 int64_t fwi_totalmem; /* total installed mem */
81 int64_t fwi_flags; /* various flags */
82 int64_t fwi_boardid; /* board ID */
83 int64_t fwi_bootarea_va; /* VA of boot area */
84 int64_t fwi_bootarea_pa; /* PA of boot area */
85 int64_t fwi_bootarea_size; /* size of boot area */
86} cfe_fwinfo_t;
87
88
89/*
90 * Defines and prototypes for functions which take no arguments.
91 */
92int64_t cfe_getticks(void);
93
94/*
95 * Defines and prototypes for the rest of the functions.
96 */
97int cfe_close(int handle);
98int cfe_cpu_start(int cpu, void (*fn) (void), long sp, long gp, long a1);
99int cfe_cpu_stop(int cpu);
100int cfe_enumenv(int idx, char *name, int namelen, char *val, int vallen);
101int cfe_enummem(int idx, int flags, uint64_t * start, uint64_t * length,
102 uint64_t * type);
103int cfe_exit(int warm, int status);
104int cfe_flushcache(int flg);
105int cfe_getdevinfo(char *name);
106int cfe_getenv(char *name, char *dest, int destlen);
107int cfe_getfwinfo(cfe_fwinfo_t * info);
108int cfe_getstdhandle(int flg);
109int cfe_init(uint64_t handle, uint64_t ept);
110int cfe_inpstat(int handle);
111int cfe_ioctl(int handle, unsigned int ioctlnum, unsigned char *buffer,
112 int length, int *retlen, uint64_t offset);
113int cfe_open(char *name);
114int cfe_read(int handle, unsigned char *buffer, int length);
115int cfe_readblk(int handle, int64_t offset, unsigned char *buffer,
116 int length);
117int cfe_setenv(char *name, char *val);
118int cfe_write(int handle, unsigned char *buffer, int length);
119int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
120 int length);
121
122#endif /* CFE_API_H */
diff --git a/include/asm-mips/fw/cfe/cfe_error.h b/include/asm-mips/fw/cfe/cfe_error.h
deleted file mode 100644
index b80374636279..000000000000
--- a/include/asm-mips/fw/cfe/cfe_error.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19/*
20 * Broadcom Common Firmware Environment (CFE)
21 *
22 * CFE's global error code list is here.
23 *
24 * Author: Mitch Lichtenberg
25 */
26
27#define CFE_OK 0
28#define CFE_ERR -1 /* generic error */
29#define CFE_ERR_INV_COMMAND -2
30#define CFE_ERR_EOF -3
31#define CFE_ERR_IOERR -4
32#define CFE_ERR_NOMEM -5
33#define CFE_ERR_DEVNOTFOUND -6
34#define CFE_ERR_DEVOPEN -7
35#define CFE_ERR_INV_PARAM -8
36#define CFE_ERR_ENVNOTFOUND -9
37#define CFE_ERR_ENVREADONLY -10
38
39#define CFE_ERR_NOTELF -11
40#define CFE_ERR_NOT32BIT -12
41#define CFE_ERR_WRONGENDIAN -13
42#define CFE_ERR_BADELFVERS -14
43#define CFE_ERR_NOTMIPS -15
44#define CFE_ERR_BADELFFMT -16
45#define CFE_ERR_BADADDR -17
46
47#define CFE_ERR_FILENOTFOUND -18
48#define CFE_ERR_UNSUPPORTED -19
49
50#define CFE_ERR_HOSTUNKNOWN -20
51
52#define CFE_ERR_TIMEOUT -21
53
54#define CFE_ERR_PROTOCOLERR -22
55
56#define CFE_ERR_NETDOWN -23
57#define CFE_ERR_NONAMESERVER -24
58
59#define CFE_ERR_NOHANDLES -25
60#define CFE_ERR_ALREADYBOUND -26
61
62#define CFE_ERR_CANNOTSET -27
63#define CFE_ERR_NOMORE -28
64#define CFE_ERR_BADFILESYS -29
65#define CFE_ERR_FSNOTAVAIL -30
66
67#define CFE_ERR_INVBOOTBLOCK -31
68#define CFE_ERR_WRONGDEVTYPE -32
69#define CFE_ERR_BBCHECKSUM -33
70#define CFE_ERR_BOOTPROGCHKSUM -34
71
72#define CFE_ERR_LDRNOTAVAIL -35
73
74#define CFE_ERR_NOTREADY -36
75
76#define CFE_ERR_GETMEM -37
77#define CFE_ERR_SETMEM -38
78
79#define CFE_ERR_NOTCONN -39
80#define CFE_ERR_ADDRINUSE -40
diff --git a/include/asm-mips/gcmpregs.h b/include/asm-mips/gcmpregs.h
deleted file mode 100644
index d74a8a4ca861..000000000000
--- a/include/asm-mips/gcmpregs.h
+++ /dev/null
@@ -1,117 +0,0 @@
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 * Copyright (C) 2000, 07 MIPS Technologies, Inc.
7 *
8 * Multiprocessor Subsystem Register Definitions
9 *
10 */
11#ifndef _ASM_GCMPREGS_H
12#define _ASM_GCMPREGS_H
13
14
15/* Offsets to major blocks within GCMP from GCMP base */
16#define GCMP_GCB_OFS 0x0000 /* Global Control Block */
17#define GCMP_CLCB_OFS 0x2000 /* Core Local Control Block */
18#define GCMP_COCB_OFS 0x4000 /* Core Other Control Block */
19#define GCMP_GDB_OFS 0x8000 /* Global Debug Block */
20
21/* Offsets to individual GCMP registers from GCMP base */
22#define GCMPOFS(block, tag, reg) (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS)
23
24#define GCMPGCBOFS(reg) GCMPOFS(GCB, GCB, reg)
25#define GCMPCLCBOFS(reg) GCMPOFS(CLCB, CCB, reg)
26#define GCMPCOCBOFS(reg) GCMPOFS(COCB, CCB, reg)
27#define GCMPGDBOFS(reg) GCMPOFS(GDB, GDB, reg)
28
29/* GCMP register access */
30#define GCMPGCB(reg) REGP(_gcmp_base, GCMPGCBOFS(reg))
31#define GCMPCLCB(reg) REGP(_gcmp_base, GCMPCLCBOFS(reg))
32#define GCMPCOCB(reg) REGP(_gcmp_base, GCMPCOCBOFS(reg))
33#define GCMPGDB(reg) REGP(_gcmp_base, GCMPGDBOFS(reg))
34
35/* Mask generation */
36#define GCMPMSK(block, reg, bits) (MSK(bits)<<GCMP_##block##_##reg##_SHF)
37#define GCMPGCBMSK(reg, bits) GCMPMSK(GCB, reg, bits)
38#define GCMPCCBMSK(reg, bits) GCMPMSK(CCB, reg, bits)
39#define GCMPGDBMSK(reg, bits) GCMPMSK(GDB, reg, bits)
40
41/* GCB registers */
42#define GCMP_GCB_GC_OFS 0x0000 /* Global Config Register */
43#define GCMP_GCB_GC_NUMIOCU_SHF 8
44#define GCMP_GCB_GC_NUMIOCU_MSK GCMPGCBMSK(GC_NUMIOCU, 4)
45#define GCMP_GCB_GC_NUMCORES_SHF 0
46#define GCMP_GCB_GC_NUMCORES_MSK GCMPGCBMSK(GC_NUMCORES, 8)
47#define GCMP_GCB_GCMPB_OFS 0x0008 /* Global GCMP Base */
48#define GCMP_GCB_GCMPB_GCMPBASE_SHF 15
49#define GCMP_GCB_GCMPB_GCMPBASE_MSK GCMPGCBMSK(GCMPB_GCMPBASE, 17)
50#define GCMP_GCB_GCMPB_CMDEFTGT_SHF 0
51#define GCMP_GCB_GCMPB_CMDEFTGT_MSK GCMPGCBMSK(GCMPB_CMDEFTGT, 2)
52#define GCMP_GCB_GCMPB_CMDEFTGT_MEM 0
53#define GCMP_GCB_GCMPB_CMDEFTGT_MEM1 1
54#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU1 2
55#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU2 3
56#define GCMP_GCB_CCMC_OFS 0x0010 /* Global CM Control */
57#define GCMP_GCB_GCSRAP_OFS 0x0020 /* Global CSR Access Privilege */
58#define GCMP_GCB_GCSRAP_CMACCESS_SHF 0
59#define GCMP_GCB_GCSRAP_CMACCESS_MSK GCMPGCBMSK(GCSRAP_CMACCESS, 8)
60#define GCMP_GCB_GCMPREV_OFS 0x0030 /* GCMP Revision Register */
61#define GCMP_GCB_GCMEM_OFS 0x0040 /* Global CM Error Mask */
62#define GCMP_GCB_GCMEC_OFS 0x0048 /* Global CM Error Cause */
63#define GCMP_GCB_GMEC_ERROR_TYPE_SHF 27
64#define GCMP_GCB_GMEC_ERROR_TYPE_MSK GCMPGCBMSK(GMEC_ERROR_TYPE, 5)
65#define GCMP_GCB_GMEC_ERROR_INFO_SHF 0
66#define GCMP_GCB_GMEC_ERROR_INFO_MSK GCMPGCBMSK(GMEC_ERROR_INFO, 27)
67#define GCMP_GCB_GCMEA_OFS 0x0050 /* Global CM Error Address */
68#define GCMP_GCB_GCMEO_OFS 0x0058 /* Global CM Error Multiple */
69#define GCMP_GCB_GMEO_ERROR_2ND_SHF 0
70#define GCMP_GCB_GMEO_ERROR_2ND_MSK GCMPGCBMSK(GMEO_ERROR_2ND, 5)
71#define GCMP_GCB_GICBA_OFS 0x0080 /* Global Interrupt Controller Base Address */
72#define GCMP_GCB_GICBA_BASE_SHF 17
73#define GCMP_GCB_GICBA_BASE_MSK GCMPGCBMSK(GICBA_BASE, 15)
74#define GCMP_GCB_GICBA_EN_SHF 0
75#define GCMP_GCB_GICBA_EN_MSK GCMPGCBMSK(GICBA_EN, 1)
76
77/* GCB Regions */
78#define GCMP_GCB_CMxBASE_OFS(n) (0x0090+16*(n)) /* Global Region[0-3] Base Address */
79#define GCMP_GCB_CMxBASE_BASE_SHF 16
80#define GCMP_GCB_CMxBASE_BASE_MSK GCMPGCBMSK(CMxBASE_BASE, 16)
81#define GCMP_GCB_CMxMASK_OFS(n) (0x0098+16*(n)) /* Global Region[0-3] Address Mask */
82#define GCMP_GCB_CMxMASK_MASK_SHF 16
83#define GCMP_GCB_CMxMASK_MASK_MSK GCMPGCBMSK(CMxMASK_MASK, 16)
84#define GCMP_GCB_CMxMASK_CMREGTGT_SHF 0
85#define GCMP_GCB_CMxMASK_CMREGTGT_MSK GCMPGCBMSK(CMxMASK_CMREGTGT, 2)
86#define GCMP_GCB_CMxMASK_CMREGTGT_MEM 0
87#define GCMP_GCB_CMxMASK_CMREGTGT_MEM1 1
88#define GCMP_GCB_CMxMASK_CMREGTGT_IOCU1 2
89#define GCMP_GCB_CMxMASK_CMREGTGT_IOCU2 3
90
91
92/* Core local/Core other control block registers */
93#define GCMP_CCB_RESETR_OFS 0x0000 /* Reset Release */
94#define GCMP_CCB_RESETR_INRESET_SHF 0
95#define GCMP_CCB_RESETR_INRESET_MSK GCMPCCBMSK(RESETR_INRESET, 16)
96#define GCMP_CCB_COHCTL_OFS 0x0008 /* Coherence Control */
97#define GCMP_CCB_COHCTL_DOMAIN_SHF 0
98#define GCMP_CCB_COHCTL_DOMAIN_MSK GCMPCCBMSK(COHCTL_DOMAIN, 8)
99#define GCMP_CCB_CFG_OFS 0x0010 /* Config */
100#define GCMP_CCB_CFG_IOCUTYPE_SHF 10
101#define GCMP_CCB_CFG_IOCUTYPE_MSK GCMPCCBMSK(CFG_IOCUTYPE, 2)
102#define GCMP_CCB_CFG_IOCUTYPE_CPU 0
103#define GCMP_CCB_CFG_IOCUTYPE_NCIOCU 1
104#define GCMP_CCB_CFG_IOCUTYPE_CIOCU 2
105#define GCMP_CCB_CFG_NUMVPE_SHF 0
106#define GCMP_CCB_CFG_NUMVPE_MSK GCMPCCBMSK(CFG_NUMVPE, 10)
107#define GCMP_CCB_OTHER_OFS 0x0018 /* Other Address */
108#define GCMP_CCB_OTHER_CORENUM_SHF 16
109#define GCMP_CCB_OTHER_CORENUM_MSK GCMPCCBMSK(OTHER_CORENUM, 16)
110#define GCMP_CCB_RESETBASE_OFS 0x0020 /* Reset Exception Base */
111#define GCMP_CCB_RESETBASE_BEV_SHF 12
112#define GCMP_CCB_RESETBASE_BEV_MSK GCMPCCBMSK(RESETBASE_BEV, 20)
113#define GCMP_CCB_ID_OFS 0x0028 /* Identification */
114#define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */
115#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */
116
117#endif /* _ASM_GCMPREGS_H */
diff --git a/include/asm-mips/gic.h b/include/asm-mips/gic.h
deleted file mode 100644
index 954807d9d66a..000000000000
--- a/include/asm-mips/gic.h
+++ /dev/null
@@ -1,487 +0,0 @@
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 * Copyright (C) 2000, 07 MIPS Technologies, Inc.
7 *
8 * GIC Register Definitions
9 *
10 */
11#ifndef _ASM_GICREGS_H
12#define _ASM_GICREGS_H
13
14#undef GICISBYTELITTLEENDIAN
15#define GICISWORDLITTLEENDIAN
16
17/* Constants */
18#define GIC_POL_POS 1
19#define GIC_POL_NEG 0
20#define GIC_TRIG_EDGE 1
21#define GIC_TRIG_LEVEL 0
22
23#define GIC_NUM_INTRS 32
24
25#define MSK(n) ((1 << (n)) - 1)
26#define REG32(addr) (*(volatile unsigned int *) (addr))
27#define REG(base, offs) REG32((unsigned long)(base) + offs##_##OFS)
28#define REGP(base, phys) REG32((unsigned long)(base) + (phys))
29
30/* Accessors */
31#define GIC_REG(segment, offset) \
32 REG32(_gic_base + segment##_##SECTION_OFS + offset##_##OFS)
33#define GIC_REG_ADDR(segment, offset) \
34 REG32(_gic_base + segment##_##SECTION_OFS + offset)
35
36#define GIC_ABS_REG(segment, offset) \
37 (_gic_base + segment##_##SECTION_OFS + offset##_##OFS)
38#define GIC_REG_ABS_ADDR(segment, offset) \
39 (_gic_base + segment##_##SECTION_OFS + offset)
40
41#ifdef GICISBYTELITTLEENDIAN
42#define GICREAD(reg, data) (data) = (reg), (data) = le32_to_cpu(data)
43#define GICWRITE(reg, data) (reg) = cpu_to_le32(data)
44#define GICBIS(reg, bits) \
45 ({unsigned int data; \
46 GICREAD(reg, data); \
47 data |= bits; \
48 GICWRITE(reg, data); \
49 })
50
51#else
52#define GICREAD(reg, data) (data) = (reg)
53#define GICWRITE(reg, data) (reg) = (data)
54#define GICBIS(reg, bits) (reg) |= (bits)
55#endif
56
57
58/* GIC Address Space */
59#define SHARED_SECTION_OFS 0x0000
60#define SHARED_SECTION_SIZE 0x8000
61#define VPE_LOCAL_SECTION_OFS 0x8000
62#define VPE_LOCAL_SECTION_SIZE 0x4000
63#define VPE_OTHER_SECTION_OFS 0xc000
64#define VPE_OTHER_SECTION_SIZE 0x4000
65#define USM_VISIBLE_SECTION_OFS 0x10000
66#define USM_VISIBLE_SECTION_SIZE 0x10000
67
68/* Register Map for Shared Section */
69#if defined(CONFIG_CPU_LITTLE_ENDIAN) || defined(GICISWORDLITTLEENDIAN)
70
71#define GIC_SH_CONFIG_OFS 0x0000
72
73/* Shared Global Counter */
74#define GIC_SH_COUNTER_31_00_OFS 0x0010
75#define GIC_SH_COUNTER_63_32_OFS 0x0014
76
77/* Interrupt Polarity */
78#define GIC_SH_POL_31_0_OFS 0x0100
79#define GIC_SH_POL_63_32_OFS 0x0104
80#define GIC_SH_POL_95_64_OFS 0x0108
81#define GIC_SH_POL_127_96_OFS 0x010c
82#define GIC_SH_POL_159_128_OFS 0x0110
83#define GIC_SH_POL_191_160_OFS 0x0114
84#define GIC_SH_POL_223_192_OFS 0x0118
85#define GIC_SH_POL_255_224_OFS 0x011c
86
87/* Edge/Level Triggering */
88#define GIC_SH_TRIG_31_0_OFS 0x0180
89#define GIC_SH_TRIG_63_32_OFS 0x0184
90#define GIC_SH_TRIG_95_64_OFS 0x0188
91#define GIC_SH_TRIG_127_96_OFS 0x018c
92#define GIC_SH_TRIG_159_128_OFS 0x0190
93#define GIC_SH_TRIG_191_160_OFS 0x0194
94#define GIC_SH_TRIG_223_192_OFS 0x0198
95#define GIC_SH_TRIG_255_224_OFS 0x019c
96
97/* Dual Edge Triggering */
98#define GIC_SH_DUAL_31_0_OFS 0x0200
99#define GIC_SH_DUAL_63_32_OFS 0x0204
100#define GIC_SH_DUAL_95_64_OFS 0x0208
101#define GIC_SH_DUAL_127_96_OFS 0x020c
102#define GIC_SH_DUAL_159_128_OFS 0x0210
103#define GIC_SH_DUAL_191_160_OFS 0x0214
104#define GIC_SH_DUAL_223_192_OFS 0x0218
105#define GIC_SH_DUAL_255_224_OFS 0x021c
106
107/* Set/Clear corresponding bit in Edge Detect Register */
108#define GIC_SH_WEDGE_OFS 0x0280
109
110/* Reset Mask - Disables Interrupt */
111#define GIC_SH_RMASK_31_0_OFS 0x0300
112#define GIC_SH_RMASK_63_32_OFS 0x0304
113#define GIC_SH_RMASK_95_64_OFS 0x0308
114#define GIC_SH_RMASK_127_96_OFS 0x030c
115#define GIC_SH_RMASK_159_128_OFS 0x0310
116#define GIC_SH_RMASK_191_160_OFS 0x0314
117#define GIC_SH_RMASK_223_192_OFS 0x0318
118#define GIC_SH_RMASK_255_224_OFS 0x031c
119
120/* Set Mask (WO) - Enables Interrupt */
121#define GIC_SH_SMASK_31_0_OFS 0x0380
122#define GIC_SH_SMASK_63_32_OFS 0x0384
123#define GIC_SH_SMASK_95_64_OFS 0x0388
124#define GIC_SH_SMASK_127_96_OFS 0x038c
125#define GIC_SH_SMASK_159_128_OFS 0x0390
126#define GIC_SH_SMASK_191_160_OFS 0x0394
127#define GIC_SH_SMASK_223_192_OFS 0x0398
128#define GIC_SH_SMASK_255_224_OFS 0x039c
129
130/* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */
131#define GIC_SH_MASK_31_0_OFS 0x0400
132#define GIC_SH_MASK_63_32_OFS 0x0404
133#define GIC_SH_MASK_95_64_OFS 0x0408
134#define GIC_SH_MASK_127_96_OFS 0x040c
135#define GIC_SH_MASK_159_128_OFS 0x0410
136#define GIC_SH_MASK_191_160_OFS 0x0414
137#define GIC_SH_MASK_223_192_OFS 0x0418
138#define GIC_SH_MASK_255_224_OFS 0x041c
139
140/* Pending Global Interrupts (RO) */
141#define GIC_SH_PEND_31_0_OFS 0x0480
142#define GIC_SH_PEND_63_32_OFS 0x0484
143#define GIC_SH_PEND_95_64_OFS 0x0488
144#define GIC_SH_PEND_127_96_OFS 0x048c
145#define GIC_SH_PEND_159_128_OFS 0x0490
146#define GIC_SH_PEND_191_160_OFS 0x0494
147#define GIC_SH_PEND_223_192_OFS 0x0498
148#define GIC_SH_PEND_255_224_OFS 0x049c
149
150#define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500
151
152/* Maps Interrupt X to a Pin */
153#define GIC_SH_MAP_TO_PIN(intr) \
154 (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr))
155
156#define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2000
157
158/* Maps Interrupt X to a VPE */
159#define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \
160 (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + (((vpe) / 32) * 4))
161#define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32))
162
163/* Polarity : Reset Value is always 0 */
164#define GIC_SH_SET_POLARITY_OFS 0x0100
165#define GIC_SET_POLARITY(intr, pol) \
166 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + (((intr) / 32) * 4)), (pol) << ((intr) % 32))
167
168/* Triggering : Reset Value is always 0 */
169#define GIC_SH_SET_TRIGGER_OFS 0x0180
170#define GIC_SET_TRIGGER(intr, trig) \
171 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + (((intr) / 32) * 4)), (trig) << ((intr) % 32))
172
173/* Mask manipulation */
174#define GIC_SH_SMASK_OFS 0x0380
175#define GIC_SET_INTR_MASK(intr, val) \
176 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32)))
177
178#define GIC_SH_RMASK_OFS 0x0300
179#define GIC_CLR_INTR_MASK(intr, val) \
180 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32)))
181
182/* Register Map for Local Section */
183#define GIC_VPE_CTL_OFS 0x0000
184#define GIC_VPE_PEND_OFS 0x0004
185#define GIC_VPE_MASK_OFS 0x0008
186#define GIC_VPE_RMASK_OFS 0x000c
187#define GIC_VPE_SMASK_OFS 0x0010
188#define GIC_VPE_WD_MAP_OFS 0x0040
189#define GIC_VPE_COMPARE_MAP_OFS 0x0044
190#define GIC_VPE_TIMER_MAP_OFS 0x0048
191#define GIC_VPE_PERFCTR_MAP_OFS 0x0050
192#define GIC_VPE_SWINT0_MAP_OFS 0x0054
193#define GIC_VPE_SWINT1_MAP_OFS 0x0058
194#define GIC_VPE_OTHER_ADDR_OFS 0x0080
195#define GIC_VPE_WD_CONFIG0_OFS 0x0090
196#define GIC_VPE_WD_COUNT0_OFS 0x0094
197#define GIC_VPE_WD_INITIAL0_OFS 0x0098
198#define GIC_VPE_COMPARE_LO_OFS 0x00a0
199#define GIC_VPE_COMPARE_HI 0x00a4
200
201#define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100
202#define GIC_VPE_EIC_SS(intr) \
203 (GIC_EIC_SHADOW_SET_BASE + (4 * intr))
204
205#define GIC_VPE_EIC_VEC_BASE 0x0800
206#define GIC_VPE_EIC_VEC(intr) \
207 (GIC_VPE_EIC_VEC_BASE + (4 * intr))
208
209#define GIC_VPE_TENABLE_NMI_OFS 0x1000
210#define GIC_VPE_TENABLE_YQ_OFS 0x1004
211#define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080
212#define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084
213
214/* User Mode Visible Section Register Map */
215#define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000
216#define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004
217
218#else /* CONFIG_CPU_BIG_ENDIAN */
219
220#define GIC_SH_CONFIG_OFS 0x0000
221
222/* Shared Global Counter */
223#define GIC_SH_COUNTER_31_00_OFS 0x0014
224#define GIC_SH_COUNTER_63_32_OFS 0x0010
225
226/* Interrupt Polarity */
227#define GIC_SH_POL_31_0_OFS 0x0104
228#define GIC_SH_POL_63_32_OFS 0x0100
229#define GIC_SH_POL_95_64_OFS 0x010c
230#define GIC_SH_POL_127_96_OFS 0x0108
231#define GIC_SH_POL_159_128_OFS 0x0114
232#define GIC_SH_POL_191_160_OFS 0x0110
233#define GIC_SH_POL_223_192_OFS 0x011c
234#define GIC_SH_POL_255_224_OFS 0x0118
235
236/* Edge/Level Triggering */
237#define GIC_SH_TRIG_31_0_OFS 0x0184
238#define GIC_SH_TRIG_63_32_OFS 0x0180
239#define GIC_SH_TRIG_95_64_OFS 0x018c
240#define GIC_SH_TRIG_127_96_OFS 0x0188
241#define GIC_SH_TRIG_159_128_OFS 0x0194
242#define GIC_SH_TRIG_191_160_OFS 0x0190
243#define GIC_SH_TRIG_223_192_OFS 0x019c
244#define GIC_SH_TRIG_255_224_OFS 0x0198
245
246/* Dual Edge Triggering */
247#define GIC_SH_DUAL_31_0_OFS 0x0204
248#define GIC_SH_DUAL_63_32_OFS 0x0200
249#define GIC_SH_DUAL_95_64_OFS 0x020c
250#define GIC_SH_DUAL_127_96_OFS 0x0208
251#define GIC_SH_DUAL_159_128_OFS 0x0214
252#define GIC_SH_DUAL_191_160_OFS 0x0210
253#define GIC_SH_DUAL_223_192_OFS 0x021c
254#define GIC_SH_DUAL_255_224_OFS 0x0218
255
256/* Set/Clear corresponding bit in Edge Detect Register */
257#define GIC_SH_WEDGE_OFS 0x0280
258
259/* Reset Mask - Disables Interrupt */
260#define GIC_SH_RMASK_31_0_OFS 0x0304
261#define GIC_SH_RMASK_63_32_OFS 0x0300
262#define GIC_SH_RMASK_95_64_OFS 0x030c
263#define GIC_SH_RMASK_127_96_OFS 0x0308
264#define GIC_SH_RMASK_159_128_OFS 0x0314
265#define GIC_SH_RMASK_191_160_OFS 0x0310
266#define GIC_SH_RMASK_223_192_OFS 0x031c
267#define GIC_SH_RMASK_255_224_OFS 0x0318
268
269/* Set Mask (WO) - Enables Interrupt */
270#define GIC_SH_SMASK_31_0_OFS 0x0384
271#define GIC_SH_SMASK_63_32_OFS 0x0380
272#define GIC_SH_SMASK_95_64_OFS 0x038c
273#define GIC_SH_SMASK_127_96_OFS 0x0388
274#define GIC_SH_SMASK_159_128_OFS 0x0394
275#define GIC_SH_SMASK_191_160_OFS 0x0390
276#define GIC_SH_SMASK_223_192_OFS 0x039c
277#define GIC_SH_SMASK_255_224_OFS 0x0398
278
279/* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */
280#define GIC_SH_MASK_31_0_OFS 0x0404
281#define GIC_SH_MASK_63_32_OFS 0x0400
282#define GIC_SH_MASK_95_64_OFS 0x040c
283#define GIC_SH_MASK_127_96_OFS 0x0408
284#define GIC_SH_MASK_159_128_OFS 0x0414
285#define GIC_SH_MASK_191_160_OFS 0x0410
286#define GIC_SH_MASK_223_192_OFS 0x041c
287#define GIC_SH_MASK_255_224_OFS 0x0418
288
289/* Pending Global Interrupts (RO) */
290#define GIC_SH_PEND_31_0_OFS 0x0484
291#define GIC_SH_PEND_63_32_OFS 0x0480
292#define GIC_SH_PEND_95_64_OFS 0x048c
293#define GIC_SH_PEND_127_96_OFS 0x0488
294#define GIC_SH_PEND_159_128_OFS 0x0494
295#define GIC_SH_PEND_191_160_OFS 0x0490
296#define GIC_SH_PEND_223_192_OFS 0x049c
297#define GIC_SH_PEND_255_224_OFS 0x0498
298
299#define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500
300
301/* Maps Interrupt X to a Pin */
302#define GIC_SH_MAP_TO_PIN(intr) \
303 (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr))
304
305#define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2004
306
307/*
308 * Maps Interrupt X to a VPE. This is more complex than the LE case, as
309 * odd and even registers need to be transposed. It does work - trust me!
310 */
311#define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \
312 (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + \
313 (((((vpe) / 32) ^ 1) - 1) * 4))
314#define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32))
315
316/* Polarity */
317#define GIC_SH_SET_POLARITY_OFS 0x0100
318#define GIC_SET_POLARITY(intr, pol) \
319 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (pol) << ((intr) % 32))
320
321/* Triggering */
322#define GIC_SH_SET_TRIGGER_OFS 0x0180
323#define GIC_SET_TRIGGER(intr, trig) \
324 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (trig) << ((intr) % 32))
325
326/* Mask manipulation */
327#define GIC_SH_SMASK_OFS 0x0380
328#define GIC_SET_INTR_MASK(intr, val) \
329 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32)))
330
331#define GIC_SH_RMASK_OFS 0x0300
332#define GIC_CLR_INTR_MASK(intr, val) \
333 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32)))
334
335/* Register Map for Local Section */
336#define GIC_VPE_CTL_OFS 0x0000
337#define GIC_VPE_PEND_OFS 0x0004
338#define GIC_VPE_MASK_OFS 0x0008
339#define GIC_VPE_RMASK_OFS 0x000c
340#define GIC_VPE_SMASK_OFS 0x0010
341#define GIC_VPE_WD_MAP_OFS 0x0040
342#define GIC_VPE_COMPARE_MAP_OFS 0x0044
343#define GIC_VPE_TIMER_MAP_OFS 0x0048
344#define GIC_VPE_PERFCTR_MAP_OFS 0x0050
345#define GIC_VPE_SWINT0_MAP_OFS 0x0054
346#define GIC_VPE_SWINT1_MAP_OFS 0x0058
347#define GIC_VPE_OTHER_ADDR_OFS 0x0080
348#define GIC_VPE_WD_CONFIG0_OFS 0x0090
349#define GIC_VPE_WD_COUNT0_OFS 0x0094
350#define GIC_VPE_WD_INITIAL0_OFS 0x0098
351#define GIC_VPE_COMPARE_LO_OFS 0x00a4
352#define GIC_VPE_COMPARE_HI_OFS 0x00a0
353
354#define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100
355#define GIC_VPE_EIC_SS(intr) \
356 (GIC_EIC_SHADOW_SET_BASE + (4 * intr))
357
358#define GIC_VPE_EIC_VEC_BASE 0x0800
359#define GIC_VPE_EIC_VEC(intr) \
360 (GIC_VPE_EIC_VEC_BASE + (4 * intr))
361
362#define GIC_VPE_TENABLE_NMI_OFS 0x1000
363#define GIC_VPE_TENABLE_YQ_OFS 0x1004
364#define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080
365#define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084
366
367/* User Mode Visible Section Register Map */
368#define GIC_UMV_SH_COUNTER_31_00_OFS 0x0004
369#define GIC_UMV_SH_COUNTER_63_32_OFS 0x0000
370
371#endif /* !LE */
372
373/* Masks */
374#define GIC_SH_CONFIG_COUNTSTOP_SHF 28
375#define GIC_SH_CONFIG_COUNTSTOP_MSK (MSK(1) << GIC_SH_CONFIG_COUNTSTOP_SHF)
376
377#define GIC_SH_CONFIG_COUNTBITS_SHF 24
378#define GIC_SH_CONFIG_COUNTBITS_MSK (MSK(4) << GIC_SH_CONFIG_COUNTBITS_SHF)
379
380#define GIC_SH_CONFIG_NUMINTRS_SHF 16
381#define GIC_SH_CONFIG_NUMINTRS_MSK (MSK(8) << GIC_SH_CONFIG_NUMINTRS_SHF)
382
383#define GIC_SH_CONFIG_NUMVPES_SHF 0
384#define GIC_SH_CONFIG_NUMVPES_MSK (MSK(8) << GIC_SH_CONFIG_NUMVPES_SHF)
385
386#define GIC_SH_WEDGE_SET(intr) (intr | (0x1 << 31))
387#define GIC_SH_WEDGE_CLR(intr) (intr & ~(0x1 << 31))
388
389#define GIC_MAP_TO_PIN_SHF 31
390#define GIC_MAP_TO_PIN_MSK (MSK(1) << GIC_MAP_TO_PIN_SHF)
391#define GIC_MAP_TO_NMI_SHF 30
392#define GIC_MAP_TO_NMI_MSK (MSK(1) << GIC_MAP_TO_NMI_SHF)
393#define GIC_MAP_TO_YQ_SHF 29
394#define GIC_MAP_TO_YQ_MSK (MSK(1) << GIC_MAP_TO_YQ_SHF)
395#define GIC_MAP_SHF 0
396#define GIC_MAP_MSK (MSK(6) << GIC_MAP_SHF)
397
398/* GIC_VPE_CTL Masks */
399#define GIC_VPE_CTL_PERFCNT_RTBL_SHF 2
400#define GIC_VPE_CTL_PERFCNT_RTBL_MSK (MSK(1) << GIC_VPE_CTL_PERFCNT_RTBL_SHF)
401#define GIC_VPE_CTL_TIMER_RTBL_SHF 1
402#define GIC_VPE_CTL_TIMER_RTBL_MSK (MSK(1) << GIC_VPE_CTL_TIMER_RTBL_SHF)
403#define GIC_VPE_CTL_EIC_MODE_SHF 0
404#define GIC_VPE_CTL_EIC_MODE_MSK (MSK(1) << GIC_VPE_CTL_EIC_MODE_SHF)
405
406/* GIC_VPE_PEND Masks */
407#define GIC_VPE_PEND_WD_SHF 0
408#define GIC_VPE_PEND_WD_MSK (MSK(1) << GIC_VPE_PEND_WD_SHF)
409#define GIC_VPE_PEND_CMP_SHF 1
410#define GIC_VPE_PEND_CMP_MSK (MSK(1) << GIC_VPE_PEND_CMP_SHF)
411#define GIC_VPE_PEND_TIMER_SHF 2
412#define GIC_VPE_PEND_TIMER_MSK (MSK(1) << GIC_VPE_PEND_TIMER_SHF)
413#define GIC_VPE_PEND_PERFCOUNT_SHF 3
414#define GIC_VPE_PEND_PERFCOUNT_MSK (MSK(1) << GIC_VPE_PEND_PERFCOUNT_SHF)
415#define GIC_VPE_PEND_SWINT0_SHF 4
416#define GIC_VPE_PEND_SWINT0_MSK (MSK(1) << GIC_VPE_PEND_SWINT0_SHF)
417#define GIC_VPE_PEND_SWINT1_SHF 5
418#define GIC_VPE_PEND_SWINT1_MSK (MSK(1) << GIC_VPE_PEND_SWINT1_SHF)
419
420/* GIC_VPE_RMASK Masks */
421#define GIC_VPE_RMASK_WD_SHF 0
422#define GIC_VPE_RMASK_WD_MSK (MSK(1) << GIC_VPE_RMASK_WD_SHF)
423#define GIC_VPE_RMASK_CMP_SHF 1
424#define GIC_VPE_RMASK_CMP_MSK (MSK(1) << GIC_VPE_RMASK_CMP_SHF)
425#define GIC_VPE_RMASK_TIMER_SHF 2
426#define GIC_VPE_RMASK_TIMER_MSK (MSK(1) << GIC_VPE_RMASK_TIMER_SHF)
427#define GIC_VPE_RMASK_PERFCNT_SHF 3
428#define GIC_VPE_RMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_RMASK_PERFCNT_SHF)
429#define GIC_VPE_RMASK_SWINT0_SHF 4
430#define GIC_VPE_RMASK_SWINT0_MSK (MSK(1) << GIC_VPE_RMASK_SWINT0_SHF)
431#define GIC_VPE_RMASK_SWINT1_SHF 5
432#define GIC_VPE_RMASK_SWINT1_MSK (MSK(1) << GIC_VPE_RMASK_SWINT1_SHF)
433
434/* GIC_VPE_SMASK Masks */
435#define GIC_VPE_SMASK_WD_SHF 0
436#define GIC_VPE_SMASK_WD_MSK (MSK(1) << GIC_VPE_SMASK_WD_SHF)
437#define GIC_VPE_SMASK_CMP_SHF 1
438#define GIC_VPE_SMASK_CMP_MSK (MSK(1) << GIC_VPE_SMASK_CMP_SHF)
439#define GIC_VPE_SMASK_TIMER_SHF 2
440#define GIC_VPE_SMASK_TIMER_MSK (MSK(1) << GIC_VPE_SMASK_TIMER_SHF)
441#define GIC_VPE_SMASK_PERFCNT_SHF 3
442#define GIC_VPE_SMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_SMASK_PERFCNT_SHF)
443#define GIC_VPE_SMASK_SWINT0_SHF 4
444#define GIC_VPE_SMASK_SWINT0_MSK (MSK(1) << GIC_VPE_SMASK_SWINT0_SHF)
445#define GIC_VPE_SMASK_SWINT1_SHF 5
446#define GIC_VPE_SMASK_SWINT1_MSK (MSK(1) << GIC_VPE_SMASK_SWINT1_SHF)
447
448/*
449 * Set the Mapping of Interrupt X to a VPE.
450 */
451#define GIC_SH_MAP_TO_VPE_SMASK(intr, vpe) \
452 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe)), \
453 GIC_SH_MAP_TO_VPE_REG_BIT(vpe))
454
455struct gic_pcpu_mask {
456 DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS);
457};
458
459struct gic_pending_regs {
460 DECLARE_BITMAP(pending, GIC_NUM_INTRS);
461};
462
463struct gic_intrmask_regs {
464 DECLARE_BITMAP(intrmask, GIC_NUM_INTRS);
465};
466
467/*
468 * Interrupt Meta-data specification. The ipiflag helps
469 * in building ipi_map.
470 */
471struct gic_intr_map {
472 unsigned int intrnum; /* Ext Intr Num */
473 unsigned int cpunum; /* Directed to this CPU */
474 unsigned int pin; /* Directed to this Pin */
475 unsigned int polarity; /* Polarity : +/- */
476 unsigned int trigtype; /* Trigger : Edge/Levl */
477 unsigned int ipiflag; /* Is used for IPI ? */
478};
479
480extern void gic_init(unsigned long gic_base_addr,
481 unsigned long gic_addrspace_size, struct gic_intr_map *intrmap,
482 unsigned int intrmap_size, unsigned int irqbase);
483
484extern unsigned int gic_get_int(void);
485extern void gic_send_ipi(unsigned int intr);
486
487#endif /* _ASM_GICREGS_H */
diff --git a/include/asm-mips/gpio.h b/include/asm-mips/gpio.h
deleted file mode 100644
index 06e46faf862d..000000000000
--- a/include/asm-mips/gpio.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_MIPS_GPIO_H
2#define __ASM_MIPS_GPIO_H
3
4#include <gpio.h>
5
6#endif /* __ASM_MIPS_GPIO_H */
diff --git a/include/asm-mips/gt64120.h b/include/asm-mips/gt64120.h
deleted file mode 100644
index e64b41093c49..000000000000
--- a/include/asm-mips/gt64120.h
+++ /dev/null
@@ -1,580 +0,0 @@
1/*
2 * Copyright (C) 2000, 2004, 2005 MIPS Technologies, Inc.
3 * All rights reserved.
4 * Authors: Carsten Langgaard <carstenl@mips.com>
5 * Maciej W. Rozycki <macro@mips.com>
6 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21#ifndef _ASM_GT64120_H
22#define _ASM_GT64120_H
23
24#include <linux/clocksource.h>
25
26#include <asm/addrspace.h>
27#include <asm/byteorder.h>
28
29#define MSK(n) ((1 << (n)) - 1)
30
31/*
32 * Register offset addresses
33 */
34/* CPU Configuration. */
35#define GT_CPU_OFS 0x000
36
37#define GT_MULTI_OFS 0x120
38
39/* CPU Address Decode. */
40#define GT_SCS10LD_OFS 0x008
41#define GT_SCS10HD_OFS 0x010
42#define GT_SCS32LD_OFS 0x018
43#define GT_SCS32HD_OFS 0x020
44#define GT_CS20LD_OFS 0x028
45#define GT_CS20HD_OFS 0x030
46#define GT_CS3BOOTLD_OFS 0x038
47#define GT_CS3BOOTHD_OFS 0x040
48#define GT_PCI0IOLD_OFS 0x048
49#define GT_PCI0IOHD_OFS 0x050
50#define GT_PCI0M0LD_OFS 0x058
51#define GT_PCI0M0HD_OFS 0x060
52#define GT_ISD_OFS 0x068
53
54#define GT_PCI0M1LD_OFS 0x080
55#define GT_PCI0M1HD_OFS 0x088
56#define GT_PCI1IOLD_OFS 0x090
57#define GT_PCI1IOHD_OFS 0x098
58#define GT_PCI1M0LD_OFS 0x0a0
59#define GT_PCI1M0HD_OFS 0x0a8
60#define GT_PCI1M1LD_OFS 0x0b0
61#define GT_PCI1M1HD_OFS 0x0b8
62#define GT_PCI1M1LD_OFS 0x0b0
63#define GT_PCI1M1HD_OFS 0x0b8
64
65#define GT_SCS10AR_OFS 0x0d0
66#define GT_SCS32AR_OFS 0x0d8
67#define GT_CS20R_OFS 0x0e0
68#define GT_CS3BOOTR_OFS 0x0e8
69
70#define GT_PCI0IOREMAP_OFS 0x0f0
71#define GT_PCI0M0REMAP_OFS 0x0f8
72#define GT_PCI0M1REMAP_OFS 0x100
73#define GT_PCI1IOREMAP_OFS 0x108
74#define GT_PCI1M0REMAP_OFS 0x110
75#define GT_PCI1M1REMAP_OFS 0x118
76
77/* CPU Error Report. */
78#define GT_CPUERR_ADDRLO_OFS 0x070
79#define GT_CPUERR_ADDRHI_OFS 0x078
80
81#define GT_CPUERR_DATALO_OFS 0x128 /* GT-64120A only */
82#define GT_CPUERR_DATAHI_OFS 0x130 /* GT-64120A only */
83#define GT_CPUERR_PARITY_OFS 0x138 /* GT-64120A only */
84
85/* CPU Sync Barrier. */
86#define GT_PCI0SYNC_OFS 0x0c0
87#define GT_PCI1SYNC_OFS 0x0c8
88
89/* SDRAM and Device Address Decode. */
90#define GT_SCS0LD_OFS 0x400
91#define GT_SCS0HD_OFS 0x404
92#define GT_SCS1LD_OFS 0x408
93#define GT_SCS1HD_OFS 0x40c
94#define GT_SCS2LD_OFS 0x410
95#define GT_SCS2HD_OFS 0x414
96#define GT_SCS3LD_OFS 0x418
97#define GT_SCS3HD_OFS 0x41c
98#define GT_CS0LD_OFS 0x420
99#define GT_CS0HD_OFS 0x424
100#define GT_CS1LD_OFS 0x428
101#define GT_CS1HD_OFS 0x42c
102#define GT_CS2LD_OFS 0x430
103#define GT_CS2HD_OFS 0x434
104#define GT_CS3LD_OFS 0x438
105#define GT_CS3HD_OFS 0x43c
106#define GT_BOOTLD_OFS 0x440
107#define GT_BOOTHD_OFS 0x444
108
109#define GT_ADERR_OFS 0x470
110
111/* SDRAM Configuration. */
112#define GT_SDRAM_CFG_OFS 0x448
113
114#define GT_SDRAM_OPMODE_OFS 0x474
115#define GT_SDRAM_BM_OFS 0x478
116#define GT_SDRAM_ADDRDECODE_OFS 0x47c
117
118/* SDRAM Parameters. */
119#define GT_SDRAM_B0_OFS 0x44c
120#define GT_SDRAM_B1_OFS 0x450
121#define GT_SDRAM_B2_OFS 0x454
122#define GT_SDRAM_B3_OFS 0x458
123
124/* Device Parameters. */
125#define GT_DEV_B0_OFS 0x45c
126#define GT_DEV_B1_OFS 0x460
127#define GT_DEV_B2_OFS 0x464
128#define GT_DEV_B3_OFS 0x468
129#define GT_DEV_BOOT_OFS 0x46c
130
131/* ECC. */
132#define GT_ECC_ERRDATALO 0x480 /* GT-64120A only */
133#define GT_ECC_ERRDATAHI 0x484 /* GT-64120A only */
134#define GT_ECC_MEM 0x488 /* GT-64120A only */
135#define GT_ECC_CALC 0x48c /* GT-64120A only */
136#define GT_ECC_ERRADDR 0x490 /* GT-64120A only */
137
138/* DMA Record. */
139#define GT_DMA0_CNT_OFS 0x800
140#define GT_DMA1_CNT_OFS 0x804
141#define GT_DMA2_CNT_OFS 0x808
142#define GT_DMA3_CNT_OFS 0x80c
143#define GT_DMA0_SA_OFS 0x810
144#define GT_DMA1_SA_OFS 0x814
145#define GT_DMA2_SA_OFS 0x818
146#define GT_DMA3_SA_OFS 0x81c
147#define GT_DMA0_DA_OFS 0x820
148#define GT_DMA1_DA_OFS 0x824
149#define GT_DMA2_DA_OFS 0x828
150#define GT_DMA3_DA_OFS 0x82c
151#define GT_DMA0_NEXT_OFS 0x830
152#define GT_DMA1_NEXT_OFS 0x834
153#define GT_DMA2_NEXT_OFS 0x838
154#define GT_DMA3_NEXT_OFS 0x83c
155
156#define GT_DMA0_CUR_OFS 0x870
157#define GT_DMA1_CUR_OFS 0x874
158#define GT_DMA2_CUR_OFS 0x878
159#define GT_DMA3_CUR_OFS 0x87c
160
161/* DMA Channel Control. */
162#define GT_DMA0_CTRL_OFS 0x840
163#define GT_DMA1_CTRL_OFS 0x844
164#define GT_DMA2_CTRL_OFS 0x848
165#define GT_DMA3_CTRL_OFS 0x84c
166
167/* DMA Arbiter. */
168#define GT_DMA_ARB_OFS 0x860
169
170/* Timer/Counter. */
171#define GT_TC0_OFS 0x850
172#define GT_TC1_OFS 0x854
173#define GT_TC2_OFS 0x858
174#define GT_TC3_OFS 0x85c
175
176#define GT_TC_CONTROL_OFS 0x864
177
178/* PCI Internal. */
179#define GT_PCI0_CMD_OFS 0xc00
180#define GT_PCI0_TOR_OFS 0xc04
181#define GT_PCI0_BS_SCS10_OFS 0xc08
182#define GT_PCI0_BS_SCS32_OFS 0xc0c
183#define GT_PCI0_BS_CS20_OFS 0xc10
184#define GT_PCI0_BS_CS3BT_OFS 0xc14
185
186#define GT_PCI1_IACK_OFS 0xc30
187#define GT_PCI0_IACK_OFS 0xc34
188
189#define GT_PCI0_BARE_OFS 0xc3c
190#define GT_PCI0_PREFMBR_OFS 0xc40
191
192#define GT_PCI0_SCS10_BAR_OFS 0xc48
193#define GT_PCI0_SCS32_BAR_OFS 0xc4c
194#define GT_PCI0_CS20_BAR_OFS 0xc50
195#define GT_PCI0_CS3BT_BAR_OFS 0xc54
196#define GT_PCI0_SSCS10_BAR_OFS 0xc58
197#define GT_PCI0_SSCS32_BAR_OFS 0xc5c
198
199#define GT_PCI0_SCS3BT_BAR_OFS 0xc64
200
201#define GT_PCI1_CMD_OFS 0xc80
202#define GT_PCI1_TOR_OFS 0xc84
203#define GT_PCI1_BS_SCS10_OFS 0xc88
204#define GT_PCI1_BS_SCS32_OFS 0xc8c
205#define GT_PCI1_BS_CS20_OFS 0xc90
206#define GT_PCI1_BS_CS3BT_OFS 0xc94
207
208#define GT_PCI1_BARE_OFS 0xcbc
209#define GT_PCI1_PREFMBR_OFS 0xcc0
210
211#define GT_PCI1_SCS10_BAR_OFS 0xcc8
212#define GT_PCI1_SCS32_BAR_OFS 0xccc
213#define GT_PCI1_CS20_BAR_OFS 0xcd0
214#define GT_PCI1_CS3BT_BAR_OFS 0xcd4
215#define GT_PCI1_SSCS10_BAR_OFS 0xcd8
216#define GT_PCI1_SSCS32_BAR_OFS 0xcdc
217
218#define GT_PCI1_SCS3BT_BAR_OFS 0xce4
219
220#define GT_PCI1_CFGADDR_OFS 0xcf0
221#define GT_PCI1_CFGDATA_OFS 0xcf4
222#define GT_PCI0_CFGADDR_OFS 0xcf8
223#define GT_PCI0_CFGDATA_OFS 0xcfc
224
225/* Interrupts. */
226#define GT_INTRCAUSE_OFS 0xc18
227#define GT_INTRMASK_OFS 0xc1c
228
229#define GT_PCI0_ICMASK_OFS 0xc24
230#define GT_PCI0_SERR0MASK_OFS 0xc28
231
232#define GT_CPU_INTSEL_OFS 0xc70
233#define GT_PCI0_INTSEL_OFS 0xc74
234
235#define GT_HINTRCAUSE_OFS 0xc98
236#define GT_HINTRMASK_OFS 0xc9c
237
238#define GT_PCI0_HICMASK_OFS 0xca4
239#define GT_PCI1_SERR1MASK_OFS 0xca8
240
241
242/*
243 * I2O Support Registers
244 */
245#define INBOUND_MESSAGE_REGISTER0_PCI_SIDE 0x010
246#define INBOUND_MESSAGE_REGISTER1_PCI_SIDE 0x014
247#define OUTBOUND_MESSAGE_REGISTER0_PCI_SIDE 0x018
248#define OUTBOUND_MESSAGE_REGISTER1_PCI_SIDE 0x01c
249#define INBOUND_DOORBELL_REGISTER_PCI_SIDE 0x020
250#define INBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE 0x024
251#define INBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE 0x028
252#define OUTBOUND_DOORBELL_REGISTER_PCI_SIDE 0x02c
253#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_PCI_SIDE 0x030
254#define OUTBOUND_INTERRUPT_MASK_REGISTER_PCI_SIDE 0x034
255#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE 0x040
256#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI_SIDE 0x044
257#define QUEUE_CONTROL_REGISTER_PCI_SIDE 0x050
258#define QUEUE_BASE_ADDRESS_REGISTER_PCI_SIDE 0x054
259#define INBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE 0x060
260#define INBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE 0x064
261#define INBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE 0x068
262#define INBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE 0x06c
263#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_PCI_SIDE 0x070
264#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_PCI_SIDE 0x074
265#define OUTBOUND_POST_HEAD_POINTER_REGISTER_PCI_SIDE 0x078
266#define OUTBOUND_POST_TAIL_POINTER_REGISTER_PCI_SIDE 0x07c
267
268#define INBOUND_MESSAGE_REGISTER0_CPU_SIDE 0x1c10
269#define INBOUND_MESSAGE_REGISTER1_CPU_SIDE 0x1c14
270#define OUTBOUND_MESSAGE_REGISTER0_CPU_SIDE 0x1c18
271#define OUTBOUND_MESSAGE_REGISTER1_CPU_SIDE 0x1c1c
272#define INBOUND_DOORBELL_REGISTER_CPU_SIDE 0x1c20
273#define INBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE 0x1c24
274#define INBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE 0x1c28
275#define OUTBOUND_DOORBELL_REGISTER_CPU_SIDE 0x1c2c
276#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_CPU_SIDE 0x1c30
277#define OUTBOUND_INTERRUPT_MASK_REGISTER_CPU_SIDE 0x1c34
278#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE 0x1c40
279#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU_SIDE 0x1c44
280#define QUEUE_CONTROL_REGISTER_CPU_SIDE 0x1c50
281#define QUEUE_BASE_ADDRESS_REGISTER_CPU_SIDE 0x1c54
282#define INBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c60
283#define INBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c64
284#define INBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c68
285#define INBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c6c
286#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c70
287#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c74
288#define OUTBOUND_POST_HEAD_POINTER_REGISTER_CPU_SIDE 0x1c78
289#define OUTBOUND_POST_TAIL_POINTER_REGISTER_CPU_SIDE 0x1c7c
290
291/*
292 * Register encodings
293 */
294#define GT_CPU_ENDIAN_SHF 12
295#define GT_CPU_ENDIAN_MSK (MSK(1) << GT_CPU_ENDIAN_SHF)
296#define GT_CPU_ENDIAN_BIT GT_CPU_ENDIAN_MSK
297#define GT_CPU_WR_SHF 16
298#define GT_CPU_WR_MSK (MSK(1) << GT_CPU_WR_SHF)
299#define GT_CPU_WR_BIT GT_CPU_WR_MSK
300#define GT_CPU_WR_DXDXDXDX 0
301#define GT_CPU_WR_DDDD 1
302
303
304#define GT_PCI_DCRM_SHF 21
305#define GT_PCI_LD_SHF 0
306#define GT_PCI_LD_MSK (MSK(15) << GT_PCI_LD_SHF)
307#define GT_PCI_HD_SHF 0
308#define GT_PCI_HD_MSK (MSK(7) << GT_PCI_HD_SHF)
309#define GT_PCI_REMAP_SHF 0
310#define GT_PCI_REMAP_MSK (MSK(11) << GT_PCI_REMAP_SHF)
311
312
313#define GT_CFGADDR_CFGEN_SHF 31
314#define GT_CFGADDR_CFGEN_MSK (MSK(1) << GT_CFGADDR_CFGEN_SHF)
315#define GT_CFGADDR_CFGEN_BIT GT_CFGADDR_CFGEN_MSK
316
317#define GT_CFGADDR_BUSNUM_SHF 16
318#define GT_CFGADDR_BUSNUM_MSK (MSK(8) << GT_CFGADDR_BUSNUM_SHF)
319
320#define GT_CFGADDR_DEVNUM_SHF 11
321#define GT_CFGADDR_DEVNUM_MSK (MSK(5) << GT_CFGADDR_DEVNUM_SHF)
322
323#define GT_CFGADDR_FUNCNUM_SHF 8
324#define GT_CFGADDR_FUNCNUM_MSK (MSK(3) << GT_CFGADDR_FUNCNUM_SHF)
325
326#define GT_CFGADDR_REGNUM_SHF 2
327#define GT_CFGADDR_REGNUM_MSK (MSK(6) << GT_CFGADDR_REGNUM_SHF)
328
329
330#define GT_SDRAM_BM_ORDER_SHF 2
331#define GT_SDRAM_BM_ORDER_MSK (MSK(1) << GT_SDRAM_BM_ORDER_SHF)
332#define GT_SDRAM_BM_ORDER_BIT GT_SDRAM_BM_ORDER_MSK
333#define GT_SDRAM_BM_ORDER_SUB 1
334#define GT_SDRAM_BM_ORDER_LIN 0
335
336#define GT_SDRAM_BM_RSVD_ALL1 0xffb
337
338
339#define GT_SDRAM_ADDRDECODE_ADDR_SHF 0
340#define GT_SDRAM_ADDRDECODE_ADDR_MSK (MSK(3) << GT_SDRAM_ADDRDECODE_ADDR_SHF)
341#define GT_SDRAM_ADDRDECODE_ADDR_0 0
342#define GT_SDRAM_ADDRDECODE_ADDR_1 1
343#define GT_SDRAM_ADDRDECODE_ADDR_2 2
344#define GT_SDRAM_ADDRDECODE_ADDR_3 3
345#define GT_SDRAM_ADDRDECODE_ADDR_4 4
346#define GT_SDRAM_ADDRDECODE_ADDR_5 5
347#define GT_SDRAM_ADDRDECODE_ADDR_6 6
348#define GT_SDRAM_ADDRDECODE_ADDR_7 7
349
350
351#define GT_SDRAM_B0_CASLAT_SHF 0
352#define GT_SDRAM_B0_CASLAT_MSK (MSK(2) << GT_SDRAM_B0__SHF)
353#define GT_SDRAM_B0_CASLAT_2 1
354#define GT_SDRAM_B0_CASLAT_3 2
355
356#define GT_SDRAM_B0_FTDIS_SHF 2
357#define GT_SDRAM_B0_FTDIS_MSK (MSK(1) << GT_SDRAM_B0_FTDIS_SHF)
358#define GT_SDRAM_B0_FTDIS_BIT GT_SDRAM_B0_FTDIS_MSK
359
360#define GT_SDRAM_B0_SRASPRCHG_SHF 3
361#define GT_SDRAM_B0_SRASPRCHG_MSK (MSK(1) << GT_SDRAM_B0_SRASPRCHG_SHF)
362#define GT_SDRAM_B0_SRASPRCHG_BIT GT_SDRAM_B0_SRASPRCHG_MSK
363#define GT_SDRAM_B0_SRASPRCHG_2 0
364#define GT_SDRAM_B0_SRASPRCHG_3 1
365
366#define GT_SDRAM_B0_B0COMPAB_SHF 4
367#define GT_SDRAM_B0_B0COMPAB_MSK (MSK(1) << GT_SDRAM_B0_B0COMPAB_SHF)
368#define GT_SDRAM_B0_B0COMPAB_BIT GT_SDRAM_B0_B0COMPAB_MSK
369
370#define GT_SDRAM_B0_64BITINT_SHF 5
371#define GT_SDRAM_B0_64BITINT_MSK (MSK(1) << GT_SDRAM_B0_64BITINT_SHF)
372#define GT_SDRAM_B0_64BITINT_BIT GT_SDRAM_B0_64BITINT_MSK
373#define GT_SDRAM_B0_64BITINT_2 0
374#define GT_SDRAM_B0_64BITINT_4 1
375
376#define GT_SDRAM_B0_BW_SHF 6
377#define GT_SDRAM_B0_BW_MSK (MSK(1) << GT_SDRAM_B0_BW_SHF)
378#define GT_SDRAM_B0_BW_BIT GT_SDRAM_B0_BW_MSK
379#define GT_SDRAM_B0_BW_32 0
380#define GT_SDRAM_B0_BW_64 1
381
382#define GT_SDRAM_B0_BLODD_SHF 7
383#define GT_SDRAM_B0_BLODD_MSK (MSK(1) << GT_SDRAM_B0_BLODD_SHF)
384#define GT_SDRAM_B0_BLODD_BIT GT_SDRAM_B0_BLODD_MSK
385
386#define GT_SDRAM_B0_PAR_SHF 8
387#define GT_SDRAM_B0_PAR_MSK (MSK(1) << GT_SDRAM_B0_PAR_SHF)
388#define GT_SDRAM_B0_PAR_BIT GT_SDRAM_B0_PAR_MSK
389
390#define GT_SDRAM_B0_BYPASS_SHF 9
391#define GT_SDRAM_B0_BYPASS_MSK (MSK(1) << GT_SDRAM_B0_BYPASS_SHF)
392#define GT_SDRAM_B0_BYPASS_BIT GT_SDRAM_B0_BYPASS_MSK
393
394#define GT_SDRAM_B0_SRAS2SCAS_SHF 10
395#define GT_SDRAM_B0_SRAS2SCAS_MSK (MSK(1) << GT_SDRAM_B0_SRAS2SCAS_SHF)
396#define GT_SDRAM_B0_SRAS2SCAS_BIT GT_SDRAM_B0_SRAS2SCAS_MSK
397#define GT_SDRAM_B0_SRAS2SCAS_2 0
398#define GT_SDRAM_B0_SRAS2SCAS_3 1
399
400#define GT_SDRAM_B0_SIZE_SHF 11
401#define GT_SDRAM_B0_SIZE_MSK (MSK(1) << GT_SDRAM_B0_SIZE_SHF)
402#define GT_SDRAM_B0_SIZE_BIT GT_SDRAM_B0_SIZE_MSK
403#define GT_SDRAM_B0_SIZE_16M 0
404#define GT_SDRAM_B0_SIZE_64M 1
405
406#define GT_SDRAM_B0_EXTPAR_SHF 12
407#define GT_SDRAM_B0_EXTPAR_MSK (MSK(1) << GT_SDRAM_B0_EXTPAR_SHF)
408#define GT_SDRAM_B0_EXTPAR_BIT GT_SDRAM_B0_EXTPAR_MSK
409
410#define GT_SDRAM_B0_BLEN_SHF 13
411#define GT_SDRAM_B0_BLEN_MSK (MSK(1) << GT_SDRAM_B0_BLEN_SHF)
412#define GT_SDRAM_B0_BLEN_BIT GT_SDRAM_B0_BLEN_MSK
413#define GT_SDRAM_B0_BLEN_8 0
414#define GT_SDRAM_B0_BLEN_4 1
415
416
417#define GT_SDRAM_CFG_REFINT_SHF 0
418#define GT_SDRAM_CFG_REFINT_MSK (MSK(14) << GT_SDRAM_CFG_REFINT_SHF)
419
420#define GT_SDRAM_CFG_NINTERLEAVE_SHF 14
421#define GT_SDRAM_CFG_NINTERLEAVE_MSK (MSK(1) << GT_SDRAM_CFG_NINTERLEAVE_SHF)
422#define GT_SDRAM_CFG_NINTERLEAVE_BIT GT_SDRAM_CFG_NINTERLEAVE_MSK
423
424#define GT_SDRAM_CFG_RMW_SHF 15
425#define GT_SDRAM_CFG_RMW_MSK (MSK(1) << GT_SDRAM_CFG_RMW_SHF)
426#define GT_SDRAM_CFG_RMW_BIT GT_SDRAM_CFG_RMW_MSK
427
428#define GT_SDRAM_CFG_NONSTAGREF_SHF 16
429#define GT_SDRAM_CFG_NONSTAGREF_MSK (MSK(1) << GT_SDRAM_CFG_NONSTAGREF_SHF)
430#define GT_SDRAM_CFG_NONSTAGREF_BIT GT_SDRAM_CFG_NONSTAGREF_MSK
431
432#define GT_SDRAM_CFG_DUPCNTL_SHF 19
433#define GT_SDRAM_CFG_DUPCNTL_MSK (MSK(1) << GT_SDRAM_CFG_DUPCNTL_SHF)
434#define GT_SDRAM_CFG_DUPCNTL_BIT GT_SDRAM_CFG_DUPCNTL_MSK
435
436#define GT_SDRAM_CFG_DUPBA_SHF 20
437#define GT_SDRAM_CFG_DUPBA_MSK (MSK(1) << GT_SDRAM_CFG_DUPBA_SHF)
438#define GT_SDRAM_CFG_DUPBA_BIT GT_SDRAM_CFG_DUPBA_MSK
439
440#define GT_SDRAM_CFG_DUPEOT0_SHF 21
441#define GT_SDRAM_CFG_DUPEOT0_MSK (MSK(1) << GT_SDRAM_CFG_DUPEOT0_SHF)
442#define GT_SDRAM_CFG_DUPEOT0_BIT GT_SDRAM_CFG_DUPEOT0_MSK
443
444#define GT_SDRAM_CFG_DUPEOT1_SHF 22
445#define GT_SDRAM_CFG_DUPEOT1_MSK (MSK(1) << GT_SDRAM_CFG_DUPEOT1_SHF)
446#define GT_SDRAM_CFG_DUPEOT1_BIT GT_SDRAM_CFG_DUPEOT1_MSK
447
448#define GT_SDRAM_OPMODE_OP_SHF 0
449#define GT_SDRAM_OPMODE_OP_MSK (MSK(3) << GT_SDRAM_OPMODE_OP_SHF)
450#define GT_SDRAM_OPMODE_OP_NORMAL 0
451#define GT_SDRAM_OPMODE_OP_NOP 1
452#define GT_SDRAM_OPMODE_OP_PRCHG 2
453#define GT_SDRAM_OPMODE_OP_MODE 3
454#define GT_SDRAM_OPMODE_OP_CBR 4
455
456#define GT_TC_CONTROL_ENTC0_SHF 0
457#define GT_TC_CONTROL_ENTC0_MSK (MSK(1) << GT_TC_CONTROL_ENTC0_SHF)
458#define GT_TC_CONTROL_ENTC0_BIT GT_TC_CONTROL_ENTC0_MSK
459#define GT_TC_CONTROL_SELTC0_SHF 1
460#define GT_TC_CONTROL_SELTC0_MSK (MSK(1) << GT_TC_CONTROL_SELTC0_SHF)
461#define GT_TC_CONTROL_SELTC0_BIT GT_TC_CONTROL_SELTC0_MSK
462
463
464#define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0
465#define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF)
466#define GT_PCI0_BARE_SWSCS3BOOTDIS_BIT GT_PCI0_BARE_SWSCS3BOOTDIS_MSK
467
468#define GT_PCI0_BARE_SWSCS32DIS_SHF 1
469#define GT_PCI0_BARE_SWSCS32DIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS32DIS_SHF)
470#define GT_PCI0_BARE_SWSCS32DIS_BIT GT_PCI0_BARE_SWSCS32DIS_MSK
471
472#define GT_PCI0_BARE_SWSCS10DIS_SHF 2
473#define GT_PCI0_BARE_SWSCS10DIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS10DIS_SHF)
474#define GT_PCI0_BARE_SWSCS10DIS_BIT GT_PCI0_BARE_SWSCS10DIS_MSK
475
476#define GT_PCI0_BARE_INTIODIS_SHF 3
477#define GT_PCI0_BARE_INTIODIS_MSK (MSK(1) << GT_PCI0_BARE_INTIODIS_SHF)
478#define GT_PCI0_BARE_INTIODIS_BIT GT_PCI0_BARE_INTIODIS_MSK
479
480#define GT_PCI0_BARE_INTMEMDIS_SHF 4
481#define GT_PCI0_BARE_INTMEMDIS_MSK (MSK(1) << GT_PCI0_BARE_INTMEMDIS_SHF)
482#define GT_PCI0_BARE_INTMEMDIS_BIT GT_PCI0_BARE_INTMEMDIS_MSK
483
484#define GT_PCI0_BARE_CS3BOOTDIS_SHF 5
485#define GT_PCI0_BARE_CS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_CS3BOOTDIS_SHF)
486#define GT_PCI0_BARE_CS3BOOTDIS_BIT GT_PCI0_BARE_CS3BOOTDIS_MSK
487
488#define GT_PCI0_BARE_CS20DIS_SHF 6
489#define GT_PCI0_BARE_CS20DIS_MSK (MSK(1) << GT_PCI0_BARE_CS20DIS_SHF)
490#define GT_PCI0_BARE_CS20DIS_BIT GT_PCI0_BARE_CS20DIS_MSK
491
492#define GT_PCI0_BARE_SCS32DIS_SHF 7
493#define GT_PCI0_BARE_SCS32DIS_MSK (MSK(1) << GT_PCI0_BARE_SCS32DIS_SHF)
494#define GT_PCI0_BARE_SCS32DIS_BIT GT_PCI0_BARE_SCS32DIS_MSK
495
496#define GT_PCI0_BARE_SCS10DIS_SHF 8
497#define GT_PCI0_BARE_SCS10DIS_MSK (MSK(1) << GT_PCI0_BARE_SCS10DIS_SHF)
498#define GT_PCI0_BARE_SCS10DIS_BIT GT_PCI0_BARE_SCS10DIS_MSK
499
500
501#define GT_INTRCAUSE_MASABORT0_SHF 18
502#define GT_INTRCAUSE_MASABORT0_MSK (MSK(1) << GT_INTRCAUSE_MASABORT0_SHF)
503#define GT_INTRCAUSE_MASABORT0_BIT GT_INTRCAUSE_MASABORT0_MSK
504
505#define GT_INTRCAUSE_TARABORT0_SHF 19
506#define GT_INTRCAUSE_TARABORT0_MSK (MSK(1) << GT_INTRCAUSE_TARABORT0_SHF)
507#define GT_INTRCAUSE_TARABORT0_BIT GT_INTRCAUSE_TARABORT0_MSK
508
509
510#define GT_PCI0_CFGADDR_REGNUM_SHF 2
511#define GT_PCI0_CFGADDR_REGNUM_MSK (MSK(6) << GT_PCI0_CFGADDR_REGNUM_SHF)
512#define GT_PCI0_CFGADDR_FUNCTNUM_SHF 8
513#define GT_PCI0_CFGADDR_FUNCTNUM_MSK (MSK(3) << GT_PCI0_CFGADDR_FUNCTNUM_SHF)
514#define GT_PCI0_CFGADDR_DEVNUM_SHF 11
515#define GT_PCI0_CFGADDR_DEVNUM_MSK (MSK(5) << GT_PCI0_CFGADDR_DEVNUM_SHF)
516#define GT_PCI0_CFGADDR_BUSNUM_SHF 16
517#define GT_PCI0_CFGADDR_BUSNUM_MSK (MSK(8) << GT_PCI0_CFGADDR_BUSNUM_SHF)
518#define GT_PCI0_CFGADDR_CONFIGEN_SHF 31
519#define GT_PCI0_CFGADDR_CONFIGEN_MSK (MSK(1) << GT_PCI0_CFGADDR_CONFIGEN_SHF)
520#define GT_PCI0_CFGADDR_CONFIGEN_BIT GT_PCI0_CFGADDR_CONFIGEN_MSK
521
522#define GT_PCI0_CMD_MBYTESWAP_SHF 0
523#define GT_PCI0_CMD_MBYTESWAP_MSK (MSK(1) << GT_PCI0_CMD_MBYTESWAP_SHF)
524#define GT_PCI0_CMD_MBYTESWAP_BIT GT_PCI0_CMD_MBYTESWAP_MSK
525#define GT_PCI0_CMD_MWORDSWAP_SHF 10
526#define GT_PCI0_CMD_MWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_MWORDSWAP_SHF)
527#define GT_PCI0_CMD_MWORDSWAP_BIT GT_PCI0_CMD_MWORDSWAP_MSK
528#define GT_PCI0_CMD_SBYTESWAP_SHF 16
529#define GT_PCI0_CMD_SBYTESWAP_MSK (MSK(1) << GT_PCI0_CMD_SBYTESWAP_SHF)
530#define GT_PCI0_CMD_SBYTESWAP_BIT GT_PCI0_CMD_SBYTESWAP_MSK
531#define GT_PCI0_CMD_SWORDSWAP_SHF 11
532#define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF)
533#define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK
534
535#define GT_INTR_T0EXP_SHF 8
536#define GT_INTR_T0EXP_MSK (MSK(1) << GT_INTR_T0EXP_SHF)
537#define GT_INTR_T0EXP_BIT GT_INTR_T0EXP_MSK
538#define GT_INTR_RETRYCTR0_SHF 20
539#define GT_INTR_RETRYCTR0_MSK (MSK(1) << GT_INTR_RETRYCTR0_SHF)
540#define GT_INTR_RETRYCTR0_BIT GT_INTR_RETRYCTR0_MSK
541
542/*
543 * Misc
544 */
545#define GT_DEF_PCI0_IO_BASE 0x10000000UL
546#define GT_DEF_PCI0_IO_SIZE 0x02000000UL
547#define GT_DEF_PCI0_MEM0_BASE 0x12000000UL
548#define GT_DEF_PCI0_MEM0_SIZE 0x02000000UL
549#define GT_DEF_BASE 0x14000000UL
550
551#define GT_MAX_BANKSIZE (256 * 1024 * 1024) /* Max 256MB bank */
552#define GT_LATTIM_MIN 6 /* Minimum lat */
553
554/*
555 * The gt64120_dep.h file must define the following macros
556 *
557 * GT_READ(ofs, data_pointer)
558 * GT_WRITE(ofs, data) - read/write GT64120 registers in 32bit
559 *
560 * TIMER - gt64120 timer irq, temporary solution until
561 * full gt64120 cascade interrupt support is in place
562 */
563
564#include <mach-gt64120.h>
565
566/*
567 * Because of an error/peculiarity in the Galileo chip, we need to swap the
568 * bytes when running bigendian. We also provide non-swapping versions.
569 */
570#define __GT_READ(ofs) \
571 (*(volatile u32 *)(GT64120_BASE+(ofs)))
572#define __GT_WRITE(ofs, data) \
573 do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
574#define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs))
575#define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data))
576
577extern void gt641xx_set_base_clock(unsigned int clock);
578extern int gt641xx_timer0_state(void);
579
580#endif /* _ASM_GT64120_H */
diff --git a/include/asm-mips/hardirq.h b/include/asm-mips/hardirq.h
deleted file mode 100644
index 90bf399e6dd9..000000000000
--- a/include/asm-mips/hardirq.h
+++ /dev/null
@@ -1,24 +0,0 @@
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 * Copyright (C) 1997, 98, 99, 2000, 01, 05 Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 */
10#ifndef _ASM_HARDIRQ_H
11#define _ASM_HARDIRQ_H
12
13#include <linux/threads.h>
14#include <linux/irq.h>
15
16typedef struct {
17 unsigned int __softirq_pending;
18} ____cacheline_aligned irq_cpustat_t;
19
20#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
21
22extern void ack_bad_irq(unsigned int irq);
23
24#endif /* _ASM_HARDIRQ_H */
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
deleted file mode 100644
index 2de638f84c86..000000000000
--- a/include/asm-mips/hazards.h
+++ /dev/null
@@ -1,271 +0,0 @@
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 * Copyright (C) 2003, 04, 07 Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) MIPS Technologies, Inc.
8 * written by Ralf Baechle <ralf@linux-mips.org>
9 */
10#ifndef _ASM_HAZARDS_H
11#define _ASM_HAZARDS_H
12
13#ifdef __ASSEMBLY__
14#define ASMMACRO(name, code...) .macro name; code; .endm
15#else
16
17#include <asm/cpu-features.h>
18
19#define ASMMACRO(name, code...) \
20__asm__(".macro " #name "; " #code "; .endm"); \
21 \
22static inline void name(void) \
23{ \
24 __asm__ __volatile__ (#name); \
25}
26
27/*
28 * MIPS R2 instruction hazard barrier. Needs to be called as a subroutine.
29 */
30extern void mips_ihb(void);
31
32#endif
33
34ASMMACRO(_ssnop,
35 sll $0, $0, 1
36 )
37
38ASMMACRO(_ehb,
39 sll $0, $0, 3
40 )
41
42/*
43 * TLB hazards
44 */
45#if defined(CONFIG_CPU_MIPSR2)
46
47/*
48 * MIPSR2 defines ehb for hazard avoidance
49 */
50
51ASMMACRO(mtc0_tlbw_hazard,
52 _ehb
53 )
54ASMMACRO(tlbw_use_hazard,
55 _ehb
56 )
57ASMMACRO(tlb_probe_hazard,
58 _ehb
59 )
60ASMMACRO(irq_enable_hazard,
61 _ehb
62 )
63ASMMACRO(irq_disable_hazard,
64 _ehb
65 )
66ASMMACRO(back_to_back_c0_hazard,
67 _ehb
68 )
69/*
70 * gcc has a tradition of misscompiling the previous construct using the
71 * address of a label as argument to inline assembler. Gas otoh has the
72 * annoying difference between la and dla which are only usable for 32-bit
73 * rsp. 64-bit code, so can't be used without conditional compilation.
74 * The alterantive is switching the assembler to 64-bit code which happens
75 * to work right even for 32-bit code ...
76 */
77#define instruction_hazard() \
78do { \
79 unsigned long tmp; \
80 \
81 __asm__ __volatile__( \
82 " .set mips64r2 \n" \
83 " dla %0, 1f \n" \
84 " jr.hb %0 \n" \
85 " .set mips0 \n" \
86 "1: \n" \
87 : "=r" (tmp)); \
88} while (0)
89
90#elif defined(CONFIG_CPU_MIPSR1)
91
92/*
93 * These are slightly complicated by the fact that we guarantee R1 kernels to
94 * run fine on R2 processors.
95 */
96ASMMACRO(mtc0_tlbw_hazard,
97 _ssnop; _ssnop; _ehb
98 )
99ASMMACRO(tlbw_use_hazard,
100 _ssnop; _ssnop; _ssnop; _ehb
101 )
102ASMMACRO(tlb_probe_hazard,
103 _ssnop; _ssnop; _ssnop; _ehb
104 )
105ASMMACRO(irq_enable_hazard,
106 _ssnop; _ssnop; _ssnop; _ehb
107 )
108ASMMACRO(irq_disable_hazard,
109 _ssnop; _ssnop; _ssnop; _ehb
110 )
111ASMMACRO(back_to_back_c0_hazard,
112 _ssnop; _ssnop; _ssnop; _ehb
113 )
114/*
115 * gcc has a tradition of misscompiling the previous construct using the
116 * address of a label as argument to inline assembler. Gas otoh has the
117 * annoying difference between la and dla which are only usable for 32-bit
118 * rsp. 64-bit code, so can't be used without conditional compilation.
119 * The alterantive is switching the assembler to 64-bit code which happens
120 * to work right even for 32-bit code ...
121 */
122#define __instruction_hazard() \
123do { \
124 unsigned long tmp; \
125 \
126 __asm__ __volatile__( \
127 " .set mips64r2 \n" \
128 " dla %0, 1f \n" \
129 " jr.hb %0 \n" \
130 " .set mips0 \n" \
131 "1: \n" \
132 : "=r" (tmp)); \
133} while (0)
134
135#define instruction_hazard() \
136do { \
137 if (cpu_has_mips_r2) \
138 __instruction_hazard(); \
139} while (0)
140
141#elif defined(CONFIG_CPU_R10000)
142
143/*
144 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
145 */
146
147ASMMACRO(mtc0_tlbw_hazard,
148 )
149ASMMACRO(tlbw_use_hazard,
150 )
151ASMMACRO(tlb_probe_hazard,
152 )
153ASMMACRO(irq_enable_hazard,
154 )
155ASMMACRO(irq_disable_hazard,
156 )
157ASMMACRO(back_to_back_c0_hazard,
158 )
159#define instruction_hazard() do { } while (0)
160
161#elif defined(CONFIG_CPU_RM9000)
162
163/*
164 * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
165 * use of the JTLB for instructions should not occur for 4 cpu cycles and use
166 * for data translations should not occur for 3 cpu cycles.
167 */
168
169ASMMACRO(mtc0_tlbw_hazard,
170 _ssnop; _ssnop; _ssnop; _ssnop
171 )
172ASMMACRO(tlbw_use_hazard,
173 _ssnop; _ssnop; _ssnop; _ssnop
174 )
175ASMMACRO(tlb_probe_hazard,
176 _ssnop; _ssnop; _ssnop; _ssnop
177 )
178ASMMACRO(irq_enable_hazard,
179 )
180ASMMACRO(irq_disable_hazard,
181 )
182ASMMACRO(back_to_back_c0_hazard,
183 )
184#define instruction_hazard() do { } while (0)
185
186#elif defined(CONFIG_CPU_SB1)
187
188/*
189 * Mostly like R4000 for historic reasons
190 */
191ASMMACRO(mtc0_tlbw_hazard,
192 )
193ASMMACRO(tlbw_use_hazard,
194 )
195ASMMACRO(tlb_probe_hazard,
196 )
197ASMMACRO(irq_enable_hazard,
198 )
199ASMMACRO(irq_disable_hazard,
200 _ssnop; _ssnop; _ssnop
201 )
202ASMMACRO(back_to_back_c0_hazard,
203 )
204#define instruction_hazard() do { } while (0)
205
206#else
207
208/*
209 * Finally the catchall case for all other processors including R4000, R4400,
210 * R4600, R4700, R5000, RM7000, NEC VR41xx etc.
211 *
212 * The taken branch will result in a two cycle penalty for the two killed
213 * instructions on R4000 / R4400. Other processors only have a single cycle
214 * hazard so this is nice trick to have an optimal code for a range of
215 * processors.
216 */
217ASMMACRO(mtc0_tlbw_hazard,
218 nop; nop
219 )
220ASMMACRO(tlbw_use_hazard,
221 nop; nop; nop
222 )
223ASMMACRO(tlb_probe_hazard,
224 nop; nop; nop
225 )
226ASMMACRO(irq_enable_hazard,
227 _ssnop; _ssnop; _ssnop;
228 )
229ASMMACRO(irq_disable_hazard,
230 nop; nop; nop
231 )
232ASMMACRO(back_to_back_c0_hazard,
233 _ssnop; _ssnop; _ssnop;
234 )
235#define instruction_hazard() do { } while (0)
236
237#endif
238
239
240/* FPU hazards */
241
242#if defined(CONFIG_CPU_SB1)
243ASMMACRO(enable_fpu_hazard,
244 .set push;
245 .set mips64;
246 .set noreorder;
247 _ssnop;
248 bnezl $0, .+4;
249 _ssnop;
250 .set pop
251)
252ASMMACRO(disable_fpu_hazard,
253)
254
255#elif defined(CONFIG_CPU_MIPSR2)
256ASMMACRO(enable_fpu_hazard,
257 _ehb
258)
259ASMMACRO(disable_fpu_hazard,
260 _ehb
261)
262#else
263ASMMACRO(enable_fpu_hazard,
264 nop; nop; nop; nop
265)
266ASMMACRO(disable_fpu_hazard,
267 _ehb
268)
269#endif
270
271#endif /* _ASM_HAZARDS_H */
diff --git a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
deleted file mode 100644
index 4374ab2adc75..000000000000
--- a/include/asm-mips/highmem.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * highmem.h: virtual kernel memory mappings for high memory
3 *
4 * Used in CONFIG_HIGHMEM systems for memory pages which
5 * are not addressable by direct kernel virtual addresses.
6 *
7 * Copyright (C) 1999 Gerhard Wichert, Siemens AG
8 * Gerhard.Wichert@pdb.siemens.de
9 *
10 *
11 * Redesigned the x86 32-bit VM architecture to deal with
12 * up to 16 Terabyte physical memory. With current x86 CPUs
13 * we now support up to 64 Gigabytes physical RAM.
14 *
15 * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
16 */
17#ifndef _ASM_HIGHMEM_H
18#define _ASM_HIGHMEM_H
19
20#ifdef __KERNEL__
21
22#include <linux/init.h>
23#include <linux/interrupt.h>
24#include <linux/uaccess.h>
25#include <asm/kmap_types.h>
26
27/* undef for production */
28#define HIGHMEM_DEBUG 1
29
30/* declarations for highmem.c */
31extern unsigned long highstart_pfn, highend_pfn;
32
33extern pte_t *kmap_pte;
34extern pgprot_t kmap_prot;
35extern pte_t *pkmap_page_table;
36
37/*
38 * Right now we initialize only a single pte table. It can be extended
39 * easily, subsequent pte tables have to be allocated in one physical
40 * chunk of RAM.
41 */
42#define LAST_PKMAP 1024
43#define LAST_PKMAP_MASK (LAST_PKMAP-1)
44#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
45#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
46
47extern void * kmap_high(struct page *page);
48extern void kunmap_high(struct page *page);
49
50extern void *__kmap(struct page *page);
51extern void __kunmap(struct page *page);
52extern void *__kmap_atomic(struct page *page, enum km_type type);
53extern void __kunmap_atomic(void *kvaddr, enum km_type type);
54extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
55extern struct page *__kmap_atomic_to_page(void *ptr);
56
57#define kmap __kmap
58#define kunmap __kunmap
59#define kmap_atomic __kmap_atomic
60#define kunmap_atomic __kunmap_atomic
61#define kmap_atomic_to_page __kmap_atomic_to_page
62
63#define flush_cache_kmaps() flush_cache_all()
64
65#endif /* __KERNEL__ */
66
67#endif /* _ASM_HIGHMEM_H */
diff --git a/include/asm-mips/hw_irq.h b/include/asm-mips/hw_irq.h
deleted file mode 100644
index aca05a43a97b..000000000000
--- a/include/asm-mips/hw_irq.h
+++ /dev/null
@@ -1,20 +0,0 @@
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 * Copyright (C) 2000, 2001, 2002 by Ralf Baechle
7 */
8#ifndef __ASM_HW_IRQ_H
9#define __ASM_HW_IRQ_H
10
11#include <asm/atomic.h>
12
13extern atomic_t irq_err_count;
14
15/*
16 * interrupt-retrigger: NOP for now. This may not be apropriate for all
17 * machines, we'll see ...
18 */
19
20#endif /* __ASM_HW_IRQ_H */
diff --git a/include/asm-mips/i8253.h b/include/asm-mips/i8253.h
deleted file mode 100644
index 5dabc870b322..000000000000
--- a/include/asm-mips/i8253.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Machine specific IO port address definition for generic.
3 * Written by Osamu Tomita <tomita@cinet.co.jp>
4 */
5#ifndef __ASM_I8253_H
6#define __ASM_I8253_H
7
8#include <linux/spinlock.h>
9
10/* i8253A PIT registers */
11#define PIT_MODE 0x43
12#define PIT_CH0 0x40
13#define PIT_CH2 0x42
14
15#define PIT_TICK_RATE 1193182UL
16
17extern spinlock_t i8253_lock;
18
19extern void setup_pit_timer(void);
20
21#endif /* __ASM_I8253_H */
diff --git a/include/asm-mips/i8259.h b/include/asm-mips/i8259.h
deleted file mode 100644
index 8572a2d90484..000000000000
--- a/include/asm-mips/i8259.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * include/asm-mips/i8259.h
3 *
4 * i8259A interrupt definitions.
5 *
6 * Copyright (C) 2003 Maciej W. Rozycki
7 * Copyright (C) 2003 Ralf Baechle <ralf@linux-mips.org>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14#ifndef _ASM_I8259_H
15#define _ASM_I8259_H
16
17#include <linux/compiler.h>
18#include <linux/spinlock.h>
19
20#include <asm/io.h>
21#include <irq.h>
22
23/* i8259A PIC registers */
24#define PIC_MASTER_CMD 0x20
25#define PIC_MASTER_IMR 0x21
26#define PIC_MASTER_ISR PIC_MASTER_CMD
27#define PIC_MASTER_POLL PIC_MASTER_ISR
28#define PIC_MASTER_OCW3 PIC_MASTER_ISR
29#define PIC_SLAVE_CMD 0xa0
30#define PIC_SLAVE_IMR 0xa1
31
32/* i8259A PIC related value */
33#define PIC_CASCADE_IR 2
34#define MASTER_ICW4_DEFAULT 0x01
35#define SLAVE_ICW4_DEFAULT 0x01
36#define PIC_ICW4_AEOI 2
37
38extern spinlock_t i8259A_lock;
39
40extern int i8259A_irq_pending(unsigned int irq);
41extern void make_8259A_irq(unsigned int irq);
42
43extern void init_i8259_irqs(void);
44
45/*
46 * Do the traditional i8259 interrupt polling thing. This is for the few
47 * cases where no better interrupt acknowledge method is available and we
48 * absolutely must touch the i8259.
49 */
50static inline int i8259_irq(void)
51{
52 int irq;
53
54 spin_lock(&i8259A_lock);
55
56 /* Perform an interrupt acknowledge cycle on controller 1. */
57 outb(0x0C, PIC_MASTER_CMD); /* prepare for poll */
58 irq = inb(PIC_MASTER_CMD) & 7;
59 if (irq == PIC_CASCADE_IR) {
60 /*
61 * Interrupt is cascaded so perform interrupt
62 * acknowledge on controller 2.
63 */
64 outb(0x0C, PIC_SLAVE_CMD); /* prepare for poll */
65 irq = (inb(PIC_SLAVE_CMD) & 7) + 8;
66 }
67
68 if (unlikely(irq == 7)) {
69 /*
70 * This may be a spurious interrupt.
71 *
72 * Read the interrupt status register (ISR). If the most
73 * significant bit is not set then there is no valid
74 * interrupt.
75 */
76 outb(0x0B, PIC_MASTER_ISR); /* ISR register */
77 if(~inb(PIC_MASTER_ISR) & 0x80)
78 irq = -1;
79 }
80
81 spin_unlock(&i8259A_lock);
82
83 return likely(irq >= 0) ? irq + I8259A_IRQ_BASE : irq;
84}
85
86#endif /* _ASM_I8259_H */
diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h
deleted file mode 100644
index bb674c3b0303..000000000000
--- a/include/asm-mips/ide.h
+++ /dev/null
@@ -1,13 +0,0 @@
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 * This file contains the MIPS architecture specific IDE code.
7 */
8#ifndef __ASM_IDE_H
9#define __ASM_IDE_H
10
11#include <ide.h>
12
13#endif /* __ASM_IDE_H */
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
deleted file mode 100644
index 6489f00731ca..000000000000
--- a/include/asm-mips/inst.h
+++ /dev/null
@@ -1,394 +0,0 @@
1/*
2 * Format of an instruction in memory.
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 (C) 1996, 2000 by Ralf Baechle
9 * Copyright (C) 2006 by Thiemo Seufer
10 */
11#ifndef _ASM_INST_H
12#define _ASM_INST_H
13
14/*
15 * Major opcodes; before MIPS IV cop1x was called cop3.
16 */
17enum major_op {
18 spec_op, bcond_op, j_op, jal_op,
19 beq_op, bne_op, blez_op, bgtz_op,
20 addi_op, addiu_op, slti_op, sltiu_op,
21 andi_op, ori_op, xori_op, lui_op,
22 cop0_op, cop1_op, cop2_op, cop1x_op,
23 beql_op, bnel_op, blezl_op, bgtzl_op,
24 daddi_op, daddiu_op, ldl_op, ldr_op,
25 spec2_op, jalx_op, mdmx_op, spec3_op,
26 lb_op, lh_op, lwl_op, lw_op,
27 lbu_op, lhu_op, lwr_op, lwu_op,
28 sb_op, sh_op, swl_op, sw_op,
29 sdl_op, sdr_op, swr_op, cache_op,
30 ll_op, lwc1_op, lwc2_op, pref_op,
31 lld_op, ldc1_op, ldc2_op, ld_op,
32 sc_op, swc1_op, swc2_op, major_3b_op,
33 scd_op, sdc1_op, sdc2_op, sd_op
34};
35
36/*
37 * func field of spec opcode.
38 */
39enum spec_op {
40 sll_op, movc_op, srl_op, sra_op,
41 sllv_op, pmon_op, srlv_op, srav_op,
42 jr_op, jalr_op, movz_op, movn_op,
43 syscall_op, break_op, spim_op, sync_op,
44 mfhi_op, mthi_op, mflo_op, mtlo_op,
45 dsllv_op, spec2_unused_op, dsrlv_op, dsrav_op,
46 mult_op, multu_op, div_op, divu_op,
47 dmult_op, dmultu_op, ddiv_op, ddivu_op,
48 add_op, addu_op, sub_op, subu_op,
49 and_op, or_op, xor_op, nor_op,
50 spec3_unused_op, spec4_unused_op, slt_op, sltu_op,
51 dadd_op, daddu_op, dsub_op, dsubu_op,
52 tge_op, tgeu_op, tlt_op, tltu_op,
53 teq_op, spec5_unused_op, tne_op, spec6_unused_op,
54 dsll_op, spec7_unused_op, dsrl_op, dsra_op,
55 dsll32_op, spec8_unused_op, dsrl32_op, dsra32_op
56};
57
58/*
59 * func field of spec2 opcode.
60 */
61enum spec2_op {
62 madd_op, maddu_op, mul_op, spec2_3_unused_op,
63 msub_op, msubu_op, /* more unused ops */
64 clz_op = 0x20, clo_op,
65 dclz_op = 0x24, dclo_op,
66 sdbpp_op = 0x3f
67};
68
69/*
70 * func field of spec3 opcode.
71 */
72enum spec3_op {
73 ext_op, dextm_op, dextu_op, dext_op,
74 ins_op, dinsm_op, dinsu_op, dins_op,
75 bshfl_op = 0x20,
76 dbshfl_op = 0x24,
77 rdhwr_op = 0x3b
78};
79
80/*
81 * rt field of bcond opcodes.
82 */
83enum rt_op {
84 bltz_op, bgez_op, bltzl_op, bgezl_op,
85 spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07,
86 tgei_op, tgeiu_op, tlti_op, tltiu_op,
87 teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op,
88 bltzal_op, bgezal_op, bltzall_op, bgezall_op,
89 rt_op_0x14, rt_op_0x15, rt_op_0x16, rt_op_0x17,
90 rt_op_0x18, rt_op_0x19, rt_op_0x1a, rt_op_0x1b,
91 bposge32_op, rt_op_0x1d, rt_op_0x1e, rt_op_0x1f
92};
93
94/*
95 * rs field of cop opcodes.
96 */
97enum cop_op {
98 mfc_op = 0x00, dmfc_op = 0x01,
99 cfc_op = 0x02, mtc_op = 0x04,
100 dmtc_op = 0x05, ctc_op = 0x06,
101 bc_op = 0x08, cop_op = 0x10,
102 copm_op = 0x18
103};
104
105/*
106 * rt field of cop.bc_op opcodes
107 */
108enum bcop_op {
109 bcf_op, bct_op, bcfl_op, bctl_op
110};
111
112/*
113 * func field of cop0 coi opcodes.
114 */
115enum cop0_coi_func {
116 tlbr_op = 0x01, tlbwi_op = 0x02,
117 tlbwr_op = 0x06, tlbp_op = 0x08,
118 rfe_op = 0x10, eret_op = 0x18
119};
120
121/*
122 * func field of cop0 com opcodes.
123 */
124enum cop0_com_func {
125 tlbr1_op = 0x01, tlbw_op = 0x02,
126 tlbp1_op = 0x08, dctr_op = 0x09,
127 dctw_op = 0x0a
128};
129
130/*
131 * fmt field of cop1 opcodes.
132 */
133enum cop1_fmt {
134 s_fmt, d_fmt, e_fmt, q_fmt,
135 w_fmt, l_fmt
136};
137
138/*
139 * func field of cop1 instructions using d, s or w format.
140 */
141enum cop1_sdw_func {
142 fadd_op = 0x00, fsub_op = 0x01,
143 fmul_op = 0x02, fdiv_op = 0x03,
144 fsqrt_op = 0x04, fabs_op = 0x05,
145 fmov_op = 0x06, fneg_op = 0x07,
146 froundl_op = 0x08, ftruncl_op = 0x09,
147 fceill_op = 0x0a, ffloorl_op = 0x0b,
148 fround_op = 0x0c, ftrunc_op = 0x0d,
149 fceil_op = 0x0e, ffloor_op = 0x0f,
150 fmovc_op = 0x11, fmovz_op = 0x12,
151 fmovn_op = 0x13, frecip_op = 0x15,
152 frsqrt_op = 0x16, fcvts_op = 0x20,
153 fcvtd_op = 0x21, fcvte_op = 0x22,
154 fcvtw_op = 0x24, fcvtl_op = 0x25,
155 fcmp_op = 0x30
156};
157
158/*
159 * func field of cop1x opcodes (MIPS IV).
160 */
161enum cop1x_func {
162 lwxc1_op = 0x00, ldxc1_op = 0x01,
163 pfetch_op = 0x07, swxc1_op = 0x08,
164 sdxc1_op = 0x09, madd_s_op = 0x20,
165 madd_d_op = 0x21, madd_e_op = 0x22,
166 msub_s_op = 0x28, msub_d_op = 0x29,
167 msub_e_op = 0x2a, nmadd_s_op = 0x30,
168 nmadd_d_op = 0x31, nmadd_e_op = 0x32,
169 nmsub_s_op = 0x38, nmsub_d_op = 0x39,
170 nmsub_e_op = 0x3a
171};
172
173/*
174 * func field for mad opcodes (MIPS IV).
175 */
176enum mad_func {
177 madd_fp_op = 0x08, msub_fp_op = 0x0a,
178 nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e
179};
180
181/*
182 * Damn ... bitfields depend from byteorder :-(
183 */
184#ifdef __MIPSEB__
185struct j_format { /* Jump format */
186 unsigned int opcode : 6;
187 unsigned int target : 26;
188};
189
190struct i_format { /* Immediate format (addi, lw, ...) */
191 unsigned int opcode : 6;
192 unsigned int rs : 5;
193 unsigned int rt : 5;
194 signed int simmediate : 16;
195};
196
197struct u_format { /* Unsigned immediate format (ori, xori, ...) */
198 unsigned int opcode : 6;
199 unsigned int rs : 5;
200 unsigned int rt : 5;
201 unsigned int uimmediate : 16;
202};
203
204struct c_format { /* Cache (>= R6000) format */
205 unsigned int opcode : 6;
206 unsigned int rs : 5;
207 unsigned int c_op : 3;
208 unsigned int cache : 2;
209 unsigned int simmediate : 16;
210};
211
212struct r_format { /* Register format */
213 unsigned int opcode : 6;
214 unsigned int rs : 5;
215 unsigned int rt : 5;
216 unsigned int rd : 5;
217 unsigned int re : 5;
218 unsigned int func : 6;
219};
220
221struct p_format { /* Performance counter format (R10000) */
222 unsigned int opcode : 6;
223 unsigned int rs : 5;
224 unsigned int rt : 5;
225 unsigned int rd : 5;
226 unsigned int re : 5;
227 unsigned int func : 6;
228};
229
230struct f_format { /* FPU register format */
231 unsigned int opcode : 6;
232 unsigned int : 1;
233 unsigned int fmt : 4;
234 unsigned int rt : 5;
235 unsigned int rd : 5;
236 unsigned int re : 5;
237 unsigned int func : 6;
238};
239
240struct ma_format { /* FPU multipy and add format (MIPS IV) */
241 unsigned int opcode : 6;
242 unsigned int fr : 5;
243 unsigned int ft : 5;
244 unsigned int fs : 5;
245 unsigned int fd : 5;
246 unsigned int func : 4;
247 unsigned int fmt : 2;
248};
249
250#elif defined(__MIPSEL__)
251
252struct j_format { /* Jump format */
253 unsigned int target : 26;
254 unsigned int opcode : 6;
255};
256
257struct i_format { /* Immediate format */
258 signed int simmediate : 16;
259 unsigned int rt : 5;
260 unsigned int rs : 5;
261 unsigned int opcode : 6;
262};
263
264struct u_format { /* Unsigned immediate format */
265 unsigned int uimmediate : 16;
266 unsigned int rt : 5;
267 unsigned int rs : 5;
268 unsigned int opcode : 6;
269};
270
271struct c_format { /* Cache (>= R6000) format */
272 unsigned int simmediate : 16;
273 unsigned int cache : 2;
274 unsigned int c_op : 3;
275 unsigned int rs : 5;
276 unsigned int opcode : 6;
277};
278
279struct r_format { /* Register format */
280 unsigned int func : 6;
281 unsigned int re : 5;
282 unsigned int rd : 5;
283 unsigned int rt : 5;
284 unsigned int rs : 5;
285 unsigned int opcode : 6;
286};
287
288struct p_format { /* Performance counter format (R10000) */
289 unsigned int func : 6;
290 unsigned int re : 5;
291 unsigned int rd : 5;
292 unsigned int rt : 5;
293 unsigned int rs : 5;
294 unsigned int opcode : 6;
295};
296
297struct f_format { /* FPU register format */
298 unsigned int func : 6;
299 unsigned int re : 5;
300 unsigned int rd : 5;
301 unsigned int rt : 5;
302 unsigned int fmt : 4;
303 unsigned int : 1;
304 unsigned int opcode : 6;
305};
306
307struct ma_format { /* FPU multipy and add format (MIPS IV) */
308 unsigned int fmt : 2;
309 unsigned int func : 4;
310 unsigned int fd : 5;
311 unsigned int fs : 5;
312 unsigned int ft : 5;
313 unsigned int fr : 5;
314 unsigned int opcode : 6;
315};
316
317#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */
318#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?"
319#endif
320
321union mips_instruction {
322 unsigned int word;
323 unsigned short halfword[2];
324 unsigned char byte[4];
325 struct j_format j_format;
326 struct i_format i_format;
327 struct u_format u_format;
328 struct c_format c_format;
329 struct r_format r_format;
330 struct f_format f_format;
331 struct ma_format ma_format;
332};
333
334/* HACHACHAHCAHC ... */
335
336/* In case some other massaging is needed, keep MIPSInst as wrapper */
337
338#define MIPSInst(x) x
339
340#define I_OPCODE_SFT 26
341#define MIPSInst_OPCODE(x) (MIPSInst(x) >> I_OPCODE_SFT)
342
343#define I_JTARGET_SFT 0
344#define MIPSInst_JTARGET(x) (MIPSInst(x) & 0x03ffffff)
345
346#define I_RS_SFT 21
347#define MIPSInst_RS(x) ((MIPSInst(x) & 0x03e00000) >> I_RS_SFT)
348
349#define I_RT_SFT 16
350#define MIPSInst_RT(x) ((MIPSInst(x) & 0x001f0000) >> I_RT_SFT)
351
352#define I_IMM_SFT 0
353#define MIPSInst_SIMM(x) ((int)((short)(MIPSInst(x) & 0xffff)))
354#define MIPSInst_UIMM(x) (MIPSInst(x) & 0xffff)
355
356#define I_CACHEOP_SFT 18
357#define MIPSInst_CACHEOP(x) ((MIPSInst(x) & 0x001c0000) >> I_CACHEOP_SFT)
358
359#define I_CACHESEL_SFT 16
360#define MIPSInst_CACHESEL(x) ((MIPSInst(x) & 0x00030000) >> I_CACHESEL_SFT)
361
362#define I_RD_SFT 11
363#define MIPSInst_RD(x) ((MIPSInst(x) & 0x0000f800) >> I_RD_SFT)
364
365#define I_RE_SFT 6
366#define MIPSInst_RE(x) ((MIPSInst(x) & 0x000007c0) >> I_RE_SFT)
367
368#define I_FUNC_SFT 0
369#define MIPSInst_FUNC(x) (MIPSInst(x) & 0x0000003f)
370
371#define I_FFMT_SFT 21
372#define MIPSInst_FFMT(x) ((MIPSInst(x) & 0x01e00000) >> I_FFMT_SFT)
373
374#define I_FT_SFT 16
375#define MIPSInst_FT(x) ((MIPSInst(x) & 0x001f0000) >> I_FT_SFT)
376
377#define I_FS_SFT 11
378#define MIPSInst_FS(x) ((MIPSInst(x) & 0x0000f800) >> I_FS_SFT)
379
380#define I_FD_SFT 6
381#define MIPSInst_FD(x) ((MIPSInst(x) & 0x000007c0) >> I_FD_SFT)
382
383#define I_FR_SFT 21
384#define MIPSInst_FR(x) ((MIPSInst(x) & 0x03e00000) >> I_FR_SFT)
385
386#define I_FMA_FUNC_SFT 2
387#define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x0000003c) >> I_FMA_FUNC_SFT)
388
389#define I_FMA_FFMT_SFT 0
390#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000003)
391
392typedef unsigned int mips_instruction;
393
394#endif /* _ASM_INST_H */
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
deleted file mode 100644
index 501a40b9f18d..000000000000
--- a/include/asm-mips/io.h
+++ /dev/null
@@ -1,589 +0,0 @@
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 * Copyright (C) 1994, 1995 Waldorf GmbH
7 * Copyright (C) 1994 - 2000, 06 Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
10 * Author: Maciej W. Rozycki <macro@mips.com>
11 */
12#ifndef _ASM_IO_H
13#define _ASM_IO_H
14
15#include <linux/compiler.h>
16#include <linux/kernel.h>
17#include <linux/types.h>
18
19#include <asm/addrspace.h>
20#include <asm/byteorder.h>
21#include <asm/cpu.h>
22#include <asm/cpu-features.h>
23#include <asm-generic/iomap.h>
24#include <asm/page.h>
25#include <asm/pgtable-bits.h>
26#include <asm/processor.h>
27#include <asm/string.h>
28
29#include <ioremap.h>
30#include <mangle-port.h>
31
32/*
33 * Slowdown I/O port space accesses for antique hardware.
34 */
35#undef CONF_SLOWDOWN_IO
36
37/*
38 * Raw operations are never swapped in software. OTOH values that raw
39 * operations are working on may or may not have been swapped by the bus
40 * hardware. An example use would be for flash memory that's used for
41 * execute in place.
42 */
43# define __raw_ioswabb(a, x) (x)
44# define __raw_ioswabw(a, x) (x)
45# define __raw_ioswabl(a, x) (x)
46# define __raw_ioswabq(a, x) (x)
47# define ____raw_ioswabq(a, x) (x)
48
49/* ioswab[bwlq], __mem_ioswab[bwlq] are defined in mangle-port.h */
50
51#define IO_SPACE_LIMIT 0xffff
52
53/*
54 * On MIPS I/O ports are memory mapped, so we access them using normal
55 * load/store instructions. mips_io_port_base is the virtual address to
56 * which all ports are being mapped. For sake of efficiency some code
57 * assumes that this is an address that can be loaded with a single lui
58 * instruction, so the lower 16 bits must be zero. Should be true on
59 * on any sane architecture; generic code does not use this assumption.
60 */
61extern const unsigned long mips_io_port_base;
62
63/*
64 * Gcc will generate code to load the value of mips_io_port_base after each
65 * function call which may be fairly wasteful in some cases. So we don't
66 * play quite by the book. We tell gcc mips_io_port_base is a long variable
67 * which solves the code generation issue. Now we need to violate the
68 * aliasing rules a little to make initialization possible and finally we
69 * will need the barrier() to fight side effects of the aliasing chat.
70 * This trickery will eventually collapse under gcc's optimizer. Oh well.
71 */
72static inline void set_io_port_base(unsigned long base)
73{
74 * (unsigned long *) &mips_io_port_base = base;
75 barrier();
76}
77
78/*
79 * Thanks to James van Artsdalen for a better timing-fix than
80 * the two short jumps: using outb's to a nonexistent port seems
81 * to guarantee better timings even on fast machines.
82 *
83 * On the other hand, I'd like to be sure of a non-existent port:
84 * I feel a bit unsafe about using 0x80 (should be safe, though)
85 *
86 * Linus
87 *
88 */
89
90#define __SLOW_DOWN_IO \
91 __asm__ __volatile__( \
92 "sb\t$0,0x80(%0)" \
93 : : "r" (mips_io_port_base));
94
95#ifdef CONF_SLOWDOWN_IO
96#ifdef REALLY_SLOW_IO
97#define SLOW_DOWN_IO { __SLOW_DOWN_IO; __SLOW_DOWN_IO; __SLOW_DOWN_IO; __SLOW_DOWN_IO; }
98#else
99#define SLOW_DOWN_IO __SLOW_DOWN_IO
100#endif
101#else
102#define SLOW_DOWN_IO
103#endif
104
105/*
106 * virt_to_phys - map virtual addresses to physical
107 * @address: address to remap
108 *
109 * The returned physical address is the physical (CPU) mapping for
110 * the memory address given. It is only valid to use this function on
111 * addresses directly mapped or allocated via kmalloc.
112 *
113 * This function does not give bus mappings for DMA transfers. In
114 * almost all conceivable cases a device driver should not be using
115 * this function
116 */
117static inline unsigned long virt_to_phys(volatile const void *address)
118{
119 return (unsigned long)address - PAGE_OFFSET + PHYS_OFFSET;
120}
121
122/*
123 * phys_to_virt - map physical address to virtual
124 * @address: address to remap
125 *
126 * The returned virtual address is a current CPU mapping for
127 * the memory address given. It is only valid to use this function on
128 * addresses that have a kernel mapping
129 *
130 * This function does not handle bus mappings for DMA transfers. In
131 * almost all conceivable cases a device driver should not be using
132 * this function
133 */
134static inline void * phys_to_virt(unsigned long address)
135{
136 return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
137}
138
139/*
140 * ISA I/O bus memory addresses are 1:1 with the physical address.
141 */
142static inline unsigned long isa_virt_to_bus(volatile void * address)
143{
144 return (unsigned long)address - PAGE_OFFSET;
145}
146
147static inline void * isa_bus_to_virt(unsigned long address)
148{
149 return (void *)(address + PAGE_OFFSET);
150}
151
152#define isa_page_to_bus page_to_phys
153
154/*
155 * However PCI ones are not necessarily 1:1 and therefore these interfaces
156 * are forbidden in portable PCI drivers.
157 *
158 * Allow them for x86 for legacy drivers, though.
159 */
160#define virt_to_bus virt_to_phys
161#define bus_to_virt phys_to_virt
162
163/*
164 * Change "struct page" to physical address.
165 */
166#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
167
168extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags);
169extern void __iounmap(const volatile void __iomem *addr);
170
171static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
172 unsigned long flags)
173{
174 void __iomem *addr = plat_ioremap(offset, size, flags);
175
176 if (addr)
177 return addr;
178
179#define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL))
180
181 if (cpu_has_64bit_addresses) {
182 u64 base = UNCAC_BASE;
183
184 /*
185 * R10000 supports a 2 bit uncached attribute therefore
186 * UNCAC_BASE may not equal IO_BASE.
187 */
188 if (flags == _CACHE_UNCACHED)
189 base = (u64) IO_BASE;
190 return (void __iomem *) (unsigned long) (base + offset);
191 } else if (__builtin_constant_p(offset) &&
192 __builtin_constant_p(size) && __builtin_constant_p(flags)) {
193 phys_t phys_addr, last_addr;
194
195 phys_addr = fixup_bigphys_addr(offset, size);
196
197 /* Don't allow wraparound or zero size. */
198 last_addr = phys_addr + size - 1;
199 if (!size || last_addr < phys_addr)
200 return NULL;
201
202 /*
203 * Map uncached objects in the low 512MB of address
204 * space using KSEG1.
205 */
206 if (__IS_LOW512(phys_addr) && __IS_LOW512(last_addr) &&
207 flags == _CACHE_UNCACHED)
208 return (void __iomem *)
209 (unsigned long)CKSEG1ADDR(phys_addr);
210 }
211
212 return __ioremap(offset, size, flags);
213
214#undef __IS_LOW512
215}
216
217/*
218 * ioremap - map bus memory into CPU space
219 * @offset: bus address of the memory
220 * @size: size of the resource to map
221 *
222 * ioremap performs a platform specific sequence of operations to
223 * make bus memory CPU accessible via the readb/readw/readl/writeb/
224 * writew/writel functions and the other mmio helpers. The returned
225 * address is not guaranteed to be usable directly as a virtual
226 * address.
227 */
228#define ioremap(offset, size) \
229 __ioremap_mode((offset), (size), _CACHE_UNCACHED)
230
231/*
232 * ioremap_nocache - map bus memory into CPU space
233 * @offset: bus address of the memory
234 * @size: size of the resource to map
235 *
236 * ioremap_nocache performs a platform specific sequence of operations to
237 * make bus memory CPU accessible via the readb/readw/readl/writeb/
238 * writew/writel functions and the other mmio helpers. The returned
239 * address is not guaranteed to be usable directly as a virtual
240 * address.
241 *
242 * This version of ioremap ensures that the memory is marked uncachable
243 * on the CPU as well as honouring existing caching rules from things like
244 * the PCI bus. Note that there are other caches and buffers on many
245 * busses. In paticular driver authors should read up on PCI writes
246 *
247 * It's useful if some control registers are in such an area and
248 * write combining or read caching is not desirable:
249 */
250#define ioremap_nocache(offset, size) \
251 __ioremap_mode((offset), (size), _CACHE_UNCACHED)
252
253/*
254 * ioremap_cachable - map bus memory into CPU space
255 * @offset: bus address of the memory
256 * @size: size of the resource to map
257 *
258 * ioremap_nocache performs a platform specific sequence of operations to
259 * make bus memory CPU accessible via the readb/readw/readl/writeb/
260 * writew/writel functions and the other mmio helpers. The returned
261 * address is not guaranteed to be usable directly as a virtual
262 * address.
263 *
264 * This version of ioremap ensures that the memory is marked cachable by
265 * the CPU. Also enables full write-combining. Useful for some
266 * memory-like regions on I/O busses.
267 */
268#define ioremap_cachable(offset, size) \
269 __ioremap_mode((offset), (size), _page_cachable_default)
270
271/*
272 * These two are MIPS specific ioremap variant. ioremap_cacheable_cow
273 * requests a cachable mapping, ioremap_uncached_accelerated requests a
274 * mapping using the uncached accelerated mode which isn't supported on
275 * all processors.
276 */
277#define ioremap_cacheable_cow(offset, size) \
278 __ioremap_mode((offset), (size), _CACHE_CACHABLE_COW)
279#define ioremap_uncached_accelerated(offset, size) \
280 __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED)
281
282static inline void iounmap(const volatile void __iomem *addr)
283{
284 if (plat_iounmap(addr))
285 return;
286
287#define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
288
289 if (cpu_has_64bit_addresses ||
290 (__builtin_constant_p(addr) && __IS_KSEG1(addr)))
291 return;
292
293 __iounmap(addr);
294
295#undef __IS_KSEG1
296}
297
298#define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \
299 \
300static inline void pfx##write##bwlq(type val, \
301 volatile void __iomem *mem) \
302{ \
303 volatile type *__mem; \
304 type __val; \
305 \
306 __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \
307 \
308 __val = pfx##ioswab##bwlq(__mem, val); \
309 \
310 if (sizeof(type) != sizeof(u64) || sizeof(u64) == sizeof(long)) \
311 *__mem = __val; \
312 else if (cpu_has_64bits) { \
313 unsigned long __flags; \
314 type __tmp; \
315 \
316 if (irq) \
317 local_irq_save(__flags); \
318 __asm__ __volatile__( \
319 ".set mips3" "\t\t# __writeq""\n\t" \
320 "dsll32 %L0, %L0, 0" "\n\t" \
321 "dsrl32 %L0, %L0, 0" "\n\t" \
322 "dsll32 %M0, %M0, 0" "\n\t" \
323 "or %L0, %L0, %M0" "\n\t" \
324 "sd %L0, %2" "\n\t" \
325 ".set mips0" "\n" \
326 : "=r" (__tmp) \
327 : "0" (__val), "m" (*__mem)); \
328 if (irq) \
329 local_irq_restore(__flags); \
330 } else \
331 BUG(); \
332} \
333 \
334static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
335{ \
336 volatile type *__mem; \
337 type __val; \
338 \
339 __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \
340 \
341 if (sizeof(type) != sizeof(u64) || sizeof(u64) == sizeof(long)) \
342 __val = *__mem; \
343 else if (cpu_has_64bits) { \
344 unsigned long __flags; \
345 \
346 if (irq) \
347 local_irq_save(__flags); \
348 __asm__ __volatile__( \
349 ".set mips3" "\t\t# __readq" "\n\t" \
350 "ld %L0, %1" "\n\t" \
351 "dsra32 %M0, %L0, 0" "\n\t" \
352 "sll %L0, %L0, 0" "\n\t" \
353 ".set mips0" "\n" \
354 : "=r" (__val) \
355 : "m" (*__mem)); \
356 if (irq) \
357 local_irq_restore(__flags); \
358 } else { \
359 __val = 0; \
360 BUG(); \
361 } \
362 \
363 return pfx##ioswab##bwlq(__mem, __val); \
364}
365
366#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p, slow) \
367 \
368static inline void pfx##out##bwlq##p(type val, unsigned long port) \
369{ \
370 volatile type *__addr; \
371 type __val; \
372 \
373 __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \
374 \
375 __val = pfx##ioswab##bwlq(__addr, val); \
376 \
377 /* Really, we want this to be atomic */ \
378 BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \
379 \
380 *__addr = __val; \
381 slow; \
382} \
383 \
384static inline type pfx##in##bwlq##p(unsigned long port) \
385{ \
386 volatile type *__addr; \
387 type __val; \
388 \
389 __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \
390 \
391 BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \
392 \
393 __val = *__addr; \
394 slow; \
395 \
396 return pfx##ioswab##bwlq(__addr, __val); \
397}
398
399#define __BUILD_MEMORY_PFX(bus, bwlq, type) \
400 \
401__BUILD_MEMORY_SINGLE(bus, bwlq, type, 1)
402
403#define BUILDIO_MEM(bwlq, type) \
404 \
405__BUILD_MEMORY_PFX(__raw_, bwlq, type) \
406__BUILD_MEMORY_PFX(, bwlq, type) \
407__BUILD_MEMORY_PFX(__mem_, bwlq, type) \
408
409BUILDIO_MEM(b, u8)
410BUILDIO_MEM(w, u16)
411BUILDIO_MEM(l, u32)
412BUILDIO_MEM(q, u64)
413
414#define __BUILD_IOPORT_PFX(bus, bwlq, type) \
415 __BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \
416 __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO)
417
418#define BUILDIO_IOPORT(bwlq, type) \
419 __BUILD_IOPORT_PFX(, bwlq, type) \
420 __BUILD_IOPORT_PFX(__mem_, bwlq, type)
421
422BUILDIO_IOPORT(b, u8)
423BUILDIO_IOPORT(w, u16)
424BUILDIO_IOPORT(l, u32)
425#ifdef CONFIG_64BIT
426BUILDIO_IOPORT(q, u64)
427#endif
428
429#define __BUILDIO(bwlq, type) \
430 \
431__BUILD_MEMORY_SINGLE(____raw_, bwlq, type, 0)
432
433__BUILDIO(q, u64)
434
435#define readb_relaxed readb
436#define readw_relaxed readw
437#define readl_relaxed readl
438#define readq_relaxed readq
439
440/*
441 * Some code tests for these symbols
442 */
443#define readq readq
444#define writeq writeq
445
446#define __BUILD_MEMORY_STRING(bwlq, type) \
447 \
448static inline void writes##bwlq(volatile void __iomem *mem, \
449 const void *addr, unsigned int count) \
450{ \
451 const volatile type *__addr = addr; \
452 \
453 while (count--) { \
454 __mem_write##bwlq(*__addr, mem); \
455 __addr++; \
456 } \
457} \
458 \
459static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \
460 unsigned int count) \
461{ \
462 volatile type *__addr = addr; \
463 \
464 while (count--) { \
465 *__addr = __mem_read##bwlq(mem); \
466 __addr++; \
467 } \
468}
469
470#define __BUILD_IOPORT_STRING(bwlq, type) \
471 \
472static inline void outs##bwlq(unsigned long port, const void *addr, \
473 unsigned int count) \
474{ \
475 const volatile type *__addr = addr; \
476 \
477 while (count--) { \
478 __mem_out##bwlq(*__addr, port); \
479 __addr++; \
480 } \
481} \
482 \
483static inline void ins##bwlq(unsigned long port, void *addr, \
484 unsigned int count) \
485{ \
486 volatile type *__addr = addr; \
487 \
488 while (count--) { \
489 *__addr = __mem_in##bwlq(port); \
490 __addr++; \
491 } \
492}
493
494#define BUILDSTRING(bwlq, type) \
495 \
496__BUILD_MEMORY_STRING(bwlq, type) \
497__BUILD_IOPORT_STRING(bwlq, type)
498
499BUILDSTRING(b, u8)
500BUILDSTRING(w, u16)
501BUILDSTRING(l, u32)
502#ifdef CONFIG_64BIT
503BUILDSTRING(q, u64)
504#endif
505
506
507/* Depends on MIPS II instruction set */
508#define mmiowb() asm volatile ("sync" ::: "memory")
509
510static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
511{
512 memset((void __force *) addr, val, count);
513}
514static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
515{
516 memcpy(dst, (void __force *) src, count);
517}
518static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
519{
520 memcpy((void __force *) dst, src, count);
521}
522
523/*
524 * The caches on some architectures aren't dma-coherent and have need to
525 * handle this in software. There are three types of operations that
526 * can be applied to dma buffers.
527 *
528 * - dma_cache_wback_inv(start, size) makes caches and coherent by
529 * writing the content of the caches back to memory, if necessary.
530 * The function also invalidates the affected part of the caches as
531 * necessary before DMA transfers from outside to memory.
532 * - dma_cache_wback(start, size) makes caches and coherent by
533 * writing the content of the caches back to memory, if necessary.
534 * The function also invalidates the affected part of the caches as
535 * necessary before DMA transfers from outside to memory.
536 * - dma_cache_inv(start, size) invalidates the affected parts of the
537 * caches. Dirty lines of the caches may be written back or simply
538 * be discarded. This operation is necessary before dma operations
539 * to the memory.
540 *
541 * This API used to be exported; it now is for arch code internal use only.
542 */
543#ifdef CONFIG_DMA_NONCOHERENT
544
545extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size);
546extern void (*_dma_cache_wback)(unsigned long start, unsigned long size);
547extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
548
549#define dma_cache_wback_inv(start, size) _dma_cache_wback_inv(start, size)
550#define dma_cache_wback(start, size) _dma_cache_wback(start, size)
551#define dma_cache_inv(start, size) _dma_cache_inv(start, size)
552
553#else /* Sane hardware */
554
555#define dma_cache_wback_inv(start,size) \
556 do { (void) (start); (void) (size); } while (0)
557#define dma_cache_wback(start,size) \
558 do { (void) (start); (void) (size); } while (0)
559#define dma_cache_inv(start,size) \
560 do { (void) (start); (void) (size); } while (0)
561
562#endif /* CONFIG_DMA_NONCOHERENT */
563
564/*
565 * Read a 32-bit register that requires a 64-bit read cycle on the bus.
566 * Avoid interrupt mucking, just adjust the address for 4-byte access.
567 * Assume the addresses are 8-byte aligned.
568 */
569#ifdef __MIPSEB__
570#define __CSR_32_ADJUST 4
571#else
572#define __CSR_32_ADJUST 0
573#endif
574
575#define csr_out32(v, a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v))
576#define csr_in32(a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST))
577
578/*
579 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
580 * access
581 */
582#define xlate_dev_mem_ptr(p) __va(p)
583
584/*
585 * Convert a virtual cached pointer to an uncached pointer
586 */
587#define xlate_dev_kmem_ptr(p) p
588
589#endif /* _ASM_IO_H */
diff --git a/include/asm-mips/ioctl.h b/include/asm-mips/ioctl.h
deleted file mode 100644
index 85067e248a83..000000000000
--- a/include/asm-mips/ioctl.h
+++ /dev/null
@@ -1,94 +0,0 @@
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 * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle
7 */
8#ifndef _ASM_IOCTL_H
9#define _ASM_IOCTL_H
10
11/*
12 * The original linux ioctl numbering scheme was just a general
13 * "anything goes" setup, where more or less random numbers were
14 * assigned. Sorry, I was clueless when I started out on this.
15 *
16 * On the alpha, we'll try to clean it up a bit, using a more sane
17 * ioctl numbering, and also trying to be compatible with OSF/1 in
18 * the process. I'd like to clean it up for the i386 as well, but
19 * it's so painful recognizing both the new and the old numbers..
20 *
21 * The same applies for for the MIPS ABI; in fact even the macros
22 * from Linux/Alpha fit almost perfectly.
23 */
24
25#define _IOC_NRBITS 8
26#define _IOC_TYPEBITS 8
27#define _IOC_SIZEBITS 13
28#define _IOC_DIRBITS 3
29
30#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
31#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
32#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
33#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
34
35#define _IOC_NRSHIFT 0
36#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
37#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
38#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
39
40/*
41 * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
42 * And this turns out useful to catch old ioctl numbers in header
43 * files for us.
44 */
45#define _IOC_NONE 1U
46#define _IOC_READ 2U
47#define _IOC_WRITE 4U
48
49/*
50 * The following are included for compatibility
51 */
52#define _IOC_VOID 0x20000000
53#define _IOC_OUT 0x40000000
54#define _IOC_IN 0x80000000
55#define _IOC_INOUT (IOC_IN|IOC_OUT)
56
57#define _IOC(dir, type, nr, size) \
58 (((dir) << _IOC_DIRSHIFT) | \
59 ((type) << _IOC_TYPESHIFT) | \
60 ((nr) << _IOC_NRSHIFT) | \
61 ((size) << _IOC_SIZESHIFT))
62
63/* provoke compile error for invalid uses of size argument */
64extern unsigned int __invalid_size_argument_for_IOC;
65#define _IOC_TYPECHECK(t) \
66 ((sizeof(t) == sizeof(t[1]) && \
67 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
68 sizeof(t) : __invalid_size_argument_for_IOC)
69
70/* used to create numbers */
71#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
72#define _IOR(type, nr, size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
73#define _IOW(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
74#define _IOWR(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
75#define _IOR_BAD(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof(size))
76#define _IOW_BAD(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size))
77#define _IOWR_BAD(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), sizeof(size))
78
79
80/* used to decode them.. */
81#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
82#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
83#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
84#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
85
86/* ...and for the drivers/sound files... */
87
88#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
89#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
90#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
91#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
92#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
93
94#endif /* _ASM_IOCTL_H */
diff --git a/include/asm-mips/ioctls.h b/include/asm-mips/ioctls.h
deleted file mode 100644
index 3f04a995ec54..000000000000
--- a/include/asm-mips/ioctls.h
+++ /dev/null
@@ -1,109 +0,0 @@
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 * Copyright (C) 1995, 1996, 2001 Ralf Baechle
7 * Copyright (C) 2001 MIPS Technologies, Inc.
8 */
9#ifndef __ASM_IOCTLS_H
10#define __ASM_IOCTLS_H
11
12#include <asm/ioctl.h>
13
14#define TCGETA 0x5401
15#define TCSETA 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
16#define TCSETAW 0x5403
17#define TCSETAF 0x5404
18
19#define TCSBRK 0x5405
20#define TCXONC 0x5406
21#define TCFLSH 0x5407
22
23#define TCGETS 0x540d
24#define TCSETS 0x540e
25#define TCSETSW 0x540f
26#define TCSETSF 0x5410
27
28#define TIOCEXCL 0x740d /* set exclusive use of tty */
29#define TIOCNXCL 0x740e /* reset exclusive use of tty */
30#define TIOCOUTQ 0x7472 /* output queue size */
31#define TIOCSTI 0x5472 /* simulate terminal input */
32#define TIOCMGET 0x741d /* get all modem bits */
33#define TIOCMBIS 0x741b /* bis modem bits */
34#define TIOCMBIC 0x741c /* bic modem bits */
35#define TIOCMSET 0x741a /* set all modem bits */
36#define TIOCPKT 0x5470 /* pty: set/clear packet mode */
37#define TIOCPKT_DATA 0x00 /* data packet */
38#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
39#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
40#define TIOCPKT_STOP 0x04 /* stop output */
41#define TIOCPKT_START 0x08 /* start output */
42#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
43#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
44/* #define TIOCPKT_IOCTL 0x40 state change of pty driver */
45#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
46#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
47#define TIOCNOTTY 0x5471 /* void tty association */
48#define TIOCSETD 0x7401
49#define TIOCGETD 0x7400
50
51#define FIOCLEX 0x6601
52#define FIONCLEX 0x6602
53#define FIOASYNC 0x667d
54#define FIONBIO 0x667e
55#define FIOQSIZE 0x667f
56
57#define TIOCGLTC 0x7474 /* get special local chars */
58#define TIOCSLTC 0x7475 /* set special local chars */
59#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
60#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
61#define TIOCCONS _IOW('t', 120, int) /* become virtual console */
62
63#define FIONREAD 0x467f
64#define TIOCINQ FIONREAD
65
66#define TIOCGETP 0x7408
67#define TIOCSETP 0x7409
68#define TIOCSETN 0x740a /* TIOCSETP wo flush */
69
70/* #define TIOCSETA _IOW('t', 20, struct termios) set termios struct */
71/* #define TIOCSETAW _IOW('t', 21, struct termios) drain output, set */
72/* #define TIOCSETAF _IOW('t', 22, struct termios) drn out, fls in, set */
73/* #define TIOCGETD _IOR('t', 26, int) get line discipline */
74/* #define TIOCSETD _IOW('t', 27, int) set line discipline */
75 /* 127-124 compat */
76
77#define TIOCSBRK 0x5427 /* BSD compatibility */
78#define TIOCCBRK 0x5428 /* BSD compatibility */
79#define TIOCGSID 0x7416 /* Return the session ID of FD */
80#define TCGETS2 _IOR('T', 0x2A, struct termios2)
81#define TCSETS2 _IOW('T', 0x2B, struct termios2)
82#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
83#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
84#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
85#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
86
87/* I hope the range from 0x5480 on is free ... */
88#define TIOCSCTTY 0x5480 /* become controlling tty */
89#define TIOCGSOFTCAR 0x5481
90#define TIOCSSOFTCAR 0x5482
91#define TIOCLINUX 0x5483
92#define TIOCGSERIAL 0x5484
93#define TIOCSSERIAL 0x5485
94#define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */
95#define TIOCSERCONFIG 0x5488
96#define TIOCSERGWILD 0x5489
97#define TIOCSERSWILD 0x548a
98#define TIOCGLCKTRMIOS 0x548b
99#define TIOCSLCKTRMIOS 0x548c
100#define TIOCSERGSTRUCT 0x548d /* For debugging only */
101#define TIOCSERGETLSR 0x548e /* Get line status register */
102#define TIOCSERGETMULTI 0x548f /* Get multiport config */
103#define TIOCSERSETMULTI 0x5490 /* Set multiport config */
104#define TIOCMIWAIT 0x5491 /* wait for a change on serial input line(s) */
105#define TIOCGICOUNT 0x5492 /* read serial port inline interrupt counts */
106#define TIOCGHAYESESP 0x5493 /* Get Hayes ESP configuration */
107#define TIOCSHAYESESP 0x5494 /* Set Hayes ESP configuration */
108
109#endif /* __ASM_IOCTLS_H */
diff --git a/include/asm-mips/ip32/crime.h b/include/asm-mips/ip32/crime.h
deleted file mode 100644
index 7c36b0e5b1c6..000000000000
--- a/include/asm-mips/ip32/crime.h
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * Definitions for the SGI CRIME (CPU, Rendering, Interconnect and Memory
3 * Engine)
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2000 Harald Koerfgen
10 */
11
12#ifndef __ASM_CRIME_H__
13#define __ASM_CRIME_H__
14
15/*
16 * Address map
17 */
18#define CRIME_BASE 0x14000000 /* physical */
19
20struct sgi_crime {
21 volatile unsigned long id;
22#define CRIME_ID_MASK 0xff
23#define CRIME_ID_IDBITS 0xf0
24#define CRIME_ID_IDVALUE 0xa0
25#define CRIME_ID_REV 0x0f
26#define CRIME_REV_PETTY 0x00
27#define CRIME_REV_11 0x11
28#define CRIME_REV_13 0x13
29#define CRIME_REV_14 0x14
30
31 volatile unsigned long control;
32#define CRIME_CONTROL_MASK 0x3fff
33#define CRIME_CONTROL_TRITON_SYSADC 0x2000
34#define CRIME_CONTROL_CRIME_SYSADC 0x1000
35#define CRIME_CONTROL_HARD_RESET 0x0800
36#define CRIME_CONTROL_SOFT_RESET 0x0400
37#define CRIME_CONTROL_DOG_ENA 0x0200
38#define CRIME_CONTROL_ENDIANESS 0x0100
39#define CRIME_CONTROL_ENDIAN_BIG 0x0100
40#define CRIME_CONTROL_ENDIAN_LITTLE 0x0000
41#define CRIME_CONTROL_CQUEUE_HWM 0x000f
42#define CRIME_CONTROL_CQUEUE_SHFT 0
43#define CRIME_CONTROL_WBUF_HWM 0x00f0
44#define CRIME_CONTROL_WBUF_SHFT 8
45
46 volatile unsigned long istat;
47 volatile unsigned long imask;
48 volatile unsigned long soft_int;
49 volatile unsigned long hard_int;
50#define MACE_VID_IN1_INT BIT(0)
51#define MACE_VID_IN2_INT BIT(1)
52#define MACE_VID_OUT_INT BIT(2)
53#define MACE_ETHERNET_INT BIT(3)
54#define MACE_SUPERIO_INT BIT(4)
55#define MACE_MISC_INT BIT(5)
56#define MACE_AUDIO_INT BIT(6)
57#define MACE_PCI_BRIDGE_INT BIT(7)
58#define MACEPCI_SCSI0_INT BIT(8)
59#define MACEPCI_SCSI1_INT BIT(9)
60#define MACEPCI_SLOT0_INT BIT(10)
61#define MACEPCI_SLOT1_INT BIT(11)
62#define MACEPCI_SLOT2_INT BIT(12)
63#define MACEPCI_SHARED0_INT BIT(13)
64#define MACEPCI_SHARED1_INT BIT(14)
65#define MACEPCI_SHARED2_INT BIT(15)
66#define CRIME_GBE0_INT BIT(16)
67#define CRIME_GBE1_INT BIT(17)
68#define CRIME_GBE2_INT BIT(18)
69#define CRIME_GBE3_INT BIT(19)
70#define CRIME_CPUERR_INT BIT(20)
71#define CRIME_MEMERR_INT BIT(21)
72#define CRIME_RE_EMPTY_E_INT BIT(22)
73#define CRIME_RE_FULL_E_INT BIT(23)
74#define CRIME_RE_IDLE_E_INT BIT(24)
75#define CRIME_RE_EMPTY_L_INT BIT(25)
76#define CRIME_RE_FULL_L_INT BIT(26)
77#define CRIME_RE_IDLE_L_INT BIT(27)
78#define CRIME_SOFT0_INT BIT(28)
79#define CRIME_SOFT1_INT BIT(29)
80#define CRIME_SOFT2_INT BIT(30)
81#define CRIME_SYSCORERR_INT CRIME_SOFT2_INT
82#define CRIME_VICE_INT BIT(31)
83/* Masks for deciding who handles the interrupt */
84#define CRIME_MACE_INT_MASK 0x8f
85#define CRIME_MACEISA_INT_MASK 0x70
86#define CRIME_MACEPCI_INT_MASK 0xff00
87#define CRIME_CRIME_INT_MASK 0xffff0000
88
89 volatile unsigned long watchdog;
90#define CRIME_DOG_POWER_ON_RESET 0x00010000
91#define CRIME_DOG_WARM_RESET 0x00080000
92#define CRIME_DOG_TIMEOUT (CRIME_DOG_POWER_ON_RESET|CRIME_DOG_WARM_RESET)
93#define CRIME_DOG_VALUE 0x00007fff
94
95 volatile unsigned long timer;
96#define CRIME_MASTER_FREQ 66666500 /* Crime upcounter frequency */
97#define CRIME_NS_PER_TICK 15 /* for delay_calibrate */
98
99 volatile unsigned long cpu_error_addr;
100#define CRIME_CPU_ERROR_ADDR_MASK 0x3ffffffff
101
102 volatile unsigned long cpu_error_stat;
103#define CRIME_CPU_ERROR_MASK 0x7 /* cpu error stat is 3 bits */
104#define CRIME_CPU_ERROR_CPU_ILL_ADDR 0x4
105#define CRIME_CPU_ERROR_VICE_WRT_PRTY 0x2
106#define CRIME_CPU_ERROR_CPU_WRT_PRTY 0x1
107
108 unsigned long _pad0[54];
109
110 volatile unsigned long mc_ctrl;
111 volatile unsigned long bank_ctrl[8];
112#define CRIME_MEM_BANK_CONTROL_MASK 0x11f /* 9 bits 7:5 reserved */
113#define CRIME_MEM_BANK_CONTROL_ADDR 0x01f
114#define CRIME_MEM_BANK_CONTROL_SDRAM_SIZE 0x100
115#define CRIME_MAXBANKS 8
116
117 volatile unsigned long mem_ref_counter;
118#define CRIME_MEM_REF_COUNTER_MASK 0x3ff /* 10bit */
119
120 volatile unsigned long mem_error_stat;
121#define CRIME_MEM_ERROR_STAT_MASK 0x0ff7ffff /* 28-bit register */
122#define CRIME_MEM_ERROR_MACE_ID 0x0000007f
123#define CRIME_MEM_ERROR_MACE_ACCESS 0x00000080
124#define CRIME_MEM_ERROR_RE_ID 0x00007f00
125#define CRIME_MEM_ERROR_RE_ACCESS 0x00008000
126#define CRIME_MEM_ERROR_GBE_ACCESS 0x00010000
127#define CRIME_MEM_ERROR_VICE_ACCESS 0x00020000
128#define CRIME_MEM_ERROR_CPU_ACCESS 0x00040000
129#define CRIME_MEM_ERROR_RESERVED 0x00080000
130#define CRIME_MEM_ERROR_SOFT_ERR 0x00100000
131#define CRIME_MEM_ERROR_HARD_ERR 0x00200000
132#define CRIME_MEM_ERROR_MULTIPLE 0x00400000
133#define CRIME_MEM_ERROR_ECC 0x01800000
134#define CRIME_MEM_ERROR_MEM_ECC_RD 0x00800000
135#define CRIME_MEM_ERROR_MEM_ECC_RMW 0x01000000
136#define CRIME_MEM_ERROR_INV 0x0e000000
137#define CRIME_MEM_ERROR_INV_MEM_ADDR_RD 0x02000000
138#define CRIME_MEM_ERROR_INV_MEM_ADDR_WR 0x04000000
139#define CRIME_MEM_ERROR_INV_MEM_ADDR_RMW 0x08000000
140
141 volatile unsigned long mem_error_addr;
142#define CRIME_MEM_ERROR_ADDR_MASK 0x3fffffff
143
144 volatile unsigned long mem_ecc_syn;
145#define CRIME_MEM_ERROR_ECC_SYN_MASK 0xffffffff
146
147 volatile unsigned long mem_ecc_chk;
148#define CRIME_MEM_ERROR_ECC_CHK_MASK 0xffffffff
149
150 volatile unsigned long mem_ecc_repl;
151#define CRIME_MEM_ERROR_ECC_REPL_MASK 0xffffffff
152};
153
154extern struct sgi_crime __iomem *crime;
155
156#define CRIME_HI_MEM_BASE 0x40000000 /* this is where whole 1G of RAM is mapped */
157
158#endif /* __ASM_CRIME_H__ */
diff --git a/include/asm-mips/ip32/ip32_ints.h b/include/asm-mips/ip32/ip32_ints.h
deleted file mode 100644
index 85bc5302bce0..000000000000
--- a/include/asm-mips/ip32/ip32_ints.h
+++ /dev/null
@@ -1,114 +0,0 @@
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 * Copyright (C) 2000 Harald Koerfgen
7 */
8
9#ifndef __ASM_IP32_INTS_H
10#define __ASM_IP32_INTS_H
11
12#include <asm/irq.h>
13
14/*
15 * This list reflects the assignment of interrupt numbers to
16 * interrupting events. Order is fairly irrelevant to handling
17 * priority. This differs from irix.
18 */
19
20enum ip32_irq_no {
21 /*
22 * CPU interrupts are 0 ... 7
23 */
24
25 CRIME_IRQ_BASE = MIPS_CPU_IRQ_BASE + 8,
26
27 /*
28 * MACE
29 */
30 MACE_VID_IN1_IRQ = CRIME_IRQ_BASE,
31 MACE_VID_IN2_IRQ,
32 MACE_VID_OUT_IRQ,
33 MACE_ETHERNET_IRQ,
34 /* SUPERIO, MISC, and AUDIO are MACEISA */
35 __MACE_SUPERIO,
36 __MACE_MISC,
37 __MACE_AUDIO,
38 MACE_PCI_BRIDGE_IRQ,
39
40 /*
41 * MACEPCI
42 */
43 MACEPCI_SCSI0_IRQ,
44 MACEPCI_SCSI1_IRQ,
45 MACEPCI_SLOT0_IRQ,
46 MACEPCI_SLOT1_IRQ,
47 MACEPCI_SLOT2_IRQ,
48 MACEPCI_SHARED0_IRQ,
49 MACEPCI_SHARED1_IRQ,
50 MACEPCI_SHARED2_IRQ,
51
52 /*
53 * CRIME
54 */
55 CRIME_GBE0_IRQ,
56 CRIME_GBE1_IRQ,
57 CRIME_GBE2_IRQ,
58 CRIME_GBE3_IRQ,
59 CRIME_CPUERR_IRQ,
60 CRIME_MEMERR_IRQ,
61 CRIME_RE_EMPTY_E_IRQ,
62 CRIME_RE_FULL_E_IRQ,
63 CRIME_RE_IDLE_E_IRQ,
64 CRIME_RE_EMPTY_L_IRQ,
65 CRIME_RE_FULL_L_IRQ,
66 CRIME_RE_IDLE_L_IRQ,
67 CRIME_SOFT0_IRQ,
68 CRIME_SOFT1_IRQ,
69 CRIME_SOFT2_IRQ,
70 CRIME_SYSCORERR_IRQ = CRIME_SOFT2_IRQ,
71 CRIME_VICE_IRQ,
72
73 /*
74 * MACEISA
75 */
76 MACEISA_AUDIO_SW_IRQ,
77 MACEISA_AUDIO_SC_IRQ,
78 MACEISA_AUDIO1_DMAT_IRQ,
79 MACEISA_AUDIO1_OF_IRQ,
80 MACEISA_AUDIO2_DMAT_IRQ,
81 MACEISA_AUDIO2_MERR_IRQ,
82 MACEISA_AUDIO3_DMAT_IRQ,
83 MACEISA_AUDIO3_MERR_IRQ,
84 MACEISA_RTC_IRQ,
85 MACEISA_KEYB_IRQ,
86 /* MACEISA_KEYB_POLL is not an IRQ */
87 __MACEISA_KEYB_POLL,
88 MACEISA_MOUSE_IRQ,
89 /* MACEISA_MOUSE_POLL is not an IRQ */
90 __MACEISA_MOUSE_POLL,
91 MACEISA_TIMER0_IRQ,
92 MACEISA_TIMER1_IRQ,
93 MACEISA_TIMER2_IRQ,
94 MACEISA_PARALLEL_IRQ,
95 MACEISA_PAR_CTXA_IRQ,
96 MACEISA_PAR_CTXB_IRQ,
97 MACEISA_PAR_MERR_IRQ,
98 MACEISA_SERIAL1_IRQ,
99 MACEISA_SERIAL1_TDMAT_IRQ,
100 MACEISA_SERIAL1_TDMAPR_IRQ,
101 MACEISA_SERIAL1_TDMAME_IRQ,
102 MACEISA_SERIAL1_RDMAT_IRQ,
103 MACEISA_SERIAL1_RDMAOR_IRQ,
104 MACEISA_SERIAL2_IRQ,
105 MACEISA_SERIAL2_TDMAT_IRQ,
106 MACEISA_SERIAL2_TDMAPR_IRQ,
107 MACEISA_SERIAL2_TDMAME_IRQ,
108 MACEISA_SERIAL2_RDMAT_IRQ,
109 MACEISA_SERIAL2_RDMAOR_IRQ,
110
111 IP32_IRQ_MAX = MACEISA_SERIAL2_RDMAOR_IRQ
112};
113
114#endif /* __ASM_IP32_INTS_H */
diff --git a/include/asm-mips/ip32/mace.h b/include/asm-mips/ip32/mace.h
deleted file mode 100644
index d08d7c672139..000000000000
--- a/include/asm-mips/ip32/mace.h
+++ /dev/null
@@ -1,365 +0,0 @@
1/*
2 * Definitions for the SGI MACE (Multimedia, Audio and Communications Engine)
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 (C) 2000 Harald Koerfgen
9 * Copyright (C) 2004 Ladislav Michl
10 */
11
12#ifndef __ASM_MACE_H__
13#define __ASM_MACE_H__
14
15/*
16 * Address map
17 */
18#define MACE_BASE 0x1f000000 /* physical */
19
20/*
21 * PCI interface
22 */
23struct mace_pci {
24 volatile unsigned int error_addr;
25 volatile unsigned int error;
26#define MACEPCI_ERROR_MASTER_ABORT BIT(31)
27#define MACEPCI_ERROR_TARGET_ABORT BIT(30)
28#define MACEPCI_ERROR_DATA_PARITY_ERR BIT(29)
29#define MACEPCI_ERROR_RETRY_ERR BIT(28)
30#define MACEPCI_ERROR_ILLEGAL_CMD BIT(27)
31#define MACEPCI_ERROR_SYSTEM_ERR BIT(26)
32#define MACEPCI_ERROR_INTERRUPT_TEST BIT(25)
33#define MACEPCI_ERROR_PARITY_ERR BIT(24)
34#define MACEPCI_ERROR_OVERRUN BIT(23)
35#define MACEPCI_ERROR_RSVD BIT(22)
36#define MACEPCI_ERROR_MEMORY_ADDR BIT(21)
37#define MACEPCI_ERROR_CONFIG_ADDR BIT(20)
38#define MACEPCI_ERROR_MASTER_ABORT_ADDR_VALID BIT(19)
39#define MACEPCI_ERROR_TARGET_ABORT_ADDR_VALID BIT(18)
40#define MACEPCI_ERROR_DATA_PARITY_ADDR_VALID BIT(17)
41#define MACEPCI_ERROR_RETRY_ADDR_VALID BIT(16)
42#define MACEPCI_ERROR_SIG_TABORT BIT(4)
43#define MACEPCI_ERROR_DEVSEL_MASK 0xc0
44#define MACEPCI_ERROR_DEVSEL_FAST 0
45#define MACEPCI_ERROR_DEVSEL_MED 0x40
46#define MACEPCI_ERROR_DEVSEL_SLOW 0x80
47#define MACEPCI_ERROR_FBB BIT(1)
48#define MACEPCI_ERROR_66MHZ BIT(0)
49 volatile unsigned int control;
50#define MACEPCI_CONTROL_INT(x) BIT(x)
51#define MACEPCI_CONTROL_INT_MASK 0xff
52#define MACEPCI_CONTROL_SERR_ENA BIT(8)
53#define MACEPCI_CONTROL_ARB_N6 BIT(9)
54#define MACEPCI_CONTROL_PARITY_ERR BIT(10)
55#define MACEPCI_CONTROL_MRMRA_ENA BIT(11)
56#define MACEPCI_CONTROL_ARB_N3 BIT(12)
57#define MACEPCI_CONTROL_ARB_N4 BIT(13)
58#define MACEPCI_CONTROL_ARB_N5 BIT(14)
59#define MACEPCI_CONTROL_PARK_LIU BIT(15)
60#define MACEPCI_CONTROL_INV_INT(x) BIT(16+x)
61#define MACEPCI_CONTROL_INV_INT_MASK 0x00ff0000
62#define MACEPCI_CONTROL_OVERRUN_INT BIT(24)
63#define MACEPCI_CONTROL_PARITY_INT BIT(25)
64#define MACEPCI_CONTROL_SERR_INT BIT(26)
65#define MACEPCI_CONTROL_IT_INT BIT(27)
66#define MACEPCI_CONTROL_RE_INT BIT(28)
67#define MACEPCI_CONTROL_DPED_INT BIT(29)
68#define MACEPCI_CONTROL_TAR_INT BIT(30)
69#define MACEPCI_CONTROL_MAR_INT BIT(31)
70 volatile unsigned int rev;
71 unsigned int _pad[0xcf8/4 - 4];
72 volatile unsigned int config_addr;
73 union {
74 volatile unsigned char b[4];
75 volatile unsigned short w[2];
76 volatile unsigned int l;
77 } config_data;
78};
79#define MACEPCI_LOW_MEMORY 0x1a000000
80#define MACEPCI_LOW_IO 0x18000000
81#define MACEPCI_SWAPPED_VIEW 0
82#define MACEPCI_NATIVE_VIEW 0x40000000
83#define MACEPCI_IO 0x80000000
84#define MACEPCI_HI_MEMORY 0x280000000
85#define MACEPCI_HI_IO 0x100000000
86
87/*
88 * Video interface
89 */
90struct mace_video {
91 unsigned long xxx; /* later... */
92};
93
94/*
95 * Ethernet interface
96 */
97struct mace_ethernet {
98 volatile unsigned long mac_ctrl;
99 volatile unsigned long int_stat;
100 volatile unsigned long dma_ctrl;
101 volatile unsigned long timer;
102 volatile unsigned long tx_int_al;
103 volatile unsigned long rx_int_al;
104 volatile unsigned long tx_info;
105 volatile unsigned long tx_info_al;
106 volatile unsigned long rx_buff;
107 volatile unsigned long rx_buff_al1;
108 volatile unsigned long rx_buff_al2;
109 volatile unsigned long diag;
110 volatile unsigned long phy_data;
111 volatile unsigned long phy_regs;
112 volatile unsigned long phy_trans_go;
113 volatile unsigned long backoff_seed;
114 /*===================================*/
115 volatile unsigned long imq_reserved[4];
116 volatile unsigned long mac_addr;
117 volatile unsigned long mac_addr2;
118 volatile unsigned long mcast_filter;
119 volatile unsigned long tx_ring_base;
120 /* Following are read-only registers for debugging */
121 volatile unsigned long tx_pkt1_hdr;
122 volatile unsigned long tx_pkt1_ptr[3];
123 volatile unsigned long tx_pkt2_hdr;
124 volatile unsigned long tx_pkt2_ptr[3];
125 /*===================================*/
126 volatile unsigned long rx_fifo;
127};
128
129/*
130 * Peripherals
131 */
132
133/* Audio registers */
134struct mace_audio {
135 volatile unsigned long control;
136 volatile unsigned long codec_control; /* codec status control */
137 volatile unsigned long codec_mask; /* codec status input mask */
138 volatile unsigned long codec_read; /* codec status read data */
139 struct {
140 volatile unsigned long control; /* channel control */
141 volatile unsigned long read_ptr; /* channel read pointer */
142 volatile unsigned long write_ptr; /* channel write pointer */
143 volatile unsigned long depth; /* channel depth */
144 } chan[3];
145};
146
147
148/* register definitions for parallel port DMA */
149struct mace_parport {
150 /* 0 - do nothing,
151 * 1 - pulse terminal count to the device after buffer is drained */
152#define MACEPAR_CONTEXT_LASTFLAG BIT(63)
153 /* Should not cross 4K page boundary */
154#define MACEPAR_CONTEXT_DATA_BOUND 0x0000000000001000UL
155#define MACEPAR_CONTEXT_DATALEN_MASK 0x00000fff00000000UL
156#define MACEPAR_CONTEXT_DATALEN_SHIFT 32
157 /* Can be arbitrarily aligned on any byte boundary on output,
158 * 64 byte aligned on input */
159#define MACEPAR_CONTEXT_BASEADDR_MASK 0x00000000ffffffffUL
160 volatile u64 context_a;
161 volatile u64 context_b;
162 /* 0 - mem->device, 1 - device->mem */
163#define MACEPAR_CTLSTAT_DIRECTION BIT(0)
164 /* 0 - channel frozen, 1 - channel enabled */
165#define MACEPAR_CTLSTAT_ENABLE BIT(1)
166 /* 0 - channel active, 1 - complete channel reset */
167#define MACEPAR_CTLSTAT_RESET BIT(2)
168#define MACEPAR_CTLSTAT_CTXB_VALID BIT(3)
169#define MACEPAR_CTLSTAT_CTXA_VALID BIT(4)
170 volatile u64 cntlstat; /* Control/Status register */
171#define MACEPAR_DIAG_CTXINUSE BIT(0)
172 /* 1 - Dma engine is enabled and processing something */
173#define MACEPAR_DIAG_DMACTIVE BIT(1)
174 /* Counter of bytes left */
175#define MACEPAR_DIAG_CTRMASK 0x0000000000003ffcUL
176#define MACEPAR_DIAG_CTRSHIFT 2
177 volatile u64 diagnostic; /* RO: diagnostic register */
178};
179
180/* ISA Control and DMA registers */
181struct mace_isactrl {
182 volatile unsigned long ringbase;
183#define MACEISA_RINGBUFFERS_SIZE (8 * 4096)
184
185 volatile unsigned long misc;
186#define MACEISA_FLASH_WE BIT(0) /* 1=> Enable FLASH writes */
187#define MACEISA_PWD_CLEAR BIT(1) /* 1=> PWD CLEAR jumper detected */
188#define MACEISA_NIC_DEASSERT BIT(2)
189#define MACEISA_NIC_DATA BIT(3)
190#define MACEISA_LED_RED BIT(4) /* 0=> Illuminate red LED */
191#define MACEISA_LED_GREEN BIT(5) /* 0=> Illuminate green LED */
192#define MACEISA_DP_RAM_ENABLE BIT(6)
193
194 volatile unsigned long istat;
195 volatile unsigned long imask;
196#define MACEISA_AUDIO_SW_INT BIT(0)
197#define MACEISA_AUDIO_SC_INT BIT(1)
198#define MACEISA_AUDIO1_DMAT_INT BIT(2)
199#define MACEISA_AUDIO1_OF_INT BIT(3)
200#define MACEISA_AUDIO2_DMAT_INT BIT(4)
201#define MACEISA_AUDIO2_MERR_INT BIT(5)
202#define MACEISA_AUDIO3_DMAT_INT BIT(6)
203#define MACEISA_AUDIO3_MERR_INT BIT(7)
204#define MACEISA_RTC_INT BIT(8)
205#define MACEISA_KEYB_INT BIT(9)
206#define MACEISA_KEYB_POLL_INT BIT(10)
207#define MACEISA_MOUSE_INT BIT(11)
208#define MACEISA_MOUSE_POLL_INT BIT(12)
209#define MACEISA_TIMER0_INT BIT(13)
210#define MACEISA_TIMER1_INT BIT(14)
211#define MACEISA_TIMER2_INT BIT(15)
212#define MACEISA_PARALLEL_INT BIT(16)
213#define MACEISA_PAR_CTXA_INT BIT(17)
214#define MACEISA_PAR_CTXB_INT BIT(18)
215#define MACEISA_PAR_MERR_INT BIT(19)
216#define MACEISA_SERIAL1_INT BIT(20)
217#define MACEISA_SERIAL1_TDMAT_INT BIT(21)
218#define MACEISA_SERIAL1_TDMAPR_INT BIT(22)
219#define MACEISA_SERIAL1_TDMAME_INT BIT(23)
220#define MACEISA_SERIAL1_RDMAT_INT BIT(24)
221#define MACEISA_SERIAL1_RDMAOR_INT BIT(25)
222#define MACEISA_SERIAL2_INT BIT(26)
223#define MACEISA_SERIAL2_TDMAT_INT BIT(27)
224#define MACEISA_SERIAL2_TDMAPR_INT BIT(28)
225#define MACEISA_SERIAL2_TDMAME_INT BIT(29)
226#define MACEISA_SERIAL2_RDMAT_INT BIT(30)
227#define MACEISA_SERIAL2_RDMAOR_INT BIT(31)
228
229 volatile unsigned long _pad[0x2000/8 - 4];
230
231 volatile unsigned long dp_ram[0x400];
232 struct mace_parport parport;
233};
234
235/* Keyboard & Mouse registers
236 * -> drivers/input/serio/maceps2.c */
237struct mace_ps2port {
238 volatile unsigned long tx;
239 volatile unsigned long rx;
240 volatile unsigned long control;
241 volatile unsigned long status;
242};
243
244struct mace_ps2 {
245 struct mace_ps2port keyb;
246 struct mace_ps2port mouse;
247};
248
249/* I2C registers
250 * -> drivers/i2c/algos/i2c-algo-sgi.c */
251struct mace_i2c {
252 volatile unsigned long config;
253#define MACEI2C_RESET BIT(0)
254#define MACEI2C_FAST BIT(1)
255#define MACEI2C_DATA_OVERRIDE BIT(2)
256#define MACEI2C_CLOCK_OVERRIDE BIT(3)
257#define MACEI2C_DATA_STATUS BIT(4)
258#define MACEI2C_CLOCK_STATUS BIT(5)
259 volatile unsigned long control;
260 volatile unsigned long data;
261};
262
263/* Timer registers */
264typedef union {
265 volatile unsigned long ust_msc;
266 struct reg {
267 volatile unsigned int ust;
268 volatile unsigned int msc;
269 } reg;
270} timer_reg;
271
272struct mace_timers {
273 volatile unsigned long ust;
274#define MACE_UST_PERIOD_NS 960
275
276 volatile unsigned long compare1;
277 volatile unsigned long compare2;
278 volatile unsigned long compare3;
279
280 timer_reg audio_in;
281 timer_reg audio_out1;
282 timer_reg audio_out2;
283 timer_reg video_in1;
284 timer_reg video_in2;
285 timer_reg video_out;
286};
287
288struct mace_perif {
289 struct mace_audio audio;
290 char _pad0[0x10000 - sizeof(struct mace_audio)];
291
292 struct mace_isactrl ctrl;
293 char _pad1[0x10000 - sizeof(struct mace_isactrl)];
294
295 struct mace_ps2 ps2;
296 char _pad2[0x10000 - sizeof(struct mace_ps2)];
297
298 struct mace_i2c i2c;
299 char _pad3[0x10000 - sizeof(struct mace_i2c)];
300
301 struct mace_timers timers;
302 char _pad4[0x10000 - sizeof(struct mace_timers)];
303};
304
305
306/*
307 * ISA peripherals
308 */
309
310/* Parallel port */
311struct mace_parallel {
312};
313
314struct mace_ecp1284 { /* later... */
315};
316
317/* Serial port */
318struct mace_serial {
319 volatile unsigned long xxx; /* later... */
320};
321
322struct mace_isa {
323 struct mace_parallel parallel;
324 char _pad1[0x8000 - sizeof(struct mace_parallel)];
325
326 struct mace_ecp1284 ecp1284;
327 char _pad2[0x8000 - sizeof(struct mace_ecp1284)];
328
329 struct mace_serial serial1;
330 char _pad3[0x8000 - sizeof(struct mace_serial)];
331
332 struct mace_serial serial2;
333 char _pad4[0x8000 - sizeof(struct mace_serial)];
334
335 volatile unsigned char rtc[0x10000];
336};
337
338struct sgi_mace {
339 char _reserved[0x80000];
340
341 struct mace_pci pci;
342 char _pad0[0x80000 - sizeof(struct mace_pci)];
343
344 struct mace_video video_in1;
345 char _pad1[0x80000 - sizeof(struct mace_video)];
346
347 struct mace_video video_in2;
348 char _pad2[0x80000 - sizeof(struct mace_video)];
349
350 struct mace_video video_out;
351 char _pad3[0x80000 - sizeof(struct mace_video)];
352
353 struct mace_ethernet eth;
354 char _pad4[0x80000 - sizeof(struct mace_ethernet)];
355
356 struct mace_perif perif;
357 char _pad5[0x80000 - sizeof(struct mace_perif)];
358
359 struct mace_isa isa;
360 char _pad6[0x80000 - sizeof(struct mace_isa)];
361};
362
363extern struct sgi_mace __iomem *mace;
364
365#endif /* __ASM_MACE_H__ */
diff --git a/include/asm-mips/ipcbuf.h b/include/asm-mips/ipcbuf.h
deleted file mode 100644
index d47d08f264e7..000000000000
--- a/include/asm-mips/ipcbuf.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef _ASM_IPCBUF_H
2#define _ASM_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for alpha 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 * - 32-bit seq
11 * - 2 miscellaneous 64-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid_t uid;
18 __kernel_gid_t gid;
19 __kernel_uid_t cuid;
20 __kernel_gid_t cgid;
21 __kernel_mode_t mode;
22 unsigned short seq;
23 unsigned short __pad1;
24 unsigned long __unused1;
25 unsigned long __unused2;
26};
27
28#endif /* _ASM_IPCBUF_H */
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
deleted file mode 100644
index a58f0eecc68f..000000000000
--- a/include/asm-mips/irq.h
+++ /dev/null
@@ -1,163 +0,0 @@
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 * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
7 * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
8 */
9#ifndef _ASM_IRQ_H
10#define _ASM_IRQ_H
11
12#include <linux/linkage.h>
13
14#include <asm/mipsmtregs.h>
15
16#include <irq.h>
17
18#ifdef CONFIG_I8259
19static inline int irq_canonicalize(int irq)
20{
21 return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
22}
23#else
24#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
25#endif
26
27#ifdef CONFIG_MIPS_MT_SMTC
28
29struct irqaction;
30
31extern unsigned long irq_hwmask[];
32extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
33 unsigned long hwmask);
34
35static inline void smtc_im_ack_irq(unsigned int irq)
36{
37 if (irq_hwmask[irq] & ST0_IM)
38 set_c0_status(irq_hwmask[irq] & ST0_IM);
39}
40
41#else
42
43static inline void smtc_im_ack_irq(unsigned int irq)
44{
45}
46
47#endif /* CONFIG_MIPS_MT_SMTC */
48
49#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
50#include <linux/cpumask.h>
51
52extern void plat_set_irq_affinity(unsigned int irq, cpumask_t affinity);
53extern void smtc_forward_irq(unsigned int irq);
54
55/*
56 * IRQ affinity hook invoked at the beginning of interrupt dispatch
57 * if option is enabled.
58 *
59 * Up through Linux 2.6.22 (at least) cpumask operations are very
60 * inefficient on MIPS. Initial prototypes of SMTC IRQ affinity
61 * used a "fast path" per-IRQ-descriptor cache of affinity information
62 * to reduce latency. As there is a project afoot to optimize the
63 * cpumask implementations, this version is optimistically assuming
64 * that cpumask.h macro overhead is reasonable during interrupt dispatch.
65 */
66#define IRQ_AFFINITY_HOOK(irq) \
67do { \
68 if (!cpu_isset(smp_processor_id(), irq_desc[irq].affinity)) { \
69 smtc_forward_irq(irq); \
70 irq_exit(); \
71 return; \
72 } \
73} while (0)
74
75#else /* Not doing SMTC affinity */
76
77#define IRQ_AFFINITY_HOOK(irq) do { } while (0)
78
79#endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */
80
81#ifdef CONFIG_MIPS_MT_SMTC_IM_BACKSTOP
82
83/*
84 * Clear interrupt mask handling "backstop" if irq_hwmask
85 * entry so indicates. This implies that the ack() or end()
86 * functions will take over re-enabling the low-level mask.
87 * Otherwise it will be done on return from exception.
88 */
89#define __DO_IRQ_SMTC_HOOK(irq) \
90do { \
91 IRQ_AFFINITY_HOOK(irq); \
92 if (irq_hwmask[irq] & 0x0000ff00) \
93 write_c0_tccontext(read_c0_tccontext() & \
94 ~(irq_hwmask[irq] & 0x0000ff00)); \
95} while (0)
96
97#define __NO_AFFINITY_IRQ_SMTC_HOOK(irq) \
98do { \
99 if (irq_hwmask[irq] & 0x0000ff00) \
100 write_c0_tccontext(read_c0_tccontext() & \
101 ~(irq_hwmask[irq] & 0x0000ff00)); \
102} while (0)
103
104#else
105
106#define __DO_IRQ_SMTC_HOOK(irq) \
107do { \
108 IRQ_AFFINITY_HOOK(irq); \
109} while (0)
110#define __NO_AFFINITY_IRQ_SMTC_HOOK(irq) do { } while (0)
111
112#endif
113
114/*
115 * do_IRQ handles all normal device IRQ's (the special
116 * SMP cross-CPU interrupts have their own specific
117 * handlers).
118 *
119 * Ideally there should be away to get this into kernel/irq/handle.c to
120 * avoid the overhead of a call for just a tiny function ...
121 */
122#define do_IRQ(irq) \
123do { \
124 irq_enter(); \
125 __DO_IRQ_SMTC_HOOK(irq); \
126 generic_handle_irq(irq); \
127 irq_exit(); \
128} while (0)
129
130#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
131/*
132 * To avoid inefficient and in some cases pathological re-checking of
133 * IRQ affinity, we have this variant that skips the affinity check.
134 */
135
136
137#define do_IRQ_no_affinity(irq) \
138do { \
139 irq_enter(); \
140 __NO_AFFINITY_IRQ_SMTC_HOOK(irq); \
141 generic_handle_irq(irq); \
142 irq_exit(); \
143} while (0)
144
145#endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */
146
147extern void arch_init_irq(void);
148extern void spurious_interrupt(void);
149
150extern int allocate_irqno(void);
151extern void alloc_legacy_irqno(void);
152extern void free_irqno(unsigned int irq);
153
154/*
155 * Before R2 the timer and performance counter interrupts were both fixed to
156 * IE7. Since R2 their number has to be read from the c0_intctl register.
157 */
158#define CP0_LEGACY_COMPARE_IRQ 7
159
160extern int cp0_compare_irq;
161extern int cp0_perfcount_irq;
162
163#endif /* _ASM_IRQ_H */
diff --git a/include/asm-mips/irq_cpu.h b/include/asm-mips/irq_cpu.h
deleted file mode 100644
index ef6a07cddb23..000000000000
--- a/include/asm-mips/irq_cpu.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * include/asm-mips/irq_cpu.h
3 *
4 * MIPS CPU interrupt definitions.
5 *
6 * Copyright (C) 2002 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef _ASM_IRQ_CPU_H
14#define _ASM_IRQ_CPU_H
15
16extern void mips_cpu_irq_init(void);
17extern void rm7k_cpu_irq_init(void);
18extern void rm9k_cpu_irq_init(void);
19
20#endif /* _ASM_IRQ_CPU_H */
diff --git a/include/asm-mips/irq_gt641xx.h b/include/asm-mips/irq_gt641xx.h
deleted file mode 100644
index f9a7c3ac2e66..000000000000
--- a/include/asm-mips/irq_gt641xx.h
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Galileo/Marvell GT641xx IRQ definitions.
3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#ifndef _ASM_IRQ_GT641XX_H
21#define _ASM_IRQ_GT641XX_H
22
23#ifndef GT641XX_IRQ_BASE
24#define GT641XX_IRQ_BASE 8
25#endif
26
27#define GT641XX_MEMORY_OUT_OF_RANGE_IRQ (GT641XX_IRQ_BASE + 1)
28#define GT641XX_DMA_OUT_OF_RANGE_IRQ (GT641XX_IRQ_BASE + 2)
29#define GT641XX_CPU_ACCESS_OUT_OF_RANGE_IRQ (GT641XX_IRQ_BASE + 3)
30#define GT641XX_DMA0_IRQ (GT641XX_IRQ_BASE + 4)
31#define GT641XX_DMA1_IRQ (GT641XX_IRQ_BASE + 5)
32#define GT641XX_DMA2_IRQ (GT641XX_IRQ_BASE + 6)
33#define GT641XX_DMA3_IRQ (GT641XX_IRQ_BASE + 7)
34#define GT641XX_TIMER0_IRQ (GT641XX_IRQ_BASE + 8)
35#define GT641XX_TIMER1_IRQ (GT641XX_IRQ_BASE + 9)
36#define GT641XX_TIMER2_IRQ (GT641XX_IRQ_BASE + 10)
37#define GT641XX_TIMER3_IRQ (GT641XX_IRQ_BASE + 11)
38#define GT641XX_PCI_0_MASTER_READ_ERROR_IRQ (GT641XX_IRQ_BASE + 12)
39#define GT641XX_PCI_0_SLAVE_WRITE_ERROR_IRQ (GT641XX_IRQ_BASE + 13)
40#define GT641XX_PCI_0_MASTER_WRITE_ERROR_IRQ (GT641XX_IRQ_BASE + 14)
41#define GT641XX_PCI_0_SLAVE_READ_ERROR_IRQ (GT641XX_IRQ_BASE + 15)
42#define GT641XX_PCI_0_ADDRESS_ERROR_IRQ (GT641XX_IRQ_BASE + 16)
43#define GT641XX_MEMORY_ERROR_IRQ (GT641XX_IRQ_BASE + 17)
44#define GT641XX_PCI_0_MASTER_ABORT_IRQ (GT641XX_IRQ_BASE + 18)
45#define GT641XX_PCI_0_TARGET_ABORT_IRQ (GT641XX_IRQ_BASE + 19)
46#define GT641XX_PCI_0_RETRY_TIMEOUT_IRQ (GT641XX_IRQ_BASE + 20)
47#define GT641XX_CPU_INT0_IRQ (GT641XX_IRQ_BASE + 21)
48#define GT641XX_CPU_INT1_IRQ (GT641XX_IRQ_BASE + 22)
49#define GT641XX_CPU_INT2_IRQ (GT641XX_IRQ_BASE + 23)
50#define GT641XX_CPU_INT3_IRQ (GT641XX_IRQ_BASE + 24)
51#define GT641XX_CPU_INT4_IRQ (GT641XX_IRQ_BASE + 25)
52#define GT641XX_PCI_INT0_IRQ (GT641XX_IRQ_BASE + 26)
53#define GT641XX_PCI_INT1_IRQ (GT641XX_IRQ_BASE + 27)
54#define GT641XX_PCI_INT2_IRQ (GT641XX_IRQ_BASE + 28)
55#define GT641XX_PCI_INT3_IRQ (GT641XX_IRQ_BASE + 29)
56
57extern void gt641xx_irq_dispatch(void);
58extern void gt641xx_irq_init(void);
59
60#endif /* _ASM_IRQ_GT641XX_H */
diff --git a/include/asm-mips/irq_regs.h b/include/asm-mips/irq_regs.h
deleted file mode 100644
index 33bd2a06de57..000000000000
--- a/include/asm-mips/irq_regs.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version
5 * 2 of the License, or (at your option) any later version.
6 *
7 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
8 */
9#ifndef __ASM_IRQ_REGS_H
10#define __ASM_IRQ_REGS_H
11
12#define ARCH_HAS_OWN_IRQ_REGS
13
14#include <linux/thread_info.h>
15
16static inline struct pt_regs *get_irq_regs(void)
17{
18 return current_thread_info()->regs;
19}
20
21#endif /* __ASM_IRQ_REGS_H */
diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h
deleted file mode 100644
index 881e8866501d..000000000000
--- a/include/asm-mips/irqflags.h
+++ /dev/null
@@ -1,263 +0,0 @@
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 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 by Ralf Baechle
7 * Copyright (C) 1996 by Paul M. Antoine
8 * Copyright (C) 1999 Silicon Graphics
9 * Copyright (C) 2000 MIPS Technologies, Inc.
10 */
11#ifndef _ASM_IRQFLAGS_H
12#define _ASM_IRQFLAGS_H
13
14#ifndef __ASSEMBLY__
15
16#include <linux/compiler.h>
17#include <asm/hazards.h>
18
19__asm__(
20 " .macro raw_local_irq_enable \n"
21 " .set push \n"
22 " .set reorder \n"
23 " .set noat \n"
24#ifdef CONFIG_MIPS_MT_SMTC
25 " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n"
26 " ori $1, 0x400 \n"
27 " xori $1, 0x400 \n"
28 " mtc0 $1, $2, 1 \n"
29#elif defined(CONFIG_CPU_MIPSR2)
30 " ei \n"
31#else
32 " mfc0 $1,$12 \n"
33 " ori $1,0x1f \n"
34 " xori $1,0x1e \n"
35 " mtc0 $1,$12 \n"
36#endif
37 " irq_enable_hazard \n"
38 " .set pop \n"
39 " .endm");
40
41static inline void raw_local_irq_enable(void)
42{
43 __asm__ __volatile__(
44 "raw_local_irq_enable"
45 : /* no outputs */
46 : /* no inputs */
47 : "memory");
48}
49
50/*
51 * For cli() we have to insert nops to make sure that the new value
52 * has actually arrived in the status register before the end of this
53 * macro.
54 * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs
55 * no nops at all.
56 */
57/*
58 * For TX49, operating only IE bit is not enough.
59 *
60 * If mfc0 $12 follows store and the mfc0 is last instruction of a
61 * page and fetching the next instruction causes TLB miss, the result
62 * of the mfc0 might wrongly contain EXL bit.
63 *
64 * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008
65 *
66 * Workaround: mask EXL bit of the result or place a nop before mfc0.
67 */
68__asm__(
69 " .macro raw_local_irq_disable\n"
70 " .set push \n"
71 " .set noat \n"
72#ifdef CONFIG_MIPS_MT_SMTC
73 " mfc0 $1, $2, 1 \n"
74 " ori $1, 0x400 \n"
75 " .set noreorder \n"
76 " mtc0 $1, $2, 1 \n"
77#elif defined(CONFIG_CPU_MIPSR2)
78 " di \n"
79#else
80 " mfc0 $1,$12 \n"
81 " ori $1,0x1f \n"
82 " xori $1,0x1f \n"
83 " .set noreorder \n"
84 " mtc0 $1,$12 \n"
85#endif
86 " irq_disable_hazard \n"
87 " .set pop \n"
88 " .endm \n");
89
90static inline void raw_local_irq_disable(void)
91{
92 __asm__ __volatile__(
93 "raw_local_irq_disable"
94 : /* no outputs */
95 : /* no inputs */
96 : "memory");
97}
98
99__asm__(
100 " .macro raw_local_save_flags flags \n"
101 " .set push \n"
102 " .set reorder \n"
103#ifdef CONFIG_MIPS_MT_SMTC
104 " mfc0 \\flags, $2, 1 \n"
105#else
106 " mfc0 \\flags, $12 \n"
107#endif
108 " .set pop \n"
109 " .endm \n");
110
111#define raw_local_save_flags(x) \
112__asm__ __volatile__( \
113 "raw_local_save_flags %0" \
114 : "=r" (x))
115
116__asm__(
117 " .macro raw_local_irq_save result \n"
118 " .set push \n"
119 " .set reorder \n"
120 " .set noat \n"
121#ifdef CONFIG_MIPS_MT_SMTC
122 " mfc0 \\result, $2, 1 \n"
123 " ori $1, \\result, 0x400 \n"
124 " .set noreorder \n"
125 " mtc0 $1, $2, 1 \n"
126 " andi \\result, \\result, 0x400 \n"
127#elif defined(CONFIG_CPU_MIPSR2)
128 " di \\result \n"
129 " andi \\result, 1 \n"
130#else
131 " mfc0 \\result, $12 \n"
132 " ori $1, \\result, 0x1f \n"
133 " xori $1, 0x1f \n"
134 " .set noreorder \n"
135 " mtc0 $1, $12 \n"
136#endif
137 " irq_disable_hazard \n"
138 " .set pop \n"
139 " .endm \n");
140
141#define raw_local_irq_save(x) \
142__asm__ __volatile__( \
143 "raw_local_irq_save\t%0" \
144 : "=r" (x) \
145 : /* no inputs */ \
146 : "memory")
147
148__asm__(
149 " .macro raw_local_irq_restore flags \n"
150 " .set push \n"
151 " .set noreorder \n"
152 " .set noat \n"
153#ifdef CONFIG_MIPS_MT_SMTC
154 "mfc0 $1, $2, 1 \n"
155 "andi \\flags, 0x400 \n"
156 "ori $1, 0x400 \n"
157 "xori $1, 0x400 \n"
158 "or \\flags, $1 \n"
159 "mtc0 \\flags, $2, 1 \n"
160#elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU)
161 /*
162 * Slow, but doesn't suffer from a relativly unlikely race
163 * condition we're having since days 1.
164 */
165 " beqz \\flags, 1f \n"
166 " di \n"
167 " ei \n"
168 "1: \n"
169#elif defined(CONFIG_CPU_MIPSR2)
170 /*
171 * Fast, dangerous. Life is fun, life is good.
172 */
173 " mfc0 $1, $12 \n"
174 " ins $1, \\flags, 0, 1 \n"
175 " mtc0 $1, $12 \n"
176#else
177 " mfc0 $1, $12 \n"
178 " andi \\flags, 1 \n"
179 " ori $1, 0x1f \n"
180 " xori $1, 0x1f \n"
181 " or \\flags, $1 \n"
182 " mtc0 \\flags, $12 \n"
183#endif
184 " irq_disable_hazard \n"
185 " .set pop \n"
186 " .endm \n");
187
188extern void smtc_ipi_replay(void);
189
190static inline void raw_local_irq_restore(unsigned long flags)
191{
192 unsigned long __tmp1;
193
194#ifdef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY
195 /*
196 * CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY does prompt replay of deferred
197 * IPIs, at the cost of branch and call overhead on each
198 * local_irq_restore()
199 */
200 if (unlikely(!(flags & 0x0400)))
201 smtc_ipi_replay();
202#endif
203
204 __asm__ __volatile__(
205 "raw_local_irq_restore\t%0"
206 : "=r" (__tmp1)
207 : "0" (flags)
208 : "memory");
209}
210
211static inline int raw_irqs_disabled_flags(unsigned long flags)
212{
213#ifdef CONFIG_MIPS_MT_SMTC
214 /*
215 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU
216 */
217 return flags & 0x400;
218#else
219 return !(flags & 1);
220#endif
221}
222
223#endif
224
225/*
226 * Do the CPU's IRQ-state tracing from assembly code.
227 */
228#ifdef CONFIG_TRACE_IRQFLAGS
229/* Reload some registers clobbered by trace_hardirqs_on */
230#ifdef CONFIG_64BIT
231# define TRACE_IRQS_RELOAD_REGS \
232 LONG_L $11, PT_R11(sp); \
233 LONG_L $10, PT_R10(sp); \
234 LONG_L $9, PT_R9(sp); \
235 LONG_L $8, PT_R8(sp); \
236 LONG_L $7, PT_R7(sp); \
237 LONG_L $6, PT_R6(sp); \
238 LONG_L $5, PT_R5(sp); \
239 LONG_L $4, PT_R4(sp); \
240 LONG_L $2, PT_R2(sp)
241#else
242# define TRACE_IRQS_RELOAD_REGS \
243 LONG_L $7, PT_R7(sp); \
244 LONG_L $6, PT_R6(sp); \
245 LONG_L $5, PT_R5(sp); \
246 LONG_L $4, PT_R4(sp); \
247 LONG_L $2, PT_R2(sp)
248#endif
249# define TRACE_IRQS_ON \
250 CLI; /* make sure trace_hardirqs_on() is called in kernel level */ \
251 jal trace_hardirqs_on
252# define TRACE_IRQS_ON_RELOAD \
253 TRACE_IRQS_ON; \
254 TRACE_IRQS_RELOAD_REGS
255# define TRACE_IRQS_OFF \
256 jal trace_hardirqs_off
257#else
258# define TRACE_IRQS_ON
259# define TRACE_IRQS_ON_RELOAD
260# define TRACE_IRQS_OFF
261#endif
262
263#endif /* _ASM_IRQFLAGS_H */
diff --git a/include/asm-mips/isadep.h b/include/asm-mips/isadep.h
deleted file mode 100644
index 24c6cda79377..000000000000
--- a/include/asm-mips/isadep.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Various ISA level dependent constants.
3 * Most of the following constants reflect the different layout
4 * of Coprocessor 0 registers.
5 *
6 * Copyright (c) 1998 Harald Koerfgen
7 */
8
9#ifndef __ASM_ISADEP_H
10#define __ASM_ISADEP_H
11
12#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
13/*
14 * R2000 or R3000
15 */
16
17/*
18 * kernel or user mode? (CP0_STATUS)
19 */
20#define KU_MASK 0x08
21#define KU_USER 0x08
22#define KU_KERN 0x00
23
24#else
25/*
26 * kernel or user mode?
27 */
28#define KU_MASK 0x18
29#define KU_USER 0x10
30#define KU_KERN 0x00
31
32#endif
33
34#endif /* __ASM_ISADEP_H */
diff --git a/include/asm-mips/jazz.h b/include/asm-mips/jazz.h
deleted file mode 100644
index 83f449dec95e..000000000000
--- a/include/asm-mips/jazz.h
+++ /dev/null
@@ -1,310 +0,0 @@
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 * Copyright (C) 1995 - 1998 by Andreas Busse and Ralf Baechle
7 */
8#ifndef __ASM_JAZZ_H
9#define __ASM_JAZZ_H
10
11/*
12 * The addresses below are virtual address. The mappings are
13 * created on startup via wired entries in the tlb. The Mips
14 * Magnum R3000 and R4000 machines are similar in many aspects,
15 * but many hardware register are accessible at 0xb9000000 in
16 * instead of 0xe0000000.
17 */
18
19#define JAZZ_LOCAL_IO_SPACE 0xe0000000
20
21/*
22 * Revision numbers in PICA_ASIC_REVISION
23 *
24 * 0xf0000000 - Rev1
25 * 0xf0000001 - Rev2
26 * 0xf0000002 - Rev3
27 */
28#define PICA_ASIC_REVISION 0xe0000008
29
30/*
31 * The segments of the seven segment LED are mapped
32 * to the control bits as follows:
33 *
34 * (7)
35 * ---------
36 * | |
37 * (2) | | (6)
38 * | (1) |
39 * ---------
40 * | |
41 * (3) | | (5)
42 * | (4) |
43 * --------- . (0)
44 */
45#define PICA_LED 0xe000f000
46
47/*
48 * Some characters for the LED control registers
49 * The original Mips machines seem to have a LED display
50 * with integrated decoder while the Acer machines can
51 * control each of the seven segments and the dot independently.
52 * It's only a toy, anyway...
53 */
54#define LED_DOT 0x01
55#define LED_SPACE 0x00
56#define LED_0 0xfc
57#define LED_1 0x60
58#define LED_2 0xda
59#define LED_3 0xf2
60#define LED_4 0x66
61#define LED_5 0xb6
62#define LED_6 0xbe
63#define LED_7 0xe0
64#define LED_8 0xfe
65#define LED_9 0xf6
66#define LED_A 0xee
67#define LED_b 0x3e
68#define LED_C 0x9c
69#define LED_d 0x7a
70#define LED_E 0x9e
71#define LED_F 0x8e
72
73#ifndef __ASSEMBLY__
74
75static __inline__ void pica_set_led(unsigned int bits)
76{
77 volatile unsigned int *led_register = (unsigned int *) PICA_LED;
78
79 *led_register = bits;
80}
81
82#endif /* !__ASSEMBLY__ */
83
84/*
85 * Base address of the Sonic Ethernet adapter in Jazz machines.
86 */
87#define JAZZ_ETHERNET_BASE 0xe0001000
88
89/*
90 * Base address of the 53C94 SCSI hostadapter in Jazz machines.
91 */
92#define JAZZ_SCSI_BASE 0xe0002000
93
94/*
95 * i8042 keyboard controller for JAZZ and PICA chipsets.
96 * This address is just a guess and seems to differ from
97 * other mips machines such as RC3xxx...
98 */
99#define JAZZ_KEYBOARD_ADDRESS 0xe0005000
100#define JAZZ_KEYBOARD_DATA 0xe0005000
101#define JAZZ_KEYBOARD_COMMAND 0xe0005001
102
103#ifndef __ASSEMBLY__
104
105typedef struct {
106 unsigned char data;
107 unsigned char command;
108} jazz_keyboard_hardware;
109
110#define jazz_kh ((keyboard_hardware *) JAZZ_KEYBOARD_ADDRESS)
111
112typedef struct {
113 unsigned char pad0[3];
114 unsigned char data;
115 unsigned char pad1[3];
116 unsigned char command;
117} mips_keyboard_hardware;
118
119/*
120 * For now. Needs to be changed for RC3xxx support. See below.
121 */
122#define keyboard_hardware jazz_keyboard_hardware
123
124#endif /* !__ASSEMBLY__ */
125
126/*
127 * i8042 keyboard controller for most other Mips machines.
128 */
129#define MIPS_KEYBOARD_ADDRESS 0xb9005000
130#define MIPS_KEYBOARD_DATA 0xb9005003
131#define MIPS_KEYBOARD_COMMAND 0xb9005007
132
133/*
134 * Serial and parallel ports (WD 16C552) on the Mips JAZZ
135 */
136#define JAZZ_SERIAL1_BASE (unsigned int)0xe0006000
137#define JAZZ_SERIAL2_BASE (unsigned int)0xe0007000
138#define JAZZ_PARALLEL_BASE (unsigned int)0xe0008000
139
140/*
141 * Dummy Device Address. Used in jazzdma.c
142 */
143#define JAZZ_DUMMY_DEVICE 0xe000d000
144
145/*
146 * JAZZ timer registers and interrupt no.
147 * Note that the hardware timer interrupt is actually on
148 * cpu level 6, but to keep compatibility with PC stuff
149 * it is remapped to vector 0. See arch/mips/kernel/entry.S.
150 */
151#define JAZZ_TIMER_INTERVAL 0xe0000228
152#define JAZZ_TIMER_REGISTER 0xe0000230
153
154/*
155 * DRAM configuration register
156 */
157#ifndef __ASSEMBLY__
158#ifdef __MIPSEL__
159typedef struct {
160 unsigned int bank2 : 3;
161 unsigned int bank1 : 3;
162 unsigned int mem_bus_width : 1;
163 unsigned int reserved2 : 1;
164 unsigned int page_mode : 1;
165 unsigned int reserved1 : 23;
166} dram_configuration;
167#else /* defined (__MIPSEB__) */
168typedef struct {
169 unsigned int reserved1 : 23;
170 unsigned int page_mode : 1;
171 unsigned int reserved2 : 1;
172 unsigned int mem_bus_width : 1;
173 unsigned int bank1 : 3;
174 unsigned int bank2 : 3;
175} dram_configuration;
176#endif
177#endif /* !__ASSEMBLY__ */
178
179#define PICA_DRAM_CONFIG 0xe00fffe0
180
181/*
182 * JAZZ interrupt control registers
183 */
184#define JAZZ_IO_IRQ_SOURCE 0xe0010000
185#define JAZZ_IO_IRQ_ENABLE 0xe0010002
186
187/*
188 * JAZZ Interrupt Level definitions
189 *
190 * This is somewhat broken. For reasons which nobody can remember anymore
191 * we remap the Jazz interrupts to the usual ISA style interrupt numbers.
192 */
193#define JAZZ_IRQ_START 24
194#define JAZZ_IRQ_END (24 + 9)
195#define JAZZ_PARALLEL_IRQ (JAZZ_IRQ_START + 0)
196#define JAZZ_FLOPPY_IRQ (JAZZ_IRQ_START + 1)
197#define JAZZ_SOUND_IRQ (JAZZ_IRQ_START + 2)
198#define JAZZ_VIDEO_IRQ (JAZZ_IRQ_START + 3)
199#define JAZZ_ETHERNET_IRQ (JAZZ_IRQ_START + 4)
200#define JAZZ_SCSI_IRQ (JAZZ_IRQ_START + 5)
201#define JAZZ_KEYBOARD_IRQ (JAZZ_IRQ_START + 6)
202#define JAZZ_MOUSE_IRQ (JAZZ_IRQ_START + 7)
203#define JAZZ_SERIAL1_IRQ (JAZZ_IRQ_START + 8)
204#define JAZZ_SERIAL2_IRQ (JAZZ_IRQ_START + 9)
205
206#define JAZZ_TIMER_IRQ (MIPS_CPU_IRQ_BASE+6)
207
208
209/*
210 * JAZZ DMA Channels
211 * Note: Channels 4...7 are not used with respect to the Acer PICA-61
212 * chipset which does not provide these DMA channels.
213 */
214#define JAZZ_SCSI_DMA 0 /* SCSI */
215#define JAZZ_FLOPPY_DMA 1 /* FLOPPY */
216#define JAZZ_AUDIOL_DMA 2 /* AUDIO L */
217#define JAZZ_AUDIOR_DMA 3 /* AUDIO R */
218
219/*
220 * JAZZ R4030 MCT_ADR chip (DMA controller)
221 * Note: Virtual Addresses !
222 */
223#define JAZZ_R4030_CONFIG 0xE0000000 /* R4030 config register */
224#define JAZZ_R4030_REVISION 0xE0000008 /* same as PICA_ASIC_REVISION */
225#define JAZZ_R4030_INV_ADDR 0xE0000010 /* Invalid Address register */
226
227#define JAZZ_R4030_TRSTBL_BASE 0xE0000018 /* Translation Table Base */
228#define JAZZ_R4030_TRSTBL_LIM 0xE0000020 /* Translation Table Limit */
229#define JAZZ_R4030_TRSTBL_INV 0xE0000028 /* Translation Table Invalidate */
230
231#define JAZZ_R4030_CACHE_MTNC 0xE0000030 /* Cache Maintenance */
232#define JAZZ_R4030_R_FAIL_ADDR 0xE0000038 /* Remote Failed Address */
233#define JAZZ_R4030_M_FAIL_ADDR 0xE0000040 /* Memory Failed Address */
234
235#define JAZZ_R4030_CACHE_PTAG 0xE0000048 /* I/O Cache Physical Tag */
236#define JAZZ_R4030_CACHE_LTAG 0xE0000050 /* I/O Cache Logical Tag */
237#define JAZZ_R4030_CACHE_BMASK 0xE0000058 /* I/O Cache Byte Mask */
238#define JAZZ_R4030_CACHE_BWIN 0xE0000060 /* I/O Cache Buffer Window */
239
240/*
241 * Remote Speed Registers.
242 *
243 * 0: free, 1: Ethernet, 2: SCSI, 3: Floppy,
244 * 4: RTC, 5: Kb./Mouse 6: serial 1, 7: serial 2,
245 * 8: parallel, 9: NVRAM, 10: CPU, 11: PROM,
246 * 12: reserved, 13: free, 14: 7seg LED, 15: ???
247 */
248#define JAZZ_R4030_REM_SPEED 0xE0000070 /* 16 Remote Speed Registers */
249 /* 0xE0000070,78,80... 0xE00000E8 */
250#define JAZZ_R4030_IRQ_ENABLE 0xE00000E8 /* Internal Interrupt Enable */
251#define JAZZ_R4030_INVAL_ADDR 0xE0000010 /* Invalid address Register */
252#define JAZZ_R4030_IRQ_SOURCE 0xE0000200 /* Interrupt Source Register */
253#define JAZZ_R4030_I386_ERROR 0xE0000208 /* i386/EISA Bus Error */
254
255/*
256 * Virtual (E)ISA controller address
257 */
258#define JAZZ_EISA_IRQ_ACK 0xE0000238 /* EISA interrupt acknowledge */
259
260/*
261 * Access the R4030 DMA and I/O Controller
262 */
263#ifndef __ASSEMBLY__
264
265static inline void r4030_delay(void)
266{
267__asm__ __volatile__(
268 ".set\tnoreorder\n\t"
269 "nop\n\t"
270 "nop\n\t"
271 "nop\n\t"
272 "nop\n\t"
273 ".set\treorder");
274}
275
276static inline unsigned short r4030_read_reg16(unsigned long addr)
277{
278 unsigned short ret = *((volatile unsigned short *)addr);
279 r4030_delay();
280 return ret;
281}
282
283static inline unsigned int r4030_read_reg32(unsigned long addr)
284{
285 unsigned int ret = *((volatile unsigned int *)addr);
286 r4030_delay();
287 return ret;
288}
289
290static inline void r4030_write_reg16(unsigned long addr, unsigned val)
291{
292 *((volatile unsigned short *)addr) = val;
293 r4030_delay();
294}
295
296static inline void r4030_write_reg32(unsigned long addr, unsigned val)
297{
298 *((volatile unsigned int *)addr) = val;
299 r4030_delay();
300}
301
302#endif /* !__ASSEMBLY__ */
303
304#define JAZZ_FDC_BASE 0xe0003000
305#define JAZZ_RTC_BASE 0xe0004000
306#define JAZZ_PORT_BASE 0xe2000000
307
308#define JAZZ_EISA_BASE 0xe3000000
309
310#endif /* __ASM_JAZZ_H */
diff --git a/include/asm-mips/jazzdma.h b/include/asm-mips/jazzdma.h
deleted file mode 100644
index 8bb37bba68f0..000000000000
--- a/include/asm-mips/jazzdma.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2 * Helpfile for jazzdma.c -- Mips Jazz R4030 DMA controller support
3 */
4#ifndef _ASM_JAZZDMA_H
5#define _ASM_JAZZDMA_H
6
7/*
8 * Prototypes and macros
9 */
10extern unsigned long vdma_alloc(unsigned long paddr, unsigned long size);
11extern int vdma_free(unsigned long laddr);
12extern int vdma_remap(unsigned long laddr, unsigned long paddr,
13 unsigned long size);
14extern unsigned long vdma_phys2log(unsigned long paddr);
15extern unsigned long vdma_log2phys(unsigned long laddr);
16extern void vdma_stats(void); /* for debugging only */
17
18extern void vdma_enable(int channel);
19extern void vdma_disable(int channel);
20extern void vdma_set_mode(int channel, int mode);
21extern void vdma_set_addr(int channel, long addr);
22extern void vdma_set_count(int channel, int count);
23extern int vdma_get_residue(int channel);
24extern int vdma_get_enable(int channel);
25
26/*
27 * some definitions used by the driver functions
28 */
29#define VDMA_PAGESIZE 4096
30#define VDMA_PGTBL_ENTRIES 4096
31#define VDMA_PGTBL_SIZE (sizeof(VDMA_PGTBL_ENTRY) * VDMA_PGTBL_ENTRIES)
32#define VDMA_PAGE_EMPTY 0xff000000
33
34/*
35 * Macros to get page no. and offset of a given address
36 * Note that VDMA_PAGE() works for physical addresses only
37 */
38#define VDMA_PAGE(a) ((unsigned int)(a) >> 12)
39#define VDMA_OFFSET(a) ((unsigned int)(a) & (VDMA_PAGESIZE-1))
40
41/*
42 * error code returned by vdma_alloc()
43 * (See also arch/mips/kernel/jazzdma.c)
44 */
45#define VDMA_ERROR 0xffffffff
46
47/*
48 * VDMA pagetable entry description
49 */
50typedef volatile struct VDMA_PGTBL_ENTRY {
51 unsigned int frame; /* physical frame no. */
52 unsigned int owner; /* owner of this entry (0=free) */
53} VDMA_PGTBL_ENTRY;
54
55
56/*
57 * DMA channel control registers
58 * in the R4030 MCT_ADR chip
59 */
60#define JAZZ_R4030_CHNL_MODE 0xE0000100 /* 8 DMA Channel Mode Registers, */
61 /* 0xE0000100,120,140... */
62#define JAZZ_R4030_CHNL_ENABLE 0xE0000108 /* 8 DMA Channel Enable Regs, */
63 /* 0xE0000108,128,148... */
64#define JAZZ_R4030_CHNL_COUNT 0xE0000110 /* 8 DMA Channel Byte Cnt Regs, */
65 /* 0xE0000110,130,150... */
66#define JAZZ_R4030_CHNL_ADDR 0xE0000118 /* 8 DMA Channel Address Regs, */
67 /* 0xE0000118,138,158... */
68
69/* channel enable register bits */
70
71#define R4030_CHNL_ENABLE (1<<0)
72#define R4030_CHNL_WRITE (1<<1)
73#define R4030_TC_INTR (1<<8)
74#define R4030_MEM_INTR (1<<9)
75#define R4030_ADDR_INTR (1<<10)
76
77/*
78 * Channel mode register bits
79 */
80#define R4030_MODE_ATIME_40 (0) /* device access time on remote bus */
81#define R4030_MODE_ATIME_80 (1)
82#define R4030_MODE_ATIME_120 (2)
83#define R4030_MODE_ATIME_160 (3)
84#define R4030_MODE_ATIME_200 (4)
85#define R4030_MODE_ATIME_240 (5)
86#define R4030_MODE_ATIME_280 (6)
87#define R4030_MODE_ATIME_320 (7)
88#define R4030_MODE_WIDTH_8 (1<<3) /* device data bus width */
89#define R4030_MODE_WIDTH_16 (2<<3)
90#define R4030_MODE_WIDTH_32 (3<<3)
91#define R4030_MODE_INTR_EN (1<<5)
92#define R4030_MODE_BURST (1<<6) /* Rev. 2 only */
93#define R4030_MODE_FAST_ACK (1<<7) /* Rev. 2 only */
94
95#endif /* _ASM_JAZZDMA_H */
diff --git a/include/asm-mips/kdebug.h b/include/asm-mips/kdebug.h
deleted file mode 100644
index 5bf62aafc890..000000000000
--- a/include/asm-mips/kdebug.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _ASM_MIPS_KDEBUG_H
2#define _ASM_MIPS_KDEBUG_H
3
4#include <linux/notifier.h>
5
6enum die_val {
7 DIE_OOPS = 1,
8 DIE_FP,
9 DIE_TRAP,
10 DIE_RI,
11};
12
13#endif /* _ASM_MIPS_KDEBUG_H */
diff --git a/include/asm-mips/kexec.h b/include/asm-mips/kexec.h
deleted file mode 100644
index 4314892aaebb..000000000000
--- a/include/asm-mips/kexec.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * kexec.h for kexec
3 * Created by <nschichan@corp.free.fr> on Thu Oct 12 14:59:34 2006
4 *
5 * This source code is licensed under the GNU General Public License,
6 * Version 2. See the file COPYING for more details.
7 */
8
9#ifndef _MIPS_KEXEC
10# define _MIPS_KEXEC
11
12/* Maximum physical address we can use pages from */
13#define KEXEC_SOURCE_MEMORY_LIMIT (0x20000000)
14/* Maximum address we can reach in physical address mode */
15#define KEXEC_DESTINATION_MEMORY_LIMIT (0x20000000)
16 /* Maximum address we can use for the control code buffer */
17#define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000)
18
19#define KEXEC_CONTROL_PAGE_SIZE 4096
20
21/* The native architecture */
22#define KEXEC_ARCH KEXEC_ARCH_MIPS
23
24static inline void crash_setup_regs(struct pt_regs *newregs,
25 struct pt_regs *oldregs)
26{
27 /* Dummy implementation for now */
28}
29
30#endif /* !_MIPS_KEXEC */
diff --git a/include/asm-mips/kgdb.h b/include/asm-mips/kgdb.h
deleted file mode 100644
index 48223b09396c..000000000000
--- a/include/asm-mips/kgdb.h
+++ /dev/null
@@ -1,44 +0,0 @@
1#ifndef __ASM_KGDB_H_
2#define __ASM_KGDB_H_
3
4#ifdef __KERNEL__
5
6#include <asm/sgidefs.h>
7
8#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
9 (_MIPS_ISA == _MIPS_ISA_MIPS32)
10
11#define KGDB_GDB_REG_SIZE 32
12
13#elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
14 (_MIPS_ISA == _MIPS_ISA_MIPS64)
15
16#ifdef CONFIG_32BIT
17#define KGDB_GDB_REG_SIZE 32
18#else /* CONFIG_CPU_32BIT */
19#define KGDB_GDB_REG_SIZE 64
20#endif
21#else
22#error "Need to set KGDB_GDB_REG_SIZE for MIPS ISA"
23#endif /* _MIPS_ISA */
24
25#define BUFMAX 2048
26#if (KGDB_GDB_REG_SIZE == 32)
27#define NUMREGBYTES (90*sizeof(u32))
28#define NUMCRITREGBYTES (12*sizeof(u32))
29#else
30#define NUMREGBYTES (90*sizeof(u64))
31#define NUMCRITREGBYTES (12*sizeof(u64))
32#endif
33#define BREAK_INSTR_SIZE 4
34#define CACHE_FLUSH_IS_SAFE 0
35
36extern void arch_kgdb_breakpoint(void);
37extern int kgdb_early_setup;
38extern void *saved_vectors[32];
39extern void handle_exception(struct pt_regs *regs);
40extern void breakinst(void);
41
42#endif /* __KERNEL__ */
43
44#endif /* __ASM_KGDB_H_ */
diff --git a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h
deleted file mode 100644
index 806aae3c5338..000000000000
--- a/include/asm-mips/kmap_types.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H
3
4
5#ifdef CONFIG_DEBUG_HIGHMEM
6# define D(n) __KM_FENCE_##n ,
7#else
8# define D(n)
9#endif
10
11enum km_type {
12D(0) KM_BOUNCE_READ,
13D(1) KM_SKB_SUNRPC_DATA,
14D(2) KM_SKB_DATA_SOFTIRQ,
15D(3) KM_USER0,
16D(4) KM_USER1,
17D(5) KM_BIO_SRC_IRQ,
18D(6) KM_BIO_DST_IRQ,
19D(7) KM_PTE0,
20D(8) KM_PTE1,
21D(9) KM_IRQ0,
22D(10) KM_IRQ1,
23D(11) KM_SOFTIRQ0,
24D(12) KM_SOFTIRQ1,
25D(13) KM_TYPE_NR
26};
27
28#undef D
29
30#endif
diff --git a/include/asm-mips/kspd.h b/include/asm-mips/kspd.h
deleted file mode 100644
index 4e9e724c8935..000000000000
--- a/include/asm-mips/kspd.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#ifndef _ASM_KSPD_H
20#define _ASM_KSPD_H
21
22struct kspd_notifications {
23 void (*kspd_sp_exit)(int sp_id);
24
25 struct list_head list;
26};
27
28#ifdef CONFIG_MIPS_APSP_KSPD
29extern void kspd_notify(struct kspd_notifications *notify);
30#else
31static inline void kspd_notify(struct kspd_notifications *notify)
32{
33}
34#endif
35
36#endif
diff --git a/include/asm-mips/lasat/ds1603.h b/include/asm-mips/lasat/ds1603.h
deleted file mode 100644
index edcd7544b358..000000000000
--- a/include/asm-mips/lasat/ds1603.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#include <asm/addrspace.h>
2
3/* Lasat 100 */
4#define DS1603_REG_100 (KSEG1ADDR(0x1c810000))
5#define DS1603_RST_100 (1 << 2)
6#define DS1603_CLK_100 (1 << 0)
7#define DS1603_DATA_SHIFT_100 1
8#define DS1603_DATA_100 (1 << DS1603_DATA_SHIFT_100)
9
10/* Lasat 200 */
11#define DS1603_REG_200 (KSEG1ADDR(0x11000000))
12#define DS1603_RST_200 (1 << 3)
13#define DS1603_CLK_200 (1 << 4)
14#define DS1603_DATA_200 (1 << 5)
15
16#define DS1603_DATA_REG_200 (DS1603_REG_200 + 0x10000)
17#define DS1603_DATA_READ_SHIFT_200 9
18#define DS1603_DATA_READ_200 (1 << DS1603_DATA_READ_SHIFT_200)
diff --git a/include/asm-mips/lasat/eeprom.h b/include/asm-mips/lasat/eeprom.h
deleted file mode 100644
index 3dac203697fa..000000000000
--- a/include/asm-mips/lasat/eeprom.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#include <asm/addrspace.h>
2
3/* lasat 100 */
4#define AT93C_REG_100 KSEG1ADDR(0x1c810000)
5#define AT93C_RDATA_REG_100 AT93C_REG_100
6#define AT93C_RDATA_SHIFT_100 4
7#define AT93C_WDATA_SHIFT_100 4
8#define AT93C_CS_M_100 (1 << 5)
9#define AT93C_CLK_M_100 (1 << 3)
10
11/* lasat 200 */
12#define AT93C_REG_200 KSEG1ADDR(0x11000000)
13#define AT93C_RDATA_REG_200 (AT93C_REG_200+0x10000)
14#define AT93C_RDATA_SHIFT_200 8
15#define AT93C_WDATA_SHIFT_200 2
16#define AT93C_CS_M_200 (1 << 0)
17#define AT93C_CLK_M_200 (1 << 1)
diff --git a/include/asm-mips/lasat/head.h b/include/asm-mips/lasat/head.h
deleted file mode 100644
index f5589f31a197..000000000000
--- a/include/asm-mips/lasat/head.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Image header stuff
3 */
4#ifndef _HEAD_H
5#define _HEAD_H
6
7#define LASAT_K_MAGIC0_VAL 0xfedeabba
8#define LASAT_K_MAGIC1_VAL 0x00bedead
9
10#ifndef _LANGUAGE_ASSEMBLY
11#include <linux/types.h>
12struct bootloader_header {
13 u32 magic[2];
14 u32 version;
15 u32 image_start;
16 u32 image_size;
17 u32 kernel_start;
18 u32 kernel_entry;
19};
20#endif
21
22#endif /* _HEAD_H */
diff --git a/include/asm-mips/lasat/lasat.h b/include/asm-mips/lasat/lasat.h
deleted file mode 100644
index caeba1e302a2..000000000000
--- a/include/asm-mips/lasat/lasat.h
+++ /dev/null
@@ -1,258 +0,0 @@
1/*
2 * lasat.h
3 *
4 * Thomas Horsten <thh@lasat.com>
5 * Copyright (C) 2000 LASAT Networks A/S.
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * 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 * Configuration for LASAT boards, loads the appropriate include files.
21 */
22#ifndef _LASAT_H
23#define _LASAT_H
24
25#ifndef _LANGUAGE_ASSEMBLY
26
27extern struct lasat_misc {
28 volatile u32 *reset_reg;
29 volatile u32 *flash_wp_reg;
30 u32 flash_wp_bit;
31} *lasat_misc;
32
33enum lasat_mtdparts {
34 LASAT_MTD_BOOTLOADER,
35 LASAT_MTD_SERVICE,
36 LASAT_MTD_NORMAL,
37 LASAT_MTD_CONFIG,
38 LASAT_MTD_FS,
39 LASAT_MTD_LAST
40};
41
42/*
43 * The format of the data record in the EEPROM.
44 * See Documentation/LASAT/eeprom.txt for a detailed description
45 * of the fields in this struct, and the LASAT Hardware Configuration
46 * field specification for a detailed description of the config
47 * field.
48 */
49#include <linux/types.h>
50
51#define LASAT_EEPROM_VERSION 7
52struct lasat_eeprom_struct {
53 unsigned int version;
54 unsigned int cfg[3];
55 unsigned char hwaddr[6];
56 unsigned char print_partno[12];
57 unsigned char term0;
58 unsigned char print_serial[14];
59 unsigned char term1;
60 unsigned char prod_partno[12];
61 unsigned char term2;
62 unsigned char prod_serial[14];
63 unsigned char term3;
64 unsigned char passwd_hash[16];
65 unsigned char pwdnull;
66 unsigned char vendid;
67 unsigned char ts_ref;
68 unsigned char ts_signoff;
69 unsigned char reserved[11];
70 unsigned char debugaccess;
71 unsigned short prid;
72 unsigned int serviceflag;
73 unsigned int ipaddr;
74 unsigned int netmask;
75 unsigned int crc32;
76};
77
78struct lasat_eeprom_struct_pre7 {
79 unsigned int version;
80 unsigned int flags[3];
81 unsigned char hwaddr0[6];
82 unsigned char hwaddr1[6];
83 unsigned char print_partno[9];
84 unsigned char term0;
85 unsigned char print_serial[14];
86 unsigned char term1;
87 unsigned char prod_partno[9];
88 unsigned char term2;
89 unsigned char prod_serial[14];
90 unsigned char term3;
91 unsigned char passwd_hash[24];
92 unsigned char pwdnull;
93 unsigned char vendor;
94 unsigned char ts_ref;
95 unsigned char ts_signoff;
96 unsigned char reserved[6];
97 unsigned int writecount;
98 unsigned int ipaddr;
99 unsigned int netmask;
100 unsigned int crc32;
101};
102
103/* Configuration descriptor encoding - see the doc for details */
104
105#define LASAT_W0_DSCTYPE(v) (((v)) & 0xf)
106#define LASAT_W0_BMID(v) (((v) >> 0x04) & 0xf)
107#define LASAT_W0_CPUTYPE(v) (((v) >> 0x08) & 0xf)
108#define LASAT_W0_BUSSPEED(v) (((v) >> 0x0c) & 0xf)
109#define LASAT_W0_CPUCLK(v) (((v) >> 0x10) & 0xf)
110#define LASAT_W0_SDRAMBANKSZ(v) (((v) >> 0x14) & 0xf)
111#define LASAT_W0_SDRAMBANKS(v) (((v) >> 0x18) & 0xf)
112#define LASAT_W0_L2CACHE(v) (((v) >> 0x1c) & 0xf)
113
114#define LASAT_W1_EDHAC(v) (((v)) & 0xf)
115#define LASAT_W1_HIFN(v) (((v) >> 0x04) & 0x1)
116#define LASAT_W1_ISDN(v) (((v) >> 0x05) & 0x1)
117#define LASAT_W1_IDE(v) (((v) >> 0x06) & 0x1)
118#define LASAT_W1_HDLC(v) (((v) >> 0x07) & 0x1)
119#define LASAT_W1_USVERSION(v) (((v) >> 0x08) & 0x1)
120#define LASAT_W1_4MACS(v) (((v) >> 0x09) & 0x1)
121#define LASAT_W1_EXTSERIAL(v) (((v) >> 0x0a) & 0x1)
122#define LASAT_W1_FLASHSIZE(v) (((v) >> 0x0c) & 0xf)
123#define LASAT_W1_PCISLOTS(v) (((v) >> 0x10) & 0xf)
124#define LASAT_W1_PCI1OPT(v) (((v) >> 0x14) & 0xf)
125#define LASAT_W1_PCI2OPT(v) (((v) >> 0x18) & 0xf)
126#define LASAT_W1_PCI3OPT(v) (((v) >> 0x1c) & 0xf)
127
128/* Routines specific to LASAT boards */
129
130#define LASAT_BMID_MASQUERADE2 0
131#define LASAT_BMID_MASQUERADEPRO 1
132#define LASAT_BMID_SAFEPIPE25 2
133#define LASAT_BMID_SAFEPIPE50 3
134#define LASAT_BMID_SAFEPIPE100 4
135#define LASAT_BMID_SAFEPIPE5000 5
136#define LASAT_BMID_SAFEPIPE7000 6
137#define LASAT_BMID_SAFEPIPE1000 7
138#if 0
139#define LASAT_BMID_SAFEPIPE30 7
140#define LASAT_BMID_SAFEPIPE5100 8
141#define LASAT_BMID_SAFEPIPE7100 9
142#endif
143#define LASAT_BMID_UNKNOWN 0xf
144#define LASAT_MAX_BMID_NAMES 9 /* no larger than 15! */
145
146#define LASAT_HAS_EDHAC (1 << 0)
147#define LASAT_EDHAC_FAST (1 << 1)
148#define LASAT_HAS_EADI (1 << 2)
149#define LASAT_HAS_HIFN (1 << 3)
150#define LASAT_HAS_ISDN (1 << 4)
151#define LASAT_HAS_LEASEDLINE_IF (1 << 5)
152#define LASAT_HAS_HDC (1 << 6)
153
154#define LASAT_PRID_MASQUERADE2 0
155#define LASAT_PRID_MASQUERADEPRO 1
156#define LASAT_PRID_SAFEPIPE25 2
157#define LASAT_PRID_SAFEPIPE50 3
158#define LASAT_PRID_SAFEPIPE100 4
159#define LASAT_PRID_SAFEPIPE5000 5
160#define LASAT_PRID_SAFEPIPE7000 6
161#define LASAT_PRID_SAFEPIPE30 7
162#define LASAT_PRID_SAFEPIPE5100 8
163#define LASAT_PRID_SAFEPIPE7100 9
164
165#define LASAT_PRID_SAFEPIPE1110 10
166#define LASAT_PRID_SAFEPIPE3020 11
167#define LASAT_PRID_SAFEPIPE3030 12
168#define LASAT_PRID_SAFEPIPE5020 13
169#define LASAT_PRID_SAFEPIPE5030 14
170#define LASAT_PRID_SAFEPIPE1120 15
171#define LASAT_PRID_SAFEPIPE1130 16
172#define LASAT_PRID_SAFEPIPE6010 17
173#define LASAT_PRID_SAFEPIPE6110 18
174#define LASAT_PRID_SAFEPIPE6210 19
175#define LASAT_PRID_SAFEPIPE1020 20
176#define LASAT_PRID_SAFEPIPE1040 21
177#define LASAT_PRID_SAFEPIPE1060 22
178
179struct lasat_info {
180 unsigned int li_cpu_hz;
181 unsigned int li_bus_hz;
182 unsigned int li_bmid;
183 unsigned int li_memsize;
184 unsigned int li_flash_size;
185 unsigned int li_prid;
186 unsigned char li_bmstr[16];
187 unsigned char li_namestr[32];
188 unsigned char li_typestr[16];
189 /* Info on the Flash layout */
190 unsigned int li_flash_base;
191 unsigned long li_flashpart_base[LASAT_MTD_LAST];
192 unsigned long li_flashpart_size[LASAT_MTD_LAST];
193 struct lasat_eeprom_struct li_eeprom_info;
194 unsigned int li_eeprom_upgrade_version;
195 unsigned int li_debugaccess;
196};
197
198extern struct lasat_info lasat_board_info;
199
200static inline unsigned long lasat_flash_partition_start(int partno)
201{
202 if (partno < 0 || partno >= LASAT_MTD_LAST)
203 return 0;
204
205 return lasat_board_info.li_flashpart_base[partno];
206}
207
208static inline unsigned long lasat_flash_partition_size(int partno)
209{
210 if (partno < 0 || partno >= LASAT_MTD_LAST)
211 return 0;
212
213 return lasat_board_info.li_flashpart_size[partno];
214}
215
216/* Called from setup() to initialize the global board_info struct */
217extern int lasat_init_board_info(void);
218
219/* Write the modified EEPROM info struct */
220extern void lasat_write_eeprom_info(void);
221
222#define N_MACHTYPES 2
223/* for calibration of delays */
224
225/* the lasat_ndelay function is necessary because it is used at an
226 * early stage of the boot process where ndelay is not calibrated.
227 * It is used for the bit-banging rtc and eeprom drivers */
228
229#include <linux/delay.h>
230
231/* calculating with the slowest board with 100 MHz clock */
232#define LASAT_100_DIVIDER 20
233/* All 200's run at 250 MHz clock */
234#define LASAT_200_DIVIDER 8
235
236extern unsigned int lasat_ndelay_divider;
237
238static inline void lasat_ndelay(unsigned int ns)
239{
240 __delay(ns / lasat_ndelay_divider);
241}
242
243#define IS_LASAT_200() (current_cpu_data.cputype == CPU_R5000)
244
245#endif /* !defined (_LANGUAGE_ASSEMBLY) */
246
247#define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef
248#define LASAT_SERVICEMODE_MAGIC_2 0xfedeabba
249
250/* Lasat 100 boards */
251#define LASAT_GT_BASE (KSEG1ADDR(0x14000000))
252
253/* Lasat 200 boards */
254#define Vrc5074_PHYS_BASE 0x1fa00000
255#define Vrc5074_BASE (KSEG1ADDR(Vrc5074_PHYS_BASE))
256#define PCI_WINDOW1 0x1a000000
257
258#endif /* _LASAT_H */
diff --git a/include/asm-mips/lasat/lasatint.h b/include/asm-mips/lasat/lasatint.h
deleted file mode 100644
index e0d2458b43d0..000000000000
--- a/include/asm-mips/lasat/lasatint.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef __ASM_LASAT_LASATINT_H
2#define __ASM_LASAT_LASATINT_H
3
4/* lasat 100 */
5#define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000))
6#define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000))
7#define LASATINT_MASK_SHIFT_100 0
8
9/* lasat 200 */
10#define LASAT_INT_STATUS_REG_200 (KSEG1ADDR(0x1104003c))
11#define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c))
12#define LASATINT_MASK_SHIFT_200 16
13
14#endif /* __ASM_LASAT_LASATINT_H */
diff --git a/include/asm-mips/lasat/picvue.h b/include/asm-mips/lasat/picvue.h
deleted file mode 100644
index 42a492edc40e..000000000000
--- a/include/asm-mips/lasat/picvue.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/* Lasat 100 */
2#define PVC_REG_100 KSEG1ADDR(0x1c820000)
3#define PVC_DATA_SHIFT_100 0
4#define PVC_DATA_M_100 0xFF
5#define PVC_E_100 (1 << 8)
6#define PVC_RW_100 (1 << 9)
7#define PVC_RS_100 (1 << 10)
8
9/* Lasat 200 */
10#define PVC_REG_200 KSEG1ADDR(0x11000000)
11#define PVC_DATA_SHIFT_200 24
12#define PVC_DATA_M_200 (0xFF << PVC_DATA_SHIFT_200)
13#define PVC_E_200 (1 << 16)
14#define PVC_RW_200 (1 << 17)
15#define PVC_RS_200 (1 << 18)
diff --git a/include/asm-mips/lasat/serial.h b/include/asm-mips/lasat/serial.h
deleted file mode 100644
index 1c37d70579b8..000000000000
--- a/include/asm-mips/lasat/serial.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#include <asm/lasat/lasat.h>
2
3/* Lasat 100 boards serial configuration */
4#define LASAT_BASE_BAUD_100 (7372800 / 16)
5#define LASAT_UART_REGS_BASE_100 0x1c8b0000
6#define LASAT_UART_REGS_SHIFT_100 2
7#define LASATINT_UART_100 16
8
9/* * LASAT 200 boards serial configuration */
10#define LASAT_BASE_BAUD_200 (100000000 / 16 / 12)
11#define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300)
12#define LASAT_UART_REGS_SHIFT_200 3
13#define LASATINT_UART_200 21
diff --git a/include/asm-mips/linkage.h b/include/asm-mips/linkage.h
deleted file mode 100644
index e9a940d1b0c6..000000000000
--- a/include/asm-mips/linkage.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __ASM_LINKAGE_H
2#define __ASM_LINKAGE_H
3
4#ifdef __ASSEMBLY__
5#include <asm/asm.h>
6#endif
7
8#define __weak __attribute__((weak))
9
10#endif
diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h
deleted file mode 100644
index f96fd59e0845..000000000000
--- a/include/asm-mips/local.h
+++ /dev/null
@@ -1,221 +0,0 @@
1#ifndef _ARCH_MIPS_LOCAL_H
2#define _ARCH_MIPS_LOCAL_H
3
4#include <linux/percpu.h>
5#include <linux/bitops.h>
6#include <asm/atomic.h>
7#include <asm/cmpxchg.h>
8#include <asm/war.h>
9
10typedef struct
11{
12 atomic_long_t a;
13} local_t;
14
15#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
16
17#define local_read(l) atomic_long_read(&(l)->a)
18#define local_set(l, i) atomic_long_set(&(l)->a, (i))
19
20#define local_add(i, l) atomic_long_add((i), (&(l)->a))
21#define local_sub(i, l) atomic_long_sub((i), (&(l)->a))
22#define local_inc(l) atomic_long_inc(&(l)->a)
23#define local_dec(l) atomic_long_dec(&(l)->a)
24
25/*
26 * Same as above, but return the result value
27 */
28static __inline__ long local_add_return(long i, local_t * l)
29{
30 unsigned long result;
31
32 if (cpu_has_llsc && R10000_LLSC_WAR) {
33 unsigned long temp;
34
35 __asm__ __volatile__(
36 " .set mips3 \n"
37 "1:" __LL "%1, %2 # local_add_return \n"
38 " addu %0, %1, %3 \n"
39 __SC "%0, %2 \n"
40 " beqzl %0, 1b \n"
41 " addu %0, %1, %3 \n"
42 " .set mips0 \n"
43 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
44 : "Ir" (i), "m" (l->a.counter)
45 : "memory");
46 } else if (cpu_has_llsc) {
47 unsigned long temp;
48
49 __asm__ __volatile__(
50 " .set mips3 \n"
51 "1:" __LL "%1, %2 # local_add_return \n"
52 " addu %0, %1, %3 \n"
53 __SC "%0, %2 \n"
54 " beqz %0, 1b \n"
55 " addu %0, %1, %3 \n"
56 " .set mips0 \n"
57 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
58 : "Ir" (i), "m" (l->a.counter)
59 : "memory");
60 } else {
61 unsigned long flags;
62
63 local_irq_save(flags);
64 result = l->a.counter;
65 result += i;
66 l->a.counter = result;
67 local_irq_restore(flags);
68 }
69
70 return result;
71}
72
73static __inline__ long local_sub_return(long i, local_t * l)
74{
75 unsigned long result;
76
77 if (cpu_has_llsc && R10000_LLSC_WAR) {
78 unsigned long temp;
79
80 __asm__ __volatile__(
81 " .set mips3 \n"
82 "1:" __LL "%1, %2 # local_sub_return \n"
83 " subu %0, %1, %3 \n"
84 __SC "%0, %2 \n"
85 " beqzl %0, 1b \n"
86 " subu %0, %1, %3 \n"
87 " .set mips0 \n"
88 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
89 : "Ir" (i), "m" (l->a.counter)
90 : "memory");
91 } else if (cpu_has_llsc) {
92 unsigned long temp;
93
94 __asm__ __volatile__(
95 " .set mips3 \n"
96 "1:" __LL "%1, %2 # local_sub_return \n"
97 " subu %0, %1, %3 \n"
98 __SC "%0, %2 \n"
99 " beqz %0, 1b \n"
100 " subu %0, %1, %3 \n"
101 " .set mips0 \n"
102 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
103 : "Ir" (i), "m" (l->a.counter)
104 : "memory");
105 } else {
106 unsigned long flags;
107
108 local_irq_save(flags);
109 result = l->a.counter;
110 result -= i;
111 l->a.counter = result;
112 local_irq_restore(flags);
113 }
114
115 return result;
116}
117
118#define local_cmpxchg(l, o, n) \
119 ((long)cmpxchg_local(&((l)->a.counter), (o), (n)))
120#define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n)))
121
122/**
123 * local_add_unless - add unless the number is a given value
124 * @l: pointer of type local_t
125 * @a: the amount to add to l...
126 * @u: ...unless l is equal to u.
127 *
128 * Atomically adds @a to @l, so long as it was not @u.
129 * Returns non-zero if @l was not @u, and zero otherwise.
130 */
131#define local_add_unless(l, a, u) \
132({ \
133 long c, old; \
134 c = local_read(l); \
135 while (c != (u) && (old = local_cmpxchg((l), c, c + (a))) != c) \
136 c = old; \
137 c != (u); \
138})
139#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
140
141#define local_dec_return(l) local_sub_return(1, (l))
142#define local_inc_return(l) local_add_return(1, (l))
143
144/*
145 * local_sub_and_test - subtract value from variable and test result
146 * @i: integer value to subtract
147 * @l: pointer of type local_t
148 *
149 * Atomically subtracts @i from @l and returns
150 * true if the result is zero, or false for all
151 * other cases.
152 */
153#define local_sub_and_test(i, l) (local_sub_return((i), (l)) == 0)
154
155/*
156 * local_inc_and_test - increment and test
157 * @l: pointer of type local_t
158 *
159 * Atomically increments @l by 1
160 * and returns true if the result is zero, or false for all
161 * other cases.
162 */
163#define local_inc_and_test(l) (local_inc_return(l) == 0)
164
165/*
166 * local_dec_and_test - decrement by 1 and test
167 * @l: pointer of type local_t
168 *
169 * Atomically decrements @l by 1 and
170 * returns true if the result is 0, or false for all other
171 * cases.
172 */
173#define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
174
175/*
176 * local_add_negative - add and test if negative
177 * @l: pointer of type local_t
178 * @i: integer value to add
179 *
180 * Atomically adds @i to @l and returns true
181 * if the result is negative, or false when
182 * result is greater than or equal to zero.
183 */
184#define local_add_negative(i, l) (local_add_return(i, (l)) < 0)
185
186/* Use these for per-cpu local_t variables: on some archs they are
187 * much more efficient than these naive implementations. Note they take
188 * a variable, not an address.
189 */
190
191#define __local_inc(l) ((l)->a.counter++)
192#define __local_dec(l) ((l)->a.counter++)
193#define __local_add(i, l) ((l)->a.counter+=(i))
194#define __local_sub(i, l) ((l)->a.counter-=(i))
195
196/* Need to disable preemption for the cpu local counters otherwise we could
197 still access a variable of a previous CPU in a non atomic way. */
198#define cpu_local_wrap_v(l) \
199 ({ local_t res__; \
200 preempt_disable(); \
201 res__ = (l); \
202 preempt_enable(); \
203 res__; })
204#define cpu_local_wrap(l) \
205 ({ preempt_disable(); \
206 l; \
207 preempt_enable(); }) \
208
209#define cpu_local_read(l) cpu_local_wrap_v(local_read(&__get_cpu_var(l)))
210#define cpu_local_set(l, i) cpu_local_wrap(local_set(&__get_cpu_var(l), (i)))
211#define cpu_local_inc(l) cpu_local_wrap(local_inc(&__get_cpu_var(l)))
212#define cpu_local_dec(l) cpu_local_wrap(local_dec(&__get_cpu_var(l)))
213#define cpu_local_add(i, l) cpu_local_wrap(local_add((i), &__get_cpu_var(l)))
214#define cpu_local_sub(i, l) cpu_local_wrap(local_sub((i), &__get_cpu_var(l)))
215
216#define __cpu_local_inc(l) cpu_local_inc(l)
217#define __cpu_local_dec(l) cpu_local_dec(l)
218#define __cpu_local_add(i, l) cpu_local_add((i), (l))
219#define __cpu_local_sub(i, l) cpu_local_sub((i), (l))
220
221#endif /* _ARCH_MIPS_LOCAL_H */
diff --git a/include/asm-mips/m48t35.h b/include/asm-mips/m48t35.h
deleted file mode 100644
index f44852e9a96d..000000000000
--- a/include/asm-mips/m48t35.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
3 */
4#ifndef _ASM_M48T35_H
5#define _ASM_M48T35_H
6
7#include <linux/spinlock.h>
8
9extern spinlock_t rtc_lock;
10
11struct m48t35_rtc {
12 volatile u8 pad[0x7ff8]; /* starts at 0x7ff8 */
13 volatile u8 control;
14 volatile u8 sec;
15 volatile u8 min;
16 volatile u8 hour;
17 volatile u8 day;
18 volatile u8 date;
19 volatile u8 month;
20 volatile u8 year;
21};
22
23#define M48T35_RTC_SET 0x80
24#define M48T35_RTC_STOPPED 0x80
25#define M48T35_RTC_READ 0x40
26
27#endif /* _ASM_M48T35_H */
diff --git a/include/asm-mips/m48t37.h b/include/asm-mips/m48t37.h
deleted file mode 100644
index cabf86264f36..000000000000
--- a/include/asm-mips/m48t37.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Registers for the SGS-Thomson M48T37 Timekeeper RAM chip
3 */
4#ifndef _ASM_M48T37_H
5#define _ASM_M48T37_H
6
7#include <linux/spinlock.h>
8
9extern spinlock_t rtc_lock;
10
11struct m48t37_rtc {
12 volatile u8 pad[0x7ff0]; /* NVRAM */
13 volatile u8 flags;
14 volatile u8 century;
15 volatile u8 alarm_sec;
16 volatile u8 alarm_min;
17 volatile u8 alarm_hour;
18 volatile u8 alarm_data;
19 volatile u8 interrupts;
20 volatile u8 watchdog;
21 volatile u8 control;
22 volatile u8 sec;
23 volatile u8 min;
24 volatile u8 hour;
25 volatile u8 day;
26 volatile u8 date;
27 volatile u8 month;
28 volatile u8 year;
29};
30
31#define M48T37_RTC_SET 0x80
32#define M48T37_RTC_STOPPED 0x80
33#define M48T37_RTC_READ 0x40
34
35#endif /* _ASM_M48T37_H */
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
deleted file mode 100644
index 0d302bad4492..000000000000
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ /dev/null
@@ -1,1772 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Include file for Alchemy Semiconductor's Au1k CPU.
5 *
6 * Copyright 2000-2001, 2006-2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30 /*
31 * some definitions add by takuzo@sm.sony.co.jp and sato@sm.sony.co.jp
32 */
33
34#ifndef _AU1000_H_
35#define _AU1000_H_
36
37
38#ifndef _LANGUAGE_ASSEMBLY
39
40#include <linux/delay.h>
41#include <linux/types.h>
42
43#include <linux/io.h>
44#include <linux/irq.h>
45
46/* cpu pipeline flush */
47void static inline au_sync(void)
48{
49 __asm__ volatile ("sync");
50}
51
52void static inline au_sync_udelay(int us)
53{
54 __asm__ volatile ("sync");
55 udelay(us);
56}
57
58void static inline au_sync_delay(int ms)
59{
60 __asm__ volatile ("sync");
61 mdelay(ms);
62}
63
64void static inline au_writeb(u8 val, unsigned long reg)
65{
66 *(volatile u8 *)reg = val;
67}
68
69void static inline au_writew(u16 val, unsigned long reg)
70{
71 *(volatile u16 *)reg = val;
72}
73
74void static inline au_writel(u32 val, unsigned long reg)
75{
76 *(volatile u32 *)reg = val;
77}
78
79static inline u8 au_readb(unsigned long reg)
80{
81 return *(volatile u8 *)reg;
82}
83
84static inline u16 au_readw(unsigned long reg)
85{
86 return *(volatile u16 *)reg;
87}
88
89static inline u32 au_readl(unsigned long reg)
90{
91 return *(volatile u32 *)reg;
92}
93
94
95/* arch/mips/au1000/common/clocks.c */
96extern void set_au1x00_speed(unsigned int new_freq);
97extern unsigned int get_au1x00_speed(void);
98extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
99extern unsigned long get_au1x00_uart_baud_base(void);
100extern void set_au1x00_lcd_clock(void);
101extern unsigned int get_au1x00_lcd_clock(void);
102
103/*
104 * Every board describes its IRQ mapping with this table.
105 */
106struct au1xxx_irqmap {
107 int im_irq;
108 int im_type;
109 int im_request;
110};
111
112/*
113 * init_IRQ looks for a table with this name.
114 */
115extern struct au1xxx_irqmap au1xxx_irq_map[];
116
117#endif /* !defined (_LANGUAGE_ASSEMBLY) */
118
119/*
120 * SDRAM register offsets
121 */
122#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || \
123 defined(CONFIG_SOC_AU1100)
124#define MEM_SDMODE0 0x0000
125#define MEM_SDMODE1 0x0004
126#define MEM_SDMODE2 0x0008
127#define MEM_SDADDR0 0x000C
128#define MEM_SDADDR1 0x0010
129#define MEM_SDADDR2 0x0014
130#define MEM_SDREFCFG 0x0018
131#define MEM_SDPRECMD 0x001C
132#define MEM_SDAUTOREF 0x0020
133#define MEM_SDWRMD0 0x0024
134#define MEM_SDWRMD1 0x0028
135#define MEM_SDWRMD2 0x002C
136#define MEM_SDSLEEP 0x0030
137#define MEM_SDSMCKE 0x0034
138
139/*
140 * MEM_SDMODE register content definitions
141 */
142#define MEM_SDMODE_F (1 << 22)
143#define MEM_SDMODE_SR (1 << 21)
144#define MEM_SDMODE_BS (1 << 20)
145#define MEM_SDMODE_RS (3 << 18)
146#define MEM_SDMODE_CS (7 << 15)
147#define MEM_SDMODE_TRAS (15 << 11)
148#define MEM_SDMODE_TMRD (3 << 9)
149#define MEM_SDMODE_TWR (3 << 7)
150#define MEM_SDMODE_TRP (3 << 5)
151#define MEM_SDMODE_TRCD (3 << 3)
152#define MEM_SDMODE_TCL (7 << 0)
153
154#define MEM_SDMODE_BS_2Bank (0 << 20)
155#define MEM_SDMODE_BS_4Bank (1 << 20)
156#define MEM_SDMODE_RS_11Row (0 << 18)
157#define MEM_SDMODE_RS_12Row (1 << 18)
158#define MEM_SDMODE_RS_13Row (2 << 18)
159#define MEM_SDMODE_RS_N(N) ((N) << 18)
160#define MEM_SDMODE_CS_7Col (0 << 15)
161#define MEM_SDMODE_CS_8Col (1 << 15)
162#define MEM_SDMODE_CS_9Col (2 << 15)
163#define MEM_SDMODE_CS_10Col (3 << 15)
164#define MEM_SDMODE_CS_11Col (4 << 15)
165#define MEM_SDMODE_CS_N(N) ((N) << 15)
166#define MEM_SDMODE_TRAS_N(N) ((N) << 11)
167#define MEM_SDMODE_TMRD_N(N) ((N) << 9)
168#define MEM_SDMODE_TWR_N(N) ((N) << 7)
169#define MEM_SDMODE_TRP_N(N) ((N) << 5)
170#define MEM_SDMODE_TRCD_N(N) ((N) << 3)
171#define MEM_SDMODE_TCL_N(N) ((N) << 0)
172
173/*
174 * MEM_SDADDR register contents definitions
175 */
176#define MEM_SDADDR_E (1 << 20)
177#define MEM_SDADDR_CSBA (0x03FF << 10)
178#define MEM_SDADDR_CSMASK (0x03FF << 0)
179#define MEM_SDADDR_CSBA_N(N) ((N) & (0x03FF << 22) >> 12)
180#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF << 22) >> 22)
181
182/*
183 * MEM_SDREFCFG register content definitions
184 */
185#define MEM_SDREFCFG_TRC (15 << 28)
186#define MEM_SDREFCFG_TRPM (3 << 26)
187#define MEM_SDREFCFG_E (1 << 25)
188#define MEM_SDREFCFG_RE (0x1ffffff << 0)
189#define MEM_SDREFCFG_TRC_N(N) ((N) << MEM_SDREFCFG_TRC)
190#define MEM_SDREFCFG_TRPM_N(N) ((N) << MEM_SDREFCFG_TRPM)
191#define MEM_SDREFCFG_REF_N(N) (N)
192#endif
193
194/***********************************************************************/
195
196/*
197 * Au1550 SDRAM Register Offsets
198 */
199
200/***********************************************************************/
201
202#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
203#define MEM_SDMODE0 0x0800
204#define MEM_SDMODE1 0x0808
205#define MEM_SDMODE2 0x0810
206#define MEM_SDADDR0 0x0820
207#define MEM_SDADDR1 0x0828
208#define MEM_SDADDR2 0x0830
209#define MEM_SDCONFIGA 0x0840
210#define MEM_SDCONFIGB 0x0848
211#define MEM_SDSTAT 0x0850
212#define MEM_SDERRADDR 0x0858
213#define MEM_SDSTRIDE0 0x0860
214#define MEM_SDSTRIDE1 0x0868
215#define MEM_SDSTRIDE2 0x0870
216#define MEM_SDWRMD0 0x0880
217#define MEM_SDWRMD1 0x0888
218#define MEM_SDWRMD2 0x0890
219#define MEM_SDPRECMD 0x08C0
220#define MEM_SDAUTOREF 0x08C8
221#define MEM_SDSREF 0x08D0
222#define MEM_SDSLEEP MEM_SDSREF
223
224#endif
225
226/*
227 * Physical base addresses for integrated peripherals
228 */
229
230#ifdef CONFIG_SOC_AU1000
231#define MEM_PHYS_ADDR 0x14000000
232#define STATIC_MEM_PHYS_ADDR 0x14001000
233#define DMA0_PHYS_ADDR 0x14002000
234#define DMA1_PHYS_ADDR 0x14002100
235#define DMA2_PHYS_ADDR 0x14002200
236#define DMA3_PHYS_ADDR 0x14002300
237#define DMA4_PHYS_ADDR 0x14002400
238#define DMA5_PHYS_ADDR 0x14002500
239#define DMA6_PHYS_ADDR 0x14002600
240#define DMA7_PHYS_ADDR 0x14002700
241#define IC0_PHYS_ADDR 0x10400000
242#define IC1_PHYS_ADDR 0x11800000
243#define AC97_PHYS_ADDR 0x10000000
244#define USBH_PHYS_ADDR 0x10100000
245#define USBD_PHYS_ADDR 0x10200000
246#define IRDA_PHYS_ADDR 0x10300000
247#define MAC0_PHYS_ADDR 0x10500000
248#define MAC1_PHYS_ADDR 0x10510000
249#define MACEN_PHYS_ADDR 0x10520000
250#define MACDMA0_PHYS_ADDR 0x14004000
251#define MACDMA1_PHYS_ADDR 0x14004200
252#define I2S_PHYS_ADDR 0x11000000
253#define UART0_PHYS_ADDR 0x11100000
254#define UART1_PHYS_ADDR 0x11200000
255#define UART2_PHYS_ADDR 0x11300000
256#define UART3_PHYS_ADDR 0x11400000
257#define SSI0_PHYS_ADDR 0x11600000
258#define SSI1_PHYS_ADDR 0x11680000
259#define SYS_PHYS_ADDR 0x11900000
260#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
261#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
262#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
263#endif
264
265/********************************************************************/
266
267#ifdef CONFIG_SOC_AU1500
268#define MEM_PHYS_ADDR 0x14000000
269#define STATIC_MEM_PHYS_ADDR 0x14001000
270#define DMA0_PHYS_ADDR 0x14002000
271#define DMA1_PHYS_ADDR 0x14002100
272#define DMA2_PHYS_ADDR 0x14002200
273#define DMA3_PHYS_ADDR 0x14002300
274#define DMA4_PHYS_ADDR 0x14002400
275#define DMA5_PHYS_ADDR 0x14002500
276#define DMA6_PHYS_ADDR 0x14002600
277#define DMA7_PHYS_ADDR 0x14002700
278#define IC0_PHYS_ADDR 0x10400000
279#define IC1_PHYS_ADDR 0x11800000
280#define AC97_PHYS_ADDR 0x10000000
281#define USBH_PHYS_ADDR 0x10100000
282#define USBD_PHYS_ADDR 0x10200000
283#define PCI_PHYS_ADDR 0x14005000
284#define MAC0_PHYS_ADDR 0x11500000
285#define MAC1_PHYS_ADDR 0x11510000
286#define MACEN_PHYS_ADDR 0x11520000
287#define MACDMA0_PHYS_ADDR 0x14004000
288#define MACDMA1_PHYS_ADDR 0x14004200
289#define I2S_PHYS_ADDR 0x11000000
290#define UART0_PHYS_ADDR 0x11100000
291#define UART3_PHYS_ADDR 0x11400000
292#define GPIO2_PHYS_ADDR 0x11700000
293#define SYS_PHYS_ADDR 0x11900000
294#define PCI_MEM_PHYS_ADDR 0x400000000ULL
295#define PCI_IO_PHYS_ADDR 0x500000000ULL
296#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
297#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
298#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
299#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
300#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
301#endif
302
303/********************************************************************/
304
305#ifdef CONFIG_SOC_AU1100
306#define MEM_PHYS_ADDR 0x14000000
307#define STATIC_MEM_PHYS_ADDR 0x14001000
308#define DMA0_PHYS_ADDR 0x14002000
309#define DMA1_PHYS_ADDR 0x14002100
310#define DMA2_PHYS_ADDR 0x14002200
311#define DMA3_PHYS_ADDR 0x14002300
312#define DMA4_PHYS_ADDR 0x14002400
313#define DMA5_PHYS_ADDR 0x14002500
314#define DMA6_PHYS_ADDR 0x14002600
315#define DMA7_PHYS_ADDR 0x14002700
316#define IC0_PHYS_ADDR 0x10400000
317#define SD0_PHYS_ADDR 0x10600000
318#define SD1_PHYS_ADDR 0x10680000
319#define IC1_PHYS_ADDR 0x11800000
320#define AC97_PHYS_ADDR 0x10000000
321#define USBH_PHYS_ADDR 0x10100000
322#define USBD_PHYS_ADDR 0x10200000
323#define IRDA_PHYS_ADDR 0x10300000
324#define MAC0_PHYS_ADDR 0x10500000
325#define MACEN_PHYS_ADDR 0x10520000
326#define MACDMA0_PHYS_ADDR 0x14004000
327#define MACDMA1_PHYS_ADDR 0x14004200
328#define I2S_PHYS_ADDR 0x11000000
329#define UART0_PHYS_ADDR 0x11100000
330#define UART1_PHYS_ADDR 0x11200000
331#define UART3_PHYS_ADDR 0x11400000
332#define SSI0_PHYS_ADDR 0x11600000
333#define SSI1_PHYS_ADDR 0x11680000
334#define GPIO2_PHYS_ADDR 0x11700000
335#define SYS_PHYS_ADDR 0x11900000
336#define LCD_PHYS_ADDR 0x15000000
337#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
338#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
339#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
340#endif
341
342/***********************************************************************/
343
344#ifdef CONFIG_SOC_AU1550
345#define MEM_PHYS_ADDR 0x14000000
346#define STATIC_MEM_PHYS_ADDR 0x14001000
347#define IC0_PHYS_ADDR 0x10400000
348#define IC1_PHYS_ADDR 0x11800000
349#define USBH_PHYS_ADDR 0x14020000
350#define USBD_PHYS_ADDR 0x10200000
351#define PCI_PHYS_ADDR 0x14005000
352#define MAC0_PHYS_ADDR 0x10500000
353#define MAC1_PHYS_ADDR 0x10510000
354#define MACEN_PHYS_ADDR 0x10520000
355#define MACDMA0_PHYS_ADDR 0x14004000
356#define MACDMA1_PHYS_ADDR 0x14004200
357#define UART0_PHYS_ADDR 0x11100000
358#define UART1_PHYS_ADDR 0x11200000
359#define UART3_PHYS_ADDR 0x11400000
360#define GPIO2_PHYS_ADDR 0x11700000
361#define SYS_PHYS_ADDR 0x11900000
362#define DDMA_PHYS_ADDR 0x14002000
363#define PE_PHYS_ADDR 0x14008000
364#define PSC0_PHYS_ADDR 0x11A00000
365#define PSC1_PHYS_ADDR 0x11B00000
366#define PSC2_PHYS_ADDR 0x10A00000
367#define PSC3_PHYS_ADDR 0x10B00000
368#define PCI_MEM_PHYS_ADDR 0x400000000ULL
369#define PCI_IO_PHYS_ADDR 0x500000000ULL
370#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
371#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
372#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
373#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
374#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
375#endif
376
377/***********************************************************************/
378
379#ifdef CONFIG_SOC_AU1200
380#define MEM_PHYS_ADDR 0x14000000
381#define STATIC_MEM_PHYS_ADDR 0x14001000
382#define AES_PHYS_ADDR 0x10300000
383#define CIM_PHYS_ADDR 0x14004000
384#define IC0_PHYS_ADDR 0x10400000
385#define IC1_PHYS_ADDR 0x11800000
386#define USBM_PHYS_ADDR 0x14020000
387#define USBH_PHYS_ADDR 0x14020100
388#define UART0_PHYS_ADDR 0x11100000
389#define UART1_PHYS_ADDR 0x11200000
390#define GPIO2_PHYS_ADDR 0x11700000
391#define SYS_PHYS_ADDR 0x11900000
392#define DDMA_PHYS_ADDR 0x14002000
393#define PSC0_PHYS_ADDR 0x11A00000
394#define PSC1_PHYS_ADDR 0x11B00000
395#define SD0_PHYS_ADDR 0x10600000
396#define SD1_PHYS_ADDR 0x10680000
397#define LCD_PHYS_ADDR 0x15000000
398#define SWCNT_PHYS_ADDR 0x1110010C
399#define MAEFE_PHYS_ADDR 0x14012000
400#define MAEBE_PHYS_ADDR 0x14010000
401#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
402#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
403#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
404#endif
405
406/* Static Bus Controller */
407#define MEM_STCFG0 0xB4001000
408#define MEM_STTIME0 0xB4001004
409#define MEM_STADDR0 0xB4001008
410
411#define MEM_STCFG1 0xB4001010
412#define MEM_STTIME1 0xB4001014
413#define MEM_STADDR1 0xB4001018
414
415#define MEM_STCFG2 0xB4001020
416#define MEM_STTIME2 0xB4001024
417#define MEM_STADDR2 0xB4001028
418
419#define MEM_STCFG3 0xB4001030
420#define MEM_STTIME3 0xB4001034
421#define MEM_STADDR3 0xB4001038
422
423#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
424#define MEM_STNDCTL 0xB4001100
425#define MEM_STSTAT 0xB4001104
426
427#define MEM_STNAND_CMD 0x0
428#define MEM_STNAND_ADDR 0x4
429#define MEM_STNAND_DATA 0x20
430#endif
431
432/* Interrupt Controller 0 */
433#define IC0_CFG0RD 0xB0400040
434#define IC0_CFG0SET 0xB0400040
435#define IC0_CFG0CLR 0xB0400044
436
437#define IC0_CFG1RD 0xB0400048
438#define IC0_CFG1SET 0xB0400048
439#define IC0_CFG1CLR 0xB040004C
440
441#define IC0_CFG2RD 0xB0400050
442#define IC0_CFG2SET 0xB0400050
443#define IC0_CFG2CLR 0xB0400054
444
445#define IC0_REQ0INT 0xB0400054
446#define IC0_SRCRD 0xB0400058
447#define IC0_SRCSET 0xB0400058
448#define IC0_SRCCLR 0xB040005C
449#define IC0_REQ1INT 0xB040005C
450
451#define IC0_ASSIGNRD 0xB0400060
452#define IC0_ASSIGNSET 0xB0400060
453#define IC0_ASSIGNCLR 0xB0400064
454
455#define IC0_WAKERD 0xB0400068
456#define IC0_WAKESET 0xB0400068
457#define IC0_WAKECLR 0xB040006C
458
459#define IC0_MASKRD 0xB0400070
460#define IC0_MASKSET 0xB0400070
461#define IC0_MASKCLR 0xB0400074
462
463#define IC0_RISINGRD 0xB0400078
464#define IC0_RISINGCLR 0xB0400078
465#define IC0_FALLINGRD 0xB040007C
466#define IC0_FALLINGCLR 0xB040007C
467
468#define IC0_TESTBIT 0xB0400080
469
470/* Interrupt Controller 1 */
471#define IC1_CFG0RD 0xB1800040
472#define IC1_CFG0SET 0xB1800040
473#define IC1_CFG0CLR 0xB1800044
474
475#define IC1_CFG1RD 0xB1800048
476#define IC1_CFG1SET 0xB1800048
477#define IC1_CFG1CLR 0xB180004C
478
479#define IC1_CFG2RD 0xB1800050
480#define IC1_CFG2SET 0xB1800050
481#define IC1_CFG2CLR 0xB1800054
482
483#define IC1_REQ0INT 0xB1800054
484#define IC1_SRCRD 0xB1800058
485#define IC1_SRCSET 0xB1800058
486#define IC1_SRCCLR 0xB180005C
487#define IC1_REQ1INT 0xB180005C
488
489#define IC1_ASSIGNRD 0xB1800060
490#define IC1_ASSIGNSET 0xB1800060
491#define IC1_ASSIGNCLR 0xB1800064
492
493#define IC1_WAKERD 0xB1800068
494#define IC1_WAKESET 0xB1800068
495#define IC1_WAKECLR 0xB180006C
496
497#define IC1_MASKRD 0xB1800070
498#define IC1_MASKSET 0xB1800070
499#define IC1_MASKCLR 0xB1800074
500
501#define IC1_RISINGRD 0xB1800078
502#define IC1_RISINGCLR 0xB1800078
503#define IC1_FALLINGRD 0xB180007C
504#define IC1_FALLINGCLR 0xB180007C
505
506#define IC1_TESTBIT 0xB1800080
507
508/* Interrupt Configuration Modes */
509#define INTC_INT_DISABLED 0x0
510#define INTC_INT_RISE_EDGE 0x1
511#define INTC_INT_FALL_EDGE 0x2
512#define INTC_INT_RISE_AND_FALL_EDGE 0x3
513#define INTC_INT_HIGH_LEVEL 0x5
514#define INTC_INT_LOW_LEVEL 0x6
515#define INTC_INT_HIGH_AND_LOW_LEVEL 0x7
516
517/* Interrupt Numbers */
518/* Au1000 */
519#ifdef CONFIG_SOC_AU1000
520enum soc_au1000_ints {
521 AU1000_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
522 AU1000_UART0_INT = AU1000_FIRST_INT,
523 AU1000_UART1_INT, /* au1000 */
524 AU1000_UART2_INT, /* au1000 */
525 AU1000_UART3_INT,
526 AU1000_SSI0_INT, /* au1000 */
527 AU1000_SSI1_INT, /* au1000 */
528 AU1000_DMA_INT_BASE,
529
530 AU1000_TOY_INT = AU1000_FIRST_INT + 14,
531 AU1000_TOY_MATCH0_INT,
532 AU1000_TOY_MATCH1_INT,
533 AU1000_TOY_MATCH2_INT,
534 AU1000_RTC_INT,
535 AU1000_RTC_MATCH0_INT,
536 AU1000_RTC_MATCH1_INT,
537 AU1000_RTC_MATCH2_INT,
538 AU1000_IRDA_TX_INT, /* au1000 */
539 AU1000_IRDA_RX_INT, /* au1000 */
540 AU1000_USB_DEV_REQ_INT,
541 AU1000_USB_DEV_SUS_INT,
542 AU1000_USB_HOST_INT,
543 AU1000_ACSYNC_INT,
544 AU1000_MAC0_DMA_INT,
545 AU1000_MAC1_DMA_INT,
546 AU1000_I2S_UO_INT, /* au1000 */
547 AU1000_AC97C_INT,
548 AU1000_GPIO_0,
549 AU1000_GPIO_1,
550 AU1000_GPIO_2,
551 AU1000_GPIO_3,
552 AU1000_GPIO_4,
553 AU1000_GPIO_5,
554 AU1000_GPIO_6,
555 AU1000_GPIO_7,
556 AU1000_GPIO_8,
557 AU1000_GPIO_9,
558 AU1000_GPIO_10,
559 AU1000_GPIO_11,
560 AU1000_GPIO_12,
561 AU1000_GPIO_13,
562 AU1000_GPIO_14,
563 AU1000_GPIO_15,
564 AU1000_GPIO_16,
565 AU1000_GPIO_17,
566 AU1000_GPIO_18,
567 AU1000_GPIO_19,
568 AU1000_GPIO_20,
569 AU1000_GPIO_21,
570 AU1000_GPIO_22,
571 AU1000_GPIO_23,
572 AU1000_GPIO_24,
573 AU1000_GPIO_25,
574 AU1000_GPIO_26,
575 AU1000_GPIO_27,
576 AU1000_GPIO_28,
577 AU1000_GPIO_29,
578 AU1000_GPIO_30,
579 AU1000_GPIO_31,
580};
581
582#define UART0_ADDR 0xB1100000
583#define UART1_ADDR 0xB1200000
584#define UART2_ADDR 0xB1300000
585#define UART3_ADDR 0xB1400000
586
587#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
588#define USB_HOST_CONFIG 0xB017FFFC
589
590#define AU1000_ETH0_BASE 0xB0500000
591#define AU1000_ETH1_BASE 0xB0510000
592#define AU1000_MAC0_ENABLE 0xB0520000
593#define AU1000_MAC1_ENABLE 0xB0520004
594#define NUM_ETH_INTERFACES 2
595#endif /* CONFIG_SOC_AU1000 */
596
597/* Au1500 */
598#ifdef CONFIG_SOC_AU1500
599enum soc_au1500_ints {
600 AU1500_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
601 AU1500_UART0_INT = AU1500_FIRST_INT,
602 AU1000_PCI_INTA, /* au1500 */
603 AU1000_PCI_INTB, /* au1500 */
604 AU1500_UART3_INT,
605 AU1000_PCI_INTC, /* au1500 */
606 AU1000_PCI_INTD, /* au1500 */
607 AU1000_DMA_INT_BASE,
608
609 AU1000_TOY_INT = AU1500_FIRST_INT + 14,
610 AU1000_TOY_MATCH0_INT,
611 AU1000_TOY_MATCH1_INT,
612 AU1000_TOY_MATCH2_INT,
613 AU1000_RTC_INT,
614 AU1000_RTC_MATCH0_INT,
615 AU1000_RTC_MATCH1_INT,
616 AU1000_RTC_MATCH2_INT,
617 AU1500_PCI_ERR_INT,
618 AU1500_RESERVED_INT,
619 AU1000_USB_DEV_REQ_INT,
620 AU1000_USB_DEV_SUS_INT,
621 AU1000_USB_HOST_INT,
622 AU1000_ACSYNC_INT,
623 AU1500_MAC0_DMA_INT,
624 AU1500_MAC1_DMA_INT,
625 AU1000_AC97C_INT = AU1500_FIRST_INT + 31,
626 AU1000_GPIO_0,
627 AU1000_GPIO_1,
628 AU1000_GPIO_2,
629 AU1000_GPIO_3,
630 AU1000_GPIO_4,
631 AU1000_GPIO_5,
632 AU1000_GPIO_6,
633 AU1000_GPIO_7,
634 AU1000_GPIO_8,
635 AU1000_GPIO_9,
636 AU1000_GPIO_10,
637 AU1000_GPIO_11,
638 AU1000_GPIO_12,
639 AU1000_GPIO_13,
640 AU1000_GPIO_14,
641 AU1000_GPIO_15,
642 AU1500_GPIO_200,
643 AU1500_GPIO_201,
644 AU1500_GPIO_202,
645 AU1500_GPIO_203,
646 AU1500_GPIO_20,
647 AU1500_GPIO_204,
648 AU1500_GPIO_205,
649 AU1500_GPIO_23,
650 AU1500_GPIO_24,
651 AU1500_GPIO_25,
652 AU1500_GPIO_26,
653 AU1500_GPIO_27,
654 AU1500_GPIO_28,
655 AU1500_GPIO_206,
656 AU1500_GPIO_207,
657 AU1500_GPIO_208_215,
658};
659
660/* shortcuts */
661#define INTA AU1000_PCI_INTA
662#define INTB AU1000_PCI_INTB
663#define INTC AU1000_PCI_INTC
664#define INTD AU1000_PCI_INTD
665
666#define UART0_ADDR 0xB1100000
667#define UART3_ADDR 0xB1400000
668
669#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
670#define USB_HOST_CONFIG 0xB017fffc
671
672#define AU1500_ETH0_BASE 0xB1500000
673#define AU1500_ETH1_BASE 0xB1510000
674#define AU1500_MAC0_ENABLE 0xB1520000
675#define AU1500_MAC1_ENABLE 0xB1520004
676#define NUM_ETH_INTERFACES 2
677#endif /* CONFIG_SOC_AU1500 */
678
679/* Au1100 */
680#ifdef CONFIG_SOC_AU1100
681enum soc_au1100_ints {
682 AU1100_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
683 AU1100_UART0_INT,
684 AU1100_UART1_INT,
685 AU1100_SD_INT,
686 AU1100_UART3_INT,
687 AU1000_SSI0_INT,
688 AU1000_SSI1_INT,
689 AU1000_DMA_INT_BASE,
690
691 AU1000_TOY_INT = AU1100_FIRST_INT + 14,
692 AU1000_TOY_MATCH0_INT,
693 AU1000_TOY_MATCH1_INT,
694 AU1000_TOY_MATCH2_INT,
695 AU1000_RTC_INT,
696 AU1000_RTC_MATCH0_INT,
697 AU1000_RTC_MATCH1_INT,
698 AU1000_RTC_MATCH2_INT,
699 AU1000_IRDA_TX_INT,
700 AU1000_IRDA_RX_INT,
701 AU1000_USB_DEV_REQ_INT,
702 AU1000_USB_DEV_SUS_INT,
703 AU1000_USB_HOST_INT,
704 AU1000_ACSYNC_INT,
705 AU1100_MAC0_DMA_INT,
706 AU1100_GPIO_208_215,
707 AU1100_LCD_INT,
708 AU1000_AC97C_INT,
709 AU1000_GPIO_0,
710 AU1000_GPIO_1,
711 AU1000_GPIO_2,
712 AU1000_GPIO_3,
713 AU1000_GPIO_4,
714 AU1000_GPIO_5,
715 AU1000_GPIO_6,
716 AU1000_GPIO_7,
717 AU1000_GPIO_8,
718 AU1000_GPIO_9,
719 AU1000_GPIO_10,
720 AU1000_GPIO_11,
721 AU1000_GPIO_12,
722 AU1000_GPIO_13,
723 AU1000_GPIO_14,
724 AU1000_GPIO_15,
725 AU1000_GPIO_16,
726 AU1000_GPIO_17,
727 AU1000_GPIO_18,
728 AU1000_GPIO_19,
729 AU1000_GPIO_20,
730 AU1000_GPIO_21,
731 AU1000_GPIO_22,
732 AU1000_GPIO_23,
733 AU1000_GPIO_24,
734 AU1000_GPIO_25,
735 AU1000_GPIO_26,
736 AU1000_GPIO_27,
737 AU1000_GPIO_28,
738 AU1000_GPIO_29,
739 AU1000_GPIO_30,
740 AU1000_GPIO_31,
741};
742
743#define UART0_ADDR 0xB1100000
744#define UART1_ADDR 0xB1200000
745#define UART3_ADDR 0xB1400000
746
747#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
748#define USB_HOST_CONFIG 0xB017FFFC
749
750#define AU1100_ETH0_BASE 0xB0500000
751#define AU1100_MAC0_ENABLE 0xB0520000
752#define NUM_ETH_INTERFACES 1
753#endif /* CONFIG_SOC_AU1100 */
754
755#ifdef CONFIG_SOC_AU1550
756enum soc_au1550_ints {
757 AU1550_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
758 AU1550_UART0_INT = AU1550_FIRST_INT,
759 AU1550_PCI_INTA,
760 AU1550_PCI_INTB,
761 AU1550_DDMA_INT,
762 AU1550_CRYPTO_INT,
763 AU1550_PCI_INTC,
764 AU1550_PCI_INTD,
765 AU1550_PCI_RST_INT,
766 AU1550_UART1_INT,
767 AU1550_UART3_INT,
768 AU1550_PSC0_INT,
769 AU1550_PSC1_INT,
770 AU1550_PSC2_INT,
771 AU1550_PSC3_INT,
772 AU1000_TOY_INT,
773 AU1000_TOY_MATCH0_INT,
774 AU1000_TOY_MATCH1_INT,
775 AU1000_TOY_MATCH2_INT,
776 AU1000_RTC_INT,
777 AU1000_RTC_MATCH0_INT,
778 AU1000_RTC_MATCH1_INT,
779 AU1000_RTC_MATCH2_INT,
780
781 AU1550_NAND_INT = AU1550_FIRST_INT + 23,
782 AU1550_USB_DEV_REQ_INT,
783 AU1000_USB_DEV_REQ_INT = AU1550_USB_DEV_REQ_INT,
784 AU1550_USB_DEV_SUS_INT,
785 AU1000_USB_DEV_SUS_INT = AU1550_USB_DEV_SUS_INT,
786 AU1550_USB_HOST_INT,
787 AU1000_USB_HOST_INT = AU1550_USB_HOST_INT,
788 AU1550_MAC0_DMA_INT,
789 AU1550_MAC1_DMA_INT,
790 AU1000_GPIO_0 = AU1550_FIRST_INT + 32,
791 AU1000_GPIO_1,
792 AU1000_GPIO_2,
793 AU1000_GPIO_3,
794 AU1000_GPIO_4,
795 AU1000_GPIO_5,
796 AU1000_GPIO_6,
797 AU1000_GPIO_7,
798 AU1000_GPIO_8,
799 AU1000_GPIO_9,
800 AU1000_GPIO_10,
801 AU1000_GPIO_11,
802 AU1000_GPIO_12,
803 AU1000_GPIO_13,
804 AU1000_GPIO_14,
805 AU1000_GPIO_15,
806 AU1550_GPIO_200,
807 AU1500_GPIO_201_205, /* Logical or of GPIO201:205 */
808 AU1500_GPIO_16,
809 AU1500_GPIO_17,
810 AU1500_GPIO_20,
811 AU1500_GPIO_21,
812 AU1500_GPIO_22,
813 AU1500_GPIO_23,
814 AU1500_GPIO_24,
815 AU1500_GPIO_25,
816 AU1500_GPIO_26,
817 AU1500_GPIO_27,
818 AU1500_GPIO_28,
819 AU1500_GPIO_206,
820 AU1500_GPIO_207,
821 AU1500_GPIO_208_218, /* Logical or of GPIO208:218 */
822};
823
824/* shortcuts */
825#define INTA AU1550_PCI_INTA
826#define INTB AU1550_PCI_INTB
827#define INTC AU1550_PCI_INTC
828#define INTD AU1550_PCI_INTD
829
830#define UART0_ADDR 0xB1100000
831#define UART1_ADDR 0xB1200000
832#define UART3_ADDR 0xB1400000
833
834#define USB_OHCI_BASE 0x14020000 /* phys addr for ioremap */
835#define USB_OHCI_LEN 0x00060000
836#define USB_HOST_CONFIG 0xB4027ffc
837
838#define AU1550_ETH0_BASE 0xB0500000
839#define AU1550_ETH1_BASE 0xB0510000
840#define AU1550_MAC0_ENABLE 0xB0520000
841#define AU1550_MAC1_ENABLE 0xB0520004
842#define NUM_ETH_INTERFACES 2
843#endif /* CONFIG_SOC_AU1550 */
844
845#ifdef CONFIG_SOC_AU1200
846enum soc_au1200_ints {
847 AU1200_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
848 AU1200_UART0_INT = AU1200_FIRST_INT,
849 AU1200_SWT_INT,
850 AU1200_SD_INT,
851 AU1200_DDMA_INT,
852 AU1200_MAE_BE_INT,
853 AU1200_GPIO_200,
854 AU1200_GPIO_201,
855 AU1200_GPIO_202,
856 AU1200_UART1_INT,
857 AU1200_MAE_FE_INT,
858 AU1200_PSC0_INT,
859 AU1200_PSC1_INT,
860 AU1200_AES_INT,
861 AU1200_CAMERA_INT,
862 AU1000_TOY_INT,
863 AU1000_TOY_MATCH0_INT,
864 AU1000_TOY_MATCH1_INT,
865 AU1000_TOY_MATCH2_INT,
866 AU1000_RTC_INT,
867 AU1000_RTC_MATCH0_INT,
868 AU1000_RTC_MATCH1_INT,
869 AU1000_RTC_MATCH2_INT,
870
871 AU1200_NAND_INT = AU1200_FIRST_INT + 23,
872 AU1200_GPIO_204,
873 AU1200_GPIO_205,
874 AU1200_GPIO_206,
875 AU1200_GPIO_207,
876 AU1200_GPIO_208_215, /* Logical OR of 208:215 */
877 AU1200_USB_INT,
878 AU1000_USB_HOST_INT = AU1200_USB_INT,
879 AU1200_LCD_INT,
880 AU1200_MAE_BOTH_INT,
881 AU1000_GPIO_0,
882 AU1000_GPIO_1,
883 AU1000_GPIO_2,
884 AU1000_GPIO_3,
885 AU1000_GPIO_4,
886 AU1000_GPIO_5,
887 AU1000_GPIO_6,
888 AU1000_GPIO_7,
889 AU1000_GPIO_8,
890 AU1000_GPIO_9,
891 AU1000_GPIO_10,
892 AU1000_GPIO_11,
893 AU1000_GPIO_12,
894 AU1000_GPIO_13,
895 AU1000_GPIO_14,
896 AU1000_GPIO_15,
897 AU1000_GPIO_16,
898 AU1000_GPIO_17,
899 AU1000_GPIO_18,
900 AU1000_GPIO_19,
901 AU1000_GPIO_20,
902 AU1000_GPIO_21,
903 AU1000_GPIO_22,
904 AU1000_GPIO_23,
905 AU1000_GPIO_24,
906 AU1000_GPIO_25,
907 AU1000_GPIO_26,
908 AU1000_GPIO_27,
909 AU1000_GPIO_28,
910 AU1000_GPIO_29,
911 AU1000_GPIO_30,
912 AU1000_GPIO_31,
913};
914
915#define UART0_ADDR 0xB1100000
916#define UART1_ADDR 0xB1200000
917
918#define USB_UOC_BASE 0x14020020
919#define USB_UOC_LEN 0x20
920#define USB_OHCI_BASE 0x14020100
921#define USB_OHCI_LEN 0x100
922#define USB_EHCI_BASE 0x14020200
923#define USB_EHCI_LEN 0x100
924#define USB_UDC_BASE 0x14022000
925#define USB_UDC_LEN 0x2000
926#define USB_MSR_BASE 0xB4020000
927#define USB_MSR_MCFG 4
928#define USBMSRMCFG_OMEMEN 0
929#define USBMSRMCFG_OBMEN 1
930#define USBMSRMCFG_EMEMEN 2
931#define USBMSRMCFG_EBMEN 3
932#define USBMSRMCFG_DMEMEN 4
933#define USBMSRMCFG_DBMEN 5
934#define USBMSRMCFG_GMEMEN 6
935#define USBMSRMCFG_OHCCLKEN 16
936#define USBMSRMCFG_EHCCLKEN 17
937#define USBMSRMCFG_UDCCLKEN 18
938#define USBMSRMCFG_PHYPLLEN 19
939#define USBMSRMCFG_RDCOMB 30
940#define USBMSRMCFG_PFEN 31
941
942#endif /* CONFIG_SOC_AU1200 */
943
944#define AU1000_INTC0_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
945#define AU1000_INTC0_INT_LAST (AU1000_INTC0_INT_BASE + 31)
946#define AU1000_INTC1_INT_BASE (AU1000_INTC0_INT_BASE + 32)
947#define AU1000_INTC1_INT_LAST (AU1000_INTC1_INT_BASE + 31)
948
949#define AU1000_MAX_INTR AU1000_INTC1_INT_LAST
950#define INTX 0xFF /* not valid */
951
952/* Programmable Counters 0 and 1 */
953#define SYS_BASE 0xB1900000
954#define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
955# define SYS_CNTRL_E1S (1 << 23)
956# define SYS_CNTRL_T1S (1 << 20)
957# define SYS_CNTRL_M21 (1 << 19)
958# define SYS_CNTRL_M11 (1 << 18)
959# define SYS_CNTRL_M01 (1 << 17)
960# define SYS_CNTRL_C1S (1 << 16)
961# define SYS_CNTRL_BP (1 << 14)
962# define SYS_CNTRL_EN1 (1 << 13)
963# define SYS_CNTRL_BT1 (1 << 12)
964# define SYS_CNTRL_EN0 (1 << 11)
965# define SYS_CNTRL_BT0 (1 << 10)
966# define SYS_CNTRL_E0 (1 << 8)
967# define SYS_CNTRL_E0S (1 << 7)
968# define SYS_CNTRL_32S (1 << 5)
969# define SYS_CNTRL_T0S (1 << 4)
970# define SYS_CNTRL_M20 (1 << 3)
971# define SYS_CNTRL_M10 (1 << 2)
972# define SYS_CNTRL_M00 (1 << 1)
973# define SYS_CNTRL_C0S (1 << 0)
974
975/* Programmable Counter 0 Registers */
976#define SYS_TOYTRIM (SYS_BASE + 0)
977#define SYS_TOYWRITE (SYS_BASE + 4)
978#define SYS_TOYMATCH0 (SYS_BASE + 8)
979#define SYS_TOYMATCH1 (SYS_BASE + 0xC)
980#define SYS_TOYMATCH2 (SYS_BASE + 0x10)
981#define SYS_TOYREAD (SYS_BASE + 0x40)
982
983/* Programmable Counter 1 Registers */
984#define SYS_RTCTRIM (SYS_BASE + 0x44)
985#define SYS_RTCWRITE (SYS_BASE + 0x48)
986#define SYS_RTCMATCH0 (SYS_BASE + 0x4C)
987#define SYS_RTCMATCH1 (SYS_BASE + 0x50)
988#define SYS_RTCMATCH2 (SYS_BASE + 0x54)
989#define SYS_RTCREAD (SYS_BASE + 0x58)
990
991/* I2S Controller */
992#define I2S_DATA 0xB1000000
993# define I2S_DATA_MASK 0xffffff
994#define I2S_CONFIG 0xB1000004
995# define I2S_CONFIG_XU (1 << 25)
996# define I2S_CONFIG_XO (1 << 24)
997# define I2S_CONFIG_RU (1 << 23)
998# define I2S_CONFIG_RO (1 << 22)
999# define I2S_CONFIG_TR (1 << 21)
1000# define I2S_CONFIG_TE (1 << 20)
1001# define I2S_CONFIG_TF (1 << 19)
1002# define I2S_CONFIG_RR (1 << 18)
1003# define I2S_CONFIG_RE (1 << 17)
1004# define I2S_CONFIG_RF (1 << 16)
1005# define I2S_CONFIG_PD (1 << 11)
1006# define I2S_CONFIG_LB (1 << 10)
1007# define I2S_CONFIG_IC (1 << 9)
1008# define I2S_CONFIG_FM_BIT 7
1009# define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT)
1010# define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT)
1011# define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT)
1012# define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT)
1013# define I2S_CONFIG_TN (1 << 6)
1014# define I2S_CONFIG_RN (1 << 5)
1015# define I2S_CONFIG_SZ_BIT 0
1016# define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT)
1017
1018#define I2S_CONTROL 0xB1000008
1019# define I2S_CONTROL_D (1 << 1)
1020# define I2S_CONTROL_CE (1 << 0)
1021
1022/* USB Host Controller */
1023#ifndef USB_OHCI_LEN
1024#define USB_OHCI_LEN 0x00100000
1025#endif
1026
1027#ifndef CONFIG_SOC_AU1200
1028
1029/* USB Device Controller */
1030#define USBD_EP0RD 0xB0200000
1031#define USBD_EP0WR 0xB0200004
1032#define USBD_EP2WR 0xB0200008
1033#define USBD_EP3WR 0xB020000C
1034#define USBD_EP4RD 0xB0200010
1035#define USBD_EP5RD 0xB0200014
1036#define USBD_INTEN 0xB0200018
1037#define USBD_INTSTAT 0xB020001C
1038# define USBDEV_INT_SOF (1 << 12)
1039# define USBDEV_INT_HF_BIT 6
1040# define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT)
1041# define USBDEV_INT_CMPLT_BIT 0
1042# define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
1043#define USBD_CONFIG 0xB0200020
1044#define USBD_EP0CS 0xB0200024
1045#define USBD_EP2CS 0xB0200028
1046#define USBD_EP3CS 0xB020002C
1047#define USBD_EP4CS 0xB0200030
1048#define USBD_EP5CS 0xB0200034
1049# define USBDEV_CS_SU (1 << 14)
1050# define USBDEV_CS_NAK (1 << 13)
1051# define USBDEV_CS_ACK (1 << 12)
1052# define USBDEV_CS_BUSY (1 << 11)
1053# define USBDEV_CS_TSIZE_BIT 1
1054# define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT)
1055# define USBDEV_CS_STALL (1 << 0)
1056#define USBD_EP0RDSTAT 0xB0200040
1057#define USBD_EP0WRSTAT 0xB0200044
1058#define USBD_EP2WRSTAT 0xB0200048
1059#define USBD_EP3WRSTAT 0xB020004C
1060#define USBD_EP4RDSTAT 0xB0200050
1061#define USBD_EP5RDSTAT 0xB0200054
1062# define USBDEV_FSTAT_FLUSH (1 << 6)
1063# define USBDEV_FSTAT_UF (1 << 5)
1064# define USBDEV_FSTAT_OF (1 << 4)
1065# define USBDEV_FSTAT_FCNT_BIT 0
1066# define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT)
1067#define USBD_ENABLE 0xB0200058
1068# define USBDEV_ENABLE (1 << 1)
1069# define USBDEV_CE (1 << 0)
1070
1071#endif /* !CONFIG_SOC_AU1200 */
1072
1073/* Ethernet Controllers */
1074
1075/* 4 byte offsets from AU1000_ETH_BASE */
1076#define MAC_CONTROL 0x0
1077# define MAC_RX_ENABLE (1 << 2)
1078# define MAC_TX_ENABLE (1 << 3)
1079# define MAC_DEF_CHECK (1 << 5)
1080# define MAC_SET_BL(X) (((X) & 0x3) << 6)
1081# define MAC_AUTO_PAD (1 << 8)
1082# define MAC_DISABLE_RETRY (1 << 10)
1083# define MAC_DISABLE_BCAST (1 << 11)
1084# define MAC_LATE_COL (1 << 12)
1085# define MAC_HASH_MODE (1 << 13)
1086# define MAC_HASH_ONLY (1 << 15)
1087# define MAC_PASS_ALL (1 << 16)
1088# define MAC_INVERSE_FILTER (1 << 17)
1089# define MAC_PROMISCUOUS (1 << 18)
1090# define MAC_PASS_ALL_MULTI (1 << 19)
1091# define MAC_FULL_DUPLEX (1 << 20)
1092# define MAC_NORMAL_MODE 0
1093# define MAC_INT_LOOPBACK (1 << 21)
1094# define MAC_EXT_LOOPBACK (1 << 22)
1095# define MAC_DISABLE_RX_OWN (1 << 23)
1096# define MAC_BIG_ENDIAN (1 << 30)
1097# define MAC_RX_ALL (1 << 31)
1098#define MAC_ADDRESS_HIGH 0x4
1099#define MAC_ADDRESS_LOW 0x8
1100#define MAC_MCAST_HIGH 0xC
1101#define MAC_MCAST_LOW 0x10
1102#define MAC_MII_CNTRL 0x14
1103# define MAC_MII_BUSY (1 << 0)
1104# define MAC_MII_READ 0
1105# define MAC_MII_WRITE (1 << 1)
1106# define MAC_SET_MII_SELECT_REG(X) (((X) & 0x1f) << 6)
1107# define MAC_SET_MII_SELECT_PHY(X) (((X) & 0x1f) << 11)
1108#define MAC_MII_DATA 0x18
1109#define MAC_FLOW_CNTRL 0x1C
1110# define MAC_FLOW_CNTRL_BUSY (1 << 0)
1111# define MAC_FLOW_CNTRL_ENABLE (1 << 1)
1112# define MAC_PASS_CONTROL (1 << 2)
1113# define MAC_SET_PAUSE(X) (((X) & 0xffff) << 16)
1114#define MAC_VLAN1_TAG 0x20
1115#define MAC_VLAN2_TAG 0x24
1116
1117/* Ethernet Controller Enable */
1118
1119# define MAC_EN_CLOCK_ENABLE (1 << 0)
1120# define MAC_EN_RESET0 (1 << 1)
1121# define MAC_EN_TOSS (0 << 2)
1122# define MAC_EN_CACHEABLE (1 << 3)
1123# define MAC_EN_RESET1 (1 << 4)
1124# define MAC_EN_RESET2 (1 << 5)
1125# define MAC_DMA_RESET (1 << 6)
1126
1127/* Ethernet Controller DMA Channels */
1128
1129#define MAC0_TX_DMA_ADDR 0xB4004000
1130#define MAC1_TX_DMA_ADDR 0xB4004200
1131/* offsets from MAC_TX_RING_ADDR address */
1132#define MAC_TX_BUFF0_STATUS 0x0
1133# define TX_FRAME_ABORTED (1 << 0)
1134# define TX_JAB_TIMEOUT (1 << 1)
1135# define TX_NO_CARRIER (1 << 2)
1136# define TX_LOSS_CARRIER (1 << 3)
1137# define TX_EXC_DEF (1 << 4)
1138# define TX_LATE_COLL_ABORT (1 << 5)
1139# define TX_EXC_COLL (1 << 6)
1140# define TX_UNDERRUN (1 << 7)
1141# define TX_DEFERRED (1 << 8)
1142# define TX_LATE_COLL (1 << 9)
1143# define TX_COLL_CNT_MASK (0xF << 10)
1144# define TX_PKT_RETRY (1 << 31)
1145#define MAC_TX_BUFF0_ADDR 0x4
1146# define TX_DMA_ENABLE (1 << 0)
1147# define TX_T_DONE (1 << 1)
1148# define TX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3)
1149#define MAC_TX_BUFF0_LEN 0x8
1150#define MAC_TX_BUFF1_STATUS 0x10
1151#define MAC_TX_BUFF1_ADDR 0x14
1152#define MAC_TX_BUFF1_LEN 0x18
1153#define MAC_TX_BUFF2_STATUS 0x20
1154#define MAC_TX_BUFF2_ADDR 0x24
1155#define MAC_TX_BUFF2_LEN 0x28
1156#define MAC_TX_BUFF3_STATUS 0x30
1157#define MAC_TX_BUFF3_ADDR 0x34
1158#define MAC_TX_BUFF3_LEN 0x38
1159
1160#define MAC0_RX_DMA_ADDR 0xB4004100
1161#define MAC1_RX_DMA_ADDR 0xB4004300
1162/* offsets from MAC_RX_RING_ADDR */
1163#define MAC_RX_BUFF0_STATUS 0x0
1164# define RX_FRAME_LEN_MASK 0x3fff
1165# define RX_WDOG_TIMER (1 << 14)
1166# define RX_RUNT (1 << 15)
1167# define RX_OVERLEN (1 << 16)
1168# define RX_COLL (1 << 17)
1169# define RX_ETHER (1 << 18)
1170# define RX_MII_ERROR (1 << 19)
1171# define RX_DRIBBLING (1 << 20)
1172# define RX_CRC_ERROR (1 << 21)
1173# define RX_VLAN1 (1 << 22)
1174# define RX_VLAN2 (1 << 23)
1175# define RX_LEN_ERROR (1 << 24)
1176# define RX_CNTRL_FRAME (1 << 25)
1177# define RX_U_CNTRL_FRAME (1 << 26)
1178# define RX_MCAST_FRAME (1 << 27)
1179# define RX_BCAST_FRAME (1 << 28)
1180# define RX_FILTER_FAIL (1 << 29)
1181# define RX_PACKET_FILTER (1 << 30)
1182# define RX_MISSED_FRAME (1 << 31)
1183
1184# define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \
1185 RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
1186 RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
1187#define MAC_RX_BUFF0_ADDR 0x4
1188# define RX_DMA_ENABLE (1 << 0)
1189# define RX_T_DONE (1 << 1)
1190# define RX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3)
1191# define RX_SET_BUFF_ADDR(X) ((X) & 0xffffffc0)
1192#define MAC_RX_BUFF1_STATUS 0x10
1193#define MAC_RX_BUFF1_ADDR 0x14
1194#define MAC_RX_BUFF2_STATUS 0x20
1195#define MAC_RX_BUFF2_ADDR 0x24
1196#define MAC_RX_BUFF3_STATUS 0x30
1197#define MAC_RX_BUFF3_ADDR 0x34
1198
1199/* UARTS 0-3 */
1200#define UART_BASE UART0_ADDR
1201#ifdef CONFIG_SOC_AU1200
1202#define UART_DEBUG_BASE UART1_ADDR
1203#else
1204#define UART_DEBUG_BASE UART3_ADDR
1205#endif
1206
1207#define UART_RX 0 /* Receive buffer */
1208#define UART_TX 4 /* Transmit buffer */
1209#define UART_IER 8 /* Interrupt Enable Register */
1210#define UART_IIR 0xC /* Interrupt ID Register */
1211#define UART_FCR 0x10 /* FIFO Control Register */
1212#define UART_LCR 0x14 /* Line Control Register */
1213#define UART_MCR 0x18 /* Modem Control Register */
1214#define UART_LSR 0x1C /* Line Status Register */
1215#define UART_MSR 0x20 /* Modem Status Register */
1216#define UART_CLK 0x28 /* Baud Rate Clock Divider */
1217#define UART_MOD_CNTRL 0x100 /* Module Control */
1218
1219#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
1220#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
1221#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
1222#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
1223#define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
1224#define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
1225#define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
1226#define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
1227#define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */
1228#define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
1229#define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
1230#define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */
1231#define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
1232
1233/*
1234 * These are the definitions for the Line Control Register
1235 */
1236#define UART_LCR_SBC 0x40 /* Set break control */
1237#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
1238#define UART_LCR_EPAR 0x10 /* Even parity select */
1239#define UART_LCR_PARITY 0x08 /* Parity Enable */
1240#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
1241#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
1242#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
1243#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
1244#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
1245
1246/*
1247 * These are the definitions for the Line Status Register
1248 */
1249#define UART_LSR_TEMT 0x40 /* Transmitter empty */
1250#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
1251#define UART_LSR_BI 0x10 /* Break interrupt indicator */
1252#define UART_LSR_FE 0x08 /* Frame error indicator */
1253#define UART_LSR_PE 0x04 /* Parity error indicator */
1254#define UART_LSR_OE 0x02 /* Overrun error indicator */
1255#define UART_LSR_DR 0x01 /* Receiver data ready */
1256
1257/*
1258 * These are the definitions for the Interrupt Identification Register
1259 */
1260#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
1261#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
1262#define UART_IIR_MSI 0x00 /* Modem status interrupt */
1263#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
1264#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
1265#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
1266
1267/*
1268 * These are the definitions for the Interrupt Enable Register
1269 */
1270#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
1271#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
1272#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
1273#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
1274
1275/*
1276 * These are the definitions for the Modem Control Register
1277 */
1278#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
1279#define UART_MCR_OUT2 0x08 /* Out2 complement */
1280#define UART_MCR_OUT1 0x04 /* Out1 complement */
1281#define UART_MCR_RTS 0x02 /* RTS complement */
1282#define UART_MCR_DTR 0x01 /* DTR complement */
1283
1284/*
1285 * These are the definitions for the Modem Status Register
1286 */
1287#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
1288#define UART_MSR_RI 0x40 /* Ring Indicator */
1289#define UART_MSR_DSR 0x20 /* Data Set Ready */
1290#define UART_MSR_CTS 0x10 /* Clear to Send */
1291#define UART_MSR_DDCD 0x08 /* Delta DCD */
1292#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
1293#define UART_MSR_DDSR 0x02 /* Delta DSR */
1294#define UART_MSR_DCTS 0x01 /* Delta CTS */
1295#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
1296
1297/* SSIO */
1298#define SSI0_STATUS 0xB1600000
1299# define SSI_STATUS_BF (1 << 4)
1300# define SSI_STATUS_OF (1 << 3)
1301# define SSI_STATUS_UF (1 << 2)
1302# define SSI_STATUS_D (1 << 1)
1303# define SSI_STATUS_B (1 << 0)
1304#define SSI0_INT 0xB1600004
1305# define SSI_INT_OI (1 << 3)
1306# define SSI_INT_UI (1 << 2)
1307# define SSI_INT_DI (1 << 1)
1308#define SSI0_INT_ENABLE 0xB1600008
1309# define SSI_INTE_OIE (1 << 3)
1310# define SSI_INTE_UIE (1 << 2)
1311# define SSI_INTE_DIE (1 << 1)
1312#define SSI0_CONFIG 0xB1600020
1313# define SSI_CONFIG_AO (1 << 24)
1314# define SSI_CONFIG_DO (1 << 23)
1315# define SSI_CONFIG_ALEN_BIT 20
1316# define SSI_CONFIG_ALEN_MASK (0x7 << 20)
1317# define SSI_CONFIG_DLEN_BIT 16
1318# define SSI_CONFIG_DLEN_MASK (0x7 << 16)
1319# define SSI_CONFIG_DD (1 << 11)
1320# define SSI_CONFIG_AD (1 << 10)
1321# define SSI_CONFIG_BM_BIT 8
1322# define SSI_CONFIG_BM_MASK (0x3 << 8)
1323# define SSI_CONFIG_CE (1 << 7)
1324# define SSI_CONFIG_DP (1 << 6)
1325# define SSI_CONFIG_DL (1 << 5)
1326# define SSI_CONFIG_EP (1 << 4)
1327#define SSI0_ADATA 0xB1600024
1328# define SSI_AD_D (1 << 24)
1329# define SSI_AD_ADDR_BIT 16
1330# define SSI_AD_ADDR_MASK (0xff << 16)
1331# define SSI_AD_DATA_BIT 0
1332# define SSI_AD_DATA_MASK (0xfff << 0)
1333#define SSI0_CLKDIV 0xB1600028
1334#define SSI0_CONTROL 0xB1600100
1335# define SSI_CONTROL_CD (1 << 1)
1336# define SSI_CONTROL_E (1 << 0)
1337
1338/* SSI1 */
1339#define SSI1_STATUS 0xB1680000
1340#define SSI1_INT 0xB1680004
1341#define SSI1_INT_ENABLE 0xB1680008
1342#define SSI1_CONFIG 0xB1680020
1343#define SSI1_ADATA 0xB1680024
1344#define SSI1_CLKDIV 0xB1680028
1345#define SSI1_ENABLE 0xB1680100
1346
1347/*
1348 * Register content definitions
1349 */
1350#define SSI_STATUS_BF (1 << 4)
1351#define SSI_STATUS_OF (1 << 3)
1352#define SSI_STATUS_UF (1 << 2)
1353#define SSI_STATUS_D (1 << 1)
1354#define SSI_STATUS_B (1 << 0)
1355
1356/* SSI_INT */
1357#define SSI_INT_OI (1 << 3)
1358#define SSI_INT_UI (1 << 2)
1359#define SSI_INT_DI (1 << 1)
1360
1361/* SSI_INTEN */
1362#define SSI_INTEN_OIE (1 << 3)
1363#define SSI_INTEN_UIE (1 << 2)
1364#define SSI_INTEN_DIE (1 << 1)
1365
1366#define SSI_CONFIG_AO (1 << 24)
1367#define SSI_CONFIG_DO (1 << 23)
1368#define SSI_CONFIG_ALEN (7 << 20)
1369#define SSI_CONFIG_DLEN (15 << 16)
1370#define SSI_CONFIG_DD (1 << 11)
1371#define SSI_CONFIG_AD (1 << 10)
1372#define SSI_CONFIG_BM (3 << 8)
1373#define SSI_CONFIG_CE (1 << 7)
1374#define SSI_CONFIG_DP (1 << 6)
1375#define SSI_CONFIG_DL (1 << 5)
1376#define SSI_CONFIG_EP (1 << 4)
1377#define SSI_CONFIG_ALEN_N(N) ((N-1) << 20)
1378#define SSI_CONFIG_DLEN_N(N) ((N-1) << 16)
1379#define SSI_CONFIG_BM_HI (0 << 8)
1380#define SSI_CONFIG_BM_LO (1 << 8)
1381#define SSI_CONFIG_BM_CY (2 << 8)
1382
1383#define SSI_ADATA_D (1 << 24)
1384#define SSI_ADATA_ADDR (0xFF << 16)
1385#define SSI_ADATA_DATA 0x0FFF
1386#define SSI_ADATA_ADDR_N(N) (N << 16)
1387
1388#define SSI_ENABLE_CD (1 << 1)
1389#define SSI_ENABLE_E (1 << 0)
1390
1391/* IrDA Controller */
1392#define IRDA_BASE 0xB0300000
1393#define IR_RING_PTR_STATUS (IRDA_BASE + 0x00)
1394#define IR_RING_BASE_ADDR_H (IRDA_BASE + 0x04)
1395#define IR_RING_BASE_ADDR_L (IRDA_BASE + 0x08)
1396#define IR_RING_SIZE (IRDA_BASE + 0x0C)
1397#define IR_RING_PROMPT (IRDA_BASE + 0x10)
1398#define IR_RING_ADDR_CMPR (IRDA_BASE + 0x14)
1399#define IR_INT_CLEAR (IRDA_BASE + 0x18)
1400#define IR_CONFIG_1 (IRDA_BASE + 0x20)
1401# define IR_RX_INVERT_LED (1 << 0)
1402# define IR_TX_INVERT_LED (1 << 1)
1403# define IR_ST (1 << 2)
1404# define IR_SF (1 << 3)
1405# define IR_SIR (1 << 4)
1406# define IR_MIR (1 << 5)
1407# define IR_FIR (1 << 6)
1408# define IR_16CRC (1 << 7)
1409# define IR_TD (1 << 8)
1410# define IR_RX_ALL (1 << 9)
1411# define IR_DMA_ENABLE (1 << 10)
1412# define IR_RX_ENABLE (1 << 11)
1413# define IR_TX_ENABLE (1 << 12)
1414# define IR_LOOPBACK (1 << 14)
1415# define IR_SIR_MODE (IR_SIR | IR_DMA_ENABLE | \
1416 IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC)
1417#define IR_SIR_FLAGS (IRDA_BASE + 0x24)
1418#define IR_ENABLE (IRDA_BASE + 0x28)
1419# define IR_RX_STATUS (1 << 9)
1420# define IR_TX_STATUS (1 << 10)
1421#define IR_READ_PHY_CONFIG (IRDA_BASE + 0x2C)
1422#define IR_WRITE_PHY_CONFIG (IRDA_BASE + 0x30)
1423#define IR_MAX_PKT_LEN (IRDA_BASE + 0x34)
1424#define IR_RX_BYTE_CNT (IRDA_BASE + 0x38)
1425#define IR_CONFIG_2 (IRDA_BASE + 0x3C)
1426# define IR_MODE_INV (1 << 0)
1427# define IR_ONE_PIN (1 << 1)
1428#define IR_INTERFACE_CONFIG (IRDA_BASE + 0x40)
1429
1430/* GPIO */
1431#define SYS_PINFUNC 0xB190002C
1432# define SYS_PF_USB (1 << 15) /* 2nd USB device/host */
1433# define SYS_PF_U3 (1 << 14) /* GPIO23/U3TXD */
1434# define SYS_PF_U2 (1 << 13) /* GPIO22/U2TXD */
1435# define SYS_PF_U1 (1 << 12) /* GPIO21/U1TXD */
1436# define SYS_PF_SRC (1 << 11) /* GPIO6/SROMCKE */
1437# define SYS_PF_CK5 (1 << 10) /* GPIO3/CLK5 */
1438# define SYS_PF_CK4 (1 << 9) /* GPIO2/CLK4 */
1439# define SYS_PF_IRF (1 << 8) /* GPIO15/IRFIRSEL */
1440# define SYS_PF_UR3 (1 << 7) /* GPIO[14:9]/UART3 */
1441# define SYS_PF_I2D (1 << 6) /* GPIO8/I2SDI */
1442# define SYS_PF_I2S (1 << 5) /* I2S/GPIO[29:31] */
1443# define SYS_PF_NI2 (1 << 4) /* NI2/GPIO[24:28] */
1444# define SYS_PF_U0 (1 << 3) /* U0TXD/GPIO20 */
1445# define SYS_PF_RD (1 << 2) /* IRTXD/GPIO19 */
1446# define SYS_PF_A97 (1 << 1) /* AC97/SSL1 */
1447# define SYS_PF_S0 (1 << 0) /* SSI_0/GPIO[16:18] */
1448
1449/* Au1100 only */
1450# define SYS_PF_PC (1 << 18) /* PCMCIA/GPIO[207:204] */
1451# define SYS_PF_LCD (1 << 17) /* extern lcd/GPIO[203:200] */
1452# define SYS_PF_CS (1 << 16) /* EXTCLK0/32KHz to gpio2 */
1453# define SYS_PF_EX0 (1 << 9) /* GPIO2/clock */
1454
1455/* Au1550 only. Redefines lots of pins */
1456# define SYS_PF_PSC2_MASK (7 << 17)
1457# define SYS_PF_PSC2_AC97 0
1458# define SYS_PF_PSC2_SPI 0
1459# define SYS_PF_PSC2_I2S (1 << 17)
1460# define SYS_PF_PSC2_SMBUS (3 << 17)
1461# define SYS_PF_PSC2_GPIO (7 << 17)
1462# define SYS_PF_PSC3_MASK (7 << 20)
1463# define SYS_PF_PSC3_AC97 0
1464# define SYS_PF_PSC3_SPI 0
1465# define SYS_PF_PSC3_I2S (1 << 20)
1466# define SYS_PF_PSC3_SMBUS (3 << 20)
1467# define SYS_PF_PSC3_GPIO (7 << 20)
1468# define SYS_PF_PSC1_S1 (1 << 1)
1469# define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
1470
1471/* Au1200 only */
1472#ifdef CONFIG_SOC_AU1200
1473#define SYS_PINFUNC_DMA (1 << 31)
1474#define SYS_PINFUNC_S0A (1 << 30)
1475#define SYS_PINFUNC_S1A (1 << 29)
1476#define SYS_PINFUNC_LP0 (1 << 28)
1477#define SYS_PINFUNC_LP1 (1 << 27)
1478#define SYS_PINFUNC_LD16 (1 << 26)
1479#define SYS_PINFUNC_LD8 (1 << 25)
1480#define SYS_PINFUNC_LD1 (1 << 24)
1481#define SYS_PINFUNC_LD0 (1 << 23)
1482#define SYS_PINFUNC_P1A (3 << 21)
1483#define SYS_PINFUNC_P1B (1 << 20)
1484#define SYS_PINFUNC_FS3 (1 << 19)
1485#define SYS_PINFUNC_P0A (3 << 17)
1486#define SYS_PINFUNC_CS (1 << 16)
1487#define SYS_PINFUNC_CIM (1 << 15)
1488#define SYS_PINFUNC_P1C (1 << 14)
1489#define SYS_PINFUNC_U1T (1 << 12)
1490#define SYS_PINFUNC_U1R (1 << 11)
1491#define SYS_PINFUNC_EX1 (1 << 10)
1492#define SYS_PINFUNC_EX0 (1 << 9)
1493#define SYS_PINFUNC_U0R (1 << 8)
1494#define SYS_PINFUNC_MC (1 << 7)
1495#define SYS_PINFUNC_S0B (1 << 6)
1496#define SYS_PINFUNC_S0C (1 << 5)
1497#define SYS_PINFUNC_P0B (1 << 4)
1498#define SYS_PINFUNC_U0T (1 << 3)
1499#define SYS_PINFUNC_S1B (1 << 2)
1500#endif
1501
1502#define SYS_TRIOUTRD 0xB1900100
1503#define SYS_TRIOUTCLR 0xB1900100
1504#define SYS_OUTPUTRD 0xB1900108
1505#define SYS_OUTPUTSET 0xB1900108
1506#define SYS_OUTPUTCLR 0xB190010C
1507#define SYS_PINSTATERD 0xB1900110
1508#define SYS_PININPUTEN 0xB1900110
1509
1510/* GPIO2, Au1500, Au1550 only */
1511#define GPIO2_BASE 0xB1700000
1512#define GPIO2_DIR (GPIO2_BASE + 0)
1513#define GPIO2_OUTPUT (GPIO2_BASE + 8)
1514#define GPIO2_PINSTATE (GPIO2_BASE + 0xC)
1515#define GPIO2_INTENABLE (GPIO2_BASE + 0x10)
1516#define GPIO2_ENABLE (GPIO2_BASE + 0x14)
1517
1518/* Power Management */
1519#define SYS_SCRATCH0 0xB1900018
1520#define SYS_SCRATCH1 0xB190001C
1521#define SYS_WAKEMSK 0xB1900034
1522#define SYS_ENDIAN 0xB1900038
1523#define SYS_POWERCTRL 0xB190003C
1524#define SYS_WAKESRC 0xB190005C
1525#define SYS_SLPPWR 0xB1900078
1526#define SYS_SLEEP 0xB190007C
1527
1528/* Clock Controller */
1529#define SYS_FREQCTRL0 0xB1900020
1530# define SYS_FC_FRDIV2_BIT 22
1531# define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT)
1532# define SYS_FC_FE2 (1 << 21)
1533# define SYS_FC_FS2 (1 << 20)
1534# define SYS_FC_FRDIV1_BIT 12
1535# define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT)
1536# define SYS_FC_FE1 (1 << 11)
1537# define SYS_FC_FS1 (1 << 10)
1538# define SYS_FC_FRDIV0_BIT 2
1539# define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT)
1540# define SYS_FC_FE0 (1 << 1)
1541# define SYS_FC_FS0 (1 << 0)
1542#define SYS_FREQCTRL1 0xB1900024
1543# define SYS_FC_FRDIV5_BIT 22
1544# define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT)
1545# define SYS_FC_FE5 (1 << 21)
1546# define SYS_FC_FS5 (1 << 20)
1547# define SYS_FC_FRDIV4_BIT 12
1548# define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT)
1549# define SYS_FC_FE4 (1 << 11)
1550# define SYS_FC_FS4 (1 << 10)
1551# define SYS_FC_FRDIV3_BIT 2
1552# define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT)
1553# define SYS_FC_FE3 (1 << 1)
1554# define SYS_FC_FS3 (1 << 0)
1555#define SYS_CLKSRC 0xB1900028
1556# define SYS_CS_ME1_BIT 27
1557# define SYS_CS_ME1_MASK (0x7 << SYS_CS_ME1_BIT)
1558# define SYS_CS_DE1 (1 << 26)
1559# define SYS_CS_CE1 (1 << 25)
1560# define SYS_CS_ME0_BIT 22
1561# define SYS_CS_ME0_MASK (0x7 << SYS_CS_ME0_BIT)
1562# define SYS_CS_DE0 (1 << 21)
1563# define SYS_CS_CE0 (1 << 20)
1564# define SYS_CS_MI2_BIT 17
1565# define SYS_CS_MI2_MASK (0x7 << SYS_CS_MI2_BIT)
1566# define SYS_CS_DI2 (1 << 16)
1567# define SYS_CS_CI2 (1 << 15)
1568#ifdef CONFIG_SOC_AU1100
1569# define SYS_CS_ML_BIT 7
1570# define SYS_CS_ML_MASK (0x7 << SYS_CS_ML_BIT)
1571# define SYS_CS_DL (1 << 6)
1572# define SYS_CS_CL (1 << 5)
1573#else
1574# define SYS_CS_MUH_BIT 12
1575# define SYS_CS_MUH_MASK (0x7 << SYS_CS_MUH_BIT)
1576# define SYS_CS_DUH (1 << 11)
1577# define SYS_CS_CUH (1 << 10)
1578# define SYS_CS_MUD_BIT 7
1579# define SYS_CS_MUD_MASK (0x7 << SYS_CS_MUD_BIT)
1580# define SYS_CS_DUD (1 << 6)
1581# define SYS_CS_CUD (1 << 5)
1582#endif
1583# define SYS_CS_MIR_BIT 2
1584# define SYS_CS_MIR_MASK (0x7 << SYS_CS_MIR_BIT)
1585# define SYS_CS_DIR (1 << 1)
1586# define SYS_CS_CIR (1 << 0)
1587
1588# define SYS_CS_MUX_AUX 0x1
1589# define SYS_CS_MUX_FQ0 0x2
1590# define SYS_CS_MUX_FQ1 0x3
1591# define SYS_CS_MUX_FQ2 0x4
1592# define SYS_CS_MUX_FQ3 0x5
1593# define SYS_CS_MUX_FQ4 0x6
1594# define SYS_CS_MUX_FQ5 0x7
1595#define SYS_CPUPLL 0xB1900060
1596#define SYS_AUXPLL 0xB1900064
1597
1598/* AC97 Controller */
1599#define AC97C_CONFIG 0xB0000000
1600# define AC97C_RECV_SLOTS_BIT 13
1601# define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
1602# define AC97C_XMIT_SLOTS_BIT 3
1603# define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
1604# define AC97C_SG (1 << 2)
1605# define AC97C_SYNC (1 << 1)
1606# define AC97C_RESET (1 << 0)
1607#define AC97C_STATUS 0xB0000004
1608# define AC97C_XU (1 << 11)
1609# define AC97C_XO (1 << 10)
1610# define AC97C_RU (1 << 9)
1611# define AC97C_RO (1 << 8)
1612# define AC97C_READY (1 << 7)
1613# define AC97C_CP (1 << 6)
1614# define AC97C_TR (1 << 5)
1615# define AC97C_TE (1 << 4)
1616# define AC97C_TF (1 << 3)
1617# define AC97C_RR (1 << 2)
1618# define AC97C_RE (1 << 1)
1619# define AC97C_RF (1 << 0)
1620#define AC97C_DATA 0xB0000008
1621#define AC97C_CMD 0xB000000C
1622# define AC97C_WD_BIT 16
1623# define AC97C_READ (1 << 7)
1624# define AC97C_INDEX_MASK 0x7f
1625#define AC97C_CNTRL 0xB0000010
1626# define AC97C_RS (1 << 1)
1627# define AC97C_CE (1 << 0)
1628
1629/* Secure Digital (SD) Controller */
1630#define SD0_XMIT_FIFO 0xB0600000
1631#define SD0_RECV_FIFO 0xB0600004
1632#define SD1_XMIT_FIFO 0xB0680000
1633#define SD1_RECV_FIFO 0xB0680004
1634
1635#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
1636/* Au1500 PCI Controller */
1637#define Au1500_CFG_BASE 0xB4005000 /* virtual, KSEG1 addr */
1638#define Au1500_PCI_CMEM (Au1500_CFG_BASE + 0)
1639#define Au1500_PCI_CFG (Au1500_CFG_BASE + 4)
1640# define PCI_ERROR ((1 << 22) | (1 << 23) | (1 << 24) | \
1641 (1 << 25) | (1 << 26) | (1 << 27))
1642#define Au1500_PCI_B2BMASK_CCH (Au1500_CFG_BASE + 8)
1643#define Au1500_PCI_B2B0_VID (Au1500_CFG_BASE + 0xC)
1644#define Au1500_PCI_B2B1_ID (Au1500_CFG_BASE + 0x10)
1645#define Au1500_PCI_MWMASK_DEV (Au1500_CFG_BASE + 0x14)
1646#define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18)
1647#define Au1500_PCI_ERR_ADDR (Au1500_CFG_BASE + 0x1C)
1648#define Au1500_PCI_SPEC_INTACK (Au1500_CFG_BASE + 0x20)
1649#define Au1500_PCI_ID (Au1500_CFG_BASE + 0x100)
1650#define Au1500_PCI_STATCMD (Au1500_CFG_BASE + 0x104)
1651#define Au1500_PCI_CLASSREV (Au1500_CFG_BASE + 0x108)
1652#define Au1500_PCI_HDRTYPE (Au1500_CFG_BASE + 0x10C)
1653#define Au1500_PCI_MBAR (Au1500_CFG_BASE + 0x110)
1654
1655#define Au1500_PCI_HDR 0xB4005100 /* virtual, KSEG1 addr */
1656
1657/*
1658 * All of our structures, like PCI resource, have 32-bit members.
1659 * Drivers are expected to do an ioremap on the PCI MEM resource, but it's
1660 * hard to store 0x4 0000 0000 in a 32-bit type. We require a small patch
1661 * to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and
1662 * (u32)Au1500_PCI_MEM_END and change those to the full 36-bit PCI MEM
1663 * addresses. For PCI I/O, it's simpler because we get to do the ioremap
1664 * ourselves and then adjust the device's resources.
1665 */
1666#define Au1500_EXT_CFG 0x600000000ULL
1667#define Au1500_EXT_CFG_TYPE1 0x680000000ULL
1668#define Au1500_PCI_IO_START 0x500000000ULL
1669#define Au1500_PCI_IO_END 0x5000FFFFFULL
1670#define Au1500_PCI_MEM_START 0x440000000ULL
1671#define Au1500_PCI_MEM_END 0x44FFFFFFFULL
1672
1673#define PCI_IO_START 0x00001000
1674#define PCI_IO_END 0x000FFFFF
1675#define PCI_MEM_START 0x40000000
1676#define PCI_MEM_END 0x4FFFFFFF
1677
1678#define PCI_FIRST_DEVFN (0 << 3)
1679#define PCI_LAST_DEVFN (19 << 3)
1680
1681#define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
1682#define IOPORT_RESOURCE_END 0xffffffff
1683#define IOMEM_RESOURCE_START 0x10000000
1684#define IOMEM_RESOURCE_END 0xffffffff
1685
1686#else /* Au1000 and Au1100 and Au1200 */
1687
1688/* Don't allow any legacy ports probing */
1689#define IOPORT_RESOURCE_START 0x10000000
1690#define IOPORT_RESOURCE_END 0xffffffff
1691#define IOMEM_RESOURCE_START 0x10000000
1692#define IOMEM_RESOURCE_END 0xffffffff
1693
1694#define PCI_IO_START 0
1695#define PCI_IO_END 0
1696#define PCI_MEM_START 0
1697#define PCI_MEM_END 0
1698#define PCI_FIRST_DEVFN 0
1699#define PCI_LAST_DEVFN 0
1700
1701#endif
1702
1703#ifndef _LANGUAGE_ASSEMBLY
1704typedef volatile struct {
1705 /* 0x0000 */ u32 toytrim;
1706 /* 0x0004 */ u32 toywrite;
1707 /* 0x0008 */ u32 toymatch0;
1708 /* 0x000C */ u32 toymatch1;
1709 /* 0x0010 */ u32 toymatch2;
1710 /* 0x0014 */ u32 cntrctrl;
1711 /* 0x0018 */ u32 scratch0;
1712 /* 0x001C */ u32 scratch1;
1713 /* 0x0020 */ u32 freqctrl0;
1714 /* 0x0024 */ u32 freqctrl1;
1715 /* 0x0028 */ u32 clksrc;
1716 /* 0x002C */ u32 pinfunc;
1717 /* 0x0030 */ u32 reserved0;
1718 /* 0x0034 */ u32 wakemsk;
1719 /* 0x0038 */ u32 endian;
1720 /* 0x003C */ u32 powerctrl;
1721 /* 0x0040 */ u32 toyread;
1722 /* 0x0044 */ u32 rtctrim;
1723 /* 0x0048 */ u32 rtcwrite;
1724 /* 0x004C */ u32 rtcmatch0;
1725 /* 0x0050 */ u32 rtcmatch1;
1726 /* 0x0054 */ u32 rtcmatch2;
1727 /* 0x0058 */ u32 rtcread;
1728 /* 0x005C */ u32 wakesrc;
1729 /* 0x0060 */ u32 cpupll;
1730 /* 0x0064 */ u32 auxpll;
1731 /* 0x0068 */ u32 reserved1;
1732 /* 0x006C */ u32 reserved2;
1733 /* 0x0070 */ u32 reserved3;
1734 /* 0x0074 */ u32 reserved4;
1735 /* 0x0078 */ u32 slppwr;
1736 /* 0x007C */ u32 sleep;
1737 /* 0x0080 */ u32 reserved5[32];
1738 /* 0x0100 */ u32 trioutrd;
1739#define trioutclr trioutrd
1740 /* 0x0104 */ u32 reserved6;
1741 /* 0x0108 */ u32 outputrd;
1742#define outputset outputrd
1743 /* 0x010C */ u32 outputclr;
1744 /* 0x0110 */ u32 pinstaterd;
1745#define pininputen pinstaterd
1746} AU1X00_SYS;
1747
1748static AU1X00_SYS * const sys = (AU1X00_SYS *)SYS_BASE;
1749
1750#endif
1751
1752/*
1753 * Processor information based on PRID.
1754 * Copied from PowerPC.
1755 */
1756#ifndef _LANGUAGE_ASSEMBLY
1757struct cpu_spec {
1758 /* CPU is matched via (PRID & prid_mask) == prid_value */
1759 unsigned int prid_mask;
1760 unsigned int prid_value;
1761
1762 char *cpu_name;
1763 unsigned char cpu_od; /* Set Config[OD] */
1764 unsigned char cpu_bclk; /* Enable BCLK switching */
1765 unsigned char cpu_pll_wo; /* sys_cpupll reg. write-only */
1766};
1767
1768extern struct cpu_spec cpu_specs[];
1769extern struct cpu_spec *cur_cpu_spec[];
1770#endif
1771
1772#endif
diff --git a/include/asm-mips/mach-au1x00/au1000_dma.h b/include/asm-mips/mach-au1x00/au1000_dma.h
deleted file mode 100644
index c333b4e1cd44..000000000000
--- a/include/asm-mips/mach-au1x00/au1000_dma.h
+++ /dev/null
@@ -1,458 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Defines for using and allocating DMA channels on the Alchemy
4 * Au1x00 MIPS processors.
5 *
6 * Copyright 2000, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 *
29 */
30#ifndef __ASM_AU1000_DMA_H
31#define __ASM_AU1000_DMA_H
32
33#include <linux/io.h> /* need byte IO */
34#include <linux/spinlock.h> /* And spinlocks */
35#include <linux/delay.h>
36#include <asm/system.h>
37
38#define NUM_AU1000_DMA_CHANNELS 8
39
40/* DMA Channel Base Addresses */
41#define DMA_CHANNEL_BASE 0xB4002000
42#define DMA_CHANNEL_LEN 0x00000100
43
44/* DMA Channel Register Offsets */
45#define DMA_MODE_SET 0x00000000
46#define DMA_MODE_READ DMA_MODE_SET
47#define DMA_MODE_CLEAR 0x00000004
48/* DMA Mode register bits follow */
49#define DMA_DAH_MASK (0x0f << 20)
50#define DMA_DID_BIT 16
51#define DMA_DID_MASK (0x0f << DMA_DID_BIT)
52#define DMA_DS (1 << 15)
53#define DMA_BE (1 << 13)
54#define DMA_DR (1 << 12)
55#define DMA_TS8 (1 << 11)
56#define DMA_DW_BIT 9
57#define DMA_DW_MASK (0x03 << DMA_DW_BIT)
58#define DMA_DW8 (0 << DMA_DW_BIT)
59#define DMA_DW16 (1 << DMA_DW_BIT)
60#define DMA_DW32 (2 << DMA_DW_BIT)
61#define DMA_NC (1 << 8)
62#define DMA_IE (1 << 7)
63#define DMA_HALT (1 << 6)
64#define DMA_GO (1 << 5)
65#define DMA_AB (1 << 4)
66#define DMA_D1 (1 << 3)
67#define DMA_BE1 (1 << 2)
68#define DMA_D0 (1 << 1)
69#define DMA_BE0 (1 << 0)
70
71#define DMA_PERIPHERAL_ADDR 0x00000008
72#define DMA_BUFFER0_START 0x0000000C
73#define DMA_BUFFER1_START 0x00000014
74#define DMA_BUFFER0_COUNT 0x00000010
75#define DMA_BUFFER1_COUNT 0x00000018
76#define DMA_BAH_BIT 16
77#define DMA_BAH_MASK (0x0f << DMA_BAH_BIT)
78#define DMA_COUNT_BIT 0
79#define DMA_COUNT_MASK (0xffff << DMA_COUNT_BIT)
80
81/* DMA Device IDs follow */
82enum {
83 DMA_ID_UART0_TX = 0,
84 DMA_ID_UART0_RX,
85 DMA_ID_GP04,
86 DMA_ID_GP05,
87 DMA_ID_AC97C_TX,
88 DMA_ID_AC97C_RX,
89 DMA_ID_UART3_TX,
90 DMA_ID_UART3_RX,
91 DMA_ID_USBDEV_EP0_RX,
92 DMA_ID_USBDEV_EP0_TX,
93 DMA_ID_USBDEV_EP2_TX,
94 DMA_ID_USBDEV_EP3_TX,
95 DMA_ID_USBDEV_EP4_RX,
96 DMA_ID_USBDEV_EP5_RX,
97 DMA_ID_I2S_TX,
98 DMA_ID_I2S_RX,
99 DMA_NUM_DEV
100};
101
102/* DMA Device ID's for 2nd bank (AU1100) follow */
103enum {
104 DMA_ID_SD0_TX = 0,
105 DMA_ID_SD0_RX,
106 DMA_ID_SD1_TX,
107 DMA_ID_SD1_RX,
108 DMA_NUM_DEV_BANK2
109};
110
111struct dma_chan {
112 int dev_id; /* this channel is allocated if >= 0, */
113 /* free otherwise */
114 unsigned int io;
115 const char *dev_str;
116 int irq;
117 void *irq_dev;
118 unsigned int fifo_addr;
119 unsigned int mode;
120};
121
122/* These are in arch/mips/au1000/common/dma.c */
123extern struct dma_chan au1000_dma_table[];
124extern int request_au1000_dma(int dev_id,
125 const char *dev_str,
126 irq_handler_t irqhandler,
127 unsigned long irqflags,
128 void *irq_dev_id);
129extern void free_au1000_dma(unsigned int dmanr);
130extern int au1000_dma_read_proc(char *buf, char **start, off_t fpos,
131 int length, int *eof, void *data);
132extern void dump_au1000_dma_channel(unsigned int dmanr);
133extern spinlock_t au1000_dma_spin_lock;
134
135static inline struct dma_chan *get_dma_chan(unsigned int dmanr)
136{
137 if (dmanr >= NUM_AU1000_DMA_CHANNELS ||
138 au1000_dma_table[dmanr].dev_id < 0)
139 return NULL;
140 return &au1000_dma_table[dmanr];
141}
142
143static inline unsigned long claim_dma_lock(void)
144{
145 unsigned long flags;
146
147 spin_lock_irqsave(&au1000_dma_spin_lock, flags);
148 return flags;
149}
150
151static inline void release_dma_lock(unsigned long flags)
152{
153 spin_unlock_irqrestore(&au1000_dma_spin_lock, flags);
154}
155
156/*
157 * Set the DMA buffer enable bits in the mode register.
158 */
159static inline void enable_dma_buffer0(unsigned int dmanr)
160{
161 struct dma_chan *chan = get_dma_chan(dmanr);
162
163 if (!chan)
164 return;
165 au_writel(DMA_BE0, chan->io + DMA_MODE_SET);
166}
167
168static inline void enable_dma_buffer1(unsigned int dmanr)
169{
170 struct dma_chan *chan = get_dma_chan(dmanr);
171
172 if (!chan)
173 return;
174 au_writel(DMA_BE1, chan->io + DMA_MODE_SET);
175}
176static inline void enable_dma_buffers(unsigned int dmanr)
177{
178 struct dma_chan *chan = get_dma_chan(dmanr);
179
180 if (!chan)
181 return;
182 au_writel(DMA_BE0 | DMA_BE1, chan->io + DMA_MODE_SET);
183}
184
185static inline void start_dma(unsigned int dmanr)
186{
187 struct dma_chan *chan = get_dma_chan(dmanr);
188
189 if (!chan)
190 return;
191 au_writel(DMA_GO, chan->io + DMA_MODE_SET);
192}
193
194#define DMA_HALT_POLL 0x5000
195
196static inline void halt_dma(unsigned int dmanr)
197{
198 struct dma_chan *chan = get_dma_chan(dmanr);
199 int i;
200
201 if (!chan)
202 return;
203 au_writel(DMA_GO, chan->io + DMA_MODE_CLEAR);
204
205 /* Poll the halt bit */
206 for (i = 0; i < DMA_HALT_POLL; i++)
207 if (au_readl(chan->io + DMA_MODE_READ) & DMA_HALT)
208 break;
209 if (i == DMA_HALT_POLL)
210 printk(KERN_INFO "halt_dma: HALT poll expired!\n");
211}
212
213static inline void disable_dma(unsigned int dmanr)
214{
215 struct dma_chan *chan = get_dma_chan(dmanr);
216
217 if (!chan)
218 return;
219
220 halt_dma(dmanr);
221
222 /* Now we can disable the buffers */
223 au_writel(~DMA_GO, chan->io + DMA_MODE_CLEAR);
224}
225
226static inline int dma_halted(unsigned int dmanr)
227{
228 struct dma_chan *chan = get_dma_chan(dmanr);
229
230 if (!chan)
231 return 1;
232 return (au_readl(chan->io + DMA_MODE_READ) & DMA_HALT) ? 1 : 0;
233}
234
235/* Initialize a DMA channel. */
236static inline void init_dma(unsigned int dmanr)
237{
238 struct dma_chan *chan = get_dma_chan(dmanr);
239 u32 mode;
240
241 if (!chan)
242 return;
243
244 disable_dma(dmanr);
245
246 /* Set device FIFO address */
247 au_writel(CPHYSADDR(chan->fifo_addr), chan->io + DMA_PERIPHERAL_ADDR);
248
249 mode = chan->mode | (chan->dev_id << DMA_DID_BIT);
250 if (chan->irq)
251 mode |= DMA_IE;
252
253 au_writel(~mode, chan->io + DMA_MODE_CLEAR);
254 au_writel(mode, chan->io + DMA_MODE_SET);
255}
256
257/*
258 * Set mode for a specific DMA channel
259 */
260static inline void set_dma_mode(unsigned int dmanr, unsigned int mode)
261{
262 struct dma_chan *chan = get_dma_chan(dmanr);
263
264 if (!chan)
265 return;
266 /*
267 * set_dma_mode is only allowed to change endianess, direction,
268 * transfer size, device FIFO width, and coherency settings.
269 * Make sure anything else is masked off.
270 */
271 mode &= (DMA_BE | DMA_DR | DMA_TS8 | DMA_DW_MASK | DMA_NC);
272 chan->mode &= ~(DMA_BE | DMA_DR | DMA_TS8 | DMA_DW_MASK | DMA_NC);
273 chan->mode |= mode;
274}
275
276static inline unsigned int get_dma_mode(unsigned int dmanr)
277{
278 struct dma_chan *chan = get_dma_chan(dmanr);
279
280 if (!chan)
281 return 0;
282 return chan->mode;
283}
284
285static inline int get_dma_active_buffer(unsigned int dmanr)
286{
287 struct dma_chan *chan = get_dma_chan(dmanr);
288
289 if (!chan)
290 return -1;
291 return (au_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? 1 : 0;
292}
293
294/*
295 * Set the device FIFO address for a specific DMA channel - only
296 * applicable to GPO4 and GPO5. All the other devices have fixed
297 * FIFO addresses.
298 */
299static inline void set_dma_fifo_addr(unsigned int dmanr, unsigned int a)
300{
301 struct dma_chan *chan = get_dma_chan(dmanr);
302
303 if (!chan)
304 return;
305
306 if (chan->mode & DMA_DS) /* second bank of device IDs */
307 return;
308
309 if (chan->dev_id != DMA_ID_GP04 && chan->dev_id != DMA_ID_GP05)
310 return;
311
312 au_writel(CPHYSADDR(a), chan->io + DMA_PERIPHERAL_ADDR);
313}
314
315/*
316 * Clear the DMA buffer done bits in the mode register.
317 */
318static inline void clear_dma_done0(unsigned int dmanr)
319{
320 struct dma_chan *chan = get_dma_chan(dmanr);
321
322 if (!chan)
323 return;
324 au_writel(DMA_D0, chan->io + DMA_MODE_CLEAR);
325}
326
327static inline void clear_dma_done1(unsigned int dmanr)
328{
329 struct dma_chan *chan = get_dma_chan(dmanr);
330
331 if (!chan)
332 return;
333 au_writel(DMA_D1, chan->io + DMA_MODE_CLEAR);
334}
335
336/*
337 * This does nothing - not applicable to Au1000 DMA.
338 */
339static inline void set_dma_page(unsigned int dmanr, char pagenr)
340{
341}
342
343/*
344 * Set Buffer 0 transfer address for specific DMA channel.
345 */
346static inline void set_dma_addr0(unsigned int dmanr, unsigned int a)
347{
348 struct dma_chan *chan = get_dma_chan(dmanr);
349
350 if (!chan)
351 return;
352 au_writel(a, chan->io + DMA_BUFFER0_START);
353}
354
355/*
356 * Set Buffer 1 transfer address for specific DMA channel.
357 */
358static inline void set_dma_addr1(unsigned int dmanr, unsigned int a)
359{
360 struct dma_chan *chan = get_dma_chan(dmanr);
361
362 if (!chan)
363 return;
364 au_writel(a, chan->io + DMA_BUFFER1_START);
365}
366
367
368/*
369 * Set Buffer 0 transfer size (max 64k) for a specific DMA channel.
370 */
371static inline void set_dma_count0(unsigned int dmanr, unsigned int count)
372{
373 struct dma_chan *chan = get_dma_chan(dmanr);
374
375 if (!chan)
376 return;
377 count &= DMA_COUNT_MASK;
378 au_writel(count, chan->io + DMA_BUFFER0_COUNT);
379}
380
381/*
382 * Set Buffer 1 transfer size (max 64k) for a specific DMA channel.
383 */
384static inline void set_dma_count1(unsigned int dmanr, unsigned int count)
385{
386 struct dma_chan *chan = get_dma_chan(dmanr);
387
388 if (!chan)
389 return;
390 count &= DMA_COUNT_MASK;
391 au_writel(count, chan->io + DMA_BUFFER1_COUNT);
392}
393
394/*
395 * Set both buffer transfer sizes (max 64k) for a specific DMA channel.
396 */
397static inline void set_dma_count(unsigned int dmanr, unsigned int count)
398{
399 struct dma_chan *chan = get_dma_chan(dmanr);
400
401 if (!chan)
402 return;
403 count &= DMA_COUNT_MASK;
404 au_writel(count, chan->io + DMA_BUFFER0_COUNT);
405 au_writel(count, chan->io + DMA_BUFFER1_COUNT);
406}
407
408/*
409 * Returns which buffer has its done bit set in the mode register.
410 * Returns -1 if neither or both done bits set.
411 */
412static inline unsigned int get_dma_buffer_done(unsigned int dmanr)
413{
414 struct dma_chan *chan = get_dma_chan(dmanr);
415
416 if (!chan)
417 return 0;
418 return au_readl(chan->io + DMA_MODE_READ) & (DMA_D0 | DMA_D1);
419}
420
421
422/*
423 * Returns the DMA channel's Buffer Done IRQ number.
424 */
425static inline int get_dma_done_irq(unsigned int dmanr)
426{
427 struct dma_chan *chan = get_dma_chan(dmanr);
428
429 if (!chan)
430 return -1;
431 return chan->irq;
432}
433
434/*
435 * Get DMA residue count. Returns the number of _bytes_ left to transfer.
436 */
437static inline int get_dma_residue(unsigned int dmanr)
438{
439 int curBufCntReg, count;
440 struct dma_chan *chan = get_dma_chan(dmanr);
441
442 if (!chan)
443 return 0;
444
445 curBufCntReg = (au_readl(chan->io + DMA_MODE_READ) & DMA_AB) ?
446 DMA_BUFFER1_COUNT : DMA_BUFFER0_COUNT;
447
448 count = au_readl(chan->io + curBufCntReg) & DMA_COUNT_MASK;
449
450 if ((chan->mode & DMA_DW_MASK) == DMA_DW16)
451 count <<= 1;
452 else if ((chan->mode & DMA_DW_MASK) == DMA_DW32)
453 count <<= 2;
454
455 return count;
456}
457
458#endif /* __ASM_AU1000_DMA_H */
diff --git a/include/asm-mips/mach-au1x00/au1000_gpio.h b/include/asm-mips/mach-au1x00/au1000_gpio.h
deleted file mode 100644
index d8c96fda5549..000000000000
--- a/include/asm-mips/mach-au1x00/au1000_gpio.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * FILE NAME au1000_gpio.h
3 *
4 * BRIEF MODULE DESCRIPTION
5 * API to Alchemy Au1xx0 GPIO device.
6 *
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 * Steve Longerbeam
9 *
10 * Copyright 2001, 2008 MontaVista Software Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32
33#ifndef __AU1000_GPIO_H
34#define __AU1000_GPIO_H
35
36#include <linux/ioctl.h>
37
38#define AU1000GPIO_IOC_MAGIC 'A'
39
40#define AU1000GPIO_IN _IOR(AU1000GPIO_IOC_MAGIC, 0, int)
41#define AU1000GPIO_SET _IOW(AU1000GPIO_IOC_MAGIC, 1, int)
42#define AU1000GPIO_CLEAR _IOW(AU1000GPIO_IOC_MAGIC, 2, int)
43#define AU1000GPIO_OUT _IOW(AU1000GPIO_IOC_MAGIC, 3, int)
44#define AU1000GPIO_TRISTATE _IOW(AU1000GPIO_IOC_MAGIC, 4, int)
45#define AU1000GPIO_AVAIL_MASK _IOR(AU1000GPIO_IOC_MAGIC, 5, int)
46
47#ifdef __KERNEL__
48extern u32 get_au1000_avail_gpio_mask(void);
49extern int au1000gpio_tristate(u32 data);
50extern int au1000gpio_in(u32 *data);
51extern int au1000gpio_set(u32 data);
52extern int au1000gpio_clear(u32 data);
53extern int au1000gpio_out(u32 data);
54#endif
55
56#endif
diff --git a/include/asm-mips/mach-au1x00/au1100_mmc.h b/include/asm-mips/mach-au1x00/au1100_mmc.h
deleted file mode 100644
index c35e20918490..000000000000
--- a/include/asm-mips/mach-au1x00/au1100_mmc.h
+++ /dev/null
@@ -1,208 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Defines for using the MMC/SD controllers on the
4 * Alchemy Au1100 mips processor.
5 *
6 * Copyright (c) 2003 Embedded Edge, LLC.
7 * Author: Embedded Edge, LLC.
8 * dan@embeddededge.com or tim@embeddededge.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 *
30 */
31/*
32 * AU1100 MMC/SD definitions.
33 *
34 * From "AMD Alchemy Solutions Au1100 Processor Data Book - Preliminary"
35 * June, 2003
36 */
37
38#ifndef __ASM_AU1100_MMC_H
39#define __ASM_AU1100_MMC_H
40
41#include <linux/leds.h>
42
43struct au1xmmc_platform_data {
44 int(*cd_setup)(void *mmc_host, int on);
45 int(*card_inserted)(void *mmc_host);
46 int(*card_readonly)(void *mmc_host);
47 void(*set_power)(void *mmc_host, int state);
48 struct led_classdev *led;
49};
50
51#define SD0_BASE 0xB0600000
52#define SD1_BASE 0xB0680000
53
54
55/*
56 * Register offsets.
57 */
58#define SD_TXPORT (0x0000)
59#define SD_RXPORT (0x0004)
60#define SD_CONFIG (0x0008)
61#define SD_ENABLE (0x000C)
62#define SD_CONFIG2 (0x0010)
63#define SD_BLKSIZE (0x0014)
64#define SD_STATUS (0x0018)
65#define SD_DEBUG (0x001C)
66#define SD_CMD (0x0020)
67#define SD_CMDARG (0x0024)
68#define SD_RESP3 (0x0028)
69#define SD_RESP2 (0x002C)
70#define SD_RESP1 (0x0030)
71#define SD_RESP0 (0x0034)
72#define SD_TIMEOUT (0x0038)
73
74
75/*
76 * SD_TXPORT bit definitions.
77 */
78#define SD_TXPORT_TXD (0x000000ff)
79
80
81/*
82 * SD_RXPORT bit definitions.
83 */
84#define SD_RXPORT_RXD (0x000000ff)
85
86
87/*
88 * SD_CONFIG bit definitions.
89 */
90#define SD_CONFIG_DIV (0x000001ff)
91#define SD_CONFIG_DE (0x00000200)
92#define SD_CONFIG_NE (0x00000400)
93#define SD_CONFIG_TU (0x00000800)
94#define SD_CONFIG_TO (0x00001000)
95#define SD_CONFIG_RU (0x00002000)
96#define SD_CONFIG_RO (0x00004000)
97#define SD_CONFIG_I (0x00008000)
98#define SD_CONFIG_CR (0x00010000)
99#define SD_CONFIG_RAT (0x00020000)
100#define SD_CONFIG_DD (0x00040000)
101#define SD_CONFIG_DT (0x00080000)
102#define SD_CONFIG_SC (0x00100000)
103#define SD_CONFIG_RC (0x00200000)
104#define SD_CONFIG_WC (0x00400000)
105#define SD_CONFIG_xxx (0x00800000)
106#define SD_CONFIG_TH (0x01000000)
107#define SD_CONFIG_TE (0x02000000)
108#define SD_CONFIG_TA (0x04000000)
109#define SD_CONFIG_RH (0x08000000)
110#define SD_CONFIG_RA (0x10000000)
111#define SD_CONFIG_RF (0x20000000)
112#define SD_CONFIG_CD (0x40000000)
113#define SD_CONFIG_SI (0x80000000)
114
115
116/*
117 * SD_ENABLE bit definitions.
118 */
119#define SD_ENABLE_CE (0x00000001)
120#define SD_ENABLE_R (0x00000002)
121
122
123/*
124 * SD_CONFIG2 bit definitions.
125 */
126#define SD_CONFIG2_EN (0x00000001)
127#define SD_CONFIG2_FF (0x00000002)
128#define SD_CONFIG2_xx1 (0x00000004)
129#define SD_CONFIG2_DF (0x00000008)
130#define SD_CONFIG2_DC (0x00000010)
131#define SD_CONFIG2_xx2 (0x000000e0)
132#define SD_CONFIG2_WB (0x00000100)
133#define SD_CONFIG2_RW (0x00000200)
134
135
136/*
137 * SD_BLKSIZE bit definitions.
138 */
139#define SD_BLKSIZE_BS (0x000007ff)
140#define SD_BLKSIZE_BS_SHIFT (0)
141#define SD_BLKSIZE_BC (0x01ff0000)
142#define SD_BLKSIZE_BC_SHIFT (16)
143
144
145/*
146 * SD_STATUS bit definitions.
147 */
148#define SD_STATUS_DCRCW (0x00000007)
149#define SD_STATUS_xx1 (0x00000008)
150#define SD_STATUS_CB (0x00000010)
151#define SD_STATUS_DB (0x00000020)
152#define SD_STATUS_CF (0x00000040)
153#define SD_STATUS_D3 (0x00000080)
154#define SD_STATUS_xx2 (0x00000300)
155#define SD_STATUS_NE (0x00000400)
156#define SD_STATUS_TU (0x00000800)
157#define SD_STATUS_TO (0x00001000)
158#define SD_STATUS_RU (0x00002000)
159#define SD_STATUS_RO (0x00004000)
160#define SD_STATUS_I (0x00008000)
161#define SD_STATUS_CR (0x00010000)
162#define SD_STATUS_RAT (0x00020000)
163#define SD_STATUS_DD (0x00040000)
164#define SD_STATUS_DT (0x00080000)
165#define SD_STATUS_SC (0x00100000)
166#define SD_STATUS_RC (0x00200000)
167#define SD_STATUS_WC (0x00400000)
168#define SD_STATUS_xx3 (0x00800000)
169#define SD_STATUS_TH (0x01000000)
170#define SD_STATUS_TE (0x02000000)
171#define SD_STATUS_TA (0x04000000)
172#define SD_STATUS_RH (0x08000000)
173#define SD_STATUS_RA (0x10000000)
174#define SD_STATUS_RF (0x20000000)
175#define SD_STATUS_CD (0x40000000)
176#define SD_STATUS_SI (0x80000000)
177
178
179/*
180 * SD_CMD bit definitions.
181 */
182#define SD_CMD_GO (0x00000001)
183#define SD_CMD_RY (0x00000002)
184#define SD_CMD_xx1 (0x0000000c)
185#define SD_CMD_CT_MASK (0x000000f0)
186#define SD_CMD_CT_0 (0x00000000)
187#define SD_CMD_CT_1 (0x00000010)
188#define SD_CMD_CT_2 (0x00000020)
189#define SD_CMD_CT_3 (0x00000030)
190#define SD_CMD_CT_4 (0x00000040)
191#define SD_CMD_CT_5 (0x00000050)
192#define SD_CMD_CT_6 (0x00000060)
193#define SD_CMD_CT_7 (0x00000070)
194#define SD_CMD_CI (0x0000ff00)
195#define SD_CMD_CI_SHIFT (8)
196#define SD_CMD_RT_MASK (0x00ff0000)
197#define SD_CMD_RT_0 (0x00000000)
198#define SD_CMD_RT_1 (0x00010000)
199#define SD_CMD_RT_2 (0x00020000)
200#define SD_CMD_RT_3 (0x00030000)
201#define SD_CMD_RT_4 (0x00040000)
202#define SD_CMD_RT_5 (0x00050000)
203#define SD_CMD_RT_6 (0x00060000)
204#define SD_CMD_RT_1B (0x00810000)
205
206
207#endif /* __ASM_AU1100_MMC_H */
208
diff --git a/include/asm-mips/mach-au1x00/au1550_spi.h b/include/asm-mips/mach-au1x00/au1550_spi.h
deleted file mode 100644
index 08e1958e9410..000000000000
--- a/include/asm-mips/mach-au1x00/au1550_spi.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * au1550_spi.h - Au1550 PSC SPI controller driver - platform data structure
3 */
4
5#ifndef _AU1550_SPI_H_
6#define _AU1550_SPI_H_
7
8struct au1550_spi_info {
9 u32 mainclk_hz; /* main input clock frequency of PSC */
10 u16 num_chipselect; /* number of chipselects supported */
11 void (*activate_cs)(struct au1550_spi_info *spi, int cs, int polarity);
12 void (*deactivate_cs)(struct au1550_spi_info *spi, int cs, int polarity);
13};
14
15#endif
diff --git a/include/asm-mips/mach-au1x00/au1xxx.h b/include/asm-mips/mach-au1x00/au1xxx.h
deleted file mode 100644
index 1b3655090ed3..000000000000
--- a/include/asm-mips/mach-au1x00/au1xxx.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
11 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
12 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
13 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
16 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#ifndef _AU1XXX_H_
24#define _AU1XXX_H_
25
26#include <asm/mach-au1x00/au1000.h>
27
28#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || \
29 defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550)
30#include <asm/mach-db1x00/db1x00.h>
31
32#elif defined(CONFIG_MIPS_PB1550)
33#include <asm/mach-pb1x00/pb1550.h>
34
35#elif defined(CONFIG_MIPS_PB1200)
36#include <asm/mach-pb1x00/pb1200.h>
37
38#elif defined(CONFIG_MIPS_DB1200)
39#include <asm/mach-db1x00/db1200.h>
40
41#endif
42
43#endif /* _AU1XXX_H_ */
diff --git a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
deleted file mode 100644
index 44a67bf05dc1..000000000000
--- a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
+++ /dev/null
@@ -1,386 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Include file for Alchemy Semiconductor's Au1550 Descriptor
5 * Based DMA Controller.
6 *
7 * Copyright 2004 Embedded Edge, LLC
8 * dan@embeddededge.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31/*
32 * Specifics for the Au1xxx Descriptor-Based DMA Controller,
33 * first seen in the AU1550 part.
34 */
35#ifndef _AU1000_DBDMA_H_
36#define _AU1000_DBDMA_H_
37
38#ifndef _LANGUAGE_ASSEMBLY
39
40/*
41 * The DMA base addresses.
42 * The channels are every 256 bytes (0x0100) from the channel 0 base.
43 * Interrupt status/enable is bits 15:0 for channels 15 to zero.
44 */
45#define DDMA_GLOBAL_BASE 0xb4003000
46#define DDMA_CHANNEL_BASE 0xb4002000
47
48typedef volatile struct dbdma_global {
49 u32 ddma_config;
50 u32 ddma_intstat;
51 u32 ddma_throttle;
52 u32 ddma_inten;
53} dbdma_global_t;
54
55/* General Configuration. */
56#define DDMA_CONFIG_AF (1 << 2)
57#define DDMA_CONFIG_AH (1 << 1)
58#define DDMA_CONFIG_AL (1 << 0)
59
60#define DDMA_THROTTLE_EN (1 << 31)
61
62/* The structure of a DMA Channel. */
63typedef volatile struct au1xxx_dma_channel {
64 u32 ddma_cfg; /* See below */
65 u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */
66 u32 ddma_statptr; /* word aligned pointer to status word */
67 u32 ddma_dbell; /* A write activates channel operation */
68 u32 ddma_irq; /* If bit 0 set, interrupt pending */
69 u32 ddma_stat; /* See below */
70 u32 ddma_bytecnt; /* Byte count, valid only when chan idle */
71 /* Remainder, up to the 256 byte boundary, is reserved. */
72} au1x_dma_chan_t;
73
74#define DDMA_CFG_SED (1 << 9) /* source DMA level/edge detect */
75#define DDMA_CFG_SP (1 << 8) /* source DMA polarity */
76#define DDMA_CFG_DED (1 << 7) /* destination DMA level/edge detect */
77#define DDMA_CFG_DP (1 << 6) /* destination DMA polarity */
78#define DDMA_CFG_SYNC (1 << 5) /* Sync static bus controller */
79#define DDMA_CFG_PPR (1 << 4) /* PCI posted read/write control */
80#define DDMA_CFG_DFN (1 << 3) /* Descriptor fetch non-coherent */
81#define DDMA_CFG_SBE (1 << 2) /* Source big endian */
82#define DDMA_CFG_DBE (1 << 1) /* Destination big endian */
83#define DDMA_CFG_EN (1 << 0) /* Channel enable */
84
85/*
86 * Always set when descriptor processing done, regardless of
87 * interrupt enable state. Reflected in global intstat, don't
88 * clear this until global intstat is read/used.
89 */
90#define DDMA_IRQ_IN (1 << 0)
91
92#define DDMA_STAT_DB (1 << 2) /* Doorbell pushed */
93#define DDMA_STAT_V (1 << 1) /* Descriptor valid */
94#define DDMA_STAT_H (1 << 0) /* Channel Halted */
95
96/*
97 * "Standard" DDMA Descriptor.
98 * Must be 32-byte aligned.
99 */
100typedef volatile struct au1xxx_ddma_desc {
101 u32 dscr_cmd0; /* See below */
102 u32 dscr_cmd1; /* See below */
103 u32 dscr_source0; /* source phys address */
104 u32 dscr_source1; /* See below */
105 u32 dscr_dest0; /* Destination address */
106 u32 dscr_dest1; /* See below */
107 u32 dscr_stat; /* completion status */
108 u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */
109 /*
110 * First 32 bytes are HW specific!!!
111 * Lets have some SW data following -- make sure it's 32 bytes.
112 */
113 u32 sw_status;
114 u32 sw_context;
115 u32 sw_reserved[6];
116} au1x_ddma_desc_t;
117
118#define DSCR_CMD0_V (1 << 31) /* Descriptor valid */
119#define DSCR_CMD0_MEM (1 << 30) /* mem-mem transfer */
120#define DSCR_CMD0_SID_MASK (0x1f << 25) /* Source ID */
121#define DSCR_CMD0_DID_MASK (0x1f << 20) /* Destination ID */
122#define DSCR_CMD0_SW_MASK (0x3 << 18) /* Source Width */
123#define DSCR_CMD0_DW_MASK (0x3 << 16) /* Destination Width */
124#define DSCR_CMD0_ARB (0x1 << 15) /* Set for Hi Pri */
125#define DSCR_CMD0_DT_MASK (0x3 << 13) /* Descriptor Type */
126#define DSCR_CMD0_SN (0x1 << 12) /* Source non-coherent */
127#define DSCR_CMD0_DN (0x1 << 11) /* Destination non-coherent */
128#define DSCR_CMD0_SM (0x1 << 10) /* Stride mode */
129#define DSCR_CMD0_IE (0x1 << 8) /* Interrupt Enable */
130#define DSCR_CMD0_SP (0x1 << 4) /* Status pointer select */
131#define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */
132#define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */
133
134#define SW_STATUS_INUSE (1 << 0)
135
136/* Command 0 device IDs. */
137#ifdef CONFIG_SOC_AU1550
138#define DSCR_CMD0_UART0_TX 0
139#define DSCR_CMD0_UART0_RX 1
140#define DSCR_CMD0_UART3_TX 2
141#define DSCR_CMD0_UART3_RX 3
142#define DSCR_CMD0_DMA_REQ0 4
143#define DSCR_CMD0_DMA_REQ1 5
144#define DSCR_CMD0_DMA_REQ2 6
145#define DSCR_CMD0_DMA_REQ3 7
146#define DSCR_CMD0_USBDEV_RX0 8
147#define DSCR_CMD0_USBDEV_TX0 9
148#define DSCR_CMD0_USBDEV_TX1 10
149#define DSCR_CMD0_USBDEV_TX2 11
150#define DSCR_CMD0_USBDEV_RX3 12
151#define DSCR_CMD0_USBDEV_RX4 13
152#define DSCR_CMD0_PSC0_TX 14
153#define DSCR_CMD0_PSC0_RX 15
154#define DSCR_CMD0_PSC1_TX 16
155#define DSCR_CMD0_PSC1_RX 17
156#define DSCR_CMD0_PSC2_TX 18
157#define DSCR_CMD0_PSC2_RX 19
158#define DSCR_CMD0_PSC3_TX 20
159#define DSCR_CMD0_PSC3_RX 21
160#define DSCR_CMD0_PCI_WRITE 22
161#define DSCR_CMD0_NAND_FLASH 23
162#define DSCR_CMD0_MAC0_RX 24
163#define DSCR_CMD0_MAC0_TX 25
164#define DSCR_CMD0_MAC1_RX 26
165#define DSCR_CMD0_MAC1_TX 27
166#endif /* CONFIG_SOC_AU1550 */
167
168#ifdef CONFIG_SOC_AU1200
169#define DSCR_CMD0_UART0_TX 0
170#define DSCR_CMD0_UART0_RX 1
171#define DSCR_CMD0_UART1_TX 2
172#define DSCR_CMD0_UART1_RX 3
173#define DSCR_CMD0_DMA_REQ0 4
174#define DSCR_CMD0_DMA_REQ1 5
175#define DSCR_CMD0_MAE_BE 6
176#define DSCR_CMD0_MAE_FE 7
177#define DSCR_CMD0_SDMS_TX0 8
178#define DSCR_CMD0_SDMS_RX0 9
179#define DSCR_CMD0_SDMS_TX1 10
180#define DSCR_CMD0_SDMS_RX1 11
181#define DSCR_CMD0_AES_TX 13
182#define DSCR_CMD0_AES_RX 12
183#define DSCR_CMD0_PSC0_TX 14
184#define DSCR_CMD0_PSC0_RX 15
185#define DSCR_CMD0_PSC1_TX 16
186#define DSCR_CMD0_PSC1_RX 17
187#define DSCR_CMD0_CIM_RXA 18
188#define DSCR_CMD0_CIM_RXB 19
189#define DSCR_CMD0_CIM_RXC 20
190#define DSCR_CMD0_MAE_BOTH 21
191#define DSCR_CMD0_LCD 22
192#define DSCR_CMD0_NAND_FLASH 23
193#define DSCR_CMD0_PSC0_SYNC 24
194#define DSCR_CMD0_PSC1_SYNC 25
195#define DSCR_CMD0_CIM_SYNC 26
196#endif /* CONFIG_SOC_AU1200 */
197
198#define DSCR_CMD0_THROTTLE 30
199#define DSCR_CMD0_ALWAYS 31
200#define DSCR_NDEV_IDS 32
201/* This macro is used to find/create custom device types */
202#define DSCR_DEV2CUSTOM_ID(x, d) (((((x) & 0xFFFF) << 8) | 0x32000000) | \
203 ((d) & 0xFF))
204#define DSCR_CUSTOM2DEV_ID(x) ((x) & 0xFF)
205
206#define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25)
207#define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20)
208
209/* Source/Destination transfer width. */
210#define DSCR_CMD0_BYTE 0
211#define DSCR_CMD0_HALFWORD 1
212#define DSCR_CMD0_WORD 2
213
214#define DSCR_CMD0_SW(x) (((x) & 0x3) << 18)
215#define DSCR_CMD0_DW(x) (((x) & 0x3) << 16)
216
217/* DDMA Descriptor Type. */
218#define DSCR_CMD0_STANDARD 0
219#define DSCR_CMD0_LITERAL 1
220#define DSCR_CMD0_CMP_BRANCH 2
221
222#define DSCR_CMD0_DT(x) (((x) & 0x3) << 13)
223
224/* Status Instruction. */
225#define DSCR_CMD0_ST_NOCHANGE 0 /* Don't change */
226#define DSCR_CMD0_ST_CURRENT 1 /* Write current status */
227#define DSCR_CMD0_ST_CMD0 2 /* Write cmd0 with V cleared */
228#define DSCR_CMD0_ST_BYTECNT 3 /* Write remaining byte count */
229
230#define DSCR_CMD0_ST(x) (((x) & 0x3) << 0)
231
232/* Descriptor Command 1. */
233#define DSCR_CMD1_SUPTR_MASK (0xf << 28) /* upper 4 bits of src addr */
234#define DSCR_CMD1_DUPTR_MASK (0xf << 24) /* upper 4 bits of dest addr */
235#define DSCR_CMD1_FL_MASK (0x3 << 22) /* Flag bits */
236#define DSCR_CMD1_BC_MASK (0x3fffff) /* Byte count */
237
238/* Flag description. */
239#define DSCR_CMD1_FL_MEM_STRIDE0 0
240#define DSCR_CMD1_FL_MEM_STRIDE1 1
241#define DSCR_CMD1_FL_MEM_STRIDE2 2
242
243#define DSCR_CMD1_FL(x) (((x) & 0x3) << 22)
244
245/* Source1, 1-dimensional stride. */
246#define DSCR_SRC1_STS_MASK (3 << 30) /* Src xfer size */
247#define DSCR_SRC1_SAM_MASK (3 << 28) /* Src xfer movement */
248#define DSCR_SRC1_SB_MASK (0x3fff << 14) /* Block size */
249#define DSCR_SRC1_SB(x) (((x) & 0x3fff) << 14)
250#define DSCR_SRC1_SS_MASK (0x3fff << 0) /* Stride */
251#define DSCR_SRC1_SS(x) (((x) & 0x3fff) << 0)
252
253/* Dest1, 1-dimensional stride. */
254#define DSCR_DEST1_DTS_MASK (3 << 30) /* Dest xfer size */
255#define DSCR_DEST1_DAM_MASK (3 << 28) /* Dest xfer movement */
256#define DSCR_DEST1_DB_MASK (0x3fff << 14) /* Block size */
257#define DSCR_DEST1_DB(x) (((x) & 0x3fff) << 14)
258#define DSCR_DEST1_DS_MASK (0x3fff << 0) /* Stride */
259#define DSCR_DEST1_DS(x) (((x) & 0x3fff) << 0)
260
261#define DSCR_xTS_SIZE1 0
262#define DSCR_xTS_SIZE2 1
263#define DSCR_xTS_SIZE4 2
264#define DSCR_xTS_SIZE8 3
265#define DSCR_SRC1_STS(x) (((x) & 3) << 30)
266#define DSCR_DEST1_DTS(x) (((x) & 3) << 30)
267
268#define DSCR_xAM_INCREMENT 0
269#define DSCR_xAM_DECREMENT 1
270#define DSCR_xAM_STATIC 2
271#define DSCR_xAM_BURST 3
272#define DSCR_SRC1_SAM(x) (((x) & 3) << 28)
273#define DSCR_DEST1_DAM(x) (((x) & 3) << 28)
274
275/* The next descriptor pointer. */
276#define DSCR_NXTPTR_MASK (0x07ffffff)
277#define DSCR_NXTPTR(x) ((x) >> 5)
278#define DSCR_GET_NXTPTR(x) ((x) << 5)
279#define DSCR_NXTPTR_MS (1 << 27)
280
281/* The number of DBDMA channels. */
282#define NUM_DBDMA_CHANS 16
283
284/*
285 * DDMA API definitions
286 * FIXME: may not fit to this header file
287 */
288typedef struct dbdma_device_table {
289 u32 dev_id;
290 u32 dev_flags;
291 u32 dev_tsize;
292 u32 dev_devwidth;
293 u32 dev_physaddr; /* If FIFO */
294 u32 dev_intlevel;
295 u32 dev_intpolarity;
296} dbdev_tab_t;
297
298
299typedef struct dbdma_chan_config {
300 spinlock_t lock;
301
302 u32 chan_flags;
303 u32 chan_index;
304 dbdev_tab_t *chan_src;
305 dbdev_tab_t *chan_dest;
306 au1x_dma_chan_t *chan_ptr;
307 au1x_ddma_desc_t *chan_desc_base;
308 au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
309 void *chan_callparam;
310 void (*chan_callback)(int, void *);
311} chan_tab_t;
312
313#define DEV_FLAGS_INUSE (1 << 0)
314#define DEV_FLAGS_ANYUSE (1 << 1)
315#define DEV_FLAGS_OUT (1 << 2)
316#define DEV_FLAGS_IN (1 << 3)
317#define DEV_FLAGS_BURSTABLE (1 << 4)
318#define DEV_FLAGS_SYNC (1 << 5)
319/* end DDMA API definitions */
320
321/*
322 * External functions for drivers to use.
323 * Use this to allocate a DBDMA channel. The device IDs are one of
324 * the DSCR_CMD0 devices IDs, which is usually redefined to a more
325 * meaningful name. The 'callback' is called during DMA completion
326 * interrupt.
327 */
328extern u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
329 void (*callback)(int, void *),
330 void *callparam);
331
332#define DBDMA_MEM_CHAN DSCR_CMD0_ALWAYS
333
334/* Set the device width of an in/out FIFO. */
335u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits);
336
337/* Allocate a ring of descriptors for DBDMA. */
338u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries);
339
340/* Put buffers on source/destination descriptors. */
341u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
342u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
343
344/* Get a buffer from the destination descriptor. */
345u32 au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes);
346
347void au1xxx_dbdma_stop(u32 chanid);
348void au1xxx_dbdma_start(u32 chanid);
349void au1xxx_dbdma_reset(u32 chanid);
350u32 au1xxx_get_dma_residue(u32 chanid);
351
352void au1xxx_dbdma_chan_free(u32 chanid);
353void au1xxx_dbdma_dump(u32 chanid);
354
355u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr);
356
357u32 au1xxx_ddma_add_device(dbdev_tab_t *dev);
358extern void au1xxx_ddma_del_device(u32 devid);
359void *au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp);
360
361/*
362 * Some compatibilty macros -- needed to make changes to API
363 * without breaking existing drivers.
364 */
365#define au1xxx_dbdma_put_source(chanid, buf, nbytes) \
366 _au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
367#define au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags) \
368 _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
369#define put_source_flags(chanid, buf, nbytes, flags) \
370 au1xxx_dbdma_put_source_flags(chanid, buf, nbytes, flags)
371
372#define au1xxx_dbdma_put_dest(chanid, buf, nbytes) \
373 _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
374#define au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags) \
375 _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
376#define put_dest_flags(chanid, buf, nbytes, flags) \
377 au1xxx_dbdma_put_dest_flags(chanid, buf, nbytes, flags)
378
379/*
380 * Flags for the put_source/put_dest functions.
381 */
382#define DDMA_FLAGS_IE (1 << 0)
383#define DDMA_FLAGS_NOIE (1 << 1)
384
385#endif /* _LANGUAGE_ASSEMBLY */
386#endif /* _AU1000_DBDMA_H_ */
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
deleted file mode 100644
index 60638b8969ba..000000000000
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ /dev/null
@@ -1,194 +0,0 @@
1/*
2 * include/asm-mips/mach-au1x00/au1xxx_ide.h version 01.30.00 Aug. 02 2005
3 *
4 * BRIEF MODULE DESCRIPTION
5 * AMD Alchemy Au1xxx IDE interface routines over the Static Bus
6 *
7 * Copyright (c) 2003-2005 AMD, Personal Connectivity Solutions
8 *
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the License, or (at your option) any later
12 * version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
15 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 * POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along with
26 * this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 *
29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE
30 * Interface and Linux Device Driver" Application Note.
31 */
32
33#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
34#define DMA_WAIT_TIMEOUT 100
35#define NUM_DESCRIPTORS PRD_ENTRIES
36#else /* CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA */
37#define NUM_DESCRIPTORS 2
38#endif
39
40#ifndef AU1XXX_ATA_RQSIZE
41#define AU1XXX_ATA_RQSIZE 128
42#endif
43
44/* Disable Burstable-Support for DBDMA */
45#ifndef CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON
46#define CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON 0
47#endif
48
49#ifdef CONFIG_PM
50/*
51 * This will enable the device to be powered up when write() or read()
52 * is called. If this is not defined, the driver will return -EBUSY.
53 */
54#define WAKE_ON_ACCESS 1
55
56typedef struct {
57 spinlock_t lock; /* Used to block on state transitions */
58 au1xxx_power_dev_t *dev; /* Power Managers device structure */
59 unsigned stopped; /* Used to signal device is stopped */
60} pm_state;
61#endif
62
63typedef struct {
64 u32 tx_dev_id, rx_dev_id, target_dev_id;
65 u32 tx_chan, rx_chan;
66 void *tx_desc_head, *rx_desc_head;
67 ide_hwif_t *hwif;
68#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
69 ide_drive_t *drive;
70 struct dbdma_cmd *dma_table_cpu;
71 dma_addr_t dma_table_dma;
72#endif
73 int irq;
74 u32 regbase;
75#ifdef CONFIG_PM
76 pm_state pm;
77#endif
78} _auide_hwif;
79
80/******************************************************************************/
81/* PIO Mode timing calculation : */
82/* */
83/* Static Bus Spec ATA Spec */
84/* Tcsoe = t1 */
85/* Toecs = t9 */
86/* Twcs = t9 */
87/* Tcsh = t2i | t2 */
88/* Tcsoff = t2i | t2 */
89/* Twp = t2 */
90/* Tcsw = t1 */
91/* Tpm = 0 */
92/* Ta = t1+t2 */
93/******************************************************************************/
94
95#define TCSOE_MASK (0x07 << 29)
96#define TOECS_MASK (0x07 << 26)
97#define TWCS_MASK (0x07 << 28)
98#define TCSH_MASK (0x0F << 24)
99#define TCSOFF_MASK (0x07 << 20)
100#define TWP_MASK (0x3F << 14)
101#define TCSW_MASK (0x0F << 10)
102#define TPM_MASK (0x0F << 6)
103#define TA_MASK (0x3F << 0)
104#define TS_MASK (1 << 8)
105
106/* Timing parameters PIO mode 0 */
107#define SBC_IDE_PIO0_TCSOE (0x04 << 29)
108#define SBC_IDE_PIO0_TOECS (0x01 << 26)
109#define SBC_IDE_PIO0_TWCS (0x02 << 28)
110#define SBC_IDE_PIO0_TCSH (0x08 << 24)
111#define SBC_IDE_PIO0_TCSOFF (0x07 << 20)
112#define SBC_IDE_PIO0_TWP (0x10 << 14)
113#define SBC_IDE_PIO0_TCSW (0x04 << 10)
114#define SBC_IDE_PIO0_TPM (0x00 << 6)
115#define SBC_IDE_PIO0_TA (0x15 << 0)
116/* Timing parameters PIO mode 1 */
117#define SBC_IDE_PIO1_TCSOE (0x03 << 29)
118#define SBC_IDE_PIO1_TOECS (0x01 << 26)
119#define SBC_IDE_PIO1_TWCS (0x01 << 28)
120#define SBC_IDE_PIO1_TCSH (0x06 << 24)
121#define SBC_IDE_PIO1_TCSOFF (0x06 << 20)
122#define SBC_IDE_PIO1_TWP (0x08 << 14)
123#define SBC_IDE_PIO1_TCSW (0x03 << 10)
124#define SBC_IDE_PIO1_TPM (0x00 << 6)
125#define SBC_IDE_PIO1_TA (0x0B << 0)
126/* Timing parameters PIO mode 2 */
127#define SBC_IDE_PIO2_TCSOE (0x05 << 29)
128#define SBC_IDE_PIO2_TOECS (0x01 << 26)
129#define SBC_IDE_PIO2_TWCS (0x01 << 28)
130#define SBC_IDE_PIO2_TCSH (0x07 << 24)
131#define SBC_IDE_PIO2_TCSOFF (0x07 << 20)
132#define SBC_IDE_PIO2_TWP (0x1F << 14)
133#define SBC_IDE_PIO2_TCSW (0x05 << 10)
134#define SBC_IDE_PIO2_TPM (0x00 << 6)
135#define SBC_IDE_PIO2_TA (0x22 << 0)
136/* Timing parameters PIO mode 3 */
137#define SBC_IDE_PIO3_TCSOE (0x05 << 29)
138#define SBC_IDE_PIO3_TOECS (0x01 << 26)
139#define SBC_IDE_PIO3_TWCS (0x01 << 28)
140#define SBC_IDE_PIO3_TCSH (0x0D << 24)
141#define SBC_IDE_PIO3_TCSOFF (0x0D << 20)
142#define SBC_IDE_PIO3_TWP (0x15 << 14)
143#define SBC_IDE_PIO3_TCSW (0x05 << 10)
144#define SBC_IDE_PIO3_TPM (0x00 << 6)
145#define SBC_IDE_PIO3_TA (0x1A << 0)
146/* Timing parameters PIO mode 4 */
147#define SBC_IDE_PIO4_TCSOE (0x04 << 29)
148#define SBC_IDE_PIO4_TOECS (0x01 << 26)
149#define SBC_IDE_PIO4_TWCS (0x01 << 28)
150#define SBC_IDE_PIO4_TCSH (0x04 << 24)
151#define SBC_IDE_PIO4_TCSOFF (0x04 << 20)
152#define SBC_IDE_PIO4_TWP (0x0D << 14)
153#define SBC_IDE_PIO4_TCSW (0x03 << 10)
154#define SBC_IDE_PIO4_TPM (0x00 << 6)
155#define SBC_IDE_PIO4_TA (0x12 << 0)
156/* Timing parameters MDMA mode 0 */
157#define SBC_IDE_MDMA0_TCSOE (0x03 << 29)
158#define SBC_IDE_MDMA0_TOECS (0x01 << 26)
159#define SBC_IDE_MDMA0_TWCS (0x01 << 28)
160#define SBC_IDE_MDMA0_TCSH (0x07 << 24)
161#define SBC_IDE_MDMA0_TCSOFF (0x07 << 20)
162#define SBC_IDE_MDMA0_TWP (0x0C << 14)
163#define SBC_IDE_MDMA0_TCSW (0x03 << 10)
164#define SBC_IDE_MDMA0_TPM (0x00 << 6)
165#define SBC_IDE_MDMA0_TA (0x0F << 0)
166/* Timing parameters MDMA mode 1 */
167#define SBC_IDE_MDMA1_TCSOE (0x05 << 29)
168#define SBC_IDE_MDMA1_TOECS (0x01 << 26)
169#define SBC_IDE_MDMA1_TWCS (0x01 << 28)
170#define SBC_IDE_MDMA1_TCSH (0x05 << 24)
171#define SBC_IDE_MDMA1_TCSOFF (0x05 << 20)
172#define SBC_IDE_MDMA1_TWP (0x0F << 14)
173#define SBC_IDE_MDMA1_TCSW (0x05 << 10)
174#define SBC_IDE_MDMA1_TPM (0x00 << 6)
175#define SBC_IDE_MDMA1_TA (0x15 << 0)
176/* Timing parameters MDMA mode 2 */
177#define SBC_IDE_MDMA2_TCSOE (0x04 << 29)
178#define SBC_IDE_MDMA2_TOECS (0x01 << 26)
179#define SBC_IDE_MDMA2_TWCS (0x01 << 28)
180#define SBC_IDE_MDMA2_TCSH (0x04 << 24)
181#define SBC_IDE_MDMA2_TCSOFF (0x04 << 20)
182#define SBC_IDE_MDMA2_TWP (0x0D << 14)
183#define SBC_IDE_MDMA2_TCSW (0x04 << 10)
184#define SBC_IDE_MDMA2_TPM (0x00 << 6)
185#define SBC_IDE_MDMA2_TA (0x12 << 0)
186
187#define SBC_IDE_TIMING(mode) \
188 (SBC_IDE_##mode##_TWCS | \
189 SBC_IDE_##mode##_TCSH | \
190 SBC_IDE_##mode##_TCSOFF | \
191 SBC_IDE_##mode##_TWP | \
192 SBC_IDE_##mode##_TCSW | \
193 SBC_IDE_##mode##_TPM | \
194 SBC_IDE_##mode##_TA)
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h
deleted file mode 100644
index 892b7f168eb4..000000000000
--- a/include/asm-mips/mach-au1x00/au1xxx_psc.h
+++ /dev/null
@@ -1,505 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Include file for Alchemy Semiconductor's Au1k CPU.
5 *
6 * Copyright 2004 Embedded Edge, LLC
7 * dan@embeddededge.com
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30/* Specifics for the Au1xxx Programmable Serial Controllers, first
31 * seen in the AU1550 part.
32 */
33#ifndef _AU1000_PSC_H_
34#define _AU1000_PSC_H_
35
36/* The PSC base addresses. */
37#ifdef CONFIG_SOC_AU1550
38#define PSC0_BASE_ADDR 0xb1a00000
39#define PSC1_BASE_ADDR 0xb1b00000
40#define PSC2_BASE_ADDR 0xb0a00000
41#define PSC3_BASE_ADDR 0xb0b00000
42#endif
43
44#ifdef CONFIG_SOC_AU1200
45#define PSC0_BASE_ADDR 0xb1a00000
46#define PSC1_BASE_ADDR 0xb1b00000
47#endif
48
49/*
50 * The PSC select and control registers are common to all protocols.
51 */
52#define PSC_SEL_OFFSET 0x00000000
53#define PSC_CTRL_OFFSET 0x00000004
54
55#define PSC_SEL_CLK_MASK (3 << 4)
56#define PSC_SEL_CLK_INTCLK (0 << 4)
57#define PSC_SEL_CLK_EXTCLK (1 << 4)
58#define PSC_SEL_CLK_SERCLK (2 << 4)
59
60#define PSC_SEL_PS_MASK 0x00000007
61#define PSC_SEL_PS_DISABLED 0
62#define PSC_SEL_PS_SPIMODE 2
63#define PSC_SEL_PS_I2SMODE 3
64#define PSC_SEL_PS_AC97MODE 4
65#define PSC_SEL_PS_SMBUSMODE 5
66
67#define PSC_CTRL_DISABLE 0
68#define PSC_CTRL_SUSPEND 2
69#define PSC_CTRL_ENABLE 3
70
71/* AC97 Registers. */
72#define PSC_AC97CFG_OFFSET 0x00000008
73#define PSC_AC97MSK_OFFSET 0x0000000c
74#define PSC_AC97PCR_OFFSET 0x00000010
75#define PSC_AC97STAT_OFFSET 0x00000014
76#define PSC_AC97EVNT_OFFSET 0x00000018
77#define PSC_AC97TXRX_OFFSET 0x0000001c
78#define PSC_AC97CDC_OFFSET 0x00000020
79#define PSC_AC97RST_OFFSET 0x00000024
80#define PSC_AC97GPO_OFFSET 0x00000028
81#define PSC_AC97GPI_OFFSET 0x0000002c
82
83#define AC97_PSC_SEL (AC97_PSC_BASE + PSC_SEL_OFFSET)
84#define AC97_PSC_CTRL (AC97_PSC_BASE + PSC_CTRL_OFFSET)
85#define PSC_AC97CFG (AC97_PSC_BASE + PSC_AC97CFG_OFFSET)
86#define PSC_AC97MSK (AC97_PSC_BASE + PSC_AC97MSK_OFFSET)
87#define PSC_AC97PCR (AC97_PSC_BASE + PSC_AC97PCR_OFFSET)
88#define PSC_AC97STAT (AC97_PSC_BASE + PSC_AC97STAT_OFFSET)
89#define PSC_AC97EVNT (AC97_PSC_BASE + PSC_AC97EVNT_OFFSET)
90#define PSC_AC97TXRX (AC97_PSC_BASE + PSC_AC97TXRX_OFFSET)
91#define PSC_AC97CDC (AC97_PSC_BASE + PSC_AC97CDC_OFFSET)
92#define PSC_AC97RST (AC97_PSC_BASE + PSC_AC97RST_OFFSET)
93#define PSC_AC97GPO (AC97_PSC_BASE + PSC_AC97GPO_OFFSET)
94#define PSC_AC97GPI (AC97_PSC_BASE + PSC_AC97GPI_OFFSET)
95
96/* AC97 Config Register. */
97#define PSC_AC97CFG_RT_MASK (3 << 30)
98#define PSC_AC97CFG_RT_FIFO1 (0 << 30)
99#define PSC_AC97CFG_RT_FIFO2 (1 << 30)
100#define PSC_AC97CFG_RT_FIFO4 (2 << 30)
101#define PSC_AC97CFG_RT_FIFO8 (3 << 30)
102
103#define PSC_AC97CFG_TT_MASK (3 << 28)
104#define PSC_AC97CFG_TT_FIFO1 (0 << 28)
105#define PSC_AC97CFG_TT_FIFO2 (1 << 28)
106#define PSC_AC97CFG_TT_FIFO4 (2 << 28)
107#define PSC_AC97CFG_TT_FIFO8 (3 << 28)
108
109#define PSC_AC97CFG_DD_DISABLE (1 << 27)
110#define PSC_AC97CFG_DE_ENABLE (1 << 26)
111#define PSC_AC97CFG_SE_ENABLE (1 << 25)
112
113#define PSC_AC97CFG_LEN_MASK (0xf << 21)
114#define PSC_AC97CFG_TXSLOT_MASK (0x3ff << 11)
115#define PSC_AC97CFG_RXSLOT_MASK (0x3ff << 1)
116#define PSC_AC97CFG_GE_ENABLE (1)
117
118/* Enable slots 3-12. */
119#define PSC_AC97CFG_TXSLOT_ENA(x) (1 << (((x) - 3) + 11))
120#define PSC_AC97CFG_RXSLOT_ENA(x) (1 << (((x) - 3) + 1))
121
122/*
123 * The word length equation is ((x) * 2) + 2, so choose 'x' appropriately.
124 * The only sensible numbers are 7, 9, or possibly 11. Nah, just do the
125 * arithmetic in the macro.
126 */
127#define PSC_AC97CFG_SET_LEN(x) (((((x) - 2) / 2) & 0xf) << 21)
128#define PSC_AC97CFG_GET_LEN(x) (((((x) >> 21) & 0xf) * 2) + 2)
129
130/* AC97 Mask Register. */
131#define PSC_AC97MSK_GR (1 << 25)
132#define PSC_AC97MSK_CD (1 << 24)
133#define PSC_AC97MSK_RR (1 << 13)
134#define PSC_AC97MSK_RO (1 << 12)
135#define PSC_AC97MSK_RU (1 << 11)
136#define PSC_AC97MSK_TR (1 << 10)
137#define PSC_AC97MSK_TO (1 << 9)
138#define PSC_AC97MSK_TU (1 << 8)
139#define PSC_AC97MSK_RD (1 << 5)
140#define PSC_AC97MSK_TD (1 << 4)
141#define PSC_AC97MSK_ALLMASK (PSC_AC97MSK_GR | PSC_AC97MSK_CD | \
142 PSC_AC97MSK_RR | PSC_AC97MSK_RO | \
143 PSC_AC97MSK_RU | PSC_AC97MSK_TR | \
144 PSC_AC97MSK_TO | PSC_AC97MSK_TU | \
145 PSC_AC97MSK_RD | PSC_AC97MSK_TD)
146
147/* AC97 Protocol Control Register. */
148#define PSC_AC97PCR_RC (1 << 6)
149#define PSC_AC97PCR_RP (1 << 5)
150#define PSC_AC97PCR_RS (1 << 4)
151#define PSC_AC97PCR_TC (1 << 2)
152#define PSC_AC97PCR_TP (1 << 1)
153#define PSC_AC97PCR_TS (1 << 0)
154
155/* AC97 Status register (read only). */
156#define PSC_AC97STAT_CB (1 << 26)
157#define PSC_AC97STAT_CP (1 << 25)
158#define PSC_AC97STAT_CR (1 << 24)
159#define PSC_AC97STAT_RF (1 << 13)
160#define PSC_AC97STAT_RE (1 << 12)
161#define PSC_AC97STAT_RR (1 << 11)
162#define PSC_AC97STAT_TF (1 << 10)
163#define PSC_AC97STAT_TE (1 << 9)
164#define PSC_AC97STAT_TR (1 << 8)
165#define PSC_AC97STAT_RB (1 << 5)
166#define PSC_AC97STAT_TB (1 << 4)
167#define PSC_AC97STAT_DI (1 << 2)
168#define PSC_AC97STAT_DR (1 << 1)
169#define PSC_AC97STAT_SR (1 << 0)
170
171/* AC97 Event Register. */
172#define PSC_AC97EVNT_GR (1 << 25)
173#define PSC_AC97EVNT_CD (1 << 24)
174#define PSC_AC97EVNT_RR (1 << 13)
175#define PSC_AC97EVNT_RO (1 << 12)
176#define PSC_AC97EVNT_RU (1 << 11)
177#define PSC_AC97EVNT_TR (1 << 10)
178#define PSC_AC97EVNT_TO (1 << 9)
179#define PSC_AC97EVNT_TU (1 << 8)
180#define PSC_AC97EVNT_RD (1 << 5)
181#define PSC_AC97EVNT_TD (1 << 4)
182
183/* CODEC Command Register. */
184#define PSC_AC97CDC_RD (1 << 25)
185#define PSC_AC97CDC_ID_MASK (3 << 23)
186#define PSC_AC97CDC_INDX_MASK (0x7f << 16)
187#define PSC_AC97CDC_ID(x) (((x) & 0x03) << 23)
188#define PSC_AC97CDC_INDX(x) (((x) & 0x7f) << 16)
189
190/* AC97 Reset Control Register. */
191#define PSC_AC97RST_RST (1 << 1)
192#define PSC_AC97RST_SNC (1 << 0)
193
194/* PSC in I2S Mode. */
195typedef struct psc_i2s {
196 u32 psc_sel;
197 u32 psc_ctrl;
198 u32 psc_i2scfg;
199 u32 psc_i2smsk;
200 u32 psc_i2spcr;
201 u32 psc_i2sstat;
202 u32 psc_i2sevent;
203 u32 psc_i2stxrx;
204 u32 psc_i2sudf;
205} psc_i2s_t;
206
207#define PSC_I2SCFG_OFFSET 0x08
208#define PSC_I2SMASK_OFFSET 0x0C
209#define PSC_I2SPCR_OFFSET 0x10
210#define PSC_I2SSTAT_OFFSET 0x14
211#define PSC_I2SEVENT_OFFSET 0x18
212#define PSC_I2SRXTX_OFFSET 0x1C
213#define PSC_I2SUDF_OFFSET 0x20
214
215/* I2S Config Register. */
216#define PSC_I2SCFG_RT_MASK (3 << 30)
217#define PSC_I2SCFG_RT_FIFO1 (0 << 30)
218#define PSC_I2SCFG_RT_FIFO2 (1 << 30)
219#define PSC_I2SCFG_RT_FIFO4 (2 << 30)
220#define PSC_I2SCFG_RT_FIFO8 (3 << 30)
221
222#define PSC_I2SCFG_TT_MASK (3 << 28)
223#define PSC_I2SCFG_TT_FIFO1 (0 << 28)
224#define PSC_I2SCFG_TT_FIFO2 (1 << 28)
225#define PSC_I2SCFG_TT_FIFO4 (2 << 28)
226#define PSC_I2SCFG_TT_FIFO8 (3 << 28)
227
228#define PSC_I2SCFG_DD_DISABLE (1 << 27)
229#define PSC_I2SCFG_DE_ENABLE (1 << 26)
230#define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16)
231#define PSC_I2SCFG_WS(n) ((n & 0xFF) << 16)
232#define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F))
233#define PSC_I2SCFG_WI (1 << 15)
234
235#define PSC_I2SCFG_DIV_MASK (3 << 13)
236#define PSC_I2SCFG_DIV2 (0 << 13)
237#define PSC_I2SCFG_DIV4 (1 << 13)
238#define PSC_I2SCFG_DIV8 (2 << 13)
239#define PSC_I2SCFG_DIV16 (3 << 13)
240
241#define PSC_I2SCFG_BI (1 << 12)
242#define PSC_I2SCFG_BUF (1 << 11)
243#define PSC_I2SCFG_MLJ (1 << 10)
244#define PSC_I2SCFG_XM (1 << 9)
245
246/* The word length equation is simply LEN+1. */
247#define PSC_I2SCFG_SET_LEN(x) ((((x) - 1) & 0x1f) << 4)
248#define PSC_I2SCFG_GET_LEN(x) ((((x) >> 4) & 0x1f) + 1)
249
250#define PSC_I2SCFG_LB (1 << 2)
251#define PSC_I2SCFG_MLF (1 << 1)
252#define PSC_I2SCFG_MS (1 << 0)
253
254/* I2S Mask Register. */
255#define PSC_I2SMSK_RR (1 << 13)
256#define PSC_I2SMSK_RO (1 << 12)
257#define PSC_I2SMSK_RU (1 << 11)
258#define PSC_I2SMSK_TR (1 << 10)
259#define PSC_I2SMSK_TO (1 << 9)
260#define PSC_I2SMSK_TU (1 << 8)
261#define PSC_I2SMSK_RD (1 << 5)
262#define PSC_I2SMSK_TD (1 << 4)
263#define PSC_I2SMSK_ALLMASK (PSC_I2SMSK_RR | PSC_I2SMSK_RO | \
264 PSC_I2SMSK_RU | PSC_I2SMSK_TR | \
265 PSC_I2SMSK_TO | PSC_I2SMSK_TU | \
266 PSC_I2SMSK_RD | PSC_I2SMSK_TD)
267
268/* I2S Protocol Control Register. */
269#define PSC_I2SPCR_RC (1 << 6)
270#define PSC_I2SPCR_RP (1 << 5)
271#define PSC_I2SPCR_RS (1 << 4)
272#define PSC_I2SPCR_TC (1 << 2)
273#define PSC_I2SPCR_TP (1 << 1)
274#define PSC_I2SPCR_TS (1 << 0)
275
276/* I2S Status register (read only). */
277#define PSC_I2SSTAT_RF (1 << 13)
278#define PSC_I2SSTAT_RE (1 << 12)
279#define PSC_I2SSTAT_RR (1 << 11)
280#define PSC_I2SSTAT_TF (1 << 10)
281#define PSC_I2SSTAT_TE (1 << 9)
282#define PSC_I2SSTAT_TR (1 << 8)
283#define PSC_I2SSTAT_RB (1 << 5)
284#define PSC_I2SSTAT_TB (1 << 4)
285#define PSC_I2SSTAT_DI (1 << 2)
286#define PSC_I2SSTAT_DR (1 << 1)
287#define PSC_I2SSTAT_SR (1 << 0)
288
289/* I2S Event Register. */
290#define PSC_I2SEVNT_RR (1 << 13)
291#define PSC_I2SEVNT_RO (1 << 12)
292#define PSC_I2SEVNT_RU (1 << 11)
293#define PSC_I2SEVNT_TR (1 << 10)
294#define PSC_I2SEVNT_TO (1 << 9)
295#define PSC_I2SEVNT_TU (1 << 8)
296#define PSC_I2SEVNT_RD (1 << 5)
297#define PSC_I2SEVNT_TD (1 << 4)
298
299/* PSC in SPI Mode. */
300typedef struct psc_spi {
301 u32 psc_sel;
302 u32 psc_ctrl;
303 u32 psc_spicfg;
304 u32 psc_spimsk;
305 u32 psc_spipcr;
306 u32 psc_spistat;
307 u32 psc_spievent;
308 u32 psc_spitxrx;
309} psc_spi_t;
310
311/* SPI Config Register. */
312#define PSC_SPICFG_RT_MASK (3 << 30)
313#define PSC_SPICFG_RT_FIFO1 (0 << 30)
314#define PSC_SPICFG_RT_FIFO2 (1 << 30)
315#define PSC_SPICFG_RT_FIFO4 (2 << 30)
316#define PSC_SPICFG_RT_FIFO8 (3 << 30)
317
318#define PSC_SPICFG_TT_MASK (3 << 28)
319#define PSC_SPICFG_TT_FIFO1 (0 << 28)
320#define PSC_SPICFG_TT_FIFO2 (1 << 28)
321#define PSC_SPICFG_TT_FIFO4 (2 << 28)
322#define PSC_SPICFG_TT_FIFO8 (3 << 28)
323
324#define PSC_SPICFG_DD_DISABLE (1 << 27)
325#define PSC_SPICFG_DE_ENABLE (1 << 26)
326#define PSC_SPICFG_CLR_BAUD(x) ((x) & ~((0x3f) << 15))
327#define PSC_SPICFG_SET_BAUD(x) (((x) & 0x3f) << 15)
328
329#define PSC_SPICFG_SET_DIV(x) (((x) & 0x03) << 13)
330#define PSC_SPICFG_DIV2 0
331#define PSC_SPICFG_DIV4 1
332#define PSC_SPICFG_DIV8 2
333#define PSC_SPICFG_DIV16 3
334
335#define PSC_SPICFG_BI (1 << 12)
336#define PSC_SPICFG_PSE (1 << 11)
337#define PSC_SPICFG_CGE (1 << 10)
338#define PSC_SPICFG_CDE (1 << 9)
339
340#define PSC_SPICFG_CLR_LEN(x) ((x) & ~((0x1f) << 4))
341#define PSC_SPICFG_SET_LEN(x) (((x-1) & 0x1f) << 4)
342
343#define PSC_SPICFG_LB (1 << 3)
344#define PSC_SPICFG_MLF (1 << 1)
345#define PSC_SPICFG_MO (1 << 0)
346
347/* SPI Mask Register. */
348#define PSC_SPIMSK_MM (1 << 16)
349#define PSC_SPIMSK_RR (1 << 13)
350#define PSC_SPIMSK_RO (1 << 12)
351#define PSC_SPIMSK_RU (1 << 11)
352#define PSC_SPIMSK_TR (1 << 10)
353#define PSC_SPIMSK_TO (1 << 9)
354#define PSC_SPIMSK_TU (1 << 8)
355#define PSC_SPIMSK_SD (1 << 5)
356#define PSC_SPIMSK_MD (1 << 4)
357#define PSC_SPIMSK_ALLMASK (PSC_SPIMSK_MM | PSC_SPIMSK_RR | \
358 PSC_SPIMSK_RO | PSC_SPIMSK_TO | \
359 PSC_SPIMSK_TU | PSC_SPIMSK_SD | \
360 PSC_SPIMSK_MD)
361
362/* SPI Protocol Control Register. */
363#define PSC_SPIPCR_RC (1 << 6)
364#define PSC_SPIPCR_SP (1 << 5)
365#define PSC_SPIPCR_SS (1 << 4)
366#define PSC_SPIPCR_TC (1 << 2)
367#define PSC_SPIPCR_MS (1 << 0)
368
369/* SPI Status register (read only). */
370#define PSC_SPISTAT_RF (1 << 13)
371#define PSC_SPISTAT_RE (1 << 12)
372#define PSC_SPISTAT_RR (1 << 11)
373#define PSC_SPISTAT_TF (1 << 10)
374#define PSC_SPISTAT_TE (1 << 9)
375#define PSC_SPISTAT_TR (1 << 8)
376#define PSC_SPISTAT_SB (1 << 5)
377#define PSC_SPISTAT_MB (1 << 4)
378#define PSC_SPISTAT_DI (1 << 2)
379#define PSC_SPISTAT_DR (1 << 1)
380#define PSC_SPISTAT_SR (1 << 0)
381
382/* SPI Event Register. */
383#define PSC_SPIEVNT_MM (1 << 16)
384#define PSC_SPIEVNT_RR (1 << 13)
385#define PSC_SPIEVNT_RO (1 << 12)
386#define PSC_SPIEVNT_RU (1 << 11)
387#define PSC_SPIEVNT_TR (1 << 10)
388#define PSC_SPIEVNT_TO (1 << 9)
389#define PSC_SPIEVNT_TU (1 << 8)
390#define PSC_SPIEVNT_SD (1 << 5)
391#define PSC_SPIEVNT_MD (1 << 4)
392
393/* Transmit register control. */
394#define PSC_SPITXRX_LC (1 << 29)
395#define PSC_SPITXRX_SR (1 << 28)
396
397/* PSC in SMBus (I2C) Mode. */
398typedef struct psc_smb {
399 u32 psc_sel;
400 u32 psc_ctrl;
401 u32 psc_smbcfg;
402 u32 psc_smbmsk;
403 u32 psc_smbpcr;
404 u32 psc_smbstat;
405 u32 psc_smbevnt;
406 u32 psc_smbtxrx;
407 u32 psc_smbtmr;
408} psc_smb_t;
409
410/* SMBus Config Register. */
411#define PSC_SMBCFG_RT_MASK (3 << 30)
412#define PSC_SMBCFG_RT_FIFO1 (0 << 30)
413#define PSC_SMBCFG_RT_FIFO2 (1 << 30)
414#define PSC_SMBCFG_RT_FIFO4 (2 << 30)
415#define PSC_SMBCFG_RT_FIFO8 (3 << 30)
416
417#define PSC_SMBCFG_TT_MASK (3 << 28)
418#define PSC_SMBCFG_TT_FIFO1 (0 << 28)
419#define PSC_SMBCFG_TT_FIFO2 (1 << 28)
420#define PSC_SMBCFG_TT_FIFO4 (2 << 28)
421#define PSC_SMBCFG_TT_FIFO8 (3 << 28)
422
423#define PSC_SMBCFG_DD_DISABLE (1 << 27)
424#define PSC_SMBCFG_DE_ENABLE (1 << 26)
425
426#define PSC_SMBCFG_SET_DIV(x) (((x) & 0x03) << 13)
427#define PSC_SMBCFG_DIV2 0
428#define PSC_SMBCFG_DIV4 1
429#define PSC_SMBCFG_DIV8 2
430#define PSC_SMBCFG_DIV16 3
431
432#define PSC_SMBCFG_GCE (1 << 9)
433#define PSC_SMBCFG_SFM (1 << 8)
434
435#define PSC_SMBCFG_SET_SLV(x) (((x) & 0x7f) << 1)
436
437/* SMBus Mask Register. */
438#define PSC_SMBMSK_DN (1 << 30)
439#define PSC_SMBMSK_AN (1 << 29)
440#define PSC_SMBMSK_AL (1 << 28)
441#define PSC_SMBMSK_RR (1 << 13)
442#define PSC_SMBMSK_RO (1 << 12)
443#define PSC_SMBMSK_RU (1 << 11)
444#define PSC_SMBMSK_TR (1 << 10)
445#define PSC_SMBMSK_TO (1 << 9)
446#define PSC_SMBMSK_TU (1 << 8)
447#define PSC_SMBMSK_SD (1 << 5)
448#define PSC_SMBMSK_MD (1 << 4)
449#define PSC_SMBMSK_ALLMASK (PSC_SMBMSK_DN | PSC_SMBMSK_AN | \
450 PSC_SMBMSK_AL | PSC_SMBMSK_RR | \
451 PSC_SMBMSK_RO | PSC_SMBMSK_TO | \
452 PSC_SMBMSK_TU | PSC_SMBMSK_SD | \
453 PSC_SMBMSK_MD)
454
455/* SMBus Protocol Control Register. */
456#define PSC_SMBPCR_DC (1 << 2)
457#define PSC_SMBPCR_MS (1 << 0)
458
459/* SMBus Status register (read only). */
460#define PSC_SMBSTAT_BB (1 << 28)
461#define PSC_SMBSTAT_RF (1 << 13)
462#define PSC_SMBSTAT_RE (1 << 12)
463#define PSC_SMBSTAT_RR (1 << 11)
464#define PSC_SMBSTAT_TF (1 << 10)
465#define PSC_SMBSTAT_TE (1 << 9)
466#define PSC_SMBSTAT_TR (1 << 8)
467#define PSC_SMBSTAT_SB (1 << 5)
468#define PSC_SMBSTAT_MB (1 << 4)
469#define PSC_SMBSTAT_DI (1 << 2)
470#define PSC_SMBSTAT_DR (1 << 1)
471#define PSC_SMBSTAT_SR (1 << 0)
472
473/* SMBus Event Register. */
474#define PSC_SMBEVNT_DN (1 << 30)
475#define PSC_SMBEVNT_AN (1 << 29)
476#define PSC_SMBEVNT_AL (1 << 28)
477#define PSC_SMBEVNT_RR (1 << 13)
478#define PSC_SMBEVNT_RO (1 << 12)
479#define PSC_SMBEVNT_RU (1 << 11)
480#define PSC_SMBEVNT_TR (1 << 10)
481#define PSC_SMBEVNT_TO (1 << 9)
482#define PSC_SMBEVNT_TU (1 << 8)
483#define PSC_SMBEVNT_SD (1 << 5)
484#define PSC_SMBEVNT_MD (1 << 4)
485#define PSC_SMBEVNT_ALLCLR (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | \
486 PSC_SMBEVNT_AL | PSC_SMBEVNT_RR | \
487 PSC_SMBEVNT_RO | PSC_SMBEVNT_TO | \
488 PSC_SMBEVNT_TU | PSC_SMBEVNT_SD | \
489 PSC_SMBEVNT_MD)
490
491/* Transmit register control. */
492#define PSC_SMBTXRX_RSR (1 << 28)
493#define PSC_SMBTXRX_STP (1 << 29)
494#define PSC_SMBTXRX_DATAMASK 0xff
495
496/* SMBus protocol timers register. */
497#define PSC_SMBTMR_SET_TH(x) (((x) & 0x03) << 30)
498#define PSC_SMBTMR_SET_PS(x) (((x) & 0x1f) << 25)
499#define PSC_SMBTMR_SET_PU(x) (((x) & 0x1f) << 20)
500#define PSC_SMBTMR_SET_SH(x) (((x) & 0x1f) << 15)
501#define PSC_SMBTMR_SET_SU(x) (((x) & 0x1f) << 10)
502#define PSC_SMBTMR_SET_CL(x) (((x) & 0x1f) << 5)
503#define PSC_SMBTMR_SET_CH(x) (((x) & 0x1f) << 0)
504
505#endif /* _AU1000_PSC_H_ */
diff --git a/include/asm-mips/mach-au1x00/gpio.h b/include/asm-mips/mach-au1x00/gpio.h
deleted file mode 100644
index 2dc61e009a08..000000000000
--- a/include/asm-mips/mach-au1x00/gpio.h
+++ /dev/null
@@ -1,69 +0,0 @@
1#ifndef _AU1XXX_GPIO_H_
2#define _AU1XXX_GPIO_H_
3
4#include <linux/types.h>
5
6#define AU1XXX_GPIO_BASE 200
7
8struct au1x00_gpio2 {
9 u32 dir;
10 u32 reserved;
11 u32 output;
12 u32 pinstate;
13 u32 inten;
14 u32 enable;
15};
16
17extern int au1xxx_gpio_get_value(unsigned gpio);
18extern void au1xxx_gpio_set_value(unsigned gpio, int value);
19extern int au1xxx_gpio_direction_input(unsigned gpio);
20extern int au1xxx_gpio_direction_output(unsigned gpio, int value);
21
22
23/* Wrappers for the arch-neutral GPIO API */
24
25static inline int gpio_request(unsigned gpio, const char *label)
26{
27 /* Not yet implemented */
28 return 0;
29}
30
31static inline void gpio_free(unsigned gpio)
32{
33 /* Not yet implemented */
34}
35
36static inline int gpio_direction_input(unsigned gpio)
37{
38 return au1xxx_gpio_direction_input(gpio);
39}
40
41static inline int gpio_direction_output(unsigned gpio, int value)
42{
43 return au1xxx_gpio_direction_output(gpio, value);
44}
45
46static inline int gpio_get_value(unsigned gpio)
47{
48 return au1xxx_gpio_get_value(gpio);
49}
50
51static inline void gpio_set_value(unsigned gpio, int value)
52{
53 au1xxx_gpio_set_value(gpio, value);
54}
55
56static inline int gpio_to_irq(unsigned gpio)
57{
58 return gpio;
59}
60
61static inline int irq_to_gpio(unsigned irq)
62{
63 return irq;
64}
65
66/* For cansleep */
67#include <asm-generic/gpio.h>
68
69#endif /* _AU1XXX_GPIO_H_ */
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h
deleted file mode 100644
index 364cea2dc71f..000000000000
--- a/include/asm-mips/mach-au1x00/ioremap.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * include/asm-mips/mach-au1x00/ioremap.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#ifndef __ASM_MACH_AU1X00_IOREMAP_H
10#define __ASM_MACH_AU1X00_IOREMAP_H
11
12#include <linux/types.h>
13
14#ifdef CONFIG_64BIT_PHYS_ADDR
15extern phys_t __fixup_bigphys_addr(phys_t, phys_t);
16#else
17static inline phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
18{
19 return phys_addr;
20}
21#endif
22
23/*
24 * Allow physical addresses to be fixed up to help 36-bit peripherals.
25 */
26static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
27{
28 return __fixup_bigphys_addr(phys_addr, size);
29}
30
31static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
32 unsigned long flags)
33{
34 return NULL;
35}
36
37static inline int plat_iounmap(const volatile void __iomem *addr)
38{
39 return 0;
40}
41
42#endif /* __ASM_MACH_AU1X00_IOREMAP_H */
diff --git a/include/asm-mips/mach-au1x00/prom.h b/include/asm-mips/mach-au1x00/prom.h
deleted file mode 100644
index e38715577c51..000000000000
--- a/include/asm-mips/mach-au1x00/prom.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __AU1X00_PROM_H
2#define __AU1X00_PROM_H
3
4extern int prom_argc;
5extern char **prom_argv;
6extern char **prom_envp;
7
8extern void prom_init_cmdline(void);
9extern char *prom_getcmdline(void);
10extern char *prom_getenv(char *envname);
11extern int prom_get_ethernet_addr(char *ethernet_addr);
12
13#endif
diff --git a/include/asm-mips/mach-au1x00/war.h b/include/asm-mips/mach-au1x00/war.h
deleted file mode 100644
index dd57d03d68ba..000000000000
--- a/include/asm-mips/mach-au1x00/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_AU1X00_WAR_H
9#define __ASM_MIPS_MACH_AU1X00_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_AU1X00_WAR_H */
diff --git a/include/asm-mips/mach-bcm47xx/bcm47xx.h b/include/asm-mips/mach-bcm47xx/bcm47xx.h
deleted file mode 100644
index d008f47a28bd..000000000000
--- a/include/asm-mips/mach-bcm47xx/bcm47xx.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#ifndef __ASM_BCM47XX_H
20#define __ASM_BCM47XX_H
21
22/* SSB bus */
23extern struct ssb_bus ssb_bcm47xx;
24
25#endif /* __ASM_BCM47XX_H */
diff --git a/include/asm-mips/mach-bcm47xx/gpio.h b/include/asm-mips/mach-bcm47xx/gpio.h
deleted file mode 100644
index cfc8f4d618ce..000000000000
--- a/include/asm-mips/mach-bcm47xx/gpio.h
+++ /dev/null
@@ -1,59 +0,0 @@
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 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
7 */
8
9#ifndef __BCM47XX_GPIO_H
10#define __BCM47XX_GPIO_H
11
12#define BCM47XX_EXTIF_GPIO_LINES 5
13#define BCM47XX_CHIPCO_GPIO_LINES 16
14
15extern int bcm47xx_gpio_to_irq(unsigned gpio);
16extern int bcm47xx_gpio_get_value(unsigned gpio);
17extern void bcm47xx_gpio_set_value(unsigned gpio, int value);
18extern int bcm47xx_gpio_direction_input(unsigned gpio);
19extern int bcm47xx_gpio_direction_output(unsigned gpio, int value);
20
21static inline int gpio_request(unsigned gpio, const char *label)
22{
23 return 0;
24}
25
26static inline void gpio_free(unsigned gpio)
27{
28}
29
30static inline int gpio_to_irq(unsigned gpio)
31{
32 return bcm47xx_gpio_to_irq(gpio);
33}
34
35static inline int gpio_get_value(unsigned gpio)
36{
37 return bcm47xx_gpio_get_value(gpio);
38}
39
40static inline void gpio_set_value(unsigned gpio, int value)
41{
42 bcm47xx_gpio_set_value(gpio, value);
43}
44
45static inline int gpio_direction_input(unsigned gpio)
46{
47 return bcm47xx_gpio_direction_input(gpio);
48}
49
50static inline int gpio_direction_output(unsigned gpio, int value)
51{
52 return bcm47xx_gpio_direction_output(gpio, value);
53}
54
55
56/* cansleep wrappers */
57#include <asm-generic/gpio.h>
58
59#endif /* __BCM47XX_GPIO_H */
diff --git a/include/asm-mips/mach-bcm47xx/war.h b/include/asm-mips/mach-bcm47xx/war.h
deleted file mode 100644
index 4a2b7986b582..000000000000
--- a/include/asm-mips/mach-bcm47xx/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_BCM947XX_WAR_H
9#define __ASM_MIPS_MACH_BCM947XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_BCM947XX_WAR_H */
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h
deleted file mode 100644
index 5b9fce73f11d..000000000000
--- a/include/asm-mips/mach-cobalt/cobalt.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * The Cobalt board ID 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 (C) 1997 Cobalt Microserver
9 * Copyright (C) 1997, 2003 Ralf Baechle
10 * Copyright (C) 2001, 2002, 2003 Liam Davies (ldavies@agile.tv)
11 */
12#ifndef __ASM_COBALT_H
13#define __ASM_COBALT_H
14
15extern int cobalt_board_id;
16
17#define COBALT_BRD_ID_QUBE1 0x3
18#define COBALT_BRD_ID_RAQ1 0x4
19#define COBALT_BRD_ID_QUBE2 0x5
20#define COBALT_BRD_ID_RAQ2 0x6
21
22#endif /* __ASM_COBALT_H */
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
deleted file mode 100644
index b3314cf53194..000000000000
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ /dev/null
@@ -1,56 +0,0 @@
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 * Copyright (C) 2006, 07 Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
10
11
12#define cpu_has_tlb 1
13#define cpu_has_4kex 1
14#define cpu_has_3k_cache 0
15#define cpu_has_4k_cache 1
16#define cpu_has_tx39_cache 0
17#define cpu_has_fpu 1
18#define cpu_has_32fpr 1
19#define cpu_has_counter 1
20#define cpu_has_watch 0
21#define cpu_has_divec 1
22#define cpu_has_vce 0
23#define cpu_has_cache_cdex_p 0
24#define cpu_has_cache_cdex_s 0
25#define cpu_has_prefetch 0
26#define cpu_has_mcheck 0
27#define cpu_has_ejtag 0
28
29#define cpu_has_inclusive_pcaches 0
30#define cpu_dcache_line_size() 32
31#define cpu_icache_line_size() 32
32#define cpu_scache_line_size() 0
33
34#ifdef CONFIG_64BIT
35#define cpu_has_llsc 0
36#else
37#define cpu_has_llsc 1
38#endif
39
40#define cpu_has_mips16 0
41#define cpu_has_mdmx 0
42#define cpu_has_mips3d 0
43#define cpu_has_smartmips 0
44#define cpu_has_vtag_icache 0
45#define cpu_has_ic_fills_f_dc 0
46#define cpu_icache_snoops_remote_store 0
47#define cpu_has_dsp 0
48#define cpu_has_mipsmt 0
49#define cpu_has_userlocal 0
50
51#define cpu_has_mips32r1 0
52#define cpu_has_mips32r2 0
53#define cpu_has_mips64r1 0
54#define cpu_has_mips64r2 0
55
56#endif /* __ASM_COBALT_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-cobalt/irq.h b/include/asm-mips/mach-cobalt/irq.h
deleted file mode 100644
index 57c8c9ac5851..000000000000
--- a/include/asm-mips/mach-cobalt/irq.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * Cobalt IRQ definitions.
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 (C) 1997 Cobalt Microserver
9 * Copyright (C) 1997, 2003 Ralf Baechle
10 * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv)
11 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
12 */
13#ifndef _ASM_COBALT_IRQ_H
14#define _ASM_COBALT_IRQ_H
15
16/*
17 * i8259 interrupts used on Cobalt:
18 *
19 * 8 - RTC
20 * 9 - PCI slot
21 * 14 - IDE0
22 * 15 - IDE1(no connector on board)
23 */
24#define I8259A_IRQ_BASE 0
25
26#define PCISLOT_IRQ (I8259A_IRQ_BASE + 9)
27
28/*
29 * CPU interrupts used on Cobalt:
30 *
31 * 0 - Software interrupt 0 (unused)
32 * 1 - Software interrupt 0 (unused)
33 * 2 - cascade GT64111
34 * 3 - ethernet or SCSI host controller
35 * 4 - ethernet
36 * 5 - 16550 UART
37 * 6 - cascade i8259
38 * 7 - CP0 counter
39 */
40#define MIPS_CPU_IRQ_BASE 16
41
42#define GT641XX_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 2)
43#define RAQ2_SCSI_IRQ (MIPS_CPU_IRQ_BASE + 3)
44#define ETH0_IRQ (MIPS_CPU_IRQ_BASE + 3)
45#define QUBE1_ETH0_IRQ (MIPS_CPU_IRQ_BASE + 4)
46#define ETH1_IRQ (MIPS_CPU_IRQ_BASE + 4)
47#define SERIAL_IRQ (MIPS_CPU_IRQ_BASE + 5)
48#define SCSI_IRQ (MIPS_CPU_IRQ_BASE + 5)
49#define I8259_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 6)
50
51#define GT641XX_IRQ_BASE 24
52
53#include <asm/irq_gt641xx.h>
54
55#define NR_IRQS (GT641XX_PCI_INT3_IRQ + 1)
56
57#endif /* _ASM_COBALT_IRQ_H */
diff --git a/include/asm-mips/mach-cobalt/mach-gt64120.h b/include/asm-mips/mach-cobalt/mach-gt64120.h
deleted file mode 100644
index ae9c5523c7ef..000000000000
--- a/include/asm-mips/mach-cobalt/mach-gt64120.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#ifndef _COBALT_MACH_GT64120_H
19#define _COBALT_MACH_GT64120_H
20
21/*
22 * Cobalt uses GT64111. GT64111 is almost the same as GT64120.
23 */
24
25#define GT64120_BASE CKSEG1ADDR(GT_DEF_BASE)
26
27#endif /* _COBALT_MACH_GT64120_H */
diff --git a/include/asm-mips/mach-cobalt/war.h b/include/asm-mips/mach-cobalt/war.h
deleted file mode 100644
index 97884fd18ac0..000000000000
--- a/include/asm-mips/mach-cobalt/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_COBALT_WAR_H
9#define __ASM_MIPS_MACH_COBALT_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_COBALT_WAR_H */
diff --git a/include/asm-mips/mach-db1x00/db1200.h b/include/asm-mips/mach-db1x00/db1200.h
deleted file mode 100644
index 27f26102b1bb..000000000000
--- a/include/asm-mips/mach-db1x00/db1200.h
+++ /dev/null
@@ -1,230 +0,0 @@
1/*
2 * AMD Alchemy DBAu1200 Reference Board
3 * Board register defines.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * 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 */
24#ifndef __ASM_DB1200_H
25#define __ASM_DB1200_H
26
27#include <linux/types.h>
28#include <asm/mach-au1x00/au1xxx_psc.h>
29
30#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
31#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
32#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
33#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
34
35/*
36 * SPI and SMB are muxed on the DBAu1200 board.
37 * Refer to board documentation.
38 */
39#define SPI_PSC_BASE PSC0_BASE_ADDR
40#define SMBUS_PSC_BASE PSC0_BASE_ADDR
41/*
42 * AC'97 and I2S are muxed on the DBAu1200 board.
43 * Refer to board documentation.
44 */
45#define AC97_PSC_BASE PSC1_BASE_ADDR
46#define I2S_PSC_BASE PSC1_BASE_ADDR
47
48#define BCSR_KSEG1_ADDR 0xB9800000
49
50typedef volatile struct
51{
52 /*00*/ u16 whoami;
53 u16 reserved0;
54 /*04*/ u16 status;
55 u16 reserved1;
56 /*08*/ u16 switches;
57 u16 reserved2;
58 /*0C*/ u16 resets;
59 u16 reserved3;
60
61 /*10*/ u16 pcmcia;
62 u16 reserved4;
63 /*14*/ u16 board;
64 u16 reserved5;
65 /*18*/ u16 disk_leds;
66 u16 reserved6;
67 /*1C*/ u16 system;
68 u16 reserved7;
69
70 /*20*/ u16 intclr;
71 u16 reserved8;
72 /*24*/ u16 intset;
73 u16 reserved9;
74 /*28*/ u16 intclr_mask;
75 u16 reserved10;
76 /*2C*/ u16 intset_mask;
77 u16 reserved11;
78
79 /*30*/ u16 sig_status;
80 u16 reserved12;
81 /*34*/ u16 int_status;
82 u16 reserved13;
83 /*38*/ u16 reserved14;
84 u16 reserved15;
85 /*3C*/ u16 reserved16;
86 u16 reserved17;
87
88} BCSR;
89
90static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
91
92/*
93 * Register bit definitions for the BCSRs
94 */
95#define BCSR_WHOAMI_DCID 0x000F
96#define BCSR_WHOAMI_CPLD 0x00F0
97#define BCSR_WHOAMI_BOARD 0x0F00
98
99#define BCSR_STATUS_PCMCIA0VS 0x0003
100#define BCSR_STATUS_PCMCIA1VS 0x000C
101#define BCSR_STATUS_SWAPBOOT 0x0040
102#define BCSR_STATUS_FLASHBUSY 0x0100
103#define BCSR_STATUS_IDECBLID 0x0200
104#define BCSR_STATUS_SD0WP 0x0400
105#define BCSR_STATUS_U0RXD 0x1000
106#define BCSR_STATUS_U1RXD 0x2000
107
108#define BCSR_SWITCHES_OCTAL 0x00FF
109#define BCSR_SWITCHES_DIP_1 0x0080
110#define BCSR_SWITCHES_DIP_2 0x0040
111#define BCSR_SWITCHES_DIP_3 0x0020
112#define BCSR_SWITCHES_DIP_4 0x0010
113#define BCSR_SWITCHES_DIP_5 0x0008
114#define BCSR_SWITCHES_DIP_6 0x0004
115#define BCSR_SWITCHES_DIP_7 0x0002
116#define BCSR_SWITCHES_DIP_8 0x0001
117#define BCSR_SWITCHES_ROTARY 0x0F00
118
119#define BCSR_RESETS_ETH 0x0001
120#define BCSR_RESETS_CAMERA 0x0002
121#define BCSR_RESETS_DC 0x0004
122#define BCSR_RESETS_IDE 0x0008
123#define BCSR_RESETS_TV 0x0010
124/* Not resets but in the same register */
125#define BCSR_RESETS_PWMR1MUX 0x0800
126#define BCSR_RESETS_PCS0MUX 0x1000
127#define BCSR_RESETS_PCS1MUX 0x2000
128#define BCSR_RESETS_SPISEL 0x4000
129
130#define BCSR_PCMCIA_PC0VPP 0x0003
131#define BCSR_PCMCIA_PC0VCC 0x000C
132#define BCSR_PCMCIA_PC0DRVEN 0x0010
133#define BCSR_PCMCIA_PC0RST 0x0080
134#define BCSR_PCMCIA_PC1VPP 0x0300
135#define BCSR_PCMCIA_PC1VCC 0x0C00
136#define BCSR_PCMCIA_PC1DRVEN 0x1000
137#define BCSR_PCMCIA_PC1RST 0x8000
138
139#define BCSR_BOARD_LCDVEE 0x0001
140#define BCSR_BOARD_LCDVDD 0x0002
141#define BCSR_BOARD_LCDBL 0x0004
142#define BCSR_BOARD_CAMSNAP 0x0010
143#define BCSR_BOARD_CAMPWR 0x0020
144#define BCSR_BOARD_SD0PWR 0x0040
145
146#define BCSR_LEDS_DECIMALS 0x0003
147#define BCSR_LEDS_LED0 0x0100
148#define BCSR_LEDS_LED1 0x0200
149#define BCSR_LEDS_LED2 0x0400
150#define BCSR_LEDS_LED3 0x0800
151
152#define BCSR_SYSTEM_POWEROFF 0x4000
153#define BCSR_SYSTEM_RESET 0x8000
154
155/* Bit positions for the different interrupt sources */
156#define BCSR_INT_IDE 0x0001
157#define BCSR_INT_ETH 0x0002
158#define BCSR_INT_PC0 0x0004
159#define BCSR_INT_PC0STSCHG 0x0008
160#define BCSR_INT_PC1 0x0010
161#define BCSR_INT_PC1STSCHG 0x0020
162#define BCSR_INT_DC 0x0040
163#define BCSR_INT_FLASHBUSY 0x0080
164#define BCSR_INT_PC0INSERT 0x0100
165#define BCSR_INT_PC0EJECT 0x0200
166#define BCSR_INT_PC1INSERT 0x0400
167#define BCSR_INT_PC1EJECT 0x0800
168#define BCSR_INT_SD0INSERT 0x1000
169#define BCSR_INT_SD0EJECT 0x2000
170
171#define SMC91C111_PHYS_ADDR 0x19000300
172#define SMC91C111_INT DB1200_ETH_INT
173
174#define IDE_PHYS_ADDR 0x18800000
175#define IDE_REG_SHIFT 5
176#define IDE_PHYS_LEN (16 << IDE_REG_SHIFT)
177#define IDE_INT DB1200_IDE_INT
178#define IDE_DDMA_REQ DSCR_CMD0_DMA_REQ1
179#define IDE_RQSIZE 128
180
181#define NAND_PHYS_ADDR 0x20000000
182
183/*
184 * External Interrupts for DBAu1200 as of 8/6/2004.
185 * Bit positions in the CPLD registers can be calculated by taking
186 * the interrupt define and subtracting the DB1200_INT_BEGIN value.
187 *
188 * Example: IDE bis pos is = 64 - 64
189 * ETH bit pos is = 65 - 64
190 */
191enum external_pb1200_ints {
192 DB1200_INT_BEGIN = AU1000_MAX_INTR + 1,
193
194 DB1200_IDE_INT = DB1200_INT_BEGIN,
195 DB1200_ETH_INT,
196 DB1200_PC0_INT,
197 DB1200_PC0_STSCHG_INT,
198 DB1200_PC1_INT,
199 DB1200_PC1_STSCHG_INT,
200 DB1200_DC_INT,
201 DB1200_FLASHBUSY_INT,
202 DB1200_PC0_INSERT_INT,
203 DB1200_PC0_EJECT_INT,
204 DB1200_PC1_INSERT_INT,
205 DB1200_PC1_EJECT_INT,
206 DB1200_SD0_INSERT_INT,
207 DB1200_SD0_EJECT_INT,
208
209 DB1200_INT_END = DB1200_INT_BEGIN + 15,
210};
211
212
213/*
214 * DBAu1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c
215 */
216#define PCMCIA_MAX_SOCK 1
217#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
218
219/* VPP/VCC */
220#define SET_VCC_VPP(VCC, VPP, SLOT) \
221 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
222
223#define BOARD_PC0_INT DB1200_PC0_INT
224#define BOARD_PC1_INT DB1200_PC1_INT
225#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1 << (8 + (2 * SOCKET)))
226
227/* NAND chip select */
228#define NAND_CS 1
229
230#endif /* __ASM_DB1200_H */
diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h
deleted file mode 100644
index 1a515b8c870f..000000000000
--- a/include/asm-mips/mach-db1x00/db1x00.h
+++ /dev/null
@@ -1,179 +0,0 @@
1/*
2 * AMD Alchemy DBAu1x00 Reference Boards
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
7 *
8 * ########################################################################
9 *
10 * This program is free software; you can distribute it and/or modify it
11 * under the terms of the GNU General Public License (Version 2) as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * ########################################################################
24 *
25 *
26 */
27#ifndef __ASM_DB1X00_H
28#define __ASM_DB1X00_H
29
30#include <asm/mach-au1x00/au1xxx_psc.h>
31
32#ifdef CONFIG_MIPS_DB1550
33
34#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
35#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
36#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX
37#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX
38
39#define SPI_PSC_BASE PSC0_BASE_ADDR
40#define AC97_PSC_BASE PSC1_BASE_ADDR
41#define SMBUS_PSC_BASE PSC2_BASE_ADDR
42#define I2S_PSC_BASE PSC3_BASE_ADDR
43
44#define BCSR_KSEG1_ADDR 0xAF000000
45#define NAND_PHYS_ADDR 0x20000000
46
47#else
48#define BCSR_KSEG1_ADDR 0xAE000000
49#endif
50
51/*
52 * Overlay data structure of the DBAu1x00 board registers.
53 * Registers are located at physical 0E0000xx, KSEG1 0xAE0000xx.
54 */
55typedef volatile struct
56{
57 /*00*/ unsigned short whoami;
58 unsigned short reserved0;
59 /*04*/ unsigned short status;
60 unsigned short reserved1;
61 /*08*/ unsigned short switches;
62 unsigned short reserved2;
63 /*0C*/ unsigned short resets;
64 unsigned short reserved3;
65 /*10*/ unsigned short pcmcia;
66 unsigned short reserved4;
67 /*14*/ unsigned short specific;
68 unsigned short reserved5;
69 /*18*/ unsigned short leds;
70 unsigned short reserved6;
71 /*1C*/ unsigned short swreset;
72 unsigned short reserved7;
73
74} BCSR;
75
76
77/*
78 * Register/mask bit definitions for the BCSRs
79 */
80#define BCSR_WHOAMI_DCID 0x000F
81#define BCSR_WHOAMI_CPLD 0x00F0
82#define BCSR_WHOAMI_BOARD 0x0F00
83
84#define BCSR_STATUS_PC0VS 0x0003
85#define BCSR_STATUS_PC1VS 0x000C
86#define BCSR_STATUS_PC0FI 0x0010
87#define BCSR_STATUS_PC1FI 0x0020
88#define BCSR_STATUS_FLASHBUSY 0x0100
89#define BCSR_STATUS_ROMBUSY 0x0400
90#define BCSR_STATUS_SWAPBOOT 0x2000
91#define BCSR_STATUS_FLASHDEN 0xC000
92
93#define BCSR_SWITCHES_DIP 0x00FF
94#define BCSR_SWITCHES_DIP_1 0x0080
95#define BCSR_SWITCHES_DIP_2 0x0040
96#define BCSR_SWITCHES_DIP_3 0x0020
97#define BCSR_SWITCHES_DIP_4 0x0010
98#define BCSR_SWITCHES_DIP_5 0x0008
99#define BCSR_SWITCHES_DIP_6 0x0004
100#define BCSR_SWITCHES_DIP_7 0x0002
101#define BCSR_SWITCHES_DIP_8 0x0001
102#define BCSR_SWITCHES_ROTARY 0x0F00
103
104#define BCSR_RESETS_PHY0 0x0001
105#define BCSR_RESETS_PHY1 0x0002
106#define BCSR_RESETS_DC 0x0004
107#define BCSR_RESETS_FIR_SEL 0x2000
108#define BCSR_RESETS_IRDA_MODE_MASK 0xC000
109#define BCSR_RESETS_IRDA_MODE_FULL 0x0000
110#define BCSR_RESETS_IRDA_MODE_OFF 0x4000
111#define BCSR_RESETS_IRDA_MODE_2_3 0x8000
112#define BCSR_RESETS_IRDA_MODE_1_3 0xC000
113
114#define BCSR_PCMCIA_PC0VPP 0x0003
115#define BCSR_PCMCIA_PC0VCC 0x000C
116#define BCSR_PCMCIA_PC0DRVEN 0x0010
117#define BCSR_PCMCIA_PC0RST 0x0080
118#define BCSR_PCMCIA_PC1VPP 0x0300
119#define BCSR_PCMCIA_PC1VCC 0x0C00
120#define BCSR_PCMCIA_PC1DRVEN 0x1000
121#define BCSR_PCMCIA_PC1RST 0x8000
122
123#define BCSR_BOARD_PCIM66EN 0x0001
124#define BCSR_BOARD_SD0_PWR 0x0040
125#define BCSR_BOARD_SD1_PWR 0x0080
126#define BCSR_BOARD_PCIM33 0x0100
127#define BCSR_BOARD_GPIO200RST 0x0400
128#define BCSR_BOARD_PCICFG 0x1000
129#define BCSR_BOARD_SD0_WP 0x4000
130#define BCSR_BOARD_SD1_WP 0x8000
131
132#define BCSR_LEDS_DECIMALS 0x0003
133#define BCSR_LEDS_LED0 0x0100
134#define BCSR_LEDS_LED1 0x0200
135#define BCSR_LEDS_LED2 0x0400
136#define BCSR_LEDS_LED3 0x0800
137
138#define BCSR_SWRESET_RESET 0x0080
139
140/* PCMCIA DBAu1x00 specific defines */
141#define PCMCIA_MAX_SOCK 1
142#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
143
144/* VPP/VCC */
145#define SET_VCC_VPP(VCC, VPP, SLOT)\
146 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
147
148/*
149 * NAND defines
150 *
151 * Timing values as described in databook, * ns value stripped of the
152 * lower 2 bits.
153 * These defines are here rather than an Au1550 generic file because
154 * the parts chosen on another board may be different and may require
155 * different timings.
156 */
157#define NAND_T_H (18 >> 2)
158#define NAND_T_PUL (30 >> 2)
159#define NAND_T_SU (30 >> 2)
160#define NAND_T_WH (30 >> 2)
161
162/* Bitfield shift amounts */
163#define NAND_T_H_SHIFT 0
164#define NAND_T_PUL_SHIFT 4
165#define NAND_T_SU_SHIFT 8
166#define NAND_T_WH_SHIFT 12
167
168#define NAND_TIMING (((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
169 ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
170 ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
171 ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT))
172#define NAND_CS 1
173
174/* Should be done by YAMON */
175#define NAND_STCFG 0x00400005 /* 8-bit NAND */
176#define NAND_STTIME 0x00007774 /* valid for 396 MHz SD=2 only */
177#define NAND_STADDR 0x12000FFF /* physical address 0x20000000 */
178
179#endif /* __ASM_DB1X00_H */
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h
deleted file mode 100644
index 6724e99e43e1..000000000000
--- a/include/asm-mips/mach-dec/mc146818rtc.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * RTC definitions for DECstation style attached Dallas DS1287 chip.
3 *
4 * Copyright (C) 1998, 2001 by Ralf Baechle
5 * Copyright (C) 1998 by Harald Koerfgen
6 * Copyright (C) 2002, 2005 Maciej W. Rozycki
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#ifndef __ASM_MIPS_DEC_RTC_DEC_H
14#define __ASM_MIPS_DEC_RTC_DEC_H
15
16#include <linux/types.h>
17#include <asm/addrspace.h>
18#include <asm/dec/system.h>
19
20extern volatile u8 *dec_rtc_base;
21
22#define ARCH_RTC_LOCATION
23
24#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base)
25#define RTC_IO_EXTENT dec_kn_slot_size
26#define RTC_IOMAPPED 0
27#undef RTC_IRQ
28
29#define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */
30
31static inline unsigned char CMOS_READ(unsigned long addr)
32{
33 return dec_rtc_base[addr * 4];
34}
35
36static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
37{
38 dec_rtc_base[addr * 4] = data;
39}
40
41#define RTC_ALWAYS_BCD 0
42
43#endif /* __ASM_MIPS_DEC_RTC_DEC_H */
diff --git a/include/asm-mips/mach-dec/war.h b/include/asm-mips/mach-dec/war.h
deleted file mode 100644
index ca5e2ef909ad..000000000000
--- a/include/asm-mips/mach-dec/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_DEC_WAR_H
9#define __ASM_MIPS_MACH_DEC_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_DEC_WAR_H */
diff --git a/include/asm-mips/mach-emma2rh/irq.h b/include/asm-mips/mach-emma2rh/irq.h
deleted file mode 100644
index 5439eb856461..000000000000
--- a/include/asm-mips/mach-emma2rh/irq.h
+++ /dev/null
@@ -1,15 +0,0 @@
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 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_EMMA2RH_IRQ_H
9#define __ASM_MACH_EMMA2RH_IRQ_H
10
11#define NR_IRQS 256
12
13#include_next <irq.h>
14
15#endif /* __ASM_MACH_EMMA2RH_IRQ_H */
diff --git a/include/asm-mips/mach-emma2rh/war.h b/include/asm-mips/mach-emma2rh/war.h
deleted file mode 100644
index b660a4c30e6a..000000000000
--- a/include/asm-mips/mach-emma2rh/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_EMMA2RH_WAR_H
9#define __ASM_MIPS_MACH_EMMA2RH_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_EMMA2RH_WAR_H */
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
deleted file mode 100644
index 107104c3cd12..000000000000
--- a/include/asm-mips/mach-excite/cpu-feature-overrides.h
+++ /dev/null
@@ -1,48 +0,0 @@
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 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com>
7 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
8 */
9#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
11
12/*
13 * Basler eXcite has an RM9122 processor.
14 */
15#define cpu_has_watch 1
16#define cpu_has_mips16 0
17#define cpu_has_divec 0
18#define cpu_has_vce 0
19#define cpu_has_cache_cdex_p 0
20#define cpu_has_cache_cdex_s 0
21#define cpu_has_prefetch 1
22#define cpu_has_mcheck 0
23#define cpu_has_ejtag 0
24
25#define cpu_has_llsc 1
26#define cpu_has_vtag_icache 0
27#define cpu_has_dc_aliases 0
28#define cpu_has_ic_fills_f_dc 0
29#define cpu_has_dsp 0
30#define cpu_icache_snoops_remote_store 0
31#define cpu_has_mipsmt 0
32#define cpu_has_userlocal 0
33
34#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1
36
37#define cpu_has_mips32r1 0
38#define cpu_has_mips32r2 0
39#define cpu_has_mips64r1 0
40#define cpu_has_mips64r2 0
41
42#define cpu_has_inclusive_pcaches 0
43
44#define cpu_dcache_line_size() 32
45#define cpu_icache_line_size() 32
46#define cpu_scache_line_size() 32
47
48#endif /* __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-excite/excite.h b/include/asm-mips/mach-excite/excite.h
deleted file mode 100644
index 4c29ba44992c..000000000000
--- a/include/asm-mips/mach-excite/excite.h
+++ /dev/null
@@ -1,154 +0,0 @@
1#ifndef __EXCITE_H__
2#define __EXCITE_H__
3
4#include <linux/init.h>
5#include <asm/addrspace.h>
6#include <asm/types.h>
7
8#define EXCITE_CPU_EXT_CLOCK 100000000
9
10#if !defined(__ASSEMBLY__)
11void __init excite_kgdb_init(void);
12void excite_procfs_init(void);
13extern unsigned long memsize;
14extern char modetty[];
15extern u32 unit_id;
16#endif
17
18/* Base name for XICAP devices */
19#define XICAP_NAME "xicap_gpi"
20
21/* OCD register offsets */
22#define LKB0 0x0038
23#define LKB5 0x0128
24#define LKM5 0x012C
25#define LKB7 0x0138
26#define LKM7 0x013c
27#define LKB8 0x0140
28#define LKM8 0x0144
29#define LKB9 0x0148
30#define LKM9 0x014c
31#define LKB10 0x0150
32#define LKM10 0x0154
33#define LKB11 0x0158
34#define LKM11 0x015c
35#define LKB12 0x0160
36#define LKM12 0x0164
37#define LKB13 0x0168
38#define LKM13 0x016c
39#define LDP0 0x0200
40#define LDP1 0x0210
41#define LDP2 0x0220
42#define LDP3 0x0230
43#define INTPIN0 0x0A40
44#define INTPIN1 0x0A44
45#define INTPIN2 0x0A48
46#define INTPIN3 0x0A4C
47#define INTPIN4 0x0A50
48#define INTPIN5 0x0A54
49#define INTPIN6 0x0A58
50#define INTPIN7 0x0A5C
51
52
53
54
55/* TITAN register offsets */
56#define CPRR 0x0004
57#define CPDSR 0x0008
58#define CPTC0R 0x000c
59#define CPTC1R 0x0010
60#define CPCFG0 0x0020
61#define CPCFG1 0x0024
62#define CPDST0A 0x0028
63#define CPDST0B 0x002c
64#define CPDST1A 0x0030
65#define CPDST1B 0x0034
66#define CPXDSTA 0x0038
67#define CPXDSTB 0x003c
68#define CPXCISRA 0x0048
69#define CPXCISRB 0x004c
70#define CPGIG0ER 0x0050
71#define CPGIG1ER 0x0054
72#define CPGRWL 0x0068
73#define CPURSLMT 0x00f8
74#define UACFG 0x0200
75#define UAINTS 0x0204
76#define SDRXFCIE 0x4828
77#define SDTXFCIE 0x4928
78#define INTP0Status0 0x1B00
79#define INTP0Mask0 0x1B04
80#define INTP0Set0 0x1B08
81#define INTP0Clear0 0x1B0C
82#define GXCFG 0x5000
83#define GXDMADRPFX 0x5018
84#define GXDMA_DESCADR 0x501c
85#define GXCH0TDESSTRT 0x5054
86
87/* IRQ definitions */
88#define NMICONFIG 0xac0
89#define TITAN_MSGINT 0xc4
90#define TITAN_IRQ ((TITAN_MSGINT / 0x20) + 2)
91#define FPGA0_MSGINT 0x5a
92#define FPGA0_IRQ ((FPGA0_MSGINT / 0x20) + 2)
93#define FPGA1_MSGINT 0x7b
94#define FPGA1_IRQ ((FPGA1_MSGINT / 0x20) + 2)
95#define PHY_MSGINT 0x9c
96#define PHY_IRQ ((PHY_MSGINT / 0x20) + 2)
97
98#if defined(CONFIG_BASLER_EXCITE_PROTOTYPE)
99/* Pre-release units used interrupt pin #9 */
100#define USB_IRQ 11
101#else
102/* Re-designed units use interrupt pin #1 */
103#define USB_MSGINT 0x39
104#define USB_IRQ ((USB_MSGINT / 0x20) + 2)
105#endif
106#define TIMER_IRQ 12
107
108
109/* Device address ranges */
110#define EXCITE_OFFS_OCD 0x1fffc000
111#define EXCITE_SIZE_OCD (16 * 1024)
112#define EXCITE_PHYS_OCD CPHYSADDR(EXCITE_OFFS_OCD)
113#define EXCITE_ADDR_OCD CKSEG1ADDR(EXCITE_OFFS_OCD)
114
115#define EXCITE_OFFS_SCRAM 0x1fffa000
116#define EXCITE_SIZE_SCRAM (8 << 10)
117#define EXCITE_PHYS_SCRAM CPHYSADDR(EXCITE_OFFS_SCRAM)
118#define EXCITE_ADDR_SCRAM CKSEG1ADDR(EXCITE_OFFS_SCRAM)
119
120#define EXCITE_OFFS_PCI_IO 0x1fff8000
121#define EXCITE_SIZE_PCI_IO (8 << 10)
122#define EXCITE_PHYS_PCI_IO CPHYSADDR(EXCITE_OFFS_PCI_IO)
123#define EXCITE_ADDR_PCI_IO CKSEG1ADDR(EXCITE_OFFS_PCI_IO)
124
125#define EXCITE_OFFS_TITAN 0x1fff0000
126#define EXCITE_SIZE_TITAN (32 << 10)
127#define EXCITE_PHYS_TITAN CPHYSADDR(EXCITE_OFFS_TITAN)
128#define EXCITE_ADDR_TITAN CKSEG1ADDR(EXCITE_OFFS_TITAN)
129
130#define EXCITE_OFFS_PCI_MEM 0x1ffe0000
131#define EXCITE_SIZE_PCI_MEM (64 << 10)
132#define EXCITE_PHYS_PCI_MEM CPHYSADDR(EXCITE_OFFS_PCI_MEM)
133#define EXCITE_ADDR_PCI_MEM CKSEG1ADDR(EXCITE_OFFS_PCI_MEM)
134
135#define EXCITE_OFFS_FPGA 0x1ffdc000
136#define EXCITE_SIZE_FPGA (16 << 10)
137#define EXCITE_PHYS_FPGA CPHYSADDR(EXCITE_OFFS_FPGA)
138#define EXCITE_ADDR_FPGA CKSEG1ADDR(EXCITE_OFFS_FPGA)
139
140#define EXCITE_OFFS_NAND 0x1ffd8000
141#define EXCITE_SIZE_NAND (16 << 10)
142#define EXCITE_PHYS_NAND CPHYSADDR(EXCITE_OFFS_NAND)
143#define EXCITE_ADDR_NAND CKSEG1ADDR(EXCITE_OFFS_NAND)
144
145#define EXCITE_OFFS_BOOTROM 0x1f000000
146#define EXCITE_SIZE_BOOTROM (8 << 20)
147#define EXCITE_PHYS_BOOTROM CPHYSADDR(EXCITE_OFFS_BOOTROM)
148#define EXCITE_ADDR_BOOTROM CKSEG1ADDR(EXCITE_OFFS_BOOTROM)
149
150/* FPGA address offsets */
151#define EXCITE_FPGA_DPR 0x0104 /* dual-ported ram */
152#define EXCITE_FPGA_SYSCTL 0x0200 /* system control register block */
153
154#endif /* __EXCITE_H__ */
diff --git a/include/asm-mips/mach-excite/excite_fpga.h b/include/asm-mips/mach-excite/excite_fpga.h
deleted file mode 100644
index 0a1ef69bece7..000000000000
--- a/include/asm-mips/mach-excite/excite_fpga.h
+++ /dev/null
@@ -1,80 +0,0 @@
1#ifndef EXCITE_FPGA_H_INCLUDED
2#define EXCITE_FPGA_H_INCLUDED
3
4
5/**
6 * Address alignment of the individual FPGA bytes.
7 * The address arrangement of the individual bytes of the FPGA is two
8 * byte aligned at the embedded MK2 platform.
9 */
10#ifdef EXCITE_CCI_FPGA_MK2
11typedef unsigned char excite_cci_fpga_align_t __attribute__ ((aligned(2)));
12#else
13typedef unsigned char excite_cci_fpga_align_t;
14#endif
15
16
17/**
18 * Size of Dual Ported RAM.
19 */
20#define EXCITE_DPR_SIZE 263
21
22
23/**
24 * Size of Reserved Status Fields in Dual Ported RAM.
25 */
26#define EXCITE_DPR_STATUS_SIZE 7
27
28
29
30/**
31 * FPGA.
32 * Hardware register layout of the FPGA interface. The FPGA must accessed
33 * byte wise solely.
34 * @see EXCITE_CCI_DPR_MK2
35 */
36typedef struct excite_fpga {
37
38 /**
39 * Dual Ported RAM.
40 */
41 excite_cci_fpga_align_t dpr[EXCITE_DPR_SIZE];
42
43 /**
44 * Status.
45 */
46 excite_cci_fpga_align_t status[EXCITE_DPR_STATUS_SIZE];
47
48#ifdef EXCITE_CCI_FPGA_MK2
49 /**
50 * RM9000 Interrupt.
51 * Write access initiates interrupt at the RM9000 (MIPS) processor of the eXcite.
52 */
53 excite_cci_fpga_align_t rm9k_int;
54#else
55 /**
56 * MK2 Interrupt.
57 * Write access initiates interrupt at the ARM processor of the MK2.
58 */
59 excite_cci_fpga_align_t mk2_int;
60
61 excite_cci_fpga_align_t gap[0x1000-0x10f];
62
63 /**
64 * IRQ Source/Acknowledge.
65 */
66 excite_cci_fpga_align_t rm9k_irq_src;
67
68 /**
69 * IRQ Mask.
70 * Set bits enable the related interrupt.
71 */
72 excite_cci_fpga_align_t rm9k_irq_mask;
73#endif
74
75
76} excite_fpga;
77
78
79
80#endif /* ndef EXCITE_FPGA_H_INCLUDED */
diff --git a/include/asm-mips/mach-excite/excite_nandflash.h b/include/asm-mips/mach-excite/excite_nandflash.h
deleted file mode 100644
index c4cf6140622e..000000000000
--- a/include/asm-mips/mach-excite/excite_nandflash.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __EXCITE_NANDFLASH_H__
2#define __EXCITE_NANDFLASH_H__
3
4/* Resource names */
5#define EXCITE_NANDFLASH_RESOURCE_REGS "excite_nandflash_regs"
6
7#endif /* __EXCITE_NANDFLASH_H__ */
diff --git a/include/asm-mips/mach-excite/rm9k_eth.h b/include/asm-mips/mach-excite/rm9k_eth.h
deleted file mode 100644
index 94705a46f72e..000000000000
--- a/include/asm-mips/mach-excite/rm9k_eth.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#if !defined(__RM9K_ETH_H__)
2#define __RM9K_ETH_H__
3
4#define RM9K_GE_NAME "rm9k_ge"
5
6/* Resource names */
7#define RM9K_GE_RESOURCE_MAC "rm9k_ge_mac"
8#define RM9K_GE_RESOURCE_MSTAT "rm9k_ge_mstat"
9#define RM9K_GE_RESOURCE_PKTPROC "rm9k_ge_pktproc"
10#define RM9K_GE_RESOURCE_XDMA "rm9k_ge_xdma"
11#define RM9K_GE_RESOURCE_FIFO_RX "rm9k_ge_fifo_rx"
12#define RM9K_GE_RESOURCE_FIFO_TX "rm9k_ge_fifo_tx"
13#define RM9K_GE_RESOURCE_FIFOMEM_RX "rm9k_ge_fifo_memory_rx"
14#define RM9K_GE_RESOURCE_FIFOMEM_TX "rm9k_ge_fifo_memory_tx"
15#define RM9K_GE_RESOURCE_PHY "rm9k_ge_phy"
16#define RM9K_GE_RESOURCE_DMADESC_RX "rm9k_ge_dmadesc_rx"
17#define RM9K_GE_RESOURCE_DMADESC_TX "rm9k_ge_dmadesc_tx"
18#define RM9K_GE_RESOURCE_IRQ_MAIN "rm9k_ge_irq_main"
19#define RM9K_GE_RESOURCE_IRQ_PHY "rm9k_ge_irq_phy"
20#define RM9K_GE_RESOURCE_GPI_SLICE "rm9k_ge_gpi_slice"
21#define RM9K_GE_RESOURCE_MDIO_CHANNEL "rm9k_ge_mdio_channel"
22
23#endif /* !defined(__RM9K_ETH_H__) */
diff --git a/include/asm-mips/mach-excite/rm9k_wdt.h b/include/asm-mips/mach-excite/rm9k_wdt.h
deleted file mode 100644
index 3fa3c08d2da7..000000000000
--- a/include/asm-mips/mach-excite/rm9k_wdt.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef __RM9K_WDT_H__
2#define __RM9K_WDT_H__
3
4/* Device name */
5#define WDT_NAME "wdt_gpi"
6
7/* Resource names */
8#define WDT_RESOURCE_REGS "excite_watchdog_regs"
9#define WDT_RESOURCE_IRQ "excite_watchdog_irq"
10#define WDT_RESOURCE_COUNTER "excite_watchdog_counter"
11
12#endif /* __RM9K_WDT_H__ */
diff --git a/include/asm-mips/mach-excite/rm9k_xicap.h b/include/asm-mips/mach-excite/rm9k_xicap.h
deleted file mode 100644
index 009577734a8d..000000000000
--- a/include/asm-mips/mach-excite/rm9k_xicap.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef __EXCITE_XICAP_H__
2#define __EXCITE_XICAP_H__
3
4
5/* Resource names */
6#define XICAP_RESOURCE_FIFO_RX "xicap_fifo_rx"
7#define XICAP_RESOURCE_FIFO_TX "xicap_fifo_tx"
8#define XICAP_RESOURCE_XDMA "xicap_xdma"
9#define XICAP_RESOURCE_DMADESC "xicap_dmadesc"
10#define XICAP_RESOURCE_PKTPROC "xicap_pktproc"
11#define XICAP_RESOURCE_IRQ "xicap_irq"
12#define XICAP_RESOURCE_GPI_SLICE "xicap_gpi_slice"
13#define XICAP_RESOURCE_FIFO_BLK "xicap_fifo_blocks"
14#define XICAP_RESOURCE_PKT_STREAM "xicap_pkt_stream"
15
16#endif /* __EXCITE_XICAP_H__ */
diff --git a/include/asm-mips/mach-excite/war.h b/include/asm-mips/mach-excite/war.h
deleted file mode 100644
index 1f82180c1598..000000000000
--- a/include/asm-mips/mach-excite/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_EXCITE_WAR_H
9#define __ASM_MIPS_MACH_EXCITE_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 1
21#define ICACHE_REFILLS_WORKAROUND_WAR 1
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_EXCITE_WAR_H */
diff --git a/include/asm-mips/mach-generic/cpu-feature-overrides.h b/include/asm-mips/mach-generic/cpu-feature-overrides.h
deleted file mode 100644
index 7c185bb06f13..000000000000
--- a/include/asm-mips/mach-generic/cpu-feature-overrides.h
+++ /dev/null
@@ -1,13 +0,0 @@
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 * Copyright (C) 2003 Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H
10
11/* Intentionally empty file ... */
12
13#endif /* __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-generic/dma-coherence.h b/include/asm-mips/mach-generic/dma-coherence.h
deleted file mode 100644
index 76e04e7feb84..000000000000
--- a/include/asm-mips/mach-generic/dma-coherence.h
+++ /dev/null
@@ -1,45 +0,0 @@
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 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
7 *
8 */
9#ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H
10#define __ASM_MACH_GENERIC_DMA_COHERENCE_H
11
12struct device;
13
14static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
15 size_t size)
16{
17 return virt_to_phys(addr);
18}
19
20static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
21 struct page *page)
22{
23 return page_to_phys(page);
24}
25
26static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
27{
28 return dma_addr;
29}
30
31static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
32{
33}
34
35static inline int plat_device_is_coherent(struct device *dev)
36{
37#ifdef CONFIG_DMA_COHERENT
38 return 1;
39#endif
40#ifdef CONFIG_DMA_NONCOHERENT
41 return 0;
42#endif
43}
44
45#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
diff --git a/include/asm-mips/mach-generic/floppy.h b/include/asm-mips/mach-generic/floppy.h
deleted file mode 100644
index 001a8ce17c17..000000000000
--- a/include/asm-mips/mach-generic/floppy.h
+++ /dev/null
@@ -1,139 +0,0 @@
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 * Copyright (C) 1996, 1997, 1998, 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_FLOPPY_H
9#define __ASM_MACH_GENERIC_FLOPPY_H
10
11#include <linux/delay.h>
12#include <linux/init.h>
13#include <linux/ioport.h>
14#include <linux/sched.h>
15#include <linux/linkage.h>
16#include <linux/types.h>
17#include <linux/mm.h>
18
19#include <asm/bootinfo.h>
20#include <asm/cachectl.h>
21#include <asm/dma.h>
22#include <asm/floppy.h>
23#include <asm/io.h>
24#include <asm/irq.h>
25#include <asm/pgtable.h>
26
27/*
28 * How to access the FDC's registers.
29 */
30static inline unsigned char fd_inb(unsigned int port)
31{
32 return inb_p(port);
33}
34
35static inline void fd_outb(unsigned char value, unsigned int port)
36{
37 outb_p(value, port);
38}
39
40/*
41 * How to access the floppy DMA functions.
42 */
43static inline void fd_enable_dma(void)
44{
45 enable_dma(FLOPPY_DMA);
46}
47
48static inline void fd_disable_dma(void)
49{
50 disable_dma(FLOPPY_DMA);
51}
52
53static inline int fd_request_dma(void)
54{
55 return request_dma(FLOPPY_DMA, "floppy");
56}
57
58static inline void fd_free_dma(void)
59{
60 free_dma(FLOPPY_DMA);
61}
62
63static inline void fd_clear_dma_ff(void)
64{
65 clear_dma_ff(FLOPPY_DMA);
66}
67
68static inline void fd_set_dma_mode(char mode)
69{
70 set_dma_mode(FLOPPY_DMA, mode);
71}
72
73static inline void fd_set_dma_addr(char *addr)
74{
75 set_dma_addr(FLOPPY_DMA, (unsigned long) addr);
76}
77
78static inline void fd_set_dma_count(unsigned int count)
79{
80 set_dma_count(FLOPPY_DMA, count);
81}
82
83static inline int fd_get_dma_residue(void)
84{
85 return get_dma_residue(FLOPPY_DMA);
86}
87
88static inline void fd_enable_irq(void)
89{
90 enable_irq(FLOPPY_IRQ);
91}
92
93static inline void fd_disable_irq(void)
94{
95 disable_irq(FLOPPY_IRQ);
96}
97
98static inline int fd_request_irq(void)
99{
100 return request_irq(FLOPPY_IRQ, floppy_interrupt,
101 IRQF_DISABLED, "floppy", NULL);
102}
103
104static inline void fd_free_irq(void)
105{
106 free_irq(FLOPPY_IRQ, NULL);
107}
108
109#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL);
110
111
112static inline unsigned long fd_getfdaddr1(void)
113{
114 return 0x3f0;
115}
116
117static inline unsigned long fd_dma_mem_alloc(unsigned long size)
118{
119 unsigned long mem;
120
121 mem = __get_dma_pages(GFP_KERNEL, get_order(size));
122
123 return mem;
124}
125
126static inline void fd_dma_mem_free(unsigned long addr, unsigned long size)
127{
128 free_pages(addr, get_order(size));
129}
130
131static inline unsigned long fd_drive_type(unsigned long n)
132{
133 if (n == 0)
134 return 4; /* 3,5", 1.44mb */
135
136 return 0;
137}
138
139#endif /* __ASM_MACH_GENERIC_FLOPPY_H */
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h
deleted file mode 100644
index b4e70208da64..000000000000
--- a/include/asm-mips/mach-generic/gpio.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __ASM_MACH_GENERIC_GPIO_H
2#define __ASM_MACH_GENERIC_GPIO_H
3
4#ifdef CONFIG_GPIOLIB
5#define gpio_get_value __gpio_get_value
6#define gpio_set_value __gpio_set_value
7#define gpio_cansleep __gpio_cansleep
8#else
9int gpio_request(unsigned gpio, const char *label);
10void gpio_free(unsigned gpio);
11int gpio_direction_input(unsigned gpio);
12int gpio_direction_output(unsigned gpio, int value);
13int gpio_get_value(unsigned gpio);
14void gpio_set_value(unsigned gpio, int value);
15#endif
16int gpio_to_irq(unsigned gpio);
17int irq_to_gpio(unsigned irq);
18
19#include <asm-generic/gpio.h> /* cansleep wrappers */
20
21#endif /* __ASM_MACH_GENERIC_GPIO_H */
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
deleted file mode 100644
index 73008f7bdc93..000000000000
--- a/include/asm-mips/mach-generic/ide.h
+++ /dev/null
@@ -1,167 +0,0 @@
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 * Copyright (C) 1994-1996 Linus Torvalds & authors
7 *
8 * Copied from i386; many of the especially older MIPS or ISA-based platforms
9 * are basically identical. Using this file probably implies i8259 PIC
10 * support in a system but the very least interrupt numbers 0 - 15 need to
11 * be put aside for legacy devices.
12 */
13#ifndef __ASM_MACH_GENERIC_IDE_H
14#define __ASM_MACH_GENERIC_IDE_H
15
16#ifdef __KERNEL__
17
18#include <linux/pci.h>
19#include <linux/stddef.h>
20#include <asm/processor.h>
21
22static __inline__ int ide_probe_legacy(void)
23{
24#ifdef CONFIG_PCI
25 struct pci_dev *dev;
26 /*
27 * This can be called on the ide_setup() path, super-early in
28 * boot. But the down_read() will enable local interrupts,
29 * which can cause some machines to crash. So here we detect
30 * and flag that situation and bail out early.
31 */
32 if (no_pci_devices())
33 return 0;
34 dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL);
35 if (dev)
36 goto found;
37 dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
38 if (dev)
39 goto found;
40 return 0;
41found:
42 pci_dev_put(dev);
43 return 1;
44#elif defined(CONFIG_EISA) || defined(CONFIG_ISA)
45 return 1;
46#else
47 return 0;
48#endif
49}
50
51/* MIPS port and memory-mapped I/O string operations. */
52static inline void __ide_flush_prologue(void)
53{
54#ifdef CONFIG_SMP
55 if (cpu_has_dc_aliases)
56 preempt_disable();
57#endif
58}
59
60static inline void __ide_flush_epilogue(void)
61{
62#ifdef CONFIG_SMP
63 if (cpu_has_dc_aliases)
64 preempt_enable();
65#endif
66}
67
68static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
69{
70 if (cpu_has_dc_aliases) {
71 unsigned long end = addr + size;
72
73 while (addr < end) {
74 local_flush_data_cache_page((void *)addr);
75 addr += PAGE_SIZE;
76 }
77 }
78}
79
80/*
81 * insw() and gang might be called with interrupts disabled, so we can't
82 * send IPIs for flushing due to the potencial of deadlocks, see the comment
83 * above smp_call_function() in arch/mips/kernel/smp.c. We work around the
84 * problem by disabling preemption so we know we actually perform the flush
85 * on the processor that actually has the lines to be flushed which hopefully
86 * is even better for performance anyway.
87 */
88static inline void __ide_insw(unsigned long port, void *addr,
89 unsigned int count)
90{
91 __ide_flush_prologue();
92 insw(port, addr, count);
93 __ide_flush_dcache_range((unsigned long)addr, count * 2);
94 __ide_flush_epilogue();
95}
96
97static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
98{
99 __ide_flush_prologue();
100 insl(port, addr, count);
101 __ide_flush_dcache_range((unsigned long)addr, count * 4);
102 __ide_flush_epilogue();
103}
104
105static inline void __ide_outsw(unsigned long port, const void *addr,
106 unsigned long count)
107{
108 __ide_flush_prologue();
109 outsw(port, addr, count);
110 __ide_flush_dcache_range((unsigned long)addr, count * 2);
111 __ide_flush_epilogue();
112}
113
114static inline void __ide_outsl(unsigned long port, const void *addr,
115 unsigned long count)
116{
117 __ide_flush_prologue();
118 outsl(port, addr, count);
119 __ide_flush_dcache_range((unsigned long)addr, count * 4);
120 __ide_flush_epilogue();
121}
122
123static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count)
124{
125 __ide_flush_prologue();
126 readsw(port, addr, count);
127 __ide_flush_dcache_range((unsigned long)addr, count * 2);
128 __ide_flush_epilogue();
129}
130
131static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count)
132{
133 __ide_flush_prologue();
134 readsl(port, addr, count);
135 __ide_flush_dcache_range((unsigned long)addr, count * 4);
136 __ide_flush_epilogue();
137}
138
139static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count)
140{
141 __ide_flush_prologue();
142 writesw(port, addr, count);
143 __ide_flush_dcache_range((unsigned long)addr, count * 2);
144 __ide_flush_epilogue();
145}
146
147static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count)
148{
149 __ide_flush_prologue();
150 writesl(port, addr, count);
151 __ide_flush_dcache_range((unsigned long)addr, count * 4);
152 __ide_flush_epilogue();
153}
154
155/* ide_insw calls insw, not __ide_insw. Why? */
156#undef insw
157#undef insl
158#undef outsw
159#undef outsl
160#define insw(port, addr, count) __ide_insw(port, addr, count)
161#define insl(port, addr, count) __ide_insl(port, addr, count)
162#define outsw(port, addr, count) __ide_outsw(port, addr, count)
163#define outsl(port, addr, count) __ide_outsl(port, addr, count)
164
165#endif /* __KERNEL__ */
166
167#endif /* __ASM_MACH_GENERIC_IDE_H */
diff --git a/include/asm-mips/mach-generic/ioremap.h b/include/asm-mips/mach-generic/ioremap.h
deleted file mode 100644
index b379938d47f0..000000000000
--- a/include/asm-mips/mach-generic/ioremap.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * include/asm-mips/mach-generic/ioremap.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#ifndef __ASM_MACH_GENERIC_IOREMAP_H
10#define __ASM_MACH_GENERIC_IOREMAP_H
11
12#include <linux/types.h>
13
14/*
15 * Allow physical addresses to be fixed up to help peripherals located
16 * outside the low 32-bit range -- generic pass-through version.
17 */
18static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
19{
20 return phys_addr;
21}
22
23static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
24 unsigned long flags)
25{
26 return NULL;
27}
28
29static inline int plat_iounmap(const volatile void __iomem *addr)
30{
31 return 0;
32}
33
34#endif /* __ASM_MACH_GENERIC_IOREMAP_H */
diff --git a/include/asm-mips/mach-generic/irq.h b/include/asm-mips/mach-generic/irq.h
deleted file mode 100644
index 70d9a25132c5..000000000000
--- a/include/asm-mips/mach-generic/irq.h
+++ /dev/null
@@ -1,45 +0,0 @@
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 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_IRQ_H
9#define __ASM_MACH_GENERIC_IRQ_H
10
11#ifndef NR_IRQS
12#define NR_IRQS 128
13#endif
14
15#ifdef CONFIG_I8259
16#ifndef I8259A_IRQ_BASE
17#define I8259A_IRQ_BASE 0
18#endif
19#endif
20
21#ifdef CONFIG_IRQ_CPU
22
23#ifndef MIPS_CPU_IRQ_BASE
24#ifdef CONFIG_I8259
25#define MIPS_CPU_IRQ_BASE 16
26#else
27#define MIPS_CPU_IRQ_BASE 0
28#endif /* CONFIG_I8259 */
29#endif
30
31#ifdef CONFIG_IRQ_CPU_RM7K
32#ifndef RM7K_CPU_IRQ_BASE
33#define RM7K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+8)
34#endif
35#endif
36
37#ifdef CONFIG_IRQ_CPU_RM9K
38#ifndef RM9K_CPU_IRQ_BASE
39#define RM9K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+12)
40#endif
41#endif
42
43#endif /* CONFIG_IRQ_CPU */
44
45#endif /* __ASM_MACH_GENERIC_IRQ_H */
diff --git a/include/asm-mips/mach-generic/kernel-entry-init.h b/include/asm-mips/mach-generic/kernel-entry-init.h
deleted file mode 100644
index 7e66505fa574..000000000000
--- a/include/asm-mips/mach-generic/kernel-entry-init.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2005 Embedded Alley Solutions, Inc
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
8 */
9#ifndef __ASM_MACH_GENERIC_KERNEL_ENTRY_H
10#define __ASM_MACH_GENERIC_KERNEL_ENTRY_H
11
12/* Intentionally empty macro, used in head.S. Override in
13 * arch/mips/mach-xxx/kernel-entry-init.h when necessary.
14 */
15.macro kernel_entry_setup
16.endm
17
18/*
19 * Do SMP slave processor setup necessary before we can savely execute C code.
20 */
21 .macro smp_slave_setup
22 .endm
23
24
25#endif /* __ASM_MACH_GENERIC_KERNEL_ENTRY_H */
diff --git a/include/asm-mips/mach-generic/kmalloc.h b/include/asm-mips/mach-generic/kmalloc.h
deleted file mode 100644
index b8e6deba352f..000000000000
--- a/include/asm-mips/mach-generic/kmalloc.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ASM_MACH_GENERIC_KMALLOC_H
2#define __ASM_MACH_GENERIC_KMALLOC_H
3
4
5#ifndef CONFIG_DMA_COHERENT
6/*
7 * Total overkill for most systems but need as a safe default.
8 * Set this one if any device in the system might do non-coherent DMA.
9 */
10#define ARCH_KMALLOC_MINALIGN 128
11#endif
12
13#endif /* __ASM_MACH_GENERIC_KMALLOC_H */
diff --git a/include/asm-mips/mach-generic/mangle-port.h b/include/asm-mips/mach-generic/mangle-port.h
deleted file mode 100644
index f49dc990214b..000000000000
--- a/include/asm-mips/mach-generic/mangle-port.h
+++ /dev/null
@@ -1,52 +0,0 @@
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 * Copyright (C) 2003, 2004 Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H
9#define __ASM_MACH_GENERIC_MANGLE_PORT_H
10
11#define __swizzle_addr_b(port) (port)
12#define __swizzle_addr_w(port) (port)
13#define __swizzle_addr_l(port) (port)
14#define __swizzle_addr_q(port) (port)
15
16/*
17 * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware;
18 * less sane hardware forces software to fiddle with this...
19 *
20 * Regardless, if the host bus endianness mismatches that of PCI/ISA, then
21 * you can't have the numerical value of data and byte addresses within
22 * multibyte quantities both preserved at the same time. Hence two
23 * variations of functions: non-prefixed ones that preserve the value
24 * and prefixed ones that preserve byte addresses. The latters are
25 * typically used for moving raw data between a peripheral and memory (cf.
26 * string I/O functions), hence the "__mem_" prefix.
27 */
28#if defined(CONFIG_SWAP_IO_SPACE)
29
30# define ioswabb(a, x) (x)
31# define __mem_ioswabb(a, x) (x)
32# define ioswabw(a, x) le16_to_cpu(x)
33# define __mem_ioswabw(a, x) (x)
34# define ioswabl(a, x) le32_to_cpu(x)
35# define __mem_ioswabl(a, x) (x)
36# define ioswabq(a, x) le64_to_cpu(x)
37# define __mem_ioswabq(a, x) (x)
38
39#else
40
41# define ioswabb(a, x) (x)
42# define __mem_ioswabb(a, x) (x)
43# define ioswabw(a, x) (x)
44# define __mem_ioswabw(a, x) cpu_to_le16(x)
45# define ioswabl(a, x) (x)
46# define __mem_ioswabl(a, x) cpu_to_le32(x)
47# define ioswabq(a, x) (x)
48# define __mem_ioswabq(a, x) cpu_to_le32(x)
49
50#endif
51
52#endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */
diff --git a/include/asm-mips/mach-generic/mc146818rtc.h b/include/asm-mips/mach-generic/mc146818rtc.h
deleted file mode 100644
index 0b9a942f079d..000000000000
--- a/include/asm-mips/mach-generic/mc146818rtc.h
+++ /dev/null
@@ -1,36 +0,0 @@
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 * Copyright (C) 1998, 2001, 03 by Ralf Baechle
7 *
8 * RTC routines for PC style attached Dallas chip.
9 */
10#ifndef __ASM_MACH_GENERIC_MC146818RTC_H
11#define __ASM_MACH_GENERIC_MC146818RTC_H
12
13#include <asm/io.h>
14
15#define RTC_PORT(x) (0x70 + (x))
16#define RTC_IRQ 8
17
18static inline unsigned char CMOS_READ(unsigned long addr)
19{
20 outb_p(addr, RTC_PORT(0));
21 return inb_p(RTC_PORT(1));
22}
23
24static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
25{
26 outb_p(addr, RTC_PORT(0));
27 outb_p(data, RTC_PORT(1));
28}
29
30#define RTC_ALWAYS_BCD 1
31
32#ifndef mc146818_decode_year
33#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
34#endif
35
36#endif /* __ASM_MACH_GENERIC_MC146818RTC_H */
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h
deleted file mode 100644
index c9fa4b14968d..000000000000
--- a/include/asm-mips/mach-generic/spaces.h
+++ /dev/null
@@ -1,85 +0,0 @@
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 * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_MACH_GENERIC_SPACES_H
11#define _ASM_MACH_GENERIC_SPACES_H
12
13#include <linux/const.h>
14
15/*
16 * This gives the physical RAM offset.
17 */
18#ifndef PHYS_OFFSET
19#define PHYS_OFFSET _AC(0, UL)
20#endif
21
22#ifdef CONFIG_32BIT
23
24#define CAC_BASE _AC(0x80000000, UL)
25#define IO_BASE _AC(0xa0000000, UL)
26#define UNCAC_BASE _AC(0xa0000000, UL)
27
28#ifndef MAP_BASE
29#define MAP_BASE _AC(0xc0000000, UL)
30#endif
31
32/*
33 * Memory above this physical address will be considered highmem.
34 */
35#ifndef HIGHMEM_START
36#define HIGHMEM_START _AC(0x20000000, UL)
37#endif
38
39#endif /* CONFIG_32BIT */
40
41#ifdef CONFIG_64BIT
42
43#ifndef CAC_BASE
44#ifdef CONFIG_DMA_NONCOHERENT
45#define CAC_BASE _AC(0x9800000000000000, UL)
46#else
47#define CAC_BASE _AC(0xa800000000000000, UL)
48#endif
49#endif
50
51#ifndef IO_BASE
52#define IO_BASE _AC(0x9000000000000000, UL)
53#endif
54
55#ifndef UNCAC_BASE
56#define UNCAC_BASE _AC(0x9000000000000000, UL)
57#endif
58
59#ifndef MAP_BASE
60#define MAP_BASE _AC(0xc000000000000000, UL)
61#endif
62
63/*
64 * Memory above this physical address will be considered highmem.
65 * Fixme: 59 bits is a fictive number and makes assumptions about processors
66 * in the distant future. Nobody will care for a few years :-)
67 */
68#ifndef HIGHMEM_START
69#define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
70#endif
71
72#define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
73#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
74#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
75
76#endif /* CONFIG_64BIT */
77
78/*
79 * This handles the memory map.
80 */
81#ifndef PAGE_OFFSET
82#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
83#endif
84
85#endif /* __ASM_MACH_GENERIC_SPACES_H */
diff --git a/include/asm-mips/mach-generic/topology.h b/include/asm-mips/mach-generic/topology.h
deleted file mode 100644
index 5428f333a02c..000000000000
--- a/include/asm-mips/mach-generic/topology.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/topology.h>
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
deleted file mode 100644
index 9c8735158da1..000000000000
--- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h
+++ /dev/null
@@ -1,44 +0,0 @@
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 * Copyright (C) 2003, 07 Ralf Baechle
7 */
8#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
10
11/*
12 * IP22 with a variety of processors so we can't use defaults for everything.
13 */
14#define cpu_has_tlb 1
15#define cpu_has_4kex 1
16#define cpu_has_4k_cache 1
17#define cpu_has_fpu 1
18#define cpu_has_32fpr 1
19#define cpu_has_counter 1
20#define cpu_has_mips16 0
21#define cpu_has_divec 0
22#define cpu_has_cache_cdex_p 1
23#define cpu_has_prefetch 0
24#define cpu_has_mcheck 0
25#define cpu_has_ejtag 0
26
27#define cpu_has_llsc 1
28#define cpu_has_vtag_icache 0 /* Needs to change for R8000 */
29#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
30#define cpu_has_ic_fills_f_dc 0
31
32#define cpu_has_dsp 0
33#define cpu_has_mipsmt 0
34#define cpu_has_userlocal 0
35
36#define cpu_has_nofpuex 0
37#define cpu_has_64bits 1
38
39#define cpu_has_mips32r1 0
40#define cpu_has_mips32r2 0
41#define cpu_has_mips64r1 0
42#define cpu_has_mips64r2 0
43
44#endif /* __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-ip22/ds1286.h b/include/asm-mips/mach-ip22/ds1286.h
deleted file mode 100644
index f19f1eafbc71..000000000000
--- a/include/asm-mips/mach-ip22/ds1286.h
+++ /dev/null
@@ -1,18 +0,0 @@
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 * Copyright (C) 1998, 2001, 03 by Ralf Baechle
7 *
8 * RTC routines for PC style attached Dallas chip.
9 */
10#ifndef __ASM_MACH_IP22_DS1286_H
11#define __ASM_MACH_IP22_DS1286_H
12
13#include <asm/sgi/hpc3.h>
14
15#define rtc_read(reg) (hpc3c0->rtcregs[(reg)] & 0xff)
16#define rtc_write(data, reg) do { hpc3c0->rtcregs[(reg)] = (data); } while(0)
17
18#endif /* __ASM_MACH_IP22_DS1286_H */
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h
deleted file mode 100644
index 7f9fa6f66059..000000000000
--- a/include/asm-mips/mach-ip22/spaces.h
+++ /dev/null
@@ -1,27 +0,0 @@
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 * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_MACH_IP22_SPACES_H
11#define _ASM_MACH_IP22_SPACES_H
12
13
14#ifdef CONFIG_64BIT
15
16#define PAGE_OFFSET 0xffffffff80000000UL
17
18#define CAC_BASE 0xffffffff80000000
19#define IO_BASE 0xffffffffa0000000
20#define UNCAC_BASE 0xffffffffa0000000
21#define MAP_BASE 0xc000000000000000
22
23#endif /* CONFIG_64BIT */
24
25#include <asm/mach-generic/spaces.h>
26
27#endif /* __ASM_MACH_IP22_SPACES_H */
diff --git a/include/asm-mips/mach-ip22/war.h b/include/asm-mips/mach-ip22/war.h
deleted file mode 100644
index a44fa9656a82..000000000000
--- a/include/asm-mips/mach-ip22/war.h
+++ /dev/null
@@ -1,29 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_IP22_WAR_H
9#define __ASM_MIPS_MACH_IP22_WAR_H
10
11/*
12 * R4600 CPU modules for the Indy come with both V1.7 and V2.0 processors.
13 */
14
15#define R4600_V1_INDEX_ICACHEOP_WAR 1
16#define R4600_V1_HIT_CACHEOP_WAR 1
17#define R4600_V2_HIT_CACHEOP_WAR 1
18#define R5432_CP0_INTERRUPT_WAR 0
19#define BCM1250_M3_WAR 0
20#define SIBYTE_1956_WAR 0
21#define MIPS4K_ICACHE_REFILL_WAR 0
22#define MIPS_CACHE_SYNC_WAR 0
23#define TX49XX_ICACHE_INDEX_INV_WAR 0
24#define RM9000_CDEX_SMP_WAR 0
25#define ICACHE_REFILLS_WORKAROUND_WAR 0
26#define R10000_LLSC_WAR 0
27#define MIPS34K_MISSED_ITLB_WAR 0
28
29#endif /* __ASM_MIPS_MACH_IP22_WAR_H */
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
deleted file mode 100644
index 7d3112b148d9..000000000000
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ /dev/null
@@ -1,54 +0,0 @@
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 * Copyright (C) 2003, 07 Ralf Baechle
7 */
8#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
10
11/*
12 * IP27 only comes with R10000 family processors all using the same config
13 */
14#define cpu_has_watch 1
15#define cpu_has_mips16 0
16#define cpu_has_divec 0
17#define cpu_has_vce 0
18#define cpu_has_cache_cdex_p 0
19#define cpu_has_cache_cdex_s 0
20#define cpu_has_prefetch 1
21#define cpu_has_mcheck 0
22#define cpu_has_ejtag 0
23
24#define cpu_has_llsc 1
25#define cpu_has_vtag_icache 0
26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 1
30#define cpu_has_mipsmt 0
31#define cpu_has_userlocal 0
32
33#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1
35
36#define cpu_has_4kex 1
37#define cpu_has_3k_cache 0
38#define cpu_has_6k_cache 0
39#define cpu_has_4k_cache 1
40#define cpu_has_8k_cache 0
41#define cpu_has_tx39_cache 0
42
43#define cpu_has_inclusive_pcaches 1
44
45#define cpu_dcache_line_size() 32
46#define cpu_icache_line_size() 64
47#define cpu_scache_line_size() 128
48
49#define cpu_has_mips32r1 0
50#define cpu_has_mips32r2 0
51#define cpu_has_mips64r1 0
52#define cpu_has_mips64r2 0
53
54#endif /* __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-ip27/dma-coherence.h b/include/asm-mips/mach-ip27/dma-coherence.h
deleted file mode 100644
index ed7e6222dc15..000000000000
--- a/include/asm-mips/mach-ip27/dma-coherence.h
+++ /dev/null
@@ -1,50 +0,0 @@
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 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
7 *
8 */
9#ifndef __ASM_MACH_IP27_DMA_COHERENCE_H
10#define __ASM_MACH_IP27_DMA_COHERENCE_H
11
12#include <asm/pci/bridge.h>
13
14#define pdev_to_baddr(pdev, addr) \
15 (BRIDGE_CONTROLLER(pdev->bus)->baddr + (addr))
16#define dev_to_baddr(dev, addr) \
17 pdev_to_baddr(to_pci_dev(dev), (addr))
18
19struct device;
20
21static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
22 size_t size)
23{
24 dma_addr_t pa = dev_to_baddr(dev, virt_to_phys(addr));
25
26 return pa;
27}
28
29static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
30{
31 dma_addr_t pa = dev_to_baddr(dev, page_to_phys(page));
32
33 return pa;
34}
35
36static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
37{
38 return dma_addr & ~(0xffUL << 56);
39}
40
41static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
42{
43}
44
45static inline int plat_device_is_coherent(struct device *dev)
46{
47 return 1; /* IP27 non-cohernet mode is unsupported */
48}
49
50#endif /* __ASM_MACH_IP27_DMA_COHERENCE_H */
diff --git a/include/asm-mips/mach-ip27/irq.h b/include/asm-mips/mach-ip27/irq.h
deleted file mode 100644
index cf4384bfa846..000000000000
--- a/include/asm-mips/mach-ip27/irq.h
+++ /dev/null
@@ -1,22 +0,0 @@
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 * Copyright (C) 1999, 2000, 01, 02, 03 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 * Copyright (C) 2001 Kanoj Sarcar
9 */
10#ifndef __ASM_MACH_IP27_IRQ_H
11#define __ASM_MACH_IP27_IRQ_H
12
13/*
14 * A hardwired interrupt number is completly stupid for this system - a
15 * large configuration might have thousands if not tenthousands of
16 * interrupts.
17 */
18#define NR_IRQS 256
19
20#include_next <irq.h>
21
22#endif /* __ASM_MACH_IP27_IRQ_H */
diff --git a/include/asm-mips/mach-ip27/kernel-entry-init.h b/include/asm-mips/mach-ip27/kernel-entry-init.h
deleted file mode 100644
index 624d66c7f290..000000000000
--- a/include/asm-mips/mach-ip27/kernel-entry-init.h
+++ /dev/null
@@ -1,59 +0,0 @@
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 * Copyright (C) 2000 Silicon Graphics, Inc.
7 * Copyright (C) 2005 Ralf Baechle <ralf@linux-mips.org>
8 */
9#ifndef __ASM_MACH_IP27_KERNEL_ENTRY_H
10#define __ASM_MACH_IP27_KERNEL_ENTRY_H
11
12#include <asm/sn/addrs.h>
13#include <asm/sn/sn0/hubni.h>
14#include <asm/sn/klkernvars.h>
15
16/*
17 * Returns the local nasid into res.
18 */
19 .macro GET_NASID_ASM res
20 dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
21 ld \res, (\res)
22 and \res, NSRI_NODEID_MASK
23 dsrl \res, NSRI_NODEID_SHFT
24 .endm
25
26/*
27 * Intentionally empty macro, used in head.S. Override in
28 * arch/mips/mach-xxx/kernel-entry-init.h when necessary.
29 */
30 .macro kernel_entry_setup
31 GET_NASID_ASM t1
32 move t2, t1 # text and data are here
33 MAPPED_KERNEL_SETUP_TLB
34 .endm
35
36/*
37 * Do SMP slave processor setup necessary before we can savely execute C code.
38 */
39 .macro smp_slave_setup
40 GET_NASID_ASM t1
41 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
42 KLDIR_OFF_POINTER + CAC_BASE
43 dsll t1, NASID_SHFT
44 or t0, t0, t1
45 ld t0, 0(t0) # t0 points to kern_vars struct
46 lh t1, KV_RO_NASID_OFFSET(t0)
47 lh t2, KV_RW_NASID_OFFSET(t0)
48 MAPPED_KERNEL_SETUP_TLB
49
50 /*
51 * We might not get launched at the address the kernel is linked to,
52 * so we jump there.
53 */
54 PTR_LA t0, 0f
55 jr t0
560:
57 .endm
58
59#endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */
diff --git a/include/asm-mips/mach-ip27/kmalloc.h b/include/asm-mips/mach-ip27/kmalloc.h
deleted file mode 100644
index 426bd049b2d7..000000000000
--- a/include/asm-mips/mach-ip27/kmalloc.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_MACH_IP27_KMALLOC_H
2#define __ASM_MACH_IP27_KMALLOC_H
3
4/*
5 * All happy, no need to define ARCH_KMALLOC_MINALIGN
6 */
7
8#endif /* __ASM_MACH_IP27_KMALLOC_H */
diff --git a/include/asm-mips/mach-ip27/mangle-port.h b/include/asm-mips/mach-ip27/mangle-port.h
deleted file mode 100644
index f6e4912ea062..000000000000
--- a/include/asm-mips/mach-ip27/mangle-port.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2003, 2004 Ralf Baechle
7 */
8#ifndef __ASM_MACH_IP27_MANGLE_PORT_H
9#define __ASM_MACH_IP27_MANGLE_PORT_H
10
11#define __swizzle_addr_b(port) (port)
12#define __swizzle_addr_w(port) ((port) ^ 2)
13#define __swizzle_addr_l(port) (port)
14#define __swizzle_addr_q(port) (port)
15
16# define ioswabb(a, x) (x)
17# define __mem_ioswabb(a, x) (x)
18# define ioswabw(a, x) (x)
19# define __mem_ioswabw(a, x) cpu_to_le16(x)
20# define ioswabl(a, x) (x)
21# define __mem_ioswabl(a, x) cpu_to_le32(x)
22# define ioswabq(a, x) (x)
23# define __mem_ioswabq(a, x) cpu_to_le32(x)
24
25#endif /* __ASM_MACH_IP27_MANGLE_PORT_H */
diff --git a/include/asm-mips/mach-ip27/mmzone.h b/include/asm-mips/mach-ip27/mmzone.h
deleted file mode 100644
index 986a3b9b59a7..000000000000
--- a/include/asm-mips/mach-ip27/mmzone.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef _ASM_MACH_MMZONE_H
2#define _ASM_MACH_MMZONE_H
3
4#include <asm/sn/addrs.h>
5#include <asm/sn/arch.h>
6#include <asm/sn/hub.h>
7
8#define pa_to_nid(addr) NASID_TO_COMPACT_NODEID(NASID_GET(addr))
9
10#define LEVELS_PER_SLICE 128
11
12struct slice_data {
13 unsigned long irq_enable_mask[2];
14 int level_to_irq[LEVELS_PER_SLICE];
15};
16
17struct hub_data {
18 kern_vars_t kern_vars;
19 DECLARE_BITMAP(h_bigwin_used, HUB_NUM_BIG_WINDOW);
20 cpumask_t h_cpus;
21 unsigned long slice_map;
22 unsigned long irq_alloc_mask[2];
23 struct slice_data slice[2];
24};
25
26struct node_data {
27 struct pglist_data pglist;
28 struct hub_data hub;
29};
30
31extern struct node_data *__node_data[];
32
33#define NODE_DATA(n) (&__node_data[(n)]->pglist)
34#define hub_data(n) (&__node_data[(n)]->hub)
35
36#endif /* _ASM_MACH_MMZONE_H */
diff --git a/include/asm-mips/mach-ip27/spaces.h b/include/asm-mips/mach-ip27/spaces.h
deleted file mode 100644
index b18802a0b17e..000000000000
--- a/include/asm-mips/mach-ip27/spaces.h
+++ /dev/null
@@ -1,30 +0,0 @@
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 * Copyright (C) 1996, 99 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999 by Silicon Graphics, Inc.
9 */
10#ifndef _ASM_MACH_IP27_SPACES_H
11#define _ASM_MACH_IP27_SPACES_H
12
13/*
14 * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects
15 * uncached memory addressing.
16 */
17
18#define HSPEC_BASE 0x9000000000000000
19#define IO_BASE 0x9200000000000000
20#define MSPEC_BASE 0x9400000000000000
21#define UNCAC_BASE 0x9600000000000000
22
23#define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK))
24#define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK))
25
26#define HIGHMEM_START (~0UL)
27
28#include <asm/mach-generic/spaces.h>
29
30#endif /* _ASM_MACH_IP27_SPACES_H */
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h
deleted file mode 100644
index 7785bec732f2..000000000000
--- a/include/asm-mips/mach-ip27/topology.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef _ASM_MACH_TOPOLOGY_H
2#define _ASM_MACH_TOPOLOGY_H 1
3
4#include <asm/sn/hub.h>
5#include <asm/sn/types.h>
6#include <asm/mmzone.h>
7
8struct cpuinfo_ip27 {
9// cpuid_t p_cpuid; /* PROM assigned cpuid */
10 cnodeid_t p_nodeid; /* my node ID in compact-id-space */
11 nasid_t p_nasid; /* my node ID in numa-as-id-space */
12 unsigned char p_slice; /* Physical position on node board */
13#if 0
14 unsigned long loops_per_sec;
15 unsigned long ipi_count;
16 unsigned long irq_attempt[NR_IRQS];
17 unsigned long smp_local_irq_count;
18 unsigned long prof_multiplier;
19 unsigned long prof_counter;
20#endif
21};
22
23extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
24
25#define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid)
26#define parent_node(node) (node)
27#define node_to_cpumask(node) (hub_data(node)->h_cpus)
28#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))
29struct pci_bus;
30extern int pcibus_to_node(struct pci_bus *);
31
32#define pcibus_to_cpumask(bus) (cpu_online_map)
33
34extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
35
36#define node_distance(from, to) (__node_distances[(from)][(to)])
37
38/* sched_domains SD_NODE_INIT for SGI IP27 machines */
39#define SD_NODE_INIT (struct sched_domain) { \
40 .span = CPU_MASK_NONE, \
41 .parent = NULL, \
42 .child = NULL, \
43 .groups = NULL, \
44 .min_interval = 8, \
45 .max_interval = 32, \
46 .busy_factor = 32, \
47 .imbalance_pct = 125, \
48 .cache_nice_tries = 1, \
49 .flags = SD_LOAD_BALANCE \
50 | SD_BALANCE_EXEC \
51 | SD_WAKE_BALANCE, \
52 .last_balance = jiffies, \
53 .balance_interval = 1, \
54 .nr_balance_failed = 0, \
55}
56
57#include <asm-generic/topology.h>
58
59#endif /* _ASM_MACH_TOPOLOGY_H */
diff --git a/include/asm-mips/mach-ip27/war.h b/include/asm-mips/mach-ip27/war.h
deleted file mode 100644
index e2ddcc9b1fff..000000000000
--- a/include/asm-mips/mach-ip27/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_IP27_WAR_H
9#define __ASM_MIPS_MACH_IP27_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 1
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_IP27_WAR_H */
diff --git a/include/asm-mips/mach-ip28/cpu-feature-overrides.h b/include/asm-mips/mach-ip28/cpu-feature-overrides.h
deleted file mode 100644
index 9a53b326f848..000000000000
--- a/include/asm-mips/mach-ip28/cpu-feature-overrides.h
+++ /dev/null
@@ -1,50 +0,0 @@
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 * Copyright (C) 2003 Ralf Baechle
7 * 6/2004 pf
8 */
9#ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
11
12/*
13 * IP28 only comes with R10000 family processors all using the same config
14 */
15#define cpu_has_watch 1
16#define cpu_has_mips16 0
17#define cpu_has_divec 0
18#define cpu_has_vce 0
19#define cpu_has_cache_cdex_p 0
20#define cpu_has_cache_cdex_s 0
21#define cpu_has_prefetch 1
22#define cpu_has_mcheck 0
23#define cpu_has_ejtag 0
24
25#define cpu_has_llsc 1
26#define cpu_has_vtag_icache 0
27#define cpu_has_dc_aliases 0 /* see probe_pcache() */
28#define cpu_has_ic_fills_f_dc 0
29#define cpu_has_dsp 0
30#define cpu_icache_snoops_remote_store 1
31#define cpu_has_mipsmt 0
32#define cpu_has_userlocal 0
33
34#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1
36
37#define cpu_has_4kex 1
38#define cpu_has_4k_cache 1
39
40#define cpu_has_inclusive_pcaches 1
41
42#define cpu_dcache_line_size() 32
43#define cpu_icache_line_size() 64
44
45#define cpu_has_mips32r1 0
46#define cpu_has_mips32r2 0
47#define cpu_has_mips64r1 0
48#define cpu_has_mips64r2 0
49
50#endif /* __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-ip28/ds1286.h b/include/asm-mips/mach-ip28/ds1286.h
deleted file mode 100644
index 471bb9a33e0f..000000000000
--- a/include/asm-mips/mach-ip28/ds1286.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __ASM_MACH_IP28_DS1286_H
2#define __ASM_MACH_IP28_DS1286_H
3#include <asm/mach-ip22/ds1286.h>
4#endif /* __ASM_MACH_IP28_DS1286_H */
diff --git a/include/asm-mips/mach-ip28/spaces.h b/include/asm-mips/mach-ip28/spaces.h
deleted file mode 100644
index 05aabb27e5e7..000000000000
--- a/include/asm-mips/mach-ip28/spaces.h
+++ /dev/null
@@ -1,22 +0,0 @@
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 * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 * 2004 pf
10 */
11#ifndef _ASM_MACH_IP28_SPACES_H
12#define _ASM_MACH_IP28_SPACES_H
13
14#define CAC_BASE 0xa800000000000000
15
16#define HIGHMEM_START (~0UL)
17
18#define PHYS_OFFSET _AC(0x20000000, UL)
19
20#include <asm/mach-generic/spaces.h>
21
22#endif /* _ASM_MACH_IP28_SPACES_H */
diff --git a/include/asm-mips/mach-ip28/war.h b/include/asm-mips/mach-ip28/war.h
deleted file mode 100644
index a1baafab486a..000000000000
--- a/include/asm-mips/mach-ip28/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_IP28_WAR_H
9#define __ASM_MIPS_MACH_IP28_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 1
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_IP28_WAR_H */
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
deleted file mode 100644
index 6782fccebe8d..000000000000
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ /dev/null
@@ -1,50 +0,0 @@
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 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh
7 * Copyright (C) 2005, 07 Ralf Baechle (ralf@linux-mips.org)
8 */
9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
11
12
13/*
14 * R5000 has an interesting "restriction": ll(d)/sc(d)
15 * instructions to XKPHYS region simply do uncached bus
16 * requests. This breaks all the atomic bitops functions.
17 * so, for 64bit IP32 kernel we just don't use ll/sc.
18 * This does not affect luserland.
19 */
20#if (defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_NEVADA)) && defined(CONFIG_64BIT)
21#define cpu_has_llsc 0
22#else
23#define cpu_has_llsc 1
24#endif
25
26/* Settings which are common for all ip32 CPUs */
27#define cpu_has_tlb 1
28#define cpu_has_4kex 1
29#define cpu_has_fpu 1
30#define cpu_has_32fpr 1
31#define cpu_has_counter 1
32#define cpu_has_mips16 0
33#define cpu_has_vce 0
34#define cpu_has_cache_cdex_s 0
35#define cpu_has_mcheck 0
36#define cpu_has_ejtag 0
37#define cpu_has_vtag_icache 0
38#define cpu_has_ic_fills_f_dc 0
39#define cpu_has_dsp 0
40#define cpu_has_4k_cache 1
41#define cpu_has_mipsmt 0
42#define cpu_has_userlocal 0
43
44
45#define cpu_has_mips32r1 0
46#define cpu_has_mips32r2 0
47#define cpu_has_mips64r1 0
48#define cpu_has_mips64r2 0
49
50#endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-ip32/dma-coherence.h b/include/asm-mips/mach-ip32/dma-coherence.h
deleted file mode 100644
index a5511ebb2d53..000000000000
--- a/include/asm-mips/mach-ip32/dma-coherence.h
+++ /dev/null
@@ -1,72 +0,0 @@
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 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
7 *
8 */
9#ifndef __ASM_MACH_IP32_DMA_COHERENCE_H
10#define __ASM_MACH_IP32_DMA_COHERENCE_H
11
12#include <asm/ip32/crime.h>
13
14struct device;
15
16/*
17 * Few notes.
18 * 1. CPU sees memory as two chunks: 0-256M@0x0, and the rest @0x40000000+256M
19 * 2. PCI sees memory as one big chunk @0x0 (or we could use 0x40000000 for
20 * native-endian)
21 * 3. All other devices see memory as one big chunk at 0x40000000
22 * 4. Non-PCI devices will pass NULL as struct device*
23 *
24 * Thus we translate differently, depending on device.
25 */
26
27#define RAM_OFFSET_MASK 0x3fffffffUL
28
29static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
30 size_t size)
31{
32 dma_addr_t pa = virt_to_phys(addr) & RAM_OFFSET_MASK;
33
34 if (dev == NULL)
35 pa += CRIME_HI_MEM_BASE;
36
37 return pa;
38}
39
40static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
41{
42 dma_addr_t pa;
43
44 pa = page_to_phys(page) & RAM_OFFSET_MASK;
45
46 if (dev == NULL)
47 pa += CRIME_HI_MEM_BASE;
48
49 return pa;
50}
51
52/* This is almost certainly wrong but it's what dma-ip32.c used to use */
53static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
54{
55 unsigned long addr = dma_addr & RAM_OFFSET_MASK;
56
57 if (dma_addr >= 256*1024*1024)
58 addr += CRIME_HI_MEM_BASE;
59
60 return addr;
61}
62
63static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
64{
65}
66
67static inline int plat_device_is_coherent(struct device *dev)
68{
69 return 0; /* IP32 is non-cohernet */
70}
71
72#endif /* __ASM_MACH_IP32_DMA_COHERENCE_H */
diff --git a/include/asm-mips/mach-ip32/kmalloc.h b/include/asm-mips/mach-ip32/kmalloc.h
deleted file mode 100644
index b1e0be60f720..000000000000
--- a/include/asm-mips/mach-ip32/kmalloc.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef __ASM_MACH_IP32_KMALLOC_H
2#define __ASM_MACH_IP32_KMALLOC_H
3
4
5#if defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_RM7000)
6#define ARCH_KMALLOC_MINALIGN 32
7#else
8#define ARCH_KMALLOC_MINALIGN 128
9#endif
10
11#endif /* __ASM_MACH_IP32_KMALLOC_H */
diff --git a/include/asm-mips/mach-ip32/mangle-port.h b/include/asm-mips/mach-ip32/mangle-port.h
deleted file mode 100644
index f1d0f1756a9f..000000000000
--- a/include/asm-mips/mach-ip32/mangle-port.h
+++ /dev/null
@@ -1,26 +0,0 @@
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 * Copyright (C) 2003 Ladislav Michl
7 * Copyright (C) 2004 Ralf Baechle
8 */
9#ifndef __ASM_MACH_IP32_MANGLE_PORT_H
10#define __ASM_MACH_IP32_MANGLE_PORT_H
11
12#define __swizzle_addr_b(port) ((port) ^ 3)
13#define __swizzle_addr_w(port) ((port) ^ 2)
14#define __swizzle_addr_l(port) (port)
15#define __swizzle_addr_q(port) (port)
16
17# define ioswabb(a, x) (x)
18# define __mem_ioswabb(a, x) (x)
19# define ioswabw(a, x) (x)
20# define __mem_ioswabw(a, x) cpu_to_le16(x)
21# define ioswabl(a, x) (x)
22# define __mem_ioswabl(a, x) cpu_to_le32(x)
23# define ioswabq(a, x) (x)
24# define __mem_ioswabq(a, x) cpu_to_le32(x)
25
26#endif /* __ASM_MACH_IP32_MANGLE_PORT_H */
diff --git a/include/asm-mips/mach-ip32/mc146818rtc.h b/include/asm-mips/mach-ip32/mc146818rtc.h
deleted file mode 100644
index c28ba8d84076..000000000000
--- a/include/asm-mips/mach-ip32/mc146818rtc.h
+++ /dev/null
@@ -1,36 +0,0 @@
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 * Copyright (C) 1998, 2001, 03 by Ralf Baechle
7 * Copyright (C) 2000 Harald Koerfgen
8 *
9 * RTC routines for IP32 style attached Dallas chip.
10 */
11#ifndef __ASM_MACH_IP32_MC146818RTC_H
12#define __ASM_MACH_IP32_MC146818RTC_H
13
14#include <asm/ip32/mace.h>
15
16#define RTC_PORT(x) (0x70 + (x))
17
18static unsigned char CMOS_READ(unsigned long addr)
19{
20 return mace->isa.rtc[addr << 8];
21}
22
23static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
24{
25 mace->isa.rtc[addr << 8] = data;
26}
27
28/*
29 * FIXME: Do it right. For now just assume that noone lives in 20th century
30 * and no O2 user in 22th century ;-)
31 */
32#define mc146818_decode_year(year) ((year) + 2000)
33
34#define RTC_ALWAYS_BCD 0
35
36#endif /* __ASM_MACH_IP32_MC146818RTC_H */
diff --git a/include/asm-mips/mach-ip32/war.h b/include/asm-mips/mach-ip32/war.h
deleted file mode 100644
index d194056dcd7a..000000000000
--- a/include/asm-mips/mach-ip32/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_IP32_WAR_H
9#define __ASM_MIPS_MACH_IP32_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 1
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_IP32_WAR_H */
diff --git a/include/asm-mips/mach-jazz/dma-coherence.h b/include/asm-mips/mach-jazz/dma-coherence.h
deleted file mode 100644
index d66979a124a8..000000000000
--- a/include/asm-mips/mach-jazz/dma-coherence.h
+++ /dev/null
@@ -1,40 +0,0 @@
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 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MACH_JAZZ_DMA_COHERENCE_H
9#define __ASM_MACH_JAZZ_DMA_COHERENCE_H
10
11#include <asm/jazzdma.h>
12
13struct device;
14
15static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size)
16{
17 return vdma_alloc(virt_to_phys(addr), size);
18}
19
20static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
21{
22 return vdma_alloc(page_to_phys(page), PAGE_SIZE);
23}
24
25static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
26{
27 return vdma_log2phys(dma_addr);
28}
29
30static void plat_unmap_dma_mem(dma_addr_t dma_addr)
31{
32 vdma_free(dma_addr);
33}
34
35static inline int plat_device_is_coherent(struct device *dev)
36{
37 return 0;
38}
39
40#endif /* __ASM_MACH_JAZZ_DMA_COHERENCE_H */
diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h
deleted file mode 100644
index 56e9ca6ae426..000000000000
--- a/include/asm-mips/mach-jazz/floppy.h
+++ /dev/null
@@ -1,135 +0,0 @@
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 * Copyright (C) 1998, 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_JAZZ_FLOPPY_H
9#define __ASM_MACH_JAZZ_FLOPPY_H
10
11#include <linux/delay.h>
12#include <linux/init.h>
13#include <linux/linkage.h>
14#include <linux/types.h>
15#include <linux/mm.h>
16#include <asm/addrspace.h>
17#include <asm/jazz.h>
18#include <asm/jazzdma.h>
19#include <asm/pgtable.h>
20
21static inline unsigned char fd_inb(unsigned int port)
22{
23 unsigned char c;
24
25 c = *(volatile unsigned char *) port;
26 udelay(1);
27
28 return c;
29}
30
31static inline void fd_outb(unsigned char value, unsigned int port)
32{
33 *(volatile unsigned char *) port = value;
34}
35
36/*
37 * How to access the floppy DMA functions.
38 */
39static inline void fd_enable_dma(void)
40{
41 vdma_enable(JAZZ_FLOPPY_DMA);
42}
43
44static inline void fd_disable_dma(void)
45{
46 vdma_disable(JAZZ_FLOPPY_DMA);
47}
48
49static inline int fd_request_dma(void)
50{
51 return 0;
52}
53
54static inline void fd_free_dma(void)
55{
56}
57
58static inline void fd_clear_dma_ff(void)
59{
60}
61
62static inline void fd_set_dma_mode(char mode)
63{
64 vdma_set_mode(JAZZ_FLOPPY_DMA, mode);
65}
66
67static inline void fd_set_dma_addr(char *a)
68{
69 vdma_set_addr(JAZZ_FLOPPY_DMA, vdma_phys2log(CPHYSADDR((unsigned long)a)));
70}
71
72static inline void fd_set_dma_count(unsigned int count)
73{
74 vdma_set_count(JAZZ_FLOPPY_DMA, count);
75}
76
77static inline int fd_get_dma_residue(void)
78{
79 return vdma_get_residue(JAZZ_FLOPPY_DMA);
80}
81
82static inline void fd_enable_irq(void)
83{
84}
85
86static inline void fd_disable_irq(void)
87{
88}
89
90static inline int fd_request_irq(void)
91{
92 return request_irq(FLOPPY_IRQ, floppy_interrupt,
93 IRQF_DISABLED, "floppy", NULL);
94}
95
96static inline void fd_free_irq(void)
97{
98 free_irq(FLOPPY_IRQ, NULL);
99}
100
101static inline unsigned long fd_getfdaddr1(void)
102{
103 return JAZZ_FDC_BASE;
104}
105
106static inline unsigned long fd_dma_mem_alloc(unsigned long size)
107{
108 unsigned long mem;
109
110 mem = __get_dma_pages(GFP_KERNEL, get_order(size));
111 if(!mem)
112 return 0;
113 vdma_alloc(CPHYSADDR(mem), size); /* XXX error checking */
114
115 return mem;
116}
117
118static inline void fd_dma_mem_free(unsigned long addr, unsigned long size)
119{
120 vdma_free(vdma_phys2log(CPHYSADDR(addr)));
121 free_pages(addr, get_order(size));
122}
123
124static inline unsigned long fd_drive_type(unsigned long n)
125{
126 /* XXX This is wrong for machines with ED 2.88mb disk drives like the
127 Olivetti M700. Anyway, we should suck this from the ARC
128 firmware. */
129 if (n == 0)
130 return 4; /* 3,5", 1.44mb */
131
132 return 0;
133}
134
135#endif /* __ASM_MACH_JAZZ_FLOPPY_H */
diff --git a/include/asm-mips/mach-jazz/mc146818rtc.h b/include/asm-mips/mach-jazz/mc146818rtc.h
deleted file mode 100644
index 987f727afe25..000000000000
--- a/include/asm-mips/mach-jazz/mc146818rtc.h
+++ /dev/null
@@ -1,38 +0,0 @@
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 * Copyright (C) 1998, 2001, 03 by Ralf Baechle
7 * Copyright (C) 2007 Thomas Bogendoerfer
8 *
9 * RTC routines for Jazz style attached Dallas chip.
10 */
11#ifndef __ASM_MACH_JAZZ_MC146818RTC_H
12#define __ASM_MACH_JAZZ_MC146818RTC_H
13
14#include <linux/delay.h>
15
16#include <asm/io.h>
17#include <asm/jazz.h>
18
19#define RTC_PORT(x) (0x70 + (x))
20#define RTC_IRQ 8
21
22static inline unsigned char CMOS_READ(unsigned long addr)
23{
24 outb_p(addr, RTC_PORT(0));
25 return *(volatile char *)JAZZ_RTC_BASE;
26}
27
28static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
29{
30 outb_p(addr, RTC_PORT(0));
31 *(volatile char *)JAZZ_RTC_BASE = data;
32}
33
34#define RTC_ALWAYS_BCD 0
35
36#define mc146818_decode_year(year) ((year) + 1980)
37
38#endif /* __ASM_MACH_JAZZ_MC146818RTC_H */
diff --git a/include/asm-mips/mach-jazz/war.h b/include/asm-mips/mach-jazz/war.h
deleted file mode 100644
index 6158ee861bfd..000000000000
--- a/include/asm-mips/mach-jazz/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_JAZZ_WAR_H
9#define __ASM_MIPS_MACH_JAZZ_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_JAZZ_WAR_H */
diff --git a/include/asm-mips/mach-lasat/irq.h b/include/asm-mips/mach-lasat/irq.h
deleted file mode 100644
index 3a282419d5f9..000000000000
--- a/include/asm-mips/mach-lasat/irq.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _ASM_MACH_LASAT_IRQ_H
2#define _ASM_MACH_LASAT_IRQ_H
3
4#define LASAT_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 2)
5
6#define LASAT_IRQ_BASE 8
7#define LASAT_IRQ_END 23
8
9#define NR_IRQS 24
10
11#include_next <irq.h>
12
13#endif /* _ASM_MACH_LASAT_IRQ_H */
diff --git a/include/asm-mips/mach-lasat/mach-gt64120.h b/include/asm-mips/mach-lasat/mach-gt64120.h
deleted file mode 100644
index 1a9ad45cc135..000000000000
--- a/include/asm-mips/mach-lasat/mach-gt64120.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * This is a direct copy of the ev96100.h file, with a global
3 * search and replace. The numbers are the same.
4 *
5 * The reason I'm duplicating this is so that the 64120/96100
6 * defines won't be confusing in the source code.
7 */
8#ifndef _ASM_GT64120_LASAT_GT64120_DEP_H
9#define _ASM_GT64120_LASAT_GT64120_DEP_H
10
11/*
12 * GT64120 config space base address on Lasat 100
13 */
14#define GT64120_BASE (KSEG1ADDR(0x14000000))
15
16/*
17 * PCI Bus allocation
18 *
19 * (Guessing ...)
20 */
21#define GT_PCI_MEM_BASE 0x12000000UL
22#define GT_PCI_MEM_SIZE 0x02000000UL
23#define GT_PCI_IO_BASE 0x10000000UL
24#define GT_PCI_IO_SIZE 0x02000000UL
25#define GT_ISA_IO_BASE PCI_IO_BASE
26
27#endif /* _ASM_GT64120_LASAT_GT64120_DEP_H */
diff --git a/include/asm-mips/mach-lasat/war.h b/include/asm-mips/mach-lasat/war.h
deleted file mode 100644
index bb1e0325c9be..000000000000
--- a/include/asm-mips/mach-lasat/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_LASAT_WAR_H
9#define __ASM_MIPS_MACH_LASAT_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_LASAT_WAR_H */
diff --git a/include/asm-mips/mach-lemote/dma-coherence.h b/include/asm-mips/mach-lemote/dma-coherence.h
deleted file mode 100644
index 7e914777ebc4..000000000000
--- a/include/asm-mips/mach-lemote/dma-coherence.h
+++ /dev/null
@@ -1,42 +0,0 @@
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 * Copyright (C) 2006, 07 Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 *
10 */
11#ifndef __ASM_MACH_LEMOTE_DMA_COHERENCE_H
12#define __ASM_MACH_LEMOTE_DMA_COHERENCE_H
13
14struct device;
15
16static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
17 size_t size)
18{
19 return virt_to_phys(addr) | 0x80000000;
20}
21
22static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
23 struct page *page)
24{
25 return page_to_phys(page) | 0x80000000;
26}
27
28static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
29{
30 return dma_addr & 0x7fffffff;
31}
32
33static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
34{
35}
36
37static inline int plat_device_is_coherent(struct device *dev)
38{
39 return 0;
40}
41
42#endif /* __ASM_MACH_LEMOTE_DMA_COHERENCE_H */
diff --git a/include/asm-mips/mach-lemote/mc146818rtc.h b/include/asm-mips/mach-lemote/mc146818rtc.h
deleted file mode 100644
index ed5147e11085..000000000000
--- a/include/asm-mips/mach-lemote/mc146818rtc.h
+++ /dev/null
@@ -1,36 +0,0 @@
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 * Copyright (C) 1998, 2001, 03, 07 by Ralf Baechle (ralf@linux-mips.org)
7 *
8 * RTC routines for PC style attached Dallas chip.
9 */
10#ifndef __ASM_MACH_LEMOTE_MC146818RTC_H
11#define __ASM_MACH_LEMOTE_MC146818RTC_H
12
13#include <linux/io.h>
14
15#define RTC_PORT(x) (0x70 + (x))
16#define RTC_IRQ 8
17
18static inline unsigned char CMOS_READ(unsigned long addr)
19{
20 outb_p(addr, RTC_PORT(0));
21 return inb_p(RTC_PORT(1));
22}
23
24static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
25{
26 outb_p(addr, RTC_PORT(0));
27 outb_p(data, RTC_PORT(1));
28}
29
30#define RTC_ALWAYS_BCD 0
31
32#ifndef mc146818_decode_year
33#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970)
34#endif
35
36#endif /* __ASM_MACH_LEMOTE_MC146818RTC_H */
diff --git a/include/asm-mips/mach-lemote/war.h b/include/asm-mips/mach-lemote/war.h
deleted file mode 100644
index 05f89e0f2a11..000000000000
--- a/include/asm-mips/mach-lemote/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_LEMOTE_WAR_H
9#define __ASM_MIPS_MACH_LEMOTE_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_LEMOTE_WAR_H */
diff --git a/include/asm-mips/mach-malta/cpu-feature-overrides.h b/include/asm-mips/mach-malta/cpu-feature-overrides.h
deleted file mode 100644
index 7f3e3f9bd23a..000000000000
--- a/include/asm-mips/mach-malta/cpu-feature-overrides.h
+++ /dev/null
@@ -1,72 +0,0 @@
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 * Copyright (C) 2003, 2004 Chris Dearman
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
8 */
9#ifndef __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H
11
12
13/*
14 * CPU feature overrides for MIPS boards
15 */
16#ifdef CONFIG_CPU_MIPS32
17#define cpu_has_tlb 1
18#define cpu_has_4kex 1
19#define cpu_has_4k_cache 1
20/* #define cpu_has_fpu ? */
21/* #define cpu_has_32fpr ? */
22#define cpu_has_counter 1
23/* #define cpu_has_watch ? */
24#define cpu_has_divec 1
25#define cpu_has_vce 0
26/* #define cpu_has_cache_cdex_p ? */
27/* #define cpu_has_cache_cdex_s ? */
28/* #define cpu_has_prefetch ? */
29#define cpu_has_mcheck 1
30/* #define cpu_has_ejtag ? */
31#ifdef CONFIG_CPU_HAS_LLSC
32#define cpu_has_llsc 1
33#else
34#define cpu_has_llsc 0
35#endif
36/* #define cpu_has_vtag_icache ? */
37/* #define cpu_has_dc_aliases ? */
38/* #define cpu_has_ic_fills_f_dc ? */
39#define cpu_has_nofpuex 0
40/* #define cpu_has_64bits ? */
41/* #define cpu_has_64bit_zero_reg ? */
42/* #define cpu_has_inclusive_pcaches ? */
43#define cpu_icache_snoops_remote_store 1
44#endif
45
46#ifdef CONFIG_CPU_MIPS64
47#define cpu_has_tlb 1
48#define cpu_has_4kex 1
49#define cpu_has_4k_cache 1
50/* #define cpu_has_fpu ? */
51/* #define cpu_has_32fpr ? */
52#define cpu_has_counter 1
53/* #define cpu_has_watch ? */
54#define cpu_has_divec 1
55#define cpu_has_vce 0
56/* #define cpu_has_cache_cdex_p ? */
57/* #define cpu_has_cache_cdex_s ? */
58/* #define cpu_has_prefetch ? */
59#define cpu_has_mcheck 1
60/* #define cpu_has_ejtag ? */
61#define cpu_has_llsc 1
62/* #define cpu_has_vtag_icache ? */
63/* #define cpu_has_dc_aliases ? */
64/* #define cpu_has_ic_fills_f_dc ? */
65#define cpu_has_nofpuex 0
66/* #define cpu_has_64bits ? */
67/* #define cpu_has_64bit_zero_reg ? */
68/* #define cpu_has_inclusive_pcaches ? */
69#define cpu_icache_snoops_remote_store 1
70#endif
71
72#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-malta/irq.h b/include/asm-mips/mach-malta/irq.h
deleted file mode 100644
index 9b9da26683c2..000000000000
--- a/include/asm-mips/mach-malta/irq.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __ASM_MACH_MIPS_IRQ_H
2#define __ASM_MACH_MIPS_IRQ_H
3
4
5#define NR_IRQS 256
6
7#include_next <irq.h>
8
9#endif /* __ASM_MACH_MIPS_IRQ_H */
diff --git a/include/asm-mips/mach-malta/kernel-entry-init.h b/include/asm-mips/mach-malta/kernel-entry-init.h
deleted file mode 100644
index 0b793e7bf67e..000000000000
--- a/include/asm-mips/mach-malta/kernel-entry-init.h
+++ /dev/null
@@ -1,52 +0,0 @@
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 * Chris Dearman (chris@mips.com)
7 * Copyright (C) 2007 Mips Technologies, Inc.
8 */
9#ifndef __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H
10#define __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H
11
12 .macro kernel_entry_setup
13#ifdef CONFIG_MIPS_MT_SMTC
14 mfc0 t0, CP0_CONFIG
15 bgez t0, 9f
16 mfc0 t0, CP0_CONFIG, 1
17 bgez t0, 9f
18 mfc0 t0, CP0_CONFIG, 2
19 bgez t0, 9f
20 mfc0 t0, CP0_CONFIG, 3
21 and t0, 1<<2
22 bnez t0, 0f
239:
24 /* Assume we came from YAMON... */
25 PTR_LA v0, 0x9fc00534 /* YAMON print */
26 lw v0, (v0)
27 move a0, zero
28 PTR_LA a1, nonmt_processor
29 jal v0
30
31 PTR_LA v0, 0x9fc00520 /* YAMON exit */
32 lw v0, (v0)
33 li a0, 1
34 jal v0
35
361: b 1b
37
38 __INITDATA
39nonmt_processor:
40 .asciz "SMTC kernel requires the MT ASE to run\n"
41 __FINIT
420:
43#endif
44 .endm
45
46/*
47 * Do SMP slave processor setup necessary before we can safely execute C code.
48 */
49 .macro smp_slave_setup
50 .endm
51
52#endif /* __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H */
diff --git a/include/asm-mips/mach-malta/mach-gt64120.h b/include/asm-mips/mach-malta/mach-gt64120.h
deleted file mode 100644
index 0f863148f3b6..000000000000
--- a/include/asm-mips/mach-malta/mach-gt64120.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * This is a direct copy of the ev96100.h file, with a global
3 * search and replace. The numbers are the same.
4 *
5 * The reason I'm duplicating this is so that the 64120/96100
6 * defines won't be confusing in the source code.
7 */
8#ifndef _ASM_MACH_MIPS_MACH_GT64120_DEP_H
9#define _ASM_MACH_MIPS_MACH_GT64120_DEP_H
10
11#define MIPS_GT_BASE 0x1be00000
12
13extern unsigned long _pcictrl_gt64120;
14/*
15 * GT64120 config space base address
16 */
17#define GT64120_BASE _pcictrl_gt64120
18
19#endif /* _ASM_MACH_MIPS_MACH_GT64120_DEP_H */
diff --git a/include/asm-mips/mach-malta/mc146818rtc.h b/include/asm-mips/mach-malta/mc146818rtc.h
deleted file mode 100644
index ea612f37f614..000000000000
--- a/include/asm-mips/mach-malta/mc146818rtc.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 * Copyright (C) 2003 by Ralf Baechle
5 *
6 * This program is free software; you can distribute it and/or modify it
7 * under the terms of the GNU General Public License (Version 2) as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 *
19 * RTC routines for Malta style attached PIIX4 device, which contains a
20 * Motorola MC146818A-compatible Real Time Clock.
21 */
22#ifndef __ASM_MACH_MALTA_MC146818RTC_H
23#define __ASM_MACH_MALTA_MC146818RTC_H
24
25#include <asm/io.h>
26#include <asm/mips-boards/generic.h>
27#include <asm/mips-boards/malta.h>
28
29#define RTC_PORT(x) (0x70 + (x))
30#define RTC_IRQ 8
31
32static inline unsigned char CMOS_READ(unsigned long addr)
33{
34 outb(addr, MALTA_RTC_ADR_REG);
35 return inb(MALTA_RTC_DAT_REG);
36}
37
38static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
39{
40 outb(addr, MALTA_RTC_ADR_REG);
41 outb(data, MALTA_RTC_DAT_REG);
42}
43
44#define RTC_ALWAYS_BCD 0
45
46#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
47
48#endif /* __ASM_MACH_MALTA_MC146818RTC_H */
diff --git a/include/asm-mips/mach-malta/war.h b/include/asm-mips/mach-malta/war.h
deleted file mode 100644
index 7c6931d5f45f..000000000000
--- a/include/asm-mips/mach-malta/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_MIPS_WAR_H
9#define __ASM_MIPS_MACH_MIPS_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 1
18#define MIPS_CACHE_SYNC_WAR 1
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 1
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_MIPS_WAR_H */
diff --git a/include/asm-mips/mach-mipssim/cpu-feature-overrides.h b/include/asm-mips/mach-mipssim/cpu-feature-overrides.h
deleted file mode 100644
index 779b02205737..000000000000
--- a/include/asm-mips/mach-mipssim/cpu-feature-overrides.h
+++ /dev/null
@@ -1,65 +0,0 @@
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 * Copyright (C) 2003, 2004 Chris Dearman
7 */
8#ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
10
11
12/*
13 * CPU feature overrides for MIPS boards
14 */
15#ifdef CONFIG_CPU_MIPS32
16#define cpu_has_tlb 1
17#define cpu_has_4kex 1
18#define cpu_has_4k_cache 1
19#define cpu_has_fpu 0
20/* #define cpu_has_32fpr ? */
21#define cpu_has_counter 1
22/* #define cpu_has_watch ? */
23#define cpu_has_divec 1
24#define cpu_has_vce 0
25/* #define cpu_has_cache_cdex_p ? */
26/* #define cpu_has_cache_cdex_s ? */
27/* #define cpu_has_prefetch ? */
28#define cpu_has_mcheck 1
29/* #define cpu_has_ejtag ? */
30#define cpu_has_llsc 1
31/* #define cpu_has_vtag_icache ? */
32/* #define cpu_has_dc_aliases ? */
33/* #define cpu_has_ic_fills_f_dc ? */
34#define cpu_has_nofpuex 0
35/* #define cpu_has_64bits ? */
36/* #define cpu_has_64bit_zero_reg ? */
37/* #define cpu_has_inclusive_pcaches ? */
38#endif
39
40#ifdef CONFIG_CPU_MIPS64
41#define cpu_has_tlb 1
42#define cpu_has_4kex 1
43#define cpu_has_4k_cache 1
44/* #define cpu_has_fpu ? */
45/* #define cpu_has_32fpr ? */
46#define cpu_has_counter 1
47/* #define cpu_has_watch ? */
48#define cpu_has_divec 1
49#define cpu_has_vce 0
50/* #define cpu_has_cache_cdex_p ? */
51/* #define cpu_has_cache_cdex_s ? */
52/* #define cpu_has_prefetch ? */
53#define cpu_has_mcheck 1
54/* #define cpu_has_ejtag ? */
55#define cpu_has_llsc 1
56/* #define cpu_has_vtag_icache ? */
57/* #define cpu_has_dc_aliases ? */
58/* #define cpu_has_ic_fills_f_dc ? */
59#define cpu_has_nofpuex 0
60/* #define cpu_has_64bits ? */
61/* #define cpu_has_64bit_zero_reg ? */
62/* #define cpu_has_inclusive_pcaches ? */
63#endif
64
65#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-mipssim/war.h b/include/asm-mips/mach-mipssim/war.h
deleted file mode 100644
index c8a74a3515e0..000000000000
--- a/include/asm-mips/mach-mipssim/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_MIPSSIM_WAR_H
9#define __ASM_MIPS_MACH_MIPSSIM_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_MIPSSIM_WAR_H */
diff --git a/include/asm-mips/mach-pb1x00/mc146818rtc.h b/include/asm-mips/mach-pb1x00/mc146818rtc.h
deleted file mode 100644
index 622c58710e5b..000000000000
--- a/include/asm-mips/mach-pb1x00/mc146818rtc.h
+++ /dev/null
@@ -1,34 +0,0 @@
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 * Copyright (C) 1998, 2001, 03 by Ralf Baechle
7 *
8 * RTC routines for PC style attached Dallas chip.
9 */
10#ifndef __ASM_MACH_AU1XX_MC146818RTC_H
11#define __ASM_MACH_AU1XX_MC146818RTC_H
12
13#include <asm/io.h>
14#include <asm/mach-au1x00/au1000.h>
15
16#define RTC_PORT(x) (0x0c000000 + (x))
17#define RTC_IRQ 8
18#define PB1500_RTC_ADDR 0x0c000000
19
20static inline unsigned char CMOS_READ(unsigned long offset)
21{
22 offset <<= 2;
23 return (u8)(au_readl(offset + PB1500_RTC_ADDR) & 0xff);
24}
25
26static inline void CMOS_WRITE(unsigned char data, unsigned long offset)
27{
28 offset <<= 2;
29 au_writel(data, offset + PB1500_RTC_ADDR);
30}
31
32#define RTC_ALWAYS_BCD 1
33
34#endif /* __ASM_MACH_AU1XX_MC146818RTC_H */
diff --git a/include/asm-mips/mach-pb1x00/pb1000.h b/include/asm-mips/mach-pb1x00/pb1000.h
deleted file mode 100644
index 6d1ff9060e44..000000000000
--- a/include/asm-mips/mach-pb1x00/pb1000.h
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * Alchemy Semi Pb1000 Referrence Board
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 *
24 *
25 */
26#ifndef __ASM_PB1000_H
27#define __ASM_PB1000_H
28
29/* PCMCIA PB1000 specific defines */
30#define PCMCIA_MAX_SOCK 1
31#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
32
33#define PB1000_PCR 0xBE000000
34# define PCR_SLOT_0_VPP0 (1 << 0)
35# define PCR_SLOT_0_VPP1 (1 << 1)
36# define PCR_SLOT_0_VCC0 (1 << 2)
37# define PCR_SLOT_0_VCC1 (1 << 3)
38# define PCR_SLOT_0_RST (1 << 4)
39# define PCR_SLOT_1_VPP0 (1 << 8)
40# define PCR_SLOT_1_VPP1 (1 << 9)
41# define PCR_SLOT_1_VCC0 (1 << 10)
42# define PCR_SLOT_1_VCC1 (1 << 11)
43# define PCR_SLOT_1_RST (1 << 12)
44
45#define PB1000_MDR 0xBE000004
46# define MDR_PI (1 << 5) /* PCMCIA int latch */
47# define MDR_EPI (1 << 14) /* enable PCMCIA int */
48# define MDR_CPI (1 << 15) /* clear PCMCIA int */
49
50#define PB1000_ACR1 0xBE000008
51# define ACR1_SLOT_0_CD1 (1 << 0) /* card detect 1 */
52# define ACR1_SLOT_0_CD2 (1 << 1) /* card detect 2 */
53# define ACR1_SLOT_0_READY (1 << 2) /* ready */
54# define ACR1_SLOT_0_STATUS (1 << 3) /* status change */
55# define ACR1_SLOT_0_VS1 (1 << 4) /* voltage sense 1 */
56# define ACR1_SLOT_0_VS2 (1 << 5) /* voltage sense 2 */
57# define ACR1_SLOT_0_INPACK (1 << 6) /* inpack pin status */
58# define ACR1_SLOT_1_CD1 (1 << 8) /* card detect 1 */
59# define ACR1_SLOT_1_CD2 (1 << 9) /* card detect 2 */
60# define ACR1_SLOT_1_READY (1 << 10) /* ready */
61# define ACR1_SLOT_1_STATUS (1 << 11) /* status change */
62# define ACR1_SLOT_1_VS1 (1 << 12) /* voltage sense 1 */
63# define ACR1_SLOT_1_VS2 (1 << 13) /* voltage sense 2 */
64# define ACR1_SLOT_1_INPACK (1 << 14) /* inpack pin status */
65
66#define CPLD_AUX0 0xBE00000C
67#define CPLD_AUX1 0xBE000010
68#define CPLD_AUX2 0xBE000014
69
70/* Voltage levels */
71
72/* VPPEN1 - VPPEN0 */
73#define VPP_GND ((0 << 1) | (0 << 0))
74#define VPP_5V ((1 << 1) | (0 << 0))
75#define VPP_3V ((0 << 1) | (1 << 0))
76#define VPP_12V ((0 << 1) | (1 << 0))
77#define VPP_HIZ ((1 << 1) | (1 << 0))
78
79/* VCCEN1 - VCCEN0 */
80#define VCC_3V ((0 << 1) | (1 << 0))
81#define VCC_5V ((1 << 1) | (0 << 0))
82#define VCC_HIZ ((0 << 1) | (0 << 0))
83
84/* VPP/VCC */
85#define SET_VCC_VPP(VCC, VPP, SLOT) \
86 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
87#endif /* __ASM_PB1000_H */
diff --git a/include/asm-mips/mach-pb1x00/pb1100.h b/include/asm-mips/mach-pb1x00/pb1100.h
deleted file mode 100644
index b1a60f1cbd02..000000000000
--- a/include/asm-mips/mach-pb1x00/pb1100.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Alchemy Semi Pb1100 Referrence Board
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 *
24 *
25 */
26#ifndef __ASM_PB1100_H
27#define __ASM_PB1100_H
28
29#define PB1100_IDENT 0xAE000000
30#define BOARD_STATUS_REG 0xAE000004
31# define PB1100_ROM_SEL (1 << 15)
32# define PB1100_ROM_SIZ (1 << 14)
33# define PB1100_SWAP_BOOT (1 << 13)
34# define PB1100_FLASH_WP (1 << 12)
35# define PB1100_ROM_H_STS (1 << 11)
36# define PB1100_ROM_L_STS (1 << 10)
37# define PB1100_FLASH_H_STS (1 << 9)
38# define PB1100_FLASH_L_STS (1 << 8)
39# define PB1100_SRAM_SIZ (1 << 7)
40# define PB1100_TSC_BUSY (1 << 6)
41# define PB1100_PCMCIA_VS_MASK (3 << 4)
42# define PB1100_RS232_CD (1 << 3)
43# define PB1100_RS232_CTS (1 << 2)
44# define PB1100_RS232_DSR (1 << 1)
45# define PB1100_RS232_RI (1 << 0)
46
47#define PB1100_IRDA_RS232 0xAE00000C
48# define PB1100_IRDA_FULL (0 << 14) /* full power */
49# define PB1100_IRDA_SHUTDOWN (1 << 14)
50# define PB1100_IRDA_TT (2 << 14) /* 2/3 power */
51# define PB1100_IRDA_OT (3 << 14) /* 1/3 power */
52# define PB1100_IRDA_FIR (1 << 13)
53
54#define PCMCIA_BOARD_REG 0xAE000010
55# define PB1100_SD_WP1_RO (1 << 15) /* read only */
56# define PB1100_SD_WP0_RO (1 << 14) /* read only */
57# define PB1100_SD_PWR1 (1 << 11) /* applies power to SD1 */
58# define PB1100_SD_PWR0 (1 << 10) /* applies power to SD0 */
59# define PB1100_SEL_SD_CONN1 (1 << 9)
60# define PB1100_SEL_SD_CONN0 (1 << 8)
61# define PC_DEASSERT_RST (1 << 7)
62# define PC_DRV_EN (1 << 4)
63
64#define PB1100_G_CONTROL 0xAE000014 /* graphics control */
65
66#define PB1100_RST_VDDI 0xAE00001C
67# define PB1100_SOFT_RESET (1 << 15) /* clear to reset the board */
68# define PB1100_VDDI_MASK 0x1F
69
70#define PB1100_LEDS 0xAE000018
71
72/*
73 * 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED.
74 * 7:0 is the LED Display's decimal points.
75 */
76#define PB1100_HEX_LED 0xAE000018
77
78/* PCMCIA Pb1100 specific defines */
79#define PCMCIA_MAX_SOCK 0
80#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
81
82/* VPP/VCC */
83#define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0))
84
85#endif /* __ASM_PB1100_H */
diff --git a/include/asm-mips/mach-pb1x00/pb1200.h b/include/asm-mips/mach-pb1x00/pb1200.h
deleted file mode 100644
index c8618df88cb5..000000000000
--- a/include/asm-mips/mach-pb1x00/pb1200.h
+++ /dev/null
@@ -1,259 +0,0 @@
1/*
2 * AMD Alchemy Pb1200 Referrence Board
3 * Board Registers defines.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * 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 */
24#ifndef __ASM_PB1200_H
25#define __ASM_PB1200_H
26
27#include <linux/types.h>
28#include <asm/mach-au1x00/au1xxx_psc.h>
29
30#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
31#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
32#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
33#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
34
35/*
36 * SPI and SMB are muxed on the Pb1200 board.
37 * Refer to board documentation.
38 */
39#define SPI_PSC_BASE PSC0_BASE_ADDR
40#define SMBUS_PSC_BASE PSC0_BASE_ADDR
41/*
42 * AC97 and I2S are muxed on the Pb1200 board.
43 * Refer to board documentation.
44 */
45#define AC97_PSC_BASE PSC1_BASE_ADDR
46#define I2S_PSC_BASE PSC1_BASE_ADDR
47
48#define BCSR_KSEG1_ADDR 0xAD800000
49
50typedef volatile struct
51{
52 /*00*/ u16 whoami;
53 u16 reserved0;
54 /*04*/ u16 status;
55 u16 reserved1;
56 /*08*/ u16 switches;
57 u16 reserved2;
58 /*0C*/ u16 resets;
59 u16 reserved3;
60
61 /*10*/ u16 pcmcia;
62 u16 reserved4;
63 /*14*/ u16 board;
64 u16 reserved5;
65 /*18*/ u16 disk_leds;
66 u16 reserved6;
67 /*1C*/ u16 system;
68 u16 reserved7;
69
70 /*20*/ u16 intclr;
71 u16 reserved8;
72 /*24*/ u16 intset;
73 u16 reserved9;
74 /*28*/ u16 intclr_mask;
75 u16 reserved10;
76 /*2C*/ u16 intset_mask;
77 u16 reserved11;
78
79 /*30*/ u16 sig_status;
80 u16 reserved12;
81 /*34*/ u16 int_status;
82 u16 reserved13;
83 /*38*/ u16 reserved14;
84 u16 reserved15;
85 /*3C*/ u16 reserved16;
86 u16 reserved17;
87
88} BCSR;
89
90static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
91
92/*
93 * Register bit definitions for the BCSRs
94 */
95#define BCSR_WHOAMI_DCID 0x000F
96#define BCSR_WHOAMI_CPLD 0x00F0
97#define BCSR_WHOAMI_BOARD 0x0F00
98
99#define BCSR_STATUS_PCMCIA0VS 0x0003
100#define BCSR_STATUS_PCMCIA1VS 0x000C
101#define BCSR_STATUS_SWAPBOOT 0x0040
102#define BCSR_STATUS_FLASHBUSY 0x0100
103#define BCSR_STATUS_IDECBLID 0x0200
104#define BCSR_STATUS_SD0WP 0x0400
105#define BCSR_STATUS_SD1WP 0x0800
106#define BCSR_STATUS_U0RXD 0x1000
107#define BCSR_STATUS_U1RXD 0x2000
108
109#define BCSR_SWITCHES_OCTAL 0x00FF
110#define BCSR_SWITCHES_DIP_1 0x0080
111#define BCSR_SWITCHES_DIP_2 0x0040
112#define BCSR_SWITCHES_DIP_3 0x0020
113#define BCSR_SWITCHES_DIP_4 0x0010
114#define BCSR_SWITCHES_DIP_5 0x0008
115#define BCSR_SWITCHES_DIP_6 0x0004
116#define BCSR_SWITCHES_DIP_7 0x0002
117#define BCSR_SWITCHES_DIP_8 0x0001
118#define BCSR_SWITCHES_ROTARY 0x0F00
119
120#define BCSR_RESETS_ETH 0x0001
121#define BCSR_RESETS_CAMERA 0x0002
122#define BCSR_RESETS_DC 0x0004
123#define BCSR_RESETS_IDE 0x0008
124/* not resets but in the same register */
125#define BCSR_RESETS_WSCFSM 0x0800
126#define BCSR_RESETS_PCS0MUX 0x1000
127#define BCSR_RESETS_PCS1MUX 0x2000
128#define BCSR_RESETS_SPISEL 0x4000
129#define BCSR_RESETS_SD1MUX 0x8000
130
131#define BCSR_PCMCIA_PC0VPP 0x0003
132#define BCSR_PCMCIA_PC0VCC 0x000C
133#define BCSR_PCMCIA_PC0DRVEN 0x0010
134#define BCSR_PCMCIA_PC0RST 0x0080
135#define BCSR_PCMCIA_PC1VPP 0x0300
136#define BCSR_PCMCIA_PC1VCC 0x0C00
137#define BCSR_PCMCIA_PC1DRVEN 0x1000
138#define BCSR_PCMCIA_PC1RST 0x8000
139
140#define BCSR_BOARD_LCDVEE 0x0001
141#define BCSR_BOARD_LCDVDD 0x0002
142#define BCSR_BOARD_LCDBL 0x0004
143#define BCSR_BOARD_CAMSNAP 0x0010
144#define BCSR_BOARD_CAMPWR 0x0020
145#define BCSR_BOARD_SD0PWR 0x0040
146#define BCSR_BOARD_SD1PWR 0x0080
147
148#define BCSR_LEDS_DECIMALS 0x00FF
149#define BCSR_LEDS_LED0 0x0100
150#define BCSR_LEDS_LED1 0x0200
151#define BCSR_LEDS_LED2 0x0400
152#define BCSR_LEDS_LED3 0x0800
153
154#define BCSR_SYSTEM_VDDI 0x001F
155#define BCSR_SYSTEM_POWEROFF 0x4000
156#define BCSR_SYSTEM_RESET 0x8000
157
158/* Bit positions for the different interrupt sources */
159#define BCSR_INT_IDE 0x0001
160#define BCSR_INT_ETH 0x0002
161#define BCSR_INT_PC0 0x0004
162#define BCSR_INT_PC0STSCHG 0x0008
163#define BCSR_INT_PC1 0x0010
164#define BCSR_INT_PC1STSCHG 0x0020
165#define BCSR_INT_DC 0x0040
166#define BCSR_INT_FLASHBUSY 0x0080
167#define BCSR_INT_PC0INSERT 0x0100
168#define BCSR_INT_PC0EJECT 0x0200
169#define BCSR_INT_PC1INSERT 0x0400
170#define BCSR_INT_PC1EJECT 0x0800
171#define BCSR_INT_SD0INSERT 0x1000
172#define BCSR_INT_SD0EJECT 0x2000
173#define BCSR_INT_SD1INSERT 0x4000
174#define BCSR_INT_SD1EJECT 0x8000
175
176#define SMC91C111_PHYS_ADDR 0x0D000300
177#define SMC91C111_INT PB1200_ETH_INT
178
179#define IDE_PHYS_ADDR 0x0C800000
180#define IDE_REG_SHIFT 5
181#define IDE_PHYS_LEN (16 << IDE_REG_SHIFT)
182#define IDE_INT PB1200_IDE_INT
183#define IDE_DDMA_REQ DSCR_CMD0_DMA_REQ1
184#define IDE_RQSIZE 128
185
186#define NAND_PHYS_ADDR 0x1C000000
187
188/*
189 * Timing values as described in databook, * ns value stripped of
190 * lower 2 bits.
191 * These defines are here rather than an Au1200 generic file because
192 * the parts chosen on another board may be different and may require
193 * different timings.
194 */
195#define NAND_T_H (18 >> 2)
196#define NAND_T_PUL (30 >> 2)
197#define NAND_T_SU (30 >> 2)
198#define NAND_T_WH (30 >> 2)
199
200/* Bitfield shift amounts */
201#define NAND_T_H_SHIFT 0
202#define NAND_T_PUL_SHIFT 4
203#define NAND_T_SU_SHIFT 8
204#define NAND_T_WH_SHIFT 12
205
206#define NAND_TIMING (((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
207 ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
208 ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
209 ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT))
210
211/*
212 * External Interrupts for Pb1200 as of 8/6/2004.
213 * Bit positions in the CPLD registers can be calculated by taking
214 * the interrupt define and subtracting the PB1200_INT_BEGIN value.
215 *
216 * Example: IDE bis pos is = 64 - 64
217 * ETH bit pos is = 65 - 64
218 */
219enum external_pb1200_ints {
220 PB1200_INT_BEGIN = AU1000_MAX_INTR + 1,
221
222 PB1200_IDE_INT = PB1200_INT_BEGIN,
223 PB1200_ETH_INT,
224 PB1200_PC0_INT,
225 PB1200_PC0_STSCHG_INT,
226 PB1200_PC1_INT,
227 PB1200_PC1_STSCHG_INT,
228 PB1200_DC_INT,
229 PB1200_FLASHBUSY_INT,
230 PB1200_PC0_INSERT_INT,
231 PB1200_PC0_EJECT_INT,
232 PB1200_PC1_INSERT_INT,
233 PB1200_PC1_EJECT_INT,
234 PB1200_SD0_INSERT_INT,
235 PB1200_SD0_EJECT_INT,
236 PB1200_SD1_INSERT_INT,
237 PB1200_SD1_EJECT_INT,
238
239 PB1200_INT_END = PB1200_INT_BEGIN + 15
240};
241
242/*
243 * Pb1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c
244 */
245#define PCMCIA_MAX_SOCK 1
246#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
247
248/* VPP/VCC */
249#define SET_VCC_VPP(VCC, VPP, SLOT) \
250 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
251
252#define BOARD_PC0_INT PB1200_PC0_INT
253#define BOARD_PC1_INT PB1200_PC1_INT
254#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1 << (8 + (2 * SOCKET)))
255
256/* NAND chip select */
257#define NAND_CS 1
258
259#endif /* __ASM_PB1200_H */
diff --git a/include/asm-mips/mach-pb1x00/pb1500.h b/include/asm-mips/mach-pb1x00/pb1500.h
deleted file mode 100644
index da51a2eb7b82..000000000000
--- a/include/asm-mips/mach-pb1x00/pb1500.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Alchemy Semi Pb1500 Referrence Board
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 *
24 *
25 */
26#ifndef __ASM_PB1500_H
27#define __ASM_PB1500_H
28
29#define IDENT_BOARD_REG 0xAE000000
30#define BOARD_STATUS_REG 0xAE000004
31#define PCI_BOARD_REG 0xAE000010
32#define PCMCIA_BOARD_REG 0xAE000010
33# define PC_DEASSERT_RST 0x80
34# define PC_DRV_EN 0x10
35#define PB1500_G_CONTROL 0xAE000014
36#define PB1500_RST_VDDI 0xAE00001C
37#define PB1500_LEDS 0xAE000018
38
39#define PB1500_HEX_LED 0xAF000004
40#define PB1500_HEX_LED_BLANK 0xAF000008
41
42/* PCMCIA Pb1500 specific defines */
43#define PCMCIA_MAX_SOCK 0
44#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
45
46/* VPP/VCC */
47#define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0))
48
49#endif /* __ASM_PB1500_H */
diff --git a/include/asm-mips/mach-pb1x00/pb1550.h b/include/asm-mips/mach-pb1x00/pb1550.h
deleted file mode 100644
index 6704a11497db..000000000000
--- a/include/asm-mips/mach-pb1x00/pb1550.h
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2 * AMD Alchemy Semi PB1550 Referrence Board
3 * Board Registers defines.
4 *
5 * Copyright 2004 Embedded Edge LLC.
6 * Copyright 2005 Ralf Baechle (ralf@linux-mips.org)
7 *
8 * ########################################################################
9 *
10 * This program is free software; you can distribute it and/or modify it
11 * under the terms of the GNU General Public License (Version 2) as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * ########################################################################
24 *
25 *
26 */
27#ifndef __ASM_PB1550_H
28#define __ASM_PB1550_H
29
30#include <linux/types.h>
31#include <asm/mach-au1x00/au1xxx_psc.h>
32
33#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
34#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
35#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX
36#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX
37
38#define SPI_PSC_BASE PSC0_BASE_ADDR
39#define AC97_PSC_BASE PSC1_BASE_ADDR
40#define SMBUS_PSC_BASE PSC2_BASE_ADDR
41#define I2S_PSC_BASE PSC3_BASE_ADDR
42
43#define BCSR_PHYS_ADDR 0xAF000000
44
45typedef volatile struct
46{
47 /*00*/ u16 whoami;
48 u16 reserved0;
49 /*04*/ u16 status;
50 u16 reserved1;
51 /*08*/ u16 switches;
52 u16 reserved2;
53 /*0C*/ u16 resets;
54 u16 reserved3;
55 /*10*/ u16 pcmcia;
56 u16 reserved4;
57 /*14*/ u16 pci;
58 u16 reserved5;
59 /*18*/ u16 leds;
60 u16 reserved6;
61 /*1C*/ u16 system;
62 u16 reserved7;
63
64} BCSR;
65
66static BCSR * const bcsr = (BCSR *)BCSR_PHYS_ADDR;
67
68/*
69 * Register bit definitions for the BCSRs
70 */
71#define BCSR_WHOAMI_DCID 0x000F
72#define BCSR_WHOAMI_CPLD 0x00F0
73#define BCSR_WHOAMI_BOARD 0x0F00
74
75#define BCSR_STATUS_PCMCIA0VS 0x0003
76#define BCSR_STATUS_PCMCIA1VS 0x000C
77#define BCSR_STATUS_PCMCIA0FI 0x0010
78#define BCSR_STATUS_PCMCIA1FI 0x0020
79#define BCSR_STATUS_SWAPBOOT 0x0040
80#define BCSR_STATUS_SRAMWIDTH 0x0080
81#define BCSR_STATUS_FLASHBUSY 0x0100
82#define BCSR_STATUS_ROMBUSY 0x0200
83#define BCSR_STATUS_USBOTGID 0x0800
84#define BCSR_STATUS_U0RXD 0x1000
85#define BCSR_STATUS_U1RXD 0x2000
86#define BCSR_STATUS_U3RXD 0x8000
87
88#define BCSR_SWITCHES_OCTAL 0x00FF
89#define BCSR_SWITCHES_DIP_1 0x0080
90#define BCSR_SWITCHES_DIP_2 0x0040
91#define BCSR_SWITCHES_DIP_3 0x0020
92#define BCSR_SWITCHES_DIP_4 0x0010
93#define BCSR_SWITCHES_DIP_5 0x0008
94#define BCSR_SWITCHES_DIP_6 0x0004
95#define BCSR_SWITCHES_DIP_7 0x0002
96#define BCSR_SWITCHES_DIP_8 0x0001
97#define BCSR_SWITCHES_ROTARY 0x0F00
98
99#define BCSR_RESETS_PHY0 0x0001
100#define BCSR_RESETS_PHY1 0x0002
101#define BCSR_RESETS_DC 0x0004
102#define BCSR_RESETS_WSC 0x2000
103#define BCSR_RESETS_SPISEL 0x4000
104#define BCSR_RESETS_DMAREQ 0x8000
105
106#define BCSR_PCMCIA_PC0VPP 0x0003
107#define BCSR_PCMCIA_PC0VCC 0x000C
108#define BCSR_PCMCIA_PC0DRVEN 0x0010
109#define BCSR_PCMCIA_PC0RST 0x0080
110#define BCSR_PCMCIA_PC1VPP 0x0300
111#define BCSR_PCMCIA_PC1VCC 0x0C00
112#define BCSR_PCMCIA_PC1DRVEN 0x1000
113#define BCSR_PCMCIA_PC1RST 0x8000
114
115#define BCSR_PCI_M66EN 0x0001
116#define BCSR_PCI_M33 0x0100
117#define BCSR_PCI_EXTERNARB 0x0200
118#define BCSR_PCI_GPIO200RST 0x0400
119#define BCSR_PCI_CLKOUT 0x0800
120#define BCSR_PCI_CFGHOST 0x1000
121
122#define BCSR_LEDS_DECIMALS 0x00FF
123#define BCSR_LEDS_LED0 0x0100
124#define BCSR_LEDS_LED1 0x0200
125#define BCSR_LEDS_LED2 0x0400
126#define BCSR_LEDS_LED3 0x0800
127
128#define BCSR_SYSTEM_VDDI 0x001F
129#define BCSR_SYSTEM_POWEROFF 0x4000
130#define BCSR_SYSTEM_RESET 0x8000
131
132#define PCMCIA_MAX_SOCK 1
133#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
134
135/* VPP/VCC */
136#define SET_VCC_VPP(VCC, VPP, SLOT) \
137 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
138
139#if defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER)
140#define PB1550_BOTH_BANKS
141#elif defined(CONFIG_MTD_PB1550_BOOT) && !defined(CONFIG_MTD_PB1550_USER)
142#define PB1550_BOOT_ONLY
143#elif !defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER)
144#define PB1550_USER_ONLY
145#endif
146
147/*
148 * Timing values as described in databook, * ns value stripped of
149 * lower 2 bits.
150 * These defines are here rather than an SOC1550 generic file because
151 * the parts chosen on another board may be different and may require
152 * different timings.
153 */
154#define NAND_T_H (18 >> 2)
155#define NAND_T_PUL (30 >> 2)
156#define NAND_T_SU (30 >> 2)
157#define NAND_T_WH (30 >> 2)
158
159/* Bitfield shift amounts */
160#define NAND_T_H_SHIFT 0
161#define NAND_T_PUL_SHIFT 4
162#define NAND_T_SU_SHIFT 8
163#define NAND_T_WH_SHIFT 12
164
165#define NAND_TIMING (((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
166 ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
167 ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
168 ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT))
169
170#define NAND_CS 1
171
172/* Should be done by YAMON */
173#define NAND_STCFG 0x00400005 /* 8-bit NAND */
174#define NAND_STTIME 0x00007774 /* valid for 396 MHz SD=2 only */
175#define NAND_STADDR 0x12000FFF /* physical address 0x20000000 */
176
177#endif /* __ASM_PB1550_H */
diff --git a/include/asm-mips/mach-pnx8550/cm.h b/include/asm-mips/mach-pnx8550/cm.h
deleted file mode 100644
index bb0a56c7d011..000000000000
--- a/include/asm-mips/mach-pnx8550/cm.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Clock module specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_CM_H
23#define __PNX8550_CM_H
24
25#define PNX8550_CM_BASE 0xBBE47000
26
27#define PNX8550_CM_PLL0_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x000)
28#define PNX8550_CM_PLL1_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x004)
29#define PNX8550_CM_PLL2_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x008)
30#define PNX8550_CM_PLL3_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x00C)
31
32// Table not complete.....
33
34#define PNX8550_CM_PLL_BLOCKED_MASK 0x80000000
35#define PNX8550_CM_PLL_LOCK_MASK 0x40000000
36#define PNX8550_CM_PLL_CURRENT_ADJ_MASK 0x3c000000
37#define PNX8550_CM_PLL_N_MASK 0x01ff0000
38#define PNX8550_CM_PLL_M_MASK 0x00003f00
39#define PNX8550_CM_PLL_P_MASK 0x0000000c
40#define PNX8550_CM_PLL_PD_MASK 0x00000002
41
42
43#endif
diff --git a/include/asm-mips/mach-pnx8550/glb.h b/include/asm-mips/mach-pnx8550/glb.h
deleted file mode 100644
index 07aa85e609bc..000000000000
--- a/include/asm-mips/mach-pnx8550/glb.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * PNX8550 global definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_GLB_H
23#define __PNX8550_GLB_H
24
25#define PNX8550_GLB1_BASE 0xBBE63000
26#define PNX8550_GLB2_BASE 0xBBE4d000
27#define PNX8550_RESET_BASE 0xBBE60000
28
29/* PCI Inta Output Enable Registers */
30#define PNX8550_GLB2_ENAB_INTA_O *(volatile unsigned long *)(PNX8550_GLB2_BASE + 0x050)
31
32/* Bit 1:Enable DAC Powerdown
33 0:DACs are enabled and are working normally
34 1:DACs are powerdown
35*/
36#define PNX8550_GLB_DAC_PD 0x2
37/* Bit 0:Enable of PCI inta output
38 0 = Disable PCI inta output
39 1 = Enable PCI inta output
40*/
41#define PNX8550_GLB_ENABLE_INTA_O 0x1
42
43/* PCI Direct Mappings */
44#define PNX8550_PCIMEM 0x12000000
45#define PNX8550_PCIMEM_SIZE 0x08000000
46#define PNX8550_PCIIO 0x1c000000
47#define PNX8550_PCIIO_SIZE 0x02000000 /* 32M */
48
49#define PNX8550_PORT_BASE KSEG1
50
51// GPIO def
52#define PNX8550_GPIO_BASE 0x1Be00000
53
54#define PNX8550_GPIO_DIRQ0 (PNX8550_GPIO_BASE + 0x104500)
55#define PNX8550_GPIO_MC1 (PNX8550_GPIO_BASE + 0x104004)
56#define PNX8550_GPIO_MC_31_BIT 30
57#define PNX8550_GPIO_MC_30_BIT 28
58#define PNX8550_GPIO_MC_29_BIT 26
59#define PNX8550_GPIO_MC_28_BIT 24
60#define PNX8550_GPIO_MC_27_BIT 22
61#define PNX8550_GPIO_MC_26_BIT 20
62#define PNX8550_GPIO_MC_25_BIT 18
63#define PNX8550_GPIO_MC_24_BIT 16
64#define PNX8550_GPIO_MC_23_BIT 14
65#define PNX8550_GPIO_MC_22_BIT 12
66#define PNX8550_GPIO_MC_21_BIT 10
67#define PNX8550_GPIO_MC_20_BIT 8
68#define PNX8550_GPIO_MC_19_BIT 6
69#define PNX8550_GPIO_MC_18_BIT 4
70#define PNX8550_GPIO_MC_17_BIT 2
71#define PNX8550_GPIO_MC_16_BIT 0
72
73#define PNX8550_GPIO_MODE_PRIMOP 0x1
74#define PNX8550_GPIO_MODE_NO_OPENDR 0x2
75#define PNX8550_GPIO_MODE_OPENDR 0x3
76
77// RESET module
78#define PNX8550_RST_CTL *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x0)
79#define PNX8550_RST_CAUSE *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x4)
80#define PNX8550_RST_EN_WATCHDOG *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x8)
81
82#define PNX8550_RST_REL_MIPS_RST_N 0x8
83#define PNX8550_RST_DO_SW_RST 0x4
84#define PNX8550_RST_REL_SYS_RST_OUT 0x2
85#define PNX8550_RST_ASSERT_SYS_RST_OUT 0x1
86#endif
diff --git a/include/asm-mips/mach-pnx8550/int.h b/include/asm-mips/mach-pnx8550/int.h
deleted file mode 100644
index 0e0668b524f4..000000000000
--- a/include/asm-mips/mach-pnx8550/int.h
+++ /dev/null
@@ -1,140 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Interrupt specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_INT_H
23#define __PNX8550_INT_H
24
25#define PNX8550_GIC_BASE 0xBBE3E000
26
27#define PNX8550_GIC_PRIMASK_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x000)
28#define PNX8550_GIC_PRIMASK_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x004)
29#define PNX8550_GIC_VECTOR_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x100)
30#define PNX8550_GIC_VECTOR_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x104)
31#define PNX8550_GIC_PEND_1_31 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x200)
32#define PNX8550_GIC_PEND_32_63 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x204)
33#define PNX8550_GIC_PEND_64_70 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x208)
34#define PNX8550_GIC_FEATURES *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x300)
35#define PNX8550_GIC_REQ(x) *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x400 + (x)*4)
36#define PNX8550_GIC_MOD_ID *(volatile unsigned long *)(PNX8550_GIC_BASE + 0xFFC)
37
38// cp0 is two software + six hw exceptions
39#define PNX8550_INT_CP0_TOTINT 8
40#define PNX8550_INT_CP0_MIN 0
41#define PNX8550_INT_CP0_MAX (PNX8550_INT_CP0_MIN + PNX8550_INT_CP0_TOTINT - 1)
42
43#define MIPS_CPU_GIC_IRQ 2
44#define MIPS_CPU_TIMER_IRQ 7
45
46// GIC are 71 exceptions connected to cp0's first hardware exception
47#define PNX8550_INT_GIC_TOTINT 71
48#define PNX8550_INT_GIC_MIN (PNX8550_INT_CP0_MAX+1)
49#define PNX8550_INT_GIC_MAX (PNX8550_INT_GIC_MIN + PNX8550_INT_GIC_TOTINT - 1)
50
51#define PNX8550_INT_UNDEF (PNX8550_INT_GIC_MIN+0)
52#define PNX8550_INT_IPC_TARGET0_MIPS (PNX8550_INT_GIC_MIN+1)
53#define PNX8550_INT_IPC_TARGET1_TM32_1 (PNX8550_INT_GIC_MIN+2)
54#define PNX8550_INT_IPC_TARGET1_TM32_2 (PNX8550_INT_GIC_MIN+3)
55#define PNX8550_INT_RESERVED_4 (PNX8550_INT_GIC_MIN+4)
56#define PNX8550_INT_USB (PNX8550_INT_GIC_MIN+5)
57#define PNX8550_INT_GPIO_EQ1 (PNX8550_INT_GIC_MIN+6)
58#define PNX8550_INT_GPIO_EQ2 (PNX8550_INT_GIC_MIN+7)
59#define PNX8550_INT_GPIO_EQ3 (PNX8550_INT_GIC_MIN+8)
60#define PNX8550_INT_GPIO_EQ4 (PNX8550_INT_GIC_MIN+9)
61
62#define PNX8550_INT_GPIO_EQ5 (PNX8550_INT_GIC_MIN+10)
63#define PNX8550_INT_GPIO_EQ6 (PNX8550_INT_GIC_MIN+11)
64#define PNX8550_INT_RESERVED_12 (PNX8550_INT_GIC_MIN+12)
65#define PNX8550_INT_QVCP1 (PNX8550_INT_GIC_MIN+13)
66#define PNX8550_INT_QVCP2 (PNX8550_INT_GIC_MIN+14)
67#define PNX8550_INT_I2C1 (PNX8550_INT_GIC_MIN+15)
68#define PNX8550_INT_I2C2 (PNX8550_INT_GIC_MIN+16)
69#define PNX8550_INT_ISO_UART1 (PNX8550_INT_GIC_MIN+17)
70#define PNX8550_INT_ISO_UART2 (PNX8550_INT_GIC_MIN+18)
71#define PNX8550_INT_UART1 (PNX8550_INT_GIC_MIN+19)
72
73#define PNX8550_INT_UART2 (PNX8550_INT_GIC_MIN+20)
74#define PNX8550_INT_QNTR (PNX8550_INT_GIC_MIN+21)
75#define PNX8550_INT_RESERVED22 (PNX8550_INT_GIC_MIN+22)
76#define PNX8550_INT_T_DSC (PNX8550_INT_GIC_MIN+23)
77#define PNX8550_INT_M_DSC (PNX8550_INT_GIC_MIN+24)
78#define PNX8550_INT_RESERVED25 (PNX8550_INT_GIC_MIN+25)
79#define PNX8550_INT_2D_DRAW_ENG (PNX8550_INT_GIC_MIN+26)
80#define PNX8550_INT_MEM_BASED_SCALAR1 (PNX8550_INT_GIC_MIN+27)
81#define PNX8550_INT_VIDEO_MPEG (PNX8550_INT_GIC_MIN+28)
82#define PNX8550_INT_VIDEO_INPUT_P1 (PNX8550_INT_GIC_MIN+29)
83
84#define PNX8550_INT_VIDEO_INPUT_P2 (PNX8550_INT_GIC_MIN+30)
85#define PNX8550_INT_SPDI1 (PNX8550_INT_GIC_MIN+31)
86#define PNX8550_INT_SPDO (PNX8550_INT_GIC_MIN+32)
87#define PNX8550_INT_AUDIO_INPUT1 (PNX8550_INT_GIC_MIN+33)
88#define PNX8550_INT_AUDIO_OUTPUT1 (PNX8550_INT_GIC_MIN+34)
89#define PNX8550_INT_AUDIO_INPUT2 (PNX8550_INT_GIC_MIN+35)
90#define PNX8550_INT_AUDIO_OUTPUT2 (PNX8550_INT_GIC_MIN+36)
91#define PNX8550_INT_MEMBASED_SCALAR2 (PNX8550_INT_GIC_MIN+37)
92#define PNX8550_INT_VPK (PNX8550_INT_GIC_MIN+38)
93#define PNX8550_INT_MPEG1_MIPS (PNX8550_INT_GIC_MIN+39)
94
95#define PNX8550_INT_MPEG1_TM (PNX8550_INT_GIC_MIN+40)
96#define PNX8550_INT_MPEG2_MIPS (PNX8550_INT_GIC_MIN+41)
97#define PNX8550_INT_MPEG2_TM (PNX8550_INT_GIC_MIN+42)
98#define PNX8550_INT_TS_DMA (PNX8550_INT_GIC_MIN+43)
99#define PNX8550_INT_EDMA (PNX8550_INT_GIC_MIN+44)
100#define PNX8550_INT_TM_DEBUG1 (PNX8550_INT_GIC_MIN+45)
101#define PNX8550_INT_TM_DEBUG2 (PNX8550_INT_GIC_MIN+46)
102#define PNX8550_INT_PCI_INTA (PNX8550_INT_GIC_MIN+47)
103#define PNX8550_INT_CLOCK_MODULE (PNX8550_INT_GIC_MIN+48)
104#define PNX8550_INT_PCI_XIO_INTA_PCI (PNX8550_INT_GIC_MIN+49)
105
106#define PNX8550_INT_PCI_XIO_INTB_DMA (PNX8550_INT_GIC_MIN+50)
107#define PNX8550_INT_PCI_XIO_INTC_GPPM (PNX8550_INT_GIC_MIN+51)
108#define PNX8550_INT_PCI_XIO_INTD_GPXIO (PNX8550_INT_GIC_MIN+52)
109#define PNX8550_INT_DVD_CSS (PNX8550_INT_GIC_MIN+53)
110#define PNX8550_INT_VLD (PNX8550_INT_GIC_MIN+54)
111#define PNX8550_INT_GPIO_TSU_7_0 (PNX8550_INT_GIC_MIN+55)
112#define PNX8550_INT_GPIO_TSU_15_8 (PNX8550_INT_GIC_MIN+56)
113#define PNX8550_INT_GPIO_CTU_IR (PNX8550_INT_GIC_MIN+57)
114#define PNX8550_INT_GPIO0 (PNX8550_INT_GIC_MIN+58)
115#define PNX8550_INT_GPIO1 (PNX8550_INT_GIC_MIN+59)
116
117#define PNX8550_INT_GPIO2 (PNX8550_INT_GIC_MIN+60)
118#define PNX8550_INT_GPIO3 (PNX8550_INT_GIC_MIN+61)
119#define PNX8550_INT_GPIO4 (PNX8550_INT_GIC_MIN+62)
120#define PNX8550_INT_GPIO5 (PNX8550_INT_GIC_MIN+63)
121#define PNX8550_INT_GPIO6 (PNX8550_INT_GIC_MIN+64)
122#define PNX8550_INT_GPIO7 (PNX8550_INT_GIC_MIN+65)
123#define PNX8550_INT_PMAN_SECURITY (PNX8550_INT_GIC_MIN+66)
124#define PNX8550_INT_I2C3 (PNX8550_INT_GIC_MIN+67)
125#define PNX8550_INT_RESERVED_68 (PNX8550_INT_GIC_MIN+68)
126#define PNX8550_INT_SPDI2 (PNX8550_INT_GIC_MIN+69)
127
128#define PNX8550_INT_I2C4 (PNX8550_INT_GIC_MIN+70)
129
130// Timer are 3 exceptions connected to cp0's 7th hardware exception
131#define PNX8550_INT_TIMER_TOTINT 3
132#define PNX8550_INT_TIMER_MIN (PNX8550_INT_GIC_MAX+1)
133#define PNX8550_INT_TIMER_MAX (PNX8550_INT_TIMER_MIN + PNX8550_INT_TIMER_TOTINT - 1)
134
135#define PNX8550_INT_TIMER1 (PNX8550_INT_TIMER_MIN+0)
136#define PNX8550_INT_TIMER2 (PNX8550_INT_TIMER_MIN+1)
137#define PNX8550_INT_TIMER3 (PNX8550_INT_TIMER_MIN+2)
138#define PNX8550_INT_WATCHDOG PNX8550_INT_TIMER3
139
140#endif
diff --git a/include/asm-mips/mach-pnx8550/kernel-entry-init.h b/include/asm-mips/mach-pnx8550/kernel-entry-init.h
deleted file mode 100644
index bdde00c9199b..000000000000
--- a/include/asm-mips/mach-pnx8550/kernel-entry-init.h
+++ /dev/null
@@ -1,262 +0,0 @@
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 * Copyright (C) 2005 Embedded Alley Solutions, Inc
7 */
8#ifndef __ASM_MACH_KERNEL_ENTRY_INIT_H
9#define __ASM_MACH_KERNEL_ENTRY_INIT_H
10
11#include <asm/cacheops.h>
12#include <asm/addrspace.h>
13
14#define CO_CONFIGPR_VALID 0x3F1F41FF /* valid bits to write to ConfigPR */
15#define HAZARD_CP0 nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
16#define CACHE_OPC 0xBC000000 /* MIPS cache instruction opcode */
17#define ICACHE_LINE_SIZE 32 /* Instruction cache line size bytes */
18#define DCACHE_LINE_SIZE 32 /* Data cache line size in bytes */
19
20#define ICACHE_SET_COUNT 256 /* Instruction cache set count */
21#define DCACHE_SET_COUNT 128 /* Data cache set count */
22
23#define ICACHE_SET_SIZE (ICACHE_SET_COUNT * ICACHE_LINE_SIZE)
24#define DCACHE_SET_SIZE (DCACHE_SET_COUNT * DCACHE_LINE_SIZE)
25
26 .macro kernel_entry_setup
27 .set push
28 .set noreorder
29 /*
30 * PNX8550 entry point, when running a non compressed
31 * kernel. When loading a zImage, the head.S code in
32 * arch/mips/zboot/pnx8550 will init the caches and,
33 * decompress the kernel, and branch to kernel_entry.
34 */
35cache_begin: li t0, (1<<28)
36 mtc0 t0, CP0_STATUS /* cp0 usable */
37 HAZARD_CP0
38
39 mtc0 zero, CP0_CAUSE
40 HAZARD_CP0
41
42
43 /* Set static virtual to phys address translation and TLB disabled */
44 mfc0 t0, CP0_CONFIG, 7
45 HAZARD_CP0
46
47 and t0, ~((1<<19) | (1<<20)) /* TLB/MAP cleared */
48 mtc0 t0, CP0_CONFIG, 7
49 HAZARD_CP0
50
51 /* CPU boots with kseg0 cache algo set to 0x2 -- uncached */
52
53 init_icache
54 nop
55 init_dcache
56 nop
57
58 cachePr4450ICReset
59 nop
60
61 cachePr4450DCReset
62 nop
63
64 /* read ConfigPR into t0 */
65 mfc0 t0, CP0_CONFIG, 7
66 HAZARD_CP0
67
68 /* enable the TLB */
69 or t0, (1<<19)
70
71 /* disable the ICACHE: at least 10x slower */
72 /* or t0, (1<<26) */
73
74 /* disable the DCACHE; CONFIG_CPU_HAS_LLSC should not be set */
75 /* or t0, (1<<27) */
76
77 and t0, CO_CONFIGPR_VALID
78
79 /* enable TLB. */
80 mtc0 t0, CP0_CONFIG, 7
81 HAZARD_CP0
82cache_end:
83 /* Setup CMEM_0 to MMIO address space, 2MB */
84 lui t0, 0x1BE0
85 addi t0, t0, 0x3
86 mtc0 $8, $22, 4
87 nop
88
89 /* Setup CMEM_1, 128MB */
90 lui t0, 0x1000
91 addi t0, t0, 0xf
92 mtc0 $8, $22, 5
93 nop
94
95
96 /* Setup CMEM_2, 32MB */
97 lui t0, 0x1C00
98 addi t0, t0, 0xb
99 mtc0 $8, $22, 6
100 nop
101
102 /* Setup CMEM_3, 0MB */
103 lui t0, 0x0
104 addi t0, t0, 0x0
105 mtc0 $8, $22, 7
106 nop
107
108 /* Enable cache */
109 mfc0 t0, CP0_CONFIG
110 HAZARD_CP0
111 and t0, t0, 0xFFFFFFF8
112 or t0, t0, 3
113 mtc0 t0, CP0_CONFIG
114 HAZARD_CP0
115 .set pop
116 .endm
117
118 .macro init_icache
119 .set push
120 .set noreorder
121
122 /* Get Cache Configuration */
123 mfc0 t3, CP0_CONFIG, 1
124 HAZARD_CP0
125
126 /* get cache Line size */
127
128 srl t1, t3, 19 /* C0_CONFIGPR_IL_SHIFT */
129 andi t1, t1, 0x7 /* C0_CONFIGPR_IL_MASK */
130 beq t1, zero, pr4450_instr_cache_invalidated /* if zero instruction cache is absent */
131 nop
132 addiu t0, t1, 1
133 ori t1, zero, 1
134 sllv t1, t1, t0
135
136 /* get max cache Index */
137 srl t2, t3, 22 /* C0_CONFIGPR_IS_SHIFT */
138 andi t2, t2, 0x7 /* C0_CONFIGPR_IS_MASK */
139 addiu t0, t2, 6
140 ori t2, zero, 1
141 sllv t2, t2, t0
142
143 /* get max cache way */
144 srl t3, t3, 16 /* C0_CONFIGPR_IA_SHIFT */
145 andi t3, t3, 0x7 /* C0_CONFIGPR_IA_MASK */
146 addiu t3, t3, 1
147
148 /* total no of cache lines */
149 multu t2, t3 /* max index * max way */
150 mflo t2
151 addiu t2, t2, -1
152
153 move t0, zero
154pr4450_next_instruction_cache_set:
155 cache Index_Invalidate_I, 0(t0)
156 addu t0, t0, t1 /* add bytes in a line */
157 bne t2, zero, pr4450_next_instruction_cache_set
158 addiu t2, t2, -1 /* reduce no of lines to invalidate by one */
159pr4450_instr_cache_invalidated:
160 .set pop
161 .endm
162
163 .macro init_dcache
164 .set push
165 .set noreorder
166 move t1, zero
167
168 /* Store Tag Information */
169 mtc0 zero, CP0_TAGLO, 0
170 HAZARD_CP0
171
172 mtc0 zero, CP0_TAGHI, 0
173 HAZARD_CP0
174
175 /* Cache size is 16384 = 512 lines x 32 bytes per line */
176 or t2, zero, (128*4)-1 /* 512 lines */
177 /* Invalidate all lines */
1782:
179 cache Index_Store_Tag_D, 0(t1)
180 addiu t2, t2, -1
181 bne t2, zero, 2b
182 addiu t1, t1, 32 /* 32 bytes in a line */
183 .set pop
184 .endm
185
186 .macro cachePr4450ICReset
187 .set push
188 .set noreorder
189
190 /* Save CP0 status reg on entry; */
191 /* disable interrupts during cache reset */
192 mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */
193 HAZARD_CP0
194
195 mtc0 zero, CP0_STATUS /* disable CPU interrupts */
196 HAZARD_CP0
197
198 or t1, zero, zero /* T1 = starting cache index (0) */
199 ori t2, zero, (256 - 1) /* T2 = inst cache set cnt - 1 */
200
201 icache_invd_loop:
202 /* 9 == register t1 */
203 .word CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \
204 (0 * ICACHE_SET_SIZE) /* invalidate inst cache WAY0 */
205 .word CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \
206 (1 * ICACHE_SET_SIZE) /* invalidate inst cache WAY1 */
207
208 addiu t1, t1, ICACHE_LINE_SIZE /* T1 = next cache line index */
209 bne t2, zero, icache_invd_loop /* T2 = 0 if all sets invalidated */
210 addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */
211
212 /* Initialize the latches in the instruction cache tag */
213 /* that drive the way selection tri-state bus drivers, by doing a */
214 /* dummy load while the instruction cache is still disabled. */
215 /* TODO: Is this needed ? */
216 la t1, KSEG0 /* T1 = cached memory base address */
217 lw zero, 0x0000(t1) /* (dummy read of first memory word) */
218
219 mtc0 t0, CP0_STATUS /* restore interrupt status on entry */
220 HAZARD_CP0
221 .set pop
222 .endm
223
224 .macro cachePr4450DCReset
225 .set push
226 .set noreorder
227 mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */
228 HAZARD_CP0
229 mtc0 zero, CP0_STATUS /* disable CPU interrupts */
230 HAZARD_CP0
231
232 /* Writeback/invalidate entire data cache sets/ways/lines */
233 or t1, zero, zero /* T1 = starting cache index (0) */
234 ori t2, zero, (DCACHE_SET_COUNT - 1) /* T2 = data cache set cnt - 1 */
235
236 dcache_wbinvd_loop:
237 /* 9 == register t1 */
238 .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
239 (0 * DCACHE_SET_SIZE) /* writeback/invalidate WAY0 */
240 .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
241 (1 * DCACHE_SET_SIZE) /* writeback/invalidate WAY1 */
242 .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
243 (2 * DCACHE_SET_SIZE) /* writeback/invalidate WAY2 */
244 .word CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \
245 (3 * DCACHE_SET_SIZE) /* writeback/invalidate WAY3 */
246
247 addiu t1, t1, DCACHE_LINE_SIZE /* T1 = next data cache line index */
248 bne t2, zero, dcache_wbinvd_loop /* T2 = 0 when wbinvd entire cache */
249 addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */
250
251 /* Initialize the latches in the data cache tag that drive the way
252 selection tri-state bus drivers, by doing a dummy load while the
253 data cache is still in the disabled mode. TODO: Is this needed ? */
254 la t1, KSEG0 /* T1 = cached memory base address */
255 lw zero, 0x0000(t1) /* (dummy read of first memory word) */
256
257 mtc0 t0, CP0_STATUS /* restore interrupt status on entry */
258 HAZARD_CP0
259 .set pop
260 .endm
261
262#endif /* __ASM_MACH_KERNEL_ENTRY_INIT_H */
diff --git a/include/asm-mips/mach-pnx8550/nand.h b/include/asm-mips/mach-pnx8550/nand.h
deleted file mode 100644
index aefbc514ab09..000000000000
--- a/include/asm-mips/mach-pnx8550/nand.h
+++ /dev/null
@@ -1,121 +0,0 @@
1#ifndef __PNX8550_NAND_H
2#define __PNX8550_NAND_H
3
4#define PNX8550_NAND_BASE_ADDR 0x10000000
5#define PNX8550_PCIXIO_BASE 0xBBE40000
6
7#define PNX8550_DMA_EXT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x800)
8#define PNX8550_DMA_INT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x804)
9#define PNX8550_DMA_TRANS_SIZE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x808)
10#define PNX8550_DMA_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x80c)
11#define PNX8550_XIO_SEL0 *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x814)
12#define PNX8550_GPXIO_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x820)
13#define PNX8550_GPXIO_WR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x824)
14#define PNX8550_GPXIO_RD *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x828)
15#define PNX8550_GPXIO_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x82C)
16#define PNX8550_XIO_FLASH_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x830)
17#define PNX8550_GPXIO_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb0)
18#define PNX8550_GPXIO_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb4)
19#define PNX8550_GPXIO_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb8)
20#define PNX8550_DMA_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd0)
21#define PNX8550_DMA_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd4)
22#define PNX8550_DMA_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd8)
23
24#define PNX8550_XIO_SEL0_EN_16BIT 0x00800000
25#define PNX8550_XIO_SEL0_USE_ACK 0x00400000
26#define PNX8550_XIO_SEL0_REN_HIGH 0x00100000
27#define PNX8550_XIO_SEL0_REN_LOW 0x00040000
28#define PNX8550_XIO_SEL0_WEN_HIGH 0x00010000
29#define PNX8550_XIO_SEL0_WEN_LOW 0x00004000
30#define PNX8550_XIO_SEL0_WAIT 0x00000200
31#define PNX8550_XIO_SEL0_OFFSET 0x00000020
32#define PNX8550_XIO_SEL0_TYPE_68360 0x00000000
33#define PNX8550_XIO_SEL0_TYPE_NOR 0x00000008
34#define PNX8550_XIO_SEL0_TYPE_NAND 0x00000010
35#define PNX8550_XIO_SEL0_TYPE_IDE 0x00000018
36#define PNX8550_XIO_SEL0_SIZE_8MB 0x00000000
37#define PNX8550_XIO_SEL0_SIZE_16MB 0x00000002
38#define PNX8550_XIO_SEL0_SIZE_32MB 0x00000004
39#define PNX8550_XIO_SEL0_SIZE_64MB 0x00000006
40#define PNX8550_XIO_SEL0_ENAB 0x00000001
41
42#define PNX8550_SEL0_DEFAULT ((PNX8550_XIO_SEL0_EN_16BIT) | \
43 (PNX8550_XIO_SEL0_REN_HIGH*0)| \
44 (PNX8550_XIO_SEL0_REN_LOW*2) | \
45 (PNX8550_XIO_SEL0_WEN_HIGH*0)| \
46 (PNX8550_XIO_SEL0_WEN_LOW*2) | \
47 (PNX8550_XIO_SEL0_WAIT*4) | \
48 (PNX8550_XIO_SEL0_OFFSET*0) | \
49 (PNX8550_XIO_SEL0_TYPE_NAND) | \
50 (PNX8550_XIO_SEL0_SIZE_32MB) | \
51 (PNX8550_XIO_SEL0_ENAB))
52
53#define PNX8550_GPXIO_PENDING 0x00000200
54#define PNX8550_GPXIO_DONE 0x00000100
55#define PNX8550_GPXIO_CLR_DONE 0x00000080
56#define PNX8550_GPXIO_INIT 0x00000040
57#define PNX8550_GPXIO_READ_CMD 0x00000010
58#define PNX8550_GPXIO_BEN 0x0000000F
59
60#define PNX8550_XIO_FLASH_64MB 0x00200000
61#define PNX8550_XIO_FLASH_INC_DATA 0x00100000
62#define PNX8550_XIO_FLASH_CMD_PH 0x000C0000
63#define PNX8550_XIO_FLASH_CMD_PH2 0x00080000
64#define PNX8550_XIO_FLASH_CMD_PH1 0x00040000
65#define PNX8550_XIO_FLASH_CMD_PH0 0x00000000
66#define PNX8550_XIO_FLASH_ADR_PH 0x00030000
67#define PNX8550_XIO_FLASH_ADR_PH3 0x00030000
68#define PNX8550_XIO_FLASH_ADR_PH2 0x00020000
69#define PNX8550_XIO_FLASH_ADR_PH1 0x00010000
70#define PNX8550_XIO_FLASH_ADR_PH0 0x00000000
71#define PNX8550_XIO_FLASH_CMD_B(x) ((x<<8) & 0x0000FF00)
72#define PNX8550_XIO_FLASH_CMD_A(x) (x & 0x000000FF)
73
74#define PNX8550_XIO_INT_ACK 0x00004000
75#define PNX8550_XIO_INT_COMPL 0x00002000
76#define PNX8550_XIO_INT_NONSUP 0x00000200
77#define PNX8550_XIO_INT_ABORT 0x00000004
78
79#define PNX8550_DMA_CTRL_SINGLE_DATA 0x00000400
80#define PNX8550_DMA_CTRL_SND2XIO 0x00000200
81#define PNX8550_DMA_CTRL_FIX_ADDR 0x00000100
82#define PNX8550_DMA_CTRL_BURST_8 0x00000000
83#define PNX8550_DMA_CTRL_BURST_16 0x00000020
84#define PNX8550_DMA_CTRL_BURST_32 0x00000040
85#define PNX8550_DMA_CTRL_BURST_64 0x00000060
86#define PNX8550_DMA_CTRL_BURST_128 0x00000080
87#define PNX8550_DMA_CTRL_BURST_256 0x000000A0
88#define PNX8550_DMA_CTRL_BURST_512 0x000000C0
89#define PNX8550_DMA_CTRL_BURST_NORES 0x000000E0
90#define PNX8550_DMA_CTRL_INIT_DMA 0x00000010
91#define PNX8550_DMA_CTRL_CMD_TYPE 0x0000000F
92
93/* see PCI system arch, page 100 for the full list: */
94#define PNX8550_DMA_CTRL_PCI_CMD_READ 0x00000006
95#define PNX8550_DMA_CTRL_PCI_CMD_WRITE 0x00000007
96
97#define PNX8550_DMA_INT_STAT_ACK_DONE (1<<14)
98#define PNX8550_DMA_INT_STAT_DMA_DONE (1<<12)
99#define PNX8550_DMA_INT_STAT_DMA_ERR (1<<9)
100#define PNX8550_DMA_INT_STAT_PERR5 (1<<5)
101#define PNX8550_DMA_INT_STAT_PERR4 (1<<4)
102#define PNX8550_DMA_INT_STAT_M_ABORT (1<<2)
103#define PNX8550_DMA_INT_STAT_T_ABORT (1<<1)
104
105#define PNX8550_DMA_INT_EN_ACK_DONE (1<<14)
106#define PNX8550_DMA_INT_EN_DMA_DONE (1<<12)
107#define PNX8550_DMA_INT_EN_DMA_ERR (1<<9)
108#define PNX8550_DMA_INT_EN_PERR5 (1<<5)
109#define PNX8550_DMA_INT_EN_PERR4 (1<<4)
110#define PNX8550_DMA_INT_EN_M_ABORT (1<<2)
111#define PNX8550_DMA_INT_EN_T_ABORT (1<<1)
112
113#define PNX8550_DMA_INT_CLR_ACK_DONE (1<<14)
114#define PNX8550_DMA_INT_CLR_DMA_DONE (1<<12)
115#define PNX8550_DMA_INT_CLR_DMA_ERR (1<<9)
116#define PNX8550_DMA_INT_CLR_PERR5 (1<<5)
117#define PNX8550_DMA_INT_CLR_PERR4 (1<<4)
118#define PNX8550_DMA_INT_CLR_M_ABORT (1<<2)
119#define PNX8550_DMA_INT_CLR_T_ABORT (1<<1)
120
121#endif
diff --git a/include/asm-mips/mach-pnx8550/pci.h b/include/asm-mips/mach-pnx8550/pci.h
deleted file mode 100644
index b921508d701b..000000000000
--- a/include/asm-mips/mach-pnx8550/pci.h
+++ /dev/null
@@ -1,185 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * PCI specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_PCI_H
23#define __PNX8550_PCI_H
24
25#include <linux/types.h>
26#include <linux/pci.h>
27#include <linux/kernel.h>
28#include <linux/init.h>
29
30#define PCI_ACCESS_READ 0
31#define PCI_ACCESS_WRITE 1
32
33#define PCI_CMD_IOR 0x20
34#define PCI_CMD_IOW 0x30
35#define PCI_CMD_CONFIG_READ 0xa0
36#define PCI_CMD_CONFIG_WRITE 0xb0
37
38#define PCI_IO_TIMEOUT 1000
39#define PCI_IO_RETRY 5
40/* Timeout for IO and CFG accesses.
41 This is in 1/1024 th of a jiffie(=10ms)
42 i.e. approx 10us */
43#define PCI_IO_JIFFIES_TIMEOUT 40
44#define PCI_IO_JIFFIES_SHIFT 10
45
46#define PCI_BYTE_ENABLE_MASK 0x0000000f
47#define PCI_CFG_BUS_SHIFT 16
48#define PCI_CFG_FUNC_SHIFT 8
49#define PCI_CFG_REG_SHIFT 2
50
51#define PCI_BASE 0x1be00000
52#define PCI_SETUP 0x00040010
53#define PCI_DIS_REQGNT (1<<30)
54#define PCI_DIS_REQGNTA (1<<29)
55#define PCI_DIS_REQGNTB (1<<28)
56#define PCI_D2_SUPPORT (1<<27)
57#define PCI_D1_SUPPORT (1<<26)
58#define PCI_EN_TA (1<<24)
59#define PCI_EN_PCI2MMI (1<<23)
60#define PCI_EN_XIO (1<<22)
61#define PCI_BASE18_PREF (1<<21)
62#define SIZE_16M 0x3
63#define SIZE_32M 0x4
64#define SIZE_64M 0x5
65#define SIZE_128M 0x6
66#define PCI_SETUP_BASE18_SIZE(X) (X<<18)
67#define PCI_SETUP_BASE18_EN (1<<17)
68#define PCI_SETUP_BASE14_PREF (1<<16)
69#define PCI_SETUP_BASE14_SIZE(X) (X<<12)
70#define PCI_SETUP_BASE14_EN (1<<11)
71#define PCI_SETUP_BASE10_PREF (1<<10)
72#define PCI_SETUP_BASE10_SIZE(X) (X<<7)
73#define PCI_SETUP_CFGMANAGE_EN (1<<1)
74#define PCI_SETUP_PCIARB_EN (1<<0)
75
76#define PCI_CTRL 0x040014
77#define PCI_SWPB_DCS_PCI (1<<16)
78#define PCI_SWPB_PCI_PCI (1<<15)
79#define PCI_SWPB_PCI_DCS (1<<14)
80#define PCI_REG_WR_POST (1<<13)
81#define PCI_XIO_WR_POST (1<<12)
82#define PCI_PCI2_WR_POST (1<<13)
83#define PCI_PCI1_WR_POST (1<<12)
84#define PCI_SERR_SEEN (1<<11)
85#define PCI_B10_SPEC_RD (1<<6)
86#define PCI_B14_SPEC_RD (1<<5)
87#define PCI_B18_SPEC_RD (1<<4)
88#define PCI_B10_NOSUBWORD (1<<3)
89#define PCI_B14_NOSUBWORD (1<<2)
90#define PCI_B18_NOSUBWORD (1<<1)
91#define PCI_RETRY_TMREN (1<<0)
92
93#define PCI_BASE1_LO 0x040018
94#define PCI_BASE1_HI 0x04001C
95#define PCI_BASE2_LO 0x040020
96#define PCI_BASE2_HI 0x040024
97#define PCI_RDLIFETIM 0x040028
98#define PCI_GPPM_ADDR 0x04002C
99#define PCI_GPPM_WDAT 0x040030
100#define PCI_GPPM_RDAT 0x040034
101#define PCI_GPPM_CTRL 0x040038
102#define GPPM_DONE (1<<10)
103#define INIT_PCI_CYCLE (1<<9)
104#define GPPM_CMD(X) (((X)&0xf)<<4)
105#define GPPM_BYTEEN(X) ((X)&0xf)
106#define PCI_UNLOCKREG 0x04003C
107#define UNLOCK_SSID(X) (((X)&0xff)<<8)
108#define UNLOCK_SETUP(X) (((X)&0xff)<<0)
109#define UNLOCK_MAGIC 0xCA
110#define PCI_DEV_VEND_ID 0x040040
111#define DEVICE_ID(X) (((X)>>16)&0xffff)
112#define VENDOR_ID(X) (((X)&0xffff))
113#define PCI_CFG_CMDSTAT 0x040044
114#define PCI_CFG_STATUS(X) (((X)>>16)&0xffff)
115#define PCI_CFG_COMMAND(X) ((X)&0xffff)
116#define PCI_CLASS_REV 0x040048
117#define PCI_CLASSCODE(X) (((X)>>8)&0xffffff)
118#define PCI_REVID(X) ((X)&0xff)
119#define PCI_LAT_TMR 0x04004c
120#define PCI_BASE10 0x040050
121#define PCI_BASE14 0x040054
122#define PCI_BASE18 0x040058
123#define PCI_SUBSYS_ID 0x04006c
124#define PCI_CAP_PTR 0x040074
125#define PCI_CFG_MISC 0x04007c
126#define PCI_PMC 0x040080
127#define PCI_PWR_STATE 0x040084
128#define PCI_IO 0x040088
129#define PCI_SLVTUNING 0x04008C
130#define PCI_DMATUNING 0x040090
131#define PCI_DMAEADDR 0x040800
132#define PCI_DMAIADDR 0x040804
133#define PCI_DMALEN 0x040808
134#define PCI_DMACTRL 0x04080C
135#define PCI_XIOCTRL 0x040810
136#define PCI_SEL0PROF 0x040814
137#define PCI_SEL1PROF 0x040818
138#define PCI_SEL2PROF 0x04081C
139#define PCI_GPXIOADDR 0x040820
140#define PCI_NANDCTRLS 0x400830
141#define PCI_SEL3PROF 0x040834
142#define PCI_SEL4PROF 0x040838
143#define PCI_GPXIO_STAT 0x040FB0
144#define PCI_GPXIO_IMASK 0x040FB4
145#define PCI_GPXIO_ICLR 0x040FB8
146#define PCI_GPXIO_ISET 0x040FBC
147#define PCI_GPPM_STATUS 0x040FC0
148#define GPPM_DONE (1<<10)
149#define GPPM_ERR (1<<9)
150#define GPPM_MPAR_ERR (1<<8)
151#define GPPM_PAR_ERR (1<<7)
152#define GPPM_R_MABORT (1<<2)
153#define GPPM_R_TABORT (1<<1)
154#define PCI_GPPM_IMASK 0x040FC4
155#define PCI_GPPM_ICLR 0x040FC8
156#define PCI_GPPM_ISET 0x040FCC
157#define PCI_DMA_STATUS 0x040FD0
158#define PCI_DMA_IMASK 0x040FD4
159#define PCI_DMA_ICLR 0x040FD8
160#define PCI_DMA_ISET 0x040FDC
161#define PCI_ISTATUS 0x040FE0
162#define PCI_IMASK 0x040FE4
163#define PCI_ICLR 0x040FE8
164#define PCI_ISET 0x040FEC
165#define PCI_MOD_ID 0x040FFC
166
167/*
168 * PCI configuration cycle AD bus definition
169 */
170/* Type 0 */
171#define PCI_CFG_TYPE0_REG_SHF 0
172#define PCI_CFG_TYPE0_FUNC_SHF 8
173
174/* Type 1 */
175#define PCI_CFG_TYPE1_REG_SHF 0
176#define PCI_CFG_TYPE1_FUNC_SHF 8
177#define PCI_CFG_TYPE1_DEV_SHF 11
178#define PCI_CFG_TYPE1_BUS_SHF 16
179
180/*
181 * Ethernet device DP83816 definition
182 */
183#define DP83816_IRQ_ETHER 66
184
185#endif
diff --git a/include/asm-mips/mach-pnx8550/uart.h b/include/asm-mips/mach-pnx8550/uart.h
deleted file mode 100644
index ad7608d44874..000000000000
--- a/include/asm-mips/mach-pnx8550/uart.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef __IP3106_UART_H
2#define __IP3106_UART_H
3
4#include <int.h>
5
6/* early macros for kgdb use. fixme: clean this up */
7
8#define UART_BASE 0xbbe4a000 /* PNX8550 */
9
10#define PNX8550_UART_PORT0 (UART_BASE)
11#define PNX8550_UART_PORT1 (UART_BASE + 0x1000)
12
13#define PNX8550_UART_INT(x) (PNX8550_INT_GIC_MIN+19+x)
14#define IRQ_TO_UART(x) (x-PNX8550_INT_GIC_MIN-19)
15
16/* early macros needed for prom/kgdb */
17
18#define ip3106_lcr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x000)
19#define ip3106_mcr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x004)
20#define ip3106_baud(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x008)
21#define ip3106_cfg(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x00C)
22#define ip3106_fifo(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x028)
23#define ip3106_istat(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE0)
24#define ip3106_ien(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE4)
25#define ip3106_iclr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE8)
26#define ip3106_iset(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFEC)
27#define ip3106_pd(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFF4)
28#define ip3106_mid(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFFC)
29
30#endif
diff --git a/include/asm-mips/mach-pnx8550/usb.h b/include/asm-mips/mach-pnx8550/usb.h
deleted file mode 100644
index 483b7fc65d41..000000000000
--- a/include/asm-mips/mach-pnx8550/usb.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * USB specific definitions
5 *
6 * Author: source@mvista.com
7 *
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 */
21
22#ifndef __PNX8550_USB_H
23#define __PNX8550_USB_H
24
25/*
26 * USB Host controller
27 */
28
29#define PNX8550_USB_OHCI_OP_BASE 0x1be48000
30#define PNX8550_USB_OHCI_OP_LEN 0x1000
31
32#endif
diff --git a/include/asm-mips/mach-pnx8550/war.h b/include/asm-mips/mach-pnx8550/war.h
deleted file mode 100644
index d0458dd082f9..000000000000
--- a/include/asm-mips/mach-pnx8550/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_PNX8550_WAR_H
9#define __ASM_MIPS_MACH_PNX8550_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_PNX8550_WAR_H */
diff --git a/include/asm-mips/mach-rc32434/cpu-feature-overrides.h b/include/asm-mips/mach-rc32434/cpu-feature-overrides.h
deleted file mode 100644
index f3bc7efa2608..000000000000
--- a/include/asm-mips/mach-rc32434/cpu-feature-overrides.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * IDT RC32434 specific CPU feature overrides
3 *
4 * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
5 *
6 * This file was derived from: include/asm-mips/cpu-features.h
7 * Copyright (C) 2003, 2004 Ralf Baechle
8 * Copyright (C) 2004 Maciej W. Rozycki
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (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
22 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24 */
25#ifndef __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H
26#define __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H
27
28/*
29 * The IDT RC32434 SOC has a built-in MIPS 4Kc core.
30 */
31#define cpu_has_tlb 1
32#define cpu_has_4kex 1
33#define cpu_has_3k_cache 0
34#define cpu_has_4k_cache 1
35#define cpu_has_tx39_cache 0
36#define cpu_has_sb1_cache 0
37#define cpu_has_fpu 0
38#define cpu_has_32fpr 0
39#define cpu_has_counter 1
40#define cpu_has_watch 1
41#define cpu_has_divec 1
42#define cpu_has_vce 0
43#define cpu_has_cache_cdex_p 0
44#define cpu_has_cache_cdex_s 0
45#define cpu_has_prefetch 1
46#define cpu_has_mcheck 1
47#define cpu_has_ejtag 1
48#define cpu_has_llsc 1
49
50#define cpu_has_mips16 0
51#define cpu_has_mdmx 0
52#define cpu_has_mips3d 0
53#define cpu_has_smartmips 0
54
55#define cpu_has_vtag_icache 0
56/* #define cpu_has_dc_aliases ? */
57/* #define cpu_has_ic_fills_f_dc ? */
58/* #define cpu_has_pindexed_dcache ? */
59
60/* #define cpu_icache_snoops_remote_store ? */
61
62#define cpu_has_mips32r1 1
63#define cpu_has_mips32r2 0
64#define cpu_has_mips64r1 0
65#define cpu_has_mips64r2 0
66
67#define cpu_has_dsp 0
68#define cpu_has_mipsmt 0
69
70/* #define cpu_has_nofpuex ? */
71#define cpu_has_64bits 0
72#define cpu_has_64bit_zero_reg 0
73#define cpu_has_64bit_gp_regs 0
74#define cpu_has_64bit_addresses 0
75
76#define cpu_has_inclusive_pcaches 0
77
78#define cpu_dcache_line_size() 16
79#define cpu_icache_line_size() 16
80
81#endif /* __ASM_MACH_RC32434_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-rc32434/ddr.h b/include/asm-mips/mach-rc32434/ddr.h
deleted file mode 100644
index 291e2cf9dde0..000000000000
--- a/include/asm-mips/mach-rc32434/ddr.h
+++ /dev/null
@@ -1,141 +0,0 @@
1/*
2 * Definitions for the DDR registers
3 *
4 * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef _ASM_RC32434_DDR_H_
30#define _ASM_RC32434_DDR_H_
31
32#include <asm/mach-rc32434/rb.h>
33
34/* DDR register structure */
35struct ddr_ram {
36 u32 ddrbase;
37 u32 ddrmask;
38 u32 res1;
39 u32 res2;
40 u32 ddrc;
41 u32 ddrabase;
42 u32 ddramask;
43 u32 ddramap;
44 u32 ddrcust;
45 u32 ddrrdc;
46 u32 ddrspare;
47};
48
49#define DDR0_PHYS_ADDR 0x18018000
50
51/* DDR banks masks */
52#define DDR_MASK 0xffff0000
53#define DDR0_BASE_MSK DDR_MASK
54#define DDR1_BASE_MSK DDR_MASK
55
56/* DDR bank0 registers */
57#define RC32434_DDR0_ATA_BIT 5
58#define RC32434_DDR0_ATA_MSK 0x000000E0
59#define RC32434_DDR0_DBW_BIT 8
60#define RC32434_DDR0_DBW_MSK 0x00000100
61#define RC32434_DDR0_WR_BIT 9
62#define RC32434_DDR0_WR_MSK 0x00000600
63#define RC32434_DDR0_PS_BIT 11
64#define RC32434_DDR0_PS_MSK 0x00001800
65#define RC32434_DDR0_DTYPE_BIT 13
66#define RC32434_DDR0_DTYPE_MSK 0x0000e000
67#define RC32434_DDR0_RFC_BIT 16
68#define RC32434_DDR0_RFC_MSK 0x000f0000
69#define RC32434_DDR0_RP_BIT 20
70#define RC32434_DDR0_RP_MSK 0x00300000
71#define RC32434_DDR0_AP_BIT 22
72#define RC32434_DDR0_AP_MSK 0x00400000
73#define RC32434_DDR0_RCD_BIT 23
74#define RC32434_DDR0_RCD_MSK 0x01800000
75#define RC32434_DDR0_CL_BIT 25
76#define RC32434_DDR0_CL_MSK 0x06000000
77#define RC32434_DDR0_DBM_BIT 27
78#define RC32434_DDR0_DBM_MSK 0x08000000
79#define RC32434_DDR0_SDS_BIT 28
80#define RC32434_DDR0_SDS_MSK 0x10000000
81#define RC32434_DDR0_ATP_BIT 29
82#define RC32434_DDR0_ATP_MSK 0x60000000
83#define RC32434_DDR0_RE_BIT 31
84#define RC32434_DDR0_RE_MSK 0x80000000
85
86/* DDR bank C registers */
87#define RC32434_DDRC_MSK(x) BIT_TO_MASK(x)
88#define RC32434_DDRC_CES_BIT 0
89#define RC32434_DDRC_ACE_BIT 1
90
91/* Custom DDR bank registers */
92#define RC32434_DCST_MSK(x) BIT_TO_MASK(x)
93#define RC32434_DCST_CS_BIT 0
94#define RC32434_DCST_CS_MSK 0x00000003
95#define RC32434_DCST_WE_BIT 2
96#define RC32434_DCST_RAS_BIT 3
97#define RC32434_DCST_CAS_BIT 4
98#define RC32434_DSCT_CKE_BIT 5
99#define RC32434_DSCT_BA_BIT 6
100#define RC32434_DSCT_BA_MSK 0x000000c0
101
102/* DDR QSC registers */
103#define RC32434_QSC_DM_BIT 0
104#define RC32434_QSC_DM_MSK 0x00000003
105#define RC32434_QSC_DQSBS_BIT 2
106#define RC32434_QSC_DQSBS_MSK 0x000000fc
107#define RC32434_QSC_DB_BIT 8
108#define RC32434_QSC_DB_MSK 0x00000100
109#define RC32434_QSC_DBSP_BIT 9
110#define RC32434_QSC_DBSP_MSK 0x01fffe00
111#define RC32434_QSC_BDP_BIT 25
112#define RC32434_QSC_BDP_MSK 0x7e000000
113
114/* DDR LLC registers */
115#define RC32434_LLC_EAO_BIT 0
116#define RC32434_LLC_EAO_MSK 0x00000001
117#define RC32434_LLC_EO_BIT 1
118#define RC32434_LLC_EO_MSK 0x0000003e
119#define RC32434_LLC_FS_BIT 6
120#define RC32434_LLC_FS_MSK 0x000000c0
121#define RC32434_LLC_AS_BIT 8
122#define RC32434_LLC_AS_MSK 0x00000700
123#define RC32434_LLC_SP_BIT 11
124#define RC32434_LLC_SP_MSK 0x001ff800
125
126/* DDR LLFC registers */
127#define RC32434_LLFC_MSK(x) BIT_TO_MASK(x)
128#define RC32434_LLFC_MEN_BIT 0
129#define RC32434_LLFC_EAN_BIT 1
130#define RC32434_LLFC_FF_BIT 2
131
132/* DDR DLLTA registers */
133#define RC32434_DLLTA_ADDR_BIT 2
134#define RC32434_DLLTA_ADDR_MSK 0xfffffffc
135
136/* DDR DLLED registers */
137#define RC32434_DLLED_MSK(x) BIT_TO_MASK(x)
138#define RC32434_DLLED_DBE_BIT 0
139#define RC32434_DLLED_DTE_BIT 1
140
141#endif /* _ASM_RC32434_DDR_H_ */
diff --git a/include/asm-mips/mach-rc32434/dma.h b/include/asm-mips/mach-rc32434/dma.h
deleted file mode 100644
index 5f898b5873f7..000000000000
--- a/include/asm-mips/mach-rc32434/dma.h
+++ /dev/null
@@ -1,103 +0,0 @@
1/*
2 * Copyright 2002 Integrated Device Technology, Inc.
3 * All rights reserved.
4 *
5 * DMA register definition.
6 *
7 * Author : ryan.holmQVist@idt.com
8 * Date : 20011005
9 */
10
11#ifndef __ASM_RC32434_DMA_H
12#define __ASM_RC32434_DMA_H
13
14#include <asm/mach-rc32434/rb.h>
15
16#define DMA0_BASE_ADDR 0x18040000
17
18/*
19 * DMA descriptor (in physical memory).
20 */
21
22struct dma_desc {
23 u32 control; /* Control. use DMAD_* */
24 u32 ca; /* Current Address. */
25 u32 devcs; /* Device control and status. */
26 u32 link; /* Next descriptor in chain. */
27};
28
29#define DMA_DESC_SIZ sizeof(struct dma_desc)
30#define DMA_DESC_COUNT_BIT 0
31#define DMA_DESC_COUNT_MSK 0x0003ffff
32#define DMA_DESC_DS_BIT 20
33#define DMA_DESC_DS_MSK 0x00300000
34
35#define DMA_DESC_DEV_CMD_BIT 22
36#define DMA_DESC_DEV_CMD_MSK 0x01c00000
37
38/* DMA command sizes */
39#define DMA_DESC_DEV_CMD_BYTE 0
40#define DMA_DESC_DEV_CMD_HLF_WD 1
41#define DMA_DESC_DEV_CMD_WORD 2
42#define DMA_DESC_DEV_CMD_2WORDS 3
43#define DMA_DESC_DEV_CMD_4WORDS 4
44#define DMA_DESC_DEV_CMD_6WORDS 5
45#define DMA_DESC_DEV_CMD_8WORDS 6
46#define DMA_DESC_DEV_CMD_16WORDS 7
47
48/* DMA descriptors interrupts */
49#define DMA_DESC_COF (1 << 25) /* Chain on finished */
50#define DMA_DESC_COD (1 << 26) /* Chain on done */
51#define DMA_DESC_IOF (1 << 27) /* Interrupt on finished */
52#define DMA_DESC_IOD (1 << 28) /* Interrupt on done */
53#define DMA_DESC_TERM (1 << 29) /* Terminated */
54#define DMA_DESC_DONE (1 << 30) /* Done */
55#define DMA_DESC_FINI (1 << 31) /* Finished */
56
57/*
58 * DMA register (within Internal Register Map).
59 */
60
61struct dma_reg {
62 u32 dmac; /* Control. */
63 u32 dmas; /* Status. */
64 u32 dmasm; /* Mask. */
65 u32 dmadptr; /* Descriptor pointer. */
66 u32 dmandptr; /* Next descriptor pointer. */
67};
68
69/* DMA channels specific registers */
70#define DMA_CHAN_RUN_BIT (1 << 0)
71#define DMA_CHAN_DONE_BIT (1 << 1)
72#define DMA_CHAN_MODE_BIT (1 << 2)
73#define DMA_CHAN_MODE_MSK 0x0000000c
74#define DMA_CHAN_MODE_AUTO 0
75#define DMA_CHAN_MODE_BURST 1
76#define DMA_CHAN_MODE_XFRT 2
77#define DMA_CHAN_MODE_RSVD 3
78#define DMA_CHAN_ACT_BIT (1 << 4)
79
80/* DMA status registers */
81#define DMA_STAT_FINI (1 << 0)
82#define DMA_STAT_DONE (1 << 1)
83#define DMA_STAT_CHAIN (1 << 2)
84#define DMA_STAT_ERR (1 << 3)
85#define DMA_STAT_HALT (1 << 4)
86
87/*
88 * DMA channel definitions
89 */
90
91#define DMA_CHAN_ETH_RCV 0
92#define DMA_CHAN_ETH_XMT 1
93#define DMA_CHAN_MEM_TO_FIFO 2
94#define DMA_CHAN_FIFO_TO_MEM 3
95#define DMA_CHAN_PCI_TO_MEM 4
96#define DMA_CHAN_MEM_TO_PCI 5
97#define DMA_CHAN_COUNT 6
98
99struct dma_channel {
100 struct dma_reg ch[DMA_CHAN_COUNT];
101};
102
103#endif /* __ASM_RC32434_DMA_H */
diff --git a/include/asm-mips/mach-rc32434/dma_v.h b/include/asm-mips/mach-rc32434/dma_v.h
deleted file mode 100644
index 173a9f9146cd..000000000000
--- a/include/asm-mips/mach-rc32434/dma_v.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Copyright 2002 Integrated Device Technology, Inc.
3 * All rights reserved.
4 *
5 * DMA register definition.
6 *
7 * Author : ryan.holmQVist@idt.com
8 * Date : 20011005
9 */
10
11#ifndef _ASM_RC32434_DMA_V_H_
12#define _ASM_RC32434_DMA_V_H_
13
14#include <asm/mach-rc32434/dma.h>
15#include <asm/mach-rc32434/rc32434.h>
16
17#define DMA_CHAN_OFFSET 0x14
18#define IS_DMA_USED(X) (((X) & \
19 (DMA_DESC_FINI | DMA_DESC_DONE | DMA_DESC_TERM)) \
20 != 0)
21#define DMA_COUNT(count) ((count) & DMA_DESC_COUNT_MSK)
22
23#define DMA_HALT_TIMEOUT 500
24
25static inline int rc32434_halt_dma(struct dma_reg *ch)
26{
27 int timeout = 1;
28 if (__raw_readl(&ch->dmac) & DMA_CHAN_RUN_BIT) {
29 __raw_writel(0, &ch->dmac);
30 for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
31 if (__raw_readl(&ch->dmas) & DMA_STAT_HALT) {
32 __raw_writel(0, &ch->dmas);
33 break;
34 }
35 }
36 }
37
38 return timeout ? 0 : 1;
39}
40
41static inline void rc32434_start_dma(struct dma_reg *ch, u32 dma_addr)
42{
43 __raw_writel(0, &ch->dmandptr);
44 __raw_writel(dma_addr, &ch->dmadptr);
45}
46
47static inline void rc32434_chain_dma(struct dma_reg *ch, u32 dma_addr)
48{
49 __raw_writel(dma_addr, &ch->dmandptr);
50}
51
52#endif /* _ASM_RC32434_DMA_V_H_ */
diff --git a/include/asm-mips/mach-rc32434/eth.h b/include/asm-mips/mach-rc32434/eth.h
deleted file mode 100644
index a25cbc56173d..000000000000
--- a/include/asm-mips/mach-rc32434/eth.h
+++ /dev/null
@@ -1,220 +0,0 @@
1/*
2 * Definitions for the Ethernet registers
3 *
4 * Copyright 2002 Allend Stichter <allen.stichter@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef __ASM_RC32434_ETH_H
30#define __ASM_RC32434_ETH_H
31
32
33#define ETH0_BASE_ADDR 0x18060000
34
35struct eth_regs {
36 u32 ethintfc;
37 u32 ethfifott;
38 u32 etharc;
39 u32 ethhash0;
40 u32 ethhash1;
41 u32 ethu0[4]; /* Reserved. */
42 u32 ethpfs;
43 u32 ethmcp;
44 u32 eth_u1[10]; /* Reserved. */
45 u32 ethspare;
46 u32 eth_u2[42]; /* Reserved. */
47 u32 ethsal0;
48 u32 ethsah0;
49 u32 ethsal1;
50 u32 ethsah1;
51 u32 ethsal2;
52 u32 ethsah2;
53 u32 ethsal3;
54 u32 ethsah3;
55 u32 ethrbc;
56 u32 ethrpc;
57 u32 ethrupc;
58 u32 ethrfc;
59 u32 ethtbc;
60 u32 ethgpf;
61 u32 eth_u9[50]; /* Reserved. */
62 u32 ethmac1;
63 u32 ethmac2;
64 u32 ethipgt;
65 u32 ethipgr;
66 u32 ethclrt;
67 u32 ethmaxf;
68 u32 eth_u10; /* Reserved. */
69 u32 ethmtest;
70 u32 miimcfg;
71 u32 miimcmd;
72 u32 miimaddr;
73 u32 miimwtd;
74 u32 miimrdd;
75 u32 miimind;
76 u32 eth_u11; /* Reserved. */
77 u32 eth_u12; /* Reserved. */
78 u32 ethcfsa0;
79 u32 ethcfsa1;
80 u32 ethcfsa2;
81};
82
83/* Ethernet interrupt registers */
84#define ETH_INT_FC_EN (1 << 0)
85#define ETH_INT_FC_ITS (1 << 1)
86#define ETH_INT_FC_RIP (1 << 2)
87#define ETH_INT_FC_JAM (1 << 3)
88#define ETH_INT_FC_OVR (1 << 4)
89#define ETH_INT_FC_UND (1 << 5)
90#define ETH_INT_FC_IOC 0x000000c0
91
92/* Ethernet FIFO registers */
93#define ETH_FIFI_TT_TTH_BIT 0
94#define ETH_FIFO_TT_TTH 0x0000007f
95
96/* Ethernet ARC/multicast registers */
97#define ETH_ARC_PRO (1 << 0)
98#define ETH_ARC_AM (1 << 1)
99#define ETH_ARC_AFM (1 << 2)
100#define ETH_ARC_AB (1 << 3)
101
102/* Ethernet SAL registers */
103#define ETH_SAL_BYTE_5 0x000000ff
104#define ETH_SAL_BYTE_4 0x0000ff00
105#define ETH_SAL_BYTE_3 0x00ff0000
106#define ETH_SAL_BYTE_2 0xff000000
107
108/* Ethernet SAH registers */
109#define ETH_SAH_BYTE1 0x000000ff
110#define ETH_SAH_BYTE0 0x0000ff00
111
112/* Ethernet GPF register */
113#define ETH_GPF_PTV 0x0000ffff
114
115/* Ethernet PFG register */
116#define ETH_PFS_PFD (1 << 0)
117
118/* Ethernet CFSA[0-3] registers */
119#define ETH_CFSA0_CFSA4 0x000000ff
120#define ETH_CFSA0_CFSA5 0x0000ff00
121#define ETH_CFSA1_CFSA2 0x000000ff
122#define ETH_CFSA1_CFSA3 0x0000ff00
123#define ETH_CFSA1_CFSA0 0x000000ff
124#define ETH_CFSA1_CFSA1 0x0000ff00
125
126/* Ethernet MAC1 registers */
127#define ETH_MAC1_RE (1 << 0)
128#define ETH_MAC1_PAF (1 << 1)
129#define ETH_MAC1_RFC (1 << 2)
130#define ETH_MAC1_TFC (1 << 3)
131#define ETH_MAC1_LB (1 << 4)
132#define ETH_MAC1_MR (1 << 31)
133
134/* Ethernet MAC2 registers */
135#define ETH_MAC2_FD (1 << 0)
136#define ETH_MAC2_FLC (1 << 1)
137#define ETH_MAC2_HFE (1 << 2)
138#define ETH_MAC2_DC (1 << 3)
139#define ETH_MAC2_CEN (1 << 4)
140#define ETH_MAC2_PE (1 << 5)
141#define ETH_MAC2_VPE (1 << 6)
142#define ETH_MAC2_APE (1 << 7)
143#define ETH_MAC2_PPE (1 << 8)
144#define ETH_MAC2_LPE (1 << 9)
145#define ETH_MAC2_NB (1 << 12)
146#define ETH_MAC2_BP (1 << 13)
147#define ETH_MAC2_ED (1 << 14)
148
149/* Ethernet IPGT register */
150#define ETH_IPGT 0x0000007f
151
152/* Ethernet IPGR registers */
153#define ETH_IPGR_IPGR2 0x0000007f
154#define ETH_IPGR_IPGR1 0x00007f00
155
156/* Ethernet CLRT registers */
157#define ETH_CLRT_MAX_RET 0x0000000f
158#define ETH_CLRT_COL_WIN 0x00003f00
159
160/* Ethernet MAXF register */
161#define ETH_MAXF 0x0000ffff
162
163/* Ethernet test registers */
164#define ETH_TEST_REG (1 << 2)
165#define ETH_MCP_DIV 0x000000ff
166
167/* MII registers */
168#define ETH_MII_CFG_RSVD 0x0000000c
169#define ETH_MII_CMD_RD (1 << 0)
170#define ETH_MII_CMD_SCN (1 << 1)
171#define ETH_MII_REG_ADDR 0x0000001f
172#define ETH_MII_PHY_ADDR 0x00001f00
173#define ETH_MII_WTD_DATA 0x0000ffff
174#define ETH_MII_RDD_DATA 0x0000ffff
175#define ETH_MII_IND_BSY (1 << 0)
176#define ETH_MII_IND_SCN (1 << 1)
177#define ETH_MII_IND_NV (1 << 2)
178
179/*
180 * Values for the DEVCS field of the Ethernet DMA Rx and Tx descriptors.
181 */
182
183#define ETH_RX_FD (1 << 0)
184#define ETH_RX_LD (1 << 1)
185#define ETH_RX_ROK (1 << 2)
186#define ETH_RX_FM (1 << 3)
187#define ETH_RX_MP (1 << 4)
188#define ETH_RX_BP (1 << 5)
189#define ETH_RX_VLT (1 << 6)
190#define ETH_RX_CF (1 << 7)
191#define ETH_RX_OVR (1 << 8)
192#define ETH_RX_CRC (1 << 9)
193#define ETH_RX_CV (1 << 10)
194#define ETH_RX_DB (1 << 11)
195#define ETH_RX_LE (1 << 12)
196#define ETH_RX_LOR (1 << 13)
197#define ETH_RX_CES (1 << 14)
198#define ETH_RX_LEN_BIT 16
199#define ETH_RX_LEN 0xffff0000
200
201#define ETH_TX_FD (1 << 0)
202#define ETH_TX_LD (1 << 1)
203#define ETH_TX_OEN (1 << 2)
204#define ETH_TX_PEN (1 << 3)
205#define ETH_TX_CEN (1 << 4)
206#define ETH_TX_HEN (1 << 5)
207#define ETH_TX_TOK (1 << 6)
208#define ETH_TX_MP (1 << 7)
209#define ETH_TX_BP (1 << 8)
210#define ETH_TX_UND (1 << 9)
211#define ETH_TX_OF (1 << 10)
212#define ETH_TX_ED (1 << 11)
213#define ETH_TX_EC (1 << 12)
214#define ETH_TX_LC (1 << 13)
215#define ETH_TX_TD (1 << 14)
216#define ETH_TX_CRC (1 << 15)
217#define ETH_TX_LE (1 << 16)
218#define ETH_TX_CC 0x001E0000
219
220#endif /* __ASM_RC32434_ETH_H */
diff --git a/include/asm-mips/mach-rc32434/gpio.h b/include/asm-mips/mach-rc32434/gpio.h
deleted file mode 100644
index f946f5f45bbb..000000000000
--- a/include/asm-mips/mach-rc32434/gpio.h
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 * Copyright 2002 Integrated Device Technology, Inc.
3 * All rights reserved.
4 *
5 * GPIO register definition.
6 *
7 * Author : ryan.holmQVist@idt.com
8 * Date : 20011005
9 * Copyright (C) 2001, 2002 Ryan Holm <ryan.holmQVist@idt.com>
10 * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
11 */
12
13#ifndef _RC32434_GPIO_H_
14#define _RC32434_GPIO_H_
15
16#include <linux/types.h>
17
18struct rb532_gpio_reg {
19 u32 gpiofunc; /* GPIO Function Register
20 * gpiofunc[x]==0 bit = gpio
21 * func[x]==1 bit = altfunc
22 */
23 u32 gpiocfg; /* GPIO Configuration Register
24 * gpiocfg[x]==0 bit = input
25 * gpiocfg[x]==1 bit = output
26 */
27 u32 gpiod; /* GPIO Data Register
28 * gpiod[x] read/write gpio pinX status
29 */
30 u32 gpioilevel; /* GPIO Interrupt Status Register
31 * interrupt level (see gpioistat)
32 */
33 u32 gpioistat; /* Gpio Interrupt Status Register
34 * istat[x] = (gpiod[x] == level[x])
35 * cleared in ISR (STICKY bits)
36 */
37 u32 gpionmien; /* GPIO Non-maskable Interrupt Enable Register */
38};
39
40/* UART GPIO signals */
41#define RC32434_UART0_SOUT (1 << 0)
42#define RC32434_UART0_SIN (1 << 1)
43#define RC32434_UART0_RTS (1 << 2)
44#define RC32434_UART0_CTS (1 << 3)
45
46/* M & P bus GPIO signals */
47#define RC32434_MP_BIT_22 (1 << 4)
48#define RC32434_MP_BIT_23 (1 << 5)
49#define RC32434_MP_BIT_24 (1 << 6)
50#define RC32434_MP_BIT_25 (1 << 7)
51
52/* CPU GPIO signals */
53#define RC32434_CPU_GPIO (1 << 8)
54
55/* Reserved GPIO signals */
56#define RC32434_AF_SPARE_6 (1 << 9)
57#define RC32434_AF_SPARE_4 (1 << 10)
58#define RC32434_AF_SPARE_3 (1 << 11)
59#define RC32434_AF_SPARE_2 (1 << 12)
60
61/* PCI messaging unit */
62#define RC32434_PCI_MSU_GPIO (1 << 13)
63
64
65extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val);
66extern unsigned get_434_reg(unsigned reg_offs);
67extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
68extern unsigned char get_latch_u5(void);
69
70extern int rb532_gpio_get_value(unsigned gpio);
71extern void rb532_gpio_set_value(unsigned gpio, int value);
72extern int rb532_gpio_direction_input(unsigned gpio);
73extern int rb532_gpio_direction_output(unsigned gpio, int value);
74extern void rb532_gpio_set_int_level(unsigned gpio, int value);
75extern int rb532_gpio_get_int_level(unsigned gpio);
76extern void rb532_gpio_set_int_status(unsigned gpio, int value);
77extern int rb532_gpio_get_int_status(unsigned gpio);
78
79
80/* Wrappers for the arch-neutral GPIO API */
81
82static inline int gpio_request(unsigned gpio, const char *label)
83{
84 /* Not yet implemented */
85 return 0;
86}
87
88static inline void gpio_free(unsigned gpio)
89{
90 /* Not yet implemented */
91}
92
93static inline int gpio_direction_input(unsigned gpio)
94{
95 return rb532_gpio_direction_input(gpio);
96}
97
98static inline int gpio_direction_output(unsigned gpio, int value)
99{
100 return rb532_gpio_direction_output(gpio, value);
101}
102
103static inline int gpio_get_value(unsigned gpio)
104{
105 return rb532_gpio_get_value(gpio);
106}
107
108static inline void gpio_set_value(unsigned gpio, int value)
109{
110 rb532_gpio_set_value(gpio, value);
111}
112
113static inline int gpio_to_irq(unsigned gpio)
114{
115 return gpio;
116}
117
118static inline int irq_to_gpio(unsigned irq)
119{
120 return irq;
121}
122
123/* For cansleep */
124#include <asm-generic/gpio.h>
125
126#endif /* _RC32434_GPIO_H_ */
diff --git a/include/asm-mips/mach-rc32434/integ.h b/include/asm-mips/mach-rc32434/integ.h
deleted file mode 100644
index fa65bc3d8807..000000000000
--- a/include/asm-mips/mach-rc32434/integ.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * Definitions for the Watchdog registers
3 *
4 * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef __RC32434_INTEG_H__
30#define __RC32434_INTEG_H__
31
32#include <asm/mach-rc32434/rb.h>
33
34#define INTEG0_BASE_ADDR 0x18030030
35
36struct integ {
37 u32 errcs; /* sticky use ERRCS_ */
38 u32 wtcount; /* Watchdog timer count reg. */
39 u32 wtcompare; /* Watchdog timer timeout value. */
40 u32 wtc; /* Watchdog timer control. use WTC_ */
41};
42
43/* Error counters */
44#define RC32434_ERR_WTO 0
45#define RC32434_ERR_WNE 1
46#define RC32434_ERR_UCW 2
47#define RC32434_ERR_UCR 3
48#define RC32434_ERR_UPW 4
49#define RC32434_ERR_UPR 5
50#define RC32434_ERR_UDW 6
51#define RC32434_ERR_UDR 7
52#define RC32434_ERR_SAE 8
53#define RC32434_ERR_WRE 9
54
55/* Watchdog control bits */
56#define RC32434_WTC_EN 0
57#define RC32434_WTC_TO 1
58
59#endif /* __RC32434_INTEG_H__ */
diff --git a/include/asm-mips/mach-rc32434/irq.h b/include/asm-mips/mach-rc32434/irq.h
deleted file mode 100644
index cb9e4725f5dc..000000000000
--- a/include/asm-mips/mach-rc32434/irq.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_RC32434_IRQ_H
2#define __ASM_RC32434_IRQ_H
3
4#define NR_IRQS 256
5
6#include <asm/mach-generic/irq.h>
7
8#endif /* __ASM_RC32434_IRQ_H */
diff --git a/include/asm-mips/mach-rc32434/pci.h b/include/asm-mips/mach-rc32434/pci.h
deleted file mode 100644
index 410638f2af74..000000000000
--- a/include/asm-mips/mach-rc32434/pci.h
+++ /dev/null
@@ -1,481 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
8 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
10 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
11 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
12 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
13 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
14 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
16 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 * Copyright 2004 IDT Inc. (rischelp@idt.com)
23 *
24 * Initial Release
25 */
26
27#ifndef _ASM_RC32434_PCI_H_
28#define _ASM_RC32434_PCI_H_
29
30#define epld_mask ((volatile unsigned char *)0xB900000d)
31
32#define PCI0_BASE_ADDR 0x18080000
33#define PCI_LBA_COUNT 4
34
35struct pci_map {
36 u32 address; /* Address. */
37 u32 control; /* Control. */
38 u32 mapping; /* mapping. */
39};
40
41struct pci_reg {
42 u32 pcic;
43 u32 pcis;
44 u32 pcism;
45 u32 pcicfga;
46 u32 pcicfgd;
47 volatile struct pci_map pcilba[PCI_LBA_COUNT];
48 u32 pcidac;
49 u32 pcidas;
50 u32 pcidasm;
51 u32 pcidad;
52 u32 pcidma8c;
53 u32 pcidma9c;
54 u32 pcitc;
55};
56
57#define PCI_MSU_COUNT 2
58
59struct pci_msu {
60 u32 pciim[PCI_MSU_COUNT];
61 u32 pciom[PCI_MSU_COUNT];
62 u32 pciid;
63 u32 pciiic;
64 u32 pciiim;
65 u32 pciiod;
66 u32 pciioic;
67 u32 pciioim;
68};
69
70/*
71 * PCI Control Register
72 */
73
74#define PCI_CTL_EN (1 << 0)
75#define PCI_CTL_TNR (1 << 1)
76#define PCI_CTL_SCE (1 << 2)
77#define PCI_CTL_IEN (1 << 3)
78#define PCI_CTL_AAA (1 << 4)
79#define PCI_CTL_EAP (1 << 5)
80#define PCI_CTL_PCIM_BIT 6
81#define PCI_CTL_PCIM 0x000001c0
82
83#define PCI_CTL_PCIM_DIS 0
84#define PCI_CTL_PCIM_TNR 1 /* Satellite - target not ready */
85#define PCI_CTL_PCIM_SUS 2 /* Satellite - suspended CPU. */
86#define PCI_CTL_PCIM_EXT 3 /* Host - external arbiter. */
87#define PCI_CTL PCIM_PRIO 4 /* Host - fixed priority arb. */
88#define PCI_CTL_PCIM_RR 5 /* Host - round robin priority. */
89#define PCI_CTL_PCIM_RSVD6 6
90#define PCI_CTL_PCIM_RSVD7 7
91
92#define PCI_CTL_IGM (1 << 9)
93
94/*
95 * PCI Status Register
96 */
97
98#define PCI_STAT_EED (1 << 0)
99#define PCI_STAT_WR (1 << 1)
100#define PCI_STAT_NMI (1 << 2)
101#define PCI_STAT_II (1 << 3)
102#define PCI_STAT_CWE (1 << 4)
103#define PCI_STAT_CRE (1 << 5)
104#define PCI_STAT_MDPE (1 << 6)
105#define PCI_STAT_STA (1 << 7)
106#define PCI_STAT_RTA (1 << 8)
107#define PCI_STAT_RMA (1 << 9)
108#define PCI_STAT_SSE (1 << 10)
109#define PCI_STAT_OSE (1 << 11)
110#define PCI_STAT_PE (1 << 12)
111#define PCI_STAT_TAE (1 << 13)
112#define PCI_STAT_RLE (1 << 14)
113#define PCI_STAT_BME (1 << 15)
114#define PCI_STAT_PRD (1 << 16)
115#define PCI_STAT_RIP (1 << 17)
116
117/*
118 * PCI Status Mask Register
119 */
120
121#define PCI_STATM_EED PCI_STAT_EED
122#define PCI_STATM_WR PCI_STAT_WR
123#define PCI_STATM_NMI PCI_STAT_NMI
124#define PCI_STATM_II PCI_STAT_II
125#define PCI_STATM_CWE PCI_STAT_CWE
126#define PCI_STATM_CRE PCI_STAT_CRE
127#define PCI_STATM_MDPE PCI_STAT_MDPE
128#define PCI_STATM_STA PCI_STAT_STA
129#define PCI_STATM_RTA PCI_STAT_RTA
130#define PCI_STATM_RMA PCI_STAT_RMA
131#define PCI_STATM_SSE PCI_STAT_SSE
132#define PCI_STATM_OSE PCI_STAT_OSE
133#define PCI_STATM_PE PCI_STAT_PE
134#define PCI_STATM_TAE PCI_STAT_TAE
135#define PCI_STATM_RLE PCI_STAT_RLE
136#define PCI_STATM_BME PCI_STAT_BME
137#define PCI_STATM_PRD PCI_STAT_PRD
138#define PCI_STATM_RIP PCI_STAT_RIP
139
140/*
141 * PCI Configuration Address Register
142 */
143#define PCI_CFGA_REG_BIT 2
144#define PCI_CFGA_REG 0x000000fc
145#define PCI_CFGA_REG_ID (0x00 >> 2) /* use PCFGID */
146#define PCI_CFGA_REG_04 (0x04 >> 2) /* use PCFG04_ */
147#define PCI_CFGA_REG_08 (0x08 >> 2) /* use PCFG08_ */
148#define PCI_CFGA_REG_0C (0x0C >> 2) /* use PCFG0C_ */
149#define PCI_CFGA_REG_PBA0 (0x10 >> 2) /* use PCIPBA_ */
150#define PCI_CFGA_REG_PBA1 (0x14 >> 2) /* use PCIPBA_ */
151#define PCI_CFGA_REG_PBA2 (0x18 >> 2) /* use PCIPBA_ */
152#define PCI_CFGA_REG_PBA3 (0x1c >> 2) /* use PCIPBA_ */
153#define PCI_CFGA_REG_SUBSYS (0x2c >> 2) /* use PCFGSS_ */
154#define PCI_CFGA_REG_3C (0x3C >> 2) /* use PCFG3C_ */
155#define PCI_CFGA_REG_PBBA0C (0x44 >> 2) /* use PCIPBAC_ */
156#define PCI_CFGA_REG_PBA0M (0x48 >> 2)
157#define PCI_CFGA_REG_PBA1C (0x4c >> 2) /* use PCIPBAC_ */
158#define PCI_CFGA_REG_PBA1M (0x50 >> 2)
159#define PCI_CFGA_REG_PBA2C (0x54 >> 2) /* use PCIPBAC_ */
160#define PCI_CFGA_REG_PBA2M (0x58 >> 2)
161#define PCI_CFGA_REG_PBA3C (0x5c >> 2) /* use PCIPBAC_ */
162#define PCI_CFGA_REG_PBA3M (0x60 >> 2)
163#define PCI_CFGA_REG_PMGT (0x64 >> 2)
164#define PCI_CFGA_FUNC_BIT 8
165#define PCI_CFGA_FUNC 0x00000700
166#define PCI_CFGA_DEV_BIT 11
167#define PCI_CFGA_DEV 0x0000f800
168#define PCI_CFGA_DEV_INTERN 0
169#define PCI_CFGA_BUS_BIT 16
170#define PCI CFGA_BUS 0x00ff0000
171#define PCI_CFGA_BUS_TYPE0 0
172#define PCI_CFGA_EN (1 << 31)
173
174/* PCI CFG04 commands */
175#define PCI_CFG04_CMD_IO_ENA (1 << 0)
176#define PCI_CFG04_CMD_MEM_ENA (1 << 1)
177#define PCI_CFG04_CMD_BM_ENA (1 << 2)
178#define PCI_CFG04_CMD_MW_INV (1 << 4)
179#define PCI_CFG04_CMD_PAR_ENA (1 << 6)
180#define PCI_CFG04_CMD_SER_ENA (1 << 8)
181#define PCI_CFG04_CMD_FAST_ENA (1 << 9)
182
183/* PCI CFG04 status fields */
184#define PCI_CFG04_STAT_BIT 16
185#define PCI_CFG04_STAT 0xffff0000
186#define PCI_CFG04_STAT_66_MHZ (1 << 21)
187#define PCI_CFG04_STAT_FBB (1 << 23)
188#define PCI_CFG04_STAT_MDPE (1 << 24)
189#define PCI_CFG04_STAT_DST (1 << 25)
190#define PCI_CFG04_STAT_STA (1 << 27)
191#define PCI_CFG04_STAT_RTA (1 << 28)
192#define PCI_CFG04_STAT_RMA (1 << 29)
193#define PCI_CFG04_STAT_SSE (1 << 30)
194#define PCI_CFG04_STAT_PE (1 << 31)
195
196#define PCI_PBA_MSI (1 << 0)
197#define PCI_PBA_P (1 << 2)
198
199/* PCI PBAC registers */
200#define PCI_PBAC_MSI (1 << 0)
201#define PCI_PBAC_P (1 << 1)
202#define PCI_PBAC_SIZE_BIT 2
203#define PCI_PBAC_SIZE 0x0000007c
204#define PCI_PBAC_SB (1 << 7)
205#define PCI_PBAC_PP (1 << 8)
206#define PCI_PBAC_MR_BIT 9
207#define PCI_PBAC_MR 0x00000600
208#define PCI_PBAC_MR_RD 0
209#define PCI_PBAC_MR_RD_LINE 1
210#define PCI_PBAC_MR_RD_MULT 2
211#define PCI_PBAC_MRL (1 << 11)
212#define PCI_PBAC_MRM (1 << 12)
213#define PCI_PBAC_TRP (1 << 13)
214
215#define PCI_CFG40_TRDY_TIM 0x000000ff
216#define PCI_CFG40_RET_LIM 0x0000ff00
217
218/*
219 * PCI Local Base Address [0|1|2|3] Register
220 */
221
222#define PCI_LBA_BADDR_BIT 0
223#define PCI_LBA_BADDR 0xffffff00
224
225/*
226 * PCI Local Base Address Control Register
227 */
228
229#define PCI_LBAC_MSI (1 << 0)
230#define PCI_LBAC_MSI_MEM 0
231#define PCI_LBAC_MSI_IO 1
232#define PCI_LBAC_SIZE_BIT 2
233#define PCI_LBAC_SIZE 0x0000007c
234#define PCI_LBAC_SB (1 << 7)
235#define PCI_LBAC_RT (1 << 8)
236#define PCI_LBAC_RT_NO_PREF 0
237#define PCI_LBAC_RT_PREF 1
238
239/*
240 * PCI Local Base Address [0|1|2|3] Mapping Register
241 */
242#define PCI_LBAM_MADDR_BIT 8
243#define PCI_LBAM_MADDR 0xffffff00
244
245/*
246 * PCI Decoupled Access Control Register
247 */
248#define PCI_DAC_DEN (1 << 0)
249
250/*
251 * PCI Decoupled Access Status Register
252 */
253#define PCI_DAS_D (1 << 0)
254#define PCI_DAS_B (1 << 1)
255#define PCI_DAS_E (1 << 2)
256#define PCI_DAS_OFE (1 << 3)
257#define PCI_DAS_OFF (1 << 4)
258#define PCI_DAS_IFE (1 << 5)
259#define PCI_DAS_IFF (1 << 6)
260
261/*
262 * PCI DMA Channel 8 Configuration Register
263 */
264#define PCI_DMA8C_MBS_BIT 0
265#define PCI_DMA8C_MBS 0x00000fff /* Maximum Burst Size. */
266#define PCI_DMA8C_OUR (1 << 12)
267
268/*
269 * PCI DMA Channel 9 Configuration Register
270 */
271#define PCI_DMA9C_MBS_BIT 0 /* Maximum Burst Size. */
272#define PCI_DMA9C_MBS 0x00000fff
273
274/*
275 * PCI to Memory(DMA Channel 8) AND Memory to PCI DMA(DMA Channel 9)Descriptors
276 */
277
278#define PCI_DMAD_PT_BIT 22 /* in DEVCMD field (descriptor) */
279#define PCI_DMAD_PT 0x00c00000 /* preferred transaction field */
280/* These are for reads (DMA channel 8) */
281#define PCI_DMAD_DEVCMD_MR 0 /* memory read */
282#define PCI_DMAD_DEVCMD_MRL 1 /* memory read line */
283#define PCI_DMAD_DEVCMD_MRM 2 /* memory read multiple */
284#define PCI_DMAD_DEVCMD_IOR 3 /* I/O read */
285/* These are for writes (DMA channel 9) */
286#define PCI_DMAD_DEVCMD_MW 0 /* memory write */
287#define PCI_DMAD_DEVCMD_MWI 1 /* memory write invalidate */
288#define PCI_DMAD_DEVCMD_IOW 3 /* I/O write */
289
290/* Swap byte field applies to both DMA channel 8 and 9 */
291#define PCI_DMAD_SB (1 << 24) /* swap byte field */
292
293
294/*
295 * PCI Target Control Register
296 */
297
298#define PCI_TC_RTIMER_BIT 0
299#define PCI_TC_RTIMER 0x000000ff
300#define PCI_TC_DTIMER_BIT 8
301#define PCI_TC_DTIMER 0x0000ff00
302#define PCI_TC_RDR (1 << 18)
303#define PCI_TC_DDT (1 << 19)
304
305/*
306 * PCI messaging unit [applies to both inbound and outbound registers ]
307 */
308#define PCI_MSU_M0 (1 << 0)
309#define PCI_MSU_M1 (1 << 1)
310#define PCI_MSU_DB (1 << 2)
311
312#define PCI_MSG_ADDR 0xB8088010
313#define PCI0_ADDR 0xB8080000
314#define rc32434_pci ((struct pci_reg *) PCI0_ADDR)
315#define rc32434_pci_msg ((struct pci_msu *) PCI_MSG_ADDR)
316
317#define PCIM_SHFT 0x6
318#define PCIM_BIT_LEN 0x7
319#define PCIM_H_EA 0x3
320#define PCIM_H_IA_FIX 0x4
321#define PCIM_H_IA_RR 0x5
322#if 0
323#define PCI_ADDR_START 0x13000000
324#endif
325
326#define PCI_ADDR_START 0x50000000
327
328#define CPUTOPCI_MEM_WIN 0x02000000
329#define CPUTOPCI_IO_WIN 0x00100000
330#define PCILBA_SIZE_SHFT 2
331#define PCILBA_SIZE_MASK 0x1F
332#define SIZE_256MB 0x1C
333#define SIZE_128MB 0x1B
334#define SIZE_64MB 0x1A
335#define SIZE_32MB 0x19
336#define SIZE_16MB 0x18
337#define SIZE_4MB 0x16
338#define SIZE_2MB 0x15
339#define SIZE_1MB 0x14
340#define KORINA_CONFIG0_ADDR 0x80000000
341#define KORINA_CONFIG1_ADDR 0x80000004
342#define KORINA_CONFIG2_ADDR 0x80000008
343#define KORINA_CONFIG3_ADDR 0x8000000C
344#define KORINA_CONFIG4_ADDR 0x80000010
345#define KORINA_CONFIG5_ADDR 0x80000014
346#define KORINA_CONFIG6_ADDR 0x80000018
347#define KORINA_CONFIG7_ADDR 0x8000001C
348#define KORINA_CONFIG8_ADDR 0x80000020
349#define KORINA_CONFIG9_ADDR 0x80000024
350#define KORINA_CONFIG10_ADDR 0x80000028
351#define KORINA_CONFIG11_ADDR 0x8000002C
352#define KORINA_CONFIG12_ADDR 0x80000030
353#define KORINA_CONFIG13_ADDR 0x80000034
354#define KORINA_CONFIG14_ADDR 0x80000038
355#define KORINA_CONFIG15_ADDR 0x8000003C
356#define KORINA_CONFIG16_ADDR 0x80000040
357#define KORINA_CONFIG17_ADDR 0x80000044
358#define KORINA_CONFIG18_ADDR 0x80000048
359#define KORINA_CONFIG19_ADDR 0x8000004C
360#define KORINA_CONFIG20_ADDR 0x80000050
361#define KORINA_CONFIG21_ADDR 0x80000054
362#define KORINA_CONFIG22_ADDR 0x80000058
363#define KORINA_CONFIG23_ADDR 0x8000005C
364#define KORINA_CONFIG24_ADDR 0x80000060
365#define KORINA_CONFIG25_ADDR 0x80000064
366#define KORINA_CMD (PCI_CFG04_CMD_IO_ENA | \
367 PCI_CFG04_CMD_MEM_ENA | \
368 PCI_CFG04_CMD_BM_ENA | \
369 PCI_CFG04_CMD_MW_INV | \
370 PCI_CFG04_CMD_PAR_ENA | \
371 PCI_CFG04_CMD_SER_ENA)
372
373#define KORINA_STAT (PCI_CFG04_STAT_MDPE | \
374 PCI_CFG04_STAT_STA | \
375 PCI_CFG04_STAT_RTA | \
376 PCI_CFG04_STAT_RMA | \
377 PCI_CFG04_STAT_SSE | \
378 PCI_CFG04_STAT_PE)
379
380#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
381
382#define KORINA_REVID 0
383#define KORINA_CLASS_CODE 0
384#define KORINA_CNFG2 ((KORINA_CLASS_CODE<<8) | \
385 KORINA_REVID)
386
387#define KORINA_CACHE_LINE_SIZE 4
388#define KORINA_MASTER_LAT 0x3c
389#define KORINA_HEADER_TYPE 0
390#define KORINA_BIST 0
391
392#define KORINA_CNFG3 ((KORINA_BIST << 24) | \
393 (KORINA_HEADER_TYPE<<16) | \
394 (KORINA_MASTER_LAT<<8) | \
395 KORINA_CACHE_LINE_SIZE)
396
397#define KORINA_BAR0 0x00000008 /* 128 MB Memory */
398#define KORINA_BAR1 0x18800001 /* 1 MB IO */
399#define KORINA_BAR2 0x18000001 /* 2 MB IO window for Korina
400 internal Registers */
401#define KORINA_BAR3 0x48000008 /* Spare 128 MB Memory */
402
403#define KORINA_CNFG4 KORINA_BAR0
404#define KORINA_CNFG5 KORINA_BAR1
405#define KORINA_CNFG6 KORINA_BAR2
406#define KORINA_CNFG7 KORINA_BAR3
407
408#define KORINA_SUBSYS_VENDOR_ID 0x011d
409#define KORINA_SUBSYSTEM_ID 0x0214
410#define KORINA_CNFG8 0
411#define KORINA_CNFG9 0
412#define KORINA_CNFG10 0
413#define KORINA_CNFG11 ((KORINA_SUBSYS_VENDOR_ID<<16) | \
414 KORINA_SUBSYSTEM_ID)
415#define KORINA_INT_LINE 1
416#define KORINA_INT_PIN 1
417#define KORINA_MIN_GNT 8
418#define KORINA_MAX_LAT 0x38
419#define KORINA_CNFG12 0
420#define KORINA_CNFG13 0
421#define KORINA_CNFG14 0
422#define KORINA_CNFG15 ((KORINA_MAX_LAT<<24) | \
423 (KORINA_MIN_GNT<<16) | \
424 (KORINA_INT_PIN<<8) | \
425 KORINA_INT_LINE)
426#define KORINA_RETRY_LIMIT 0x80
427#define KORINA_TRDY_LIMIT 0x80
428#define KORINA_CNFG16 ((KORINA_RETRY_LIMIT<<8) | \
429 KORINA_TRDY_LIMIT)
430#define PCI_PBAxC_R 0x0
431#define PCI_PBAxC_RL 0x1
432#define PCI_PBAxC_RM 0x2
433#define SIZE_SHFT 2
434
435#if defined(__MIPSEB__)
436#define KORINA_PBA0C (PCI_PBAC_MRL | PCI_PBAC_SB | \
437 ((PCI_PBAxC_RM & 0x3) << PCI_PBAC_MR_BIT) | \
438 PCI_PBAC_PP | \
439 (SIZE_128MB<<SIZE_SHFT) | \
440 PCI_PBAC_P)
441#else
442#define KORINA_PBA0C (PCI_PBAC_MRL | \
443 ((PCI_PBAxC_RM & 0x3) << PCI_PBAC_MR_BIT) | \
444 PCI_PBAC_PP | \
445 (SIZE_128MB<<SIZE_SHFT) | \
446 PCI_PBAC_P)
447#endif
448#define KORINA_CNFG17 KORINA_PBA0C
449#define KORINA_PBA0M 0x0
450#define KORINA_CNFG18 KORINA_PBA0M
451
452#if defined(__MIPSEB__)
453#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | PCI_PBAC_SB | \
454 PCI_PBAC_MSI)
455#else
456#define KORINA_PBA1C ((SIZE_1MB<<SIZE_SHFT) | \
457 PCI_PBAC_MSI)
458#endif
459#define KORINA_CNFG19 KORINA_PBA1C
460#define KORINA_PBA1M 0x0
461#define KORINA_CNFG20 KORINA_PBA1M
462
463#if defined(__MIPSEB__)
464#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | PCI_PBAC_SB | \
465 PCI_PBAC_MSI)
466#else
467#define KORINA_PBA2C ((SIZE_2MB<<SIZE_SHFT) | \
468 PCI_PBAC_MSI)
469#endif
470#define KORINA_CNFG21 KORINA_PBA2C
471#define KORINA_PBA2M 0x18000000
472#define KORINA_CNFG22 KORINA_PBA2M
473#define KORINA_PBA3C 0
474#define KORINA_CNFG23 KORINA_PBA3C
475#define KORINA_PBA3M 0
476#define KORINA_CNFG24 KORINA_PBA3M
477
478#define PCITC_DTIMER_VAL 8
479#define PCITC_RTIMER_VAL 0x10
480
481#endif /* __ASM_RC32434_PCI_H */
diff --git a/include/asm-mips/mach-rc32434/prom.h b/include/asm-mips/mach-rc32434/prom.h
deleted file mode 100644
index 1d66ddcda89a..000000000000
--- a/include/asm-mips/mach-rc32434/prom.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Definitions for the PROM
3 *
4 * Copyright 2002 Ryan Holm <ryan.holmQVist@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#define PROM_ENTRY(x) (0xbfc00000 + ((x) * 8))
30
31#define GPIO_INIT_NOBUTTON ""
32#define GPIO_INIT_BUTTON " 2"
33
34#define SR_NMI 0x00180000
35#define SERIAL_SPEED_ENTRY 0x00000001
36
37#define FREQ_TAG "HZ="
38#define GPIO_TAG "gpio="
39#define KMAC_TAG "kmac="
40#define MEM_TAG "mem="
41#define BOARD_TAG "board="
42
43#define BOARD_RB532 "500"
44#define BOARD_RB532A "500r5"
diff --git a/include/asm-mips/mach-rc32434/rb.h b/include/asm-mips/mach-rc32434/rb.h
deleted file mode 100644
index e0a76e3ffea8..000000000000
--- a/include/asm-mips/mach-rc32434/rb.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * Copyright (C) 2004 IDT Inc.
13 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
14 */
15#ifndef __ASM_RC32434_RB_H
16#define __ASM_RC32434_RB_H
17
18#include <linux/genhd.h>
19
20#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(0x18000000))
21#define DEV0BASE 0x010000
22#define DEV0MASK 0x010004
23#define DEV0C 0x010008
24#define DEV0T 0x01000C
25#define DEV1BASE 0x010010
26#define DEV1MASK 0x010014
27#define DEV1C 0x010018
28#define DEV1TC 0x01001C
29#define DEV2BASE 0x010020
30#define DEV2MASK 0x010024
31#define DEV2C 0x010028
32#define DEV2TC 0x01002C
33#define DEV3BASE 0x010030
34#define DEV3MASK 0x010034
35#define DEV3C 0x010038
36#define DEV3TC 0x01003C
37#define BTCS 0x010040
38#define BTCOMPARE 0x010044
39#define GPIOBASE 0x050000
40#define GPIOCFG 0x050004
41#define GPIOD 0x050008
42#define GPIOILEVEL 0x05000C
43#define GPIOISTAT 0x050010
44#define GPIONMIEN 0x050014
45#define IMASK6 0x038038
46#define LO_WPX (1 << 0)
47#define LO_ALE (1 << 1)
48#define LO_CLE (1 << 2)
49#define LO_CEX (1 << 3)
50#define LO_FOFF (1 << 5)
51#define LO_SPICS (1 << 6)
52#define LO_ULED (1 << 7)
53
54#define BIT_TO_MASK(x) (1 << x)
55
56struct dev_reg {
57 u32 base;
58 u32 mask;
59 u32 ctl;
60 u32 timing;
61};
62
63struct korina_device {
64 char *name;
65 unsigned char mac[6];
66 struct net_device *dev;
67};
68
69struct cf_device {
70 int gpio_pin;
71 void *dev;
72 struct gendisk *gd;
73};
74
75struct mpmc_device {
76 unsigned char state;
77 spinlock_t lock;
78 void __iomem *base;
79};
80
81#endif /* __ASM_RC32434_RB_H */
diff --git a/include/asm-mips/mach-rc32434/rc32434.h b/include/asm-mips/mach-rc32434/rc32434.h
deleted file mode 100644
index c4a02145104e..000000000000
--- a/include/asm-mips/mach-rc32434/rc32434.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Definitions for IDT RC323434 CPU.
3 */
4
5#ifndef _ASM_RC32434_RC32434_H_
6#define _ASM_RC32434_RC32434_H_
7
8#include <linux/delay.h>
9#include <linux/io.h>
10
11#define RC32434_REG_BASE 0x18000000
12#define RC32434_RST (1 << 15)
13
14#define IDT_CLOCK_MULT 2
15#define MIPS_CPU_TIMER_IRQ 7
16
17/* Interrupt Controller */
18#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
19#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
20#define IC_GROUP_OFFSET 0x0C
21
22#define NUM_INTR_GROUPS 5
23
24/* 16550 UARTs */
25#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
26 /* GRP3 IRQ numbers start here */
27#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32)
28 /* GRP4 IRQ numbers start here */
29#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32)
30 /* GRP5 IRQ numbers start here */
31#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32)
32#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)
33
34
35#ifdef __MIPSEB__
36#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
37#else
38#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
39#endif
40
41#define RC32434_UART0_IRQ (GROUP3_IRQ_BASE + 0)
42
43/* cpu pipeline flush */
44static inline void rc32434_sync(void)
45{
46 __asm__ volatile ("sync");
47}
48
49static inline void rc32434_sync_udelay(int us)
50{
51 __asm__ volatile ("sync");
52 udelay(us);
53}
54
55static inline void rc32434_sync_delay(int ms)
56{
57 __asm__ volatile ("sync");
58 mdelay(ms);
59}
60
61#endif /* _ASM_RC32434_RC32434_H_ */
diff --git a/include/asm-mips/mach-rc32434/timer.h b/include/asm-mips/mach-rc32434/timer.h
deleted file mode 100644
index e49b1d57a017..000000000000
--- a/include/asm-mips/mach-rc32434/timer.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * Definitions for timer registers
3 *
4 * Copyright 2004 Philip Rischel <rischelp@idt.com>
5 * Copyright 2008 Florian Fainelli <florian@openwrt.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28
29#ifndef __ASM_RC32434_TIMER_H
30#define __ASM_RC32434_TIMER_H
31
32#include <asm/mach-rc32434/rb.h>
33
34#define TIMER0_BASE_ADDR 0x18028000
35#define TIMER_COUNT 3
36
37struct timer_counter {
38 u32 count;
39 u32 compare;
40 u32 ctc; /*use CTC_ */
41};
42
43struct timer {
44 struct timer_counter tim[TIMER_COUNT];
45 u32 rcount; /* use RCOUNT_ */
46 u32 rcompare; /* use RCOMPARE_ */
47 u32 rtc; /* use RTC_ */
48};
49
50#define RC32434_CTC_EN_BIT 0
51#define RC32434_CTC_TO_BIT 1
52
53/* Real time clock registers */
54#define RC32434_RTC_MSK(x) BIT_TO_MASK(x)
55#define RC32434_RTC_CE_BIT 0
56#define RC32434_RTC_TO_BIT 1
57#define RC32434_RTC_RQE_BIT 2
58
59/* Counter registers */
60#define RC32434_RCOUNT_BIT 0
61#define RC32434_RCOUNT_MSK 0x0000ffff
62#define RC32434_RCOMP_BIT 0
63#define RC32434_RCOMP_MSK 0x0000ffff
64
65#endif /* __ASM_RC32434_TIMER_H */
diff --git a/include/asm-mips/mach-rc32434/war.h b/include/asm-mips/mach-rc32434/war.h
deleted file mode 100644
index 3ddf187e98a6..000000000000
--- a/include/asm-mips/mach-rc32434/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_MIPS_WAR_H
9#define __ASM_MIPS_MACH_MIPS_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 1
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_MIPS_WAR_H */
diff --git a/include/asm-mips/mach-rm/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h
deleted file mode 100644
index ccf543363537..000000000000
--- a/include/asm-mips/mach-rm/cpu-feature-overrides.h
+++ /dev/null
@@ -1,43 +0,0 @@
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 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 *
8 * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors.
9 */
10#ifndef __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H
11#define __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H
12
13#include <cpu-feature-overrides.h>
14
15#define cpu_has_tlb 1
16#define cpu_has_4kex 1
17#define cpu_has_4k_cache 1
18#define cpu_has_fpu 1
19#define cpu_has_32fpr 1
20#define cpu_has_counter 1
21#define cpu_has_watch 0
22#define cpu_has_mips16 0
23#define cpu_has_divec 0
24#define cpu_has_cache_cdex_p 1
25#define cpu_has_prefetch 0
26#define cpu_has_mcheck 0
27#define cpu_has_ejtag 0
28#define cpu_has_llsc 1
29#define cpu_has_vtag_icache 0
30#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
31#define cpu_has_ic_fills_f_dc 0
32#define cpu_has_dsp 0
33#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1
35#define cpu_has_mipsmt 0
36#define cpu_has_userlocal 0
37
38#define cpu_has_mips32r1 0
39#define cpu_has_mips32r2 0
40#define cpu_has_mips64r1 0
41#define cpu_has_mips64r2 0
42
43#endif /* __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-rm/mc146818rtc.h b/include/asm-mips/mach-rm/mc146818rtc.h
deleted file mode 100644
index 145bce096fe9..000000000000
--- a/include/asm-mips/mach-rm/mc146818rtc.h
+++ /dev/null
@@ -1,21 +0,0 @@
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 * Copyright (C) 2004 by Ralf Baechle
7 *
8 * RTC routines for PC style attached Dallas chip with ARC epoch.
9 */
10#ifndef __ASM_MACH_RM_MC146818RTC_H
11#define __ASM_MACH_RM_MC146818RTC_H
12
13#ifdef CONFIG_CPU_BIG_ENDIAN
14#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
15#else
16#define mc146818_decode_year(year) ((year) + 1980)
17#endif
18
19#include_next <mc146818rtc.h>
20
21#endif /* __ASM_MACH_RM_MC146818RTC_H */
diff --git a/include/asm-mips/mach-rm/war.h b/include/asm-mips/mach-rm/war.h
deleted file mode 100644
index 948d3129a114..000000000000
--- a/include/asm-mips/mach-rm/war.h
+++ /dev/null
@@ -1,29 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_RM_WAR_H
9#define __ASM_MIPS_MACH_RM_WAR_H
10
11/*
12 * The RM200C seems to have been shipped only with V2.0 R4600s
13 */
14
15#define R4600_V1_INDEX_ICACHEOP_WAR 0
16#define R4600_V1_HIT_CACHEOP_WAR 0
17#define R4600_V2_HIT_CACHEOP_WAR 1
18#define R5432_CP0_INTERRUPT_WAR 0
19#define BCM1250_M3_WAR 0
20#define SIBYTE_1956_WAR 0
21#define MIPS4K_ICACHE_REFILL_WAR 0
22#define MIPS_CACHE_SYNC_WAR 0
23#define TX49XX_ICACHE_INDEX_INV_WAR 0
24#define RM9000_CDEX_SMP_WAR 0
25#define ICACHE_REFILLS_WORKAROUND_WAR 0
26#define R10000_LLSC_WAR 0
27#define MIPS34K_MISSED_ITLB_WAR 0
28
29#endif /* __ASM_MIPS_MACH_RM_WAR_H */
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
deleted file mode 100644
index 1c1f92415b9a..000000000000
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ /dev/null
@@ -1,47 +0,0 @@
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 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
10
11/*
12 * Sibyte are MIPS64 processors wired to a specific configuration
13 */
14#define cpu_has_watch 1
15#define cpu_has_mips16 0
16#define cpu_has_divec 1
17#define cpu_has_vce 0
18#define cpu_has_cache_cdex_p 0
19#define cpu_has_cache_cdex_s 0
20#define cpu_has_prefetch 1
21#define cpu_has_mcheck 1
22#define cpu_has_ejtag 1
23
24#define cpu_has_llsc 1
25#define cpu_has_vtag_icache 1
26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
31#define cpu_icache_snoops_remote_store 0
32
33#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1
35
36#define cpu_has_mips32r1 1
37#define cpu_has_mips32r2 0
38#define cpu_has_mips64r1 1
39#define cpu_has_mips64r2 0
40
41#define cpu_has_inclusive_pcaches 0
42
43#define cpu_dcache_line_size() 32
44#define cpu_icache_line_size() 32
45#define cpu_scache_line_size() 32
46
47#endif /* __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-sibyte/war.h b/include/asm-mips/mach-sibyte/war.h
deleted file mode 100644
index 7950ef4f032c..000000000000
--- a/include/asm-mips/mach-sibyte/war.h
+++ /dev/null
@@ -1,37 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_SIBYTE_WAR_H
9#define __ASM_MIPS_MACH_SIBYTE_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15
16#if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \
17 defined(CONFIG_SB1_PASS_2_WORKAROUNDS)
18
19#define BCM1250_M3_WAR 1
20#define SIBYTE_1956_WAR 1
21
22#else
23
24#define BCM1250_M3_WAR 0
25#define SIBYTE_1956_WAR 0
26
27#endif
28
29#define MIPS4K_ICACHE_REFILL_WAR 0
30#define MIPS_CACHE_SYNC_WAR 0
31#define TX49XX_ICACHE_INDEX_INV_WAR 0
32#define RM9000_CDEX_SMP_WAR 0
33#define ICACHE_REFILLS_WORKAROUND_WAR 0
34#define R10000_LLSC_WAR 0
35#define MIPS34K_MISSED_ITLB_WAR 0
36
37#endif /* __ASM_MIPS_MACH_SIBYTE_WAR_H */
diff --git a/include/asm-mips/mach-tx39xx/ioremap.h b/include/asm-mips/mach-tx39xx/ioremap.h
deleted file mode 100644
index 93c6c04ffda3..000000000000
--- a/include/asm-mips/mach-tx39xx/ioremap.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * include/asm-mips/mach-tx39xx/ioremap.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#ifndef __ASM_MACH_TX39XX_IOREMAP_H
10#define __ASM_MACH_TX39XX_IOREMAP_H
11
12#include <linux/types.h>
13
14/*
15 * Allow physical addresses to be fixed up to help peripherals located
16 * outside the low 32-bit range -- generic pass-through version.
17 */
18static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
19{
20 return phys_addr;
21}
22
23static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
24 unsigned long flags)
25{
26#define TXX9_DIRECTMAP_BASE 0xff000000ul
27 if (offset >= TXX9_DIRECTMAP_BASE &&
28 offset < TXX9_DIRECTMAP_BASE + 0xff0000)
29 return (void __iomem *)offset;
30 return NULL;
31}
32
33static inline int plat_iounmap(const volatile void __iomem *addr)
34{
35 return (unsigned long)addr >= TXX9_DIRECTMAP_BASE;
36}
37
38#endif /* __ASM_MACH_TX39XX_IOREMAP_H */
diff --git a/include/asm-mips/mach-tx39xx/mangle-port.h b/include/asm-mips/mach-tx39xx/mangle-port.h
deleted file mode 100644
index ef0b502fd8b7..000000000000
--- a/include/asm-mips/mach-tx39xx/mangle-port.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef __ASM_MACH_TX39XX_MANGLE_PORT_H
2#define __ASM_MACH_TX39XX_MANGLE_PORT_H
3
4#if defined(CONFIG_TOSHIBA_JMR3927)
5extern unsigned long (*__swizzle_addr_b)(unsigned long port);
6#define NEEDS_TXX9_SWIZZLE_ADDR_B
7#else
8#define __swizzle_addr_b(port) (port)
9#endif
10#define __swizzle_addr_w(port) (port)
11#define __swizzle_addr_l(port) (port)
12#define __swizzle_addr_q(port) (port)
13
14#define ioswabb(a, x) (x)
15#define __mem_ioswabb(a, x) (x)
16#define ioswabw(a, x) le16_to_cpu(x)
17#define __mem_ioswabw(a, x) (x)
18#define ioswabl(a, x) le32_to_cpu(x)
19#define __mem_ioswabl(a, x) (x)
20#define ioswabq(a, x) le64_to_cpu(x)
21#define __mem_ioswabq(a, x) (x)
22
23#endif /* __ASM_MACH_TX39XX_MANGLE_PORT_H */
diff --git a/include/asm-mips/mach-tx39xx/war.h b/include/asm-mips/mach-tx39xx/war.h
deleted file mode 100644
index 433814616359..000000000000
--- a/include/asm-mips/mach-tx39xx/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_TX39XX_WAR_H
9#define __ASM_MIPS_MACH_TX39XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_TX39XX_WAR_H */
diff --git a/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h b/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h
deleted file mode 100644
index 275eaf92c748..000000000000
--- a/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H
2#define __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H
3
4#define cpu_has_llsc 1
5#define cpu_has_64bits 1
6#define cpu_has_inclusive_pcaches 0
7
8#define cpu_has_mips16 0
9#define cpu_has_mdmx 0
10#define cpu_has_mips3d 0
11#define cpu_has_smartmips 0
12#define cpu_has_vtag_icache 0
13#define cpu_has_ic_fills_f_dc 0
14#define cpu_has_dsp 0
15#define cpu_has_mipsmt 0
16#define cpu_has_userlocal 0
17
18#define cpu_has_mips32r1 0
19#define cpu_has_mips32r2 0
20#define cpu_has_mips64r1 0
21#define cpu_has_mips64r2 0
22
23#endif /* __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-tx49xx/ioremap.h b/include/asm-mips/mach-tx49xx/ioremap.h
deleted file mode 100644
index 1e7beae72229..000000000000
--- a/include/asm-mips/mach-tx49xx/ioremap.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * include/asm-mips/mach-tx49xx/ioremap.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#ifndef __ASM_MACH_TX49XX_IOREMAP_H
10#define __ASM_MACH_TX49XX_IOREMAP_H
11
12#include <linux/types.h>
13
14/*
15 * Allow physical addresses to be fixed up to help peripherals located
16 * outside the low 32-bit range -- generic pass-through version.
17 */
18static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
19{
20 return phys_addr;
21}
22
23static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size,
24 unsigned long flags)
25{
26#ifdef CONFIG_64BIT
27#define TXX9_DIRECTMAP_BASE 0xfff000000ul
28#else
29#define TXX9_DIRECTMAP_BASE 0xff000000ul
30#endif
31 if (offset >= TXX9_DIRECTMAP_BASE &&
32 offset < TXX9_DIRECTMAP_BASE + 0x400000)
33 return (void __iomem *)(unsigned long)(int)offset;
34 return NULL;
35}
36
37static inline int plat_iounmap(const volatile void __iomem *addr)
38{
39 return (unsigned long)addr >=
40 (unsigned long)(int)(TXX9_DIRECTMAP_BASE & 0xffffffff);
41}
42
43#endif /* __ASM_MACH_TX49XX_IOREMAP_H */
diff --git a/include/asm-mips/mach-tx49xx/kmalloc.h b/include/asm-mips/mach-tx49xx/kmalloc.h
deleted file mode 100644
index 913ff196259d..000000000000
--- a/include/asm-mips/mach-tx49xx/kmalloc.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_MACH_TX49XX_KMALLOC_H
2#define __ASM_MACH_TX49XX_KMALLOC_H
3
4/*
5 * All happy, no need to define ARCH_KMALLOC_MINALIGN
6 */
7
8#endif /* __ASM_MACH_TX49XX_KMALLOC_H */
diff --git a/include/asm-mips/mach-tx49xx/war.h b/include/asm-mips/mach-tx49xx/war.h
deleted file mode 100644
index 39b5d1177c57..000000000000
--- a/include/asm-mips/mach-tx49xx/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_TX49XX_WAR_H
9#define __ASM_MIPS_MACH_TX49XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 1
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_TX49XX_WAR_H */
diff --git a/include/asm-mips/mach-vr41xx/irq.h b/include/asm-mips/mach-vr41xx/irq.h
deleted file mode 100644
index 862058d3f81b..000000000000
--- a/include/asm-mips/mach-vr41xx/irq.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_MACH_VR41XX_IRQ_H
2#define __ASM_MACH_VR41XX_IRQ_H
3
4#include <asm/vr41xx/irq.h> /* for MIPS_CPU_IRQ_BASE */
5
6#include_next <irq.h>
7
8#endif /* __ASM_MACH_VR41XX_IRQ_H */
diff --git a/include/asm-mips/mach-vr41xx/war.h b/include/asm-mips/mach-vr41xx/war.h
deleted file mode 100644
index 56a38926412a..000000000000
--- a/include/asm-mips/mach-vr41xx/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_VR41XX_WAR_H
9#define __ASM_MIPS_MACH_VR41XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_VR41XX_WAR_H */
diff --git a/include/asm-mips/mach-wrppmc/mach-gt64120.h b/include/asm-mips/mach-wrppmc/mach-gt64120.h
deleted file mode 100644
index 83746b84a5ec..000000000000
--- a/include/asm-mips/mach-wrppmc/mach-gt64120.h
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * This is a direct copy of the ev96100.h file, with a global
3 * search and replace. The numbers are the same.
4 *
5 * The reason I'm duplicating this is so that the 64120/96100
6 * defines won't be confusing in the source code.
7 */
8#ifndef __ASM_MIPS_GT64120_H
9#define __ASM_MIPS_GT64120_H
10
11/*
12 * This is the CPU physical memory map of PPMC Board:
13 *
14 * 0x00000000-0x03FFFFFF - 64MB SDRAM (SCS[0]#)
15 * 0x1C000000-0x1C000000 - LED (CS0)
16 * 0x1C800000-0x1C800007 - UART 16550 port (CS1)
17 * 0x1F000000-0x1F000000 - MailBox (CS3)
18 * 0x1FC00000-0x20000000 - 4MB Flash (BOOT CS)
19 */
20
21#define WRPPMC_SDRAM_SCS0_BASE 0x00000000
22#define WRPPMC_SDRAM_SCS0_SIZE 0x04000000
23
24#define WRPPMC_UART16550_BASE 0x1C800000
25#define WRPPMC_UART16550_CLOCK 3686400 /* 3.68MHZ */
26
27#define WRPPMC_LED_BASE 0x1C000000
28#define WRPPMC_MBOX_BASE 0x1F000000
29
30#define WRPPMC_BOOTROM_BASE 0x1FC00000
31#define WRPPMC_BOOTROM_SIZE 0x00400000 /* 4M Flash */
32
33#define WRPPMC_MIPS_TIMER_IRQ 7 /* MIPS compare/count timer interrupt */
34#define WRPPMC_UART16550_IRQ 6
35#define WRPPMC_PCI_INTA_IRQ 3
36
37/*
38 * PCI Bus I/O and Memory resources allocation
39 *
40 * NOTE: We only have PCI_0 hose interface
41 */
42#define GT_PCI_MEM_BASE 0x13000000UL
43#define GT_PCI_MEM_SIZE 0x02000000UL
44#define GT_PCI_IO_BASE 0x11000000UL
45#define GT_PCI_IO_SIZE 0x02000000UL
46
47/*
48 * PCI interrupts will come in on either the INTA or INTD interrupt lines,
49 * which are mapped to the #2 and #5 interrupt pins of the MIPS. On our
50 * boards, they all either come in on IntD or they all come in on IntA, they
51 * aren't mixed. There can be numerous PCI interrupts, so we keep a list of the
52 * "requested" interrupt numbers and go through the list whenever we get an
53 * IntA/D.
54 *
55 * Interrupts < 8 are directly wired to the processor; PCI INTA is 8 and
56 * INTD is 11.
57 */
58#define GT_TIMER 4
59#define GT_INTA 2
60#define GT_INTD 5
61
62#ifndef __ASSEMBLY__
63
64/*
65 * GT64120 internal register space base address
66 */
67extern unsigned long gt64120_base;
68
69#define GT64120_BASE (gt64120_base)
70
71/* define WRPPMC_EARLY_DEBUG to enable early output something to UART */
72#undef WRPPMC_EARLY_DEBUG
73
74#ifdef WRPPMC_EARLY_DEBUG
75extern void wrppmc_led_on(int mask);
76extern void wrppmc_led_off(int mask);
77extern void wrppmc_early_printk(const char *fmt, ...);
78#else
79#define wrppmc_early_printk(fmt, ...) do {} while (0)
80#endif /* WRPPMC_EARLY_DEBUG */
81
82#endif /* __ASSEMBLY__ */
83#endif /* __ASM_MIPS_GT64120_H */
diff --git a/include/asm-mips/mach-wrppmc/war.h b/include/asm-mips/mach-wrppmc/war.h
deleted file mode 100644
index ac48629bb1ce..000000000000
--- a/include/asm-mips/mach-wrppmc/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_WRPPMC_WAR_H
9#define __ASM_MIPS_MACH_WRPPMC_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 1
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_WRPPMC_WAR_H */
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
deleted file mode 100644
index 470e5e9e10d6..000000000000
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ /dev/null
@@ -1,47 +0,0 @@
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 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
10
11/*
12 * Momentum Jaguar ATX always has the RM9000 processor.
13 */
14#define cpu_has_watch 1
15#define cpu_has_mips16 0
16#define cpu_has_divec 0
17#define cpu_has_vce 0
18#define cpu_has_cache_cdex_p 0
19#define cpu_has_cache_cdex_s 0
20#define cpu_has_prefetch 1
21#define cpu_has_mcheck 0
22#define cpu_has_ejtag 0
23
24#define cpu_has_llsc 1
25#define cpu_has_vtag_icache 0
26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
31#define cpu_icache_snoops_remote_store 0
32
33#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1
35
36#define cpu_has_inclusive_pcaches 0
37
38#define cpu_dcache_line_size() 32
39#define cpu_icache_line_size() 32
40#define cpu_scache_line_size() 32
41
42#define cpu_has_mips32r1 0
43#define cpu_has_mips32r2 0
44#define cpu_has_mips64r1 0
45#define cpu_has_mips64r2 0
46
47#endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-yosemite/war.h b/include/asm-mips/mach-yosemite/war.h
deleted file mode 100644
index e5c6d53efc86..000000000000
--- a/include/asm-mips/mach-yosemite/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_YOSEMITE_WAR_H
9#define __ASM_MIPS_MACH_YOSEMITE_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 1
21#define ICACHE_REFILLS_WORKAROUND_WAR 1
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_YOSEMITE_WAR_H */
diff --git a/include/asm-mips/mc146818-time.h b/include/asm-mips/mc146818-time.h
deleted file mode 100644
index cdc379a0a94e..000000000000
--- a/include/asm-mips/mc146818-time.h
+++ /dev/null
@@ -1,119 +0,0 @@
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 * Machine dependent access functions for RTC registers.
7 */
8#ifndef __ASM_MC146818_TIME_H
9#define __ASM_MC146818_TIME_H
10
11#include <linux/bcd.h>
12#include <linux/mc146818rtc.h>
13#include <linux/time.h>
14
15/*
16 * For check timing call set_rtc_mmss() 500ms; used in timer interrupt.
17 */
18#define USEC_AFTER 500000
19#define USEC_BEFORE 500000
20
21/*
22 * In order to set the CMOS clock precisely, set_rtc_mmss has to be
23 * called 500 ms after the second nowtime has started, because when
24 * nowtime is written into the registers of the CMOS clock, it will
25 * jump to the next second precisely 500 ms later. Check the Motorola
26 * MC146818A or Dallas DS12887 data sheet for details.
27 *
28 * BUG: This routine does not handle hour overflow properly; it just
29 * sets the minutes. Usually you'll only notice that after reboot!
30 */
31static inline int mc146818_set_rtc_mmss(unsigned long nowtime)
32{
33 int real_seconds, real_minutes, cmos_minutes;
34 unsigned char save_control, save_freq_select;
35 int retval = 0;
36 unsigned long flags;
37
38 spin_lock_irqsave(&rtc_lock, flags);
39 save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
40 CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
41
42 save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
43 CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
44
45 cmos_minutes = CMOS_READ(RTC_MINUTES);
46 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
47 BCD_TO_BIN(cmos_minutes);
48
49 /*
50 * since we're only adjusting minutes and seconds,
51 * don't interfere with hour overflow. This avoids
52 * messing with unknown time zones but requires your
53 * RTC not to be off by more than 15 minutes
54 */
55 real_seconds = nowtime % 60;
56 real_minutes = nowtime / 60;
57 if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
58 real_minutes += 30; /* correct for half hour time zone */
59 real_minutes %= 60;
60
61 if (abs(real_minutes - cmos_minutes) < 30) {
62 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
63 BIN_TO_BCD(real_seconds);
64 BIN_TO_BCD(real_minutes);
65 }
66 CMOS_WRITE(real_seconds, RTC_SECONDS);
67 CMOS_WRITE(real_minutes, RTC_MINUTES);
68 } else {
69 printk(KERN_WARNING
70 "set_rtc_mmss: can't update from %d to %d\n",
71 cmos_minutes, real_minutes);
72 retval = -1;
73 }
74
75 /* The following flags have to be released exactly in this order,
76 * otherwise the DS12887 (popular MC146818A clone with integrated
77 * battery and quartz) will not reset the oscillator and will not
78 * update precisely 500 ms later. You won't find this mentioned in
79 * the Dallas Semiconductor data sheets, but who believes data
80 * sheets anyway ... -- Markus Kuhn
81 */
82 CMOS_WRITE(save_control, RTC_CONTROL);
83 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
84 spin_unlock_irqrestore(&rtc_lock, flags);
85
86 return retval;
87}
88
89static inline unsigned long mc146818_get_cmos_time(void)
90{
91 unsigned int year, mon, day, hour, min, sec;
92 unsigned long flags;
93
94 spin_lock_irqsave(&rtc_lock, flags);
95
96 do {
97 sec = CMOS_READ(RTC_SECONDS);
98 min = CMOS_READ(RTC_MINUTES);
99 hour = CMOS_READ(RTC_HOURS);
100 day = CMOS_READ(RTC_DAY_OF_MONTH);
101 mon = CMOS_READ(RTC_MONTH);
102 year = CMOS_READ(RTC_YEAR);
103 } while (sec != CMOS_READ(RTC_SECONDS));
104
105 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
106 BCD_TO_BIN(sec);
107 BCD_TO_BIN(min);
108 BCD_TO_BIN(hour);
109 BCD_TO_BIN(day);
110 BCD_TO_BIN(mon);
111 BCD_TO_BIN(year);
112 }
113 spin_unlock_irqrestore(&rtc_lock, flags);
114 year = mc146818_decode_year(year);
115
116 return mktime(year, mon, day, hour, min, sec);
117}
118
119#endif /* __ASM_MC146818_TIME_H */
diff --git a/include/asm-mips/mc146818rtc.h b/include/asm-mips/mc146818rtc.h
deleted file mode 100644
index 68b4da6d520b..000000000000
--- a/include/asm-mips/mc146818rtc.h
+++ /dev/null
@@ -1,16 +0,0 @@
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 * Machine dependent access functions for RTC registers.
7 *
8 * Copyright (C) 1996, 1997, 1998, 2000 Ralf Baechle
9 * Copyright (C) 2002 Maciej W. Rozycki
10 */
11#ifndef _ASM_MC146818RTC_H
12#define _ASM_MC146818RTC_H
13
14#include <mc146818rtc.h>
15
16#endif /* _ASM_MC146818RTC_H */
diff --git a/include/asm-mips/mips-boards/bonito64.h b/include/asm-mips/mips-boards/bonito64.h
deleted file mode 100644
index a0f04bb99c99..000000000000
--- a/include/asm-mips/mips-boards/bonito64.h
+++ /dev/null
@@ -1,436 +0,0 @@
1/*
2 * Bonito Register Map
3 *
4 * This file is the original bonito.h from Algorithmics with minor changes
5 * to fit into linux.
6 *
7 * Copyright (c) 1999 Algorithmics Ltd
8 *
9 * Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2001 MIPS Technologies, Inc. All rights reserved.
11 *
12 * Algorithmics gives permission for anyone to use and modify this file
13 * without any obligation or license condition except that you retain
14 * this copyright message in any source redistribution in whole or part.
15 *
16 */
17
18/* Revision 1.48 autogenerated on 08/17/99 15:20:01 */
19/* This bonito64 version editted from bonito.h Revision 1.48 on 11/09/00 */
20
21#ifndef _ASM_MIPS_BOARDS_BONITO64_H
22#define _ASM_MIPS_BOARDS_BONITO64_H
23
24#ifdef __ASSEMBLY__
25
26/* offsets from base register */
27#define BONITO(x) (x)
28
29#elif defined(CONFIG_LEMOTE_FULONG)
30
31#define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x)))
32#define BONITO_IRQ_BASE 32
33
34#else
35
36/*
37 * Algorithmics Bonito64 system controller register base.
38 */
39extern unsigned long _pcictrl_bonito;
40extern unsigned long _pcictrl_bonito_pcicfg;
41
42#define BONITO(x) *(volatile u32 *)(_pcictrl_bonito + (x))
43
44#endif /* __ASSEMBLY__ */
45
46
47#define BONITO_BOOT_BASE 0x1fc00000
48#define BONITO_BOOT_SIZE 0x00100000
49#define BONITO_BOOT_TOP (BONITO_BOOT_BASE+BONITO_BOOT_SIZE-1)
50#define BONITO_FLASH_BASE 0x1c000000
51#define BONITO_FLASH_SIZE 0x03000000
52#define BONITO_FLASH_TOP (BONITO_FLASH_BASE+BONITO_FLASH_SIZE-1)
53#define BONITO_SOCKET_BASE 0x1f800000
54#define BONITO_SOCKET_SIZE 0x00400000
55#define BONITO_SOCKET_TOP (BONITO_SOCKET_BASE+BONITO_SOCKET_SIZE-1)
56#define BONITO_REG_BASE 0x1fe00000
57#define BONITO_REG_SIZE 0x00040000
58#define BONITO_REG_TOP (BONITO_REG_BASE+BONITO_REG_SIZE-1)
59#define BONITO_DEV_BASE 0x1ff00000
60#define BONITO_DEV_SIZE 0x00100000
61#define BONITO_DEV_TOP (BONITO_DEV_BASE+BONITO_DEV_SIZE-1)
62#define BONITO_PCILO_BASE 0x10000000
63#define BONITO_PCILO_SIZE 0x0c000000
64#define BONITO_PCILO_TOP (BONITO_PCILO_BASE+BONITO_PCILO_SIZE-1)
65#define BONITO_PCILO0_BASE 0x10000000
66#define BONITO_PCILO1_BASE 0x14000000
67#define BONITO_PCILO2_BASE 0x18000000
68#define BONITO_PCIHI_BASE 0x20000000
69#define BONITO_PCIHI_SIZE 0x20000000
70#define BONITO_PCIHI_TOP (BONITO_PCIHI_BASE+BONITO_PCIHI_SIZE-1)
71#define BONITO_PCIIO_BASE 0x1fd00000
72#define BONITO_PCIIO_SIZE 0x00100000
73#define BONITO_PCIIO_TOP (BONITO_PCIIO_BASE+BONITO_PCIIO_SIZE-1)
74#define BONITO_PCICFG_BASE 0x1fe80000
75#define BONITO_PCICFG_SIZE 0x00080000
76#define BONITO_PCICFG_TOP (BONITO_PCICFG_BASE+BONITO_PCICFG_SIZE-1)
77
78
79/* Bonito Register Bases */
80
81#define BONITO_PCICONFIGBASE 0x00
82#define BONITO_REGBASE 0x100
83
84
85/* PCI Configuration Registers */
86
87#define BONITO_PCI_REG(x) BONITO(BONITO_PCICONFIGBASE + (x))
88#define BONITO_PCIDID BONITO_PCI_REG(0x00)
89#define BONITO_PCICMD BONITO_PCI_REG(0x04)
90#define BONITO_PCICLASS BONITO_PCI_REG(0x08)
91#define BONITO_PCILTIMER BONITO_PCI_REG(0x0c)
92#define BONITO_PCIBASE0 BONITO_PCI_REG(0x10)
93#define BONITO_PCIBASE1 BONITO_PCI_REG(0x14)
94#define BONITO_PCIBASE2 BONITO_PCI_REG(0x18)
95#define BONITO_PCIEXPRBASE BONITO_PCI_REG(0x30)
96#define BONITO_PCIINT BONITO_PCI_REG(0x3c)
97
98#define BONITO_PCICMD_PERR_CLR 0x80000000
99#define BONITO_PCICMD_SERR_CLR 0x40000000
100#define BONITO_PCICMD_MABORT_CLR 0x20000000
101#define BONITO_PCICMD_MTABORT_CLR 0x10000000
102#define BONITO_PCICMD_TABORT_CLR 0x08000000
103#define BONITO_PCICMD_MPERR_CLR 0x01000000
104#define BONITO_PCICMD_PERRRESPEN 0x00000040
105#define BONITO_PCICMD_ASTEPEN 0x00000080
106#define BONITO_PCICMD_SERREN 0x00000100
107#define BONITO_PCILTIMER_BUSLATENCY 0x0000ff00
108#define BONITO_PCILTIMER_BUSLATENCY_SHIFT 8
109
110
111
112
113/* 1. Bonito h/w Configuration */
114/* Power on register */
115
116#define BONITO_BONPONCFG BONITO(BONITO_REGBASE + 0x00)
117
118#define BONITO_BONPONCFG_SYSCONTROLLERRD 0x00040000
119#define BONITO_BONPONCFG_ROMCS1SAMP 0x00020000
120#define BONITO_BONPONCFG_ROMCS0SAMP 0x00010000
121#define BONITO_BONPONCFG_CPUBIGEND 0x00004000
122/* Added by RPF 11-9-00 */
123#define BONITO_BONPONCFG_BURSTORDER 0x00001000
124/* --- */
125#define BONITO_BONPONCFG_CPUPARITY 0x00002000
126#define BONITO_BONPONCFG_CPUTYPE 0x00000007
127#define BONITO_BONPONCFG_CPUTYPE_SHIFT 0
128#define BONITO_BONPONCFG_PCIRESET_OUT 0x00000008
129#define BONITO_BONPONCFG_IS_ARBITER 0x00000010
130#define BONITO_BONPONCFG_ROMBOOT 0x000000c0
131#define BONITO_BONPONCFG_ROMBOOT_SHIFT 6
132
133#define BONITO_BONPONCFG_ROMBOOT_FLASH (0x0<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
134#define BONITO_BONPONCFG_ROMBOOT_SOCKET (0x1<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
135#define BONITO_BONPONCFG_ROMBOOT_SDRAM (0x2<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
136#define BONITO_BONPONCFG_ROMBOOT_CPURESET (0x3<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
137
138#define BONITO_BONPONCFG_ROMCS0WIDTH 0x00000100
139#define BONITO_BONPONCFG_ROMCS1WIDTH 0x00000200
140#define BONITO_BONPONCFG_ROMCS0FAST 0x00000400
141#define BONITO_BONPONCFG_ROMCS1FAST 0x00000800
142#define BONITO_BONPONCFG_CONFIG_DIS 0x00000020
143
144
145/* Other Bonito configuration */
146
147#define BONITO_BONGENCFG_OFFSET 0x4
148#define BONITO_BONGENCFG BONITO(BONITO_REGBASE + BONITO_BONGENCFG_OFFSET)
149
150#define BONITO_BONGENCFG_DEBUGMODE 0x00000001
151#define BONITO_BONGENCFG_SNOOPEN 0x00000002
152#define BONITO_BONGENCFG_CPUSELFRESET 0x00000004
153
154#define BONITO_BONGENCFG_FORCE_IRQA 0x00000008
155#define BONITO_BONGENCFG_IRQA_ISOUT 0x00000010
156#define BONITO_BONGENCFG_IRQA_FROM_INT1 0x00000020
157#define BONITO_BONGENCFG_BYTESWAP 0x00000040
158
159#define BONITO_BONGENCFG_UNCACHED 0x00000080
160#define BONITO_BONGENCFG_PREFETCHEN 0x00000100
161#define BONITO_BONGENCFG_WBEHINDEN 0x00000200
162#define BONITO_BONGENCFG_CACHEALG 0x00000c00
163#define BONITO_BONGENCFG_CACHEALG_SHIFT 10
164#define BONITO_BONGENCFG_PCIQUEUE 0x00001000
165#define BONITO_BONGENCFG_CACHESTOP 0x00002000
166#define BONITO_BONGENCFG_MSTRBYTESWAP 0x00004000
167#define BONITO_BONGENCFG_BUSERREN 0x00008000
168#define BONITO_BONGENCFG_NORETRYTIMEOUT 0x00010000
169#define BONITO_BONGENCFG_SHORTCOPYTIMEOUT 0x00020000
170
171/* 2. IO & IDE configuration */
172
173#define BONITO_IODEVCFG BONITO(BONITO_REGBASE + 0x08)
174
175/* 3. IO & IDE configuration */
176
177#define BONITO_SDCFG BONITO(BONITO_REGBASE + 0x0c)
178
179/* 4. PCI address map control */
180
181#define BONITO_PCIMAP BONITO(BONITO_REGBASE + 0x10)
182#define BONITO_PCIMEMBASECFG BONITO(BONITO_REGBASE + 0x14)
183#define BONITO_PCIMAP_CFG BONITO(BONITO_REGBASE + 0x18)
184
185/* 5. ICU & GPIO regs */
186
187/* GPIO Regs - r/w */
188
189#define BONITO_GPIODATA_OFFSET 0x1c
190#define BONITO_GPIODATA BONITO(BONITO_REGBASE + BONITO_GPIODATA_OFFSET)
191#define BONITO_GPIOIE BONITO(BONITO_REGBASE + 0x20)
192
193/* ICU Configuration Regs - r/w */
194
195#define BONITO_INTEDGE BONITO(BONITO_REGBASE + 0x24)
196#define BONITO_INTSTEER BONITO(BONITO_REGBASE + 0x28)
197#define BONITO_INTPOL BONITO(BONITO_REGBASE + 0x2c)
198
199/* ICU Enable Regs - IntEn & IntISR are r/o. */
200
201#define BONITO_INTENSET BONITO(BONITO_REGBASE + 0x30)
202#define BONITO_INTENCLR BONITO(BONITO_REGBASE + 0x34)
203#define BONITO_INTEN BONITO(BONITO_REGBASE + 0x38)
204#define BONITO_INTISR BONITO(BONITO_REGBASE + 0x3c)
205
206/* PCI mail boxes */
207
208#define BONITO_PCIMAIL0_OFFSET 0x40
209#define BONITO_PCIMAIL1_OFFSET 0x44
210#define BONITO_PCIMAIL2_OFFSET 0x48
211#define BONITO_PCIMAIL3_OFFSET 0x4c
212#define BONITO_PCIMAIL0 BONITO(BONITO_REGBASE + 0x40)
213#define BONITO_PCIMAIL1 BONITO(BONITO_REGBASE + 0x44)
214#define BONITO_PCIMAIL2 BONITO(BONITO_REGBASE + 0x48)
215#define BONITO_PCIMAIL3 BONITO(BONITO_REGBASE + 0x4c)
216
217
218/* 6. PCI cache */
219
220#define BONITO_PCICACHECTRL BONITO(BONITO_REGBASE + 0x50)
221#define BONITO_PCICACHETAG BONITO(BONITO_REGBASE + 0x54)
222
223#define BONITO_PCIBADADDR BONITO(BONITO_REGBASE + 0x58)
224#define BONITO_PCIMSTAT BONITO(BONITO_REGBASE + 0x5c)
225
226
227/*
228#define BONITO_PCIRDPOST BONITO(BONITO_REGBASE + 0x60)
229#define BONITO_PCIDATA BONITO(BONITO_REGBASE + 0x64)
230*/
231
232/* 7. IDE DMA & Copier */
233
234#define BONITO_CONFIGBASE 0x000
235#define BONITO_BONITOBASE 0x100
236#define BONITO_LDMABASE 0x200
237#define BONITO_COPBASE 0x300
238#define BONITO_REG_BLOCKMASK 0x300
239
240#define BONITO_LDMACTRL BONITO(BONITO_LDMABASE + 0x0)
241#define BONITO_LDMASTAT BONITO(BONITO_LDMABASE + 0x0)
242#define BONITO_LDMAADDR BONITO(BONITO_LDMABASE + 0x4)
243#define BONITO_LDMAGO BONITO(BONITO_LDMABASE + 0x8)
244#define BONITO_LDMADATA BONITO(BONITO_LDMABASE + 0xc)
245
246#define BONITO_COPCTRL BONITO(BONITO_COPBASE + 0x0)
247#define BONITO_COPSTAT BONITO(BONITO_COPBASE + 0x0)
248#define BONITO_COPPADDR BONITO(BONITO_COPBASE + 0x4)
249#define BONITO_COPDADDR BONITO(BONITO_COPBASE + 0x8)
250#define BONITO_COPGO BONITO(BONITO_COPBASE + 0xc)
251
252
253/* ###### Bit Definitions for individual Registers #### */
254
255/* Gen DMA. */
256
257#define BONITO_IDECOPDADDR_DMA_DADDR 0x0ffffffc
258#define BONITO_IDECOPDADDR_DMA_DADDR_SHIFT 2
259#define BONITO_IDECOPPADDR_DMA_PADDR 0xfffffffc
260#define BONITO_IDECOPPADDR_DMA_PADDR_SHIFT 2
261#define BONITO_IDECOPGO_DMA_SIZE 0x0000fffe
262#define BONITO_IDECOPGO_DMA_SIZE_SHIFT 0
263#define BONITO_IDECOPGO_DMA_WRITE 0x00010000
264#define BONITO_IDECOPGO_DMAWCOUNT 0x000f0000
265#define BONITO_IDECOPGO_DMAWCOUNT_SHIFT 16
266
267#define BONITO_IDECOPCTRL_DMA_STARTBIT 0x80000000
268#define BONITO_IDECOPCTRL_DMA_RSTBIT 0x40000000
269
270/* DRAM - sdCfg */
271
272#define BONITO_SDCFG_AROWBITS 0x00000003
273#define BONITO_SDCFG_AROWBITS_SHIFT 0
274#define BONITO_SDCFG_ACOLBITS 0x0000000c
275#define BONITO_SDCFG_ACOLBITS_SHIFT 2
276#define BONITO_SDCFG_ABANKBIT 0x00000010
277#define BONITO_SDCFG_ASIDES 0x00000020
278#define BONITO_SDCFG_AABSENT 0x00000040
279#define BONITO_SDCFG_AWIDTH64 0x00000080
280
281#define BONITO_SDCFG_BROWBITS 0x00000300
282#define BONITO_SDCFG_BROWBITS_SHIFT 8
283#define BONITO_SDCFG_BCOLBITS 0x00000c00
284#define BONITO_SDCFG_BCOLBITS_SHIFT 10
285#define BONITO_SDCFG_BBANKBIT 0x00001000
286#define BONITO_SDCFG_BSIDES 0x00002000
287#define BONITO_SDCFG_BABSENT 0x00004000
288#define BONITO_SDCFG_BWIDTH64 0x00008000
289
290#define BONITO_SDCFG_EXTRDDATA 0x00010000
291#define BONITO_SDCFG_EXTRASCAS 0x00020000
292#define BONITO_SDCFG_EXTPRECH 0x00040000
293#define BONITO_SDCFG_EXTRASWIDTH 0x00180000
294#define BONITO_SDCFG_EXTRASWIDTH_SHIFT 19
295/* Changed by RPF 11-9-00 */
296#define BONITO_SDCFG_DRAMMODESET 0x00200000
297/* --- */
298#define BONITO_SDCFG_DRAMEXTREGS 0x00400000
299#define BONITO_SDCFG_DRAMPARITY 0x00800000
300/* Added by RPF 11-9-00 */
301#define BONITO_SDCFG_DRAMBURSTLEN 0x03000000
302#define BONITO_SDCFG_DRAMBURSTLEN_SHIFT 24
303#define BONITO_SDCFG_DRAMMODESET_DONE 0x80000000
304/* --- */
305
306/* PCI Cache - pciCacheCtrl */
307
308#define BONITO_PCICACHECTRL_CACHECMD 0x00000007
309#define BONITO_PCICACHECTRL_CACHECMD_SHIFT 0
310#define BONITO_PCICACHECTRL_CACHECMDLINE 0x00000018
311#define BONITO_PCICACHECTRL_CACHECMDLINE_SHIFT 3
312#define BONITO_PCICACHECTRL_CMDEXEC 0x00000020
313
314#define BONITO_PCICACHECTRL_IOBCCOH_PRES 0x00000100
315#define BONITO_PCICACHECTRL_IOBCCOH_EN 0x00000200
316#define BONITO_PCICACHECTRL_CPUCOH_PRES 0x00000400
317#define BONITO_PCICACHECTRL_CPUCOH_EN 0x00000800
318
319#define BONITO_IODEVCFG_BUFFBIT_CS0 0x00000001
320#define BONITO_IODEVCFG_SPEEDBIT_CS0 0x00000002
321#define BONITO_IODEVCFG_MOREABITS_CS0 0x00000004
322
323#define BONITO_IODEVCFG_BUFFBIT_CS1 0x00000008
324#define BONITO_IODEVCFG_SPEEDBIT_CS1 0x00000010
325#define BONITO_IODEVCFG_MOREABITS_CS1 0x00000020
326
327#define BONITO_IODEVCFG_BUFFBIT_CS2 0x00000040
328#define BONITO_IODEVCFG_SPEEDBIT_CS2 0x00000080
329#define BONITO_IODEVCFG_MOREABITS_CS2 0x00000100
330
331#define BONITO_IODEVCFG_BUFFBIT_CS3 0x00000200
332#define BONITO_IODEVCFG_SPEEDBIT_CS3 0x00000400
333#define BONITO_IODEVCFG_MOREABITS_CS3 0x00000800
334
335#define BONITO_IODEVCFG_BUFFBIT_IDE 0x00001000
336#define BONITO_IODEVCFG_SPEEDBIT_IDE 0x00002000
337#define BONITO_IODEVCFG_WORDSWAPBIT_IDE 0x00004000
338#define BONITO_IODEVCFG_MODEBIT_IDE 0x00008000
339#define BONITO_IODEVCFG_DMAON_IDE 0x001f0000
340#define BONITO_IODEVCFG_DMAON_IDE_SHIFT 16
341#define BONITO_IODEVCFG_DMAOFF_IDE 0x01e00000
342#define BONITO_IODEVCFG_DMAOFF_IDE_SHIFT 21
343#define BONITO_IODEVCFG_EPROMSPLIT 0x02000000
344/* Added by RPF 11-9-00 */
345#define BONITO_IODEVCFG_CPUCLOCKPERIOD 0xfc000000
346#define BONITO_IODEVCFG_CPUCLOCKPERIOD_SHIFT 26
347/* --- */
348
349/* gpio */
350#define BONITO_GPIO_GPIOW 0x000003ff
351#define BONITO_GPIO_GPIOW_SHIFT 0
352#define BONITO_GPIO_GPIOR 0x01ff0000
353#define BONITO_GPIO_GPIOR_SHIFT 16
354#define BONITO_GPIO_GPINR 0xfe000000
355#define BONITO_GPIO_GPINR_SHIFT 25
356#define BONITO_GPIO_IOW(N) (1<<(BONITO_GPIO_GPIOW_SHIFT+(N)))
357#define BONITO_GPIO_IOR(N) (1<<(BONITO_GPIO_GPIOR_SHIFT+(N)))
358#define BONITO_GPIO_INR(N) (1<<(BONITO_GPIO_GPINR_SHIFT+(N)))
359
360/* ICU */
361#define BONITO_ICU_MBOXES 0x0000000f
362#define BONITO_ICU_MBOXES_SHIFT 0
363#define BONITO_ICU_DMARDY 0x00000010
364#define BONITO_ICU_DMAEMPTY 0x00000020
365#define BONITO_ICU_COPYRDY 0x00000040
366#define BONITO_ICU_COPYEMPTY 0x00000080
367#define BONITO_ICU_COPYERR 0x00000100
368#define BONITO_ICU_PCIIRQ 0x00000200
369#define BONITO_ICU_MASTERERR 0x00000400
370#define BONITO_ICU_SYSTEMERR 0x00000800
371#define BONITO_ICU_DRAMPERR 0x00001000
372#define BONITO_ICU_RETRYERR 0x00002000
373#define BONITO_ICU_GPIOS 0x01ff0000
374#define BONITO_ICU_GPIOS_SHIFT 16
375#define BONITO_ICU_GPINS 0x7e000000
376#define BONITO_ICU_GPINS_SHIFT 25
377#define BONITO_ICU_MBOX(N) (1<<(BONITO_ICU_MBOXES_SHIFT+(N)))
378#define BONITO_ICU_GPIO(N) (1<<(BONITO_ICU_GPIOS_SHIFT+(N)))
379#define BONITO_ICU_GPIN(N) (1<<(BONITO_ICU_GPINS_SHIFT+(N)))
380
381/* pcimap */
382
383#define BONITO_PCIMAP_PCIMAP_LO0 0x0000003f
384#define BONITO_PCIMAP_PCIMAP_LO0_SHIFT 0
385#define BONITO_PCIMAP_PCIMAP_LO1 0x00000fc0
386#define BONITO_PCIMAP_PCIMAP_LO1_SHIFT 6
387#define BONITO_PCIMAP_PCIMAP_LO2 0x0003f000
388#define BONITO_PCIMAP_PCIMAP_LO2_SHIFT 12
389#define BONITO_PCIMAP_PCIMAP_2 0x00040000
390#define BONITO_PCIMAP_WIN(WIN, ADDR) ((((ADDR)>>26) & BONITO_PCIMAP_PCIMAP_LO0) << ((WIN)*6))
391
392#define BONITO_PCIMAP_WINSIZE (1<<26)
393#define BONITO_PCIMAP_WINOFFSET(ADDR) ((ADDR) & (BONITO_PCIMAP_WINSIZE - 1))
394#define BONITO_PCIMAP_WINBASE(ADDR) ((ADDR) << 26)
395
396/* pcimembaseCfg */
397
398#define BONITO_PCIMEMBASECFG_MASK 0xf0000000
399#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK 0x0000001f
400#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK_SHIFT 0
401#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS 0x000003e0
402#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS_SHIFT 5
403#define BONITO_PCIMEMBASECFG_MEMBASE0_CACHED 0x00000400
404#define BONITO_PCIMEMBASECFG_MEMBASE0_IO 0x00000800
405
406#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK 0x0001f000
407#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK_SHIFT 12
408#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS 0x003e0000
409#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS_SHIFT 17
410#define BONITO_PCIMEMBASECFG_MEMBASE1_CACHED 0x00400000
411#define BONITO_PCIMEMBASECFG_MEMBASE1_IO 0x00800000
412
413#define BONITO_PCIMEMBASECFG_ASHIFT 23
414#define BONITO_PCIMEMBASECFG_AMASK 0x007fffff
415#define BONITO_PCIMEMBASECFGSIZE(WIN, SIZE) (((~((SIZE)-1))>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)
416#define BONITO_PCIMEMBASECFGBASE(WIN, BASE) (((BASE)>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS)
417
418#define BONITO_PCIMEMBASECFG_SIZE(WIN, CFG) (((((~(CFG)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)) << (BONITO_PCIMEMBASECFG_ASHIFT - BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) | BONITO_PCIMEMBASECFG_AMASK)
419
420
421#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
422#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
423#define BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
424
425#define BONITO_PCITOPHYS(WIN, ADDR, CFG) ( \
426 (((ADDR) & (~(BONITO_PCIMEMBASECFG_MASK))) & (~(BONITO_PCIMEMBASECFG_ADDRMASK(WIN, CFG)))) | \
427 (BONITO_PCIMEMBASECFG_ADDRTRANS(WIN, CFG)) \
428 )
429
430/* PCICmd */
431
432#define BONITO_PCICMD_MEMEN 0x00000002
433#define BONITO_PCICMD_MSTREN 0x00000004
434
435
436#endif /* _ASM_MIPS_BOARDS_BONITO64_H */
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h
deleted file mode 100644
index 7f0b034dd9a5..000000000000
--- a/include/asm-mips/mips-boards/generic.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Defines of the MIPS boards specific address-MAP, registers, etc.
19 */
20#ifndef __ASM_MIPS_BOARDS_GENERIC_H
21#define __ASM_MIPS_BOARDS_GENERIC_H
22
23#include <asm/addrspace.h>
24#include <asm/byteorder.h>
25#include <asm/mips-boards/bonito64.h>
26
27/*
28 * Display register base.
29 */
30#define ASCII_DISPLAY_WORD_BASE 0x1f000410
31#define ASCII_DISPLAY_POS_BASE 0x1f000418
32
33
34/*
35 * Yamon Prom print address.
36 */
37#define YAMON_PROM_PRINT_ADDR 0x1fc00504
38
39
40/*
41 * Reset register.
42 */
43#define SOFTRES_REG 0x1f000500
44#define GORESET 0x42
45
46/*
47 * Revision register.
48 */
49#define MIPS_REVISION_REG 0x1fc00010
50#define MIPS_REVISION_CORID_QED_RM5261 0
51#define MIPS_REVISION_CORID_CORE_LV 1
52#define MIPS_REVISION_CORID_BONITO64 2
53#define MIPS_REVISION_CORID_CORE_20K 3
54#define MIPS_REVISION_CORID_CORE_FPGA 4
55#define MIPS_REVISION_CORID_CORE_MSC 5
56#define MIPS_REVISION_CORID_CORE_EMUL 6
57#define MIPS_REVISION_CORID_CORE_FPGA2 7
58#define MIPS_REVISION_CORID_CORE_FPGAR2 8
59#define MIPS_REVISION_CORID_CORE_FPGA3 9
60#define MIPS_REVISION_CORID_CORE_24K 10
61#define MIPS_REVISION_CORID_CORE_FPGA4 11
62#define MIPS_REVISION_CORID_CORE_FPGA5 12
63
64/**** Artificial corid defines ****/
65/*
66 * CoreEMUL with Bonito System Controller is treated like a Core20K
67 * CoreEMUL with SOC-it 101 System Controller is treated like a CoreMSC
68 */
69#define MIPS_REVISION_CORID_CORE_EMUL_BON -1
70#define MIPS_REVISION_CORID_CORE_EMUL_MSC -2
71
72#define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f)
73
74extern int mips_revision_corid;
75
76#define MIPS_REVISION_SCON_OTHER 0
77#define MIPS_REVISION_SCON_SOCITSC 1
78#define MIPS_REVISION_SCON_SOCITSCP 2
79
80/* Artificial SCON defines for MIPS_REVISION_SCON_OTHER */
81#define MIPS_REVISION_SCON_UNKNOWN -1
82#define MIPS_REVISION_SCON_GT64120 -2
83#define MIPS_REVISION_SCON_BONITO -3
84#define MIPS_REVISION_SCON_BRTL -4
85#define MIPS_REVISION_SCON_SOCIT -5
86#define MIPS_REVISION_SCON_ROCIT -6
87
88#define MIPS_REVISION_SCONID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 24) & 0xff)
89
90extern int mips_revision_sconid;
91
92extern void mips_reboot_setup(void);
93
94#ifdef CONFIG_PCI
95extern void mips_pcibios_init(void);
96#else
97#define mips_pcibios_init() do { } while (0)
98#endif
99
100#ifdef CONFIG_KGDB
101extern void kgdb_config(void);
102#endif
103
104#endif /* __ASM_MIPS_BOARDS_GENERIC_H */
diff --git a/include/asm-mips/mips-boards/launch.h b/include/asm-mips/mips-boards/launch.h
deleted file mode 100644
index d8ae7f95a522..000000000000
--- a/include/asm-mips/mips-boards/launch.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 *
3 */
4
5#ifndef _ASSEMBLER_
6
7struct cpulaunch {
8 unsigned long pc;
9 unsigned long gp;
10 unsigned long sp;
11 unsigned long a0;
12 unsigned long _pad[3]; /* pad to cache line size to avoid thrashing */
13 unsigned long flags;
14};
15
16#else
17
18#define LOG2CPULAUNCH 5
19#define LAUNCH_PC 0
20#define LAUNCH_GP 4
21#define LAUNCH_SP 8
22#define LAUNCH_A0 12
23#define LAUNCH_FLAGS 28
24
25#endif
26
27#define LAUNCH_FREADY 1
28#define LAUNCH_FGO 2
29#define LAUNCH_FGONE 4
30
31#define CPULAUNCH 0x00000f00
32#define NCPULAUNCH 8
33
34/* Polling period in count cycles for secondary CPU's */
35#define LAUNCHPERIOD 10000
diff --git a/include/asm-mips/mips-boards/malta.h b/include/asm-mips/mips-boards/malta.h
deleted file mode 100644
index c1891578fa65..000000000000
--- a/include/asm-mips/mips-boards/malta.h
+++ /dev/null
@@ -1,102 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Defines of the Malta board specific address-MAP, registers, etc.
19 */
20#ifndef __ASM_MIPS_BOARDS_MALTA_H
21#define __ASM_MIPS_BOARDS_MALTA_H
22
23#include <asm/addrspace.h>
24#include <asm/io.h>
25#include <asm/mips-boards/msc01_pci.h>
26#include <asm/gt64120.h>
27
28/* Mips interrupt controller found in SOCit variations */
29#define MIPS_MSC01_IC_REG_BASE 0x1bc40000
30#define MIPS_SOCITSC_IC_REG_BASE 0x1ffa0000
31
32/*
33 * Malta I/O ports base address for the Galileo GT64120 and Algorithmics
34 * Bonito system controllers.
35 */
36#define MALTA_GT_PORT_BASE get_gt_port_base(GT_PCI0IOLD_OFS)
37#define MALTA_BONITO_PORT_BASE ((unsigned long)ioremap (0x1fd00000, 0x10000))
38#define MALTA_MSC_PORT_BASE get_msc_port_base(MSC01_PCI_SC2PIOBASL)
39
40static inline unsigned long get_gt_port_base(unsigned long reg)
41{
42 unsigned long addr;
43 addr = GT_READ(reg);
44 return (unsigned long) ioremap (((addr & 0xffff) << 21), 0x10000);
45}
46
47static inline unsigned long get_msc_port_base(unsigned long reg)
48{
49 unsigned long addr;
50 MSC_READ(reg, addr);
51 return (unsigned long) ioremap(addr, 0x10000);
52}
53
54/*
55 * GCMP Specific definitions
56 */
57#define GCMP_BASE_ADDR 0x1fbf8000
58#define GCMP_ADDRSPACE_SZ (256 * 1024)
59
60/*
61 * GIC Specific definitions
62 */
63#define GIC_BASE_ADDR 0x1bdc0000
64#define GIC_ADDRSPACE_SZ (128 * 1024)
65
66/*
67 * MSC01 BIU Specific definitions
68 * FIXME : These should be elsewhere ?
69 */
70#define MSC01_BIU_REG_BASE 0x1bc80000
71#define MSC01_BIU_ADDRSPACE_SZ (256 * 1024)
72#define MSC01_SC_CFG_OFS 0x0110
73#define MSC01_SC_CFG_GICPRES_MSK 0x00000004
74#define MSC01_SC_CFG_GICPRES_SHF 2
75#define MSC01_SC_CFG_GICENA_SHF 3
76
77/*
78 * Malta RTC-device indirect register access.
79 */
80#define MALTA_RTC_ADR_REG 0x70
81#define MALTA_RTC_DAT_REG 0x71
82
83/*
84 * Malta SMSC FDC37M817 Super I/O Controller register.
85 */
86#define SMSC_CONFIG_REG 0x3f0
87#define SMSC_DATA_REG 0x3f1
88
89#define SMSC_CONFIG_DEVNUM 0x7
90#define SMSC_CONFIG_ACTIVATE 0x30
91#define SMSC_CONFIG_ENTER 0x55
92#define SMSC_CONFIG_EXIT 0xaa
93
94#define SMSC_CONFIG_DEVNUM_FLOPPY 0
95
96#define SMSC_CONFIG_ACTIVATE_ENABLE 1
97
98#define SMSC_WRITE(x, a) outb(x, a)
99
100#define MALTA_JMPRS_REG 0x1f000210
101
102#endif /* __ASM_MIPS_BOARDS_MALTA_H */
diff --git a/include/asm-mips/mips-boards/maltaint.h b/include/asm-mips/mips-boards/maltaint.h
deleted file mode 100644
index cea872fc6f5c..000000000000
--- a/include/asm-mips/mips-boards/maltaint.h
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * 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 * Defines for the Malta interrupt controller.
23 *
24 */
25#ifndef _MIPS_MALTAINT_H
26#define _MIPS_MALTAINT_H
27
28#include <irq.h>
29
30/*
31 * Interrupts 0..15 are used for Malta ISA compatible interrupts
32 */
33#define MALTA_INT_BASE 0
34
35/* CPU interrupt offsets */
36#define MIPSCPU_INT_SW0 0
37#define MIPSCPU_INT_SW1 1
38#define MIPSCPU_INT_MB0 2
39#define MIPSCPU_INT_I8259A MIPSCPU_INT_MB0
40#define MIPSCPU_INT_MB1 3
41#define MIPSCPU_INT_SMI MIPSCPU_INT_MB1
42#define MIPSCPU_INT_IPI0 MIPSCPU_INT_MB1 /* GIC IPI */
43#define MIPSCPU_INT_MB2 4
44#define MIPSCPU_INT_IPI1 MIPSCPU_INT_MB2 /* GIC IPI */
45#define MIPSCPU_INT_MB3 5
46#define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3
47#define MIPSCPU_INT_MB4 6
48#define MIPSCPU_INT_CORELO MIPSCPU_INT_MB4
49
50/*
51 * Interrupts 64..127 are used for Soc-it Classic interrupts
52 */
53#define MSC01C_INT_BASE 64
54
55/* SOC-it Classic interrupt offsets */
56#define MSC01C_INT_TMR 0
57#define MSC01C_INT_PCI 1
58
59/*
60 * Interrupts 64..127 are used for Soc-it EIC interrupts
61 */
62#define MSC01E_INT_BASE 64
63
64/* SOC-it EIC interrupt offsets */
65#define MSC01E_INT_SW0 1
66#define MSC01E_INT_SW1 2
67#define MSC01E_INT_MB0 3
68#define MSC01E_INT_I8259A MSC01E_INT_MB0
69#define MSC01E_INT_MB1 4
70#define MSC01E_INT_SMI MSC01E_INT_MB1
71#define MSC01E_INT_MB2 5
72#define MSC01E_INT_MB3 6
73#define MSC01E_INT_COREHI MSC01E_INT_MB3
74#define MSC01E_INT_MB4 7
75#define MSC01E_INT_CORELO MSC01E_INT_MB4
76#define MSC01E_INT_TMR 8
77#define MSC01E_INT_PCI 9
78#define MSC01E_INT_PERFCTR 10
79#define MSC01E_INT_CPUCTR 11
80
81/* GIC's Nomenclature for Core Interrupt Pins on the Malta */
82#define GIC_CPU_INT0 0 /* Core Interrupt 2 */
83#define GIC_CPU_INT1 1 /* . */
84#define GIC_CPU_INT2 2 /* . */
85#define GIC_CPU_INT3 3 /* . */
86#define GIC_CPU_INT4 4 /* . */
87#define GIC_CPU_INT5 5 /* Core Interrupt 5 */
88
89#define GIC_EXT_INTR(x) x
90
91/* Dummy data */
92#define X 0xdead
93
94/* External Interrupts used for IPI */
95#define GIC_IPI_EXT_INTR_RESCHED_VPE0 16
96#define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17
97#define GIC_IPI_EXT_INTR_RESCHED_VPE1 18
98#define GIC_IPI_EXT_INTR_CALLFNC_VPE1 19
99#define GIC_IPI_EXT_INTR_RESCHED_VPE2 20
100#define GIC_IPI_EXT_INTR_CALLFNC_VPE2 21
101#define GIC_IPI_EXT_INTR_RESCHED_VPE3 22
102#define GIC_IPI_EXT_INTR_CALLFNC_VPE3 23
103
104#define MIPS_GIC_IRQ_BASE (MIPS_CPU_IRQ_BASE + 8)
105
106#ifndef __ASSEMBLY__
107extern void maltaint_init(void);
108#endif
109
110#endif /* !(_MIPS_MALTAINT_H) */
diff --git a/include/asm-mips/mips-boards/msc01_pci.h b/include/asm-mips/mips-boards/msc01_pci.h
deleted file mode 100644
index e036b7dd6deb..000000000000
--- a/include/asm-mips/mips-boards/msc01_pci.h
+++ /dev/null
@@ -1,258 +0,0 @@
1/*
2 * PCI Register definitions for the MIPS System Controller.
3 *
4 * Copyright (C) 2002, 2005 MIPS Technologies, Inc. All rights reserved.
5 * Authors: Carsten Langgaard <carstenl@mips.com>
6 * Maciej W. Rozycki <macro@mips.com>
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#ifndef __ASM_MIPS_BOARDS_MSC01_PCI_H
13#define __ASM_MIPS_BOARDS_MSC01_PCI_H
14
15/*
16 * Register offset addresses
17 */
18
19#define MSC01_PCI_ID_OFS 0x0000
20#define MSC01_PCI_SC2PMBASL_OFS 0x0208
21#define MSC01_PCI_SC2PMMSKL_OFS 0x0218
22#define MSC01_PCI_SC2PMMAPL_OFS 0x0228
23#define MSC01_PCI_SC2PIOBASL_OFS 0x0248
24#define MSC01_PCI_SC2PIOMSKL_OFS 0x0258
25#define MSC01_PCI_SC2PIOMAPL_OFS 0x0268
26#define MSC01_PCI_P2SCMSKL_OFS 0x0308
27#define MSC01_PCI_P2SCMAPL_OFS 0x0318
28#define MSC01_PCI_INTCFG_OFS 0x0600
29#define MSC01_PCI_INTSTAT_OFS 0x0608
30#define MSC01_PCI_CFGADDR_OFS 0x0610
31#define MSC01_PCI_CFGDATA_OFS 0x0618
32#define MSC01_PCI_IACK_OFS 0x0620
33#define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */
34#define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */
35#define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */
36#define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */
37#define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */
38#define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */
39#define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */
40#define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */
41#define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */
42#define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */
43#define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */
44#define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */
45#define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */
46#define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */
47#define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */
48#define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */
49#define MSC01_PCI_BAR0_OFS 0x2220
50#define MSC01_PCI_CFG_OFS 0x2380
51#define MSC01_PCI_SWAP_OFS 0x2388
52
53
54/*****************************************************************************
55 * Register encodings
56 ****************************************************************************/
57
58#define MSC01_PCI_ID_ID_SHF 16
59#define MSC01_PCI_ID_ID_MSK 0x00ff0000
60#define MSC01_PCI_ID_ID_HOSTBRIDGE 82
61#define MSC01_PCI_ID_MAR_SHF 8
62#define MSC01_PCI_ID_MAR_MSK 0x0000ff00
63#define MSC01_PCI_ID_MIR_SHF 0
64#define MSC01_PCI_ID_MIR_MSK 0x000000ff
65
66#define MSC01_PCI_SC2PMBASL_BAS_SHF 24
67#define MSC01_PCI_SC2PMBASL_BAS_MSK 0xff000000
68
69#define MSC01_PCI_SC2PMMSKL_MSK_SHF 24
70#define MSC01_PCI_SC2PMMSKL_MSK_MSK 0xff000000
71
72#define MSC01_PCI_SC2PMMAPL_MAP_SHF 24
73#define MSC01_PCI_SC2PMMAPL_MAP_MSK 0xff000000
74
75#define MSC01_PCI_SC2PIOBASL_BAS_SHF 24
76#define MSC01_PCI_SC2PIOBASL_BAS_MSK 0xff000000
77
78#define MSC01_PCI_SC2PIOMSKL_MSK_SHF 24
79#define MSC01_PCI_SC2PIOMSKL_MSK_MSK 0xff000000
80
81#define MSC01_PCI_SC2PIOMAPL_MAP_SHF 24
82#define MSC01_PCI_SC2PIOMAPL_MAP_MSK 0xff000000
83
84#define MSC01_PCI_P2SCMSKL_MSK_SHF 24
85#define MSC01_PCI_P2SCMSKL_MSK_MSK 0xff000000
86
87#define MSC01_PCI_P2SCMAPL_MAP_SHF 24
88#define MSC01_PCI_P2SCMAPL_MAP_MSK 0xff000000
89
90#define MSC01_PCI_INTCFG_RST_SHF 10
91#define MSC01_PCI_INTCFG_RST_MSK 0x00000400
92#define MSC01_PCI_INTCFG_RST_BIT 0x00000400
93#define MSC01_PCI_INTCFG_MWE_SHF 9
94#define MSC01_PCI_INTCFG_MWE_MSK 0x00000200
95#define MSC01_PCI_INTCFG_MWE_BIT 0x00000200
96#define MSC01_PCI_INTCFG_DTO_SHF 8
97#define MSC01_PCI_INTCFG_DTO_MSK 0x00000100
98#define MSC01_PCI_INTCFG_DTO_BIT 0x00000100
99#define MSC01_PCI_INTCFG_MA_SHF 7
100#define MSC01_PCI_INTCFG_MA_MSK 0x00000080
101#define MSC01_PCI_INTCFG_MA_BIT 0x00000080
102#define MSC01_PCI_INTCFG_TA_SHF 6
103#define MSC01_PCI_INTCFG_TA_MSK 0x00000040
104#define MSC01_PCI_INTCFG_TA_BIT 0x00000040
105#define MSC01_PCI_INTCFG_RTY_SHF 5
106#define MSC01_PCI_INTCFG_RTY_MSK 0x00000020
107#define MSC01_PCI_INTCFG_RTY_BIT 0x00000020
108#define MSC01_PCI_INTCFG_MWP_SHF 4
109#define MSC01_PCI_INTCFG_MWP_MSK 0x00000010
110#define MSC01_PCI_INTCFG_MWP_BIT 0x00000010
111#define MSC01_PCI_INTCFG_MRP_SHF 3
112#define MSC01_PCI_INTCFG_MRP_MSK 0x00000008
113#define MSC01_PCI_INTCFG_MRP_BIT 0x00000008
114#define MSC01_PCI_INTCFG_SWP_SHF 2
115#define MSC01_PCI_INTCFG_SWP_MSK 0x00000004
116#define MSC01_PCI_INTCFG_SWP_BIT 0x00000004
117#define MSC01_PCI_INTCFG_SRP_SHF 1
118#define MSC01_PCI_INTCFG_SRP_MSK 0x00000002
119#define MSC01_PCI_INTCFG_SRP_BIT 0x00000002
120#define MSC01_PCI_INTCFG_SE_SHF 0
121#define MSC01_PCI_INTCFG_SE_MSK 0x00000001
122#define MSC01_PCI_INTCFG_SE_BIT 0x00000001
123
124#define MSC01_PCI_INTSTAT_RST_SHF 10
125#define MSC01_PCI_INTSTAT_RST_MSK 0x00000400
126#define MSC01_PCI_INTSTAT_RST_BIT 0x00000400
127#define MSC01_PCI_INTSTAT_MWE_SHF 9
128#define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200
129#define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200
130#define MSC01_PCI_INTSTAT_DTO_SHF 8
131#define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100
132#define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100
133#define MSC01_PCI_INTSTAT_MA_SHF 7
134#define MSC01_PCI_INTSTAT_MA_MSK 0x00000080
135#define MSC01_PCI_INTSTAT_MA_BIT 0x00000080
136#define MSC01_PCI_INTSTAT_TA_SHF 6
137#define MSC01_PCI_INTSTAT_TA_MSK 0x00000040
138#define MSC01_PCI_INTSTAT_TA_BIT 0x00000040
139#define MSC01_PCI_INTSTAT_RTY_SHF 5
140#define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020
141#define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020
142#define MSC01_PCI_INTSTAT_MWP_SHF 4
143#define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010
144#define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010
145#define MSC01_PCI_INTSTAT_MRP_SHF 3
146#define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008
147#define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008
148#define MSC01_PCI_INTSTAT_SWP_SHF 2
149#define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004
150#define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004
151#define MSC01_PCI_INTSTAT_SRP_SHF 1
152#define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002
153#define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002
154#define MSC01_PCI_INTSTAT_SE_SHF 0
155#define MSC01_PCI_INTSTAT_SE_MSK 0x00000001
156#define MSC01_PCI_INTSTAT_SE_BIT 0x00000001
157
158#define MSC01_PCI_CFGADDR_BNUM_SHF 16
159#define MSC01_PCI_CFGADDR_BNUM_MSK 0x00ff0000
160#define MSC01_PCI_CFGADDR_DNUM_SHF 11
161#define MSC01_PCI_CFGADDR_DNUM_MSK 0x0000f800
162#define MSC01_PCI_CFGADDR_FNUM_SHF 8
163#define MSC01_PCI_CFGADDR_FNUM_MSK 0x00000700
164#define MSC01_PCI_CFGADDR_RNUM_SHF 2
165#define MSC01_PCI_CFGADDR_RNUM_MSK 0x000000fc
166
167#define MSC01_PCI_CFGDATA_DATA_SHF 0
168#define MSC01_PCI_CFGDATA_DATA_MSK 0xffffffff
169
170/* The defines below are ONLY valid for a MEM bar! */
171#define MSC01_PCI_BAR0_SIZE_SHF 4
172#define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0
173#define MSC01_PCI_BAR0_P_SHF 3
174#define MSC01_PCI_BAR0_P_MSK 0x00000008
175#define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK
176#define MSC01_PCI_BAR0_D_SHF 1
177#define MSC01_PCI_BAR0_D_MSK 0x00000006
178#define MSC01_PCI_BAR0_T_SHF 0
179#define MSC01_PCI_BAR0_T_MSK 0x00000001
180#define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK
181
182
183#define MSC01_PCI_CFG_RA_SHF 17
184#define MSC01_PCI_CFG_RA_MSK 0x00020000
185#define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK
186#define MSC01_PCI_CFG_G_SHF 16
187#define MSC01_PCI_CFG_G_MSK 0x00010000
188#define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK
189#define MSC01_PCI_CFG_EN_SHF 15
190#define MSC01_PCI_CFG_EN_MSK 0x00008000
191#define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK
192#define MSC01_PCI_CFG_MAXRTRY_SHF 0
193#define MSC01_PCI_CFG_MAXRTRY_MSK 0x00000fff
194
195#define MSC01_PCI_SWAP_IO_SHF 18
196#define MSC01_PCI_SWAP_IO_MSK 0x000c0000
197#define MSC01_PCI_SWAP_MEM_SHF 16
198#define MSC01_PCI_SWAP_MEM_MSK 0x00030000
199#define MSC01_PCI_SWAP_BAR0_SHF 0
200#define MSC01_PCI_SWAP_BAR0_MSK 0x00000003
201#define MSC01_PCI_SWAP_NOSWAP 0
202#define MSC01_PCI_SWAP_BYTESWAP 1
203
204/*
205 * MIPS System controller PCI register base.
206 *
207 * FIXME - are these macros specific to Malta and co or to the MSC? If the
208 * latter, they should be moved elsewhere.
209 */
210#define MIPS_MSC01_PCI_REG_BASE 0x1bd00000
211#define MIPS_SOCITSC_PCI_REG_BASE 0x1ff10000
212
213extern unsigned long _pcictrl_msc;
214
215#define MSC01_PCI_REG_BASE _pcictrl_msc
216
217#define MSC_WRITE(reg, data) do { *(volatile u32 *)(reg) = data; } while (0)
218#define MSC_READ(reg, data) do { data = *(volatile u32 *)(reg); } while (0)
219
220/*
221 * Registers absolute addresses
222 */
223
224#define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS)
225#define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS)
226#define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS)
227#define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS)
228#define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS)
229#define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS)
230#define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS)
231#define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS)
232#define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS)
233#define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS)
234#define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS)
235#define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS)
236#define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS)
237#define MSC01_PCI_IACK (MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS)
238#define MSC01_PCI_HEAD0 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS)
239#define MSC01_PCI_HEAD1 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS)
240#define MSC01_PCI_HEAD2 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD2_OFS)
241#define MSC01_PCI_HEAD3 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD3_OFS)
242#define MSC01_PCI_HEAD4 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD4_OFS)
243#define MSC01_PCI_HEAD5 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD5_OFS)
244#define MSC01_PCI_HEAD6 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD6_OFS)
245#define MSC01_PCI_HEAD7 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD7_OFS)
246#define MSC01_PCI_HEAD8 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD8_OFS)
247#define MSC01_PCI_HEAD9 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD9_OFS)
248#define MSC01_PCI_HEAD10 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD10_OFS)
249#define MSC01_PCI_HEAD11 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
250#define MSC01_PCI_HEAD12 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
251#define MSC01_PCI_HEAD13 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
252#define MSC01_PCI_HEAD14 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
253#define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
254#define MSC01_PCI_BAR0 (MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS)
255#define MSC01_PCI_CFG (MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS)
256#define MSC01_PCI_SWAP (MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS)
257
258#endif /* __ASM_MIPS_BOARDS_MSC01_PCI_H */
diff --git a/include/asm-mips/mips-boards/piix4.h b/include/asm-mips/mips-boards/piix4.h
deleted file mode 100644
index 2971d60f2e95..000000000000
--- a/include/asm-mips/mips-boards/piix4.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Register definitions for Intel PIIX4 South Bridge Device.
19 */
20#ifndef __ASM_MIPS_BOARDS_PIIX4_H
21#define __ASM_MIPS_BOARDS_PIIX4_H
22
23/************************************************************************
24 * IO register offsets
25 ************************************************************************/
26#define PIIX4_ICTLR1_ICW1 0x20
27#define PIIX4_ICTLR1_ICW2 0x21
28#define PIIX4_ICTLR1_ICW3 0x21
29#define PIIX4_ICTLR1_ICW4 0x21
30#define PIIX4_ICTLR2_ICW1 0xa0
31#define PIIX4_ICTLR2_ICW2 0xa1
32#define PIIX4_ICTLR2_ICW3 0xa1
33#define PIIX4_ICTLR2_ICW4 0xa1
34#define PIIX4_ICTLR1_OCW1 0x21
35#define PIIX4_ICTLR1_OCW2 0x20
36#define PIIX4_ICTLR1_OCW3 0x20
37#define PIIX4_ICTLR1_OCW4 0x20
38#define PIIX4_ICTLR2_OCW1 0xa1
39#define PIIX4_ICTLR2_OCW2 0xa0
40#define PIIX4_ICTLR2_OCW3 0xa0
41#define PIIX4_ICTLR2_OCW4 0xa0
42
43
44/************************************************************************
45 * Register encodings.
46 ************************************************************************/
47#define PIIX4_OCW2_NSEOI (0x1 << 5)
48#define PIIX4_OCW2_SEOI (0x3 << 5)
49#define PIIX4_OCW2_RNSEOI (0x5 << 5)
50#define PIIX4_OCW2_RAEOIS (0x4 << 5)
51#define PIIX4_OCW2_RAEOIC (0x0 << 5)
52#define PIIX4_OCW2_RSEOI (0x7 << 5)
53#define PIIX4_OCW2_SP (0x6 << 5)
54#define PIIX4_OCW2_NOP (0x2 << 5)
55
56#define PIIX4_OCW2_SEL (0x0 << 3)
57
58#define PIIX4_OCW2_ILS_0 0
59#define PIIX4_OCW2_ILS_1 1
60#define PIIX4_OCW2_ILS_2 2
61#define PIIX4_OCW2_ILS_3 3
62#define PIIX4_OCW2_ILS_4 4
63#define PIIX4_OCW2_ILS_5 5
64#define PIIX4_OCW2_ILS_6 6
65#define PIIX4_OCW2_ILS_7 7
66#define PIIX4_OCW2_ILS_8 0
67#define PIIX4_OCW2_ILS_9 1
68#define PIIX4_OCW2_ILS_10 2
69#define PIIX4_OCW2_ILS_11 3
70#define PIIX4_OCW2_ILS_12 4
71#define PIIX4_OCW2_ILS_13 5
72#define PIIX4_OCW2_ILS_14 6
73#define PIIX4_OCW2_ILS_15 7
74
75#define PIIX4_OCW3_SEL (0x1 << 3)
76
77#define PIIX4_OCW3_IRR 0x2
78#define PIIX4_OCW3_ISR 0x3
79
80#endif /* __ASM_MIPS_BOARDS_PIIX4_H */
diff --git a/include/asm-mips/mips-boards/prom.h b/include/asm-mips/mips-boards/prom.h
deleted file mode 100644
index a9db576a9768..000000000000
--- a/include/asm-mips/mips-boards/prom.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * 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 * MIPS boards bootprom interface for the Linux kernel.
23 *
24 */
25
26#ifndef _MIPS_PROM_H
27#define _MIPS_PROM_H
28
29extern char *prom_getcmdline(void);
30extern char *prom_getenv(char *name);
31extern void prom_init_cmdline(void);
32extern void prom_meminit(void);
33extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
34extern void mips_display_message(const char *str);
35extern void mips_display_word(unsigned int num);
36extern void mips_scroll_message(void);
37extern int get_ethernet_addr(char *ethernet_addr);
38
39/* Memory descriptor management. */
40#define PROM_MAX_PMEMBLOCKS 32
41struct prom_pmemblock {
42 unsigned long base; /* Within KSEG0. */
43 unsigned int size; /* In bytes. */
44 unsigned int type; /* free or prom memory */
45};
46
47#endif /* !(_MIPS_PROM_H) */
diff --git a/include/asm-mips/mips-boards/sim.h b/include/asm-mips/mips-boards/sim.h
deleted file mode 100644
index acb7c2331d98..000000000000
--- a/include/asm-mips/mips-boards/sim.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#ifndef _ASM_MIPS_BOARDS_SIM_H
20#define _ASM_MIPS_BOARDS_SIM_H
21
22#define STATS_ON 1
23#define STATS_OFF 2
24#define STATS_CLEAR 3
25#define STATS_DUMP 4
26#define TRACE_ON 5
27#define TRACE_OFF 6
28
29
30#define simcfg(code) \
31({ \
32 __asm__ __volatile__( \
33 "sltiu $0,$0, %0" \
34 ::"i"(code) \
35 ); \
36})
37
38
39
40#endif
diff --git a/include/asm-mips/mips-boards/simint.h b/include/asm-mips/mips-boards/simint.h
deleted file mode 100644
index 8ef6db76d5c1..000000000000
--- a/include/asm-mips/mips-boards/simint.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 */
17#ifndef _MIPS_SIMINT_H
18#define _MIPS_SIMINT_H
19
20#include <irq.h>
21
22#define SIM_INT_BASE 0
23#define MIPSCPU_INT_MB0 2
24#define MIPS_CPU_TIMER_IRQ 7
25
26
27#define MSC01E_INT_BASE 64
28
29#define MSC01E_INT_CPUCTR 11
30
31#endif
diff --git a/include/asm-mips/mips_mt.h b/include/asm-mips/mips_mt.h
deleted file mode 100644
index ac7935203f89..000000000000
--- a/include/asm-mips/mips_mt.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Definitions and decalrations for MIPS MT support
3 * that are common between SMTC, VSMP, and/or AP/SP
4 * kernel models.
5 */
6#ifndef __ASM_MIPS_MT_H
7#define __ASM_MIPS_MT_H
8
9#include <linux/cpumask.h>
10
11/*
12 * How many VPEs and TCs is Linux allowed to use? 0 means no limit.
13 */
14extern int tclimit;
15extern int vpelimit;
16
17extern cpumask_t mt_fpu_cpumask;
18extern unsigned long mt_fpemul_threshold;
19
20extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value);
21extern void mips_mt_set_cpuoptions(void);
22
23struct class;
24extern struct class *mt_class;
25
26#endif /* __ASM_MIPS_MT_H */
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h
deleted file mode 100644
index c9420aa97e32..000000000000
--- a/include/asm-mips/mipsmtregs.h
+++ /dev/null
@@ -1,395 +0,0 @@
1/*
2 * MT regs definitions, follows on from mipsregs.h
3 * Copyright (C) 2004 - 2005 MIPS Technologies, Inc. All rights reserved.
4 * Elizabeth Clarke et. al.
5 *
6 */
7#ifndef _ASM_MIPSMTREGS_H
8#define _ASM_MIPSMTREGS_H
9
10#include <asm/mipsregs.h>
11#include <asm/war.h>
12
13#ifndef __ASSEMBLY__
14
15/*
16 * C macros
17 */
18
19#define read_c0_mvpcontrol() __read_32bit_c0_register($0, 1)
20#define write_c0_mvpcontrol(val) __write_32bit_c0_register($0, 1, val)
21
22#define read_c0_mvpconf0() __read_32bit_c0_register($0, 2)
23#define read_c0_mvpconf1() __read_32bit_c0_register($0, 3)
24
25#define read_c0_vpecontrol() __read_32bit_c0_register($1, 1)
26#define write_c0_vpecontrol(val) __write_32bit_c0_register($1, 1, val)
27
28#define read_c0_vpeconf0() __read_32bit_c0_register($1, 2)
29#define write_c0_vpeconf0(val) __write_32bit_c0_register($1, 2, val)
30
31#define read_c0_tcstatus() __read_32bit_c0_register($2, 1)
32#define write_c0_tcstatus(val) __write_32bit_c0_register($2, 1, val)
33
34#define read_c0_tcbind() __read_32bit_c0_register($2, 2)
35
36#define read_c0_tccontext() __read_32bit_c0_register($2, 5)
37#define write_c0_tccontext(val) __write_32bit_c0_register($2, 5, val)
38
39#else /* Assembly */
40/*
41 * Macros for use in assembly language code
42 */
43
44#define CP0_MVPCONTROL $0, 1
45#define CP0_MVPCONF0 $0, 2
46#define CP0_MVPCONF1 $0, 3
47#define CP0_VPECONTROL $1, 1
48#define CP0_VPECONF0 $1, 2
49#define CP0_VPECONF1 $1, 3
50#define CP0_YQMASK $1, 4
51#define CP0_VPESCHEDULE $1, 5
52#define CP0_VPESCHEFBK $1, 6
53#define CP0_TCSTATUS $2, 1
54#define CP0_TCBIND $2, 2
55#define CP0_TCRESTART $2, 3
56#define CP0_TCHALT $2, 4
57#define CP0_TCCONTEXT $2, 5
58#define CP0_TCSCHEDULE $2, 6
59#define CP0_TCSCHEFBK $2, 7
60#define CP0_SRSCONF0 $6, 1
61#define CP0_SRSCONF1 $6, 2
62#define CP0_SRSCONF2 $6, 3
63#define CP0_SRSCONF3 $6, 4
64#define CP0_SRSCONF4 $6, 5
65
66#endif
67
68/* MVPControl fields */
69#define MVPCONTROL_EVP (_ULCAST_(1))
70
71#define MVPCONTROL_VPC_SHIFT 1
72#define MVPCONTROL_VPC (_ULCAST_(1) << MVPCONTROL_VPC_SHIFT)
73
74#define MVPCONTROL_STLB_SHIFT 2
75#define MVPCONTROL_STLB (_ULCAST_(1) << MVPCONTROL_STLB_SHIFT)
76
77
78/* MVPConf0 fields */
79#define MVPCONF0_PTC_SHIFT 0
80#define MVPCONF0_PTC ( _ULCAST_(0xff))
81#define MVPCONF0_PVPE_SHIFT 10
82#define MVPCONF0_PVPE ( _ULCAST_(0xf) << MVPCONF0_PVPE_SHIFT)
83#define MVPCONF0_TCA_SHIFT 15
84#define MVPCONF0_TCA ( _ULCAST_(1) << MVPCONF0_TCA_SHIFT)
85#define MVPCONF0_PTLBE_SHIFT 16
86#define MVPCONF0_PTLBE (_ULCAST_(0x3ff) << MVPCONF0_PTLBE_SHIFT)
87#define MVPCONF0_TLBS_SHIFT 29
88#define MVPCONF0_TLBS (_ULCAST_(1) << MVPCONF0_TLBS_SHIFT)
89#define MVPCONF0_M_SHIFT 31
90#define MVPCONF0_M (_ULCAST_(0x1) << MVPCONF0_M_SHIFT)
91
92
93/* config3 fields */
94#define CONFIG3_MT_SHIFT 2
95#define CONFIG3_MT (_ULCAST_(1) << CONFIG3_MT_SHIFT)
96
97
98/* VPEControl fields (per VPE) */
99#define VPECONTROL_TARGTC (_ULCAST_(0xff))
100
101#define VPECONTROL_TE_SHIFT 15
102#define VPECONTROL_TE (_ULCAST_(1) << VPECONTROL_TE_SHIFT)
103#define VPECONTROL_EXCPT_SHIFT 16
104#define VPECONTROL_EXCPT (_ULCAST_(0x7) << VPECONTROL_EXCPT_SHIFT)
105
106/* Thread Exception Codes for EXCPT field */
107#define THREX_TU 0
108#define THREX_TO 1
109#define THREX_IYQ 2
110#define THREX_GSX 3
111#define THREX_YSCH 4
112#define THREX_GSSCH 5
113
114#define VPECONTROL_GSI_SHIFT 20
115#define VPECONTROL_GSI (_ULCAST_(1) << VPECONTROL_GSI_SHIFT)
116#define VPECONTROL_YSI_SHIFT 21
117#define VPECONTROL_YSI (_ULCAST_(1) << VPECONTROL_YSI_SHIFT)
118
119/* VPEConf0 fields (per VPE) */
120#define VPECONF0_VPA_SHIFT 0
121#define VPECONF0_VPA (_ULCAST_(1) << VPECONF0_VPA_SHIFT)
122#define VPECONF0_MVP_SHIFT 1
123#define VPECONF0_MVP (_ULCAST_(1) << VPECONF0_MVP_SHIFT)
124#define VPECONF0_XTC_SHIFT 21
125#define VPECONF0_XTC (_ULCAST_(0xff) << VPECONF0_XTC_SHIFT)
126
127/* TCStatus fields (per TC) */
128#define TCSTATUS_TASID (_ULCAST_(0xff))
129#define TCSTATUS_IXMT_SHIFT 10
130#define TCSTATUS_IXMT (_ULCAST_(1) << TCSTATUS_IXMT_SHIFT)
131#define TCSTATUS_TKSU_SHIFT 11
132#define TCSTATUS_TKSU (_ULCAST_(3) << TCSTATUS_TKSU_SHIFT)
133#define TCSTATUS_A_SHIFT 13
134#define TCSTATUS_A (_ULCAST_(1) << TCSTATUS_A_SHIFT)
135#define TCSTATUS_DA_SHIFT 15
136#define TCSTATUS_DA (_ULCAST_(1) << TCSTATUS_DA_SHIFT)
137#define TCSTATUS_DT_SHIFT 20
138#define TCSTATUS_DT (_ULCAST_(1) << TCSTATUS_DT_SHIFT)
139#define TCSTATUS_TDS_SHIFT 21
140#define TCSTATUS_TDS (_ULCAST_(1) << TCSTATUS_TDS_SHIFT)
141#define TCSTATUS_TSST_SHIFT 22
142#define TCSTATUS_TSST (_ULCAST_(1) << TCSTATUS_TSST_SHIFT)
143#define TCSTATUS_RNST_SHIFT 23
144#define TCSTATUS_RNST (_ULCAST_(3) << TCSTATUS_RNST_SHIFT)
145/* Codes for RNST */
146#define TC_RUNNING 0
147#define TC_WAITING 1
148#define TC_YIELDING 2
149#define TC_GATED 3
150
151#define TCSTATUS_TMX_SHIFT 27
152#define TCSTATUS_TMX (_ULCAST_(1) << TCSTATUS_TMX_SHIFT)
153/* TCStatus TCU bits can use same definitions/offsets as CU bits in Status */
154
155/* TCBind */
156#define TCBIND_CURVPE_SHIFT 0
157#define TCBIND_CURVPE (_ULCAST_(0xf))
158
159#define TCBIND_CURTC_SHIFT 21
160
161#define TCBIND_CURTC (_ULCAST_(0xff) << TCBIND_CURTC_SHIFT)
162
163/* TCHalt */
164#define TCHALT_H (_ULCAST_(1))
165
166#ifndef __ASSEMBLY__
167
168static inline unsigned int dvpe(void)
169{
170 int res = 0;
171
172 __asm__ __volatile__(
173 " .set push \n"
174 " .set noreorder \n"
175 " .set noat \n"
176 " .set mips32r2 \n"
177 " .word 0x41610001 # dvpe $1 \n"
178 " move %0, $1 \n"
179 " ehb \n"
180 " .set pop \n"
181 : "=r" (res));
182
183 instruction_hazard();
184
185 return res;
186}
187
188static inline void __raw_evpe(void)
189{
190 __asm__ __volatile__(
191 " .set push \n"
192 " .set noreorder \n"
193 " .set noat \n"
194 " .set mips32r2 \n"
195 " .word 0x41600021 # evpe \n"
196 " ehb \n"
197 " .set pop \n");
198}
199
200/* Enable virtual processor execution if previous suggested it should be.
201 EVPE_ENABLE to force */
202
203#define EVPE_ENABLE MVPCONTROL_EVP
204
205static inline void evpe(int previous)
206{
207 if ((previous & MVPCONTROL_EVP))
208 __raw_evpe();
209}
210
211static inline unsigned int dmt(void)
212{
213 int res;
214
215 __asm__ __volatile__(
216 " .set push \n"
217 " .set mips32r2 \n"
218 " .set noat \n"
219 " .word 0x41610BC1 # dmt $1 \n"
220 " ehb \n"
221 " move %0, $1 \n"
222 " .set pop \n"
223 : "=r" (res));
224
225 instruction_hazard();
226
227 return res;
228}
229
230static inline void __raw_emt(void)
231{
232 __asm__ __volatile__(
233 " .set noreorder \n"
234 " .set mips32r2 \n"
235 " .word 0x41600be1 # emt \n"
236 " ehb \n"
237 " .set mips0 \n"
238 " .set reorder");
239}
240
241/* enable multi-threaded execution if previous suggested it should be.
242 EMT_ENABLE to force */
243
244#define EMT_ENABLE VPECONTROL_TE
245
246static inline void emt(int previous)
247{
248 if ((previous & EMT_ENABLE))
249 __raw_emt();
250}
251
252static inline void ehb(void)
253{
254 __asm__ __volatile__(
255 " .set mips32r2 \n"
256 " ehb \n"
257 " .set mips0 \n");
258}
259
260#define mftc0(rt,sel) \
261({ \
262 unsigned long __res; \
263 \
264 __asm__ __volatile__( \
265 " .set push \n" \
266 " .set mips32r2 \n" \
267 " .set noat \n" \
268 " # mftc0 $1, $" #rt ", " #sel " \n" \
269 " .word 0x41000800 | (" #rt " << 16) | " #sel " \n" \
270 " move %0, $1 \n" \
271 " .set pop \n" \
272 : "=r" (__res)); \
273 \
274 __res; \
275})
276
277#define mftgpr(rt) \
278({ \
279 unsigned long __res; \
280 \
281 __asm__ __volatile__( \
282 " .set push \n" \
283 " .set noat \n" \
284 " .set mips32r2 \n" \
285 " # mftgpr $1," #rt " \n" \
286 " .word 0x41000820 | (" #rt " << 16) \n" \
287 " move %0, $1 \n" \
288 " .set pop \n" \
289 : "=r" (__res)); \
290 \
291 __res; \
292})
293
294#define mftr(rt, u, sel) \
295({ \
296 unsigned long __res; \
297 \
298 __asm__ __volatile__( \
299 " mftr %0, " #rt ", " #u ", " #sel " \n" \
300 : "=r" (__res)); \
301 \
302 __res; \
303})
304
305#define mttgpr(rd,v) \
306do { \
307 __asm__ __volatile__( \
308 " .set push \n" \
309 " .set mips32r2 \n" \
310 " .set noat \n" \
311 " move $1, %0 \n" \
312 " # mttgpr $1, " #rd " \n" \
313 " .word 0x41810020 | (" #rd " << 11) \n" \
314 " .set pop \n" \
315 : : "r" (v)); \
316} while (0)
317
318#define mttc0(rd, sel, v) \
319({ \
320 __asm__ __volatile__( \
321 " .set push \n" \
322 " .set mips32r2 \n" \
323 " .set noat \n" \
324 " move $1, %0 \n" \
325 " # mttc0 %0," #rd ", " #sel " \n" \
326 " .word 0x41810000 | (" #rd " << 11) | " #sel " \n" \
327 " .set pop \n" \
328 : \
329 : "r" (v)); \
330})
331
332
333#define mttr(rd, u, sel, v) \
334({ \
335 __asm__ __volatile__( \
336 "mttr %0," #rd ", " #u ", " #sel \
337 : : "r" (v)); \
338})
339
340
341#define settc(tc) \
342do { \
343 write_c0_vpecontrol((read_c0_vpecontrol()&~VPECONTROL_TARGTC) | (tc)); \
344 ehb(); \
345} while (0)
346
347
348/* you *must* set the target tc (settc) before trying to use these */
349#define read_vpe_c0_vpecontrol() mftc0(1, 1)
350#define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val)
351#define read_vpe_c0_vpeconf0() mftc0(1, 2)
352#define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val)
353#define read_vpe_c0_count() mftc0(9, 0)
354#define write_vpe_c0_count(val) mttc0(9, 0, val)
355#define read_vpe_c0_status() mftc0(12, 0)
356#define write_vpe_c0_status(val) mttc0(12, 0, val)
357#define read_vpe_c0_cause() mftc0(13, 0)
358#define write_vpe_c0_cause(val) mttc0(13, 0, val)
359#define read_vpe_c0_config() mftc0(16, 0)
360#define write_vpe_c0_config(val) mttc0(16, 0, val)
361#define read_vpe_c0_config1() mftc0(16, 1)
362#define write_vpe_c0_config1(val) mttc0(16, 1, val)
363#define read_vpe_c0_config7() mftc0(16, 7)
364#define write_vpe_c0_config7(val) mttc0(16, 7, val)
365#define read_vpe_c0_ebase() mftc0(15, 1)
366#define write_vpe_c0_ebase(val) mttc0(15, 1, val)
367#define write_vpe_c0_compare(val) mttc0(11, 0, val)
368#define read_vpe_c0_badvaddr() mftc0(8, 0)
369#define read_vpe_c0_epc() mftc0(14, 0)
370#define write_vpe_c0_epc(val) mttc0(14, 0, val)
371
372
373/* TC */
374#define read_tc_c0_tcstatus() mftc0(2, 1)
375#define write_tc_c0_tcstatus(val) mttc0(2, 1, val)
376#define read_tc_c0_tcbind() mftc0(2, 2)
377#define write_tc_c0_tcbind(val) mttc0(2, 2, val)
378#define read_tc_c0_tcrestart() mftc0(2, 3)
379#define write_tc_c0_tcrestart(val) mttc0(2, 3, val)
380#define read_tc_c0_tchalt() mftc0(2, 4)
381#define write_tc_c0_tchalt(val) mttc0(2, 4, val)
382#define read_tc_c0_tccontext() mftc0(2, 5)
383#define write_tc_c0_tccontext(val) mttc0(2, 5, val)
384
385/* GPR */
386#define read_tc_gpr_sp() mftgpr(29)
387#define write_tc_gpr_sp(val) mttgpr(29, val)
388#define read_tc_gpr_gp() mftgpr(28)
389#define write_tc_gpr_gp(val) mttgpr(28, val)
390
391__BUILD_SET_C0(mvpcontrol)
392
393#endif /* Not __ASSEMBLY__ */
394
395#endif
diff --git a/include/asm-mips/mipsprom.h b/include/asm-mips/mipsprom.h
deleted file mode 100644
index 146d41b67adc..000000000000
--- a/include/asm-mips/mipsprom.h
+++ /dev/null
@@ -1,76 +0,0 @@
1#ifndef __ASM_MIPS_PROM_H
2#define __ASM_MIPS_PROM_H
3
4#define PROM_RESET 0
5#define PROM_EXEC 1
6#define PROM_RESTART 2
7#define PROM_REINIT 3
8#define PROM_REBOOT 4
9#define PROM_AUTOBOOT 5
10#define PROM_OPEN 6
11#define PROM_READ 7
12#define PROM_WRITE 8
13#define PROM_IOCTL 9
14#define PROM_CLOSE 10
15#define PROM_GETCHAR 11
16#define PROM_PUTCHAR 12
17#define PROM_SHOWCHAR 13 /* XXX */
18#define PROM_GETS 14 /* XXX */
19#define PROM_PUTS 15 /* XXX */
20#define PROM_PRINTF 16 /* XXX */
21
22/* What are these for? */
23#define PROM_INITPROTO 17 /* XXX */
24#define PROM_PROTOENABLE 18 /* XXX */
25#define PROM_PROTODISABLE 19 /* XXX */
26#define PROM_GETPKT 20 /* XXX */
27#define PROM_PUTPKT 21 /* XXX */
28
29/* More PROM shit. Probably has to do with VME RMW cycles??? */
30#define PROM_ORW_RMW 22 /* XXX */
31#define PROM_ORH_RMW 23 /* XXX */
32#define PROM_ORB_RMW 24 /* XXX */
33#define PROM_ANDW_RMW 25 /* XXX */
34#define PROM_ANDH_RMW 26 /* XXX */
35#define PROM_ANDB_RMW 27 /* XXX */
36
37/* Cache handling stuff */
38#define PROM_FLUSHCACHE 28 /* XXX */
39#define PROM_CLEARCACHE 29 /* XXX */
40
41/* Libc alike stuff */
42#define PROM_SETJMP 30 /* XXX */
43#define PROM_LONGJMP 31 /* XXX */
44#define PROM_BEVUTLB 32 /* XXX */
45#define PROM_GETENV 33 /* XXX */
46#define PROM_SETENV 34 /* XXX */
47#define PROM_ATOB 35 /* XXX */
48#define PROM_STRCMP 36 /* XXX */
49#define PROM_STRLEN 37 /* XXX */
50#define PROM_STRCPY 38 /* XXX */
51#define PROM_STRCAT 39 /* XXX */
52
53/* Misc stuff */
54#define PROM_PARSER 40 /* XXX */
55#define PROM_RANGE 41 /* XXX */
56#define PROM_ARGVIZE 42 /* XXX */
57#define PROM_HELP 43 /* XXX */
58
59/* Entry points for some PROM commands */
60#define PROM_DUMPCMD 44 /* XXX */
61#define PROM_SETENVCMD 45 /* XXX */
62#define PROM_UNSETENVCMD 46 /* XXX */
63#define PROM_PRINTENVCMD 47 /* XXX */
64#define PROM_BEVEXCEPT 48 /* XXX */
65#define PROM_ENABLECMD 49 /* XXX */
66#define PROM_DISABLECMD 50 /* XXX */
67
68#define PROM_CLEARNOFAULT 51 /* XXX */
69#define PROM_NOTIMPLEMENT 52 /* XXX */
70
71#define PROM_NV_GET 53 /* XXX */
72#define PROM_NV_SET 54 /* XXX */
73
74extern char *prom_getenv(char *);
75
76#endif /* __ASM_MIPS_PROM_H */
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
deleted file mode 100644
index a46f8e258e6b..000000000000
--- a/include/asm-mips/mipsregs.h
+++ /dev/null
@@ -1,1526 +0,0 @@
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 * Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001 by Ralf Baechle
7 * Copyright (C) 2000 Silicon Graphics, Inc.
8 * Modified for further R[236]000 support by Paul M. Antoine, 1996.
9 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2000, 07 MIPS Technologies, Inc.
11 * Copyright (C) 2003, 2004 Maciej W. Rozycki
12 */
13#ifndef _ASM_MIPSREGS_H
14#define _ASM_MIPSREGS_H
15
16#include <linux/linkage.h>
17#include <asm/hazards.h>
18#include <asm/war.h>
19
20/*
21 * The following macros are especially useful for __asm__
22 * inline assembler.
23 */
24#ifndef __STR
25#define __STR(x) #x
26#endif
27#ifndef STR
28#define STR(x) __STR(x)
29#endif
30
31/*
32 * Configure language
33 */
34#ifdef __ASSEMBLY__
35#define _ULCAST_
36#else
37#define _ULCAST_ (unsigned long)
38#endif
39
40/*
41 * Coprocessor 0 register names
42 */
43#define CP0_INDEX $0
44#define CP0_RANDOM $1
45#define CP0_ENTRYLO0 $2
46#define CP0_ENTRYLO1 $3
47#define CP0_CONF $3
48#define CP0_CONTEXT $4
49#define CP0_PAGEMASK $5
50#define CP0_WIRED $6
51#define CP0_INFO $7
52#define CP0_BADVADDR $8
53#define CP0_COUNT $9
54#define CP0_ENTRYHI $10
55#define CP0_COMPARE $11
56#define CP0_STATUS $12
57#define CP0_CAUSE $13
58#define CP0_EPC $14
59#define CP0_PRID $15
60#define CP0_CONFIG $16
61#define CP0_LLADDR $17
62#define CP0_WATCHLO $18
63#define CP0_WATCHHI $19
64#define CP0_XCONTEXT $20
65#define CP0_FRAMEMASK $21
66#define CP0_DIAGNOSTIC $22
67#define CP0_DEBUG $23
68#define CP0_DEPC $24
69#define CP0_PERFORMANCE $25
70#define CP0_ECC $26
71#define CP0_CACHEERR $27
72#define CP0_TAGLO $28
73#define CP0_TAGHI $29
74#define CP0_ERROREPC $30
75#define CP0_DESAVE $31
76
77/*
78 * R4640/R4650 cp0 register names. These registers are listed
79 * here only for completeness; without MMU these CPUs are not useable
80 * by Linux. A future ELKS port might take make Linux run on them
81 * though ...
82 */
83#define CP0_IBASE $0
84#define CP0_IBOUND $1
85#define CP0_DBASE $2
86#define CP0_DBOUND $3
87#define CP0_CALG $17
88#define CP0_IWATCH $18
89#define CP0_DWATCH $19
90
91/*
92 * Coprocessor 0 Set 1 register names
93 */
94#define CP0_S1_DERRADDR0 $26
95#define CP0_S1_DERRADDR1 $27
96#define CP0_S1_INTCONTROL $20
97
98/*
99 * Coprocessor 0 Set 2 register names
100 */
101#define CP0_S2_SRSCTL $12 /* MIPSR2 */
102
103/*
104 * Coprocessor 0 Set 3 register names
105 */
106#define CP0_S3_SRSMAP $12 /* MIPSR2 */
107
108/*
109 * TX39 Series
110 */
111#define CP0_TX39_CACHE $7
112
113/*
114 * Coprocessor 1 (FPU) register names
115 */
116#define CP1_REVISION $0
117#define CP1_STATUS $31
118
119/*
120 * FPU Status Register Values
121 */
122/*
123 * Status Register Values
124 */
125
126#define FPU_CSR_FLUSH 0x01000000 /* flush denormalised results to 0 */
127#define FPU_CSR_COND 0x00800000 /* $fcc0 */
128#define FPU_CSR_COND0 0x00800000 /* $fcc0 */
129#define FPU_CSR_COND1 0x02000000 /* $fcc1 */
130#define FPU_CSR_COND2 0x04000000 /* $fcc2 */
131#define FPU_CSR_COND3 0x08000000 /* $fcc3 */
132#define FPU_CSR_COND4 0x10000000 /* $fcc4 */
133#define FPU_CSR_COND5 0x20000000 /* $fcc5 */
134#define FPU_CSR_COND6 0x40000000 /* $fcc6 */
135#define FPU_CSR_COND7 0x80000000 /* $fcc7 */
136
137/*
138 * X the exception cause indicator
139 * E the exception enable
140 * S the sticky/flag bit
141*/
142#define FPU_CSR_ALL_X 0x0003f000
143#define FPU_CSR_UNI_X 0x00020000
144#define FPU_CSR_INV_X 0x00010000
145#define FPU_CSR_DIV_X 0x00008000
146#define FPU_CSR_OVF_X 0x00004000
147#define FPU_CSR_UDF_X 0x00002000
148#define FPU_CSR_INE_X 0x00001000
149
150#define FPU_CSR_ALL_E 0x00000f80
151#define FPU_CSR_INV_E 0x00000800
152#define FPU_CSR_DIV_E 0x00000400
153#define FPU_CSR_OVF_E 0x00000200
154#define FPU_CSR_UDF_E 0x00000100
155#define FPU_CSR_INE_E 0x00000080
156
157#define FPU_CSR_ALL_S 0x0000007c
158#define FPU_CSR_INV_S 0x00000040
159#define FPU_CSR_DIV_S 0x00000020
160#define FPU_CSR_OVF_S 0x00000010
161#define FPU_CSR_UDF_S 0x00000008
162#define FPU_CSR_INE_S 0x00000004
163
164/* rounding mode */
165#define FPU_CSR_RN 0x0 /* nearest */
166#define FPU_CSR_RZ 0x1 /* towards zero */
167#define FPU_CSR_RU 0x2 /* towards +Infinity */
168#define FPU_CSR_RD 0x3 /* towards -Infinity */
169
170
171/*
172 * Values for PageMask register
173 */
174#ifdef CONFIG_CPU_VR41XX
175
176/* Why doesn't stupidity hurt ... */
177
178#define PM_1K 0x00000000
179#define PM_4K 0x00001800
180#define PM_16K 0x00007800
181#define PM_64K 0x0001f800
182#define PM_256K 0x0007f800
183
184#else
185
186#define PM_4K 0x00000000
187#define PM_16K 0x00006000
188#define PM_64K 0x0001e000
189#define PM_256K 0x0007e000
190#define PM_1M 0x001fe000
191#define PM_4M 0x007fe000
192#define PM_16M 0x01ffe000
193#define PM_64M 0x07ffe000
194#define PM_256M 0x1fffe000
195
196#endif
197
198/*
199 * Default page size for a given kernel configuration
200 */
201#ifdef CONFIG_PAGE_SIZE_4KB
202#define PM_DEFAULT_MASK PM_4K
203#elif defined(CONFIG_PAGE_SIZE_16KB)
204#define PM_DEFAULT_MASK PM_16K
205#elif defined(CONFIG_PAGE_SIZE_64KB)
206#define PM_DEFAULT_MASK PM_64K
207#else
208#error Bad page size configuration!
209#endif
210
211
212/*
213 * Values used for computation of new tlb entries
214 */
215#define PL_4K 12
216#define PL_16K 14
217#define PL_64K 16
218#define PL_256K 18
219#define PL_1M 20
220#define PL_4M 22
221#define PL_16M 24
222#define PL_64M 26
223#define PL_256M 28
224
225/*
226 * R4x00 interrupt enable / cause bits
227 */
228#define IE_SW0 (_ULCAST_(1) << 8)
229#define IE_SW1 (_ULCAST_(1) << 9)
230#define IE_IRQ0 (_ULCAST_(1) << 10)
231#define IE_IRQ1 (_ULCAST_(1) << 11)
232#define IE_IRQ2 (_ULCAST_(1) << 12)
233#define IE_IRQ3 (_ULCAST_(1) << 13)
234#define IE_IRQ4 (_ULCAST_(1) << 14)
235#define IE_IRQ5 (_ULCAST_(1) << 15)
236
237/*
238 * R4x00 interrupt cause bits
239 */
240#define C_SW0 (_ULCAST_(1) << 8)
241#define C_SW1 (_ULCAST_(1) << 9)
242#define C_IRQ0 (_ULCAST_(1) << 10)
243#define C_IRQ1 (_ULCAST_(1) << 11)
244#define C_IRQ2 (_ULCAST_(1) << 12)
245#define C_IRQ3 (_ULCAST_(1) << 13)
246#define C_IRQ4 (_ULCAST_(1) << 14)
247#define C_IRQ5 (_ULCAST_(1) << 15)
248
249/*
250 * Bitfields in the R4xx0 cp0 status register
251 */
252#define ST0_IE 0x00000001
253#define ST0_EXL 0x00000002
254#define ST0_ERL 0x00000004
255#define ST0_KSU 0x00000018
256# define KSU_USER 0x00000010
257# define KSU_SUPERVISOR 0x00000008
258# define KSU_KERNEL 0x00000000
259#define ST0_UX 0x00000020
260#define ST0_SX 0x00000040
261#define ST0_KX 0x00000080
262#define ST0_DE 0x00010000
263#define ST0_CE 0x00020000
264
265/*
266 * Setting c0_status.co enables Hit_Writeback and Hit_Writeback_Invalidate
267 * cacheops in userspace. This bit exists only on RM7000 and RM9000
268 * processors.
269 */
270#define ST0_CO 0x08000000
271
272/*
273 * Bitfields in the R[23]000 cp0 status register.
274 */
275#define ST0_IEC 0x00000001
276#define ST0_KUC 0x00000002
277#define ST0_IEP 0x00000004
278#define ST0_KUP 0x00000008
279#define ST0_IEO 0x00000010
280#define ST0_KUO 0x00000020
281/* bits 6 & 7 are reserved on R[23]000 */
282#define ST0_ISC 0x00010000
283#define ST0_SWC 0x00020000
284#define ST0_CM 0x00080000
285
286/*
287 * Bits specific to the R4640/R4650
288 */
289#define ST0_UM (_ULCAST_(1) << 4)
290#define ST0_IL (_ULCAST_(1) << 23)
291#define ST0_DL (_ULCAST_(1) << 24)
292
293/*
294 * Enable the MIPS MDMX and DSP ASEs
295 */
296#define ST0_MX 0x01000000
297
298/*
299 * Bitfields in the TX39 family CP0 Configuration Register 3
300 */
301#define TX39_CONF_ICS_SHIFT 19
302#define TX39_CONF_ICS_MASK 0x00380000
303#define TX39_CONF_ICS_1KB 0x00000000
304#define TX39_CONF_ICS_2KB 0x00080000
305#define TX39_CONF_ICS_4KB 0x00100000
306#define TX39_CONF_ICS_8KB 0x00180000
307#define TX39_CONF_ICS_16KB 0x00200000
308
309#define TX39_CONF_DCS_SHIFT 16
310#define TX39_CONF_DCS_MASK 0x00070000
311#define TX39_CONF_DCS_1KB 0x00000000
312#define TX39_CONF_DCS_2KB 0x00010000
313#define TX39_CONF_DCS_4KB 0x00020000
314#define TX39_CONF_DCS_8KB 0x00030000
315#define TX39_CONF_DCS_16KB 0x00040000
316
317#define TX39_CONF_CWFON 0x00004000
318#define TX39_CONF_WBON 0x00002000
319#define TX39_CONF_RF_SHIFT 10
320#define TX39_CONF_RF_MASK 0x00000c00
321#define TX39_CONF_DOZE 0x00000200
322#define TX39_CONF_HALT 0x00000100
323#define TX39_CONF_LOCK 0x00000080
324#define TX39_CONF_ICE 0x00000020
325#define TX39_CONF_DCE 0x00000010
326#define TX39_CONF_IRSIZE_SHIFT 2
327#define TX39_CONF_IRSIZE_MASK 0x0000000c
328#define TX39_CONF_DRSIZE_SHIFT 0
329#define TX39_CONF_DRSIZE_MASK 0x00000003
330
331/*
332 * Status register bits available in all MIPS CPUs.
333 */
334#define ST0_IM 0x0000ff00
335#define STATUSB_IP0 8
336#define STATUSF_IP0 (_ULCAST_(1) << 8)
337#define STATUSB_IP1 9
338#define STATUSF_IP1 (_ULCAST_(1) << 9)
339#define STATUSB_IP2 10
340#define STATUSF_IP2 (_ULCAST_(1) << 10)
341#define STATUSB_IP3 11
342#define STATUSF_IP3 (_ULCAST_(1) << 11)
343#define STATUSB_IP4 12
344#define STATUSF_IP4 (_ULCAST_(1) << 12)
345#define STATUSB_IP5 13
346#define STATUSF_IP5 (_ULCAST_(1) << 13)
347#define STATUSB_IP6 14
348#define STATUSF_IP6 (_ULCAST_(1) << 14)
349#define STATUSB_IP7 15
350#define STATUSF_IP7 (_ULCAST_(1) << 15)
351#define STATUSB_IP8 0
352#define STATUSF_IP8 (_ULCAST_(1) << 0)
353#define STATUSB_IP9 1
354#define STATUSF_IP9 (_ULCAST_(1) << 1)
355#define STATUSB_IP10 2
356#define STATUSF_IP10 (_ULCAST_(1) << 2)
357#define STATUSB_IP11 3
358#define STATUSF_IP11 (_ULCAST_(1) << 3)
359#define STATUSB_IP12 4
360#define STATUSF_IP12 (_ULCAST_(1) << 4)
361#define STATUSB_IP13 5
362#define STATUSF_IP13 (_ULCAST_(1) << 5)
363#define STATUSB_IP14 6
364#define STATUSF_IP14 (_ULCAST_(1) << 6)
365#define STATUSB_IP15 7
366#define STATUSF_IP15 (_ULCAST_(1) << 7)
367#define ST0_CH 0x00040000
368#define ST0_SR 0x00100000
369#define ST0_TS 0x00200000
370#define ST0_BEV 0x00400000
371#define ST0_RE 0x02000000
372#define ST0_FR 0x04000000
373#define ST0_CU 0xf0000000
374#define ST0_CU0 0x10000000
375#define ST0_CU1 0x20000000
376#define ST0_CU2 0x40000000
377#define ST0_CU3 0x80000000
378#define ST0_XX 0x80000000 /* MIPS IV naming */
379
380/*
381 * Bitfields and bit numbers in the coprocessor 0 cause register.
382 *
383 * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
384 */
385#define CAUSEB_EXCCODE 2
386#define CAUSEF_EXCCODE (_ULCAST_(31) << 2)
387#define CAUSEB_IP 8
388#define CAUSEF_IP (_ULCAST_(255) << 8)
389#define CAUSEB_IP0 8
390#define CAUSEF_IP0 (_ULCAST_(1) << 8)
391#define CAUSEB_IP1 9
392#define CAUSEF_IP1 (_ULCAST_(1) << 9)
393#define CAUSEB_IP2 10
394#define CAUSEF_IP2 (_ULCAST_(1) << 10)
395#define CAUSEB_IP3 11
396#define CAUSEF_IP3 (_ULCAST_(1) << 11)
397#define CAUSEB_IP4 12
398#define CAUSEF_IP4 (_ULCAST_(1) << 12)
399#define CAUSEB_IP5 13
400#define CAUSEF_IP5 (_ULCAST_(1) << 13)
401#define CAUSEB_IP6 14
402#define CAUSEF_IP6 (_ULCAST_(1) << 14)
403#define CAUSEB_IP7 15
404#define CAUSEF_IP7 (_ULCAST_(1) << 15)
405#define CAUSEB_IV 23
406#define CAUSEF_IV (_ULCAST_(1) << 23)
407#define CAUSEB_CE 28
408#define CAUSEF_CE (_ULCAST_(3) << 28)
409#define CAUSEB_BD 31
410#define CAUSEF_BD (_ULCAST_(1) << 31)
411
412/*
413 * Bits in the coprocessor 0 config register.
414 */
415/* Generic bits. */
416#define CONF_CM_CACHABLE_NO_WA 0
417#define CONF_CM_CACHABLE_WA 1
418#define CONF_CM_UNCACHED 2
419#define CONF_CM_CACHABLE_NONCOHERENT 3
420#define CONF_CM_CACHABLE_CE 4
421#define CONF_CM_CACHABLE_COW 5
422#define CONF_CM_CACHABLE_CUW 6
423#define CONF_CM_CACHABLE_ACCELERATED 7
424#define CONF_CM_CMASK 7
425#define CONF_BE (_ULCAST_(1) << 15)
426
427/* Bits common to various processors. */
428#define CONF_CU (_ULCAST_(1) << 3)
429#define CONF_DB (_ULCAST_(1) << 4)
430#define CONF_IB (_ULCAST_(1) << 5)
431#define CONF_DC (_ULCAST_(7) << 6)
432#define CONF_IC (_ULCAST_(7) << 9)
433#define CONF_EB (_ULCAST_(1) << 13)
434#define CONF_EM (_ULCAST_(1) << 14)
435#define CONF_SM (_ULCAST_(1) << 16)
436#define CONF_SC (_ULCAST_(1) << 17)
437#define CONF_EW (_ULCAST_(3) << 18)
438#define CONF_EP (_ULCAST_(15)<< 24)
439#define CONF_EC (_ULCAST_(7) << 28)
440#define CONF_CM (_ULCAST_(1) << 31)
441
442/* Bits specific to the R4xx0. */
443#define R4K_CONF_SW (_ULCAST_(1) << 20)
444#define R4K_CONF_SS (_ULCAST_(1) << 21)
445#define R4K_CONF_SB (_ULCAST_(3) << 22)
446
447/* Bits specific to the R5000. */
448#define R5K_CONF_SE (_ULCAST_(1) << 12)
449#define R5K_CONF_SS (_ULCAST_(3) << 20)
450
451/* Bits specific to the RM7000. */
452#define RM7K_CONF_SE (_ULCAST_(1) << 3)
453#define RM7K_CONF_TE (_ULCAST_(1) << 12)
454#define RM7K_CONF_CLK (_ULCAST_(1) << 16)
455#define RM7K_CONF_TC (_ULCAST_(1) << 17)
456#define RM7K_CONF_SI (_ULCAST_(3) << 20)
457#define RM7K_CONF_SC (_ULCAST_(1) << 31)
458
459/* Bits specific to the R10000. */
460#define R10K_CONF_DN (_ULCAST_(3) << 3)
461#define R10K_CONF_CT (_ULCAST_(1) << 5)
462#define R10K_CONF_PE (_ULCAST_(1) << 6)
463#define R10K_CONF_PM (_ULCAST_(3) << 7)
464#define R10K_CONF_EC (_ULCAST_(15)<< 9)
465#define R10K_CONF_SB (_ULCAST_(1) << 13)
466#define R10K_CONF_SK (_ULCAST_(1) << 14)
467#define R10K_CONF_SS (_ULCAST_(7) << 16)
468#define R10K_CONF_SC (_ULCAST_(7) << 19)
469#define R10K_CONF_DC (_ULCAST_(7) << 26)
470#define R10K_CONF_IC (_ULCAST_(7) << 29)
471
472/* Bits specific to the VR41xx. */
473#define VR41_CONF_CS (_ULCAST_(1) << 12)
474#define VR41_CONF_P4K (_ULCAST_(1) << 13)
475#define VR41_CONF_BP (_ULCAST_(1) << 16)
476#define VR41_CONF_M16 (_ULCAST_(1) << 20)
477#define VR41_CONF_AD (_ULCAST_(1) << 23)
478
479/* Bits specific to the R30xx. */
480#define R30XX_CONF_FDM (_ULCAST_(1) << 19)
481#define R30XX_CONF_REV (_ULCAST_(1) << 22)
482#define R30XX_CONF_AC (_ULCAST_(1) << 23)
483#define R30XX_CONF_RF (_ULCAST_(1) << 24)
484#define R30XX_CONF_HALT (_ULCAST_(1) << 25)
485#define R30XX_CONF_FPINT (_ULCAST_(7) << 26)
486#define R30XX_CONF_DBR (_ULCAST_(1) << 29)
487#define R30XX_CONF_SB (_ULCAST_(1) << 30)
488#define R30XX_CONF_LOCK (_ULCAST_(1) << 31)
489
490/* Bits specific to the TX49. */
491#define TX49_CONF_DC (_ULCAST_(1) << 16)
492#define TX49_CONF_IC (_ULCAST_(1) << 17) /* conflict with CONF_SC */
493#define TX49_CONF_HALT (_ULCAST_(1) << 18)
494#define TX49_CONF_CWFON (_ULCAST_(1) << 27)
495
496/* Bits specific to the MIPS32/64 PRA. */
497#define MIPS_CONF_MT (_ULCAST_(7) << 7)
498#define MIPS_CONF_AR (_ULCAST_(7) << 10)
499#define MIPS_CONF_AT (_ULCAST_(3) << 13)
500#define MIPS_CONF_M (_ULCAST_(1) << 31)
501
502/*
503 * Bits in the MIPS32/64 PRA coprocessor 0 config registers 1 and above.
504 */
505#define MIPS_CONF1_FP (_ULCAST_(1) << 0)
506#define MIPS_CONF1_EP (_ULCAST_(1) << 1)
507#define MIPS_CONF1_CA (_ULCAST_(1) << 2)
508#define MIPS_CONF1_WR (_ULCAST_(1) << 3)
509#define MIPS_CONF1_PC (_ULCAST_(1) << 4)
510#define MIPS_CONF1_MD (_ULCAST_(1) << 5)
511#define MIPS_CONF1_C2 (_ULCAST_(1) << 6)
512#define MIPS_CONF1_DA (_ULCAST_(7) << 7)
513#define MIPS_CONF1_DL (_ULCAST_(7) << 10)
514#define MIPS_CONF1_DS (_ULCAST_(7) << 13)
515#define MIPS_CONF1_IA (_ULCAST_(7) << 16)
516#define MIPS_CONF1_IL (_ULCAST_(7) << 19)
517#define MIPS_CONF1_IS (_ULCAST_(7) << 22)
518#define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25)
519
520#define MIPS_CONF2_SA (_ULCAST_(15)<< 0)
521#define MIPS_CONF2_SL (_ULCAST_(15)<< 4)
522#define MIPS_CONF2_SS (_ULCAST_(15)<< 8)
523#define MIPS_CONF2_SU (_ULCAST_(15)<< 12)
524#define MIPS_CONF2_TA (_ULCAST_(15)<< 16)
525#define MIPS_CONF2_TL (_ULCAST_(15)<< 20)
526#define MIPS_CONF2_TS (_ULCAST_(15)<< 24)
527#define MIPS_CONF2_TU (_ULCAST_(7) << 28)
528
529#define MIPS_CONF3_TL (_ULCAST_(1) << 0)
530#define MIPS_CONF3_SM (_ULCAST_(1) << 1)
531#define MIPS_CONF3_MT (_ULCAST_(1) << 2)
532#define MIPS_CONF3_SP (_ULCAST_(1) << 4)
533#define MIPS_CONF3_VINT (_ULCAST_(1) << 5)
534#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6)
535#define MIPS_CONF3_LPA (_ULCAST_(1) << 7)
536#define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
537#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)
538
539#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
540
541#define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
542
543
544/*
545 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
546 */
547#define MIPS_FPIR_S (_ULCAST_(1) << 16)
548#define MIPS_FPIR_D (_ULCAST_(1) << 17)
549#define MIPS_FPIR_PS (_ULCAST_(1) << 18)
550#define MIPS_FPIR_3D (_ULCAST_(1) << 19)
551#define MIPS_FPIR_W (_ULCAST_(1) << 20)
552#define MIPS_FPIR_L (_ULCAST_(1) << 21)
553#define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
554
555#ifndef __ASSEMBLY__
556
557/*
558 * Functions to access the R10000 performance counters. These are basically
559 * mfc0 and mtc0 instructions from and to coprocessor register with a 5-bit
560 * performance counter number encoded into bits 1 ... 5 of the instruction.
561 * Only performance counters 0 to 1 actually exist, so for a non-R10000 aware
562 * disassembler these will look like an access to sel 0 or 1.
563 */
564#define read_r10k_perf_cntr(counter) \
565({ \
566 unsigned int __res; \
567 __asm__ __volatile__( \
568 "mfpc\t%0, %1" \
569 : "=r" (__res) \
570 : "i" (counter)); \
571 \
572 __res; \
573})
574
575#define write_r10k_perf_cntr(counter,val) \
576do { \
577 __asm__ __volatile__( \
578 "mtpc\t%0, %1" \
579 : \
580 : "r" (val), "i" (counter)); \
581} while (0)
582
583#define read_r10k_perf_event(counter) \
584({ \
585 unsigned int __res; \
586 __asm__ __volatile__( \
587 "mfps\t%0, %1" \
588 : "=r" (__res) \
589 : "i" (counter)); \
590 \
591 __res; \
592})
593
594#define write_r10k_perf_cntl(counter,val) \
595do { \
596 __asm__ __volatile__( \
597 "mtps\t%0, %1" \
598 : \
599 : "r" (val), "i" (counter)); \
600} while (0)
601
602
603/*
604 * Macros to access the system control coprocessor
605 */
606
607#define __read_32bit_c0_register(source, sel) \
608({ int __res; \
609 if (sel == 0) \
610 __asm__ __volatile__( \
611 "mfc0\t%0, " #source "\n\t" \
612 : "=r" (__res)); \
613 else \
614 __asm__ __volatile__( \
615 ".set\tmips32\n\t" \
616 "mfc0\t%0, " #source ", " #sel "\n\t" \
617 ".set\tmips0\n\t" \
618 : "=r" (__res)); \
619 __res; \
620})
621
622#define __read_64bit_c0_register(source, sel) \
623({ unsigned long long __res; \
624 if (sizeof(unsigned long) == 4) \
625 __res = __read_64bit_c0_split(source, sel); \
626 else if (sel == 0) \
627 __asm__ __volatile__( \
628 ".set\tmips3\n\t" \
629 "dmfc0\t%0, " #source "\n\t" \
630 ".set\tmips0" \
631 : "=r" (__res)); \
632 else \
633 __asm__ __volatile__( \
634 ".set\tmips64\n\t" \
635 "dmfc0\t%0, " #source ", " #sel "\n\t" \
636 ".set\tmips0" \
637 : "=r" (__res)); \
638 __res; \
639})
640
641#define __write_32bit_c0_register(register, sel, value) \
642do { \
643 if (sel == 0) \
644 __asm__ __volatile__( \
645 "mtc0\t%z0, " #register "\n\t" \
646 : : "Jr" ((unsigned int)(value))); \
647 else \
648 __asm__ __volatile__( \
649 ".set\tmips32\n\t" \
650 "mtc0\t%z0, " #register ", " #sel "\n\t" \
651 ".set\tmips0" \
652 : : "Jr" ((unsigned int)(value))); \
653} while (0)
654
655#define __write_64bit_c0_register(register, sel, value) \
656do { \
657 if (sizeof(unsigned long) == 4) \
658 __write_64bit_c0_split(register, sel, value); \
659 else if (sel == 0) \
660 __asm__ __volatile__( \
661 ".set\tmips3\n\t" \
662 "dmtc0\t%z0, " #register "\n\t" \
663 ".set\tmips0" \
664 : : "Jr" (value)); \
665 else \
666 __asm__ __volatile__( \
667 ".set\tmips64\n\t" \
668 "dmtc0\t%z0, " #register ", " #sel "\n\t" \
669 ".set\tmips0" \
670 : : "Jr" (value)); \
671} while (0)
672
673#define __read_ulong_c0_register(reg, sel) \
674 ((sizeof(unsigned long) == 4) ? \
675 (unsigned long) __read_32bit_c0_register(reg, sel) : \
676 (unsigned long) __read_64bit_c0_register(reg, sel))
677
678#define __write_ulong_c0_register(reg, sel, val) \
679do { \
680 if (sizeof(unsigned long) == 4) \
681 __write_32bit_c0_register(reg, sel, val); \
682 else \
683 __write_64bit_c0_register(reg, sel, val); \
684} while (0)
685
686/*
687 * On RM7000/RM9000 these are uses to access cop0 set 1 registers
688 */
689#define __read_32bit_c0_ctrl_register(source) \
690({ int __res; \
691 __asm__ __volatile__( \
692 "cfc0\t%0, " #source "\n\t" \
693 : "=r" (__res)); \
694 __res; \
695})
696
697#define __write_32bit_c0_ctrl_register(register, value) \
698do { \
699 __asm__ __volatile__( \
700 "ctc0\t%z0, " #register "\n\t" \
701 : : "Jr" ((unsigned int)(value))); \
702} while (0)
703
704/*
705 * These versions are only needed for systems with more than 38 bits of
706 * physical address space running the 32-bit kernel. That's none atm :-)
707 */
708#define __read_64bit_c0_split(source, sel) \
709({ \
710 unsigned long long __val; \
711 unsigned long __flags; \
712 \
713 local_irq_save(__flags); \
714 if (sel == 0) \
715 __asm__ __volatile__( \
716 ".set\tmips64\n\t" \
717 "dmfc0\t%M0, " #source "\n\t" \
718 "dsll\t%L0, %M0, 32\n\t" \
719 "dsrl\t%M0, %M0, 32\n\t" \
720 "dsrl\t%L0, %L0, 32\n\t" \
721 ".set\tmips0" \
722 : "=r" (__val)); \
723 else \
724 __asm__ __volatile__( \
725 ".set\tmips64\n\t" \
726 "dmfc0\t%M0, " #source ", " #sel "\n\t" \
727 "dsll\t%L0, %M0, 32\n\t" \
728 "dsrl\t%M0, %M0, 32\n\t" \
729 "dsrl\t%L0, %L0, 32\n\t" \
730 ".set\tmips0" \
731 : "=r" (__val)); \
732 local_irq_restore(__flags); \
733 \
734 __val; \
735})
736
737#define __write_64bit_c0_split(source, sel, val) \
738do { \
739 unsigned long __flags; \
740 \
741 local_irq_save(__flags); \
742 if (sel == 0) \
743 __asm__ __volatile__( \
744 ".set\tmips64\n\t" \
745 "dsll\t%L0, %L0, 32\n\t" \
746 "dsrl\t%L0, %L0, 32\n\t" \
747 "dsll\t%M0, %M0, 32\n\t" \
748 "or\t%L0, %L0, %M0\n\t" \
749 "dmtc0\t%L0, " #source "\n\t" \
750 ".set\tmips0" \
751 : : "r" (val)); \
752 else \
753 __asm__ __volatile__( \
754 ".set\tmips64\n\t" \
755 "dsll\t%L0, %L0, 32\n\t" \
756 "dsrl\t%L0, %L0, 32\n\t" \
757 "dsll\t%M0, %M0, 32\n\t" \
758 "or\t%L0, %L0, %M0\n\t" \
759 "dmtc0\t%L0, " #source ", " #sel "\n\t" \
760 ".set\tmips0" \
761 : : "r" (val)); \
762 local_irq_restore(__flags); \
763} while (0)
764
765#define read_c0_index() __read_32bit_c0_register($0, 0)
766#define write_c0_index(val) __write_32bit_c0_register($0, 0, val)
767
768#define read_c0_random() __read_32bit_c0_register($1, 0)
769#define write_c0_random(val) __write_32bit_c0_register($1, 0, val)
770
771#define read_c0_entrylo0() __read_ulong_c0_register($2, 0)
772#define write_c0_entrylo0(val) __write_ulong_c0_register($2, 0, val)
773
774#define read_c0_entrylo1() __read_ulong_c0_register($3, 0)
775#define write_c0_entrylo1(val) __write_ulong_c0_register($3, 0, val)
776
777#define read_c0_conf() __read_32bit_c0_register($3, 0)
778#define write_c0_conf(val) __write_32bit_c0_register($3, 0, val)
779
780#define read_c0_context() __read_ulong_c0_register($4, 0)
781#define write_c0_context(val) __write_ulong_c0_register($4, 0, val)
782
783#define read_c0_userlocal() __read_ulong_c0_register($4, 2)
784#define write_c0_userlocal(val) __write_ulong_c0_register($4, 2, val)
785
786#define read_c0_pagemask() __read_32bit_c0_register($5, 0)
787#define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val)
788
789#define read_c0_wired() __read_32bit_c0_register($6, 0)
790#define write_c0_wired(val) __write_32bit_c0_register($6, 0, val)
791
792#define read_c0_info() __read_32bit_c0_register($7, 0)
793
794#define read_c0_cache() __read_32bit_c0_register($7, 0) /* TX39xx */
795#define write_c0_cache(val) __write_32bit_c0_register($7, 0, val)
796
797#define read_c0_badvaddr() __read_ulong_c0_register($8, 0)
798#define write_c0_badvaddr(val) __write_ulong_c0_register($8, 0, val)
799
800#define read_c0_count() __read_32bit_c0_register($9, 0)
801#define write_c0_count(val) __write_32bit_c0_register($9, 0, val)
802
803#define read_c0_count2() __read_32bit_c0_register($9, 6) /* pnx8550 */
804#define write_c0_count2(val) __write_32bit_c0_register($9, 6, val)
805
806#define read_c0_count3() __read_32bit_c0_register($9, 7) /* pnx8550 */
807#define write_c0_count3(val) __write_32bit_c0_register($9, 7, val)
808
809#define read_c0_entryhi() __read_ulong_c0_register($10, 0)
810#define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val)
811
812#define read_c0_compare() __read_32bit_c0_register($11, 0)
813#define write_c0_compare(val) __write_32bit_c0_register($11, 0, val)
814
815#define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */
816#define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val)
817
818#define read_c0_compare3() __read_32bit_c0_register($11, 7) /* pnx8550 */
819#define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val)
820
821#define read_c0_status() __read_32bit_c0_register($12, 0)
822#ifdef CONFIG_MIPS_MT_SMTC
823#define write_c0_status(val) \
824do { \
825 __write_32bit_c0_register($12, 0, val); \
826 __ehb(); \
827} while (0)
828#else
829/*
830 * Legacy non-SMTC code, which may be hazardous
831 * but which might not support EHB
832 */
833#define write_c0_status(val) __write_32bit_c0_register($12, 0, val)
834#endif /* CONFIG_MIPS_MT_SMTC */
835
836#define read_c0_cause() __read_32bit_c0_register($13, 0)
837#define write_c0_cause(val) __write_32bit_c0_register($13, 0, val)
838
839#define read_c0_epc() __read_ulong_c0_register($14, 0)
840#define write_c0_epc(val) __write_ulong_c0_register($14, 0, val)
841
842#define read_c0_prid() __read_32bit_c0_register($15, 0)
843
844#define read_c0_config() __read_32bit_c0_register($16, 0)
845#define read_c0_config1() __read_32bit_c0_register($16, 1)
846#define read_c0_config2() __read_32bit_c0_register($16, 2)
847#define read_c0_config3() __read_32bit_c0_register($16, 3)
848#define read_c0_config4() __read_32bit_c0_register($16, 4)
849#define read_c0_config5() __read_32bit_c0_register($16, 5)
850#define read_c0_config6() __read_32bit_c0_register($16, 6)
851#define read_c0_config7() __read_32bit_c0_register($16, 7)
852#define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
853#define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
854#define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
855#define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
856#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
857#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
858#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
859#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
860
861/*
862 * The WatchLo register. There may be upto 8 of them.
863 */
864#define read_c0_watchlo0() __read_ulong_c0_register($18, 0)
865#define read_c0_watchlo1() __read_ulong_c0_register($18, 1)
866#define read_c0_watchlo2() __read_ulong_c0_register($18, 2)
867#define read_c0_watchlo3() __read_ulong_c0_register($18, 3)
868#define read_c0_watchlo4() __read_ulong_c0_register($18, 4)
869#define read_c0_watchlo5() __read_ulong_c0_register($18, 5)
870#define read_c0_watchlo6() __read_ulong_c0_register($18, 6)
871#define read_c0_watchlo7() __read_ulong_c0_register($18, 7)
872#define write_c0_watchlo0(val) __write_ulong_c0_register($18, 0, val)
873#define write_c0_watchlo1(val) __write_ulong_c0_register($18, 1, val)
874#define write_c0_watchlo2(val) __write_ulong_c0_register($18, 2, val)
875#define write_c0_watchlo3(val) __write_ulong_c0_register($18, 3, val)
876#define write_c0_watchlo4(val) __write_ulong_c0_register($18, 4, val)
877#define write_c0_watchlo5(val) __write_ulong_c0_register($18, 5, val)
878#define write_c0_watchlo6(val) __write_ulong_c0_register($18, 6, val)
879#define write_c0_watchlo7(val) __write_ulong_c0_register($18, 7, val)
880
881/*
882 * The WatchHi register. There may be upto 8 of them.
883 */
884#define read_c0_watchhi0() __read_32bit_c0_register($19, 0)
885#define read_c0_watchhi1() __read_32bit_c0_register($19, 1)
886#define read_c0_watchhi2() __read_32bit_c0_register($19, 2)
887#define read_c0_watchhi3() __read_32bit_c0_register($19, 3)
888#define read_c0_watchhi4() __read_32bit_c0_register($19, 4)
889#define read_c0_watchhi5() __read_32bit_c0_register($19, 5)
890#define read_c0_watchhi6() __read_32bit_c0_register($19, 6)
891#define read_c0_watchhi7() __read_32bit_c0_register($19, 7)
892
893#define write_c0_watchhi0(val) __write_32bit_c0_register($19, 0, val)
894#define write_c0_watchhi1(val) __write_32bit_c0_register($19, 1, val)
895#define write_c0_watchhi2(val) __write_32bit_c0_register($19, 2, val)
896#define write_c0_watchhi3(val) __write_32bit_c0_register($19, 3, val)
897#define write_c0_watchhi4(val) __write_32bit_c0_register($19, 4, val)
898#define write_c0_watchhi5(val) __write_32bit_c0_register($19, 5, val)
899#define write_c0_watchhi6(val) __write_32bit_c0_register($19, 6, val)
900#define write_c0_watchhi7(val) __write_32bit_c0_register($19, 7, val)
901
902#define read_c0_xcontext() __read_ulong_c0_register($20, 0)
903#define write_c0_xcontext(val) __write_ulong_c0_register($20, 0, val)
904
905#define read_c0_intcontrol() __read_32bit_c0_ctrl_register($20)
906#define write_c0_intcontrol(val) __write_32bit_c0_ctrl_register($20, val)
907
908#define read_c0_framemask() __read_32bit_c0_register($21, 0)
909#define write_c0_framemask(val) __write_32bit_c0_register($21, 0, val)
910
911/* RM9000 PerfControl performance counter control register */
912#define read_c0_perfcontrol() __read_32bit_c0_register($22, 0)
913#define write_c0_perfcontrol(val) __write_32bit_c0_register($22, 0, val)
914
915#define read_c0_diag() __read_32bit_c0_register($22, 0)
916#define write_c0_diag(val) __write_32bit_c0_register($22, 0, val)
917
918#define read_c0_diag1() __read_32bit_c0_register($22, 1)
919#define write_c0_diag1(val) __write_32bit_c0_register($22, 1, val)
920
921#define read_c0_diag2() __read_32bit_c0_register($22, 2)
922#define write_c0_diag2(val) __write_32bit_c0_register($22, 2, val)
923
924#define read_c0_diag3() __read_32bit_c0_register($22, 3)
925#define write_c0_diag3(val) __write_32bit_c0_register($22, 3, val)
926
927#define read_c0_diag4() __read_32bit_c0_register($22, 4)
928#define write_c0_diag4(val) __write_32bit_c0_register($22, 4, val)
929
930#define read_c0_diag5() __read_32bit_c0_register($22, 5)
931#define write_c0_diag5(val) __write_32bit_c0_register($22, 5, val)
932
933#define read_c0_debug() __read_32bit_c0_register($23, 0)
934#define write_c0_debug(val) __write_32bit_c0_register($23, 0, val)
935
936#define read_c0_depc() __read_ulong_c0_register($24, 0)
937#define write_c0_depc(val) __write_ulong_c0_register($24, 0, val)
938
939/*
940 * MIPS32 / MIPS64 performance counters
941 */
942#define read_c0_perfctrl0() __read_32bit_c0_register($25, 0)
943#define write_c0_perfctrl0(val) __write_32bit_c0_register($25, 0, val)
944#define read_c0_perfcntr0() __read_32bit_c0_register($25, 1)
945#define write_c0_perfcntr0(val) __write_32bit_c0_register($25, 1, val)
946#define read_c0_perfctrl1() __read_32bit_c0_register($25, 2)
947#define write_c0_perfctrl1(val) __write_32bit_c0_register($25, 2, val)
948#define read_c0_perfcntr1() __read_32bit_c0_register($25, 3)
949#define write_c0_perfcntr1(val) __write_32bit_c0_register($25, 3, val)
950#define read_c0_perfctrl2() __read_32bit_c0_register($25, 4)
951#define write_c0_perfctrl2(val) __write_32bit_c0_register($25, 4, val)
952#define read_c0_perfcntr2() __read_32bit_c0_register($25, 5)
953#define write_c0_perfcntr2(val) __write_32bit_c0_register($25, 5, val)
954#define read_c0_perfctrl3() __read_32bit_c0_register($25, 6)
955#define write_c0_perfctrl3(val) __write_32bit_c0_register($25, 6, val)
956#define read_c0_perfcntr3() __read_32bit_c0_register($25, 7)
957#define write_c0_perfcntr3(val) __write_32bit_c0_register($25, 7, val)
958
959/* RM9000 PerfCount performance counter register */
960#define read_c0_perfcount() __read_64bit_c0_register($25, 0)
961#define write_c0_perfcount(val) __write_64bit_c0_register($25, 0, val)
962
963#define read_c0_ecc() __read_32bit_c0_register($26, 0)
964#define write_c0_ecc(val) __write_32bit_c0_register($26, 0, val)
965
966#define read_c0_derraddr0() __read_ulong_c0_register($26, 1)
967#define write_c0_derraddr0(val) __write_ulong_c0_register($26, 1, val)
968
969#define read_c0_cacheerr() __read_32bit_c0_register($27, 0)
970
971#define read_c0_derraddr1() __read_ulong_c0_register($27, 1)
972#define write_c0_derraddr1(val) __write_ulong_c0_register($27, 1, val)
973
974#define read_c0_taglo() __read_32bit_c0_register($28, 0)
975#define write_c0_taglo(val) __write_32bit_c0_register($28, 0, val)
976
977#define read_c0_dtaglo() __read_32bit_c0_register($28, 2)
978#define write_c0_dtaglo(val) __write_32bit_c0_register($28, 2, val)
979
980#define read_c0_taghi() __read_32bit_c0_register($29, 0)
981#define write_c0_taghi(val) __write_32bit_c0_register($29, 0, val)
982
983#define read_c0_errorepc() __read_ulong_c0_register($30, 0)
984#define write_c0_errorepc(val) __write_ulong_c0_register($30, 0, val)
985
986/* MIPSR2 */
987#define read_c0_hwrena() __read_32bit_c0_register($7, 0)
988#define write_c0_hwrena(val) __write_32bit_c0_register($7, 0, val)
989
990#define read_c0_intctl() __read_32bit_c0_register($12, 1)
991#define write_c0_intctl(val) __write_32bit_c0_register($12, 1, val)
992
993#define read_c0_srsctl() __read_32bit_c0_register($12, 2)
994#define write_c0_srsctl(val) __write_32bit_c0_register($12, 2, val)
995
996#define read_c0_srsmap() __read_32bit_c0_register($12, 3)
997#define write_c0_srsmap(val) __write_32bit_c0_register($12, 3, val)
998
999#define read_c0_ebase() __read_32bit_c0_register($15, 1)
1000#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val)
1001
1002/*
1003 * Macros to access the floating point coprocessor control registers
1004 */
1005#define read_32bit_cp1_register(source) \
1006({ int __res; \
1007 __asm__ __volatile__( \
1008 ".set\tpush\n\t" \
1009 ".set\treorder\n\t" \
1010 "cfc1\t%0,"STR(source)"\n\t" \
1011 ".set\tpop" \
1012 : "=r" (__res)); \
1013 __res;})
1014
1015#define rddsp(mask) \
1016({ \
1017 unsigned int __res; \
1018 \
1019 __asm__ __volatile__( \
1020 " .set push \n" \
1021 " .set noat \n" \
1022 " # rddsp $1, %x1 \n" \
1023 " .word 0x7c000cb8 | (%x1 << 16) \n" \
1024 " move %0, $1 \n" \
1025 " .set pop \n" \
1026 : "=r" (__res) \
1027 : "i" (mask)); \
1028 __res; \
1029})
1030
1031#define wrdsp(val, mask) \
1032do { \
1033 __asm__ __volatile__( \
1034 " .set push \n" \
1035 " .set noat \n" \
1036 " move $1, %0 \n" \
1037 " # wrdsp $1, %x1 \n" \
1038 " .word 0x7c2004f8 | (%x1 << 11) \n" \
1039 " .set pop \n" \
1040 : \
1041 : "r" (val), "i" (mask)); \
1042} while (0)
1043
1044#if 0 /* Need DSP ASE capable assembler ... */
1045#define mflo0() ({ long mflo0; __asm__("mflo %0, $ac0" : "=r" (mflo0)); mflo0;})
1046#define mflo1() ({ long mflo1; __asm__("mflo %0, $ac1" : "=r" (mflo1)); mflo1;})
1047#define mflo2() ({ long mflo2; __asm__("mflo %0, $ac2" : "=r" (mflo2)); mflo2;})
1048#define mflo3() ({ long mflo3; __asm__("mflo %0, $ac3" : "=r" (mflo3)); mflo3;})
1049
1050#define mfhi0() ({ long mfhi0; __asm__("mfhi %0, $ac0" : "=r" (mfhi0)); mfhi0;})
1051#define mfhi1() ({ long mfhi1; __asm__("mfhi %0, $ac1" : "=r" (mfhi1)); mfhi1;})
1052#define mfhi2() ({ long mfhi2; __asm__("mfhi %0, $ac2" : "=r" (mfhi2)); mfhi2;})
1053#define mfhi3() ({ long mfhi3; __asm__("mfhi %0, $ac3" : "=r" (mfhi3)); mfhi3;})
1054
1055#define mtlo0(x) __asm__("mtlo %0, $ac0" ::"r" (x))
1056#define mtlo1(x) __asm__("mtlo %0, $ac1" ::"r" (x))
1057#define mtlo2(x) __asm__("mtlo %0, $ac2" ::"r" (x))
1058#define mtlo3(x) __asm__("mtlo %0, $ac3" ::"r" (x))
1059
1060#define mthi0(x) __asm__("mthi %0, $ac0" ::"r" (x))
1061#define mthi1(x) __asm__("mthi %0, $ac1" ::"r" (x))
1062#define mthi2(x) __asm__("mthi %0, $ac2" ::"r" (x))
1063#define mthi3(x) __asm__("mthi %0, $ac3" ::"r" (x))
1064
1065#else
1066
1067#define mfhi0() \
1068({ \
1069 unsigned long __treg; \
1070 \
1071 __asm__ __volatile__( \
1072 " .set push \n" \
1073 " .set noat \n" \
1074 " # mfhi %0, $ac0 \n" \
1075 " .word 0x00000810 \n" \
1076 " move %0, $1 \n" \
1077 " .set pop \n" \
1078 : "=r" (__treg)); \
1079 __treg; \
1080})
1081
1082#define mfhi1() \
1083({ \
1084 unsigned long __treg; \
1085 \
1086 __asm__ __volatile__( \
1087 " .set push \n" \
1088 " .set noat \n" \
1089 " # mfhi %0, $ac1 \n" \
1090 " .word 0x00200810 \n" \
1091 " move %0, $1 \n" \
1092 " .set pop \n" \
1093 : "=r" (__treg)); \
1094 __treg; \
1095})
1096
1097#define mfhi2() \
1098({ \
1099 unsigned long __treg; \
1100 \
1101 __asm__ __volatile__( \
1102 " .set push \n" \
1103 " .set noat \n" \
1104 " # mfhi %0, $ac2 \n" \
1105 " .word 0x00400810 \n" \
1106 " move %0, $1 \n" \
1107 " .set pop \n" \
1108 : "=r" (__treg)); \
1109 __treg; \
1110})
1111
1112#define mfhi3() \
1113({ \
1114 unsigned long __treg; \
1115 \
1116 __asm__ __volatile__( \
1117 " .set push \n" \
1118 " .set noat \n" \
1119 " # mfhi %0, $ac3 \n" \
1120 " .word 0x00600810 \n" \
1121 " move %0, $1 \n" \
1122 " .set pop \n" \
1123 : "=r" (__treg)); \
1124 __treg; \
1125})
1126
1127#define mflo0() \
1128({ \
1129 unsigned long __treg; \
1130 \
1131 __asm__ __volatile__( \
1132 " .set push \n" \
1133 " .set noat \n" \
1134 " # mflo %0, $ac0 \n" \
1135 " .word 0x00000812 \n" \
1136 " move %0, $1 \n" \
1137 " .set pop \n" \
1138 : "=r" (__treg)); \
1139 __treg; \
1140})
1141
1142#define mflo1() \
1143({ \
1144 unsigned long __treg; \
1145 \
1146 __asm__ __volatile__( \
1147 " .set push \n" \
1148 " .set noat \n" \
1149 " # mflo %0, $ac1 \n" \
1150 " .word 0x00200812 \n" \
1151 " move %0, $1 \n" \
1152 " .set pop \n" \
1153 : "=r" (__treg)); \
1154 __treg; \
1155})
1156
1157#define mflo2() \
1158({ \
1159 unsigned long __treg; \
1160 \
1161 __asm__ __volatile__( \
1162 " .set push \n" \
1163 " .set noat \n" \
1164 " # mflo %0, $ac2 \n" \
1165 " .word 0x00400812 \n" \
1166 " move %0, $1 \n" \
1167 " .set pop \n" \
1168 : "=r" (__treg)); \
1169 __treg; \
1170})
1171
1172#define mflo3() \
1173({ \
1174 unsigned long __treg; \
1175 \
1176 __asm__ __volatile__( \
1177 " .set push \n" \
1178 " .set noat \n" \
1179 " # mflo %0, $ac3 \n" \
1180 " .word 0x00600812 \n" \
1181 " move %0, $1 \n" \
1182 " .set pop \n" \
1183 : "=r" (__treg)); \
1184 __treg; \
1185})
1186
1187#define mthi0(x) \
1188do { \
1189 __asm__ __volatile__( \
1190 " .set push \n" \
1191 " .set noat \n" \
1192 " move $1, %0 \n" \
1193 " # mthi $1, $ac0 \n" \
1194 " .word 0x00200011 \n" \
1195 " .set pop \n" \
1196 : \
1197 : "r" (x)); \
1198} while (0)
1199
1200#define mthi1(x) \
1201do { \
1202 __asm__ __volatile__( \
1203 " .set push \n" \
1204 " .set noat \n" \
1205 " move $1, %0 \n" \
1206 " # mthi $1, $ac1 \n" \
1207 " .word 0x00200811 \n" \
1208 " .set pop \n" \
1209 : \
1210 : "r" (x)); \
1211} while (0)
1212
1213#define mthi2(x) \
1214do { \
1215 __asm__ __volatile__( \
1216 " .set push \n" \
1217 " .set noat \n" \
1218 " move $1, %0 \n" \
1219 " # mthi $1, $ac2 \n" \
1220 " .word 0x00201011 \n" \
1221 " .set pop \n" \
1222 : \
1223 : "r" (x)); \
1224} while (0)
1225
1226#define mthi3(x) \
1227do { \
1228 __asm__ __volatile__( \
1229 " .set push \n" \
1230 " .set noat \n" \
1231 " move $1, %0 \n" \
1232 " # mthi $1, $ac3 \n" \
1233 " .word 0x00201811 \n" \
1234 " .set pop \n" \
1235 : \
1236 : "r" (x)); \
1237} while (0)
1238
1239#define mtlo0(x) \
1240do { \
1241 __asm__ __volatile__( \
1242 " .set push \n" \
1243 " .set noat \n" \
1244 " move $1, %0 \n" \
1245 " # mtlo $1, $ac0 \n" \
1246 " .word 0x00200013 \n" \
1247 " .set pop \n" \
1248 : \
1249 : "r" (x)); \
1250} while (0)
1251
1252#define mtlo1(x) \
1253do { \
1254 __asm__ __volatile__( \
1255 " .set push \n" \
1256 " .set noat \n" \
1257 " move $1, %0 \n" \
1258 " # mtlo $1, $ac1 \n" \
1259 " .word 0x00200813 \n" \
1260 " .set pop \n" \
1261 : \
1262 : "r" (x)); \
1263} while (0)
1264
1265#define mtlo2(x) \
1266do { \
1267 __asm__ __volatile__( \
1268 " .set push \n" \
1269 " .set noat \n" \
1270 " move $1, %0 \n" \
1271 " # mtlo $1, $ac2 \n" \
1272 " .word 0x00201013 \n" \
1273 " .set pop \n" \
1274 : \
1275 : "r" (x)); \
1276} while (0)
1277
1278#define mtlo3(x) \
1279do { \
1280 __asm__ __volatile__( \
1281 " .set push \n" \
1282 " .set noat \n" \
1283 " move $1, %0 \n" \
1284 " # mtlo $1, $ac3 \n" \
1285 " .word 0x00201813 \n" \
1286 " .set pop \n" \
1287 : \
1288 : "r" (x)); \
1289} while (0)
1290
1291#endif
1292
1293/*
1294 * TLB operations.
1295 *
1296 * It is responsibility of the caller to take care of any TLB hazards.
1297 */
1298static inline void tlb_probe(void)
1299{
1300 __asm__ __volatile__(
1301 ".set noreorder\n\t"
1302 "tlbp\n\t"
1303 ".set reorder");
1304}
1305
1306static inline void tlb_read(void)
1307{
1308#if MIPS34K_MISSED_ITLB_WAR
1309 int res = 0;
1310
1311 __asm__ __volatile__(
1312 " .set push \n"
1313 " .set noreorder \n"
1314 " .set noat \n"
1315 " .set mips32r2 \n"
1316 " .word 0x41610001 # dvpe $1 \n"
1317 " move %0, $1 \n"
1318 " ehb \n"
1319 " .set pop \n"
1320 : "=r" (res));
1321
1322 instruction_hazard();
1323#endif
1324
1325 __asm__ __volatile__(
1326 ".set noreorder\n\t"
1327 "tlbr\n\t"
1328 ".set reorder");
1329
1330#if MIPS34K_MISSED_ITLB_WAR
1331 if ((res & _ULCAST_(1)))
1332 __asm__ __volatile__(
1333 " .set push \n"
1334 " .set noreorder \n"
1335 " .set noat \n"
1336 " .set mips32r2 \n"
1337 " .word 0x41600021 # evpe \n"
1338 " ehb \n"
1339 " .set pop \n");
1340#endif
1341}
1342
1343static inline void tlb_write_indexed(void)
1344{
1345 __asm__ __volatile__(
1346 ".set noreorder\n\t"
1347 "tlbwi\n\t"
1348 ".set reorder");
1349}
1350
1351static inline void tlb_write_random(void)
1352{
1353 __asm__ __volatile__(
1354 ".set noreorder\n\t"
1355 "tlbwr\n\t"
1356 ".set reorder");
1357}
1358
1359/*
1360 * Manipulate bits in a c0 register.
1361 */
1362#ifndef CONFIG_MIPS_MT_SMTC
1363/*
1364 * SMTC Linux requires shutting-down microthread scheduling
1365 * during CP0 register read-modify-write sequences.
1366 */
1367#define __BUILD_SET_C0(name) \
1368static inline unsigned int \
1369set_c0_##name(unsigned int set) \
1370{ \
1371 unsigned int res; \
1372 \
1373 res = read_c0_##name(); \
1374 res |= set; \
1375 write_c0_##name(res); \
1376 \
1377 return res; \
1378} \
1379 \
1380static inline unsigned int \
1381clear_c0_##name(unsigned int clear) \
1382{ \
1383 unsigned int res; \
1384 \
1385 res = read_c0_##name(); \
1386 res &= ~clear; \
1387 write_c0_##name(res); \
1388 \
1389 return res; \
1390} \
1391 \
1392static inline unsigned int \
1393change_c0_##name(unsigned int change, unsigned int new) \
1394{ \
1395 unsigned int res; \
1396 \
1397 res = read_c0_##name(); \
1398 res &= ~change; \
1399 res |= (new & change); \
1400 write_c0_##name(res); \
1401 \
1402 return res; \
1403}
1404
1405#else /* SMTC versions that manage MT scheduling */
1406
1407#include <linux/irqflags.h>
1408
1409/*
1410 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with
1411 * header file recursion.
1412 */
1413static inline unsigned int __dmt(void)
1414{
1415 int res;
1416
1417 __asm__ __volatile__(
1418 " .set push \n"
1419 " .set mips32r2 \n"
1420 " .set noat \n"
1421 " .word 0x41610BC1 # dmt $1 \n"
1422 " ehb \n"
1423 " move %0, $1 \n"
1424 " .set pop \n"
1425 : "=r" (res));
1426
1427 instruction_hazard();
1428
1429 return res;
1430}
1431
1432#define __VPECONTROL_TE_SHIFT 15
1433#define __VPECONTROL_TE (1UL << __VPECONTROL_TE_SHIFT)
1434
1435#define __EMT_ENABLE __VPECONTROL_TE
1436
1437static inline void __emt(unsigned int previous)
1438{
1439 if ((previous & __EMT_ENABLE))
1440 __asm__ __volatile__(
1441 " .set mips32r2 \n"
1442 " .word 0x41600be1 # emt \n"
1443 " ehb \n"
1444 " .set mips0 \n");
1445}
1446
1447static inline void __ehb(void)
1448{
1449 __asm__ __volatile__(
1450 " .set mips32r2 \n"
1451 " ehb \n" " .set mips0 \n");
1452}
1453
1454/*
1455 * Note that local_irq_save/restore affect TC-specific IXMT state,
1456 * not Status.IE as in non-SMTC kernel.
1457 */
1458
1459#define __BUILD_SET_C0(name) \
1460static inline unsigned int \
1461set_c0_##name(unsigned int set) \
1462{ \
1463 unsigned int res; \
1464 unsigned int omt; \
1465 unsigned int flags; \
1466 \
1467 local_irq_save(flags); \
1468 omt = __dmt(); \
1469 res = read_c0_##name(); \
1470 res |= set; \
1471 write_c0_##name(res); \
1472 __emt(omt); \
1473 local_irq_restore(flags); \
1474 \
1475 return res; \
1476} \
1477 \
1478static inline unsigned int \
1479clear_c0_##name(unsigned int clear) \
1480{ \
1481 unsigned int res; \
1482 unsigned int omt; \
1483 unsigned int flags; \
1484 \
1485 local_irq_save(flags); \
1486 omt = __dmt(); \
1487 res = read_c0_##name(); \
1488 res &= ~clear; \
1489 write_c0_##name(res); \
1490 __emt(omt); \
1491 local_irq_restore(flags); \
1492 \
1493 return res; \
1494} \
1495 \
1496static inline unsigned int \
1497change_c0_##name(unsigned int change, unsigned int new) \
1498{ \
1499 unsigned int res; \
1500 unsigned int omt; \
1501 unsigned int flags; \
1502 \
1503 local_irq_save(flags); \
1504 \
1505 omt = __dmt(); \
1506 res = read_c0_##name(); \
1507 res &= ~change; \
1508 res |= (new & change); \
1509 write_c0_##name(res); \
1510 __emt(omt); \
1511 local_irq_restore(flags); \
1512 \
1513 return res; \
1514}
1515#endif
1516
1517__BUILD_SET_C0(status)
1518__BUILD_SET_C0(cause)
1519__BUILD_SET_C0(config)
1520__BUILD_SET_C0(intcontrol)
1521__BUILD_SET_C0(intctl)
1522__BUILD_SET_C0(srsmap)
1523
1524#endif /* !__ASSEMBLY__ */
1525
1526#endif /* _ASM_MIPSREGS_H */
diff --git a/include/asm-mips/mman.h b/include/asm-mips/mman.h
deleted file mode 100644
index e4d6f1fb1cf7..000000000000
--- a/include/asm-mips/mman.h
+++ /dev/null
@@ -1,77 +0,0 @@
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 * Copyright (C) 1995, 1999, 2002 by Ralf Baechle
7 */
8#ifndef _ASM_MMAN_H
9#define _ASM_MMAN_H
10
11/*
12 * Protections are chosen from these bits, OR'd together. The
13 * implementation does not necessarily support PROT_EXEC or PROT_WRITE
14 * without PROT_READ. The only guarantees are that no writing will be
15 * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
16 */
17#define PROT_NONE 0x00 /* page can not be accessed */
18#define PROT_READ 0x01 /* page can be read */
19#define PROT_WRITE 0x02 /* page can be written */
20#define PROT_EXEC 0x04 /* page can be executed */
21/* 0x08 reserved for PROT_EXEC_NOFLUSH */
22#define PROT_SEM 0x10 /* page may be used for atomic ops */
23#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
24#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
25
26/*
27 * Flags for mmap
28 */
29#define MAP_SHARED 0x001 /* Share changes */
30#define MAP_PRIVATE 0x002 /* Changes are private */
31#define MAP_TYPE 0x00f /* Mask for type of mapping */
32#define MAP_FIXED 0x010 /* Interpret addr exactly */
33
34/* not used by linux, but here to make sure we don't clash with ABI defines */
35#define MAP_RENAME 0x020 /* Assign page to file */
36#define MAP_AUTOGROW 0x040 /* File may grow by writing */
37#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
38#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
39
40/* These are linux-specific */
41#define MAP_NORESERVE 0x0400 /* don't check for reservations */
42#define MAP_ANONYMOUS 0x0800 /* don't use a file */
43#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
44#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
45#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
46#define MAP_LOCKED 0x8000 /* pages are locked */
47#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
48#define MAP_NONBLOCK 0x20000 /* do not block on IO */
49
50/*
51 * Flags for msync
52 */
53#define MS_ASYNC 0x0001 /* sync memory asynchronously */
54#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
55#define MS_SYNC 0x0004 /* synchronous memory sync */
56
57/*
58 * Flags for mlockall
59 */
60#define MCL_CURRENT 1 /* lock all current mappings */
61#define MCL_FUTURE 2 /* lock all future mappings */
62
63#define MADV_NORMAL 0 /* no further special treatment */
64#define MADV_RANDOM 1 /* expect random page references */
65#define MADV_SEQUENTIAL 2 /* expect sequential page references */
66#define MADV_WILLNEED 3 /* will need these pages */
67#define MADV_DONTNEED 4 /* don't need these pages */
68
69/* common parameters: try to keep these consistent across architectures */
70#define MADV_REMOVE 9 /* remove these pages & resources */
71#define MADV_DONTFORK 10 /* don't inherit across fork */
72#define MADV_DOFORK 11 /* do inherit across fork */
73
74/* compatibility flags */
75#define MAP_FILE 0
76
77#endif /* _ASM_MMAN_H */
diff --git a/include/asm-mips/mmu.h b/include/asm-mips/mmu.h
deleted file mode 100644
index 4063edd79623..000000000000
--- a/include/asm-mips/mmu.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_MMU_H
2#define __ASM_MMU_H
3
4typedef unsigned long mm_context_t[NR_CPUS];
5
6#endif /* __ASM_MMU_H */
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
deleted file mode 100644
index 0c4f245eaeb2..000000000000
--- a/include/asm-mips/mmu_context.h
+++ /dev/null
@@ -1,297 +0,0 @@
1/*
2 * Switch a MMU context.
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 (C) 1996, 1997, 1998, 1999 by Ralf Baechle
9 * Copyright (C) 1999 Silicon Graphics, Inc.
10 */
11#ifndef _ASM_MMU_CONTEXT_H
12#define _ASM_MMU_CONTEXT_H
13
14#include <linux/errno.h>
15#include <linux/sched.h>
16#include <linux/slab.h>
17#include <asm/cacheflush.h>
18#include <asm/tlbflush.h>
19#ifdef CONFIG_MIPS_MT_SMTC
20#include <asm/mipsmtregs.h>
21#include <asm/smtc.h>
22#endif /* SMTC */
23#include <asm-generic/mm_hooks.h>
24
25/*
26 * For the fast tlb miss handlers, we keep a per cpu array of pointers
27 * to the current pgd for each processor. Also, the proc. id is stuffed
28 * into the context register.
29 */
30extern unsigned long pgd_current[];
31
32#define TLBMISS_HANDLER_SETUP_PGD(pgd) \
33 pgd_current[smp_processor_id()] = (unsigned long)(pgd)
34
35#ifdef CONFIG_32BIT
36#define TLBMISS_HANDLER_SETUP() \
37 write_c0_context((unsigned long) smp_processor_id() << 25); \
38 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
39#endif
40#ifdef CONFIG_64BIT
41#define TLBMISS_HANDLER_SETUP() \
42 write_c0_context((unsigned long) smp_processor_id() << 26); \
43 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
44#endif
45
46#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
47
48#define ASID_INC 0x40
49#define ASID_MASK 0xfc0
50
51#elif defined(CONFIG_CPU_R8000)
52
53#define ASID_INC 0x10
54#define ASID_MASK 0xff0
55
56#elif defined(CONFIG_CPU_RM9000)
57
58#define ASID_INC 0x1
59#define ASID_MASK 0xfff
60
61/* SMTC/34K debug hack - but maybe we'll keep it */
62#elif defined(CONFIG_MIPS_MT_SMTC)
63
64#define ASID_INC 0x1
65extern unsigned long smtc_asid_mask;
66#define ASID_MASK (smtc_asid_mask)
67#define HW_ASID_MASK 0xff
68/* End SMTC/34K debug hack */
69#else /* FIXME: not correct for R6000 */
70
71#define ASID_INC 0x1
72#define ASID_MASK 0xff
73
74#endif
75
76#define cpu_context(cpu, mm) ((mm)->context[cpu])
77#define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & ASID_MASK)
78#define asid_cache(cpu) (cpu_data[cpu].asid_cache)
79
80static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
81{
82}
83
84/*
85 * All unused by hardware upper bits will be considered
86 * as a software asid extension.
87 */
88#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1)))
89#define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1)
90
91#ifndef CONFIG_MIPS_MT_SMTC
92/* Normal, classic MIPS get_new_mmu_context */
93static inline void
94get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
95{
96 unsigned long asid = asid_cache(cpu);
97
98 if (! ((asid += ASID_INC) & ASID_MASK) ) {
99 if (cpu_has_vtag_icache)
100 flush_icache_all();
101 local_flush_tlb_all(); /* start new asid cycle */
102 if (!asid) /* fix version if needed */
103 asid = ASID_FIRST_VERSION;
104 }
105 cpu_context(cpu, mm) = asid_cache(cpu) = asid;
106}
107
108#else /* CONFIG_MIPS_MT_SMTC */
109
110#define get_new_mmu_context(mm, cpu) smtc_get_new_mmu_context((mm), (cpu))
111
112#endif /* CONFIG_MIPS_MT_SMTC */
113
114/*
115 * Initialize the context related info for a new mm_struct
116 * instance.
117 */
118static inline int
119init_new_context(struct task_struct *tsk, struct mm_struct *mm)
120{
121 int i;
122
123 for_each_online_cpu(i)
124 cpu_context(i, mm) = 0;
125
126 return 0;
127}
128
129static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
130 struct task_struct *tsk)
131{
132 unsigned int cpu = smp_processor_id();
133 unsigned long flags;
134#ifdef CONFIG_MIPS_MT_SMTC
135 unsigned long oldasid;
136 unsigned long mtflags;
137 int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id;
138 local_irq_save(flags);
139 mtflags = dvpe();
140#else /* Not SMTC */
141 local_irq_save(flags);
142#endif /* CONFIG_MIPS_MT_SMTC */
143
144 /* Check if our ASID is of an older version and thus invalid */
145 if ((cpu_context(cpu, next) ^ asid_cache(cpu)) & ASID_VERSION_MASK)
146 get_new_mmu_context(next, cpu);
147#ifdef CONFIG_MIPS_MT_SMTC
148 /*
149 * If the EntryHi ASID being replaced happens to be
150 * the value flagged at ASID recycling time as having
151 * an extended life, clear the bit showing it being
152 * in use by this "CPU", and if that's the last bit,
153 * free up the ASID value for use and flush any old
154 * instances of it from the TLB.
155 */
156 oldasid = (read_c0_entryhi() & ASID_MASK);
157 if(smtc_live_asid[mytlb][oldasid]) {
158 smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu);
159 if(smtc_live_asid[mytlb][oldasid] == 0)
160 smtc_flush_tlb_asid(oldasid);
161 }
162 /*
163 * Tread softly on EntryHi, and so long as we support
164 * having ASID_MASK smaller than the hardware maximum,
165 * make sure no "soft" bits become "hard"...
166 */
167 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK)
168 | (cpu_context(cpu, next) & ASID_MASK));
169 ehb(); /* Make sure it propagates to TCStatus */
170 evpe(mtflags);
171#else
172 write_c0_entryhi(cpu_context(cpu, next));
173#endif /* CONFIG_MIPS_MT_SMTC */
174 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
175
176 /*
177 * Mark current->active_mm as not "active" anymore.
178 * We don't want to mislead possible IPI tlb flush routines.
179 */
180 cpu_clear(cpu, prev->cpu_vm_mask);
181 cpu_set(cpu, next->cpu_vm_mask);
182
183 local_irq_restore(flags);
184}
185
186/*
187 * Destroy context related info for an mm_struct that is about
188 * to be put to rest.
189 */
190static inline void destroy_context(struct mm_struct *mm)
191{
192}
193
194#define deactivate_mm(tsk, mm) do { } while (0)
195
196/*
197 * After we have set current->mm to a new value, this activates
198 * the context for the new mm so we see the new mappings.
199 */
200static inline void
201activate_mm(struct mm_struct *prev, struct mm_struct *next)
202{
203 unsigned long flags;
204 unsigned int cpu = smp_processor_id();
205
206#ifdef CONFIG_MIPS_MT_SMTC
207 unsigned long oldasid;
208 unsigned long mtflags;
209 int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id;
210#endif /* CONFIG_MIPS_MT_SMTC */
211
212 local_irq_save(flags);
213
214 /* Unconditionally get a new ASID. */
215 get_new_mmu_context(next, cpu);
216
217#ifdef CONFIG_MIPS_MT_SMTC
218 /* See comments for similar code above */
219 mtflags = dvpe();
220 oldasid = read_c0_entryhi() & ASID_MASK;
221 if(smtc_live_asid[mytlb][oldasid]) {
222 smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu);
223 if(smtc_live_asid[mytlb][oldasid] == 0)
224 smtc_flush_tlb_asid(oldasid);
225 }
226 /* See comments for similar code above */
227 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) |
228 (cpu_context(cpu, next) & ASID_MASK));
229 ehb(); /* Make sure it propagates to TCStatus */
230 evpe(mtflags);
231#else
232 write_c0_entryhi(cpu_context(cpu, next));
233#endif /* CONFIG_MIPS_MT_SMTC */
234 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
235
236 /* mark mmu ownership change */
237 cpu_clear(cpu, prev->cpu_vm_mask);
238 cpu_set(cpu, next->cpu_vm_mask);
239
240 local_irq_restore(flags);
241}
242
243/*
244 * If mm is currently active_mm, we can't really drop it. Instead,
245 * we will get a new one for it.
246 */
247static inline void
248drop_mmu_context(struct mm_struct *mm, unsigned cpu)
249{
250 unsigned long flags;
251#ifdef CONFIG_MIPS_MT_SMTC
252 unsigned long oldasid;
253 /* Can't use spinlock because called from TLB flush within DVPE */
254 unsigned int prevvpe;
255 int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id;
256#endif /* CONFIG_MIPS_MT_SMTC */
257
258 local_irq_save(flags);
259
260 if (cpu_isset(cpu, mm->cpu_vm_mask)) {
261 get_new_mmu_context(mm, cpu);
262#ifdef CONFIG_MIPS_MT_SMTC
263 /* See comments for similar code above */
264 prevvpe = dvpe();
265 oldasid = (read_c0_entryhi() & ASID_MASK);
266 if (smtc_live_asid[mytlb][oldasid]) {
267 smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu);
268 if(smtc_live_asid[mytlb][oldasid] == 0)
269 smtc_flush_tlb_asid(oldasid);
270 }
271 /* See comments for similar code above */
272 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK)
273 | cpu_asid(cpu, mm));
274 ehb(); /* Make sure it propagates to TCStatus */
275 evpe(prevvpe);
276#else /* not CONFIG_MIPS_MT_SMTC */
277 write_c0_entryhi(cpu_asid(cpu, mm));
278#endif /* CONFIG_MIPS_MT_SMTC */
279 } else {
280 /* will get a new context next time */
281#ifndef CONFIG_MIPS_MT_SMTC
282 cpu_context(cpu, mm) = 0;
283#else /* SMTC */
284 int i;
285
286 /* SMTC shares the TLB (and ASIDs) across VPEs */
287 for_each_online_cpu(i) {
288 if((smtc_status & SMTC_TLB_SHARED)
289 || (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id))
290 cpu_context(i, mm) = 0;
291 }
292#endif /* CONFIG_MIPS_MT_SMTC */
293 }
294 local_irq_restore(flags);
295}
296
297#endif /* _ASM_MMU_CONTEXT_H */
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h
deleted file mode 100644
index f53ec54c92ff..000000000000
--- a/include/asm-mips/mmzone.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * Written by Kanoj Sarcar (kanoj@sgi.com) Aug 99
3 * Rewritten for Linux 2.6 by Christoph Hellwig (hch@lst.de) Jan 2004
4 */
5#ifndef _ASM_MMZONE_H_
6#define _ASM_MMZONE_H_
7
8#include <asm/page.h>
9#include <mmzone.h>
10
11#ifdef CONFIG_DISCONTIGMEM
12
13#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
14
15#endif /* CONFIG_DISCONTIGMEM */
16
17#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h
deleted file mode 100644
index de6d09ebbd80..000000000000
--- a/include/asm-mips/module.h
+++ /dev/null
@@ -1,136 +0,0 @@
1#ifndef _ASM_MODULE_H
2#define _ASM_MODULE_H
3
4#include <linux/list.h>
5#include <asm/uaccess.h>
6
7struct mod_arch_specific {
8 /* Data Bus Error exception tables */
9 struct list_head dbe_list;
10 const struct exception_table_entry *dbe_start;
11 const struct exception_table_entry *dbe_end;
12};
13
14typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */
15
16typedef struct {
17 Elf64_Addr r_offset; /* Address of relocation. */
18 Elf64_Word r_sym; /* Symbol index. */
19 Elf64_Byte r_ssym; /* Special symbol. */
20 Elf64_Byte r_type3; /* Third relocation. */
21 Elf64_Byte r_type2; /* Second relocation. */
22 Elf64_Byte r_type; /* First relocation. */
23} Elf64_Mips_Rel;
24
25typedef struct {
26 Elf64_Addr r_offset; /* Address of relocation. */
27 Elf64_Word r_sym; /* Symbol index. */
28 Elf64_Byte r_ssym; /* Special symbol. */
29 Elf64_Byte r_type3; /* Third relocation. */
30 Elf64_Byte r_type2; /* Second relocation. */
31 Elf64_Byte r_type; /* First relocation. */
32 Elf64_Sxword r_addend; /* Addend. */
33} Elf64_Mips_Rela;
34
35#ifdef CONFIG_32BIT
36
37#define Elf_Shdr Elf32_Shdr
38#define Elf_Sym Elf32_Sym
39#define Elf_Ehdr Elf32_Ehdr
40#define Elf_Addr Elf32_Addr
41
42#define Elf_Mips_Rel Elf32_Rel
43#define Elf_Mips_Rela Elf32_Rela
44
45#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info)
46#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info)
47
48#endif
49
50#ifdef CONFIG_64BIT
51
52#define Elf_Shdr Elf64_Shdr
53#define Elf_Sym Elf64_Sym
54#define Elf_Ehdr Elf64_Ehdr
55#define Elf_Addr Elf64_Addr
56
57#define Elf_Mips_Rel Elf64_Mips_Rel
58#define Elf_Mips_Rela Elf64_Mips_Rela
59
60#define ELF_MIPS_R_SYM(rel) (rel.r_sym)
61#define ELF_MIPS_R_TYPE(rel) (rel.r_type)
62
63#endif
64
65#ifdef CONFIG_MODULES
66/* Given an address, look for it in the exception tables. */
67const struct exception_table_entry*search_module_dbetables(unsigned long addr);
68#else
69/* Given an address, look for it in the exception tables. */
70static inline const struct exception_table_entry *
71search_module_dbetables(unsigned long addr)
72{
73 return NULL;
74}
75#endif
76
77#ifdef CONFIG_CPU_MIPS32_R1
78#define MODULE_PROC_FAMILY "MIPS32_R1 "
79#elif defined CONFIG_CPU_MIPS32_R2
80#define MODULE_PROC_FAMILY "MIPS32_R2 "
81#elif defined CONFIG_CPU_MIPS64_R1
82#define MODULE_PROC_FAMILY "MIPS64_R1 "
83#elif defined CONFIG_CPU_MIPS64_R2
84#define MODULE_PROC_FAMILY "MIPS64_R2 "
85#elif defined CONFIG_CPU_R3000
86#define MODULE_PROC_FAMILY "R3000 "
87#elif defined CONFIG_CPU_TX39XX
88#define MODULE_PROC_FAMILY "TX39XX "
89#elif defined CONFIG_CPU_VR41XX
90#define MODULE_PROC_FAMILY "VR41XX "
91#elif defined CONFIG_CPU_R4300
92#define MODULE_PROC_FAMILY "R4300 "
93#elif defined CONFIG_CPU_R4X00
94#define MODULE_PROC_FAMILY "R4X00 "
95#elif defined CONFIG_CPU_TX49XX
96#define MODULE_PROC_FAMILY "TX49XX "
97#elif defined CONFIG_CPU_R5000
98#define MODULE_PROC_FAMILY "R5000 "
99#elif defined CONFIG_CPU_R5432
100#define MODULE_PROC_FAMILY "R5432 "
101#elif defined CONFIG_CPU_R6000
102#define MODULE_PROC_FAMILY "R6000 "
103#elif defined CONFIG_CPU_NEVADA
104#define MODULE_PROC_FAMILY "NEVADA "
105#elif defined CONFIG_CPU_R8000
106#define MODULE_PROC_FAMILY "R8000 "
107#elif defined CONFIG_CPU_R10000
108#define MODULE_PROC_FAMILY "R10000 "
109#elif defined CONFIG_CPU_RM7000
110#define MODULE_PROC_FAMILY "RM7000 "
111#elif defined CONFIG_CPU_RM9000
112#define MODULE_PROC_FAMILY "RM9000 "
113#elif defined CONFIG_CPU_SB1
114#define MODULE_PROC_FAMILY "SB1 "
115#elif defined CONFIG_CPU_LOONGSON2
116#define MODULE_PROC_FAMILY "LOONGSON2 "
117#else
118#error MODULE_PROC_FAMILY undefined for your processor configuration
119#endif
120
121#ifdef CONFIG_32BIT
122#define MODULE_KERNEL_TYPE "32BIT "
123#elif defined CONFIG_64BIT
124#define MODULE_KERNEL_TYPE "64BIT "
125#endif
126
127#ifdef CONFIG_MIPS_MT_SMTC
128#define MODULE_KERNEL_SMTC "MT_SMTC "
129#else
130#define MODULE_KERNEL_SMTC ""
131#endif
132
133#define MODULE_ARCH_VERMAGIC \
134 MODULE_PROC_FAMILY MODULE_KERNEL_TYPE MODULE_KERNEL_SMTC
135
136#endif /* _ASM_MODULE_H */
diff --git a/include/asm-mips/msc01_ic.h b/include/asm-mips/msc01_ic.h
deleted file mode 100644
index 7989b9ffc1d2..000000000000
--- a/include/asm-mips/msc01_ic.h
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * PCI Register definitions for the MIPS System Controller.
3 *
4 * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __ASM_MIPS_BOARDS_MSC01_IC_H
12#define __ASM_MIPS_BOARDS_MSC01_IC_H
13
14/*****************************************************************************
15 * Register offset addresses
16 *****************************************************************************/
17
18#define MSC01_IC_RST_OFS 0x00008 /* Software reset */
19#define MSC01_IC_ENAL_OFS 0x00100 /* Int_in enable mask 31:0 */
20#define MSC01_IC_ENAH_OFS 0x00108 /* Int_in enable mask 63:32 */
21#define MSC01_IC_DISL_OFS 0x00120 /* Int_in disable mask 31:0 */
22#define MSC01_IC_DISH_OFS 0x00128 /* Int_in disable mask 63:32 */
23#define MSC01_IC_ISBL_OFS 0x00140 /* Raw int_in 31:0 */
24#define MSC01_IC_ISBH_OFS 0x00148 /* Raw int_in 63:32 */
25#define MSC01_IC_ISAL_OFS 0x00160 /* Masked int_in 31:0 */
26#define MSC01_IC_ISAH_OFS 0x00168 /* Masked int_in 63:32 */
27#define MSC01_IC_LVL_OFS 0x00180 /* Disable priority int_out */
28#define MSC01_IC_RAMW_OFS 0x00180 /* Shadow set RAM (EI) */
29#define MSC01_IC_OSB_OFS 0x00188 /* Raw int_out */
30#define MSC01_IC_OSA_OFS 0x00190 /* Masked int_out */
31#define MSC01_IC_GENA_OFS 0x00198 /* Global HW int enable */
32#define MSC01_IC_BASE_OFS 0x001a0 /* Base address of IC_VEC */
33#define MSC01_IC_VEC_OFS 0x001b0 /* Active int's vector address */
34#define MSC01_IC_EOI_OFS 0x001c0 /* Enable lower level ints */
35#define MSC01_IC_CFG_OFS 0x001c8 /* Configuration register */
36#define MSC01_IC_TRLD_OFS 0x001d0 /* Interval timer reload val */
37#define MSC01_IC_TVAL_OFS 0x001e0 /* Interval timer current val */
38#define MSC01_IC_TCFG_OFS 0x001f0 /* Interval timer config */
39#define MSC01_IC_SUP_OFS 0x00200 /* Set up int_in line 0 */
40#define MSC01_IC_ENA_OFS 0x00800 /* Int_in enable mask 63:0 */
41#define MSC01_IC_DIS_OFS 0x00820 /* Int_in disable mask 63:0 */
42#define MSC01_IC_ISB_OFS 0x00840 /* Raw int_in 63:0 */
43#define MSC01_IC_ISA_OFS 0x00860 /* Masked int_in 63:0 */
44
45/*****************************************************************************
46 * Register field encodings
47 *****************************************************************************/
48
49#define MSC01_IC_RST_RST_SHF 0
50#define MSC01_IC_RST_RST_MSK 0x00000001
51#define MSC01_IC_RST_RST_BIT MSC01_IC_RST_RST_MSK
52#define MSC01_IC_LVL_LVL_SHF 0
53#define MSC01_IC_LVL_LVL_MSK 0x000000ff
54#define MSC01_IC_LVL_SPUR_SHF 16
55#define MSC01_IC_LVL_SPUR_MSK 0x00010000
56#define MSC01_IC_LVL_SPUR_BIT MSC01_IC_LVL_SPUR_MSK
57#define MSC01_IC_RAMW_RIPL_SHF 0
58#define MSC01_IC_RAMW_RIPL_MSK 0x0000003f
59#define MSC01_IC_RAMW_DATA_SHF 6
60#define MSC01_IC_RAMW_DATA_MSK 0x00000fc0
61#define MSC01_IC_RAMW_ADDR_SHF 25
62#define MSC01_IC_RAMW_ADDR_MSK 0x7e000000
63#define MSC01_IC_RAMW_READ_SHF 31
64#define MSC01_IC_RAMW_READ_MSK 0x80000000
65#define MSC01_IC_RAMW_READ_BIT MSC01_IC_RAMW_READ_MSK
66#define MSC01_IC_OSB_OSB_SHF 0
67#define MSC01_IC_OSB_OSB_MSK 0x000000ff
68#define MSC01_IC_OSA_OSA_SHF 0
69#define MSC01_IC_OSA_OSA_MSK 0x000000ff
70#define MSC01_IC_GENA_GENA_SHF 0
71#define MSC01_IC_GENA_GENA_MSK 0x00000001
72#define MSC01_IC_GENA_GENA_BIT MSC01_IC_GENA_GENA_MSK
73#define MSC01_IC_CFG_DIS_SHF 0
74#define MSC01_IC_CFG_DIS_MSK 0x00000001
75#define MSC01_IC_CFG_DIS_BIT MSC01_IC_CFG_DIS_MSK
76#define MSC01_IC_CFG_SHFT_SHF 8
77#define MSC01_IC_CFG_SHFT_MSK 0x00000f00
78#define MSC01_IC_TCFG_ENA_SHF 0
79#define MSC01_IC_TCFG_ENA_MSK 0x00000001
80#define MSC01_IC_TCFG_ENA_BIT MSC01_IC_TCFG_ENA_MSK
81#define MSC01_IC_TCFG_INT_SHF 8
82#define MSC01_IC_TCFG_INT_MSK 0x00000100
83#define MSC01_IC_TCFG_INT_BIT MSC01_IC_TCFG_INT_MSK
84#define MSC01_IC_TCFG_EDGE_SHF 16
85#define MSC01_IC_TCFG_EDGE_MSK 0x00010000
86#define MSC01_IC_TCFG_EDGE_BIT MSC01_IC_TCFG_EDGE_MSK
87#define MSC01_IC_SUP_PRI_SHF 0
88#define MSC01_IC_SUP_PRI_MSK 0x00000007
89#define MSC01_IC_SUP_EDGE_SHF 8
90#define MSC01_IC_SUP_EDGE_MSK 0x00000100
91#define MSC01_IC_SUP_EDGE_BIT MSC01_IC_SUP_EDGE_MSK
92#define MSC01_IC_SUP_STEP 8
93
94/*
95 * MIPS System controller interrupt register base.
96 *
97 */
98
99/*****************************************************************************
100 * Absolute register addresses
101 *****************************************************************************/
102
103#define MSC01_IC_RST (MSC01_IC_REG_BASE + MSC01_IC_RST_OFS)
104#define MSC01_IC_ENAL (MSC01_IC_REG_BASE + MSC01_IC_ENAL_OFS)
105#define MSC01_IC_ENAH (MSC01_IC_REG_BASE + MSC01_IC_ENAH_OFS)
106#define MSC01_IC_DISL (MSC01_IC_REG_BASE + MSC01_IC_DISL_OFS)
107#define MSC01_IC_DISH (MSC01_IC_REG_BASE + MSC01_IC_DISH_OFS)
108#define MSC01_IC_ISBL (MSC01_IC_REG_BASE + MSC01_IC_ISBL_OFS)
109#define MSC01_IC_ISBH (MSC01_IC_REG_BASE + MSC01_IC_ISBH_OFS)
110#define MSC01_IC_ISAL (MSC01_IC_REG_BASE + MSC01_IC_ISAL_OFS)
111#define MSC01_IC_ISAH (MSC01_IC_REG_BASE + MSC01_IC_ISAH_OFS)
112#define MSC01_IC_LVL (MSC01_IC_REG_BASE + MSC01_IC_LVL_OFS)
113#define MSC01_IC_RAMW (MSC01_IC_REG_BASE + MSC01_IC_RAMW_OFS)
114#define MSC01_IC_OSB (MSC01_IC_REG_BASE + MSC01_IC_OSB_OFS)
115#define MSC01_IC_OSA (MSC01_IC_REG_BASE + MSC01_IC_OSA_OFS)
116#define MSC01_IC_GENA (MSC01_IC_REG_BASE + MSC01_IC_GENA_OFS)
117#define MSC01_IC_BASE (MSC01_IC_REG_BASE + MSC01_IC_BASE_OFS)
118#define MSC01_IC_VEC (MSC01_IC_REG_BASE + MSC01_IC_VEC_OFS)
119#define MSC01_IC_EOI (MSC01_IC_REG_BASE + MSC01_IC_EOI_OFS)
120#define MSC01_IC_CFG (MSC01_IC_REG_BASE + MSC01_IC_CFG_OFS)
121#define MSC01_IC_TRLD (MSC01_IC_REG_BASE + MSC01_IC_TRLD_OFS)
122#define MSC01_IC_TVAL (MSC01_IC_REG_BASE + MSC01_IC_TVAL_OFS)
123#define MSC01_IC_TCFG (MSC01_IC_REG_BASE + MSC01_IC_TCFG_OFS)
124#define MSC01_IC_SUP (MSC01_IC_REG_BASE + MSC01_IC_SUP_OFS)
125#define MSC01_IC_ENA (MSC01_IC_REG_BASE + MSC01_IC_ENA_OFS)
126#define MSC01_IC_DIS (MSC01_IC_REG_BASE + MSC01_IC_DIS_OFS)
127#define MSC01_IC_ISB (MSC01_IC_REG_BASE + MSC01_IC_ISB_OFS)
128#define MSC01_IC_ISA (MSC01_IC_REG_BASE + MSC01_IC_ISA_OFS)
129
130/*
131 * Soc-it interrupts are configurable.
132 * Every board describes its IRQ mapping with this table.
133 */
134typedef struct msc_irqmap {
135 int im_irq;
136 int im_type;
137 int im_lvl;
138} msc_irqmap_t;
139
140/* im_type */
141#define MSC01_IRQ_LEVEL 0
142#define MSC01_IRQ_EDGE 1
143
144extern void __init init_msc_irqs(unsigned long icubase, unsigned int base, msc_irqmap_t *imp, int nirq);
145extern void ll_msc_irq(void);
146
147#endif /* __ASM_MIPS_BOARDS_MSC01_IC_H */
148
diff --git a/include/asm-mips/msgbuf.h b/include/asm-mips/msgbuf.h
deleted file mode 100644
index 0d6c7f14de31..000000000000
--- a/include/asm-mips/msgbuf.h
+++ /dev/null
@@ -1,47 +0,0 @@
1#ifndef _ASM_MSGBUF_H
2#define _ASM_MSGBUF_H
3
4
5/*
6 * The msqid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * Pad space is left for:
11 * - extension of time_t to 64-bit on 32-bitsystem to solve the y2038 problem
12 * - 2 miscellaneous unsigned long values
13 */
14
15struct msqid64_ds {
16 struct ipc64_perm msg_perm;
17#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
18 unsigned long __unused1;
19#endif
20 __kernel_time_t msg_stime; /* last msgsnd time */
21#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
22 unsigned long __unused1;
23#endif
24#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
25 unsigned long __unused2;
26#endif
27 __kernel_time_t msg_rtime; /* last msgrcv time */
28#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
29 unsigned long __unused2;
30#endif
31#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
32 unsigned long __unused3;
33#endif
34 __kernel_time_t msg_ctime; /* last change time */
35#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
36 unsigned long __unused3;
37#endif
38 unsigned long msg_cbytes; /* current number of bytes on queue */
39 unsigned long msg_qnum; /* number of messages in queue */
40 unsigned long msg_qbytes; /* max number of bytes on queue */
41 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
42 __kernel_pid_t msg_lrpid; /* last receive pid */
43 unsigned long __unused4;
44 unsigned long __unused5;
45};
46
47#endif /* _ASM_MSGBUF_H */
diff --git a/include/asm-mips/mutex.h b/include/asm-mips/mutex.h
deleted file mode 100644
index 458c1f7fbc18..000000000000
--- a/include/asm-mips/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
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-mips/nile4.h b/include/asm-mips/nile4.h
deleted file mode 100644
index c3ca959aa4d9..000000000000
--- a/include/asm-mips/nile4.h
+++ /dev/null
@@ -1,310 +0,0 @@
1/*
2 * asm-mips/nile4.h -- NEC Vrc-5074 Nile 4 definitions
3 *
4 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
5 * Sony Software Development Center Europe (SDCE), Brussels
6 *
7 * This file is based on the following documentation:
8 *
9 * NEC Vrc 5074 System Controller Data Sheet, June 1998
10 */
11
12#ifndef _ASM_NILE4_H
13#define _ASM_NILE4_H
14
15#define NILE4_BASE 0xbfa00000
16#define NILE4_SIZE 0x00200000 /* 2 MB */
17
18
19 /*
20 * Physical Device Address Registers (PDARs)
21 */
22
23#define NILE4_SDRAM0 0x0000 /* SDRAM Bank 0 [R/W] */
24#define NILE4_SDRAM1 0x0008 /* SDRAM Bank 1 [R/W] */
25#define NILE4_DCS2 0x0010 /* Device Chip-Select 2 [R/W] */
26#define NILE4_DCS3 0x0018 /* Device Chip-Select 3 [R/W] */
27#define NILE4_DCS4 0x0020 /* Device Chip-Select 4 [R/W] */
28#define NILE4_DCS5 0x0028 /* Device Chip-Select 5 [R/W] */
29#define NILE4_DCS6 0x0030 /* Device Chip-Select 6 [R/W] */
30#define NILE4_DCS7 0x0038 /* Device Chip-Select 7 [R/W] */
31#define NILE4_DCS8 0x0040 /* Device Chip-Select 8 [R/W] */
32#define NILE4_PCIW0 0x0060 /* PCI Address Window 0 [R/W] */
33#define NILE4_PCIW1 0x0068 /* PCI Address Window 1 [R/W] */
34#define NILE4_INTCS 0x0070 /* Controller Internal Registers and Devices */
35 /* [R/W] */
36#define NILE4_BOOTCS 0x0078 /* Boot ROM Chip-Select [R/W] */
37
38
39 /*
40 * CPU Interface Registers
41 */
42
43#define NILE4_CPUSTAT 0x0080 /* CPU Status [R/W] */
44#define NILE4_INTCTRL 0x0088 /* Interrupt Control [R/W] */
45#define NILE4_INTSTAT0 0x0090 /* Interrupt Status 0 [R] */
46#define NILE4_INTSTAT1 0x0098 /* Interrupt Status 1 and CPU Interrupt */
47 /* Enable [R/W] */
48#define NILE4_INTCLR 0x00A0 /* Interrupt Clear [R/W] */
49#define NILE4_INTPPES 0x00A8 /* PCI Interrupt Control [R/W] */
50
51
52 /*
53 * Memory-Interface Registers
54 */
55
56#define NILE4_MEMCTRL 0x00C0 /* Memory Control */
57#define NILE4_ACSTIME 0x00C8 /* Memory Access Timing [R/W] */
58#define NILE4_CHKERR 0x00D0 /* Memory Check Error Status [R] */
59
60
61 /*
62 * PCI-Bus Registers
63 */
64
65#define NILE4_PCICTRL 0x00E0 /* PCI Control [R/W] */
66#define NILE4_PCIARB 0x00E8 /* PCI Arbiter [R/W] */
67#define NILE4_PCIINIT0 0x00F0 /* PCI Master (Initiator) 0 [R/W] */
68#define NILE4_PCIINIT1 0x00F8 /* PCI Master (Initiator) 1 [R/W] */
69#define NILE4_PCIERR 0x00B8 /* PCI Error [R/W] */
70
71
72 /*
73 * Local-Bus Registers
74 */
75
76#define NILE4_LCNFG 0x0100 /* Local Bus Configuration [R/W] */
77#define NILE4_LCST2 0x0110 /* Local Bus Chip-Select Timing 2 [R/W] */
78#define NILE4_LCST3 0x0118 /* Local Bus Chip-Select Timing 3 [R/W] */
79#define NILE4_LCST4 0x0120 /* Local Bus Chip-Select Timing 4 [R/W] */
80#define NILE4_LCST5 0x0128 /* Local Bus Chip-Select Timing 5 [R/W] */
81#define NILE4_LCST6 0x0130 /* Local Bus Chip-Select Timing 6 [R/W] */
82#define NILE4_LCST7 0x0138 /* Local Bus Chip-Select Timing 7 [R/W] */
83#define NILE4_LCST8 0x0140 /* Local Bus Chip-Select Timing 8 [R/W] */
84#define NILE4_DCSFN 0x0150 /* Device Chip-Select Muxing and Output */
85 /* Enables [R/W] */
86#define NILE4_DCSIO 0x0158 /* Device Chip-Selects As I/O Bits [R/W] */
87#define NILE4_BCST 0x0178 /* Local Boot Chip-Select Timing [R/W] */
88
89
90 /*
91 * DMA Registers
92 */
93
94#define NILE4_DMACTRL0 0x0180 /* DMA Control 0 [R/W] */
95#define NILE4_DMASRCA0 0x0188 /* DMA Source Address 0 [R/W] */
96#define NILE4_DMADESA0 0x0190 /* DMA Destination Address 0 [R/W] */
97#define NILE4_DMACTRL1 0x0198 /* DMA Control 1 [R/W] */
98#define NILE4_DMASRCA1 0x01A0 /* DMA Source Address 1 [R/W] */
99#define NILE4_DMADESA1 0x01A8 /* DMA Destination Address 1 [R/W] */
100
101
102 /*
103 * Timer Registers
104 */
105
106#define NILE4_T0CTRL 0x01C0 /* SDRAM Refresh Control [R/W] */
107#define NILE4_T0CNTR 0x01C8 /* SDRAM Refresh Counter [R/W] */
108#define NILE4_T1CTRL 0x01D0 /* CPU-Bus Read Time-Out Control [R/W] */
109#define NILE4_T1CNTR 0x01D8 /* CPU-Bus Read Time-Out Counter [R/W] */
110#define NILE4_T2CTRL 0x01E0 /* General-Purpose Timer Control [R/W] */
111#define NILE4_T2CNTR 0x01E8 /* General-Purpose Timer Counter [R/W] */
112#define NILE4_T3CTRL 0x01F0 /* Watchdog Timer Control [R/W] */
113#define NILE4_T3CNTR 0x01F8 /* Watchdog Timer Counter [R/W] */
114
115
116 /*
117 * PCI Configuration Space Registers
118 */
119
120#define NILE4_PCI_BASE 0x0200
121
122#define NILE4_VID 0x0200 /* PCI Vendor ID [R] */
123#define NILE4_DID 0x0202 /* PCI Device ID [R] */
124#define NILE4_PCICMD 0x0204 /* PCI Command [R/W] */
125#define NILE4_PCISTS 0x0206 /* PCI Status [R/W] */
126#define NILE4_REVID 0x0208 /* PCI Revision ID [R] */
127#define NILE4_CLASS 0x0209 /* PCI Class Code [R] */
128#define NILE4_CLSIZ 0x020C /* PCI Cache Line Size [R/W] */
129#define NILE4_MLTIM 0x020D /* PCI Latency Timer [R/W] */
130#define NILE4_HTYPE 0x020E /* PCI Header Type [R] */
131#define NILE4_BIST 0x020F /* BIST [R] (unimplemented) */
132#define NILE4_BARC 0x0210 /* PCI Base Address Register Control [R/W] */
133#define NILE4_BAR0 0x0218 /* PCI Base Address Register 0 [R/W] */
134#define NILE4_BAR1 0x0220 /* PCI Base Address Register 1 [R/W] */
135#define NILE4_CIS 0x0228 /* PCI Cardbus CIS Pointer [R] */
136 /* (unimplemented) */
137#define NILE4_SSVID 0x022C /* PCI Sub-System Vendor ID [R/W] */
138#define NILE4_SSID 0x022E /* PCI Sub-System ID [R/W] */
139#define NILE4_ROM 0x0230 /* Expansion ROM Base Address [R] */
140 /* (unimplemented) */
141#define NILE4_INTLIN 0x023C /* PCI Interrupt Line [R/W] */
142#define NILE4_INTPIN 0x023D /* PCI Interrupt Pin [R] */
143#define NILE4_MINGNT 0x023E /* PCI Min_Gnt [R] (unimplemented) */
144#define NILE4_MAXLAT 0x023F /* PCI Max_Lat [R] (unimplemented) */
145#define NILE4_BAR2 0x0240 /* PCI Base Address Register 2 [R/W] */
146#define NILE4_BAR3 0x0248 /* PCI Base Address Register 3 [R/W] */
147#define NILE4_BAR4 0x0250 /* PCI Base Address Register 4 [R/W] */
148#define NILE4_BAR5 0x0258 /* PCI Base Address Register 5 [R/W] */
149#define NILE4_BAR6 0x0260 /* PCI Base Address Register 6 [R/W] */
150#define NILE4_BAR7 0x0268 /* PCI Base Address Register 7 [R/W] */
151#define NILE4_BAR8 0x0270 /* PCI Base Address Register 8 [R/W] */
152#define NILE4_BARB 0x0278 /* PCI Base Address Register BOOT [R/W] */
153
154
155 /*
156 * Serial-Port Registers
157 */
158
159#define NILE4_UART_BASE 0x0300
160
161#define NILE4_UARTRBR 0x0300 /* UART Receiver Data Buffer [R] */
162#define NILE4_UARTTHR 0x0300 /* UART Transmitter Data Holding [W] */
163#define NILE4_UARTIER 0x0308 /* UART Interrupt Enable [R/W] */
164#define NILE4_UARTDLL 0x0300 /* UART Divisor Latch LSB [R/W] */
165#define NILE4_UARTDLM 0x0308 /* UART Divisor Latch MSB [R/W] */
166#define NILE4_UARTIIR 0x0310 /* UART Interrupt ID [R] */
167#define NILE4_UARTFCR 0x0310 /* UART FIFO Control [W] */
168#define NILE4_UARTLCR 0x0318 /* UART Line Control [R/W] */
169#define NILE4_UARTMCR 0x0320 /* UART Modem Control [R/W] */
170#define NILE4_UARTLSR 0x0328 /* UART Line Status [R/W] */
171#define NILE4_UARTMSR 0x0330 /* UART Modem Status [R/W] */
172#define NILE4_UARTSCR 0x0338 /* UART Scratch [R/W] */
173
174#define NILE4_UART_BASE_BAUD 520833 /* 100 MHz / 12 / 16 */
175
176
177 /*
178 * Interrupt Lines
179 */
180
181#define NILE4_INT_CPCE 0 /* CPU-Interface Parity-Error Interrupt */
182#define NILE4_INT_CNTD 1 /* CPU No-Target Decode Interrupt */
183#define NILE4_INT_MCE 2 /* Memory-Check Error Interrupt */
184#define NILE4_INT_DMA 3 /* DMA Controller Interrupt */
185#define NILE4_INT_UART 4 /* UART Interrupt */
186#define NILE4_INT_WDOG 5 /* Watchdog Timer Interrupt */
187#define NILE4_INT_GPT 6 /* General-Purpose Timer Interrupt */
188#define NILE4_INT_LBRTD 7 /* Local-Bus Ready Timer Interrupt */
189#define NILE4_INT_INTA 8 /* PCI Interrupt Signal INTA# */
190#define NILE4_INT_INTB 9 /* PCI Interrupt Signal INTB# */
191#define NILE4_INT_INTC 10 /* PCI Interrupt Signal INTC# */
192#define NILE4_INT_INTD 11 /* PCI Interrupt Signal INTD# */
193#define NILE4_INT_INTE 12 /* PCI Interrupt Signal INTE# (ISA cascade) */
194#define NILE4_INT_RESV 13 /* Reserved */
195#define NILE4_INT_PCIS 14 /* PCI SERR# Interrupt */
196#define NILE4_INT_PCIE 15 /* PCI Internal Error Interrupt */
197
198
199 /*
200 * Nile 4 Register Access
201 */
202
203static inline void nile4_sync(void)
204{
205 volatile u32 *p = (volatile u32 *)0xbfc00000;
206 (void)(*p);
207}
208
209static inline void nile4_out32(u32 offset, u32 val)
210{
211 *(volatile u32 *)(NILE4_BASE+offset) = val;
212 nile4_sync();
213}
214
215static inline u32 nile4_in32(u32 offset)
216{
217 u32 val = *(volatile u32 *)(NILE4_BASE+offset);
218 nile4_sync();
219 return val;
220}
221
222static inline void nile4_out16(u32 offset, u16 val)
223{
224 *(volatile u16 *)(NILE4_BASE+offset) = val;
225 nile4_sync();
226}
227
228static inline u16 nile4_in16(u32 offset)
229{
230 u16 val = *(volatile u16 *)(NILE4_BASE+offset);
231 nile4_sync();
232 return val;
233}
234
235static inline void nile4_out8(u32 offset, u8 val)
236{
237 *(volatile u8 *)(NILE4_BASE+offset) = val;
238 nile4_sync();
239}
240
241static inline u8 nile4_in8(u32 offset)
242{
243 u8 val = *(volatile u8 *)(NILE4_BASE+offset);
244 nile4_sync();
245 return val;
246}
247
248
249 /*
250 * Physical Device Address Registers
251 */
252
253extern void nile4_set_pdar(u32 pdar, u32 phys, u32 size, int width,
254 int on_memory_bus, int visible);
255
256
257 /*
258 * PCI Master Registers
259 */
260
261#define NILE4_PCICMD_IACK 0 /* PCI Interrupt Acknowledge */
262#define NILE4_PCICMD_IO 1 /* PCI I/O Space */
263#define NILE4_PCICMD_MEM 3 /* PCI Memory Space */
264#define NILE4_PCICMD_CFG 5 /* PCI Configuration Space */
265
266
267 /*
268 * PCI Address Spaces
269 *
270 * Note that these are multiplexed using PCIINIT[01]!
271 */
272
273#define NILE4_PCI_IO_BASE 0xa6000000
274#define NILE4_PCI_MEM_BASE 0xa8000000
275#define NILE4_PCI_CFG_BASE NILE4_PCI_MEM_BASE
276#define NILE4_PCI_IACK_BASE NILE4_PCI_IO_BASE
277
278
279extern void nile4_set_pmr(u32 pmr, u32 type, u32 addr);
280
281
282 /*
283 * Interrupt Programming
284 */
285
286#define NUM_I8259_INTERRUPTS 16
287#define NUM_NILE4_INTERRUPTS 16
288
289#define IRQ_I8259_CASCADE NILE4_INT_INTE
290#define is_i8259_irq(irq) ((irq) < NUM_I8259_INTERRUPTS)
291#define nile4_to_irq(n) ((n)+NUM_I8259_INTERRUPTS)
292#define irq_to_nile4(n) ((n)-NUM_I8259_INTERRUPTS)
293
294extern void nile4_map_irq(int nile4_irq, int cpu_irq);
295extern void nile4_map_irq_all(int cpu_irq);
296extern void nile4_enable_irq(unsigned int nile4_irq);
297extern void nile4_disable_irq(unsigned int nile4_irq);
298extern void nile4_disable_irq_all(void);
299extern u16 nile4_get_irq_stat(int cpu_irq);
300extern void nile4_enable_irq_output(int cpu_irq);
301extern void nile4_disable_irq_output(int cpu_irq);
302extern void nile4_set_pci_irq_polarity(int pci_irq, int high);
303extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level);
304extern void nile4_clear_irq(int nile4_irq);
305extern void nile4_clear_irq_mask(u32 mask);
306extern u8 nile4_i8259_iack(void);
307extern void nile4_dump_irq_status(void); /* Debug */
308
309#endif
310
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h
deleted file mode 100644
index c2394f8b0fe1..000000000000
--- a/include/asm-mips/paccess.h
+++ /dev/null
@@ -1,112 +0,0 @@
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 * Copyright (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 *
9 * Protected memory access. Used for everything that might take revenge
10 * by sending a DBE error like accessing possibly non-existant memory or
11 * devices.
12 */
13#ifndef _ASM_PACCESS_H
14#define _ASM_PACCESS_H
15
16#include <linux/errno.h>
17
18#ifdef CONFIG_32BIT
19#define __PA_ADDR ".word"
20#endif
21#ifdef CONFIG_64BIT
22#define __PA_ADDR ".dword"
23#endif
24
25extern asmlinkage void handle_ibe(void);
26extern asmlinkage void handle_dbe(void);
27
28#define put_dbe(x, ptr) __put_dbe((x), (ptr), sizeof(*(ptr)))
29#define get_dbe(x, ptr) __get_dbe((x), (ptr), sizeof(*(ptr)))
30
31struct __large_pstruct { unsigned long buf[100]; };
32#define __mp(x) (*(struct __large_pstruct *)(x))
33
34#define __get_dbe(x, ptr, size) \
35({ \
36 long __gu_err; \
37 __typeof__(*(ptr)) __gu_val; \
38 unsigned long __gu_addr; \
39 __asm__("":"=r" (__gu_val)); \
40 __gu_addr = (unsigned long) (ptr); \
41 __asm__("":"=r" (__gu_err)); \
42 switch (size) { \
43 case 1: __get_dbe_asm("lb"); break; \
44 case 2: __get_dbe_asm("lh"); break; \
45 case 4: __get_dbe_asm("lw"); break; \
46 case 8: __get_dbe_asm("ld"); break; \
47 default: __get_dbe_unknown(); break; \
48 } \
49 x = (__typeof__(*(ptr))) __gu_val; \
50 __gu_err; \
51})
52
53#define __get_dbe_asm(insn) \
54{ \
55 __asm__ __volatile__( \
56 "1:\t" insn "\t%1,%2\n\t" \
57 "move\t%0,$0\n" \
58 "2:\n\t" \
59 ".section\t.fixup,\"ax\"\n" \
60 "3:\tli\t%0,%3\n\t" \
61 "move\t%1,$0\n\t" \
62 "j\t2b\n\t" \
63 ".previous\n\t" \
64 ".section\t__dbe_table,\"a\"\n\t" \
65 __PA_ADDR "\t1b, 3b\n\t" \
66 ".previous" \
67 :"=r" (__gu_err), "=r" (__gu_val) \
68 :"o" (__mp(__gu_addr)), "i" (-EFAULT)); \
69}
70
71extern void __get_dbe_unknown(void);
72
73#define __put_dbe(x, ptr, size) \
74({ \
75 long __pu_err; \
76 __typeof__(*(ptr)) __pu_val; \
77 long __pu_addr; \
78 __pu_val = (x); \
79 __pu_addr = (long) (ptr); \
80 __asm__("":"=r" (__pu_err)); \
81 switch (size) { \
82 case 1: __put_dbe_asm("sb"); break; \
83 case 2: __put_dbe_asm("sh"); break; \
84 case 4: __put_dbe_asm("sw"); break; \
85 case 8: __put_dbe_asm("sd"); break; \
86 default: __put_dbe_unknown(); break; \
87 } \
88 __pu_err; \
89})
90
91#define __put_dbe_asm(insn) \
92{ \
93 __asm__ __volatile__( \
94 "1:\t" insn "\t%1,%2\n\t" \
95 "move\t%0,$0\n" \
96 "2:\n\t" \
97 ".section\t.fixup,\"ax\"\n" \
98 "3:\tli\t%0,%3\n\t" \
99 "j\t2b\n\t" \
100 ".previous\n\t" \
101 ".section\t__dbe_table,\"a\"\n\t" \
102 __PA_ADDR "\t1b, 3b\n\t" \
103 ".previous" \
104 : "=r" (__pu_err) \
105 : "r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); \
106}
107
108extern void __put_dbe_unknown(void);
109
110extern unsigned long search_dbe_table(unsigned long addr);
111
112#endif /* _ASM_PACCESS_H */
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
deleted file mode 100644
index fe7a88ea066e..000000000000
--- a/include/asm-mips/page.h
+++ /dev/null
@@ -1,191 +0,0 @@
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 * Copyright (C) 1994 - 1999, 2000, 03 Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_PAGE_H
10#define _ASM_PAGE_H
11
12#include <spaces.h>
13
14/*
15 * PAGE_SHIFT determines the page size
16 */
17#ifdef CONFIG_PAGE_SIZE_4KB
18#define PAGE_SHIFT 12
19#endif
20#ifdef CONFIG_PAGE_SIZE_8KB
21#define PAGE_SHIFT 13
22#endif
23#ifdef CONFIG_PAGE_SIZE_16KB
24#define PAGE_SHIFT 14
25#endif
26#ifdef CONFIG_PAGE_SIZE_64KB
27#define PAGE_SHIFT 16
28#endif
29#define PAGE_SIZE (1UL << PAGE_SHIFT)
30#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
31
32#ifndef __ASSEMBLY__
33
34#include <linux/pfn.h>
35#include <asm/io.h>
36
37extern void build_clear_page(void);
38extern void build_copy_page(void);
39
40/*
41 * It's normally defined only for FLATMEM config but it's
42 * used in our early mem init code for all memory models.
43 * So always define it.
44 */
45#define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET)
46
47extern void clear_page(void * page);
48extern void copy_page(void * to, void * from);
49
50extern unsigned long shm_align_mask;
51
52static inline unsigned long pages_do_alias(unsigned long addr1,
53 unsigned long addr2)
54{
55 return (addr1 ^ addr2) & shm_align_mask;
56}
57
58struct page;
59
60static inline void clear_user_page(void *addr, unsigned long vaddr,
61 struct page *page)
62{
63 extern void (*flush_data_cache_page)(unsigned long addr);
64
65 clear_page(addr);
66 if (pages_do_alias((unsigned long) addr, vaddr & PAGE_MASK))
67 flush_data_cache_page((unsigned long)addr);
68}
69
70extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
71 struct page *to);
72struct vm_area_struct;
73extern void copy_user_highpage(struct page *to, struct page *from,
74 unsigned long vaddr, struct vm_area_struct *vma);
75
76#define __HAVE_ARCH_COPY_USER_HIGHPAGE
77
78/*
79 * These are used to make use of C type-checking..
80 */
81#ifdef CONFIG_64BIT_PHYS_ADDR
82 #ifdef CONFIG_CPU_MIPS32
83 typedef struct { unsigned long pte_low, pte_high; } pte_t;
84 #define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
85 #define __pte(x) ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
86 #else
87 typedef struct { unsigned long long pte; } pte_t;
88 #define pte_val(x) ((x).pte)
89 #define __pte(x) ((pte_t) { (x) } )
90 #endif
91#else
92typedef struct { unsigned long pte; } pte_t;
93#define pte_val(x) ((x).pte)
94#define __pte(x) ((pte_t) { (x) } )
95#endif
96typedef struct page *pgtable_t;
97
98/*
99 * For 3-level pagetables we defines these ourselves, for 2-level the
100 * definitions are supplied by <asm-generic/pgtable-nopmd.h>.
101 */
102#ifdef CONFIG_64BIT
103
104typedef struct { unsigned long pmd; } pmd_t;
105#define pmd_val(x) ((x).pmd)
106#define __pmd(x) ((pmd_t) { (x) } )
107
108#endif
109
110/*
111 * Right now we don't support 4-level pagetables, so all pud-related
112 * definitions come from <asm-generic/pgtable-nopud.h>.
113 */
114
115/*
116 * Finall the top of the hierarchy, the pgd
117 */
118typedef struct { unsigned long pgd; } pgd_t;
119#define pgd_val(x) ((x).pgd)
120#define __pgd(x) ((pgd_t) { (x) } )
121
122/*
123 * Manipulate page protection bits
124 */
125typedef struct { unsigned long pgprot; } pgprot_t;
126#define pgprot_val(x) ((x).pgprot)
127#define __pgprot(x) ((pgprot_t) { (x) } )
128
129/*
130 * On R4000-style MMUs where a TLB entry is mapping a adjacent even / odd
131 * pair of pages we only have a single global bit per pair of pages. When
132 * writing to the TLB make sure we always have the bit set for both pages
133 * or none. This macro is used to access the `buddy' of the pte we're just
134 * working on.
135 */
136#define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t)))
137
138#endif /* !__ASSEMBLY__ */
139
140/*
141 * __pa()/__va() should be used only during mem init.
142 */
143#ifdef CONFIG_64BIT
144#define __pa(x) \
145({ \
146 unsigned long __x = (unsigned long)(x); \
147 __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x); \
148})
149#else
150#define __pa(x) \
151 ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
152#endif
153#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
154#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))
155
156#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
157
158#ifdef CONFIG_FLATMEM
159
160#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
161
162#elif defined(CONFIG_SPARSEMEM)
163
164/* pfn_valid is defined in linux/mmzone.h */
165
166#elif defined(CONFIG_NEED_MULTIPLE_NODES)
167
168#define pfn_valid(pfn) \
169({ \
170 unsigned long __pfn = (pfn); \
171 int __n = pfn_to_nid(__pfn); \
172 ((__n >= 0) ? (__pfn < NODE_DATA(__n)->node_start_pfn + \
173 NODE_DATA(__n)->node_spanned_pages) \
174 : 0); \
175})
176
177#endif
178
179#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
180#define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr)))
181
182#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
183 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
184
185#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
186#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
187
188#include <asm-generic/memory_model.h>
189#include <asm-generic/page.h>
190
191#endif /* _ASM_PAGE_H */
diff --git a/include/asm-mips/param.h b/include/asm-mips/param.h
deleted file mode 100644
index 1d9bb8c5ab24..000000000000
--- a/include/asm-mips/param.h
+++ /dev/null
@@ -1,31 +0,0 @@
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 * Copyright 1994 - 2000, 2002 Ralf Baechle (ralf@gnu.org)
7 * Copyright 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_PARAM_H
10#define _ASM_PARAM_H
11
12#ifdef __KERNEL__
13
14# define HZ CONFIG_HZ /* Internal kernel timer frequency */
15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
17#endif
18
19#ifndef HZ
20#define HZ 100
21#endif
22
23#define EXEC_PAGESIZE 65536
24
25#ifndef NOGROUP
26#define NOGROUP (-1)
27#endif
28
29#define MAXHOSTNAMELEN 64 /* max length of hostname */
30
31#endif /* _ASM_PARAM_H */
diff --git a/include/asm-mips/parport.h b/include/asm-mips/parport.h
deleted file mode 100644
index f52656826cce..000000000000
--- a/include/asm-mips/parport.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
3 *
4 * This file should only be included by drivers/parport/parport_pc.c.
5 */
6#ifndef _ASM_PARPORT_H
7#define _ASM_PARPORT_H
8
9static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma);
10static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
11{
12 return parport_pc_find_isa_ports(autoirq, autodma);
13}
14
15#endif /* _ASM_PARPORT_H */
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
deleted file mode 100644
index 5510c53b7feb..000000000000
--- a/include/asm-mips/pci.h
+++ /dev/null
@@ -1,179 +0,0 @@
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#ifndef _ASM_PCI_H
7#define _ASM_PCI_H
8
9#include <linux/mm.h>
10
11#ifdef __KERNEL__
12
13/*
14 * This file essentially defines the interface between board
15 * specific PCI code and MIPS common PCI code. Should potentially put
16 * into include/asm/pci.h file.
17 */
18
19#include <linux/ioport.h>
20
21/*
22 * Each pci channel is a top-level PCI bus seem by CPU. A machine with
23 * multiple PCI channels may have multiple PCI host controllers or a
24 * single controller supporting multiple channels.
25 */
26struct pci_controller {
27 struct pci_controller *next;
28 struct pci_bus *bus;
29
30 struct pci_ops *pci_ops;
31 struct resource *mem_resource;
32 unsigned long mem_offset;
33 struct resource *io_resource;
34 unsigned long io_offset;
35 unsigned long io_map_base;
36
37 unsigned int index;
38 /* For compatibility with current (as of July 2003) pciutils
39 and XFree86. Eventually will be removed. */
40 unsigned int need_domain_info;
41
42 int iommu;
43
44 /* Optional access methods for reading/writing the bus number
45 of the PCI controller */
46 int (*get_busno)(void);
47 void (*set_busno)(int busno);
48};
49
50/*
51 * Used by boards to register their PCI busses before the actual scanning.
52 */
53extern struct pci_controller * alloc_pci_controller(void);
54extern void register_pci_controller(struct pci_controller *hose);
55
56/*
57 * board supplied pci irq fixup routine
58 */
59extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
60
61
62/* Can be used to override the logic in pci_scan_bus for skipping
63 already-configured bus numbers - to be used for buggy BIOSes
64 or architectures with incomplete PCI setup by the loader */
65
66extern unsigned int pcibios_assign_all_busses(void);
67
68#define pcibios_scan_all_fns(a, b) 0
69
70extern unsigned long PCIBIOS_MIN_IO;
71extern unsigned long PCIBIOS_MIN_MEM;
72
73#define PCIBIOS_MIN_CARDBUS_IO 0x4000
74
75extern void pcibios_set_master(struct pci_dev *dev);
76
77static inline void pcibios_penalize_isa_irq(int irq, int active)
78{
79 /* We don't do dynamic PCI IRQ allocation */
80}
81
82/*
83 * Dynamic DMA mapping stuff.
84 * MIPS has everything mapped statically.
85 */
86
87#include <linux/types.h>
88#include <linux/slab.h>
89#include <asm/scatterlist.h>
90#include <linux/string.h>
91#include <asm/io.h>
92
93struct pci_dev;
94
95/*
96 * The PCI address space does equal the physical memory address space. The
97 * networking and block device layers use this boolean for bounce buffer
98 * decisions. This is set if any hose does not have an IOMMU.
99 */
100extern unsigned int PCI_DMA_BUS_IS_PHYS;
101
102#ifdef CONFIG_DMA_NEED_PCI_MAP_STATE
103
104/* pci_unmap_{single,page} is not a nop, thus... */
105#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
106#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
107#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
108#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
109#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
110#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
111
112#else /* CONFIG_DMA_NEED_PCI_MAP_STATE */
113
114/* pci_unmap_{page,single} is a nop so... */
115#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
116#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
117#define pci_unmap_addr(PTR, ADDR_NAME) (0)
118#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
119#define pci_unmap_len(PTR, LEN_NAME) (0)
120#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
121
122#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */
123
124#ifdef CONFIG_PCI
125static inline void pci_dma_burst_advice(struct pci_dev *pdev,
126 enum pci_dma_burst_strategy *strat,
127 unsigned long *strategy_parameter)
128{
129 *strat = PCI_DMA_BURST_INFINITY;
130 *strategy_parameter = ~0UL;
131}
132#endif
133
134extern void pcibios_resource_to_bus(struct pci_dev *dev,
135 struct pci_bus_region *region, struct resource *res);
136
137extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
138 struct pci_bus_region *region);
139
140static inline struct resource *
141pcibios_select_root(struct pci_dev *pdev, struct resource *res)
142{
143 struct resource *root = NULL;
144
145 if (res->flags & IORESOURCE_IO)
146 root = &ioport_resource;
147 if (res->flags & IORESOURCE_MEM)
148 root = &iomem_resource;
149
150 return root;
151}
152
153#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
154
155static inline int pci_proc_domain(struct pci_bus *bus)
156{
157 struct pci_controller *hose = bus->sysdata;
158 return hose->need_domain_info;
159}
160
161#endif /* __KERNEL__ */
162
163/* implement the pci_ DMA API in terms of the generic device dma_ one */
164#include <asm-generic/pci-dma-compat.h>
165
166/* Do platform specific device initialization at pci_enable_device() time */
167extern int pcibios_plat_dev_init(struct pci_dev *dev);
168
169/* Chances are this interrupt is wired PC-style ... */
170static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
171{
172 return channel ? 15 : 14;
173}
174
175extern int pci_probe_only;
176
177extern char * (*pcibios_plat_setup)(char *str);
178
179#endif /* _ASM_PCI_H */
diff --git a/include/asm-mips/pci/bridge.h b/include/asm-mips/pci/bridge.h
deleted file mode 100644
index 5f4b9d4e4114..000000000000
--- a/include/asm-mips/pci/bridge.h
+++ /dev/null
@@ -1,854 +0,0 @@
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 * bridge.h - bridge chip header file, derived from IRIX <sys/PCI/bridge.h>,
7 * revision 1.76.
8 *
9 * Copyright (C) 1996, 1999 Silcon Graphics, Inc.
10 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
11 */
12#ifndef _ASM_PCI_BRIDGE_H
13#define _ASM_PCI_BRIDGE_H
14
15#include <linux/types.h>
16#include <linux/pci.h>
17#include <asm/xtalk/xwidget.h> /* generic widget header */
18#include <asm/sn/types.h>
19
20/* I/O page size */
21
22#define IOPFNSHIFT 12 /* 4K per mapped page */
23
24#define IOPGSIZE (1 << IOPFNSHIFT)
25#define IOPG(x) ((x) >> IOPFNSHIFT)
26#define IOPGOFF(x) ((x) & (IOPGSIZE-1))
27
28/* Bridge RAM sizes */
29
30#define BRIDGE_ATE_RAM_SIZE 0x00000400 /* 1kB ATE RAM */
31
32#define BRIDGE_CONFIG_BASE 0x20000
33#define BRIDGE_CONFIG1_BASE 0x28000
34#define BRIDGE_CONFIG_END 0x30000
35#define BRIDGE_CONFIG_SLOT_SIZE 0x1000
36
37#define BRIDGE_SSRAM_512K 0x00080000 /* 512kB */
38#define BRIDGE_SSRAM_128K 0x00020000 /* 128kB */
39#define BRIDGE_SSRAM_64K 0x00010000 /* 64kB */
40#define BRIDGE_SSRAM_0K 0x00000000 /* 0kB */
41
42/* ========================================================================
43 * Bridge address map
44 */
45
46#ifndef __ASSEMBLY__
47
48/*
49 * All accesses to bridge hardware registers must be done
50 * using 32-bit loads and stores.
51 */
52typedef u32 bridgereg_t;
53
54typedef u64 bridge_ate_t;
55
56/* pointers to bridge ATEs
57 * are always "pointer to volatile"
58 */
59typedef volatile bridge_ate_t *bridge_ate_p;
60
61/*
62 * It is generally preferred that hardware registers on the bridge
63 * are located from C code via this structure.
64 *
65 * Generated from Bridge spec dated 04oct95
66 */
67
68typedef volatile struct bridge_s {
69 /* Local Registers 0x000000-0x00FFFF */
70
71 /* standard widget configuration 0x000000-0x000057 */
72 widget_cfg_t b_widget; /* 0x000000 */
73
74 /* helper fieldnames for accessing bridge widget */
75
76#define b_wid_id b_widget.w_id
77#define b_wid_stat b_widget.w_status
78#define b_wid_err_upper b_widget.w_err_upper_addr
79#define b_wid_err_lower b_widget.w_err_lower_addr
80#define b_wid_control b_widget.w_control
81#define b_wid_req_timeout b_widget.w_req_timeout
82#define b_wid_int_upper b_widget.w_intdest_upper_addr
83#define b_wid_int_lower b_widget.w_intdest_lower_addr
84#define b_wid_err_cmdword b_widget.w_err_cmd_word
85#define b_wid_llp b_widget.w_llp_cfg
86#define b_wid_tflush b_widget.w_tflush
87
88 /* bridge-specific widget configuration 0x000058-0x00007F */
89 bridgereg_t _pad_000058;
90 bridgereg_t b_wid_aux_err; /* 0x00005C */
91 bridgereg_t _pad_000060;
92 bridgereg_t b_wid_resp_upper; /* 0x000064 */
93 bridgereg_t _pad_000068;
94 bridgereg_t b_wid_resp_lower; /* 0x00006C */
95 bridgereg_t _pad_000070;
96 bridgereg_t b_wid_tst_pin_ctrl; /* 0x000074 */
97 bridgereg_t _pad_000078[2];
98
99 /* PMU & Map 0x000080-0x00008F */
100 bridgereg_t _pad_000080;
101 bridgereg_t b_dir_map; /* 0x000084 */
102 bridgereg_t _pad_000088[2];
103
104 /* SSRAM 0x000090-0x00009F */
105 bridgereg_t _pad_000090;
106 bridgereg_t b_ram_perr; /* 0x000094 */
107 bridgereg_t _pad_000098[2];
108
109 /* Arbitration 0x0000A0-0x0000AF */
110 bridgereg_t _pad_0000A0;
111 bridgereg_t b_arb; /* 0x0000A4 */
112 bridgereg_t _pad_0000A8[2];
113
114 /* Number In A Can 0x0000B0-0x0000BF */
115 bridgereg_t _pad_0000B0;
116 bridgereg_t b_nic; /* 0x0000B4 */
117 bridgereg_t _pad_0000B8[2];
118
119 /* PCI/GIO 0x0000C0-0x0000FF */
120 bridgereg_t _pad_0000C0;
121 bridgereg_t b_bus_timeout; /* 0x0000C4 */
122#define b_pci_bus_timeout b_bus_timeout
123
124 bridgereg_t _pad_0000C8;
125 bridgereg_t b_pci_cfg; /* 0x0000CC */
126 bridgereg_t _pad_0000D0;
127 bridgereg_t b_pci_err_upper; /* 0x0000D4 */
128 bridgereg_t _pad_0000D8;
129 bridgereg_t b_pci_err_lower; /* 0x0000DC */
130 bridgereg_t _pad_0000E0[8];
131#define b_gio_err_lower b_pci_err_lower
132#define b_gio_err_upper b_pci_err_upper
133
134 /* Interrupt 0x000100-0x0001FF */
135 bridgereg_t _pad_000100;
136 bridgereg_t b_int_status; /* 0x000104 */
137 bridgereg_t _pad_000108;
138 bridgereg_t b_int_enable; /* 0x00010C */
139 bridgereg_t _pad_000110;
140 bridgereg_t b_int_rst_stat; /* 0x000114 */
141 bridgereg_t _pad_000118;
142 bridgereg_t b_int_mode; /* 0x00011C */
143 bridgereg_t _pad_000120;
144 bridgereg_t b_int_device; /* 0x000124 */
145 bridgereg_t _pad_000128;
146 bridgereg_t b_int_host_err; /* 0x00012C */
147
148 struct {
149 bridgereg_t __pad; /* 0x0001{30,,,68} */
150 bridgereg_t addr; /* 0x0001{34,,,6C} */
151 } b_int_addr[8]; /* 0x000130 */
152
153 bridgereg_t _pad_000170[36];
154
155 /* Device 0x000200-0x0003FF */
156 struct {
157 bridgereg_t __pad; /* 0x0002{00,,,38} */
158 bridgereg_t reg; /* 0x0002{04,,,3C} */
159 } b_device[8]; /* 0x000200 */
160
161 struct {
162 bridgereg_t __pad; /* 0x0002{40,,,78} */
163 bridgereg_t reg; /* 0x0002{44,,,7C} */
164 } b_wr_req_buf[8]; /* 0x000240 */
165
166 struct {
167 bridgereg_t __pad; /* 0x0002{80,,,88} */
168 bridgereg_t reg; /* 0x0002{84,,,8C} */
169 } b_rrb_map[2]; /* 0x000280 */
170#define b_even_resp b_rrb_map[0].reg /* 0x000284 */
171#define b_odd_resp b_rrb_map[1].reg /* 0x00028C */
172
173 bridgereg_t _pad_000290;
174 bridgereg_t b_resp_status; /* 0x000294 */
175 bridgereg_t _pad_000298;
176 bridgereg_t b_resp_clear; /* 0x00029C */
177
178 bridgereg_t _pad_0002A0[24];
179
180 char _pad_000300[0x10000 - 0x000300];
181
182 /* Internal Address Translation Entry RAM 0x010000-0x0103FF */
183 union {
184 bridge_ate_t wr; /* write-only */
185 struct {
186 bridgereg_t _p_pad;
187 bridgereg_t rd; /* read-only */
188 } hi;
189 } b_int_ate_ram[128];
190
191 char _pad_010400[0x11000 - 0x010400];
192
193 /* Internal Address Translation Entry RAM LOW 0x011000-0x0113FF */
194 struct {
195 bridgereg_t _p_pad;
196 bridgereg_t rd; /* read-only */
197 } b_int_ate_ram_lo[128];
198
199 char _pad_011400[0x20000 - 0x011400];
200
201 /* PCI Device Configuration Spaces 0x020000-0x027FFF */
202 union { /* make all access sizes available. */
203 u8 c[0x1000 / 1];
204 u16 s[0x1000 / 2];
205 u32 l[0x1000 / 4];
206 u64 d[0x1000 / 8];
207 union {
208 u8 c[0x100 / 1];
209 u16 s[0x100 / 2];
210 u32 l[0x100 / 4];
211 u64 d[0x100 / 8];
212 } f[8];
213 } b_type0_cfg_dev[8]; /* 0x020000 */
214
215 /* PCI Type 1 Configuration Space 0x028000-0x028FFF */
216 union { /* make all access sizes available. */
217 u8 c[0x1000 / 1];
218 u16 s[0x1000 / 2];
219 u32 l[0x1000 / 4];
220 u64 d[0x1000 / 8];
221 } b_type1_cfg; /* 0x028000-0x029000 */
222
223 char _pad_029000[0x007000]; /* 0x029000-0x030000 */
224
225 /* PCI Interrupt Acknowledge Cycle 0x030000 */
226 union {
227 u8 c[8 / 1];
228 u16 s[8 / 2];
229 u32 l[8 / 4];
230 u64 d[8 / 8];
231 } b_pci_iack; /* 0x030000 */
232
233 u8 _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */
234
235 /* External Address Translation Entry RAM 0x080000-0x0FFFFF */
236 bridge_ate_t b_ext_ate_ram[0x10000];
237
238 /* Reserved 0x100000-0x1FFFFF */
239 char _pad_100000[0x200000-0x100000];
240
241 /* PCI/GIO Device Spaces 0x200000-0xBFFFFF */
242 union { /* make all access sizes available. */
243 u8 c[0x100000 / 1];
244 u16 s[0x100000 / 2];
245 u32 l[0x100000 / 4];
246 u64 d[0x100000 / 8];
247 } b_devio_raw[10]; /* 0x200000 */
248
249 /* b_devio macro is a bit strange; it reflects the
250 * fact that the Bridge ASIC provides 2M for the
251 * first two DevIO windows and 1M for the other six.
252 */
253#define b_devio(n) b_devio_raw[((n)<2)?(n*2):(n+2)]
254
255 /* External Flash Proms 1,0 0xC00000-0xFFFFFF */
256 union { /* make all access sizes available. */
257 u8 c[0x400000 / 1]; /* read-only */
258 u16 s[0x400000 / 2]; /* read-write */
259 u32 l[0x400000 / 4]; /* read-only */
260 u64 d[0x400000 / 8]; /* read-only */
261 } b_external_flash; /* 0xC00000 */
262} bridge_t;
263
264/*
265 * Field formats for Error Command Word and Auxillary Error Command Word
266 * of bridge.
267 */
268typedef struct bridge_err_cmdword_s {
269 union {
270 u32 cmd_word;
271 struct {
272 u32 didn:4, /* Destination ID */
273 sidn:4, /* Source ID */
274 pactyp:4, /* Packet type */
275 tnum:5, /* Trans Number */
276 coh:1, /* Coh Transacti */
277 ds:2, /* Data size */
278 gbr:1, /* GBR enable */
279 vbpm:1, /* VBPM message */
280 error:1, /* Error occurred */
281 barr:1, /* Barrier op */
282 rsvd:8;
283 } berr_st;
284 } berr_un;
285} bridge_err_cmdword_t;
286
287#define berr_field berr_un.berr_st
288#endif /* !__ASSEMBLY__ */
289
290/*
291 * The values of these macros can and should be crosschecked
292 * regularly against the offsets of the like-named fields
293 * within the "bridge_t" structure above.
294 */
295
296/* Byte offset macros for Bridge internal registers */
297
298#define BRIDGE_WID_ID WIDGET_ID
299#define BRIDGE_WID_STAT WIDGET_STATUS
300#define BRIDGE_WID_ERR_UPPER WIDGET_ERR_UPPER_ADDR
301#define BRIDGE_WID_ERR_LOWER WIDGET_ERR_LOWER_ADDR
302#define BRIDGE_WID_CONTROL WIDGET_CONTROL
303#define BRIDGE_WID_REQ_TIMEOUT WIDGET_REQ_TIMEOUT
304#define BRIDGE_WID_INT_UPPER WIDGET_INTDEST_UPPER_ADDR
305#define BRIDGE_WID_INT_LOWER WIDGET_INTDEST_LOWER_ADDR
306#define BRIDGE_WID_ERR_CMDWORD WIDGET_ERR_CMD_WORD
307#define BRIDGE_WID_LLP WIDGET_LLP_CFG
308#define BRIDGE_WID_TFLUSH WIDGET_TFLUSH
309
310#define BRIDGE_WID_AUX_ERR 0x00005C /* Aux Error Command Word */
311#define BRIDGE_WID_RESP_UPPER 0x000064 /* Response Buf Upper Addr */
312#define BRIDGE_WID_RESP_LOWER 0x00006C /* Response Buf Lower Addr */
313#define BRIDGE_WID_TST_PIN_CTRL 0x000074 /* Test pin control */
314
315#define BRIDGE_DIR_MAP 0x000084 /* Direct Map reg */
316
317#define BRIDGE_RAM_PERR 0x000094 /* SSRAM Parity Error */
318
319#define BRIDGE_ARB 0x0000A4 /* Arbitration Priority reg */
320
321#define BRIDGE_NIC 0x0000B4 /* Number In A Can */
322
323#define BRIDGE_BUS_TIMEOUT 0x0000C4 /* Bus Timeout Register */
324#define BRIDGE_PCI_BUS_TIMEOUT BRIDGE_BUS_TIMEOUT
325#define BRIDGE_PCI_CFG 0x0000CC /* PCI Type 1 Config reg */
326#define BRIDGE_PCI_ERR_UPPER 0x0000D4 /* PCI error Upper Addr */
327#define BRIDGE_PCI_ERR_LOWER 0x0000DC /* PCI error Lower Addr */
328
329#define BRIDGE_INT_STATUS 0x000104 /* Interrupt Status */
330#define BRIDGE_INT_ENABLE 0x00010C /* Interrupt Enables */
331#define BRIDGE_INT_RST_STAT 0x000114 /* Reset Intr Status */
332#define BRIDGE_INT_MODE 0x00011C /* Interrupt Mode */
333#define BRIDGE_INT_DEVICE 0x000124 /* Interrupt Device */
334#define BRIDGE_INT_HOST_ERR 0x00012C /* Host Error Field */
335
336#define BRIDGE_INT_ADDR0 0x000134 /* Host Address Reg */
337#define BRIDGE_INT_ADDR_OFF 0x000008 /* Host Addr offset (1..7) */
338#define BRIDGE_INT_ADDR(x) (BRIDGE_INT_ADDR0+(x)*BRIDGE_INT_ADDR_OFF)
339
340#define BRIDGE_DEVICE0 0x000204 /* Device 0 */
341#define BRIDGE_DEVICE_OFF 0x000008 /* Device offset (1..7) */
342#define BRIDGE_DEVICE(x) (BRIDGE_DEVICE0+(x)*BRIDGE_DEVICE_OFF)
343
344#define BRIDGE_WR_REQ_BUF0 0x000244 /* Write Request Buffer 0 */
345#define BRIDGE_WR_REQ_BUF_OFF 0x000008 /* Buffer Offset (1..7) */
346#define BRIDGE_WR_REQ_BUF(x) (BRIDGE_WR_REQ_BUF0+(x)*BRIDGE_WR_REQ_BUF_OFF)
347
348#define BRIDGE_EVEN_RESP 0x000284 /* Even Device Response Buf */
349#define BRIDGE_ODD_RESP 0x00028C /* Odd Device Response Buf */
350
351#define BRIDGE_RESP_STATUS 0x000294 /* Read Response Status reg */
352#define BRIDGE_RESP_CLEAR 0x00029C /* Read Response Clear reg */
353
354/* Byte offset macros for Bridge I/O space */
355
356#define BRIDGE_ATE_RAM 0x00010000 /* Internal Addr Xlat Ram */
357
358#define BRIDGE_TYPE0_CFG_DEV0 0x00020000 /* Type 0 Cfg, Device 0 */
359#define BRIDGE_TYPE0_CFG_SLOT_OFF 0x00001000 /* Type 0 Cfg Slot Offset (1..7) */
360#define BRIDGE_TYPE0_CFG_FUNC_OFF 0x00000100 /* Type 0 Cfg Func Offset (1..7) */
361#define BRIDGE_TYPE0_CFG_DEV(s) (BRIDGE_TYPE0_CFG_DEV0+\
362 (s)*BRIDGE_TYPE0_CFG_SLOT_OFF)
363#define BRIDGE_TYPE0_CFG_DEVF(s, f) (BRIDGE_TYPE0_CFG_DEV0+\
364 (s)*BRIDGE_TYPE0_CFG_SLOT_OFF+\
365 (f)*BRIDGE_TYPE0_CFG_FUNC_OFF)
366
367#define BRIDGE_TYPE1_CFG 0x00028000 /* Type 1 Cfg space */
368
369#define BRIDGE_PCI_IACK 0x00030000 /* PCI Interrupt Ack */
370#define BRIDGE_EXT_SSRAM 0x00080000 /* Extern SSRAM (ATE) */
371
372/* Byte offset macros for Bridge device IO spaces */
373
374#define BRIDGE_DEV_CNT 8 /* Up to 8 devices per bridge */
375#define BRIDGE_DEVIO0 0x00200000 /* Device IO 0 Addr */
376#define BRIDGE_DEVIO1 0x00400000 /* Device IO 1 Addr */
377#define BRIDGE_DEVIO2 0x00600000 /* Device IO 2 Addr */
378#define BRIDGE_DEVIO_OFF 0x00100000 /* Device IO Offset (3..7) */
379
380#define BRIDGE_DEVIO_2MB 0x00200000 /* Device IO Offset (0..1) */
381#define BRIDGE_DEVIO_1MB 0x00100000 /* Device IO Offset (2..7) */
382
383#define BRIDGE_DEVIO(x) ((x)<=1 ? BRIDGE_DEVIO0+(x)*BRIDGE_DEVIO_2MB : BRIDGE_DEVIO2+((x)-2)*BRIDGE_DEVIO_1MB)
384
385#define BRIDGE_EXTERNAL_FLASH 0x00C00000 /* External Flash PROMS */
386
387/* ========================================================================
388 * Bridge register bit field definitions
389 */
390
391/* Widget part number of bridge */
392#define BRIDGE_WIDGET_PART_NUM 0xc002
393#define XBRIDGE_WIDGET_PART_NUM 0xd002
394
395/* Manufacturer of bridge */
396#define BRIDGE_WIDGET_MFGR_NUM 0x036
397#define XBRIDGE_WIDGET_MFGR_NUM 0x024
398
399/* Revision numbers for known Bridge revisions */
400#define BRIDGE_REV_A 0x1
401#define BRIDGE_REV_B 0x2
402#define BRIDGE_REV_C 0x3
403#define BRIDGE_REV_D 0x4
404
405/* Bridge widget status register bits definition */
406
407#define BRIDGE_STAT_LLP_REC_CNT (0xFFu << 24)
408#define BRIDGE_STAT_LLP_TX_CNT (0xFF << 16)
409#define BRIDGE_STAT_FLASH_SELECT (0x1 << 6)
410#define BRIDGE_STAT_PCI_GIO_N (0x1 << 5)
411#define BRIDGE_STAT_PENDING (0x1F << 0)
412
413/* Bridge widget control register bits definition */
414#define BRIDGE_CTRL_FLASH_WR_EN (0x1ul << 31)
415#define BRIDGE_CTRL_EN_CLK50 (0x1 << 30)
416#define BRIDGE_CTRL_EN_CLK40 (0x1 << 29)
417#define BRIDGE_CTRL_EN_CLK33 (0x1 << 28)
418#define BRIDGE_CTRL_RST(n) ((n) << 24)
419#define BRIDGE_CTRL_RST_MASK (BRIDGE_CTRL_RST(0xF))
420#define BRIDGE_CTRL_RST_PIN(x) (BRIDGE_CTRL_RST(0x1 << (x)))
421#define BRIDGE_CTRL_IO_SWAP (0x1 << 23)
422#define BRIDGE_CTRL_MEM_SWAP (0x1 << 22)
423#define BRIDGE_CTRL_PAGE_SIZE (0x1 << 21)
424#define BRIDGE_CTRL_SS_PAR_BAD (0x1 << 20)
425#define BRIDGE_CTRL_SS_PAR_EN (0x1 << 19)
426#define BRIDGE_CTRL_SSRAM_SIZE(n) ((n) << 17)
427#define BRIDGE_CTRL_SSRAM_SIZE_MASK (BRIDGE_CTRL_SSRAM_SIZE(0x3))
428#define BRIDGE_CTRL_SSRAM_512K (BRIDGE_CTRL_SSRAM_SIZE(0x3))
429#define BRIDGE_CTRL_SSRAM_128K (BRIDGE_CTRL_SSRAM_SIZE(0x2))
430#define BRIDGE_CTRL_SSRAM_64K (BRIDGE_CTRL_SSRAM_SIZE(0x1))
431#define BRIDGE_CTRL_SSRAM_1K (BRIDGE_CTRL_SSRAM_SIZE(0x0))
432#define BRIDGE_CTRL_F_BAD_PKT (0x1 << 16)
433#define BRIDGE_CTRL_LLP_XBAR_CRD(n) ((n) << 12)
434#define BRIDGE_CTRL_LLP_XBAR_CRD_MASK (BRIDGE_CTRL_LLP_XBAR_CRD(0xf))
435#define BRIDGE_CTRL_CLR_RLLP_CNT (0x1 << 11)
436#define BRIDGE_CTRL_CLR_TLLP_CNT (0x1 << 10)
437#define BRIDGE_CTRL_SYS_END (0x1 << 9)
438#define BRIDGE_CTRL_MAX_TRANS(n) ((n) << 4)
439#define BRIDGE_CTRL_MAX_TRANS_MASK (BRIDGE_CTRL_MAX_TRANS(0x1f))
440#define BRIDGE_CTRL_WIDGET_ID(n) ((n) << 0)
441#define BRIDGE_CTRL_WIDGET_ID_MASK (BRIDGE_CTRL_WIDGET_ID(0xf))
442
443/* Bridge Response buffer Error Upper Register bit fields definition */
444#define BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT (20)
445#define BRIDGE_RESP_ERRUPPR_DEVNUM_MASK (0x7 << BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT)
446#define BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT (16)
447#define BRIDGE_RESP_ERRUPPR_BUFNUM_MASK (0xF << BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT)
448#define BRIDGE_RESP_ERRRUPPR_BUFMASK (0xFFFF)
449
450#define BRIDGE_RESP_ERRUPPR_BUFNUM(x) \
451 (((x) & BRIDGE_RESP_ERRUPPR_BUFNUM_MASK) >> \
452 BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT)
453
454#define BRIDGE_RESP_ERRUPPR_DEVICE(x) \
455 (((x) & BRIDGE_RESP_ERRUPPR_DEVNUM_MASK) >> \
456 BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT)
457
458/* Bridge direct mapping register bits definition */
459#define BRIDGE_DIRMAP_W_ID_SHFT 20
460#define BRIDGE_DIRMAP_W_ID (0xf << BRIDGE_DIRMAP_W_ID_SHFT)
461#define BRIDGE_DIRMAP_RMF_64 (0x1 << 18)
462#define BRIDGE_DIRMAP_ADD512 (0x1 << 17)
463#define BRIDGE_DIRMAP_OFF (0x1ffff << 0)
464#define BRIDGE_DIRMAP_OFF_ADDRSHFT (31) /* lsbit of DIRMAP_OFF is xtalk address bit 31 */
465
466/* Bridge Arbitration register bits definition */
467#define BRIDGE_ARB_REQ_WAIT_TICK(x) ((x) << 16)
468#define BRIDGE_ARB_REQ_WAIT_TICK_MASK BRIDGE_ARB_REQ_WAIT_TICK(0x3)
469#define BRIDGE_ARB_REQ_WAIT_EN(x) ((x) << 8)
470#define BRIDGE_ARB_REQ_WAIT_EN_MASK BRIDGE_ARB_REQ_WAIT_EN(0xff)
471#define BRIDGE_ARB_FREEZE_GNT (1 << 6)
472#define BRIDGE_ARB_HPRI_RING_B2 (1 << 5)
473#define BRIDGE_ARB_HPRI_RING_B1 (1 << 4)
474#define BRIDGE_ARB_HPRI_RING_B0 (1 << 3)
475#define BRIDGE_ARB_LPRI_RING_B2 (1 << 2)
476#define BRIDGE_ARB_LPRI_RING_B1 (1 << 1)
477#define BRIDGE_ARB_LPRI_RING_B0 (1 << 0)
478
479/* Bridge Bus time-out register bits definition */
480#define BRIDGE_BUS_PCI_RETRY_HLD(x) ((x) << 16)
481#define BRIDGE_BUS_PCI_RETRY_HLD_MASK BRIDGE_BUS_PCI_RETRY_HLD(0x1f)
482#define BRIDGE_BUS_GIO_TIMEOUT (1 << 12)
483#define BRIDGE_BUS_PCI_RETRY_CNT(x) ((x) << 0)
484#define BRIDGE_BUS_PCI_RETRY_MASK BRIDGE_BUS_PCI_RETRY_CNT(0x3ff)
485
486/* Bridge interrupt status register bits definition */
487#define BRIDGE_ISR_MULTI_ERR (0x1u << 31)
488#define BRIDGE_ISR_PMU_ESIZE_FAULT (0x1 << 30)
489#define BRIDGE_ISR_UNEXP_RESP (0x1 << 29)
490#define BRIDGE_ISR_BAD_XRESP_PKT (0x1 << 28)
491#define BRIDGE_ISR_BAD_XREQ_PKT (0x1 << 27)
492#define BRIDGE_ISR_RESP_XTLK_ERR (0x1 << 26)
493#define BRIDGE_ISR_REQ_XTLK_ERR (0x1 << 25)
494#define BRIDGE_ISR_INVLD_ADDR (0x1 << 24)
495#define BRIDGE_ISR_UNSUPPORTED_XOP (0x1 << 23)
496#define BRIDGE_ISR_XREQ_FIFO_OFLOW (0x1 << 22)
497#define BRIDGE_ISR_LLP_REC_SNERR (0x1 << 21)
498#define BRIDGE_ISR_LLP_REC_CBERR (0x1 << 20)
499#define BRIDGE_ISR_LLP_RCTY (0x1 << 19)
500#define BRIDGE_ISR_LLP_TX_RETRY (0x1 << 18)
501#define BRIDGE_ISR_LLP_TCTY (0x1 << 17)
502#define BRIDGE_ISR_SSRAM_PERR (0x1 << 16)
503#define BRIDGE_ISR_PCI_ABORT (0x1 << 15)
504#define BRIDGE_ISR_PCI_PARITY (0x1 << 14)
505#define BRIDGE_ISR_PCI_SERR (0x1 << 13)
506#define BRIDGE_ISR_PCI_PERR (0x1 << 12)
507#define BRIDGE_ISR_PCI_MST_TIMEOUT (0x1 << 11)
508#define BRIDGE_ISR_GIO_MST_TIMEOUT BRIDGE_ISR_PCI_MST_TIMEOUT
509#define BRIDGE_ISR_PCI_RETRY_CNT (0x1 << 10)
510#define BRIDGE_ISR_XREAD_REQ_TIMEOUT (0x1 << 9)
511#define BRIDGE_ISR_GIO_B_ENBL_ERR (0x1 << 8)
512#define BRIDGE_ISR_INT_MSK (0xff << 0)
513#define BRIDGE_ISR_INT(x) (0x1 << (x))
514
515#define BRIDGE_ISR_LINK_ERROR \
516 (BRIDGE_ISR_LLP_REC_SNERR|BRIDGE_ISR_LLP_REC_CBERR| \
517 BRIDGE_ISR_LLP_RCTY|BRIDGE_ISR_LLP_TX_RETRY| \
518 BRIDGE_ISR_LLP_TCTY)
519
520#define BRIDGE_ISR_PCIBUS_PIOERR \
521 (BRIDGE_ISR_PCI_MST_TIMEOUT|BRIDGE_ISR_PCI_ABORT)
522
523#define BRIDGE_ISR_PCIBUS_ERROR \
524 (BRIDGE_ISR_PCIBUS_PIOERR|BRIDGE_ISR_PCI_PERR| \
525 BRIDGE_ISR_PCI_SERR|BRIDGE_ISR_PCI_RETRY_CNT| \
526 BRIDGE_ISR_PCI_PARITY)
527
528#define BRIDGE_ISR_XTALK_ERROR \
529 (BRIDGE_ISR_XREAD_REQ_TIMEOUT|BRIDGE_ISR_XREQ_FIFO_OFLOW|\
530 BRIDGE_ISR_UNSUPPORTED_XOP|BRIDGE_ISR_INVLD_ADDR| \
531 BRIDGE_ISR_REQ_XTLK_ERR|BRIDGE_ISR_RESP_XTLK_ERR| \
532 BRIDGE_ISR_BAD_XREQ_PKT|BRIDGE_ISR_BAD_XRESP_PKT| \
533 BRIDGE_ISR_UNEXP_RESP)
534
535#define BRIDGE_ISR_ERRORS \
536 (BRIDGE_ISR_LINK_ERROR|BRIDGE_ISR_PCIBUS_ERROR| \
537 BRIDGE_ISR_XTALK_ERROR|BRIDGE_ISR_SSRAM_PERR| \
538 BRIDGE_ISR_PMU_ESIZE_FAULT)
539
540/*
541 * List of Errors which are fatal and kill the system
542 */
543#define BRIDGE_ISR_ERROR_FATAL \
544 ((BRIDGE_ISR_XTALK_ERROR & ~BRIDGE_ISR_XREAD_REQ_TIMEOUT)|\
545 BRIDGE_ISR_PCI_SERR|BRIDGE_ISR_PCI_PARITY )
546
547#define BRIDGE_ISR_ERROR_DUMP \
548 (BRIDGE_ISR_PCIBUS_ERROR|BRIDGE_ISR_PMU_ESIZE_FAULT| \
549 BRIDGE_ISR_XTALK_ERROR|BRIDGE_ISR_SSRAM_PERR)
550
551/* Bridge interrupt enable register bits definition */
552#define BRIDGE_IMR_UNEXP_RESP BRIDGE_ISR_UNEXP_RESP
553#define BRIDGE_IMR_PMU_ESIZE_FAULT BRIDGE_ISR_PMU_ESIZE_FAULT
554#define BRIDGE_IMR_BAD_XRESP_PKT BRIDGE_ISR_BAD_XRESP_PKT
555#define BRIDGE_IMR_BAD_XREQ_PKT BRIDGE_ISR_BAD_XREQ_PKT
556#define BRIDGE_IMR_RESP_XTLK_ERR BRIDGE_ISR_RESP_XTLK_ERR
557#define BRIDGE_IMR_REQ_XTLK_ERR BRIDGE_ISR_REQ_XTLK_ERR
558#define BRIDGE_IMR_INVLD_ADDR BRIDGE_ISR_INVLD_ADDR
559#define BRIDGE_IMR_UNSUPPORTED_XOP BRIDGE_ISR_UNSUPPORTED_XOP
560#define BRIDGE_IMR_XREQ_FIFO_OFLOW BRIDGE_ISR_XREQ_FIFO_OFLOW
561#define BRIDGE_IMR_LLP_REC_SNERR BRIDGE_ISR_LLP_REC_SNERR
562#define BRIDGE_IMR_LLP_REC_CBERR BRIDGE_ISR_LLP_REC_CBERR
563#define BRIDGE_IMR_LLP_RCTY BRIDGE_ISR_LLP_RCTY
564#define BRIDGE_IMR_LLP_TX_RETRY BRIDGE_ISR_LLP_TX_RETRY
565#define BRIDGE_IMR_LLP_TCTY BRIDGE_ISR_LLP_TCTY
566#define BRIDGE_IMR_SSRAM_PERR BRIDGE_ISR_SSRAM_PERR
567#define BRIDGE_IMR_PCI_ABORT BRIDGE_ISR_PCI_ABORT
568#define BRIDGE_IMR_PCI_PARITY BRIDGE_ISR_PCI_PARITY
569#define BRIDGE_IMR_PCI_SERR BRIDGE_ISR_PCI_SERR
570#define BRIDGE_IMR_PCI_PERR BRIDGE_ISR_PCI_PERR
571#define BRIDGE_IMR_PCI_MST_TIMEOUT BRIDGE_ISR_PCI_MST_TIMEOUT
572#define BRIDGE_IMR_GIO_MST_TIMEOUT BRIDGE_ISR_GIO_MST_TIMEOUT
573#define BRIDGE_IMR_PCI_RETRY_CNT BRIDGE_ISR_PCI_RETRY_CNT
574#define BRIDGE_IMR_XREAD_REQ_TIMEOUT BRIDGE_ISR_XREAD_REQ_TIMEOUT
575#define BRIDGE_IMR_GIO_B_ENBL_ERR BRIDGE_ISR_GIO_B_ENBL_ERR
576#define BRIDGE_IMR_INT_MSK BRIDGE_ISR_INT_MSK
577#define BRIDGE_IMR_INT(x) BRIDGE_ISR_INT(x)
578
579/* Bridge interrupt reset register bits definition */
580#define BRIDGE_IRR_MULTI_CLR (0x1 << 6)
581#define BRIDGE_IRR_CRP_GRP_CLR (0x1 << 5)
582#define BRIDGE_IRR_RESP_BUF_GRP_CLR (0x1 << 4)
583#define BRIDGE_IRR_REQ_DSP_GRP_CLR (0x1 << 3)
584#define BRIDGE_IRR_LLP_GRP_CLR (0x1 << 2)
585#define BRIDGE_IRR_SSRAM_GRP_CLR (0x1 << 1)
586#define BRIDGE_IRR_PCI_GRP_CLR (0x1 << 0)
587#define BRIDGE_IRR_GIO_GRP_CLR (0x1 << 0)
588#define BRIDGE_IRR_ALL_CLR 0x7f
589
590#define BRIDGE_IRR_CRP_GRP (BRIDGE_ISR_UNEXP_RESP | \
591 BRIDGE_ISR_XREQ_FIFO_OFLOW)
592#define BRIDGE_IRR_RESP_BUF_GRP (BRIDGE_ISR_BAD_XRESP_PKT | \
593 BRIDGE_ISR_RESP_XTLK_ERR | \
594 BRIDGE_ISR_XREAD_REQ_TIMEOUT)
595#define BRIDGE_IRR_REQ_DSP_GRP (BRIDGE_ISR_UNSUPPORTED_XOP | \
596 BRIDGE_ISR_BAD_XREQ_PKT | \
597 BRIDGE_ISR_REQ_XTLK_ERR | \
598 BRIDGE_ISR_INVLD_ADDR)
599#define BRIDGE_IRR_LLP_GRP (BRIDGE_ISR_LLP_REC_SNERR | \
600 BRIDGE_ISR_LLP_REC_CBERR | \
601 BRIDGE_ISR_LLP_RCTY | \
602 BRIDGE_ISR_LLP_TX_RETRY | \
603 BRIDGE_ISR_LLP_TCTY)
604#define BRIDGE_IRR_SSRAM_GRP (BRIDGE_ISR_SSRAM_PERR | \
605 BRIDGE_ISR_PMU_ESIZE_FAULT)
606#define BRIDGE_IRR_PCI_GRP (BRIDGE_ISR_PCI_ABORT | \
607 BRIDGE_ISR_PCI_PARITY | \
608 BRIDGE_ISR_PCI_SERR | \
609 BRIDGE_ISR_PCI_PERR | \
610 BRIDGE_ISR_PCI_MST_TIMEOUT | \
611 BRIDGE_ISR_PCI_RETRY_CNT)
612
613#define BRIDGE_IRR_GIO_GRP (BRIDGE_ISR_GIO_B_ENBL_ERR | \
614 BRIDGE_ISR_GIO_MST_TIMEOUT)
615
616/* Bridge INT_DEV register bits definition */
617#define BRIDGE_INT_DEV_SHFT(n) ((n)*3)
618#define BRIDGE_INT_DEV_MASK(n) (0x7 << BRIDGE_INT_DEV_SHFT(n))
619#define BRIDGE_INT_DEV_SET(_dev, _line) (_dev << BRIDGE_INT_DEV_SHFT(_line))
620
621/* Bridge interrupt(x) register bits definition */
622#define BRIDGE_INT_ADDR_HOST 0x0003FF00
623#define BRIDGE_INT_ADDR_FLD 0x000000FF
624
625#define BRIDGE_TMO_PCI_RETRY_HLD_MASK 0x1f0000
626#define BRIDGE_TMO_GIO_TIMEOUT_MASK 0x001000
627#define BRIDGE_TMO_PCI_RETRY_CNT_MASK 0x0003ff
628
629#define BRIDGE_TMO_PCI_RETRY_CNT_MAX 0x3ff
630
631/*
632 * The NASID should be shifted by this amount and stored into the
633 * interrupt(x) register.
634 */
635#define BRIDGE_INT_ADDR_NASID_SHFT 8
636
637/*
638 * The BRIDGE_INT_ADDR_DEST_IO bit should be set to send an interrupt to
639 * memory.
640 */
641#define BRIDGE_INT_ADDR_DEST_IO (1 << 17)
642#define BRIDGE_INT_ADDR_DEST_MEM 0
643#define BRIDGE_INT_ADDR_MASK (1 << 17)
644
645/* Bridge device(x) register bits definition */
646#define BRIDGE_DEV_ERR_LOCK_EN 0x10000000
647#define BRIDGE_DEV_PAGE_CHK_DIS 0x08000000
648#define BRIDGE_DEV_FORCE_PCI_PAR 0x04000000
649#define BRIDGE_DEV_VIRTUAL_EN 0x02000000
650#define BRIDGE_DEV_PMU_WRGA_EN 0x01000000
651#define BRIDGE_DEV_DIR_WRGA_EN 0x00800000
652#define BRIDGE_DEV_DEV_SIZE 0x00400000
653#define BRIDGE_DEV_RT 0x00200000
654#define BRIDGE_DEV_SWAP_PMU 0x00100000
655#define BRIDGE_DEV_SWAP_DIR 0x00080000
656#define BRIDGE_DEV_PREF 0x00040000
657#define BRIDGE_DEV_PRECISE 0x00020000
658#define BRIDGE_DEV_COH 0x00010000
659#define BRIDGE_DEV_BARRIER 0x00008000
660#define BRIDGE_DEV_GBR 0x00004000
661#define BRIDGE_DEV_DEV_SWAP 0x00002000
662#define BRIDGE_DEV_DEV_IO_MEM 0x00001000
663#define BRIDGE_DEV_OFF_MASK 0x00000fff
664#define BRIDGE_DEV_OFF_ADDR_SHFT 20
665
666#define BRIDGE_DEV_PMU_BITS (BRIDGE_DEV_PMU_WRGA_EN | \
667 BRIDGE_DEV_SWAP_PMU)
668#define BRIDGE_DEV_D32_BITS (BRIDGE_DEV_DIR_WRGA_EN | \
669 BRIDGE_DEV_SWAP_DIR | \
670 BRIDGE_DEV_PREF | \
671 BRIDGE_DEV_PRECISE | \
672 BRIDGE_DEV_COH | \
673 BRIDGE_DEV_BARRIER)
674#define BRIDGE_DEV_D64_BITS (BRIDGE_DEV_DIR_WRGA_EN | \
675 BRIDGE_DEV_SWAP_DIR | \
676 BRIDGE_DEV_COH | \
677 BRIDGE_DEV_BARRIER)
678
679/* Bridge Error Upper register bit field definition */
680#define BRIDGE_ERRUPPR_DEVMASTER (0x1 << 20) /* Device was master */
681#define BRIDGE_ERRUPPR_PCIVDEV (0x1 << 19) /* Virtual Req value */
682#define BRIDGE_ERRUPPR_DEVNUM_SHFT (16)
683#define BRIDGE_ERRUPPR_DEVNUM_MASK (0x7 << BRIDGE_ERRUPPR_DEVNUM_SHFT)
684#define BRIDGE_ERRUPPR_DEVICE(err) (((err) >> BRIDGE_ERRUPPR_DEVNUM_SHFT) & 0x7)
685#define BRIDGE_ERRUPPR_ADDRMASK (0xFFFF)
686
687/* Bridge interrupt mode register bits definition */
688#define BRIDGE_INTMODE_CLR_PKT_EN(x) (0x1 << (x))
689
690/* this should be written to the xbow's link_control(x) register */
691#define BRIDGE_CREDIT 3
692
693/* RRB assignment register */
694#define BRIDGE_RRB_EN 0x8 /* after shifting down */
695#define BRIDGE_RRB_DEV 0x7 /* after shifting down */
696#define BRIDGE_RRB_VDEV 0x4 /* after shifting down */
697#define BRIDGE_RRB_PDEV 0x3 /* after shifting down */
698
699/* RRB status register */
700#define BRIDGE_RRB_VALID(r) (0x00010000<<(r))
701#define BRIDGE_RRB_INUSE(r) (0x00000001<<(r))
702
703/* RRB clear register */
704#define BRIDGE_RRB_CLEAR(r) (0x00000001<<(r))
705
706/* xbox system controller declarations */
707#define XBOX_BRIDGE_WID 8
708#define FLASH_PROM1_BASE 0xE00000 /* To read the xbox sysctlr status */
709#define XBOX_RPS_EXISTS 1 << 6 /* RPS bit in status register */
710#define XBOX_RPS_FAIL 1 << 4 /* RPS status bit in register */
711
712/* ========================================================================
713 */
714/*
715 * Macros for Xtalk to Bridge bus (PCI/GIO) PIO
716 * refer to section 4.2.1 of Bridge Spec for xtalk to PCI/GIO PIO mappings
717 */
718/* XTALK addresses that map into Bridge Bus addr space */
719#define BRIDGE_PIO32_XTALK_ALIAS_BASE 0x000040000000L
720#define BRIDGE_PIO32_XTALK_ALIAS_LIMIT 0x00007FFFFFFFL
721#define BRIDGE_PIO64_XTALK_ALIAS_BASE 0x000080000000L
722#define BRIDGE_PIO64_XTALK_ALIAS_LIMIT 0x0000BFFFFFFFL
723#define BRIDGE_PCIIO_XTALK_ALIAS_BASE 0x000100000000L
724#define BRIDGE_PCIIO_XTALK_ALIAS_LIMIT 0x0001FFFFFFFFL
725
726/* Ranges of PCI bus space that can be accessed via PIO from xtalk */
727#define BRIDGE_MIN_PIO_ADDR_MEM 0x00000000 /* 1G PCI memory space */
728#define BRIDGE_MAX_PIO_ADDR_MEM 0x3fffffff
729#define BRIDGE_MIN_PIO_ADDR_IO 0x00000000 /* 4G PCI IO space */
730#define BRIDGE_MAX_PIO_ADDR_IO 0xffffffff
731
732/* XTALK addresses that map into PCI addresses */
733#define BRIDGE_PCI_MEM32_BASE BRIDGE_PIO32_XTALK_ALIAS_BASE
734#define BRIDGE_PCI_MEM32_LIMIT BRIDGE_PIO32_XTALK_ALIAS_LIMIT
735#define BRIDGE_PCI_MEM64_BASE BRIDGE_PIO64_XTALK_ALIAS_BASE
736#define BRIDGE_PCI_MEM64_LIMIT BRIDGE_PIO64_XTALK_ALIAS_LIMIT
737#define BRIDGE_PCI_IO_BASE BRIDGE_PCIIO_XTALK_ALIAS_BASE
738#define BRIDGE_PCI_IO_LIMIT BRIDGE_PCIIO_XTALK_ALIAS_LIMIT
739
740/*
741 * Macros for Bridge bus (PCI/GIO) to Xtalk DMA
742 */
743/* Bridge Bus DMA addresses */
744#define BRIDGE_LOCAL_BASE 0
745#define BRIDGE_DMA_MAPPED_BASE 0x40000000
746#define BRIDGE_DMA_MAPPED_SIZE 0x40000000 /* 1G Bytes */
747#define BRIDGE_DMA_DIRECT_BASE 0x80000000
748#define BRIDGE_DMA_DIRECT_SIZE 0x80000000 /* 2G Bytes */
749
750#define PCI32_LOCAL_BASE BRIDGE_LOCAL_BASE
751
752/* PCI addresses of regions decoded by Bridge for DMA */
753#define PCI32_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE
754#define PCI32_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE
755
756#define IS_PCI32_LOCAL(x) ((ulong_t)(x) < PCI32_MAPPED_BASE)
757#define IS_PCI32_MAPPED(x) ((ulong_t)(x) < PCI32_DIRECT_BASE && \
758 (ulong_t)(x) >= PCI32_MAPPED_BASE)
759#define IS_PCI32_DIRECT(x) ((ulong_t)(x) >= PCI32_MAPPED_BASE)
760#define IS_PCI64(x) ((ulong_t)(x) >= PCI64_BASE)
761
762/*
763 * The GIO address space.
764 */
765/* Xtalk to GIO PIO */
766#define BRIDGE_GIO_MEM32_BASE BRIDGE_PIO32_XTALK_ALIAS_BASE
767#define BRIDGE_GIO_MEM32_LIMIT BRIDGE_PIO32_XTALK_ALIAS_LIMIT
768
769#define GIO_LOCAL_BASE BRIDGE_LOCAL_BASE
770
771/* GIO addresses of regions decoded by Bridge for DMA */
772#define GIO_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE
773#define GIO_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE
774
775#define IS_GIO_LOCAL(x) ((ulong_t)(x) < GIO_MAPPED_BASE)
776#define IS_GIO_MAPPED(x) ((ulong_t)(x) < GIO_DIRECT_BASE && \
777 (ulong_t)(x) >= GIO_MAPPED_BASE)
778#define IS_GIO_DIRECT(x) ((ulong_t)(x) >= GIO_MAPPED_BASE)
779
780/* PCI to xtalk mapping */
781
782/* given a DIR_OFF value and a pci/gio 32 bits direct address, determine
783 * which xtalk address is accessed
784 */
785#define BRIDGE_DIRECT_32_SEG_SIZE BRIDGE_DMA_DIRECT_SIZE
786#define BRIDGE_DIRECT_32_TO_XTALK(dir_off,adr) \
787 ((dir_off) * BRIDGE_DIRECT_32_SEG_SIZE + \
788 ((adr) & (BRIDGE_DIRECT_32_SEG_SIZE - 1)) + PHYS_RAMBASE)
789
790/* 64-bit address attribute masks */
791#define PCI64_ATTR_TARG_MASK 0xf000000000000000
792#define PCI64_ATTR_TARG_SHFT 60
793#define PCI64_ATTR_PREF 0x0800000000000000
794#define PCI64_ATTR_PREC 0x0400000000000000
795#define PCI64_ATTR_VIRTUAL 0x0200000000000000
796#define PCI64_ATTR_BAR 0x0100000000000000
797#define PCI64_ATTR_RMF_MASK 0x00ff000000000000
798#define PCI64_ATTR_RMF_SHFT 48
799
800#ifndef __ASSEMBLY__
801/* Address translation entry for mapped pci32 accesses */
802typedef union ate_u {
803 u64 ent;
804 struct ate_s {
805 u64 rmf:16;
806 u64 addr:36;
807 u64 targ:4;
808 u64 reserved:3;
809 u64 barrier:1;
810 u64 prefetch:1;
811 u64 precise:1;
812 u64 coherent:1;
813 u64 valid:1;
814 } field;
815} ate_t;
816#endif /* !__ASSEMBLY__ */
817
818#define ATE_V 0x01
819#define ATE_CO 0x02
820#define ATE_PREC 0x04
821#define ATE_PREF 0x08
822#define ATE_BAR 0x10
823
824#define ATE_PFNSHIFT 12
825#define ATE_TIDSHIFT 8
826#define ATE_RMFSHIFT 48
827
828#define mkate(xaddr, xid, attr) ((xaddr) & 0x0000fffffffff000ULL) | \
829 ((xid)<<ATE_TIDSHIFT) | \
830 (attr)
831
832#define BRIDGE_INTERNAL_ATES 128
833
834struct bridge_controller {
835 struct pci_controller pc;
836 struct resource mem;
837 struct resource io;
838 bridge_t *base;
839 nasid_t nasid;
840 unsigned int widget_id;
841 unsigned int irq_cpu;
842 dma64_addr_t baddr;
843 unsigned int pci_int[8];
844};
845
846#define BRIDGE_CONTROLLER(bus) \
847 ((struct bridge_controller *)((bus)->sysdata))
848
849extern void register_bridge_irq(unsigned int irq);
850extern int request_bridge_irq(struct bridge_controller *bc);
851
852extern struct pci_ops bridge_pci_ops;
853
854#endif /* _ASM_PCI_BRIDGE_H */
diff --git a/include/asm-mips/percpu.h b/include/asm-mips/percpu.h
deleted file mode 100644
index 844e763e9332..000000000000
--- a/include/asm-mips/percpu.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_PERCPU_H
2#define __ASM_PERCPU_H
3
4#include <asm-generic/percpu.h>
5
6#endif /* __ASM_PERCPU_H */
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
deleted file mode 100644
index 1275831dda29..000000000000
--- a/include/asm-mips/pgalloc.h
+++ /dev/null
@@ -1,143 +0,0 @@
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 * Copyright (C) 1994 - 2001, 2003 by Ralf Baechle
7 * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_PGALLOC_H
10#define _ASM_PGALLOC_H
11
12#include <linux/highmem.h>
13#include <linux/mm.h>
14#include <linux/sched.h>
15
16static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
17 pte_t *pte)
18{
19 set_pmd(pmd, __pmd((unsigned long)pte));
20}
21
22static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
23 pgtable_t pte)
24{
25 set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
26}
27#define pmd_pgtable(pmd) pmd_page(pmd)
28
29/*
30 * Initialize a new pmd table with invalid pointers.
31 */
32extern void pmd_init(unsigned long page, unsigned long pagetable);
33
34#ifdef CONFIG_64BIT
35
36static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
37{
38 set_pud(pud, __pud((unsigned long)pmd));
39}
40#endif
41
42/*
43 * Initialize a new pgd / pmd table with invalid pointers.
44 */
45extern void pgd_init(unsigned long page);
46
47static inline pgd_t *pgd_alloc(struct mm_struct *mm)
48{
49 pgd_t *ret, *init;
50
51 ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
52 if (ret) {
53 init = pgd_offset(&init_mm, 0UL);
54 pgd_init((unsigned long)ret);
55 memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
56 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
57 }
58
59 return ret;
60}
61
62static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
63{
64 free_pages((unsigned long)pgd, PGD_ORDER);
65}
66
67static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
68 unsigned long address)
69{
70 pte_t *pte;
71
72 pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, PTE_ORDER);
73
74 return pte;
75}
76
77static inline struct page *pte_alloc_one(struct mm_struct *mm,
78 unsigned long address)
79{
80 struct page *pte;
81
82 pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER);
83 if (pte) {
84 clear_highpage(pte);
85 pgtable_page_ctor(pte);
86 }
87 return pte;
88}
89
90static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
91{
92 free_pages((unsigned long)pte, PTE_ORDER);
93}
94
95static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
96{
97 pgtable_page_dtor(pte);
98 __free_pages(pte, PTE_ORDER);
99}
100
101#define __pte_free_tlb(tlb,pte) \
102do { \
103 pgtable_page_dtor(pte); \
104 tlb_remove_page((tlb), pte); \
105} while (0)
106
107#ifdef CONFIG_32BIT
108
109/*
110 * allocating and freeing a pmd is trivial: the 1-entry pmd is
111 * inside the pgd, so has no extra memory associated with it.
112 */
113#define pmd_free(mm, x) do { } while (0)
114#define __pmd_free_tlb(tlb, x) do { } while (0)
115
116#endif
117
118#ifdef CONFIG_64BIT
119
120static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
121{
122 pmd_t *pmd;
123
124 pmd = (pmd_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, PMD_ORDER);
125 if (pmd)
126 pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table);
127 return pmd;
128}
129
130static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
131{
132 free_pages((unsigned long)pmd, PMD_ORDER);
133}
134
135#define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x)
136
137#endif
138
139#define check_pgt_cache() do { } while (0)
140
141extern void pagetable_init(void);
142
143#endif /* _ASM_PGALLOC_H */
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
deleted file mode 100644
index 4396e9ffd418..000000000000
--- a/include/asm-mips/pgtable-32.h
+++ /dev/null
@@ -1,234 +0,0 @@
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 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 2003 Ralf Baechle
7 * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_PGTABLE_32_H
10#define _ASM_PGTABLE_32_H
11
12#include <asm/addrspace.h>
13#include <asm/page.h>
14
15#include <linux/linkage.h>
16#include <asm/cachectl.h>
17#include <asm/fixmap.h>
18
19#include <asm-generic/pgtable-nopmd.h>
20
21/*
22 * - add_wired_entry() add a fixed TLB entry, and move wired register
23 */
24extern void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
25 unsigned long entryhi, unsigned long pagemask);
26
27/*
28 * - add_temporary_entry() add a temporary TLB entry. We use TLB entries
29 * starting at the top and working down. This is for populating the
30 * TLB before trap_init() puts the TLB miss handler in place. It
31 * should be used only for entries matching the actual page tables,
32 * to prevent inconsistencies.
33 */
34extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
35 unsigned long entryhi, unsigned long pagemask);
36
37
38/* Basically we have the same two-level (which is the logical three level
39 * Linux page table layout folded) page tables as the i386. Some day
40 * when we have proper page coloring support we can have a 1% quicker
41 * tlb refill handling mechanism, but for now it is a bit slower but
42 * works even with the cache aliasing problem the R4k and above have.
43 */
44
45/* PGDIR_SHIFT determines what a third-level page table entry can map */
46#define PGDIR_SHIFT (2 * PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2)
47#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
48#define PGDIR_MASK (~(PGDIR_SIZE-1))
49
50/*
51 * Entries per page directory level: we use two-level, so
52 * we don't really have any PUD/PMD directory physically.
53 */
54#define __PGD_ORDER (32 - 3 * PAGE_SHIFT + PGD_T_LOG2 + PTE_T_LOG2)
55#define PGD_ORDER (__PGD_ORDER >= 0 ? __PGD_ORDER : 0)
56#define PUD_ORDER aieeee_attempt_to_allocate_pud
57#define PMD_ORDER 1
58#define PTE_ORDER 0
59
60#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
61#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
62
63#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)
64#define FIRST_USER_ADDRESS 0
65
66#define VMALLOC_START MAP_BASE
67
68#define PKMAP_BASE (0xfe000000UL)
69
70#ifdef CONFIG_HIGHMEM
71# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
72#else
73# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
74#endif
75
76#ifdef CONFIG_64BIT_PHYS_ADDR
77#define pte_ERROR(e) \
78 printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e))
79#else
80#define pte_ERROR(e) \
81 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
82#endif
83#define pgd_ERROR(e) \
84 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
85
86extern void load_pgd(unsigned long pg_dir);
87
88extern pte_t invalid_pte_table[PAGE_SIZE/sizeof(pte_t)];
89
90/*
91 * Empty pgd/pmd entries point to the invalid_pte_table.
92 */
93static inline int pmd_none(pmd_t pmd)
94{
95 return pmd_val(pmd) == (unsigned long) invalid_pte_table;
96}
97
98#define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK)
99
100static inline int pmd_present(pmd_t pmd)
101{
102 return pmd_val(pmd) != (unsigned long) invalid_pte_table;
103}
104
105static inline void pmd_clear(pmd_t *pmdp)
106{
107 pmd_val(*pmdp) = ((unsigned long) invalid_pte_table);
108}
109
110#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
111#define pte_page(x) pfn_to_page(pte_pfn(x))
112#define pte_pfn(x) ((unsigned long)((x).pte_high >> 6))
113static inline pte_t
114pfn_pte(unsigned long pfn, pgprot_t prot)
115{
116 pte_t pte;
117 pte.pte_high = (pfn << 6) | (pgprot_val(prot) & 0x3f);
118 pte.pte_low = pgprot_val(prot);
119 return pte;
120}
121
122#else
123
124#define pte_page(x) pfn_to_page(pte_pfn(x))
125
126#ifdef CONFIG_CPU_VR41XX
127#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
128#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
129#else
130#define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT))
131#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
132#endif
133#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */
134
135#define __pgd_offset(address) pgd_index(address)
136#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
137#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
138
139/* to find an entry in a kernel page-table-directory */
140#define pgd_offset_k(address) pgd_offset(&init_mm, address)
141
142#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
143
144/* to find an entry in a page-table-directory */
145#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
146
147/* Find an entry in the third-level page table.. */
148#define __pte_offset(address) \
149 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
150#define pte_offset(dir, address) \
151 ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
152#define pte_offset_kernel(dir, address) \
153 ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
154
155#define pte_offset_map(dir, address) \
156 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
157#define pte_offset_map_nested(dir, address) \
158 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
159#define pte_unmap(pte) ((void)(pte))
160#define pte_unmap_nested(pte) ((void)(pte))
161
162#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
163
164/* Swap entries must have VALID bit cleared. */
165#define __swp_type(x) (((x).val >> 10) & 0x1f)
166#define __swp_offset(x) ((x).val >> 15)
167#define __swp_entry(type,offset) \
168 ((swp_entry_t) { ((type) << 10) | ((offset) << 15) })
169
170/*
171 * Bits 0, 4, 8, and 9 are taken, split up 28 bits of offset into this range:
172 */
173#define PTE_FILE_MAX_BITS 28
174
175#define pte_to_pgoff(_pte) ((((_pte).pte >> 1 ) & 0x07) | \
176 (((_pte).pte >> 2 ) & 0x38) | \
177 (((_pte).pte >> 10) << 6 ))
178
179#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x07) << 1 ) | \
180 (((off) & 0x38) << 2 ) | \
181 (((off) >> 6 ) << 10) | \
182 _PAGE_FILE })
183
184#else
185
186/* Swap entries must have VALID and GLOBAL bits cleared. */
187#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
188#define __swp_type(x) (((x).val >> 2) & 0x1f)
189#define __swp_offset(x) ((x).val >> 7)
190#define __swp_entry(type,offset) \
191 ((swp_entry_t) { ((type) << 2) | ((offset) << 7) })
192#else
193#define __swp_type(x) (((x).val >> 8) & 0x1f)
194#define __swp_offset(x) ((x).val >> 13)
195#define __swp_entry(type,offset) \
196 ((swp_entry_t) { ((type) << 8) | ((offset) << 13) })
197#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */
198
199#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
200/*
201 * Bits 0 and 1 of pte_high are taken, use the rest for the page offset...
202 */
203#define PTE_FILE_MAX_BITS 30
204
205#define pte_to_pgoff(_pte) ((_pte).pte_high >> 2)
206#define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) << 2 })
207
208#else
209/*
210 * Bits 0, 4, 6, and 7 are taken, split up 28 bits of offset into this range:
211 */
212#define PTE_FILE_MAX_BITS 28
213
214#define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) | \
215 (((_pte).pte >> 2) & 0x8) | \
216 (((_pte).pte >> 8) << 4))
217
218#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) | \
219 (((off) & 0x8) << 2) | \
220 (((off) >> 4) << 8) | \
221 _PAGE_FILE })
222#endif
223
224#endif
225
226#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
227#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high })
228#define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val })
229#else
230#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
231#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
232#endif
233
234#endif /* _ASM_PGTABLE_32_H */
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
deleted file mode 100644
index 943515f0ef87..000000000000
--- a/include/asm-mips/pgtable-64.h
+++ /dev/null
@@ -1,253 +0,0 @@
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 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 2003 Ralf Baechle
7 * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_PGTABLE_64_H
10#define _ASM_PGTABLE_64_H
11
12#include <linux/linkage.h>
13
14#include <asm/addrspace.h>
15#include <asm/page.h>
16#include <asm/cachectl.h>
17#include <asm/fixmap.h>
18
19#include <asm-generic/pgtable-nopud.h>
20
21/*
22 * Each address space has 2 4K pages as its page directory, giving 1024
23 * (== PTRS_PER_PGD) 8 byte pointers to pmd tables. Each pmd table is a
24 * single 4K page, giving 512 (== PTRS_PER_PMD) 8 byte pointers to page
25 * tables. Each page table is also a single 4K page, giving 512 (==
26 * PTRS_PER_PTE) 8 byte ptes. Each pud entry is initialized to point to
27 * invalid_pmd_table, each pmd entry is initialized to point to
28 * invalid_pte_table, each pte is initialized to 0. When memory is low,
29 * and a pmd table or a page table allocation fails, empty_bad_pmd_table
30 * and empty_bad_page_table is returned back to higher layer code, so
31 * that the failure is recognized later on. Linux does not seem to
32 * handle these failures very well though. The empty_bad_page_table has
33 * invalid pte entries in it, to force page faults.
34 *
35 * Kernel mappings: kernel mappings are held in the swapper_pg_table.
36 * The layout is identical to userspace except it's indexed with the
37 * fault address - VMALLOC_START.
38 */
39
40/* PMD_SHIFT determines the size of the area a second-level page table can map */
41#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))
42#define PMD_SIZE (1UL << PMD_SHIFT)
43#define PMD_MASK (~(PMD_SIZE-1))
44
45/* PGDIR_SHIFT determines what a third-level page table entry can map */
46#define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3))
47#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
48#define PGDIR_MASK (~(PGDIR_SIZE-1))
49
50/*
51 * For 4kB page size we use a 3 level page tree and an 8kB pud, which
52 * permits us mapping 40 bits of virtual address space.
53 *
54 * We used to implement 41 bits by having an order 1 pmd level but that seemed
55 * rather pointless.
56 *
57 * For 8kB page size we use a 3 level page tree which permits a total of
58 * 8TB of address space. Alternatively a 33-bit / 8GB organization using
59 * two levels would be easy to implement.
60 *
61 * For 16kB page size we use a 2 level page tree which permits a total of
62 * 36 bits of virtual address space. We could add a third level but it seems
63 * like at the moment there's no need for this.
64 *
65 * For 64kB page size we use a 2 level page table tree for a total of 42 bits
66 * of virtual address space.
67 */
68#ifdef CONFIG_PAGE_SIZE_4KB
69#define PGD_ORDER 1
70#define PUD_ORDER aieeee_attempt_to_allocate_pud
71#define PMD_ORDER 0
72#define PTE_ORDER 0
73#endif
74#ifdef CONFIG_PAGE_SIZE_8KB
75#define PGD_ORDER 0
76#define PUD_ORDER aieeee_attempt_to_allocate_pud
77#define PMD_ORDER 0
78#define PTE_ORDER 0
79#endif
80#ifdef CONFIG_PAGE_SIZE_16KB
81#define PGD_ORDER 0
82#define PUD_ORDER aieeee_attempt_to_allocate_pud
83#define PMD_ORDER 0
84#define PTE_ORDER 0
85#endif
86#ifdef CONFIG_PAGE_SIZE_64KB
87#define PGD_ORDER 0
88#define PUD_ORDER aieeee_attempt_to_allocate_pud
89#define PMD_ORDER 0
90#define PTE_ORDER 0
91#endif
92
93#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
94#define PTRS_PER_PMD ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t))
95#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
96
97#if PGDIR_SIZE >= TASK_SIZE
98#define USER_PTRS_PER_PGD (1)
99#else
100#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
101#endif
102#define FIRST_USER_ADDRESS 0UL
103
104#define VMALLOC_START MAP_BASE
105#define VMALLOC_END \
106 (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE)
107#if defined(CONFIG_MODULES) && defined(KBUILD_64BIT_SYM32) && \
108 VMALLOC_START != CKSSEG
109/* Load modules into 32bit-compatible segment. */
110#define MODULE_START CKSSEG
111#define MODULE_END (FIXADDR_START-2*PAGE_SIZE)
112extern pgd_t module_pg_dir[PTRS_PER_PGD];
113#endif
114
115#define pte_ERROR(e) \
116 printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
117#define pmd_ERROR(e) \
118 printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
119#define pgd_ERROR(e) \
120 printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
121
122extern pte_t invalid_pte_table[PTRS_PER_PTE];
123extern pte_t empty_bad_page_table[PTRS_PER_PTE];
124extern pmd_t invalid_pmd_table[PTRS_PER_PMD];
125extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD];
126
127/*
128 * Empty pgd/pmd entries point to the invalid_pte_table.
129 */
130static inline int pmd_none(pmd_t pmd)
131{
132 return pmd_val(pmd) == (unsigned long) invalid_pte_table;
133}
134
135#define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK)
136
137static inline int pmd_present(pmd_t pmd)
138{
139 return pmd_val(pmd) != (unsigned long) invalid_pte_table;
140}
141
142static inline void pmd_clear(pmd_t *pmdp)
143{
144 pmd_val(*pmdp) = ((unsigned long) invalid_pte_table);
145}
146
147/*
148 * Empty pud entries point to the invalid_pmd_table.
149 */
150static inline int pud_none(pud_t pud)
151{
152 return pud_val(pud) == (unsigned long) invalid_pmd_table;
153}
154
155static inline int pud_bad(pud_t pud)
156{
157 return pud_val(pud) & ~PAGE_MASK;
158}
159
160static inline int pud_present(pud_t pud)
161{
162 return pud_val(pud) != (unsigned long) invalid_pmd_table;
163}
164
165static inline void pud_clear(pud_t *pudp)
166{
167 pud_val(*pudp) = ((unsigned long) invalid_pmd_table);
168}
169
170#define pte_page(x) pfn_to_page(pte_pfn(x))
171
172#ifdef CONFIG_CPU_VR41XX
173#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
174#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
175#else
176#define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT))
177#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
178#endif
179
180#define __pgd_offset(address) pgd_index(address)
181#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
182#define __pmd_offset(address) pmd_index(address)
183
184/* to find an entry in a kernel page-table-directory */
185#ifdef MODULE_START
186#define pgd_offset_k(address) \
187 ((address) >= MODULE_START ? module_pg_dir : pgd_offset(&init_mm, 0UL))
188#else
189#define pgd_offset_k(address) pgd_offset(&init_mm, 0UL)
190#endif
191
192#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
193#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
194
195/* to find an entry in a page-table-directory */
196#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
197
198static inline unsigned long pud_page_vaddr(pud_t pud)
199{
200 return pud_val(pud);
201}
202#define pud_phys(pud) virt_to_phys((void *)pud_val(pud))
203#define pud_page(pud) (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT))
204
205/* Find an entry in the second-level page table.. */
206static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address)
207{
208 return (pmd_t *) pud_page_vaddr(*pud) + pmd_index(address);
209}
210
211/* Find an entry in the third-level page table.. */
212#define __pte_offset(address) \
213 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
214#define pte_offset(dir, address) \
215 ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
216#define pte_offset_kernel(dir, address) \
217 ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
218#define pte_offset_map(dir, address) \
219 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
220#define pte_offset_map_nested(dir, address) \
221 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
222#define pte_unmap(pte) ((void)(pte))
223#define pte_unmap_nested(pte) ((void)(pte))
224
225/*
226 * Initialize a new pgd / pmd table with invalid pointers.
227 */
228extern void pgd_init(unsigned long page);
229extern void pmd_init(unsigned long page, unsigned long pagetable);
230
231/*
232 * Non-present pages: high 24 bits are offset, next 8 bits type,
233 * low 32 bits zero.
234 */
235static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
236{ pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; }
237
238#define __swp_type(x) (((x).val >> 32) & 0xff)
239#define __swp_offset(x) ((x).val >> 40)
240#define __swp_entry(type, offset) ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) })
241#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
242#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
243
244/*
245 * Bits 0, 4, 6, and 7 are taken. Let's leave bits 1, 2, 3, and 5 alone to
246 * make things easier, and only use the upper 56 bits for the page offset...
247 */
248#define PTE_FILE_MAX_BITS 56
249
250#define pte_to_pgoff(_pte) ((_pte).pte >> 8)
251#define pgoff_to_pte(off) ((pte_t) { ((off) << 8) | _PAGE_FILE })
252
253#endif /* _ASM_PGTABLE_64_H */
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h
deleted file mode 100644
index 51b34a48c84a..000000000000
--- a/include/asm-mips/pgtable-bits.h
+++ /dev/null
@@ -1,137 +0,0 @@
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 * Copyright (C) 1994 - 2002 by Ralf Baechle
7 * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
8 * Copyright (C) 2002 Maciej W. Rozycki
9 */
10#ifndef _ASM_PGTABLE_BITS_H
11#define _ASM_PGTABLE_BITS_H
12
13
14/*
15 * Note that we shift the lower 32bits of each EntryLo[01] entry
16 * 6 bits to the left. That way we can convert the PFN into the
17 * physical address by a single 'and' operation and gain 6 additional
18 * bits for storing information which isn't present in a normal
19 * MIPS page table.
20 *
21 * Similar to the Alpha port, we need to keep track of the ref
22 * and mod bits in software. We have a software "yeah you can read
23 * from this page" bit, and a hardware one which actually lets the
24 * process read from the page. On the same token we have a software
25 * writable bit and the real hardware one which actually lets the
26 * process write to the page, this keeps a mod bit via the hardware
27 * dirty bit.
28 *
29 * Certain revisions of the R4000 and R5000 have a bug where if a
30 * certain sequence occurs in the last 3 instructions of an executable
31 * page, and the following page is not mapped, the cpu can do
32 * unpredictable things. The code (when it is written) to deal with
33 * this problem will be in the update_mmu_cache() code for the r4k.
34 */
35#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
36
37#define _PAGE_PRESENT (1<<6) /* implemented in software */
38#define _PAGE_READ (1<<7) /* implemented in software */
39#define _PAGE_WRITE (1<<8) /* implemented in software */
40#define _PAGE_ACCESSED (1<<9) /* implemented in software */
41#define _PAGE_MODIFIED (1<<10) /* implemented in software */
42#define _PAGE_FILE (1<<10) /* set:pagecache unset:swap */
43
44#define _PAGE_R4KBUG (1<<0) /* workaround for r4k bug */
45#define _PAGE_GLOBAL (1<<0)
46#define _PAGE_VALID (1<<1)
47#define _PAGE_SILENT_READ (1<<1) /* synonym */
48#define _PAGE_DIRTY (1<<2) /* The MIPS dirty bit */
49#define _PAGE_SILENT_WRITE (1<<2)
50#define _CACHE_SHIFT 3
51#define _CACHE_MASK (7<<3)
52
53#else
54
55#define _PAGE_PRESENT (1<<0) /* implemented in software */
56#define _PAGE_READ (1<<1) /* implemented in software */
57#define _PAGE_WRITE (1<<2) /* implemented in software */
58#define _PAGE_ACCESSED (1<<3) /* implemented in software */
59#define _PAGE_MODIFIED (1<<4) /* implemented in software */
60#define _PAGE_FILE (1<<4) /* set:pagecache unset:swap */
61
62#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
63
64#define _PAGE_GLOBAL (1<<8)
65#define _PAGE_VALID (1<<9)
66#define _PAGE_SILENT_READ (1<<9) /* synonym */
67#define _PAGE_DIRTY (1<<10) /* The MIPS dirty bit */
68#define _PAGE_SILENT_WRITE (1<<10)
69#define _CACHE_UNCACHED (1<<11)
70#define _CACHE_MASK (1<<11)
71
72#else
73
74#define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */
75#define _PAGE_GLOBAL (1<<6)
76#define _PAGE_VALID (1<<7)
77#define _PAGE_SILENT_READ (1<<7) /* synonym */
78#define _PAGE_DIRTY (1<<8) /* The MIPS dirty bit */
79#define _PAGE_SILENT_WRITE (1<<8)
80#define _CACHE_SHIFT 9
81#define _CACHE_MASK (7<<9)
82
83#endif
84#endif /* defined(CONFIG_64BIT_PHYS_ADDR && defined(CONFIG_CPU_MIPS32) */
85
86
87/*
88 * Cache attributes
89 */
90#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
91
92#define _CACHE_CACHABLE_NONCOHERENT 0
93
94#elif defined(CONFIG_CPU_SB1)
95
96/* No penalty for being coherent on the SB1, so just
97 use it for "noncoherent" spaces, too. Shouldn't hurt. */
98
99#define _CACHE_UNCACHED (2<<_CACHE_SHIFT)
100#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT)
101#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT)
102#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
103
104#elif defined(CONFIG_CPU_RM9000)
105
106#define _CACHE_WT (0<<_CACHE_SHIFT)
107#define _CACHE_WTWA (1<<_CACHE_SHIFT)
108#define _CACHE_UC_B (2<<_CACHE_SHIFT)
109#define _CACHE_WB (3<<_CACHE_SHIFT)
110#define _CACHE_CWBEA (4<<_CACHE_SHIFT)
111#define _CACHE_CWB (5<<_CACHE_SHIFT)
112#define _CACHE_UCNB (6<<_CACHE_SHIFT)
113#define _CACHE_FPC (7<<_CACHE_SHIFT)
114
115#define _CACHE_UNCACHED _CACHE_UC_B
116#define _CACHE_CACHABLE_NONCOHERENT _CACHE_WB
117
118#else
119
120#define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT) /* R4600 only */
121#define _CACHE_CACHABLE_WA (1<<_CACHE_SHIFT) /* R4600 only */
122#define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* R4[0246]00 */
123#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* R4[0246]00 */
124#define _CACHE_CACHABLE_CE (4<<_CACHE_SHIFT) /* R4[04]00MC only */
125#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT) /* R4[04]00MC only */
126#define _CACHE_CACHABLE_COHERENT (5<<_CACHE_SHIFT) /* MIPS32R2 CMP */
127#define _CACHE_CACHABLE_CUW (6<<_CACHE_SHIFT) /* R4[04]00MC only */
128#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* R10000 only */
129
130#endif
131
132#define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED)
133#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
134
135#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK)
136
137#endif /* _ASM_PGTABLE_BITS_H */
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
deleted file mode 100644
index 6a0edf72ffbc..000000000000
--- a/include/asm-mips/pgtable.h
+++ /dev/null
@@ -1,383 +0,0 @@
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 * Copyright (C) 2003 Ralf Baechle
7 */
8#ifndef _ASM_PGTABLE_H
9#define _ASM_PGTABLE_H
10
11#ifdef CONFIG_32BIT
12#include <asm/pgtable-32.h>
13#endif
14#ifdef CONFIG_64BIT
15#include <asm/pgtable-64.h>
16#endif
17
18#include <asm/io.h>
19#include <asm/pgtable-bits.h>
20
21struct mm_struct;
22struct vm_area_struct;
23
24#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
25#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
26 _page_cachable_default)
27#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | \
28 _page_cachable_default)
29#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \
30 _page_cachable_default)
31#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
32 _PAGE_GLOBAL | _page_cachable_default)
33#define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
34 _page_cachable_default)
35#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
36 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
37
38/*
39 * MIPS can't do page protection for execute, and considers that the same like
40 * read. Also, write permissions imply read permissions. This is the closest
41 * we can get by reasonable means..
42 */
43
44/*
45 * Dummy values to fill the table in mmap.c
46 * The real values will be generated at runtime
47 */
48#define __P000 __pgprot(0)
49#define __P001 __pgprot(0)
50#define __P010 __pgprot(0)
51#define __P011 __pgprot(0)
52#define __P100 __pgprot(0)
53#define __P101 __pgprot(0)
54#define __P110 __pgprot(0)
55#define __P111 __pgprot(0)
56
57#define __S000 __pgprot(0)
58#define __S001 __pgprot(0)
59#define __S010 __pgprot(0)
60#define __S011 __pgprot(0)
61#define __S100 __pgprot(0)
62#define __S101 __pgprot(0)
63#define __S110 __pgprot(0)
64#define __S111 __pgprot(0)
65
66extern unsigned long _page_cachable_default;
67
68/*
69 * ZERO_PAGE is a global shared page that is always zero; used
70 * for zero-mapped memory areas etc..
71 */
72
73extern unsigned long empty_zero_page;
74extern unsigned long zero_page_mask;
75
76#define ZERO_PAGE(vaddr) \
77 (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
78
79extern void paging_init(void);
80
81/*
82 * Conversion functions: convert a page and protection to a page entry,
83 * and a page entry and page directory to the page they refer to.
84 */
85#define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
86#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
87#define pmd_page_vaddr(pmd) pmd_val(pmd)
88
89#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
90
91#define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL))
92#define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT)
93
94static inline void set_pte(pte_t *ptep, pte_t pte)
95{
96 ptep->pte_high = pte.pte_high;
97 smp_wmb();
98 ptep->pte_low = pte.pte_low;
99 //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low);
100
101 if (pte.pte_low & _PAGE_GLOBAL) {
102 pte_t *buddy = ptep_buddy(ptep);
103 /*
104 * Make sure the buddy is global too (if it's !none,
105 * it better already be global)
106 */
107 if (pte_none(*buddy)) {
108 buddy->pte_low |= _PAGE_GLOBAL;
109 buddy->pte_high |= _PAGE_GLOBAL;
110 }
111 }
112}
113#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
114
115static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
116{
117 pte_t null = __pte(0);
118
119 /* Preserve global status for the pair */
120 if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL)
121 null.pte_low = null.pte_high = _PAGE_GLOBAL;
122
123 set_pte_at(mm, addr, ptep, null);
124}
125#else
126
127#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
128#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
129
130/*
131 * Certain architectures need to do special things when pte's
132 * within a page table are directly modified. Thus, the following
133 * hook is made available.
134 */
135static inline void set_pte(pte_t *ptep, pte_t pteval)
136{
137 *ptep = pteval;
138#if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
139 if (pte_val(pteval) & _PAGE_GLOBAL) {
140 pte_t *buddy = ptep_buddy(ptep);
141 /*
142 * Make sure the buddy is global too (if it's !none,
143 * it better already be global)
144 */
145 if (pte_none(*buddy))
146 pte_val(*buddy) = pte_val(*buddy) | _PAGE_GLOBAL;
147 }
148#endif
149}
150#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
151
152static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
153{
154#if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
155 /* Preserve global status for the pair */
156 if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL)
157 set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL));
158 else
159#endif
160 set_pte_at(mm, addr, ptep, __pte(0));
161}
162#endif
163
164/*
165 * (pmds are folded into puds so this doesn't get actually called,
166 * but the define is needed for a generic inline function.)
167 */
168#define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
169
170#ifdef CONFIG_64BIT
171/*
172 * (puds are folded into pgds so this doesn't get actually called,
173 * but the define is needed for a generic inline function.)
174 */
175#define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
176#endif
177
178#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
179#define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
180#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
181
182/*
183 * We used to declare this array with size but gcc 3.3 and older are not able
184 * to find that this expression is a constant, so the size is dropped.
185 */
186extern pgd_t swapper_pg_dir[];
187
188/*
189 * The following only work if pte_present() is true.
190 * Undefined behaviour if not..
191 */
192#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
193static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; }
194static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; }
195static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
196static inline int pte_file(pte_t pte) { return pte.pte_low & _PAGE_FILE; }
197
198static inline pte_t pte_wrprotect(pte_t pte)
199{
200 pte.pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE);
201 pte.pte_high &= ~_PAGE_SILENT_WRITE;
202 return pte;
203}
204
205static inline pte_t pte_mkclean(pte_t pte)
206{
207 pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
208 pte.pte_high &= ~_PAGE_SILENT_WRITE;
209 return pte;
210}
211
212static inline pte_t pte_mkold(pte_t pte)
213{
214 pte.pte_low &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ);
215 pte.pte_high &= ~_PAGE_SILENT_READ;
216 return pte;
217}
218
219static inline pte_t pte_mkwrite(pte_t pte)
220{
221 pte.pte_low |= _PAGE_WRITE;
222 if (pte.pte_low & _PAGE_MODIFIED) {
223 pte.pte_low |= _PAGE_SILENT_WRITE;
224 pte.pte_high |= _PAGE_SILENT_WRITE;
225 }
226 return pte;
227}
228
229static inline pte_t pte_mkdirty(pte_t pte)
230{
231 pte.pte_low |= _PAGE_MODIFIED;
232 if (pte.pte_low & _PAGE_WRITE) {
233 pte.pte_low |= _PAGE_SILENT_WRITE;
234 pte.pte_high |= _PAGE_SILENT_WRITE;
235 }
236 return pte;
237}
238
239static inline pte_t pte_mkyoung(pte_t pte)
240{
241 pte.pte_low |= _PAGE_ACCESSED;
242 if (pte.pte_low & _PAGE_READ) {
243 pte.pte_low |= _PAGE_SILENT_READ;
244 pte.pte_high |= _PAGE_SILENT_READ;
245 }
246 return pte;
247}
248#else
249static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
250static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; }
251static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
252static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
253
254static inline pte_t pte_wrprotect(pte_t pte)
255{
256 pte_val(pte) &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE);
257 return pte;
258}
259
260static inline pte_t pte_mkclean(pte_t pte)
261{
262 pte_val(pte) &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE);
263 return pte;
264}
265
266static inline pte_t pte_mkold(pte_t pte)
267{
268 pte_val(pte) &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ);
269 return pte;
270}
271
272static inline pte_t pte_mkwrite(pte_t pte)
273{
274 pte_val(pte) |= _PAGE_WRITE;
275 if (pte_val(pte) & _PAGE_MODIFIED)
276 pte_val(pte) |= _PAGE_SILENT_WRITE;
277 return pte;
278}
279
280static inline pte_t pte_mkdirty(pte_t pte)
281{
282 pte_val(pte) |= _PAGE_MODIFIED;
283 if (pte_val(pte) & _PAGE_WRITE)
284 pte_val(pte) |= _PAGE_SILENT_WRITE;
285 return pte;
286}
287
288static inline pte_t pte_mkyoung(pte_t pte)
289{
290 pte_val(pte) |= _PAGE_ACCESSED;
291 if (pte_val(pte) & _PAGE_READ)
292 pte_val(pte) |= _PAGE_SILENT_READ;
293 return pte;
294}
295#endif
296static inline int pte_special(pte_t pte) { return 0; }
297static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
298
299/*
300 * Macro to make mark a page protection value as "uncacheable". Note
301 * that "protection" is really a misnomer here as the protection value
302 * contains the memory attribute bits, dirty bits, and various other
303 * bits as well.
304 */
305#define pgprot_noncached pgprot_noncached
306
307static inline pgprot_t pgprot_noncached(pgprot_t _prot)
308{
309 unsigned long prot = pgprot_val(_prot);
310
311 prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
312
313 return __pgprot(prot);
314}
315
316/*
317 * Conversion functions: convert a page and protection to a page entry,
318 * and a page entry and page directory to the page they refer to.
319 */
320#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
321
322#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
323static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
324{
325 pte.pte_low &= _PAGE_CHG_MASK;
326 pte.pte_high &= ~0x3f;
327 pte.pte_low |= pgprot_val(newprot);
328 pte.pte_high |= pgprot_val(newprot) & 0x3f;
329 return pte;
330}
331#else
332static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
333{
334 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
335}
336#endif
337
338
339extern void __update_tlb(struct vm_area_struct *vma, unsigned long address,
340 pte_t pte);
341extern void __update_cache(struct vm_area_struct *vma, unsigned long address,
342 pte_t pte);
343
344static inline void update_mmu_cache(struct vm_area_struct *vma,
345 unsigned long address, pte_t pte)
346{
347 __update_tlb(vma, address, pte);
348 __update_cache(vma, address, pte);
349}
350
351#define kern_addr_valid(addr) (1)
352
353#ifdef CONFIG_64BIT_PHYS_ADDR
354extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot);
355
356static inline int io_remap_pfn_range(struct vm_area_struct *vma,
357 unsigned long vaddr,
358 unsigned long pfn,
359 unsigned long size,
360 pgprot_t prot)
361{
362 phys_t phys_addr_high = fixup_bigphys_addr(pfn << PAGE_SHIFT, size);
363 return remap_pfn_range(vma, vaddr, phys_addr_high >> PAGE_SHIFT, size, prot);
364}
365#else
366#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
367 remap_pfn_range(vma, vaddr, pfn, size, prot)
368#endif
369
370#include <asm-generic/pgtable.h>
371
372/*
373 * We provide our own get_unmapped area to cope with the virtual aliasing
374 * constraints placed on us by the cache architecture.
375 */
376#define HAVE_ARCH_UNMAPPED_AREA
377
378/*
379 * No page table caches to initialise
380 */
381#define pgtable_cache_init() do { } while (0)
382
383#endif /* _ASM_PGTABLE_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h
deleted file mode 100644
index c84bcf9570b1..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * Defines for the MSP interrupt controller.
3 *
4 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
5 * Author: Carsten Langgaard, carstenl@mips.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _MSP_CIC_INT_H
26#define _MSP_CIC_INT_H
27
28/*
29 * The PMC-Sierra CIC interrupts are all centrally managed by the
30 * CIC sub-system.
31 * We attempt to keep the interrupt numbers as consistent as possible
32 * across all of the MSP devices, but some differences will creep in ...
33 * The interrupts which are directly forwarded to the MIPS core interrupts
34 * are assigned interrupts in the range 0-7, interrupts cascaded through
35 * the CIC are assigned interrupts 8-39. The cascade occurs on C_IRQ4
36 * (MSP_INT_CIC). Currently we don't really distinguish between VPE1
37 * and VPE0 (or thread contexts for that matter). Will have to fix.
38 * The PER interrupts are assigned interrupts in the range 40-71.
39*/
40
41
42/*
43 * IRQs directly forwarded to the CPU
44 */
45#define MSP_MIPS_INTBASE 0
46#define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */
47#define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */
48#define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */
49#define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */
50#define MSP_INT_USB 4 /* IRQ for USB, C_IRQ2 */
51#define MSP_INT_SAR 5 /* IRQ for ADSL2+ SAR, C_IRQ3 */
52#define MSP_INT_CIC 6 /* IRQ for CIC block, C_IRQ4 */
53#define MSP_INT_SEC 7 /* IRQ for Sec engine, C_IRQ5 */
54
55/*
56 * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4)
57 * These defines should be tied to the register definitions for the CIC
58 * interrupt routine. For now, just use hard-coded values.
59 */
60#define MSP_CIC_INTBASE (MSP_MIPS_INTBASE + 8)
61#define MSP_INT_EXT0 (MSP_CIC_INTBASE + 0)
62 /* External interrupt 0 */
63#define MSP_INT_EXT1 (MSP_CIC_INTBASE + 1)
64 /* External interrupt 1 */
65#define MSP_INT_EXT2 (MSP_CIC_INTBASE + 2)
66 /* External interrupt 2 */
67#define MSP_INT_EXT3 (MSP_CIC_INTBASE + 3)
68 /* External interrupt 3 */
69#define MSP_INT_CPUIF (MSP_CIC_INTBASE + 4)
70 /* CPU interface interrupt */
71#define MSP_INT_EXT4 (MSP_CIC_INTBASE + 5)
72 /* External interrupt 4 */
73#define MSP_INT_CIC_USB (MSP_CIC_INTBASE + 6)
74 /* Cascaded IRQ for USB */
75#define MSP_INT_MBOX (MSP_CIC_INTBASE + 7)
76 /* Sec engine mailbox IRQ */
77#define MSP_INT_EXT5 (MSP_CIC_INTBASE + 8)
78 /* External interrupt 5 */
79#define MSP_INT_TDM (MSP_CIC_INTBASE + 9)
80 /* TDM interrupt */
81#define MSP_INT_CIC_MAC0 (MSP_CIC_INTBASE + 10)
82 /* Cascaded IRQ for MAC 0 */
83#define MSP_INT_CIC_MAC1 (MSP_CIC_INTBASE + 11)
84 /* Cascaded IRQ for MAC 1 */
85#define MSP_INT_CIC_SEC (MSP_CIC_INTBASE + 12)
86 /* Cascaded IRQ for sec engine */
87#define MSP_INT_PER (MSP_CIC_INTBASE + 13)
88 /* Peripheral interrupt */
89#define MSP_INT_TIMER0 (MSP_CIC_INTBASE + 14)
90 /* SLP timer 0 */
91#define MSP_INT_TIMER1 (MSP_CIC_INTBASE + 15)
92 /* SLP timer 1 */
93#define MSP_INT_TIMER2 (MSP_CIC_INTBASE + 16)
94 /* SLP timer 2 */
95#define MSP_INT_VPE0_TIMER (MSP_CIC_INTBASE + 17)
96 /* VPE0 MIPS timer */
97#define MSP_INT_BLKCP (MSP_CIC_INTBASE + 18)
98 /* Block Copy */
99#define MSP_INT_UART0 (MSP_CIC_INTBASE + 19)
100 /* UART 0 */
101#define MSP_INT_PCI (MSP_CIC_INTBASE + 20)
102 /* PCI subsystem */
103#define MSP_INT_EXT6 (MSP_CIC_INTBASE + 21)
104 /* External interrupt 5 */
105#define MSP_INT_PCI_MSI (MSP_CIC_INTBASE + 22)
106 /* PCI Message Signal */
107#define MSP_INT_CIC_SAR (MSP_CIC_INTBASE + 23)
108 /* Cascaded ADSL2+ SAR IRQ */
109#define MSP_INT_DSL (MSP_CIC_INTBASE + 24)
110 /* ADSL2+ IRQ */
111#define MSP_INT_CIC_ERR (MSP_CIC_INTBASE + 25)
112 /* SLP error condition */
113#define MSP_INT_VPE1_TIMER (MSP_CIC_INTBASE + 26)
114 /* VPE1 MIPS timer */
115#define MSP_INT_VPE0_PC (MSP_CIC_INTBASE + 27)
116 /* VPE0 Performance counter */
117#define MSP_INT_VPE1_PC (MSP_CIC_INTBASE + 28)
118 /* VPE1 Performance counter */
119#define MSP_INT_EXT7 (MSP_CIC_INTBASE + 29)
120 /* External interrupt 5 */
121#define MSP_INT_VPE0_SW (MSP_CIC_INTBASE + 30)
122 /* VPE0 Software interrupt */
123#define MSP_INT_VPE1_SW (MSP_CIC_INTBASE + 31)
124 /* VPE0 Software interrupt */
125
126/*
127 * IRQs cascaded on CIC PER interrupt (MSP_INT_PER)
128 */
129#define MSP_PER_INTBASE (MSP_CIC_INTBASE + 32)
130/* Reserved 0-1 */
131#define MSP_INT_UART1 (MSP_PER_INTBASE + 2)
132 /* UART 1 */
133/* Reserved 3-5 */
134#define MSP_INT_2WIRE (MSP_PER_INTBASE + 6)
135 /* 2-wire */
136#define MSP_INT_TM0 (MSP_PER_INTBASE + 7)
137 /* Peripheral timer block out 0 */
138#define MSP_INT_TM1 (MSP_PER_INTBASE + 8)
139 /* Peripheral timer block out 1 */
140/* Reserved 9 */
141#define MSP_INT_SPRX (MSP_PER_INTBASE + 10)
142 /* SPI RX complete */
143#define MSP_INT_SPTX (MSP_PER_INTBASE + 11)
144 /* SPI TX complete */
145#define MSP_INT_GPIO (MSP_PER_INTBASE + 12)
146 /* GPIO */
147#define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13)
148 /* Peripheral error */
149/* Reserved 14-31 */
150
151#endif /* !_MSP_CIC_INT_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_int.h
deleted file mode 100644
index 1d9f05474820..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/msp_int.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Defines for the MSP interrupt handlers.
3 *
4 * Copyright (C) 2005, PMC-Sierra, Inc. All rights reserved.
5 * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _MSP_INT_H
26#define _MSP_INT_H
27
28/*
29 * The PMC-Sierra MSP product line has at least two different interrupt
30 * controllers, the SLP register based scheme and the CIC interrupt
31 * controller block mechanism. This file distinguishes between them
32 * so that devices see a uniform interface.
33 */
34
35#if defined(CONFIG_IRQ_MSP_SLP)
36 #include "msp_slp_int.h"
37#elif defined(CONFIG_IRQ_MSP_CIC)
38 #include "msp_cic_int.h"
39#else
40 #error "What sort of interrupt controller does *your* MSP have?"
41#endif
42
43#endif /* !_MSP_INT_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h b/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h
deleted file mode 100644
index 415606903617..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h
+++ /dev/null
@@ -1,205 +0,0 @@
1/*
2 * Copyright (c) 2000-2006 PMC-Sierra INC.
3 *
4 * This program is free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General
6 * Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be
11 * useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 * PURPOSE. See the GNU General Public License for more
14 * details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
19 * 02139, USA.
20 *
21 * PMC-SIERRA INC. DISCLAIMS ANY LIABILITY OF ANY KIND
22 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS
23 * SOFTWARE.
24 */
25
26#ifndef _MSP_PCI_H_
27#define _MSP_PCI_H_
28
29#define MSP_HAS_PCI(ID) (((u32)(ID) <= 0x4236) && ((u32)(ID) >= 0x4220))
30
31/*
32 * It is convenient to program the OATRAN register so that
33 * Athena virtual address space and PCI address space are
34 * the same. This is not a requirement, just a convenience.
35 *
36 * The only hard restrictions on the value of OATRAN is that
37 * OATRAN must not be programmed to allow translated memory
38 * addresses to fall within the lowest 512MB of
39 * PCI address space. This region is hardcoded
40 * for use as Athena PCI Host Controller target
41 * access memory space to the Athena's SDRAM.
42 *
43 * Note that OATRAN applies only to memory accesses, not
44 * to I/O accesses.
45 *
46 * To program OATRAN to make Athena virtual address space
47 * and PCI address space have the same values, OATRAN
48 * is to be programmed to 0xB8000000. The top seven
49 * bits of the value mimic the seven bits clipped off
50 * by the PCI Host controller.
51 *
52 * With OATRAN at the said value, when the CPU does
53 * an access to its virtual address at, say 0xB900_5000,
54 * the address appearing on the PCI bus will be
55 * 0xB900_5000.
56 * - Michael Penner
57 */
58#define MSP_PCI_OATRAN 0xB8000000UL
59
60#define MSP_PCI_SPACE_BASE (MSP_PCI_OATRAN + 0x1002000UL)
61#define MSP_PCI_SPACE_SIZE (0x3000000UL - 0x2000)
62#define MSP_PCI_SPACE_END \
63 (MSP_PCI_SPACE_BASE + MSP_PCI_SPACE_SIZE - 1)
64#define MSP_PCI_IOSPACE_BASE (MSP_PCI_OATRAN + 0x1001000UL)
65#define MSP_PCI_IOSPACE_SIZE 0x1000
66#define MSP_PCI_IOSPACE_END \
67 (MSP_PCI_IOSPACE_BASE + MSP_PCI_IOSPACE_SIZE - 1)
68
69/* IRQ for PCI status interrupts */
70#define PCI_STAT_IRQ 20
71
72#define QFLUSH_REG_1 0xB7F40000
73
74typedef volatile unsigned int pcireg;
75typedef void * volatile ppcireg;
76
77struct pci_block_copy
78{
79 pcireg unused1; /* +0x00 */
80 pcireg unused2; /* +0x04 */
81 ppcireg unused3; /* +0x08 */
82 ppcireg unused4; /* +0x0C */
83 pcireg unused5; /* +0x10 */
84 pcireg unused6; /* +0x14 */
85 pcireg unused7; /* +0x18 */
86 ppcireg unused8; /* +0x1C */
87 ppcireg unused9; /* +0x20 */
88 pcireg unusedA; /* +0x24 */
89 ppcireg unusedB; /* +0x28 */
90 ppcireg unusedC; /* +0x2C */
91};
92
93enum
94{
95 config_device_vendor, /* 0 */
96 config_status_command, /* 1 */
97 config_class_revision, /* 2 */
98 config_BIST_header_latency_cache, /* 3 */
99 config_BAR0, /* 4 */
100 config_BAR1, /* 5 */
101 config_BAR2, /* 6 */
102 config_not_used7, /* 7 */
103 config_not_used8, /* 8 */
104 config_not_used9, /* 9 */
105 config_CIS, /* 10 */
106 config_subsystem, /* 11 */
107 config_not_used12, /* 12 */
108 config_capabilities, /* 13 */
109 config_not_used14, /* 14 */
110 config_lat_grant_irq, /* 15 */
111 config_message_control,/* 16 */
112 config_message_addr, /* 17 */
113 config_message_data, /* 18 */
114 config_VPD_addr, /* 19 */
115 config_VPD_data, /* 20 */
116 config_maxregs /* 21 - number of registers */
117};
118
119struct msp_pci_regs
120{
121 pcireg hop_unused_00; /* +0x00 */
122 pcireg hop_unused_04; /* +0x04 */
123 pcireg hop_unused_08; /* +0x08 */
124 pcireg hop_unused_0C; /* +0x0C */
125 pcireg hop_unused_10; /* +0x10 */
126 pcireg hop_unused_14; /* +0x14 */
127 pcireg hop_unused_18; /* +0x18 */
128 pcireg hop_unused_1C; /* +0x1C */
129 pcireg hop_unused_20; /* +0x20 */
130 pcireg hop_unused_24; /* +0x24 */
131 pcireg hop_unused_28; /* +0x28 */
132 pcireg hop_unused_2C; /* +0x2C */
133 pcireg hop_unused_30; /* +0x30 */
134 pcireg hop_unused_34; /* +0x34 */
135 pcireg if_control; /* +0x38 */
136 pcireg oatran; /* +0x3C */
137 pcireg reset_ctl; /* +0x40 */
138 pcireg config_addr; /* +0x44 */
139 pcireg hop_unused_48; /* +0x48 */
140 pcireg msg_signaled_int_status; /* +0x4C */
141 pcireg msg_signaled_int_mask; /* +0x50 */
142 pcireg if_status; /* +0x54 */
143 pcireg if_mask; /* +0x58 */
144 pcireg hop_unused_5C; /* +0x5C */
145 pcireg hop_unused_60; /* +0x60 */
146 pcireg hop_unused_64; /* +0x64 */
147 pcireg hop_unused_68; /* +0x68 */
148 pcireg hop_unused_6C; /* +0x6C */
149 pcireg hop_unused_70; /* +0x70 */
150
151 struct pci_block_copy pci_bc[2] __attribute__((aligned(64)));
152
153 pcireg error_hdr1; /* +0xE0 */
154 pcireg error_hdr2; /* +0xE4 */
155
156 pcireg config[config_maxregs] __attribute__((aligned(256)));
157
158};
159
160#define BPCI_CFGADDR_BUSNUM_SHF 16
161#define BPCI_CFGADDR_FUNCTNUM_SHF 8
162#define BPCI_CFGADDR_REGNUM_SHF 2
163#define BPCI_CFGADDR_ENABLE (1<<31)
164
165#define BPCI_IFCONTROL_RTO (1<<20) /* Retry timeout */
166#define BPCI_IFCONTROL_HCE (1<<16) /* Host configuration enable */
167#define BPCI_IFCONTROL_CTO_SHF 12 /* Shift count for CTO bits */
168#define BPCI_IFCONTROL_SE (1<<5) /* Enable exceptions on errors */
169#define BPCI_IFCONTROL_BIST (1<<4) /* Use BIST in per. mode */
170#define BPCI_IFCONTROL_CAP (1<<3) /* Enable capabilities */
171#define BPCI_IFCONTROL_MMC_SHF 0 /* Shift count for MMC bits */
172
173#define BPCI_IFSTATUS_MGT (1<<8) /* Master Grant timeout */
174#define BPCI_IFSTATUS_MTT (1<<9) /* Master TRDY timeout */
175#define BPCI_IFSTATUS_MRT (1<<10) /* Master retry timeout */
176#define BPCI_IFSTATUS_BC0F (1<<13) /* Block copy 0 fault */
177#define BPCI_IFSTATUS_BC1F (1<<14) /* Block copy 1 fault */
178#define BPCI_IFSTATUS_PCIU (1<<15) /* PCI unable to respond */
179#define BPCI_IFSTATUS_BSIZ (1<<16) /* PCI access with illegal size */
180#define BPCI_IFSTATUS_BADD (1<<17) /* PCI access with illegal addr */
181#define BPCI_IFSTATUS_RTO (1<<18) /* Retry time out */
182#define BPCI_IFSTATUS_SER (1<<19) /* System error */
183#define BPCI_IFSTATUS_PER (1<<20) /* Parity error */
184#define BPCI_IFSTATUS_LCA (1<<21) /* Local CPU abort */
185#define BPCI_IFSTATUS_MEM (1<<22) /* Memory prot. violation */
186#define BPCI_IFSTATUS_ARB (1<<23) /* Arbiter timed out */
187#define BPCI_IFSTATUS_STA (1<<27) /* Signaled target abort */
188#define BPCI_IFSTATUS_TA (1<<28) /* Target abort */
189#define BPCI_IFSTATUS_MA (1<<29) /* Master abort */
190#define BPCI_IFSTATUS_PEI (1<<30) /* Parity error as initiator */
191#define BPCI_IFSTATUS_PET (1<<31) /* Parity error as target */
192
193#define BPCI_RESETCTL_PR (1<<0) /* True if reset asserted */
194#define BPCI_RESETCTL_RT (1<<4) /* Release time */
195#define BPCI_RESETCTL_CT (1<<8) /* Config time */
196#define BPCI_RESETCTL_PE (1<<12) /* PCI enabled */
197#define BPCI_RESETCTL_HM (1<<13) /* PCI host mode */
198#define BPCI_RESETCTL_RI (1<<14) /* PCI reset in */
199
200extern struct msp_pci_regs msp_pci_regs
201 __attribute__((section(".register")));
202extern unsigned long msp_pci_config_space
203 __attribute__((section(".register")));
204
205#endif /* !_MSP_PCI_H_ */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h b/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h
deleted file mode 100644
index 14ca7dc382a8..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h
+++ /dev/null
@@ -1,176 +0,0 @@
1/*
2 * MIPS boards bootprom interface for the Linux kernel.
3 *
4 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
5 * Author: Carsten Langgaard, carstenl@mips.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _ASM_MSP_PROM_H
26#define _ASM_MSP_PROM_H
27
28#include <linux/types.h>
29
30#define DEVICEID "deviceid"
31#define FEATURES "features"
32#define PROM_ENV "prom_env"
33#define PROM_ENV_FILE "/proc/"PROM_ENV
34#define PROM_ENV_SIZE 256
35
36#define CPU_DEVID_FAMILY 0x0000ff00
37#define CPU_DEVID_REVISION 0x000000ff
38
39#define FPGA_IS_POLO(revision) \
40 (((revision >= 0xb0) && (revision < 0xd0)))
41#define FPGA_IS_5000(revision) \
42 ((revision >= 0x80) && (revision <= 0x90))
43#define FPGA_IS_ZEUS(revision) ((revision < 0x7f))
44#define FPGA_IS_DUET(revision) \
45 (((revision >= 0xa0) && (revision < 0xb0)))
46#define FPGA_IS_MSP4200(revision) ((revision >= 0xd0))
47#define FPGA_IS_MSP7100(revision) ((revision >= 0xd0))
48
49#define MACHINE_TYPE_POLO "POLO"
50#define MACHINE_TYPE_DUET "DUET"
51#define MACHINE_TYPE_ZEUS "ZEUS"
52#define MACHINE_TYPE_MSP2000REVB "MSP2000REVB"
53#define MACHINE_TYPE_MSP5000 "MSP5000"
54#define MACHINE_TYPE_MSP4200 "MSP4200"
55#define MACHINE_TYPE_MSP7120 "MSP7120"
56#define MACHINE_TYPE_MSP7130 "MSP7130"
57#define MACHINE_TYPE_OTHER "OTHER"
58
59#define MACHINE_TYPE_POLO_FPGA "POLO-FPGA"
60#define MACHINE_TYPE_DUET_FPGA "DUET-FPGA"
61#define MACHINE_TYPE_ZEUS_FPGA "ZEUS_FPGA"
62#define MACHINE_TYPE_MSP2000REVB_FPGA "MSP2000REVB-FPGA"
63#define MACHINE_TYPE_MSP5000_FPGA "MSP5000-FPGA"
64#define MACHINE_TYPE_MSP4200_FPGA "MSP4200-FPGA"
65#define MACHINE_TYPE_MSP7100_FPGA "MSP7100-FPGA"
66#define MACHINE_TYPE_OTHER_FPGA "OTHER-FPGA"
67
68/* Device Family definitions */
69#define FAMILY_FPGA 0x0000
70#define FAMILY_ZEUS 0x1000
71#define FAMILY_POLO 0x2000
72#define FAMILY_DUET 0x4000
73#define FAMILY_TRIAD 0x5000
74#define FAMILY_MSP4200 0x4200
75#define FAMILY_MSP4200_FPGA 0x4f00
76#define FAMILY_MSP7100 0x7100
77#define FAMILY_MSP7100_FPGA 0x7f00
78
79/* Device Type definitions */
80#define TYPE_MSP7120 0x7120
81#define TYPE_MSP7130 0x7130
82
83#define ENET_KEY 'E'
84#define ENETTXD_KEY 'e'
85#define PCI_KEY 'P'
86#define PCIMUX_KEY 'p'
87#define SEC_KEY 'S'
88#define SPAD_KEY 'D'
89#define TDM_KEY 'T'
90#define ZSP_KEY 'Z'
91
92#define FEATURE_NOEXIST '-'
93#define FEATURE_EXIST '+'
94
95#define ENET_MII 'M'
96#define ENET_RMII 'R'
97
98#define ENETTXD_FALLING 'F'
99#define ENETTXD_RISING 'R'
100
101#define PCI_HOST 'H'
102#define PCI_PERIPHERAL 'P'
103
104#define PCIMUX_FULL 'F'
105#define PCIMUX_SINGLE 'S'
106
107#define SEC_DUET 'D'
108#define SEC_POLO 'P'
109#define SEC_SLOW 'S'
110#define SEC_TRIAD 'T'
111
112#define SPAD_POLO 'P'
113
114#define TDM_DUET 'D' /* DUET TDMs might exist */
115#define TDM_POLO 'P' /* POLO TDMs might exist */
116#define TDM_TRIAD 'T' /* TRIAD TDMs might exist */
117
118#define ZSP_DUET 'D' /* one DUET zsp engine */
119#define ZSP_TRIAD 'T' /* two TRIAD zsp engines */
120
121extern char *prom_getcmdline(void);
122extern char *prom_getenv(char *name);
123extern void prom_init_cmdline(void);
124extern void prom_meminit(void);
125extern void prom_fixup_mem_map(unsigned long start_mem,
126 unsigned long end_mem);
127
128#ifdef CONFIG_MTD_PMC_MSP_RAMROOT
129extern bool get_ramroot(void **start, unsigned long *size);
130#endif
131
132extern int get_ethernet_addr(char *ethaddr_name, char *ethernet_addr);
133extern unsigned long get_deviceid(void);
134extern char identify_enet(unsigned long interface_num);
135extern char identify_enetTxD(unsigned long interface_num);
136extern char identify_pci(void);
137extern char identify_sec(void);
138extern char identify_spad(void);
139extern char identify_sec(void);
140extern char identify_tdm(void);
141extern char identify_zsp(void);
142extern unsigned long identify_family(void);
143extern unsigned long identify_revision(void);
144
145/*
146 * The following macro calls prom_printf and puts the format string
147 * into an init section so it can be reclaimed.
148 */
149#define ppfinit(f, x...) \
150 do { \
151 static char _f[] __initdata = KERN_INFO f; \
152 printk(_f, ## x); \
153 } while (0)
154
155/* Memory descriptor management. */
156#define PROM_MAX_PMEMBLOCKS 7 /* 6 used */
157
158enum yamon_memtypes {
159 yamon_dontuse,
160 yamon_prom,
161 yamon_free,
162};
163
164struct prom_pmemblock {
165 unsigned long base; /* Within KSEG0. */
166 unsigned int size; /* In bytes. */
167 unsigned int type; /* free or prom memory */
168};
169
170extern int prom_argc;
171extern char **prom_argv;
172extern char **prom_envp;
173extern int *prom_vec;
174extern struct prom_pmemblock *prom_getmdesc(void);
175
176#endif /* !_ASM_MSP_PROM_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h
deleted file mode 100644
index 60a5a38dd5b2..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h
+++ /dev/null
@@ -1,236 +0,0 @@
1/*
2 * SMP/VPE-safe functions to access "registers" (see note).
3 *
4 * NOTES:
5* - These macros use ll/sc instructions, so it is your responsibility to
6 * ensure these are available on your platform before including this file.
7 * - The MIPS32 spec states that ll/sc results are undefined for uncached
8 * accesses. This means they can't be used on HW registers accessed
9 * through kseg1. Code which requires these macros for this purpose must
10 * front-end the registers with cached memory "registers" and have a single
11 * thread update the actual HW registers.
12 * - A maximum of 2k of code can be inserted between ll and sc. Every
13 * memory accesses between the instructions will increase the chance of
14 * sc failing and having to loop.
15 * - When using custom_read_reg32/custom_write_reg32 only perform the
16 * necessary logical operations on the register value in between these
17 * two calls. All other logic should be performed before the first call.
18 * - There is a bug on the R10000 chips which has a workaround. If you
19 * are affected by this bug, make sure to define the symbol 'R10000_LLSC_WAR'
20 * to be non-zero. If you are using this header from within linux, you may
21 * include <asm/war.h> before including this file to have this defined
22 * appropriately for you.
23 *
24 * Copyright 2005-2007 PMC-Sierra, Inc.
25 *
26 * This program is free software; you can redistribute it and/or modify it
27 * under the terms of the GNU General Public License as published by the
28 * Free Software Foundation; either version 2 of the License, or (at your
29 * option) any later version.
30 *
31 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
32 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
34 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
35 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
40 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 *
42 * You should have received a copy of the GNU General Public License along
43 * with this program; if not, write to the Free Software Foundation, Inc., 675
44 * Mass Ave, Cambridge, MA 02139, USA.
45 */
46
47#ifndef __ASM_REGOPS_H__
48#define __ASM_REGOPS_H__
49
50#include <linux/types.h>
51
52#include <asm/war.h>
53
54#ifndef R10000_LLSC_WAR
55#define R10000_LLSC_WAR 0
56#endif
57
58#if R10000_LLSC_WAR == 1
59#define __beqz "beqzl "
60#else
61#define __beqz "beqz "
62#endif
63
64#ifndef _LINUX_TYPES_H
65typedef unsigned int u32;
66#endif
67
68/*
69 * Sets all the masked bits to the corresponding value bits
70 */
71static inline void set_value_reg32(volatile u32 *const addr,
72 u32 const mask,
73 u32 const value)
74{
75 u32 temp;
76
77 __asm__ __volatile__(
78 " .set push \n"
79 " .set mips3 \n"
80 "1: ll %0, %1 # set_value_reg32 \n"
81 " and %0, %2 \n"
82 " or %0, %3 \n"
83 " sc %0, %1 \n"
84 " "__beqz"%0, 1b \n"
85 " nop \n"
86 " .set pop \n"
87 : "=&r" (temp), "=m" (*addr)
88 : "ir" (~mask), "ir" (value), "m" (*addr));
89}
90
91/*
92 * Sets all the masked bits to '1'
93 */
94static inline void set_reg32(volatile u32 *const addr,
95 u32 const mask)
96{
97 u32 temp;
98
99 __asm__ __volatile__(
100 " .set push \n"
101 " .set mips3 \n"
102 "1: ll %0, %1 # set_reg32 \n"
103 " or %0, %2 \n"
104 " sc %0, %1 \n"
105 " "__beqz"%0, 1b \n"
106 " nop \n"
107 " .set pop \n"
108 : "=&r" (temp), "=m" (*addr)
109 : "ir" (mask), "m" (*addr));
110}
111
112/*
113 * Sets all the masked bits to '0'
114 */
115static inline void clear_reg32(volatile u32 *const addr,
116 u32 const mask)
117{
118 u32 temp;
119
120 __asm__ __volatile__(
121 " .set push \n"
122 " .set mips3 \n"
123 "1: ll %0, %1 # clear_reg32 \n"
124 " and %0, %2 \n"
125 " sc %0, %1 \n"
126 " "__beqz"%0, 1b \n"
127 " nop \n"
128 " .set pop \n"
129 : "=&r" (temp), "=m" (*addr)
130 : "ir" (~mask), "m" (*addr));
131}
132
133/*
134 * Toggles all masked bits from '0' to '1' and '1' to '0'
135 */
136static inline void toggle_reg32(volatile u32 *const addr,
137 u32 const mask)
138{
139 u32 temp;
140
141 __asm__ __volatile__(
142 " .set push \n"
143 " .set mips3 \n"
144 "1: ll %0, %1 # toggle_reg32 \n"
145 " xor %0, %2 \n"
146 " sc %0, %1 \n"
147 " "__beqz"%0, 1b \n"
148 " nop \n"
149 " .set pop \n"
150 : "=&r" (temp), "=m" (*addr)
151 : "ir" (mask), "m" (*addr));
152}
153
154/*
155 * Read all masked bits others are returned as '0'
156 */
157static inline u32 read_reg32(volatile u32 *const addr,
158 u32 const mask)
159{
160 u32 temp;
161
162 __asm__ __volatile__(
163 " .set push \n"
164 " .set noreorder \n"
165 " lw %0, %1 # read \n"
166 " and %0, %2 # mask \n"
167 " .set pop \n"
168 : "=&r" (temp)
169 : "m" (*addr), "ir" (mask));
170
171 return temp;
172}
173
174/*
175 * blocking_read_reg32 - Read address with blocking load
176 *
177 * Uncached writes need to be read back to ensure they reach RAM.
178 * The returned value must be 'used' to prevent from becoming a
179 * non-blocking load.
180 */
181static inline u32 blocking_read_reg32(volatile u32 *const addr)
182{
183 u32 temp;
184
185 __asm__ __volatile__(
186 " .set push \n"
187 " .set noreorder \n"
188 " lw %0, %1 # read \n"
189 " move %0, %0 # block \n"
190 " .set pop \n"
191 : "=&r" (temp)
192 : "m" (*addr));
193
194 return temp;
195}
196
197/*
198 * For special strange cases only:
199 *
200 * If you need custom processing within a ll/sc loop, use the following macros
201 * VERY CAREFULLY:
202 *
203 * u32 tmp; <-- Define a variable to hold the data
204 *
205 * custom_read_reg32(address, tmp); <-- Reads the address and put the value
206 * in the 'tmp' variable given
207 *
208 * From here on out, you are (basicly) atomic, so don't do anything too
209 * fancy!
210 * Also, this code may loop if the end of this block fails to write
211 * everything back safely due do the other CPU, so do NOT do anything
212 * with side-effects!
213 *
214 * custom_write_reg32(address, tmp); <-- Writes back 'tmp' safely.
215 */
216#define custom_read_reg32(address, tmp) \
217 __asm__ __volatile__( \
218 " .set push \n" \
219 " .set mips3 \n" \
220 "1: ll %0, %1 #custom_read_reg32 \n" \
221 " .set pop \n" \
222 : "=r" (tmp), "=m" (*address) \
223 : "m" (*address))
224
225#define custom_write_reg32(address, tmp) \
226 __asm__ __volatile__( \
227 " .set push \n" \
228 " .set mips3 \n" \
229 " sc %0, %1 #custom_write_reg32 \n" \
230 " "__beqz"%0, 1b \n" \
231 " nop \n" \
232 " .set pop \n" \
233 : "=&r" (tmp), "=m" (*address) \
234 : "0" (tmp), "m" (*address))
235
236#endif /* __ASM_REGOPS_H__ */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h
deleted file mode 100644
index 603eb737b4a8..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h
+++ /dev/null
@@ -1,663 +0,0 @@
1/*
2 * Defines for the address space, registers and register configuration
3 * (bit masks, access macros etc) for the PMC-Sierra line of MSP products.
4 * This file contains addess maps for all the devices in the line of
5 * products but only has register definitions and configuration masks for
6 * registers which aren't definitely associated with any device. Things
7 * like clock settings, reset access, the ELB etc. Individual device
8 * drivers will reference the appropriate XXX_BASE value defined here
9 * and have individual registers offset from that.
10 *
11 * Copyright (C) 2005-2007 PMC-Sierra, Inc. All rights reserved.
12 * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
13 *
14 * ########################################################################
15 *
16 * This program is free software; you can distribute it and/or modify it
17 * under the terms of the GNU General Public License (Version 2) as
18 * published by the Free Software Foundation.
19 *
20 * This program is distributed in the hope it will be useful, but WITHOUT
21 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * for more details.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
28 *
29 * ########################################################################
30 */
31
32#include <asm/addrspace.h>
33#include <linux/types.h>
34
35#ifndef _ASM_MSP_REGS_H
36#define _ASM_MSP_REGS_H
37
38/*
39 ########################################################################
40 # Address space and device base definitions #
41 ########################################################################
42 */
43
44/*
45 ***************************************************************************
46 * System Logic and Peripherals (ELB, UART0, etc) device address space *
47 ***************************************************************************
48 */
49#define MSP_SLP_BASE 0x1c000000
50 /* System Logic and Peripherals */
51#define MSP_RST_BASE (MSP_SLP_BASE + 0x10)
52 /* System reset register base */
53#define MSP_RST_SIZE 0x0C /* System reset register space */
54
55#define MSP_WTIMER_BASE (MSP_SLP_BASE + 0x04C)
56 /* watchdog timer base */
57#define MSP_ITIMER_BASE (MSP_SLP_BASE + 0x054)
58 /* internal timer base */
59#define MSP_UART0_BASE (MSP_SLP_BASE + 0x100)
60 /* UART0 controller base */
61#define MSP_BCPY_CTRL_BASE (MSP_SLP_BASE + 0x120)
62 /* Block Copy controller base */
63#define MSP_BCPY_DESC_BASE (MSP_SLP_BASE + 0x160)
64 /* Block Copy descriptor base */
65
66/*
67 ***************************************************************************
68 * PCI address space *
69 ***************************************************************************
70 */
71#define MSP_PCI_BASE 0x19000000
72
73/*
74 ***************************************************************************
75 * MSbus device address space *
76 ***************************************************************************
77 */
78#define MSP_MSB_BASE 0x18000000
79 /* MSbus address start */
80#define MSP_PER_BASE (MSP_MSB_BASE + 0x400000)
81 /* Peripheral device registers */
82#define MSP_MAC0_BASE (MSP_MSB_BASE + 0x600000)
83 /* MAC A device registers */
84#define MSP_MAC1_BASE (MSP_MSB_BASE + 0x700000)
85 /* MAC B device registers */
86#define MSP_MAC_SIZE 0xE0 /* MAC register space */
87
88#define MSP_SEC_BASE (MSP_MSB_BASE + 0x800000)
89 /* Security Engine registers */
90#define MSP_MAC2_BASE (MSP_MSB_BASE + 0x900000)
91 /* MAC C device registers */
92#define MSP_ADSL2_BASE (MSP_MSB_BASE + 0xA80000)
93 /* ADSL2 device registers */
94#define MSP_USB_BASE (MSP_MSB_BASE + 0xB40000)
95 /* USB device registers */
96#define MSP_USB_BASE_START (MSP_MSB_BASE + 0xB40100)
97 /* USB device registers */
98#define MSP_USB_BASE_END (MSP_MSB_BASE + 0xB401FF)
99 /* USB device registers */
100#define MSP_CPUIF_BASE (MSP_MSB_BASE + 0xC00000)
101 /* CPU interface registers */
102
103/* Devices within the MSbus peripheral block */
104#define MSP_UART1_BASE (MSP_PER_BASE + 0x030)
105 /* UART1 controller base */
106#define MSP_SPI_BASE (MSP_PER_BASE + 0x058)
107 /* SPI/MPI control registers */
108#define MSP_TWI_BASE (MSP_PER_BASE + 0x090)
109 /* Two-wire control registers */
110#define MSP_PTIMER_BASE (MSP_PER_BASE + 0x0F0)
111 /* Programmable timer control */
112
113/*
114 ***************************************************************************
115 * Physical Memory configuration address space *
116 ***************************************************************************
117 */
118#define MSP_MEM_CFG_BASE 0x17f00000
119
120#define MSP_MEM_INDIRECT_CTL_10 0x10
121
122/*
123 * Notes:
124 * 1) The SPI registers are split into two blocks, one offset from the
125 * MSP_SPI_BASE by 0x00 and the other offset from the MSP_SPI_BASE by
126 * 0x68. The SPI driver definitions for the register must be aware
127 * of this.
128 * 2) The block copy engine register are divided into two regions, one
129 * for the control/configuration of the engine proper and one for the
130 * values of the descriptors used in the copy process. These have
131 * different base defines (CTRL_BASE vs DESC_BASE)
132 * 3) These constants are for physical addresses which means that they
133 * work correctly with "ioremap" and friends. This means that device
134 * drivers will need to remap these addresses using ioremap and perhaps
135 * the readw/writew macros. Or they could use the regptr() macro
136 * defined below, but the readw/writew calls are the correct thing.
137 * 4) The UARTs have an additional status register offset from the base
138 * address. This register isn't used in the standard 8250 driver but
139 * may be used in other software. Consult the hardware datasheet for
140 * offset details.
141 * 5) For some unknown reason the security engine (MSP_SEC_BASE) registers
142 * start at an offset of 0x84 from the base address but the block of
143 * registers before this is reserved for the security engine. The
144 * driver will have to be aware of this but it makes the register
145 * definitions line up better with the documentation.
146 */
147
148/*
149 ########################################################################
150 # System register definitions. Not associated with a specific device #
151 ########################################################################
152 */
153
154/*
155 * This macro maps the physical register number into uncached space
156 * and (for C code) casts it into a u32 pointer so it can be dereferenced
157 * Normally these would be accessed with ioremap and readX/writeX, but
158 * these are convenient for a lot of internal kernel code.
159 */
160#ifdef __ASSEMBLER__
161 #define regptr(addr) (KSEG1ADDR(addr))
162#else
163 #define regptr(addr) ((volatile u32 *const)(KSEG1ADDR(addr)))
164#endif
165
166/*
167 ***************************************************************************
168 * System Logic and Peripherals (RESET, ELB, etc) registers *
169 ***************************************************************************
170 */
171
172/* System Control register definitions */
173#define DEV_ID_REG regptr(MSP_SLP_BASE + 0x00)
174 /* Device-ID RO */
175#define FWR_ID_REG regptr(MSP_SLP_BASE + 0x04)
176 /* Firmware-ID Register RW */
177#define SYS_ID_REG0 regptr(MSP_SLP_BASE + 0x08)
178 /* System-ID Register-0 RW */
179#define SYS_ID_REG1 regptr(MSP_SLP_BASE + 0x0C)
180 /* System-ID Register-1 RW */
181
182/* System Reset register definitions */
183#define RST_STS_REG regptr(MSP_SLP_BASE + 0x10)
184 /* System Reset Status RO */
185#define RST_SET_REG regptr(MSP_SLP_BASE + 0x14)
186 /* System Set Reset WO */
187#define RST_CLR_REG regptr(MSP_SLP_BASE + 0x18)
188 /* System Clear Reset WO */
189
190/* System Clock Registers */
191#define PCI_SLP_REG regptr(MSP_SLP_BASE + 0x1C)
192 /* PCI clock generator RW */
193#define URT_SLP_REG regptr(MSP_SLP_BASE + 0x20)
194 /* UART clock generator RW */
195/* reserved (MSP_SLP_BASE + 0x24) */
196/* reserved (MSP_SLP_BASE + 0x28) */
197#define PLL1_SLP_REG regptr(MSP_SLP_BASE + 0x2C)
198 /* PLL1 clock generator RW */
199#define PLL0_SLP_REG regptr(MSP_SLP_BASE + 0x30)
200 /* PLL0 clock generator RW */
201#define MIPS_SLP_REG regptr(MSP_SLP_BASE + 0x34)
202 /* MIPS clock generator RW */
203#define VE_SLP_REG regptr(MSP_SLP_BASE + 0x38)
204 /* Voice Eng clock generator RW */
205/* reserved (MSP_SLP_BASE + 0x3C) */
206#define MSB_SLP_REG regptr(MSP_SLP_BASE + 0x40)
207 /* MS-Bus clock generator RW */
208#define SMAC_SLP_REG regptr(MSP_SLP_BASE + 0x44)
209 /* Sec & MAC clock generator RW */
210#define PERF_SLP_REG regptr(MSP_SLP_BASE + 0x48)
211 /* Per & TDM clock generator RW */
212
213/* Interrupt Controller Registers */
214#define SLP_INT_STS_REG regptr(MSP_SLP_BASE + 0x70)
215 /* Interrupt status register RW */
216#define SLP_INT_MSK_REG regptr(MSP_SLP_BASE + 0x74)
217 /* Interrupt enable/mask RW */
218#define SE_MBOX_REG regptr(MSP_SLP_BASE + 0x78)
219 /* Security Engine mailbox RW */
220#define VE_MBOX_REG regptr(MSP_SLP_BASE + 0x7C)
221 /* Voice Engine mailbox RW */
222
223/* ELB Controller Registers */
224#define CS0_CNFG_REG regptr(MSP_SLP_BASE + 0x80)
225 /* ELB CS0 Configuration Reg */
226#define CS0_ADDR_REG regptr(MSP_SLP_BASE + 0x84)
227 /* ELB CS0 Base Address Reg */
228#define CS0_MASK_REG regptr(MSP_SLP_BASE + 0x88)
229 /* ELB CS0 Mask Register */
230#define CS0_ACCESS_REG regptr(MSP_SLP_BASE + 0x8C)
231 /* ELB CS0 access register */
232
233#define CS1_CNFG_REG regptr(MSP_SLP_BASE + 0x90)
234 /* ELB CS1 Configuration Reg */
235#define CS1_ADDR_REG regptr(MSP_SLP_BASE + 0x94)
236 /* ELB CS1 Base Address Reg */
237#define CS1_MASK_REG regptr(MSP_SLP_BASE + 0x98)
238 /* ELB CS1 Mask Register */
239#define CS1_ACCESS_REG regptr(MSP_SLP_BASE + 0x9C)
240 /* ELB CS1 access register */
241
242#define CS2_CNFG_REG regptr(MSP_SLP_BASE + 0xA0)
243 /* ELB CS2 Configuration Reg */
244#define CS2_ADDR_REG regptr(MSP_SLP_BASE + 0xA4)
245 /* ELB CS2 Base Address Reg */
246#define CS2_MASK_REG regptr(MSP_SLP_BASE + 0xA8)
247 /* ELB CS2 Mask Register */
248#define CS2_ACCESS_REG regptr(MSP_SLP_BASE + 0xAC)
249 /* ELB CS2 access register */
250
251#define CS3_CNFG_REG regptr(MSP_SLP_BASE + 0xB0)
252 /* ELB CS3 Configuration Reg */
253#define CS3_ADDR_REG regptr(MSP_SLP_BASE + 0xB4)
254 /* ELB CS3 Base Address Reg */
255#define CS3_MASK_REG regptr(MSP_SLP_BASE + 0xB8)
256 /* ELB CS3 Mask Register */
257#define CS3_ACCESS_REG regptr(MSP_SLP_BASE + 0xBC)
258 /* ELB CS3 access register */
259
260#define CS4_CNFG_REG regptr(MSP_SLP_BASE + 0xC0)
261 /* ELB CS4 Configuration Reg */
262#define CS4_ADDR_REG regptr(MSP_SLP_BASE + 0xC4)
263 /* ELB CS4 Base Address Reg */
264#define CS4_MASK_REG regptr(MSP_SLP_BASE + 0xC8)
265 /* ELB CS4 Mask Register */
266#define CS4_ACCESS_REG regptr(MSP_SLP_BASE + 0xCC)
267 /* ELB CS4 access register */
268
269#define CS5_CNFG_REG regptr(MSP_SLP_BASE + 0xD0)
270 /* ELB CS5 Configuration Reg */
271#define CS5_ADDR_REG regptr(MSP_SLP_BASE + 0xD4)
272 /* ELB CS5 Base Address Reg */
273#define CS5_MASK_REG regptr(MSP_SLP_BASE + 0xD8)
274 /* ELB CS5 Mask Register */
275#define CS5_ACCESS_REG regptr(MSP_SLP_BASE + 0xDC)
276 /* ELB CS5 access register */
277
278/* reserved 0xE0 - 0xE8 */
279#define ELB_1PC_EN_REG regptr(MSP_SLP_BASE + 0xEC)
280 /* ELB single PC card detect */
281
282/* reserved 0xF0 - 0xF8 */
283#define ELB_CLK_CFG_REG regptr(MSP_SLP_BASE + 0xFC)
284 /* SDRAM read/ELB timing Reg */
285
286/* Extended UART status registers */
287#define UART0_STATUS_REG regptr(MSP_UART0_BASE + 0x0c0)
288 /* UART Status Register 0 */
289#define UART1_STATUS_REG regptr(MSP_UART1_BASE + 0x170)
290 /* UART Status Register 1 */
291
292/* Performance monitoring registers */
293#define PERF_MON_CTRL_REG regptr(MSP_SLP_BASE + 0x140)
294 /* Performance monitor control */
295#define PERF_MON_CLR_REG regptr(MSP_SLP_BASE + 0x144)
296 /* Performance monitor clear */
297#define PERF_MON_CNTH_REG regptr(MSP_SLP_BASE + 0x148)
298 /* Perf monitor counter high */
299#define PERF_MON_CNTL_REG regptr(MSP_SLP_BASE + 0x14C)
300 /* Perf monitor counter low */
301
302/* System control registers */
303#define SYS_CTRL_REG regptr(MSP_SLP_BASE + 0x150)
304 /* System control register */
305#define SYS_ERR1_REG regptr(MSP_SLP_BASE + 0x154)
306 /* System Error status 1 */
307#define SYS_ERR2_REG regptr(MSP_SLP_BASE + 0x158)
308 /* System Error status 2 */
309#define SYS_INT_CFG_REG regptr(MSP_SLP_BASE + 0x15C)
310 /* System Interrupt config */
311
312/* Voice Engine Memory configuration */
313#define VE_MEM_REG regptr(MSP_SLP_BASE + 0x17C)
314 /* Voice engine memory config */
315
316/* CPU/SLP Error Status registers */
317#define CPU_ERR1_REG regptr(MSP_SLP_BASE + 0x180)
318 /* CPU/SLP Error status 1 */
319#define CPU_ERR2_REG regptr(MSP_SLP_BASE + 0x184)
320 /* CPU/SLP Error status 1 */
321
322#define EXTENDED_GPIO_REG regptr(MSP_SLP_BASE + 0x188)
323 /* Extended GPIO register */
324
325/* System Error registers */
326#define SLP_ERR_STS_REG regptr(MSP_SLP_BASE + 0x190)
327 /* Int status for SLP errors */
328#define SLP_ERR_MSK_REG regptr(MSP_SLP_BASE + 0x194)
329 /* Int mask for SLP errors */
330#define SLP_ELB_ERST_REG regptr(MSP_SLP_BASE + 0x198)
331 /* External ELB reset */
332#define SLP_BOOT_STS_REG regptr(MSP_SLP_BASE + 0x19C)
333 /* Boot Status */
334
335/* Extended ELB addressing */
336#define CS0_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A0)
337 /* CS0 Extended address */
338#define CS1_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A4)
339 /* CS1 Extended address */
340#define CS2_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A8)
341 /* CS2 Extended address */
342#define CS3_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1AC)
343 /* CS3 Extended address */
344/* reserved 0x1B0 */
345#define CS5_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1B4)
346 /* CS5 Extended address */
347
348/* PLL Adjustment registers */
349#define PLL_LOCK_REG regptr(MSP_SLP_BASE + 0x200)
350 /* PLL0 lock status */
351#define PLL_ARST_REG regptr(MSP_SLP_BASE + 0x204)
352 /* PLL Analog reset status */
353#define PLL0_ADJ_REG regptr(MSP_SLP_BASE + 0x208)
354 /* PLL0 Adjustment value */
355#define PLL1_ADJ_REG regptr(MSP_SLP_BASE + 0x20C)
356 /* PLL1 Adjustment value */
357
358/*
359 ***************************************************************************
360 * Peripheral Register definitions *
361 ***************************************************************************
362 */
363
364/* Peripheral status */
365#define PER_CTRL_REG regptr(MSP_PER_BASE + 0x50)
366 /* Peripheral control register */
367#define PER_STS_REG regptr(MSP_PER_BASE + 0x54)
368 /* Peripheral status register */
369
370/* SPI/MPI Registers */
371#define SMPI_TX_SZ_REG regptr(MSP_PER_BASE + 0x58)
372 /* SPI/MPI Tx Size register */
373#define SMPI_RX_SZ_REG regptr(MSP_PER_BASE + 0x5C)
374 /* SPI/MPI Rx Size register */
375#define SMPI_CTL_REG regptr(MSP_PER_BASE + 0x60)
376 /* SPI/MPI Control register */
377#define SMPI_MS_REG regptr(MSP_PER_BASE + 0x64)
378 /* SPI/MPI Chip Select reg */
379#define SMPI_CORE_DATA_REG regptr(MSP_PER_BASE + 0xC0)
380 /* SPI/MPI Core Data reg */
381#define SMPI_CORE_CTRL_REG regptr(MSP_PER_BASE + 0xC4)
382 /* SPI/MPI Core Control reg */
383#define SMPI_CORE_STAT_REG regptr(MSP_PER_BASE + 0xC8)
384 /* SPI/MPI Core Status reg */
385#define SMPI_CORE_SSEL_REG regptr(MSP_PER_BASE + 0xCC)
386 /* SPI/MPI Core Ssel reg */
387#define SMPI_FIFO_REG regptr(MSP_PER_BASE + 0xD0)
388 /* SPI/MPI Data FIFO reg */
389
390/* Peripheral Block Error Registers */
391#define PER_ERR_STS_REG regptr(MSP_PER_BASE + 0x70)
392 /* Error Bit Status Register */
393#define PER_ERR_MSK_REG regptr(MSP_PER_BASE + 0x74)
394 /* Error Bit Mask Register */
395#define PER_HDR1_REG regptr(MSP_PER_BASE + 0x78)
396 /* Error Header 1 Register */
397#define PER_HDR2_REG regptr(MSP_PER_BASE + 0x7C)
398 /* Error Header 2 Register */
399
400/* Peripheral Block Interrupt Registers */
401#define PER_INT_STS_REG regptr(MSP_PER_BASE + 0x80)
402 /* Interrupt status register */
403#define PER_INT_MSK_REG regptr(MSP_PER_BASE + 0x84)
404 /* Interrupt Mask Register */
405#define GPIO_INT_STS_REG regptr(MSP_PER_BASE + 0x88)
406 /* GPIO interrupt status reg */
407#define GPIO_INT_MSK_REG regptr(MSP_PER_BASE + 0x8C)
408 /* GPIO interrupt MASK Reg */
409
410/* POLO GPIO registers */
411#define POLO_GPIO_DAT1_REG regptr(MSP_PER_BASE + 0x0E0)
412 /* Polo GPIO[8:0] data reg */
413#define POLO_GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x0E4)
414 /* Polo GPIO[7:0] config reg */
415#define POLO_GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x0E8)
416 /* Polo GPIO[15:8] config reg */
417#define POLO_GPIO_OD1_REG regptr(MSP_PER_BASE + 0x0EC)
418 /* Polo GPIO[31:0] output drive */
419#define POLO_GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x170)
420 /* Polo GPIO[23:16] config reg */
421#define POLO_GPIO_DAT2_REG regptr(MSP_PER_BASE + 0x174)
422 /* Polo GPIO[15:9] data reg */
423#define POLO_GPIO_DAT3_REG regptr(MSP_PER_BASE + 0x178)
424 /* Polo GPIO[23:16] data reg */
425#define POLO_GPIO_DAT4_REG regptr(MSP_PER_BASE + 0x17C)
426 /* Polo GPIO[31:24] data reg */
427#define POLO_GPIO_DAT5_REG regptr(MSP_PER_BASE + 0x180)
428 /* Polo GPIO[39:32] data reg */
429#define POLO_GPIO_DAT6_REG regptr(MSP_PER_BASE + 0x184)
430 /* Polo GPIO[47:40] data reg */
431#define POLO_GPIO_DAT7_REG regptr(MSP_PER_BASE + 0x188)
432 /* Polo GPIO[54:48] data reg */
433#define POLO_GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
434 /* Polo GPIO[31:24] config reg */
435#define POLO_GPIO_CFG5_REG regptr(MSP_PER_BASE + 0x190)
436 /* Polo GPIO[39:32] config reg */
437#define POLO_GPIO_CFG6_REG regptr(MSP_PER_BASE + 0x194)
438 /* Polo GPIO[47:40] config reg */
439#define POLO_GPIO_CFG7_REG regptr(MSP_PER_BASE + 0x198)
440 /* Polo GPIO[54:48] config reg */
441#define POLO_GPIO_OD2_REG regptr(MSP_PER_BASE + 0x19C)
442 /* Polo GPIO[54:32] output drive */
443
444/* Generic GPIO registers */
445#define GPIO_DATA1_REG regptr(MSP_PER_BASE + 0x170)
446 /* GPIO[1:0] data register */
447#define GPIO_DATA2_REG regptr(MSP_PER_BASE + 0x174)
448 /* GPIO[5:2] data register */
449#define GPIO_DATA3_REG regptr(MSP_PER_BASE + 0x178)
450 /* GPIO[9:6] data register */
451#define GPIO_DATA4_REG regptr(MSP_PER_BASE + 0x17C)
452 /* GPIO[15:10] data register */
453#define GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x180)
454 /* GPIO[1:0] config register */
455#define GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x184)
456 /* GPIO[5:2] config register */
457#define GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x188)
458 /* GPIO[9:6] config register */
459#define GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
460 /* GPIO[15:10] config register */
461#define GPIO_OD_REG regptr(MSP_PER_BASE + 0x190)
462 /* GPIO[15:0] output drive */
463
464/*
465 ***************************************************************************
466 * CPU Interface register definitions *
467 ***************************************************************************
468 */
469#define PCI_FLUSH_REG regptr(MSP_CPUIF_BASE + 0x00)
470 /* PCI-SDRAM queue flush trigger */
471#define OCP_ERR1_REG regptr(MSP_CPUIF_BASE + 0x04)
472 /* OCP Error Attribute 1 */
473#define OCP_ERR2_REG regptr(MSP_CPUIF_BASE + 0x08)
474 /* OCP Error Attribute 2 */
475#define OCP_STS_REG regptr(MSP_CPUIF_BASE + 0x0C)
476 /* OCP Error Status */
477#define CPUIF_PM_REG regptr(MSP_CPUIF_BASE + 0x10)
478 /* CPU policy configuration */
479#define CPUIF_CFG_REG regptr(MSP_CPUIF_BASE + 0x10)
480 /* Misc configuration options */
481
482/* Central Interrupt Controller Registers */
483#define MSP_CIC_BASE (MSP_CPUIF_BASE + 0x8000)
484 /* Central Interrupt registers */
485#define CIC_EXT_CFG_REG regptr(MSP_CIC_BASE + 0x00)
486 /* External interrupt config */
487#define CIC_STS_REG regptr(MSP_CIC_BASE + 0x04)
488 /* CIC Interrupt Status */
489#define CIC_VPE0_MSK_REG regptr(MSP_CIC_BASE + 0x08)
490 /* VPE0 Interrupt Mask */
491#define CIC_VPE1_MSK_REG regptr(MSP_CIC_BASE + 0x0C)
492 /* VPE1 Interrupt Mask */
493#define CIC_TC0_MSK_REG regptr(MSP_CIC_BASE + 0x10)
494 /* Thread Context 0 Int Mask */
495#define CIC_TC1_MSK_REG regptr(MSP_CIC_BASE + 0x14)
496 /* Thread Context 1 Int Mask */
497#define CIC_TC2_MSK_REG regptr(MSP_CIC_BASE + 0x18)
498 /* Thread Context 2 Int Mask */
499#define CIC_TC3_MSK_REG regptr(MSP_CIC_BASE + 0x18)
500 /* Thread Context 3 Int Mask */
501#define CIC_TC4_MSK_REG regptr(MSP_CIC_BASE + 0x18)
502 /* Thread Context 4 Int Mask */
503#define CIC_PCIMSI_STS_REG regptr(MSP_CIC_BASE + 0x18)
504#define CIC_PCIMSI_MSK_REG regptr(MSP_CIC_BASE + 0x18)
505#define CIC_PCIFLSH_REG regptr(MSP_CIC_BASE + 0x18)
506#define CIC_VPE0_SWINT_REG regptr(MSP_CIC_BASE + 0x08)
507
508
509/*
510 ***************************************************************************
511 * Memory controller registers *
512 ***************************************************************************
513 */
514#define MEM_CFG1_REG regptr(MSP_MEM_CFG_BASE + 0x00)
515#define MEM_SS_ADDR regptr(MSP_MEM_CFG_BASE + 0x00)
516#define MEM_SS_DATA regptr(MSP_MEM_CFG_BASE + 0x04)
517#define MEM_SS_WRITE regptr(MSP_MEM_CFG_BASE + 0x08)
518
519/*
520 ***************************************************************************
521 * PCI controller registers *
522 ***************************************************************************
523 */
524#define PCI_BASE_REG regptr(MSP_PCI_BASE + 0x00)
525#define PCI_CONFIG_SPACE_REG regptr(MSP_PCI_BASE + 0x800)
526#define PCI_JTAG_DEVID_REG regptr(MSP_SLP_BASE + 0x13c)
527
528/*
529 ########################################################################
530 # Register content & macro definitions #
531 ########################################################################
532 */
533
534/*
535 ***************************************************************************
536 * DEV_ID defines *
537 ***************************************************************************
538 */
539#define DEV_ID_PCI_DIS (1 << 26) /* Set if PCI disabled */
540#define DEV_ID_PCI_HOST (1 << 20) /* Set if PCI host */
541#define DEV_ID_SINGLE_PC (1 << 19) /* Set if single PC Card */
542#define DEV_ID_FAMILY (0xff << 8) /* family ID code */
543#define POLO_ZEUS_SUB_FAMILY (0x7 << 16) /* sub family for Polo/Zeus */
544
545#define MSPFPGA_ID (0x00 << 8) /* you are on your own here */
546#define MSP5000_ID (0x50 << 8)
547#define MSP4F00_ID (0x4f << 8) /* FPGA version of MSP4200 */
548#define MSP4E00_ID (0x4f << 8) /* FPGA version of MSP7120 */
549#define MSP4200_ID (0x42 << 8)
550#define MSP4000_ID (0x40 << 8)
551#define MSP2XXX_ID (0x20 << 8)
552#define MSPZEUS_ID (0x10 << 8)
553
554#define MSP2004_SUB_ID (0x0 << 16)
555#define MSP2005_SUB_ID (0x1 << 16)
556#define MSP2006_SUB_ID (0x1 << 16)
557#define MSP2007_SUB_ID (0x2 << 16)
558#define MSP2010_SUB_ID (0x3 << 16)
559#define MSP2015_SUB_ID (0x4 << 16)
560#define MSP2020_SUB_ID (0x5 << 16)
561#define MSP2100_SUB_ID (0x6 << 16)
562
563/*
564 ***************************************************************************
565 * RESET defines *
566 ***************************************************************************
567 */
568#define MSP_GR_RST (0x01 << 0) /* Global reset bit */
569#define MSP_MR_RST (0x01 << 1) /* MIPS reset bit */
570#define MSP_PD_RST (0x01 << 2) /* PVC DMA reset bit */
571#define MSP_PP_RST (0x01 << 3) /* PVC reset bit */
572/* reserved */
573#define MSP_EA_RST (0x01 << 6) /* Mac A reset bit */
574#define MSP_EB_RST (0x01 << 7) /* Mac B reset bit */
575#define MSP_SE_RST (0x01 << 8) /* Security Eng reset bit */
576#define MSP_PB_RST (0x01 << 9) /* Per block reset bit */
577#define MSP_EC_RST (0x01 << 10) /* Mac C reset bit */
578#define MSP_TW_RST (0x01 << 11) /* TWI reset bit */
579#define MSP_SPI_RST (0x01 << 12) /* SPI/MPI reset bit */
580#define MSP_U1_RST (0x01 << 13) /* UART1 reset bit */
581#define MSP_U0_RST (0x01 << 14) /* UART0 reset bit */
582
583/*
584 ***************************************************************************
585 * UART defines *
586 ***************************************************************************
587 */
588#define MSP_BASE_BAUD 25000000
589#define MSP_UART_REG_LEN 0x20
590
591/*
592 ***************************************************************************
593 * ELB defines *
594 ***************************************************************************
595 */
596#define PCCARD_32 0x02 /* Set if is PCCARD 32 (Cardbus) */
597#define SINGLE_PCCARD 0x01 /* Set to enable single PC card */
598
599/*
600 ***************************************************************************
601 * CIC defines *
602 ***************************************************************************
603 */
604
605/* CIC_EXT_CFG_REG */
606#define EXT_INT_POL(eirq) (1 << (eirq + 8))
607#define EXT_INT_EDGE(eirq) (1 << eirq)
608
609#define CIC_EXT_SET_TRIGGER_LEVEL(reg, eirq) (reg &= ~EXT_INT_EDGE(eirq))
610#define CIC_EXT_SET_TRIGGER_EDGE(reg, eirq) (reg |= EXT_INT_EDGE(eirq))
611#define CIC_EXT_SET_ACTIVE_HI(reg, eirq) (reg |= EXT_INT_POL(eirq))
612#define CIC_EXT_SET_ACTIVE_LO(reg, eirq) (reg &= ~EXT_INT_POL(eirq))
613#define CIC_EXT_SET_ACTIVE_RISING CIC_EXT_SET_ACTIVE_HI
614#define CIC_EXT_SET_ACTIVE_FALLING CIC_EXT_SET_ACTIVE_LO
615
616#define CIC_EXT_IS_TRIGGER_LEVEL(reg, eirq) \
617 ((reg & EXT_INT_EDGE(eirq)) == 0)
618#define CIC_EXT_IS_TRIGGER_EDGE(reg, eirq) (reg & EXT_INT_EDGE(eirq))
619#define CIC_EXT_IS_ACTIVE_HI(reg, eirq) (reg & EXT_INT_POL(eirq))
620#define CIC_EXT_IS_ACTIVE_LO(reg, eirq) \
621 ((reg & EXT_INT_POL(eirq)) == 0)
622#define CIC_EXT_IS_ACTIVE_RISING CIC_EXT_IS_ACTIVE_HI
623#define CIC_EXT_IS_ACTIVE_FALLING CIC_EXT_IS_ACTIVE_LO
624
625/*
626 ***************************************************************************
627 * Memory Controller defines *
628 ***************************************************************************
629 */
630
631/* Indirect memory controller registers */
632#define DDRC_CFG(n) (n)
633#define DDRC_DEBUG(n) (0x04 + n)
634#define DDRC_CTL(n) (0x40 + n)
635
636/* Macro to perform DDRC indirect write */
637#define DDRC_INDIRECT_WRITE(reg, mask, value) \
638({ \
639 *MEM_SS_ADDR = (((mask) & 0xf) << 8) | ((reg) & 0xff); \
640 *MEM_SS_DATA = (value); \
641 *MEM_SS_WRITE = 1; \
642})
643
644/*
645 ***************************************************************************
646 * SPI/MPI Mode *
647 ***************************************************************************
648 */
649#define SPI_MPI_RX_BUSY 0x00008000 /* SPI/MPI Receive Busy */
650#define SPI_MPI_FIFO_EMPTY 0x00004000 /* SPI/MPI Fifo Empty */
651#define SPI_MPI_TX_BUSY 0x00002000 /* SPI/MPI Transmit Busy */
652#define SPI_MPI_FIFO_FULL 0x00001000 /* SPI/MPU FIFO full */
653
654/*
655 ***************************************************************************
656 * SPI/MPI Control Register *
657 ***************************************************************************
658 */
659#define SPI_MPI_RX_START 0x00000004 /* Start receive command */
660#define SPI_MPI_FLUSH_Q 0x00000002 /* Flush SPI/MPI Queue */
661#define SPI_MPI_TX_START 0x00000001 /* Start Transmit Command */
662
663#endif /* !_ASM_MSP_REGS_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h
deleted file mode 100644
index 96d4c8ce8c83..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h
+++ /dev/null
@@ -1,141 +0,0 @@
1/*
2 * Defines for the MSP interrupt controller.
3 *
4 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
5 * Author: Carsten Langgaard, carstenl@mips.com
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 */
24
25#ifndef _MSP_SLP_INT_H
26#define _MSP_SLP_INT_H
27
28/*
29 * The PMC-Sierra SLP interrupts are arranged in a 3 level cascaded
30 * hierarchical system. The first level are the direct MIPS interrupts
31 * and are assigned the interrupt range 0-7. The second level is the SLM
32 * interrupt controller and is assigned the range 8-39. The third level
33 * comprises the Peripherial block, the PCI block, the PCI MSI block and
34 * the SLP. The PCI interrupts and the SLP errors are handled by the
35 * relevant subsystems so the core interrupt code needs only concern
36 * itself with the Peripheral block. These are assigned interrupts in
37 * the range 40-71.
38 */
39
40/*
41 * IRQs directly connected to CPU
42 */
43#define MSP_MIPS_INTBASE 0
44#define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */
45#define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */
46#define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */
47#define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */
48#define MSP_INT_C_IRQ2 4 /* Wired off, C_IRQ2 */
49#define MSP_INT_VE 5 /* IRQ for Voice Engine, C_IRQ3 */
50#define MSP_INT_SLP 6 /* IRQ for SLM block, C_IRQ4 */
51#define MSP_INT_TIMER 7 /* IRQ for the MIPS timer, C_IRQ5 */
52
53/*
54 * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4)
55 * These defines should be tied to the register definition for the SLM
56 * interrupt routine. For now, just use hard-coded values.
57 */
58#define MSP_SLP_INTBASE (MSP_MIPS_INTBASE + 8)
59#define MSP_INT_EXT0 (MSP_SLP_INTBASE + 0)
60 /* External interrupt 0 */
61#define MSP_INT_EXT1 (MSP_SLP_INTBASE + 1)
62 /* External interrupt 1 */
63#define MSP_INT_EXT2 (MSP_SLP_INTBASE + 2)
64 /* External interrupt 2 */
65#define MSP_INT_EXT3 (MSP_SLP_INTBASE + 3)
66 /* External interrupt 3 */
67/* Reserved 4-7 */
68
69/*
70 *************************************************************************
71 * DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER *
72 * Some MSP produces have this interrupt labelled as Voice and some are *
73 * SEC mbox ... *
74 *************************************************************************
75 */
76#define MSP_INT_SLP_VE (MSP_SLP_INTBASE + 8)
77 /* Cascaded IRQ for Voice Engine*/
78#define MSP_INT_SLP_TDM (MSP_SLP_INTBASE + 9)
79 /* TDM interrupt */
80#define MSP_INT_SLP_MAC0 (MSP_SLP_INTBASE + 10)
81 /* Cascaded IRQ for MAC 0 */
82#define MSP_INT_SLP_MAC1 (MSP_SLP_INTBASE + 11)
83 /* Cascaded IRQ for MAC 1 */
84#define MSP_INT_SEC (MSP_SLP_INTBASE + 12)
85 /* IRQ for security engine */
86#define MSP_INT_PER (MSP_SLP_INTBASE + 13)
87 /* Peripheral interrupt */
88#define MSP_INT_TIMER0 (MSP_SLP_INTBASE + 14)
89 /* SLP timer 0 */
90#define MSP_INT_TIMER1 (MSP_SLP_INTBASE + 15)
91 /* SLP timer 1 */
92#define MSP_INT_TIMER2 (MSP_SLP_INTBASE + 16)
93 /* SLP timer 2 */
94#define MSP_INT_SLP_TIMER (MSP_SLP_INTBASE + 17)
95 /* Cascaded MIPS timer */
96#define MSP_INT_BLKCP (MSP_SLP_INTBASE + 18)
97 /* Block Copy */
98#define MSP_INT_UART0 (MSP_SLP_INTBASE + 19)
99 /* UART 0 */
100#define MSP_INT_PCI (MSP_SLP_INTBASE + 20)
101 /* PCI subsystem */
102#define MSP_INT_PCI_DBELL (MSP_SLP_INTBASE + 21)
103 /* PCI doorbell */
104#define MSP_INT_PCI_MSI (MSP_SLP_INTBASE + 22)
105 /* PCI Message Signal */
106#define MSP_INT_PCI_BC0 (MSP_SLP_INTBASE + 23)
107 /* PCI Block Copy 0 */
108#define MSP_INT_PCI_BC1 (MSP_SLP_INTBASE + 24)
109 /* PCI Block Copy 1 */
110#define MSP_INT_SLP_ERR (MSP_SLP_INTBASE + 25)
111 /* SLP error condition */
112#define MSP_INT_MAC2 (MSP_SLP_INTBASE + 26)
113 /* IRQ for MAC2 */
114/* Reserved 26-31 */
115
116/*
117 * IRQs cascaded on SLP PER interrupt (MSP_INT_PER)
118 */
119#define MSP_PER_INTBASE (MSP_SLP_INTBASE + 32)
120/* Reserved 0-1 */
121#define MSP_INT_UART1 (MSP_PER_INTBASE + 2)
122 /* UART 1 */
123/* Reserved 3-5 */
124#define MSP_INT_2WIRE (MSP_PER_INTBASE + 6)
125 /* 2-wire */
126#define MSP_INT_TM0 (MSP_PER_INTBASE + 7)
127 /* Peripheral timer block out 0 */
128#define MSP_INT_TM1 (MSP_PER_INTBASE + 8)
129 /* Peripheral timer block out 1 */
130/* Reserved 9 */
131#define MSP_INT_SPRX (MSP_PER_INTBASE + 10)
132 /* SPI RX complete */
133#define MSP_INT_SPTX (MSP_PER_INTBASE + 11)
134 /* SPI TX complete */
135#define MSP_INT_GPIO (MSP_PER_INTBASE + 12)
136 /* GPIO */
137#define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13)
138 /* Peripheral error */
139/* Reserved 14-31 */
140
141#endif /* !_MSP_SLP_INT_H */
diff --git a/include/asm-mips/pmc-sierra/msp71xx/war.h b/include/asm-mips/pmc-sierra/msp71xx/war.h
deleted file mode 100644
index 0bf48fc1892b..000000000000
--- a/include/asm-mips/pmc-sierra/msp71xx/war.h
+++ /dev/null
@@ -1,28 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_PMC_SIERRA_WAR_H
9#define __ASM_MIPS_PMC_SIERRA_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \
24 defined(CONFIG_PMC_MSP7120_FPGA)
25#define MIPS34K_MISSED_ITLB_WAR 1
26#endif
27
28#endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */
diff --git a/include/asm-mips/pmon.h b/include/asm-mips/pmon.h
deleted file mode 100644
index 6ad519189ce2..000000000000
--- a/include/asm-mips/pmon.h
+++ /dev/null
@@ -1,46 +0,0 @@
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 * Copyright (C) 2004 by Ralf Baechle
7 *
8 * The cpustart method is a PMC-Sierra's function to start the secondary CPU.
9 * Stock PMON 2000 has the smpfork, semlock and semunlock methods instead.
10 */
11#ifndef _ASM_PMON_H
12#define _ASM_PMON_H
13
14struct callvectors {
15 int (*open) (char*, int, int);
16 int (*close) (int);
17 int (*read) (int, void*, int);
18 int (*write) (int, void*, int);
19 off_t (*lseek) (int, off_t, int);
20 int (*printf) (const char*, ...);
21 void (*cacheflush) (void);
22 char* (*gets) (char*);
23 union {
24 int (*smpfork) (unsigned long cp, char *sp);
25 int (*cpustart) (long, void (*)(void), void *, long);
26 } _s;
27 int (*semlock) (int sem);
28 void (*semunlock) (int sem);
29};
30
31extern struct callvectors *debug_vectors;
32
33#define pmon_open(name, flags, mode) debug_vectors->open(name, flage, mode)
34#define pmon_close(fd) debug_vectors->close(fd)
35#define pmon_read(fd, buf, count) debug_vectors->read(fd, buf, count)
36#define pmon_write(fd, buf, count) debug_vectors->write(fd, buf, count)
37#define pmon_lseek(fd, off, whence) debug_vectors->lseek(fd, off, whence)
38#define pmon_printf(fmt...) debug_vectors->printf(fmt)
39#define pmon_cacheflush() debug_vectors->cacheflush()
40#define pmon_gets(s) debug_vectors->gets(s)
41#define pmon_cpustart(n, f, sp, gp) debug_vectors->_s.cpustart(n, f, sp, gp)
42#define pmon_smpfork(cp, sp) debug_vectors->_s.smpfork(cp, sp)
43#define pmon_semlock(sem) debug_vectors->semlock(sem)
44#define pmon_semunlock(sem) debug_vectors->semunlock(sem)
45
46#endif /* _ASM_PMON_H */
diff --git a/include/asm-mips/poll.h b/include/asm-mips/poll.h
deleted file mode 100644
index 47b952080431..000000000000
--- a/include/asm-mips/poll.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __ASM_POLL_H
2#define __ASM_POLL_H
3
4#define POLLWRNORM POLLOUT
5#define POLLWRBAND 0x0100
6
7#include <asm-generic/poll.h>
8
9#endif /* __ASM_POLL_H */
diff --git a/include/asm-mips/posix_types.h b/include/asm-mips/posix_types.h
deleted file mode 100644
index c200102c8586..000000000000
--- a/include/asm-mips/posix_types.h
+++ /dev/null
@@ -1,144 +0,0 @@
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 * Copyright (C) 1996, 97, 98, 99, 2000 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_POSIX_TYPES_H
10#define _ASM_POSIX_TYPES_H
11
12#include <asm/sgidefs.h>
13
14/*
15 * This file is generally used by user-level software, so you need to
16 * be a little careful about namespace pollution etc. Also, we cannot
17 * assume GCC is being used.
18 */
19
20typedef unsigned long __kernel_ino_t;
21typedef unsigned int __kernel_mode_t;
22#if (_MIPS_SZLONG == 32)
23typedef unsigned long __kernel_nlink_t;
24#endif
25#if (_MIPS_SZLONG == 64)
26typedef unsigned int __kernel_nlink_t;
27#endif
28typedef long __kernel_off_t;
29typedef int __kernel_pid_t;
30typedef int __kernel_ipc_pid_t;
31typedef unsigned int __kernel_uid_t;
32typedef unsigned int __kernel_gid_t;
33#if (_MIPS_SZLONG == 32)
34typedef unsigned int __kernel_size_t;
35typedef int __kernel_ssize_t;
36typedef int __kernel_ptrdiff_t;
37#endif
38#if (_MIPS_SZLONG == 64)
39typedef unsigned long __kernel_size_t;
40typedef long __kernel_ssize_t;
41typedef long __kernel_ptrdiff_t;
42#endif
43typedef long __kernel_time_t;
44typedef long __kernel_suseconds_t;
45typedef long __kernel_clock_t;
46typedef int __kernel_timer_t;
47typedef int __kernel_clockid_t;
48typedef long __kernel_daddr_t;
49typedef char * __kernel_caddr_t;
50
51typedef unsigned short __kernel_uid16_t;
52typedef unsigned short __kernel_gid16_t;
53typedef unsigned int __kernel_uid32_t;
54typedef unsigned int __kernel_gid32_t;
55typedef __kernel_uid_t __kernel_old_uid_t;
56typedef __kernel_gid_t __kernel_old_gid_t;
57typedef unsigned int __kernel_old_dev_t;
58
59#ifdef __GNUC__
60typedef long long __kernel_loff_t;
61#endif
62
63typedef struct {
64#if (_MIPS_SZLONG == 32)
65 long val[2];
66#endif
67#if (_MIPS_SZLONG == 64)
68 int val[2];
69#endif
70} __kernel_fsid_t;
71
72#if defined(__KERNEL__)
73
74#undef __FD_SET
75static __inline__ void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp)
76{
77 unsigned long __tmp = __fd / __NFDBITS;
78 unsigned long __rem = __fd % __NFDBITS;
79 __fdsetp->fds_bits[__tmp] |= (1UL<<__rem);
80}
81
82#undef __FD_CLR
83static __inline__ void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp)
84{
85 unsigned long __tmp = __fd / __NFDBITS;
86 unsigned long __rem = __fd % __NFDBITS;
87 __fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem);
88}
89
90#undef __FD_ISSET
91static __inline__ int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p)
92{
93 unsigned long __tmp = __fd / __NFDBITS;
94 unsigned long __rem = __fd % __NFDBITS;
95 return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0;
96}
97
98/*
99 * This will unroll the loop for the normal constant case (8 ints,
100 * for a 256-bit fd_set)
101 */
102#undef __FD_ZERO
103static __inline__ void __FD_ZERO(__kernel_fd_set *__p)
104{
105 unsigned long *__tmp = __p->fds_bits;
106 int __i;
107
108 if (__builtin_constant_p(__FDSET_LONGS)) {
109 switch (__FDSET_LONGS) {
110 case 16:
111 __tmp[ 0] = 0; __tmp[ 1] = 0;
112 __tmp[ 2] = 0; __tmp[ 3] = 0;
113 __tmp[ 4] = 0; __tmp[ 5] = 0;
114 __tmp[ 6] = 0; __tmp[ 7] = 0;
115 __tmp[ 8] = 0; __tmp[ 9] = 0;
116 __tmp[10] = 0; __tmp[11] = 0;
117 __tmp[12] = 0; __tmp[13] = 0;
118 __tmp[14] = 0; __tmp[15] = 0;
119 return;
120
121 case 8:
122 __tmp[ 0] = 0; __tmp[ 1] = 0;
123 __tmp[ 2] = 0; __tmp[ 3] = 0;
124 __tmp[ 4] = 0; __tmp[ 5] = 0;
125 __tmp[ 6] = 0; __tmp[ 7] = 0;
126 return;
127
128 case 4:
129 __tmp[ 0] = 0; __tmp[ 1] = 0;
130 __tmp[ 2] = 0; __tmp[ 3] = 0;
131 return;
132 }
133 }
134 __i = __FDSET_LONGS;
135 while (__i) {
136 __i--;
137 *__tmp = 0;
138 __tmp++;
139 }
140}
141
142#endif /* defined(__KERNEL__) */
143
144#endif /* _ASM_POSIX_TYPES_H */
diff --git a/include/asm-mips/prefetch.h b/include/asm-mips/prefetch.h
deleted file mode 100644
index 17850834ccb0..000000000000
--- a/include/asm-mips/prefetch.h
+++ /dev/null
@@ -1,87 +0,0 @@
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 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_PREFETCH_H
9#define __ASM_PREFETCH_H
10
11
12/*
13 * R5000 and RM5200 implements pref and prefx instructions but they're nops, so
14 * rather than wasting time we pretend these processors don't support
15 * prefetching at all.
16 *
17 * R5432 implements Load, Store, LoadStreamed, StoreStreamed, LoadRetained,
18 * StoreRetained and WriteBackInvalidate but not Pref_PrepareForStore.
19 *
20 * Hell (and the book on my shelf I can't open ...) know what the R8000 does.
21 *
22 * RM7000 version 1.0 interprets all hints as Pref_Load; version 2.0 implements
23 * Pref_PrepareForStore also.
24 *
25 * RM9000 is MIPS IV but implements prefetching like MIPS32/MIPS64; it's
26 * Pref_WriteBackInvalidate is a nop and Pref_PrepareForStore is broken in
27 * current versions due to erratum G105.
28 *
29 * VR7701 only implements the Load prefetch.
30 *
31 * Finally MIPS32 and MIPS64 implement all of the following hints.
32 */
33
34#define Pref_Load 0
35#define Pref_Store 1
36 /* 2 and 3 are reserved */
37#define Pref_LoadStreamed 4
38#define Pref_StoreStreamed 5
39#define Pref_LoadRetained 6
40#define Pref_StoreRetained 7
41 /* 8 ... 24 are reserved */
42#define Pref_WriteBackInvalidate 25
43#define Pref_PrepareForStore 30
44
45#ifdef __ASSEMBLY__
46
47 .macro __pref hint addr
48#ifdef CONFIG_CPU_HAS_PREFETCH
49 pref \hint, \addr
50#endif
51 .endm
52
53 .macro pref_load addr
54 __pref Pref_Load, \addr
55 .endm
56
57 .macro pref_store addr
58 __pref Pref_Store, \addr
59 .endm
60
61 .macro pref_load_streamed addr
62 __pref Pref_LoadStreamed, \addr
63 .endm
64
65 .macro pref_store_streamed addr
66 __pref Pref_StoreStreamed, \addr
67 .endm
68
69 .macro pref_load_retained addr
70 __pref Pref_LoadRetained, \addr
71 .endm
72
73 .macro pref_store_retained addr
74 __pref Pref_StoreRetained, \addr
75 .endm
76
77 .macro pref_wback_inv addr
78 __pref Pref_WriteBackInvalidate, \addr
79 .endm
80
81 .macro pref_prepare_for_store addr
82 __pref Pref_PrepareForStore, \addr
83 .endm
84
85#endif
86
87#endif /* __ASM_PREFETCH_H */
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
deleted file mode 100644
index a1e4453469f9..000000000000
--- a/include/asm-mips/processor.h
+++ /dev/null
@@ -1,263 +0,0 @@
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 * Copyright (C) 1994 Waldorf GMBH
7 * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle
8 * Copyright (C) 1996 Paul M. Antoine
9 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
10 */
11#ifndef _ASM_PROCESSOR_H
12#define _ASM_PROCESSOR_H
13
14#include <linux/cpumask.h>
15#include <linux/threads.h>
16
17#include <asm/cachectl.h>
18#include <asm/cpu.h>
19#include <asm/cpu-info.h>
20#include <asm/mipsregs.h>
21#include <asm/prefetch.h>
22#include <asm/system.h>
23
24/*
25 * Return current * instruction pointer ("program counter").
26 */
27#define current_text_addr() ({ __label__ _l; _l: &&_l;})
28
29/*
30 * System setup and hardware flags..
31 */
32extern void (*cpu_wait)(void);
33
34extern unsigned int vced_count, vcei_count;
35
36#ifdef CONFIG_32BIT
37/*
38 * User space process size: 2GB. This is hardcoded into a few places,
39 * so don't change it unless you know what you are doing.
40 */
41#define TASK_SIZE 0x7fff8000UL
42#define STACK_TOP TASK_SIZE
43
44/*
45 * This decides where the kernel will search for a free chunk of vm
46 * space during mmap's.
47 */
48#define TASK_UNMAPPED_BASE ((TASK_SIZE / 3) & ~(PAGE_SIZE))
49#endif
50
51#ifdef CONFIG_64BIT
52/*
53 * User space process size: 1TB. This is hardcoded into a few places,
54 * so don't change it unless you know what you are doing. TASK_SIZE
55 * is limited to 1TB by the R4000 architecture; R10000 and better can
56 * support 16TB; the architectural reserve for future expansion is
57 * 8192EB ...
58 */
59#define TASK_SIZE32 0x7fff8000UL
60#define TASK_SIZE 0x10000000000UL
61#define STACK_TOP \
62 (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)
63
64/*
65 * This decides where the kernel will search for a free chunk of vm
66 * space during mmap's.
67 */
68#define TASK_UNMAPPED_BASE \
69 (test_thread_flag(TIF_32BIT_ADDR) ? \
70 PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3))
71#define TASK_SIZE_OF(tsk) \
72 (test_tsk_thread_flag(tsk, TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)
73#endif
74
75#ifdef __KERNEL__
76#define STACK_TOP_MAX TASK_SIZE
77#endif
78
79#define NUM_FPU_REGS 32
80
81typedef __u64 fpureg_t;
82
83/*
84 * It would be nice to add some more fields for emulator statistics, but there
85 * are a number of fixed offsets in offset.h and elsewhere that would have to
86 * be recalculated by hand. So the additional information will be private to
87 * the FPU emulator for now. See asm-mips/fpu_emulator.h.
88 */
89
90struct mips_fpu_struct {
91 fpureg_t fpr[NUM_FPU_REGS];
92 unsigned int fcr31;
93};
94
95#define NUM_DSP_REGS 6
96
97typedef __u32 dspreg_t;
98
99struct mips_dsp_state {
100 dspreg_t dspr[NUM_DSP_REGS];
101 unsigned int dspcontrol;
102};
103
104#define INIT_CPUMASK { \
105 {0,} \
106}
107
108typedef struct {
109 unsigned long seg;
110} mm_segment_t;
111
112#define ARCH_MIN_TASKALIGN 8
113
114struct mips_abi;
115
116/*
117 * If you change thread_struct remember to change the #defines below too!
118 */
119struct thread_struct {
120 /* Saved main processor registers. */
121 unsigned long reg16;
122 unsigned long reg17, reg18, reg19, reg20, reg21, reg22, reg23;
123 unsigned long reg29, reg30, reg31;
124
125 /* Saved cp0 stuff. */
126 unsigned long cp0_status;
127
128 /* Saved fpu/fpu emulator stuff. */
129 struct mips_fpu_struct fpu;
130#ifdef CONFIG_MIPS_MT_FPAFF
131 /* Emulated instruction count */
132 unsigned long emulated_fp;
133 /* Saved per-thread scheduler affinity mask */
134 cpumask_t user_cpus_allowed;
135#endif /* CONFIG_MIPS_MT_FPAFF */
136
137 /* Saved state of the DSP ASE, if available. */
138 struct mips_dsp_state dsp;
139
140 /* Other stuff associated with the thread. */
141 unsigned long cp0_badvaddr; /* Last user fault */
142 unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */
143 unsigned long error_code;
144 unsigned long trap_no;
145 unsigned long irix_trampoline; /* Wheee... */
146 unsigned long irix_oldctx;
147 struct mips_abi *abi;
148};
149
150#ifdef CONFIG_MIPS_MT_FPAFF
151#define FPAFF_INIT \
152 .emulated_fp = 0, \
153 .user_cpus_allowed = INIT_CPUMASK,
154#else
155#define FPAFF_INIT
156#endif /* CONFIG_MIPS_MT_FPAFF */
157
158#define INIT_THREAD { \
159 /* \
160 * Saved main processor registers \
161 */ \
162 .reg16 = 0, \
163 .reg17 = 0, \
164 .reg18 = 0, \
165 .reg19 = 0, \
166 .reg20 = 0, \
167 .reg21 = 0, \
168 .reg22 = 0, \
169 .reg23 = 0, \
170 .reg29 = 0, \
171 .reg30 = 0, \
172 .reg31 = 0, \
173 /* \
174 * Saved cp0 stuff \
175 */ \
176 .cp0_status = 0, \
177 /* \
178 * Saved FPU/FPU emulator stuff \
179 */ \
180 .fpu = { \
181 .fpr = {0,}, \
182 .fcr31 = 0, \
183 }, \
184 /* \
185 * FPU affinity state (null if not FPAFF) \
186 */ \
187 FPAFF_INIT \
188 /* \
189 * Saved DSP stuff \
190 */ \
191 .dsp = { \
192 .dspr = {0, }, \
193 .dspcontrol = 0, \
194 }, \
195 /* \
196 * Other stuff associated with the process \
197 */ \
198 .cp0_badvaddr = 0, \
199 .cp0_baduaddr = 0, \
200 .error_code = 0, \
201 .trap_no = 0, \
202 .irix_trampoline = 0, \
203 .irix_oldctx = 0, \
204}
205
206struct task_struct;
207
208/* Free all resources held by a thread. */
209#define release_thread(thread) do { } while(0)
210
211/* Prepare to copy thread state - unlazy all lazy status */
212#define prepare_to_copy(tsk) do { } while (0)
213
214extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
215
216extern unsigned long thread_saved_pc(struct task_struct *tsk);
217
218/*
219 * Do necessary setup to start up a newly executed thread.
220 */
221extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp);
222
223unsigned long get_wchan(struct task_struct *p);
224
225#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32)
226#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1)
227#define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc)
228#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
229#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
230
231#define cpu_relax() barrier()
232
233/*
234 * Return_address is a replacement for __builtin_return_address(count)
235 * which on certain architectures cannot reasonably be implemented in GCC
236 * (MIPS, Alpha) or is unuseable with -fomit-frame-pointer (i386).
237 * Note that __builtin_return_address(x>=1) is forbidden because GCC
238 * aborts compilation on some CPUs. It's simply not possible to unwind
239 * some CPU's stackframes.
240 *
241 * __builtin_return_address works only for non-leaf functions. We avoid the
242 * overhead of a function call by forcing the compiler to save the return
243 * address register on the stack.
244 */
245#define return_address() ({__asm__ __volatile__("":::"$31");__builtin_return_address(0);})
246
247#ifdef CONFIG_CPU_HAS_PREFETCH
248
249#define ARCH_HAS_PREFETCH
250
251static inline void prefetch(const void *addr)
252{
253 __asm__ __volatile__(
254 " .set mips4 \n"
255 " pref %0, (%1) \n"
256 " .set mips0 \n"
257 :
258 : "i" (Pref_Load), "r" (addr));
259}
260
261#endif
262
263#endif /* _ASM_PROCESSOR_H */
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
deleted file mode 100644
index 786f7e3c99bc..000000000000
--- a/include/asm-mips/ptrace.h
+++ /dev/null
@@ -1,99 +0,0 @@
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 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_PTRACE_H
10#define _ASM_PTRACE_H
11
12
13/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
14#define FPR_BASE 32
15#define PC 64
16#define CAUSE 65
17#define BADVADDR 66
18#define MMHI 67
19#define MMLO 68
20#define FPC_CSR 69
21#define FPC_EIR 70
22#define DSP_BASE 71 /* 3 more hi / lo register pairs */
23#define DSP_CONTROL 77
24#define ACX 78
25
26/*
27 * This struct defines the way the registers are stored on the stack during a
28 * system call/exception. As usual the registers k0/k1 aren't being saved.
29 */
30struct pt_regs {
31#ifdef CONFIG_32BIT
32 /* Pad bytes for argument save space on the stack. */
33 unsigned long pad0[6];
34#endif
35
36 /* Saved main processor registers. */
37 unsigned long regs[32];
38
39 /* Saved special registers. */
40 unsigned long cp0_status;
41 unsigned long hi;
42 unsigned long lo;
43#ifdef CONFIG_CPU_HAS_SMARTMIPS
44 unsigned long acx;
45#endif
46 unsigned long cp0_badvaddr;
47 unsigned long cp0_cause;
48 unsigned long cp0_epc;
49#ifdef CONFIG_MIPS_MT_SMTC
50 unsigned long cp0_tcstatus;
51#endif /* CONFIG_MIPS_MT_SMTC */
52} __attribute__ ((aligned (8)));
53
54/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
55#define PTRACE_GETREGS 12
56#define PTRACE_SETREGS 13
57#define PTRACE_GETFPREGS 14
58#define PTRACE_SETFPREGS 15
59/* #define PTRACE_GETFPXREGS 18 */
60/* #define PTRACE_SETFPXREGS 19 */
61
62#define PTRACE_OLDSETOPTIONS 21
63
64#define PTRACE_GET_THREAD_AREA 25
65#define PTRACE_SET_THREAD_AREA 26
66
67/* Calls to trace a 64bit program from a 32bit program. */
68#define PTRACE_PEEKTEXT_3264 0xc0
69#define PTRACE_PEEKDATA_3264 0xc1
70#define PTRACE_POKETEXT_3264 0xc2
71#define PTRACE_POKEDATA_3264 0xc3
72#define PTRACE_GET_THREAD_AREA_3264 0xc4
73
74#ifdef __KERNEL__
75
76#include <linux/linkage.h>
77#include <asm/isadep.h>
78
79/*
80 * Does the process account for user or for system time?
81 */
82#define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
83
84#define instruction_pointer(regs) ((regs)->cp0_epc)
85#define profile_pc(regs) instruction_pointer(regs)
86
87extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
88
89extern NORET_TYPE void die(const char *, const struct pt_regs *) ATTRIB_NORET;
90
91static inline void die_if_kernel(const char *str, const struct pt_regs *regs)
92{
93 if (unlikely(!user_mode(regs)))
94 die(str, regs);
95}
96
97#endif
98
99#endif /* _ASM_PTRACE_H */
diff --git a/include/asm-mips/r4k-timer.h b/include/asm-mips/r4k-timer.h
deleted file mode 100644
index a37d12b3b61c..000000000000
--- a/include/asm-mips/r4k-timer.h
+++ /dev/null
@@ -1,30 +0,0 @@
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 * Copyright (C) 2008 by Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_R4K_TYPES_H
9#define __ASM_R4K_TYPES_H
10
11#include <linux/compiler.h>
12
13#ifdef CONFIG_SYNC_R4K
14
15extern void synchronise_count_master(void);
16extern void synchronise_count_slave(void);
17
18#else
19
20static inline void synchronise_count_master(void)
21{
22}
23
24static inline void synchronise_count_slave(void)
25{
26}
27
28#endif
29
30#endif /* __ASM_R4K_TYPES_H */
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h
deleted file mode 100644
index 4c140db36786..000000000000
--- a/include/asm-mips/r4kcache.h
+++ /dev/null
@@ -1,443 +0,0 @@
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 * Inline assembly cache operations.
7 *
8 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
9 * Copyright (C) 1997 - 2002 Ralf Baechle (ralf@gnu.org)
10 * Copyright (C) 2004 Ralf Baechle (ralf@linux-mips.org)
11 */
12#ifndef _ASM_R4KCACHE_H
13#define _ASM_R4KCACHE_H
14
15#include <asm/asm.h>
16#include <asm/cacheops.h>
17#include <asm/cpu-features.h>
18#include <asm/mipsmtregs.h>
19
20/*
21 * This macro return a properly sign-extended address suitable as base address
22 * for indexed cache operations. Two issues here:
23 *
24 * - The MIPS32 and MIPS64 specs permit an implementation to directly derive
25 * the index bits from the virtual address. This breaks with tradition
26 * set by the R4000. To keep unpleasant surprises from happening we pick
27 * an address in KSEG0 / CKSEG0.
28 * - We need a properly sign extended address for 64-bit code. To get away
29 * without ifdefs we let the compiler do it by a type cast.
30 */
31#define INDEX_BASE CKSEG0
32
33#define cache_op(op,addr) \
34 __asm__ __volatile__( \
35 " .set push \n" \
36 " .set noreorder \n" \
37 " .set mips3\n\t \n" \
38 " cache %0, %1 \n" \
39 " .set pop \n" \
40 : \
41 : "i" (op), "R" (*(unsigned char *)(addr)))
42
43#ifdef CONFIG_MIPS_MT
44/*
45 * Temporary hacks for SMTC debug. Optionally force single-threaded
46 * execution during I-cache flushes.
47 */
48
49#define PROTECT_CACHE_FLUSHES 1
50
51#ifdef PROTECT_CACHE_FLUSHES
52
53extern int mt_protiflush;
54extern int mt_protdflush;
55extern void mt_cflush_lockdown(void);
56extern void mt_cflush_release(void);
57
58#define BEGIN_MT_IPROT \
59 unsigned long flags = 0; \
60 unsigned long mtflags = 0; \
61 if(mt_protiflush) { \
62 local_irq_save(flags); \
63 ehb(); \
64 mtflags = dvpe(); \
65 mt_cflush_lockdown(); \
66 }
67
68#define END_MT_IPROT \
69 if(mt_protiflush) { \
70 mt_cflush_release(); \
71 evpe(mtflags); \
72 local_irq_restore(flags); \
73 }
74
75#define BEGIN_MT_DPROT \
76 unsigned long flags = 0; \
77 unsigned long mtflags = 0; \
78 if(mt_protdflush) { \
79 local_irq_save(flags); \
80 ehb(); \
81 mtflags = dvpe(); \
82 mt_cflush_lockdown(); \
83 }
84
85#define END_MT_DPROT \
86 if(mt_protdflush) { \
87 mt_cflush_release(); \
88 evpe(mtflags); \
89 local_irq_restore(flags); \
90 }
91
92#else
93
94#define BEGIN_MT_IPROT
95#define BEGIN_MT_DPROT
96#define END_MT_IPROT
97#define END_MT_DPROT
98
99#endif /* PROTECT_CACHE_FLUSHES */
100
101#define __iflush_prologue \
102 unsigned long redundance; \
103 extern int mt_n_iflushes; \
104 BEGIN_MT_IPROT \
105 for (redundance = 0; redundance < mt_n_iflushes; redundance++) {
106
107#define __iflush_epilogue \
108 END_MT_IPROT \
109 }
110
111#define __dflush_prologue \
112 unsigned long redundance; \
113 extern int mt_n_dflushes; \
114 BEGIN_MT_DPROT \
115 for (redundance = 0; redundance < mt_n_dflushes; redundance++) {
116
117#define __dflush_epilogue \
118 END_MT_DPROT \
119 }
120
121#define __inv_dflush_prologue __dflush_prologue
122#define __inv_dflush_epilogue __dflush_epilogue
123#define __sflush_prologue {
124#define __sflush_epilogue }
125#define __inv_sflush_prologue __sflush_prologue
126#define __inv_sflush_epilogue __sflush_epilogue
127
128#else /* CONFIG_MIPS_MT */
129
130#define __iflush_prologue {
131#define __iflush_epilogue }
132#define __dflush_prologue {
133#define __dflush_epilogue }
134#define __inv_dflush_prologue {
135#define __inv_dflush_epilogue }
136#define __sflush_prologue {
137#define __sflush_epilogue }
138#define __inv_sflush_prologue {
139#define __inv_sflush_epilogue }
140
141#endif /* CONFIG_MIPS_MT */
142
143static inline void flush_icache_line_indexed(unsigned long addr)
144{
145 __iflush_prologue
146 cache_op(Index_Invalidate_I, addr);
147 __iflush_epilogue
148}
149
150static inline void flush_dcache_line_indexed(unsigned long addr)
151{
152 __dflush_prologue
153 cache_op(Index_Writeback_Inv_D, addr);
154 __dflush_epilogue
155}
156
157static inline void flush_scache_line_indexed(unsigned long addr)
158{
159 cache_op(Index_Writeback_Inv_SD, addr);
160}
161
162static inline void flush_icache_line(unsigned long addr)
163{
164 __iflush_prologue
165 cache_op(Hit_Invalidate_I, addr);
166 __iflush_epilogue
167}
168
169static inline void flush_dcache_line(unsigned long addr)
170{
171 __dflush_prologue
172 cache_op(Hit_Writeback_Inv_D, addr);
173 __dflush_epilogue
174}
175
176static inline void invalidate_dcache_line(unsigned long addr)
177{
178 __dflush_prologue
179 cache_op(Hit_Invalidate_D, addr);
180 __dflush_epilogue
181}
182
183static inline void invalidate_scache_line(unsigned long addr)
184{
185 cache_op(Hit_Invalidate_SD, addr);
186}
187
188static inline void flush_scache_line(unsigned long addr)
189{
190 cache_op(Hit_Writeback_Inv_SD, addr);
191}
192
193#define protected_cache_op(op,addr) \
194 __asm__ __volatile__( \
195 " .set push \n" \
196 " .set noreorder \n" \
197 " .set mips3 \n" \
198 "1: cache %0, (%1) \n" \
199 "2: .set pop \n" \
200 " .section __ex_table,\"a\" \n" \
201 " "STR(PTR)" 1b, 2b \n" \
202 " .previous" \
203 : \
204 : "i" (op), "r" (addr))
205
206/*
207 * The next two are for badland addresses like signal trampolines.
208 */
209static inline void protected_flush_icache_line(unsigned long addr)
210{
211 protected_cache_op(Hit_Invalidate_I, addr);
212}
213
214/*
215 * R10000 / R12000 hazard - these processors don't support the Hit_Writeback_D
216 * cacheop so we use Hit_Writeback_Inv_D which is supported by all R4000-style
217 * caches. We're talking about one cacheline unnecessarily getting invalidated
218 * here so the penalty isn't overly hard.
219 */
220static inline void protected_writeback_dcache_line(unsigned long addr)
221{
222 protected_cache_op(Hit_Writeback_Inv_D, addr);
223}
224
225static inline void protected_writeback_scache_line(unsigned long addr)
226{
227 protected_cache_op(Hit_Writeback_Inv_SD, addr);
228}
229
230/*
231 * This one is RM7000-specific
232 */
233static inline void invalidate_tcache_page(unsigned long addr)
234{
235 cache_op(Page_Invalidate_T, addr);
236}
237
238#define cache16_unroll32(base,op) \
239 __asm__ __volatile__( \
240 " .set push \n" \
241 " .set noreorder \n" \
242 " .set mips3 \n" \
243 " cache %1, 0x000(%0); cache %1, 0x010(%0) \n" \
244 " cache %1, 0x020(%0); cache %1, 0x030(%0) \n" \
245 " cache %1, 0x040(%0); cache %1, 0x050(%0) \n" \
246 " cache %1, 0x060(%0); cache %1, 0x070(%0) \n" \
247 " cache %1, 0x080(%0); cache %1, 0x090(%0) \n" \
248 " cache %1, 0x0a0(%0); cache %1, 0x0b0(%0) \n" \
249 " cache %1, 0x0c0(%0); cache %1, 0x0d0(%0) \n" \
250 " cache %1, 0x0e0(%0); cache %1, 0x0f0(%0) \n" \
251 " cache %1, 0x100(%0); cache %1, 0x110(%0) \n" \
252 " cache %1, 0x120(%0); cache %1, 0x130(%0) \n" \
253 " cache %1, 0x140(%0); cache %1, 0x150(%0) \n" \
254 " cache %1, 0x160(%0); cache %1, 0x170(%0) \n" \
255 " cache %1, 0x180(%0); cache %1, 0x190(%0) \n" \
256 " cache %1, 0x1a0(%0); cache %1, 0x1b0(%0) \n" \
257 " cache %1, 0x1c0(%0); cache %1, 0x1d0(%0) \n" \
258 " cache %1, 0x1e0(%0); cache %1, 0x1f0(%0) \n" \
259 " .set pop \n" \
260 : \
261 : "r" (base), \
262 "i" (op));
263
264#define cache32_unroll32(base,op) \
265 __asm__ __volatile__( \
266 " .set push \n" \
267 " .set noreorder \n" \
268 " .set mips3 \n" \
269 " cache %1, 0x000(%0); cache %1, 0x020(%0) \n" \
270 " cache %1, 0x040(%0); cache %1, 0x060(%0) \n" \
271 " cache %1, 0x080(%0); cache %1, 0x0a0(%0) \n" \
272 " cache %1, 0x0c0(%0); cache %1, 0x0e0(%0) \n" \
273 " cache %1, 0x100(%0); cache %1, 0x120(%0) \n" \
274 " cache %1, 0x140(%0); cache %1, 0x160(%0) \n" \
275 " cache %1, 0x180(%0); cache %1, 0x1a0(%0) \n" \
276 " cache %1, 0x1c0(%0); cache %1, 0x1e0(%0) \n" \
277 " cache %1, 0x200(%0); cache %1, 0x220(%0) \n" \
278 " cache %1, 0x240(%0); cache %1, 0x260(%0) \n" \
279 " cache %1, 0x280(%0); cache %1, 0x2a0(%0) \n" \
280 " cache %1, 0x2c0(%0); cache %1, 0x2e0(%0) \n" \
281 " cache %1, 0x300(%0); cache %1, 0x320(%0) \n" \
282 " cache %1, 0x340(%0); cache %1, 0x360(%0) \n" \
283 " cache %1, 0x380(%0); cache %1, 0x3a0(%0) \n" \
284 " cache %1, 0x3c0(%0); cache %1, 0x3e0(%0) \n" \
285 " .set pop \n" \
286 : \
287 : "r" (base), \
288 "i" (op));
289
290#define cache64_unroll32(base,op) \
291 __asm__ __volatile__( \
292 " .set push \n" \
293 " .set noreorder \n" \
294 " .set mips3 \n" \
295 " cache %1, 0x000(%0); cache %1, 0x040(%0) \n" \
296 " cache %1, 0x080(%0); cache %1, 0x0c0(%0) \n" \
297 " cache %1, 0x100(%0); cache %1, 0x140(%0) \n" \
298 " cache %1, 0x180(%0); cache %1, 0x1c0(%0) \n" \
299 " cache %1, 0x200(%0); cache %1, 0x240(%0) \n" \
300 " cache %1, 0x280(%0); cache %1, 0x2c0(%0) \n" \
301 " cache %1, 0x300(%0); cache %1, 0x340(%0) \n" \
302 " cache %1, 0x380(%0); cache %1, 0x3c0(%0) \n" \
303 " cache %1, 0x400(%0); cache %1, 0x440(%0) \n" \
304 " cache %1, 0x480(%0); cache %1, 0x4c0(%0) \n" \
305 " cache %1, 0x500(%0); cache %1, 0x540(%0) \n" \
306 " cache %1, 0x580(%0); cache %1, 0x5c0(%0) \n" \
307 " cache %1, 0x600(%0); cache %1, 0x640(%0) \n" \
308 " cache %1, 0x680(%0); cache %1, 0x6c0(%0) \n" \
309 " cache %1, 0x700(%0); cache %1, 0x740(%0) \n" \
310 " cache %1, 0x780(%0); cache %1, 0x7c0(%0) \n" \
311 " .set pop \n" \
312 : \
313 : "r" (base), \
314 "i" (op));
315
316#define cache128_unroll32(base,op) \
317 __asm__ __volatile__( \
318 " .set push \n" \
319 " .set noreorder \n" \
320 " .set mips3 \n" \
321 " cache %1, 0x000(%0); cache %1, 0x080(%0) \n" \
322 " cache %1, 0x100(%0); cache %1, 0x180(%0) \n" \
323 " cache %1, 0x200(%0); cache %1, 0x280(%0) \n" \
324 " cache %1, 0x300(%0); cache %1, 0x380(%0) \n" \
325 " cache %1, 0x400(%0); cache %1, 0x480(%0) \n" \
326 " cache %1, 0x500(%0); cache %1, 0x580(%0) \n" \
327 " cache %1, 0x600(%0); cache %1, 0x680(%0) \n" \
328 " cache %1, 0x700(%0); cache %1, 0x780(%0) \n" \
329 " cache %1, 0x800(%0); cache %1, 0x880(%0) \n" \
330 " cache %1, 0x900(%0); cache %1, 0x980(%0) \n" \
331 " cache %1, 0xa00(%0); cache %1, 0xa80(%0) \n" \
332 " cache %1, 0xb00(%0); cache %1, 0xb80(%0) \n" \
333 " cache %1, 0xc00(%0); cache %1, 0xc80(%0) \n" \
334 " cache %1, 0xd00(%0); cache %1, 0xd80(%0) \n" \
335 " cache %1, 0xe00(%0); cache %1, 0xe80(%0) \n" \
336 " cache %1, 0xf00(%0); cache %1, 0xf80(%0) \n" \
337 " .set pop \n" \
338 : \
339 : "r" (base), \
340 "i" (op));
341
342/* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */
343#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize) \
344static inline void blast_##pfx##cache##lsize(void) \
345{ \
346 unsigned long start = INDEX_BASE; \
347 unsigned long end = start + current_cpu_data.desc.waysize; \
348 unsigned long ws_inc = 1UL << current_cpu_data.desc.waybit; \
349 unsigned long ws_end = current_cpu_data.desc.ways << \
350 current_cpu_data.desc.waybit; \
351 unsigned long ws, addr; \
352 \
353 __##pfx##flush_prologue \
354 \
355 for (ws = 0; ws < ws_end; ws += ws_inc) \
356 for (addr = start; addr < end; addr += lsize * 32) \
357 cache##lsize##_unroll32(addr|ws, indexop); \
358 \
359 __##pfx##flush_epilogue \
360} \
361 \
362static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \
363{ \
364 unsigned long start = page; \
365 unsigned long end = page + PAGE_SIZE; \
366 \
367 __##pfx##flush_prologue \
368 \
369 do { \
370 cache##lsize##_unroll32(start, hitop); \
371 start += lsize * 32; \
372 } while (start < end); \
373 \
374 __##pfx##flush_epilogue \
375} \
376 \
377static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \
378{ \
379 unsigned long indexmask = current_cpu_data.desc.waysize - 1; \
380 unsigned long start = INDEX_BASE + (page & indexmask); \
381 unsigned long end = start + PAGE_SIZE; \
382 unsigned long ws_inc = 1UL << current_cpu_data.desc.waybit; \
383 unsigned long ws_end = current_cpu_data.desc.ways << \
384 current_cpu_data.desc.waybit; \
385 unsigned long ws, addr; \
386 \
387 __##pfx##flush_prologue \
388 \
389 for (ws = 0; ws < ws_end; ws += ws_inc) \
390 for (addr = start; addr < end; addr += lsize * 32) \
391 cache##lsize##_unroll32(addr|ws, indexop); \
392 \
393 __##pfx##flush_epilogue \
394}
395
396__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16)
397__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16)
398__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16)
399__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32)
400__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32)
401__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32)
402__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
403__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64)
404__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128)
405
406__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16)
407__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32)
408__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16)
409__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32)
410__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64)
411__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128)
412
413/* build blast_xxx_range, protected_blast_xxx_range */
414#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \
415static inline void prot##blast_##pfx##cache##_range(unsigned long start, \
416 unsigned long end) \
417{ \
418 unsigned long lsize = cpu_##desc##_line_size(); \
419 unsigned long addr = start & ~(lsize - 1); \
420 unsigned long aend = (end - 1) & ~(lsize - 1); \
421 \
422 __##pfx##flush_prologue \
423 \
424 while (1) { \
425 prot##cache_op(hitop, addr); \
426 if (addr == aend) \
427 break; \
428 addr += lsize; \
429 } \
430 \
431 __##pfx##flush_epilogue \
432}
433
434__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_)
435__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_)
436__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_)
437__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, )
438__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, )
439/* blast_inv_dcache_range */
440__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, )
441__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, )
442
443#endif /* _ASM_R4KCACHE_H */
diff --git a/include/asm-mips/reboot.h b/include/asm-mips/reboot.h
deleted file mode 100644
index e48c0bfab257..000000000000
--- a/include/asm-mips/reboot.h
+++ /dev/null
@@ -1,15 +0,0 @@
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 * Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle
7 * Copyright (C) 2001 MIPS Technologies, Inc.
8 */
9#ifndef _ASM_REBOOT_H
10#define _ASM_REBOOT_H
11
12extern void (*_machine_restart)(char *command);
13extern void (*_machine_halt)(void);
14
15#endif /* _ASM_REBOOT_H */
diff --git a/include/asm-mips/reg.h b/include/asm-mips/reg.h
deleted file mode 100644
index 634b55d7e7f6..000000000000
--- a/include/asm-mips/reg.h
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * Various register offset definitions for debuggers, core file
3 * examiners and whatnot.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 1995, 1999 Ralf Baechle
10 * Copyright (C) 1995, 1999 Silicon Graphics
11 */
12#ifndef __ASM_MIPS_REG_H
13#define __ASM_MIPS_REG_H
14
15
16#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H)
17
18#define EF_R0 6
19#define EF_R1 7
20#define EF_R2 8
21#define EF_R3 9
22#define EF_R4 10
23#define EF_R5 11
24#define EF_R6 12
25#define EF_R7 13
26#define EF_R8 14
27#define EF_R9 15
28#define EF_R10 16
29#define EF_R11 17
30#define EF_R12 18
31#define EF_R13 19
32#define EF_R14 20
33#define EF_R15 21
34#define EF_R16 22
35#define EF_R17 23
36#define EF_R18 24
37#define EF_R19 25
38#define EF_R20 26
39#define EF_R21 27
40#define EF_R22 28
41#define EF_R23 29
42#define EF_R24 30
43#define EF_R25 31
44
45/*
46 * k0/k1 unsaved
47 */
48#define EF_R26 32
49#define EF_R27 33
50
51#define EF_R28 34
52#define EF_R29 35
53#define EF_R30 36
54#define EF_R31 37
55
56/*
57 * Saved special registers
58 */
59#define EF_LO 38
60#define EF_HI 39
61
62#define EF_CP0_EPC 40
63#define EF_CP0_BADVADDR 41
64#define EF_CP0_STATUS 42
65#define EF_CP0_CAUSE 43
66#define EF_UNUSED0 44
67
68#define EF_SIZE 180
69
70#endif
71
72#ifdef CONFIG_64BIT
73
74#define EF_R0 0
75#define EF_R1 1
76#define EF_R2 2
77#define EF_R3 3
78#define EF_R4 4
79#define EF_R5 5
80#define EF_R6 6
81#define EF_R7 7
82#define EF_R8 8
83#define EF_R9 9
84#define EF_R10 10
85#define EF_R11 11
86#define EF_R12 12
87#define EF_R13 13
88#define EF_R14 14
89#define EF_R15 15
90#define EF_R16 16
91#define EF_R17 17
92#define EF_R18 18
93#define EF_R19 19
94#define EF_R20 20
95#define EF_R21 21
96#define EF_R22 22
97#define EF_R23 23
98#define EF_R24 24
99#define EF_R25 25
100
101/*
102 * k0/k1 unsaved
103 */
104#define EF_R26 26
105#define EF_R27 27
106
107
108#define EF_R28 28
109#define EF_R29 29
110#define EF_R30 30
111#define EF_R31 31
112
113/*
114 * Saved special registers
115 */
116#define EF_LO 32
117#define EF_HI 33
118
119#define EF_CP0_EPC 34
120#define EF_CP0_BADVADDR 35
121#define EF_CP0_STATUS 36
122#define EF_CP0_CAUSE 37
123
124#define EF_SIZE 304 /* size in bytes */
125
126#endif /* CONFIG_64BIT */
127
128#endif /* __ASM_MIPS_REG_H */
diff --git a/include/asm-mips/regdef.h b/include/asm-mips/regdef.h
deleted file mode 100644
index 7c8ecb6b9c40..000000000000
--- a/include/asm-mips/regdef.h
+++ /dev/null
@@ -1,100 +0,0 @@
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 * Copyright (C) 1985 MIPS Computer Systems, Inc.
7 * Copyright (C) 1994, 95, 99, 2003 by Ralf Baechle
8 * Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_REGDEF_H
11#define _ASM_REGDEF_H
12
13#include <asm/sgidefs.h>
14
15#if _MIPS_SIM == _MIPS_SIM_ABI32
16
17/*
18 * Symbolic register names for 32 bit ABI
19 */
20#define zero $0 /* wired zero */
21#define AT $1 /* assembler temp - uppercase because of ".set at" */
22#define v0 $2 /* return value */
23#define v1 $3
24#define a0 $4 /* argument registers */
25#define a1 $5
26#define a2 $6
27#define a3 $7
28#define t0 $8 /* caller saved */
29#define t1 $9
30#define t2 $10
31#define t3 $11
32#define t4 $12
33#define t5 $13
34#define t6 $14
35#define t7 $15
36#define s0 $16 /* callee saved */
37#define s1 $17
38#define s2 $18
39#define s3 $19
40#define s4 $20
41#define s5 $21
42#define s6 $22
43#define s7 $23
44#define t8 $24 /* caller saved */
45#define t9 $25
46#define jp $25 /* PIC jump register */
47#define k0 $26 /* kernel scratch */
48#define k1 $27
49#define gp $28 /* global pointer */
50#define sp $29 /* stack pointer */
51#define fp $30 /* frame pointer */
52#define s8 $30 /* same like fp! */
53#define ra $31 /* return address */
54
55#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
56
57#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
58
59#define zero $0 /* wired zero */
60#define AT $at /* assembler temp - uppercase because of ".set at" */
61#define v0 $2 /* return value - caller saved */
62#define v1 $3
63#define a0 $4 /* argument registers */
64#define a1 $5
65#define a2 $6
66#define a3 $7
67#define a4 $8 /* arg reg 64 bit; caller saved in 32 bit */
68#define ta0 $8
69#define a5 $9
70#define ta1 $9
71#define a6 $10
72#define ta2 $10
73#define a7 $11
74#define ta3 $11
75#define t0 $12 /* caller saved */
76#define t1 $13
77#define t2 $14
78#define t3 $15
79#define s0 $16 /* callee saved */
80#define s1 $17
81#define s2 $18
82#define s3 $19
83#define s4 $20
84#define s5 $21
85#define s6 $22
86#define s7 $23
87#define t8 $24 /* caller saved */
88#define t9 $25 /* callee address for PIC/temp */
89#define jp $25 /* PIC jump register */
90#define k0 $26 /* kernel temporary */
91#define k1 $27
92#define gp $28 /* global pointer - caller saved for PIC */
93#define sp $29 /* stack pointer */
94#define fp $30 /* frame pointer */
95#define s8 $30 /* callee saved */
96#define ra $31 /* return address */
97
98#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
99
100#endif /* _ASM_REGDEF_H */
diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h
deleted file mode 100644
index 87cb3085269c..000000000000
--- a/include/asm-mips/resource.h
+++ /dev/null
@@ -1,35 +0,0 @@
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 * Copyright (C) 1995, 96, 98, 99, 2000 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_RESOURCE_H
10#define _ASM_RESOURCE_H
11
12
13/*
14 * These five resource limit IDs have a MIPS/Linux-specific ordering,
15 * the rest comes from the generic header:
16 */
17#define RLIMIT_NOFILE 5 /* max number of open files */
18#define RLIMIT_AS 6 /* address space limit */
19#define RLIMIT_RSS 7 /* max resident set size */
20#define RLIMIT_NPROC 8 /* max number of processes */
21#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
22
23/*
24 * SuS says limits have to be unsigned.
25 * Which makes a ton more sense anyway,
26 * but we keep the old value on MIPS32,
27 * for compatibility:
28 */
29#ifdef CONFIG_32BIT
30# define RLIM_INFINITY 0x7fffffffUL
31#endif
32
33#include <asm-generic/resource.h>
34
35#endif /* _ASM_RESOURCE_H */
diff --git a/include/asm-mips/rm9k-ocd.h b/include/asm-mips/rm9k-ocd.h
deleted file mode 100644
index b0b80d9ecf96..000000000000
--- a/include/asm-mips/rm9k-ocd.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * Copyright (C) 2004 by Basler Vision Technologies AG
3 * Author: Thomas Koeller <thomas.koeller@baslerweb.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (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, MA 02111-1307 USA
18 */
19
20#if !defined(_ASM_RM9K_OCD_H)
21#define _ASM_RM9K_OCD_H
22
23#include <linux/types.h>
24#include <linux/spinlock.h>
25#include <asm/io.h>
26
27extern volatile void __iomem * const ocd_base;
28extern volatile void __iomem * const titan_base;
29
30#define ocd_addr(__x__) (ocd_base + (__x__))
31#define titan_addr(__x__) (titan_base + (__x__))
32#define scram_addr(__x__) (scram_base + (__x__))
33
34/* OCD register access */
35#define ocd_readl(__offs__) __raw_readl(ocd_addr(__offs__))
36#define ocd_readw(__offs__) __raw_readw(ocd_addr(__offs__))
37#define ocd_readb(__offs__) __raw_readb(ocd_addr(__offs__))
38#define ocd_writel(__val__, __offs__) \
39 __raw_writel((__val__), ocd_addr(__offs__))
40#define ocd_writew(__val__, __offs__) \
41 __raw_writew((__val__), ocd_addr(__offs__))
42#define ocd_writeb(__val__, __offs__) \
43 __raw_writeb((__val__), ocd_addr(__offs__))
44
45/* TITAN register access - 32 bit-wide only */
46#define titan_readl(__offs__) __raw_readl(titan_addr(__offs__))
47#define titan_writel(__val__, __offs__) \
48 __raw_writel((__val__), titan_addr(__offs__))
49
50/* Protect access to shared TITAN registers */
51extern spinlock_t titan_lock;
52extern int titan_irqflags;
53#define lock_titan_regs() spin_lock_irqsave(&titan_lock, titan_irqflags)
54#define unlock_titan_regs() spin_unlock_irqrestore(&titan_lock, titan_irqflags)
55
56#endif /* !defined(_ASM_RM9K_OCD_H) */
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h
deleted file mode 100644
index 4ca3063ed2ce..000000000000
--- a/include/asm-mips/rtlx.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 */
5
6#ifndef __ASM_RTLX_H_
7#define __ASM_RTLX_H_
8
9#include <irq.h>
10
11#define LX_NODE_BASE 10
12
13#define MIPS_CPU_RTLX_IRQ 0
14
15#define RTLX_VERSION 2
16#define RTLX_xID 0x12345600
17#define RTLX_ID (RTLX_xID | RTLX_VERSION)
18#define RTLX_CHANNELS 8
19
20#define RTLX_CHANNEL_STDIO 0
21#define RTLX_CHANNEL_DBG 1
22#define RTLX_CHANNEL_SYSIO 2
23
24extern int rtlx_open(int index, int can_sleep);
25extern int rtlx_release(int index);
26extern ssize_t rtlx_read(int index, void __user *buff, size_t count);
27extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count);
28extern unsigned int rtlx_read_poll(int index, int can_sleep);
29extern unsigned int rtlx_write_poll(int index);
30
31enum rtlx_state {
32 RTLX_STATE_UNUSED = 0,
33 RTLX_STATE_INITIALISED,
34 RTLX_STATE_REMOTE_READY,
35 RTLX_STATE_OPENED
36};
37
38#define RTLX_BUFFER_SIZE 2048
39
40/* each channel supports read and write.
41 linux (vpe0) reads lx_buffer and writes rt_buffer
42 SP (vpe1) reads rt_buffer and writes lx_buffer
43*/
44struct rtlx_channel {
45 enum rtlx_state rt_state;
46 enum rtlx_state lx_state;
47
48 int buffer_size;
49
50 /* read and write indexes per buffer */
51 int rt_write, rt_read;
52 char *rt_buffer;
53
54 int lx_write, lx_read;
55 char *lx_buffer;
56};
57
58struct rtlx_info {
59 unsigned long id;
60 enum rtlx_state state;
61
62 struct rtlx_channel channel[RTLX_CHANNELS];
63};
64
65#endif /* __ASM_RTLX_H_ */
diff --git a/include/asm-mips/scatterlist.h b/include/asm-mips/scatterlist.h
deleted file mode 100644
index 83d69fe17c9f..000000000000
--- a/include/asm-mips/scatterlist.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef __ASM_SCATTERLIST_H
2#define __ASM_SCATTERLIST_H
3
4#include <asm/types.h>
5
6struct scatterlist {
7#ifdef CONFIG_DEBUG_SG
8 unsigned long sg_magic;
9#endif
10 unsigned long page_link;
11 unsigned int offset;
12 dma_addr_t dma_address;
13 unsigned int length;
14};
15
16/*
17 * These macros should be used after a pci_map_sg call has been done
18 * to get bus addresses of each of the SG entries and their lengths.
19 * You should only work with the number of sg entries pci_map_sg
20 * returns, or alternatively stop on the first sg_dma_len(sg) which
21 * is 0.
22 */
23#define sg_dma_address(sg) ((sg)->dma_address)
24#define sg_dma_len(sg) ((sg)->length)
25
26#define ISA_DMA_THRESHOLD (0x00ffffffUL)
27
28#endif /* __ASM_SCATTERLIST_H */
diff --git a/include/asm-mips/seccomp.h b/include/asm-mips/seccomp.h
deleted file mode 100644
index 36ed44070256..000000000000
--- a/include/asm-mips/seccomp.h
+++ /dev/null
@@ -1,37 +0,0 @@
1#ifndef __ASM_SECCOMP_H
2
3#include <linux/thread_info.h>
4#include <linux/unistd.h>
5
6#define __NR_seccomp_read __NR_read
7#define __NR_seccomp_write __NR_write
8#define __NR_seccomp_exit __NR_exit
9#define __NR_seccomp_sigreturn __NR_rt_sigreturn
10
11/*
12 * Kludge alert:
13 *
14 * The generic seccomp code currently allows only a single compat ABI. Until
15 * this is fixed we priorize O32 as the compat ABI over N32.
16 */
17#ifdef CONFIG_MIPS32_O32
18
19#define TIF_32BIT TIF_32BIT_REGS
20
21#define __NR_seccomp_read_32 4003
22#define __NR_seccomp_write_32 4004
23#define __NR_seccomp_exit_32 4001
24#define __NR_seccomp_sigreturn_32 4193 /* rt_sigreturn */
25
26#elif defined(CONFIG_MIPS32_N32)
27
28#define TIF_32BIT _TIF_32BIT_ADDR
29
30#define __NR_seccomp_read_32 6000
31#define __NR_seccomp_write_32 6001
32#define __NR_seccomp_exit_32 6058
33#define __NR_seccomp_sigreturn_32 6211 /* rt_sigreturn */
34
35#endif /* CONFIG_MIPS32_O32 */
36
37#endif /* __ASM_SECCOMP_H */
diff --git a/include/asm-mips/sections.h b/include/asm-mips/sections.h
deleted file mode 100644
index b7e37262c246..000000000000
--- a/include/asm-mips/sections.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_SECTIONS_H
2#define _ASM_SECTIONS_H
3
4#include <asm-generic/sections.h>
5
6#endif /* _ASM_SECTIONS_H */
diff --git a/include/asm-mips/segment.h b/include/asm-mips/segment.h
deleted file mode 100644
index 92ac001fc483..000000000000
--- a/include/asm-mips/segment.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_SEGMENT_H
2#define _ASM_SEGMENT_H
3
4/* Only here because we have some old header files that expect it.. */
5
6#endif /* _ASM_SEGMENT_H */
diff --git a/include/asm-mips/sembuf.h b/include/asm-mips/sembuf.h
deleted file mode 100644
index 7281a4decaa0..000000000000
--- a/include/asm-mips/sembuf.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef _ASM_SEMBUF_H
2#define _ASM_SEMBUF_H
3
4/*
5 * The semid64_ds structure for the MIPS 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 * - 2 miscellaneous 64-bit values
11 */
12
13struct semid64_ds {
14 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
15 __kernel_time_t sem_otime; /* last semop time */
16 __kernel_time_t sem_ctime; /* last change time */
17 unsigned long sem_nsems; /* no. of semaphores in array */
18 unsigned long __unused1;
19 unsigned long __unused2;
20};
21
22#endif /* _ASM_SEMBUF_H */
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
deleted file mode 100644
index c07ebd8eb9e7..000000000000
--- a/include/asm-mips/serial.h
+++ /dev/null
@@ -1,22 +0,0 @@
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 * Copyright (C) 1999 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SERIAL_H
10#define _ASM_SERIAL_H
11
12
13/*
14 * This assumes you have a 1.8432 MHz clock for your UART.
15 *
16 * It'd be nice if someone built a serial card with a 24.576 MHz
17 * clock, since the 16550A is capable of handling a top speed of 1.5
18 * megabits/second; but this requires the faster clock.
19 */
20#define BASE_BAUD (1843200 / 16)
21
22#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-mips/setup.h b/include/asm-mips/setup.h
deleted file mode 100644
index e600cedda976..000000000000
--- a/include/asm-mips/setup.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _MIPS_SETUP_H
2#define _MIPS_SETUP_H
3
4#define COMMAND_LINE_SIZE 256
5
6#ifdef __KERNEL__
7extern void setup_early_printk(void);
8#endif /* __KERNEL__ */
9
10#endif /* __SETUP_H */
diff --git a/include/asm-mips/sgi/gio.h b/include/asm-mips/sgi/gio.h
deleted file mode 100644
index 889cf028c95d..000000000000
--- a/include/asm-mips/sgi/gio.h
+++ /dev/null
@@ -1,86 +0,0 @@
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 * gio.h: Definitions for SGI GIO bus
7 *
8 * Copyright (C) 2002 Ladislav Michl
9 */
10
11#ifndef _SGI_GIO_H
12#define _SGI_GIO_H
13
14/*
15 * GIO bus addresses
16 *
17 * The Indigo and Indy have two GIO bus connectors. Indigo2 (all models) have
18 * three physical connectors, but only two slots, GFX and EXP0.
19 *
20 * There is 10MB of GIO address space for GIO64 slot devices
21 * slot# slot type address range size
22 * ----- --------- ----------------------- -----
23 * 0 GFX 0x1f000000 - 0x1f3fffff 4MB
24 * 1 EXP0 0x1f400000 - 0x1f5fffff 2MB
25 * 2 EXP1 0x1f600000 - 0x1f9fffff 4MB
26 *
27 * There are un-slotted devices, HPC, I/O and misc devices, which are grouped
28 * into the HPC address space.
29 * - MISC 0x1fb00000 - 0x1fbfffff 1MB
30 *
31 * Following space is reserved and unused
32 * - RESERVED 0x18000000 - 0x1effffff 112MB
33 *
34 * GIO bus IDs
35 *
36 * Each GIO bus device identifies itself to the system by answering a
37 * read with an "ID" value. IDs are either 8 or 32 bits long. IDs less
38 * than 128 are 8 bits long, with the most significant 24 bits read from
39 * the slot undefined.
40 *
41 * 32-bit IDs are divided into
42 * bits 0:6 the product ID; ranges from 0x00 to 0x7F.
43 * bit 7 0=GIO Product ID is 8 bits wide
44 * 1=GIO Product ID is 32 bits wide.
45 * bits 8:15 manufacturer version for the product.
46 * bit 16 0=GIO32 and GIO32-bis, 1=GIO64.
47 * bit 17 0=no ROM present
48 * 1=ROM present on this board AND next three words
49 * space define the ROM.
50 * bits 18:31 up to manufacturer.
51 *
52 * IDs above 0x50/0xd0 are of 3rd party boards.
53 *
54 * 8-bit IDs
55 * 0x01 XPI low cost FDDI
56 * 0x02 GTR TokenRing
57 * 0x04 Synchronous ISDN
58 * 0x05 ATM board [*]
59 * 0x06 Canon Interface
60 * 0x07 16 bit SCSI Card [*]
61 * 0x08 JPEG (Double Wide)
62 * 0x09 JPEG (Single Wide)
63 * 0x0a XPI mez. FDDI device 0
64 * 0x0b XPI mez. FDDI device 1
65 * 0x0c SMPTE 259M Video [*]
66 * 0x0d Babblefish Compression [*]
67 * 0x0e E-Plex 8-port Ethernet
68 * 0x30 Lyon Lamb IVAS
69 * 0xb8 GIO 100BaseTX Fast Ethernet (gfe)
70 *
71 * [*] Device provide 32-bit ID.
72 *
73 */
74
75#define GIO_ID(x) (x & 0x7f)
76#define GIO_32BIT_ID 0x80
77#define GIO_REV(x) ((x >> 8) & 0xff)
78#define GIO_64BIT_IFACE 0x10000
79#define GIO_ROM_PRESENT 0x20000
80#define GIO_VENDOR_CODE(x) ((x >> 18) & 0x3fff)
81
82#define GIO_SLOT_GFX_BASE 0x1f000000
83#define GIO_SLOT_EXP0_BASE 0x1f400000
84#define GIO_SLOT_EXP1_BASE 0x1f600000
85
86#endif /* _SGI_GIO_H */
diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h
deleted file mode 100644
index c4729f531919..000000000000
--- a/include/asm-mips/sgi/hpc3.h
+++ /dev/null
@@ -1,317 +0,0 @@
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 * hpc3.h: Definitions for SGI HPC3 controller
7 *
8 * Copyright (C) 1996 David S. Miller
9 * Copyright (C) 1998 Ralf Baechle
10 */
11
12#ifndef _SGI_HPC3_H
13#define _SGI_HPC3_H
14
15#include <linux/types.h>
16#include <asm/page.h>
17
18/* An HPC DMA descriptor. */
19struct hpc_dma_desc {
20 u32 pbuf; /* physical address of data buffer */
21 u32 cntinfo; /* counter and info bits */
22#define HPCDMA_EOX 0x80000000 /* last desc in chain for tx */
23#define HPCDMA_EOR 0x80000000 /* last desc in chain for rx */
24#define HPCDMA_EOXP 0x40000000 /* end of packet for tx */
25#define HPCDMA_EORP 0x40000000 /* end of packet for rx */
26#define HPCDMA_XIE 0x20000000 /* irq generated when at end of this desc */
27#define HPCDMA_XIU 0x01000000 /* Tx buffer in use by CPU. */
28#define HPCDMA_EIPC 0x00ff0000 /* SEEQ ethernet special xternal bytecount */
29#define HPCDMA_ETXD 0x00008000 /* set to one by HPC when packet tx'd */
30#define HPCDMA_OWN 0x00004000 /* Denotes ring buffer ownership on rx */
31#define HPCDMA_BCNT 0x00003fff /* size in bytes of this dma buffer */
32
33 u32 pnext; /* paddr of next hpc_dma_desc if any */
34};
35
36/* The set of regs for each HPC3 PBUS DMA channel. */
37struct hpc3_pbus_dmacregs {
38 volatile u32 pbdma_bptr; /* pbus dma channel buffer ptr */
39 volatile u32 pbdma_dptr; /* pbus dma channel desc ptr */
40 u32 _unused0[0x1000/4 - 2]; /* padding */
41 volatile u32 pbdma_ctrl; /* pbus dma channel control register has
42 * copletely different meaning for read
43 * compared with write */
44 /* read */
45#define HPC3_PDMACTRL_INT 0x00000001 /* interrupt (cleared after read) */
46#define HPC3_PDMACTRL_ISACT 0x00000002 /* channel active */
47 /* write */
48#define HPC3_PDMACTRL_SEL 0x00000002 /* little endian transfer */
49#define HPC3_PDMACTRL_RCV 0x00000004 /* direction is receive */
50#define HPC3_PDMACTRL_FLSH 0x00000008 /* enable flush for receive DMA */
51#define HPC3_PDMACTRL_ACT 0x00000010 /* start dma transfer */
52#define HPC3_PDMACTRL_LD 0x00000020 /* load enable for ACT */
53#define HPC3_PDMACTRL_RT 0x00000040 /* Use realtime GIO bus servicing */
54#define HPC3_PDMACTRL_HW 0x0000ff00 /* DMA High-water mark */
55#define HPC3_PDMACTRL_FB 0x003f0000 /* Ptr to beginning of fifo */
56#define HPC3_PDMACTRL_FE 0x3f000000 /* Ptr to end of fifo */
57
58 u32 _unused1[0x1000/4 - 1]; /* padding */
59};
60
61/* The HPC3 SCSI registers, this does not include external ones. */
62struct hpc3_scsiregs {
63 volatile u32 cbptr; /* current dma buffer ptr, diagnostic use only */
64 volatile u32 ndptr; /* next dma descriptor ptr */
65 u32 _unused0[0x1000/4 - 2]; /* padding */
66 volatile u32 bcd; /* byte count info */
67#define HPC3_SBCD_BCNTMSK 0x00003fff /* bytes to transfer from/to memory */
68#define HPC3_SBCD_XIE 0x00004000 /* Send IRQ when done with cur buf */
69#define HPC3_SBCD_EOX 0x00008000 /* Indicates this is last buf in chain */
70
71 volatile u32 ctrl; /* control register */
72#define HPC3_SCTRL_IRQ 0x01 /* IRQ asserted, either dma done or parity */
73#define HPC3_SCTRL_ENDIAN 0x02 /* DMA endian mode, 0=big 1=little */
74#define HPC3_SCTRL_DIR 0x04 /* DMA direction, 1=dev2mem 0=mem2dev */
75#define HPC3_SCTRL_FLUSH 0x08 /* Tells HPC3 to flush scsi fifos */
76#define HPC3_SCTRL_ACTIVE 0x10 /* SCSI DMA channel is active */
77#define HPC3_SCTRL_AMASK 0x20 /* DMA active inhibits PIO */
78#define HPC3_SCTRL_CRESET 0x40 /* Resets dma channel and external controller */
79#define HPC3_SCTRL_PERR 0x80 /* Bad parity on HPC3 iface to scsi controller */
80
81 volatile u32 gfptr; /* current GIO fifo ptr */
82 volatile u32 dfptr; /* current device fifo ptr */
83 volatile u32 dconfig; /* DMA configuration register */
84#define HPC3_SDCFG_HCLK 0x00001 /* Enable DMA half clock mode */
85#define HPC3_SDCFG_D1 0x00006 /* Cycles to spend in D1 state */
86#define HPC3_SDCFG_D2 0x00038 /* Cycles to spend in D2 state */
87#define HPC3_SDCFG_D3 0x001c0 /* Cycles to spend in D3 state */
88#define HPC3_SDCFG_HWAT 0x00e00 /* DMA high water mark */
89#define HPC3_SDCFG_HW 0x01000 /* Enable 16-bit halfword DMA accesses to scsi */
90#define HPC3_SDCFG_SWAP 0x02000 /* Byte swap all DMA accesses */
91#define HPC3_SDCFG_EPAR 0x04000 /* Enable parity checking for DMA */
92#define HPC3_SDCFG_POLL 0x08000 /* hd_dreq polarity control */
93#define HPC3_SDCFG_ERLY 0x30000 /* hd_dreq behavior control bits */
94
95 volatile u32 pconfig; /* PIO configuration register */
96#define HPC3_SPCFG_P3 0x0003 /* Cycles to spend in P3 state */
97#define HPC3_SPCFG_P2W 0x001c /* Cycles to spend in P2 state for writes */
98#define HPC3_SPCFG_P2R 0x01e0 /* Cycles to spend in P2 state for reads */
99#define HPC3_SPCFG_P1 0x0e00 /* Cycles to spend in P1 state */
100#define HPC3_SPCFG_HW 0x1000 /* Enable 16-bit halfword PIO accesses to scsi */
101#define HPC3_SPCFG_SWAP 0x2000 /* Byte swap all PIO accesses */
102#define HPC3_SPCFG_EPAR 0x4000 /* Enable parity checking for PIO */
103#define HPC3_SPCFG_FUJI 0x8000 /* Fujitsu scsi controller mode for faster dma/pio */
104
105 u32 _unused1[0x1000/4 - 6]; /* padding */
106};
107
108/* SEEQ ethernet HPC3 registers, only one seeq per HPC3. */
109struct hpc3_ethregs {
110 /* Receiver registers. */
111 volatile u32 rx_cbptr; /* current dma buffer ptr, diagnostic use only */
112 volatile u32 rx_ndptr; /* next dma descriptor ptr */
113 u32 _unused0[0x1000/4 - 2]; /* padding */
114 volatile u32 rx_bcd; /* byte count info */
115#define HPC3_ERXBCD_BCNTMSK 0x00003fff /* bytes to be sent to memory */
116#define HPC3_ERXBCD_XIE 0x20000000 /* HPC3 interrupts cpu at end of this buf */
117#define HPC3_ERXBCD_EOX 0x80000000 /* flags this as end of descriptor chain */
118
119 volatile u32 rx_ctrl; /* control register */
120#define HPC3_ERXCTRL_STAT50 0x0000003f /* Receive status reg bits of Seeq8003 */
121#define HPC3_ERXCTRL_STAT6 0x00000040 /* Rdonly irq status */
122#define HPC3_ERXCTRL_STAT7 0x00000080 /* Rdonlt old/new status bit from Seeq */
123#define HPC3_ERXCTRL_ENDIAN 0x00000100 /* Endian for dma channel, little=1 big=0 */
124#define HPC3_ERXCTRL_ACTIVE 0x00000200 /* Tells if DMA transfer is in progress */
125#define HPC3_ERXCTRL_AMASK 0x00000400 /* Tells if ACTIVE inhibits PIO's to hpc3 */
126#define HPC3_ERXCTRL_RBO 0x00000800 /* Receive buffer overflow if set to 1 */
127
128 volatile u32 rx_gfptr; /* current GIO fifo ptr */
129 volatile u32 rx_dfptr; /* current device fifo ptr */
130 u32 _unused1; /* padding */
131 volatile u32 reset; /* reset register */
132#define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */
133#define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */
134#define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
135
136 volatile u32 dconfig; /* DMA configuration register */
137#define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
138#define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
139#define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
140#define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
141#define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
142#define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
143#define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
144#define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */
145
146 volatile u32 pconfig; /* PIO configuration register */
147#define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
148#define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
149#define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
150#define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
151
152 u32 _unused2[0x1000/4 - 8]; /* padding */
153
154 /* Transmitter registers. */
155 volatile u32 tx_cbptr; /* current dma buffer ptr, diagnostic use only */
156 volatile u32 tx_ndptr; /* next dma descriptor ptr */
157 u32 _unused3[0x1000/4 - 2]; /* padding */
158 volatile u32 tx_bcd; /* byte count info */
159#define HPC3_ETXBCD_BCNTMSK 0x00003fff /* bytes to be read from memory */
160#define HPC3_ETXBCD_ESAMP 0x10000000 /* if set, too late to add descriptor */
161#define HPC3_ETXBCD_XIE 0x20000000 /* Interrupt cpu at end of cur desc */
162#define HPC3_ETXBCD_EOP 0x40000000 /* Last byte of cur buf is end of packet */
163#define HPC3_ETXBCD_EOX 0x80000000 /* This buf is the end of desc chain */
164
165 volatile u32 tx_ctrl; /* control register */
166#define HPC3_ETXCTRL_STAT30 0x0000000f /* Rdonly copy of seeq tx stat reg */
167#define HPC3_ETXCTRL_STAT4 0x00000010 /* Indicate late collision occurred */
168#define HPC3_ETXCTRL_STAT75 0x000000e0 /* Rdonly irq status from seeq */
169#define HPC3_ETXCTRL_ENDIAN 0x00000100 /* DMA channel endian mode, 1=little 0=big */
170#define HPC3_ETXCTRL_ACTIVE 0x00000200 /* DMA tx channel is active */
171#define HPC3_ETXCTRL_AMASK 0x00000400 /* Indicates ACTIVE inhibits PIO's */
172
173 volatile u32 tx_gfptr; /* current GIO fifo ptr */
174 volatile u32 tx_dfptr; /* current device fifo ptr */
175 u32 _unused4[0x1000/4 - 4]; /* padding */
176};
177
178struct hpc3_regs {
179 /* First regs for the PBUS 8 dma channels. */
180 struct hpc3_pbus_dmacregs pbdma[8];
181
182 /* Now the HPC scsi registers, we get two scsi reg sets. */
183 struct hpc3_scsiregs scsi_chan0, scsi_chan1;
184
185 /* The SEEQ hpc3 ethernet dma/control registers. */
186 struct hpc3_ethregs ethregs;
187
188 /* Here are where the hpc3 fifo's can be directly accessed
189 * via PIO accesses. Under normal operation we never stick
190 * our grubby paws in here so it's just padding. */
191 u32 _unused0[0x18000/4];
192
193 /* HPC3 irq status regs. Due to a peculiar bug you need to
194 * look at two different register addresses to get at all of
195 * the status bits. The first reg can only reliably report
196 * bits 4:0 of the status, and the second reg can only
197 * reliably report bits 9:5 of the hpc3 irq status. I told
198 * you it was a peculiar bug. ;-)
199 */
200 volatile u32 istat0; /* Irq status, only bits <4:0> reliable. */
201#define HPC3_ISTAT_PBIMASK 0x0ff /* irq bits for pbus devs 0 --> 7 */
202#define HPC3_ISTAT_SC0MASK 0x100 /* irq bit for scsi channel 0 */
203#define HPC3_ISTAT_SC1MASK 0x200 /* irq bit for scsi channel 1 */
204
205 volatile u32 gio_misc; /* GIO misc control bits. */
206#define HPC3_GIOMISC_ERTIME 0x1 /* Enable external timer real time. */
207#define HPC3_GIOMISC_DENDIAN 0x2 /* dma descriptor endian, 1=lit 0=big */
208
209 u32 eeprom; /* EEPROM data reg. */
210#define HPC3_EEPROM_EPROT 0x01 /* Protect register enable */
211#define HPC3_EEPROM_CSEL 0x02 /* Chip select */
212#define HPC3_EEPROM_ECLK 0x04 /* EEPROM clock */
213#define HPC3_EEPROM_DATO 0x08 /* Data out */
214#define HPC3_EEPROM_DATI 0x10 /* Data in */
215
216 volatile u32 istat1; /* Irq status, only bits <9:5> reliable. */
217 volatile u32 bestat; /* Bus error interrupt status reg. */
218#define HPC3_BESTAT_BLMASK 0x000ff /* Bus lane where bad parity occurred */
219#define HPC3_BESTAT_CTYPE 0x00100 /* Bus cycle type, 0=PIO 1=DMA */
220#define HPC3_BESTAT_PIDSHIFT 9
221#define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */
222
223 u32 _unused1[0x14000/4 - 5]; /* padding */
224
225 /* Now direct PIO per-HPC3 peripheral access to external regs. */
226 volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
227 u32 _unused2[0x7c00/4];
228 volatile u32 scsi1_ext[256]; /* SCSI channel 1 external regs */
229 u32 _unused3[0x7c00/4];
230 volatile u32 eth_ext[320]; /* Ethernet external registers */
231 u32 _unused4[0x3b00/4];
232
233 /* Per-peripheral device external registers and DMA/PIO control. */
234 volatile u32 pbus_extregs[16][256];
235 volatile u32 pbus_dmacfg[8][128];
236 /* Cycles to spend in D3 for reads */
237#define HPC3_DMACFG_D3R_MASK 0x00000001
238#define HPC3_DMACFG_D3R_SHIFT 0
239 /* Cycles to spend in D4 for reads */
240#define HPC3_DMACFG_D4R_MASK 0x0000001e
241#define HPC3_DMACFG_D4R_SHIFT 1
242 /* Cycles to spend in D5 for reads */
243#define HPC3_DMACFG_D5R_MASK 0x000001e0
244#define HPC3_DMACFG_D5R_SHIFT 5
245 /* Cycles to spend in D3 for writes */
246#define HPC3_DMACFG_D3W_MASK 0x00000200
247#define HPC3_DMACFG_D3W_SHIFT 9
248 /* Cycles to spend in D4 for writes */
249#define HPC3_DMACFG_D4W_MASK 0x00003c00
250#define HPC3_DMACFG_D4W_SHIFT 10
251 /* Cycles to spend in D5 for writes */
252#define HPC3_DMACFG_D5W_MASK 0x0003c000
253#define HPC3_DMACFG_D5W_SHIFT 14
254 /* Enable 16-bit DMA access mode */
255#define HPC3_DMACFG_DS16 0x00040000
256 /* Places halfwords on high 16 bits of bus */
257#define HPC3_DMACFG_EVENHI 0x00080000
258 /* Make this device real time */
259#define HPC3_DMACFG_RTIME 0x00200000
260 /* 5 bit burst count for DMA device */
261#define HPC3_DMACFG_BURST_MASK 0x07c00000
262#define HPC3_DMACFG_BURST_SHIFT 22
263 /* Use live pbus_dreq unsynchronized signal */
264#define HPC3_DMACFG_DRQLIVE 0x08000000
265 volatile u32 pbus_piocfg[16][64];
266 /* Cycles to spend in P2 state for reads */
267#define HPC3_PIOCFG_P2R_MASK 0x00001
268#define HPC3_PIOCFG_P2R_SHIFT 0
269 /* Cycles to spend in P3 state for reads */
270#define HPC3_PIOCFG_P3R_MASK 0x0001e
271#define HPC3_PIOCFG_P3R_SHIFT 1
272 /* Cycles to spend in P4 state for reads */
273#define HPC3_PIOCFG_P4R_MASK 0x001e0
274#define HPC3_PIOCFG_P4R_SHIFT 5
275 /* Cycles to spend in P2 state for writes */
276#define HPC3_PIOCFG_P2W_MASK 0x00200
277#define HPC3_PIOCFG_P2W_SHIFT 9
278 /* Cycles to spend in P3 state for writes */
279#define HPC3_PIOCFG_P3W_MASK 0x03c00
280#define HPC3_PIOCFG_P3W_SHIFT 10
281 /* Cycles to spend in P4 state for writes */
282#define HPC3_PIOCFG_P4W_MASK 0x3c000
283#define HPC3_PIOCFG_P4W_SHIFT 14
284 /* Enable 16-bit PIO accesses */
285#define HPC3_PIOCFG_DS16 0x40000
286 /* Place even address bits in bits <15:8> */
287#define HPC3_PIOCFG_EVENHI 0x80000
288
289 /* PBUS PROM control regs. */
290 volatile u32 pbus_promwe; /* PROM write enable register */
291#define HPC3_PROM_WENAB 0x1 /* Enable writes to the PROM */
292
293 u32 _unused5[0x0800/4 - 1];
294 volatile u32 pbus_promswap; /* Chip select swap reg */
295#define HPC3_PROM_SWAP 0x1 /* invert GIO addr bit to select prom0 or prom1 */
296
297 u32 _unused6[0x0800/4 - 1];
298 volatile u32 pbus_gout; /* PROM general purpose output reg */
299#define HPC3_PROM_STAT 0x1 /* General purpose status bit in gout */
300
301 u32 _unused7[0x1000/4 - 1];
302 volatile u32 rtcregs[14]; /* Dallas clock registers */
303 u32 _unused8[50];
304 volatile u32 bbram[8192-50-14]; /* Battery backed ram */
305};
306
307/*
308 * It is possible to have two HPC3's within the address space on
309 * one machine, though only having one is more likely on an Indy.
310 */
311extern struct hpc3_regs *hpc3c0, *hpc3c1;
312#define HPC3_CHIP0_BASE 0x1fb80000 /* physical */
313#define HPC3_CHIP1_BASE 0x1fb00000 /* physical */
314
315extern void sgihpc_init(void);
316
317#endif /* _SGI_HPC3_H */
diff --git a/include/asm-mips/sgi/ioc.h b/include/asm-mips/sgi/ioc.h
deleted file mode 100644
index 343ed15f8dc4..000000000000
--- a/include/asm-mips/sgi/ioc.h
+++ /dev/null
@@ -1,200 +0,0 @@
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 * ioc.h: Definitions for SGI I/O Controller
7 *
8 * Copyright (C) 1996 David S. Miller
9 * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle
10 * Copyright (C) 2001, 2003 Ladislav Michl
11 */
12
13#ifndef _SGI_IOC_H
14#define _SGI_IOC_H
15
16#include <linux/types.h>
17#include <asm/sgi/pi1.h>
18
19/*
20 * All registers are 8-bit wide alligned on 32-bit boundary. Bad things
21 * happen if you try word access them. You have been warned.
22 */
23
24struct sgioc_uart_regs {
25 u8 _ctrl1[3];
26 volatile u8 ctrl1;
27 u8 _data1[3];
28 volatile u8 data1;
29 u8 _ctrl2[3];
30 volatile u8 ctrl2;
31 u8 _data2[3];
32 volatile u8 data2;
33};
34
35struct sgioc_keyb_regs {
36 u8 _data[3];
37 volatile u8 data;
38 u8 _command[3];
39 volatile u8 command;
40};
41
42struct sgint_regs {
43 u8 _istat0[3];
44 volatile u8 istat0; /* Interrupt status zero */
45#define SGINT_ISTAT0_FFULL 0x01
46#define SGINT_ISTAT0_SCSI0 0x02
47#define SGINT_ISTAT0_SCSI1 0x04
48#define SGINT_ISTAT0_ENET 0x08
49#define SGINT_ISTAT0_GFXDMA 0x10
50#define SGINT_ISTAT0_PPORT 0x20
51#define SGINT_ISTAT0_HPC2 0x40
52#define SGINT_ISTAT0_LIO2 0x80
53 u8 _imask0[3];
54 volatile u8 imask0; /* Interrupt mask zero */
55 u8 _istat1[3];
56 volatile u8 istat1; /* Interrupt status one */
57#define SGINT_ISTAT1_ISDNI 0x01
58#define SGINT_ISTAT1_PWR 0x02
59#define SGINT_ISTAT1_ISDNH 0x04
60#define SGINT_ISTAT1_LIO3 0x08
61#define SGINT_ISTAT1_HPC3 0x10
62#define SGINT_ISTAT1_AFAIL 0x20
63#define SGINT_ISTAT1_VIDEO 0x40
64#define SGINT_ISTAT1_GIO2 0x80
65 u8 _imask1[3];
66 volatile u8 imask1; /* Interrupt mask one */
67 u8 _vmeistat[3];
68 volatile u8 vmeistat; /* VME interrupt status */
69 u8 _cmeimask0[3];
70 volatile u8 cmeimask0; /* VME interrupt mask zero */
71 u8 _cmeimask1[3];
72 volatile u8 cmeimask1; /* VME interrupt mask one */
73 u8 _cmepol[3];
74 volatile u8 cmepol; /* VME polarity */
75 u8 _tclear[3];
76 volatile u8 tclear;
77 u8 _errstat[3];
78 volatile u8 errstat; /* Error status reg, reserved on INT2 */
79 u32 _unused0[2];
80 u8 _tcnt0[3];
81 volatile u8 tcnt0; /* counter 0 */
82 u8 _tcnt1[3];
83 volatile u8 tcnt1; /* counter 1 */
84 u8 _tcnt2[3];
85 volatile u8 tcnt2; /* counter 2 */
86 u8 _tcword[3];
87 volatile u8 tcword; /* control word */
88#define SGINT_TCWORD_BCD 0x01 /* Use BCD mode for counters */
89#define SGINT_TCWORD_MMASK 0x0e /* Mode bitmask. */
90#define SGINT_TCWORD_MITC 0x00 /* IRQ on terminal count (doesn't work) */
91#define SGINT_TCWORD_MOS 0x02 /* One-shot IRQ mode. */
92#define SGINT_TCWORD_MRGEN 0x04 /* Normal rate generation */
93#define SGINT_TCWORD_MSWGEN 0x06 /* Square wave generator mode */
94#define SGINT_TCWORD_MSWST 0x08 /* Software strobe */
95#define SGINT_TCWORD_MHWST 0x0a /* Hardware strobe */
96#define SGINT_TCWORD_CMASK 0x30 /* Command mask */
97#define SGINT_TCWORD_CLAT 0x00 /* Latch command */
98#define SGINT_TCWORD_CLSB 0x10 /* LSB read/write */
99#define SGINT_TCWORD_CMSB 0x20 /* MSB read/write */
100#define SGINT_TCWORD_CALL 0x30 /* Full counter read/write */
101#define SGINT_TCWORD_CNT0 0x00 /* Select counter zero */
102#define SGINT_TCWORD_CNT1 0x40 /* Select counter one */
103#define SGINT_TCWORD_CNT2 0x80 /* Select counter two */
104#define SGINT_TCWORD_CRBCK 0xc0 /* Readback command */
105};
106
107/*
108 * The timer is the good old 8254. Unlike in PCs it's clocked at exactly 1MHz
109 */
110#define SGINT_TIMER_CLOCK 1000000
111
112/*
113 * This is the constant we're using for calibrating the counter.
114 */
115#define SGINT_TCSAMP_COUNTER ((SGINT_TIMER_CLOCK / HZ) + 255)
116
117/* We need software copies of these because they are write only. */
118extern u8 sgi_ioc_reset, sgi_ioc_write;
119
120struct sgioc_regs {
121 struct pi1_regs pport;
122 u32 _unused0[2];
123 struct sgioc_uart_regs uart;
124 struct sgioc_keyb_regs kbdmouse;
125 u8 _gcsel[3];
126 volatile u8 gcsel;
127 u8 _genctrl[3];
128 volatile u8 genctrl;
129 u8 _panel[3];
130 volatile u8 panel;
131#define SGIOC_PANEL_POWERON 0x01
132#define SGIOC_PANEL_POWERINTR 0x02
133#define SGIOC_PANEL_VOLDNINTR 0x10
134#define SGIOC_PANEL_VOLDNHOLD 0x20
135#define SGIOC_PANEL_VOLUPINTR 0x40
136#define SGIOC_PANEL_VOLUPHOLD 0x80
137 u32 _unused1;
138 u8 _sysid[3];
139 volatile u8 sysid;
140#define SGIOC_SYSID_FULLHOUSE 0x01
141#define SGIOC_SYSID_BOARDREV(x) (((x) & 0x1e) >> 1)
142#define SGIOC_SYSID_CHIPREV(x) (((x) & 0xe0) >> 5)
143 u32 _unused2;
144 u8 _read[3];
145 volatile u8 read;
146 u32 _unused3;
147 u8 _dmasel[3];
148 volatile u8 dmasel;
149#define SGIOC_DMASEL_SCLK10MHZ 0x00 /* use 10MHZ serial clock */
150#define SGIOC_DMASEL_ISDNB 0x01 /* enable isdn B */
151#define SGIOC_DMASEL_ISDNA 0x02 /* enable isdn A */
152#define SGIOC_DMASEL_PPORT 0x04 /* use parallel DMA */
153#define SGIOC_DMASEL_SCLK667MHZ 0x10 /* use 6.67MHZ serial clock */
154#define SGIOC_DMASEL_SCLKEXT 0x20 /* use external serial clock */
155 u32 _unused4;
156 u8 _reset[3];
157 volatile u8 reset;
158#define SGIOC_RESET_PPORT 0x01 /* 0=parport reset, 1=nornal */
159#define SGIOC_RESET_KBDMOUSE 0x02 /* 0=kbdmouse reset, 1=normal */
160#define SGIOC_RESET_EISA 0x04 /* 0=eisa reset, 1=normal */
161#define SGIOC_RESET_ISDN 0x08 /* 0=isdn reset, 1=normal */
162#define SGIOC_RESET_LC0OFF 0x10 /* guiness: turn led off (red, else green) */
163#define SGIOC_RESET_LC1OFF 0x20 /* guiness: turn led off (green, else amber) */
164 u32 _unused5;
165 u8 _write[3];
166 volatile u8 write;
167#define SGIOC_WRITE_NTHRESH 0x01 /* use 4.5db threshhold */
168#define SGIOC_WRITE_TPSPEED 0x02 /* use 100ohm TP speed */
169#define SGIOC_WRITE_EPSEL 0x04 /* force cable mode: 1=AUI 0=TP */
170#define SGIOC_WRITE_EASEL 0x08 /* 1=autoselect 0=manual cable selection */
171#define SGIOC_WRITE_U1AMODE 0x10 /* 1=PC 0=MAC UART mode */
172#define SGIOC_WRITE_U0AMODE 0x20 /* 1=PC 0=MAC UART mode */
173#define SGIOC_WRITE_MLO 0x40 /* 1=4.75V 0=+5V */
174#define SGIOC_WRITE_MHI 0x80 /* 1=5.25V 0=+5V */
175 u32 _unused6;
176 struct sgint_regs int3;
177 u32 _unused7[16];
178 volatile u32 extio; /* FullHouse only */
179#define EXTIO_S0_IRQ_3 0x8000 /* S0: vid.vsync */
180#define EXTIO_S0_IRQ_2 0x4000 /* S0: gfx.fifofull */
181#define EXTIO_S0_IRQ_1 0x2000 /* S0: gfx.int */
182#define EXTIO_S0_RETRACE 0x1000
183#define EXTIO_SG_IRQ_3 0x0800 /* SG: vid.vsync */
184#define EXTIO_SG_IRQ_2 0x0400 /* SG: gfx.fifofull */
185#define EXTIO_SG_IRQ_1 0x0200 /* SG: gfx.int */
186#define EXTIO_SG_RETRACE 0x0100
187#define EXTIO_GIO_33MHZ 0x0080
188#define EXTIO_EISA_BUSERR 0x0040
189#define EXTIO_MC_BUSERR 0x0020
190#define EXTIO_HPC3_BUSERR 0x0010
191#define EXTIO_S0_STAT_1 0x0008
192#define EXTIO_S0_STAT_0 0x0004
193#define EXTIO_SG_STAT_1 0x0002
194#define EXTIO_SG_STAT_0 0x0001
195};
196
197extern struct sgioc_regs *sgioc;
198extern struct sgint_regs *sgint;
199
200#endif
diff --git a/include/asm-mips/sgi/ip22.h b/include/asm-mips/sgi/ip22.h
deleted file mode 100644
index c0501f91719b..000000000000
--- a/include/asm-mips/sgi/ip22.h
+++ /dev/null
@@ -1,78 +0,0 @@
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 * ip22.h: Definitions for SGI IP22 machines
7 *
8 * Copyright (C) 1996 David S. Miller
9 * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle
10 */
11
12#ifndef _SGI_IP22_H
13#define _SGI_IP22_H
14
15/*
16 * These are the virtual IRQ numbers, we divide all IRQ's into
17 * 'spaces', the 'space' determines where and how to enable/disable
18 * that particular IRQ on an SGI machine. HPC DMA and MC DMA interrupts
19 * are not supported this way. Driver is supposed to allocate HPC/MC
20 * interrupt as shareable and then look to proper status bit (see
21 * HAL2 driver). This will prevent many complications, trust me ;-)
22 */
23
24#include <irq.h>
25#include <asm/sgi/ioc.h>
26
27#define SGINT_EISA 0 /* 16 EISA irq levels (Indigo2) */
28#define SGINT_CPU MIPS_CPU_IRQ_BASE /* MIPS CPU define 8 interrupt sources */
29#define SGINT_LOCAL0 (SGINT_CPU+8) /* 8 local0 irq levels */
30#define SGINT_LOCAL1 (SGINT_CPU+16) /* 8 local1 irq levels */
31#define SGINT_LOCAL2 (SGINT_CPU+24) /* 8 local2 vectored irq levels */
32#define SGINT_LOCAL3 (SGINT_CPU+32) /* 8 local3 vectored irq levels */
33#define SGINT_END (SGINT_CPU+40) /* End of 'spaces' */
34
35/*
36 * Individual interrupt definitions for the Indy and Indigo2
37 */
38
39#define SGI_SOFT_0_IRQ SGINT_CPU + 0
40#define SGI_SOFT_1_IRQ SGINT_CPU + 1
41#define SGI_LOCAL_0_IRQ SGINT_CPU + 2
42#define SGI_LOCAL_1_IRQ SGINT_CPU + 3
43#define SGI_8254_0_IRQ SGINT_CPU + 4
44#define SGI_8254_1_IRQ SGINT_CPU + 5
45#define SGI_BUSERR_IRQ SGINT_CPU + 6
46#define SGI_TIMER_IRQ SGINT_CPU + 7
47
48#define SGI_FIFO_IRQ SGINT_LOCAL0 + 0 /* FIFO full */
49#define SGI_GIO_0_IRQ SGI_FIFO_IRQ /* GIO-0 */
50#define SGI_WD93_0_IRQ SGINT_LOCAL0 + 1 /* 1st onboard WD93 */
51#define SGI_WD93_1_IRQ SGINT_LOCAL0 + 2 /* 2nd onboard WD93 */
52#define SGI_ENET_IRQ SGINT_LOCAL0 + 3 /* onboard ethernet */
53#define SGI_MCDMA_IRQ SGINT_LOCAL0 + 4 /* MC DMA done */
54#define SGI_PARPORT_IRQ SGINT_LOCAL0 + 5 /* Parallel port */
55#define SGI_GIO_1_IRQ SGINT_LOCAL0 + 6 /* GE / GIO-1 / 2nd-HPC */
56#define SGI_MAP_0_IRQ SGINT_LOCAL0 + 7 /* Mappable interrupt 0 */
57
58#define SGI_GPL0_IRQ SGINT_LOCAL1 + 0 /* General Purpose LOCAL1_N<0> */
59#define SGI_PANEL_IRQ SGINT_LOCAL1 + 1 /* front panel */
60#define SGI_GPL2_IRQ SGINT_LOCAL1 + 2 /* General Purpose LOCAL1_N<2> */
61#define SGI_MAP_1_IRQ SGINT_LOCAL1 + 3 /* Mappable interrupt 1 */
62#define SGI_HPCDMA_IRQ SGINT_LOCAL1 + 4 /* HPC DMA done */
63#define SGI_ACFAIL_IRQ SGINT_LOCAL1 + 5 /* AC fail */
64#define SGI_VINO_IRQ SGINT_LOCAL1 + 6 /* Indy VINO */
65#define SGI_GIO_2_IRQ SGINT_LOCAL1 + 7 /* Vert retrace / GIO-2 */
66
67/* Mapped interrupts. These interrupts may be mapped to either 0, or 1 */
68#define SGI_VERT_IRQ SGINT_LOCAL2 + 0 /* INT3: newport vertical status */
69#define SGI_EISA_IRQ SGINT_LOCAL2 + 3 /* EISA interrupts */
70#define SGI_KEYBD_IRQ SGINT_LOCAL2 + 4 /* keyboard */
71#define SGI_SERIAL_IRQ SGINT_LOCAL2 + 5 /* onboard serial */
72
73#define ip22_is_fullhouse() (sgioc->sysid & SGIOC_SYSID_FULLHOUSE)
74
75extern unsigned short ip22_eeprom_read(unsigned int *ctrl, int reg);
76extern unsigned short ip22_nvram_read(int reg);
77
78#endif
diff --git a/include/asm-mips/sgi/mc.h b/include/asm-mips/sgi/mc.h
deleted file mode 100644
index 1576c2394de8..000000000000
--- a/include/asm-mips/sgi/mc.h
+++ /dev/null
@@ -1,231 +0,0 @@
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 * mc.h: Definitions for SGI Memory Controller
7 *
8 * Copyright (C) 1996 David S. Miller
9 * Copyright (C) 1999 Ralf Baechle
10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */
12
13#ifndef _SGI_MC_H
14#define _SGI_MC_H
15
16struct sgimc_regs {
17 u32 _unused0;
18 volatile u32 cpuctrl0; /* CPU control register 0, readwrite */
19#define SGIMC_CCTRL0_REFS 0x0000000f /* REFS mask */
20#define SGIMC_CCTRL0_EREFRESH 0x00000010 /* Memory refresh enable */
21#define SGIMC_CCTRL0_EPERRGIO 0x00000020 /* GIO parity error enable */
22#define SGIMC_CCTRL0_EPERRMEM 0x00000040 /* Main mem parity error enable */
23#define SGIMC_CCTRL0_EPERRCPU 0x00000080 /* CPU bus parity error enable */
24#define SGIMC_CCTRL0_WDOG 0x00000100 /* Watchdog timer enable */
25#define SGIMC_CCTRL0_SYSINIT 0x00000200 /* System init bit */
26#define SGIMC_CCTRL0_GFXRESET 0x00000400 /* Graphics interface reset */
27#define SGIMC_CCTRL0_EISALOCK 0x00000800 /* Lock CPU from memory for EISA */
28#define SGIMC_CCTRL0_EPERRSCMD 0x00001000 /* SysCMD bus parity error enable */
29#define SGIMC_CCTRL0_IENAB 0x00002000 /* Allow interrupts from MC */
30#define SGIMC_CCTRL0_ESNOOP 0x00004000 /* Snooping I/O enable */
31#define SGIMC_CCTRL0_EPROMWR 0x00008000 /* Prom writes from cpu enable */
32#define SGIMC_CCTRL0_WRESETPMEM 0x00010000 /* Perform warm reset, preserves mem */
33#define SGIMC_CCTRL0_LENDIAN 0x00020000 /* Put MC in little-endian mode */
34#define SGIMC_CCTRL0_WRESETDMEM 0x00040000 /* Warm reset, destroys mem contents */
35#define SGIMC_CCTRL0_CMEMBADPAR 0x02000000 /* Generate bad perr from cpu to mem */
36#define SGIMC_CCTRL0_R4KNOCHKPARR 0x04000000 /* Don't chk parity on mem data reads */
37#define SGIMC_CCTRL0_GIOBTOB 0x08000000 /* Allow GIO back to back writes */
38 u32 _unused1;
39 volatile u32 cpuctrl1; /* CPU control register 1, readwrite */
40#define SGIMC_CCTRL1_EGIOTIMEO 0x00000010 /* GIO bus timeout enable */
41#define SGIMC_CCTRL1_FIXEDEHPC 0x00001000 /* Fixed HPC endianness */
42#define SGIMC_CCTRL1_LITTLEHPC 0x00002000 /* Little endian HPC */
43#define SGIMC_CCTRL1_FIXEDEEXP0 0x00004000 /* Fixed EXP0 endianness */
44#define SGIMC_CCTRL1_LITTLEEXP0 0x00008000 /* Little endian EXP0 */
45#define SGIMC_CCTRL1_FIXEDEEXP1 0x00010000 /* Fixed EXP1 endianness */
46#define SGIMC_CCTRL1_LITTLEEXP1 0x00020000 /* Little endian EXP1 */
47
48 u32 _unused2;
49 volatile u32 watchdogt; /* Watchdog reg rdonly, write clears */
50
51 u32 _unused3;
52 volatile u32 systemid; /* MC system ID register, readonly */
53#define SGIMC_SYSID_MASKREV 0x0000000f /* Revision of MC controller */
54#define SGIMC_SYSID_EPRESENT 0x00000010 /* Indicates presence of EISA bus */
55
56 u32 _unused4[3];
57 volatile u32 divider; /* Divider reg for RPSS */
58
59 u32 _unused5;
60 u32 eeprom; /* EEPROM byte reg for r4k */
61#define SGIMC_EEPROM_PRE 0x00000001 /* eeprom chip PRE pin assertion */
62#define SGIMC_EEPROM_CSEL 0x00000002 /* Active high, eeprom chip select */
63#define SGIMC_EEPROM_SECLOCK 0x00000004 /* EEPROM serial clock */
64#define SGIMC_EEPROM_SDATAO 0x00000008 /* Serial EEPROM data-out */
65#define SGIMC_EEPROM_SDATAI 0x00000010 /* Serial EEPROM data-in */
66
67 u32 _unused6[3];
68 volatile u32 rcntpre; /* Preload refresh counter */
69
70 u32 _unused7;
71 volatile u32 rcounter; /* Readonly refresh counter */
72
73 u32 _unused8[13];
74 volatile u32 giopar; /* Parameter word for GIO64 */
75#define SGIMC_GIOPAR_HPC64 0x00000001 /* HPC talks to GIO using 64-bits */
76#define SGIMC_GIOPAR_GFX64 0x00000002 /* GFX talks to GIO using 64-bits */
77#define SGIMC_GIOPAR_EXP064 0x00000004 /* EXP(slot0) talks using 64-bits */
78#define SGIMC_GIOPAR_EXP164 0x00000008 /* EXP(slot1) talks using 64-bits */
79#define SGIMC_GIOPAR_EISA64 0x00000010 /* EISA bus talks 64-bits to GIO */
80#define SGIMC_GIOPAR_HPC264 0x00000020 /* 2nd HPX talks 64-bits to GIO */
81#define SGIMC_GIOPAR_RTIMEGFX 0x00000040 /* GFX device has realtime attr */
82#define SGIMC_GIOPAR_RTIMEEXP0 0x00000080 /* EXP(slot0) has realtime attr */
83#define SGIMC_GIOPAR_RTIMEEXP1 0x00000100 /* EXP(slot1) has realtime attr */
84#define SGIMC_GIOPAR_MASTEREISA 0x00000200 /* EISA bus can act as bus master */
85#define SGIMC_GIOPAR_ONEBUS 0x00000400 /* Exists one GIO64 pipelined bus */
86#define SGIMC_GIOPAR_MASTERGFX 0x00000800 /* GFX can act as a bus master */
87#define SGIMC_GIOPAR_MASTEREXP0 0x00001000 /* EXP(slot0) can bus master */
88#define SGIMC_GIOPAR_MASTEREXP1 0x00002000 /* EXP(slot1) can bus master */
89#define SGIMC_GIOPAR_PLINEEXP0 0x00004000 /* EXP(slot0) has pipeline attr */
90#define SGIMC_GIOPAR_PLINEEXP1 0x00008000 /* EXP(slot1) has pipeline attr */
91
92 u32 _unused9;
93 volatile u32 cputp; /* CPU bus arb time period */
94
95 u32 _unused10[3];
96 volatile u32 lbursttp; /* Time period for long bursts */
97
98 /* MC chip can drive up to 4 bank 4 SIMMs each. All SIMMs in bank must
99 * be the same size. The size encoding for supported SIMMs is bellow */
100 u32 _unused11[9];
101 volatile u32 mconfig0; /* Memory config register zero */
102 u32 _unused12;
103 volatile u32 mconfig1; /* Memory config register one */
104#define SGIMC_MCONFIG_BASEADDR 0x000000ff /* Base address of bank*/
105#define SGIMC_MCONFIG_RMASK 0x00001f00 /* Ram config bitmask */
106#define SGIMC_MCONFIG_BVALID 0x00002000 /* Bank is valid */
107#define SGIMC_MCONFIG_SBANKS 0x00004000 /* Number of subbanks */
108
109 u32 _unused13;
110 volatile u32 cmacc; /* Mem access config for CPU */
111 u32 _unused14;
112 volatile u32 gmacc; /* Mem access config for GIO */
113
114 /* This define applies to both cmacc and gmacc registers above. */
115#define SGIMC_MACC_ALIASBIG 0x20000000 /* 512MB home for alias */
116
117 /* Error address/status regs from GIO and CPU perspectives. */
118 u32 _unused15;
119 volatile u32 cerr; /* Error address reg for CPU */
120 u32 _unused16;
121 volatile u32 cstat; /* Status reg for CPU */
122#define SGIMC_CSTAT_RD 0x00000100 /* read parity error */
123#define SGIMC_CSTAT_PAR 0x00000200 /* CPU parity error */
124#define SGIMC_CSTAT_ADDR 0x00000400 /* memory bus error bad addr */
125#define SGIMC_CSTAT_SYSAD_PAR 0x00000800 /* sysad parity error */
126#define SGIMC_CSTAT_SYSCMD_PAR 0x00001000 /* syscmd parity error */
127#define SGIMC_CSTAT_BAD_DATA 0x00002000 /* bad data identifier */
128#define SGIMC_CSTAT_PAR_MASK 0x00001f00 /* parity error mask */
129#define SGIMC_CSTAT_RD_PAR (SGIMC_CSTAT_RD | SGIMC_CSTAT_PAR)
130
131 u32 _unused17;
132 volatile u32 gerr; /* Error address reg for GIO */
133 u32 _unused18;
134 volatile u32 gstat; /* Status reg for GIO */
135#define SGIMC_GSTAT_RD 0x00000100 /* read parity error */
136#define SGIMC_GSTAT_WR 0x00000200 /* write parity error */
137#define SGIMC_GSTAT_TIME 0x00000400 /* GIO bus timed out */
138#define SGIMC_GSTAT_PROM 0x00000800 /* write to PROM when PROM_EN not set */
139#define SGIMC_GSTAT_ADDR 0x00001000 /* parity error on addr cycle */
140#define SGIMC_GSTAT_BC 0x00002000 /* parity error on byte count cycle */
141#define SGIMC_GSTAT_PIO_RD 0x00004000 /* read data parity on pio */
142#define SGIMC_GSTAT_PIO_WR 0x00008000 /* write data parity on pio */
143
144 /* Special hard bus locking registers. */
145 u32 _unused19;
146 volatile u32 syssembit; /* Uni-bit system semaphore */
147 u32 _unused20;
148 volatile u32 mlock; /* Global GIO memory access lock */
149 u32 _unused21;
150 volatile u32 elock; /* Locks EISA from GIO accesses */
151
152 /* GIO dma control registers. */
153 u32 _unused22[15];
154 volatile u32 gio_dma_trans; /* DMA mask to translation GIO addrs */
155 u32 _unused23;
156 volatile u32 gio_dma_sbits; /* DMA GIO addr substitution bits */
157 u32 _unused24;
158 volatile u32 dma_intr_cause; /* DMA IRQ cause indicator bits */
159 u32 _unused25;
160 volatile u32 dma_ctrl; /* Main DMA control reg */
161
162 /* DMA TLB entry 0 */
163 u32 _unused26[5];
164 volatile u32 dtlb_hi0;
165 u32 _unused27;
166 volatile u32 dtlb_lo0;
167
168 /* DMA TLB entry 1 */
169 u32 _unused28;
170 volatile u32 dtlb_hi1;
171 u32 _unused29;
172 volatile u32 dtlb_lo1;
173
174 /* DMA TLB entry 2 */
175 u32 _unused30;
176 volatile u32 dtlb_hi2;
177 u32 _unused31;
178 volatile u32 dtlb_lo2;
179
180 /* DMA TLB entry 3 */
181 u32 _unused32;
182 volatile u32 dtlb_hi3;
183 u32 _unused33;
184 volatile u32 dtlb_lo3;
185
186 u32 _unused34[0x0392];
187
188 u32 _unused35;
189 volatile u32 rpsscounter; /* Chirps at 100ns */
190
191 u32 _unused36[0x1000/4-2*4];
192
193 u32 _unused37;
194 volatile u32 maddronly; /* Address DMA goes at */
195 u32 _unused38;
196 volatile u32 maddrpdeflts; /* Same as above, plus set defaults */
197 u32 _unused39;
198 volatile u32 dmasz; /* DMA count */
199 u32 _unused40;
200 volatile u32 ssize; /* DMA stride size */
201 u32 _unused41;
202 volatile u32 gmaddronly; /* Set GIO DMA but don't start trans */
203 u32 _unused42;
204 volatile u32 dmaddnpgo; /* Set GIO DMA addr + start transfer */
205 u32 _unused43;
206 volatile u32 dmamode; /* DMA mode config bit settings */
207 u32 _unused44;
208 volatile u32 dmaccount; /* Zoom and byte count for DMA */
209 u32 _unused45;
210 volatile u32 dmastart; /* Pedal to the metal. */
211 u32 _unused46;
212 volatile u32 dmarunning; /* DMA op is in progress */
213 u32 _unused47;
214 volatile u32 maddrdefstart; /* Set dma addr, defaults, and kick it */
215};
216
217extern struct sgimc_regs *sgimc;
218#define SGIMC_BASE 0x1fa00000 /* physical */
219
220/* Base location of the two ram banks found in IP2[0268] machines. */
221#define SGIMC_SEG0_BADDR 0x08000000
222#define SGIMC_SEG1_BADDR 0x20000000
223
224/* Maximum size of the above banks are per machine. */
225#define SGIMC_SEG0_SIZE_ALL 0x10000000 /* 256MB */
226#define SGIMC_SEG1_SIZE_IP20_IP22 0x08000000 /* 128MB */
227#define SGIMC_SEG1_SIZE_IP26_IP28 0x20000000 /* 512MB */
228
229extern void sgimc_init(void);
230
231#endif /* _SGI_MC_H */
diff --git a/include/asm-mips/sgi/pi1.h b/include/asm-mips/sgi/pi1.h
deleted file mode 100644
index c9506915dc5c..000000000000
--- a/include/asm-mips/sgi/pi1.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * pi1.h: Definitions for SGI PI1 parallel port
3 */
4
5#ifndef _SGI_PI1_H
6#define _SGI_PI1_H
7
8struct pi1_regs {
9 u8 _data[3];
10 volatile u8 data;
11 u8 _ctrl[3];
12 volatile u8 ctrl;
13#define PI1_CTRL_STROBE_N 0x01
14#define PI1_CTRL_AFD_N 0x02
15#define PI1_CTRL_INIT_N 0x04
16#define PI1_CTRL_SLIN_N 0x08
17#define PI1_CTRL_IRQ_ENA 0x10
18#define PI1_CTRL_DIR 0x20
19#define PI1_CTRL_SEL 0x40
20 u8 _status[3];
21 volatile u8 status;
22#define PI1_STAT_DEVID 0x03 /* bits 0-1 */
23#define PI1_STAT_NOINK 0x04 /* SGI MODE only */
24#define PI1_STAT_ERROR 0x08
25#define PI1_STAT_ONLINE 0x10
26#define PI1_STAT_PE 0x20
27#define PI1_STAT_ACK 0x40
28#define PI1_STAT_BUSY 0x80
29 u8 _dmactrl[3];
30 volatile u8 dmactrl;
31#define PI1_DMACTRL_FIFO_EMPTY 0x01 /* fifo empty R/O */
32#define PI1_DMACTRL_ABORT 0x02 /* reset DMA and internal fifo W/O */
33#define PI1_DMACTRL_STDMODE 0x00 /* bits 2-3 */
34#define PI1_DMACTRL_SGIMODE 0x04 /* bits 2-3 */
35#define PI1_DMACTRL_RICOHMODE 0x08 /* bits 2-3 */
36#define PI1_DMACTRL_HPMODE 0x0c /* bits 2-3 */
37#define PI1_DMACTRL_BLKMODE 0x10 /* block mode */
38#define PI1_DMACTRL_FIFO_CLEAR 0x20 /* clear fifo W/O */
39#define PI1_DMACTRL_READ 0x40 /* read */
40#define PI1_DMACTRL_RUN 0x80 /* pedal to the metal */
41 u8 _intstat[3];
42 volatile u8 intstat;
43#define PI1_INTSTAT_ACK 0x04
44#define PI1_INTSTAT_FEMPTY 0x08
45#define PI1_INTSTAT_NOINK 0x10
46#define PI1_INTSTAT_ONLINE 0x20
47#define PI1_INTSTAT_ERR 0x40
48#define PI1_INTSTAT_PE 0x80
49 u8 _intmask[3];
50 volatile u8 intmask; /* enabled low, reset high*/
51#define PI1_INTMASK_ACK 0x04
52#define PI1_INTMASK_FIFO_EMPTY 0x08
53#define PI1_INTMASK_NOINK 0x10
54#define PI1_INTMASK_ONLINE 0x20
55#define PI1_INTMASK_ERR 0x40
56#define PI1_INTMASK_PE 0x80
57 u8 _timer1[3];
58 volatile u8 timer1;
59#define PI1_TIME1 0x27
60 u8 _timer2[3];
61 volatile u8 timer2;
62#define PI1_TIME2 0x13
63 u8 _timer3[3];
64 volatile u8 timer3;
65#define PI1_TIME3 0x10
66 u8 _timer4[3];
67 volatile u8 timer4;
68#define PI1_TIME4 0x00
69};
70
71#endif
diff --git a/include/asm-mips/sgi/seeq.h b/include/asm-mips/sgi/seeq.h
deleted file mode 100644
index af0ffd76899d..000000000000
--- a/include/asm-mips/sgi/seeq.h
+++ /dev/null
@@ -1,21 +0,0 @@
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 * Copyright (C) 2007 by Ralf Baechle
7 */
8#ifndef __ASM_SGI_SEEQ_H
9#define __ASM_SGI_SEEQ_H
10
11#include <linux/if_ether.h>
12
13#include <asm/sgi/hpc3.h>
14
15struct sgiseeq_platform_data {
16 struct hpc3_regs *hpc;
17 unsigned int irq;
18 unsigned char mac[ETH_ALEN];
19};
20
21#endif /* __ASM_SGI_SEEQ_H */
diff --git a/include/asm-mips/sgi/sgi.h b/include/asm-mips/sgi/sgi.h
deleted file mode 100644
index 645cea7c0f8e..000000000000
--- a/include/asm-mips/sgi/sgi.h
+++ /dev/null
@@ -1,47 +0,0 @@
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 * sgi.h: Definitions specific to SGI machines.
7 *
8 * Copyright (C) 1996 David S. Miller (dm@sgi.com)
9 */
10#ifndef _ASM_SGI_SGI_H
11#define _ASM_SGI_SGI_H
12
13/* UP=UniProcessor MP=MultiProcessor(capable) */
14enum sgi_mach {
15 ip4, /* R2k UP */
16 ip5, /* R2k MP */
17 ip6, /* R3k UP */
18 ip7, /* R3k MP */
19 ip9, /* R3k UP */
20 ip12, /* R3kA UP, Indigo */
21 ip15, /* R3kA MP */
22 ip17, /* R4K UP */
23 ip19, /* R4K MP */
24 ip20, /* R4K UP, Indigo */
25 ip21, /* TFP MP */
26 ip22, /* R4x00 UP, Indigo2 */
27 ip25, /* R10k MP */
28 ip26, /* TFP UP, Indigo2 */
29 ip27, /* R10k MP, R12k MP, Origin */
30 ip28, /* R10k UP, Indigo2 */
31 ip30, /* Octane */
32 ip32, /* O2 */
33};
34
35extern enum sgi_mach sgimach;
36extern void sgi_sysinit(void);
37
38/* Many I/O space registers are byte sized and are contained within
39 * one byte per word, specifically the MSB, this macro helps out.
40 */
41#ifdef __MIPSEL__
42#define SGI_MSB(regaddr) (regaddr)
43#else
44#define SGI_MSB(regaddr) ((regaddr) | 0x3)
45#endif
46
47#endif /* _ASM_SGI_SGI_H */
diff --git a/include/asm-mips/sgi/wd.h b/include/asm-mips/sgi/wd.h
deleted file mode 100644
index 0d6c3a4da891..000000000000
--- a/include/asm-mips/sgi/wd.h
+++ /dev/null
@@ -1,20 +0,0 @@
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 * Copyright (C) 2007 by Ralf Baechle
7 */
8#ifndef __ASM_SGI_WD_H
9#define __ASM_SGI_WD_H
10
11#include <asm/sgi/hpc3.h>
12
13struct sgiwd93_platform_data {
14 unsigned int unit;
15 unsigned int irq;
16 struct hpc3_scsiregs *hregs;
17 unsigned char *wdregs;
18};
19
20#endif /* __ASM_SGI_WD_H */
diff --git a/include/asm-mips/sgialib.h b/include/asm-mips/sgialib.h
deleted file mode 100644
index bfce5c786f1c..000000000000
--- a/include/asm-mips/sgialib.h
+++ /dev/null
@@ -1,124 +0,0 @@
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 * SGI ARCS firmware interface library for the Linux kernel.
7 *
8 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
9 * Copyright (C) 2001, 2002 Ralf Baechle (ralf@gnu.org)
10 */
11#ifndef _ASM_SGIALIB_H
12#define _ASM_SGIALIB_H
13
14#include <asm/sgiarcs.h>
15
16extern struct linux_romvec *romvec;
17extern int prom_argc;
18
19extern LONG *_prom_argv, *_prom_envp;
20
21/* A 32-bit ARC PROM pass arguments and environment as 32-bit pointer.
22 These macros take care of sign extension. */
23#define prom_argv(index) ((char *) (long) _prom_argv[(index)])
24#define prom_argc(index) ((char *) (long) _prom_argc[(index)])
25
26extern int prom_flags;
27
28#define PROM_FLAG_ARCS 1
29#define PROM_FLAG_USE_AS_CONSOLE 2
30#define PROM_FLAG_DONT_FREE_TEMP 4
31
32/* Simple char-by-char console I/O. */
33extern void prom_putchar(char c);
34extern char prom_getchar(void);
35
36/* Memory descriptor management. */
37#define PROM_MAX_PMEMBLOCKS 32
38struct prom_pmemblock {
39 LONG base; /* Within KSEG0 or XKPHYS. */
40 ULONG size; /* In bytes. */
41 ULONG type; /* free or prom memory */
42};
43
44/* Get next memory descriptor after CURR, returns first descriptor
45 * in chain is CURR is NULL.
46 */
47extern struct linux_mdesc *prom_getmdesc(struct linux_mdesc *curr);
48#define PROM_NULL_MDESC ((struct linux_mdesc *) 0)
49
50/* Called by prom_init to setup the physical memory pmemblock
51 * array.
52 */
53extern void prom_meminit(void);
54extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
55
56/* PROM device tree library routines. */
57#define PROM_NULL_COMPONENT ((pcomponent *) 0)
58
59/* Get sibling component of THIS. */
60extern pcomponent *ArcGetPeer(pcomponent *this);
61
62/* Get child component of THIS. */
63extern pcomponent *ArcGetChild(pcomponent *this);
64
65/* Get parent component of CHILD. */
66extern pcomponent *prom_getparent(pcomponent *child);
67
68/* Copy component opaque data of component THIS into BUFFER
69 * if component THIS has opaque data. Returns success or
70 * failure status.
71 */
72extern long prom_getcdata(void *buffer, pcomponent *this);
73
74/* Other misc. component routines. */
75extern pcomponent *prom_childadd(pcomponent *this, pcomponent *tmp, void *data);
76extern long prom_delcomponent(pcomponent *this);
77extern pcomponent *prom_componentbypath(char *path);
78
79/* This is called at prom_init time to identify the
80 * ARC architecture we are running on
81 */
82extern void prom_identify_arch(void);
83
84/* Environment variable routines. */
85extern PCHAR ArcGetEnvironmentVariable(PCHAR name);
86extern LONG ArcSetEnvironmentVariable(PCHAR name, PCHAR value);
87
88/* ARCS command line acquisition and parsing. */
89extern char *prom_getcmdline(void);
90extern void prom_init_cmdline(void);
91
92/* Acquiring info about the current time, etc. */
93extern struct linux_tinfo *prom_gettinfo(void);
94extern unsigned long prom_getrtime(void);
95
96/* File operations. */
97extern long prom_getvdirent(unsigned long fd, struct linux_vdirent *ent, unsigned long num, unsigned long *cnt);
98extern long prom_open(char *name, enum linux_omode md, unsigned long *fd);
99extern long prom_close(unsigned long fd);
100extern LONG ArcRead(ULONG fd, PVOID buf, ULONG num, PULONG cnt);
101extern long prom_getrstatus(unsigned long fd);
102extern LONG ArcWrite(ULONG fd, PVOID buf, ULONG num, PULONG cnt);
103extern long prom_seek(unsigned long fd, struct linux_bigint *off, enum linux_seekmode sm);
104extern long prom_mount(char *name, enum linux_mountops op);
105extern long prom_getfinfo(unsigned long fd, struct linux_finfo *buf);
106extern long prom_setfinfo(unsigned long fd, unsigned long flags, unsigned long msk);
107
108/* Running stand-along programs. */
109extern long prom_load(char *name, unsigned long end, unsigned long *pc, unsigned long *eaddr);
110extern long prom_invoke(unsigned long pc, unsigned long sp, long argc, char **argv, char **envp);
111extern long prom_exec(char *name, long argc, char **argv, char **envp);
112
113/* Misc. routines. */
114extern VOID prom_halt(VOID) __attribute__((noreturn));
115extern VOID prom_powerdown(VOID) __attribute__((noreturn));
116extern VOID prom_restart(VOID) __attribute__((noreturn));
117extern VOID ArcReboot(VOID) __attribute__((noreturn));
118extern VOID ArcEnterInteractiveMode(VOID) __attribute__((noreturn));
119extern long prom_cfgsave(VOID);
120extern struct linux_sysid *prom_getsysid(VOID);
121extern VOID ArcFlushAllCaches(VOID);
122extern DISPLAY_STATUS *ArcGetDisplayStatus(ULONG FileID);
123
124#endif /* _ASM_SGIALIB_H */
diff --git a/include/asm-mips/sgiarcs.h b/include/asm-mips/sgiarcs.h
deleted file mode 100644
index 721327f88601..000000000000
--- a/include/asm-mips/sgiarcs.h
+++ /dev/null
@@ -1,548 +0,0 @@
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 * ARC firmware interface defines.
7 *
8 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
9 * Copyright (C) 1999, 2001 Ralf Baechle (ralf@gnu.org)
10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */
12#ifndef _ASM_SGIARCS_H
13#define _ASM_SGIARCS_H
14
15#include <asm/types.h>
16#include <asm/fw/arc/types.h>
17
18/* Various ARCS error codes. */
19#define PROM_ESUCCESS 0x00
20#define PROM_E2BIG 0x01
21#define PROM_EACCESS 0x02
22#define PROM_EAGAIN 0x03
23#define PROM_EBADF 0x04
24#define PROM_EBUSY 0x05
25#define PROM_EFAULT 0x06
26#define PROM_EINVAL 0x07
27#define PROM_EIO 0x08
28#define PROM_EISDIR 0x09
29#define PROM_EMFILE 0x0a
30#define PROM_EMLINK 0x0b
31#define PROM_ENAMETOOLONG 0x0c
32#define PROM_ENODEV 0x0d
33#define PROM_ENOENT 0x0e
34#define PROM_ENOEXEC 0x0f
35#define PROM_ENOMEM 0x10
36#define PROM_ENOSPC 0x11
37#define PROM_ENOTDIR 0x12
38#define PROM_ENOTTY 0x13
39#define PROM_ENXIO 0x14
40#define PROM_EROFS 0x15
41/* SGI ARCS specific errno's. */
42#define PROM_EADDRNOTAVAIL 0x1f
43#define PROM_ETIMEDOUT 0x20
44#define PROM_ECONNABORTED 0x21
45#define PROM_ENOCONNECT 0x22
46
47/* Device classes, types, and identifiers for prom
48 * device inventory queries.
49 */
50enum linux_devclass {
51 system, processor, cache, adapter, controller, peripheral, memory
52};
53
54enum linux_devtypes {
55 /* Generic stuff. */
56 Arc, Cpu, Fpu,
57
58 /* Primary insn and data caches. */
59 picache, pdcache,
60
61 /* Secondary insn, data, and combined caches. */
62 sicache, sdcache, sccache,
63
64 memdev, eisa_adapter, tc_adapter, scsi_adapter, dti_adapter,
65 multifunc_adapter, dsk_controller, tp_controller, cdrom_controller,
66 worm_controller, serial_controller, net_controller, disp_controller,
67 parallel_controller, ptr_controller, kbd_controller, audio_controller,
68 misc_controller, disk_peripheral, flpy_peripheral, tp_peripheral,
69 modem_peripheral, monitor_peripheral, printer_peripheral,
70 ptr_peripheral, kbd_peripheral, term_peripheral, line_peripheral,
71 net_peripheral, misc_peripheral, anon
72};
73
74enum linux_identifier {
75 bogus, ronly, removable, consin, consout, input, output
76};
77
78/* A prom device tree component. */
79struct linux_component {
80 enum linux_devclass class; /* node class */
81 enum linux_devtypes type; /* node type */
82 enum linux_identifier iflags; /* node flags */
83 USHORT vers; /* node version */
84 USHORT rev; /* node revision */
85 ULONG key; /* completely magic */
86 ULONG amask; /* XXX affinity mask??? */
87 ULONG cdsize; /* size of configuration data */
88 ULONG ilen; /* length of string identifier */
89 _PULONG iname; /* string identifier */
90};
91typedef struct linux_component pcomponent;
92
93struct linux_sysid {
94 char vend[8], prod[8];
95};
96
97/* ARCS prom memory descriptors. */
98enum arcs_memtypes {
99 arcs_eblock, /* exception block */
100 arcs_rvpage, /* ARCS romvec page */
101 arcs_fcontig, /* Contiguous and free */
102 arcs_free, /* Generic free memory */
103 arcs_bmem, /* Borken memory, don't use */
104 arcs_prog, /* A loaded program resides here */
105 arcs_atmp, /* ARCS temporary storage area, wish Sparc OpenBoot told this */
106 arcs_aperm, /* ARCS permanent storage... */
107};
108
109/* ARC has slightly different types than ARCS */
110enum arc_memtypes {
111 arc_eblock, /* exception block */
112 arc_rvpage, /* romvec page */
113 arc_free, /* Generic free memory */
114 arc_bmem, /* Borken memory, don't use */
115 arc_prog, /* A loaded program resides here */
116 arc_atmp, /* temporary storage area */
117 arc_aperm, /* permanent storage */
118 arc_fcontig, /* Contiguous and free */
119};
120
121union linux_memtypes {
122 enum arcs_memtypes arcs;
123 enum arc_memtypes arc;
124};
125
126struct linux_mdesc {
127 union linux_memtypes type;
128 ULONG base;
129 ULONG pages;
130};
131
132/* Time of day descriptor. */
133struct linux_tinfo {
134 unsigned short yr;
135 unsigned short mnth;
136 unsigned short day;
137 unsigned short hr;
138 unsigned short min;
139 unsigned short sec;
140 unsigned short msec;
141};
142
143/* ARCS virtual dirents. */
144struct linux_vdirent {
145 ULONG namelen;
146 unsigned char attr;
147 char fname[32]; /* XXX imperical, should be a define */
148};
149
150/* Other stuff for files. */
151enum linux_omode {
152 rdonly, wronly, rdwr, wronly_creat, rdwr_creat,
153 wronly_ssede, rdwr_ssede, dirent, dirent_creat
154};
155
156enum linux_seekmode {
157 absolute, relative
158};
159
160enum linux_mountops {
161 media_load, media_unload
162};
163
164/* This prom has a bolixed design. */
165struct linux_bigint {
166#ifdef __MIPSEL__
167 u32 lo;
168 s32 hi;
169#else /* !(__MIPSEL__) */
170 s32 hi;
171 u32 lo;
172#endif
173};
174
175struct linux_finfo {
176 struct linux_bigint begin;
177 struct linux_bigint end;
178 struct linux_bigint cur;
179 enum linux_devtypes dtype;
180 unsigned long namelen;
181 unsigned char attr;
182 char name[32]; /* XXX imperical, should be define */
183};
184
185/* This describes the vector containing function pointers to the ARC
186 firmware functions. */
187struct linux_romvec {
188 LONG load; /* Load an executable image. */
189 LONG invoke; /* Invoke a standalong image. */
190 LONG exec; /* Load and begin execution of a
191 standalone image. */
192 LONG halt; /* Halt the machine. */
193 LONG pdown; /* Power down the machine. */
194 LONG restart; /* XXX soft reset??? */
195 LONG reboot; /* Reboot the machine. */
196 LONG imode; /* Enter PROM interactive mode. */
197 LONG _unused1; /* Was ReturnFromMain(). */
198
199 /* PROM device tree interface. */
200 LONG next_component;
201 LONG child_component;
202 LONG parent_component;
203 LONG component_data;
204 LONG child_add;
205 LONG comp_del;
206 LONG component_by_path;
207
208 /* Misc. stuff. */
209 LONG cfg_save;
210 LONG get_sysid;
211
212 /* Probing for memory. */
213 LONG get_mdesc;
214 LONG _unused2; /* was Signal() */
215
216 LONG get_tinfo;
217 LONG get_rtime;
218
219 /* File type operations. */
220 LONG get_vdirent;
221 LONG open;
222 LONG close;
223 LONG read;
224 LONG get_rstatus;
225 LONG write;
226 LONG seek;
227 LONG mount;
228
229 /* Dealing with firmware environment variables. */
230 LONG get_evar;
231 LONG set_evar;
232
233 LONG get_finfo;
234 LONG set_finfo;
235
236 /* Miscellaneous. */
237 LONG cache_flush;
238 LONG TestUnicodeCharacter; /* ARC; not sure if ARCS too */
239 LONG GetDisplayStatus;
240};
241
242/* The SGI ARCS parameter block is in a fixed location for standalone
243 * programs to access PROM facilities easily.
244 */
245typedef struct _SYSTEM_PARAMETER_BLOCK {
246 ULONG magic; /* magic cookie */
247#define PROMBLOCK_MAGIC 0x53435241
248
249 ULONG len; /* length of parm block */
250 USHORT ver; /* ARCS firmware version */
251 USHORT rev; /* ARCS firmware revision */
252 _PLONG rs_block; /* Restart block. */
253 _PLONG dbg_block; /* Debug block. */
254 _PLONG gevect; /* XXX General vector??? */
255 _PLONG utlbvect; /* XXX UTLB vector??? */
256 ULONG rveclen; /* Size of romvec struct. */
257 _PVOID romvec; /* Function interface. */
258 ULONG pveclen; /* Length of private vector. */
259 _PVOID pvector; /* Private vector. */
260 ULONG adap_cnt; /* Adapter count. */
261 ULONG adap_typ0; /* First adapter type. */
262 ULONG adap_vcnt0; /* Adapter 0 vector count. */
263 _PVOID adap_vector; /* Adapter 0 vector ptr. */
264 ULONG adap_typ1; /* Second adapter type. */
265 ULONG adap_vcnt1; /* Adapter 1 vector count. */
266 _PVOID adap_vector1; /* Adapter 1 vector ptr. */
267 /* More adapter vectors go here... */
268} SYSTEM_PARAMETER_BLOCK, *PSYSTEM_PARAMETER_BLOCK;
269
270#define PROMBLOCK ((PSYSTEM_PARAMETER_BLOCK) (int)0xA0001000)
271#define ROMVECTOR ((struct linux_romvec *) (long)(PROMBLOCK)->romvec)
272
273/* Cache layout parameter block. */
274union linux_cache_key {
275 struct param {
276#ifdef __MIPSEL__
277 unsigned short size;
278 unsigned char lsize;
279 unsigned char bsize;
280#else /* !(__MIPSEL__) */
281 unsigned char bsize;
282 unsigned char lsize;
283 unsigned short size;
284#endif
285 } info;
286 unsigned long allinfo;
287};
288
289/* Configuration data. */
290struct linux_cdata {
291 char *name;
292 int mlen;
293 enum linux_devtypes type;
294};
295
296/* Common SGI ARCS firmware file descriptors. */
297#define SGIPROM_STDIN 0
298#define SGIPROM_STDOUT 1
299
300/* Common SGI ARCS firmware file types. */
301#define SGIPROM_ROFILE 0x01 /* read-only file */
302#define SGIPROM_HFILE 0x02 /* hidden file */
303#define SGIPROM_SFILE 0x04 /* System file */
304#define SGIPROM_AFILE 0x08 /* Archive file */
305#define SGIPROM_DFILE 0x10 /* Directory file */
306#define SGIPROM_DELFILE 0x20 /* Deleted file */
307
308/* SGI ARCS boot record information. */
309struct sgi_partition {
310 unsigned char flag;
311#define SGIPART_UNUSED 0x00
312#define SGIPART_ACTIVE 0x80
313
314 unsigned char shead, ssect, scyl; /* unused */
315 unsigned char systype; /* OS type, Irix or NT */
316 unsigned char ehead, esect, ecyl; /* unused */
317 unsigned char rsect0, rsect1, rsect2, rsect3;
318 unsigned char tsect0, tsect1, tsect2, tsect3;
319};
320
321#define SGIBBLOCK_MAGIC 0xaa55
322#define SGIBBLOCK_MAXPART 0x0004
323
324struct sgi_bootblock {
325 unsigned char _unused[446];
326 struct sgi_partition partitions[SGIBBLOCK_MAXPART];
327 unsigned short magic;
328};
329
330/* BIOS parameter block. */
331struct sgi_bparm_block {
332 unsigned short bytes_sect; /* bytes per sector */
333 unsigned char sect_clust; /* sectors per cluster */
334 unsigned short sect_resv; /* reserved sectors */
335 unsigned char nfats; /* # of allocation tables */
336 unsigned short nroot_dirents; /* # of root directory entries */
337 unsigned short sect_volume; /* sectors in volume */
338 unsigned char media_type; /* media descriptor */
339 unsigned short sect_fat; /* sectors per allocation table */
340 unsigned short sect_track; /* sectors per track */
341 unsigned short nheads; /* # of heads */
342 unsigned short nhsects; /* # of hidden sectors */
343};
344
345struct sgi_bsector {
346 unsigned char jmpinfo[3];
347 unsigned char manuf_name[8];
348 struct sgi_bparm_block info;
349};
350
351/* Debugging block used with SGI symmon symbolic debugger. */
352#define SMB_DEBUG_MAGIC 0xfeeddead
353struct linux_smonblock {
354 unsigned long magic;
355 void (*handler)(void); /* Breakpoint routine. */
356 unsigned long dtable_base; /* Base addr of dbg table. */
357 int (*printf)(const char *fmt, ...);
358 unsigned long btable_base; /* Breakpoint table. */
359 unsigned long mpflushreqs; /* SMP cache flush request list. */
360 unsigned long ntab; /* Name table. */
361 unsigned long stab; /* Symbol table. */
362 int smax; /* Max # of symbols. */
363};
364
365/*
366 * Macros for calling a 32-bit ARC implementation from 64-bit code
367 */
368
369#if defined(CONFIG_64BIT) && defined(CONFIG_ARC32)
370
371#define __arc_clobbers \
372 "$2", "$3" /* ... */, "$8", "$9", "$10", "$11", \
373 "$12", "$13", "$14", "$15", "$16", "$24", "$25", "$31"
374
375#define ARC_CALL0(dest) \
376({ long __res; \
377 long __vec = (long) romvec->dest; \
378 __asm__ __volatile__( \
379 "dsubu\t$29, 32\n\t" \
380 "jalr\t%1\n\t" \
381 "daddu\t$29, 32\n\t" \
382 "move\t%0, $2" \
383 : "=r" (__res), "=r" (__vec) \
384 : "1" (__vec) \
385 : __arc_clobbers, "$4", "$5", "$6", "$7"); \
386 (unsigned long) __res; \
387})
388
389#define ARC_CALL1(dest, a1) \
390({ long __res; \
391 register signed int __a1 __asm__("$4") = (int) (long) (a1); \
392 long __vec = (long) romvec->dest; \
393 __asm__ __volatile__( \
394 "dsubu\t$29, 32\n\t" \
395 "jalr\t%1\n\t" \
396 "daddu\t$29, 32\n\t" \
397 "move\t%0, $2" \
398 : "=r" (__res), "=r" (__vec) \
399 : "1" (__vec), "r" (__a1) \
400 : __arc_clobbers, "$5", "$6", "$7"); \
401 (unsigned long) __res; \
402})
403
404#define ARC_CALL2(dest, a1, a2) \
405({ long __res; \
406 register signed int __a1 __asm__("$4") = (int) (long) (a1); \
407 register signed int __a2 __asm__("$5") = (int) (long) (a2); \
408 long __vec = (long) romvec->dest; \
409 __asm__ __volatile__( \
410 "dsubu\t$29, 32\n\t" \
411 "jalr\t%1\n\t" \
412 "daddu\t$29, 32\n\t" \
413 "move\t%0, $2" \
414 : "=r" (__res), "=r" (__vec) \
415 : "1" (__vec), "r" (__a1), "r" (__a2) \
416 : __arc_clobbers, "$6", "$7"); \
417 __res; \
418})
419
420#define ARC_CALL3(dest, a1, a2, a3) \
421({ long __res; \
422 register signed int __a1 __asm__("$4") = (int) (long) (a1); \
423 register signed int __a2 __asm__("$5") = (int) (long) (a2); \
424 register signed int __a3 __asm__("$6") = (int) (long) (a3); \
425 long __vec = (long) romvec->dest; \
426 __asm__ __volatile__( \
427 "dsubu\t$29, 32\n\t" \
428 "jalr\t%1\n\t" \
429 "daddu\t$29, 32\n\t" \
430 "move\t%0, $2" \
431 : "=r" (__res), "=r" (__vec) \
432 : "1" (__vec), "r" (__a1), "r" (__a2), "r" (__a3) \
433 : __arc_clobbers, "$7"); \
434 __res; \
435})
436
437#define ARC_CALL4(dest, a1, a2, a3, a4) \
438({ long __res; \
439 register signed int __a1 __asm__("$4") = (int) (long) (a1); \
440 register signed int __a2 __asm__("$5") = (int) (long) (a2); \
441 register signed int __a3 __asm__("$6") = (int) (long) (a3); \
442 register signed int __a4 __asm__("$7") = (int) (long) (a4); \
443 long __vec = (long) romvec->dest; \
444 __asm__ __volatile__( \
445 "dsubu\t$29, 32\n\t" \
446 "jalr\t%1\n\t" \
447 "daddu\t$29, 32\n\t" \
448 "move\t%0, $2" \
449 : "=r" (__res), "=r" (__vec) \
450 : "1" (__vec), "r" (__a1), "r" (__a2), "r" (__a3), \
451 "r" (__a4) \
452 : __arc_clobbers); \
453 __res; \
454})
455
456#define ARC_CALL5(dest, a1, a2, a3, a4, a5) \
457({ long __res; \
458 register signed int __a1 __asm__("$4") = (int) (long) (a1); \
459 register signed int __a2 __asm__("$5") = (int) (long) (a2); \
460 register signed int __a3 __asm__("$6") = (int) (long) (a3); \
461 register signed int __a4 __asm__("$7") = (int) (long) (a4); \
462 register signed int __a5 = (int) (long) (a5); \
463 long __vec = (long) romvec->dest; \
464 __asm__ __volatile__( \
465 "dsubu\t$29, 32\n\t" \
466 "sw\t%7, 16($29)\n\t" \
467 "jalr\t%1\n\t" \
468 "daddu\t$29, 32\n\t" \
469 "move\t%0, $2" \
470 : "=r" (__res), "=r" (__vec) \
471 : "1" (__vec), \
472 "r" (__a1), "r" (__a2), "r" (__a3), "r" (__a4), \
473 "r" (__a5) \
474 : __arc_clobbers); \
475 __res; \
476})
477
478#endif /* defined(CONFIG_64BIT) && defined(CONFIG_ARC32) */
479
480#if (defined(CONFIG_32BIT) && defined(CONFIG_ARC32)) || \
481 (defined(CONFIG_64BIT) && defined(CONFIG_ARC64))
482
483#define ARC_CALL0(dest) \
484({ long __res; \
485 long (*__vec)(void) = (void *) romvec->dest; \
486 \
487 __res = __vec(); \
488 __res; \
489})
490
491#define ARC_CALL1(dest, a1) \
492({ long __res; \
493 long __a1 = (long) (a1); \
494 long (*__vec)(long) = (void *) romvec->dest; \
495 \
496 __res = __vec(__a1); \
497 __res; \
498})
499
500#define ARC_CALL2(dest, a1, a2) \
501({ long __res; \
502 long __a1 = (long) (a1); \
503 long __a2 = (long) (a2); \
504 long (*__vec)(long, long) = (void *) romvec->dest; \
505 \
506 __res = __vec(__a1, __a2); \
507 __res; \
508})
509
510#define ARC_CALL3(dest, a1, a2, a3) \
511({ long __res; \
512 long __a1 = (long) (a1); \
513 long __a2 = (long) (a2); \
514 long __a3 = (long) (a3); \
515 long (*__vec)(long, long, long) = (void *) romvec->dest; \
516 \
517 __res = __vec(__a1, __a2, __a3); \
518 __res; \
519})
520
521#define ARC_CALL4(dest, a1, a2, a3, a4) \
522({ long __res; \
523 long __a1 = (long) (a1); \
524 long __a2 = (long) (a2); \
525 long __a3 = (long) (a3); \
526 long __a4 = (long) (a4); \
527 long (*__vec)(long, long, long, long) = (void *) romvec->dest; \
528 \
529 __res = __vec(__a1, __a2, __a3, __a4); \
530 __res; \
531})
532
533#define ARC_CALL5(dest, a1, a2, a3, a4, a5) \
534({ long __res; \
535 long __a1 = (long) (a1); \
536 long __a2 = (long) (a2); \
537 long __a3 = (long) (a3); \
538 long __a4 = (long) (a4); \
539 long __a5 = (long) (a5); \
540 long (*__vec)(long, long, long, long, long); \
541 __vec = (void *) romvec->dest; \
542 \
543 __res = __vec(__a1, __a2, __a3, __a4, __a5); \
544 __res; \
545})
546#endif /* both kernel and ARC either 32-bit or 64-bit */
547
548#endif /* _ASM_SGIARCS_H */
diff --git a/include/asm-mips/sgidefs.h b/include/asm-mips/sgidefs.h
deleted file mode 100644
index 876442fcfb32..000000000000
--- a/include/asm-mips/sgidefs.h
+++ /dev/null
@@ -1,44 +0,0 @@
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 * Copyright (C) 1996, 1999, 2001 Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 */
10#ifndef __ASM_SGIDEFS_H
11#define __ASM_SGIDEFS_H
12
13/*
14 * Using a Linux compiler for building Linux seems logic but not to
15 * everybody.
16 */
17#ifndef __linux__
18#error Use a Linux compiler or give up.
19#endif
20
21/*
22 * Definitions for the ISA levels
23 *
24 * With the introduction of MIPS32 / MIPS64 instruction sets definitions
25 * MIPS ISAs are no longer subsets of each other. Therefore comparisons
26 * on these symbols except with == may result in unexpected results and
27 * are forbidden!
28 */
29#define _MIPS_ISA_MIPS1 1
30#define _MIPS_ISA_MIPS2 2
31#define _MIPS_ISA_MIPS3 3
32#define _MIPS_ISA_MIPS4 4
33#define _MIPS_ISA_MIPS5 5
34#define _MIPS_ISA_MIPS32 6
35#define _MIPS_ISA_MIPS64 7
36
37/*
38 * Subprogram calling convention
39 */
40#define _MIPS_SIM_ABI32 1
41#define _MIPS_SIM_NABI32 2
42#define _MIPS_SIM_ABI64 3
43
44#endif /* __ASM_SGIDEFS_H */
diff --git a/include/asm-mips/shmbuf.h b/include/asm-mips/shmbuf.h
deleted file mode 100644
index f994438277bf..000000000000
--- a/include/asm-mips/shmbuf.h
+++ /dev/null
@@ -1,38 +0,0 @@
1#ifndef _ASM_SHMBUF_H
2#define _ASM_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for the MIPS 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 * - 2 miscellaneous 32-bit rsp. 64-bit values
11 */
12
13struct shmid64_ds {
14 struct ipc64_perm shm_perm; /* operation perms */
15 size_t shm_segsz; /* size of segment (bytes) */
16 __kernel_time_t shm_atime; /* last attach time */
17 __kernel_time_t shm_dtime; /* last detach time */
18 __kernel_time_t shm_ctime; /* last change time */
19 __kernel_pid_t shm_cpid; /* pid of creator */
20 __kernel_pid_t shm_lpid; /* pid of last operator */
21 unsigned long shm_nattch; /* no. of current attaches */
22 unsigned long __unused1;
23 unsigned long __unused2;
24};
25
26struct shminfo64 {
27 unsigned long shmmax;
28 unsigned long shmmin;
29 unsigned long shmmni;
30 unsigned long shmseg;
31 unsigned long shmall;
32 unsigned long __unused1;
33 unsigned long __unused2;
34 unsigned long __unused3;
35 unsigned long __unused4;
36};
37
38#endif /* _ASM_SHMBUF_H */
diff --git a/include/asm-mips/shmparam.h b/include/asm-mips/shmparam.h
deleted file mode 100644
index 09290720751c..000000000000
--- a/include/asm-mips/shmparam.h
+++ /dev/null
@@ -1,13 +0,0 @@
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#ifndef _ASM_SHMPARAM_H
7#define _ASM_SHMPARAM_H
8
9#define __ARCH_FORCE_SHMLBA 1
10
11#define SHMLBA 0x40000 /* attach addr a multiple of this */
12
13#endif /* _ASM_SHMPARAM_H */
diff --git a/include/asm-mips/sibyte/bcm1480_int.h b/include/asm-mips/sibyte/bcm1480_int.h
deleted file mode 100644
index 6109557c14e9..000000000000
--- a/include/asm-mips/sibyte/bcm1480_int.h
+++ /dev/null
@@ -1,312 +0,0 @@
1/* *********************************************************************
2 * BCM1280/BCM1480 Board Support Package
3 *
4 * Interrupt Mapper definitions File: bcm1480_int.h
5 *
6 * This module contains constants for manipulating the
7 * BCM1255/BCM1280/BCM1455/BCM1480's interrupt mapper and
8 * definitions for the interrupt sources.
9 *
10 * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03)
11 *
12 *********************************************************************
13 *
14 * Copyright 2000,2001,2002,2003
15 * Broadcom Corporation. All rights reserved.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) 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; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 ********************************************************************* */
32
33
34#ifndef _BCM1480_INT_H
35#define _BCM1480_INT_H
36
37#include "sb1250_defs.h"
38
39/* *********************************************************************
40 * Interrupt Mapper Constants
41 ********************************************************************* */
42
43/*
44 * The interrupt mapper deals with 128-bit logical registers that are
45 * implemented as pairs of 64-bit registers, with the "low" 64 bits in
46 * a register that has an address 0x1000 higher(!) than the
47 * corresponding "high" register.
48 *
49 * For appropriate registers, bit 0 of the "high" register is a
50 * cascade bit that summarizes (as a bit-OR) the 64 bits of the "low"
51 * register.
52 */
53
54/*
55 * This entire file uses _BCM1480_ in all the symbols because it is
56 * entirely BCM1480 specific.
57 */
58
59/*
60 * Interrupt sources (Table 22)
61 */
62
63#define K_BCM1480_INT_SOURCES 128
64
65#define _BCM1480_INT_HIGH(k) (k)
66#define _BCM1480_INT_LOW(k) ((k)+64)
67
68#define K_BCM1480_INT_ADDR_TRAP _BCM1480_INT_HIGH(1)
69#define K_BCM1480_INT_GPIO_0 _BCM1480_INT_HIGH(4)
70#define K_BCM1480_INT_GPIO_1 _BCM1480_INT_HIGH(5)
71#define K_BCM1480_INT_GPIO_2 _BCM1480_INT_HIGH(6)
72#define K_BCM1480_INT_GPIO_3 _BCM1480_INT_HIGH(7)
73#define K_BCM1480_INT_PCI_INTA _BCM1480_INT_HIGH(8)
74#define K_BCM1480_INT_PCI_INTB _BCM1480_INT_HIGH(9)
75#define K_BCM1480_INT_PCI_INTC _BCM1480_INT_HIGH(10)
76#define K_BCM1480_INT_PCI_INTD _BCM1480_INT_HIGH(11)
77#define K_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_HIGH(12)
78#define K_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_HIGH(13)
79#define K_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_HIGH(14)
80#define K_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_HIGH(15)
81#define K_BCM1480_INT_TIMER_0 _BCM1480_INT_HIGH(20)
82#define K_BCM1480_INT_TIMER_1 _BCM1480_INT_HIGH(21)
83#define K_BCM1480_INT_TIMER_2 _BCM1480_INT_HIGH(22)
84#define K_BCM1480_INT_TIMER_3 _BCM1480_INT_HIGH(23)
85#define K_BCM1480_INT_DM_CH_0 _BCM1480_INT_HIGH(28)
86#define K_BCM1480_INT_DM_CH_1 _BCM1480_INT_HIGH(29)
87#define K_BCM1480_INT_DM_CH_2 _BCM1480_INT_HIGH(30)
88#define K_BCM1480_INT_DM_CH_3 _BCM1480_INT_HIGH(31)
89#define K_BCM1480_INT_MAC_0 _BCM1480_INT_HIGH(36)
90#define K_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_HIGH(37)
91#define K_BCM1480_INT_MAC_1 _BCM1480_INT_HIGH(38)
92#define K_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_HIGH(39)
93#define K_BCM1480_INT_MAC_2 _BCM1480_INT_HIGH(40)
94#define K_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_HIGH(41)
95#define K_BCM1480_INT_MAC_3 _BCM1480_INT_HIGH(42)
96#define K_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_HIGH(43)
97#define K_BCM1480_INT_PMI_LOW _BCM1480_INT_HIGH(52)
98#define K_BCM1480_INT_PMI_HIGH _BCM1480_INT_HIGH(53)
99#define K_BCM1480_INT_PMO_LOW _BCM1480_INT_HIGH(54)
100#define K_BCM1480_INT_PMO_HIGH _BCM1480_INT_HIGH(55)
101#define K_BCM1480_INT_MBOX_0_0 _BCM1480_INT_HIGH(56)
102#define K_BCM1480_INT_MBOX_0_1 _BCM1480_INT_HIGH(57)
103#define K_BCM1480_INT_MBOX_0_2 _BCM1480_INT_HIGH(58)
104#define K_BCM1480_INT_MBOX_0_3 _BCM1480_INT_HIGH(59)
105#define K_BCM1480_INT_MBOX_1_0 _BCM1480_INT_HIGH(60)
106#define K_BCM1480_INT_MBOX_1_1 _BCM1480_INT_HIGH(61)
107#define K_BCM1480_INT_MBOX_1_2 _BCM1480_INT_HIGH(62)
108#define K_BCM1480_INT_MBOX_1_3 _BCM1480_INT_HIGH(63)
109
110#define K_BCM1480_INT_BAD_ECC _BCM1480_INT_LOW(1)
111#define K_BCM1480_INT_COR_ECC _BCM1480_INT_LOW(2)
112#define K_BCM1480_INT_IO_BUS _BCM1480_INT_LOW(3)
113#define K_BCM1480_INT_PERF_CNT _BCM1480_INT_LOW(4)
114#define K_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_LOW(5)
115#define K_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_LOW(6)
116#define K_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_LOW(7)
117#define K_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_LOW(8)
118#define K_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_LOW(9)
119#define K_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_LOW(10)
120#define K_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_LOW(11)
121#define K_BCM1480_INT_PCI_ERROR _BCM1480_INT_LOW(16)
122#define K_BCM1480_INT_PCI_RESET _BCM1480_INT_LOW(17)
123#define K_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_LOW(18)
124#define K_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_LOW(19)
125#define K_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_LOW(20)
126#define K_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_LOW(21)
127#define K_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_LOW(22)
128#define K_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_LOW(23)
129#define K_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_LOW(24)
130#define K_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_LOW(25)
131#define K_BCM1480_INT_LDT_SMI _BCM1480_INT_LOW(32)
132#define K_BCM1480_INT_LDT_NMI _BCM1480_INT_LOW(33)
133#define K_BCM1480_INT_LDT_INIT _BCM1480_INT_LOW(34)
134#define K_BCM1480_INT_LDT_STARTUP _BCM1480_INT_LOW(35)
135#define K_BCM1480_INT_LDT_EXT _BCM1480_INT_LOW(36)
136#define K_BCM1480_INT_SMB_0 _BCM1480_INT_LOW(40)
137#define K_BCM1480_INT_SMB_1 _BCM1480_INT_LOW(41)
138#define K_BCM1480_INT_PCMCIA _BCM1480_INT_LOW(42)
139#define K_BCM1480_INT_UART_0 _BCM1480_INT_LOW(44)
140#define K_BCM1480_INT_UART_1 _BCM1480_INT_LOW(45)
141#define K_BCM1480_INT_UART_2 _BCM1480_INT_LOW(46)
142#define K_BCM1480_INT_UART_3 _BCM1480_INT_LOW(47)
143#define K_BCM1480_INT_GPIO_4 _BCM1480_INT_LOW(52)
144#define K_BCM1480_INT_GPIO_5 _BCM1480_INT_LOW(53)
145#define K_BCM1480_INT_GPIO_6 _BCM1480_INT_LOW(54)
146#define K_BCM1480_INT_GPIO_7 _BCM1480_INT_LOW(55)
147#define K_BCM1480_INT_GPIO_8 _BCM1480_INT_LOW(56)
148#define K_BCM1480_INT_GPIO_9 _BCM1480_INT_LOW(57)
149#define K_BCM1480_INT_GPIO_10 _BCM1480_INT_LOW(58)
150#define K_BCM1480_INT_GPIO_11 _BCM1480_INT_LOW(59)
151#define K_BCM1480_INT_GPIO_12 _BCM1480_INT_LOW(60)
152#define K_BCM1480_INT_GPIO_13 _BCM1480_INT_LOW(61)
153#define K_BCM1480_INT_GPIO_14 _BCM1480_INT_LOW(62)
154#define K_BCM1480_INT_GPIO_15 _BCM1480_INT_LOW(63)
155
156/*
157 * Mask values for each interrupt
158 */
159
160#define _BCM1480_INT_MASK(w, n) _SB_MAKEMASK(w, ((n) & 0x3F))
161#define _BCM1480_INT_MASK1(n) _SB_MAKEMASK1(((n) & 0x3F))
162#define _BCM1480_INT_OFFSET(n) (((n) & 0x40) << 6)
163
164#define M_BCM1480_INT_CASCADE _BCM1480_INT_MASK1(_BCM1480_INT_HIGH(0))
165
166#define M_BCM1480_INT_ADDR_TRAP _BCM1480_INT_MASK1(K_BCM1480_INT_ADDR_TRAP)
167#define M_BCM1480_INT_GPIO_0 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_0)
168#define M_BCM1480_INT_GPIO_1 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_1)
169#define M_BCM1480_INT_GPIO_2 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_2)
170#define M_BCM1480_INT_GPIO_3 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_3)
171#define M_BCM1480_INT_PCI_INTA _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTA)
172#define M_BCM1480_INT_PCI_INTB _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTB)
173#define M_BCM1480_INT_PCI_INTC _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTC)
174#define M_BCM1480_INT_PCI_INTD _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTD)
175#define M_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP0)
176#define M_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP1)
177#define M_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP2)
178#define M_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP3)
179#define M_BCM1480_INT_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_0)
180#define M_BCM1480_INT_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_1)
181#define M_BCM1480_INT_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_2)
182#define M_BCM1480_INT_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_3)
183#define M_BCM1480_INT_DM_CH_0 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_0)
184#define M_BCM1480_INT_DM_CH_1 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_1)
185#define M_BCM1480_INT_DM_CH_2 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_2)
186#define M_BCM1480_INT_DM_CH_3 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_3)
187#define M_BCM1480_INT_MAC_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0)
188#define M_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0_CH1)
189#define M_BCM1480_INT_MAC_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1)
190#define M_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1_CH1)
191#define M_BCM1480_INT_MAC_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2)
192#define M_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2_CH1)
193#define M_BCM1480_INT_MAC_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3)
194#define M_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3_CH1)
195#define M_BCM1480_INT_PMI_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_LOW)
196#define M_BCM1480_INT_PMI_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_HIGH)
197#define M_BCM1480_INT_PMO_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_LOW)
198#define M_BCM1480_INT_PMO_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_HIGH)
199#define M_BCM1480_INT_MBOX_ALL _BCM1480_INT_MASK(8, K_BCM1480_INT_MBOX_0_0)
200#define M_BCM1480_INT_MBOX_0_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_0)
201#define M_BCM1480_INT_MBOX_0_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_1)
202#define M_BCM1480_INT_MBOX_0_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_2)
203#define M_BCM1480_INT_MBOX_0_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_3)
204#define M_BCM1480_INT_MBOX_1_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_0)
205#define M_BCM1480_INT_MBOX_1_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_1)
206#define M_BCM1480_INT_MBOX_1_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_2)
207#define M_BCM1480_INT_MBOX_1_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_3)
208#define M_BCM1480_INT_BAD_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_BAD_ECC)
209#define M_BCM1480_INT_COR_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_COR_ECC)
210#define M_BCM1480_INT_IO_BUS _BCM1480_INT_MASK1(K_BCM1480_INT_IO_BUS)
211#define M_BCM1480_INT_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_PERF_CNT)
212#define M_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_SW_PERF_CNT)
213#define M_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_TRACE_FREEZE)
214#define M_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_SW_TRACE_FREEZE)
215#define M_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_0)
216#define M_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_1)
217#define M_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_2)
218#define M_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_3)
219#define M_BCM1480_INT_PCI_ERROR _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_ERROR)
220#define M_BCM1480_INT_PCI_RESET _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_RESET)
221#define M_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_MASK1(K_BCM1480_INT_NODE_CONTROLLER)
222#define M_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_MASK1(K_BCM1480_INT_HOST_BRIDGE)
223#define M_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_FATAL)
224#define M_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_NONFATAL)
225#define M_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_FATAL)
226#define M_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_NONFATAL)
227#define M_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_FATAL)
228#define M_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_NONFATAL)
229#define M_BCM1480_INT_LDT_SMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_SMI)
230#define M_BCM1480_INT_LDT_NMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_NMI)
231#define M_BCM1480_INT_LDT_INIT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_INIT)
232#define M_BCM1480_INT_LDT_STARTUP _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_STARTUP)
233#define M_BCM1480_INT_LDT_EXT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_EXT)
234#define M_BCM1480_INT_SMB_0 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_0)
235#define M_BCM1480_INT_SMB_1 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_1)
236#define M_BCM1480_INT_PCMCIA _BCM1480_INT_MASK1(K_BCM1480_INT_PCMCIA)
237#define M_BCM1480_INT_UART_0 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_0)
238#define M_BCM1480_INT_UART_1 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_1)
239#define M_BCM1480_INT_UART_2 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_2)
240#define M_BCM1480_INT_UART_3 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_3)
241#define M_BCM1480_INT_GPIO_4 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_4)
242#define M_BCM1480_INT_GPIO_5 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_5)
243#define M_BCM1480_INT_GPIO_6 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_6)
244#define M_BCM1480_INT_GPIO_7 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_7)
245#define M_BCM1480_INT_GPIO_8 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_8)
246#define M_BCM1480_INT_GPIO_9 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_9)
247#define M_BCM1480_INT_GPIO_10 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_10)
248#define M_BCM1480_INT_GPIO_11 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_11)
249#define M_BCM1480_INT_GPIO_12 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_12)
250#define M_BCM1480_INT_GPIO_13 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_13)
251#define M_BCM1480_INT_GPIO_14 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_14)
252#define M_BCM1480_INT_GPIO_15 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_15)
253
254/*
255 * Interrupt mappings (Table 18)
256 */
257
258#define K_BCM1480_INT_MAP_I0 0 /* interrupt pins on processor */
259#define K_BCM1480_INT_MAP_I1 1
260#define K_BCM1480_INT_MAP_I2 2
261#define K_BCM1480_INT_MAP_I3 3
262#define K_BCM1480_INT_MAP_I4 4
263#define K_BCM1480_INT_MAP_I5 5
264#define K_BCM1480_INT_MAP_NMI 6 /* nonmaskable */
265#define K_BCM1480_INT_MAP_DINT 7 /* debug interrupt */
266
267/*
268 * Interrupt LDT Set Register (Table 19)
269 */
270
271#define S_BCM1480_INT_HT_INTMSG 0
272#define M_BCM1480_INT_HT_INTMSG _SB_MAKEMASK(3, S_BCM1480_INT_HT_INTMSG)
273#define V_BCM1480_INT_HT_INTMSG(x) _SB_MAKEVALUE(x, S_BCM1480_INT_HT_INTMSG)
274#define G_BCM1480_INT_HT_INTMSG(x) _SB_GETVALUE(x, S_BCM1480_INT_HT_INTMSG, M_BCM1480_INT_HT_INTMSG)
275
276#define K_BCM1480_INT_HT_INTMSG_FIXED 0
277#define K_BCM1480_INT_HT_INTMSG_ARBITRATED 1
278#define K_BCM1480_INT_HT_INTMSG_SMI 2
279#define K_BCM1480_INT_HT_INTMSG_NMI 3
280#define K_BCM1480_INT_HT_INTMSG_INIT 4
281#define K_BCM1480_INT_HT_INTMSG_STARTUP 5
282#define K_BCM1480_INT_HT_INTMSG_EXTINT 6
283#define K_BCM1480_INT_HT_INTMSG_RESERVED 7
284
285#define M_BCM1480_INT_HT_TRIGGERMODE _SB_MAKEMASK1(3)
286#define V_BCM1480_INT_HT_EDGETRIGGER 0
287#define V_BCM1480_INT_HT_LEVELTRIGGER M_BCM1480_INT_HT_TRIGGERMODE
288
289#define M_BCM1480_INT_HT_DESTMODE _SB_MAKEMASK1(4)
290#define V_BCM1480_INT_HT_PHYSICALDEST 0
291#define V_BCM1480_INT_HT_LOGICALDEST M_BCM1480_INT_HT_DESTMODE
292
293#define S_BCM1480_INT_HT_INTDEST 5
294#define M_BCM1480_INT_HT_INTDEST _SB_MAKEMASK(8, S_BCM1480_INT_HT_INTDEST)
295#define V_BCM1480_INT_HT_INTDEST(x) _SB_MAKEVALUE(x, S_BCM1480_INT_HT_INTDEST)
296#define G_BCM1480_INT_HT_INTDEST(x) _SB_GETVALUE(x, S_BCM1480_INT_HT_INTDEST, M_BCM1480_INT_HT_INTDEST)
297
298#define S_BCM1480_INT_HT_VECTOR 13
299#define M_BCM1480_INT_HT_VECTOR _SB_MAKEMASK(8, S_BCM1480_INT_HT_VECTOR)
300#define V_BCM1480_INT_HT_VECTOR(x) _SB_MAKEVALUE(x, S_BCM1480_INT_HT_VECTOR)
301#define G_BCM1480_INT_HT_VECTOR(x) _SB_GETVALUE(x, S_BCM1480_INT_HT_VECTOR, M_BCM1480_INT_HT_VECTOR)
302
303/*
304 * Vector prefix (Table 4-7)
305 */
306
307#define M_BCM1480_HTVECT_RAISE_INTLDT_HIGH 0x00
308#define M_BCM1480_HTVECT_RAISE_MBOX_0 0x40
309#define M_BCM1480_HTVECT_RAISE_INTLDT_LO 0x80
310#define M_BCM1480_HTVECT_RAISE_MBOX_1 0xC0
311
312#endif /* _BCM1480_INT_H */
diff --git a/include/asm-mips/sibyte/bcm1480_l2c.h b/include/asm-mips/sibyte/bcm1480_l2c.h
deleted file mode 100644
index fd75817f7ac4..000000000000
--- a/include/asm-mips/sibyte/bcm1480_l2c.h
+++ /dev/null
@@ -1,176 +0,0 @@
1/* *********************************************************************
2 * BCM1280/BCM1480 Board Support Package
3 *
4 * L2 Cache constants and macros File: bcm1480_l2c.h
5 *
6 * This module contains constants useful for manipulating the
7 * level 2 cache.
8 *
9 * BCM1400 specification level: 1280-UM100-D2 (11/14/03)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _BCM1480_L2C_H
34#define _BCM1480_L2C_H
35
36#include "sb1250_defs.h"
37
38/*
39 * Format of level 2 cache management address (Table 55)
40 */
41
42#define S_BCM1480_L2C_MGMT_INDEX 5
43#define M_BCM1480_L2C_MGMT_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_MGMT_INDEX)
44#define V_BCM1480_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_INDEX)
45#define G_BCM1480_L2C_MGMT_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_INDEX, M_BCM1480_L2C_MGMT_INDEX)
46
47#define S_BCM1480_L2C_MGMT_WAY 17
48#define M_BCM1480_L2C_MGMT_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_MGMT_WAY)
49#define V_BCM1480_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_WAY)
50#define G_BCM1480_L2C_MGMT_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_WAY, M_BCM1480_L2C_MGMT_WAY)
51
52#define M_BCM1480_L2C_MGMT_DIRTY _SB_MAKEMASK1(20)
53#define M_BCM1480_L2C_MGMT_VALID _SB_MAKEMASK1(21)
54
55#define S_BCM1480_L2C_MGMT_ECC_DIAG 22
56#define M_BCM1480_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2, S_BCM1480_L2C_MGMT_ECC_DIAG)
57#define V_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG)
58#define G_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_MGMT_ECC_DIAG, M_BCM1480_L2C_MGMT_ECC_DIAG)
59
60#define A_BCM1480_L2C_MGMT_TAG_BASE 0x00D0000000
61
62#define BCM1480_L2C_ENTRIES_PER_WAY 4096
63#define BCM1480_L2C_NUM_WAYS 8
64
65
66/*
67 * Level 2 Cache Tag register (Table 59)
68 */
69
70#define S_BCM1480_L2C_TAG_MBZ 0
71#define M_BCM1480_L2C_TAG_MBZ _SB_MAKEMASK(5, S_BCM1480_L2C_TAG_MBZ)
72
73#define S_BCM1480_L2C_TAG_INDEX 5
74#define M_BCM1480_L2C_TAG_INDEX _SB_MAKEMASK(12, S_BCM1480_L2C_TAG_INDEX)
75#define V_BCM1480_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_INDEX)
76#define G_BCM1480_L2C_TAG_INDEX(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_INDEX, M_BCM1480_L2C_TAG_INDEX)
77
78/* Note that index bit 16 is also tag bit 40 */
79#define S_BCM1480_L2C_TAG_TAG 17
80#define M_BCM1480_L2C_TAG_TAG _SB_MAKEMASK(23, S_BCM1480_L2C_TAG_TAG)
81#define V_BCM1480_L2C_TAG_TAG(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_TAG)
82#define G_BCM1480_L2C_TAG_TAG(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_TAG, M_BCM1480_L2C_TAG_TAG)
83
84#define S_BCM1480_L2C_TAG_ECC 40
85#define M_BCM1480_L2C_TAG_ECC _SB_MAKEMASK(6, S_BCM1480_L2C_TAG_ECC)
86#define V_BCM1480_L2C_TAG_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_ECC)
87#define G_BCM1480_L2C_TAG_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_ECC, M_BCM1480_L2C_TAG_ECC)
88
89#define S_BCM1480_L2C_TAG_WAY 46
90#define M_BCM1480_L2C_TAG_WAY _SB_MAKEMASK(3, S_BCM1480_L2C_TAG_WAY)
91#define V_BCM1480_L2C_TAG_WAY(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_TAG_WAY)
92#define G_BCM1480_L2C_TAG_WAY(x) _SB_GETVALUE(x, S_BCM1480_L2C_TAG_WAY, M_BCM1480_L2C_TAG_WAY)
93
94#define M_BCM1480_L2C_TAG_DIRTY _SB_MAKEMASK1(49)
95#define M_BCM1480_L2C_TAG_VALID _SB_MAKEMASK1(50)
96
97#define S_BCM1480_L2C_DATA_ECC 51
98#define M_BCM1480_L2C_DATA_ECC _SB_MAKEMASK(10, S_BCM1480_L2C_DATA_ECC)
99#define V_BCM1480_L2C_DATA_ECC(x) _SB_MAKEVALUE(x, S_BCM1480_L2C_DATA_ECC)
100#define G_BCM1480_L2C_DATA_ECC(x) _SB_GETVALUE(x, S_BCM1480_L2C_DATA_ECC, M_BCM1480_L2C_DATA_ECC)
101
102
103/*
104 * L2 Misc0 Value Register (Table 60)
105 */
106
107#define S_BCM1480_L2C_MISC0_WAY_REMOTE 0
108#define M_BCM1480_L2C_MISC0_WAY_REMOTE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_REMOTE)
109#define G_BCM1480_L2C_MISC0_WAY_REMOTE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_REMOTE, M_BCM1480_L2C_MISC0_WAY_REMOTE)
110
111#define S_BCM1480_L2C_MISC0_WAY_LOCAL 8
112#define M_BCM1480_L2C_MISC0_WAY_LOCAL _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_LOCAL)
113#define G_BCM1480_L2C_MISC0_WAY_LOCAL(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_LOCAL, M_BCM1480_L2C_MISC0_WAY_LOCAL)
114
115#define S_BCM1480_L2C_MISC0_WAY_ENABLE 16
116#define M_BCM1480_L2C_MISC0_WAY_ENABLE _SB_MAKEMASK(8, S_BCM1480_L2C_MISC0_WAY_ENABLE)
117#define G_BCM1480_L2C_MISC0_WAY_ENABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_WAY_ENABLE, M_BCM1480_L2C_MISC0_WAY_ENABLE)
118
119#define S_BCM1480_L2C_MISC0_CACHE_DISABLE 24
120#define M_BCM1480_L2C_MISC0_CACHE_DISABLE _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_DISABLE)
121#define G_BCM1480_L2C_MISC0_CACHE_DISABLE(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_DISABLE, M_BCM1480_L2C_MISC0_CACHE_DISABLE)
122
123#define S_BCM1480_L2C_MISC0_CACHE_QUAD 26
124#define M_BCM1480_L2C_MISC0_CACHE_QUAD _SB_MAKEMASK(2, S_BCM1480_L2C_MISC0_CACHE_QUAD)
125#define G_BCM1480_L2C_MISC0_CACHE_QUAD(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC0_CACHE_QUAD, M_BCM1480_L2C_MISC0_CACHE_QUAD)
126
127#define S_BCM1480_L2C_MISC0_MC_PRIORITY 30
128#define M_BCM1480_L2C_MISC0_MC_PRIORITY _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_MC_PRIORITY)
129
130#define S_BCM1480_L2C_MISC0_ECC_CLEANUP 31
131#define M_BCM1480_L2C_MISC0_ECC_CLEANUP _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_ECC_CLEANUP)
132
133
134/*
135 * L2 Misc1 Value Register (Table 60)
136 */
137
138#define S_BCM1480_L2C_MISC1_WAY_AGENT_0 0
139#define M_BCM1480_L2C_MISC1_WAY_AGENT_0 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_0)
140#define G_BCM1480_L2C_MISC1_WAY_AGENT_0(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_0, M_BCM1480_L2C_MISC1_WAY_AGENT_0)
141
142#define S_BCM1480_L2C_MISC1_WAY_AGENT_1 8
143#define M_BCM1480_L2C_MISC1_WAY_AGENT_1 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_1)
144#define G_BCM1480_L2C_MISC1_WAY_AGENT_1(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_1, M_BCM1480_L2C_MISC1_WAY_AGENT_1)
145
146#define S_BCM1480_L2C_MISC1_WAY_AGENT_2 16
147#define M_BCM1480_L2C_MISC1_WAY_AGENT_2 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_2)
148#define G_BCM1480_L2C_MISC1_WAY_AGENT_2(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_2, M_BCM1480_L2C_MISC1_WAY_AGENT_2)
149
150#define S_BCM1480_L2C_MISC1_WAY_AGENT_3 24
151#define M_BCM1480_L2C_MISC1_WAY_AGENT_3 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_3)
152#define G_BCM1480_L2C_MISC1_WAY_AGENT_3(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_3, M_BCM1480_L2C_MISC1_WAY_AGENT_3)
153
154#define S_BCM1480_L2C_MISC1_WAY_AGENT_4 32
155#define M_BCM1480_L2C_MISC1_WAY_AGENT_4 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC1_WAY_AGENT_4)
156#define G_BCM1480_L2C_MISC1_WAY_AGENT_4(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC1_WAY_AGENT_4, M_BCM1480_L2C_MISC1_WAY_AGENT_4)
157
158
159/*
160 * L2 Misc2 Value Register (Table 60)
161 */
162
163#define S_BCM1480_L2C_MISC2_WAY_AGENT_8 0
164#define M_BCM1480_L2C_MISC2_WAY_AGENT_8 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_8)
165#define G_BCM1480_L2C_MISC2_WAY_AGENT_8(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_8, M_BCM1480_L2C_MISC2_WAY_AGENT_8)
166
167#define S_BCM1480_L2C_MISC2_WAY_AGENT_9 8
168#define M_BCM1480_L2C_MISC2_WAY_AGENT_9 _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_9)
169#define G_BCM1480_L2C_MISC2_WAY_AGENT_9(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_9, M_BCM1480_L2C_MISC2_WAY_AGENT_9)
170
171#define S_BCM1480_L2C_MISC2_WAY_AGENT_A 16
172#define M_BCM1480_L2C_MISC2_WAY_AGENT_A _SB_MAKEMASK(8, S_BCM1480_L2C_MISC2_WAY_AGENT_A)
173#define G_BCM1480_L2C_MISC2_WAY_AGENT_A(x) _SB_GETVALUE(x, S_BCM1480_L2C_MISC2_WAY_AGENT_A, M_BCM1480_L2C_MISC2_WAY_AGENT_A)
174
175
176#endif /* _BCM1480_L2C_H */
diff --git a/include/asm-mips/sibyte/bcm1480_mc.h b/include/asm-mips/sibyte/bcm1480_mc.h
deleted file mode 100644
index f26a41a82b59..000000000000
--- a/include/asm-mips/sibyte/bcm1480_mc.h
+++ /dev/null
@@ -1,984 +0,0 @@
1/* *********************************************************************
2 * BCM1280/BCM1480 Board Support Package
3 *
4 * Memory Controller constants File: bcm1480_mc.h
5 *
6 * This module contains constants and macros useful for
7 * programming the memory controller.
8 *
9 * BCM1400 specification level: 1280-UM100-D1 (11/14/03 Review Copy)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _BCM1480_MC_H
34#define _BCM1480_MC_H
35
36#include "sb1250_defs.h"
37
38/*
39 * Memory Channel Configuration Register (Table 81)
40 */
41
42#define S_BCM1480_MC_INTLV0 0
43#define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV0)
44#define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV0)
45#define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV0, M_BCM1480_MC_INTLV0)
46#define V_BCM1480_MC_INTLV0_DEFAULT V_BCM1480_MC_INTLV0(0)
47
48#define S_BCM1480_MC_INTLV1 8
49#define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV1)
50#define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV1)
51#define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV1, M_BCM1480_MC_INTLV1)
52#define V_BCM1480_MC_INTLV1_DEFAULT V_BCM1480_MC_INTLV1(0)
53
54#define S_BCM1480_MC_INTLV2 16
55#define M_BCM1480_MC_INTLV2 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV2)
56#define V_BCM1480_MC_INTLV2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV2)
57#define G_BCM1480_MC_INTLV2(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV2, M_BCM1480_MC_INTLV2)
58#define V_BCM1480_MC_INTLV2_DEFAULT V_BCM1480_MC_INTLV2(0)
59
60#define S_BCM1480_MC_CS_MODE 32
61#define M_BCM1480_MC_CS_MODE _SB_MAKEMASK(8, S_BCM1480_MC_CS_MODE)
62#define V_BCM1480_MC_CS_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS_MODE)
63#define G_BCM1480_MC_CS_MODE(x) _SB_GETVALUE(x, S_BCM1480_MC_CS_MODE, M_BCM1480_MC_CS_MODE)
64#define V_BCM1480_MC_CS_MODE_DEFAULT V_BCM1480_MC_CS_MODE(0)
65
66#define V_BCM1480_MC_CONFIG_DEFAULT (V_BCM1480_MC_INTLV0_DEFAULT | \
67 V_BCM1480_MC_INTLV1_DEFAULT | \
68 V_BCM1480_MC_INTLV2_DEFAULT | \
69 V_BCM1480_MC_CS_MODE_DEFAULT)
70
71#define K_BCM1480_MC_CS01_MODE 0x03
72#define K_BCM1480_MC_CS02_MODE 0x05
73#define K_BCM1480_MC_CS0123_MODE 0x0F
74#define K_BCM1480_MC_CS0246_MODE 0x55
75#define K_BCM1480_MC_CS0145_MODE 0x33
76#define K_BCM1480_MC_CS0167_MODE 0xC3
77#define K_BCM1480_MC_CSFULL_MODE 0xFF
78
79/*
80 * Chip Select Start Address Register (Table 82)
81 */
82
83#define S_BCM1480_MC_CS0_START 0
84#define M_BCM1480_MC_CS0_START _SB_MAKEMASK(12, S_BCM1480_MC_CS0_START)
85#define V_BCM1480_MC_CS0_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS0_START)
86#define G_BCM1480_MC_CS0_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS0_START, M_BCM1480_MC_CS0_START)
87
88#define S_BCM1480_MC_CS1_START 16
89#define M_BCM1480_MC_CS1_START _SB_MAKEMASK(12, S_BCM1480_MC_CS1_START)
90#define V_BCM1480_MC_CS1_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS1_START)
91#define G_BCM1480_MC_CS1_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS1_START, M_BCM1480_MC_CS1_START)
92
93#define S_BCM1480_MC_CS2_START 32
94#define M_BCM1480_MC_CS2_START _SB_MAKEMASK(12, S_BCM1480_MC_CS2_START)
95#define V_BCM1480_MC_CS2_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS2_START)
96#define G_BCM1480_MC_CS2_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS2_START, M_BCM1480_MC_CS2_START)
97
98#define S_BCM1480_MC_CS3_START 48
99#define M_BCM1480_MC_CS3_START _SB_MAKEMASK(12, S_BCM1480_MC_CS3_START)
100#define V_BCM1480_MC_CS3_START(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS3_START)
101#define G_BCM1480_MC_CS3_START(x) _SB_GETVALUE(x, S_BCM1480_MC_CS3_START, M_BCM1480_MC_CS3_START)
102
103/*
104 * Chip Select End Address Register (Table 83)
105 */
106
107#define S_BCM1480_MC_CS0_END 0
108#define M_BCM1480_MC_CS0_END _SB_MAKEMASK(12, S_BCM1480_MC_CS0_END)
109#define V_BCM1480_MC_CS0_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS0_END)
110#define G_BCM1480_MC_CS0_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS0_END, M_BCM1480_MC_CS0_END)
111
112#define S_BCM1480_MC_CS1_END 16
113#define M_BCM1480_MC_CS1_END _SB_MAKEMASK(12, S_BCM1480_MC_CS1_END)
114#define V_BCM1480_MC_CS1_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS1_END)
115#define G_BCM1480_MC_CS1_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS1_END, M_BCM1480_MC_CS1_END)
116
117#define S_BCM1480_MC_CS2_END 32
118#define M_BCM1480_MC_CS2_END _SB_MAKEMASK(12, S_BCM1480_MC_CS2_END)
119#define V_BCM1480_MC_CS2_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS2_END)
120#define G_BCM1480_MC_CS2_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS2_END, M_BCM1480_MC_CS2_END)
121
122#define S_BCM1480_MC_CS3_END 48
123#define M_BCM1480_MC_CS3_END _SB_MAKEMASK(12, S_BCM1480_MC_CS3_END)
124#define V_BCM1480_MC_CS3_END(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS3_END)
125#define G_BCM1480_MC_CS3_END(x) _SB_GETVALUE(x, S_BCM1480_MC_CS3_END, M_BCM1480_MC_CS3_END)
126
127/*
128 * Row Address Bit Select Register 0 (Table 84)
129 */
130
131#define S_BCM1480_MC_ROW00 0
132#define M_BCM1480_MC_ROW00 _SB_MAKEMASK(6, S_BCM1480_MC_ROW00)
133#define V_BCM1480_MC_ROW00(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW00)
134#define G_BCM1480_MC_ROW00(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW00, M_BCM1480_MC_ROW00)
135
136#define S_BCM1480_MC_ROW01 8
137#define M_BCM1480_MC_ROW01 _SB_MAKEMASK(6, S_BCM1480_MC_ROW01)
138#define V_BCM1480_MC_ROW01(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW01)
139#define G_BCM1480_MC_ROW01(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW01, M_BCM1480_MC_ROW01)
140
141#define S_BCM1480_MC_ROW02 16
142#define M_BCM1480_MC_ROW02 _SB_MAKEMASK(6, S_BCM1480_MC_ROW02)
143#define V_BCM1480_MC_ROW02(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW02)
144#define G_BCM1480_MC_ROW02(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW02, M_BCM1480_MC_ROW02)
145
146#define S_BCM1480_MC_ROW03 24
147#define M_BCM1480_MC_ROW03 _SB_MAKEMASK(6, S_BCM1480_MC_ROW03)
148#define V_BCM1480_MC_ROW03(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW03)
149#define G_BCM1480_MC_ROW03(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW03, M_BCM1480_MC_ROW03)
150
151#define S_BCM1480_MC_ROW04 32
152#define M_BCM1480_MC_ROW04 _SB_MAKEMASK(6, S_BCM1480_MC_ROW04)
153#define V_BCM1480_MC_ROW04(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW04)
154#define G_BCM1480_MC_ROW04(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW04, M_BCM1480_MC_ROW04)
155
156#define S_BCM1480_MC_ROW05 40
157#define M_BCM1480_MC_ROW05 _SB_MAKEMASK(6, S_BCM1480_MC_ROW05)
158#define V_BCM1480_MC_ROW05(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW05)
159#define G_BCM1480_MC_ROW05(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW05, M_BCM1480_MC_ROW05)
160
161#define S_BCM1480_MC_ROW06 48
162#define M_BCM1480_MC_ROW06 _SB_MAKEMASK(6, S_BCM1480_MC_ROW06)
163#define V_BCM1480_MC_ROW06(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW06)
164#define G_BCM1480_MC_ROW06(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW06, M_BCM1480_MC_ROW06)
165
166#define S_BCM1480_MC_ROW07 56
167#define M_BCM1480_MC_ROW07 _SB_MAKEMASK(6, S_BCM1480_MC_ROW07)
168#define V_BCM1480_MC_ROW07(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW07)
169#define G_BCM1480_MC_ROW07(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW07, M_BCM1480_MC_ROW07)
170
171/*
172 * Row Address Bit Select Register 1 (Table 85)
173 */
174
175#define S_BCM1480_MC_ROW08 0
176#define M_BCM1480_MC_ROW08 _SB_MAKEMASK(6, S_BCM1480_MC_ROW08)
177#define V_BCM1480_MC_ROW08(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW08)
178#define G_BCM1480_MC_ROW08(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW08, M_BCM1480_MC_ROW08)
179
180#define S_BCM1480_MC_ROW09 8
181#define M_BCM1480_MC_ROW09 _SB_MAKEMASK(6, S_BCM1480_MC_ROW09)
182#define V_BCM1480_MC_ROW09(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW09)
183#define G_BCM1480_MC_ROW09(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW09, M_BCM1480_MC_ROW09)
184
185#define S_BCM1480_MC_ROW10 16
186#define M_BCM1480_MC_ROW10 _SB_MAKEMASK(6, S_BCM1480_MC_ROW10)
187#define V_BCM1480_MC_ROW10(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW10)
188#define G_BCM1480_MC_ROW10(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW10, M_BCM1480_MC_ROW10)
189
190#define S_BCM1480_MC_ROW11 24
191#define M_BCM1480_MC_ROW11 _SB_MAKEMASK(6, S_BCM1480_MC_ROW11)
192#define V_BCM1480_MC_ROW11(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW11)
193#define G_BCM1480_MC_ROW11(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW11, M_BCM1480_MC_ROW11)
194
195#define S_BCM1480_MC_ROW12 32
196#define M_BCM1480_MC_ROW12 _SB_MAKEMASK(6, S_BCM1480_MC_ROW12)
197#define V_BCM1480_MC_ROW12(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW12)
198#define G_BCM1480_MC_ROW12(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW12, M_BCM1480_MC_ROW12)
199
200#define S_BCM1480_MC_ROW13 40
201#define M_BCM1480_MC_ROW13 _SB_MAKEMASK(6, S_BCM1480_MC_ROW13)
202#define V_BCM1480_MC_ROW13(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW13)
203#define G_BCM1480_MC_ROW13(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW13, M_BCM1480_MC_ROW13)
204
205#define S_BCM1480_MC_ROW14 48
206#define M_BCM1480_MC_ROW14 _SB_MAKEMASK(6, S_BCM1480_MC_ROW14)
207#define V_BCM1480_MC_ROW14(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ROW14)
208#define G_BCM1480_MC_ROW14(x) _SB_GETVALUE(x, S_BCM1480_MC_ROW14, M_BCM1480_MC_ROW14)
209
210#define K_BCM1480_MC_ROWX_BIT_SPACING 8
211
212/*
213 * Column Address Bit Select Register 0 (Table 86)
214 */
215
216#define S_BCM1480_MC_COL00 0
217#define M_BCM1480_MC_COL00 _SB_MAKEMASK(6, S_BCM1480_MC_COL00)
218#define V_BCM1480_MC_COL00(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL00)
219#define G_BCM1480_MC_COL00(x) _SB_GETVALUE(x, S_BCM1480_MC_COL00, M_BCM1480_MC_COL00)
220
221#define S_BCM1480_MC_COL01 8
222#define M_BCM1480_MC_COL01 _SB_MAKEMASK(6, S_BCM1480_MC_COL01)
223#define V_BCM1480_MC_COL01(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL01)
224#define G_BCM1480_MC_COL01(x) _SB_GETVALUE(x, S_BCM1480_MC_COL01, M_BCM1480_MC_COL01)
225
226#define S_BCM1480_MC_COL02 16
227#define M_BCM1480_MC_COL02 _SB_MAKEMASK(6, S_BCM1480_MC_COL02)
228#define V_BCM1480_MC_COL02(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL02)
229#define G_BCM1480_MC_COL02(x) _SB_GETVALUE(x, S_BCM1480_MC_COL02, M_BCM1480_MC_COL02)
230
231#define S_BCM1480_MC_COL03 24
232#define M_BCM1480_MC_COL03 _SB_MAKEMASK(6, S_BCM1480_MC_COL03)
233#define V_BCM1480_MC_COL03(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL03)
234#define G_BCM1480_MC_COL03(x) _SB_GETVALUE(x, S_BCM1480_MC_COL03, M_BCM1480_MC_COL03)
235
236#define S_BCM1480_MC_COL04 32
237#define M_BCM1480_MC_COL04 _SB_MAKEMASK(6, S_BCM1480_MC_COL04)
238#define V_BCM1480_MC_COL04(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL04)
239#define G_BCM1480_MC_COL04(x) _SB_GETVALUE(x, S_BCM1480_MC_COL04, M_BCM1480_MC_COL04)
240
241#define S_BCM1480_MC_COL05 40
242#define M_BCM1480_MC_COL05 _SB_MAKEMASK(6, S_BCM1480_MC_COL05)
243#define V_BCM1480_MC_COL05(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL05)
244#define G_BCM1480_MC_COL05(x) _SB_GETVALUE(x, S_BCM1480_MC_COL05, M_BCM1480_MC_COL05)
245
246#define S_BCM1480_MC_COL06 48
247#define M_BCM1480_MC_COL06 _SB_MAKEMASK(6, S_BCM1480_MC_COL06)
248#define V_BCM1480_MC_COL06(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL06)
249#define G_BCM1480_MC_COL06(x) _SB_GETVALUE(x, S_BCM1480_MC_COL06, M_BCM1480_MC_COL06)
250
251#define S_BCM1480_MC_COL07 56
252#define M_BCM1480_MC_COL07 _SB_MAKEMASK(6, S_BCM1480_MC_COL07)
253#define V_BCM1480_MC_COL07(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL07)
254#define G_BCM1480_MC_COL07(x) _SB_GETVALUE(x, S_BCM1480_MC_COL07, M_BCM1480_MC_COL07)
255
256/*
257 * Column Address Bit Select Register 1 (Table 87)
258 */
259
260#define S_BCM1480_MC_COL08 0
261#define M_BCM1480_MC_COL08 _SB_MAKEMASK(6, S_BCM1480_MC_COL08)
262#define V_BCM1480_MC_COL08(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL08)
263#define G_BCM1480_MC_COL08(x) _SB_GETVALUE(x, S_BCM1480_MC_COL08, M_BCM1480_MC_COL08)
264
265#define S_BCM1480_MC_COL09 8
266#define M_BCM1480_MC_COL09 _SB_MAKEMASK(6, S_BCM1480_MC_COL09)
267#define V_BCM1480_MC_COL09(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL09)
268#define G_BCM1480_MC_COL09(x) _SB_GETVALUE(x, S_BCM1480_MC_COL09, M_BCM1480_MC_COL09)
269
270#define S_BCM1480_MC_COL10 16 /* not a valid position, must be prog as 0 */
271
272#define S_BCM1480_MC_COL11 24
273#define M_BCM1480_MC_COL11 _SB_MAKEMASK(6, S_BCM1480_MC_COL11)
274#define V_BCM1480_MC_COL11(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL11)
275#define G_BCM1480_MC_COL11(x) _SB_GETVALUE(x, S_BCM1480_MC_COL11, M_BCM1480_MC_COL11)
276
277#define S_BCM1480_MC_COL12 32
278#define M_BCM1480_MC_COL12 _SB_MAKEMASK(6, S_BCM1480_MC_COL12)
279#define V_BCM1480_MC_COL12(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL12)
280#define G_BCM1480_MC_COL12(x) _SB_GETVALUE(x, S_BCM1480_MC_COL12, M_BCM1480_MC_COL12)
281
282#define S_BCM1480_MC_COL13 40
283#define M_BCM1480_MC_COL13 _SB_MAKEMASK(6, S_BCM1480_MC_COL13)
284#define V_BCM1480_MC_COL13(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL13)
285#define G_BCM1480_MC_COL13(x) _SB_GETVALUE(x, S_BCM1480_MC_COL13, M_BCM1480_MC_COL13)
286
287#define S_BCM1480_MC_COL14 48
288#define M_BCM1480_MC_COL14 _SB_MAKEMASK(6, S_BCM1480_MC_COL14)
289#define V_BCM1480_MC_COL14(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COL14)
290#define G_BCM1480_MC_COL14(x) _SB_GETVALUE(x, S_BCM1480_MC_COL14, M_BCM1480_MC_COL14)
291
292#define K_BCM1480_MC_COLX_BIT_SPACING 8
293
294/*
295 * CS0 and CS1 Bank Address Bit Select Register (Table 88)
296 */
297
298#define S_BCM1480_MC_CS01_BANK0 0
299#define M_BCM1480_MC_CS01_BANK0 _SB_MAKEMASK(6, S_BCM1480_MC_CS01_BANK0)
300#define V_BCM1480_MC_CS01_BANK0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS01_BANK0)
301#define G_BCM1480_MC_CS01_BANK0(x) _SB_GETVALUE(x, S_BCM1480_MC_CS01_BANK0, M_BCM1480_MC_CS01_BANK0)
302
303#define S_BCM1480_MC_CS01_BANK1 8
304#define M_BCM1480_MC_CS01_BANK1 _SB_MAKEMASK(6, S_BCM1480_MC_CS01_BANK1)
305#define V_BCM1480_MC_CS01_BANK1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS01_BANK1)
306#define G_BCM1480_MC_CS01_BANK1(x) _SB_GETVALUE(x, S_BCM1480_MC_CS01_BANK1, M_BCM1480_MC_CS01_BANK1)
307
308#define S_BCM1480_MC_CS01_BANK2 16
309#define M_BCM1480_MC_CS01_BANK2 _SB_MAKEMASK(6, S_BCM1480_MC_CS01_BANK2)
310#define V_BCM1480_MC_CS01_BANK2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS01_BANK2)
311#define G_BCM1480_MC_CS01_BANK2(x) _SB_GETVALUE(x, S_BCM1480_MC_CS01_BANK2, M_BCM1480_MC_CS01_BANK2)
312
313/*
314 * CS2 and CS3 Bank Address Bit Select Register (Table 89)
315 */
316
317#define S_BCM1480_MC_CS23_BANK0 0
318#define M_BCM1480_MC_CS23_BANK0 _SB_MAKEMASK(6, S_BCM1480_MC_CS23_BANK0)
319#define V_BCM1480_MC_CS23_BANK0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS23_BANK0)
320#define G_BCM1480_MC_CS23_BANK0(x) _SB_GETVALUE(x, S_BCM1480_MC_CS23_BANK0, M_BCM1480_MC_CS23_BANK0)
321
322#define S_BCM1480_MC_CS23_BANK1 8
323#define M_BCM1480_MC_CS23_BANK1 _SB_MAKEMASK(6, S_BCM1480_MC_CS23_BANK1)
324#define V_BCM1480_MC_CS23_BANK1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS23_BANK1)
325#define G_BCM1480_MC_CS23_BANK1(x) _SB_GETVALUE(x, S_BCM1480_MC_CS23_BANK1, M_BCM1480_MC_CS23_BANK1)
326
327#define S_BCM1480_MC_CS23_BANK2 16
328#define M_BCM1480_MC_CS23_BANK2 _SB_MAKEMASK(6, S_BCM1480_MC_CS23_BANK2)
329#define V_BCM1480_MC_CS23_BANK2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS23_BANK2)
330#define G_BCM1480_MC_CS23_BANK2(x) _SB_GETVALUE(x, S_BCM1480_MC_CS23_BANK2, M_BCM1480_MC_CS23_BANK2)
331
332#define K_BCM1480_MC_CSXX_BANKX_BIT_SPACING 8
333
334/*
335 * DRAM Command Register (Table 90)
336 */
337
338#define S_BCM1480_MC_COMMAND 0
339#define M_BCM1480_MC_COMMAND _SB_MAKEMASK(4, S_BCM1480_MC_COMMAND)
340#define V_BCM1480_MC_COMMAND(x) _SB_MAKEVALUE(x, S_BCM1480_MC_COMMAND)
341#define G_BCM1480_MC_COMMAND(x) _SB_GETVALUE(x, S_BCM1480_MC_COMMAND, M_BCM1480_MC_COMMAND)
342
343#define K_BCM1480_MC_COMMAND_EMRS 0
344#define K_BCM1480_MC_COMMAND_MRS 1
345#define K_BCM1480_MC_COMMAND_PRE 2
346#define K_BCM1480_MC_COMMAND_AR 3
347#define K_BCM1480_MC_COMMAND_SETRFSH 4
348#define K_BCM1480_MC_COMMAND_CLRRFSH 5
349#define K_BCM1480_MC_COMMAND_SETPWRDN 6
350#define K_BCM1480_MC_COMMAND_CLRPWRDN 7
351
352#if SIBYTE_HDR_FEATURE(1480, PASS2)
353#define K_BCM1480_MC_COMMAND_EMRS2 8
354#define K_BCM1480_MC_COMMAND_EMRS3 9
355#define K_BCM1480_MC_COMMAND_ENABLE_MCLK 10
356#define K_BCM1480_MC_COMMAND_DISABLE_MCLK 11
357#endif
358
359#define V_BCM1480_MC_COMMAND_EMRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS)
360#define V_BCM1480_MC_COMMAND_MRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_MRS)
361#define V_BCM1480_MC_COMMAND_PRE V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_PRE)
362#define V_BCM1480_MC_COMMAND_AR V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_AR)
363#define V_BCM1480_MC_COMMAND_SETRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETRFSH)
364#define V_BCM1480_MC_COMMAND_CLRRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRRFSH)
365#define V_BCM1480_MC_COMMAND_SETPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETPWRDN)
366#define V_BCM1480_MC_COMMAND_CLRPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRPWRDN)
367
368#if SIBYTE_HDR_FEATURE(1480, PASS2)
369#define V_BCM1480_MC_COMMAND_EMRS2 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS2)
370#define V_BCM1480_MC_COMMAND_EMRS3 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS3)
371#define V_BCM1480_MC_COMMAND_ENABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_ENABLE_MCLK)
372#define V_BCM1480_MC_COMMAND_DISABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_DISABLE_MCLK)
373#endif
374
375#define S_BCM1480_MC_CS0 4
376#define M_BCM1480_MC_CS0 _SB_MAKEMASK1(4)
377#define M_BCM1480_MC_CS1 _SB_MAKEMASK1(5)
378#define M_BCM1480_MC_CS2 _SB_MAKEMASK1(6)
379#define M_BCM1480_MC_CS3 _SB_MAKEMASK1(7)
380#define M_BCM1480_MC_CS4 _SB_MAKEMASK1(8)
381#define M_BCM1480_MC_CS5 _SB_MAKEMASK1(9)
382#define M_BCM1480_MC_CS6 _SB_MAKEMASK1(10)
383#define M_BCM1480_MC_CS7 _SB_MAKEMASK1(11)
384
385#define M_BCM1480_MC_CS _SB_MAKEMASK(8, S_BCM1480_MC_CS0)
386#define V_BCM1480_MC_CS(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CS0)
387#define G_BCM1480_MC_CS(x) _SB_GETVALUE(x, S_BCM1480_MC_CS0, M_BCM1480_MC_CS0)
388
389#define M_BCM1480_MC_CMD_ACTIVE _SB_MAKEMASK1(16)
390
391/*
392 * DRAM Mode Register (Table 91)
393 */
394
395#define S_BCM1480_MC_EMODE 0
396#define M_BCM1480_MC_EMODE _SB_MAKEMASK(15, S_BCM1480_MC_EMODE)
397#define V_BCM1480_MC_EMODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_EMODE)
398#define G_BCM1480_MC_EMODE(x) _SB_GETVALUE(x, S_BCM1480_MC_EMODE, M_BCM1480_MC_EMODE)
399#define V_BCM1480_MC_EMODE_DEFAULT V_BCM1480_MC_EMODE(0)
400
401#define S_BCM1480_MC_MODE 16
402#define M_BCM1480_MC_MODE _SB_MAKEMASK(15, S_BCM1480_MC_MODE)
403#define V_BCM1480_MC_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_MODE)
404#define G_BCM1480_MC_MODE(x) _SB_GETVALUE(x, S_BCM1480_MC_MODE, M_BCM1480_MC_MODE)
405#define V_BCM1480_MC_MODE_DEFAULT V_BCM1480_MC_MODE(0)
406
407#define S_BCM1480_MC_DRAM_TYPE 32
408#define M_BCM1480_MC_DRAM_TYPE _SB_MAKEMASK(4, S_BCM1480_MC_DRAM_TYPE)
409#define V_BCM1480_MC_DRAM_TYPE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DRAM_TYPE)
410#define G_BCM1480_MC_DRAM_TYPE(x) _SB_GETVALUE(x, S_BCM1480_MC_DRAM_TYPE, M_BCM1480_MC_DRAM_TYPE)
411
412#define K_BCM1480_MC_DRAM_TYPE_JEDEC 0
413#define K_BCM1480_MC_DRAM_TYPE_FCRAM 1
414
415#if SIBYTE_HDR_FEATURE(1480, PASS2)
416#define K_BCM1480_MC_DRAM_TYPE_DDR2 2
417#endif
418
419#define K_BCM1480_MC_DRAM_TYPE_DDR2_PASS1 0
420
421#define V_BCM1480_MC_DRAM_TYPE_JEDEC V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_JEDEC)
422#define V_BCM1480_MC_DRAM_TYPE_FCRAM V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_FCRAM)
423
424#if SIBYTE_HDR_FEATURE(1480, PASS2)
425#define V_BCM1480_MC_DRAM_TYPE_DDR2 V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_DDR2)
426#endif
427
428#define M_BCM1480_MC_GANGED _SB_MAKEMASK1(36)
429#define M_BCM1480_MC_BY9_INTF _SB_MAKEMASK1(37)
430#define M_BCM1480_MC_FORCE_ECC64 _SB_MAKEMASK1(38)
431#define M_BCM1480_MC_ECC_DISABLE _SB_MAKEMASK1(39)
432
433#define S_BCM1480_MC_PG_POLICY 40
434#define M_BCM1480_MC_PG_POLICY _SB_MAKEMASK(2, S_BCM1480_MC_PG_POLICY)
435#define V_BCM1480_MC_PG_POLICY(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PG_POLICY)
436#define G_BCM1480_MC_PG_POLICY(x) _SB_GETVALUE(x, S_BCM1480_MC_PG_POLICY, M_BCM1480_MC_PG_POLICY)
437
438#define K_BCM1480_MC_PG_POLICY_CLOSED 0
439#define K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK 1
440
441#define V_BCM1480_MC_PG_POLICY_CLOSED V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CLOSED)
442#define V_BCM1480_MC_PG_POLICY_CAS_TIME_CHK V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK)
443
444#if SIBYTE_HDR_FEATURE(1480, PASS2)
445#define M_BCM1480_MC_2T_CMD _SB_MAKEMASK1(42)
446#define M_BCM1480_MC_ECC_COR_DIS _SB_MAKEMASK1(43)
447#endif
448
449#define V_BCM1480_MC_DRAMMODE_DEFAULT V_BCM1480_MC_EMODE_DEFAULT | V_BCM1480_MC_MODE_DEFAULT | V_BCM1480_MC_DRAM_TYPE_JEDEC | \
450 V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK)
451
452/*
453 * Memory Clock Configuration Register (Table 92)
454 */
455
456#define S_BCM1480_MC_CLK_RATIO 0
457#define M_BCM1480_MC_CLK_RATIO _SB_MAKEMASK(6, S_BCM1480_MC_CLK_RATIO)
458#define V_BCM1480_MC_CLK_RATIO(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CLK_RATIO)
459#define G_BCM1480_MC_CLK_RATIO(x) _SB_GETVALUE(x, S_BCM1480_MC_CLK_RATIO, M_BCM1480_MC_CLK_RATIO)
460
461#define V_BCM1480_MC_CLK_RATIO_DEFAULT V_BCM1480_MC_CLK_RATIO(10)
462
463#define S_BCM1480_MC_REF_RATE 8
464#define M_BCM1480_MC_REF_RATE _SB_MAKEMASK(8, S_BCM1480_MC_REF_RATE)
465#define V_BCM1480_MC_REF_RATE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_REF_RATE)
466#define G_BCM1480_MC_REF_RATE(x) _SB_GETVALUE(x, S_BCM1480_MC_REF_RATE, M_BCM1480_MC_REF_RATE)
467
468#define K_BCM1480_MC_REF_RATE_100MHz 0x31
469#define K_BCM1480_MC_REF_RATE_200MHz 0x62
470#define K_BCM1480_MC_REF_RATE_400MHz 0xC4
471
472#define V_BCM1480_MC_REF_RATE_100MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_100MHz)
473#define V_BCM1480_MC_REF_RATE_200MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_200MHz)
474#define V_BCM1480_MC_REF_RATE_400MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_400MHz)
475#define V_BCM1480_MC_REF_RATE_DEFAULT V_BCM1480_MC_REF_RATE_400MHz
476
477#if SIBYTE_HDR_FEATURE(1480, PASS2)
478#define M_BCM1480_MC_AUTO_REF_DIS _SB_MAKEMASK1(16)
479#endif
480
481/*
482 * ODT Register (Table 99)
483 */
484
485#if SIBYTE_HDR_FEATURE(1480, PASS2)
486#define M_BCM1480_MC_RD_ODT0_CS0 _SB_MAKEMASK1(0)
487#define M_BCM1480_MC_RD_ODT0_CS2 _SB_MAKEMASK1(1)
488#define M_BCM1480_MC_RD_ODT0_CS4 _SB_MAKEMASK1(2)
489#define M_BCM1480_MC_RD_ODT0_CS6 _SB_MAKEMASK1(3)
490#define M_BCM1480_MC_WR_ODT0_CS0 _SB_MAKEMASK1(4)
491#define M_BCM1480_MC_WR_ODT0_CS2 _SB_MAKEMASK1(5)
492#define M_BCM1480_MC_WR_ODT0_CS4 _SB_MAKEMASK1(6)
493#define M_BCM1480_MC_WR_ODT0_CS6 _SB_MAKEMASK1(7)
494#define M_BCM1480_MC_RD_ODT2_CS0 _SB_MAKEMASK1(8)
495#define M_BCM1480_MC_RD_ODT2_CS2 _SB_MAKEMASK1(9)
496#define M_BCM1480_MC_RD_ODT2_CS4 _SB_MAKEMASK1(10)
497#define M_BCM1480_MC_RD_ODT2_CS6 _SB_MAKEMASK1(11)
498#define M_BCM1480_MC_WR_ODT2_CS0 _SB_MAKEMASK1(12)
499#define M_BCM1480_MC_WR_ODT2_CS2 _SB_MAKEMASK1(13)
500#define M_BCM1480_MC_WR_ODT2_CS4 _SB_MAKEMASK1(14)
501#define M_BCM1480_MC_WR_ODT2_CS6 _SB_MAKEMASK1(15)
502#define M_BCM1480_MC_RD_ODT4_CS0 _SB_MAKEMASK1(16)
503#define M_BCM1480_MC_RD_ODT4_CS2 _SB_MAKEMASK1(17)
504#define M_BCM1480_MC_RD_ODT4_CS4 _SB_MAKEMASK1(18)
505#define M_BCM1480_MC_RD_ODT4_CS6 _SB_MAKEMASK1(19)
506#define M_BCM1480_MC_WR_ODT4_CS0 _SB_MAKEMASK1(20)
507#define M_BCM1480_MC_WR_ODT4_CS2 _SB_MAKEMASK1(21)
508#define M_BCM1480_MC_WR_ODT4_CS4 _SB_MAKEMASK1(22)
509#define M_BCM1480_MC_WR_ODT4_CS6 _SB_MAKEMASK1(23)
510#define M_BCM1480_MC_RD_ODT6_CS0 _SB_MAKEMASK1(24)
511#define M_BCM1480_MC_RD_ODT6_CS2 _SB_MAKEMASK1(25)
512#define M_BCM1480_MC_RD_ODT6_CS4 _SB_MAKEMASK1(26)
513#define M_BCM1480_MC_RD_ODT6_CS6 _SB_MAKEMASK1(27)
514#define M_BCM1480_MC_WR_ODT6_CS0 _SB_MAKEMASK1(28)
515#define M_BCM1480_MC_WR_ODT6_CS2 _SB_MAKEMASK1(29)
516#define M_BCM1480_MC_WR_ODT6_CS4 _SB_MAKEMASK1(30)
517#define M_BCM1480_MC_WR_ODT6_CS6 _SB_MAKEMASK1(31)
518
519#define M_BCM1480_MC_CS_ODD_ODT_EN _SB_MAKEMASK1(32)
520
521#define S_BCM1480_MC_ODT0 0
522#define M_BCM1480_MC_ODT0 _SB_MAKEMASK(8, S_BCM1480_MC_ODT0)
523#define V_BCM1480_MC_ODT0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT0)
524
525#define S_BCM1480_MC_ODT2 8
526#define M_BCM1480_MC_ODT2 _SB_MAKEMASK(8, S_BCM1480_MC_ODT2)
527#define V_BCM1480_MC_ODT2(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT2)
528
529#define S_BCM1480_MC_ODT4 16
530#define M_BCM1480_MC_ODT4 _SB_MAKEMASK(8, S_BCM1480_MC_ODT4)
531#define V_BCM1480_MC_ODT4(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT4)
532
533#define S_BCM1480_MC_ODT6 24
534#define M_BCM1480_MC_ODT6 _SB_MAKEMASK(8, S_BCM1480_MC_ODT6)
535#define V_BCM1480_MC_ODT6(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ODT6)
536#endif
537
538/*
539 * Memory DLL Configuration Register (Table 93)
540 */
541
542#define S_BCM1480_MC_ADDR_COARSE_ADJ 0
543#define M_BCM1480_MC_ADDR_COARSE_ADJ _SB_MAKEMASK(6, S_BCM1480_MC_ADDR_COARSE_ADJ)
544#define V_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ADDR_COARSE_ADJ)
545#define G_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_ADDR_COARSE_ADJ, M_BCM1480_MC_ADDR_COARSE_ADJ)
546#define V_BCM1480_MC_ADDR_COARSE_ADJ_DEFAULT V_BCM1480_MC_ADDR_COARSE_ADJ(0x0)
547
548#if SIBYTE_HDR_FEATURE(1480, PASS2)
549#define S_BCM1480_MC_ADDR_FREQ_RANGE 8
550#define M_BCM1480_MC_ADDR_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_ADDR_FREQ_RANGE)
551#define V_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ADDR_FREQ_RANGE)
552#define G_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_ADDR_FREQ_RANGE, M_BCM1480_MC_ADDR_FREQ_RANGE)
553#define V_BCM1480_MC_ADDR_FREQ_RANGE_DEFAULT V_BCM1480_MC_ADDR_FREQ_RANGE(0x4)
554#endif
555
556#define S_BCM1480_MC_ADDR_FINE_ADJ 8
557#define M_BCM1480_MC_ADDR_FINE_ADJ _SB_MAKEMASK(4, S_BCM1480_MC_ADDR_FINE_ADJ)
558#define V_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ADDR_FINE_ADJ)
559#define G_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_ADDR_FINE_ADJ, M_BCM1480_MC_ADDR_FINE_ADJ)
560#define V_BCM1480_MC_ADDR_FINE_ADJ_DEFAULT V_BCM1480_MC_ADDR_FINE_ADJ(0x8)
561
562#define S_BCM1480_MC_DQI_COARSE_ADJ 16
563#define M_BCM1480_MC_DQI_COARSE_ADJ _SB_MAKEMASK(6, S_BCM1480_MC_DQI_COARSE_ADJ)
564#define V_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQI_COARSE_ADJ)
565#define G_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQI_COARSE_ADJ, M_BCM1480_MC_DQI_COARSE_ADJ)
566#define V_BCM1480_MC_DQI_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQI_COARSE_ADJ(0x0)
567
568#if SIBYTE_HDR_FEATURE(1480, PASS2)
569#define S_BCM1480_MC_DQI_FREQ_RANGE 24
570#define M_BCM1480_MC_DQI_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_DQI_FREQ_RANGE)
571#define V_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQI_FREQ_RANGE)
572#define G_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_DQI_FREQ_RANGE, M_BCM1480_MC_DQI_FREQ_RANGE)
573#define V_BCM1480_MC_DQI_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQI_FREQ_RANGE(0x4)
574#endif
575
576#define S_BCM1480_MC_DQI_FINE_ADJ 24
577#define M_BCM1480_MC_DQI_FINE_ADJ _SB_MAKEMASK(4, S_BCM1480_MC_DQI_FINE_ADJ)
578#define V_BCM1480_MC_DQI_FINE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQI_FINE_ADJ)
579#define G_BCM1480_MC_DQI_FINE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQI_FINE_ADJ, M_BCM1480_MC_DQI_FINE_ADJ)
580#define V_BCM1480_MC_DQI_FINE_ADJ_DEFAULT V_BCM1480_MC_DQI_FINE_ADJ(0x8)
581
582#define S_BCM1480_MC_DQO_COARSE_ADJ 32
583#define M_BCM1480_MC_DQO_COARSE_ADJ _SB_MAKEMASK(6, S_BCM1480_MC_DQO_COARSE_ADJ)
584#define V_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQO_COARSE_ADJ)
585#define G_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQO_COARSE_ADJ, M_BCM1480_MC_DQO_COARSE_ADJ)
586#define V_BCM1480_MC_DQO_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQO_COARSE_ADJ(0x0)
587
588#if SIBYTE_HDR_FEATURE(1480, PASS2)
589#define S_BCM1480_MC_DQO_FREQ_RANGE 40
590#define M_BCM1480_MC_DQO_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_DQO_FREQ_RANGE)
591#define V_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQO_FREQ_RANGE)
592#define G_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_DQO_FREQ_RANGE, M_BCM1480_MC_DQO_FREQ_RANGE)
593#define V_BCM1480_MC_DQO_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQO_FREQ_RANGE(0x4)
594#endif
595
596#define S_BCM1480_MC_DQO_FINE_ADJ 40
597#define M_BCM1480_MC_DQO_FINE_ADJ _SB_MAKEMASK(4, S_BCM1480_MC_DQO_FINE_ADJ)
598#define V_BCM1480_MC_DQO_FINE_ADJ(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DQO_FINE_ADJ)
599#define G_BCM1480_MC_DQO_FINE_ADJ(x) _SB_GETVALUE(x, S_BCM1480_MC_DQO_FINE_ADJ, M_BCM1480_MC_DQO_FINE_ADJ)
600#define V_BCM1480_MC_DQO_FINE_ADJ_DEFAULT V_BCM1480_MC_DQO_FINE_ADJ(0x8)
601
602#if SIBYTE_HDR_FEATURE(1480, PASS2)
603#define S_BCM1480_MC_DLL_PDSEL 44
604#define M_BCM1480_MC_DLL_PDSEL _SB_MAKEMASK(2, S_BCM1480_MC_DLL_PDSEL)
605#define V_BCM1480_MC_DLL_PDSEL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_PDSEL)
606#define G_BCM1480_MC_DLL_PDSEL(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_PDSEL, M_BCM1480_MC_DLL_PDSEL)
607#define V_BCM1480_MC_DLL_DEFAULT_PDSEL V_BCM1480_MC_DLL_PDSEL(0x0)
608
609#define M_BCM1480_MC_DLL_REGBYPASS _SB_MAKEMASK1(46)
610#define M_BCM1480_MC_DQO_SHIFT _SB_MAKEMASK1(47)
611#endif
612
613#define S_BCM1480_MC_DLL_DEFAULT 48
614#define M_BCM1480_MC_DLL_DEFAULT _SB_MAKEMASK(6, S_BCM1480_MC_DLL_DEFAULT)
615#define V_BCM1480_MC_DLL_DEFAULT(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_DEFAULT)
616#define G_BCM1480_MC_DLL_DEFAULT(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_DEFAULT, M_BCM1480_MC_DLL_DEFAULT)
617#define V_BCM1480_MC_DLL_DEFAULT_DEFAULT V_BCM1480_MC_DLL_DEFAULT(0x10)
618
619#if SIBYTE_HDR_FEATURE(1480, PASS2)
620#define S_BCM1480_MC_DLL_REGCTRL 54
621#define M_BCM1480_MC_DLL_REGCTRL _SB_MAKEMASK(2, S_BCM1480_MC_DLL_REGCTRL)
622#define V_BCM1480_MC_DLL_REGCTRL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_REGCTRL)
623#define G_BCM1480_MC_DLL_REGCTRL(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_REGCTRL, M_BCM1480_MC_DLL_REGCTRL)
624#define V_BCM1480_MC_DLL_DEFAULT_REGCTRL V_BCM1480_MC_DLL_REGCTRL(0x0)
625#endif
626
627#if SIBYTE_HDR_FEATURE(1480, PASS2)
628#define S_BCM1480_MC_DLL_FREQ_RANGE 56
629#define M_BCM1480_MC_DLL_FREQ_RANGE _SB_MAKEMASK(4, S_BCM1480_MC_DLL_FREQ_RANGE)
630#define V_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_FREQ_RANGE)
631#define G_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_FREQ_RANGE, M_BCM1480_MC_DLL_FREQ_RANGE)
632#define V_BCM1480_MC_DLL_FREQ_RANGE_DEFAULT V_BCM1480_MC_DLL_FREQ_RANGE(0x4)
633#endif
634
635#define S_BCM1480_MC_DLL_STEP_SIZE 56
636#define M_BCM1480_MC_DLL_STEP_SIZE _SB_MAKEMASK(4, S_BCM1480_MC_DLL_STEP_SIZE)
637#define V_BCM1480_MC_DLL_STEP_SIZE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_STEP_SIZE)
638#define G_BCM1480_MC_DLL_STEP_SIZE(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_STEP_SIZE, M_BCM1480_MC_DLL_STEP_SIZE)
639#define V_BCM1480_MC_DLL_STEP_SIZE_DEFAULT V_BCM1480_MC_DLL_STEP_SIZE(0x8)
640
641#if SIBYTE_HDR_FEATURE(1480, PASS2)
642#define S_BCM1480_MC_DLL_BGCTRL 60
643#define M_BCM1480_MC_DLL_BGCTRL _SB_MAKEMASK(2, S_BCM1480_MC_DLL_BGCTRL)
644#define V_BCM1480_MC_DLL_BGCTRL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_DLL_BGCTRL)
645#define G_BCM1480_MC_DLL_BGCTRL(x) _SB_GETVALUE(x, S_BCM1480_MC_DLL_BGCTRL, M_BCM1480_MC_DLL_BGCTRL)
646#define V_BCM1480_MC_DLL_DEFAULT_BGCTRL V_BCM1480_MC_DLL_BGCTRL(0x0)
647#endif
648
649#define M_BCM1480_MC_DLL_BYPASS _SB_MAKEMASK1(63)
650
651/*
652 * Memory Drive Configuration Register (Table 94)
653 */
654
655#define S_BCM1480_MC_RTT_BYP_PULLDOWN 0
656#define M_BCM1480_MC_RTT_BYP_PULLDOWN _SB_MAKEMASK(3, S_BCM1480_MC_RTT_BYP_PULLDOWN)
657#define V_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_MAKEVALUE(x, S_BCM1480_MC_RTT_BYP_PULLDOWN)
658#define G_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_GETVALUE(x, S_BCM1480_MC_RTT_BYP_PULLDOWN, M_BCM1480_MC_RTT_BYP_PULLDOWN)
659
660#define S_BCM1480_MC_RTT_BYP_PULLUP 6
661#define M_BCM1480_MC_RTT_BYP_PULLUP _SB_MAKEMASK(3, S_BCM1480_MC_RTT_BYP_PULLUP)
662#define V_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_RTT_BYP_PULLUP)
663#define G_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_GETVALUE(x, S_BCM1480_MC_RTT_BYP_PULLUP, M_BCM1480_MC_RTT_BYP_PULLUP)
664
665#define M_BCM1480_MC_RTT_BYPASS _SB_MAKEMASK1(8)
666#define M_BCM1480_MC_RTT_COMP_MOV_AVG _SB_MAKEMASK1(9)
667
668#define S_BCM1480_MC_PVT_BYP_C1_PULLDOWN 10
669#define M_BCM1480_MC_PVT_BYP_C1_PULLDOWN _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C1_PULLDOWN)
670#define V_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLDOWN)
671#define G_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLDOWN, M_BCM1480_MC_PVT_BYP_C1_PULLDOWN)
672
673#define S_BCM1480_MC_PVT_BYP_C1_PULLUP 15
674#define M_BCM1480_MC_PVT_BYP_C1_PULLUP _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C1_PULLUP)
675#define V_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLUP)
676#define G_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C1_PULLUP, M_BCM1480_MC_PVT_BYP_C1_PULLUP)
677
678#define S_BCM1480_MC_PVT_BYP_C2_PULLDOWN 20
679#define M_BCM1480_MC_PVT_BYP_C2_PULLDOWN _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C2_PULLDOWN)
680#define V_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLDOWN)
681#define G_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLDOWN, M_BCM1480_MC_PVT_BYP_C2_PULLDOWN)
682
683#define S_BCM1480_MC_PVT_BYP_C2_PULLUP 25
684#define M_BCM1480_MC_PVT_BYP_C2_PULLUP _SB_MAKEMASK(4, S_BCM1480_MC_PVT_BYP_C2_PULLUP)
685#define V_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLUP)
686#define G_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_GETVALUE(x, S_BCM1480_MC_PVT_BYP_C2_PULLUP, M_BCM1480_MC_PVT_BYP_C2_PULLUP)
687
688#define M_BCM1480_MC_PVT_BYPASS _SB_MAKEMASK1(30)
689#define M_BCM1480_MC_PVT_COMP_MOV_AVG _SB_MAKEMASK1(31)
690
691#define M_BCM1480_MC_CLK_CLASS _SB_MAKEMASK1(34)
692#define M_BCM1480_MC_DATA_CLASS _SB_MAKEMASK1(35)
693#define M_BCM1480_MC_ADDR_CLASS _SB_MAKEMASK1(36)
694
695#define M_BCM1480_MC_DQ_ODT_75 _SB_MAKEMASK1(37)
696#define M_BCM1480_MC_DQ_ODT_150 _SB_MAKEMASK1(38)
697#define M_BCM1480_MC_DQS_ODT_75 _SB_MAKEMASK1(39)
698#define M_BCM1480_MC_DQS_ODT_150 _SB_MAKEMASK1(40)
699#define M_BCM1480_MC_DQS_DIFF _SB_MAKEMASK1(41)
700
701/*
702 * ECC Test Data Register (Table 95)
703 */
704
705#define S_BCM1480_MC_DATA_INVERT 0
706#define M_DATA_ECC_INVERT _SB_MAKEMASK(64, S_BCM1480_MC_ECC_INVERT)
707
708/*
709 * ECC Test ECC Register (Table 96)
710 */
711
712#define S_BCM1480_MC_ECC_INVERT 0
713#define M_BCM1480_MC_ECC_INVERT _SB_MAKEMASK(8, S_BCM1480_MC_ECC_INVERT)
714
715/*
716 * SDRAM Timing Register (Table 97)
717 */
718
719#define S_BCM1480_MC_tRCD 0
720#define M_BCM1480_MC_tRCD _SB_MAKEMASK(4, S_BCM1480_MC_tRCD)
721#define V_BCM1480_MC_tRCD(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRCD)
722#define G_BCM1480_MC_tRCD(x) _SB_GETVALUE(x, S_BCM1480_MC_tRCD, M_BCM1480_MC_tRCD)
723#define K_BCM1480_MC_tRCD_DEFAULT 3
724#define V_BCM1480_MC_tRCD_DEFAULT V_BCM1480_MC_tRCD(K_BCM1480_MC_tRCD_DEFAULT)
725
726#define S_BCM1480_MC_tCL 4
727#define M_BCM1480_MC_tCL _SB_MAKEMASK(4, S_BCM1480_MC_tCL)
728#define V_BCM1480_MC_tCL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tCL)
729#define G_BCM1480_MC_tCL(x) _SB_GETVALUE(x, S_BCM1480_MC_tCL, M_BCM1480_MC_tCL)
730#define K_BCM1480_MC_tCL_DEFAULT 2
731#define V_BCM1480_MC_tCL_DEFAULT V_BCM1480_MC_tCL(K_BCM1480_MC_tCL_DEFAULT)
732
733#define M_BCM1480_MC_tCrDh _SB_MAKEMASK1(8)
734
735#define S_BCM1480_MC_tWR 9
736#define M_BCM1480_MC_tWR _SB_MAKEMASK(3, S_BCM1480_MC_tWR)
737#define V_BCM1480_MC_tWR(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tWR)
738#define G_BCM1480_MC_tWR(x) _SB_GETVALUE(x, S_BCM1480_MC_tWR, M_BCM1480_MC_tWR)
739#define K_BCM1480_MC_tWR_DEFAULT 2
740#define V_BCM1480_MC_tWR_DEFAULT V_BCM1480_MC_tWR(K_BCM1480_MC_tWR_DEFAULT)
741
742#define S_BCM1480_MC_tCwD 12
743#define M_BCM1480_MC_tCwD _SB_MAKEMASK(4, S_BCM1480_MC_tCwD)
744#define V_BCM1480_MC_tCwD(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tCwD)
745#define G_BCM1480_MC_tCwD(x) _SB_GETVALUE(x, S_BCM1480_MC_tCwD, M_BCM1480_MC_tCwD)
746#define K_BCM1480_MC_tCwD_DEFAULT 1
747#define V_BCM1480_MC_tCwD_DEFAULT V_BCM1480_MC_tCwD(K_BCM1480_MC_tCwD_DEFAULT)
748
749#define S_BCM1480_MC_tRP 16
750#define M_BCM1480_MC_tRP _SB_MAKEMASK(4, S_BCM1480_MC_tRP)
751#define V_BCM1480_MC_tRP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRP)
752#define G_BCM1480_MC_tRP(x) _SB_GETVALUE(x, S_BCM1480_MC_tRP, M_BCM1480_MC_tRP)
753#define K_BCM1480_MC_tRP_DEFAULT 4
754#define V_BCM1480_MC_tRP_DEFAULT V_BCM1480_MC_tRP(K_BCM1480_MC_tRP_DEFAULT)
755
756#define S_BCM1480_MC_tRRD 20
757#define M_BCM1480_MC_tRRD _SB_MAKEMASK(4, S_BCM1480_MC_tRRD)
758#define V_BCM1480_MC_tRRD(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRRD)
759#define G_BCM1480_MC_tRRD(x) _SB_GETVALUE(x, S_BCM1480_MC_tRRD, M_BCM1480_MC_tRRD)
760#define K_BCM1480_MC_tRRD_DEFAULT 2
761#define V_BCM1480_MC_tRRD_DEFAULT V_BCM1480_MC_tRRD(K_BCM1480_MC_tRRD_DEFAULT)
762
763#define S_BCM1480_MC_tRCw 24
764#define M_BCM1480_MC_tRCw _SB_MAKEMASK(5, S_BCM1480_MC_tRCw)
765#define V_BCM1480_MC_tRCw(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRCw)
766#define G_BCM1480_MC_tRCw(x) _SB_GETVALUE(x, S_BCM1480_MC_tRCw, M_BCM1480_MC_tRCw)
767#define K_BCM1480_MC_tRCw_DEFAULT 10
768#define V_BCM1480_MC_tRCw_DEFAULT V_BCM1480_MC_tRCw(K_BCM1480_MC_tRCw_DEFAULT)
769
770#define S_BCM1480_MC_tRCr 32
771#define M_BCM1480_MC_tRCr _SB_MAKEMASK(5, S_BCM1480_MC_tRCr)
772#define V_BCM1480_MC_tRCr(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRCr)
773#define G_BCM1480_MC_tRCr(x) _SB_GETVALUE(x, S_BCM1480_MC_tRCr, M_BCM1480_MC_tRCr)
774#define K_BCM1480_MC_tRCr_DEFAULT 9
775#define V_BCM1480_MC_tRCr_DEFAULT V_BCM1480_MC_tRCr(K_BCM1480_MC_tRCr_DEFAULT)
776
777#if SIBYTE_HDR_FEATURE(1480, PASS2)
778#define S_BCM1480_MC_tFAW 40
779#define M_BCM1480_MC_tFAW _SB_MAKEMASK(6, S_BCM1480_MC_tFAW)
780#define V_BCM1480_MC_tFAW(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tFAW)
781#define G_BCM1480_MC_tFAW(x) _SB_GETVALUE(x, S_BCM1480_MC_tFAW, M_BCM1480_MC_tFAW)
782#define K_BCM1480_MC_tFAW_DEFAULT 0
783#define V_BCM1480_MC_tFAW_DEFAULT V_BCM1480_MC_tFAW(K_BCM1480_MC_tFAW_DEFAULT)
784#endif
785
786#define S_BCM1480_MC_tRFC 48
787#define M_BCM1480_MC_tRFC _SB_MAKEMASK(7, S_BCM1480_MC_tRFC)
788#define V_BCM1480_MC_tRFC(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRFC)
789#define G_BCM1480_MC_tRFC(x) _SB_GETVALUE(x, S_BCM1480_MC_tRFC, M_BCM1480_MC_tRFC)
790#define K_BCM1480_MC_tRFC_DEFAULT 12
791#define V_BCM1480_MC_tRFC_DEFAULT V_BCM1480_MC_tRFC(K_BCM1480_MC_tRFC_DEFAULT)
792
793#define S_BCM1480_MC_tFIFO 56
794#define M_BCM1480_MC_tFIFO _SB_MAKEMASK(2, S_BCM1480_MC_tFIFO)
795#define V_BCM1480_MC_tFIFO(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tFIFO)
796#define G_BCM1480_MC_tFIFO(x) _SB_GETVALUE(x, S_BCM1480_MC_tFIFO, M_BCM1480_MC_tFIFO)
797#define K_BCM1480_MC_tFIFO_DEFAULT 0
798#define V_BCM1480_MC_tFIFO_DEFAULT V_BCM1480_MC_tFIFO(K_BCM1480_MC_tFIFO_DEFAULT)
799
800#define S_BCM1480_MC_tW2R 58
801#define M_BCM1480_MC_tW2R _SB_MAKEMASK(2, S_BCM1480_MC_tW2R)
802#define V_BCM1480_MC_tW2R(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tW2R)
803#define G_BCM1480_MC_tW2R(x) _SB_GETVALUE(x, S_BCM1480_MC_tW2R, M_BCM1480_MC_tW2R)
804#define K_BCM1480_MC_tW2R_DEFAULT 1
805#define V_BCM1480_MC_tW2R_DEFAULT V_BCM1480_MC_tW2R(K_BCM1480_MC_tW2R_DEFAULT)
806
807#define S_BCM1480_MC_tR2W 60
808#define M_BCM1480_MC_tR2W _SB_MAKEMASK(2, S_BCM1480_MC_tR2W)
809#define V_BCM1480_MC_tR2W(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tR2W)
810#define G_BCM1480_MC_tR2W(x) _SB_GETVALUE(x, S_BCM1480_MC_tR2W, M_BCM1480_MC_tR2W)
811#define K_BCM1480_MC_tR2W_DEFAULT 0
812#define V_BCM1480_MC_tR2W_DEFAULT V_BCM1480_MC_tR2W(K_BCM1480_MC_tR2W_DEFAULT)
813
814#define M_BCM1480_MC_tR2R _SB_MAKEMASK1(62)
815
816#define V_BCM1480_MC_TIMING_DEFAULT (M_BCM1480_MC_tR2R | \
817 V_BCM1480_MC_tFIFO_DEFAULT | \
818 V_BCM1480_MC_tR2W_DEFAULT | \
819 V_BCM1480_MC_tW2R_DEFAULT | \
820 V_BCM1480_MC_tRFC_DEFAULT | \
821 V_BCM1480_MC_tRCr_DEFAULT | \
822 V_BCM1480_MC_tRCw_DEFAULT | \
823 V_BCM1480_MC_tRRD_DEFAULT | \
824 V_BCM1480_MC_tRP_DEFAULT | \
825 V_BCM1480_MC_tCwD_DEFAULT | \
826 V_BCM1480_MC_tWR_DEFAULT | \
827 M_BCM1480_MC_tCrDh | \
828 V_BCM1480_MC_tCL_DEFAULT | \
829 V_BCM1480_MC_tRCD_DEFAULT)
830
831/*
832 * SDRAM Timing Register 2
833 */
834
835#if SIBYTE_HDR_FEATURE(1480, PASS2)
836
837#define S_BCM1480_MC_tAL 0
838#define M_BCM1480_MC_tAL _SB_MAKEMASK(4, S_BCM1480_MC_tAL)
839#define V_BCM1480_MC_tAL(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tAL)
840#define G_BCM1480_MC_tAL(x) _SB_GETVALUE(x, S_BCM1480_MC_tAL, M_BCM1480_MC_tAL)
841#define K_BCM1480_MC_tAL_DEFAULT 0
842#define V_BCM1480_MC_tAL_DEFAULT V_BCM1480_MC_tAL(K_BCM1480_MC_tAL_DEFAULT)
843
844#define S_BCM1480_MC_tRTP 4
845#define M_BCM1480_MC_tRTP _SB_MAKEMASK(3, S_BCM1480_MC_tRTP)
846#define V_BCM1480_MC_tRTP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRTP)
847#define G_BCM1480_MC_tRTP(x) _SB_GETVALUE(x, S_BCM1480_MC_tRTP, M_BCM1480_MC_tRTP)
848#define K_BCM1480_MC_tRTP_DEFAULT 2
849#define V_BCM1480_MC_tRTP_DEFAULT V_BCM1480_MC_tRTP(K_BCM1480_MC_tRTP_DEFAULT)
850
851#define S_BCM1480_MC_tW2W 8
852#define M_BCM1480_MC_tW2W _SB_MAKEMASK(2, S_BCM1480_MC_tW2W)
853#define V_BCM1480_MC_tW2W(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tW2W)
854#define G_BCM1480_MC_tW2W(x) _SB_GETVALUE(x, S_BCM1480_MC_tW2W, M_BCM1480_MC_tW2W)
855#define K_BCM1480_MC_tW2W_DEFAULT 0
856#define V_BCM1480_MC_tW2W_DEFAULT V_BCM1480_MC_tW2W(K_BCM1480_MC_tW2W_DEFAULT)
857
858#define S_BCM1480_MC_tRAP 12
859#define M_BCM1480_MC_tRAP _SB_MAKEMASK(4, S_BCM1480_MC_tRAP)
860#define V_BCM1480_MC_tRAP(x) _SB_MAKEVALUE(x, S_BCM1480_MC_tRAP)
861#define G_BCM1480_MC_tRAP(x) _SB_GETVALUE(x, S_BCM1480_MC_tRAP, M_BCM1480_MC_tRAP)
862#define K_BCM1480_MC_tRAP_DEFAULT 0
863#define V_BCM1480_MC_tRAP_DEFAULT V_BCM1480_MC_tRAP(K_BCM1480_MC_tRAP_DEFAULT)
864
865#endif
866
867
868
869/*
870 * Global Registers: single instances per BCM1480
871 */
872
873/*
874 * Global Configuration Register (Table 99)
875 */
876
877#define S_BCM1480_MC_BLK_SET_MARK 8
878#define M_BCM1480_MC_BLK_SET_MARK _SB_MAKEMASK(4, S_BCM1480_MC_BLK_SET_MARK)
879#define V_BCM1480_MC_BLK_SET_MARK(x) _SB_MAKEVALUE(x, S_BCM1480_MC_BLK_SET_MARK)
880#define G_BCM1480_MC_BLK_SET_MARK(x) _SB_GETVALUE(x, S_BCM1480_MC_BLK_SET_MARK, M_BCM1480_MC_BLK_SET_MARK)
881
882#define S_BCM1480_MC_BLK_CLR_MARK 12
883#define M_BCM1480_MC_BLK_CLR_MARK _SB_MAKEMASK(4, S_BCM1480_MC_BLK_CLR_MARK)
884#define V_BCM1480_MC_BLK_CLR_MARK(x) _SB_MAKEVALUE(x, S_BCM1480_MC_BLK_CLR_MARK)
885#define G_BCM1480_MC_BLK_CLR_MARK(x) _SB_GETVALUE(x, S_BCM1480_MC_BLK_CLR_MARK, M_BCM1480_MC_BLK_CLR_MARK)
886
887#define M_BCM1480_MC_PKT_PRIORITY _SB_MAKEMASK1(16)
888
889#define S_BCM1480_MC_MAX_AGE 20
890#define M_BCM1480_MC_MAX_AGE _SB_MAKEMASK(4, S_BCM1480_MC_MAX_AGE)
891#define V_BCM1480_MC_MAX_AGE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_MAX_AGE)
892#define G_BCM1480_MC_MAX_AGE(x) _SB_GETVALUE(x, S_BCM1480_MC_MAX_AGE, M_BCM1480_MC_MAX_AGE)
893
894#define M_BCM1480_MC_BERR_DISABLE _SB_MAKEMASK1(29)
895#define M_BCM1480_MC_FORCE_SEQ _SB_MAKEMASK1(30)
896#define M_BCM1480_MC_VGEN _SB_MAKEMASK1(32)
897
898#define S_BCM1480_MC_SLEW 33
899#define M_BCM1480_MC_SLEW _SB_MAKEMASK(2, S_BCM1480_MC_SLEW)
900#define V_BCM1480_MC_SLEW(x) _SB_MAKEVALUE(x, S_BCM1480_MC_SLEW)
901#define G_BCM1480_MC_SLEW(x) _SB_GETVALUE(x, S_BCM1480_MC_SLEW, M_BCM1480_MC_SLEW)
902
903#define M_BCM1480_MC_SSTL_VOLTAGE _SB_MAKEMASK1(35)
904
905/*
906 * Global Channel Interleave Register (Table 100)
907 */
908
909#define S_BCM1480_MC_INTLV0 0
910#define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV0)
911#define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV0)
912#define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV0, M_BCM1480_MC_INTLV0)
913
914#define S_BCM1480_MC_INTLV1 8
915#define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6, S_BCM1480_MC_INTLV1)
916#define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV1)
917#define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV1, M_BCM1480_MC_INTLV1)
918
919#define S_BCM1480_MC_INTLV_MODE 16
920#define M_BCM1480_MC_INTLV_MODE _SB_MAKEMASK(3, S_BCM1480_MC_INTLV_MODE)
921#define V_BCM1480_MC_INTLV_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_MC_INTLV_MODE)
922#define G_BCM1480_MC_INTLV_MODE(x) _SB_GETVALUE(x, S_BCM1480_MC_INTLV_MODE, M_BCM1480_MC_INTLV_MODE)
923
924#define K_BCM1480_MC_INTLV_MODE_NONE 0x0
925#define K_BCM1480_MC_INTLV_MODE_01 0x1
926#define K_BCM1480_MC_INTLV_MODE_23 0x2
927#define K_BCM1480_MC_INTLV_MODE_01_23 0x3
928#define K_BCM1480_MC_INTLV_MODE_0123 0x4
929
930#define V_BCM1480_MC_INTLV_MODE_NONE V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_NONE)
931#define V_BCM1480_MC_INTLV_MODE_01 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01)
932#define V_BCM1480_MC_INTLV_MODE_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_23)
933#define V_BCM1480_MC_INTLV_MODE_01_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01_23)
934#define V_BCM1480_MC_INTLV_MODE_0123 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_0123)
935
936/*
937 * ECC Status Register
938 */
939
940#define S_BCM1480_MC_ECC_ERR_ADDR 0
941#define M_BCM1480_MC_ECC_ERR_ADDR _SB_MAKEMASK(37, S_BCM1480_MC_ECC_ERR_ADDR)
942#define V_BCM1480_MC_ECC_ERR_ADDR(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ECC_ERR_ADDR)
943#define G_BCM1480_MC_ECC_ERR_ADDR(x) _SB_GETVALUE(x, S_BCM1480_MC_ECC_ERR_ADDR, M_BCM1480_MC_ECC_ERR_ADDR)
944
945#if SIBYTE_HDR_FEATURE(1480, PASS2)
946#define M_BCM1480_MC_ECC_ERR_RMW _SB_MAKEMASK1(60)
947#endif
948
949#define M_BCM1480_MC_ECC_MULT_ERR_DET _SB_MAKEMASK1(61)
950#define M_BCM1480_MC_ECC_UERR_DET _SB_MAKEMASK1(62)
951#define M_BCM1480_MC_ECC_CERR_DET _SB_MAKEMASK1(63)
952
953/*
954 * Global ECC Address Register (Table 102)
955 */
956
957#define S_BCM1480_MC_ECC_CORR_ADDR 0
958#define M_BCM1480_MC_ECC_CORR_ADDR _SB_MAKEMASK(37, S_BCM1480_MC_ECC_CORR_ADDR)
959#define V_BCM1480_MC_ECC_CORR_ADDR(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ECC_CORR_ADDR)
960#define G_BCM1480_MC_ECC_CORR_ADDR(x) _SB_GETVALUE(x, S_BCM1480_MC_ECC_CORR_ADDR, M_BCM1480_MC_ECC_CORR_ADDR)
961
962/*
963 * Global ECC Correction Register (Table 103)
964 */
965
966#define S_BCM1480_MC_ECC_CORRECT 0
967#define M_BCM1480_MC_ECC_CORRECT _SB_MAKEMASK(64, S_BCM1480_MC_ECC_CORRECT)
968#define V_BCM1480_MC_ECC_CORRECT(x) _SB_MAKEVALUE(x, S_BCM1480_MC_ECC_CORRECT)
969#define G_BCM1480_MC_ECC_CORRECT(x) _SB_GETVALUE(x, S_BCM1480_MC_ECC_CORRECT, M_BCM1480_MC_ECC_CORRECT)
970
971/*
972 * Global ECC Performance Counters Control Register (Table 104)
973 */
974
975#define S_BCM1480_MC_CHANNEL_SELECT 0
976#define M_BCM1480_MC_CHANNEL_SELECT _SB_MAKEMASK(4, S_BCM1480_MC_CHANNEL_SELECT)
977#define V_BCM1480_MC_CHANNEL_SELECT(x) _SB_MAKEVALUE(x, S_BCM1480_MC_CHANNEL_SELECT)
978#define G_BCM1480_MC_CHANNEL_SELECT(x) _SB_GETVALUE(x, S_BCM1480_MC_CHANNEL_SELECT, M_BCM1480_MC_CHANNEL_SELECT)
979#define K_BCM1480_MC_CHANNEL_SELECT_0 0x1
980#define K_BCM1480_MC_CHANNEL_SELECT_1 0x2
981#define K_BCM1480_MC_CHANNEL_SELECT_2 0x4
982#define K_BCM1480_MC_CHANNEL_SELECT_3 0x8
983
984#endif /* _BCM1480_MC_H */
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
deleted file mode 100644
index b4077bb72611..000000000000
--- a/include/asm-mips/sibyte/bcm1480_regs.h
+++ /dev/null
@@ -1,902 +0,0 @@
1/* *********************************************************************
2 * BCM1255/BCM1280/BCM1455/BCM1480 Board Support Package
3 *
4 * Register Definitions File: bcm1480_regs.h
5 *
6 * This module contains the addresses of the on-chip peripherals
7 * on the BCM1280 and BCM1480.
8 *
9 * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32#ifndef _BCM1480_REGS_H
33#define _BCM1480_REGS_H
34
35#include "sb1250_defs.h"
36
37/* *********************************************************************
38 * Pull in the BCM1250's registers since a great deal of the 1480's
39 * functions are the same as the BCM1250.
40 ********************************************************************* */
41
42#include "sb1250_regs.h"
43
44
45/* *********************************************************************
46 * Some general notes:
47 *
48 * Register addresses are grouped by function and follow the order
49 * of the User Manual.
50 *
51 * For the most part, when there is more than one peripheral
52 * of the same type on the SOC, the constants below will be
53 * offsets from the base of each peripheral. For example,
54 * the MAC registers are described as offsets from the first
55 * MAC register, and there will be a MAC_REGISTER() macro
56 * to calculate the base address of a given MAC.
57 *
58 * The information in this file is based on the BCM1X55/BCM1X80
59 * User Manual, Document 1X55_1X80-UM100-R, 22/12/03.
60 *
61 * This file is basically a "what's new" header file. Since the
62 * BCM1250 and the new BCM1480 (and derivatives) share many common
63 * features, this file contains only what's new or changed from
64 * the 1250. (above, you can see that we include the 1250 symbols
65 * to get the base functionality).
66 *
67 * In software, be sure to use the correct symbols, particularly
68 * for blocks that are different between the two chip families.
69 * All BCM1480-specific symbols have _BCM1480_ in their names,
70 * and all BCM1250-specific and "base" functions that are common in
71 * both chips have no special names (this is for compatibility with
72 * older include files). Therefore, if you're working with the
73 * SCD, which is very different on each chip, A_SCD_xxx implies
74 * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480
75 * version.
76 ********************************************************************* */
77
78
79/* *********************************************************************
80 * Memory Controller Registers (Section 6)
81 ********************************************************************* */
82
83#define A_BCM1480_MC_BASE_0 0x0010050000
84#define A_BCM1480_MC_BASE_1 0x0010051000
85#define A_BCM1480_MC_BASE_2 0x0010052000
86#define A_BCM1480_MC_BASE_3 0x0010053000
87#define BCM1480_MC_REGISTER_SPACING 0x1000
88
89#define A_BCM1480_MC_BASE(ctlid) (A_BCM1480_MC_BASE_0+(ctlid)*BCM1480_MC_REGISTER_SPACING)
90#define A_BCM1480_MC_REGISTER(ctlid, reg) (A_BCM1480_MC_BASE(ctlid)+(reg))
91
92#define R_BCM1480_MC_CONFIG 0x0000000100
93#define R_BCM1480_MC_CS_START 0x0000000120
94#define R_BCM1480_MC_CS_END 0x0000000140
95#define S_BCM1480_MC_CS_STARTEND 24
96
97#define R_BCM1480_MC_CS01_ROW0 0x0000000180
98#define R_BCM1480_MC_CS01_ROW1 0x00000001A0
99#define R_BCM1480_MC_CS23_ROW0 0x0000000200
100#define R_BCM1480_MC_CS23_ROW1 0x0000000220
101#define R_BCM1480_MC_CS01_COL0 0x0000000280
102#define R_BCM1480_MC_CS01_COL1 0x00000002A0
103#define R_BCM1480_MC_CS23_COL0 0x0000000300
104#define R_BCM1480_MC_CS23_COL1 0x0000000320
105
106#define R_BCM1480_MC_CSX_BASE 0x0000000180
107#define R_BCM1480_MC_CSX_ROW0 0x0000000000 /* relative to CSX_BASE */
108#define R_BCM1480_MC_CSX_ROW1 0x0000000020 /* relative to CSX_BASE */
109#define R_BCM1480_MC_CSX_COL0 0x0000000100 /* relative to CSX_BASE */
110#define R_BCM1480_MC_CSX_COL1 0x0000000120 /* relative to CSX_BASE */
111#define BCM1480_MC_CSX_SPACING 0x0000000080 /* CS23 relative to CS01 */
112
113#define R_BCM1480_MC_CS01_BA 0x0000000380
114#define R_BCM1480_MC_CS23_BA 0x00000003A0
115#define R_BCM1480_MC_DRAMCMD 0x0000000400
116#define R_BCM1480_MC_DRAMMODE 0x0000000420
117#define R_BCM1480_MC_CLOCK_CFG 0x0000000440
118#define R_BCM1480_MC_MCLK_CFG R_BCM1480_MC_CLOCK_CFG
119#define R_BCM1480_MC_TEST_DATA 0x0000000480
120#define R_BCM1480_MC_TEST_ECC 0x00000004A0
121#define R_BCM1480_MC_TIMING1 0x00000004C0
122#define R_BCM1480_MC_TIMING2 0x00000004E0
123#define R_BCM1480_MC_DLL_CFG 0x0000000500
124#define R_BCM1480_MC_DRIVE_CFG 0x0000000520
125
126#if SIBYTE_HDR_FEATURE(1480, PASS2)
127#define R_BCM1480_MC_ODT 0x0000000460
128#define R_BCM1480_MC_ECC_STATUS 0x0000000540
129#endif
130
131/* Global registers (single instance) */
132#define A_BCM1480_MC_GLB_CONFIG 0x0010054100
133#define A_BCM1480_MC_GLB_INTLV 0x0010054120
134#define A_BCM1480_MC_GLB_ECC_STATUS 0x0010054140
135#define A_BCM1480_MC_GLB_ECC_ADDR 0x0010054160
136#define A_BCM1480_MC_GLB_ECC_CORRECT 0x0010054180
137#define A_BCM1480_MC_GLB_PERF_CNT_CONTROL 0x00100541A0
138
139/* *********************************************************************
140 * L2 Cache Control Registers (Section 5)
141 ********************************************************************* */
142
143#define A_BCM1480_L2_BASE 0x0010040000
144
145#define A_BCM1480_L2_READ_TAG 0x0010040018
146#define A_BCM1480_L2_ECC_TAG 0x0010040038
147#define A_BCM1480_L2_MISC0_VALUE 0x0010040058
148#define A_BCM1480_L2_MISC1_VALUE 0x0010040078
149#define A_BCM1480_L2_MISC2_VALUE 0x0010040098
150#define A_BCM1480_L2_MISC_CONFIG 0x0010040040 /* x040 */
151#define A_BCM1480_L2_CACHE_DISABLE 0x0010040060 /* x060 */
152#define A_BCM1480_L2_MAKECACHEDISABLE(x) (A_BCM1480_L2_CACHE_DISABLE | (((x)&0xF) << 12))
153#define A_BCM1480_L2_WAY_ENABLE_3_0 0x0010040080 /* x080 */
154#define A_BCM1480_L2_WAY_ENABLE_7_4 0x00100400A0 /* x0A0 */
155#define A_BCM1480_L2_MAKE_WAY_ENABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((x)&0xF) << 12))
156#define A_BCM1480_L2_MAKE_WAY_ENABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((x)&0xF) << 12))
157#define A_BCM1480_L2_MAKE_WAY_DISABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((~x)&0xF) << 12))
158#define A_BCM1480_L2_MAKE_WAY_DISABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((~x)&0xF) << 12))
159#define A_BCM1480_L2_WAY_LOCAL_3_0 0x0010040100 /* x100 */
160#define A_BCM1480_L2_WAY_LOCAL_7_4 0x0010040120 /* x120 */
161#define A_BCM1480_L2_WAY_REMOTE_3_0 0x0010040140 /* x140 */
162#define A_BCM1480_L2_WAY_REMOTE_7_4 0x0010040160 /* x160 */
163#define A_BCM1480_L2_WAY_AGENT_3_0 0x00100400C0 /* xxC0 */
164#define A_BCM1480_L2_WAY_AGENT_7_4 0x00100400E0 /* xxE0 */
165#define A_BCM1480_L2_WAY_ENABLE(A, banks) (A | (((~(banks))&0x0F) << 8))
166#define A_BCM1480_L2_BANK_BASE 0x00D0300000
167#define A_BCM1480_L2_BANK_ADDRESS(b) (A_BCM1480_L2_BANK_BASE | (((b)&0x7)<<17))
168#define A_BCM1480_L2_MGMT_TAG_BASE 0x00D0000000
169
170
171/* *********************************************************************
172 * PCI-X Interface Registers (Section 7)
173 ********************************************************************* */
174
175#define A_BCM1480_PCI_BASE 0x0010061400
176
177#define A_BCM1480_PCI_RESET 0x0010061400
178#define A_BCM1480_PCI_DLL 0x0010061500
179
180#define A_BCM1480_PCI_TYPE00_HEADER 0x002E000000
181
182/* *********************************************************************
183 * Ethernet MAC Registers (Section 11) and DMA Registers (Section 10.6)
184 ********************************************************************* */
185
186/* No register changes with Rev.C BCM1250, but one additional MAC */
187
188#define A_BCM1480_MAC_BASE_2 0x0010066000
189
190#ifndef A_MAC_BASE_2
191#define A_MAC_BASE_2 A_BCM1480_MAC_BASE_2
192#endif
193
194#define A_BCM1480_MAC_BASE_3 0x0010067000
195#define A_MAC_BASE_3 A_BCM1480_MAC_BASE_3
196
197#define R_BCM1480_MAC_DMA_OODPKTLOST 0x00000038
198
199#ifndef R_MAC_DMA_OODPKTLOST
200#define R_MAC_DMA_OODPKTLOST R_BCM1480_MAC_DMA_OODPKTLOST
201#endif
202
203
204/* *********************************************************************
205 * DUART Registers (Section 14)
206 ********************************************************************* */
207
208/* No significant differences from BCM1250, two DUARTs */
209
210/* Conventions, per user manual:
211 * DUART generic, channels A,B,C,D
212 * DUART0 implementing channels A,B
213 * DUART1 inplementing channels C,D
214 */
215
216#define BCM1480_DUART_NUM_PORTS 4
217
218#define A_BCM1480_DUART0 0x0010060000
219#define A_BCM1480_DUART1 0x0010060400
220#define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1)
221
222#define BCM1480_DUART_CHANREG_SPACING 0x100
223#define A_BCM1480_DUART_CHANREG(chan, reg) \
224 (A_BCM1480_DUART(chan) + \
225 BCM1480_DUART_CHANREG_SPACING * (((chan) & 1) + 1) + (reg))
226#define A_BCM1480_DUART_CTRLREG(chan, reg) \
227 (A_BCM1480_DUART(chan) + \
228 BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
229
230#define DUART_IMRISR_SPACING 0x20
231#define DUART_INCHNG_SPACING 0x10
232
233#define R_BCM1480_DUART_IMRREG(chan) \
234 (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
235#define R_BCM1480_DUART_ISRREG(chan) \
236 (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
237#define R_BCM1480_DUART_INCHREG(chan) \
238 (R_DUART_IN_CHNG_A + ((chan) & 1) * DUART_INCHNG_SPACING)
239
240#define A_BCM1480_DUART_IMRREG(chan) \
241 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan)))
242#define A_BCM1480_DUART_ISRREG(chan) \
243 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_ISRREG(chan)))
244
245#define A_BCM1480_DUART_IN_PORT(chan) \
246 (A_BCM1480_DUART_CTRLREG((chan), R_DUART_IN_PORT))
247
248/*
249 * These constants are the absolute addresses.
250 */
251
252#define A_BCM1480_DUART_MODE_REG_1_C 0x0010060400
253#define A_BCM1480_DUART_MODE_REG_2_C 0x0010060410
254#define A_BCM1480_DUART_STATUS_C 0x0010060420
255#define A_BCM1480_DUART_CLK_SEL_C 0x0010060430
256#define A_BCM1480_DUART_FULL_CTL_C 0x0010060440
257#define A_BCM1480_DUART_CMD_C 0x0010060450
258#define A_BCM1480_DUART_RX_HOLD_C 0x0010060460
259#define A_BCM1480_DUART_TX_HOLD_C 0x0010060470
260#define A_BCM1480_DUART_OPCR_C 0x0010060480
261#define A_BCM1480_DUART_AUX_CTRL_C 0x0010060490
262
263#define A_BCM1480_DUART_MODE_REG_1_D 0x0010060500
264#define A_BCM1480_DUART_MODE_REG_2_D 0x0010060510
265#define A_BCM1480_DUART_STATUS_D 0x0010060520
266#define A_BCM1480_DUART_CLK_SEL_D 0x0010060530
267#define A_BCM1480_DUART_FULL_CTL_D 0x0010060540
268#define A_BCM1480_DUART_CMD_D 0x0010060550
269#define A_BCM1480_DUART_RX_HOLD_D 0x0010060560
270#define A_BCM1480_DUART_TX_HOLD_D 0x0010060570
271#define A_BCM1480_DUART_OPCR_D 0x0010060580
272#define A_BCM1480_DUART_AUX_CTRL_D 0x0010060590
273
274#define A_BCM1480_DUART_INPORT_CHNG_CD 0x0010060600
275#define A_BCM1480_DUART_AUX_CTRL_CD 0x0010060610
276#define A_BCM1480_DUART_ISR_C 0x0010060620
277#define A_BCM1480_DUART_IMR_C 0x0010060630
278#define A_BCM1480_DUART_ISR_D 0x0010060640
279#define A_BCM1480_DUART_IMR_D 0x0010060650
280#define A_BCM1480_DUART_OUT_PORT_CD 0x0010060660
281#define A_BCM1480_DUART_OPCR_CD 0x0010060670
282#define A_BCM1480_DUART_IN_PORT_CD 0x0010060680
283#define A_BCM1480_DUART_ISR_CD 0x0010060690
284#define A_BCM1480_DUART_IMR_CD 0x00100606A0
285#define A_BCM1480_DUART_SET_OPR_CD 0x00100606B0
286#define A_BCM1480_DUART_CLEAR_OPR_CD 0x00100606C0
287#define A_BCM1480_DUART_INPORT_CHNG_C 0x00100606D0
288#define A_BCM1480_DUART_INPORT_CHNG_D 0x00100606E0
289
290
291/* *********************************************************************
292 * Generic Bus Registers (Section 15) and PCMCIA Registers (Section 16)
293 ********************************************************************* */
294
295#define A_BCM1480_IO_PCMCIA_CFG_B 0x0010061A58
296#define A_BCM1480_IO_PCMCIA_STATUS_B 0x0010061A68
297
298/* *********************************************************************
299 * GPIO Registers (Section 17)
300 ********************************************************************* */
301
302/* One additional GPIO register, placed _before_ the BCM1250's GPIO block base */
303
304#define A_BCM1480_GPIO_INT_ADD_TYPE 0x0010061A78
305#define R_BCM1480_GPIO_INT_ADD_TYPE (-8)
306
307#define A_GPIO_INT_ADD_TYPE A_BCM1480_GPIO_INT_ADD_TYPE
308#define R_GPIO_INT_ADD_TYPE R_BCM1480_GPIO_INT_ADD_TYPE
309
310/* *********************************************************************
311 * SMBus Registers (Section 18)
312 ********************************************************************* */
313
314/* No changes from BCM1250 */
315
316/* *********************************************************************
317 * Timer Registers (Sections 4.6)
318 ********************************************************************* */
319
320/* BCM1480 has two additional watchdogs */
321
322/* Watchdog timers */
323
324#define A_BCM1480_SCD_WDOG_2 0x0010022050
325#define A_BCM1480_SCD_WDOG_3 0x0010022150
326
327#define BCM1480_SCD_NUM_WDOGS 4
328
329#define A_BCM1480_SCD_WDOG_BASE(w) (A_BCM1480_SCD_WDOG_0+((w)&2)*0x1000 + ((w)&1)*0x100)
330#define A_BCM1480_SCD_WDOG_REGISTER(w, r) (A_BCM1480_SCD_WDOG_BASE(w) + (r))
331
332#define A_BCM1480_SCD_WDOG_INIT_2 0x0010022050
333#define A_BCM1480_SCD_WDOG_CNT_2 0x0010022058
334#define A_BCM1480_SCD_WDOG_CFG_2 0x0010022060
335
336#define A_BCM1480_SCD_WDOG_INIT_3 0x0010022150
337#define A_BCM1480_SCD_WDOG_CNT_3 0x0010022158
338#define A_BCM1480_SCD_WDOG_CFG_3 0x0010022160
339
340/* BCM1480 has two additional compare registers */
341
342#define A_BCM1480_SCD_ZBBUS_CYCLE_COUNT A_SCD_ZBBUS_CYCLE_COUNT
343#define A_BCM1480_SCD_ZBBUS_CYCLE_CP_BASE 0x0010020C00
344#define A_BCM1480_SCD_ZBBUS_CYCLE_CP0 A_SCD_ZBBUS_CYCLE_CP0
345#define A_BCM1480_SCD_ZBBUS_CYCLE_CP1 A_SCD_ZBBUS_CYCLE_CP1
346#define A_BCM1480_SCD_ZBBUS_CYCLE_CP2 0x0010020C10
347#define A_BCM1480_SCD_ZBBUS_CYCLE_CP3 0x0010020C18
348
349/* *********************************************************************
350 * System Control Registers (Section 4.2)
351 ********************************************************************* */
352
353/* Scratch register in different place */
354
355#define A_BCM1480_SCD_SCRATCH 0x100200A0
356
357/* *********************************************************************
358 * System Address Trap Registers (Section 4.9)
359 ********************************************************************* */
360
361/* No changes from BCM1250 */
362
363/* *********************************************************************
364 * System Interrupt Mapper Registers (Sections 4.3-4.5)
365 ********************************************************************* */
366
367#define A_BCM1480_IMR_CPU0_BASE 0x0010020000
368#define A_BCM1480_IMR_CPU1_BASE 0x0010022000
369#define A_BCM1480_IMR_CPU2_BASE 0x0010024000
370#define A_BCM1480_IMR_CPU3_BASE 0x0010026000
371#define BCM1480_IMR_REGISTER_SPACING 0x2000
372#define BCM1480_IMR_REGISTER_SPACING_SHIFT 13
373
374#define A_BCM1480_IMR_MAPPER(cpu) (A_BCM1480_IMR_CPU0_BASE+(cpu)*BCM1480_IMR_REGISTER_SPACING)
375#define A_BCM1480_IMR_REGISTER(cpu, reg) (A_BCM1480_IMR_MAPPER(cpu)+(reg))
376
377/* Most IMR registers are 128 bits, implemented as non-contiguous
378 64-bit registers high (_H) and low (_L) */
379#define BCM1480_IMR_HL_SPACING 0x1000
380
381#define R_BCM1480_IMR_INTERRUPT_DIAG_H 0x0010
382#define R_BCM1480_IMR_LDT_INTERRUPT_H 0x0018
383#define R_BCM1480_IMR_LDT_INTERRUPT_CLR_H 0x0020
384#define R_BCM1480_IMR_INTERRUPT_MASK_H 0x0028
385#define R_BCM1480_IMR_INTERRUPT_TRACE_H 0x0038
386#define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_H 0x0040
387#define R_BCM1480_IMR_LDT_INTERRUPT_SET 0x0048
388#define R_BCM1480_IMR_MAILBOX_0_CPU 0x00C0
389#define R_BCM1480_IMR_MAILBOX_0_SET_CPU 0x00C8
390#define R_BCM1480_IMR_MAILBOX_0_CLR_CPU 0x00D0
391#define R_BCM1480_IMR_MAILBOX_1_CPU 0x00E0
392#define R_BCM1480_IMR_MAILBOX_1_SET_CPU 0x00E8
393#define R_BCM1480_IMR_MAILBOX_1_CLR_CPU 0x00F0
394#define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H 0x0100
395#define BCM1480_IMR_INTERRUPT_STATUS_COUNT 8
396#define R_BCM1480_IMR_INTERRUPT_MAP_BASE_H 0x0200
397#define BCM1480_IMR_INTERRUPT_MAP_COUNT 64
398
399#define R_BCM1480_IMR_INTERRUPT_DIAG_L 0x1010
400#define R_BCM1480_IMR_LDT_INTERRUPT_L 0x1018
401#define R_BCM1480_IMR_LDT_INTERRUPT_CLR_L 0x1020
402#define R_BCM1480_IMR_INTERRUPT_MASK_L 0x1028
403#define R_BCM1480_IMR_INTERRUPT_TRACE_L 0x1038
404#define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_L 0x1040
405#define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L 0x1100
406#define R_BCM1480_IMR_INTERRUPT_MAP_BASE_L 0x1200
407
408#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE 0x0010028000
409#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU1_BASE 0x0010028100
410#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU2_BASE 0x0010028200
411#define A_BCM1480_IMR_ALIAS_MAILBOX_CPU3_BASE 0x0010028300
412#define BCM1480_IMR_ALIAS_MAILBOX_SPACING 0100
413
414#define A_BCM1480_IMR_ALIAS_MAILBOX(cpu) (A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE + \
415 (cpu)*BCM1480_IMR_ALIAS_MAILBOX_SPACING)
416#define A_BCM1480_IMR_ALIAS_MAILBOX_REGISTER(cpu, reg) (A_BCM1480_IMR_ALIAS_MAILBOX(cpu)+(reg))
417
418#define R_BCM1480_IMR_ALIAS_MAILBOX_0 0x0000 /* 0x0x0 */
419#define R_BCM1480_IMR_ALIAS_MAILBOX_0_SET 0x0008 /* 0x0x8 */
420
421/*
422 * these macros work together to build the address of a mailbox
423 * register, e.g., A_BCM1480_MAILBOX_REGISTER(0,R_BCM1480_IMR_MAILBOX_SET,2)
424 * for mbox_0_set_cpu2 returns 0x00100240C8
425 */
426#define R_BCM1480_IMR_MAILBOX_CPU 0x00
427#define R_BCM1480_IMR_MAILBOX_SET 0x08
428#define R_BCM1480_IMR_MAILBOX_CLR 0x10
429#define R_BCM1480_IMR_MAILBOX_NUM_SPACING 0x20
430#define A_BCM1480_MAILBOX_REGISTER(num, reg, cpu) \
431 (A_BCM1480_IMR_CPU0_BASE + \
432 (num * R_BCM1480_IMR_MAILBOX_NUM_SPACING) + \
433 (cpu * BCM1480_IMR_REGISTER_SPACING) + \
434 (R_BCM1480_IMR_MAILBOX_0_CPU + reg))
435
436/* *********************************************************************
437 * System Performance Counter Registers (Section 4.7)
438 ********************************************************************* */
439
440/* BCM1480 has four more performance counter registers, and two control
441 registers. */
442
443#define A_BCM1480_SCD_PERF_CNT_BASE 0x00100204C0
444
445#define A_BCM1480_SCD_PERF_CNT_CFG0 0x00100204C0
446#define A_BCM1480_SCD_PERF_CNT_CFG_0 A_BCM1480_SCD_PERF_CNT_CFG0
447#define A_BCM1480_SCD_PERF_CNT_CFG1 0x00100204C8
448#define A_BCM1480_SCD_PERF_CNT_CFG_1 A_BCM1480_SCD_PERF_CNT_CFG1
449
450#define A_BCM1480_SCD_PERF_CNT_0 A_SCD_PERF_CNT_0
451#define A_BCM1480_SCD_PERF_CNT_1 A_SCD_PERF_CNT_1
452#define A_BCM1480_SCD_PERF_CNT_2 A_SCD_PERF_CNT_2
453#define A_BCM1480_SCD_PERF_CNT_3 A_SCD_PERF_CNT_3
454
455#define A_BCM1480_SCD_PERF_CNT_4 0x00100204F0
456#define A_BCM1480_SCD_PERF_CNT_5 0x00100204F8
457#define A_BCM1480_SCD_PERF_CNT_6 0x0010020500
458#define A_BCM1480_SCD_PERF_CNT_7 0x0010020508
459
460#define BCM1480_SCD_NUM_PERF_CNT 8
461#define BCM1480_SCD_PERF_CNT_SPACING 8
462#define A_BCM1480_SCD_PERF_CNT(n) (A_SCD_PERF_CNT_0+(n*BCM1480_SCD_PERF_CNT_SPACING))
463
464/* *********************************************************************
465 * System Bus Watcher Registers (Section 4.8)
466 ********************************************************************* */
467
468
469/* Same as 1250 except BUS_ERR_STATUS_DEBUG is in a different place. */
470
471#define A_BCM1480_BUS_ERR_STATUS_DEBUG 0x00100208D8
472
473/* *********************************************************************
474 * System Debug Controller Registers (Section 19)
475 ********************************************************************* */
476
477/* Same as 1250 */
478
479/* *********************************************************************
480 * System Trace Unit Registers (Sections 4.10)
481 ********************************************************************* */
482
483/* Same as 1250 */
484
485/* *********************************************************************
486 * Data Mover DMA Registers (Section 10.7)
487 ********************************************************************* */
488
489/* Same as 1250 */
490
491
492/* *********************************************************************
493 * HyperTransport Interface Registers (Section 8)
494 ********************************************************************* */
495
496#define BCM1480_HT_NUM_PORTS 3
497#define BCM1480_HT_PORT_SPACING 0x800
498#define A_BCM1480_HT_PORT_HEADER(x) (A_BCM1480_HT_PORT0_HEADER + ((x)*BCM1480_HT_PORT_SPACING))
499
500#define A_BCM1480_HT_PORT0_HEADER 0x00FE000000
501#define A_BCM1480_HT_PORT1_HEADER 0x00FE000800
502#define A_BCM1480_HT_PORT2_HEADER 0x00FE001000
503#define A_BCM1480_HT_TYPE00_HEADER 0x00FE002000
504
505
506/* *********************************************************************
507 * Node Controller Registers (Section 9)
508 ********************************************************************* */
509
510#define A_BCM1480_NC_BASE 0x00DFBD0000
511
512#define A_BCM1480_NC_RLD_FIELD 0x00DFBD0000
513#define A_BCM1480_NC_RLD_TRIGGER 0x00DFBD0020
514#define A_BCM1480_NC_RLD_BAD_ERROR 0x00DFBD0040
515#define A_BCM1480_NC_RLD_COR_ERROR 0x00DFBD0060
516#define A_BCM1480_NC_RLD_ECC_STATUS 0x00DFBD0080
517#define A_BCM1480_NC_RLD_WAY_ENABLE 0x00DFBD00A0
518#define A_BCM1480_NC_RLD_RANDOM_LFSR 0x00DFBD00C0
519
520#define A_BCM1480_NC_INTERRUPT_STATUS 0x00DFBD00E0
521#define A_BCM1480_NC_INTERRUPT_ENABLE 0x00DFBD0100
522#define A_BCM1480_NC_TIMEOUT_COUNTER 0x00DFBD0120
523#define A_BCM1480_NC_TIMEOUT_COUNTER_SEL 0x00DFBD0140
524
525#define A_BCM1480_NC_CREDIT_STATUS_REG0 0x00DFBD0200
526#define A_BCM1480_NC_CREDIT_STATUS_REG1 0x00DFBD0220
527#define A_BCM1480_NC_CREDIT_STATUS_REG2 0x00DFBD0240
528#define A_BCM1480_NC_CREDIT_STATUS_REG3 0x00DFBD0260
529#define A_BCM1480_NC_CREDIT_STATUS_REG4 0x00DFBD0280
530#define A_BCM1480_NC_CREDIT_STATUS_REG5 0x00DFBD02A0
531#define A_BCM1480_NC_CREDIT_STATUS_REG6 0x00DFBD02C0
532#define A_BCM1480_NC_CREDIT_STATUS_REG7 0x00DFBD02E0
533#define A_BCM1480_NC_CREDIT_STATUS_REG8 0x00DFBD0300
534#define A_BCM1480_NC_CREDIT_STATUS_REG9 0x00DFBD0320
535#define A_BCM1480_NC_CREDIT_STATUS_REG10 0x00DFBE0000
536#define A_BCM1480_NC_CREDIT_STATUS_REG11 0x00DFBE0020
537#define A_BCM1480_NC_CREDIT_STATUS_REG12 0x00DFBE0040
538
539#define A_BCM1480_NC_SR_TIMEOUT_COUNTER 0x00DFBE0060
540#define A_BCM1480_NC_SR_TIMEOUT_COUNTER_SEL 0x00DFBE0080
541
542
543/* *********************************************************************
544 * H&R Block Configuration Registers (Section 12.4)
545 ********************************************************************* */
546
547#define A_BCM1480_HR_BASE_0 0x00DF820000
548#define A_BCM1480_HR_BASE_1 0x00DF8A0000
549#define A_BCM1480_HR_BASE_2 0x00DF920000
550#define BCM1480_HR_REGISTER_SPACING 0x80000
551
552#define A_BCM1480_HR_BASE(idx) (A_BCM1480_HR_BASE_0 + ((idx)*BCM1480_HR_REGISTER_SPACING))
553#define A_BCM1480_HR_REGISTER(idx, reg) (A_BCM1480_HR_BASE(idx) + (reg))
554
555#define R_BCM1480_HR_CFG 0x0000000000
556
557#define R_BCM1480_HR_MAPPING 0x0000010010
558
559#define BCM1480_HR_RULE_SPACING 0x0000000010
560#define BCM1480_HR_NUM_RULES 16
561#define BCM1480_HR_OP_OFFSET 0x0000000100
562#define BCM1480_HR_TYPE_OFFSET 0x0000000108
563#define R_BCM1480_HR_RULE_OP(idx) (BCM1480_HR_OP_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING))
564#define R_BCM1480_HR_RULE_TYPE(idx) (BCM1480_HR_TYPE_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING))
565
566#define BCM1480_HR_LEAF_SPACING 0x0000000010
567#define BCM1480_HR_NUM_LEAVES 10
568#define BCM1480_HR_LEAF_OFFSET 0x0000000300
569#define R_BCM1480_HR_HA_LEAF0(idx) (BCM1480_HR_LEAF_OFFSET + ((idx)*BCM1480_HR_LEAF_SPACING))
570
571#define R_BCM1480_HR_EX_LEAF0 0x00000003A0
572
573#define BCM1480_HR_PATH_SPACING 0x0000000010
574#define BCM1480_HR_NUM_PATHS 16
575#define BCM1480_HR_PATH_OFFSET 0x0000000600
576#define R_BCM1480_HR_PATH(idx) (BCM1480_HR_PATH_OFFSET + ((idx)*BCM1480_HR_PATH_SPACING))
577
578#define R_BCM1480_HR_PATH_DEFAULT 0x0000000700
579
580#define BCM1480_HR_ROUTE_SPACING 8
581#define BCM1480_HR_NUM_ROUTES 512
582#define BCM1480_HR_ROUTE_OFFSET 0x0000001000
583#define R_BCM1480_HR_RT_WORD(idx) (BCM1480_HR_ROUTE_OFFSET + ((idx)*BCM1480_HR_ROUTE_SPACING))
584
585
586/* checked to here - ehs */
587/* *********************************************************************
588 * Packet Manager DMA Registers (Section 12.5)
589 ********************************************************************* */
590
591#define A_BCM1480_PM_BASE 0x0010056000
592
593#define A_BCM1480_PMI_LCL_0 0x0010058000
594#define A_BCM1480_PMO_LCL_0 0x001005C000
595#define A_BCM1480_PMI_OFFSET_0 (A_BCM1480_PMI_LCL_0 - A_BCM1480_PM_BASE)
596#define A_BCM1480_PMO_OFFSET_0 (A_BCM1480_PMO_LCL_0 - A_BCM1480_PM_BASE)
597
598#define BCM1480_PM_LCL_REGISTER_SPACING 0x100
599#define BCM1480_PM_NUM_CHANNELS 32
600
601#define A_BCM1480_PMI_LCL_BASE(idx) (A_BCM1480_PMI_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING))
602#define A_BCM1480_PMI_LCL_REGISTER(idx, reg) (A_BCM1480_PMI_LCL_BASE(idx) + (reg))
603#define A_BCM1480_PMO_LCL_BASE(idx) (A_BCM1480_PMO_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING))
604#define A_BCM1480_PMO_LCL_REGISTER(idx, reg) (A_BCM1480_PMO_LCL_BASE(idx) + (reg))
605
606#define BCM1480_PM_INT_PACKING 8
607#define BCM1480_PM_INT_FUNCTION_SPACING 0x40
608#define BCM1480_PM_INT_NUM_FUNCTIONS 3
609
610/*
611 * DMA channel registers relative to A_BCM1480_PMI_LCL_BASE(n) and A_BCM1480_PMO_LCL_BASE(n)
612 */
613
614#define R_BCM1480_PM_BASE_SIZE 0x0000000000
615#define R_BCM1480_PM_CNT 0x0000000008
616#define R_BCM1480_PM_PFCNT 0x0000000010
617#define R_BCM1480_PM_LAST 0x0000000018
618#define R_BCM1480_PM_PFINDX 0x0000000020
619#define R_BCM1480_PM_INT_WMK 0x0000000028
620#define R_BCM1480_PM_CONFIG0 0x0000000030
621#define R_BCM1480_PM_LOCALDEBUG 0x0000000078
622#define R_BCM1480_PM_CACHEABILITY 0x0000000080 /* PMI only */
623#define R_BCM1480_PM_INT_CNFG 0x0000000088
624#define R_BCM1480_PM_DESC_MERGE_TIMER 0x0000000090
625#define R_BCM1480_PM_LOCALDEBUG_PIB 0x00000000F8 /* PMI only */
626#define R_BCM1480_PM_LOCALDEBUG_POB 0x00000000F8 /* PMO only */
627
628/*
629 * Global Registers (Not Channelized)
630 */
631
632#define A_BCM1480_PMI_GLB_0 0x0010056000
633#define A_BCM1480_PMO_GLB_0 0x0010057000
634
635/*
636 * PM to TX Mapping Register relative to A_BCM1480_PMI_GLB_0 and A_BCM1480_PMO_GLB_0
637 */
638
639#define R_BCM1480_PM_PMO_MAPPING 0x00000008C8 /* PMO only */
640
641#define A_BCM1480_PM_PMO_MAPPING (A_BCM1480_PMO_GLB_0 + R_BCM1480_PM_PMO_MAPPING)
642
643/*
644 * Interrupt mapping registers
645 */
646
647
648#define A_BCM1480_PMI_INT_0 0x0010056800
649#define A_BCM1480_PMI_INT(q) (A_BCM1480_PMI_INT_0 + ((q>>8)<<8))
650#define A_BCM1480_PMI_INT_OFFSET_0 (A_BCM1480_PMI_INT_0 - A_BCM1480_PM_BASE)
651#define A_BCM1480_PMO_INT_0 0x0010057800
652#define A_BCM1480_PMO_INT(q) (A_BCM1480_PMO_INT_0 + ((q>>8)<<8))
653#define A_BCM1480_PMO_INT_OFFSET_0 (A_BCM1480_PMO_INT_0 - A_BCM1480_PM_BASE)
654
655/*
656 * Interrupt registers relative to A_BCM1480_PMI_INT_0 and A_BCM1480_PMO_INT_0
657 */
658
659#define R_BCM1480_PM_INT_ST 0x0000000000
660#define R_BCM1480_PM_INT_MSK 0x0000000040
661#define R_BCM1480_PM_INT_CLR 0x0000000080
662#define R_BCM1480_PM_MRGD_INT 0x00000000C0
663
664/*
665 * Debug registers (global)
666 */
667
668#define A_BCM1480_PM_GLOBALDEBUGMODE_PMI 0x0010056000
669#define A_BCM1480_PM_GLOBALDEBUG_PID 0x00100567F8
670#define A_BCM1480_PM_GLOBALDEBUG_PIB 0x0010056FF8
671#define A_BCM1480_PM_GLOBALDEBUGMODE_PMO 0x0010057000
672#define A_BCM1480_PM_GLOBALDEBUG_POD 0x00100577F8
673#define A_BCM1480_PM_GLOBALDEBUG_POB 0x0010057FF8
674
675/* *********************************************************************
676 * Switch performance counters
677 ********************************************************************* */
678
679#define A_BCM1480_SWPERF_CFG 0xdfb91800
680#define A_BCM1480_SWPERF_CNT0 0xdfb91880
681#define A_BCM1480_SWPERF_CNT1 0xdfb91888
682#define A_BCM1480_SWPERF_CNT2 0xdfb91890
683#define A_BCM1480_SWPERF_CNT3 0xdfb91898
684
685
686/* *********************************************************************
687 * Switch Trace Unit
688 ********************************************************************* */
689
690#define A_BCM1480_SWTRC_MATCH_CONTROL_0 0xDFB91000
691#define A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 0xDFB91100
692#define A_BCM1480_SWTRC_MATCH_DATA_MASK_0 0xDFB91108
693#define A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 0xDFB91200
694#define A_BCM1480_SWTRC_MATCH_TAG_MAKS_0 0xDFB91208
695#define A_BCM1480_SWTRC_EVENT_0 0xDFB91300
696#define A_BCM1480_SWTRC_SEQUENCE_0 0xDFB91400
697
698#define A_BCM1480_SWTRC_CFG 0xDFB91500
699#define A_BCM1480_SWTRC_READ 0xDFB91508
700
701#define A_BCM1480_SWDEBUG_SCHEDSTOP 0xDFB92000
702
703#define A_BCM1480_SWTRC_MATCH_CONTROL(x) (A_BCM1480_SWTRC_MATCH_CONTROL_0 + ((x)*8))
704#define A_BCM1480_SWTRC_EVENT(x) (A_BCM1480_SWTRC_EVENT_0 + ((x)*8))
705#define A_BCM1480_SWTRC_SEQUENCE(x) (A_BCM1480_SWTRC_SEQUENCE_0 + ((x)*8))
706
707#define A_BCM1480_SWTRC_MATCH_DATA_VALUE(x) (A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 + ((x)*16))
708#define A_BCM1480_SWTRC_MATCH_DATA_MASK(x) (A_BCM1480_SWTRC_MATCH_DATA_MASK_0 + ((x)*16))
709#define A_BCM1480_SWTRC_MATCH_TAG_VALUE(x) (A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 + ((x)*16))
710#define A_BCM1480_SWTRC_MATCH_TAG_MASK(x) (A_BCM1480_SWTRC_MATCH_TAG_MASK_0 + ((x)*16))
711
712
713
714/* *********************************************************************
715 * High-Speed Port Registers (Section 13)
716 ********************************************************************* */
717
718#define A_BCM1480_HSP_BASE_0 0x00DF810000
719#define A_BCM1480_HSP_BASE_1 0x00DF890000
720#define A_BCM1480_HSP_BASE_2 0x00DF910000
721#define BCM1480_HSP_REGISTER_SPACING 0x80000
722
723#define A_BCM1480_HSP_BASE(idx) (A_BCM1480_HSP_BASE_0 + ((idx)*BCM1480_HSP_REGISTER_SPACING))
724#define A_BCM1480_HSP_REGISTER(idx, reg) (A_BCM1480_HSP_BASE(idx) + (reg))
725
726#define R_BCM1480_HSP_RX_SPI4_CFG_0 0x0000000000
727#define R_BCM1480_HSP_RX_SPI4_CFG_1 0x0000000008
728#define R_BCM1480_HSP_RX_SPI4_DESKEW_OVERRIDE 0x0000000010
729#define R_BCM1480_HSP_RX_SPI4_DESKEW_DATAPATH 0x0000000018
730#define R_BCM1480_HSP_RX_SPI4_PORT_INT_EN 0x0000000020
731#define R_BCM1480_HSP_RX_SPI4_PORT_INT_STATUS 0x0000000028
732
733#define R_BCM1480_HSP_RX_SPI4_CALENDAR_0 0x0000000200
734#define R_BCM1480_HSP_RX_SPI4_CALENDAR_1 0x0000000208
735
736#define R_BCM1480_HSP_RX_PLL_CNFG 0x0000000800
737#define R_BCM1480_HSP_RX_CALIBRATION 0x0000000808
738#define R_BCM1480_HSP_RX_TEST 0x0000000810
739#define R_BCM1480_HSP_RX_DIAG_DETAILS 0x0000000818
740#define R_BCM1480_HSP_RX_DIAG_CRC_0 0x0000000820
741#define R_BCM1480_HSP_RX_DIAG_CRC_1 0x0000000828
742#define R_BCM1480_HSP_RX_DIAG_HTCMD 0x0000000830
743#define R_BCM1480_HSP_RX_DIAG_PKTCTL 0x0000000838
744
745#define R_BCM1480_HSP_RX_VIS_FLCTRL_COUNTER 0x0000000870
746
747#define R_BCM1480_HSP_RX_PKT_RAMALLOC_0 0x0000020020
748#define R_BCM1480_HSP_RX_PKT_RAMALLOC_1 0x0000020028
749#define R_BCM1480_HSP_RX_PKT_RAMALLOC_2 0x0000020030
750#define R_BCM1480_HSP_RX_PKT_RAMALLOC_3 0x0000020038
751#define R_BCM1480_HSP_RX_PKT_RAMALLOC_4 0x0000020040
752#define R_BCM1480_HSP_RX_PKT_RAMALLOC_5 0x0000020048
753#define R_BCM1480_HSP_RX_PKT_RAMALLOC_6 0x0000020050
754#define R_BCM1480_HSP_RX_PKT_RAMALLOC_7 0x0000020058
755#define R_BCM1480_HSP_RX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_RX_PKT_RAMALLOC_0 + 8*(idx))
756
757/* XXX Following registers were shuffled. Renamed/renumbered per errata. */
758#define R_BCM1480_HSP_RX_HT_RAMALLOC_0 0x0000020078
759#define R_BCM1480_HSP_RX_HT_RAMALLOC_1 0x0000020080
760#define R_BCM1480_HSP_RX_HT_RAMALLOC_2 0x0000020088
761#define R_BCM1480_HSP_RX_HT_RAMALLOC_3 0x0000020090
762#define R_BCM1480_HSP_RX_HT_RAMALLOC_4 0x0000020098
763#define R_BCM1480_HSP_RX_HT_RAMALLOC_5 0x00000200A0
764
765#define R_BCM1480_HSP_RX_SPI_WATERMARK_0 0x00000200B0
766#define R_BCM1480_HSP_RX_SPI_WATERMARK_1 0x00000200B8
767#define R_BCM1480_HSP_RX_SPI_WATERMARK_2 0x00000200C0
768#define R_BCM1480_HSP_RX_SPI_WATERMARK_3 0x00000200C8
769#define R_BCM1480_HSP_RX_SPI_WATERMARK_4 0x00000200D0
770#define R_BCM1480_HSP_RX_SPI_WATERMARK_5 0x00000200D8
771#define R_BCM1480_HSP_RX_SPI_WATERMARK_6 0x00000200E0
772#define R_BCM1480_HSP_RX_SPI_WATERMARK_7 0x00000200E8
773#define R_BCM1480_HSP_RX_SPI_WATERMARK(idx) (R_BCM1480_HSP_RX_SPI_WATERMARK_0 + 8*(idx))
774
775#define R_BCM1480_HSP_RX_VIS_CMDQ_0 0x00000200F0
776#define R_BCM1480_HSP_RX_VIS_CMDQ_1 0x00000200F8
777#define R_BCM1480_HSP_RX_VIS_CMDQ_2 0x0000020100
778#define R_BCM1480_HSP_RX_RAM_READCTL 0x0000020108
779#define R_BCM1480_HSP_RX_RAM_READWINDOW 0x0000020110
780#define R_BCM1480_HSP_RX_RF_READCTL 0x0000020118
781#define R_BCM1480_HSP_RX_RF_READWINDOW 0x0000020120
782
783#define R_BCM1480_HSP_TX_SPI4_CFG_0 0x0000040000
784#define R_BCM1480_HSP_TX_SPI4_CFG_1 0x0000040008
785#define R_BCM1480_HSP_TX_SPI4_TRAINING_FMT 0x0000040010
786
787#define R_BCM1480_HSP_TX_PKT_RAMALLOC_0 0x0000040020
788#define R_BCM1480_HSP_TX_PKT_RAMALLOC_1 0x0000040028
789#define R_BCM1480_HSP_TX_PKT_RAMALLOC_2 0x0000040030
790#define R_BCM1480_HSP_TX_PKT_RAMALLOC_3 0x0000040038
791#define R_BCM1480_HSP_TX_PKT_RAMALLOC_4 0x0000040040
792#define R_BCM1480_HSP_TX_PKT_RAMALLOC_5 0x0000040048
793#define R_BCM1480_HSP_TX_PKT_RAMALLOC_6 0x0000040050
794#define R_BCM1480_HSP_TX_PKT_RAMALLOC_7 0x0000040058
795#define R_BCM1480_HSP_TX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_TX_PKT_RAMALLOC_0 + 8*(idx))
796#define R_BCM1480_HSP_TX_NPC_RAMALLOC 0x0000040078
797#define R_BCM1480_HSP_TX_RSP_RAMALLOC 0x0000040080
798#define R_BCM1480_HSP_TX_PC_RAMALLOC 0x0000040088
799#define R_BCM1480_HSP_TX_HTCC_RAMALLOC_0 0x0000040090
800#define R_BCM1480_HSP_TX_HTCC_RAMALLOC_1 0x0000040098
801#define R_BCM1480_HSP_TX_HTCC_RAMALLOC_2 0x00000400A0
802
803#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 0x00000400B0
804#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_1 0x00000400B8
805#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_2 0x00000400C0
806#define R_BCM1480_HSP_TX_PKT_RXPHITCNT_3 0x00000400C8
807#define R_BCM1480_HSP_TX_PKT_RXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 + 8*(idx))
808#define R_BCM1480_HSP_TX_HTIO_RXPHITCNT 0x00000400D0
809#define R_BCM1480_HSP_TX_HTCC_RXPHITCNT 0x00000400D8
810
811#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 0x00000400E0
812#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_1 0x00000400E8
813#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_2 0x00000400F0
814#define R_BCM1480_HSP_TX_PKT_TXPHITCNT_3 0x00000400F8
815#define R_BCM1480_HSP_TX_PKT_TXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 + 8*(idx))
816#define R_BCM1480_HSP_TX_HTIO_TXPHITCNT 0x0000040100
817#define R_BCM1480_HSP_TX_HTCC_TXPHITCNT 0x0000040108
818
819#define R_BCM1480_HSP_TX_SPI4_CALENDAR_0 0x0000040200
820#define R_BCM1480_HSP_TX_SPI4_CALENDAR_1 0x0000040208
821
822#define R_BCM1480_HSP_TX_PLL_CNFG 0x0000040800
823#define R_BCM1480_HSP_TX_CALIBRATION 0x0000040808
824#define R_BCM1480_HSP_TX_TEST 0x0000040810
825
826#define R_BCM1480_HSP_TX_VIS_CMDQ_0 0x0000040840
827#define R_BCM1480_HSP_TX_VIS_CMDQ_1 0x0000040848
828#define R_BCM1480_HSP_TX_VIS_CMDQ_2 0x0000040850
829#define R_BCM1480_HSP_TX_RAM_READCTL 0x0000040860
830#define R_BCM1480_HSP_TX_RAM_READWINDOW 0x0000040868
831#define R_BCM1480_HSP_TX_RF_READCTL 0x0000040870
832#define R_BCM1480_HSP_TX_RF_READWINDOW 0x0000040878
833
834#define R_BCM1480_HSP_TX_SPI4_PORT_INT_STATUS 0x0000040880
835#define R_BCM1480_HSP_TX_SPI4_PORT_INT_EN 0x0000040888
836
837#define R_BCM1480_HSP_TX_NEXT_ADDR_BASE 0x000040400
838#define R_BCM1480_HSP_TX_NEXT_ADDR_REGISTER(x) (R_BCM1480_HSP_TX_NEXT_ADDR_BASE+ 8*(x))
839
840
841
842/* *********************************************************************
843 * Physical Address Map (Table 10 and Figure 7)
844 ********************************************************************* */
845
846#define A_BCM1480_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000)
847#define A_BCM1480_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024))
848#define A_BCM1480_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000)
849#define A_BCM1480_PHYS_IO_SYSTEM _SB_MAKE64(0x0010060000)
850#define A_BCM1480_PHYS_GENBUS _SB_MAKE64(0x0010090000)
851#define A_BCM1480_PHYS_GENBUS_END _SB_MAKE64(0x0028000000)
852#define A_BCM1480_PHYS_PCI_MISC_MATCH_BYTES _SB_MAKE64(0x0028000000)
853#define A_BCM1480_PHYS_PCI_IACK_MATCH_BYTES _SB_MAKE64(0x0029000000)
854#define A_BCM1480_PHYS_PCI_IO_MATCH_BYTES _SB_MAKE64(0x002C000000)
855#define A_BCM1480_PHYS_PCI_CFG_MATCH_BYTES _SB_MAKE64(0x002E000000)
856#define A_BCM1480_PHYS_PCI_OMAP_MATCH_BYTES _SB_MAKE64(0x002F000000)
857#define A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES _SB_MAKE64(0x0030000000)
858#define A_BCM1480_PHYS_HT_MEM_MATCH_BYTES _SB_MAKE64(0x0040000000)
859#define A_BCM1480_PHYS_HT_MEM_MATCH_BITS _SB_MAKE64(0x0060000000)
860#define A_BCM1480_PHYS_MEMORY_1 _SB_MAKE64(0x0080000000)
861#define A_BCM1480_PHYS_MEMORY_2 _SB_MAKE64(0x0090000000)
862#define A_BCM1480_PHYS_PCI_MISC_MATCH_BITS _SB_MAKE64(0x00A8000000)
863#define A_BCM1480_PHYS_PCI_IACK_MATCH_BITS _SB_MAKE64(0x00A9000000)
864#define A_BCM1480_PHYS_PCI_IO_MATCH_BITS _SB_MAKE64(0x00AC000000)
865#define A_BCM1480_PHYS_PCI_CFG_MATCH_BITS _SB_MAKE64(0x00AE000000)
866#define A_BCM1480_PHYS_PCI_OMAP_MATCH_BITS _SB_MAKE64(0x00AF000000)
867#define A_BCM1480_PHYS_PCI_MEM_MATCH_BITS _SB_MAKE64(0x00B0000000)
868#define A_BCM1480_PHYS_MEMORY_3 _SB_MAKE64(0x00C0000000)
869#define A_BCM1480_PHYS_L2_CACHE_TEST _SB_MAKE64(0x00D0000000)
870#define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES _SB_MAKE64(0x00D8000000)
871#define A_BCM1480_PHYS_HT_IO_MATCH_BYTES _SB_MAKE64(0x00DC000000)
872#define A_BCM1480_PHYS_HT_CFG_MATCH_BYTES _SB_MAKE64(0x00DE000000)
873#define A_BCM1480_PHYS_HS_SUBSYS _SB_MAKE64(0x00DF000000)
874#define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BITS _SB_MAKE64(0x00F8000000)
875#define A_BCM1480_PHYS_HT_IO_MATCH_BITS _SB_MAKE64(0x00FC000000)
876#define A_BCM1480_PHYS_HT_CFG_MATCH_BITS _SB_MAKE64(0x00FE000000)
877#define A_BCM1480_PHYS_MEMORY_EXP _SB_MAKE64(0x0100000000)
878#define A_BCM1480_PHYS_MEMORY_EXP_SIZE _SB_MAKE64((508*1024*1024*1024))
879#define A_BCM1480_PHYS_PCI_UPPER _SB_MAKE64(0x1000000000)
880#define A_BCM1480_PHYS_HT_UPPER_MATCH_BYTES _SB_MAKE64(0x2000000000)
881#define A_BCM1480_PHYS_HT_UPPER_MATCH_BITS _SB_MAKE64(0x3000000000)
882#define A_BCM1480_PHYS_HT_NODE_ALIAS _SB_MAKE64(0x4000000000)
883#define A_BCM1480_PHYS_HT_FULLACCESS _SB_MAKE64(0xF000000000)
884
885
886/* *********************************************************************
887 * L2 Cache as RAM (Table 54)
888 ********************************************************************* */
889
890#define A_BCM1480_PHYS_L2CACHE_WAY_SIZE _SB_MAKE64(0x0000020000)
891#define BCM1480_PHYS_L2CACHE_NUM_WAYS 8
892#define A_BCM1480_PHYS_L2CACHE_TOTAL_SIZE _SB_MAKE64(0x0000100000)
893#define A_BCM1480_PHYS_L2CACHE_WAY0 _SB_MAKE64(0x00D0300000)
894#define A_BCM1480_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D0320000)
895#define A_BCM1480_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D0340000)
896#define A_BCM1480_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D0360000)
897#define A_BCM1480_PHYS_L2CACHE_WAY4 _SB_MAKE64(0x00D0380000)
898#define A_BCM1480_PHYS_L2CACHE_WAY5 _SB_MAKE64(0x00D03A0000)
899#define A_BCM1480_PHYS_L2CACHE_WAY6 _SB_MAKE64(0x00D03C0000)
900#define A_BCM1480_PHYS_L2CACHE_WAY7 _SB_MAKE64(0x00D03E0000)
901
902#endif /* _BCM1480_REGS_H */
diff --git a/include/asm-mips/sibyte/bcm1480_scd.h b/include/asm-mips/sibyte/bcm1480_scd.h
deleted file mode 100644
index 25ef24cbb92a..000000000000
--- a/include/asm-mips/sibyte/bcm1480_scd.h
+++ /dev/null
@@ -1,406 +0,0 @@
1/* *********************************************************************
2 * BCM1280/BCM1400 Board Support Package
3 *
4 * SCD Constants and Macros File: bcm1480_scd.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the System Control and Debug module.
8 *
9 * BCM1400 specification level: 1X55_1X80-UM100-R (12/18/03)
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003,2004,2005
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32#ifndef _BCM1480_SCD_H
33#define _BCM1480_SCD_H
34
35#include "sb1250_defs.h"
36
37/* *********************************************************************
38 * Pull in the BCM1250's SCD since lots of stuff is the same.
39 ********************************************************************* */
40
41#include "sb1250_scd.h"
42
43/* *********************************************************************
44 * Some general notes:
45 *
46 * This file is basically a "what's new" header file. Since the
47 * BCM1250 and the new BCM1480 (and derivatives) share many common
48 * features, this file contains only what's new or changed from
49 * the 1250. (above, you can see that we include the 1250 symbols
50 * to get the base functionality).
51 *
52 * In software, be sure to use the correct symbols, particularly
53 * for blocks that are different between the two chip families.
54 * All BCM1480-specific symbols have _BCM1480_ in their names,
55 * and all BCM1250-specific and "base" functions that are common in
56 * both chips have no special names (this is for compatibility with
57 * older include files). Therefore, if you're working with the
58 * SCD, which is very different on each chip, A_SCD_xxx implies
59 * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480
60 * version.
61 ********************************************************************* */
62
63/* *********************************************************************
64 * System control/debug registers
65 ********************************************************************* */
66
67/*
68 * System Identification and Revision Register (Table 12)
69 * Register: SCD_SYSTEM_REVISION
70 * This register is field compatible with the 1250.
71 */
72
73/*
74 * New part definitions
75 */
76
77#define K_SYS_PART_BCM1480 0x1406
78#define K_SYS_PART_BCM1280 0x1206
79#define K_SYS_PART_BCM1455 0x1407
80#define K_SYS_PART_BCM1255 0x1257
81#define K_SYS_PART_BCM1158 0x1156
82
83/*
84 * Manufacturing Information Register (Table 14)
85 * Register: SCD_SYSTEM_MANUF
86 */
87
88/*
89 * System Configuration Register (Table 15)
90 * Register: SCD_SYSTEM_CFG
91 * Entire register is different from 1250, all new constants below
92 */
93
94#define M_BCM1480_SYS_RESERVED0 _SB_MAKEMASK1(0)
95#define M_BCM1480_SYS_HT_MINRSTCNT _SB_MAKEMASK1(1)
96#define M_BCM1480_SYS_RESERVED2 _SB_MAKEMASK1(2)
97#define M_BCM1480_SYS_RESERVED3 _SB_MAKEMASK1(3)
98#define M_BCM1480_SYS_RESERVED4 _SB_MAKEMASK1(4)
99#define M_BCM1480_SYS_IOB_DIV _SB_MAKEMASK1(5)
100
101#define S_BCM1480_SYS_PLL_DIV _SB_MAKE64(6)
102#define M_BCM1480_SYS_PLL_DIV _SB_MAKEMASK(5, S_BCM1480_SYS_PLL_DIV)
103#define V_BCM1480_SYS_PLL_DIV(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_PLL_DIV)
104#define G_BCM1480_SYS_PLL_DIV(x) _SB_GETVALUE(x, S_BCM1480_SYS_PLL_DIV, M_BCM1480_SYS_PLL_DIV)
105
106#define S_BCM1480_SYS_SW_DIV _SB_MAKE64(11)
107#define M_BCM1480_SYS_SW_DIV _SB_MAKEMASK(5, S_BCM1480_SYS_SW_DIV)
108#define V_BCM1480_SYS_SW_DIV(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_SW_DIV)
109#define G_BCM1480_SYS_SW_DIV(x) _SB_GETVALUE(x, S_BCM1480_SYS_SW_DIV, M_BCM1480_SYS_SW_DIV)
110
111#define M_BCM1480_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16)
112#define M_BCM1480_SYS_DUART1_ENABLE _SB_MAKEMASK1(17)
113
114#define S_BCM1480_SYS_BOOT_MODE _SB_MAKE64(18)
115#define M_BCM1480_SYS_BOOT_MODE _SB_MAKEMASK(2, S_BCM1480_SYS_BOOT_MODE)
116#define V_BCM1480_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_BOOT_MODE)
117#define G_BCM1480_SYS_BOOT_MODE(x) _SB_GETVALUE(x, S_BCM1480_SYS_BOOT_MODE, M_BCM1480_SYS_BOOT_MODE)
118#define K_BCM1480_SYS_BOOT_MODE_ROM32 0
119#define K_BCM1480_SYS_BOOT_MODE_ROM8 1
120#define K_BCM1480_SYS_BOOT_MODE_SMBUS_SMALL 2
121#define K_BCM1480_SYS_BOOT_MODE_SMBUS_BIG 3
122#define M_BCM1480_SYS_BOOT_MODE_SMBUS _SB_MAKEMASK1(19)
123
124#define M_BCM1480_SYS_PCI_HOST _SB_MAKEMASK1(20)
125#define M_BCM1480_SYS_PCI_ARBITER _SB_MAKEMASK1(21)
126#define M_BCM1480_SYS_BIG_ENDIAN _SB_MAKEMASK1(22)
127#define M_BCM1480_SYS_GENCLK_EN _SB_MAKEMASK1(23)
128#define M_BCM1480_SYS_GEN_PARITY_EN _SB_MAKEMASK1(24)
129#define M_BCM1480_SYS_RESERVED25 _SB_MAKEMASK1(25)
130
131#define S_BCM1480_SYS_CONFIG 26
132#define M_BCM1480_SYS_CONFIG _SB_MAKEMASK(6, S_BCM1480_SYS_CONFIG)
133#define V_BCM1480_SYS_CONFIG(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_CONFIG)
134#define G_BCM1480_SYS_CONFIG(x) _SB_GETVALUE(x, S_BCM1480_SYS_CONFIG, M_BCM1480_SYS_CONFIG)
135
136#define M_BCM1480_SYS_RESERVED32 _SB_MAKEMASK(32, 15)
137
138#define S_BCM1480_SYS_NODEID 47
139#define M_BCM1480_SYS_NODEID _SB_MAKEMASK(4, S_BCM1480_SYS_NODEID)
140#define V_BCM1480_SYS_NODEID(x) _SB_MAKEVALUE(x, S_BCM1480_SYS_NODEID)
141#define G_BCM1480_SYS_NODEID(x) _SB_GETVALUE(x, S_BCM1480_SYS_NODEID, M_BCM1480_SYS_NODEID)
142
143#define M_BCM1480_SYS_CCNUMA_EN _SB_MAKEMASK1(51)
144#define M_BCM1480_SYS_CPU_RESET_0 _SB_MAKEMASK1(52)
145#define M_BCM1480_SYS_CPU_RESET_1 _SB_MAKEMASK1(53)
146#define M_BCM1480_SYS_CPU_RESET_2 _SB_MAKEMASK1(54)
147#define M_BCM1480_SYS_CPU_RESET_3 _SB_MAKEMASK1(55)
148#define S_BCM1480_SYS_DISABLECPU0 56
149#define M_BCM1480_SYS_DISABLECPU0 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU0)
150#define S_BCM1480_SYS_DISABLECPU1 57
151#define M_BCM1480_SYS_DISABLECPU1 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU1)
152#define S_BCM1480_SYS_DISABLECPU2 58
153#define M_BCM1480_SYS_DISABLECPU2 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU2)
154#define S_BCM1480_SYS_DISABLECPU3 59
155#define M_BCM1480_SYS_DISABLECPU3 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU3)
156
157#define M_BCM1480_SYS_SB_SOFTRES _SB_MAKEMASK1(60)
158#define M_BCM1480_SYS_EXT_RESET _SB_MAKEMASK1(61)
159#define M_BCM1480_SYS_SYSTEM_RESET _SB_MAKEMASK1(62)
160#define M_BCM1480_SYS_SW_FLAG _SB_MAKEMASK1(63)
161
162/*
163 * Scratch Register (Table 16)
164 * Register: SCD_SYSTEM_SCRATCH
165 * Same as BCM1250
166 */
167
168
169/*
170 * Mailbox Registers (Table 17)
171 * Registers: SCD_MBOX_{0,1}_CPU_x
172 * Same as BCM1250
173 */
174
175
176/*
177 * See bcm1480_int.h for interrupt mapper registers.
178 */
179
180
181/*
182 * Watchdog Timer Initial Count Registers (Table 23)
183 * Registers: SCD_WDOG_INIT_CNT_x
184 *
185 * The watchdogs are almost the same as the 1250, except
186 * the configuration register has more bits to control the
187 * other CPUs.
188 */
189
190
191/*
192 * Watchdog Timer Configuration Registers (Table 25)
193 * Registers: SCD_WDOG_CFG_x
194 */
195
196#define M_BCM1480_SCD_WDOG_ENABLE _SB_MAKEMASK1(0)
197
198#define S_BCM1480_SCD_WDOG_RESET_TYPE 2
199#define M_BCM1480_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(5, S_BCM1480_SCD_WDOG_RESET_TYPE)
200#define V_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE)
201#define G_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x, S_BCM1480_SCD_WDOG_RESET_TYPE, M_BCM1480_SCD_WDOG_RESET_TYPE)
202
203#define K_BCM1480_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */
204#define K_BCM1480_SCD_WDOG_RESET_SOFT 1
205#define K_BCM1480_SCD_WDOG_RESET_CPU0 3
206#define K_BCM1480_SCD_WDOG_RESET_CPU1 5
207#define K_BCM1480_SCD_WDOG_RESET_CPU2 9
208#define K_BCM1480_SCD_WDOG_RESET_CPU3 17
209#define K_BCM1480_SCD_WDOG_RESET_ALL_CPUS 31
210
211
212#define M_BCM1480_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(8)
213
214/*
215 * General Timer Initial Count Registers (Table 26)
216 * Registers: SCD_TIMER_INIT_x
217 *
218 * The timer registers are the same as the BCM1250
219 */
220
221
222/*
223 * ZBbus Count Register (Table 29)
224 * Register: ZBBUS_CYCLE_COUNT
225 *
226 * Same as BCM1250
227 */
228
229/*
230 * ZBbus Compare Registers (Table 30)
231 * Registers: ZBBUS_CYCLE_CPx
232 *
233 * Same as BCM1250
234 */
235
236
237/*
238 * System Performance Counter Configuration Register (Table 31)
239 * Register: PERF_CNT_CFG_0
240 *
241 * SPC_CFG_SRC[0-3] is the same as the 1250.
242 * SPC_CFG_SRC[4-7] only exist on the 1480
243 * The clear/enable bits are in different locations on the 1250 and 1480.
244 */
245
246#define S_SPC_CFG_SRC4 32
247#define M_SPC_CFG_SRC4 _SB_MAKEMASK(8, S_SPC_CFG_SRC4)
248#define V_SPC_CFG_SRC4(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC4)
249#define G_SPC_CFG_SRC4(x) _SB_GETVALUE(x, S_SPC_CFG_SRC4, M_SPC_CFG_SRC4)
250
251#define S_SPC_CFG_SRC5 40
252#define M_SPC_CFG_SRC5 _SB_MAKEMASK(8, S_SPC_CFG_SRC5)
253#define V_SPC_CFG_SRC5(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC5)
254#define G_SPC_CFG_SRC5(x) _SB_GETVALUE(x, S_SPC_CFG_SRC5, M_SPC_CFG_SRC5)
255
256#define S_SPC_CFG_SRC6 48
257#define M_SPC_CFG_SRC6 _SB_MAKEMASK(8, S_SPC_CFG_SRC6)
258#define V_SPC_CFG_SRC6(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC6)
259#define G_SPC_CFG_SRC6(x) _SB_GETVALUE(x, S_SPC_CFG_SRC6, M_SPC_CFG_SRC6)
260
261#define S_SPC_CFG_SRC7 56
262#define M_SPC_CFG_SRC7 _SB_MAKEMASK(8, S_SPC_CFG_SRC7)
263#define V_SPC_CFG_SRC7(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC7)
264#define G_SPC_CFG_SRC7(x) _SB_GETVALUE(x, S_SPC_CFG_SRC7, M_SPC_CFG_SRC7)
265
266/*
267 * System Performance Counter Control Register (Table 32)
268 * Register: PERF_CNT_CFG_1
269 * BCM1480 specific
270 */
271#define M_BCM1480_SPC_CFG_CLEAR _SB_MAKEMASK1(0)
272#define M_BCM1480_SPC_CFG_ENABLE _SB_MAKEMASK1(1)
273#if SIBYTE_HDR_FEATURE_CHIP(1480)
274#define M_SPC_CFG_CLEAR M_BCM1480_SPC_CFG_CLEAR
275#define M_SPC_CFG_ENABLE M_BCM1480_SPC_CFG_ENABLE
276#endif
277
278/*
279 * System Performance Counters (Table 33)
280 * Registers: PERF_CNT_x
281 */
282
283#define S_BCM1480_SPC_CNT_COUNT 0
284#define M_BCM1480_SPC_CNT_COUNT _SB_MAKEMASK(40, S_BCM1480_SPC_CNT_COUNT)
285#define V_BCM1480_SPC_CNT_COUNT(x) _SB_MAKEVALUE(x, S_BCM1480_SPC_CNT_COUNT)
286#define G_BCM1480_SPC_CNT_COUNT(x) _SB_GETVALUE(x, S_BCM1480_SPC_CNT_COUNT, M_BCM1480_SPC_CNT_COUNT)
287
288#define M_BCM1480_SPC_CNT_OFLOW _SB_MAKEMASK1(40)
289
290
291/*
292 * Bus Watcher Error Status Register (Tables 36, 37)
293 * Registers: BUS_ERR_STATUS, BUS_ERR_STATUS_DEBUG
294 * Same as BCM1250.
295 */
296
297/*
298 * Bus Watcher Error Data Registers (Table 38)
299 * Registers: BUS_ERR_DATA_x
300 * Same as BCM1250.
301 */
302
303/*
304 * Bus Watcher L2 ECC Counter Register (Table 39)
305 * Register: BUS_L2_ERRORS
306 * Same as BCM1250.
307 */
308
309
310/*
311 * Bus Watcher Memory and I/O Error Counter Register (Table 40)
312 * Register: BUS_MEM_IO_ERRORS
313 * Same as BCM1250.
314 */
315
316
317/*
318 * Address Trap Registers
319 *
320 * Register layout same as BCM1250, almost. The bus agents
321 * are different, and the address trap configuration bits are
322 * slightly different.
323 */
324
325#define M_BCM1480_ATRAP_INDEX _SB_MAKEMASK(4, 0)
326#define M_BCM1480_ATRAP_ADDRESS _SB_MAKEMASK(40, 0)
327
328#define S_BCM1480_ATRAP_CFG_CNT 0
329#define M_BCM1480_ATRAP_CFG_CNT _SB_MAKEMASK(3, S_BCM1480_ATRAP_CFG_CNT)
330#define V_BCM1480_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CNT)
331#define G_BCM1480_ATRAP_CFG_CNT(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CNT, M_BCM1480_ATRAP_CFG_CNT)
332
333#define M_BCM1480_ATRAP_CFG_WRITE _SB_MAKEMASK1(3)
334#define M_BCM1480_ATRAP_CFG_ALL _SB_MAKEMASK1(4)
335#define M_BCM1480_ATRAP_CFG_INV _SB_MAKEMASK1(5)
336#define M_BCM1480_ATRAP_CFG_USESRC _SB_MAKEMASK1(6)
337#define M_BCM1480_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7)
338
339#define S_BCM1480_ATRAP_CFG_AGENTID 8
340#define M_BCM1480_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_BCM1480_ATRAP_CFG_AGENTID)
341#define V_BCM1480_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID)
342#define G_BCM1480_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_AGENTID, M_BCM1480_ATRAP_CFG_AGENTID)
343
344
345#define K_BCM1480_BUS_AGENT_CPU0 0
346#define K_BCM1480_BUS_AGENT_CPU1 1
347#define K_BCM1480_BUS_AGENT_NC 2
348#define K_BCM1480_BUS_AGENT_IOB 3
349#define K_BCM1480_BUS_AGENT_SCD 4
350#define K_BCM1480_BUS_AGENT_L2C 6
351#define K_BCM1480_BUS_AGENT_MC 7
352#define K_BCM1480_BUS_AGENT_CPU2 8
353#define K_BCM1480_BUS_AGENT_CPU3 9
354#define K_BCM1480_BUS_AGENT_PM 10
355
356#define S_BCM1480_ATRAP_CFG_CATTR 12
357#define M_BCM1480_ATRAP_CFG_CATTR _SB_MAKEMASK(2, S_BCM1480_ATRAP_CFG_CATTR)
358#define V_BCM1480_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x, S_BCM1480_ATRAP_CFG_CATTR)
359#define G_BCM1480_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x, S_BCM1480_ATRAP_CFG_CATTR, M_BCM1480_ATRAP_CFG_CATTR)
360
361#define K_BCM1480_ATRAP_CFG_CATTR_IGNORE 0
362#define K_BCM1480_ATRAP_CFG_CATTR_UNC 1
363#define K_BCM1480_ATRAP_CFG_CATTR_NONCOH 2
364#define K_BCM1480_ATRAP_CFG_CATTR_COHERENT 3
365
366#define M_BCM1480_ATRAP_CFG_CATTRINV _SB_MAKEMASK1(14)
367
368
369/*
370 * Trace Event Registers (Table 47)
371 * Same as BCM1250.
372 */
373
374/*
375 * Trace Sequence Control Registers (Table 48)
376 * Registers: TRACE_SEQUENCE_x
377 *
378 * Same as BCM1250 except for two new fields.
379 */
380
381
382#define M_BCM1480_SCD_TRSEQ_TID_MATCH_EN _SB_MAKEMASK1(25)
383
384#define S_BCM1480_SCD_TRSEQ_SWFUNC 26
385#define M_BCM1480_SCD_TRSEQ_SWFUNC _SB_MAKEMASK(2, S_BCM1480_SCD_TRSEQ_SWFUNC)
386#define V_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC)
387#define G_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_GETVALUE(x, S_BCM1480_SCD_TRSEQ_SWFUNC, M_BCM1480_SCD_TRSEQ_SWFUNC)
388
389/*
390 * Trace Control Register (Table 49)
391 * Register: TRACE_CFG
392 *
393 * BCM1480 changes to this register (other than location of the CUR_ADDR field)
394 * are defined below.
395 */
396
397#define S_BCM1480_SCD_TRACE_CFG_MODE 16
398#define M_BCM1480_SCD_TRACE_CFG_MODE _SB_MAKEMASK(2, S_BCM1480_SCD_TRACE_CFG_MODE)
399#define V_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_MAKEVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE)
400#define G_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_GETVALUE(x, S_BCM1480_SCD_TRACE_CFG_MODE, M_BCM1480_SCD_TRACE_CFG_MODE)
401
402#define K_BCM1480_SCD_TRACE_CFG_MODE_BLOCKERS 0
403#define K_BCM1480_SCD_TRACE_CFG_MODE_BYTEEN_INT 1
404#define K_BCM1480_SCD_TRACE_CFG_MODE_FLOW_ID 2
405
406#endif /* _BCM1480_SCD_H */
diff --git a/include/asm-mips/sibyte/bigsur.h b/include/asm-mips/sibyte/bigsur.h
deleted file mode 100644
index ebefe797fc1d..000000000000
--- a/include/asm-mips/sibyte/bigsur.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18#ifndef __ASM_SIBYTE_BIGSUR_H
19#define __ASM_SIBYTE_BIGSUR_H
20
21#include <asm/sibyte/sb1250.h>
22#include <asm/sibyte/bcm1480_int.h>
23
24#ifdef CONFIG_SIBYTE_BIGSUR
25#define SIBYTE_BOARD_NAME "BCM91x80A/B (BigSur)"
26#define SIBYTE_HAVE_PCMCIA 1
27#define SIBYTE_HAVE_IDE 1
28#endif
29
30/* Generic bus chip selects */
31#define LEDS_CS 3
32#define LEDS_PHYS 0x100a0000
33
34#ifdef SIBYTE_HAVE_IDE
35#define IDE_CS 4
36#define IDE_PHYS 0x100b0000
37#define K_GPIO_GB_IDE 4
38#define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE)
39#endif
40
41#ifdef SIBYTE_HAVE_PCMCIA
42#define PCMCIA_CS 6
43#define PCMCIA_PHYS 0x11000000
44#define K_GPIO_PC_READY 9
45#define K_INT_PC_READY (K_INT_GPIO_0 + K_GPIO_PC_READY)
46#endif
47
48#endif /* __ASM_SIBYTE_BIGSUR_H */
49
diff --git a/include/asm-mips/sibyte/board.h b/include/asm-mips/sibyte/board.h
deleted file mode 100644
index 25372ae0e814..000000000000
--- a/include/asm-mips/sibyte/board.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#ifndef _SIBYTE_BOARD_H
20#define _SIBYTE_BOARD_H
21
22#if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_CRHONE) || \
23 defined(CONFIG_SIBYTE_CRHINE) || defined(CONFIG_SIBYTE_LITTLESUR)
24#include <asm/sibyte/swarm.h>
25#endif
26
27#if defined(CONFIG_SIBYTE_SENTOSA) || defined(CONFIG_SIBYTE_RHONE)
28#include <asm/sibyte/sentosa.h>
29#endif
30
31#ifdef CONFIG_SIBYTE_CARMEL
32#include <asm/sibyte/carmel.h>
33#endif
34
35#ifdef CONFIG_SIBYTE_BIGSUR
36#include <asm/sibyte/bigsur.h>
37#endif
38
39#ifdef __ASSEMBLY__
40
41#ifdef LEDS_PHYS
42#define setleds(t0, t1, c0, c1, c2, c3) \
43 li t0, (LEDS_PHYS|0xa0000000); \
44 li t1, c0; \
45 sb t1, 0x18(t0); \
46 li t1, c1; \
47 sb t1, 0x10(t0); \
48 li t1, c2; \
49 sb t1, 0x08(t0); \
50 li t1, c3; \
51 sb t1, 0x00(t0)
52#else
53#define setleds(t0, t1, c0, c1, c2, c3)
54#endif /* LEDS_PHYS */
55
56#else
57
58void swarm_setup(void);
59
60#ifdef LEDS_PHYS
61extern void setleds(char *str);
62#else
63#define setleds(s) do { } while (0)
64#endif /* LEDS_PHYS */
65
66#endif /* __ASSEMBLY__ */
67
68#endif /* _SIBYTE_BOARD_H */
diff --git a/include/asm-mips/sibyte/carmel.h b/include/asm-mips/sibyte/carmel.h
deleted file mode 100644
index 11cad71323e8..000000000000
--- a/include/asm-mips/sibyte/carmel.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * Copyright (C) 2002 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18#ifndef __ASM_SIBYTE_CARMEL_H
19#define __ASM_SIBYTE_CARMEL_H
20
21#include <asm/sibyte/sb1250.h>
22#include <asm/sibyte/sb1250_int.h>
23
24#define SIBYTE_BOARD_NAME "Carmel"
25
26#define GPIO_PHY_INTERRUPT 2
27#define GPIO_NONMASKABLE_INT 3
28#define GPIO_CF_INSERTED 6
29#define GPIO_MONTEREY_RESET 7
30#define GPIO_QUADUART_INT 8
31#define GPIO_CF_INT 9
32#define GPIO_FPGA_CCLK 10
33#define GPIO_FPGA_DOUT 11
34#define GPIO_FPGA_DIN 12
35#define GPIO_FPGA_PGM 13
36#define GPIO_FPGA_DONE 14
37#define GPIO_FPGA_INIT 15
38
39#define LEDS_CS 2
40#define LEDS_PHYS 0x100C0000
41#define MLEDS_CS 3
42#define MLEDS_PHYS 0x100A0000
43#define UART_CS 4
44#define UART_PHYS 0x100D0000
45#define ARAVALI_CS 5
46#define ARAVALI_PHYS 0x11000000
47#define IDE_CS 6
48#define IDE_PHYS 0x100B0000
49#define ARAVALI2_CS 7
50#define ARAVALI2_PHYS 0x100E0000
51
52#if defined(CONFIG_SIBYTE_CARMEL)
53#define K_GPIO_GB_IDE 9
54#define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE)
55#endif
56
57
58#endif /* __ASM_SIBYTE_CARMEL_H */
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h
deleted file mode 100644
index 80c1a052662a..000000000000
--- a/include/asm-mips/sibyte/sb1250.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#ifndef _ASM_SIBYTE_SB1250_H
20#define _ASM_SIBYTE_SB1250_H
21
22/*
23 * yymmddpp: year, month, day, patch.
24 * should sync with Makefile EXTRAVERSION
25 */
26#define SIBYTE_RELEASE 0x02111403
27
28#define SB1250_NR_IRQS 64
29
30#define BCM1480_NR_IRQS 128
31#define BCM1480_NR_IRQS_HALF 64
32
33#define SB1250_DUART_MINOR_BASE 64
34
35#ifndef __ASSEMBLY__
36
37#include <asm/addrspace.h>
38
39/* For revision/pass information */
40#include <asm/sibyte/sb1250_scd.h>
41#include <asm/sibyte/bcm1480_scd.h>
42extern unsigned int sb1_pass;
43extern unsigned int soc_pass;
44extern unsigned int soc_type;
45extern unsigned int periph_rev;
46extern unsigned int zbbus_mhz;
47
48extern void sb1250_time_init(void);
49extern void sb1250_mask_irq(int cpu, int irq);
50extern void sb1250_unmask_irq(int cpu, int irq);
51
52extern void bcm1480_time_init(void);
53extern void bcm1480_mask_irq(int cpu, int irq);
54extern void bcm1480_unmask_irq(int cpu, int irq);
55
56#define AT_spin \
57 __asm__ __volatile__ ( \
58 ".set noat\n" \
59 "li $at, 0\n" \
60 "1: beqz $at, 1b\n" \
61 ".set at\n" \
62 )
63
64#endif
65
66#define IOADDR(a) ((void __iomem *)(IO_BASE + (a)))
67
68#endif
diff --git a/include/asm-mips/sibyte/sb1250_defs.h b/include/asm-mips/sibyte/sb1250_defs.h
deleted file mode 100644
index 09365f9111fa..000000000000
--- a/include/asm-mips/sibyte/sb1250_defs.h
+++ /dev/null
@@ -1,259 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * Global constants and macros File: sb1250_defs.h
5 *
6 * This file contains macros and definitions used by the other
7 * include files.
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32#ifndef _SB1250_DEFS_H
33#define _SB1250_DEFS_H
34
35/*
36 * These headers require ANSI C89 string concatenation, and GCC or other
37 * 'long long' (64-bit integer) support.
38 */
39#if !defined(__STDC__) && !defined(_MSC_VER)
40#error SiByte headers require ANSI C89 support
41#endif
42
43
44/* *********************************************************************
45 * Macros for feature tests, used to enable include file features
46 * for chip features only present in certain chip revisions.
47 *
48 * SIBYTE_HDR_FEATURES may be defined to be the mask value chip/revision
49 * which is to be exposed by the headers. If undefined, it defaults to
50 * "all features."
51 *
52 * Use like:
53 *
54 * #define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_112x_PASS1
55 *
56 * Generate defines only for that revision of chip.
57 *
58 * #if SIBYTE_HDR_FEATURE(chip,pass)
59 *
60 * True if header features for that revision or later of
61 * that particular chip type are enabled in SIBYTE_HDR_FEATURES.
62 * (Use this to bracket #defines for features present in a given
63 * revision and later.)
64 *
65 * Note that there is no implied ordering between chip types.
66 *
67 * Note also that 'chip' and 'pass' must textually exactly
68 * match the defines below. So, for example,
69 * SIBYTE_HDR_FEATURE(112x, PASS1) is OK, but
70 * SIBYTE_HDR_FEATURE(1120, pass1) is not (for two reasons).
71 *
72 * #if SIBYTE_HDR_FEATURE_UP_TO(chip,pass)
73 *
74 * Same as SIBYTE_HDR_FEATURE, but true for the named revision
75 * and earlier revisions of the named chip type.
76 *
77 * #if SIBYTE_HDR_FEATURE_EXACT(chip,pass)
78 *
79 * Same as SIBYTE_HDR_FEATURE, but only true for the named
80 * revision of the named chip type. (Note that this CANNOT
81 * be used to verify that you're compiling only for that
82 * particular chip/revision. It will be true any time this
83 * chip/revision is included in SIBYTE_HDR_FEATURES.)
84 *
85 * #if SIBYTE_HDR_FEATURE_CHIP(chip)
86 *
87 * True if header features for (any revision of) that chip type
88 * are enabled in SIBYTE_HDR_FEATURES. (Use this to bracket
89 * #defines for features specific to a given chip type.)
90 *
91 * Mask values currently include room for additional revisions of each
92 * chip type, but can be renumbered at will. Note that they MUST fit
93 * into 31 bits and may not include C type constructs, for safe use in
94 * CPP conditionals. Bit positions within chip types DO indicate
95 * ordering, so be careful when adding support for new minor revs.
96 ********************************************************************* */
97
98#define SIBYTE_HDR_FMASK_1250_ALL 0x000000ff
99#define SIBYTE_HDR_FMASK_1250_PASS1 0x00000001
100#define SIBYTE_HDR_FMASK_1250_PASS2 0x00000002
101#define SIBYTE_HDR_FMASK_1250_PASS3 0x00000004
102
103#define SIBYTE_HDR_FMASK_112x_ALL 0x00000f00
104#define SIBYTE_HDR_FMASK_112x_PASS1 0x00000100
105
106#define SIBYTE_HDR_FMASK_1480_ALL 0x0000f000
107#define SIBYTE_HDR_FMASK_1480_PASS1 0x00001000
108#define SIBYTE_HDR_FMASK_1480_PASS2 0x00002000
109
110/* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */
111#define SIBYTE_HDR_FMASK(chip, pass) \
112 (SIBYTE_HDR_FMASK_ ## chip ## _ ## pass)
113#define SIBYTE_HDR_FMASK_ALLREVS(chip) \
114 (SIBYTE_HDR_FMASK_ ## chip ## _ALL)
115
116/* Default constant value for all chips, all revisions */
117#define SIBYTE_HDR_FMASK_ALL \
118 (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL \
119 | SIBYTE_HDR_FMASK_1480_ALL)
120
121/* This one is used for the "original" BCM1250/BCM112x chips. We use this
122 to weed out constants and macros that do not exist on later chips like
123 the BCM1480 */
124#define SIBYTE_HDR_FMASK_1250_112x_ALL \
125 (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL)
126#define SIBYTE_HDR_FMASK_1250_112x SIBYTE_HDR_FMASK_1250_112x_ALL
127
128#ifndef SIBYTE_HDR_FEATURES
129#define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_ALL
130#endif
131
132
133/* Bit mask for revisions of chip exclusively before the named revision. */
134#define SIBYTE_HDR_FMASK_BEFORE(chip, pass) \
135 ((SIBYTE_HDR_FMASK(chip, pass) - 1) & SIBYTE_HDR_FMASK_ALLREVS(chip))
136
137/* Bit mask for revisions of chip exclusively after the named revision. */
138#define SIBYTE_HDR_FMASK_AFTER(chip, pass) \
139 (~(SIBYTE_HDR_FMASK(chip, pass) \
140 | (SIBYTE_HDR_FMASK(chip, pass) - 1)) & SIBYTE_HDR_FMASK_ALLREVS(chip))
141
142
143/* True if header features enabled for (any revision of) that chip type. */
144#define SIBYTE_HDR_FEATURE_CHIP(chip) \
145 (!! (SIBYTE_HDR_FMASK_ALLREVS(chip) & SIBYTE_HDR_FEATURES))
146
147/* True for all versions of the BCM1250 and BCM1125, but not true for
148 anything else */
149#define SIBYTE_HDR_FEATURE_1250_112x \
150 (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x))
151/* (!! (SIBYTE_HDR_FEATURES & SIBYHTE_HDR_FMASK_1250_112x)) */
152
153/* True if header features enabled for that rev or later, inclusive. */
154#define SIBYTE_HDR_FEATURE(chip, pass) \
155 (!! ((SIBYTE_HDR_FMASK(chip, pass) \
156 | SIBYTE_HDR_FMASK_AFTER(chip, pass)) & SIBYTE_HDR_FEATURES))
157
158/* True if header features enabled for exactly that rev. */
159#define SIBYTE_HDR_FEATURE_EXACT(chip, pass) \
160 (!! (SIBYTE_HDR_FMASK(chip, pass) & SIBYTE_HDR_FEATURES))
161
162/* True if header features enabled for that rev or before, inclusive. */
163#define SIBYTE_HDR_FEATURE_UP_TO(chip, pass) \
164 (!! ((SIBYTE_HDR_FMASK(chip, pass) \
165 | SIBYTE_HDR_FMASK_BEFORE(chip, pass)) & SIBYTE_HDR_FEATURES))
166
167
168/* *********************************************************************
169 * Naming schemes for constants in these files:
170 *
171 * M_xxx MASK constant (identifies bits in a register).
172 * For multi-bit fields, all bits in the field will
173 * be set.
174 *
175 * K_xxx "Code" constant (value for data in a multi-bit
176 * field). The value is right justified.
177 *
178 * V_xxx "Value" constant. This is the same as the
179 * corresponding "K_xxx" constant, except it is
180 * shifted to the correct position in the register.
181 *
182 * S_xxx SHIFT constant. This is the number of bits that
183 * a field value (code) needs to be shifted
184 * (towards the left) to put the value in the right
185 * position for the register.
186 *
187 * A_xxx ADDRESS constant. This will be a physical
188 * address. Use the PHYS_TO_K1 macro to generate
189 * a K1SEG address.
190 *
191 * R_xxx RELATIVE offset constant. This is an offset from
192 * an A_xxx constant (usually the first register in
193 * a group).
194 *
195 * G_xxx(X) GET value. This macro obtains a multi-bit field
196 * from a register, masks it, and shifts it to
197 * the bottom of the register (retrieving a K_xxx
198 * value, for example).
199 *
200 * V_xxx(X) VALUE. This macro computes the value of a
201 * K_xxx constant shifted to the correct position
202 * in the register.
203 ********************************************************************* */
204
205
206
207
208/*
209 * Cast to 64-bit number. Presumably the syntax is different in
210 * assembly language.
211 *
212 * Note: you'll need to define uint32_t and uint64_t in your headers.
213 */
214
215#if !defined(__ASSEMBLY__)
216#define _SB_MAKE64(x) ((uint64_t)(x))
217#define _SB_MAKE32(x) ((uint32_t)(x))
218#else
219#define _SB_MAKE64(x) (x)
220#define _SB_MAKE32(x) (x)
221#endif
222
223
224/*
225 * Make a mask for 1 bit at position 'n'
226 */
227
228#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
229#define _SB_MAKEMASK1_32(n) (_SB_MAKE32(1) << _SB_MAKE32(n))
230
231/*
232 * Make a mask for 'v' bits at position 'n'
233 */
234
235#define _SB_MAKEMASK(v, n) (_SB_MAKE64((_SB_MAKE64(1)<<(v))-1) << _SB_MAKE64(n))
236#define _SB_MAKEMASK_32(v, n) (_SB_MAKE32((_SB_MAKE32(1)<<(v))-1) << _SB_MAKE32(n))
237
238/*
239 * Make a value at 'v' at bit position 'n'
240 */
241
242#define _SB_MAKEVALUE(v, n) (_SB_MAKE64(v) << _SB_MAKE64(n))
243#define _SB_MAKEVALUE_32(v, n) (_SB_MAKE32(v) << _SB_MAKE32(n))
244
245#define _SB_GETVALUE(v, n, m) ((_SB_MAKE64(v) & _SB_MAKE64(m)) >> _SB_MAKE64(n))
246#define _SB_GETVALUE_32(v, n, m) ((_SB_MAKE32(v) & _SB_MAKE32(m)) >> _SB_MAKE32(n))
247
248/*
249 * Macros to read/write on-chip registers
250 * XXX should we do the PHYS_TO_K1 here?
251 */
252
253
254#if defined(__mips64) && !defined(__ASSEMBLY__)
255#define SBWRITECSR(csr, val) *((volatile uint64_t *) PHYS_TO_K1(csr)) = (val)
256#define SBREADCSR(csr) (*((volatile uint64_t *) PHYS_TO_K1(csr)))
257#endif /* __ASSEMBLY__ */
258
259#endif
diff --git a/include/asm-mips/sibyte/sb1250_dma.h b/include/asm-mips/sibyte/sb1250_dma.h
deleted file mode 100644
index bad56171d747..000000000000
--- a/include/asm-mips/sibyte/sb1250_dma.h
+++ /dev/null
@@ -1,594 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * DMA definitions File: sb1250_dma.h
5 *
6 * This module contains constants and macros useful for
7 * programming the SB1250's DMA controllers, both the data mover
8 * and the Ethernet DMA.
9 *
10 * SB1250 specification level: User's manual 10/21/02
11 * BCM1280 specification level: User's manual 11/24/03
12 *
13 *********************************************************************
14 *
15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved.
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) 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; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA
32 ********************************************************************* */
33
34
35#ifndef _SB1250_DMA_H
36#define _SB1250_DMA_H
37
38
39#include "sb1250_defs.h"
40
41/* *********************************************************************
42 * DMA Registers
43 ********************************************************************* */
44
45/*
46 * Ethernet and Serial DMA Configuration Register 0 (Table 7-4)
47 * Registers: DMA_CONFIG0_MAC_x_RX_CH_0
48 * Registers: DMA_CONFIG0_MAC_x_TX_CH_0
49 * Registers: DMA_CONFIG0_SER_x_RX
50 * Registers: DMA_CONFIG0_SER_x_TX
51 */
52
53
54#define M_DMA_DROP _SB_MAKEMASK1(0)
55
56#define M_DMA_CHAIN_SEL _SB_MAKEMASK1(1)
57#define M_DMA_RESERVED1 _SB_MAKEMASK1(2)
58
59#define S_DMA_DESC_TYPE _SB_MAKE64(1)
60#define M_DMA_DESC_TYPE _SB_MAKEMASK(2, S_DMA_DESC_TYPE)
61#define V_DMA_DESC_TYPE(x) _SB_MAKEVALUE(x, S_DMA_DESC_TYPE)
62#define G_DMA_DESC_TYPE(x) _SB_GETVALUE(x, S_DMA_DESC_TYPE, M_DMA_DESC_TYPE)
63
64#define K_DMA_DESC_TYPE_RING_AL 0
65#define K_DMA_DESC_TYPE_CHAIN_AL 1
66
67#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
68#define K_DMA_DESC_TYPE_RING_UAL_WI 2
69#define K_DMA_DESC_TYPE_RING_UAL_RMW 3
70#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
71
72#define M_DMA_EOP_INT_EN _SB_MAKEMASK1(3)
73#define M_DMA_HWM_INT_EN _SB_MAKEMASK1(4)
74#define M_DMA_LWM_INT_EN _SB_MAKEMASK1(5)
75#define M_DMA_TBX_EN _SB_MAKEMASK1(6)
76#define M_DMA_TDX_EN _SB_MAKEMASK1(7)
77
78#define S_DMA_INT_PKTCNT _SB_MAKE64(8)
79#define M_DMA_INT_PKTCNT _SB_MAKEMASK(8, S_DMA_INT_PKTCNT)
80#define V_DMA_INT_PKTCNT(x) _SB_MAKEVALUE(x, S_DMA_INT_PKTCNT)
81#define G_DMA_INT_PKTCNT(x) _SB_GETVALUE(x, S_DMA_INT_PKTCNT, M_DMA_INT_PKTCNT)
82
83#define S_DMA_RINGSZ _SB_MAKE64(16)
84#define M_DMA_RINGSZ _SB_MAKEMASK(16, S_DMA_RINGSZ)
85#define V_DMA_RINGSZ(x) _SB_MAKEVALUE(x, S_DMA_RINGSZ)
86#define G_DMA_RINGSZ(x) _SB_GETVALUE(x, S_DMA_RINGSZ, M_DMA_RINGSZ)
87
88#define S_DMA_HIGH_WATERMARK _SB_MAKE64(32)
89#define M_DMA_HIGH_WATERMARK _SB_MAKEMASK(16, S_DMA_HIGH_WATERMARK)
90#define V_DMA_HIGH_WATERMARK(x) _SB_MAKEVALUE(x, S_DMA_HIGH_WATERMARK)
91#define G_DMA_HIGH_WATERMARK(x) _SB_GETVALUE(x, S_DMA_HIGH_WATERMARK, M_DMA_HIGH_WATERMARK)
92
93#define S_DMA_LOW_WATERMARK _SB_MAKE64(48)
94#define M_DMA_LOW_WATERMARK _SB_MAKEMASK(16, S_DMA_LOW_WATERMARK)
95#define V_DMA_LOW_WATERMARK(x) _SB_MAKEVALUE(x, S_DMA_LOW_WATERMARK)
96#define G_DMA_LOW_WATERMARK(x) _SB_GETVALUE(x, S_DMA_LOW_WATERMARK, M_DMA_LOW_WATERMARK)
97
98/*
99 * Ethernet and Serial DMA Configuration Register 1 (Table 7-5)
100 * Registers: DMA_CONFIG1_MAC_x_RX_CH_0
101 * Registers: DMA_CONFIG1_DMA_x_TX_CH_0
102 * Registers: DMA_CONFIG1_SER_x_RX
103 * Registers: DMA_CONFIG1_SER_x_TX
104 */
105
106#define M_DMA_HDR_CF_EN _SB_MAKEMASK1(0)
107#define M_DMA_ASIC_XFR_EN _SB_MAKEMASK1(1)
108#define M_DMA_PRE_ADDR_EN _SB_MAKEMASK1(2)
109#define M_DMA_FLOW_CTL_EN _SB_MAKEMASK1(3)
110#define M_DMA_NO_DSCR_UPDT _SB_MAKEMASK1(4)
111#define M_DMA_L2CA _SB_MAKEMASK1(5)
112
113#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
114#define M_DMA_RX_XTRA_STATUS _SB_MAKEMASK1(6)
115#define M_DMA_TX_CPU_PAUSE _SB_MAKEMASK1(6)
116#define M_DMA_TX_FC_PAUSE_EN _SB_MAKEMASK1(7)
117#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
118
119#define M_DMA_MBZ1 _SB_MAKEMASK(6, 15)
120
121#define S_DMA_HDR_SIZE _SB_MAKE64(21)
122#define M_DMA_HDR_SIZE _SB_MAKEMASK(9, S_DMA_HDR_SIZE)
123#define V_DMA_HDR_SIZE(x) _SB_MAKEVALUE(x, S_DMA_HDR_SIZE)
124#define G_DMA_HDR_SIZE(x) _SB_GETVALUE(x, S_DMA_HDR_SIZE, M_DMA_HDR_SIZE)
125
126#define M_DMA_MBZ2 _SB_MAKEMASK(5, 32)
127
128#define S_DMA_ASICXFR_SIZE _SB_MAKE64(37)
129#define M_DMA_ASICXFR_SIZE _SB_MAKEMASK(9, S_DMA_ASICXFR_SIZE)
130#define V_DMA_ASICXFR_SIZE(x) _SB_MAKEVALUE(x, S_DMA_ASICXFR_SIZE)
131#define G_DMA_ASICXFR_SIZE(x) _SB_GETVALUE(x, S_DMA_ASICXFR_SIZE, M_DMA_ASICXFR_SIZE)
132
133#define S_DMA_INT_TIMEOUT _SB_MAKE64(48)
134#define M_DMA_INT_TIMEOUT _SB_MAKEMASK(16, S_DMA_INT_TIMEOUT)
135#define V_DMA_INT_TIMEOUT(x) _SB_MAKEVALUE(x, S_DMA_INT_TIMEOUT)
136#define G_DMA_INT_TIMEOUT(x) _SB_GETVALUE(x, S_DMA_INT_TIMEOUT, M_DMA_INT_TIMEOUT)
137
138/*
139 * Ethernet and Serial DMA Descriptor base address (Table 7-6)
140 */
141
142#define M_DMA_DSCRBASE_MBZ _SB_MAKEMASK(4, 0)
143
144
145/*
146 * ASIC Mode Base Address (Table 7-7)
147 */
148
149#define M_DMA_ASIC_BASE_MBZ _SB_MAKEMASK(20, 0)
150
151/*
152 * DMA Descriptor Count Registers (Table 7-8)
153 */
154
155/* No bitfields */
156
157
158/*
159 * Current Descriptor Address Register (Table 7-11)
160 */
161
162#define S_DMA_CURDSCR_ADDR _SB_MAKE64(0)
163#define M_DMA_CURDSCR_ADDR _SB_MAKEMASK(40, S_DMA_CURDSCR_ADDR)
164#define S_DMA_CURDSCR_COUNT _SB_MAKE64(40)
165#define M_DMA_CURDSCR_COUNT _SB_MAKEMASK(16, S_DMA_CURDSCR_COUNT)
166
167#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
168#define M_DMA_TX_CH_PAUSE_ON _SB_MAKEMASK1(56)
169#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
170
171/*
172 * Receive Packet Drop Registers
173 */
174#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
175#define S_DMA_OODLOST_RX _SB_MAKE64(0)
176#define M_DMA_OODLOST_RX _SB_MAKEMASK(16, S_DMA_OODLOST_RX)
177#define G_DMA_OODLOST_RX(x) _SB_GETVALUE(x, S_DMA_OODLOST_RX, M_DMA_OODLOST_RX)
178
179#define S_DMA_EOP_COUNT_RX _SB_MAKE64(16)
180#define M_DMA_EOP_COUNT_RX _SB_MAKEMASK(8, S_DMA_EOP_COUNT_RX)
181#define G_DMA_EOP_COUNT_RX(x) _SB_GETVALUE(x, S_DMA_EOP_COUNT_RX, M_DMA_EOP_COUNT_RX)
182#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
183
184/* *********************************************************************
185 * DMA Descriptors
186 ********************************************************************* */
187
188/*
189 * Descriptor doubleword "A" (Table 7-12)
190 */
191
192#define S_DMA_DSCRA_OFFSET _SB_MAKE64(0)
193#define M_DMA_DSCRA_OFFSET _SB_MAKEMASK(5, S_DMA_DSCRA_OFFSET)
194#define V_DMA_DSCRA_OFFSET(x) _SB_MAKEVALUE(x, S_DMA_DSCRA_OFFSET)
195#define G_DMA_DSCRA_OFFSET(x) _SB_GETVALUE(x, S_DMA_DSCRA_OFFSET, M_DMA_DSCRA_OFFSET)
196
197/* Note: Don't shift the address over, just mask it with the mask below */
198#define S_DMA_DSCRA_A_ADDR _SB_MAKE64(5)
199#define M_DMA_DSCRA_A_ADDR _SB_MAKEMASK(35, S_DMA_DSCRA_A_ADDR)
200
201#define M_DMA_DSCRA_A_ADDR_OFFSET (M_DMA_DSCRA_OFFSET | M_DMA_DSCRA_A_ADDR)
202
203#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
204#define S_DMA_DSCRA_A_ADDR_UA _SB_MAKE64(0)
205#define M_DMA_DSCRA_A_ADDR_UA _SB_MAKEMASK(40, S_DMA_DSCRA_A_ADDR_UA)
206#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
207
208#define S_DMA_DSCRA_A_SIZE _SB_MAKE64(40)
209#define M_DMA_DSCRA_A_SIZE _SB_MAKEMASK(9, S_DMA_DSCRA_A_SIZE)
210#define V_DMA_DSCRA_A_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRA_A_SIZE)
211#define G_DMA_DSCRA_A_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRA_A_SIZE, M_DMA_DSCRA_A_SIZE)
212
213#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
214#define S_DMA_DSCRA_DSCR_CNT _SB_MAKE64(40)
215#define M_DMA_DSCRA_DSCR_CNT _SB_MAKEMASK(8, S_DMA_DSCRA_DSCR_CNT)
216#define G_DMA_DSCRA_DSCR_CNT(x) _SB_GETVALUE(x, S_DMA_DSCRA_DSCR_CNT, M_DMA_DSCRA_DSCR_CNT)
217#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
218
219#define M_DMA_DSCRA_INTERRUPT _SB_MAKEMASK1(49)
220#define M_DMA_DSCRA_OFFSETB _SB_MAKEMASK1(50)
221
222#define S_DMA_DSCRA_STATUS _SB_MAKE64(51)
223#define M_DMA_DSCRA_STATUS _SB_MAKEMASK(13, S_DMA_DSCRA_STATUS)
224#define V_DMA_DSCRA_STATUS(x) _SB_MAKEVALUE(x, S_DMA_DSCRA_STATUS)
225#define G_DMA_DSCRA_STATUS(x) _SB_GETVALUE(x, S_DMA_DSCRA_STATUS, M_DMA_DSCRA_STATUS)
226
227/*
228 * Descriptor doubleword "B" (Table 7-13)
229 */
230
231
232#define S_DMA_DSCRB_OPTIONS _SB_MAKE64(0)
233#define M_DMA_DSCRB_OPTIONS _SB_MAKEMASK(4, S_DMA_DSCRB_OPTIONS)
234#define V_DMA_DSCRB_OPTIONS(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_OPTIONS)
235#define G_DMA_DSCRB_OPTIONS(x) _SB_GETVALUE(x, S_DMA_DSCRB_OPTIONS, M_DMA_DSCRB_OPTIONS)
236
237#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
238#define S_DMA_DSCRB_A_SIZE _SB_MAKE64(8)
239#define M_DMA_DSCRB_A_SIZE _SB_MAKEMASK(14, S_DMA_DSCRB_A_SIZE)
240#define V_DMA_DSCRB_A_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_A_SIZE)
241#define G_DMA_DSCRB_A_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRB_A_SIZE, M_DMA_DSCRB_A_SIZE)
242#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
243
244#define R_DMA_DSCRB_ADDR _SB_MAKE64(0x10)
245
246/* Note: Don't shift the address over, just mask it with the mask below */
247#define S_DMA_DSCRB_B_ADDR _SB_MAKE64(5)
248#define M_DMA_DSCRB_B_ADDR _SB_MAKEMASK(35, S_DMA_DSCRB_B_ADDR)
249
250#define S_DMA_DSCRB_B_SIZE _SB_MAKE64(40)
251#define M_DMA_DSCRB_B_SIZE _SB_MAKEMASK(9, S_DMA_DSCRB_B_SIZE)
252#define V_DMA_DSCRB_B_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_B_SIZE)
253#define G_DMA_DSCRB_B_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRB_B_SIZE, M_DMA_DSCRB_B_SIZE)
254
255#define M_DMA_DSCRB_B_VALID _SB_MAKEMASK1(49)
256
257#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
258#define S_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKE64(48)
259#define M_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKEMASK(2, S_DMA_DSCRB_PKT_SIZE_MSB)
260#define V_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_PKT_SIZE_MSB)
261#define G_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_GETVALUE(x, S_DMA_DSCRB_PKT_SIZE_MSB, M_DMA_DSCRB_PKT_SIZE_MSB)
262#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
263
264#define S_DMA_DSCRB_PKT_SIZE _SB_MAKE64(50)
265#define M_DMA_DSCRB_PKT_SIZE _SB_MAKEMASK(14, S_DMA_DSCRB_PKT_SIZE)
266#define V_DMA_DSCRB_PKT_SIZE(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_PKT_SIZE)
267#define G_DMA_DSCRB_PKT_SIZE(x) _SB_GETVALUE(x, S_DMA_DSCRB_PKT_SIZE, M_DMA_DSCRB_PKT_SIZE)
268
269/*
270 * from pass2 some bits in dscr_b are also used for rx status
271 */
272#define S_DMA_DSCRB_STATUS _SB_MAKE64(0)
273#define M_DMA_DSCRB_STATUS _SB_MAKEMASK(1, S_DMA_DSCRB_STATUS)
274#define V_DMA_DSCRB_STATUS(x) _SB_MAKEVALUE(x, S_DMA_DSCRB_STATUS)
275#define G_DMA_DSCRB_STATUS(x) _SB_GETVALUE(x, S_DMA_DSCRB_STATUS, M_DMA_DSCRB_STATUS)
276
277/*
278 * Ethernet Descriptor Status Bits (Table 7-15)
279 */
280
281#define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51)
282#define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52)
283
284#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
285/* Note: This bit is in the DSCR_B options field */
286#define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0)
287#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
288
289#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
290/* Note: These bits are in the DSCR_B options field */
291#define M_DMA_ETH_VLAN_FLAG _SB_MAKEMASK1(1)
292#define M_DMA_ETH_CRC_FLAG _SB_MAKEMASK1(2)
293#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
294
295#define S_DMA_ETHRX_RXCH 53
296#define M_DMA_ETHRX_RXCH _SB_MAKEMASK(2, S_DMA_ETHRX_RXCH)
297#define V_DMA_ETHRX_RXCH(x) _SB_MAKEVALUE(x, S_DMA_ETHRX_RXCH)
298#define G_DMA_ETHRX_RXCH(x) _SB_GETVALUE(x, S_DMA_ETHRX_RXCH, M_DMA_ETHRX_RXCH)
299
300#define S_DMA_ETHRX_PKTTYPE 55
301#define M_DMA_ETHRX_PKTTYPE _SB_MAKEMASK(3, S_DMA_ETHRX_PKTTYPE)
302#define V_DMA_ETHRX_PKTTYPE(x) _SB_MAKEVALUE(x, S_DMA_ETHRX_PKTTYPE)
303#define G_DMA_ETHRX_PKTTYPE(x) _SB_GETVALUE(x, S_DMA_ETHRX_PKTTYPE, M_DMA_ETHRX_PKTTYPE)
304
305#define K_DMA_ETHRX_PKTTYPE_IPV4 0
306#define K_DMA_ETHRX_PKTTYPE_ARPV4 1
307#define K_DMA_ETHRX_PKTTYPE_802 2
308#define K_DMA_ETHRX_PKTTYPE_OTHER 3
309#define K_DMA_ETHRX_PKTTYPE_USER0 4
310#define K_DMA_ETHRX_PKTTYPE_USER1 5
311#define K_DMA_ETHRX_PKTTYPE_USER2 6
312#define K_DMA_ETHRX_PKTTYPE_USER3 7
313
314#define M_DMA_ETHRX_MATCH_HASH _SB_MAKEMASK1(58)
315#define M_DMA_ETHRX_MATCH_EXACT _SB_MAKEMASK1(59)
316#define M_DMA_ETHRX_BCAST _SB_MAKEMASK1(60)
317#define M_DMA_ETHRX_MCAST _SB_MAKEMASK1(61)
318#define M_DMA_ETHRX_BAD _SB_MAKEMASK1(62)
319#define M_DMA_ETHRX_SOP _SB_MAKEMASK1(63)
320
321/*
322 * Ethernet Transmit Status Bits (Table 7-16)
323 */
324
325#define M_DMA_ETHTX_SOP _SB_MAKEMASK1(63)
326
327/*
328 * Ethernet Transmit Options (Table 7-17)
329 */
330
331#define K_DMA_ETHTX_NOTSOP _SB_MAKE64(0x00)
332#define K_DMA_ETHTX_APPENDCRC _SB_MAKE64(0x01)
333#define K_DMA_ETHTX_REPLACECRC _SB_MAKE64(0x02)
334#define K_DMA_ETHTX_APPENDCRC_APPENDPAD _SB_MAKE64(0x03)
335#define K_DMA_ETHTX_APPENDVLAN_REPLACECRC _SB_MAKE64(0x04)
336#define K_DMA_ETHTX_REMOVEVLAN_REPLACECRC _SB_MAKE64(0x05)
337#define K_DMA_ETHTX_REPLACEVLAN_REPLACECRC _SB_MAKE64(0x6)
338#define K_DMA_ETHTX_NOMODS _SB_MAKE64(0x07)
339#define K_DMA_ETHTX_RESERVED1 _SB_MAKE64(0x08)
340#define K_DMA_ETHTX_REPLACESADDR_APPENDCRC _SB_MAKE64(0x09)
341#define K_DMA_ETHTX_REPLACESADDR_REPLACECRC _SB_MAKE64(0x0A)
342#define K_DMA_ETHTX_REPLACESADDR_APPENDCRC_APPENDPAD _SB_MAKE64(0x0B)
343#define K_DMA_ETHTX_REPLACESADDR_APPENDVLAN_REPLACECRC _SB_MAKE64(0x0C)
344#define K_DMA_ETHTX_REPLACESADDR_REMOVEVLAN_REPLACECRC _SB_MAKE64(0x0D)
345#define K_DMA_ETHTX_REPLACESADDR_REPLACEVLAN_REPLACECRC _SB_MAKE64(0x0E)
346#define K_DMA_ETHTX_RESERVED2 _SB_MAKE64(0x0F)
347
348/*
349 * Serial Receive Options (Table 7-18)
350 */
351#define M_DMA_SERRX_CRC_ERROR _SB_MAKEMASK1(56)
352#define M_DMA_SERRX_ABORT _SB_MAKEMASK1(57)
353#define M_DMA_SERRX_OCTET_ERROR _SB_MAKEMASK1(58)
354#define M_DMA_SERRX_LONGFRAME_ERROR _SB_MAKEMASK1(59)
355#define M_DMA_SERRX_SHORTFRAME_ERROR _SB_MAKEMASK1(60)
356#define M_DMA_SERRX_OVERRUN_ERROR _SB_MAKEMASK1(61)
357#define M_DMA_SERRX_GOOD _SB_MAKEMASK1(62)
358#define M_DMA_SERRX_SOP _SB_MAKEMASK1(63)
359
360/*
361 * Serial Transmit Status Bits (Table 7-20)
362 */
363
364#define M_DMA_SERTX_FLAG _SB_MAKEMASK1(63)
365
366/*
367 * Serial Transmit Options (Table 7-21)
368 */
369
370#define K_DMA_SERTX_RESERVED _SB_MAKEMASK1(0)
371#define K_DMA_SERTX_APPENDCRC _SB_MAKEMASK1(1)
372#define K_DMA_SERTX_APPENDPAD _SB_MAKEMASK1(2)
373#define K_DMA_SERTX_ABORT _SB_MAKEMASK1(3)
374
375
376/* *********************************************************************
377 * Data Mover Registers
378 ********************************************************************* */
379
380/*
381 * Data Mover Descriptor Base Address Register (Table 7-22)
382 * Register: DM_DSCR_BASE_0
383 * Register: DM_DSCR_BASE_1
384 * Register: DM_DSCR_BASE_2
385 * Register: DM_DSCR_BASE_3
386 */
387
388#define M_DM_DSCR_BASE_MBZ _SB_MAKEMASK(4, 0)
389
390/* Note: Just mask the base address and then OR it in. */
391#define S_DM_DSCR_BASE_ADDR _SB_MAKE64(4)
392#define M_DM_DSCR_BASE_ADDR _SB_MAKEMASK(36, S_DM_DSCR_BASE_ADDR)
393
394#define S_DM_DSCR_BASE_RINGSZ _SB_MAKE64(40)
395#define M_DM_DSCR_BASE_RINGSZ _SB_MAKEMASK(16, S_DM_DSCR_BASE_RINGSZ)
396#define V_DM_DSCR_BASE_RINGSZ(x) _SB_MAKEVALUE(x, S_DM_DSCR_BASE_RINGSZ)
397#define G_DM_DSCR_BASE_RINGSZ(x) _SB_GETVALUE(x, S_DM_DSCR_BASE_RINGSZ, M_DM_DSCR_BASE_RINGSZ)
398
399#define S_DM_DSCR_BASE_PRIORITY _SB_MAKE64(56)
400#define M_DM_DSCR_BASE_PRIORITY _SB_MAKEMASK(3, S_DM_DSCR_BASE_PRIORITY)
401#define V_DM_DSCR_BASE_PRIORITY(x) _SB_MAKEVALUE(x, S_DM_DSCR_BASE_PRIORITY)
402#define G_DM_DSCR_BASE_PRIORITY(x) _SB_GETVALUE(x, S_DM_DSCR_BASE_PRIORITY, M_DM_DSCR_BASE_PRIORITY)
403
404#define K_DM_DSCR_BASE_PRIORITY_1 0
405#define K_DM_DSCR_BASE_PRIORITY_2 1
406#define K_DM_DSCR_BASE_PRIORITY_4 2
407#define K_DM_DSCR_BASE_PRIORITY_8 3
408#define K_DM_DSCR_BASE_PRIORITY_16 4
409
410#define M_DM_DSCR_BASE_ACTIVE _SB_MAKEMASK1(59)
411#define M_DM_DSCR_BASE_INTERRUPT _SB_MAKEMASK1(60)
412#define M_DM_DSCR_BASE_RESET _SB_MAKEMASK1(61) /* write register */
413#define M_DM_DSCR_BASE_ERROR _SB_MAKEMASK1(61) /* read register */
414#define M_DM_DSCR_BASE_ABORT _SB_MAKEMASK1(62)
415#define M_DM_DSCR_BASE_ENABL _SB_MAKEMASK1(63)
416
417/*
418 * Data Mover Descriptor Count Register (Table 7-25)
419 */
420
421/* no bitfields */
422
423/*
424 * Data Mover Current Descriptor Address (Table 7-24)
425 * Register: DM_CUR_DSCR_ADDR_0
426 * Register: DM_CUR_DSCR_ADDR_1
427 * Register: DM_CUR_DSCR_ADDR_2
428 * Register: DM_CUR_DSCR_ADDR_3
429 */
430
431#define S_DM_CUR_DSCR_DSCR_ADDR _SB_MAKE64(0)
432#define M_DM_CUR_DSCR_DSCR_ADDR _SB_MAKEMASK(40, S_DM_CUR_DSCR_DSCR_ADDR)
433
434#define S_DM_CUR_DSCR_DSCR_COUNT _SB_MAKE64(48)
435#define M_DM_CUR_DSCR_DSCR_COUNT _SB_MAKEMASK(16, S_DM_CUR_DSCR_DSCR_COUNT)
436#define V_DM_CUR_DSCR_DSCR_COUNT(r) _SB_MAKEVALUE(r, S_DM_CUR_DSCR_DSCR_COUNT)
437#define G_DM_CUR_DSCR_DSCR_COUNT(r) _SB_GETVALUE(r, S_DM_CUR_DSCR_DSCR_COUNT,\
438 M_DM_CUR_DSCR_DSCR_COUNT)
439
440
441#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
442/*
443 * Data Mover Channel Partial Result Registers
444 * Register: DM_PARTIAL_0
445 * Register: DM_PARTIAL_1
446 * Register: DM_PARTIAL_2
447 * Register: DM_PARTIAL_3
448 */
449#define S_DM_PARTIAL_CRC_PARTIAL _SB_MAKE64(0)
450#define M_DM_PARTIAL_CRC_PARTIAL _SB_MAKEMASK(32, S_DM_PARTIAL_CRC_PARTIAL)
451#define V_DM_PARTIAL_CRC_PARTIAL(r) _SB_MAKEVALUE(r, S_DM_PARTIAL_CRC_PARTIAL)
452#define G_DM_PARTIAL_CRC_PARTIAL(r) _SB_GETVALUE(r, S_DM_PARTIAL_CRC_PARTIAL,\
453 M_DM_PARTIAL_CRC_PARTIAL)
454
455#define S_DM_PARTIAL_TCPCS_PARTIAL _SB_MAKE64(32)
456#define M_DM_PARTIAL_TCPCS_PARTIAL _SB_MAKEMASK(16, S_DM_PARTIAL_TCPCS_PARTIAL)
457#define V_DM_PARTIAL_TCPCS_PARTIAL(r) _SB_MAKEVALUE(r, S_DM_PARTIAL_TCPCS_PARTIAL)
458#define G_DM_PARTIAL_TCPCS_PARTIAL(r) _SB_GETVALUE(r, S_DM_PARTIAL_TCPCS_PARTIAL,\
459 M_DM_PARTIAL_TCPCS_PARTIAL)
460
461#define M_DM_PARTIAL_ODD_BYTE _SB_MAKEMASK1(48)
462#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
463
464
465#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
466/*
467 * Data Mover CRC Definition Registers
468 * Register: CRC_DEF_0
469 * Register: CRC_DEF_1
470 */
471#define S_CRC_DEF_CRC_INIT _SB_MAKE64(0)
472#define M_CRC_DEF_CRC_INIT _SB_MAKEMASK(32, S_CRC_DEF_CRC_INIT)
473#define V_CRC_DEF_CRC_INIT(r) _SB_MAKEVALUE(r, S_CRC_DEF_CRC_INIT)
474#define G_CRC_DEF_CRC_INIT(r) _SB_GETVALUE(r, S_CRC_DEF_CRC_INIT,\
475 M_CRC_DEF_CRC_INIT)
476
477#define S_CRC_DEF_CRC_POLY _SB_MAKE64(32)
478#define M_CRC_DEF_CRC_POLY _SB_MAKEMASK(32, S_CRC_DEF_CRC_POLY)
479#define V_CRC_DEF_CRC_POLY(r) _SB_MAKEVALUE(r, S_CRC_DEF_CRC_POLY)
480#define G_CRC_DEF_CRC_POLY(r) _SB_GETVALUE(r, S_CRC_DEF_CRC_POLY,\
481 M_CRC_DEF_CRC_POLY)
482#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
483
484
485#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
486/*
487 * Data Mover CRC/Checksum Definition Registers
488 * Register: CTCP_DEF_0
489 * Register: CTCP_DEF_1
490 */
491#define S_CTCP_DEF_CRC_TXOR _SB_MAKE64(0)
492#define M_CTCP_DEF_CRC_TXOR _SB_MAKEMASK(32, S_CTCP_DEF_CRC_TXOR)
493#define V_CTCP_DEF_CRC_TXOR(r) _SB_MAKEVALUE(r, S_CTCP_DEF_CRC_TXOR)
494#define G_CTCP_DEF_CRC_TXOR(r) _SB_GETVALUE(r, S_CTCP_DEF_CRC_TXOR,\
495 M_CTCP_DEF_CRC_TXOR)
496
497#define S_CTCP_DEF_TCPCS_INIT _SB_MAKE64(32)
498#define M_CTCP_DEF_TCPCS_INIT _SB_MAKEMASK(16, S_CTCP_DEF_TCPCS_INIT)
499#define V_CTCP_DEF_TCPCS_INIT(r) _SB_MAKEVALUE(r, S_CTCP_DEF_TCPCS_INIT)
500#define G_CTCP_DEF_TCPCS_INIT(r) _SB_GETVALUE(r, S_CTCP_DEF_TCPCS_INIT,\
501 M_CTCP_DEF_TCPCS_INIT)
502
503#define S_CTCP_DEF_CRC_WIDTH _SB_MAKE64(48)
504#define M_CTCP_DEF_CRC_WIDTH _SB_MAKEMASK(2, S_CTCP_DEF_CRC_WIDTH)
505#define V_CTCP_DEF_CRC_WIDTH(r) _SB_MAKEVALUE(r, S_CTCP_DEF_CRC_WIDTH)
506#define G_CTCP_DEF_CRC_WIDTH(r) _SB_GETVALUE(r, S_CTCP_DEF_CRC_WIDTH,\
507 M_CTCP_DEF_CRC_WIDTH)
508
509#define K_CTCP_DEF_CRC_WIDTH_4 0
510#define K_CTCP_DEF_CRC_WIDTH_2 1
511#define K_CTCP_DEF_CRC_WIDTH_1 2
512
513#define M_CTCP_DEF_CRC_BIT_ORDER _SB_MAKEMASK1(50)
514#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
515
516
517/*
518 * Data Mover Descriptor Doubleword "A" (Table 7-26)
519 */
520
521#define S_DM_DSCRA_DST_ADDR _SB_MAKE64(0)
522#define M_DM_DSCRA_DST_ADDR _SB_MAKEMASK(40, S_DM_DSCRA_DST_ADDR)
523
524#define M_DM_DSCRA_UN_DEST _SB_MAKEMASK1(40)
525#define M_DM_DSCRA_UN_SRC _SB_MAKEMASK1(41)
526#define M_DM_DSCRA_INTERRUPT _SB_MAKEMASK1(42)
527#if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1)
528#define M_DM_DSCRA_THROTTLE _SB_MAKEMASK1(43)
529#endif /* up to 1250 PASS1 */
530
531#define S_DM_DSCRA_DIR_DEST _SB_MAKE64(44)
532#define M_DM_DSCRA_DIR_DEST _SB_MAKEMASK(2, S_DM_DSCRA_DIR_DEST)
533#define V_DM_DSCRA_DIR_DEST(x) _SB_MAKEVALUE(x, S_DM_DSCRA_DIR_DEST)
534#define G_DM_DSCRA_DIR_DEST(x) _SB_GETVALUE(x, S_DM_DSCRA_DIR_DEST, M_DM_DSCRA_DIR_DEST)
535
536#define K_DM_DSCRA_DIR_DEST_INCR 0
537#define K_DM_DSCRA_DIR_DEST_DECR 1
538#define K_DM_DSCRA_DIR_DEST_CONST 2
539
540#define V_DM_DSCRA_DIR_DEST_INCR _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_INCR, S_DM_DSCRA_DIR_DEST)
541#define V_DM_DSCRA_DIR_DEST_DECR _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_DECR, S_DM_DSCRA_DIR_DEST)
542#define V_DM_DSCRA_DIR_DEST_CONST _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_CONST, S_DM_DSCRA_DIR_DEST)
543
544#define S_DM_DSCRA_DIR_SRC _SB_MAKE64(46)
545#define M_DM_DSCRA_DIR_SRC _SB_MAKEMASK(2, S_DM_DSCRA_DIR_SRC)
546#define V_DM_DSCRA_DIR_SRC(x) _SB_MAKEVALUE(x, S_DM_DSCRA_DIR_SRC)
547#define G_DM_DSCRA_DIR_SRC(x) _SB_GETVALUE(x, S_DM_DSCRA_DIR_SRC, M_DM_DSCRA_DIR_SRC)
548
549#define K_DM_DSCRA_DIR_SRC_INCR 0
550#define K_DM_DSCRA_DIR_SRC_DECR 1
551#define K_DM_DSCRA_DIR_SRC_CONST 2
552
553#define V_DM_DSCRA_DIR_SRC_INCR _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_INCR, S_DM_DSCRA_DIR_SRC)
554#define V_DM_DSCRA_DIR_SRC_DECR _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_DECR, S_DM_DSCRA_DIR_SRC)
555#define V_DM_DSCRA_DIR_SRC_CONST _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_CONST, S_DM_DSCRA_DIR_SRC)
556
557
558#define M_DM_DSCRA_ZERO_MEM _SB_MAKEMASK1(48)
559#define M_DM_DSCRA_PREFETCH _SB_MAKEMASK1(49)
560#define M_DM_DSCRA_L2C_DEST _SB_MAKEMASK1(50)
561#define M_DM_DSCRA_L2C_SRC _SB_MAKEMASK1(51)
562
563#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
564#define M_DM_DSCRA_RD_BKOFF _SB_MAKEMASK1(52)
565#define M_DM_DSCRA_WR_BKOFF _SB_MAKEMASK1(53)
566#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
567
568#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
569#define M_DM_DSCRA_TCPCS_EN _SB_MAKEMASK1(54)
570#define M_DM_DSCRA_TCPCS_RES _SB_MAKEMASK1(55)
571#define M_DM_DSCRA_TCPCS_AP _SB_MAKEMASK1(56)
572#define M_DM_DSCRA_CRC_EN _SB_MAKEMASK1(57)
573#define M_DM_DSCRA_CRC_RES _SB_MAKEMASK1(58)
574#define M_DM_DSCRA_CRC_AP _SB_MAKEMASK1(59)
575#define M_DM_DSCRA_CRC_DFN _SB_MAKEMASK1(60)
576#define M_DM_DSCRA_CRC_XBIT _SB_MAKEMASK1(61)
577#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
578
579#define M_DM_DSCRA_RESERVED2 _SB_MAKEMASK(3, 61)
580
581/*
582 * Data Mover Descriptor Doubleword "B" (Table 7-25)
583 */
584
585#define S_DM_DSCRB_SRC_ADDR _SB_MAKE64(0)
586#define M_DM_DSCRB_SRC_ADDR _SB_MAKEMASK(40, S_DM_DSCRB_SRC_ADDR)
587
588#define S_DM_DSCRB_SRC_LENGTH _SB_MAKE64(40)
589#define M_DM_DSCRB_SRC_LENGTH _SB_MAKEMASK(20, S_DM_DSCRB_SRC_LENGTH)
590#define V_DM_DSCRB_SRC_LENGTH(x) _SB_MAKEVALUE(x, S_DM_DSCRB_SRC_LENGTH)
591#define G_DM_DSCRB_SRC_LENGTH(x) _SB_GETVALUE(x, S_DM_DSCRB_SRC_LENGTH, M_DM_DSCRB_SRC_LENGTH)
592
593
594#endif
diff --git a/include/asm-mips/sibyte/sb1250_genbus.h b/include/asm-mips/sibyte/sb1250_genbus.h
deleted file mode 100644
index 94e9c7c8e783..000000000000
--- a/include/asm-mips/sibyte/sb1250_genbus.h
+++ /dev/null
@@ -1,474 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * Generic Bus Constants File: sb1250_genbus.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the SB1250's Generic Bus interface
8 *
9 * SB1250 specification level: User's manual 10/21/02
10 * BCM1280 specification level: User's Manual 11/14/03
11 *
12 *********************************************************************
13 *
14 * Copyright 2000, 2001, 2002, 2003
15 * Broadcom Corporation. All rights reserved.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) 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; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 ********************************************************************* */
32
33
34#ifndef _SB1250_GENBUS_H
35#define _SB1250_GENBUS_H
36
37#include "sb1250_defs.h"
38
39/*
40 * Generic Bus Region Configuration Registers (Table 11-4)
41 */
42
43#define S_IO_RDY_ACTIVE 0
44#define M_IO_RDY_ACTIVE _SB_MAKEMASK1(S_IO_RDY_ACTIVE)
45
46#define S_IO_ENA_RDY 1
47#define M_IO_ENA_RDY _SB_MAKEMASK1(S_IO_ENA_RDY)
48
49#define S_IO_WIDTH_SEL 2
50#define M_IO_WIDTH_SEL _SB_MAKEMASK(2, S_IO_WIDTH_SEL)
51#define K_IO_WIDTH_SEL_1 0
52#define K_IO_WIDTH_SEL_2 1
53#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
54 || SIBYTE_HDR_FEATURE_CHIP(1480)
55#define K_IO_WIDTH_SEL_1L 2
56#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
57#define K_IO_WIDTH_SEL_4 3
58#define V_IO_WIDTH_SEL(x) _SB_MAKEVALUE(x, S_IO_WIDTH_SEL)
59#define G_IO_WIDTH_SEL(x) _SB_GETVALUE(x, S_IO_WIDTH_SEL, M_IO_WIDTH_SEL)
60
61#define S_IO_PARITY_ENA 4
62#define M_IO_PARITY_ENA _SB_MAKEMASK1(S_IO_PARITY_ENA)
63#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
64 || SIBYTE_HDR_FEATURE_CHIP(1480)
65#define S_IO_BURST_EN 5
66#define M_IO_BURST_EN _SB_MAKEMASK1(S_IO_BURST_EN)
67#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
68#define S_IO_PARITY_ODD 6
69#define M_IO_PARITY_ODD _SB_MAKEMASK1(S_IO_PARITY_ODD)
70#define S_IO_NONMUX 7
71#define M_IO_NONMUX _SB_MAKEMASK1(S_IO_NONMUX)
72
73#define S_IO_TIMEOUT 8
74#define M_IO_TIMEOUT _SB_MAKEMASK(8, S_IO_TIMEOUT)
75#define V_IO_TIMEOUT(x) _SB_MAKEVALUE(x, S_IO_TIMEOUT)
76#define G_IO_TIMEOUT(x) _SB_GETVALUE(x, S_IO_TIMEOUT, M_IO_TIMEOUT)
77
78/*
79 * Generic Bus Region Size register (Table 11-5)
80 */
81
82#define S_IO_MULT_SIZE 0
83#define M_IO_MULT_SIZE _SB_MAKEMASK(12, S_IO_MULT_SIZE)
84#define V_IO_MULT_SIZE(x) _SB_MAKEVALUE(x, S_IO_MULT_SIZE)
85#define G_IO_MULT_SIZE(x) _SB_GETVALUE(x, S_IO_MULT_SIZE, M_IO_MULT_SIZE)
86
87#define S_IO_REGSIZE 16 /* # bits to shift size for this reg */
88
89/*
90 * Generic Bus Region Address (Table 11-6)
91 */
92
93#define S_IO_START_ADDR 0
94#define M_IO_START_ADDR _SB_MAKEMASK(14, S_IO_START_ADDR)
95#define V_IO_START_ADDR(x) _SB_MAKEVALUE(x, S_IO_START_ADDR)
96#define G_IO_START_ADDR(x) _SB_GETVALUE(x, S_IO_START_ADDR, M_IO_START_ADDR)
97
98#define S_IO_ADDRBASE 16 /* # bits to shift addr for this reg */
99
100#define M_IO_BLK_CACHE _SB_MAKEMASK1(15)
101
102
103/*
104 * Generic Bus Timing 0 Registers (Table 11-7)
105 */
106
107#define S_IO_ALE_WIDTH 0
108#define M_IO_ALE_WIDTH _SB_MAKEMASK(3, S_IO_ALE_WIDTH)
109#define V_IO_ALE_WIDTH(x) _SB_MAKEVALUE(x, S_IO_ALE_WIDTH)
110#define G_IO_ALE_WIDTH(x) _SB_GETVALUE(x, S_IO_ALE_WIDTH, M_IO_ALE_WIDTH)
111
112#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
113 || SIBYTE_HDR_FEATURE_CHIP(1480)
114#define M_IO_EARLY_CS _SB_MAKEMASK1(3)
115#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
116
117#define S_IO_ALE_TO_CS 4
118#define M_IO_ALE_TO_CS _SB_MAKEMASK(2, S_IO_ALE_TO_CS)
119#define V_IO_ALE_TO_CS(x) _SB_MAKEVALUE(x, S_IO_ALE_TO_CS)
120#define G_IO_ALE_TO_CS(x) _SB_GETVALUE(x, S_IO_ALE_TO_CS, M_IO_ALE_TO_CS)
121
122#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
123 || SIBYTE_HDR_FEATURE_CHIP(1480)
124#define S_IO_BURST_WIDTH _SB_MAKE64(6)
125#define M_IO_BURST_WIDTH _SB_MAKEMASK(2, S_IO_BURST_WIDTH)
126#define V_IO_BURST_WIDTH(x) _SB_MAKEVALUE(x, S_IO_BURST_WIDTH)
127#define G_IO_BURST_WIDTH(x) _SB_GETVALUE(x, S_IO_BURST_WIDTH, M_IO_BURST_WIDTH)
128#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
129
130#define S_IO_CS_WIDTH 8
131#define M_IO_CS_WIDTH _SB_MAKEMASK(5, S_IO_CS_WIDTH)
132#define V_IO_CS_WIDTH(x) _SB_MAKEVALUE(x, S_IO_CS_WIDTH)
133#define G_IO_CS_WIDTH(x) _SB_GETVALUE(x, S_IO_CS_WIDTH, M_IO_CS_WIDTH)
134
135#define S_IO_RDY_SMPLE 13
136#define M_IO_RDY_SMPLE _SB_MAKEMASK(3, S_IO_RDY_SMPLE)
137#define V_IO_RDY_SMPLE(x) _SB_MAKEVALUE(x, S_IO_RDY_SMPLE)
138#define G_IO_RDY_SMPLE(x) _SB_GETVALUE(x, S_IO_RDY_SMPLE, M_IO_RDY_SMPLE)
139
140
141/*
142 * Generic Bus Timing 1 Registers (Table 11-8)
143 */
144
145#define S_IO_ALE_TO_WRITE 0
146#define M_IO_ALE_TO_WRITE _SB_MAKEMASK(3, S_IO_ALE_TO_WRITE)
147#define V_IO_ALE_TO_WRITE(x) _SB_MAKEVALUE(x, S_IO_ALE_TO_WRITE)
148#define G_IO_ALE_TO_WRITE(x) _SB_GETVALUE(x, S_IO_ALE_TO_WRITE, M_IO_ALE_TO_WRITE)
149
150#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \
151 || SIBYTE_HDR_FEATURE_CHIP(1480)
152#define M_IO_RDY_SYNC _SB_MAKEMASK1(3)
153#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
154
155#define S_IO_WRITE_WIDTH 4
156#define M_IO_WRITE_WIDTH _SB_MAKEMASK(4, S_IO_WRITE_WIDTH)
157#define V_IO_WRITE_WIDTH(x) _SB_MAKEVALUE(x, S_IO_WRITE_WIDTH)
158#define G_IO_WRITE_WIDTH(x) _SB_GETVALUE(x, S_IO_WRITE_WIDTH, M_IO_WRITE_WIDTH)
159
160#define S_IO_IDLE_CYCLE 8
161#define M_IO_IDLE_CYCLE _SB_MAKEMASK(4, S_IO_IDLE_CYCLE)
162#define V_IO_IDLE_CYCLE(x) _SB_MAKEVALUE(x, S_IO_IDLE_CYCLE)
163#define G_IO_IDLE_CYCLE(x) _SB_GETVALUE(x, S_IO_IDLE_CYCLE, M_IO_IDLE_CYCLE)
164
165#define S_IO_OE_TO_CS 12
166#define M_IO_OE_TO_CS _SB_MAKEMASK(2, S_IO_OE_TO_CS)
167#define V_IO_OE_TO_CS(x) _SB_MAKEVALUE(x, S_IO_OE_TO_CS)
168#define G_IO_OE_TO_CS(x) _SB_GETVALUE(x, S_IO_OE_TO_CS, M_IO_OE_TO_CS)
169
170#define S_IO_CS_TO_OE 14
171#define M_IO_CS_TO_OE _SB_MAKEMASK(2, S_IO_CS_TO_OE)
172#define V_IO_CS_TO_OE(x) _SB_MAKEVALUE(x, S_IO_CS_TO_OE)
173#define G_IO_CS_TO_OE(x) _SB_GETVALUE(x, S_IO_CS_TO_OE, M_IO_CS_TO_OE)
174
175/*
176 * Generic Bus Interrupt Status Register (Table 11-9)
177 */
178
179#define M_IO_CS_ERR_INT _SB_MAKEMASK(0, 8)
180#define M_IO_CS0_ERR_INT _SB_MAKEMASK1(0)
181#define M_IO_CS1_ERR_INT _SB_MAKEMASK1(1)
182#define M_IO_CS2_ERR_INT _SB_MAKEMASK1(2)
183#define M_IO_CS3_ERR_INT _SB_MAKEMASK1(3)
184#define M_IO_CS4_ERR_INT _SB_MAKEMASK1(4)
185#define M_IO_CS5_ERR_INT _SB_MAKEMASK1(5)
186#define M_IO_CS6_ERR_INT _SB_MAKEMASK1(6)
187#define M_IO_CS7_ERR_INT _SB_MAKEMASK1(7)
188
189#define M_IO_RD_PAR_INT _SB_MAKEMASK1(9)
190#define M_IO_TIMEOUT_INT _SB_MAKEMASK1(10)
191#define M_IO_ILL_ADDR_INT _SB_MAKEMASK1(11)
192#define M_IO_MULT_CS_INT _SB_MAKEMASK1(12)
193#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
194#define M_IO_COH_ERR _SB_MAKEMASK1(14)
195#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
196
197
198/*
199 * Generic Bus Output Drive Control Register 0 (Table 14-18)
200 */
201
202#define S_IO_SLEW0 0
203#define M_IO_SLEW0 _SB_MAKEMASK(2, S_IO_SLEW0)
204#define V_IO_SLEW0(x) _SB_MAKEVALUE(x, S_IO_SLEW0)
205#define G_IO_SLEW0(x) _SB_GETVALUE(x, S_IO_SLEW0, M_IO_SLEW0)
206
207#define S_IO_DRV_A 2
208#define M_IO_DRV_A _SB_MAKEMASK(2, S_IO_DRV_A)
209#define V_IO_DRV_A(x) _SB_MAKEVALUE(x, S_IO_DRV_A)
210#define G_IO_DRV_A(x) _SB_GETVALUE(x, S_IO_DRV_A, M_IO_DRV_A)
211
212#define S_IO_DRV_B 6
213#define M_IO_DRV_B _SB_MAKEMASK(2, S_IO_DRV_B)
214#define V_IO_DRV_B(x) _SB_MAKEVALUE(x, S_IO_DRV_B)
215#define G_IO_DRV_B(x) _SB_GETVALUE(x, S_IO_DRV_B, M_IO_DRV_B)
216
217#define S_IO_DRV_C 10
218#define M_IO_DRV_C _SB_MAKEMASK(2, S_IO_DRV_C)
219#define V_IO_DRV_C(x) _SB_MAKEVALUE(x, S_IO_DRV_C)
220#define G_IO_DRV_C(x) _SB_GETVALUE(x, S_IO_DRV_C, M_IO_DRV_C)
221
222#define S_IO_DRV_D 14
223#define M_IO_DRV_D _SB_MAKEMASK(2, S_IO_DRV_D)
224#define V_IO_DRV_D(x) _SB_MAKEVALUE(x, S_IO_DRV_D)
225#define G_IO_DRV_D(x) _SB_GETVALUE(x, S_IO_DRV_D, M_IO_DRV_D)
226
227/*
228 * Generic Bus Output Drive Control Register 1 (Table 14-19)
229 */
230
231#define S_IO_DRV_E 2
232#define M_IO_DRV_E _SB_MAKEMASK(2, S_IO_DRV_E)
233#define V_IO_DRV_E(x) _SB_MAKEVALUE(x, S_IO_DRV_E)
234#define G_IO_DRV_E(x) _SB_GETVALUE(x, S_IO_DRV_E, M_IO_DRV_E)
235
236#define S_IO_DRV_F 6
237#define M_IO_DRV_F _SB_MAKEMASK(2, S_IO_DRV_F)
238#define V_IO_DRV_F(x) _SB_MAKEVALUE(x, S_IO_DRV_F)
239#define G_IO_DRV_F(x) _SB_GETVALUE(x, S_IO_DRV_F, M_IO_DRV_F)
240
241#define S_IO_SLEW1 8
242#define M_IO_SLEW1 _SB_MAKEMASK(2, S_IO_SLEW1)
243#define V_IO_SLEW1(x) _SB_MAKEVALUE(x, S_IO_SLEW1)
244#define G_IO_SLEW1(x) _SB_GETVALUE(x, S_IO_SLEW1, M_IO_SLEW1)
245
246#define S_IO_DRV_G 10
247#define M_IO_DRV_G _SB_MAKEMASK(2, S_IO_DRV_G)
248#define V_IO_DRV_G(x) _SB_MAKEVALUE(x, S_IO_DRV_G)
249#define G_IO_DRV_G(x) _SB_GETVALUE(x, S_IO_DRV_G, M_IO_DRV_G)
250
251#define S_IO_SLEW2 12
252#define M_IO_SLEW2 _SB_MAKEMASK(2, S_IO_SLEW2)
253#define V_IO_SLEW2(x) _SB_MAKEVALUE(x, S_IO_SLEW2)
254#define G_IO_SLEW2(x) _SB_GETVALUE(x, S_IO_SLEW2, M_IO_SLEW2)
255
256#define S_IO_DRV_H 14
257#define M_IO_DRV_H _SB_MAKEMASK(2, S_IO_DRV_H)
258#define V_IO_DRV_H(x) _SB_MAKEVALUE(x, S_IO_DRV_H)
259#define G_IO_DRV_H(x) _SB_GETVALUE(x, S_IO_DRV_H, M_IO_DRV_H)
260
261/*
262 * Generic Bus Output Drive Control Register 2 (Table 14-20)
263 */
264
265#define S_IO_DRV_J 2
266#define M_IO_DRV_J _SB_MAKEMASK(2, S_IO_DRV_J)
267#define V_IO_DRV_J(x) _SB_MAKEVALUE(x, S_IO_DRV_J)
268#define G_IO_DRV_J(x) _SB_GETVALUE(x, S_IO_DRV_J, M_IO_DRV_J)
269
270#define S_IO_DRV_K 6
271#define M_IO_DRV_K _SB_MAKEMASK(2, S_IO_DRV_K)
272#define V_IO_DRV_K(x) _SB_MAKEVALUE(x, S_IO_DRV_K)
273#define G_IO_DRV_K(x) _SB_GETVALUE(x, S_IO_DRV_K, M_IO_DRV_K)
274
275#define S_IO_DRV_L 10
276#define M_IO_DRV_L _SB_MAKEMASK(2, S_IO_DRV_L)
277#define V_IO_DRV_L(x) _SB_MAKEVALUE(x, S_IO_DRV_L)
278#define G_IO_DRV_L(x) _SB_GETVALUE(x, S_IO_DRV_L, M_IO_DRV_L)
279
280#define S_IO_DRV_M 14
281#define M_IO_DRV_M _SB_MAKEMASK(2, S_IO_DRV_M)
282#define V_IO_DRV_M(x) _SB_MAKEVALUE(x, S_IO_DRV_M)
283#define G_IO_DRV_M(x) _SB_GETVALUE(x, S_IO_DRV_M, M_IO_DRV_M)
284
285/*
286 * Generic Bus Output Drive Control Register 3 (Table 14-21)
287 */
288
289#define S_IO_SLEW3 0
290#define M_IO_SLEW3 _SB_MAKEMASK(2, S_IO_SLEW3)
291#define V_IO_SLEW3(x) _SB_MAKEVALUE(x, S_IO_SLEW3)
292#define G_IO_SLEW3(x) _SB_GETVALUE(x, S_IO_SLEW3, M_IO_SLEW3)
293
294#define S_IO_DRV_N 2
295#define M_IO_DRV_N _SB_MAKEMASK(2, S_IO_DRV_N)
296#define V_IO_DRV_N(x) _SB_MAKEVALUE(x, S_IO_DRV_N)
297#define G_IO_DRV_N(x) _SB_GETVALUE(x, S_IO_DRV_N, M_IO_DRV_N)
298
299#define S_IO_DRV_P 6
300#define M_IO_DRV_P _SB_MAKEMASK(2, S_IO_DRV_P)
301#define V_IO_DRV_P(x) _SB_MAKEVALUE(x, S_IO_DRV_P)
302#define G_IO_DRV_P(x) _SB_GETVALUE(x, S_IO_DRV_P, M_IO_DRV_P)
303
304#define S_IO_DRV_Q 10
305#define M_IO_DRV_Q _SB_MAKEMASK(2, S_IO_DRV_Q)
306#define V_IO_DRV_Q(x) _SB_MAKEVALUE(x, S_IO_DRV_Q)
307#define G_IO_DRV_Q(x) _SB_GETVALUE(x, S_IO_DRV_Q, M_IO_DRV_Q)
308
309#define S_IO_DRV_R 14
310#define M_IO_DRV_R _SB_MAKEMASK(2, S_IO_DRV_R)
311#define V_IO_DRV_R(x) _SB_MAKEVALUE(x, S_IO_DRV_R)
312#define G_IO_DRV_R(x) _SB_GETVALUE(x, S_IO_DRV_R, M_IO_DRV_R)
313
314
315/*
316 * PCMCIA configuration register (Table 12-6)
317 */
318
319#define M_PCMCIA_CFG_ATTRMEM _SB_MAKEMASK1(0)
320#define M_PCMCIA_CFG_3VEN _SB_MAKEMASK1(1)
321#define M_PCMCIA_CFG_5VEN _SB_MAKEMASK1(2)
322#define M_PCMCIA_CFG_VPPEN _SB_MAKEMASK1(3)
323#define M_PCMCIA_CFG_RESET _SB_MAKEMASK1(4)
324#define M_PCMCIA_CFG_APWRONEN _SB_MAKEMASK1(5)
325#define M_PCMCIA_CFG_CDMASK _SB_MAKEMASK1(6)
326#define M_PCMCIA_CFG_WPMASK _SB_MAKEMASK1(7)
327#define M_PCMCIA_CFG_RDYMASK _SB_MAKEMASK1(8)
328#define M_PCMCIA_CFG_PWRCTL _SB_MAKEMASK1(9)
329
330#if SIBYTE_HDR_FEATURE_CHIP(1480)
331#define S_PCMCIA_MODE 16
332#define M_PCMCIA_MODE _SB_MAKEMASK(3, S_PCMCIA_MODE)
333#define V_PCMCIA_MODE(x) _SB_MAKEVALUE(x, S_PCMCIA_MODE)
334#define G_PCMCIA_MODE(x) _SB_GETVALUE(x, S_PCMCIA_MODE, M_PCMCIA_MODE)
335
336#define K_PCMCIA_MODE_PCMA_NOB 0 /* standard PCMCIA "A", no "B" */
337#define K_PCMCIA_MODE_IDEA_NOB 1 /* IDE "A", no "B" */
338#define K_PCMCIA_MODE_PCMIOA_NOB 2 /* PCMCIA with I/O "A", no "B" */
339#define K_PCMCIA_MODE_PCMA_PCMB 4 /* standard PCMCIA "A", standard PCMCIA "B" */
340#define K_PCMCIA_MODE_IDEA_PCMB 5 /* IDE "A", standard PCMCIA "B" */
341#define K_PCMCIA_MODE_PCMA_IDEB 6 /* standard PCMCIA "A", IDE "B" */
342#define K_PCMCIA_MODE_IDEA_IDEB 7 /* IDE "A", IDE "B" */
343#endif
344
345
346/*
347 * PCMCIA status register (Table 12-7)
348 */
349
350#define M_PCMCIA_STATUS_CD1 _SB_MAKEMASK1(0)
351#define M_PCMCIA_STATUS_CD2 _SB_MAKEMASK1(1)
352#define M_PCMCIA_STATUS_VS1 _SB_MAKEMASK1(2)
353#define M_PCMCIA_STATUS_VS2 _SB_MAKEMASK1(3)
354#define M_PCMCIA_STATUS_WP _SB_MAKEMASK1(4)
355#define M_PCMCIA_STATUS_RDY _SB_MAKEMASK1(5)
356#define M_PCMCIA_STATUS_3VEN _SB_MAKEMASK1(6)
357#define M_PCMCIA_STATUS_5VEN _SB_MAKEMASK1(7)
358#define M_PCMCIA_STATUS_CDCHG _SB_MAKEMASK1(8)
359#define M_PCMCIA_STATUS_WPCHG _SB_MAKEMASK1(9)
360#define M_PCMCIA_STATUS_RDYCHG _SB_MAKEMASK1(10)
361
362/*
363 * GPIO Interrupt Type Register (table 13-3)
364 */
365
366#define K_GPIO_INTR_DISABLE 0
367#define K_GPIO_INTR_EDGE 1
368#define K_GPIO_INTR_LEVEL 2
369#define K_GPIO_INTR_SPLIT 3
370
371#define S_GPIO_INTR_TYPEX(n) (((n)/2)*2)
372#define M_GPIO_INTR_TYPEX(n) _SB_MAKEMASK(2, S_GPIO_INTR_TYPEX(n))
373#define V_GPIO_INTR_TYPEX(n, x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPEX(n))
374#define G_GPIO_INTR_TYPEX(n, x) _SB_GETVALUE(x, S_GPIO_INTR_TYPEX(n), M_GPIO_INTR_TYPEX(n))
375
376#define S_GPIO_INTR_TYPE0 0
377#define M_GPIO_INTR_TYPE0 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE0)
378#define V_GPIO_INTR_TYPE0(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE0)
379#define G_GPIO_INTR_TYPE0(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE0, M_GPIO_INTR_TYPE0)
380
381#define S_GPIO_INTR_TYPE2 2
382#define M_GPIO_INTR_TYPE2 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE2)
383#define V_GPIO_INTR_TYPE2(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE2)
384#define G_GPIO_INTR_TYPE2(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE2, M_GPIO_INTR_TYPE2)
385
386#define S_GPIO_INTR_TYPE4 4
387#define M_GPIO_INTR_TYPE4 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE4)
388#define V_GPIO_INTR_TYPE4(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE4)
389#define G_GPIO_INTR_TYPE4(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE4, M_GPIO_INTR_TYPE4)
390
391#define S_GPIO_INTR_TYPE6 6
392#define M_GPIO_INTR_TYPE6 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE6)
393#define V_GPIO_INTR_TYPE6(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE6)
394#define G_GPIO_INTR_TYPE6(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE6, M_GPIO_INTR_TYPE6)
395
396#define S_GPIO_INTR_TYPE8 8
397#define M_GPIO_INTR_TYPE8 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE8)
398#define V_GPIO_INTR_TYPE8(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE8)
399#define G_GPIO_INTR_TYPE8(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE8, M_GPIO_INTR_TYPE8)
400
401#define S_GPIO_INTR_TYPE10 10
402#define M_GPIO_INTR_TYPE10 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE10)
403#define V_GPIO_INTR_TYPE10(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE10)
404#define G_GPIO_INTR_TYPE10(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE10, M_GPIO_INTR_TYPE10)
405
406#define S_GPIO_INTR_TYPE12 12
407#define M_GPIO_INTR_TYPE12 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE12)
408#define V_GPIO_INTR_TYPE12(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE12)
409#define G_GPIO_INTR_TYPE12(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE12, M_GPIO_INTR_TYPE12)
410
411#define S_GPIO_INTR_TYPE14 14
412#define M_GPIO_INTR_TYPE14 _SB_MAKEMASK(2, S_GPIO_INTR_TYPE14)
413#define V_GPIO_INTR_TYPE14(x) _SB_MAKEVALUE(x, S_GPIO_INTR_TYPE14)
414#define G_GPIO_INTR_TYPE14(x) _SB_GETVALUE(x, S_GPIO_INTR_TYPE14, M_GPIO_INTR_TYPE14)
415
416#if SIBYTE_HDR_FEATURE_CHIP(1480)
417
418/*
419 * GPIO Interrupt Additional Type Register
420 */
421
422#define K_GPIO_INTR_BOTHEDGE 0
423#define K_GPIO_INTR_RISEEDGE 1
424#define K_GPIO_INTR_UNPRED1 2
425#define K_GPIO_INTR_UNPRED2 3
426
427#define S_GPIO_INTR_ATYPEX(n) (((n)/2)*2)
428#define M_GPIO_INTR_ATYPEX(n) _SB_MAKEMASK(2, S_GPIO_INTR_ATYPEX(n))
429#define V_GPIO_INTR_ATYPEX(n, x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPEX(n))
430#define G_GPIO_INTR_ATYPEX(n, x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPEX(n), M_GPIO_INTR_ATYPEX(n))
431
432#define S_GPIO_INTR_ATYPE0 0
433#define M_GPIO_INTR_ATYPE0 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE0)
434#define V_GPIO_INTR_ATYPE0(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE0)
435#define G_GPIO_INTR_ATYPE0(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE0, M_GPIO_INTR_ATYPE0)
436
437#define S_GPIO_INTR_ATYPE2 2
438#define M_GPIO_INTR_ATYPE2 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE2)
439#define V_GPIO_INTR_ATYPE2(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE2)
440#define G_GPIO_INTR_ATYPE2(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE2, M_GPIO_INTR_ATYPE2)
441
442#define S_GPIO_INTR_ATYPE4 4
443#define M_GPIO_INTR_ATYPE4 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE4)
444#define V_GPIO_INTR_ATYPE4(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE4)
445#define G_GPIO_INTR_ATYPE4(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE4, M_GPIO_INTR_ATYPE4)
446
447#define S_GPIO_INTR_ATYPE6 6
448#define M_GPIO_INTR_ATYPE6 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE6)
449#define V_GPIO_INTR_ATYPE6(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE6)
450#define G_GPIO_INTR_ATYPE6(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE6, M_GPIO_INTR_ATYPE6)
451
452#define S_GPIO_INTR_ATYPE8 8
453#define M_GPIO_INTR_ATYPE8 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE8)
454#define V_GPIO_INTR_ATYPE8(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE8)
455#define G_GPIO_INTR_ATYPE8(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE8, M_GPIO_INTR_ATYPE8)
456
457#define S_GPIO_INTR_ATYPE10 10
458#define M_GPIO_INTR_ATYPE10 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE10)
459#define V_GPIO_INTR_ATYPE10(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE10)
460#define G_GPIO_INTR_ATYPE10(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE10, M_GPIO_INTR_ATYPE10)
461
462#define S_GPIO_INTR_ATYPE12 12
463#define M_GPIO_INTR_ATYPE12 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE12)
464#define V_GPIO_INTR_ATYPE12(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE12)
465#define G_GPIO_INTR_ATYPE12(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE12, M_GPIO_INTR_ATYPE12)
466
467#define S_GPIO_INTR_ATYPE14 14
468#define M_GPIO_INTR_ATYPE14 _SB_MAKEMASK(2, S_GPIO_INTR_ATYPE14)
469#define V_GPIO_INTR_ATYPE14(x) _SB_MAKEVALUE(x, S_GPIO_INTR_ATYPE14)
470#define G_GPIO_INTR_ATYPE14(x) _SB_GETVALUE(x, S_GPIO_INTR_ATYPE14, M_GPIO_INTR_ATYPE14)
471#endif
472
473
474#endif
diff --git a/include/asm-mips/sibyte/sb1250_int.h b/include/asm-mips/sibyte/sb1250_int.h
deleted file mode 100644
index f2850b4bcfd4..000000000000
--- a/include/asm-mips/sibyte/sb1250_int.h
+++ /dev/null
@@ -1,248 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * Interrupt Mapper definitions File: sb1250_int.h
5 *
6 * This module contains constants for manipulating the SB1250's
7 * interrupt mapper and definitions for the interrupt sources.
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000, 2001, 2002, 2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_INT_H
34#define _SB1250_INT_H
35
36#include "sb1250_defs.h"
37
38/* *********************************************************************
39 * Interrupt Mapper Constants
40 ********************************************************************* */
41
42/*
43 * Interrupt sources (Table 4-8, UM 0.2)
44 *
45 * First, the interrupt numbers.
46 */
47
48#define K_INT_SOURCES 64
49
50#define K_INT_WATCHDOG_TIMER_0 0
51#define K_INT_WATCHDOG_TIMER_1 1
52#define K_INT_TIMER_0 2
53#define K_INT_TIMER_1 3
54#define K_INT_TIMER_2 4
55#define K_INT_TIMER_3 5
56#define K_INT_SMB_0 6
57#define K_INT_SMB_1 7
58#define K_INT_UART_0 8
59#define K_INT_UART_1 9
60#define K_INT_SER_0 10
61#define K_INT_SER_1 11
62#define K_INT_PCMCIA 12
63#define K_INT_ADDR_TRAP 13
64#define K_INT_PERF_CNT 14
65#define K_INT_TRACE_FREEZE 15
66#define K_INT_BAD_ECC 16
67#define K_INT_COR_ECC 17
68#define K_INT_IO_BUS 18
69#define K_INT_MAC_0 19
70#define K_INT_MAC_1 20
71#define K_INT_MAC_2 21
72#define K_INT_DM_CH_0 22
73#define K_INT_DM_CH_1 23
74#define K_INT_DM_CH_2 24
75#define K_INT_DM_CH_3 25
76#define K_INT_MBOX_0 26
77#define K_INT_MBOX_1 27
78#define K_INT_MBOX_2 28
79#define K_INT_MBOX_3 29
80#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
81#define K_INT_CYCLE_CP0_INT 30
82#define K_INT_CYCLE_CP1_INT 31
83#endif /* 1250 PASS2 || 112x PASS1 */
84#define K_INT_GPIO_0 32
85#define K_INT_GPIO_1 33
86#define K_INT_GPIO_2 34
87#define K_INT_GPIO_3 35
88#define K_INT_GPIO_4 36
89#define K_INT_GPIO_5 37
90#define K_INT_GPIO_6 38
91#define K_INT_GPIO_7 39
92#define K_INT_GPIO_8 40
93#define K_INT_GPIO_9 41
94#define K_INT_GPIO_10 42
95#define K_INT_GPIO_11 43
96#define K_INT_GPIO_12 44
97#define K_INT_GPIO_13 45
98#define K_INT_GPIO_14 46
99#define K_INT_GPIO_15 47
100#define K_INT_LDT_FATAL 48
101#define K_INT_LDT_NONFATAL 49
102#define K_INT_LDT_SMI 50
103#define K_INT_LDT_NMI 51
104#define K_INT_LDT_INIT 52
105#define K_INT_LDT_STARTUP 53
106#define K_INT_LDT_EXT 54
107#define K_INT_PCI_ERROR 55
108#define K_INT_PCI_INTA 56
109#define K_INT_PCI_INTB 57
110#define K_INT_PCI_INTC 58
111#define K_INT_PCI_INTD 59
112#define K_INT_SPARE_2 60
113#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
114#define K_INT_MAC_0_CH1 61
115#define K_INT_MAC_1_CH1 62
116#define K_INT_MAC_2_CH1 63
117#endif /* 1250 PASS2 || 112x PASS1 */
118
119/*
120 * Mask values for each interrupt
121 */
122
123#define M_INT_WATCHDOG_TIMER_0 _SB_MAKEMASK1(K_INT_WATCHDOG_TIMER_0)
124#define M_INT_WATCHDOG_TIMER_1 _SB_MAKEMASK1(K_INT_WATCHDOG_TIMER_1)
125#define M_INT_TIMER_0 _SB_MAKEMASK1(K_INT_TIMER_0)
126#define M_INT_TIMER_1 _SB_MAKEMASK1(K_INT_TIMER_1)
127#define M_INT_TIMER_2 _SB_MAKEMASK1(K_INT_TIMER_2)
128#define M_INT_TIMER_3 _SB_MAKEMASK1(K_INT_TIMER_3)
129#define M_INT_SMB_0 _SB_MAKEMASK1(K_INT_SMB_0)
130#define M_INT_SMB_1 _SB_MAKEMASK1(K_INT_SMB_1)
131#define M_INT_UART_0 _SB_MAKEMASK1(K_INT_UART_0)
132#define M_INT_UART_1 _SB_MAKEMASK1(K_INT_UART_1)
133#define M_INT_SER_0 _SB_MAKEMASK1(K_INT_SER_0)
134#define M_INT_SER_1 _SB_MAKEMASK1(K_INT_SER_1)
135#define M_INT_PCMCIA _SB_MAKEMASK1(K_INT_PCMCIA)
136#define M_INT_ADDR_TRAP _SB_MAKEMASK1(K_INT_ADDR_TRAP)
137#define M_INT_PERF_CNT _SB_MAKEMASK1(K_INT_PERF_CNT)
138#define M_INT_TRACE_FREEZE _SB_MAKEMASK1(K_INT_TRACE_FREEZE)
139#define M_INT_BAD_ECC _SB_MAKEMASK1(K_INT_BAD_ECC)
140#define M_INT_COR_ECC _SB_MAKEMASK1(K_INT_COR_ECC)
141#define M_INT_IO_BUS _SB_MAKEMASK1(K_INT_IO_BUS)
142#define M_INT_MAC_0 _SB_MAKEMASK1(K_INT_MAC_0)
143#define M_INT_MAC_1 _SB_MAKEMASK1(K_INT_MAC_1)
144#define M_INT_MAC_2 _SB_MAKEMASK1(K_INT_MAC_2)
145#define M_INT_DM_CH_0 _SB_MAKEMASK1(K_INT_DM_CH_0)
146#define M_INT_DM_CH_1 _SB_MAKEMASK1(K_INT_DM_CH_1)
147#define M_INT_DM_CH_2 _SB_MAKEMASK1(K_INT_DM_CH_2)
148#define M_INT_DM_CH_3 _SB_MAKEMASK1(K_INT_DM_CH_3)
149#define M_INT_MBOX_0 _SB_MAKEMASK1(K_INT_MBOX_0)
150#define M_INT_MBOX_1 _SB_MAKEMASK1(K_INT_MBOX_1)
151#define M_INT_MBOX_2 _SB_MAKEMASK1(K_INT_MBOX_2)
152#define M_INT_MBOX_3 _SB_MAKEMASK1(K_INT_MBOX_3)
153#define M_INT_MBOX_ALL _SB_MAKEMASK(4, K_INT_MBOX_0)
154#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
155#define M_INT_CYCLE_CP0_INT _SB_MAKEMASK1(K_INT_CYCLE_CP0_INT)
156#define M_INT_CYCLE_CP1_INT _SB_MAKEMASK1(K_INT_CYCLE_CP1_INT)
157#endif /* 1250 PASS2 || 112x PASS1 */
158#define M_INT_GPIO_0 _SB_MAKEMASK1(K_INT_GPIO_0)
159#define M_INT_GPIO_1 _SB_MAKEMASK1(K_INT_GPIO_1)
160#define M_INT_GPIO_2 _SB_MAKEMASK1(K_INT_GPIO_2)
161#define M_INT_GPIO_3 _SB_MAKEMASK1(K_INT_GPIO_3)
162#define M_INT_GPIO_4 _SB_MAKEMASK1(K_INT_GPIO_4)
163#define M_INT_GPIO_5 _SB_MAKEMASK1(K_INT_GPIO_5)
164#define M_INT_GPIO_6 _SB_MAKEMASK1(K_INT_GPIO_6)
165#define M_INT_GPIO_7 _SB_MAKEMASK1(K_INT_GPIO_7)
166#define M_INT_GPIO_8 _SB_MAKEMASK1(K_INT_GPIO_8)
167#define M_INT_GPIO_9 _SB_MAKEMASK1(K_INT_GPIO_9)
168#define M_INT_GPIO_10 _SB_MAKEMASK1(K_INT_GPIO_10)
169#define M_INT_GPIO_11 _SB_MAKEMASK1(K_INT_GPIO_11)
170#define M_INT_GPIO_12 _SB_MAKEMASK1(K_INT_GPIO_12)
171#define M_INT_GPIO_13 _SB_MAKEMASK1(K_INT_GPIO_13)
172#define M_INT_GPIO_14 _SB_MAKEMASK1(K_INT_GPIO_14)
173#define M_INT_GPIO_15 _SB_MAKEMASK1(K_INT_GPIO_15)
174#define M_INT_LDT_FATAL _SB_MAKEMASK1(K_INT_LDT_FATAL)
175#define M_INT_LDT_NONFATAL _SB_MAKEMASK1(K_INT_LDT_NONFATAL)
176#define M_INT_LDT_SMI _SB_MAKEMASK1(K_INT_LDT_SMI)
177#define M_INT_LDT_NMI _SB_MAKEMASK1(K_INT_LDT_NMI)
178#define M_INT_LDT_INIT _SB_MAKEMASK1(K_INT_LDT_INIT)
179#define M_INT_LDT_STARTUP _SB_MAKEMASK1(K_INT_LDT_STARTUP)
180#define M_INT_LDT_EXT _SB_MAKEMASK1(K_INT_LDT_EXT)
181#define M_INT_PCI_ERROR _SB_MAKEMASK1(K_INT_PCI_ERROR)
182#define M_INT_PCI_INTA _SB_MAKEMASK1(K_INT_PCI_INTA)
183#define M_INT_PCI_INTB _SB_MAKEMASK1(K_INT_PCI_INTB)
184#define M_INT_PCI_INTC _SB_MAKEMASK1(K_INT_PCI_INTC)
185#define M_INT_PCI_INTD _SB_MAKEMASK1(K_INT_PCI_INTD)
186#define M_INT_SPARE_2 _SB_MAKEMASK1(K_INT_SPARE_2)
187#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
188#define M_INT_MAC_0_CH1 _SB_MAKEMASK1(K_INT_MAC_0_CH1)
189#define M_INT_MAC_1_CH1 _SB_MAKEMASK1(K_INT_MAC_1_CH1)
190#define M_INT_MAC_2_CH1 _SB_MAKEMASK1(K_INT_MAC_2_CH1)
191#endif /* 1250 PASS2 || 112x PASS1 */
192
193/*
194 * Interrupt mappings
195 */
196
197#define K_INT_MAP_I0 0 /* interrupt pins on processor */
198#define K_INT_MAP_I1 1
199#define K_INT_MAP_I2 2
200#define K_INT_MAP_I3 3
201#define K_INT_MAP_I4 4
202#define K_INT_MAP_I5 5
203#define K_INT_MAP_NMI 6 /* nonmaskable */
204#define K_INT_MAP_DINT 7 /* debug interrupt */
205
206/*
207 * LDT Interrupt Set Register (table 4-5)
208 */
209
210#define S_INT_LDT_INTMSG 0
211#define M_INT_LDT_INTMSG _SB_MAKEMASK(3, S_INT_LDT_INTMSG)
212#define V_INT_LDT_INTMSG(x) _SB_MAKEVALUE(x, S_INT_LDT_INTMSG)
213#define G_INT_LDT_INTMSG(x) _SB_GETVALUE(x, S_INT_LDT_INTMSG, M_INT_LDT_INTMSG)
214
215#define K_INT_LDT_INTMSG_FIXED 0
216#define K_INT_LDT_INTMSG_ARBITRATED 1
217#define K_INT_LDT_INTMSG_SMI 2
218#define K_INT_LDT_INTMSG_NMI 3
219#define K_INT_LDT_INTMSG_INIT 4
220#define K_INT_LDT_INTMSG_STARTUP 5
221#define K_INT_LDT_INTMSG_EXTINT 6
222#define K_INT_LDT_INTMSG_RESERVED 7
223
224#define M_INT_LDT_EDGETRIGGER 0
225#define M_INT_LDT_LEVELTRIGGER _SB_MAKEMASK1(3)
226
227#define M_INT_LDT_PHYSICALDEST 0
228#define M_INT_LDT_LOGICALDEST _SB_MAKEMASK1(4)
229
230#define S_INT_LDT_INTDEST 5
231#define M_INT_LDT_INTDEST _SB_MAKEMASK(10, S_INT_LDT_INTDEST)
232#define V_INT_LDT_INTDEST(x) _SB_MAKEVALUE(x, S_INT_LDT_INTDEST)
233#define G_INT_LDT_INTDEST(x) _SB_GETVALUE(x, S_INT_LDT_INTDEST, M_INT_LDT_INTDEST)
234
235#define S_INT_LDT_VECTOR 13
236#define M_INT_LDT_VECTOR _SB_MAKEMASK(8, S_INT_LDT_VECTOR)
237#define V_INT_LDT_VECTOR(x) _SB_MAKEVALUE(x, S_INT_LDT_VECTOR)
238#define G_INT_LDT_VECTOR(x) _SB_GETVALUE(x, S_INT_LDT_VECTOR, M_INT_LDT_VECTOR)
239
240/*
241 * Vector format (Table 4-6)
242 */
243
244#define M_LDTVECT_RAISEINT 0x00
245#define M_LDTVECT_RAISEMBOX 0x40
246
247
248#endif /* 1250/112x */
diff --git a/include/asm-mips/sibyte/sb1250_l2c.h b/include/asm-mips/sibyte/sb1250_l2c.h
deleted file mode 100644
index 6554dcf05cfe..000000000000
--- a/include/asm-mips/sibyte/sb1250_l2c.h
+++ /dev/null
@@ -1,131 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * L2 Cache constants and macros File: sb1250_l2c.h
5 *
6 * This module contains constants useful for manipulating the
7 * level 2 cache.
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_L2C_H
34#define _SB1250_L2C_H
35
36#include "sb1250_defs.h"
37
38/*
39 * Level 2 Cache Tag register (Table 5-3)
40 */
41
42#define S_L2C_TAG_MBZ 0
43#define M_L2C_TAG_MBZ _SB_MAKEMASK(5, S_L2C_TAG_MBZ)
44
45#define S_L2C_TAG_INDEX 5
46#define M_L2C_TAG_INDEX _SB_MAKEMASK(12, S_L2C_TAG_INDEX)
47#define V_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x, S_L2C_TAG_INDEX)
48#define G_L2C_TAG_INDEX(x) _SB_GETVALUE(x, S_L2C_TAG_INDEX, M_L2C_TAG_INDEX)
49
50#define S_L2C_TAG_TAG 17
51#define M_L2C_TAG_TAG _SB_MAKEMASK(23, S_L2C_TAG_TAG)
52#define V_L2C_TAG_TAG(x) _SB_MAKEVALUE(x, S_L2C_TAG_TAG)
53#define G_L2C_TAG_TAG(x) _SB_GETVALUE(x, S_L2C_TAG_TAG, M_L2C_TAG_TAG)
54
55#define S_L2C_TAG_ECC 40
56#define M_L2C_TAG_ECC _SB_MAKEMASK(6, S_L2C_TAG_ECC)
57#define V_L2C_TAG_ECC(x) _SB_MAKEVALUE(x, S_L2C_TAG_ECC)
58#define G_L2C_TAG_ECC(x) _SB_GETVALUE(x, S_L2C_TAG_ECC, M_L2C_TAG_ECC)
59
60#define S_L2C_TAG_WAY 46
61#define M_L2C_TAG_WAY _SB_MAKEMASK(2, S_L2C_TAG_WAY)
62#define V_L2C_TAG_WAY(x) _SB_MAKEVALUE(x, S_L2C_TAG_WAY)
63#define G_L2C_TAG_WAY(x) _SB_GETVALUE(x, S_L2C_TAG_WAY, M_L2C_TAG_WAY)
64
65#define M_L2C_TAG_DIRTY _SB_MAKEMASK1(48)
66#define M_L2C_TAG_VALID _SB_MAKEMASK1(49)
67
68/*
69 * Format of level 2 cache management address (table 5-2)
70 */
71
72#define S_L2C_MGMT_INDEX 5
73#define M_L2C_MGMT_INDEX _SB_MAKEMASK(12, S_L2C_MGMT_INDEX)
74#define V_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x, S_L2C_MGMT_INDEX)
75#define G_L2C_MGMT_INDEX(x) _SB_GETVALUE(x, S_L2C_MGMT_INDEX, M_L2C_MGMT_INDEX)
76
77#define S_L2C_MGMT_QUADRANT 15
78#define M_L2C_MGMT_QUADRANT _SB_MAKEMASK(2, S_L2C_MGMT_QUADRANT)
79#define V_L2C_MGMT_QUADRANT(x) _SB_MAKEVALUE(x, S_L2C_MGMT_QUADRANT)
80#define G_L2C_MGMT_QUADRANT(x) _SB_GETVALUE(x, S_L2C_MGMT_QUADRANT, M_L2C_MGMT_QUADRANT)
81
82#define S_L2C_MGMT_HALF 16
83#define M_L2C_MGMT_HALF _SB_MAKEMASK(1, S_L2C_MGMT_HALF)
84
85#define S_L2C_MGMT_WAY 17
86#define M_L2C_MGMT_WAY _SB_MAKEMASK(2, S_L2C_MGMT_WAY)
87#define V_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x, S_L2C_MGMT_WAY)
88#define G_L2C_MGMT_WAY(x) _SB_GETVALUE(x, S_L2C_MGMT_WAY, M_L2C_MGMT_WAY)
89
90#define S_L2C_MGMT_ECC_DIAG 21
91#define M_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2, S_L2C_MGMT_ECC_DIAG)
92#define V_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x, S_L2C_MGMT_ECC_DIAG)
93#define G_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x, S_L2C_MGMT_ECC_DIAG, M_L2C_MGMT_ECC_DIAG)
94
95#define S_L2C_MGMT_TAG 23
96#define M_L2C_MGMT_TAG _SB_MAKEMASK(4, S_L2C_MGMT_TAG)
97#define V_L2C_MGMT_TAG(x) _SB_MAKEVALUE(x, S_L2C_MGMT_TAG)
98#define G_L2C_MGMT_TAG(x) _SB_GETVALUE(x, S_L2C_MGMT_TAG, M_L2C_MGMT_TAG)
99
100#define M_L2C_MGMT_DIRTY _SB_MAKEMASK1(19)
101#define M_L2C_MGMT_VALID _SB_MAKEMASK1(20)
102
103#define A_L2C_MGMT_TAG_BASE 0x00D0000000
104
105#define L2C_ENTRIES_PER_WAY 4096
106#define L2C_NUM_WAYS 4
107
108
109#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
110/*
111 * L2 Read Misc. register (A_L2_READ_MISC)
112 */
113#define S_L2C_MISC_NO_WAY 10
114#define M_L2C_MISC_NO_WAY _SB_MAKEMASK(4, S_L2C_MISC_NO_WAY)
115#define V_L2C_MISC_NO_WAY(x) _SB_MAKEVALUE(x, S_L2C_MISC_NO_WAY)
116#define G_L2C_MISC_NO_WAY(x) _SB_GETVALUE(x, S_L2C_MISC_NO_WAY, M_L2C_MISC_NO_WAY)
117
118#define M_L2C_MISC_ECC_CLEANUP_DIS _SB_MAKEMASK1(9)
119#define M_L2C_MISC_MC_PRIO_LOW _SB_MAKEMASK1(8)
120#define M_L2C_MISC_SOFT_DISABLE_T _SB_MAKEMASK1(7)
121#define M_L2C_MISC_SOFT_DISABLE_B _SB_MAKEMASK1(6)
122#define M_L2C_MISC_SOFT_DISABLE_R _SB_MAKEMASK1(5)
123#define M_L2C_MISC_SOFT_DISABLE_L _SB_MAKEMASK1(4)
124#define M_L2C_MISC_SCACHE_DISABLE_T _SB_MAKEMASK1(3)
125#define M_L2C_MISC_SCACHE_DISABLE_B _SB_MAKEMASK1(2)
126#define M_L2C_MISC_SCACHE_DISABLE_R _SB_MAKEMASK1(1)
127#define M_L2C_MISC_SCACHE_DISABLE_L _SB_MAKEMASK1(0)
128#endif /* 1250 PASS3 || 112x PASS1 */
129
130
131#endif
diff --git a/include/asm-mips/sibyte/sb1250_ldt.h b/include/asm-mips/sibyte/sb1250_ldt.h
deleted file mode 100644
index 081e8b1c4ad0..000000000000
--- a/include/asm-mips/sibyte/sb1250_ldt.h
+++ /dev/null
@@ -1,423 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * LDT constants File: sb1250_ldt.h
5 *
6 * This module contains constants and macros to describe
7 * the LDT interface on the SB1250.
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000, 2001, 2002, 2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_LDT_H
34#define _SB1250_LDT_H
35
36#include "sb1250_defs.h"
37
38#define K_LDT_VENDOR_SIBYTE 0x166D
39#define K_LDT_DEVICE_SB1250 0x0002
40
41/*
42 * LDT Interface Type 1 (bridge) configuration header
43 */
44
45#define R_LDT_TYPE1_DEVICEID 0x0000
46#define R_LDT_TYPE1_CMDSTATUS 0x0004
47#define R_LDT_TYPE1_CLASSREV 0x0008
48#define R_LDT_TYPE1_DEVHDR 0x000C
49#define R_LDT_TYPE1_BAR0 0x0010 /* not used */
50#define R_LDT_TYPE1_BAR1 0x0014 /* not used */
51
52#define R_LDT_TYPE1_BUSID 0x0018 /* bus ID register */
53#define R_LDT_TYPE1_SECSTATUS 0x001C /* secondary status / I/O base/limit */
54#define R_LDT_TYPE1_MEMLIMIT 0x0020
55#define R_LDT_TYPE1_PREFETCH 0x0024
56#define R_LDT_TYPE1_PREF_BASE 0x0028
57#define R_LDT_TYPE1_PREF_LIMIT 0x002C
58#define R_LDT_TYPE1_IOLIMIT 0x0030
59#define R_LDT_TYPE1_CAPPTR 0x0034
60#define R_LDT_TYPE1_ROMADDR 0x0038
61#define R_LDT_TYPE1_BRCTL 0x003C
62#define R_LDT_TYPE1_CMD 0x0040
63#define R_LDT_TYPE1_LINKCTRL 0x0044
64#define R_LDT_TYPE1_LINKFREQ 0x0048
65#define R_LDT_TYPE1_RESERVED1 0x004C
66#define R_LDT_TYPE1_SRICMD 0x0050
67#define R_LDT_TYPE1_SRITXNUM 0x0054
68#define R_LDT_TYPE1_SRIRXNUM 0x0058
69#define R_LDT_TYPE1_ERRSTATUS 0x0068
70#define R_LDT_TYPE1_SRICTRL 0x006C
71#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
72#define R_LDT_TYPE1_ADDSTATUS 0x0070
73#endif /* 1250 PASS2 || 112x PASS1 */
74#define R_LDT_TYPE1_TXBUFCNT 0x00C8
75#define R_LDT_TYPE1_EXPCRC 0x00DC
76#define R_LDT_TYPE1_RXCRC 0x00F0
77
78
79/*
80 * LDT Device ID register
81 */
82
83#define S_LDT_DEVICEID_VENDOR 0
84#define M_LDT_DEVICEID_VENDOR _SB_MAKEMASK_32(16, S_LDT_DEVICEID_VENDOR)
85#define V_LDT_DEVICEID_VENDOR(x) _SB_MAKEVALUE_32(x, S_LDT_DEVICEID_VENDOR)
86#define G_LDT_DEVICEID_VENDOR(x) _SB_GETVALUE_32(x, S_LDT_DEVICEID_VENDOR, M_LDT_DEVICEID_VENDOR)
87
88#define S_LDT_DEVICEID_DEVICEID 16
89#define M_LDT_DEVICEID_DEVICEID _SB_MAKEMASK_32(16, S_LDT_DEVICEID_DEVICEID)
90#define V_LDT_DEVICEID_DEVICEID(x) _SB_MAKEVALUE_32(x, S_LDT_DEVICEID_DEVICEID)
91#define G_LDT_DEVICEID_DEVICEID(x) _SB_GETVALUE_32(x, S_LDT_DEVICEID_DEVICEID, M_LDT_DEVICEID_DEVICEID)
92
93
94/*
95 * LDT Command Register (Table 8-13)
96 */
97
98#define M_LDT_CMD_IOSPACE_EN _SB_MAKEMASK1_32(0)
99#define M_LDT_CMD_MEMSPACE_EN _SB_MAKEMASK1_32(1)
100#define M_LDT_CMD_MASTER_EN _SB_MAKEMASK1_32(2)
101#define M_LDT_CMD_SPECCYC_EN _SB_MAKEMASK1_32(3)
102#define M_LDT_CMD_MEMWRINV_EN _SB_MAKEMASK1_32(4)
103#define M_LDT_CMD_VGAPALSNP_EN _SB_MAKEMASK1_32(5)
104#define M_LDT_CMD_PARERRRESP _SB_MAKEMASK1_32(6)
105#define M_LDT_CMD_WAITCYCCTRL _SB_MAKEMASK1_32(7)
106#define M_LDT_CMD_SERR_EN _SB_MAKEMASK1_32(8)
107#define M_LDT_CMD_FASTB2B_EN _SB_MAKEMASK1_32(9)
108
109/*
110 * LDT class and revision registers
111 */
112
113#define S_LDT_CLASSREV_REV 0
114#define M_LDT_CLASSREV_REV _SB_MAKEMASK_32(8, S_LDT_CLASSREV_REV)
115#define V_LDT_CLASSREV_REV(x) _SB_MAKEVALUE_32(x, S_LDT_CLASSREV_REV)
116#define G_LDT_CLASSREV_REV(x) _SB_GETVALUE_32(x, S_LDT_CLASSREV_REV, M_LDT_CLASSREV_REV)
117
118#define S_LDT_CLASSREV_CLASS 8
119#define M_LDT_CLASSREV_CLASS _SB_MAKEMASK_32(24, S_LDT_CLASSREV_CLASS)
120#define V_LDT_CLASSREV_CLASS(x) _SB_MAKEVALUE_32(x, S_LDT_CLASSREV_CLASS)
121#define G_LDT_CLASSREV_CLASS(x) _SB_GETVALUE_32(x, S_LDT_CLASSREV_CLASS, M_LDT_CLASSREV_CLASS)
122
123#define K_LDT_REV 0x01
124#define K_LDT_CLASS 0x060000
125
126/*
127 * Device Header (offset 0x0C)
128 */
129
130#define S_LDT_DEVHDR_CLINESZ 0
131#define M_LDT_DEVHDR_CLINESZ _SB_MAKEMASK_32(8, S_LDT_DEVHDR_CLINESZ)
132#define V_LDT_DEVHDR_CLINESZ(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_CLINESZ)
133#define G_LDT_DEVHDR_CLINESZ(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_CLINESZ, M_LDT_DEVHDR_CLINESZ)
134
135#define S_LDT_DEVHDR_LATTMR 8
136#define M_LDT_DEVHDR_LATTMR _SB_MAKEMASK_32(8, S_LDT_DEVHDR_LATTMR)
137#define V_LDT_DEVHDR_LATTMR(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_LATTMR)
138#define G_LDT_DEVHDR_LATTMR(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_LATTMR, M_LDT_DEVHDR_LATTMR)
139
140#define S_LDT_DEVHDR_HDRTYPE 16
141#define M_LDT_DEVHDR_HDRTYPE _SB_MAKEMASK_32(8, S_LDT_DEVHDR_HDRTYPE)
142#define V_LDT_DEVHDR_HDRTYPE(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_HDRTYPE)
143#define G_LDT_DEVHDR_HDRTYPE(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_HDRTYPE, M_LDT_DEVHDR_HDRTYPE)
144
145#define K_LDT_DEVHDR_HDRTYPE_TYPE1 1
146
147#define S_LDT_DEVHDR_BIST 24
148#define M_LDT_DEVHDR_BIST _SB_MAKEMASK_32(8, S_LDT_DEVHDR_BIST)
149#define V_LDT_DEVHDR_BIST(x) _SB_MAKEVALUE_32(x, S_LDT_DEVHDR_BIST)
150#define G_LDT_DEVHDR_BIST(x) _SB_GETVALUE_32(x, S_LDT_DEVHDR_BIST, M_LDT_DEVHDR_BIST)
151
152
153
154/*
155 * LDT Status Register (Table 8-14). Note that these constants
156 * assume you've read the command and status register
157 * together (32-bit read at offset 0x04)
158 *
159 * These bits also apply to the secondary status
160 * register (Table 8-15), offset 0x1C
161 */
162
163#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
164#define M_LDT_STATUS_VGAEN _SB_MAKEMASK1_32(3)
165#endif /* 1250 PASS2 || 112x PASS1 */
166#define M_LDT_STATUS_CAPLIST _SB_MAKEMASK1_32(20)
167#define M_LDT_STATUS_66MHZCAP _SB_MAKEMASK1_32(21)
168#define M_LDT_STATUS_RESERVED2 _SB_MAKEMASK1_32(22)
169#define M_LDT_STATUS_FASTB2BCAP _SB_MAKEMASK1_32(23)
170#define M_LDT_STATUS_MSTRDPARERR _SB_MAKEMASK1_32(24)
171
172#define S_LDT_STATUS_DEVSELTIMING 25
173#define M_LDT_STATUS_DEVSELTIMING _SB_MAKEMASK_32(2, S_LDT_STATUS_DEVSELTIMING)
174#define V_LDT_STATUS_DEVSELTIMING(x) _SB_MAKEVALUE_32(x, S_LDT_STATUS_DEVSELTIMING)
175#define G_LDT_STATUS_DEVSELTIMING(x) _SB_GETVALUE_32(x, S_LDT_STATUS_DEVSELTIMING, M_LDT_STATUS_DEVSELTIMING)
176
177#define M_LDT_STATUS_SIGDTGTABORT _SB_MAKEMASK1_32(27)
178#define M_LDT_STATUS_RCVDTGTABORT _SB_MAKEMASK1_32(28)
179#define M_LDT_STATUS_RCVDMSTRABORT _SB_MAKEMASK1_32(29)
180#define M_LDT_STATUS_SIGDSERR _SB_MAKEMASK1_32(30)
181#define M_LDT_STATUS_DETPARERR _SB_MAKEMASK1_32(31)
182
183/*
184 * Bridge Control Register (Table 8-16). Note that these
185 * constants assume you've read the register as a 32-bit
186 * read (offset 0x3C)
187 */
188
189#define M_LDT_BRCTL_PARERRRESP_EN _SB_MAKEMASK1_32(16)
190#define M_LDT_BRCTL_SERR_EN _SB_MAKEMASK1_32(17)
191#define M_LDT_BRCTL_ISA_EN _SB_MAKEMASK1_32(18)
192#define M_LDT_BRCTL_VGA_EN _SB_MAKEMASK1_32(19)
193#define M_LDT_BRCTL_MSTRABORTMODE _SB_MAKEMASK1_32(21)
194#define M_LDT_BRCTL_SECBUSRESET _SB_MAKEMASK1_32(22)
195#define M_LDT_BRCTL_FASTB2B_EN _SB_MAKEMASK1_32(23)
196#define M_LDT_BRCTL_PRIDISCARD _SB_MAKEMASK1_32(24)
197#define M_LDT_BRCTL_SECDISCARD _SB_MAKEMASK1_32(25)
198#define M_LDT_BRCTL_DISCARDSTAT _SB_MAKEMASK1_32(26)
199#define M_LDT_BRCTL_DISCARDSERR_EN _SB_MAKEMASK1_32(27)
200
201/*
202 * LDT Command Register (Table 8-17). Note that these constants
203 * assume you've read the command and status register together
204 * 32-bit read at offset 0x40
205 */
206
207#define M_LDT_CMD_WARMRESET _SB_MAKEMASK1_32(16)
208#define M_LDT_CMD_DOUBLEENDED _SB_MAKEMASK1_32(17)
209
210#define S_LDT_CMD_CAPTYPE 29
211#define M_LDT_CMD_CAPTYPE _SB_MAKEMASK_32(3, S_LDT_CMD_CAPTYPE)
212#define V_LDT_CMD_CAPTYPE(x) _SB_MAKEVALUE_32(x, S_LDT_CMD_CAPTYPE)
213#define G_LDT_CMD_CAPTYPE(x) _SB_GETVALUE_32(x, S_LDT_CMD_CAPTYPE, M_LDT_CMD_CAPTYPE)
214
215/*
216 * LDT link control register (Table 8-18), and (Table 8-19)
217 */
218
219#define M_LDT_LINKCTRL_CAPSYNCFLOOD_EN _SB_MAKEMASK1_32(1)
220#define M_LDT_LINKCTRL_CRCSTARTTEST _SB_MAKEMASK1_32(2)
221#define M_LDT_LINKCTRL_CRCFORCEERR _SB_MAKEMASK1_32(3)
222#define M_LDT_LINKCTRL_LINKFAIL _SB_MAKEMASK1_32(4)
223#define M_LDT_LINKCTRL_INITDONE _SB_MAKEMASK1_32(5)
224#define M_LDT_LINKCTRL_EOC _SB_MAKEMASK1_32(6)
225#define M_LDT_LINKCTRL_XMITOFF _SB_MAKEMASK1_32(7)
226
227#define S_LDT_LINKCTRL_CRCERR 8
228#define M_LDT_LINKCTRL_CRCERR _SB_MAKEMASK_32(4, S_LDT_LINKCTRL_CRCERR)
229#define V_LDT_LINKCTRL_CRCERR(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_CRCERR)
230#define G_LDT_LINKCTRL_CRCERR(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_CRCERR, M_LDT_LINKCTRL_CRCERR)
231
232#define S_LDT_LINKCTRL_MAXIN 16
233#define M_LDT_LINKCTRL_MAXIN _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_MAXIN)
234#define V_LDT_LINKCTRL_MAXIN(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_MAXIN)
235#define G_LDT_LINKCTRL_MAXIN(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_MAXIN, M_LDT_LINKCTRL_MAXIN)
236
237#define M_LDT_LINKCTRL_DWFCLN _SB_MAKEMASK1_32(19)
238
239#define S_LDT_LINKCTRL_MAXOUT 20
240#define M_LDT_LINKCTRL_MAXOUT _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_MAXOUT)
241#define V_LDT_LINKCTRL_MAXOUT(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_MAXOUT)
242#define G_LDT_LINKCTRL_MAXOUT(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_MAXOUT, M_LDT_LINKCTRL_MAXOUT)
243
244#define M_LDT_LINKCTRL_DWFCOUT _SB_MAKEMASK1_32(23)
245
246#define S_LDT_LINKCTRL_WIDTHIN 24
247#define M_LDT_LINKCTRL_WIDTHIN _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_WIDTHIN)
248#define V_LDT_LINKCTRL_WIDTHIN(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_WIDTHIN)
249#define G_LDT_LINKCTRL_WIDTHIN(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_WIDTHIN, M_LDT_LINKCTRL_WIDTHIN)
250
251#define M_LDT_LINKCTRL_DWFCLIN_EN _SB_MAKEMASK1_32(27)
252
253#define S_LDT_LINKCTRL_WIDTHOUT 28
254#define M_LDT_LINKCTRL_WIDTHOUT _SB_MAKEMASK_32(3, S_LDT_LINKCTRL_WIDTHOUT)
255#define V_LDT_LINKCTRL_WIDTHOUT(x) _SB_MAKEVALUE_32(x, S_LDT_LINKCTRL_WIDTHOUT)
256#define G_LDT_LINKCTRL_WIDTHOUT(x) _SB_GETVALUE_32(x, S_LDT_LINKCTRL_WIDTHOUT, M_LDT_LINKCTRL_WIDTHOUT)
257
258#define M_LDT_LINKCTRL_DWFCOUT_EN _SB_MAKEMASK1_32(31)
259
260/*
261 * LDT Link frequency register (Table 8-20) offset 0x48
262 */
263
264#define S_LDT_LINKFREQ_FREQ 8
265#define M_LDT_LINKFREQ_FREQ _SB_MAKEMASK_32(4, S_LDT_LINKFREQ_FREQ)
266#define V_LDT_LINKFREQ_FREQ(x) _SB_MAKEVALUE_32(x, S_LDT_LINKFREQ_FREQ)
267#define G_LDT_LINKFREQ_FREQ(x) _SB_GETVALUE_32(x, S_LDT_LINKFREQ_FREQ, M_LDT_LINKFREQ_FREQ)
268
269#define K_LDT_LINKFREQ_200MHZ 0
270#define K_LDT_LINKFREQ_300MHZ 1
271#define K_LDT_LINKFREQ_400MHZ 2
272#define K_LDT_LINKFREQ_500MHZ 3
273#define K_LDT_LINKFREQ_600MHZ 4
274#define K_LDT_LINKFREQ_800MHZ 5
275#define K_LDT_LINKFREQ_1000MHZ 6
276
277/*
278 * LDT SRI Command Register (Table 8-21). Note that these constants
279 * assume you've read the command and status register together
280 * 32-bit read at offset 0x50
281 */
282
283#define M_LDT_SRICMD_SIPREADY _SB_MAKEMASK1_32(16)
284#define M_LDT_SRICMD_SYNCPTRCTL _SB_MAKEMASK1_32(17)
285#define M_LDT_SRICMD_REDUCESYNCZERO _SB_MAKEMASK1_32(18)
286#if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1)
287#define M_LDT_SRICMD_DISSTARVATIONCNT _SB_MAKEMASK1_32(19) /* PASS1 */
288#endif /* up to 1250 PASS1 */
289#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
290#define M_LDT_SRICMD_DISMULTTXVLD _SB_MAKEMASK1_32(19)
291#define M_LDT_SRICMD_EXPENDIAN _SB_MAKEMASK1_32(26)
292#endif /* 1250 PASS2 || 112x PASS1 */
293
294
295#define S_LDT_SRICMD_RXMARGIN 20
296#define M_LDT_SRICMD_RXMARGIN _SB_MAKEMASK_32(5, S_LDT_SRICMD_RXMARGIN)
297#define V_LDT_SRICMD_RXMARGIN(x) _SB_MAKEVALUE_32(x, S_LDT_SRICMD_RXMARGIN)
298#define G_LDT_SRICMD_RXMARGIN(x) _SB_GETVALUE_32(x, S_LDT_SRICMD_RXMARGIN, M_LDT_SRICMD_RXMARGIN)
299
300#define M_LDT_SRICMD_LDTPLLCOMPAT _SB_MAKEMASK1_32(25)
301
302#define S_LDT_SRICMD_TXINITIALOFFSET 28
303#define M_LDT_SRICMD_TXINITIALOFFSET _SB_MAKEMASK_32(3, S_LDT_SRICMD_TXINITIALOFFSET)
304#define V_LDT_SRICMD_TXINITIALOFFSET(x) _SB_MAKEVALUE_32(x, S_LDT_SRICMD_TXINITIALOFFSET)
305#define G_LDT_SRICMD_TXINITIALOFFSET(x) _SB_GETVALUE_32(x, S_LDT_SRICMD_TXINITIALOFFSET, M_LDT_SRICMD_TXINITIALOFFSET)
306
307#define M_LDT_SRICMD_LINKFREQDIRECT _SB_MAKEMASK1_32(31)
308
309/*
310 * LDT Error control and status register (Table 8-22) (Table 8-23)
311 */
312
313#define M_LDT_ERRCTL_PROTFATAL_EN _SB_MAKEMASK1_32(0)
314#define M_LDT_ERRCTL_PROTNONFATAL_EN _SB_MAKEMASK1_32(1)
315#define M_LDT_ERRCTL_PROTSYNCFLOOD_EN _SB_MAKEMASK1_32(2)
316#define M_LDT_ERRCTL_OVFFATAL_EN _SB_MAKEMASK1_32(3)
317#define M_LDT_ERRCTL_OVFNONFATAL_EN _SB_MAKEMASK1_32(4)
318#define M_LDT_ERRCTL_OVFSYNCFLOOD_EN _SB_MAKEMASK1_32(5)
319#define M_LDT_ERRCTL_EOCNXAFATAL_EN _SB_MAKEMASK1_32(6)
320#define M_LDT_ERRCTL_EOCNXANONFATAL_EN _SB_MAKEMASK1_32(7)
321#define M_LDT_ERRCTL_EOCNXASYNCFLOOD_EN _SB_MAKEMASK1_32(8)
322#define M_LDT_ERRCTL_CRCFATAL_EN _SB_MAKEMASK1_32(9)
323#define M_LDT_ERRCTL_CRCNONFATAL_EN _SB_MAKEMASK1_32(10)
324#define M_LDT_ERRCTL_SERRFATAL_EN _SB_MAKEMASK1_32(11)
325#define M_LDT_ERRCTL_SRCTAGFATAL_EN _SB_MAKEMASK1_32(12)
326#define M_LDT_ERRCTL_SRCTAGNONFATAL_EN _SB_MAKEMASK1_32(13)
327#define M_LDT_ERRCTL_SRCTAGSYNCFLOOD_EN _SB_MAKEMASK1_32(14)
328#define M_LDT_ERRCTL_MAPNXAFATAL_EN _SB_MAKEMASK1_32(15)
329#define M_LDT_ERRCTL_MAPNXANONFATAL_EN _SB_MAKEMASK1_32(16)
330#define M_LDT_ERRCTL_MAPNXASYNCFLOOD_EN _SB_MAKEMASK1_32(17)
331
332#define M_LDT_ERRCTL_PROTOERR _SB_MAKEMASK1_32(24)
333#define M_LDT_ERRCTL_OVFERR _SB_MAKEMASK1_32(25)
334#define M_LDT_ERRCTL_EOCNXAERR _SB_MAKEMASK1_32(26)
335#define M_LDT_ERRCTL_SRCTAGERR _SB_MAKEMASK1_32(27)
336#define M_LDT_ERRCTL_MAPNXAERR _SB_MAKEMASK1_32(28)
337
338/*
339 * SRI Control register (Table 8-24, 8-25) Offset 0x6C
340 */
341
342#define S_LDT_SRICTRL_NEEDRESP 0
343#define M_LDT_SRICTRL_NEEDRESP _SB_MAKEMASK_32(2, S_LDT_SRICTRL_NEEDRESP)
344#define V_LDT_SRICTRL_NEEDRESP(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_NEEDRESP)
345#define G_LDT_SRICTRL_NEEDRESP(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_NEEDRESP, M_LDT_SRICTRL_NEEDRESP)
346
347#define S_LDT_SRICTRL_NEEDNPREQ 2
348#define M_LDT_SRICTRL_NEEDNPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_NEEDNPREQ)
349#define V_LDT_SRICTRL_NEEDNPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_NEEDNPREQ)
350#define G_LDT_SRICTRL_NEEDNPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_NEEDNPREQ, M_LDT_SRICTRL_NEEDNPREQ)
351
352#define S_LDT_SRICTRL_NEEDPREQ 4
353#define M_LDT_SRICTRL_NEEDPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_NEEDPREQ)
354#define V_LDT_SRICTRL_NEEDPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_NEEDPREQ)
355#define G_LDT_SRICTRL_NEEDPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_NEEDPREQ, M_LDT_SRICTRL_NEEDPREQ)
356
357#define S_LDT_SRICTRL_WANTRESP 8
358#define M_LDT_SRICTRL_WANTRESP _SB_MAKEMASK_32(2, S_LDT_SRICTRL_WANTRESP)
359#define V_LDT_SRICTRL_WANTRESP(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_WANTRESP)
360#define G_LDT_SRICTRL_WANTRESP(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_WANTRESP, M_LDT_SRICTRL_WANTRESP)
361
362#define S_LDT_SRICTRL_WANTNPREQ 10
363#define M_LDT_SRICTRL_WANTNPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_WANTNPREQ)
364#define V_LDT_SRICTRL_WANTNPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_WANTNPREQ)
365#define G_LDT_SRICTRL_WANTNPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_WANTNPREQ, M_LDT_SRICTRL_WANTNPREQ)
366
367#define S_LDT_SRICTRL_WANTPREQ 12
368#define M_LDT_SRICTRL_WANTPREQ _SB_MAKEMASK_32(2, S_LDT_SRICTRL_WANTPREQ)
369#define V_LDT_SRICTRL_WANTPREQ(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_WANTPREQ)
370#define G_LDT_SRICTRL_WANTPREQ(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_WANTPREQ, M_LDT_SRICTRL_WANTPREQ)
371
372#define S_LDT_SRICTRL_BUFRELSPACE 16
373#define M_LDT_SRICTRL_BUFRELSPACE _SB_MAKEMASK_32(4, S_LDT_SRICTRL_BUFRELSPACE)
374#define V_LDT_SRICTRL_BUFRELSPACE(x) _SB_MAKEVALUE_32(x, S_LDT_SRICTRL_BUFRELSPACE)
375#define G_LDT_SRICTRL_BUFRELSPACE(x) _SB_GETVALUE_32(x, S_LDT_SRICTRL_BUFRELSPACE, M_LDT_SRICTRL_BUFRELSPACE)
376
377/*
378 * LDT SRI Transmit Buffer Count register (Table 8-26)
379 */
380
381#define S_LDT_TXBUFCNT_PCMD 0
382#define M_LDT_TXBUFCNT_PCMD _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_PCMD)
383#define V_LDT_TXBUFCNT_PCMD(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_PCMD)
384#define G_LDT_TXBUFCNT_PCMD(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_PCMD, M_LDT_TXBUFCNT_PCMD)
385
386#define S_LDT_TXBUFCNT_PDATA 4
387#define M_LDT_TXBUFCNT_PDATA _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_PDATA)
388#define V_LDT_TXBUFCNT_PDATA(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_PDATA)
389#define G_LDT_TXBUFCNT_PDATA(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_PDATA, M_LDT_TXBUFCNT_PDATA)
390
391#define S_LDT_TXBUFCNT_NPCMD 8
392#define M_LDT_TXBUFCNT_NPCMD _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_NPCMD)
393#define V_LDT_TXBUFCNT_NPCMD(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_NPCMD)
394#define G_LDT_TXBUFCNT_NPCMD(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_NPCMD, M_LDT_TXBUFCNT_NPCMD)
395
396#define S_LDT_TXBUFCNT_NPDATA 12
397#define M_LDT_TXBUFCNT_NPDATA _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_NPDATA)
398#define V_LDT_TXBUFCNT_NPDATA(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_NPDATA)
399#define G_LDT_TXBUFCNT_NPDATA(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_NPDATA, M_LDT_TXBUFCNT_NPDATA)
400
401#define S_LDT_TXBUFCNT_RCMD 16
402#define M_LDT_TXBUFCNT_RCMD _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_RCMD)
403#define V_LDT_TXBUFCNT_RCMD(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_RCMD)
404#define G_LDT_TXBUFCNT_RCMD(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_RCMD, M_LDT_TXBUFCNT_RCMD)
405
406#define S_LDT_TXBUFCNT_RDATA 20
407#define M_LDT_TXBUFCNT_RDATA _SB_MAKEMASK_32(4, S_LDT_TXBUFCNT_RDATA)
408#define V_LDT_TXBUFCNT_RDATA(x) _SB_MAKEVALUE_32(x, S_LDT_TXBUFCNT_RDATA)
409#define G_LDT_TXBUFCNT_RDATA(x) _SB_GETVALUE_32(x, S_LDT_TXBUFCNT_RDATA, M_LDT_TXBUFCNT_RDATA)
410
411#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
412/*
413 * Additional Status Register
414 */
415
416#define S_LDT_ADDSTATUS_TGTDONE 0
417#define M_LDT_ADDSTATUS_TGTDONE _SB_MAKEMASK_32(8, S_LDT_ADDSTATUS_TGTDONE)
418#define V_LDT_ADDSTATUS_TGTDONE(x) _SB_MAKEVALUE_32(x, S_LDT_ADDSTATUS_TGTDONE)
419#define G_LDT_ADDSTATUS_TGTDONE(x) _SB_GETVALUE_32(x, S_LDT_ADDSTATUS_TGTDONE, M_LDT_ADDSTATUS_TGTDONE)
420#endif /* 1250 PASS2 || 112x PASS1 */
421
422#endif
423
diff --git a/include/asm-mips/sibyte/sb1250_mac.h b/include/asm-mips/sibyte/sb1250_mac.h
deleted file mode 100644
index b6faf08ca81d..000000000000
--- a/include/asm-mips/sibyte/sb1250_mac.h
+++ /dev/null
@@ -1,656 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * MAC constants and macros File: sb1250_mac.h
5 *
6 * This module contains constants and macros for the SB1250's
7 * ethernet controllers.
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_MAC_H
34#define _SB1250_MAC_H
35
36#include "sb1250_defs.h"
37
38/* *********************************************************************
39 * Ethernet MAC Registers
40 ********************************************************************* */
41
42/*
43 * MAC Configuration Register (Table 9-13)
44 * Register: MAC_CFG_0
45 * Register: MAC_CFG_1
46 * Register: MAC_CFG_2
47 */
48
49
50#define M_MAC_RESERVED0 _SB_MAKEMASK1(0)
51#define M_MAC_TX_HOLD_SOP_EN _SB_MAKEMASK1(1)
52#define M_MAC_RETRY_EN _SB_MAKEMASK1(2)
53#define M_MAC_RET_DRPREQ_EN _SB_MAKEMASK1(3)
54#define M_MAC_RET_UFL_EN _SB_MAKEMASK1(4)
55#define M_MAC_BURST_EN _SB_MAKEMASK1(5)
56
57#define S_MAC_TX_PAUSE _SB_MAKE64(6)
58#define M_MAC_TX_PAUSE_CNT _SB_MAKEMASK(3, S_MAC_TX_PAUSE)
59#define V_MAC_TX_PAUSE_CNT(x) _SB_MAKEVALUE(x, S_MAC_TX_PAUSE)
60
61#define K_MAC_TX_PAUSE_CNT_512 0
62#define K_MAC_TX_PAUSE_CNT_1K 1
63#define K_MAC_TX_PAUSE_CNT_2K 2
64#define K_MAC_TX_PAUSE_CNT_4K 3
65#define K_MAC_TX_PAUSE_CNT_8K 4
66#define K_MAC_TX_PAUSE_CNT_16K 5
67#define K_MAC_TX_PAUSE_CNT_32K 6
68#define K_MAC_TX_PAUSE_CNT_64K 7
69
70#define V_MAC_TX_PAUSE_CNT_512 V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_512)
71#define V_MAC_TX_PAUSE_CNT_1K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_1K)
72#define V_MAC_TX_PAUSE_CNT_2K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_2K)
73#define V_MAC_TX_PAUSE_CNT_4K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_4K)
74#define V_MAC_TX_PAUSE_CNT_8K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_8K)
75#define V_MAC_TX_PAUSE_CNT_16K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_16K)
76#define V_MAC_TX_PAUSE_CNT_32K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_32K)
77#define V_MAC_TX_PAUSE_CNT_64K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_64K)
78
79#define M_MAC_RESERVED1 _SB_MAKEMASK(8, 9)
80
81#define M_MAC_AP_STAT_EN _SB_MAKEMASK1(17)
82
83#if SIBYTE_HDR_FEATURE_CHIP(1480)
84#define M_MAC_TIMESTAMP _SB_MAKEMASK1(18)
85#endif
86#define M_MAC_DRP_ERRPKT_EN _SB_MAKEMASK1(19)
87#define M_MAC_DRP_FCSERRPKT_EN _SB_MAKEMASK1(20)
88#define M_MAC_DRP_CODEERRPKT_EN _SB_MAKEMASK1(21)
89#define M_MAC_DRP_DRBLERRPKT_EN _SB_MAKEMASK1(22)
90#define M_MAC_DRP_RNTPKT_EN _SB_MAKEMASK1(23)
91#define M_MAC_DRP_OSZPKT_EN _SB_MAKEMASK1(24)
92#define M_MAC_DRP_LENERRPKT_EN _SB_MAKEMASK1(25)
93
94#define M_MAC_RESERVED3 _SB_MAKEMASK(6, 26)
95
96#define M_MAC_BYPASS_SEL _SB_MAKEMASK1(32)
97#define M_MAC_HDX_EN _SB_MAKEMASK1(33)
98
99#define S_MAC_SPEED_SEL _SB_MAKE64(34)
100#define M_MAC_SPEED_SEL _SB_MAKEMASK(2, S_MAC_SPEED_SEL)
101#define V_MAC_SPEED_SEL(x) _SB_MAKEVALUE(x, S_MAC_SPEED_SEL)
102#define G_MAC_SPEED_SEL(x) _SB_GETVALUE(x, S_MAC_SPEED_SEL, M_MAC_SPEED_SEL)
103
104#define K_MAC_SPEED_SEL_10MBPS 0
105#define K_MAC_SPEED_SEL_100MBPS 1
106#define K_MAC_SPEED_SEL_1000MBPS 2
107#define K_MAC_SPEED_SEL_RESERVED 3
108
109#define V_MAC_SPEED_SEL_10MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_10MBPS)
110#define V_MAC_SPEED_SEL_100MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_100MBPS)
111#define V_MAC_SPEED_SEL_1000MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_1000MBPS)
112#define V_MAC_SPEED_SEL_RESERVED V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_RESERVED)
113
114#define M_MAC_TX_CLK_EDGE_SEL _SB_MAKEMASK1(36)
115#define M_MAC_LOOPBACK_SEL _SB_MAKEMASK1(37)
116#define M_MAC_FAST_SYNC _SB_MAKEMASK1(38)
117#define M_MAC_SS_EN _SB_MAKEMASK1(39)
118
119#define S_MAC_BYPASS_CFG _SB_MAKE64(40)
120#define M_MAC_BYPASS_CFG _SB_MAKEMASK(2, S_MAC_BYPASS_CFG)
121#define V_MAC_BYPASS_CFG(x) _SB_MAKEVALUE(x, S_MAC_BYPASS_CFG)
122#define G_MAC_BYPASS_CFG(x) _SB_GETVALUE(x, S_MAC_BYPASS_CFG, M_MAC_BYPASS_CFG)
123
124#define K_MAC_BYPASS_GMII 0
125#define K_MAC_BYPASS_ENCODED 1
126#define K_MAC_BYPASS_SOP 2
127#define K_MAC_BYPASS_EOP 3
128
129#define M_MAC_BYPASS_16 _SB_MAKEMASK1(42)
130#define M_MAC_BYPASS_FCS_CHK _SB_MAKEMASK1(43)
131
132#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
133#define M_MAC_RX_CH_SEL_MSB _SB_MAKEMASK1(44)
134#endif /* 1250 PASS2 || 112x PASS1 || 1480*/
135
136#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
137#define M_MAC_SPLIT_CH_SEL _SB_MAKEMASK1(45)
138#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
139
140#define S_MAC_BYPASS_IFG _SB_MAKE64(46)
141#define M_MAC_BYPASS_IFG _SB_MAKEMASK(8, S_MAC_BYPASS_IFG)
142#define V_MAC_BYPASS_IFG(x) _SB_MAKEVALUE(x, S_MAC_BYPASS_IFG)
143#define G_MAC_BYPASS_IFG(x) _SB_GETVALUE(x, S_MAC_BYPASS_IFG, M_MAC_BYPASS_IFG)
144
145#define K_MAC_FC_CMD_DISABLED 0
146#define K_MAC_FC_CMD_ENABLED 1
147#define K_MAC_FC_CMD_ENAB_FALSECARR 2
148
149#define V_MAC_FC_CMD_DISABLED V_MAC_FC_CMD(K_MAC_FC_CMD_DISABLED)
150#define V_MAC_FC_CMD_ENABLED V_MAC_FC_CMD(K_MAC_FC_CMD_ENABLED)
151#define V_MAC_FC_CMD_ENAB_FALSECARR V_MAC_FC_CMD(K_MAC_FC_CMD_ENAB_FALSECARR)
152
153#define M_MAC_FC_SEL _SB_MAKEMASK1(54)
154
155#define S_MAC_FC_CMD _SB_MAKE64(55)
156#define M_MAC_FC_CMD _SB_MAKEMASK(2, S_MAC_FC_CMD)
157#define V_MAC_FC_CMD(x) _SB_MAKEVALUE(x, S_MAC_FC_CMD)
158#define G_MAC_FC_CMD(x) _SB_GETVALUE(x, S_MAC_FC_CMD, M_MAC_FC_CMD)
159
160#define S_MAC_RX_CH_SEL _SB_MAKE64(57)
161#define M_MAC_RX_CH_SEL _SB_MAKEMASK(7, S_MAC_RX_CH_SEL)
162#define V_MAC_RX_CH_SEL(x) _SB_MAKEVALUE(x, S_MAC_RX_CH_SEL)
163#define G_MAC_RX_CH_SEL(x) _SB_GETVALUE(x, S_MAC_RX_CH_SEL, M_MAC_RX_CH_SEL)
164
165
166/*
167 * MAC Enable Registers
168 * Register: MAC_ENABLE_0
169 * Register: MAC_ENABLE_1
170 * Register: MAC_ENABLE_2
171 */
172
173#define M_MAC_RXDMA_EN0 _SB_MAKEMASK1(0)
174#define M_MAC_RXDMA_EN1 _SB_MAKEMASK1(1)
175#define M_MAC_TXDMA_EN0 _SB_MAKEMASK1(4)
176#define M_MAC_TXDMA_EN1 _SB_MAKEMASK1(5)
177
178#define M_MAC_PORT_RESET _SB_MAKEMASK1(8)
179
180#if (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x))
181#define M_MAC_RX_ENABLE _SB_MAKEMASK1(10)
182#define M_MAC_TX_ENABLE _SB_MAKEMASK1(11)
183#define M_MAC_BYP_RX_ENABLE _SB_MAKEMASK1(12)
184#define M_MAC_BYP_TX_ENABLE _SB_MAKEMASK1(13)
185#endif
186
187/*
188 * MAC reset information register (1280/1255)
189 */
190#if SIBYTE_HDR_FEATURE_CHIP(1480)
191#define M_MAC_RX_CH0_PAUSE_ON _SB_MAKEMASK1(8)
192#define M_MAC_RX_CH1_PAUSE_ON _SB_MAKEMASK1(16)
193#define M_MAC_TX_CH0_PAUSE_ON _SB_MAKEMASK1(24)
194#define M_MAC_TX_CH1_PAUSE_ON _SB_MAKEMASK1(32)
195#endif
196
197/*
198 * MAC DMA Control Register
199 * Register: MAC_TXD_CTL_0
200 * Register: MAC_TXD_CTL_1
201 * Register: MAC_TXD_CTL_2
202 */
203
204#define S_MAC_TXD_WEIGHT0 _SB_MAKE64(0)
205#define M_MAC_TXD_WEIGHT0 _SB_MAKEMASK(4, S_MAC_TXD_WEIGHT0)
206#define V_MAC_TXD_WEIGHT0(x) _SB_MAKEVALUE(x, S_MAC_TXD_WEIGHT0)
207#define G_MAC_TXD_WEIGHT0(x) _SB_GETVALUE(x, S_MAC_TXD_WEIGHT0, M_MAC_TXD_WEIGHT0)
208
209#define S_MAC_TXD_WEIGHT1 _SB_MAKE64(4)
210#define M_MAC_TXD_WEIGHT1 _SB_MAKEMASK(4, S_MAC_TXD_WEIGHT1)
211#define V_MAC_TXD_WEIGHT1(x) _SB_MAKEVALUE(x, S_MAC_TXD_WEIGHT1)
212#define G_MAC_TXD_WEIGHT1(x) _SB_GETVALUE(x, S_MAC_TXD_WEIGHT1, M_MAC_TXD_WEIGHT1)
213
214/*
215 * MAC Fifo Threshhold registers (Table 9-14)
216 * Register: MAC_THRSH_CFG_0
217 * Register: MAC_THRSH_CFG_1
218 * Register: MAC_THRSH_CFG_2
219 */
220
221#define S_MAC_TX_WR_THRSH _SB_MAKE64(0)
222#if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1)
223/* XXX: Can't enable, as it has the same name as a pass2+ define below. */
224/* #define M_MAC_TX_WR_THRSH _SB_MAKEMASK(6, S_MAC_TX_WR_THRSH) */
225#endif /* up to 1250 PASS1 */
226#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
227#define M_MAC_TX_WR_THRSH _SB_MAKEMASK(7, S_MAC_TX_WR_THRSH)
228#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
229#define V_MAC_TX_WR_THRSH(x) _SB_MAKEVALUE(x, S_MAC_TX_WR_THRSH)
230#define G_MAC_TX_WR_THRSH(x) _SB_GETVALUE(x, S_MAC_TX_WR_THRSH, M_MAC_TX_WR_THRSH)
231
232#define S_MAC_TX_RD_THRSH _SB_MAKE64(8)
233#if SIBYTE_HDR_FEATURE_UP_TO(1250, PASS1)
234/* XXX: Can't enable, as it has the same name as a pass2+ define below. */
235/* #define M_MAC_TX_RD_THRSH _SB_MAKEMASK(6, S_MAC_TX_RD_THRSH) */
236#endif /* up to 1250 PASS1 */
237#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
238#define M_MAC_TX_RD_THRSH _SB_MAKEMASK(7, S_MAC_TX_RD_THRSH)
239#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
240#define V_MAC_TX_RD_THRSH(x) _SB_MAKEVALUE(x, S_MAC_TX_RD_THRSH)
241#define G_MAC_TX_RD_THRSH(x) _SB_GETVALUE(x, S_MAC_TX_RD_THRSH, M_MAC_TX_RD_THRSH)
242
243#define S_MAC_TX_RL_THRSH _SB_MAKE64(16)
244#define M_MAC_TX_RL_THRSH _SB_MAKEMASK(4, S_MAC_TX_RL_THRSH)
245#define V_MAC_TX_RL_THRSH(x) _SB_MAKEVALUE(x, S_MAC_TX_RL_THRSH)
246#define G_MAC_TX_RL_THRSH(x) _SB_GETVALUE(x, S_MAC_TX_RL_THRSH, M_MAC_TX_RL_THRSH)
247
248#define S_MAC_RX_PL_THRSH _SB_MAKE64(24)
249#define M_MAC_RX_PL_THRSH _SB_MAKEMASK(6, S_MAC_RX_PL_THRSH)
250#define V_MAC_RX_PL_THRSH(x) _SB_MAKEVALUE(x, S_MAC_RX_PL_THRSH)
251#define G_MAC_RX_PL_THRSH(x) _SB_GETVALUE(x, S_MAC_RX_PL_THRSH, M_MAC_RX_PL_THRSH)
252
253#define S_MAC_RX_RD_THRSH _SB_MAKE64(32)
254#define M_MAC_RX_RD_THRSH _SB_MAKEMASK(6, S_MAC_RX_RD_THRSH)
255#define V_MAC_RX_RD_THRSH(x) _SB_MAKEVALUE(x, S_MAC_RX_RD_THRSH)
256#define G_MAC_RX_RD_THRSH(x) _SB_GETVALUE(x, S_MAC_RX_RD_THRSH, M_MAC_RX_RD_THRSH)
257
258#define S_MAC_RX_RL_THRSH _SB_MAKE64(40)
259#define M_MAC_RX_RL_THRSH _SB_MAKEMASK(6, S_MAC_RX_RL_THRSH)
260#define V_MAC_RX_RL_THRSH(x) _SB_MAKEVALUE(x, S_MAC_RX_RL_THRSH)
261#define G_MAC_RX_RL_THRSH(x) _SB_GETVALUE(x, S_MAC_RX_RL_THRSH, M_MAC_RX_RL_THRSH)
262
263#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
264#define S_MAC_ENC_FC_THRSH _SB_MAKE64(56)
265#define M_MAC_ENC_FC_THRSH _SB_MAKEMASK(6, S_MAC_ENC_FC_THRSH)
266#define V_MAC_ENC_FC_THRSH(x) _SB_MAKEVALUE(x, S_MAC_ENC_FC_THRSH)
267#define G_MAC_ENC_FC_THRSH(x) _SB_GETVALUE(x, S_MAC_ENC_FC_THRSH, M_MAC_ENC_FC_THRSH)
268#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
269
270/*
271 * MAC Frame Configuration Registers (Table 9-15)
272 * Register: MAC_FRAME_CFG_0
273 * Register: MAC_FRAME_CFG_1
274 * Register: MAC_FRAME_CFG_2
275 */
276
277/* XXXCGD: ??? Unused in pass2? */
278#define S_MAC_IFG_RX _SB_MAKE64(0)
279#define M_MAC_IFG_RX _SB_MAKEMASK(6, S_MAC_IFG_RX)
280#define V_MAC_IFG_RX(x) _SB_MAKEVALUE(x, S_MAC_IFG_RX)
281#define G_MAC_IFG_RX(x) _SB_GETVALUE(x, S_MAC_IFG_RX, M_MAC_IFG_RX)
282
283#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
284#define S_MAC_PRE_LEN _SB_MAKE64(0)
285#define M_MAC_PRE_LEN _SB_MAKEMASK(6, S_MAC_PRE_LEN)
286#define V_MAC_PRE_LEN(x) _SB_MAKEVALUE(x, S_MAC_PRE_LEN)
287#define G_MAC_PRE_LEN(x) _SB_GETVALUE(x, S_MAC_PRE_LEN, M_MAC_PRE_LEN)
288#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
289
290#define S_MAC_IFG_TX _SB_MAKE64(6)
291#define M_MAC_IFG_TX _SB_MAKEMASK(6, S_MAC_IFG_TX)
292#define V_MAC_IFG_TX(x) _SB_MAKEVALUE(x, S_MAC_IFG_TX)
293#define G_MAC_IFG_TX(x) _SB_GETVALUE(x, S_MAC_IFG_TX, M_MAC_IFG_TX)
294
295#define S_MAC_IFG_THRSH _SB_MAKE64(12)
296#define M_MAC_IFG_THRSH _SB_MAKEMASK(6, S_MAC_IFG_THRSH)
297#define V_MAC_IFG_THRSH(x) _SB_MAKEVALUE(x, S_MAC_IFG_THRSH)
298#define G_MAC_IFG_THRSH(x) _SB_GETVALUE(x, S_MAC_IFG_THRSH, M_MAC_IFG_THRSH)
299
300#define S_MAC_BACKOFF_SEL _SB_MAKE64(18)
301#define M_MAC_BACKOFF_SEL _SB_MAKEMASK(4, S_MAC_BACKOFF_SEL)
302#define V_MAC_BACKOFF_SEL(x) _SB_MAKEVALUE(x, S_MAC_BACKOFF_SEL)
303#define G_MAC_BACKOFF_SEL(x) _SB_GETVALUE(x, S_MAC_BACKOFF_SEL, M_MAC_BACKOFF_SEL)
304
305#define S_MAC_LFSR_SEED _SB_MAKE64(22)
306#define M_MAC_LFSR_SEED _SB_MAKEMASK(8, S_MAC_LFSR_SEED)
307#define V_MAC_LFSR_SEED(x) _SB_MAKEVALUE(x, S_MAC_LFSR_SEED)
308#define G_MAC_LFSR_SEED(x) _SB_GETVALUE(x, S_MAC_LFSR_SEED, M_MAC_LFSR_SEED)
309
310#define S_MAC_SLOT_SIZE _SB_MAKE64(30)
311#define M_MAC_SLOT_SIZE _SB_MAKEMASK(10, S_MAC_SLOT_SIZE)
312#define V_MAC_SLOT_SIZE(x) _SB_MAKEVALUE(x, S_MAC_SLOT_SIZE)
313#define G_MAC_SLOT_SIZE(x) _SB_GETVALUE(x, S_MAC_SLOT_SIZE, M_MAC_SLOT_SIZE)
314
315#define S_MAC_MIN_FRAMESZ _SB_MAKE64(40)
316#define M_MAC_MIN_FRAMESZ _SB_MAKEMASK(8, S_MAC_MIN_FRAMESZ)
317#define V_MAC_MIN_FRAMESZ(x) _SB_MAKEVALUE(x, S_MAC_MIN_FRAMESZ)
318#define G_MAC_MIN_FRAMESZ(x) _SB_GETVALUE(x, S_MAC_MIN_FRAMESZ, M_MAC_MIN_FRAMESZ)
319
320#define S_MAC_MAX_FRAMESZ _SB_MAKE64(48)
321#define M_MAC_MAX_FRAMESZ _SB_MAKEMASK(16, S_MAC_MAX_FRAMESZ)
322#define V_MAC_MAX_FRAMESZ(x) _SB_MAKEVALUE(x, S_MAC_MAX_FRAMESZ)
323#define G_MAC_MAX_FRAMESZ(x) _SB_GETVALUE(x, S_MAC_MAX_FRAMESZ, M_MAC_MAX_FRAMESZ)
324
325/*
326 * These constants are used to configure the fields within the Frame
327 * Configuration Register.
328 */
329
330#define K_MAC_IFG_RX_10 _SB_MAKE64(0) /* See table 176, not used */
331#define K_MAC_IFG_RX_100 _SB_MAKE64(0)
332#define K_MAC_IFG_RX_1000 _SB_MAKE64(0)
333
334#define K_MAC_IFG_TX_10 _SB_MAKE64(20)
335#define K_MAC_IFG_TX_100 _SB_MAKE64(20)
336#define K_MAC_IFG_TX_1000 _SB_MAKE64(8)
337
338#define K_MAC_IFG_THRSH_10 _SB_MAKE64(4)
339#define K_MAC_IFG_THRSH_100 _SB_MAKE64(4)
340#define K_MAC_IFG_THRSH_1000 _SB_MAKE64(0)
341
342#define K_MAC_SLOT_SIZE_10 _SB_MAKE64(0)
343#define K_MAC_SLOT_SIZE_100 _SB_MAKE64(0)
344#define K_MAC_SLOT_SIZE_1000 _SB_MAKE64(0)
345
346#define V_MAC_IFG_RX_10 V_MAC_IFG_RX(K_MAC_IFG_RX_10)
347#define V_MAC_IFG_RX_100 V_MAC_IFG_RX(K_MAC_IFG_RX_100)
348#define V_MAC_IFG_RX_1000 V_MAC_IFG_RX(K_MAC_IFG_RX_1000)
349
350#define V_MAC_IFG_TX_10 V_MAC_IFG_TX(K_MAC_IFG_TX_10)
351#define V_MAC_IFG_TX_100 V_MAC_IFG_TX(K_MAC_IFG_TX_100)
352#define V_MAC_IFG_TX_1000 V_MAC_IFG_TX(K_MAC_IFG_TX_1000)
353
354#define V_MAC_IFG_THRSH_10 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_10)
355#define V_MAC_IFG_THRSH_100 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_100)
356#define V_MAC_IFG_THRSH_1000 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_1000)
357
358#define V_MAC_SLOT_SIZE_10 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_10)
359#define V_MAC_SLOT_SIZE_100 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_100)
360#define V_MAC_SLOT_SIZE_1000 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_1000)
361
362#define K_MAC_MIN_FRAMESZ_FIFO _SB_MAKE64(9)
363#define K_MAC_MIN_FRAMESZ_DEFAULT _SB_MAKE64(64)
364#define K_MAC_MAX_FRAMESZ_DEFAULT _SB_MAKE64(1518)
365#define K_MAC_MAX_FRAMESZ_JUMBO _SB_MAKE64(9216)
366
367#define V_MAC_MIN_FRAMESZ_FIFO V_MAC_MIN_FRAMESZ(K_MAC_MIN_FRAMESZ_FIFO)
368#define V_MAC_MIN_FRAMESZ_DEFAULT V_MAC_MIN_FRAMESZ(K_MAC_MIN_FRAMESZ_DEFAULT)
369#define V_MAC_MAX_FRAMESZ_DEFAULT V_MAC_MAX_FRAMESZ(K_MAC_MAX_FRAMESZ_DEFAULT)
370#define V_MAC_MAX_FRAMESZ_JUMBO V_MAC_MAX_FRAMESZ(K_MAC_MAX_FRAMESZ_JUMBO)
371
372/*
373 * MAC VLAN Tag Registers (Table 9-16)
374 * Register: MAC_VLANTAG_0
375 * Register: MAC_VLANTAG_1
376 * Register: MAC_VLANTAG_2
377 */
378
379#define S_MAC_VLAN_TAG _SB_MAKE64(0)
380#define M_MAC_VLAN_TAG _SB_MAKEMASK(32, S_MAC_VLAN_TAG)
381#define V_MAC_VLAN_TAG(x) _SB_MAKEVALUE(x, S_MAC_VLAN_TAG)
382#define G_MAC_VLAN_TAG(x) _SB_GETVALUE(x, S_MAC_VLAN_TAG, M_MAC_VLAN_TAG)
383
384#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
385#define S_MAC_TX_PKT_OFFSET _SB_MAKE64(32)
386#define M_MAC_TX_PKT_OFFSET _SB_MAKEMASK(8, S_MAC_TX_PKT_OFFSET)
387#define V_MAC_TX_PKT_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_TX_PKT_OFFSET)
388#define G_MAC_TX_PKT_OFFSET(x) _SB_GETVALUE(x, S_MAC_TX_PKT_OFFSET, M_MAC_TX_PKT_OFFSET)
389
390#define S_MAC_TX_CRC_OFFSET _SB_MAKE64(40)
391#define M_MAC_TX_CRC_OFFSET _SB_MAKEMASK(8, S_MAC_TX_CRC_OFFSET)
392#define V_MAC_TX_CRC_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_TX_CRC_OFFSET)
393#define G_MAC_TX_CRC_OFFSET(x) _SB_GETVALUE(x, S_MAC_TX_CRC_OFFSET, M_MAC_TX_CRC_OFFSET)
394
395#define M_MAC_CH_BASE_FC_EN _SB_MAKEMASK1(48)
396#endif /* 1250 PASS3 || 112x PASS1 */
397
398/*
399 * MAC Status Registers (Table 9-17)
400 * Also used for the MAC Interrupt Mask Register (Table 9-18)
401 * Register: MAC_STATUS_0
402 * Register: MAC_STATUS_1
403 * Register: MAC_STATUS_2
404 * Register: MAC_INT_MASK_0
405 * Register: MAC_INT_MASK_1
406 * Register: MAC_INT_MASK_2
407 */
408
409/*
410 * Use these constants to shift the appropriate channel
411 * into the CH0 position so the same tests can be used
412 * on each channel.
413 */
414
415#define S_MAC_RX_CH0 _SB_MAKE64(0)
416#define S_MAC_RX_CH1 _SB_MAKE64(8)
417#define S_MAC_TX_CH0 _SB_MAKE64(16)
418#define S_MAC_TX_CH1 _SB_MAKE64(24)
419
420#define S_MAC_TXCHANNELS _SB_MAKE64(16) /* this is 1st TX chan */
421#define S_MAC_CHANWIDTH _SB_MAKE64(8) /* bits between channels */
422
423/*
424 * These are the same as RX channel 0. The idea here
425 * is that you'll use one of the "S_" things above
426 * and pass just the six bits to a DMA-channel-specific ISR
427 */
428#define M_MAC_INT_CHANNEL _SB_MAKEMASK(8, 0)
429#define M_MAC_INT_EOP_COUNT _SB_MAKEMASK1(0)
430#define M_MAC_INT_EOP_TIMER _SB_MAKEMASK1(1)
431#define M_MAC_INT_EOP_SEEN _SB_MAKEMASK1(2)
432#define M_MAC_INT_HWM _SB_MAKEMASK1(3)
433#define M_MAC_INT_LWM _SB_MAKEMASK1(4)
434#define M_MAC_INT_DSCR _SB_MAKEMASK1(5)
435#define M_MAC_INT_ERR _SB_MAKEMASK1(6)
436#define M_MAC_INT_DZERO _SB_MAKEMASK1(7) /* only for TX channels */
437#define M_MAC_INT_DROP _SB_MAKEMASK1(7) /* only for RX channels */
438
439/*
440 * In the following definitions we use ch (0/1) and txrx (TX=1, RX=0, see
441 * also DMA_TX/DMA_RX in sb_regs.h).
442 */
443#define S_MAC_STATUS_CH_OFFSET(ch, txrx) _SB_MAKE64(((ch) + 2 * (txrx)) * S_MAC_CHANWIDTH)
444
445#define M_MAC_STATUS_CHANNEL(ch, txrx) _SB_MAKEVALUE(_SB_MAKEMASK(8, 0), S_MAC_STATUS_CH_OFFSET(ch, txrx))
446#define M_MAC_STATUS_EOP_COUNT(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_EOP_COUNT, S_MAC_STATUS_CH_OFFSET(ch, txrx))
447#define M_MAC_STATUS_EOP_TIMER(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_EOP_TIMER, S_MAC_STATUS_CH_OFFSET(ch, txrx))
448#define M_MAC_STATUS_EOP_SEEN(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_EOP_SEEN, S_MAC_STATUS_CH_OFFSET(ch, txrx))
449#define M_MAC_STATUS_HWM(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_HWM, S_MAC_STATUS_CH_OFFSET(ch, txrx))
450#define M_MAC_STATUS_LWM(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_LWM, S_MAC_STATUS_CH_OFFSET(ch, txrx))
451#define M_MAC_STATUS_DSCR(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_DSCR, S_MAC_STATUS_CH_OFFSET(ch, txrx))
452#define M_MAC_STATUS_ERR(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_ERR, S_MAC_STATUS_CH_OFFSET(ch, txrx))
453#define M_MAC_STATUS_DZERO(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_DZERO, S_MAC_STATUS_CH_OFFSET(ch, txrx))
454#define M_MAC_STATUS_DROP(ch, txrx) _SB_MAKEVALUE(M_MAC_INT_DROP, S_MAC_STATUS_CH_OFFSET(ch, txrx))
455#define M_MAC_STATUS_OTHER_ERR _SB_MAKEVALUE(_SB_MAKEMASK(7, 0), 40)
456
457
458#define M_MAC_RX_UNDRFL _SB_MAKEMASK1(40)
459#define M_MAC_RX_OVRFL _SB_MAKEMASK1(41)
460#define M_MAC_TX_UNDRFL _SB_MAKEMASK1(42)
461#define M_MAC_TX_OVRFL _SB_MAKEMASK1(43)
462#define M_MAC_LTCOL_ERR _SB_MAKEMASK1(44)
463#define M_MAC_EXCOL_ERR _SB_MAKEMASK1(45)
464#define M_MAC_CNTR_OVRFL_ERR _SB_MAKEMASK1(46)
465#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
466#define M_MAC_SPLIT_EN _SB_MAKEMASK1(47) /* interrupt mask only */
467#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
468
469#define S_MAC_COUNTER_ADDR _SB_MAKE64(47)
470#define M_MAC_COUNTER_ADDR _SB_MAKEMASK(5, S_MAC_COUNTER_ADDR)
471#define V_MAC_COUNTER_ADDR(x) _SB_MAKEVALUE(x, S_MAC_COUNTER_ADDR)
472#define G_MAC_COUNTER_ADDR(x) _SB_GETVALUE(x, S_MAC_COUNTER_ADDR, M_MAC_COUNTER_ADDR)
473
474#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
475#define M_MAC_TX_PAUSE_ON _SB_MAKEMASK1(52)
476#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
477
478/*
479 * MAC Fifo Pointer Registers (Table 9-19) [Debug register]
480 * Register: MAC_FIFO_PTRS_0
481 * Register: MAC_FIFO_PTRS_1
482 * Register: MAC_FIFO_PTRS_2
483 */
484
485#define S_MAC_TX_WRPTR _SB_MAKE64(0)
486#define M_MAC_TX_WRPTR _SB_MAKEMASK(6, S_MAC_TX_WRPTR)
487#define V_MAC_TX_WRPTR(x) _SB_MAKEVALUE(x, S_MAC_TX_WRPTR)
488#define G_MAC_TX_WRPTR(x) _SB_GETVALUE(x, S_MAC_TX_WRPTR, M_MAC_TX_WRPTR)
489
490#define S_MAC_TX_RDPTR _SB_MAKE64(8)
491#define M_MAC_TX_RDPTR _SB_MAKEMASK(6, S_MAC_TX_RDPTR)
492#define V_MAC_TX_RDPTR(x) _SB_MAKEVALUE(x, S_MAC_TX_RDPTR)
493#define G_MAC_TX_RDPTR(x) _SB_GETVALUE(x, S_MAC_TX_RDPTR, M_MAC_TX_RDPTR)
494
495#define S_MAC_RX_WRPTR _SB_MAKE64(16)
496#define M_MAC_RX_WRPTR _SB_MAKEMASK(6, S_MAC_RX_WRPTR)
497#define V_MAC_RX_WRPTR(x) _SB_MAKEVALUE(x, S_MAC_RX_WRPTR)
498#define G_MAC_RX_WRPTR(x) _SB_GETVALUE(x, S_MAC_RX_WRPTR, M_MAC_TX_WRPTR)
499
500#define S_MAC_RX_RDPTR _SB_MAKE64(24)
501#define M_MAC_RX_RDPTR _SB_MAKEMASK(6, S_MAC_RX_RDPTR)
502#define V_MAC_RX_RDPTR(x) _SB_MAKEVALUE(x, S_MAC_RX_RDPTR)
503#define G_MAC_RX_RDPTR(x) _SB_GETVALUE(x, S_MAC_RX_RDPTR, M_MAC_TX_RDPTR)
504
505/*
506 * MAC Fifo End Of Packet Count Registers (Table 9-20) [Debug register]
507 * Register: MAC_EOPCNT_0
508 * Register: MAC_EOPCNT_1
509 * Register: MAC_EOPCNT_2
510 */
511
512#define S_MAC_TX_EOP_COUNTER _SB_MAKE64(0)
513#define M_MAC_TX_EOP_COUNTER _SB_MAKEMASK(6, S_MAC_TX_EOP_COUNTER)
514#define V_MAC_TX_EOP_COUNTER(x) _SB_MAKEVALUE(x, S_MAC_TX_EOP_COUNTER)
515#define G_MAC_TX_EOP_COUNTER(x) _SB_GETVALUE(x, S_MAC_TX_EOP_COUNTER, M_MAC_TX_EOP_COUNTER)
516
517#define S_MAC_RX_EOP_COUNTER _SB_MAKE64(8)
518#define M_MAC_RX_EOP_COUNTER _SB_MAKEMASK(6, S_MAC_RX_EOP_COUNTER)
519#define V_MAC_RX_EOP_COUNTER(x) _SB_MAKEVALUE(x, S_MAC_RX_EOP_COUNTER)
520#define G_MAC_RX_EOP_COUNTER(x) _SB_GETVALUE(x, S_MAC_RX_EOP_COUNTER, M_MAC_RX_EOP_COUNTER)
521
522/*
523 * MAC Recieve Address Filter Exact Match Registers (Table 9-21)
524 * Registers: MAC_ADDR0_0 through MAC_ADDR7_0
525 * Registers: MAC_ADDR0_1 through MAC_ADDR7_1
526 * Registers: MAC_ADDR0_2 through MAC_ADDR7_2
527 */
528
529/* No bitfields */
530
531/*
532 * MAC Receive Address Filter Mask Registers
533 * Registers: MAC_ADDRMASK0_0 and MAC_ADDRMASK0_1
534 * Registers: MAC_ADDRMASK1_0 and MAC_ADDRMASK1_1
535 * Registers: MAC_ADDRMASK2_0 and MAC_ADDRMASK2_1
536 */
537
538/* No bitfields */
539
540/*
541 * MAC Recieve Address Filter Hash Match Registers (Table 9-22)
542 * Registers: MAC_HASH0_0 through MAC_HASH7_0
543 * Registers: MAC_HASH0_1 through MAC_HASH7_1
544 * Registers: MAC_HASH0_2 through MAC_HASH7_2
545 */
546
547/* No bitfields */
548
549/*
550 * MAC Transmit Source Address Registers (Table 9-23)
551 * Register: MAC_ETHERNET_ADDR_0
552 * Register: MAC_ETHERNET_ADDR_1
553 * Register: MAC_ETHERNET_ADDR_2
554 */
555
556/* No bitfields */
557
558/*
559 * MAC Packet Type Configuration Register
560 * Register: MAC_TYPE_CFG_0
561 * Register: MAC_TYPE_CFG_1
562 * Register: MAC_TYPE_CFG_2
563 */
564
565#define S_TYPECFG_TYPESIZE _SB_MAKE64(16)
566
567#define S_TYPECFG_TYPE0 _SB_MAKE64(0)
568#define M_TYPECFG_TYPE0 _SB_MAKEMASK(16, S_TYPECFG_TYPE0)
569#define V_TYPECFG_TYPE0(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE0)
570#define G_TYPECFG_TYPE0(x) _SB_GETVALUE(x, S_TYPECFG_TYPE0, M_TYPECFG_TYPE0)
571
572#define S_TYPECFG_TYPE1 _SB_MAKE64(0)
573#define M_TYPECFG_TYPE1 _SB_MAKEMASK(16, S_TYPECFG_TYPE1)
574#define V_TYPECFG_TYPE1(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE1)
575#define G_TYPECFG_TYPE1(x) _SB_GETVALUE(x, S_TYPECFG_TYPE1, M_TYPECFG_TYPE1)
576
577#define S_TYPECFG_TYPE2 _SB_MAKE64(0)
578#define M_TYPECFG_TYPE2 _SB_MAKEMASK(16, S_TYPECFG_TYPE2)
579#define V_TYPECFG_TYPE2(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE2)
580#define G_TYPECFG_TYPE2(x) _SB_GETVALUE(x, S_TYPECFG_TYPE2, M_TYPECFG_TYPE2)
581
582#define S_TYPECFG_TYPE3 _SB_MAKE64(0)
583#define M_TYPECFG_TYPE3 _SB_MAKEMASK(16, S_TYPECFG_TYPE3)
584#define V_TYPECFG_TYPE3(x) _SB_MAKEVALUE(x, S_TYPECFG_TYPE3)
585#define G_TYPECFG_TYPE3(x) _SB_GETVALUE(x, S_TYPECFG_TYPE3, M_TYPECFG_TYPE3)
586
587/*
588 * MAC Receive Address Filter Control Registers (Table 9-24)
589 * Register: MAC_ADFILTER_CFG_0
590 * Register: MAC_ADFILTER_CFG_1
591 * Register: MAC_ADFILTER_CFG_2
592 */
593
594#define M_MAC_ALLPKT_EN _SB_MAKEMASK1(0)
595#define M_MAC_UCAST_EN _SB_MAKEMASK1(1)
596#define M_MAC_UCAST_INV _SB_MAKEMASK1(2)
597#define M_MAC_MCAST_EN _SB_MAKEMASK1(3)
598#define M_MAC_MCAST_INV _SB_MAKEMASK1(4)
599#define M_MAC_BCAST_EN _SB_MAKEMASK1(5)
600#define M_MAC_DIRECT_INV _SB_MAKEMASK1(6)
601#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
602#define M_MAC_ALLMCAST_EN _SB_MAKEMASK1(7)
603#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
604
605#define S_MAC_IPHDR_OFFSET _SB_MAKE64(8)
606#define M_MAC_IPHDR_OFFSET _SB_MAKEMASK(8, S_MAC_IPHDR_OFFSET)
607#define V_MAC_IPHDR_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_IPHDR_OFFSET)
608#define G_MAC_IPHDR_OFFSET(x) _SB_GETVALUE(x, S_MAC_IPHDR_OFFSET, M_MAC_IPHDR_OFFSET)
609
610#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
611#define S_MAC_RX_CRC_OFFSET _SB_MAKE64(16)
612#define M_MAC_RX_CRC_OFFSET _SB_MAKEMASK(8, S_MAC_RX_CRC_OFFSET)
613#define V_MAC_RX_CRC_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_RX_CRC_OFFSET)
614#define G_MAC_RX_CRC_OFFSET(x) _SB_GETVALUE(x, S_MAC_RX_CRC_OFFSET, M_MAC_RX_CRC_OFFSET)
615
616#define S_MAC_RX_PKT_OFFSET _SB_MAKE64(24)
617#define M_MAC_RX_PKT_OFFSET _SB_MAKEMASK(8, S_MAC_RX_PKT_OFFSET)
618#define V_MAC_RX_PKT_OFFSET(x) _SB_MAKEVALUE(x, S_MAC_RX_PKT_OFFSET)
619#define G_MAC_RX_PKT_OFFSET(x) _SB_GETVALUE(x, S_MAC_RX_PKT_OFFSET, M_MAC_RX_PKT_OFFSET)
620
621#define M_MAC_FWDPAUSE_EN _SB_MAKEMASK1(32)
622#define M_MAC_VLAN_DET_EN _SB_MAKEMASK1(33)
623
624#define S_MAC_RX_CH_MSN_SEL _SB_MAKE64(34)
625#define M_MAC_RX_CH_MSN_SEL _SB_MAKEMASK(8, S_MAC_RX_CH_MSN_SEL)
626#define V_MAC_RX_CH_MSN_SEL(x) _SB_MAKEVALUE(x, S_MAC_RX_CH_MSN_SEL)
627#define G_MAC_RX_CH_MSN_SEL(x) _SB_GETVALUE(x, S_MAC_RX_CH_MSN_SEL, M_MAC_RX_CH_MSN_SEL)
628#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
629
630/*
631 * MAC Receive Channel Select Registers (Table 9-25)
632 */
633
634/* no bitfields */
635
636/*
637 * MAC MII Management Interface Registers (Table 9-26)
638 * Register: MAC_MDIO_0
639 * Register: MAC_MDIO_1
640 * Register: MAC_MDIO_2
641 */
642
643#define S_MAC_MDC 0
644#define S_MAC_MDIO_DIR 1
645#define S_MAC_MDIO_OUT 2
646#define S_MAC_GENC 3
647#define S_MAC_MDIO_IN 4
648
649#define M_MAC_MDC _SB_MAKEMASK1(S_MAC_MDC)
650#define M_MAC_MDIO_DIR _SB_MAKEMASK1(S_MAC_MDIO_DIR)
651#define M_MAC_MDIO_DIR_INPUT _SB_MAKEMASK1(S_MAC_MDIO_DIR)
652#define M_MAC_MDIO_OUT _SB_MAKEMASK1(S_MAC_MDIO_OUT)
653#define M_MAC_GENC _SB_MAKEMASK1(S_MAC_GENC)
654#define M_MAC_MDIO_IN _SB_MAKEMASK1(S_MAC_MDIO_IN)
655
656#endif
diff --git a/include/asm-mips/sibyte/sb1250_mc.h b/include/asm-mips/sibyte/sb1250_mc.h
deleted file mode 100644
index 1eb1b5a88736..000000000000
--- a/include/asm-mips/sibyte/sb1250_mc.h
+++ /dev/null
@@ -1,550 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * Memory Controller constants File: sb1250_mc.h
5 *
6 * This module contains constants and macros useful for
7 * programming the memory controller.
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000, 2001, 2002, 2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_MC_H
34#define _SB1250_MC_H
35
36#include "sb1250_defs.h"
37
38/*
39 * Memory Channel Config Register (table 6-14)
40 */
41
42#define S_MC_RESERVED0 0
43#define M_MC_RESERVED0 _SB_MAKEMASK(8, S_MC_RESERVED0)
44
45#define S_MC_CHANNEL_SEL 8
46#define M_MC_CHANNEL_SEL _SB_MAKEMASK(8, S_MC_CHANNEL_SEL)
47#define V_MC_CHANNEL_SEL(x) _SB_MAKEVALUE(x, S_MC_CHANNEL_SEL)
48#define G_MC_CHANNEL_SEL(x) _SB_GETVALUE(x, S_MC_CHANNEL_SEL, M_MC_CHANNEL_SEL)
49
50#define S_MC_BANK0_MAP 16
51#define M_MC_BANK0_MAP _SB_MAKEMASK(4, S_MC_BANK0_MAP)
52#define V_MC_BANK0_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK0_MAP)
53#define G_MC_BANK0_MAP(x) _SB_GETVALUE(x, S_MC_BANK0_MAP, M_MC_BANK0_MAP)
54
55#define K_MC_BANK0_MAP_DEFAULT 0x00
56#define V_MC_BANK0_MAP_DEFAULT V_MC_BANK0_MAP(K_MC_BANK0_MAP_DEFAULT)
57
58#define S_MC_BANK1_MAP 20
59#define M_MC_BANK1_MAP _SB_MAKEMASK(4, S_MC_BANK1_MAP)
60#define V_MC_BANK1_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK1_MAP)
61#define G_MC_BANK1_MAP(x) _SB_GETVALUE(x, S_MC_BANK1_MAP, M_MC_BANK1_MAP)
62
63#define K_MC_BANK1_MAP_DEFAULT 0x08
64#define V_MC_BANK1_MAP_DEFAULT V_MC_BANK1_MAP(K_MC_BANK1_MAP_DEFAULT)
65
66#define S_MC_BANK2_MAP 24
67#define M_MC_BANK2_MAP _SB_MAKEMASK(4, S_MC_BANK2_MAP)
68#define V_MC_BANK2_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK2_MAP)
69#define G_MC_BANK2_MAP(x) _SB_GETVALUE(x, S_MC_BANK2_MAP, M_MC_BANK2_MAP)
70
71#define K_MC_BANK2_MAP_DEFAULT 0x09
72#define V_MC_BANK2_MAP_DEFAULT V_MC_BANK2_MAP(K_MC_BANK2_MAP_DEFAULT)
73
74#define S_MC_BANK3_MAP 28
75#define M_MC_BANK3_MAP _SB_MAKEMASK(4, S_MC_BANK3_MAP)
76#define V_MC_BANK3_MAP(x) _SB_MAKEVALUE(x, S_MC_BANK3_MAP)
77#define G_MC_BANK3_MAP(x) _SB_GETVALUE(x, S_MC_BANK3_MAP, M_MC_BANK3_MAP)
78
79#define K_MC_BANK3_MAP_DEFAULT 0x0C
80#define V_MC_BANK3_MAP_DEFAULT V_MC_BANK3_MAP(K_MC_BANK3_MAP_DEFAULT)
81
82#define M_MC_RESERVED1 _SB_MAKEMASK(8, 32)
83
84#define S_MC_QUEUE_SIZE 40
85#define M_MC_QUEUE_SIZE _SB_MAKEMASK(4, S_MC_QUEUE_SIZE)
86#define V_MC_QUEUE_SIZE(x) _SB_MAKEVALUE(x, S_MC_QUEUE_SIZE)
87#define G_MC_QUEUE_SIZE(x) _SB_GETVALUE(x, S_MC_QUEUE_SIZE, M_MC_QUEUE_SIZE)
88#define V_MC_QUEUE_SIZE_DEFAULT V_MC_QUEUE_SIZE(0x0A)
89
90#define S_MC_AGE_LIMIT 44
91#define M_MC_AGE_LIMIT _SB_MAKEMASK(4, S_MC_AGE_LIMIT)
92#define V_MC_AGE_LIMIT(x) _SB_MAKEVALUE(x, S_MC_AGE_LIMIT)
93#define G_MC_AGE_LIMIT(x) _SB_GETVALUE(x, S_MC_AGE_LIMIT, M_MC_AGE_LIMIT)
94#define V_MC_AGE_LIMIT_DEFAULT V_MC_AGE_LIMIT(8)
95
96#define S_MC_WR_LIMIT 48
97#define M_MC_WR_LIMIT _SB_MAKEMASK(4, S_MC_WR_LIMIT)
98#define V_MC_WR_LIMIT(x) _SB_MAKEVALUE(x, S_MC_WR_LIMIT)
99#define G_MC_WR_LIMIT(x) _SB_GETVALUE(x, S_MC_WR_LIMIT, M_MC_WR_LIMIT)
100#define V_MC_WR_LIMIT_DEFAULT V_MC_WR_LIMIT(5)
101
102#define M_MC_IOB1HIGHPRIORITY _SB_MAKEMASK1(52)
103
104#define M_MC_RESERVED2 _SB_MAKEMASK(3, 53)
105
106#define S_MC_CS_MODE 56
107#define M_MC_CS_MODE _SB_MAKEMASK(4, S_MC_CS_MODE)
108#define V_MC_CS_MODE(x) _SB_MAKEVALUE(x, S_MC_CS_MODE)
109#define G_MC_CS_MODE(x) _SB_GETVALUE(x, S_MC_CS_MODE, M_MC_CS_MODE)
110
111#define K_MC_CS_MODE_MSB_CS 0
112#define K_MC_CS_MODE_INTLV_CS 15
113#define K_MC_CS_MODE_MIXED_CS_10 12
114#define K_MC_CS_MODE_MIXED_CS_30 6
115#define K_MC_CS_MODE_MIXED_CS_32 3
116
117#define V_MC_CS_MODE_MSB_CS V_MC_CS_MODE(K_MC_CS_MODE_MSB_CS)
118#define V_MC_CS_MODE_INTLV_CS V_MC_CS_MODE(K_MC_CS_MODE_INTLV_CS)
119#define V_MC_CS_MODE_MIXED_CS_10 V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_10)
120#define V_MC_CS_MODE_MIXED_CS_30 V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_30)
121#define V_MC_CS_MODE_MIXED_CS_32 V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_32)
122
123#define M_MC_ECC_DISABLE _SB_MAKEMASK1(60)
124#define M_MC_BERR_DISABLE _SB_MAKEMASK1(61)
125#define M_MC_FORCE_SEQ _SB_MAKEMASK1(62)
126#define M_MC_DEBUG _SB_MAKEMASK1(63)
127
128#define V_MC_CONFIG_DEFAULT V_MC_WR_LIMIT_DEFAULT | V_MC_AGE_LIMIT_DEFAULT | \
129 V_MC_BANK0_MAP_DEFAULT | V_MC_BANK1_MAP_DEFAULT | \
130 V_MC_BANK2_MAP_DEFAULT | V_MC_BANK3_MAP_DEFAULT | V_MC_CHANNEL_SEL(0) | \
131 M_MC_IOB1HIGHPRIORITY | V_MC_QUEUE_SIZE_DEFAULT
132
133
134/*
135 * Memory clock config register (Table 6-15)
136 *
137 * Note: this field has been updated to be consistent with the errata to 0.2
138 */
139
140#define S_MC_CLK_RATIO 0
141#define M_MC_CLK_RATIO _SB_MAKEMASK(4, S_MC_CLK_RATIO)
142#define V_MC_CLK_RATIO(x) _SB_MAKEVALUE(x, S_MC_CLK_RATIO)
143#define G_MC_CLK_RATIO(x) _SB_GETVALUE(x, S_MC_CLK_RATIO, M_MC_CLK_RATIO)
144
145#define K_MC_CLK_RATIO_2X 4
146#define K_MC_CLK_RATIO_25X 5
147#define K_MC_CLK_RATIO_3X 6
148#define K_MC_CLK_RATIO_35X 7
149#define K_MC_CLK_RATIO_4X 8
150#define K_MC_CLK_RATIO_45X 9
151
152#define V_MC_CLK_RATIO_2X V_MC_CLK_RATIO(K_MC_CLK_RATIO_2X)
153#define V_MC_CLK_RATIO_25X V_MC_CLK_RATIO(K_MC_CLK_RATIO_25X)
154#define V_MC_CLK_RATIO_3X V_MC_CLK_RATIO(K_MC_CLK_RATIO_3X)
155#define V_MC_CLK_RATIO_35X V_MC_CLK_RATIO(K_MC_CLK_RATIO_35X)
156#define V_MC_CLK_RATIO_4X V_MC_CLK_RATIO(K_MC_CLK_RATIO_4X)
157#define V_MC_CLK_RATIO_45X V_MC_CLK_RATIO(K_MC_CLK_RATIO_45X)
158#define V_MC_CLK_RATIO_DEFAULT V_MC_CLK_RATIO_25X
159
160#define S_MC_REF_RATE 8
161#define M_MC_REF_RATE _SB_MAKEMASK(8, S_MC_REF_RATE)
162#define V_MC_REF_RATE(x) _SB_MAKEVALUE(x, S_MC_REF_RATE)
163#define G_MC_REF_RATE(x) _SB_GETVALUE(x, S_MC_REF_RATE, M_MC_REF_RATE)
164
165#define K_MC_REF_RATE_100MHz 0x62
166#define K_MC_REF_RATE_133MHz 0x81
167#define K_MC_REF_RATE_200MHz 0xC4
168
169#define V_MC_REF_RATE_100MHz V_MC_REF_RATE(K_MC_REF_RATE_100MHz)
170#define V_MC_REF_RATE_133MHz V_MC_REF_RATE(K_MC_REF_RATE_133MHz)
171#define V_MC_REF_RATE_200MHz V_MC_REF_RATE(K_MC_REF_RATE_200MHz)
172#define V_MC_REF_RATE_DEFAULT V_MC_REF_RATE_100MHz
173
174#define S_MC_CLOCK_DRIVE 16
175#define M_MC_CLOCK_DRIVE _SB_MAKEMASK(4, S_MC_CLOCK_DRIVE)
176#define V_MC_CLOCK_DRIVE(x) _SB_MAKEVALUE(x, S_MC_CLOCK_DRIVE)
177#define G_MC_CLOCK_DRIVE(x) _SB_GETVALUE(x, S_MC_CLOCK_DRIVE, M_MC_CLOCK_DRIVE)
178#define V_MC_CLOCK_DRIVE_DEFAULT V_MC_CLOCK_DRIVE(0xF)
179
180#define S_MC_DATA_DRIVE 20
181#define M_MC_DATA_DRIVE _SB_MAKEMASK(4, S_MC_DATA_DRIVE)
182#define V_MC_DATA_DRIVE(x) _SB_MAKEVALUE(x, S_MC_DATA_DRIVE)
183#define G_MC_DATA_DRIVE(x) _SB_GETVALUE(x, S_MC_DATA_DRIVE, M_MC_DATA_DRIVE)
184#define V_MC_DATA_DRIVE_DEFAULT V_MC_DATA_DRIVE(0x0)
185
186#define S_MC_ADDR_DRIVE 24
187#define M_MC_ADDR_DRIVE _SB_MAKEMASK(4, S_MC_ADDR_DRIVE)
188#define V_MC_ADDR_DRIVE(x) _SB_MAKEVALUE(x, S_MC_ADDR_DRIVE)
189#define G_MC_ADDR_DRIVE(x) _SB_GETVALUE(x, S_MC_ADDR_DRIVE, M_MC_ADDR_DRIVE)
190#define V_MC_ADDR_DRIVE_DEFAULT V_MC_ADDR_DRIVE(0x0)
191
192#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
193#define M_MC_REF_DISABLE _SB_MAKEMASK1(30)
194#endif /* 1250 PASS3 || 112x PASS1 */
195
196#define M_MC_DLL_BYPASS _SB_MAKEMASK1(31)
197
198#define S_MC_DQI_SKEW 32
199#define M_MC_DQI_SKEW _SB_MAKEMASK(8, S_MC_DQI_SKEW)
200#define V_MC_DQI_SKEW(x) _SB_MAKEVALUE(x, S_MC_DQI_SKEW)
201#define G_MC_DQI_SKEW(x) _SB_GETVALUE(x, S_MC_DQI_SKEW, M_MC_DQI_SKEW)
202#define V_MC_DQI_SKEW_DEFAULT V_MC_DQI_SKEW(0)
203
204#define S_MC_DQO_SKEW 40
205#define M_MC_DQO_SKEW _SB_MAKEMASK(8, S_MC_DQO_SKEW)
206#define V_MC_DQO_SKEW(x) _SB_MAKEVALUE(x, S_MC_DQO_SKEW)
207#define G_MC_DQO_SKEW(x) _SB_GETVALUE(x, S_MC_DQO_SKEW, M_MC_DQO_SKEW)
208#define V_MC_DQO_SKEW_DEFAULT V_MC_DQO_SKEW(0)
209
210#define S_MC_ADDR_SKEW 48
211#define M_MC_ADDR_SKEW _SB_MAKEMASK(8, S_MC_ADDR_SKEW)
212#define V_MC_ADDR_SKEW(x) _SB_MAKEVALUE(x, S_MC_ADDR_SKEW)
213#define G_MC_ADDR_SKEW(x) _SB_GETVALUE(x, S_MC_ADDR_SKEW, M_MC_ADDR_SKEW)
214#define V_MC_ADDR_SKEW_DEFAULT V_MC_ADDR_SKEW(0x0F)
215
216#define S_MC_DLL_DEFAULT 56
217#define M_MC_DLL_DEFAULT _SB_MAKEMASK(8, S_MC_DLL_DEFAULT)
218#define V_MC_DLL_DEFAULT(x) _SB_MAKEVALUE(x, S_MC_DLL_DEFAULT)
219#define G_MC_DLL_DEFAULT(x) _SB_GETVALUE(x, S_MC_DLL_DEFAULT, M_MC_DLL_DEFAULT)
220#define V_MC_DLL_DEFAULT_DEFAULT V_MC_DLL_DEFAULT(0x10)
221
222#define V_MC_CLKCONFIG_DEFAULT V_MC_DLL_DEFAULT_DEFAULT | \
223 V_MC_ADDR_SKEW_DEFAULT | \
224 V_MC_DQO_SKEW_DEFAULT | \
225 V_MC_DQI_SKEW_DEFAULT | \
226 V_MC_ADDR_DRIVE_DEFAULT | \
227 V_MC_DATA_DRIVE_DEFAULT | \
228 V_MC_CLOCK_DRIVE_DEFAULT | \
229 V_MC_REF_RATE_DEFAULT
230
231
232
233/*
234 * DRAM Command Register (Table 6-13)
235 */
236
237#define S_MC_COMMAND 0
238#define M_MC_COMMAND _SB_MAKEMASK(4, S_MC_COMMAND)
239#define V_MC_COMMAND(x) _SB_MAKEVALUE(x, S_MC_COMMAND)
240#define G_MC_COMMAND(x) _SB_GETVALUE(x, S_MC_COMMAND, M_MC_COMMAND)
241
242#define K_MC_COMMAND_EMRS 0
243#define K_MC_COMMAND_MRS 1
244#define K_MC_COMMAND_PRE 2
245#define K_MC_COMMAND_AR 3
246#define K_MC_COMMAND_SETRFSH 4
247#define K_MC_COMMAND_CLRRFSH 5
248#define K_MC_COMMAND_SETPWRDN 6
249#define K_MC_COMMAND_CLRPWRDN 7
250
251#define V_MC_COMMAND_EMRS V_MC_COMMAND(K_MC_COMMAND_EMRS)
252#define V_MC_COMMAND_MRS V_MC_COMMAND(K_MC_COMMAND_MRS)
253#define V_MC_COMMAND_PRE V_MC_COMMAND(K_MC_COMMAND_PRE)
254#define V_MC_COMMAND_AR V_MC_COMMAND(K_MC_COMMAND_AR)
255#define V_MC_COMMAND_SETRFSH V_MC_COMMAND(K_MC_COMMAND_SETRFSH)
256#define V_MC_COMMAND_CLRRFSH V_MC_COMMAND(K_MC_COMMAND_CLRRFSH)
257#define V_MC_COMMAND_SETPWRDN V_MC_COMMAND(K_MC_COMMAND_SETPWRDN)
258#define V_MC_COMMAND_CLRPWRDN V_MC_COMMAND(K_MC_COMMAND_CLRPWRDN)
259
260#define M_MC_CS0 _SB_MAKEMASK1(4)
261#define M_MC_CS1 _SB_MAKEMASK1(5)
262#define M_MC_CS2 _SB_MAKEMASK1(6)
263#define M_MC_CS3 _SB_MAKEMASK1(7)
264
265/*
266 * DRAM Mode Register (Table 6-14)
267 */
268
269#define S_MC_EMODE 0
270#define M_MC_EMODE _SB_MAKEMASK(15, S_MC_EMODE)
271#define V_MC_EMODE(x) _SB_MAKEVALUE(x, S_MC_EMODE)
272#define G_MC_EMODE(x) _SB_GETVALUE(x, S_MC_EMODE, M_MC_EMODE)
273#define V_MC_EMODE_DEFAULT V_MC_EMODE(0)
274
275#define S_MC_MODE 16
276#define M_MC_MODE _SB_MAKEMASK(15, S_MC_MODE)
277#define V_MC_MODE(x) _SB_MAKEVALUE(x, S_MC_MODE)
278#define G_MC_MODE(x) _SB_GETVALUE(x, S_MC_MODE, M_MC_MODE)
279#define V_MC_MODE_DEFAULT V_MC_MODE(0x22)
280
281#define S_MC_DRAM_TYPE 32
282#define M_MC_DRAM_TYPE _SB_MAKEMASK(3, S_MC_DRAM_TYPE)
283#define V_MC_DRAM_TYPE(x) _SB_MAKEVALUE(x, S_MC_DRAM_TYPE)
284#define G_MC_DRAM_TYPE(x) _SB_GETVALUE(x, S_MC_DRAM_TYPE, M_MC_DRAM_TYPE)
285
286#define K_MC_DRAM_TYPE_JEDEC 0
287#define K_MC_DRAM_TYPE_FCRAM 1
288#define K_MC_DRAM_TYPE_SGRAM 2
289
290#define V_MC_DRAM_TYPE_JEDEC V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_JEDEC)
291#define V_MC_DRAM_TYPE_FCRAM V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_FCRAM)
292#define V_MC_DRAM_TYPE_SGRAM V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_SGRAM)
293
294#define M_MC_EXTERNALDECODE _SB_MAKEMASK1(35)
295
296#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
297#define M_MC_PRE_ON_A8 _SB_MAKEMASK1(36)
298#define M_MC_RAM_WITH_A13 _SB_MAKEMASK1(37)
299#endif /* 1250 PASS3 || 112x PASS1 */
300
301
302
303/*
304 * SDRAM Timing Register (Table 6-15)
305 */
306
307#define M_MC_w2rIDLE_TWOCYCLES _SB_MAKEMASK1(60)
308#define M_MC_r2wIDLE_TWOCYCLES _SB_MAKEMASK1(61)
309#define M_MC_r2rIDLE_TWOCYCLES _SB_MAKEMASK1(62)
310
311#define S_MC_tFIFO 56
312#define M_MC_tFIFO _SB_MAKEMASK(4, S_MC_tFIFO)
313#define V_MC_tFIFO(x) _SB_MAKEVALUE(x, S_MC_tFIFO)
314#define G_MC_tFIFO(x) _SB_GETVALUE(x, S_MC_tFIFO, M_MC_tFIFO)
315#define K_MC_tFIFO_DEFAULT 1
316#define V_MC_tFIFO_DEFAULT V_MC_tFIFO(K_MC_tFIFO_DEFAULT)
317
318#define S_MC_tRFC 52
319#define M_MC_tRFC _SB_MAKEMASK(4, S_MC_tRFC)
320#define V_MC_tRFC(x) _SB_MAKEVALUE(x, S_MC_tRFC)
321#define G_MC_tRFC(x) _SB_GETVALUE(x, S_MC_tRFC, M_MC_tRFC)
322#define K_MC_tRFC_DEFAULT 12
323#define V_MC_tRFC_DEFAULT V_MC_tRFC(K_MC_tRFC_DEFAULT)
324
325#if SIBYTE_HDR_FEATURE(1250, PASS3)
326#define M_MC_tRFC_PLUS16 _SB_MAKEMASK1(51) /* 1250C3 and later. */
327#endif
328
329#define S_MC_tCwCr 40
330#define M_MC_tCwCr _SB_MAKEMASK(4, S_MC_tCwCr)
331#define V_MC_tCwCr(x) _SB_MAKEVALUE(x, S_MC_tCwCr)
332#define G_MC_tCwCr(x) _SB_GETVALUE(x, S_MC_tCwCr, M_MC_tCwCr)
333#define K_MC_tCwCr_DEFAULT 4
334#define V_MC_tCwCr_DEFAULT V_MC_tCwCr(K_MC_tCwCr_DEFAULT)
335
336#define S_MC_tRCr 28
337#define M_MC_tRCr _SB_MAKEMASK(4, S_MC_tRCr)
338#define V_MC_tRCr(x) _SB_MAKEVALUE(x, S_MC_tRCr)
339#define G_MC_tRCr(x) _SB_GETVALUE(x, S_MC_tRCr, M_MC_tRCr)
340#define K_MC_tRCr_DEFAULT 9
341#define V_MC_tRCr_DEFAULT V_MC_tRCr(K_MC_tRCr_DEFAULT)
342
343#define S_MC_tRCw 24
344#define M_MC_tRCw _SB_MAKEMASK(4, S_MC_tRCw)
345#define V_MC_tRCw(x) _SB_MAKEVALUE(x, S_MC_tRCw)
346#define G_MC_tRCw(x) _SB_GETVALUE(x, S_MC_tRCw, M_MC_tRCw)
347#define K_MC_tRCw_DEFAULT 10
348#define V_MC_tRCw_DEFAULT V_MC_tRCw(K_MC_tRCw_DEFAULT)
349
350#define S_MC_tRRD 20
351#define M_MC_tRRD _SB_MAKEMASK(4, S_MC_tRRD)
352#define V_MC_tRRD(x) _SB_MAKEVALUE(x, S_MC_tRRD)
353#define G_MC_tRRD(x) _SB_GETVALUE(x, S_MC_tRRD, M_MC_tRRD)
354#define K_MC_tRRD_DEFAULT 2
355#define V_MC_tRRD_DEFAULT V_MC_tRRD(K_MC_tRRD_DEFAULT)
356
357#define S_MC_tRP 16
358#define M_MC_tRP _SB_MAKEMASK(4, S_MC_tRP)
359#define V_MC_tRP(x) _SB_MAKEVALUE(x, S_MC_tRP)
360#define G_MC_tRP(x) _SB_GETVALUE(x, S_MC_tRP, M_MC_tRP)
361#define K_MC_tRP_DEFAULT 4
362#define V_MC_tRP_DEFAULT V_MC_tRP(K_MC_tRP_DEFAULT)
363
364#define S_MC_tCwD 8
365#define M_MC_tCwD _SB_MAKEMASK(4, S_MC_tCwD)
366#define V_MC_tCwD(x) _SB_MAKEVALUE(x, S_MC_tCwD)
367#define G_MC_tCwD(x) _SB_GETVALUE(x, S_MC_tCwD, M_MC_tCwD)
368#define K_MC_tCwD_DEFAULT 1
369#define V_MC_tCwD_DEFAULT V_MC_tCwD(K_MC_tCwD_DEFAULT)
370
371#define M_tCrDh _SB_MAKEMASK1(7)
372#define M_MC_tCrDh M_tCrDh
373
374#define S_MC_tCrD 4
375#define M_MC_tCrD _SB_MAKEMASK(3, S_MC_tCrD)
376#define V_MC_tCrD(x) _SB_MAKEVALUE(x, S_MC_tCrD)
377#define G_MC_tCrD(x) _SB_GETVALUE(x, S_MC_tCrD, M_MC_tCrD)
378#define K_MC_tCrD_DEFAULT 2
379#define V_MC_tCrD_DEFAULT V_MC_tCrD(K_MC_tCrD_DEFAULT)
380
381#define S_MC_tRCD 0
382#define M_MC_tRCD _SB_MAKEMASK(4, S_MC_tRCD)
383#define V_MC_tRCD(x) _SB_MAKEVALUE(x, S_MC_tRCD)
384#define G_MC_tRCD(x) _SB_GETVALUE(x, S_MC_tRCD, M_MC_tRCD)
385#define K_MC_tRCD_DEFAULT 3
386#define V_MC_tRCD_DEFAULT V_MC_tRCD(K_MC_tRCD_DEFAULT)
387
388#define V_MC_TIMING_DEFAULT V_MC_tFIFO(K_MC_tFIFO_DEFAULT) | \
389 V_MC_tRFC(K_MC_tRFC_DEFAULT) | \
390 V_MC_tCwCr(K_MC_tCwCr_DEFAULT) | \
391 V_MC_tRCr(K_MC_tRCr_DEFAULT) | \
392 V_MC_tRCw(K_MC_tRCw_DEFAULT) | \
393 V_MC_tRRD(K_MC_tRRD_DEFAULT) | \
394 V_MC_tRP(K_MC_tRP_DEFAULT) | \
395 V_MC_tCwD(K_MC_tCwD_DEFAULT) | \
396 V_MC_tCrD(K_MC_tCrD_DEFAULT) | \
397 V_MC_tRCD(K_MC_tRCD_DEFAULT) | \
398 M_MC_r2rIDLE_TWOCYCLES
399
400/*
401 * Errata says these are not the default
402 * M_MC_w2rIDLE_TWOCYCLES | \
403 * M_MC_r2wIDLE_TWOCYCLES | \
404 */
405
406
407/*
408 * Chip Select Start Address Register (Table 6-17)
409 */
410
411#define S_MC_CS0_START 0
412#define M_MC_CS0_START _SB_MAKEMASK(16, S_MC_CS0_START)
413#define V_MC_CS0_START(x) _SB_MAKEVALUE(x, S_MC_CS0_START)
414#define G_MC_CS0_START(x) _SB_GETVALUE(x, S_MC_CS0_START, M_MC_CS0_START)
415
416#define S_MC_CS1_START 16
417#define M_MC_CS1_START _SB_MAKEMASK(16, S_MC_CS1_START)
418#define V_MC_CS1_START(x) _SB_MAKEVALUE(x, S_MC_CS1_START)
419#define G_MC_CS1_START(x) _SB_GETVALUE(x, S_MC_CS1_START, M_MC_CS1_START)
420
421#define S_MC_CS2_START 32
422#define M_MC_CS2_START _SB_MAKEMASK(16, S_MC_CS2_START)
423#define V_MC_CS2_START(x) _SB_MAKEVALUE(x, S_MC_CS2_START)
424#define G_MC_CS2_START(x) _SB_GETVALUE(x, S_MC_CS2_START, M_MC_CS2_START)
425
426#define S_MC_CS3_START 48
427#define M_MC_CS3_START _SB_MAKEMASK(16, S_MC_CS3_START)
428#define V_MC_CS3_START(x) _SB_MAKEVALUE(x, S_MC_CS3_START)
429#define G_MC_CS3_START(x) _SB_GETVALUE(x, S_MC_CS3_START, M_MC_CS3_START)
430
431/*
432 * Chip Select End Address Register (Table 6-18)
433 */
434
435#define S_MC_CS0_END 0
436#define M_MC_CS0_END _SB_MAKEMASK(16, S_MC_CS0_END)
437#define V_MC_CS0_END(x) _SB_MAKEVALUE(x, S_MC_CS0_END)
438#define G_MC_CS0_END(x) _SB_GETVALUE(x, S_MC_CS0_END, M_MC_CS0_END)
439
440#define S_MC_CS1_END 16
441#define M_MC_CS1_END _SB_MAKEMASK(16, S_MC_CS1_END)
442#define V_MC_CS1_END(x) _SB_MAKEVALUE(x, S_MC_CS1_END)
443#define G_MC_CS1_END(x) _SB_GETVALUE(x, S_MC_CS1_END, M_MC_CS1_END)
444
445#define S_MC_CS2_END 32
446#define M_MC_CS2_END _SB_MAKEMASK(16, S_MC_CS2_END)
447#define V_MC_CS2_END(x) _SB_MAKEVALUE(x, S_MC_CS2_END)
448#define G_MC_CS2_END(x) _SB_GETVALUE(x, S_MC_CS2_END, M_MC_CS2_END)
449
450#define S_MC_CS3_END 48
451#define M_MC_CS3_END _SB_MAKEMASK(16, S_MC_CS3_END)
452#define V_MC_CS3_END(x) _SB_MAKEVALUE(x, S_MC_CS3_END)
453#define G_MC_CS3_END(x) _SB_GETVALUE(x, S_MC_CS3_END, M_MC_CS3_END)
454
455/*
456 * Chip Select Interleave Register (Table 6-19)
457 */
458
459#define S_MC_INTLV_RESERVED 0
460#define M_MC_INTLV_RESERVED _SB_MAKEMASK(5, S_MC_INTLV_RESERVED)
461
462#define S_MC_INTERLEAVE 7
463#define M_MC_INTERLEAVE _SB_MAKEMASK(18, S_MC_INTERLEAVE)
464#define V_MC_INTERLEAVE(x) _SB_MAKEVALUE(x, S_MC_INTERLEAVE)
465
466#define S_MC_INTLV_MBZ 25
467#define M_MC_INTLV_MBZ _SB_MAKEMASK(39, S_MC_INTLV_MBZ)
468
469/*
470 * Row Address Bits Register (Table 6-20)
471 */
472
473#define S_MC_RAS_RESERVED 0
474#define M_MC_RAS_RESERVED _SB_MAKEMASK(5, S_MC_RAS_RESERVED)
475
476#define S_MC_RAS_SELECT 12
477#define M_MC_RAS_SELECT _SB_MAKEMASK(25, S_MC_RAS_SELECT)
478#define V_MC_RAS_SELECT(x) _SB_MAKEVALUE(x, S_MC_RAS_SELECT)
479
480#define S_MC_RAS_MBZ 37
481#define M_MC_RAS_MBZ _SB_MAKEMASK(27, S_MC_RAS_MBZ)
482
483
484/*
485 * Column Address Bits Register (Table 6-21)
486 */
487
488#define S_MC_CAS_RESERVED 0
489#define M_MC_CAS_RESERVED _SB_MAKEMASK(5, S_MC_CAS_RESERVED)
490
491#define S_MC_CAS_SELECT 5
492#define M_MC_CAS_SELECT _SB_MAKEMASK(18, S_MC_CAS_SELECT)
493#define V_MC_CAS_SELECT(x) _SB_MAKEVALUE(x, S_MC_CAS_SELECT)
494
495#define S_MC_CAS_MBZ 23
496#define M_MC_CAS_MBZ _SB_MAKEMASK(41, S_MC_CAS_MBZ)
497
498
499/*
500 * Bank Address Address Bits Register (Table 6-22)
501 */
502
503#define S_MC_BA_RESERVED 0
504#define M_MC_BA_RESERVED _SB_MAKEMASK(5, S_MC_BA_RESERVED)
505
506#define S_MC_BA_SELECT 5
507#define M_MC_BA_SELECT _SB_MAKEMASK(20, S_MC_BA_SELECT)
508#define V_MC_BA_SELECT(x) _SB_MAKEVALUE(x, S_MC_BA_SELECT)
509
510#define S_MC_BA_MBZ 25
511#define M_MC_BA_MBZ _SB_MAKEMASK(39, S_MC_BA_MBZ)
512
513/*
514 * Chip Select Attribute Register (Table 6-23)
515 */
516
517#define K_MC_CS_ATTR_CLOSED 0
518#define K_MC_CS_ATTR_CASCHECK 1
519#define K_MC_CS_ATTR_HINT 2
520#define K_MC_CS_ATTR_OPEN 3
521
522#define S_MC_CS0_PAGE 0
523#define M_MC_CS0_PAGE _SB_MAKEMASK(2, S_MC_CS0_PAGE)
524#define V_MC_CS0_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS0_PAGE)
525#define G_MC_CS0_PAGE(x) _SB_GETVALUE(x, S_MC_CS0_PAGE, M_MC_CS0_PAGE)
526
527#define S_MC_CS1_PAGE 16
528#define M_MC_CS1_PAGE _SB_MAKEMASK(2, S_MC_CS1_PAGE)
529#define V_MC_CS1_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS1_PAGE)
530#define G_MC_CS1_PAGE(x) _SB_GETVALUE(x, S_MC_CS1_PAGE, M_MC_CS1_PAGE)
531
532#define S_MC_CS2_PAGE 32
533#define M_MC_CS2_PAGE _SB_MAKEMASK(2, S_MC_CS2_PAGE)
534#define V_MC_CS2_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS2_PAGE)
535#define G_MC_CS2_PAGE(x) _SB_GETVALUE(x, S_MC_CS2_PAGE, M_MC_CS2_PAGE)
536
537#define S_MC_CS3_PAGE 48
538#define M_MC_CS3_PAGE _SB_MAKEMASK(2, S_MC_CS3_PAGE)
539#define V_MC_CS3_PAGE(x) _SB_MAKEVALUE(x, S_MC_CS3_PAGE)
540#define G_MC_CS3_PAGE(x) _SB_GETVALUE(x, S_MC_CS3_PAGE, M_MC_CS3_PAGE)
541
542/*
543 * ECC Test ECC Register (Table 6-25)
544 */
545
546#define S_MC_ECC_INVERT 0
547#define M_MC_ECC_INVERT _SB_MAKEMASK(8, S_MC_ECC_INVERT)
548
549
550#endif
diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h
deleted file mode 100644
index 8f53ec817a5e..000000000000
--- a/include/asm-mips/sibyte/sb1250_regs.h
+++ /dev/null
@@ -1,893 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * Register Definitions File: sb1250_regs.h
5 *
6 * This module contains the addresses of the on-chip peripherals
7 * on the SB1250.
8 *
9 * SB1250 specification level: 01/02/2002
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_REGS_H
34#define _SB1250_REGS_H
35
36#include "sb1250_defs.h"
37
38
39/* *********************************************************************
40 * Some general notes:
41 *
42 * For the most part, when there is more than one peripheral
43 * of the same type on the SOC, the constants below will be
44 * offsets from the base of each peripheral. For example,
45 * the MAC registers are described as offsets from the first
46 * MAC register, and there will be a MAC_REGISTER() macro
47 * to calculate the base address of a given MAC.
48 *
49 * The information in this file is based on the SB1250 SOC
50 * manual version 0.2, July 2000.
51 ********************************************************************* */
52
53
54/* *********************************************************************
55 * Memory Controller Registers
56 ********************************************************************* */
57
58/*
59 * XXX: can't remove MC base 0 if 112x, since it's used by other macros,
60 * since there is one reg there (but it could get its addr/offset constant).
61 */
62
63#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
64#define A_MC_BASE_0 0x0010051000
65#define A_MC_BASE_1 0x0010052000
66#define MC_REGISTER_SPACING 0x1000
67
68#define A_MC_BASE(ctlid) ((ctlid)*MC_REGISTER_SPACING+A_MC_BASE_0)
69#define A_MC_REGISTER(ctlid, reg) (A_MC_BASE(ctlid)+(reg))
70
71#define R_MC_CONFIG 0x0000000100
72#define R_MC_DRAMCMD 0x0000000120
73#define R_MC_DRAMMODE 0x0000000140
74#define R_MC_TIMING1 0x0000000160
75#define R_MC_TIMING2 0x0000000180
76#define R_MC_CS_START 0x00000001A0
77#define R_MC_CS_END 0x00000001C0
78#define R_MC_CS_INTERLEAVE 0x00000001E0
79#define S_MC_CS_STARTEND 16
80
81#define R_MC_CSX_BASE 0x0000000200
82#define R_MC_CSX_ROW 0x0000000000 /* relative to CSX_BASE, above */
83#define R_MC_CSX_COL 0x0000000020 /* relative to CSX_BASE, above */
84#define R_MC_CSX_BA 0x0000000040 /* relative to CSX_BASE, above */
85#define MC_CSX_SPACING 0x0000000060 /* relative to CSX_BASE, above */
86
87#define R_MC_CS0_ROW 0x0000000200
88#define R_MC_CS0_COL 0x0000000220
89#define R_MC_CS0_BA 0x0000000240
90#define R_MC_CS1_ROW 0x0000000260
91#define R_MC_CS1_COL 0x0000000280
92#define R_MC_CS1_BA 0x00000002A0
93#define R_MC_CS2_ROW 0x00000002C0
94#define R_MC_CS2_COL 0x00000002E0
95#define R_MC_CS2_BA 0x0000000300
96#define R_MC_CS3_ROW 0x0000000320
97#define R_MC_CS3_COL 0x0000000340
98#define R_MC_CS3_BA 0x0000000360
99#define R_MC_CS_ATTR 0x0000000380
100#define R_MC_TEST_DATA 0x0000000400
101#define R_MC_TEST_ECC 0x0000000420
102#define R_MC_MCLK_CFG 0x0000000500
103
104#endif /* 1250 & 112x */
105
106/* *********************************************************************
107 * L2 Cache Control Registers
108 ********************************************************************* */
109
110#if SIBYTE_HDR_FEATURE_1250_112x /* This L2C only on 1250/112x */
111
112#define A_L2_READ_TAG 0x0010040018
113#define A_L2_ECC_TAG 0x0010040038
114#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
115#define A_L2_READ_MISC 0x0010040058
116#endif /* 1250 PASS3 || 112x PASS1 */
117#define A_L2_WAY_DISABLE 0x0010041000
118#define A_L2_MAKEDISABLE(x) (A_L2_WAY_DISABLE | (((~(x))&0x0F) << 8))
119#define A_L2_MGMT_TAG_BASE 0x00D0000000
120
121#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
122#define A_L2_CACHE_DISABLE 0x0010042000
123#define A_L2_MAKECACHEDISABLE(x) (A_L2_CACHE_DISABLE | (((x)&0x0F) << 8))
124#define A_L2_MISC_CONFIG 0x0010043000
125#endif /* 1250 PASS2 || 112x PASS1 */
126
127/* Backward-compatibility definitions. */
128/* XXX: discourage people from using these constants. */
129#define A_L2_READ_ADDRESS A_L2_READ_TAG
130#define A_L2_EEC_ADDRESS A_L2_ECC_TAG
131
132#endif
133
134
135/* *********************************************************************
136 * PCI Interface Registers
137 ********************************************************************* */
138
139#if SIBYTE_HDR_FEATURE_1250_112x /* This PCI/HT only on 1250/112x */
140#define A_PCI_TYPE00_HEADER 0x00DE000000
141#define A_PCI_TYPE01_HEADER 0x00DE000800
142#endif
143
144
145/* *********************************************************************
146 * Ethernet DMA and MACs
147 ********************************************************************* */
148
149#define A_MAC_BASE_0 0x0010064000
150#define A_MAC_BASE_1 0x0010065000
151#if SIBYTE_HDR_FEATURE_CHIP(1250)
152#define A_MAC_BASE_2 0x0010066000
153#endif /* 1250 */
154
155#define MAC_SPACING 0x1000
156#define MAC_DMA_TXRX_SPACING 0x0400
157#define MAC_DMA_CHANNEL_SPACING 0x0100
158#define DMA_RX 0
159#define DMA_TX 1
160#define MAC_NUM_DMACHAN 2 /* channels per direction */
161
162/* XXX: not correct; depends on SOC type. */
163#define MAC_NUM_PORTS 3
164
165#define A_MAC_CHANNEL_BASE(macnum) \
166 (A_MAC_BASE_0 + \
167 MAC_SPACING*(macnum))
168
169#define A_MAC_REGISTER(macnum,reg) \
170 (A_MAC_BASE_0 + \
171 MAC_SPACING*(macnum) + (reg))
172
173
174#define R_MAC_DMA_CHANNELS 0x800 /* Relative to A_MAC_CHANNEL_BASE */
175
176#define A_MAC_DMA_CHANNEL_BASE(macnum, txrx, chan) \
177 ((A_MAC_CHANNEL_BASE(macnum)) + \
178 R_MAC_DMA_CHANNELS + \
179 (MAC_DMA_TXRX_SPACING*(txrx)) + \
180 (MAC_DMA_CHANNEL_SPACING*(chan)))
181
182#define R_MAC_DMA_CHANNEL_BASE(txrx, chan) \
183 (R_MAC_DMA_CHANNELS + \
184 (MAC_DMA_TXRX_SPACING*(txrx)) + \
185 (MAC_DMA_CHANNEL_SPACING*(chan)))
186
187#define A_MAC_DMA_REGISTER(macnum, txrx, chan, reg) \
188 (A_MAC_DMA_CHANNEL_BASE(macnum, txrx, chan) + \
189 (reg))
190
191#define R_MAC_DMA_REGISTER(txrx, chan, reg) \
192 (R_MAC_DMA_CHANNEL_BASE(txrx, chan) + \
193 (reg))
194
195/*
196 * DMA channel registers, relative to A_MAC_DMA_CHANNEL_BASE
197 */
198
199#define R_MAC_DMA_CONFIG0 0x00000000
200#define R_MAC_DMA_CONFIG1 0x00000008
201#define R_MAC_DMA_DSCR_BASE 0x00000010
202#define R_MAC_DMA_DSCR_CNT 0x00000018
203#define R_MAC_DMA_CUR_DSCRA 0x00000020
204#define R_MAC_DMA_CUR_DSCRB 0x00000028
205#define R_MAC_DMA_CUR_DSCRADDR 0x00000030
206#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
207#define R_MAC_DMA_OODPKTLOST_RX 0x00000038 /* rx only */
208#endif /* 1250 PASS3 || 112x PASS1 */
209
210/*
211 * RMON Counters
212 */
213
214#define R_MAC_RMON_TX_BYTES 0x00000000
215#define R_MAC_RMON_COLLISIONS 0x00000008
216#define R_MAC_RMON_LATE_COL 0x00000010
217#define R_MAC_RMON_EX_COL 0x00000018
218#define R_MAC_RMON_FCS_ERROR 0x00000020
219#define R_MAC_RMON_TX_ABORT 0x00000028
220/* Counter #6 (0x30) now reserved */
221#define R_MAC_RMON_TX_BAD 0x00000038
222#define R_MAC_RMON_TX_GOOD 0x00000040
223#define R_MAC_RMON_TX_RUNT 0x00000048
224#define R_MAC_RMON_TX_OVERSIZE 0x00000050
225#define R_MAC_RMON_RX_BYTES 0x00000080
226#define R_MAC_RMON_RX_MCAST 0x00000088
227#define R_MAC_RMON_RX_BCAST 0x00000090
228#define R_MAC_RMON_RX_BAD 0x00000098
229#define R_MAC_RMON_RX_GOOD 0x000000A0
230#define R_MAC_RMON_RX_RUNT 0x000000A8
231#define R_MAC_RMON_RX_OVERSIZE 0x000000B0
232#define R_MAC_RMON_RX_FCS_ERROR 0x000000B8
233#define R_MAC_RMON_RX_LENGTH_ERROR 0x000000C0
234#define R_MAC_RMON_RX_CODE_ERROR 0x000000C8
235#define R_MAC_RMON_RX_ALIGN_ERROR 0x000000D0
236
237/* Updated to spec 0.2 */
238#define R_MAC_CFG 0x00000100
239#define R_MAC_THRSH_CFG 0x00000108
240#define R_MAC_VLANTAG 0x00000110
241#define R_MAC_FRAMECFG 0x00000118
242#define R_MAC_EOPCNT 0x00000120
243#define R_MAC_FIFO_PTRS 0x00000128
244#define R_MAC_ADFILTER_CFG 0x00000200
245#define R_MAC_ETHERNET_ADDR 0x00000208
246#define R_MAC_PKT_TYPE 0x00000210
247#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
248#define R_MAC_ADMASK0 0x00000218
249#define R_MAC_ADMASK1 0x00000220
250#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
251#define R_MAC_HASH_BASE 0x00000240
252#define R_MAC_ADDR_BASE 0x00000280
253#define R_MAC_CHLO0_BASE 0x00000300
254#define R_MAC_CHUP0_BASE 0x00000320
255#define R_MAC_ENABLE 0x00000400
256#define R_MAC_STATUS 0x00000408
257#define R_MAC_INT_MASK 0x00000410
258#define R_MAC_TXD_CTL 0x00000420
259#define R_MAC_MDIO 0x00000428
260#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
261#define R_MAC_STATUS1 0x00000430
262#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
263#define R_MAC_DEBUG_STATUS 0x00000448
264
265#define MAC_HASH_COUNT 8
266#define MAC_ADDR_COUNT 8
267#define MAC_CHMAP_COUNT 4
268
269
270/* *********************************************************************
271 * DUART Registers
272 ********************************************************************* */
273
274
275#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
276#define R_DUART_NUM_PORTS 2
277
278#define A_DUART 0x0010060000
279
280#define DUART_CHANREG_SPACING 0x100
281
282#define A_DUART_CHANREG(chan, reg) \
283 (A_DUART + DUART_CHANREG_SPACING * ((chan) + 1) + (reg))
284#endif /* 1250 & 112x */
285
286#define R_DUART_MODE_REG_1 0x000
287#define R_DUART_MODE_REG_2 0x010
288#define R_DUART_STATUS 0x020
289#define R_DUART_CLK_SEL 0x030
290#define R_DUART_CMD 0x050
291#define R_DUART_RX_HOLD 0x060
292#define R_DUART_TX_HOLD 0x070
293
294#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
295#define R_DUART_FULL_CTL 0x040
296#define R_DUART_OPCR_X 0x080
297#define R_DUART_AUXCTL_X 0x090
298#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
299
300
301/*
302 * The IMR and ISR can't be addressed with A_DUART_CHANREG,
303 * so use these macros instead.
304 */
305
306#if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */
307#define DUART_IMRISR_SPACING 0x20
308#define DUART_INCHNG_SPACING 0x10
309
310#define A_DUART_CTRLREG(reg) \
311 (A_DUART + DUART_CHANREG_SPACING * 3 + (reg))
312
313#define R_DUART_IMRREG(chan) \
314 (R_DUART_IMR_A + (chan) * DUART_IMRISR_SPACING)
315#define R_DUART_ISRREG(chan) \
316 (R_DUART_ISR_A + (chan) * DUART_IMRISR_SPACING)
317#define R_DUART_INCHREG(chan) \
318 (R_DUART_IN_CHNG_A + (chan) * DUART_INCHNG_SPACING)
319
320#define A_DUART_IMRREG(chan) A_DUART_CTRLREG(R_DUART_IMRREG(chan))
321#define A_DUART_ISRREG(chan) A_DUART_CTRLREG(R_DUART_ISRREG(chan))
322#define A_DUART_INCHREG(chan) A_DUART_CTRLREG(R_DUART_INCHREG(chan))
323#endif /* 1250 & 112x */
324
325#define R_DUART_AUX_CTRL 0x010
326#define R_DUART_ISR_A 0x020
327#define R_DUART_IMR_A 0x030
328#define R_DUART_ISR_B 0x040
329#define R_DUART_IMR_B 0x050
330#define R_DUART_OUT_PORT 0x060
331#define R_DUART_OPCR 0x070
332#define R_DUART_IN_PORT 0x080
333
334#define R_DUART_SET_OPR 0x0B0
335#define R_DUART_CLEAR_OPR 0x0C0
336#define R_DUART_IN_CHNG_A 0x0D0
337#define R_DUART_IN_CHNG_B 0x0E0
338
339
340/*
341 * These constants are the absolute addresses.
342 */
343
344#define A_DUART_MODE_REG_1_A 0x0010060100
345#define A_DUART_MODE_REG_2_A 0x0010060110
346#define A_DUART_STATUS_A 0x0010060120
347#define A_DUART_CLK_SEL_A 0x0010060130
348#define A_DUART_CMD_A 0x0010060150
349#define A_DUART_RX_HOLD_A 0x0010060160
350#define A_DUART_TX_HOLD_A 0x0010060170
351
352#define A_DUART_MODE_REG_1_B 0x0010060200
353#define A_DUART_MODE_REG_2_B 0x0010060210
354#define A_DUART_STATUS_B 0x0010060220
355#define A_DUART_CLK_SEL_B 0x0010060230
356#define A_DUART_CMD_B 0x0010060250
357#define A_DUART_RX_HOLD_B 0x0010060260
358#define A_DUART_TX_HOLD_B 0x0010060270
359
360#define A_DUART_INPORT_CHNG 0x0010060300
361#define A_DUART_AUX_CTRL 0x0010060310
362#define A_DUART_ISR_A 0x0010060320
363#define A_DUART_IMR_A 0x0010060330
364#define A_DUART_ISR_B 0x0010060340
365#define A_DUART_IMR_B 0x0010060350
366#define A_DUART_OUT_PORT 0x0010060360
367#define A_DUART_OPCR 0x0010060370
368#define A_DUART_IN_PORT 0x0010060380
369#define A_DUART_ISR 0x0010060390
370#define A_DUART_IMR 0x00100603A0
371#define A_DUART_SET_OPR 0x00100603B0
372#define A_DUART_CLEAR_OPR 0x00100603C0
373#define A_DUART_INPORT_CHNG_A 0x00100603D0
374#define A_DUART_INPORT_CHNG_B 0x00100603E0
375
376#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
377#define A_DUART_FULL_CTL_A 0x0010060140
378#define A_DUART_FULL_CTL_B 0x0010060240
379
380#define A_DUART_OPCR_A 0x0010060180
381#define A_DUART_OPCR_B 0x0010060280
382
383#define A_DUART_INPORT_CHNG_DEBUG 0x00100603F0
384#endif /* 1250 PASS2 || 112x PASS1 */
385
386
387/* *********************************************************************
388 * Synchronous Serial Registers
389 ********************************************************************* */
390
391
392#if SIBYTE_HDR_FEATURE_1250_112x /* sync serial only on 1250/112x */
393
394#define A_SER_BASE_0 0x0010060400
395#define A_SER_BASE_1 0x0010060800
396#define SER_SPACING 0x400
397
398#define SER_DMA_TXRX_SPACING 0x80
399
400#define SER_NUM_PORTS 2
401
402#define A_SER_CHANNEL_BASE(sernum) \
403 (A_SER_BASE_0 + \
404 SER_SPACING*(sernum))
405
406#define A_SER_REGISTER(sernum,reg) \
407 (A_SER_BASE_0 + \
408 SER_SPACING*(sernum) + (reg))
409
410
411#define R_SER_DMA_CHANNELS 0 /* Relative to A_SER_BASE_x */
412
413#define A_SER_DMA_CHANNEL_BASE(sernum,txrx) \
414 ((A_SER_CHANNEL_BASE(sernum)) + \
415 R_SER_DMA_CHANNELS + \
416 (SER_DMA_TXRX_SPACING*(txrx)))
417
418#define A_SER_DMA_REGISTER(sernum, txrx, reg) \
419 (A_SER_DMA_CHANNEL_BASE(sernum, txrx) + \
420 (reg))
421
422
423/*
424 * DMA channel registers, relative to A_SER_DMA_CHANNEL_BASE
425 */
426
427#define R_SER_DMA_CONFIG0 0x00000000
428#define R_SER_DMA_CONFIG1 0x00000008
429#define R_SER_DMA_DSCR_BASE 0x00000010
430#define R_SER_DMA_DSCR_CNT 0x00000018
431#define R_SER_DMA_CUR_DSCRA 0x00000020
432#define R_SER_DMA_CUR_DSCRB 0x00000028
433#define R_SER_DMA_CUR_DSCRADDR 0x00000030
434
435#define R_SER_DMA_CONFIG0_RX 0x00000000
436#define R_SER_DMA_CONFIG1_RX 0x00000008
437#define R_SER_DMA_DSCR_BASE_RX 0x00000010
438#define R_SER_DMA_DSCR_COUNT_RX 0x00000018
439#define R_SER_DMA_CUR_DSCR_A_RX 0x00000020
440#define R_SER_DMA_CUR_DSCR_B_RX 0x00000028
441#define R_SER_DMA_CUR_DSCR_ADDR_RX 0x00000030
442
443#define R_SER_DMA_CONFIG0_TX 0x00000080
444#define R_SER_DMA_CONFIG1_TX 0x00000088
445#define R_SER_DMA_DSCR_BASE_TX 0x00000090
446#define R_SER_DMA_DSCR_COUNT_TX 0x00000098
447#define R_SER_DMA_CUR_DSCR_A_TX 0x000000A0
448#define R_SER_DMA_CUR_DSCR_B_TX 0x000000A8
449#define R_SER_DMA_CUR_DSCR_ADDR_TX 0x000000B0
450
451#define R_SER_MODE 0x00000100
452#define R_SER_MINFRM_SZ 0x00000108
453#define R_SER_MAXFRM_SZ 0x00000110
454#define R_SER_ADDR 0x00000118
455#define R_SER_USR0_ADDR 0x00000120
456#define R_SER_USR1_ADDR 0x00000128
457#define R_SER_USR2_ADDR 0x00000130
458#define R_SER_USR3_ADDR 0x00000138
459#define R_SER_CMD 0x00000140
460#define R_SER_TX_RD_THRSH 0x00000160
461#define R_SER_TX_WR_THRSH 0x00000168
462#define R_SER_RX_RD_THRSH 0x00000170
463#define R_SER_LINE_MODE 0x00000178
464#define R_SER_DMA_ENABLE 0x00000180
465#define R_SER_INT_MASK 0x00000190
466#define R_SER_STATUS 0x00000188
467#define R_SER_STATUS_DEBUG 0x000001A8
468#define R_SER_RX_TABLE_BASE 0x00000200
469#define SER_RX_TABLE_COUNT 16
470#define R_SER_TX_TABLE_BASE 0x00000300
471#define SER_TX_TABLE_COUNT 16
472
473/* RMON Counters */
474#define R_SER_RMON_TX_BYTE_LO 0x000001C0
475#define R_SER_RMON_TX_BYTE_HI 0x000001C8
476#define R_SER_RMON_RX_BYTE_LO 0x000001D0
477#define R_SER_RMON_RX_BYTE_HI 0x000001D8
478#define R_SER_RMON_TX_UNDERRUN 0x000001E0
479#define R_SER_RMON_RX_OVERFLOW 0x000001E8
480#define R_SER_RMON_RX_ERRORS 0x000001F0
481#define R_SER_RMON_RX_BADADDR 0x000001F8
482
483#endif /* 1250/112x */
484
485/* *********************************************************************
486 * Generic Bus Registers
487 ********************************************************************* */
488
489#define IO_EXT_CFG_COUNT 8
490
491#define A_IO_EXT_BASE 0x0010061000
492#define A_IO_EXT_REG(r) (A_IO_EXT_BASE + (r))
493
494#define A_IO_EXT_CFG_BASE 0x0010061000
495#define A_IO_EXT_MULT_SIZE_BASE 0x0010061100
496#define A_IO_EXT_START_ADDR_BASE 0x0010061200
497#define A_IO_EXT_TIME_CFG0_BASE 0x0010061600
498#define A_IO_EXT_TIME_CFG1_BASE 0x0010061700
499
500#define IO_EXT_REGISTER_SPACING 8
501#define A_IO_EXT_CS_BASE(cs) (A_IO_EXT_CFG_BASE+IO_EXT_REGISTER_SPACING*(cs))
502#define R_IO_EXT_REG(reg, cs) ((cs)*IO_EXT_REGISTER_SPACING + (reg))
503
504#define R_IO_EXT_CFG 0x0000
505#define R_IO_EXT_MULT_SIZE 0x0100
506#define R_IO_EXT_START_ADDR 0x0200
507#define R_IO_EXT_TIME_CFG0 0x0600
508#define R_IO_EXT_TIME_CFG1 0x0700
509
510
511#define A_IO_INTERRUPT_STATUS 0x0010061A00
512#define A_IO_INTERRUPT_DATA0 0x0010061A10
513#define A_IO_INTERRUPT_DATA1 0x0010061A18
514#define A_IO_INTERRUPT_DATA2 0x0010061A20
515#define A_IO_INTERRUPT_DATA3 0x0010061A28
516#define A_IO_INTERRUPT_ADDR0 0x0010061A30
517#define A_IO_INTERRUPT_ADDR1 0x0010061A40
518#define A_IO_INTERRUPT_PARITY 0x0010061A50
519#define A_IO_PCMCIA_CFG 0x0010061A60
520#define A_IO_PCMCIA_STATUS 0x0010061A70
521#define A_IO_DRIVE_0 0x0010061300
522#define A_IO_DRIVE_1 0x0010061308
523#define A_IO_DRIVE_2 0x0010061310
524#define A_IO_DRIVE_3 0x0010061318
525#define A_IO_DRIVE_BASE A_IO_DRIVE_0
526#define IO_DRIVE_REGISTER_SPACING 8
527#define R_IO_DRIVE(x) ((x)*IO_DRIVE_REGISTER_SPACING)
528#define A_IO_DRIVE(x) (A_IO_DRIVE_BASE + R_IO_DRIVE(x))
529
530#define R_IO_INTERRUPT_STATUS 0x0A00
531#define R_IO_INTERRUPT_DATA0 0x0A10
532#define R_IO_INTERRUPT_DATA1 0x0A18
533#define R_IO_INTERRUPT_DATA2 0x0A20
534#define R_IO_INTERRUPT_DATA3 0x0A28
535#define R_IO_INTERRUPT_ADDR0 0x0A30
536#define R_IO_INTERRUPT_ADDR1 0x0A40
537#define R_IO_INTERRUPT_PARITY 0x0A50
538#define R_IO_PCMCIA_CFG 0x0A60
539#define R_IO_PCMCIA_STATUS 0x0A70
540
541/* *********************************************************************
542 * GPIO Registers
543 ********************************************************************* */
544
545#define A_GPIO_CLR_EDGE 0x0010061A80
546#define A_GPIO_INT_TYPE 0x0010061A88
547#define A_GPIO_INPUT_INVERT 0x0010061A90
548#define A_GPIO_GLITCH 0x0010061A98
549#define A_GPIO_READ 0x0010061AA0
550#define A_GPIO_DIRECTION 0x0010061AA8
551#define A_GPIO_PIN_CLR 0x0010061AB0
552#define A_GPIO_PIN_SET 0x0010061AB8
553
554#define A_GPIO_BASE 0x0010061A80
555
556#define R_GPIO_CLR_EDGE 0x00
557#define R_GPIO_INT_TYPE 0x08
558#define R_GPIO_INPUT_INVERT 0x10
559#define R_GPIO_GLITCH 0x18
560#define R_GPIO_READ 0x20
561#define R_GPIO_DIRECTION 0x28
562#define R_GPIO_PIN_CLR 0x30
563#define R_GPIO_PIN_SET 0x38
564
565/* *********************************************************************
566 * SMBus Registers
567 ********************************************************************* */
568
569#define A_SMB_XTRA_0 0x0010060000
570#define A_SMB_XTRA_1 0x0010060008
571#define A_SMB_FREQ_0 0x0010060010
572#define A_SMB_FREQ_1 0x0010060018
573#define A_SMB_STATUS_0 0x0010060020
574#define A_SMB_STATUS_1 0x0010060028
575#define A_SMB_CMD_0 0x0010060030
576#define A_SMB_CMD_1 0x0010060038
577#define A_SMB_START_0 0x0010060040
578#define A_SMB_START_1 0x0010060048
579#define A_SMB_DATA_0 0x0010060050
580#define A_SMB_DATA_1 0x0010060058
581#define A_SMB_CONTROL_0 0x0010060060
582#define A_SMB_CONTROL_1 0x0010060068
583#define A_SMB_PEC_0 0x0010060070
584#define A_SMB_PEC_1 0x0010060078
585
586#define A_SMB_0 0x0010060000
587#define A_SMB_1 0x0010060008
588#define SMB_REGISTER_SPACING 0x8
589#define A_SMB_BASE(idx) (A_SMB_0+(idx)*SMB_REGISTER_SPACING)
590#define A_SMB_REGISTER(idx, reg) (A_SMB_BASE(idx)+(reg))
591
592#define R_SMB_XTRA 0x0000000000
593#define R_SMB_FREQ 0x0000000010
594#define R_SMB_STATUS 0x0000000020
595#define R_SMB_CMD 0x0000000030
596#define R_SMB_START 0x0000000040
597#define R_SMB_DATA 0x0000000050
598#define R_SMB_CONTROL 0x0000000060
599#define R_SMB_PEC 0x0000000070
600
601/* *********************************************************************
602 * Timer Registers
603 ********************************************************************* */
604
605/*
606 * Watchdog timers
607 */
608
609#define A_SCD_WDOG_0 0x0010020050
610#define A_SCD_WDOG_1 0x0010020150
611#define SCD_WDOG_SPACING 0x100
612#define SCD_NUM_WDOGS 2
613#define A_SCD_WDOG_BASE(w) (A_SCD_WDOG_0+SCD_WDOG_SPACING*(w))
614#define A_SCD_WDOG_REGISTER(w, r) (A_SCD_WDOG_BASE(w) + (r))
615
616#define R_SCD_WDOG_INIT 0x0000000000
617#define R_SCD_WDOG_CNT 0x0000000008
618#define R_SCD_WDOG_CFG 0x0000000010
619
620#define A_SCD_WDOG_INIT_0 0x0010020050
621#define A_SCD_WDOG_CNT_0 0x0010020058
622#define A_SCD_WDOG_CFG_0 0x0010020060
623
624#define A_SCD_WDOG_INIT_1 0x0010020150
625#define A_SCD_WDOG_CNT_1 0x0010020158
626#define A_SCD_WDOG_CFG_1 0x0010020160
627
628/*
629 * Generic timers
630 */
631
632#define A_SCD_TIMER_0 0x0010020070
633#define A_SCD_TIMER_1 0x0010020078
634#define A_SCD_TIMER_2 0x0010020170
635#define A_SCD_TIMER_3 0x0010020178
636#define SCD_NUM_TIMERS 4
637#define A_SCD_TIMER_BASE(w) (A_SCD_TIMER_0+0x08*((w)&1)+0x100*(((w)&2)>>1))
638#define A_SCD_TIMER_REGISTER(w, r) (A_SCD_TIMER_BASE(w) + (r))
639
640#define R_SCD_TIMER_INIT 0x0000000000
641#define R_SCD_TIMER_CNT 0x0000000010
642#define R_SCD_TIMER_CFG 0x0000000020
643
644#define A_SCD_TIMER_INIT_0 0x0010020070
645#define A_SCD_TIMER_CNT_0 0x0010020080
646#define A_SCD_TIMER_CFG_0 0x0010020090
647
648#define A_SCD_TIMER_INIT_1 0x0010020078
649#define A_SCD_TIMER_CNT_1 0x0010020088
650#define A_SCD_TIMER_CFG_1 0x0010020098
651
652#define A_SCD_TIMER_INIT_2 0x0010020170
653#define A_SCD_TIMER_CNT_2 0x0010020180
654#define A_SCD_TIMER_CFG_2 0x0010020190
655
656#define A_SCD_TIMER_INIT_3 0x0010020178
657#define A_SCD_TIMER_CNT_3 0x0010020188
658#define A_SCD_TIMER_CFG_3 0x0010020198
659
660#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
661#define A_SCD_SCRATCH 0x0010020C10
662#endif /* 1250 PASS2 || 112x PASS1 */
663
664#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
665#define A_SCD_ZBBUS_CYCLE_COUNT 0x0010030000
666#define A_SCD_ZBBUS_CYCLE_CP0 0x0010020C00
667#define A_SCD_ZBBUS_CYCLE_CP1 0x0010020C08
668#endif
669
670/* *********************************************************************
671 * System Control Registers
672 ********************************************************************* */
673
674#define A_SCD_SYSTEM_REVISION 0x0010020000
675#define A_SCD_SYSTEM_CFG 0x0010020008
676#define A_SCD_SYSTEM_MANUF 0x0010038000
677
678/* *********************************************************************
679 * System Address Trap Registers
680 ********************************************************************* */
681
682#define A_ADDR_TRAP_INDEX 0x00100200B0
683#define A_ADDR_TRAP_REG 0x00100200B8
684#define A_ADDR_TRAP_UP_0 0x0010020400
685#define A_ADDR_TRAP_UP_1 0x0010020408
686#define A_ADDR_TRAP_UP_2 0x0010020410
687#define A_ADDR_TRAP_UP_3 0x0010020418
688#define A_ADDR_TRAP_DOWN_0 0x0010020420
689#define A_ADDR_TRAP_DOWN_1 0x0010020428
690#define A_ADDR_TRAP_DOWN_2 0x0010020430
691#define A_ADDR_TRAP_DOWN_3 0x0010020438
692#define A_ADDR_TRAP_CFG_0 0x0010020440
693#define A_ADDR_TRAP_CFG_1 0x0010020448
694#define A_ADDR_TRAP_CFG_2 0x0010020450
695#define A_ADDR_TRAP_CFG_3 0x0010020458
696#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
697#define A_ADDR_TRAP_REG_DEBUG 0x0010020460
698#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
699
700#define ADDR_TRAP_SPACING 8
701#define NUM_ADDR_TRAP 4
702#define A_ADDR_TRAP_UP(n) (A_ADDR_TRAP_UP_0 + ((n) * ADDR_TRAP_SPACING))
703#define A_ADDR_TRAP_DOWN(n) (A_ADDR_TRAP_DOWN_0 + ((n) * ADDR_TRAP_SPACING))
704#define A_ADDR_TRAP_CFG(n) (A_ADDR_TRAP_CFG_0 + ((n) * ADDR_TRAP_SPACING))
705
706
707/* *********************************************************************
708 * System Interrupt Mapper Registers
709 ********************************************************************* */
710
711#define A_IMR_CPU0_BASE 0x0010020000
712#define A_IMR_CPU1_BASE 0x0010022000
713#define IMR_REGISTER_SPACING 0x2000
714#define IMR_REGISTER_SPACING_SHIFT 13
715
716#define A_IMR_MAPPER(cpu) (A_IMR_CPU0_BASE+(cpu)*IMR_REGISTER_SPACING)
717#define A_IMR_REGISTER(cpu, reg) (A_IMR_MAPPER(cpu)+(reg))
718
719#define R_IMR_INTERRUPT_DIAG 0x0010
720#define R_IMR_INTERRUPT_LDT 0x0018
721#define R_IMR_INTERRUPT_MASK 0x0028
722#define R_IMR_INTERRUPT_TRACE 0x0038
723#define R_IMR_INTERRUPT_SOURCE_STATUS 0x0040
724#define R_IMR_LDT_INTERRUPT_SET 0x0048
725#define R_IMR_LDT_INTERRUPT 0x0018
726#define R_IMR_LDT_INTERRUPT_CLR 0x0020
727#define R_IMR_MAILBOX_CPU 0x00c0
728#define R_IMR_ALIAS_MAILBOX_CPU 0x1000
729#define R_IMR_MAILBOX_SET_CPU 0x00C8
730#define R_IMR_ALIAS_MAILBOX_SET_CPU 0x1008
731#define R_IMR_MAILBOX_CLR_CPU 0x00D0
732#define R_IMR_INTERRUPT_STATUS_BASE 0x0100
733#define R_IMR_INTERRUPT_STATUS_COUNT 7
734#define R_IMR_INTERRUPT_MAP_BASE 0x0200
735#define R_IMR_INTERRUPT_MAP_COUNT 64
736
737/*
738 * these macros work together to build the address of a mailbox
739 * register, e.g., A_MAILBOX_REGISTER(R_IMR_MAILBOX_SET_CPU,1)
740 * for mbox_0_set_cpu2 returns 0x00100240C8
741 */
742#define A_MAILBOX_REGISTER(reg,cpu) \
743 (A_IMR_CPU0_BASE + (cpu * IMR_REGISTER_SPACING) + reg)
744
745/* *********************************************************************
746 * System Performance Counter Registers
747 ********************************************************************* */
748
749#define A_SCD_PERF_CNT_CFG 0x00100204C0
750#define A_SCD_PERF_CNT_0 0x00100204D0
751#define A_SCD_PERF_CNT_1 0x00100204D8
752#define A_SCD_PERF_CNT_2 0x00100204E0
753#define A_SCD_PERF_CNT_3 0x00100204E8
754
755#define SCD_NUM_PERF_CNT 4
756#define SCD_PERF_CNT_SPACING 8
757#define A_SCD_PERF_CNT(n) (A_SCD_PERF_CNT_0+(n*SCD_PERF_CNT_SPACING))
758
759/* *********************************************************************
760 * System Bus Watcher Registers
761 ********************************************************************* */
762
763#define A_SCD_BUS_ERR_STATUS 0x0010020880
764#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
765#define A_SCD_BUS_ERR_STATUS_DEBUG 0x00100208D0
766#define A_BUS_ERR_STATUS_DEBUG 0x00100208D0
767#endif /* 1250 PASS2 || 112x PASS1 */
768#define A_BUS_ERR_DATA_0 0x00100208A0
769#define A_BUS_ERR_DATA_1 0x00100208A8
770#define A_BUS_ERR_DATA_2 0x00100208B0
771#define A_BUS_ERR_DATA_3 0x00100208B8
772#define A_BUS_L2_ERRORS 0x00100208C0
773#define A_BUS_MEM_IO_ERRORS 0x00100208C8
774
775/* *********************************************************************
776 * System Debug Controller Registers
777 ********************************************************************* */
778
779#define A_SCD_JTAG_BASE 0x0010000000
780
781/* *********************************************************************
782 * System Trace Buffer Registers
783 ********************************************************************* */
784
785#define A_SCD_TRACE_CFG 0x0010020A00
786#define A_SCD_TRACE_READ 0x0010020A08
787#define A_SCD_TRACE_EVENT_0 0x0010020A20
788#define A_SCD_TRACE_EVENT_1 0x0010020A28
789#define A_SCD_TRACE_EVENT_2 0x0010020A30
790#define A_SCD_TRACE_EVENT_3 0x0010020A38
791#define A_SCD_TRACE_SEQUENCE_0 0x0010020A40
792#define A_SCD_TRACE_SEQUENCE_1 0x0010020A48
793#define A_SCD_TRACE_SEQUENCE_2 0x0010020A50
794#define A_SCD_TRACE_SEQUENCE_3 0x0010020A58
795#define A_SCD_TRACE_EVENT_4 0x0010020A60
796#define A_SCD_TRACE_EVENT_5 0x0010020A68
797#define A_SCD_TRACE_EVENT_6 0x0010020A70
798#define A_SCD_TRACE_EVENT_7 0x0010020A78
799#define A_SCD_TRACE_SEQUENCE_4 0x0010020A80
800#define A_SCD_TRACE_SEQUENCE_5 0x0010020A88
801#define A_SCD_TRACE_SEQUENCE_6 0x0010020A90
802#define A_SCD_TRACE_SEQUENCE_7 0x0010020A98
803
804#define TRACE_REGISTER_SPACING 8
805#define TRACE_NUM_REGISTERS 8
806#define A_SCD_TRACE_EVENT(n) (((n) & 4) ? \
807 (A_SCD_TRACE_EVENT_4 + (((n) & 3) * TRACE_REGISTER_SPACING)) : \
808 (A_SCD_TRACE_EVENT_0 + ((n) * TRACE_REGISTER_SPACING)))
809#define A_SCD_TRACE_SEQUENCE(n) (((n) & 4) ? \
810 (A_SCD_TRACE_SEQUENCE_4 + (((n) & 3) * TRACE_REGISTER_SPACING)) : \
811 (A_SCD_TRACE_SEQUENCE_0 + ((n) * TRACE_REGISTER_SPACING)))
812
813/* *********************************************************************
814 * System Generic DMA Registers
815 ********************************************************************* */
816
817#define A_DM_0 0x0010020B00
818#define A_DM_1 0x0010020B20
819#define A_DM_2 0x0010020B40
820#define A_DM_3 0x0010020B60
821#define DM_REGISTER_SPACING 0x20
822#define DM_NUM_CHANNELS 4
823#define A_DM_BASE(idx) (A_DM_0 + ((idx) * DM_REGISTER_SPACING))
824#define A_DM_REGISTER(idx, reg) (A_DM_BASE(idx) + (reg))
825
826#define R_DM_DSCR_BASE 0x0000000000
827#define R_DM_DSCR_COUNT 0x0000000008
828#define R_DM_CUR_DSCR_ADDR 0x0000000010
829#define R_DM_DSCR_BASE_DEBUG 0x0000000018
830
831#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
832#define A_DM_PARTIAL_0 0x0010020ba0
833#define A_DM_PARTIAL_1 0x0010020ba8
834#define A_DM_PARTIAL_2 0x0010020bb0
835#define A_DM_PARTIAL_3 0x0010020bb8
836#define DM_PARTIAL_REGISTER_SPACING 0x8
837#define A_DM_PARTIAL(idx) (A_DM_PARTIAL_0 + ((idx) * DM_PARTIAL_REGISTER_SPACING))
838#endif /* 1250 PASS3 || 112x PASS1 */
839
840#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
841#define A_DM_CRC_0 0x0010020b80
842#define A_DM_CRC_1 0x0010020b90
843#define DM_CRC_REGISTER_SPACING 0x10
844#define DM_CRC_NUM_CHANNELS 2
845#define A_DM_CRC_BASE(idx) (A_DM_CRC_0 + ((idx) * DM_CRC_REGISTER_SPACING))
846#define A_DM_CRC_REGISTER(idx, reg) (A_DM_CRC_BASE(idx) + (reg))
847
848#define R_CRC_DEF_0 0x00
849#define R_CTCP_DEF_0 0x08
850#endif /* 1250 PASS3 || 112x PASS1 */
851
852/* *********************************************************************
853 * Physical Address Map
854 ********************************************************************* */
855
856#if SIBYTE_HDR_FEATURE_1250_112x
857#define A_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000)
858#define A_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024))
859#define A_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000)
860#define A_PHYS_IO_SYSTEM _SB_MAKE64(0x0010060000)
861#define A_PHYS_GENBUS _SB_MAKE64(0x0010090000)
862#define A_PHYS_GENBUS_END _SB_MAKE64(0x0040000000)
863#define A_PHYS_LDTPCI_IO_MATCH_BYTES_32 _SB_MAKE64(0x0040000000)
864#define A_PHYS_LDTPCI_IO_MATCH_BITS_32 _SB_MAKE64(0x0060000000)
865#define A_PHYS_MEMORY_1 _SB_MAKE64(0x0080000000)
866#define A_PHYS_MEMORY_2 _SB_MAKE64(0x0090000000)
867#define A_PHYS_MEMORY_3 _SB_MAKE64(0x00C0000000)
868#define A_PHYS_L2_CACHE_TEST _SB_MAKE64(0x00D0000000)
869#define A_PHYS_LDT_SPECIAL_MATCH_BYTES _SB_MAKE64(0x00D8000000)
870#define A_PHYS_LDTPCI_IO_MATCH_BYTES _SB_MAKE64(0x00DC000000)
871#define A_PHYS_LDTPCI_CFG_MATCH_BYTES _SB_MAKE64(0x00DE000000)
872#define A_PHYS_LDT_SPECIAL_MATCH_BITS _SB_MAKE64(0x00F8000000)
873#define A_PHYS_LDTPCI_IO_MATCH_BITS _SB_MAKE64(0x00FC000000)
874#define A_PHYS_LDTPCI_CFG_MATCH_BITS _SB_MAKE64(0x00FE000000)
875#define A_PHYS_MEMORY_EXP _SB_MAKE64(0x0100000000)
876#define A_PHYS_MEMORY_EXP_SIZE _SB_MAKE64((508*1024*1024*1024))
877#define A_PHYS_LDT_EXP _SB_MAKE64(0x8000000000)
878#define A_PHYS_PCI_FULLACCESS_BYTES _SB_MAKE64(0xF000000000)
879#define A_PHYS_PCI_FULLACCESS_BITS _SB_MAKE64(0xF100000000)
880#define A_PHYS_RESERVED _SB_MAKE64(0xF200000000)
881#define A_PHYS_RESERVED_SPECIAL_LDT _SB_MAKE64(0xFD00000000)
882
883#define A_PHYS_L2CACHE_WAY_SIZE _SB_MAKE64(0x0000020000)
884#define PHYS_L2CACHE_NUM_WAYS 4
885#define A_PHYS_L2CACHE_TOTAL_SIZE _SB_MAKE64(0x0000080000)
886#define A_PHYS_L2CACHE_WAY0 _SB_MAKE64(0x00D0180000)
887#define A_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D01A0000)
888#define A_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D01C0000)
889#define A_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D01E0000)
890#endif
891
892
893#endif
diff --git a/include/asm-mips/sibyte/sb1250_scd.h b/include/asm-mips/sibyte/sb1250_scd.h
deleted file mode 100644
index e49c3e89b5ee..000000000000
--- a/include/asm-mips/sibyte/sb1250_scd.h
+++ /dev/null
@@ -1,654 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * SCD Constants and Macros File: sb1250_scd.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the System Control and Debug module on the 1250.
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003,2004,2005
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32#ifndef _SB1250_SCD_H
33#define _SB1250_SCD_H
34
35#include "sb1250_defs.h"
36
37/* *********************************************************************
38 * System control/debug registers
39 ********************************************************************* */
40
41/*
42 * System Revision Register (Table 4-1)
43 */
44
45#define M_SYS_RESERVED _SB_MAKEMASK(8, 0)
46
47#define S_SYS_REVISION _SB_MAKE64(8)
48#define M_SYS_REVISION _SB_MAKEMASK(8, S_SYS_REVISION)
49#define V_SYS_REVISION(x) _SB_MAKEVALUE(x, S_SYS_REVISION)
50#define G_SYS_REVISION(x) _SB_GETVALUE(x, S_SYS_REVISION, M_SYS_REVISION)
51
52#define K_SYS_REVISION_BCM1250_PASS1 0x01
53
54#define K_SYS_REVISION_BCM1250_PASS2 0x03
55#define K_SYS_REVISION_BCM1250_A1 0x03 /* Pass 2.0 WB */
56#define K_SYS_REVISION_BCM1250_A2 0x04 /* Pass 2.0 FC */
57#define K_SYS_REVISION_BCM1250_A3 0x05 /* Pass 2.1 FC */
58#define K_SYS_REVISION_BCM1250_A4 0x06 /* Pass 2.1 WB */
59#define K_SYS_REVISION_BCM1250_A6 0x07 /* OR 0x04 (A2) w/WID != 0 */
60#define K_SYS_REVISION_BCM1250_A8 0x0b /* A8/A10 */
61#define K_SYS_REVISION_BCM1250_A9 0x08
62#define K_SYS_REVISION_BCM1250_A10 K_SYS_REVISION_BCM1250_A8
63
64#define K_SYS_REVISION_BCM1250_PASS2_2 0x10
65#define K_SYS_REVISION_BCM1250_B0 K_SYS_REVISION_BCM1250_B1
66#define K_SYS_REVISION_BCM1250_B1 0x10
67#define K_SYS_REVISION_BCM1250_B2 0x11
68
69#define K_SYS_REVISION_BCM1250_C0 0x20
70#define K_SYS_REVISION_BCM1250_C1 0x21
71#define K_SYS_REVISION_BCM1250_C2 0x22
72#define K_SYS_REVISION_BCM1250_C3 0x23
73
74#if SIBYTE_HDR_FEATURE_CHIP(1250)
75/* XXX: discourage people from using these constants. */
76#define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1
77#define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2
78#define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2
79#define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3
80#define K_SYS_REVISION_BCM1250_PASS3 K_SYS_REVISION_BCM1250_C0
81#endif /* 1250 */
82
83#define K_SYS_REVISION_BCM112x_A1 0x20
84#define K_SYS_REVISION_BCM112x_A2 0x21
85#define K_SYS_REVISION_BCM112x_A3 0x22
86#define K_SYS_REVISION_BCM112x_A4 0x23
87#define K_SYS_REVISION_BCM112x_B0 0x30
88
89#define K_SYS_REVISION_BCM1480_S0 0x01
90#define K_SYS_REVISION_BCM1480_A1 0x02
91#define K_SYS_REVISION_BCM1480_A2 0x03
92#define K_SYS_REVISION_BCM1480_A3 0x04
93#define K_SYS_REVISION_BCM1480_B0 0x11
94
95/*Cache size - 23:20 of revision register*/
96#define S_SYS_L2C_SIZE _SB_MAKE64(20)
97#define M_SYS_L2C_SIZE _SB_MAKEMASK(4, S_SYS_L2C_SIZE)
98#define V_SYS_L2C_SIZE(x) _SB_MAKEVALUE(x, S_SYS_L2C_SIZE)
99#define G_SYS_L2C_SIZE(x) _SB_GETVALUE(x, S_SYS_L2C_SIZE, M_SYS_L2C_SIZE)
100
101#define K_SYS_L2C_SIZE_1MB 0
102#define K_SYS_L2C_SIZE_512KB 5
103#define K_SYS_L2C_SIZE_256KB 2
104#define K_SYS_L2C_SIZE_128KB 1
105
106#define K_SYS_L2C_SIZE_BCM1250 K_SYS_L2C_SIZE_512KB
107#define K_SYS_L2C_SIZE_BCM1125 K_SYS_L2C_SIZE_256KB
108#define K_SYS_L2C_SIZE_BCM1122 K_SYS_L2C_SIZE_128KB
109
110
111/* Number of CPU cores, bits 27:24 of revision register*/
112#define S_SYS_NUM_CPUS _SB_MAKE64(24)
113#define M_SYS_NUM_CPUS _SB_MAKEMASK(4, S_SYS_NUM_CPUS)
114#define V_SYS_NUM_CPUS(x) _SB_MAKEVALUE(x, S_SYS_NUM_CPUS)
115#define G_SYS_NUM_CPUS(x) _SB_GETVALUE(x, S_SYS_NUM_CPUS, M_SYS_NUM_CPUS)
116
117
118/* XXX: discourage people from using these constants. */
119#define S_SYS_PART _SB_MAKE64(16)
120#define M_SYS_PART _SB_MAKEMASK(16, S_SYS_PART)
121#define V_SYS_PART(x) _SB_MAKEVALUE(x, S_SYS_PART)
122#define G_SYS_PART(x) _SB_GETVALUE(x, S_SYS_PART, M_SYS_PART)
123
124/* XXX: discourage people from using these constants. */
125#define K_SYS_PART_SB1250 0x1250
126#define K_SYS_PART_BCM1120 0x1121
127#define K_SYS_PART_BCM1125 0x1123
128#define K_SYS_PART_BCM1125H 0x1124
129#define K_SYS_PART_BCM1122 0x1113
130
131
132/* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */
133#define S_SYS_SOC_TYPE _SB_MAKE64(16)
134#define M_SYS_SOC_TYPE _SB_MAKEMASK(4, S_SYS_SOC_TYPE)
135#define V_SYS_SOC_TYPE(x) _SB_MAKEVALUE(x, S_SYS_SOC_TYPE)
136#define G_SYS_SOC_TYPE(x) _SB_GETVALUE(x, S_SYS_SOC_TYPE, M_SYS_SOC_TYPE)
137
138#define K_SYS_SOC_TYPE_BCM1250 0x0
139#define K_SYS_SOC_TYPE_BCM1120 0x1
140#define K_SYS_SOC_TYPE_BCM1250_ALT 0x2 /* 1250pass2 w/ 1/4 L2. */
141#define K_SYS_SOC_TYPE_BCM1125 0x3
142#define K_SYS_SOC_TYPE_BCM1125H 0x4
143#define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */
144#define K_SYS_SOC_TYPE_BCM1x80 0x6
145#define K_SYS_SOC_TYPE_BCM1x55 0x7
146
147/*
148 * Calculate correct SOC type given a copy of system revision register.
149 *
150 * (For the assembler version, sysrev and dest may be the same register.
151 * Also, it clobbers AT.)
152 */
153#ifdef __ASSEMBLER__
154#define SYS_SOC_TYPE(dest, sysrev) \
155 .set push ; \
156 .set reorder ; \
157 dsrl dest, sysrev, S_SYS_SOC_TYPE ; \
158 andi dest, dest, (M_SYS_SOC_TYPE >> S_SYS_SOC_TYPE); \
159 beq dest, K_SYS_SOC_TYPE_BCM1250_ALT, 991f ; \
160 beq dest, K_SYS_SOC_TYPE_BCM1250_ALT2, 991f ; \
161 b 992f ; \
162991: li dest, K_SYS_SOC_TYPE_BCM1250 ; \
163992: \
164 .set pop
165#else
166#define SYS_SOC_TYPE(sysrev) \
167 ((G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT \
168 || G_SYS_SOC_TYPE(sysrev) == K_SYS_SOC_TYPE_BCM1250_ALT2) \
169 ? K_SYS_SOC_TYPE_BCM1250 : G_SYS_SOC_TYPE(sysrev))
170#endif
171
172#define S_SYS_WID _SB_MAKE64(32)
173#define M_SYS_WID _SB_MAKEMASK(32, S_SYS_WID)
174#define V_SYS_WID(x) _SB_MAKEVALUE(x, S_SYS_WID)
175#define G_SYS_WID(x) _SB_GETVALUE(x, S_SYS_WID, M_SYS_WID)
176
177/*
178 * System Manufacturing Register
179 * Register: SCD_SYSTEM_MANUF
180 */
181
182#if SIBYTE_HDR_FEATURE_1250_112x
183/* Wafer ID: bits 31:0 */
184#define S_SYS_WAFERID1_200 _SB_MAKE64(0)
185#define M_SYS_WAFERID1_200 _SB_MAKEMASK(32, S_SYS_WAFERID1_200)
186#define V_SYS_WAFERID1_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID1_200)
187#define G_SYS_WAFERID1_200(x) _SB_GETVALUE(x, S_SYS_WAFERID1_200, M_SYS_WAFERID1_200)
188
189#define S_SYS_BIN _SB_MAKE64(32)
190#define M_SYS_BIN _SB_MAKEMASK(4, S_SYS_BIN)
191#define V_SYS_BIN(x) _SB_MAKEVALUE(x, S_SYS_BIN)
192#define G_SYS_BIN(x) _SB_GETVALUE(x, S_SYS_BIN, M_SYS_BIN)
193
194/* Wafer ID: bits 39:36 */
195#define S_SYS_WAFERID2_200 _SB_MAKE64(36)
196#define M_SYS_WAFERID2_200 _SB_MAKEMASK(4, S_SYS_WAFERID2_200)
197#define V_SYS_WAFERID2_200(x) _SB_MAKEVALUE(x, S_SYS_WAFERID2_200)
198#define G_SYS_WAFERID2_200(x) _SB_GETVALUE(x, S_SYS_WAFERID2_200, M_SYS_WAFERID2_200)
199
200/* Wafer ID: bits 39:0 */
201#define S_SYS_WAFERID_300 _SB_MAKE64(0)
202#define M_SYS_WAFERID_300 _SB_MAKEMASK(40, S_SYS_WAFERID_300)
203#define V_SYS_WAFERID_300(x) _SB_MAKEVALUE(x, S_SYS_WAFERID_300)
204#define G_SYS_WAFERID_300(x) _SB_GETVALUE(x, S_SYS_WAFERID_300, M_SYS_WAFERID_300)
205
206#define S_SYS_XPOS _SB_MAKE64(40)
207#define M_SYS_XPOS _SB_MAKEMASK(6, S_SYS_XPOS)
208#define V_SYS_XPOS(x) _SB_MAKEVALUE(x, S_SYS_XPOS)
209#define G_SYS_XPOS(x) _SB_GETVALUE(x, S_SYS_XPOS, M_SYS_XPOS)
210
211#define S_SYS_YPOS _SB_MAKE64(46)
212#define M_SYS_YPOS _SB_MAKEMASK(6, S_SYS_YPOS)
213#define V_SYS_YPOS(x) _SB_MAKEVALUE(x, S_SYS_YPOS)
214#define G_SYS_YPOS(x) _SB_GETVALUE(x, S_SYS_YPOS, M_SYS_YPOS)
215#endif
216
217
218/*
219 * System Config Register (Table 4-2)
220 * Register: SCD_SYSTEM_CFG
221 */
222
223#if SIBYTE_HDR_FEATURE_1250_112x
224#define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3)
225#define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4)
226#define M_SYS_IOB0_DIV _SB_MAKEMASK1(5)
227#define M_SYS_IOB1_DIV _SB_MAKEMASK1(6)
228
229#define S_SYS_PLL_DIV _SB_MAKE64(7)
230#define M_SYS_PLL_DIV _SB_MAKEMASK(5, S_SYS_PLL_DIV)
231#define V_SYS_PLL_DIV(x) _SB_MAKEVALUE(x, S_SYS_PLL_DIV)
232#define G_SYS_PLL_DIV(x) _SB_GETVALUE(x, S_SYS_PLL_DIV, M_SYS_PLL_DIV)
233
234#define M_SYS_SER0_ENABLE _SB_MAKEMASK1(12)
235#define M_SYS_SER0_RSTB_EN _SB_MAKEMASK1(13)
236#define M_SYS_SER1_ENABLE _SB_MAKEMASK1(14)
237#define M_SYS_SER1_RSTB_EN _SB_MAKEMASK1(15)
238#define M_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16)
239
240#define S_SYS_BOOT_MODE _SB_MAKE64(17)
241#define M_SYS_BOOT_MODE _SB_MAKEMASK(2, S_SYS_BOOT_MODE)
242#define V_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x, S_SYS_BOOT_MODE)
243#define G_SYS_BOOT_MODE(x) _SB_GETVALUE(x, S_SYS_BOOT_MODE, M_SYS_BOOT_MODE)
244#define K_SYS_BOOT_MODE_ROM32 0
245#define K_SYS_BOOT_MODE_ROM8 1
246#define K_SYS_BOOT_MODE_SMBUS_SMALL 2
247#define K_SYS_BOOT_MODE_SMBUS_BIG 3
248
249#define M_SYS_PCI_HOST _SB_MAKEMASK1(19)
250#define M_SYS_PCI_ARBITER _SB_MAKEMASK1(20)
251#define M_SYS_SOUTH_ON_LDT _SB_MAKEMASK1(21)
252#define M_SYS_BIG_ENDIAN _SB_MAKEMASK1(22)
253#define M_SYS_GENCLK_EN _SB_MAKEMASK1(23)
254#define M_SYS_LDT_TEST_EN _SB_MAKEMASK1(24)
255#define M_SYS_GEN_PARITY_EN _SB_MAKEMASK1(25)
256
257#define S_SYS_CONFIG 26
258#define M_SYS_CONFIG _SB_MAKEMASK(6, S_SYS_CONFIG)
259#define V_SYS_CONFIG(x) _SB_MAKEVALUE(x, S_SYS_CONFIG)
260#define G_SYS_CONFIG(x) _SB_GETVALUE(x, S_SYS_CONFIG, M_SYS_CONFIG)
261
262/* The following bits are writeable by JTAG only. */
263
264#define M_SYS_CLKSTOP _SB_MAKEMASK1(32)
265#define M_SYS_CLKSTEP _SB_MAKEMASK1(33)
266
267#define S_SYS_CLKCOUNT 34
268#define M_SYS_CLKCOUNT _SB_MAKEMASK(8, S_SYS_CLKCOUNT)
269#define V_SYS_CLKCOUNT(x) _SB_MAKEVALUE(x, S_SYS_CLKCOUNT)
270#define G_SYS_CLKCOUNT(x) _SB_GETVALUE(x, S_SYS_CLKCOUNT, M_SYS_CLKCOUNT)
271
272#define M_SYS_PLL_BYPASS _SB_MAKEMASK1(42)
273
274#define S_SYS_PLL_IREF 43
275#define M_SYS_PLL_IREF _SB_MAKEMASK(2, S_SYS_PLL_IREF)
276
277#define S_SYS_PLL_VCO 45
278#define M_SYS_PLL_VCO _SB_MAKEMASK(2, S_SYS_PLL_VCO)
279
280#define S_SYS_PLL_VREG 47
281#define M_SYS_PLL_VREG _SB_MAKEMASK(2, S_SYS_PLL_VREG)
282
283#define M_SYS_MEM_RESET _SB_MAKEMASK1(49)
284#define M_SYS_L2C_RESET _SB_MAKEMASK1(50)
285#define M_SYS_IO_RESET_0 _SB_MAKEMASK1(51)
286#define M_SYS_IO_RESET_1 _SB_MAKEMASK1(52)
287#define M_SYS_SCD_RESET _SB_MAKEMASK1(53)
288
289/* End of bits writable by JTAG only. */
290
291#define M_SYS_CPU_RESET_0 _SB_MAKEMASK1(54)
292#define M_SYS_CPU_RESET_1 _SB_MAKEMASK1(55)
293
294#define M_SYS_UNICPU0 _SB_MAKEMASK1(56)
295#define M_SYS_UNICPU1 _SB_MAKEMASK1(57)
296
297#define M_SYS_SB_SOFTRES _SB_MAKEMASK1(58)
298#define M_SYS_EXT_RESET _SB_MAKEMASK1(59)
299#define M_SYS_SYSTEM_RESET _SB_MAKEMASK1(60)
300
301#define M_SYS_MISR_MODE _SB_MAKEMASK1(61)
302#define M_SYS_MISR_RESET _SB_MAKEMASK1(62)
303
304#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
305#define M_SYS_SW_FLAG _SB_MAKEMASK1(63)
306#endif /* 1250 PASS2 || 112x PASS1 */
307
308#endif
309
310
311/*
312 * Mailbox Registers (Table 4-3)
313 * Registers: SCD_MBOX_CPU_x
314 */
315
316#define S_MBOX_INT_3 0
317#define M_MBOX_INT_3 _SB_MAKEMASK(16, S_MBOX_INT_3)
318#define S_MBOX_INT_2 16
319#define M_MBOX_INT_2 _SB_MAKEMASK(16, S_MBOX_INT_2)
320#define S_MBOX_INT_1 32
321#define M_MBOX_INT_1 _SB_MAKEMASK(16, S_MBOX_INT_1)
322#define S_MBOX_INT_0 48
323#define M_MBOX_INT_0 _SB_MAKEMASK(16, S_MBOX_INT_0)
324
325/*
326 * Watchdog Registers (Table 4-8) (Table 4-9) (Table 4-10)
327 * Registers: SCD_WDOG_INIT_CNT_x
328 */
329
330#define V_SCD_WDOG_FREQ 1000000
331
332#define S_SCD_WDOG_INIT 0
333#define M_SCD_WDOG_INIT _SB_MAKEMASK(23, S_SCD_WDOG_INIT)
334
335#define S_SCD_WDOG_CNT 0
336#define M_SCD_WDOG_CNT _SB_MAKEMASK(23, S_SCD_WDOG_CNT)
337
338#define S_SCD_WDOG_ENABLE 0
339#define M_SCD_WDOG_ENABLE _SB_MAKEMASK1(S_SCD_WDOG_ENABLE)
340
341#define S_SCD_WDOG_RESET_TYPE 2
342#define M_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(3, S_SCD_WDOG_RESET_TYPE)
343#define V_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x, S_SCD_WDOG_RESET_TYPE)
344#define G_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x, S_SCD_WDOG_RESET_TYPE, M_SCD_WDOG_RESET_TYPE)
345
346#define K_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */
347#define K_SCD_WDOG_RESET_SOFT 1
348#define K_SCD_WDOG_RESET_CPU0 3
349#define K_SCD_WDOG_RESET_CPU1 5
350#define K_SCD_WDOG_RESET_BOTH_CPUS 7
351
352/* This feature is present in 1250 C0 and later, but *not* in 112x A revs. */
353#if SIBYTE_HDR_FEATURE(1250, PASS3)
354#define S_SCD_WDOG_HAS_RESET 8
355#define M_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(S_SCD_WDOG_HAS_RESET)
356#endif
357
358
359/*
360 * Timer Registers (Table 4-11) (Table 4-12) (Table 4-13)
361 */
362
363#define V_SCD_TIMER_FREQ 1000000
364
365#define S_SCD_TIMER_INIT 0
366#define M_SCD_TIMER_INIT _SB_MAKEMASK(23, S_SCD_TIMER_INIT)
367#define V_SCD_TIMER_INIT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_INIT)
368#define G_SCD_TIMER_INIT(x) _SB_GETVALUE(x, S_SCD_TIMER_INIT, M_SCD_TIMER_INIT)
369
370#define V_SCD_TIMER_WIDTH 23
371#define S_SCD_TIMER_CNT 0
372#define M_SCD_TIMER_CNT _SB_MAKEMASK(V_SCD_TIMER_WIDTH, S_SCD_TIMER_CNT)
373#define V_SCD_TIMER_CNT(x) _SB_MAKEVALUE(x, S_SCD_TIMER_CNT)
374#define G_SCD_TIMER_CNT(x) _SB_GETVALUE(x, S_SCD_TIMER_CNT, M_SCD_TIMER_CNT)
375
376#define M_SCD_TIMER_ENABLE _SB_MAKEMASK1(0)
377#define M_SCD_TIMER_MODE _SB_MAKEMASK1(1)
378#define M_SCD_TIMER_MODE_CONTINUOUS M_SCD_TIMER_MODE
379
380/*
381 * System Performance Counters
382 */
383
384#define S_SPC_CFG_SRC0 0
385#define M_SPC_CFG_SRC0 _SB_MAKEMASK(8, S_SPC_CFG_SRC0)
386#define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC0)
387#define G_SPC_CFG_SRC0(x) _SB_GETVALUE(x, S_SPC_CFG_SRC0, M_SPC_CFG_SRC0)
388
389#define S_SPC_CFG_SRC1 8
390#define M_SPC_CFG_SRC1 _SB_MAKEMASK(8, S_SPC_CFG_SRC1)
391#define V_SPC_CFG_SRC1(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC1)
392#define G_SPC_CFG_SRC1(x) _SB_GETVALUE(x, S_SPC_CFG_SRC1, M_SPC_CFG_SRC1)
393
394#define S_SPC_CFG_SRC2 16
395#define M_SPC_CFG_SRC2 _SB_MAKEMASK(8, S_SPC_CFG_SRC2)
396#define V_SPC_CFG_SRC2(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC2)
397#define G_SPC_CFG_SRC2(x) _SB_GETVALUE(x, S_SPC_CFG_SRC2, M_SPC_CFG_SRC2)
398
399#define S_SPC_CFG_SRC3 24
400#define M_SPC_CFG_SRC3 _SB_MAKEMASK(8, S_SPC_CFG_SRC3)
401#define V_SPC_CFG_SRC3(x) _SB_MAKEVALUE(x, S_SPC_CFG_SRC3)
402#define G_SPC_CFG_SRC3(x) _SB_GETVALUE(x, S_SPC_CFG_SRC3, M_SPC_CFG_SRC3)
403
404#if SIBYTE_HDR_FEATURE_1250_112x
405#define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32)
406#define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33)
407#endif
408
409
410/*
411 * Bus Watcher
412 */
413
414#define S_SCD_BERR_TID 8
415#define M_SCD_BERR_TID _SB_MAKEMASK(10, S_SCD_BERR_TID)
416#define V_SCD_BERR_TID(x) _SB_MAKEVALUE(x, S_SCD_BERR_TID)
417#define G_SCD_BERR_TID(x) _SB_GETVALUE(x, S_SCD_BERR_TID, M_SCD_BERR_TID)
418
419#define S_SCD_BERR_RID 18
420#define M_SCD_BERR_RID _SB_MAKEMASK(4, S_SCD_BERR_RID)
421#define V_SCD_BERR_RID(x) _SB_MAKEVALUE(x, S_SCD_BERR_RID)
422#define G_SCD_BERR_RID(x) _SB_GETVALUE(x, S_SCD_BERR_RID, M_SCD_BERR_RID)
423
424#define S_SCD_BERR_DCODE 22
425#define M_SCD_BERR_DCODE _SB_MAKEMASK(3, S_SCD_BERR_DCODE)
426#define V_SCD_BERR_DCODE(x) _SB_MAKEVALUE(x, S_SCD_BERR_DCODE)
427#define G_SCD_BERR_DCODE(x) _SB_GETVALUE(x, S_SCD_BERR_DCODE, M_SCD_BERR_DCODE)
428
429#define M_SCD_BERR_MULTERRS _SB_MAKEMASK1(30)
430
431
432#define S_SCD_L2ECC_CORR_D 0
433#define M_SCD_L2ECC_CORR_D _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_D)
434#define V_SCD_L2ECC_CORR_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_D)
435#define G_SCD_L2ECC_CORR_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_D, M_SCD_L2ECC_CORR_D)
436
437#define S_SCD_L2ECC_BAD_D 8
438#define M_SCD_L2ECC_BAD_D _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_D)
439#define V_SCD_L2ECC_BAD_D(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_D)
440#define G_SCD_L2ECC_BAD_D(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_D, M_SCD_L2ECC_BAD_D)
441
442#define S_SCD_L2ECC_CORR_T 16
443#define M_SCD_L2ECC_CORR_T _SB_MAKEMASK(8, S_SCD_L2ECC_CORR_T)
444#define V_SCD_L2ECC_CORR_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_CORR_T)
445#define G_SCD_L2ECC_CORR_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_CORR_T, M_SCD_L2ECC_CORR_T)
446
447#define S_SCD_L2ECC_BAD_T 24
448#define M_SCD_L2ECC_BAD_T _SB_MAKEMASK(8, S_SCD_L2ECC_BAD_T)
449#define V_SCD_L2ECC_BAD_T(x) _SB_MAKEVALUE(x, S_SCD_L2ECC_BAD_T)
450#define G_SCD_L2ECC_BAD_T(x) _SB_GETVALUE(x, S_SCD_L2ECC_BAD_T, M_SCD_L2ECC_BAD_T)
451
452#define S_SCD_MEM_ECC_CORR 0
453#define M_SCD_MEM_ECC_CORR _SB_MAKEMASK(8, S_SCD_MEM_ECC_CORR)
454#define V_SCD_MEM_ECC_CORR(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_CORR)
455#define G_SCD_MEM_ECC_CORR(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_CORR, M_SCD_MEM_ECC_CORR)
456
457#define S_SCD_MEM_ECC_BAD 8
458#define M_SCD_MEM_ECC_BAD _SB_MAKEMASK(8, S_SCD_MEM_ECC_BAD)
459#define V_SCD_MEM_ECC_BAD(x) _SB_MAKEVALUE(x, S_SCD_MEM_ECC_BAD)
460#define G_SCD_MEM_ECC_BAD(x) _SB_GETVALUE(x, S_SCD_MEM_ECC_BAD, M_SCD_MEM_ECC_BAD)
461
462#define S_SCD_MEM_BUSERR 16
463#define M_SCD_MEM_BUSERR _SB_MAKEMASK(8, S_SCD_MEM_BUSERR)
464#define V_SCD_MEM_BUSERR(x) _SB_MAKEVALUE(x, S_SCD_MEM_BUSERR)
465#define G_SCD_MEM_BUSERR(x) _SB_GETVALUE(x, S_SCD_MEM_BUSERR, M_SCD_MEM_BUSERR)
466
467
468/*
469 * Address Trap Registers
470 */
471
472#if SIBYTE_HDR_FEATURE_1250_112x
473#define M_ATRAP_INDEX _SB_MAKEMASK(4, 0)
474#define M_ATRAP_ADDRESS _SB_MAKEMASK(40, 0)
475
476#define S_ATRAP_CFG_CNT 0
477#define M_ATRAP_CFG_CNT _SB_MAKEMASK(3, S_ATRAP_CFG_CNT)
478#define V_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CNT)
479#define G_ATRAP_CFG_CNT(x) _SB_GETVALUE(x, S_ATRAP_CFG_CNT, M_ATRAP_CFG_CNT)
480
481#define M_ATRAP_CFG_WRITE _SB_MAKEMASK1(3)
482#define M_ATRAP_CFG_ALL _SB_MAKEMASK1(4)
483#define M_ATRAP_CFG_INV _SB_MAKEMASK1(5)
484#define M_ATRAP_CFG_USESRC _SB_MAKEMASK1(6)
485#define M_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7)
486
487#define S_ATRAP_CFG_AGENTID 8
488#define M_ATRAP_CFG_AGENTID _SB_MAKEMASK(4, S_ATRAP_CFG_AGENTID)
489#define V_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_AGENTID)
490#define G_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x, S_ATRAP_CFG_AGENTID, M_ATRAP_CFG_AGENTID)
491
492#define K_BUS_AGENT_CPU0 0
493#define K_BUS_AGENT_CPU1 1
494#define K_BUS_AGENT_IOB0 2
495#define K_BUS_AGENT_IOB1 3
496#define K_BUS_AGENT_SCD 4
497#define K_BUS_AGENT_L2C 6
498#define K_BUS_AGENT_MC 7
499
500#define S_ATRAP_CFG_CATTR 12
501#define M_ATRAP_CFG_CATTR _SB_MAKEMASK(3, S_ATRAP_CFG_CATTR)
502#define V_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x, S_ATRAP_CFG_CATTR)
503#define G_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x, S_ATRAP_CFG_CATTR, M_ATRAP_CFG_CATTR)
504
505#define K_ATRAP_CFG_CATTR_IGNORE 0
506#define K_ATRAP_CFG_CATTR_UNC 1
507#define K_ATRAP_CFG_CATTR_CACHEABLE 2
508#define K_ATRAP_CFG_CATTR_NONCOH 3
509#define K_ATRAP_CFG_CATTR_COHERENT 4
510#define K_ATRAP_CFG_CATTR_NOTUNC 5
511#define K_ATRAP_CFG_CATTR_NOTNONCOH 6
512#define K_ATRAP_CFG_CATTR_NOTCOHERENT 7
513
514#endif /* 1250/112x */
515
516/*
517 * Trace Buffer Config register
518 */
519
520#define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0)
521#define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1)
522#define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2)
523#define M_SCD_TRACE_CFG_STOP _SB_MAKEMASK1(3)
524#define M_SCD_TRACE_CFG_FREEZE _SB_MAKEMASK1(4)
525#define M_SCD_TRACE_CFG_FREEZE_FULL _SB_MAKEMASK1(5)
526#define M_SCD_TRACE_CFG_DEBUG_FULL _SB_MAKEMASK1(6)
527#define M_SCD_TRACE_CFG_FULL _SB_MAKEMASK1(7)
528#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
529#define M_SCD_TRACE_CFG_FORCECNT _SB_MAKEMASK1(8)
530#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
531
532/*
533 * This field is the same on the 1250/112x and 1480, just located in
534 * a slightly different place in the register.
535 */
536#if SIBYTE_HDR_FEATURE_1250_112x
537#define S_SCD_TRACE_CFG_CUR_ADDR 10
538#else
539#if SIBYTE_HDR_FEATURE_CHIP(1480)
540#define S_SCD_TRACE_CFG_CUR_ADDR 24
541#endif /* 1480 */
542#endif /* 1250/112x */
543
544#define M_SCD_TRACE_CFG_CUR_ADDR _SB_MAKEMASK(8, S_SCD_TRACE_CFG_CUR_ADDR)
545#define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR)
546#define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x, S_SCD_TRACE_CFG_CUR_ADDR, M_SCD_TRACE_CFG_CUR_ADDR)
547
548/*
549 * Trace Event registers
550 */
551
552#define S_SCD_TREVT_ADDR_MATCH 0
553#define M_SCD_TREVT_ADDR_MATCH _SB_MAKEMASK(4, S_SCD_TREVT_ADDR_MATCH)
554#define V_SCD_TREVT_ADDR_MATCH(x) _SB_MAKEVALUE(x, S_SCD_TREVT_ADDR_MATCH)
555#define G_SCD_TREVT_ADDR_MATCH(x) _SB_GETVALUE(x, S_SCD_TREVT_ADDR_MATCH, M_SCD_TREVT_ADDR_MATCH)
556
557#define M_SCD_TREVT_REQID_MATCH _SB_MAKEMASK1(4)
558#define M_SCD_TREVT_DATAID_MATCH _SB_MAKEMASK1(5)
559#define M_SCD_TREVT_RESPID_MATCH _SB_MAKEMASK1(6)
560#define M_SCD_TREVT_INTERRUPT _SB_MAKEMASK1(7)
561#define M_SCD_TREVT_DEBUG_PIN _SB_MAKEMASK1(9)
562#define M_SCD_TREVT_WRITE _SB_MAKEMASK1(10)
563#define M_SCD_TREVT_READ _SB_MAKEMASK1(11)
564
565#define S_SCD_TREVT_REQID 12
566#define M_SCD_TREVT_REQID _SB_MAKEMASK(4, S_SCD_TREVT_REQID)
567#define V_SCD_TREVT_REQID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_REQID)
568#define G_SCD_TREVT_REQID(x) _SB_GETVALUE(x, S_SCD_TREVT_REQID, M_SCD_TREVT_REQID)
569
570#define S_SCD_TREVT_RESPID 16
571#define M_SCD_TREVT_RESPID _SB_MAKEMASK(4, S_SCD_TREVT_RESPID)
572#define V_SCD_TREVT_RESPID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_RESPID)
573#define G_SCD_TREVT_RESPID(x) _SB_GETVALUE(x, S_SCD_TREVT_RESPID, M_SCD_TREVT_RESPID)
574
575#define S_SCD_TREVT_DATAID 20
576#define M_SCD_TREVT_DATAID _SB_MAKEMASK(4, S_SCD_TREVT_DATAID)
577#define V_SCD_TREVT_DATAID(x) _SB_MAKEVALUE(x, S_SCD_TREVT_DATAID)
578#define G_SCD_TREVT_DATAID(x) _SB_GETVALUE(x, S_SCD_TREVT_DATAID, M_SCD_TREVT_DATID)
579
580#define S_SCD_TREVT_COUNT 24
581#define M_SCD_TREVT_COUNT _SB_MAKEMASK(8, S_SCD_TREVT_COUNT)
582#define V_SCD_TREVT_COUNT(x) _SB_MAKEVALUE(x, S_SCD_TREVT_COUNT)
583#define G_SCD_TREVT_COUNT(x) _SB_GETVALUE(x, S_SCD_TREVT_COUNT, M_SCD_TREVT_COUNT)
584
585/*
586 * Trace Sequence registers
587 */
588
589#define S_SCD_TRSEQ_EVENT4 0
590#define M_SCD_TRSEQ_EVENT4 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT4)
591#define V_SCD_TRSEQ_EVENT4(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT4)
592#define G_SCD_TRSEQ_EVENT4(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT4, M_SCD_TRSEQ_EVENT4)
593
594#define S_SCD_TRSEQ_EVENT3 4
595#define M_SCD_TRSEQ_EVENT3 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT3)
596#define V_SCD_TRSEQ_EVENT3(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT3)
597#define G_SCD_TRSEQ_EVENT3(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT3, M_SCD_TRSEQ_EVENT3)
598
599#define S_SCD_TRSEQ_EVENT2 8
600#define M_SCD_TRSEQ_EVENT2 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT2)
601#define V_SCD_TRSEQ_EVENT2(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT2)
602#define G_SCD_TRSEQ_EVENT2(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT2, M_SCD_TRSEQ_EVENT2)
603
604#define S_SCD_TRSEQ_EVENT1 12
605#define M_SCD_TRSEQ_EVENT1 _SB_MAKEMASK(4, S_SCD_TRSEQ_EVENT1)
606#define V_SCD_TRSEQ_EVENT1(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_EVENT1)
607#define G_SCD_TRSEQ_EVENT1(x) _SB_GETVALUE(x, S_SCD_TRSEQ_EVENT1, M_SCD_TRSEQ_EVENT1)
608
609#define K_SCD_TRSEQ_E0 0
610#define K_SCD_TRSEQ_E1 1
611#define K_SCD_TRSEQ_E2 2
612#define K_SCD_TRSEQ_E3 3
613#define K_SCD_TRSEQ_E0_E1 4
614#define K_SCD_TRSEQ_E1_E2 5
615#define K_SCD_TRSEQ_E2_E3 6
616#define K_SCD_TRSEQ_E0_E1_E2 7
617#define K_SCD_TRSEQ_E0_E1_E2_E3 8
618#define K_SCD_TRSEQ_E0E1 9
619#define K_SCD_TRSEQ_E0E1E2 10
620#define K_SCD_TRSEQ_E0E1E2E3 11
621#define K_SCD_TRSEQ_E0E1_E2 12
622#define K_SCD_TRSEQ_E0E1_E2E3 13
623#define K_SCD_TRSEQ_E0E1_E2_E3 14
624#define K_SCD_TRSEQ_IGNORED 15
625
626#define K_SCD_TRSEQ_TRIGGER_ALL (V_SCD_TRSEQ_EVENT1(K_SCD_TRSEQ_IGNORED) | \
627 V_SCD_TRSEQ_EVENT2(K_SCD_TRSEQ_IGNORED) | \
628 V_SCD_TRSEQ_EVENT3(K_SCD_TRSEQ_IGNORED) | \
629 V_SCD_TRSEQ_EVENT4(K_SCD_TRSEQ_IGNORED))
630
631#define S_SCD_TRSEQ_FUNCTION 16
632#define M_SCD_TRSEQ_FUNCTION _SB_MAKEMASK(4, S_SCD_TRSEQ_FUNCTION)
633#define V_SCD_TRSEQ_FUNCTION(x) _SB_MAKEVALUE(x, S_SCD_TRSEQ_FUNCTION)
634#define G_SCD_TRSEQ_FUNCTION(x) _SB_GETVALUE(x, S_SCD_TRSEQ_FUNCTION, M_SCD_TRSEQ_FUNCTION)
635
636#define K_SCD_TRSEQ_FUNC_NOP 0
637#define K_SCD_TRSEQ_FUNC_START 1
638#define K_SCD_TRSEQ_FUNC_STOP 2
639#define K_SCD_TRSEQ_FUNC_FREEZE 3
640
641#define V_SCD_TRSEQ_FUNC_NOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_NOP)
642#define V_SCD_TRSEQ_FUNC_START V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_START)
643#define V_SCD_TRSEQ_FUNC_STOP V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_STOP)
644#define V_SCD_TRSEQ_FUNC_FREEZE V_SCD_TRSEQ_FUNCTION(K_SCD_TRSEQ_FUNC_FREEZE)
645
646#define M_SCD_TRSEQ_ASAMPLE _SB_MAKEMASK1(18)
647#define M_SCD_TRSEQ_DSAMPLE _SB_MAKEMASK1(19)
648#define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20)
649#define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21)
650#define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22)
651#define M_SCD_TRSEQ_ALLD_A _SB_MAKEMASK1(23)
652#define M_SCD_TRSEQ_ALL_A _SB_MAKEMASK1(24)
653
654#endif
diff --git a/include/asm-mips/sibyte/sb1250_smbus.h b/include/asm-mips/sibyte/sb1250_smbus.h
deleted file mode 100644
index 04769923cf1e..000000000000
--- a/include/asm-mips/sibyte/sb1250_smbus.h
+++ /dev/null
@@ -1,204 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * SMBUS Constants File: sb1250_smbus.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the SB1250's SMbus devices.
8 *
9 * SB1250 specification level: 10/21/02
10 * BCM1280 specification level: 11/24/03
11 *
12 *********************************************************************
13 *
14 * Copyright 2000,2001,2002,2003
15 * Broadcom Corporation. All rights reserved.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) 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; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 ********************************************************************* */
32
33
34#ifndef _SB1250_SMBUS_H
35#define _SB1250_SMBUS_H
36
37#include "sb1250_defs.h"
38
39/*
40 * SMBus Clock Frequency Register (Table 14-2)
41 */
42
43#define S_SMB_FREQ_DIV 0
44#define M_SMB_FREQ_DIV _SB_MAKEMASK(13, S_SMB_FREQ_DIV)
45#define V_SMB_FREQ_DIV(x) _SB_MAKEVALUE(x, S_SMB_FREQ_DIV)
46
47#define K_SMB_FREQ_400KHZ 0x1F
48#define K_SMB_FREQ_100KHZ 0x7D
49#define K_SMB_FREQ_10KHZ 1250
50
51#define S_SMB_CMD 0
52#define M_SMB_CMD _SB_MAKEMASK(8, S_SMB_CMD)
53#define V_SMB_CMD(x) _SB_MAKEVALUE(x, S_SMB_CMD)
54
55/*
56 * SMBus control register (Table 14-4)
57 */
58
59#define M_SMB_ERR_INTR _SB_MAKEMASK1(0)
60#define M_SMB_FINISH_INTR _SB_MAKEMASK1(1)
61
62#define S_SMB_DATA_OUT 4
63#define M_SMB_DATA_OUT _SB_MAKEMASK1(S_SMB_DATA_OUT)
64#define V_SMB_DATA_OUT(x) _SB_MAKEVALUE(x, S_SMB_DATA_OUT)
65
66#define M_SMB_DATA_DIR _SB_MAKEMASK1(5)
67#define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR
68#define M_SMB_CLK_OUT _SB_MAKEMASK1(6)
69#define M_SMB_DIRECT_ENABLE _SB_MAKEMASK1(7)
70
71/*
72 * SMBus status registers (Table 14-5)
73 */
74
75#define M_SMB_BUSY _SB_MAKEMASK1(0)
76#define M_SMB_ERROR _SB_MAKEMASK1(1)
77#define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2)
78
79#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
80#define S_SMB_SCL_IN 5
81#define M_SMB_SCL_IN _SB_MAKEMASK1(S_SMB_SCL_IN)
82#define V_SMB_SCL_IN(x) _SB_MAKEVALUE(x, S_SMB_SCL_IN)
83#define G_SMB_SCL_IN(x) _SB_GETVALUE(x, S_SMB_SCL_IN, M_SMB_SCL_IN)
84#endif /* 1250 PASS3 || 112x PASS1 || 1480 */
85
86#define S_SMB_REF 6
87#define M_SMB_REF _SB_MAKEMASK1(S_SMB_REF)
88#define V_SMB_REF(x) _SB_MAKEVALUE(x, S_SMB_REF)
89#define G_SMB_REF(x) _SB_GETVALUE(x, S_SMB_REF, M_SMB_REF)
90
91#define S_SMB_DATA_IN 7
92#define M_SMB_DATA_IN _SB_MAKEMASK1(S_SMB_DATA_IN)
93#define V_SMB_DATA_IN(x) _SB_MAKEVALUE(x, S_SMB_DATA_IN)
94#define G_SMB_DATA_IN(x) _SB_GETVALUE(x, S_SMB_DATA_IN, M_SMB_DATA_IN)
95
96/*
97 * SMBus Start/Command registers (Table 14-9)
98 */
99
100#define S_SMB_ADDR 0
101#define M_SMB_ADDR _SB_MAKEMASK(7, S_SMB_ADDR)
102#define V_SMB_ADDR(x) _SB_MAKEVALUE(x, S_SMB_ADDR)
103#define G_SMB_ADDR(x) _SB_GETVALUE(x, S_SMB_ADDR, M_SMB_ADDR)
104
105#define M_SMB_QDATA _SB_MAKEMASK1(7)
106
107#define S_SMB_TT 8
108#define M_SMB_TT _SB_MAKEMASK(3, S_SMB_TT)
109#define V_SMB_TT(x) _SB_MAKEVALUE(x, S_SMB_TT)
110#define G_SMB_TT(x) _SB_GETVALUE(x, S_SMB_TT, M_SMB_TT)
111
112#define K_SMB_TT_WR1BYTE 0
113#define K_SMB_TT_WR2BYTE 1
114#define K_SMB_TT_WR3BYTE 2
115#define K_SMB_TT_CMD_RD1BYTE 3
116#define K_SMB_TT_CMD_RD2BYTE 4
117#define K_SMB_TT_RD1BYTE 5
118#define K_SMB_TT_QUICKCMD 6
119#define K_SMB_TT_EEPROMREAD 7
120
121#define V_SMB_TT_WR1BYTE V_SMB_TT(K_SMB_TT_WR1BYTE)
122#define V_SMB_TT_WR2BYTE V_SMB_TT(K_SMB_TT_WR2BYTE)
123#define V_SMB_TT_WR3BYTE V_SMB_TT(K_SMB_TT_WR3BYTE)
124#define V_SMB_TT_CMD_RD1BYTE V_SMB_TT(K_SMB_TT_CMD_RD1BYTE)
125#define V_SMB_TT_CMD_RD2BYTE V_SMB_TT(K_SMB_TT_CMD_RD2BYTE)
126#define V_SMB_TT_RD1BYTE V_SMB_TT(K_SMB_TT_RD1BYTE)
127#define V_SMB_TT_QUICKCMD V_SMB_TT(K_SMB_TT_QUICKCMD)
128#define V_SMB_TT_EEPROMREAD V_SMB_TT(K_SMB_TT_EEPROMREAD)
129
130#define M_SMB_PEC _SB_MAKEMASK1(15)
131
132/*
133 * SMBus Data Register (Table 14-6) and SMBus Extra Register (Table 14-7)
134 */
135
136#define S_SMB_LB 0
137#define M_SMB_LB _SB_MAKEMASK(8, S_SMB_LB)
138#define V_SMB_LB(x) _SB_MAKEVALUE(x, S_SMB_LB)
139
140#define S_SMB_MB 8
141#define M_SMB_MB _SB_MAKEMASK(8, S_SMB_MB)
142#define V_SMB_MB(x) _SB_MAKEVALUE(x, S_SMB_MB)
143
144
145/*
146 * SMBus Packet Error Check register (Table 14-8)
147 */
148
149#define S_SPEC_PEC 0
150#define M_SPEC_PEC _SB_MAKEMASK(8, S_SPEC_PEC)
151#define V_SPEC_MB(x) _SB_MAKEVALUE(x, S_SPEC_PEC)
152
153
154#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
155
156#define S_SMB_CMDH 8
157#define M_SMB_CMDH _SB_MAKEMASK(8, S_SMB_CMDH)
158#define V_SMB_CMDH(x) _SB_MAKEVALUE(x, S_SMB_CMDH)
159
160#define M_SMB_EXTEND _SB_MAKEMASK1(14)
161
162#define S_SMB_DFMT 8
163#define M_SMB_DFMT _SB_MAKEMASK(3, S_SMB_DFMT)
164#define V_SMB_DFMT(x) _SB_MAKEVALUE(x, S_SMB_DFMT)
165#define G_SMB_DFMT(x) _SB_GETVALUE(x, S_SMB_DFMT, M_SMB_DFMT)
166
167#define K_SMB_DFMT_1BYTE 0
168#define K_SMB_DFMT_2BYTE 1
169#define K_SMB_DFMT_3BYTE 2
170#define K_SMB_DFMT_4BYTE 3
171#define K_SMB_DFMT_NODATA 4
172#define K_SMB_DFMT_CMD4BYTE 5
173#define K_SMB_DFMT_CMD5BYTE 6
174#define K_SMB_DFMT_RESERVED 7
175
176#define V_SMB_DFMT_1BYTE V_SMB_DFMT(K_SMB_DFMT_1BYTE)
177#define V_SMB_DFMT_2BYTE V_SMB_DFMT(K_SMB_DFMT_2BYTE)
178#define V_SMB_DFMT_3BYTE V_SMB_DFMT(K_SMB_DFMT_3BYTE)
179#define V_SMB_DFMT_4BYTE V_SMB_DFMT(K_SMB_DFMT_4BYTE)
180#define V_SMB_DFMT_NODATA V_SMB_DFMT(K_SMB_DFMT_NODATA)
181#define V_SMB_DFMT_CMD4BYTE V_SMB_DFMT(K_SMB_DFMT_CMD4BYTE)
182#define V_SMB_DFMT_CMD5BYTE V_SMB_DFMT(K_SMB_DFMT_CMD5BYTE)
183#define V_SMB_DFMT_RESERVED V_SMB_DFMT(K_SMB_DFMT_RESERVED)
184
185#define S_SMB_AFMT 11
186#define M_SMB_AFMT _SB_MAKEMASK(2, S_SMB_AFMT)
187#define V_SMB_AFMT(x) _SB_MAKEVALUE(x, S_SMB_AFMT)
188#define G_SMB_AFMT(x) _SB_GETVALUE(x, S_SMB_AFMT, M_SMB_AFMT)
189
190#define K_SMB_AFMT_NONE 0
191#define K_SMB_AFMT_ADDR 1
192#define K_SMB_AFMT_ADDR_CMD1BYTE 2
193#define K_SMB_AFMT_ADDR_CMD2BYTE 3
194
195#define V_SMB_AFMT_NONE V_SMB_AFMT(K_SMB_AFMT_NONE)
196#define V_SMB_AFMT_ADDR V_SMB_AFMT(K_SMB_AFMT_ADDR)
197#define V_SMB_AFMT_ADDR_CMD1BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD1BYTE)
198#define V_SMB_AFMT_ADDR_CMD2BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD2BYTE)
199
200#define M_SMB_DIR _SB_MAKEMASK1(13)
201
202#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
203
204#endif
diff --git a/include/asm-mips/sibyte/sb1250_syncser.h b/include/asm-mips/sibyte/sb1250_syncser.h
deleted file mode 100644
index d4b8558e0bf1..000000000000
--- a/include/asm-mips/sibyte/sb1250_syncser.h
+++ /dev/null
@@ -1,146 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * Synchronous Serial Constants File: sb1250_syncser.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the SB1250's Synchronous Serial
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_SYNCSER_H
34#define _SB1250_SYNCSER_H
35
36#include "sb1250_defs.h"
37
38/*
39 * Serial Mode Configuration Register
40 */
41
42#define M_SYNCSER_CRC_MODE _SB_MAKEMASK1(0)
43#define M_SYNCSER_MSB_FIRST _SB_MAKEMASK1(1)
44
45#define S_SYNCSER_FLAG_NUM 2
46#define M_SYNCSER_FLAG_NUM _SB_MAKEMASK(4, S_SYNCSER_FLAG_NUM)
47#define V_SYNCSER_FLAG_NUM _SB_MAKEVALUE(x, S_SYNCSER_FLAG_NUM)
48
49#define M_SYNCSER_FLAG_EN _SB_MAKEMASK1(6)
50#define M_SYNCSER_HDLC_EN _SB_MAKEMASK1(7)
51#define M_SYNCSER_LOOP_MODE _SB_MAKEMASK1(8)
52#define M_SYNCSER_LOOPBACK _SB_MAKEMASK1(9)
53
54/*
55 * Serial Clock Source and Line Interface Mode Register
56 */
57
58#define M_SYNCSER_RXCLK_INV _SB_MAKEMASK1(0)
59#define M_SYNCSER_RXCLK_EXT _SB_MAKEMASK1(1)
60
61#define S_SYNCSER_RXSYNC_DLY 2
62#define M_SYNCSER_RXSYNC_DLY _SB_MAKEMASK(2, S_SYNCSER_RXSYNC_DLY)
63#define V_SYNCSER_RXSYNC_DLY(x) _SB_MAKEVALUE(x, S_SYNCSER_RXSYNC_DLY)
64
65#define M_SYNCSER_RXSYNC_LOW _SB_MAKEMASK1(4)
66#define M_SYNCSER_RXSTRB_LOW _SB_MAKEMASK1(5)
67
68#define M_SYNCSER_RXSYNC_EDGE _SB_MAKEMASK1(6)
69#define M_SYNCSER_RXSYNC_INT _SB_MAKEMASK1(7)
70
71#define M_SYNCSER_TXCLK_INV _SB_MAKEMASK1(8)
72#define M_SYNCSER_TXCLK_EXT _SB_MAKEMASK1(9)
73
74#define S_SYNCSER_TXSYNC_DLY 10
75#define M_SYNCSER_TXSYNC_DLY _SB_MAKEMASK(2, S_SYNCSER_TXSYNC_DLY)
76#define V_SYNCSER_TXSYNC_DLY(x) _SB_MAKEVALUE(x, S_SYNCSER_TXSYNC_DLY)
77
78#define M_SYNCSER_TXSYNC_LOW _SB_MAKEMASK1(12)
79#define M_SYNCSER_TXSTRB_LOW _SB_MAKEMASK1(13)
80
81#define M_SYNCSER_TXSYNC_EDGE _SB_MAKEMASK1(14)
82#define M_SYNCSER_TXSYNC_INT _SB_MAKEMASK1(15)
83
84/*
85 * Serial Command Register
86 */
87
88#define M_SYNCSER_CMD_RX_EN _SB_MAKEMASK1(0)
89#define M_SYNCSER_CMD_TX_EN _SB_MAKEMASK1(1)
90#define M_SYNCSER_CMD_RX_RESET _SB_MAKEMASK1(2)
91#define M_SYNCSER_CMD_TX_RESET _SB_MAKEMASK1(3)
92#define M_SYNCSER_CMD_TX_PAUSE _SB_MAKEMASK1(5)
93
94/*
95 * Serial DMA Enable Register
96 */
97
98#define M_SYNCSER_DMA_RX_EN _SB_MAKEMASK1(0)
99#define M_SYNCSER_DMA_TX_EN _SB_MAKEMASK1(4)
100
101/*
102 * Serial Status Register
103 */
104
105#define M_SYNCSER_RX_CRCERR _SB_MAKEMASK1(0)
106#define M_SYNCSER_RX_ABORT _SB_MAKEMASK1(1)
107#define M_SYNCSER_RX_OCTET _SB_MAKEMASK1(2)
108#define M_SYNCSER_RX_LONGFRM _SB_MAKEMASK1(3)
109#define M_SYNCSER_RX_SHORTFRM _SB_MAKEMASK1(4)
110#define M_SYNCSER_RX_OVERRUN _SB_MAKEMASK1(5)
111#define M_SYNCSER_RX_SYNC_ERR _SB_MAKEMASK1(6)
112#define M_SYNCSER_TX_CRCERR _SB_MAKEMASK1(8)
113#define M_SYNCSER_TX_UNDERRUN _SB_MAKEMASK1(9)
114#define M_SYNCSER_TX_SYNC_ERR _SB_MAKEMASK1(10)
115#define M_SYNCSER_TX_PAUSE_COMPLETE _SB_MAKEMASK1(11)
116#define M_SYNCSER_RX_EOP_COUNT _SB_MAKEMASK1(16)
117#define M_SYNCSER_RX_EOP_TIMER _SB_MAKEMASK1(17)
118#define M_SYNCSER_RX_EOP_SEEN _SB_MAKEMASK1(18)
119#define M_SYNCSER_RX_HWM _SB_MAKEMASK1(19)
120#define M_SYNCSER_RX_LWM _SB_MAKEMASK1(20)
121#define M_SYNCSER_RX_DSCR _SB_MAKEMASK1(21)
122#define M_SYNCSER_RX_DERR _SB_MAKEMASK1(22)
123#define M_SYNCSER_TX_EOP_COUNT _SB_MAKEMASK1(24)
124#define M_SYNCSER_TX_EOP_TIMER _SB_MAKEMASK1(25)
125#define M_SYNCSER_TX_EOP_SEEN _SB_MAKEMASK1(26)
126#define M_SYNCSER_TX_HWM _SB_MAKEMASK1(27)
127#define M_SYNCSER_TX_LWM _SB_MAKEMASK1(28)
128#define M_SYNCSER_TX_DSCR _SB_MAKEMASK1(29)
129#define M_SYNCSER_TX_DERR _SB_MAKEMASK1(30)
130#define M_SYNCSER_TX_DZERO _SB_MAKEMASK1(31)
131
132/*
133 * Sequencer Table Entry format
134 */
135
136#define M_SYNCSER_SEQ_LAST _SB_MAKEMASK1(0)
137#define M_SYNCSER_SEQ_BYTE _SB_MAKEMASK1(1)
138
139#define S_SYNCSER_SEQ_COUNT 2
140#define M_SYNCSER_SEQ_COUNT _SB_MAKEMASK(4, S_SYNCSER_SEQ_COUNT)
141#define V_SYNCSER_SEQ_COUNT(x) _SB_MAKEVALUE(x, S_SYNCSER_SEQ_COUNT)
142
143#define M_SYNCSER_SEQ_ENABLE _SB_MAKEMASK1(6)
144#define M_SYNCSER_SEQ_STROBE _SB_MAKEMASK1(7)
145
146#endif
diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h
deleted file mode 100644
index d835bf280140..000000000000
--- a/include/asm-mips/sibyte/sb1250_uart.h
+++ /dev/null
@@ -1,362 +0,0 @@
1/* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * UART Constants File: sb1250_uart.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the SB1250's UARTs
8 *
9 * SB1250 specification level: User's manual 1/02/02
10 *
11 *********************************************************************
12 *
13 * Copyright 2000,2001,2002,2003
14 * Broadcom Corporation. All rights reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) 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; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 ********************************************************************* */
31
32
33#ifndef _SB1250_UART_H
34#define _SB1250_UART_H
35
36#include "sb1250_defs.h"
37
38/* **********************************************************************
39 * DUART Registers
40 ********************************************************************** */
41
42/*
43 * DUART Mode Register #1 (Table 10-3)
44 * Register: DUART_MODE_REG_1_A
45 * Register: DUART_MODE_REG_1_B
46 */
47
48#define S_DUART_BITS_PER_CHAR 0
49#define M_DUART_BITS_PER_CHAR _SB_MAKEMASK(2, S_DUART_BITS_PER_CHAR)
50#define V_DUART_BITS_PER_CHAR(x) _SB_MAKEVALUE(x, S_DUART_BITS_PER_CHAR)
51
52#define K_DUART_BITS_PER_CHAR_RSV0 0
53#define K_DUART_BITS_PER_CHAR_RSV1 1
54#define K_DUART_BITS_PER_CHAR_7 2
55#define K_DUART_BITS_PER_CHAR_8 3
56
57#define V_DUART_BITS_PER_CHAR_RSV0 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_RSV0)
58#define V_DUART_BITS_PER_CHAR_RSV1 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_RSV1)
59#define V_DUART_BITS_PER_CHAR_7 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_7)
60#define V_DUART_BITS_PER_CHAR_8 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_8)
61
62
63#define M_DUART_PARITY_TYPE_EVEN 0x00
64#define M_DUART_PARITY_TYPE_ODD _SB_MAKEMASK1(2)
65
66#define S_DUART_PARITY_MODE 3
67#define M_DUART_PARITY_MODE _SB_MAKEMASK(2, S_DUART_PARITY_MODE)
68#define V_DUART_PARITY_MODE(x) _SB_MAKEVALUE(x, S_DUART_PARITY_MODE)
69
70#define K_DUART_PARITY_MODE_ADD 0
71#define K_DUART_PARITY_MODE_ADD_FIXED 1
72#define K_DUART_PARITY_MODE_NONE 2
73
74#define V_DUART_PARITY_MODE_ADD V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD)
75#define V_DUART_PARITY_MODE_ADD_FIXED V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD_FIXED)
76#define V_DUART_PARITY_MODE_NONE V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_NONE)
77
78#define M_DUART_TX_IRQ_SEL_TXRDY 0
79#define M_DUART_TX_IRQ_SEL_TXEMPT _SB_MAKEMASK1(5)
80
81#define M_DUART_RX_IRQ_SEL_RXRDY 0
82#define M_DUART_RX_IRQ_SEL_RXFULL _SB_MAKEMASK1(6)
83
84#define M_DUART_RX_RTS_ENA _SB_MAKEMASK1(7)
85
86/*
87 * DUART Mode Register #2 (Table 10-4)
88 * Register: DUART_MODE_REG_2_A
89 * Register: DUART_MODE_REG_2_B
90 */
91
92#define M_DUART_MODE_RESERVED1 _SB_MAKEMASK(3, 0) /* ignored */
93
94#define M_DUART_STOP_BIT_LEN_2 _SB_MAKEMASK1(3)
95#define M_DUART_STOP_BIT_LEN_1 0
96
97#define M_DUART_TX_CTS_ENA _SB_MAKEMASK1(4)
98
99
100#define M_DUART_MODE_RESERVED2 _SB_MAKEMASK1(5) /* must be zero */
101
102#define S_DUART_CHAN_MODE 6
103#define M_DUART_CHAN_MODE _SB_MAKEMASK(2, S_DUART_CHAN_MODE)
104#define V_DUART_CHAN_MODE(x) _SB_MAKEVALUE(x, S_DUART_CHAN_MODE)
105
106#define K_DUART_CHAN_MODE_NORMAL 0
107#define K_DUART_CHAN_MODE_LCL_LOOP 2
108#define K_DUART_CHAN_MODE_REM_LOOP 3
109
110#define V_DUART_CHAN_MODE_NORMAL V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_NORMAL)
111#define V_DUART_CHAN_MODE_LCL_LOOP V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_LCL_LOOP)
112#define V_DUART_CHAN_MODE_REM_LOOP V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_REM_LOOP)
113
114/*
115 * DUART Command Register (Table 10-5)
116 * Register: DUART_CMD_A
117 * Register: DUART_CMD_B
118 */
119
120#define M_DUART_RX_EN _SB_MAKEMASK1(0)
121#define M_DUART_RX_DIS _SB_MAKEMASK1(1)
122#define M_DUART_TX_EN _SB_MAKEMASK1(2)
123#define M_DUART_TX_DIS _SB_MAKEMASK1(3)
124
125#define S_DUART_MISC_CMD 4
126#define M_DUART_MISC_CMD _SB_MAKEMASK(3, S_DUART_MISC_CMD)
127#define V_DUART_MISC_CMD(x) _SB_MAKEVALUE(x, S_DUART_MISC_CMD)
128
129#define K_DUART_MISC_CMD_NOACTION0 0
130#define K_DUART_MISC_CMD_NOACTION1 1
131#define K_DUART_MISC_CMD_RESET_RX 2
132#define K_DUART_MISC_CMD_RESET_TX 3
133#define K_DUART_MISC_CMD_NOACTION4 4
134#define K_DUART_MISC_CMD_RESET_BREAK_INT 5
135#define K_DUART_MISC_CMD_START_BREAK 6
136#define K_DUART_MISC_CMD_STOP_BREAK 7
137
138#define V_DUART_MISC_CMD_NOACTION0 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION0)
139#define V_DUART_MISC_CMD_NOACTION1 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION1)
140#define V_DUART_MISC_CMD_RESET_RX V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_RX)
141#define V_DUART_MISC_CMD_RESET_TX V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_TX)
142#define V_DUART_MISC_CMD_NOACTION4 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION4)
143#define V_DUART_MISC_CMD_RESET_BREAK_INT V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_BREAK_INT)
144#define V_DUART_MISC_CMD_START_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_START_BREAK)
145#define V_DUART_MISC_CMD_STOP_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_STOP_BREAK)
146
147#define M_DUART_CMD_RESERVED _SB_MAKEMASK1(7)
148
149/*
150 * DUART Status Register (Table 10-6)
151 * Register: DUART_STATUS_A
152 * Register: DUART_STATUS_B
153 * READ-ONLY
154 */
155
156#define M_DUART_RX_RDY _SB_MAKEMASK1(0)
157#define M_DUART_RX_FFUL _SB_MAKEMASK1(1)
158#define M_DUART_TX_RDY _SB_MAKEMASK1(2)
159#define M_DUART_TX_EMT _SB_MAKEMASK1(3)
160#define M_DUART_OVRUN_ERR _SB_MAKEMASK1(4)
161#define M_DUART_PARITY_ERR _SB_MAKEMASK1(5)
162#define M_DUART_FRM_ERR _SB_MAKEMASK1(6)
163#define M_DUART_RCVD_BRK _SB_MAKEMASK1(7)
164
165/*
166 * DUART Baud Rate Register (Table 10-7)
167 * Register: DUART_CLK_SEL_A
168 * Register: DUART_CLK_SEL_B
169 */
170
171#define M_DUART_CLK_COUNTER _SB_MAKEMASK(12, 0)
172#define V_DUART_BAUD_RATE(x) (100000000/((x)*20)-1)
173
174/*
175 * DUART Data Registers (Table 10-8 and 10-9)
176 * Register: DUART_RX_HOLD_A
177 * Register: DUART_RX_HOLD_B
178 * Register: DUART_TX_HOLD_A
179 * Register: DUART_TX_HOLD_B
180 */
181
182#define M_DUART_RX_DATA _SB_MAKEMASK(8, 0)
183#define M_DUART_TX_DATA _SB_MAKEMASK(8, 0)
184
185/*
186 * DUART Input Port Register (Table 10-10)
187 * Register: DUART_IN_PORT
188 */
189
190#define M_DUART_IN_PIN0_VAL _SB_MAKEMASK1(0)
191#define M_DUART_IN_PIN1_VAL _SB_MAKEMASK1(1)
192#define M_DUART_IN_PIN2_VAL _SB_MAKEMASK1(2)
193#define M_DUART_IN_PIN3_VAL _SB_MAKEMASK1(3)
194#define M_DUART_IN_PIN4_VAL _SB_MAKEMASK1(4)
195#define M_DUART_IN_PIN5_VAL _SB_MAKEMASK1(5)
196#define M_DUART_RIN0_PIN _SB_MAKEMASK1(6)
197#define M_DUART_RIN1_PIN _SB_MAKEMASK1(7)
198
199/*
200 * DUART Input Port Change Status Register (Tables 10-11, 10-12, and 10-13)
201 * Register: DUART_INPORT_CHNG
202 */
203
204#define S_DUART_IN_PIN_VAL 0
205#define M_DUART_IN_PIN_VAL _SB_MAKEMASK(4, S_DUART_IN_PIN_VAL)
206
207#define S_DUART_IN_PIN_CHNG 4
208#define M_DUART_IN_PIN_CHNG _SB_MAKEMASK(4, S_DUART_IN_PIN_CHNG)
209
210
211/*
212 * DUART Output port control register (Table 10-14)
213 * Register: DUART_OPCR
214 */
215
216#define M_DUART_OPCR_RESERVED0 _SB_MAKEMASK1(0) /* must be zero */
217#define M_DUART_OPC2_SEL _SB_MAKEMASK1(1)
218#define M_DUART_OPCR_RESERVED1 _SB_MAKEMASK1(2) /* must be zero */
219#define M_DUART_OPC3_SEL _SB_MAKEMASK1(3)
220#define M_DUART_OPCR_RESERVED2 _SB_MAKEMASK(4, 4) /* must be zero */
221
222/*
223 * DUART Aux Control Register (Table 10-15)
224 * Register: DUART_AUX_CTRL
225 */
226
227#define M_DUART_IP0_CHNG_ENA _SB_MAKEMASK1(0)
228#define M_DUART_IP1_CHNG_ENA _SB_MAKEMASK1(1)
229#define M_DUART_IP2_CHNG_ENA _SB_MAKEMASK1(2)
230#define M_DUART_IP3_CHNG_ENA _SB_MAKEMASK1(3)
231#define M_DUART_ACR_RESERVED _SB_MAKEMASK(4, 4)
232
233#define M_DUART_CTS_CHNG_ENA _SB_MAKEMASK1(0)
234#define M_DUART_CIN_CHNG_ENA _SB_MAKEMASK1(2)
235
236/*
237 * DUART Interrupt Status Register (Table 10-16)
238 * Register: DUART_ISR
239 */
240
241#define M_DUART_ISR_TX_A _SB_MAKEMASK1(0)
242
243#define S_DUART_ISR_RX_A 1
244#define M_DUART_ISR_RX_A _SB_MAKEMASK1(S_DUART_ISR_RX_A)
245#define V_DUART_ISR_RX_A(x) _SB_MAKEVALUE(x, S_DUART_ISR_RX_A)
246#define G_DUART_ISR_RX_A(x) _SB_GETVALUE(x, S_DUART_ISR_RX_A, M_DUART_ISR_RX_A)
247
248#define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2)
249#define M_DUART_ISR_IN_A _SB_MAKEMASK1(3)
250#define M_DUART_ISR_ALL_A _SB_MAKEMASK(4, 0)
251
252#define M_DUART_ISR_TX_B _SB_MAKEMASK1(4)
253#define M_DUART_ISR_RX_B _SB_MAKEMASK1(5)
254#define M_DUART_ISR_BRK_B _SB_MAKEMASK1(6)
255#define M_DUART_ISR_IN_B _SB_MAKEMASK1(7)
256#define M_DUART_ISR_ALL_B _SB_MAKEMASK(4, 4)
257
258/*
259 * DUART Channel A Interrupt Status Register (Table 10-17)
260 * DUART Channel B Interrupt Status Register (Table 10-18)
261 * Register: DUART_ISR_A
262 * Register: DUART_ISR_B
263 */
264
265#define M_DUART_ISR_TX _SB_MAKEMASK1(0)
266#define M_DUART_ISR_RX _SB_MAKEMASK1(1)
267#define M_DUART_ISR_BRK _SB_MAKEMASK1(2)
268#define M_DUART_ISR_IN _SB_MAKEMASK1(3)
269#define M_DUART_ISR_ALL _SB_MAKEMASK(4, 0)
270#define M_DUART_ISR_RESERVED _SB_MAKEMASK(4, 4)
271
272/*
273 * DUART Interrupt Mask Register (Table 10-19)
274 * Register: DUART_IMR
275 */
276
277#define M_DUART_IMR_TX_A _SB_MAKEMASK1(0)
278#define M_DUART_IMR_RX_A _SB_MAKEMASK1(1)
279#define M_DUART_IMR_BRK_A _SB_MAKEMASK1(2)
280#define M_DUART_IMR_IN_A _SB_MAKEMASK1(3)
281#define M_DUART_IMR_ALL_A _SB_MAKEMASK(4, 0)
282
283#define M_DUART_IMR_TX_B _SB_MAKEMASK1(4)
284#define M_DUART_IMR_RX_B _SB_MAKEMASK1(5)
285#define M_DUART_IMR_BRK_B _SB_MAKEMASK1(6)
286#define M_DUART_IMR_IN_B _SB_MAKEMASK1(7)
287#define M_DUART_IMR_ALL_B _SB_MAKEMASK(4, 4)
288
289/*
290 * DUART Channel A Interrupt Mask Register (Table 10-20)
291 * DUART Channel B Interrupt Mask Register (Table 10-21)
292 * Register: DUART_IMR_A
293 * Register: DUART_IMR_B
294 */
295
296#define M_DUART_IMR_TX _SB_MAKEMASK1(0)
297#define M_DUART_IMR_RX _SB_MAKEMASK1(1)
298#define M_DUART_IMR_BRK _SB_MAKEMASK1(2)
299#define M_DUART_IMR_IN _SB_MAKEMASK1(3)
300#define M_DUART_IMR_ALL _SB_MAKEMASK(4, 0)
301#define M_DUART_IMR_RESERVED _SB_MAKEMASK(4, 4)
302
303
304/*
305 * DUART Output Port Set Register (Table 10-22)
306 * Register: DUART_SET_OPR
307 */
308
309#define M_DUART_SET_OPR0 _SB_MAKEMASK1(0)
310#define M_DUART_SET_OPR1 _SB_MAKEMASK1(1)
311#define M_DUART_SET_OPR2 _SB_MAKEMASK1(2)
312#define M_DUART_SET_OPR3 _SB_MAKEMASK1(3)
313#define M_DUART_OPSR_RESERVED _SB_MAKEMASK(4, 4)
314
315/*
316 * DUART Output Port Clear Register (Table 10-23)
317 * Register: DUART_CLEAR_OPR
318 */
319
320#define M_DUART_CLR_OPR0 _SB_MAKEMASK1(0)
321#define M_DUART_CLR_OPR1 _SB_MAKEMASK1(1)
322#define M_DUART_CLR_OPR2 _SB_MAKEMASK1(2)
323#define M_DUART_CLR_OPR3 _SB_MAKEMASK1(3)
324#define M_DUART_OPCR_RESERVED _SB_MAKEMASK(4, 4)
325
326/*
327 * DUART Output Port RTS Register (Table 10-24)
328 * Register: DUART_OUT_PORT
329 */
330
331#define M_DUART_OUT_PIN_SET0 _SB_MAKEMASK1(0)
332#define M_DUART_OUT_PIN_SET1 _SB_MAKEMASK1(1)
333#define M_DUART_OUT_PIN_CLR0 _SB_MAKEMASK1(2)
334#define M_DUART_OUT_PIN_CLR1 _SB_MAKEMASK1(3)
335#define M_DUART_OPRR_RESERVED _SB_MAKEMASK(4, 4)
336
337#define M_DUART_OUT_PIN_SET(chan) \
338 (chan == 0 ? M_DUART_OUT_PIN_SET0 : M_DUART_OUT_PIN_SET1)
339#define M_DUART_OUT_PIN_CLR(chan) \
340 (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1)
341
342#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480)
343/*
344 * Full Interrupt Control Register
345 */
346
347#define S_DUART_SIG_FULL _SB_MAKE64(0)
348#define M_DUART_SIG_FULL _SB_MAKEMASK(4, S_DUART_SIG_FULL)
349#define V_DUART_SIG_FULL(x) _SB_MAKEVALUE(x, S_DUART_SIG_FULL)
350#define G_DUART_SIG_FULL(x) _SB_GETVALUE(x, S_DUART_SIG_FULL, M_DUART_SIG_FULL)
351
352#define S_DUART_INT_TIME _SB_MAKE64(4)
353#define M_DUART_INT_TIME _SB_MAKEMASK(4, S_DUART_INT_TIME)
354#define V_DUART_INT_TIME(x) _SB_MAKEVALUE(x, S_DUART_INT_TIME)
355#define G_DUART_INT_TIME(x) _SB_GETVALUE(x, S_DUART_INT_TIME, M_DUART_INT_TIME)
356#endif /* 1250 PASS2 || 112x PASS1 || 1480 */
357
358
359/* ********************************************************************** */
360
361
362#endif
diff --git a/include/asm-mips/sibyte/sentosa.h b/include/asm-mips/sibyte/sentosa.h
deleted file mode 100644
index 64c47874f32d..000000000000
--- a/include/asm-mips/sibyte/sentosa.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18#ifndef __ASM_SIBYTE_SENTOSA_H
19#define __ASM_SIBYTE_SENTOSA_H
20
21#include <asm/sibyte/sb1250.h>
22#include <asm/sibyte/sb1250_int.h>
23
24#ifdef CONFIG_SIBYTE_SENTOSA
25#define SIBYTE_BOARD_NAME "BCM91250E (Sentosa)"
26#endif
27#ifdef CONFIG_SIBYTE_RHONE
28#define SIBYTE_BOARD_NAME "BCM91125E (Rhone)"
29#endif
30
31/* Generic bus chip selects */
32#ifdef CONFIG_SIBYTE_RHONE
33#define LEDS_CS 6
34#define LEDS_PHYS 0x1d0a0000
35#endif
36
37/* GPIOs */
38#define K_GPIO_DBG_LED 0
39
40#endif /* __ASM_SIBYTE_SENTOSA_H */
diff --git a/include/asm-mips/sibyte/swarm.h b/include/asm-mips/sibyte/swarm.h
deleted file mode 100644
index 114d9d29ca9d..000000000000
--- a/include/asm-mips/sibyte/swarm.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
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 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18#ifndef __ASM_SIBYTE_SWARM_H
19#define __ASM_SIBYTE_SWARM_H
20
21#include <asm/sibyte/sb1250.h>
22#include <asm/sibyte/sb1250_int.h>
23
24#ifdef CONFIG_SIBYTE_SWARM
25#define SIBYTE_BOARD_NAME "BCM91250A (SWARM)"
26#define SIBYTE_HAVE_PCMCIA 1
27#define SIBYTE_HAVE_IDE 1
28#endif
29#ifdef CONFIG_SIBYTE_LITTLESUR
30#define SIBYTE_BOARD_NAME "BCM91250C2 (LittleSur)"
31#define SIBYTE_HAVE_PCMCIA 0
32#define SIBYTE_HAVE_IDE 1
33#define SIBYTE_DEFAULT_CONSOLE "cfe0"
34#endif
35#ifdef CONFIG_SIBYTE_CRHONE
36#define SIBYTE_BOARD_NAME "BCM91125C (CRhone)"
37#define SIBYTE_HAVE_PCMCIA 0
38#define SIBYTE_HAVE_IDE 0
39#endif
40#ifdef CONFIG_SIBYTE_CRHINE
41#define SIBYTE_BOARD_NAME "BCM91120C (CRhine)"
42#define SIBYTE_HAVE_PCMCIA 0
43#define SIBYTE_HAVE_IDE 0
44#endif
45
46/* Generic bus chip selects */
47#define LEDS_CS 3
48#define LEDS_PHYS 0x100a0000
49
50#ifdef SIBYTE_HAVE_IDE
51#define IDE_CS 4
52#define IDE_PHYS 0x100b0000
53#define K_GPIO_GB_IDE 4
54#define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE)
55#endif
56
57#ifdef SIBYTE_HAVE_PCMCIA
58#define PCMCIA_CS 6
59#define PCMCIA_PHYS 0x11000000
60#define K_GPIO_PC_READY 9
61#define K_INT_PC_READY (K_INT_GPIO_0 + K_GPIO_PC_READY)
62#endif
63
64#endif /* __ASM_SIBYTE_SWARM_H */
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h
deleted file mode 100644
index 9ce0607d7a4e..000000000000
--- a/include/asm-mips/sigcontext.h
+++ /dev/null
@@ -1,100 +0,0 @@
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 * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SIGCONTEXT_H
10#define _ASM_SIGCONTEXT_H
11
12#include <asm/sgidefs.h>
13
14#if _MIPS_SIM == _MIPS_SIM_ABI32
15
16/*
17 * Keep this struct definition in sync with the sigcontext fragment
18 * in arch/mips/tools/offset.c
19 */
20struct sigcontext {
21 unsigned int sc_regmask; /* Unused */
22 unsigned int sc_status; /* Unused */
23 unsigned long long sc_pc;
24 unsigned long long sc_regs[32];
25 unsigned long long sc_fpregs[32];
26 unsigned int sc_acx; /* Was sc_ownedfp */
27 unsigned int sc_fpc_csr;
28 unsigned int sc_fpc_eir; /* Unused */
29 unsigned int sc_used_math;
30 unsigned int sc_dsp; /* dsp status, was sc_ssflags */
31 unsigned long long sc_mdhi;
32 unsigned long long sc_mdlo;
33 unsigned long sc_hi1; /* Was sc_cause */
34 unsigned long sc_lo1; /* Was sc_badvaddr */
35 unsigned long sc_hi2; /* Was sc_sigset[4] */
36 unsigned long sc_lo2;
37 unsigned long sc_hi3;
38 unsigned long sc_lo3;
39};
40
41#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
42
43#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
44
45#include <linux/posix_types.h>
46/*
47 * Keep this struct definition in sync with the sigcontext fragment
48 * in arch/mips/tools/offset.c
49 *
50 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
51 * int so it was changed to unsigned long in 2.6.0-test1. This may break
52 * binary compatibility - no prisoners.
53 * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
54 * entries, add sc_dsp and sc_reserved for padding. No prisoners.
55 */
56struct sigcontext {
57 __u64 sc_regs[32];
58 __u64 sc_fpregs[32];
59 __u64 sc_mdhi;
60 __u64 sc_hi1;
61 __u64 sc_hi2;
62 __u64 sc_hi3;
63 __u64 sc_mdlo;
64 __u64 sc_lo1;
65 __u64 sc_lo2;
66 __u64 sc_lo3;
67 __u64 sc_pc;
68 __u32 sc_fpc_csr;
69 __u32 sc_used_math;
70 __u32 sc_dsp;
71 __u32 sc_reserved;
72};
73
74#ifdef __KERNEL__
75
76struct sigcontext32 {
77 __u32 sc_regmask; /* Unused */
78 __u32 sc_status; /* Unused */
79 __u64 sc_pc;
80 __u64 sc_regs[32];
81 __u64 sc_fpregs[32];
82 __u32 sc_acx; /* Only MIPS32; was sc_ownedfp */
83 __u32 sc_fpc_csr;
84 __u32 sc_fpc_eir; /* Unused */
85 __u32 sc_used_math;
86 __u32 sc_dsp; /* dsp status, was sc_ssflags */
87 __u64 sc_mdhi;
88 __u64 sc_mdlo;
89 __u32 sc_hi1; /* Was sc_cause */
90 __u32 sc_lo1; /* Was sc_badvaddr */
91 __u32 sc_hi2; /* Was sc_sigset[4] */
92 __u32 sc_lo2;
93 __u32 sc_hi3;
94 __u32 sc_lo3;
95};
96#endif /* __KERNEL__ */
97
98#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
99
100#endif /* _ASM_SIGCONTEXT_H */
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h
deleted file mode 100644
index 96e28f18dad1..000000000000
--- a/include/asm-mips/siginfo.h
+++ /dev/null
@@ -1,130 +0,0 @@
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 * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SIGINFO_H
10#define _ASM_SIGINFO_H
11
12
13#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
15
16#define HAVE_ARCH_SIGINFO_T
17
18/*
19 * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
20 * by design ...
21 */
22#define HAVE_ARCH_COPY_SIGINFO
23struct siginfo;
24
25/*
26 * Careful to keep union _sifields from shifting ...
27 */
28#ifdef CONFIG_32BIT
29#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
30#endif
31#ifdef CONFIG_64BIT
32#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
33#endif
34
35#include <asm-generic/siginfo.h>
36
37typedef struct siginfo {
38 int si_signo;
39 int si_code;
40 int si_errno;
41 int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
42
43 union {
44 int _pad[SI_PAD_SIZE];
45
46 /* kill() */
47 struct {
48 pid_t _pid; /* sender's pid */
49 __ARCH_SI_UID_T _uid; /* sender's uid */
50 } _kill;
51
52 /* POSIX.1b timers */
53 struct {
54 timer_t _tid; /* timer id */
55 int _overrun; /* overrun count */
56 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
57 sigval_t _sigval; /* same as below */
58 int _sys_private; /* not to be passed to user */
59 } _timer;
60
61 /* POSIX.1b signals */
62 struct {
63 pid_t _pid; /* sender's pid */
64 __ARCH_SI_UID_T _uid; /* sender's uid */
65 sigval_t _sigval;
66 } _rt;
67
68 /* SIGCHLD */
69 struct {
70 pid_t _pid; /* which child */
71 __ARCH_SI_UID_T _uid; /* sender's uid */
72 int _status; /* exit code */
73 clock_t _utime;
74 clock_t _stime;
75 } _sigchld;
76
77 /* IRIX SIGCHLD */
78 struct {
79 pid_t _pid; /* which child */
80 clock_t _utime;
81 int _status; /* exit code */
82 clock_t _stime;
83 } _irix_sigchld;
84
85 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
86 struct {
87 void __user *_addr; /* faulting insn/memory ref. */
88#ifdef __ARCH_SI_TRAPNO
89 int _trapno; /* TRAP # which caused the signal */
90#endif
91 } _sigfault;
92
93 /* SIGPOLL, SIGXFSZ (To do ...) */
94 struct {
95 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
96 int _fd;
97 } _sigpoll;
98 } _sifields;
99} siginfo_t;
100
101/*
102 * si_code values
103 * Again these have been choosen to be IRIX compatible.
104 */
105#undef SI_ASYNCIO
106#undef SI_TIMER
107#undef SI_MESGQ
108#define SI_ASYNCIO -2 /* sent by AIO completion */
109#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
110#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
111
112#ifdef __KERNEL__
113
114/*
115 * Duplicated here because of <asm-generic/siginfo.h> braindamage ...
116 */
117#include <linux/string.h>
118
119static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
120{
121 if (from->si_code < 0)
122 memcpy(to, from, sizeof(*to));
123 else
124 /* _sigchld is currently the largest know union member */
125 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
126}
127
128#endif
129
130#endif /* _ASM_SIGINFO_H */
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h
deleted file mode 100644
index bee5153aca48..000000000000
--- a/include/asm-mips/signal.h
+++ /dev/null
@@ -1,139 +0,0 @@
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 * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SIGNAL_H
10#define _ASM_SIGNAL_H
11
12#include <linux/types.h>
13
14#define _NSIG 128
15#define _NSIG_BPW (sizeof(unsigned long) * 8)
16#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
17
18typedef struct {
19 unsigned long sig[_NSIG_WORDS];
20} sigset_t;
21
22typedef unsigned long old_sigset_t; /* at least 32 bits */
23
24#define SIGHUP 1 /* Hangup (POSIX). */
25#define SIGINT 2 /* Interrupt (ANSI). */
26#define SIGQUIT 3 /* Quit (POSIX). */
27#define SIGILL 4 /* Illegal instruction (ANSI). */
28#define SIGTRAP 5 /* Trace trap (POSIX). */
29#define SIGIOT 6 /* IOT trap (4.2 BSD). */
30#define SIGABRT SIGIOT /* Abort (ANSI). */
31#define SIGEMT 7
32#define SIGFPE 8 /* Floating-point exception (ANSI). */
33#define SIGKILL 9 /* Kill, unblockable (POSIX). */
34#define SIGBUS 10 /* BUS error (4.2 BSD). */
35#define SIGSEGV 11 /* Segmentation violation (ANSI). */
36#define SIGSYS 12
37#define SIGPIPE 13 /* Broken pipe (POSIX). */
38#define SIGALRM 14 /* Alarm clock (POSIX). */
39#define SIGTERM 15 /* Termination (ANSI). */
40#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
41#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
42#define SIGCHLD 18 /* Child status has changed (POSIX). */
43#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
44#define SIGPWR 19 /* Power failure restart (System V). */
45#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
46#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
47#define SIGIO 22 /* I/O now possible (4.2 BSD). */
48#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
49#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
50#define SIGTSTP 24 /* Keyboard stop (POSIX). */
51#define SIGCONT 25 /* Continue (POSIX). */
52#define SIGTTIN 26 /* Background read from tty (POSIX). */
53#define SIGTTOU 27 /* Background write to tty (POSIX). */
54#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
55#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
56#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
57#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK indicates that a registered stack_t will be used.
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_ONSTACK 0x08000000
77#define SA_RESETHAND 0x80000000
78#define SA_RESTART 0x10000000
79#define SA_SIGINFO 0x00000008
80#define SA_NODEFER 0x40000000
81#define SA_NOCLDWAIT 0x00010000
82#define SA_NOCLDSTOP 0x00000001
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000 /* Only for o32 */
88
89/*
90 * sigaltstack controls
91 */
92#define SS_ONSTACK 1
93#define SS_DISABLE 2
94
95#define MINSIGSTKSZ 2048
96#define SIGSTKSZ 8192
97
98#ifdef __KERNEL__
99
100#ifdef CONFIG_TRAD_SIGNALS
101#define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO)
102#else
103#define sig_uses_siginfo(ka) (1)
104#endif
105
106#endif /* __KERNEL__ */
107
108#define SIG_BLOCK 1 /* for blocking signals */
109#define SIG_UNBLOCK 2 /* for unblocking signals */
110#define SIG_SETMASK 3 /* for setting the signal mask */
111
112#include <asm-generic/signal.h>
113
114struct sigaction {
115 unsigned int sa_flags;
116 __sighandler_t sa_handler;
117 sigset_t sa_mask;
118};
119
120struct k_sigaction {
121 struct sigaction sa;
122};
123
124/* IRIX compatible stack_t */
125typedef struct sigaltstack {
126 void __user *ss_sp;
127 size_t ss_size;
128 int ss_flags;
129} stack_t;
130
131#ifdef __KERNEL__
132#include <asm/sigcontext.h>
133#include <asm/siginfo.h>
134
135#define ptrace_signal_deliver(regs, cookie) do { } while (0)
136
137#endif /* __KERNEL__ */
138
139#endif /* _ASM_SIGNAL_H */
diff --git a/include/asm-mips/sim.h b/include/asm-mips/sim.h
deleted file mode 100644
index 0cd719fabb51..000000000000
--- a/include/asm-mips/sim.h
+++ /dev/null
@@ -1,82 +0,0 @@
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 * Copyright (C) 1999, 2000, 2003 Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SIM_H
10#define _ASM_SIM_H
11
12
13#include <asm/asm-offsets.h>
14
15#define __str2(x) #x
16#define __str(x) __str2(x)
17
18#ifdef CONFIG_32BIT
19
20#define save_static_function(symbol) \
21__asm__( \
22 ".text\n\t" \
23 ".globl\t" #symbol "\n\t" \
24 ".align\t2\n\t" \
25 ".type\t" #symbol ", @function\n\t" \
26 ".ent\t" #symbol ", 0\n" \
27 #symbol":\n\t" \
28 ".frame\t$29, 0, $31\n\t" \
29 "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
30 "sw\t$17,"__str(PT_R17)"($29)\n\t" \
31 "sw\t$18,"__str(PT_R18)"($29)\n\t" \
32 "sw\t$19,"__str(PT_R19)"($29)\n\t" \
33 "sw\t$20,"__str(PT_R20)"($29)\n\t" \
34 "sw\t$21,"__str(PT_R21)"($29)\n\t" \
35 "sw\t$22,"__str(PT_R22)"($29)\n\t" \
36 "sw\t$23,"__str(PT_R23)"($29)\n\t" \
37 "sw\t$30,"__str(PT_R30)"($29)\n\t" \
38 "j\t_" #symbol "\n\t" \
39 ".end\t" #symbol "\n\t" \
40 ".size\t" #symbol",. - " #symbol)
41
42#define nabi_no_regargs
43
44#endif /* CONFIG_32BIT */
45
46#ifdef CONFIG_64BIT
47
48#define save_static_function(symbol) \
49__asm__( \
50 ".text\n\t" \
51 ".globl\t" #symbol "\n\t" \
52 ".align\t2\n\t" \
53 ".type\t" #symbol ", @function\n\t" \
54 ".ent\t" #symbol ", 0\n" \
55 #symbol":\n\t" \
56 ".frame\t$29, 0, $31\n\t" \
57 "sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
58 "sd\t$17,"__str(PT_R17)"($29)\n\t" \
59 "sd\t$18,"__str(PT_R18)"($29)\n\t" \
60 "sd\t$19,"__str(PT_R19)"($29)\n\t" \
61 "sd\t$20,"__str(PT_R20)"($29)\n\t" \
62 "sd\t$21,"__str(PT_R21)"($29)\n\t" \
63 "sd\t$22,"__str(PT_R22)"($29)\n\t" \
64 "sd\t$23,"__str(PT_R23)"($29)\n\t" \
65 "sd\t$30,"__str(PT_R30)"($29)\n\t" \
66 "j\t_" #symbol "\n\t" \
67 ".end\t" #symbol "\n\t" \
68 ".size\t" #symbol",. - " #symbol)
69
70#define nabi_no_regargs \
71 unsigned long __dummy0, \
72 unsigned long __dummy1, \
73 unsigned long __dummy2, \
74 unsigned long __dummy3, \
75 unsigned long __dummy4, \
76 unsigned long __dummy5, \
77 unsigned long __dummy6, \
78 unsigned long __dummy7,
79
80#endif /* CONFIG_64BIT */
81
82#endif /* _ASM_SIM_H */
diff --git a/include/asm-mips/smp-ops.h b/include/asm-mips/smp-ops.h
deleted file mode 100644
index 43c207e72a63..000000000000
--- a/include/asm-mips/smp-ops.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General
3 * Public License. See the file "COPYING" in the main directory of this
4 * archive for more details.
5 *
6 * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
7 * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
8 * Copyright (C) 2000, 2001, 2002 Ralf Baechle
9 * Copyright (C) 2000, 2001 Broadcom Corporation
10 */
11#ifndef __ASM_SMP_OPS_H
12#define __ASM_SMP_OPS_H
13
14#ifdef CONFIG_SMP
15
16#include <linux/cpumask.h>
17
18struct plat_smp_ops {
19 void (*send_ipi_single)(int cpu, unsigned int action);
20 void (*send_ipi_mask)(cpumask_t mask, unsigned int action);
21 void (*init_secondary)(void);
22 void (*smp_finish)(void);
23 void (*cpus_done)(void);
24 void (*boot_secondary)(int cpu, struct task_struct *idle);
25 void (*smp_setup)(void);
26 void (*prepare_cpus)(unsigned int max_cpus);
27};
28
29extern void register_smp_ops(struct plat_smp_ops *ops);
30
31static inline void plat_smp_setup(void)
32{
33 extern struct plat_smp_ops *mp_ops; /* private */
34
35 mp_ops->smp_setup();
36}
37
38#else /* !CONFIG_SMP */
39
40struct plat_smp_ops;
41
42static inline void plat_smp_setup(void)
43{
44 /* UP, nothing to do ... */
45}
46
47static inline void register_smp_ops(struct plat_smp_ops *ops)
48{
49}
50
51#endif /* !CONFIG_SMP */
52
53extern struct plat_smp_ops up_smp_ops;
54extern struct plat_smp_ops cmp_smp_ops;
55extern struct plat_smp_ops vsmp_smp_ops;
56
57#endif /* __ASM_SMP_OPS_H */
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
deleted file mode 100644
index 0ff5b523ea77..000000000000
--- a/include/asm-mips/smp.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General
3 * Public License. See the file "COPYING" in the main directory of this
4 * archive for more details.
5 *
6 * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
7 * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
8 * Copyright (C) 2000, 2001, 2002 Ralf Baechle
9 * Copyright (C) 2000, 2001 Broadcom Corporation
10 */
11#ifndef __ASM_SMP_H
12#define __ASM_SMP_H
13
14#include <linux/bitops.h>
15#include <linux/linkage.h>
16#include <linux/threads.h>
17#include <linux/cpumask.h>
18
19#include <asm/atomic.h>
20#include <asm/smp-ops.h>
21
22extern int smp_num_siblings;
23extern cpumask_t cpu_sibling_map[];
24
25#define raw_smp_processor_id() (current_thread_info()->cpu)
26
27/* Map from cpu id to sequential logical cpu number. This will only
28 not be idempotent when cpus failed to come on-line. */
29extern int __cpu_number_map[NR_CPUS];
30#define cpu_number_map(cpu) __cpu_number_map[cpu]
31
32/* The reverse map from sequential logical cpu number to cpu id. */
33extern int __cpu_logical_map[NR_CPUS];
34#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
35
36#define NO_PROC_ID (-1)
37
38#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
39#define SMP_CALL_FUNCTION 0x2
40
41extern cpumask_t phys_cpu_present_map;
42#define cpu_possible_map phys_cpu_present_map
43
44extern void asmlinkage smp_bootstrap(void);
45
46/*
47 * this function sends a 'reschedule' IPI to another CPU.
48 * it goes straight through and wastes no time serializing
49 * anything. Worst case is that we lose a reschedule ...
50 */
51static inline void smp_send_reschedule(int cpu)
52{
53 extern struct plat_smp_ops *mp_ops; /* private */
54
55 mp_ops->send_ipi_single(cpu, SMP_RESCHEDULE_YOURSELF);
56}
57
58extern asmlinkage void smp_call_function_interrupt(void);
59
60extern void arch_send_call_function_single_ipi(int cpu);
61extern void arch_send_call_function_ipi(cpumask_t mask);
62
63#endif /* __ASM_SMP_H */
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h
deleted file mode 100644
index 3639b28f80db..000000000000
--- a/include/asm-mips/smtc.h
+++ /dev/null
@@ -1,69 +0,0 @@
1#ifndef _ASM_SMTC_MT_H
2#define _ASM_SMTC_MT_H
3
4/*
5 * Definitions for SMTC multitasking on MIPS MT cores
6 */
7
8#include <asm/mips_mt.h>
9
10/*
11 * System-wide SMTC status information
12 */
13
14extern unsigned int smtc_status;
15
16#define SMTC_TLB_SHARED 0x00000001
17#define SMTC_MTC_ACTIVE 0x00000002
18
19/*
20 * TLB/ASID Management information
21 */
22
23#define MAX_SMTC_TLBS 2
24#define MAX_SMTC_ASIDS 256
25#if NR_CPUS <= 8
26typedef char asiduse;
27#else
28#if NR_CPUS <= 16
29typedef short asiduse;
30#else
31typedef long asiduse;
32#endif
33#endif
34
35extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
36
37struct mm_struct;
38struct task_struct;
39
40void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
41
42void smtc_flush_tlb_asid(unsigned long asid);
43extern int mipsmt_build_cpu_map(int startslot);
44extern void mipsmt_prepare_cpus(void);
45extern void smtc_smp_finish(void);
46extern void smtc_boot_secondary(int cpu, struct task_struct *t);
47extern void smtc_cpus_done(void);
48
49/*
50 * Sharing the TLB between multiple VPEs means that the
51 * "random" index selection function is not allowed to
52 * select the current value of the Index register. To
53 * avoid additional TLB pressure, the Index registers
54 * are "parked" with an non-Valid value.
55 */
56
57#define PARKED_INDEX ((unsigned int)0x80000000)
58
59/*
60 * Define low-level interrupt mask for IPIs, if necessary.
61 * By default, use SW interrupt 1, which requires no external
62 * hardware support, but which works only for single-core
63 * MIPS MT systems.
64 */
65#ifndef MIPS_CPU_IPI_IRQ
66#define MIPS_CPU_IPI_IRQ 1
67#endif
68
69#endif /* _ASM_SMTC_MT_H */
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h
deleted file mode 100644
index 8ce517574340..000000000000
--- a/include/asm-mips/smtc_ipi.h
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * Definitions used in MIPS MT SMTC "Interprocessor Interrupt" code.
3 */
4#ifndef __ASM_SMTC_IPI_H
5#define __ASM_SMTC_IPI_H
6
7#include <linux/spinlock.h>
8
9//#define SMTC_IPI_DEBUG
10
11#ifdef SMTC_IPI_DEBUG
12#include <asm/mipsregs.h>
13#include <asm/mipsmtregs.h>
14#endif /* SMTC_IPI_DEBUG */
15
16/*
17 * An IPI "message"
18 */
19
20struct smtc_ipi {
21 struct smtc_ipi *flink;
22 int type;
23 void *arg;
24 int dest;
25#ifdef SMTC_IPI_DEBUG
26 int sender;
27 long stamp;
28#endif /* SMTC_IPI_DEBUG */
29};
30
31/*
32 * Defined IPI Types
33 */
34
35#define LINUX_SMP_IPI 1
36#define SMTC_CLOCK_TICK 2
37#define IRQ_AFFINITY_IPI 3
38
39/*
40 * A queue of IPI messages
41 */
42
43struct smtc_ipi_q {
44 struct smtc_ipi *head;
45 spinlock_t lock;
46 struct smtc_ipi *tail;
47 int depth;
48};
49
50static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
51{
52 unsigned long flags;
53
54 spin_lock_irqsave(&q->lock, flags);
55 if (q->head == NULL)
56 q->head = q->tail = p;
57 else
58 q->tail->flink = p;
59 p->flink = NULL;
60 q->tail = p;
61 q->depth++;
62#ifdef SMTC_IPI_DEBUG
63 p->sender = read_c0_tcbind();
64 p->stamp = read_c0_count();
65#endif /* SMTC_IPI_DEBUG */
66 spin_unlock_irqrestore(&q->lock, flags);
67}
68
69static inline struct smtc_ipi *__smtc_ipi_dq(struct smtc_ipi_q *q)
70{
71 struct smtc_ipi *p;
72
73 if (q->head == NULL)
74 p = NULL;
75 else {
76 p = q->head;
77 q->head = q->head->flink;
78 q->depth--;
79 /* Arguably unnecessary, but leaves queue cleaner */
80 if (q->head == NULL)
81 q->tail = NULL;
82 }
83
84 return p;
85}
86
87static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q)
88{
89 unsigned long flags;
90 struct smtc_ipi *p;
91
92 spin_lock_irqsave(&q->lock, flags);
93 p = __smtc_ipi_dq(q);
94 spin_unlock_irqrestore(&q->lock, flags);
95
96 return p;
97}
98
99static inline void smtc_ipi_req(struct smtc_ipi_q *q, struct smtc_ipi *p)
100{
101 unsigned long flags;
102
103 spin_lock_irqsave(&q->lock, flags);
104 if (q->head == NULL) {
105 q->head = q->tail = p;
106 p->flink = NULL;
107 } else {
108 p->flink = q->head;
109 q->head = p;
110 }
111 q->depth++;
112 spin_unlock_irqrestore(&q->lock, flags);
113}
114
115static inline int smtc_ipi_qdepth(struct smtc_ipi_q *q)
116{
117 unsigned long flags;
118 int retval;
119
120 spin_lock_irqsave(&q->lock, flags);
121 retval = q->depth;
122 spin_unlock_irqrestore(&q->lock, flags);
123 return retval;
124}
125
126extern void smtc_send_ipi(int cpu, int type, unsigned int action);
127
128#endif /* __ASM_SMTC_IPI_H */
diff --git a/include/asm-mips/smtc_proc.h b/include/asm-mips/smtc_proc.h
deleted file mode 100644
index 25da651f1f5f..000000000000
--- a/include/asm-mips/smtc_proc.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Definitions for SMTC /proc entries
3 * Copyright(C) 2005 MIPS Technologies Inc.
4 */
5#ifndef __ASM_SMTC_PROC_H
6#define __ASM_SMTC_PROC_H
7
8/*
9 * per-"CPU" statistics
10 */
11
12struct smtc_cpu_proc {
13 unsigned long timerints;
14 unsigned long selfipis;
15};
16
17extern struct smtc_cpu_proc smtc_cpu_stats[NR_CPUS];
18
19/* Count of number of recoveries of "stolen" FPU access rights on 34K */
20
21extern atomic_t smtc_fpu_recoveries;
22
23#endif /* __ASM_SMTC_PROC_H */
diff --git a/include/asm-mips/smvp.h b/include/asm-mips/smvp.h
deleted file mode 100644
index 0d0e80a39e8a..000000000000
--- a/include/asm-mips/smvp.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _ASM_SMVP_H
2#define _ASM_SMVP_H
3
4/*
5 * Definitions for SMVP multitasking on MIPS MT cores
6 */
7struct task_struct;
8
9extern void smvp_smp_setup(void);
10extern void smvp_smp_finish(void);
11extern void smvp_boot_secondary(int cpu, struct task_struct *t);
12extern void smvp_init_secondary(void);
13extern void smvp_smp_finish(void);
14extern void smvp_cpus_done(void);
15extern void smvp_prepare_cpus(unsigned int max_cpus);
16
17/* This is platform specific */
18extern void smvp_send_ipi(int cpu, unsigned int action);
19#endif /* _ASM_SMVP_H */
diff --git a/include/asm-mips/sn/addrs.h b/include/asm-mips/sn/addrs.h
deleted file mode 100644
index fec9bdd34913..000000000000
--- a/include/asm-mips/sn/addrs.h
+++ /dev/null
@@ -1,430 +0,0 @@
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 * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc.
7 * Copyright (C) 1999, 2000 by Ralf Baechle
8 */
9#ifndef _ASM_SN_ADDRS_H
10#define _ASM_SN_ADDRS_H
11
12
13#ifndef __ASSEMBLY__
14#include <linux/types.h>
15#endif /* !__ASSEMBLY__ */
16
17#include <asm/addrspace.h>
18#include <asm/sn/kldir.h>
19
20#if defined(CONFIG_SGI_IP27)
21#include <asm/sn/sn0/addrs.h>
22#elif defined(CONFIG_SGI_IP35)
23#include <asm/sn/sn1/addrs.h>
24#endif
25
26
27#ifndef __ASSEMBLY__
28
29#define PS_UINT_CAST (unsigned long)
30#define UINT64_CAST (unsigned long)
31
32#define HUBREG_CAST (volatile hubreg_t *)
33
34#else /* __ASSEMBLY__ */
35
36#define PS_UINT_CAST
37#define UINT64_CAST
38#define HUBREG_CAST
39
40#endif /* __ASSEMBLY__ */
41
42
43#define NASID_GET_META(_n) ((_n) >> NASID_LOCAL_BITS)
44#ifdef CONFIG_SGI_IP27
45#define NASID_GET_LOCAL(_n) ((_n) & 0xf)
46#endif
47#define NASID_MAKE(_m, _l) (((_m) << NASID_LOCAL_BITS) | (_l))
48
49#define NODE_ADDRSPACE_MASK (NODE_ADDRSPACE_SIZE - 1)
50#define TO_NODE_ADDRSPACE(_pa) (UINT64_CAST (_pa) & NODE_ADDRSPACE_MASK)
51
52#define CHANGE_ADDR_NASID(_pa, _nasid) \
53 ((UINT64_CAST(_pa) & ~NASID_MASK) | \
54 (UINT64_CAST(_nasid) << NASID_SHFT))
55
56
57/*
58 * The following macros are used to index to the beginning of a specific
59 * node's address space.
60 */
61
62#define NODE_OFFSET(_n) (UINT64_CAST (_n) << NODE_SIZE_BITS)
63
64#define NODE_CAC_BASE(_n) (CAC_BASE + NODE_OFFSET(_n))
65#define NODE_HSPEC_BASE(_n) (HSPEC_BASE + NODE_OFFSET(_n))
66#define NODE_IO_BASE(_n) (IO_BASE + NODE_OFFSET(_n))
67#define NODE_MSPEC_BASE(_n) (MSPEC_BASE + NODE_OFFSET(_n))
68#define NODE_UNCAC_BASE(_n) (UNCAC_BASE + NODE_OFFSET(_n))
69
70#define TO_NODE(_n, _x) (NODE_OFFSET(_n) | ((_x) ))
71#define TO_NODE_CAC(_n, _x) (NODE_CAC_BASE(_n) | ((_x) & TO_PHYS_MASK))
72#define TO_NODE_UNCAC(_n, _x) (NODE_UNCAC_BASE(_n) | ((_x) & TO_PHYS_MASK))
73#define TO_NODE_MSPEC(_n, _x) (NODE_MSPEC_BASE(_n) | ((_x) & TO_PHYS_MASK))
74#define TO_NODE_HSPEC(_n, _x) (NODE_HSPEC_BASE(_n) | ((_x) & TO_PHYS_MASK))
75
76
77#define RAW_NODE_SWIN_BASE(nasid, widget) \
78 (NODE_IO_BASE(nasid) + (UINT64_CAST(widget) << SWIN_SIZE_BITS))
79
80#define WIDGETID_GET(addr) ((unsigned char)((addr >> SWIN_SIZE_BITS) & 0xff))
81
82/*
83 * The following definitions pertain to the IO special address
84 * space. They define the location of the big and little windows
85 * of any given node.
86 */
87
88#define SWIN_SIZE_BITS 24
89#define SWIN_SIZE (UINT64_CAST 1 << 24)
90#define SWIN_SIZEMASK (SWIN_SIZE - 1)
91#define SWIN_WIDGET_MASK 0xF
92
93/*
94 * Convert smallwindow address to xtalk address.
95 *
96 * 'addr' can be physical or virtual address, but will be converted
97 * to Xtalk address in the range 0 -> SWINZ_SIZEMASK
98 */
99#define SWIN_WIDGETADDR(addr) ((addr) & SWIN_SIZEMASK)
100#define SWIN_WIDGETNUM(addr) (((addr) >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK)
101/*
102 * Verify if addr belongs to small window address on node with "nasid"
103 *
104 *
105 * NOTE: "addr" is expected to be XKPHYS address, and NOT physical
106 * address
107 *
108 *
109 */
110#define NODE_SWIN_ADDR(nasid, addr) \
111 (((addr) >= NODE_SWIN_BASE(nasid, 0)) && \
112 ((addr) < (NODE_SWIN_BASE(nasid, HUB_NUM_WIDGET) + SWIN_SIZE)\
113 ))
114
115/*
116 * The following define the major position-independent aliases used
117 * in SN.
118 * UALIAS -- 256MB in size, reads in the UALIAS result in
119 * uncached references to the memory of the reader's node.
120 * CPU_UALIAS -- 128kb in size, the bottom part of UALIAS is flipped
121 * depending on which CPU does the access to provide
122 * all CPUs with unique uncached memory at low addresses.
123 * LBOOT -- 256MB in size, reads in the LBOOT area result in
124 * uncached references to the local hub's boot prom and
125 * other directory-bus connected devices.
126 * IALIAS -- 8MB in size, reads in the IALIAS result in uncached
127 * references to the local hub's registers.
128 */
129
130#define UALIAS_BASE HSPEC_BASE
131#define UALIAS_SIZE 0x10000000 /* 256 Megabytes */
132#define UALIAS_LIMIT (UALIAS_BASE + UALIAS_SIZE)
133
134/*
135 * The bottom of ualias space is flipped depending on whether you're
136 * processor 0 or 1 within a node.
137 */
138#ifdef CONFIG_SGI_IP27
139#define UALIAS_FLIP_BASE UALIAS_BASE
140#define UALIAS_FLIP_SIZE 0x20000
141#define UALIAS_FLIP_BIT 0x10000
142#define UALIAS_FLIP_ADDR(_x) (cputoslice(smp_processor_id()) ? \
143 (_x) ^ UALIAS_FLIP_BIT : (_x))
144
145#define LBOOT_BASE (HSPEC_BASE + 0x10000000)
146#define LBOOT_SIZE 0x10000000
147#define LBOOT_LIMIT (LBOOT_BASE + LBOOT_SIZE)
148#define LBOOT_STRIDE 0 /* IP27 has only one CPU PROM */
149
150#endif
151
152#define HUB_REGISTER_WIDGET 1
153#define IALIAS_BASE NODE_SWIN_BASE(0, HUB_REGISTER_WIDGET)
154#define IALIAS_SIZE 0x800000 /* 8 Megabytes */
155#define IS_IALIAS(_a) (((_a) >= IALIAS_BASE) && \
156 ((_a) < (IALIAS_BASE + IALIAS_SIZE)))
157
158/*
159 * Macro for referring to Hub's RBOOT space
160 */
161
162#ifdef CONFIG_SGI_IP27
163#define RBOOT_SIZE 0x10000000 /* 256 Megabytes */
164#define NODE_RBOOT_BASE(_n) (NODE_HSPEC_BASE(_n) + 0x30000000)
165#define NODE_RBOOT_LIMIT(_n) (NODE_RBOOT_BASE(_n) + RBOOT_SIZE)
166
167#endif
168
169/*
170 * Macros for referring the Hub's back door space
171 *
172 * These macros correctly process addresses in any node's space.
173 * WARNING: They won't work in assembler.
174 *
175 * BDDIR_ENTRY_LO returns the address of the low double-word of the dir
176 * entry corresponding to a physical (Cac or Uncac) address.
177 * BDDIR_ENTRY_HI returns the address of the high double-word of the entry.
178 * BDPRT_ENTRY returns the address of the double-word protection entry
179 * corresponding to the page containing the physical address.
180 * BDPRT_ENTRY_S Stores the value into the protection entry.
181 * BDPRT_ENTRY_L Load the value from the protection entry.
182 * BDECC_ENTRY returns the address of the ECC byte corresponding to a
183 * double-word at a specified physical address.
184 * BDECC_ENTRY_H returns the address of the two ECC bytes corresponding to a
185 * quad-word at a specified physical address.
186 */
187#define NODE_BDOOR_BASE(_n) (NODE_HSPEC_BASE(_n) + (NODE_ADDRSPACE_SIZE/2))
188
189#define NODE_BDECC_BASE(_n) (NODE_BDOOR_BASE(_n))
190#define NODE_BDDIR_BASE(_n) (NODE_BDOOR_BASE(_n) + (NODE_ADDRSPACE_SIZE/4))
191#ifdef CONFIG_SGI_IP27
192#define BDDIR_ENTRY_LO(_pa) ((HSPEC_BASE + \
193 NODE_ADDRSPACE_SIZE * 3 / 4 + \
194 0x200) | \
195 UINT64_CAST(_pa) & NASID_MASK | \
196 UINT64_CAST(_pa) >> 2 & BDDIR_UPPER_MASK | \
197 UINT64_CAST(_pa) >> 3 & 0x1f << 4)
198
199#define BDDIR_ENTRY_HI(_pa) ((HSPEC_BASE + \
200 NODE_ADDRSPACE_SIZE * 3 / 4 + \
201 0x208) | \
202 UINT64_CAST(_pa) & NASID_MASK | \
203 UINT64_CAST(_pa) >> 2 & BDDIR_UPPER_MASK | \
204 UINT64_CAST(_pa) >> 3 & 0x1f << 4)
205
206#define BDPRT_ENTRY(_pa, _rgn) ((HSPEC_BASE + \
207 NODE_ADDRSPACE_SIZE * 3 / 4) | \
208 UINT64_CAST(_pa) & NASID_MASK | \
209 UINT64_CAST(_pa) >> 2 & BDDIR_UPPER_MASK | \
210 (_rgn) << 3)
211#define BDPRT_ENTRY_ADDR(_pa, _rgn) (BDPRT_ENTRY((_pa), (_rgn)))
212#define BDPRT_ENTRY_S(_pa, _rgn, _val) (*(__psunsigned_t *)BDPRT_ENTRY((_pa), (_rgn))=(_val))
213#define BDPRT_ENTRY_L(_pa, _rgn) (*(__psunsigned_t *)BDPRT_ENTRY((_pa), (_rgn)))
214
215#define BDECC_ENTRY(_pa) ((HSPEC_BASE + \
216 NODE_ADDRSPACE_SIZE / 2) | \
217 UINT64_CAST(_pa) & NASID_MASK | \
218 UINT64_CAST(_pa) >> 2 & BDECC_UPPER_MASK | \
219 UINT64_CAST(_pa) >> 3 & 3)
220
221/*
222 * Macro to convert a back door directory or protection address into the
223 * raw physical address of the associated cache line or protection page.
224 */
225#define BDADDR_IS_DIR(_ba) ((UINT64_CAST (_ba) & 0x200) != 0)
226#define BDADDR_IS_PRT(_ba) ((UINT64_CAST (_ba) & 0x200) == 0)
227
228#define BDDIR_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \
229 (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2 | \
230 (UINT64_CAST(_ba) & 0x1f << 4) << 3)
231
232#define BDPRT_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \
233 (UINT64_CAST(_ba) & BDDIR_UPPER_MASK)<<2)
234
235#define BDECC_TO_MEM(_ba) (UINT64_CAST (_ba) & NASID_MASK | \
236 (UINT64_CAST(_ba) & BDECC_UPPER_MASK)<<2 | \
237 (UINT64_CAST(_ba) & 3) << 3)
238#endif /* CONFIG_SGI_IP27 */
239
240
241/*
242 * The following macros produce the correct base virtual address for
243 * the hub registers. The LOCAL_HUB_* macros produce the appropriate
244 * address for the local registers. The REMOTE_HUB_* macro produce
245 * the address for the specified hub's registers. The intent is
246 * that the appropriate PI, MD, NI, or II register would be substituted
247 * for _x.
248 */
249
250/*
251 * WARNING:
252 * When certain Hub chip workaround are defined, it's not sufficient
253 * to dereference the *_HUB_ADDR() macros. You should instead use
254 * HUB_L() and HUB_S() if you must deal with pointers to hub registers.
255 * Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S().
256 * They're always safe.
257 */
258#define LOCAL_HUB_ADDR(_x) (HUBREG_CAST (IALIAS_BASE + (_x)))
259#define REMOTE_HUB_ADDR(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
260 0x800000 + (_x)))
261#ifdef CONFIG_SGI_IP27
262#define REMOTE_HUB_PI_ADDR(_n, _sn, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
263 0x800000 + (_x)))
264#endif /* CONFIG_SGI_IP27 */
265
266#ifndef __ASSEMBLY__
267
268#define HUB_L(_a) *(_a)
269#define HUB_S(_a, _d) *(_a) = (_d)
270
271#define LOCAL_HUB_L(_r) HUB_L(LOCAL_HUB_ADDR(_r))
272#define LOCAL_HUB_S(_r, _d) HUB_S(LOCAL_HUB_ADDR(_r), (_d))
273#define REMOTE_HUB_L(_n, _r) HUB_L(REMOTE_HUB_ADDR((_n), (_r)))
274#define REMOTE_HUB_S(_n, _r, _d) HUB_S(REMOTE_HUB_ADDR((_n), (_r)), (_d))
275#define REMOTE_HUB_PI_L(_n, _sn, _r) HUB_L(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)))
276#define REMOTE_HUB_PI_S(_n, _sn, _r, _d) HUB_S(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)), (_d))
277
278#endif /* !__ASSEMBLY__ */
279
280/*
281 * The following macros are used to get to a hub/bridge register, given
282 * the base of the register space.
283 */
284#define HUB_REG_PTR(_base, _off) \
285 (HUBREG_CAST((__psunsigned_t)(_base) + (__psunsigned_t)(_off)))
286
287#define HUB_REG_PTR_L(_base, _off) \
288 HUB_L(HUB_REG_PTR((_base), (_off)))
289
290#define HUB_REG_PTR_S(_base, _off, _data) \
291 HUB_S(HUB_REG_PTR((_base), (_off)), (_data))
292
293/*
294 * Software structure locations -- permanently fixed
295 * See diagram in kldir.h
296 */
297
298#define PHYS_RAMBASE 0x0
299#define K0_RAMBASE PHYS_TO_K0(PHYS_RAMBASE)
300
301#define EX_HANDLER_OFFSET(slice) ((slice) << 16)
302#define EX_HANDLER_ADDR(nasid, slice) \
303 PHYS_TO_K0(NODE_OFFSET(nasid) | EX_HANDLER_OFFSET(slice))
304#define EX_HANDLER_SIZE 0x0400
305
306#define EX_FRAME_OFFSET(slice) ((slice) << 16 | 0x400)
307#define EX_FRAME_ADDR(nasid, slice) \
308 PHYS_TO_K0(NODE_OFFSET(nasid) | EX_FRAME_OFFSET(slice))
309#define EX_FRAME_SIZE 0x0c00
310
311#define ARCS_SPB_OFFSET 0x1000
312#define ARCS_SPB_ADDR(nasid) \
313 PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET)
314#define ARCS_SPB_SIZE 0x0400
315
316#define KLDIR_OFFSET 0x2000
317#define KLDIR_ADDR(nasid) \
318 TO_NODE_UNCAC((nasid), KLDIR_OFFSET)
319#define KLDIR_SIZE 0x0400
320
321
322/*
323 * Software structure locations -- indirected through KLDIR
324 * See diagram in kldir.h
325 *
326 * Important: All low memory structures must only be accessed
327 * uncached, except for the symmon stacks.
328 */
329
330#define KLI_LAUNCH 0 /* Dir. entries */
331#define KLI_KLCONFIG 1
332#define KLI_NMI 2
333#define KLI_GDA 3
334#define KLI_FREEMEM 4
335#define KLI_SYMMON_STK 5
336#define KLI_PI_ERROR 6
337#define KLI_KERN_VARS 7
338#define KLI_KERN_XP 8
339#define KLI_KERN_PARTID 9
340
341#ifndef __ASSEMBLY__
342
343#define KLD_BASE(nasid) ((kldir_ent_t *) KLDIR_ADDR(nasid))
344#define KLD_LAUNCH(nasid) (KLD_BASE(nasid) + KLI_LAUNCH)
345#define KLD_NMI(nasid) (KLD_BASE(nasid) + KLI_NMI)
346#define KLD_KLCONFIG(nasid) (KLD_BASE(nasid) + KLI_KLCONFIG)
347#define KLD_PI_ERROR(nasid) (KLD_BASE(nasid) + KLI_PI_ERROR)
348#define KLD_GDA(nasid) (KLD_BASE(nasid) + KLI_GDA)
349#define KLD_SYMMON_STK(nasid) (KLD_BASE(nasid) + KLI_SYMMON_STK)
350#define KLD_FREEMEM(nasid) (KLD_BASE(nasid) + KLI_FREEMEM)
351#define KLD_KERN_VARS(nasid) (KLD_BASE(nasid) + KLI_KERN_VARS)
352#define KLD_KERN_XP(nasid) (KLD_BASE(nasid) + KLI_KERN_XP)
353#define KLD_KERN_PARTID(nasid) (KLD_BASE(nasid) + KLI_KERN_PARTID)
354
355#define LAUNCH_OFFSET(nasid, slice) \
356 (KLD_LAUNCH(nasid)->offset + \
357 KLD_LAUNCH(nasid)->stride * (slice))
358#define LAUNCH_ADDR(nasid, slice) \
359 TO_NODE_UNCAC((nasid), LAUNCH_OFFSET(nasid, slice))
360#define LAUNCH_SIZE(nasid) KLD_LAUNCH(nasid)->size
361
362#define NMI_OFFSET(nasid, slice) \
363 (KLD_NMI(nasid)->offset + \
364 KLD_NMI(nasid)->stride * (slice))
365#define NMI_ADDR(nasid, slice) \
366 TO_NODE_UNCAC((nasid), NMI_OFFSET(nasid, slice))
367#define NMI_SIZE(nasid) KLD_NMI(nasid)->size
368
369#define KLCONFIG_OFFSET(nasid) KLD_KLCONFIG(nasid)->offset
370#define KLCONFIG_ADDR(nasid) \
371 TO_NODE_UNCAC((nasid), KLCONFIG_OFFSET(nasid))
372#define KLCONFIG_SIZE(nasid) KLD_KLCONFIG(nasid)->size
373
374#define GDA_ADDR(nasid) KLD_GDA(nasid)->pointer
375#define GDA_SIZE(nasid) KLD_GDA(nasid)->size
376
377#define SYMMON_STK_OFFSET(nasid, slice) \
378 (KLD_SYMMON_STK(nasid)->offset + \
379 KLD_SYMMON_STK(nasid)->stride * (slice))
380#define SYMMON_STK_STRIDE(nasid) KLD_SYMMON_STK(nasid)->stride
381
382#define SYMMON_STK_ADDR(nasid, slice) \
383 TO_NODE_CAC((nasid), SYMMON_STK_OFFSET(nasid, slice))
384
385#define SYMMON_STK_SIZE(nasid) KLD_SYMMON_STK(nasid)->stride
386
387#define SYMMON_STK_END(nasid) (SYMMON_STK_ADDR(nasid, 0) + KLD_SYMMON_STK(nasid)->size)
388
389/* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a
390 * relocatable program
391 */
392#define UNIX_DEBUG_LOADADDR 0x300000
393#define SYMMON_LOADADDR(nasid) \
394 TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000))
395
396#define FREEMEM_OFFSET(nasid) KLD_FREEMEM(nasid)->offset
397#define FREEMEM_ADDR(nasid) SYMMON_STK_END(nasid)
398/*
399 * XXX
400 * Fix this. FREEMEM_ADDR should be aware of if symmon is loaded.
401 * Also, it should take into account what prom thinks to be a safe
402 * address
403 PHYS_TO_K0(NODE_OFFSET(nasid) + FREEMEM_OFFSET(nasid))
404 */
405#define FREEMEM_SIZE(nasid) KLD_FREEMEM(nasid)->size
406
407#define PI_ERROR_OFFSET(nasid) KLD_PI_ERROR(nasid)->offset
408#define PI_ERROR_ADDR(nasid) \
409 TO_NODE_UNCAC((nasid), PI_ERROR_OFFSET(nasid))
410#define PI_ERROR_SIZE(nasid) KLD_PI_ERROR(nasid)->size
411
412#define NODE_OFFSET_TO_K0(_nasid, _off) \
413 PHYS_TO_K0((NODE_OFFSET(_nasid) + (_off)) | CAC_BASE)
414#define NODE_OFFSET_TO_K1(_nasid, _off) \
415 TO_UNCAC((NODE_OFFSET(_nasid) + (_off)) | UNCAC_BASE)
416#define K0_TO_NODE_OFFSET(_k0addr) \
417 ((__psunsigned_t)(_k0addr) & NODE_ADDRSPACE_MASK)
418
419#define KERN_VARS_ADDR(nasid) KLD_KERN_VARS(nasid)->pointer
420#define KERN_VARS_SIZE(nasid) KLD_KERN_VARS(nasid)->size
421
422#define KERN_XP_ADDR(nasid) KLD_KERN_XP(nasid)->pointer
423#define KERN_XP_SIZE(nasid) KLD_KERN_XP(nasid)->size
424
425#define GPDA_ADDR(nasid) TO_NODE_CAC(nasid, GPDA_OFFSET)
426
427#endif /* !__ASSEMBLY__ */
428
429
430#endif /* _ASM_SN_ADDRS_H */
diff --git a/include/asm-mips/sn/agent.h b/include/asm-mips/sn/agent.h
deleted file mode 100644
index ac4ea85c3a5c..000000000000
--- a/include/asm-mips/sn/agent.h
+++ /dev/null
@@ -1,46 +0,0 @@
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 * This file has definitions for the hub and snac interfaces.
7 *
8 * Copyright (C) 1992 - 1997, 1999, 2000 Silcon Graphics, Inc.
9 * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
10 */
11#ifndef _ASM_SGI_SN_AGENT_H
12#define _ASM_SGI_SN_AGENT_H
13
14#include <linux/topology.h>
15#include <asm/sn/addrs.h>
16#include <asm/sn/arch.h>
17
18#if defined(CONFIG_SGI_IP27)
19#include <asm/sn/sn0/hub.h>
20#elif defined(CONFIG_SGI_IP35)
21#include <asm/sn/sn1/hub.h>
22#endif /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
23
24/*
25 * NIC register macros
26 */
27
28#if defined(CONFIG_SGI_IP27)
29#define HUB_NIC_ADDR(_cpuid) \
30 REMOTE_HUB_ADDR(COMPACT_TO_NASID_NODEID(cpu_to_node(_cpuid)), \
31 MD_MLAN_CTL)
32#endif
33
34#define SET_HUB_NIC(_my_cpuid, _val) \
35 (HUB_S(HUB_NIC_ADDR(_my_cpuid), (_val)))
36
37#define SET_MY_HUB_NIC(_v) \
38 SET_HUB_NIC(cpuid(), (_v))
39
40#define GET_HUB_NIC(_my_cpuid) \
41 (HUB_L(HUB_NIC_ADDR(_my_cpuid)))
42
43#define GET_MY_HUB_NIC() \
44 GET_HUB_NIC(cpuid())
45
46#endif /* _ASM_SGI_SN_AGENT_H */
diff --git a/include/asm-mips/sn/arch.h b/include/asm-mips/sn/arch.h
deleted file mode 100644
index bd75945e10ff..000000000000
--- a/include/asm-mips/sn/arch.h
+++ /dev/null
@@ -1,64 +0,0 @@
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 * SGI specific setup.
7 *
8 * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
10 */
11#ifndef _ASM_SN_ARCH_H
12#define _ASM_SN_ARCH_H
13
14#include <linux/types.h>
15#include <asm/sn/types.h>
16#ifdef CONFIG_SGI_IP27
17#include <asm/sn/sn0/arch.h>
18#endif
19
20typedef u64 hubreg_t;
21
22#define cputonasid(cpu) (sn_cpu_info[(cpu)].p_nasid)
23#define cputoslice(cpu) (sn_cpu_info[(cpu)].p_slice)
24#define makespnum(_nasid, _slice) \
25 (((_nasid) << CPUS_PER_NODE_SHFT) | (_slice))
26
27#define INVALID_NASID (nasid_t)-1
28#define INVALID_CNODEID (cnodeid_t)-1
29#define INVALID_PNODEID (pnodeid_t)-1
30#define INVALID_MODULE (moduleid_t)-1
31#define INVALID_PARTID (partid_t)-1
32
33extern nasid_t get_nasid(void);
34extern cnodeid_t get_cpu_cnode(cpuid_t);
35extern int get_cpu_slice(cpuid_t);
36
37/*
38 * NO ONE should access these arrays directly. The only reason we refer to
39 * them here is to avoid the procedure call that would be required in the
40 * macros below. (Really want private data members here :-)
41 */
42extern cnodeid_t nasid_to_compact_node[MAX_NASIDS];
43extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
44
45/*
46 * These macros are used by various parts of the kernel to convert
47 * between the three different kinds of node numbering. At least some
48 * of them may change to procedure calls in the future, but the macros
49 * will continue to work. Don't use the arrays above directly.
50 */
51
52#define NASID_TO_REGION(nnode) \
53 ((nnode) >> \
54 (is_fine_dirmode() ? NASID_TO_FINEREG_SHFT : NASID_TO_COARSEREG_SHFT))
55
56extern cnodeid_t nasid_to_compact_node[MAX_NASIDS];
57extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
58extern cnodeid_t cpuid_to_compact_node[MAXCPUS];
59
60#define NASID_TO_COMPACT_NODEID(nnode) (nasid_to_compact_node[nnode])
61#define COMPACT_TO_NASID_NODEID(cnode) (compact_to_nasid_node[cnode])
62#define CPUID_TO_COMPACT_NODEID(cpu) (cpuid_to_compact_node[(cpu)])
63
64#endif /* _ASM_SN_ARCH_H */
diff --git a/include/asm-mips/sn/fru.h b/include/asm-mips/sn/fru.h
deleted file mode 100644
index b3e3606723b7..000000000000
--- a/include/asm-mips/sn/fru.h
+++ /dev/null
@@ -1,44 +0,0 @@
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 * Derived from IRIX <sys/SN/SN0/sn0_fru.h>
7 *
8 * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc.
9 * Copyright (C) 1999, 2006 Ralf Baechle (ralf@linux-mips)
10 */
11#ifndef __ASM_SN_FRU_H
12#define __ASM_SN_FRU_H
13
14#define MAX_DIMMS 8 /* max # of dimm banks */
15#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */
16
17typedef unsigned char confidence_t;
18
19typedef struct kf_mem_s {
20 confidence_t km_confidence; /* confidence level that the memory is bad
21 * is this necessary ?
22 */
23 confidence_t km_dimm[MAX_DIMMS];
24 /* confidence level that dimm[i] is bad
25 *I think this is the right number
26 */
27
28} kf_mem_t;
29
30typedef struct kf_cpu_s {
31 confidence_t kc_confidence; /* confidence level that cpu is bad */
32 confidence_t kc_icache; /* confidence level that instr. cache is bad */
33 confidence_t kc_dcache; /* confidence level that data cache is bad */
34 confidence_t kc_scache; /* confidence level that sec. cache is bad */
35 confidence_t kc_sysbus; /* confidence level that sysad/cmd/state bus is bad */
36} kf_cpu_t;
37
38typedef struct kf_pci_bus_s {
39 confidence_t kpb_belief; /* confidence level that the pci bus is bad */
40 confidence_t kpb_pcidev_belief[MAX_PCIDEV];
41 /* confidence level that the pci dev is bad */
42} kf_pci_bus_t;
43
44#endif /* __ASM_SN_FRU_H */
diff --git a/include/asm-mips/sn/gda.h b/include/asm-mips/sn/gda.h
deleted file mode 100644
index 9cb6ff770915..000000000000
--- a/include/asm-mips/sn/gda.h
+++ /dev/null
@@ -1,107 +0,0 @@
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 * Derived from IRIX <sys/SN/gda.h>.
7 *
8 * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
9 *
10 * gda.h -- Contains the data structure for the global data area,
11 * The GDA contains information communicated between the
12 * PROM, SYMMON, and the kernel.
13 */
14#ifndef _ASM_SN_GDA_H
15#define _ASM_SN_GDA_H
16
17#include <asm/sn/addrs.h>
18
19#define GDA_MAGIC 0x58464552
20
21/*
22 * GDA Version History
23 *
24 * Version # | Change
25 * -------------+-------------------------------------------------------
26 * 1 | Initial SN0 version
27 * 2 | Prom sets g_partid field to the partition number. 0 IS
28 * | a valid partition #.
29 */
30
31#define GDA_VERSION 2 /* Current GDA version # */
32
33#define G_MAGICOFF 0
34#define G_VERSIONOFF 4
35#define G_PROMOPOFF 6
36#define G_MASTEROFF 8
37#define G_VDSOFF 12
38#define G_HKDNORMOFF 16
39#define G_HKDUTLBOFF 24
40#define G_HKDXUTLBOFF 32
41#define G_PARTIDOFF 40
42#define G_TABLEOFF 128
43
44#ifndef __ASSEMBLY__
45
46typedef struct gda {
47 u32 g_magic; /* GDA magic number */
48 u16 g_version; /* Version of this structure */
49 u16 g_masterid; /* The NASID:CPUNUM of the master cpu */
50 u32 g_promop; /* Passes requests from the kernel to prom */
51 u32 g_vds; /* Store the virtual dipswitches here */
52 void **g_hooked_norm;/* ptr to pda loc for norm hndlr */
53 void **g_hooked_utlb;/* ptr to pda loc for utlb hndlr */
54 void **g_hooked_xtlb;/* ptr to pda loc for xtlb hndlr */
55 int g_partid; /* partition id */
56 int g_symmax; /* Max symbols in name table. */
57 void *g_dbstab; /* Address of idbg symbol table */
58 char *g_nametab; /* Address of idbg name table */
59 void *g_ktext_repmask;
60 /* Pointer to a mask of nodes with copies
61 * of the kernel. */
62 char g_padding[56]; /* pad out to 128 bytes */
63 nasid_t g_nasidtable[MAX_COMPACT_NODES]; /* NASID of each node,
64 * indexed by cnodeid.
65 */
66} gda_t;
67
68#define GDA ((gda_t*) GDA_ADDR(get_nasid()))
69
70#endif /* !__ASSEMBLY__ */
71/*
72 * Define: PART_GDA_VERSION
73 * Purpose: Define the minimum version of the GDA required, lower
74 * revisions assume GDA is NOT set up, and read partition
75 * information from the board info.
76 */
77#define PART_GDA_VERSION 2
78
79/*
80 * The following requests can be sent to the PROM during startup.
81 */
82
83#define PROMOP_MAGIC 0x0ead0000
84#define PROMOP_MAGIC_MASK 0x0fff0000
85
86#define PROMOP_BIST_SHIFT 11
87#define PROMOP_BIST_MASK (0x3 << 11)
88
89#define PROMOP_REG PI_ERR_STACK_ADDR_A
90
91#define PROMOP_INVALID (PROMOP_MAGIC | 0x00)
92#define PROMOP_HALT (PROMOP_MAGIC | 0x10)
93#define PROMOP_POWERDOWN (PROMOP_MAGIC | 0x20)
94#define PROMOP_RESTART (PROMOP_MAGIC | 0x30)
95#define PROMOP_REBOOT (PROMOP_MAGIC | 0x40)
96#define PROMOP_IMODE (PROMOP_MAGIC | 0x50)
97
98#define PROMOP_CMD_MASK 0x00f0
99#define PROMOP_OPTIONS_MASK 0xfff0
100
101#define PROMOP_SKIP_DIAGS 0x0100 /* don't bother running diags */
102#define PROMOP_SKIP_MEMINIT 0x0200 /* don't bother initing memory */
103#define PROMOP_SKIP_DEVINIT 0x0400 /* don't bother initing devices */
104#define PROMOP_BIST1 0x0800 /* keep track of which BIST ran */
105#define PROMOP_BIST2 0x1000 /* keep track of which BIST ran */
106
107#endif /* _ASM_SN_GDA_H */
diff --git a/include/asm-mips/sn/hub.h b/include/asm-mips/sn/hub.h
deleted file mode 100644
index 1992d9254a08..000000000000
--- a/include/asm-mips/sn/hub.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef __ASM_SN_HUB_H
2#define __ASM_SN_HUB_H
3
4#include <linux/types.h>
5#include <linux/cpumask.h>
6#include <asm/sn/types.h>
7#include <asm/sn/io.h>
8#include <asm/sn/klkernvars.h>
9#include <asm/xtalk/xtalk.h>
10
11/* ip27-hubio.c */
12extern unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget,
13 unsigned long xtalk_addr, size_t size);
14extern void hub_pio_init(cnodeid_t cnode);
15
16#endif /* __ASM_SN_HUB_H */
diff --git a/include/asm-mips/sn/intr.h b/include/asm-mips/sn/intr.h
deleted file mode 100644
index 6718b644b970..000000000000
--- a/include/asm-mips/sn/intr.h
+++ /dev/null
@@ -1,129 +0,0 @@
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 * Copyright (C) 1992 - 1997 Silicon Graphics, Inc.
7 */
8#ifndef __ASM_SN_INTR_H
9#define __ASM_SN_INTR_H
10
11/* Number of interrupt levels associated with each interrupt register. */
12#define N_INTPEND_BITS 64
13
14#define INT_PEND0_BASELVL 0
15#define INT_PEND1_BASELVL 64
16
17#define N_INTPENDJUNK_BITS 8
18#define INTPENDJUNK_CLRBIT 0x80
19
20/*
21 * Macros to manipulate the interrupt register on the calling hub chip.
22 */
23
24#define LOCAL_HUB_SEND_INTR(level) \
25 LOCAL_HUB_S(PI_INT_PEND_MOD, (0x100 | (level)))
26#define REMOTE_HUB_SEND_INTR(hub, level) \
27 REMOTE_HUB_S((hub), PI_INT_PEND_MOD, (0x100 | (level)))
28
29/*
30 * When clearing the interrupt, make sure this clear does make it
31 * to the hub. Otherwise we could end up losing interrupts.
32 * We do an uncached load of the int_pend0 register to ensure this.
33 */
34
35#define LOCAL_HUB_CLR_INTR(level) \
36do { \
37 LOCAL_HUB_S(PI_INT_PEND_MOD, (level)); \
38 LOCAL_HUB_L(PI_INT_PEND0); \
39} while (0);
40
41#define REMOTE_HUB_CLR_INTR(hub, level) \
42do { \
43 nasid_t __hub = (hub); \
44 \
45 REMOTE_HUB_S(__hub, PI_INT_PEND_MOD, (level)); \
46 REMOTE_HUB_L(__hub, PI_INT_PEND0); \
47} while (0);
48
49/*
50 * Hard-coded interrupt levels:
51 */
52
53/*
54 * L0 = SW1
55 * L1 = SW2
56 * L2 = INT_PEND0
57 * L3 = INT_PEND1
58 * L4 = RTC
59 * L5 = Profiling Timer
60 * L6 = Hub Errors
61 * L7 = Count/Compare (T5 counters)
62 */
63
64
65/*
66 * INT_PEND0 hard-coded bits.
67 */
68
69/*
70 * INT_PEND0 bits determined by hardware:
71 */
72#define RESERVED_INTR 0 /* What is this bit? */
73#define GFX_INTR_A 1
74#define GFX_INTR_B 2
75#define PG_MIG_INTR 3
76#define UART_INTR 4
77#define CC_PEND_A 5
78#define CC_PEND_B 6
79
80/*
81 * INT_PEND0 used by the kernel for itself ...
82 */
83#define CPU_RESCHED_A_IRQ 7
84#define CPU_RESCHED_B_IRQ 8
85#define CPU_CALL_A_IRQ 9
86#define CPU_CALL_B_IRQ 10
87#define MSC_MESG_INTR 11
88#define BASE_PCI_IRQ 12
89
90/*
91 * INT_PEND0 again, bits determined by hardware / hardcoded:
92 */
93#define SDISK_INTR 63 /* SABLE name */
94#define IP_PEND0_6_63 63 /* What is this bit? */
95
96/*
97 * INT_PEND1 hard-coded bits:
98 */
99#define NI_BRDCAST_ERR_A 39
100#define NI_BRDCAST_ERR_B 40
101
102#define LLP_PFAIL_INTR_A 41 /* see ml/SN/SN0/sysctlr.c */
103#define LLP_PFAIL_INTR_B 42
104
105#define TLB_INTR_A 43 /* used for tlb flush random */
106#define TLB_INTR_B 44
107
108#define IP27_INTR_0 45 /* Reserved for PROM use */
109#define IP27_INTR_1 46 /* do not use in Kernel */
110#define IP27_INTR_2 47
111#define IP27_INTR_3 48
112#define IP27_INTR_4 49
113#define IP27_INTR_5 50
114#define IP27_INTR_6 51
115#define IP27_INTR_7 52
116
117#define BRIDGE_ERROR_INTR 53 /* Setup by PROM to catch */
118 /* Bridge Errors */
119#define DEBUG_INTR_A 54
120#define DEBUG_INTR_B 55 /* Used by symmon to stop all cpus */
121#define IO_ERROR_INTR 57 /* Setup by PROM */
122#define CLK_ERR_INTR 58
123#define COR_ERR_INTR_A 59
124#define COR_ERR_INTR_B 60
125#define MD_COR_ERR_INTR 61
126#define NI_ERROR_INTR 62
127#define MSC_PANIC_INTR 63
128
129#endif /* __ASM_SN_INTR_H */
diff --git a/include/asm-mips/sn/io.h b/include/asm-mips/sn/io.h
deleted file mode 100644
index 24c6775fbb0f..000000000000
--- a/include/asm-mips/sn/io.h
+++ /dev/null
@@ -1,59 +0,0 @@
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 * Copyright (C) 2000, 2003 Ralf Baechle
7 * Copyright (C) 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SN_IO_H
10#define _ASM_SN_IO_H
11
12#if defined(CONFIG_SGI_IP27)
13#include <asm/sn/sn0/hubio.h>
14#endif
15
16
17#define IIO_ITTE_BASE 0x400160 /* base of translation table entries */
18#define IIO_ITTE(bigwin) (IIO_ITTE_BASE + 8*(bigwin))
19
20#define IIO_ITTE_OFFSET_BITS 5 /* size of offset field */
21#define IIO_ITTE_OFFSET_MASK ((1<<IIO_ITTE_OFFSET_BITS)-1)
22#define IIO_ITTE_OFFSET_SHIFT 0
23
24#define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */
25#define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1)
26#define IIO_ITTE_WIDGET_SHIFT 8
27
28#define IIO_ITTE_IOSP 1 /* I/O Space bit */
29#define IIO_ITTE_IOSP_MASK 1
30#define IIO_ITTE_IOSP_SHIFT 12
31#define HUB_PIO_MAP_TO_MEM 0
32#define HUB_PIO_MAP_TO_IO 1
33
34#define IIO_ITTE_INVALID_WIDGET 3 /* an invalid widget */
35
36#define IIO_ITTE_PUT(nasid, bigwin, io_or_mem, widget, addr) \
37 REMOTE_HUB_S((nasid), IIO_ITTE(bigwin), \
38 (((((addr) >> BWIN_SIZE_BITS) & \
39 IIO_ITTE_OFFSET_MASK) << IIO_ITTE_OFFSET_SHIFT) | \
40 (io_or_mem << IIO_ITTE_IOSP_SHIFT) | \
41 (((widget) & IIO_ITTE_WIDGET_MASK) << IIO_ITTE_WIDGET_SHIFT)))
42
43#define IIO_ITTE_DISABLE(nasid, bigwin) \
44 IIO_ITTE_PUT((nasid), HUB_PIO_MAP_TO_MEM, \
45 (bigwin), IIO_ITTE_INVALID_WIDGET, 0)
46
47#define IIO_ITTE_GET(nasid, bigwin) REMOTE_HUB_ADDR((nasid), IIO_ITTE(bigwin))
48
49/*
50 * Macro which takes the widget number, and returns the
51 * IO PRB address of that widget.
52 * value _x is expected to be a widget number in the range
53 * 0, 8 - 0xF
54 */
55#define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \
56 (_x) : \
57 (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) )
58
59#endif /* _ASM_SN_IO_H */
diff --git a/include/asm-mips/sn/ioc3.h b/include/asm-mips/sn/ioc3.h
deleted file mode 100644
index 099677774d71..000000000000
--- a/include/asm-mips/sn/ioc3.h
+++ /dev/null
@@ -1,663 +0,0 @@
1/*
2 * Copyright (C) 1999, 2000 Ralf Baechle
3 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
4 */
5#ifndef _IOC3_H
6#define _IOC3_H
7
8#include <linux/types.h>
9
10/* SUPERIO uart register map */
11typedef volatile struct ioc3_uartregs {
12 union {
13 volatile u8 rbr; /* read only, DLAB == 0 */
14 volatile u8 thr; /* write only, DLAB == 0 */
15 volatile u8 dll; /* DLAB == 1 */
16 } u1;
17 union {
18 volatile u8 ier; /* DLAB == 0 */
19 volatile u8 dlm; /* DLAB == 1 */
20 } u2;
21 union {
22 volatile u8 iir; /* read only */
23 volatile u8 fcr; /* write only */
24 } u3;
25 volatile u8 iu_lcr;
26 volatile u8 iu_mcr;
27 volatile u8 iu_lsr;
28 volatile u8 iu_msr;
29 volatile u8 iu_scr;
30} ioc3_uregs_t;
31
32#define iu_rbr u1.rbr
33#define iu_thr u1.thr
34#define iu_dll u1.dll
35#define iu_ier u2.ier
36#define iu_dlm u2.dlm
37#define iu_iir u3.iir
38#define iu_fcr u3.fcr
39
40struct ioc3_sioregs {
41 volatile u8 fill[0x141]; /* starts at 0x141 */
42
43 volatile u8 uartc;
44 volatile u8 kbdcg;
45
46 volatile u8 fill0[0x150 - 0x142 - 1];
47
48 volatile u8 pp_data;
49 volatile u8 pp_dsr;
50 volatile u8 pp_dcr;
51
52 volatile u8 fill1[0x158 - 0x152 - 1];
53
54 volatile u8 pp_fifa;
55 volatile u8 pp_cfgb;
56 volatile u8 pp_ecr;
57
58 volatile u8 fill2[0x168 - 0x15a - 1];
59
60 volatile u8 rtcad;
61 volatile u8 rtcdat;
62
63 volatile u8 fill3[0x170 - 0x169 - 1];
64
65 struct ioc3_uartregs uartb; /* 0x20170 */
66 struct ioc3_uartregs uarta; /* 0x20178 */
67};
68
69/* Register layout of IOC3 in configuration space. */
70struct ioc3 {
71 volatile u32 pad0[7]; /* 0x00000 */
72 volatile u32 sio_ir; /* 0x0001c */
73 volatile u32 sio_ies; /* 0x00020 */
74 volatile u32 sio_iec; /* 0x00024 */
75 volatile u32 sio_cr; /* 0x00028 */
76 volatile u32 int_out; /* 0x0002c */
77 volatile u32 mcr; /* 0x00030 */
78
79 /* General Purpose I/O registers */
80 volatile u32 gpcr_s; /* 0x00034 */
81 volatile u32 gpcr_c; /* 0x00038 */
82 volatile u32 gpdr; /* 0x0003c */
83 volatile u32 gppr_0; /* 0x00040 */
84 volatile u32 gppr_1; /* 0x00044 */
85 volatile u32 gppr_2; /* 0x00048 */
86 volatile u32 gppr_3; /* 0x0004c */
87 volatile u32 gppr_4; /* 0x00050 */
88 volatile u32 gppr_5; /* 0x00054 */
89 volatile u32 gppr_6; /* 0x00058 */
90 volatile u32 gppr_7; /* 0x0005c */
91 volatile u32 gppr_8; /* 0x00060 */
92 volatile u32 gppr_9; /* 0x00064 */
93 volatile u32 gppr_10; /* 0x00068 */
94 volatile u32 gppr_11; /* 0x0006c */
95 volatile u32 gppr_12; /* 0x00070 */
96 volatile u32 gppr_13; /* 0x00074 */
97 volatile u32 gppr_14; /* 0x00078 */
98 volatile u32 gppr_15; /* 0x0007c */
99
100 /* Parallel Port Registers */
101 volatile u32 ppbr_h_a; /* 0x00080 */
102 volatile u32 ppbr_l_a; /* 0x00084 */
103 volatile u32 ppcr_a; /* 0x00088 */
104 volatile u32 ppcr; /* 0x0008c */
105 volatile u32 ppbr_h_b; /* 0x00090 */
106 volatile u32 ppbr_l_b; /* 0x00094 */
107 volatile u32 ppcr_b; /* 0x00098 */
108
109 /* Keyboard and Mouse Registers */
110 volatile u32 km_csr; /* 0x0009c */
111 volatile u32 k_rd; /* 0x000a0 */
112 volatile u32 m_rd; /* 0x000a4 */
113 volatile u32 k_wd; /* 0x000a8 */
114 volatile u32 m_wd; /* 0x000ac */
115
116 /* Serial Port Registers */
117 volatile u32 sbbr_h; /* 0x000b0 */
118 volatile u32 sbbr_l; /* 0x000b4 */
119 volatile u32 sscr_a; /* 0x000b8 */
120 volatile u32 stpir_a; /* 0x000bc */
121 volatile u32 stcir_a; /* 0x000c0 */
122 volatile u32 srpir_a; /* 0x000c4 */
123 volatile u32 srcir_a; /* 0x000c8 */
124 volatile u32 srtr_a; /* 0x000cc */
125 volatile u32 shadow_a; /* 0x000d0 */
126 volatile u32 sscr_b; /* 0x000d4 */
127 volatile u32 stpir_b; /* 0x000d8 */
128 volatile u32 stcir_b; /* 0x000dc */
129 volatile u32 srpir_b; /* 0x000e0 */
130 volatile u32 srcir_b; /* 0x000e4 */
131 volatile u32 srtr_b; /* 0x000e8 */
132 volatile u32 shadow_b; /* 0x000ec */
133
134 /* Ethernet Registers */
135 volatile u32 emcr; /* 0x000f0 */
136 volatile u32 eisr; /* 0x000f4 */
137 volatile u32 eier; /* 0x000f8 */
138 volatile u32 ercsr; /* 0x000fc */
139 volatile u32 erbr_h; /* 0x00100 */
140 volatile u32 erbr_l; /* 0x00104 */
141 volatile u32 erbar; /* 0x00108 */
142 volatile u32 ercir; /* 0x0010c */
143 volatile u32 erpir; /* 0x00110 */
144 volatile u32 ertr; /* 0x00114 */
145 volatile u32 etcsr; /* 0x00118 */
146 volatile u32 ersr; /* 0x0011c */
147 volatile u32 etcdc; /* 0x00120 */
148 volatile u32 ebir; /* 0x00124 */
149 volatile u32 etbr_h; /* 0x00128 */
150 volatile u32 etbr_l; /* 0x0012c */
151 volatile u32 etcir; /* 0x00130 */
152 volatile u32 etpir; /* 0x00134 */
153 volatile u32 emar_h; /* 0x00138 */
154 volatile u32 emar_l; /* 0x0013c */
155 volatile u32 ehar_h; /* 0x00140 */
156 volatile u32 ehar_l; /* 0x00144 */
157 volatile u32 micr; /* 0x00148 */
158 volatile u32 midr_r; /* 0x0014c */
159 volatile u32 midr_w; /* 0x00150 */
160 volatile u32 pad1[(0x20000 - 0x00154) / 4];
161
162 /* SuperIO Registers XXX */
163 struct ioc3_sioregs sregs; /* 0x20000 */
164 volatile u32 pad2[(0x40000 - 0x20180) / 4];
165
166 /* SSRAM Diagnostic Access */
167 volatile u32 ssram[(0x80000 - 0x40000) / 4];
168
169 /* Bytebus device offsets
170 0x80000 - Access to the generic devices selected with DEV0
171 0x9FFFF bytebus DEV_SEL_0
172 0xA0000 - Access to the generic devices selected with DEV1
173 0xBFFFF bytebus DEV_SEL_1
174 0xC0000 - Access to the generic devices selected with DEV2
175 0xDFFFF bytebus DEV_SEL_2
176 0xE0000 - Access to the generic devices selected with DEV3
177 0xFFFFF bytebus DEV_SEL_3 */
178};
179
180/*
181 * Ethernet RX Buffer
182 */
183struct ioc3_erxbuf {
184 u32 w0; /* first word (valid,bcnt,cksum) */
185 u32 err; /* second word various errors */
186 /* next comes n bytes of padding */
187 /* then the received ethernet frame itself */
188};
189
190#define ERXBUF_IPCKSUM_MASK 0x0000ffff
191#define ERXBUF_BYTECNT_MASK 0x07ff0000
192#define ERXBUF_BYTECNT_SHIFT 16
193#define ERXBUF_V 0x80000000
194
195#define ERXBUF_CRCERR 0x00000001 /* aka RSV15 */
196#define ERXBUF_FRAMERR 0x00000002 /* aka RSV14 */
197#define ERXBUF_CODERR 0x00000004 /* aka RSV13 */
198#define ERXBUF_INVPREAMB 0x00000008 /* aka RSV18 */
199#define ERXBUF_LOLEN 0x00007000 /* aka RSV2_0 */
200#define ERXBUF_HILEN 0x03ff0000 /* aka RSV12_3 */
201#define ERXBUF_MULTICAST 0x04000000 /* aka RSV16 */
202#define ERXBUF_BROADCAST 0x08000000 /* aka RSV17 */
203#define ERXBUF_LONGEVENT 0x10000000 /* aka RSV19 */
204#define ERXBUF_BADPKT 0x20000000 /* aka RSV20 */
205#define ERXBUF_GOODPKT 0x40000000 /* aka RSV21 */
206#define ERXBUF_CARRIER 0x80000000 /* aka RSV22 */
207
208/*
209 * Ethernet TX Descriptor
210 */
211#define ETXD_DATALEN 104
212struct ioc3_etxd {
213 u32 cmd; /* command field */
214 u32 bufcnt; /* buffer counts field */
215 u64 p1; /* buffer pointer 1 */
216 u64 p2; /* buffer pointer 2 */
217 u8 data[ETXD_DATALEN]; /* opt. tx data */
218};
219
220#define ETXD_BYTECNT_MASK 0x000007ff /* total byte count */
221#define ETXD_INTWHENDONE 0x00001000 /* intr when done */
222#define ETXD_D0V 0x00010000 /* data 0 valid */
223#define ETXD_B1V 0x00020000 /* buf 1 valid */
224#define ETXD_B2V 0x00040000 /* buf 2 valid */
225#define ETXD_DOCHECKSUM 0x00080000 /* insert ip cksum */
226#define ETXD_CHKOFF_MASK 0x07f00000 /* cksum byte offset */
227#define ETXD_CHKOFF_SHIFT 20
228
229#define ETXD_D0CNT_MASK 0x0000007f
230#define ETXD_B1CNT_MASK 0x0007ff00
231#define ETXD_B1CNT_SHIFT 8
232#define ETXD_B2CNT_MASK 0x7ff00000
233#define ETXD_B2CNT_SHIFT 20
234
235/*
236 * Bytebus device space
237 */
238#define IOC3_BYTEBUS_DEV0 0x80000L
239#define IOC3_BYTEBUS_DEV1 0xa0000L
240#define IOC3_BYTEBUS_DEV2 0xc0000L
241#define IOC3_BYTEBUS_DEV3 0xe0000L
242
243/* ------------------------------------------------------------------------- */
244
245/* Superio Registers (PIO Access) */
246#define IOC3_SIO_BASE 0x20000
247#define IOC3_SIO_UARTC (IOC3_SIO_BASE+0x141) /* UART Config */
248#define IOC3_SIO_KBDCG (IOC3_SIO_BASE+0x142) /* KBD Config */
249#define IOC3_SIO_PP_BASE (IOC3_SIO_BASE+PP_BASE) /* Parallel Port */
250#define IOC3_SIO_RTC_BASE (IOC3_SIO_BASE+0x168) /* Real Time Clock */
251#define IOC3_SIO_UB_BASE (IOC3_SIO_BASE+UARTB_BASE) /* UART B */
252#define IOC3_SIO_UA_BASE (IOC3_SIO_BASE+UARTA_BASE) /* UART A */
253
254/* SSRAM Diagnostic Access */
255#define IOC3_SSRAM IOC3_RAM_OFF /* base of SSRAM diagnostic access */
256#define IOC3_SSRAM_LEN 0x40000 /* 256kb (address space size, may not be fully populated) */
257#define IOC3_SSRAM_DM 0x0000ffff /* data mask */
258#define IOC3_SSRAM_PM 0x00010000 /* parity mask */
259
260/* bitmasks for PCI_SCR */
261#define PCI_SCR_PAR_RESP_EN 0x00000040 /* enb PCI parity checking */
262#define PCI_SCR_SERR_EN 0x00000100 /* enable the SERR# driver */
263#define PCI_SCR_DROP_MODE_EN 0x00008000 /* drop pios on parity err */
264#define PCI_SCR_RX_SERR (0x1 << 16)
265#define PCI_SCR_DROP_MODE (0x1 << 17)
266#define PCI_SCR_SIG_PAR_ERR (0x1 << 24)
267#define PCI_SCR_SIG_TAR_ABRT (0x1 << 27)
268#define PCI_SCR_RX_TAR_ABRT (0x1 << 28)
269#define PCI_SCR_SIG_MST_ABRT (0x1 << 29)
270#define PCI_SCR_SIG_SERR (0x1 << 30)
271#define PCI_SCR_PAR_ERR (0x1 << 31)
272
273/* bitmasks for IOC3_KM_CSR */
274#define KM_CSR_K_WRT_PEND 0x00000001 /* kbd port xmitting or resetting */
275#define KM_CSR_M_WRT_PEND 0x00000002 /* mouse port xmitting or resetting */
276#define KM_CSR_K_LCB 0x00000004 /* Line Cntrl Bit for last KBD write */
277#define KM_CSR_M_LCB 0x00000008 /* same for mouse */
278#define KM_CSR_K_DATA 0x00000010 /* state of kbd data line */
279#define KM_CSR_K_CLK 0x00000020 /* state of kbd clock line */
280#define KM_CSR_K_PULL_DATA 0x00000040 /* pull kbd data line low */
281#define KM_CSR_K_PULL_CLK 0x00000080 /* pull kbd clock line low */
282#define KM_CSR_M_DATA 0x00000100 /* state of ms data line */
283#define KM_CSR_M_CLK 0x00000200 /* state of ms clock line */
284#define KM_CSR_M_PULL_DATA 0x00000400 /* pull ms data line low */
285#define KM_CSR_M_PULL_CLK 0x00000800 /* pull ms clock line low */
286#define KM_CSR_EMM_MODE 0x00001000 /* emulation mode */
287#define KM_CSR_SIM_MODE 0x00002000 /* clock X8 */
288#define KM_CSR_K_SM_IDLE 0x00004000 /* Keyboard is idle */
289#define KM_CSR_M_SM_IDLE 0x00008000 /* Mouse is idle */
290#define KM_CSR_K_TO 0x00010000 /* Keyboard trying to send/receive */
291#define KM_CSR_M_TO 0x00020000 /* Mouse trying to send/receive */
292#define KM_CSR_K_TO_EN 0x00040000 /* KM_CSR_K_TO + KM_CSR_K_TO_EN = cause
293 SIO_IR to assert */
294#define KM_CSR_M_TO_EN 0x00080000 /* KM_CSR_M_TO + KM_CSR_M_TO_EN = cause
295 SIO_IR to assert */
296#define KM_CSR_K_CLAMP_ONE 0x00100000 /* Pull K_CLK low after rec. one char */
297#define KM_CSR_M_CLAMP_ONE 0x00200000 /* Pull M_CLK low after rec. one char */
298#define KM_CSR_K_CLAMP_THREE 0x00400000 /* Pull K_CLK low after rec. three chars */
299#define KM_CSR_M_CLAMP_THREE 0x00800000 /* Pull M_CLK low after rec. three char */
300
301/* bitmasks for IOC3_K_RD and IOC3_M_RD */
302#define KM_RD_DATA_2 0x000000ff /* 3rd char recvd since last read */
303#define KM_RD_DATA_2_SHIFT 0
304#define KM_RD_DATA_1 0x0000ff00 /* 2nd char recvd since last read */
305#define KM_RD_DATA_1_SHIFT 8
306#define KM_RD_DATA_0 0x00ff0000 /* 1st char recvd since last read */
307#define KM_RD_DATA_0_SHIFT 16
308#define KM_RD_FRAME_ERR_2 0x01000000 /* framing or parity error in byte 2 */
309#define KM_RD_FRAME_ERR_1 0x02000000 /* same for byte 1 */
310#define KM_RD_FRAME_ERR_0 0x04000000 /* same for byte 0 */
311
312#define KM_RD_KBD_MSE 0x08000000 /* 0 if from kbd, 1 if from mouse */
313#define KM_RD_OFLO 0x10000000 /* 4th char recvd before this read */
314#define KM_RD_VALID_2 0x20000000 /* DATA_2 valid */
315#define KM_RD_VALID_1 0x40000000 /* DATA_1 valid */
316#define KM_RD_VALID_0 0x80000000 /* DATA_0 valid */
317#define KM_RD_VALID_ALL (KM_RD_VALID_0|KM_RD_VALID_1|KM_RD_VALID_2)
318
319/* bitmasks for IOC3_K_WD & IOC3_M_WD */
320#define KM_WD_WRT_DATA 0x000000ff /* write to keyboard/mouse port */
321#define KM_WD_WRT_DATA_SHIFT 0
322
323/* bitmasks for serial RX status byte */
324#define RXSB_OVERRUN 0x01 /* char(s) lost */
325#define RXSB_PAR_ERR 0x02 /* parity error */
326#define RXSB_FRAME_ERR 0x04 /* framing error */
327#define RXSB_BREAK 0x08 /* break character */
328#define RXSB_CTS 0x10 /* state of CTS */
329#define RXSB_DCD 0x20 /* state of DCD */
330#define RXSB_MODEM_VALID 0x40 /* DCD, CTS and OVERRUN are valid */
331#define RXSB_DATA_VALID 0x80 /* data byte, FRAME_ERR PAR_ERR & BREAK valid */
332
333/* bitmasks for serial TX control byte */
334#define TXCB_INT_WHEN_DONE 0x20 /* interrupt after this byte is sent */
335#define TXCB_INVALID 0x00 /* byte is invalid */
336#define TXCB_VALID 0x40 /* byte is valid */
337#define TXCB_MCR 0x80 /* data<7:0> to modem control register */
338#define TXCB_DELAY 0xc0 /* delay data<7:0> mSec */
339
340/* bitmasks for IOC3_SBBR_L */
341#define SBBR_L_SIZE 0x00000001 /* 0 == 1KB rings, 1 == 4KB rings */
342#define SBBR_L_BASE 0xfffff000 /* lower serial ring base addr */
343
344/* bitmasks for IOC3_SSCR_<A:B> */
345#define SSCR_RX_THRESHOLD 0x000001ff /* hiwater mark */
346#define SSCR_TX_TIMER_BUSY 0x00010000 /* TX timer in progress */
347#define SSCR_HFC_EN 0x00020000 /* hardware flow control enabled */
348#define SSCR_RX_RING_DCD 0x00040000 /* post RX record on delta-DCD */
349#define SSCR_RX_RING_CTS 0x00080000 /* post RX record on delta-CTS */
350#define SSCR_HIGH_SPD 0x00100000 /* 4X speed */
351#define SSCR_DIAG 0x00200000 /* bypass clock divider for sim */
352#define SSCR_RX_DRAIN 0x08000000 /* drain RX buffer to memory */
353#define SSCR_DMA_EN 0x10000000 /* enable ring buffer DMA */
354#define SSCR_DMA_PAUSE 0x20000000 /* pause DMA */
355#define SSCR_PAUSE_STATE 0x40000000 /* sets when PAUSE takes effect */
356#define SSCR_RESET 0x80000000 /* reset DMA channels */
357
358/* all producer/comsumer pointers are the same bitfield */
359#define PROD_CONS_PTR_4K 0x00000ff8 /* for 4K buffers */
360#define PROD_CONS_PTR_1K 0x000003f8 /* for 1K buffers */
361#define PROD_CONS_PTR_OFF 3
362
363/* bitmasks for IOC3_SRCIR_<A:B> */
364#define SRCIR_ARM 0x80000000 /* arm RX timer */
365
366/* bitmasks for IOC3_SRPIR_<A:B> */
367#define SRPIR_BYTE_CNT 0x07000000 /* bytes in packer */
368#define SRPIR_BYTE_CNT_SHIFT 24
369
370/* bitmasks for IOC3_STCIR_<A:B> */
371#define STCIR_BYTE_CNT 0x0f000000 /* bytes in unpacker */
372#define STCIR_BYTE_CNT_SHIFT 24
373
374/* bitmasks for IOC3_SHADOW_<A:B> */
375#define SHADOW_DR 0x00000001 /* data ready */
376#define SHADOW_OE 0x00000002 /* overrun error */
377#define SHADOW_PE 0x00000004 /* parity error */
378#define SHADOW_FE 0x00000008 /* framing error */
379#define SHADOW_BI 0x00000010 /* break interrupt */
380#define SHADOW_THRE 0x00000020 /* transmit holding register empty */
381#define SHADOW_TEMT 0x00000040 /* transmit shift register empty */
382#define SHADOW_RFCE 0x00000080 /* char in RX fifo has an error */
383#define SHADOW_DCTS 0x00010000 /* delta clear to send */
384#define SHADOW_DDCD 0x00080000 /* delta data carrier detect */
385#define SHADOW_CTS 0x00100000 /* clear to send */
386#define SHADOW_DCD 0x00800000 /* data carrier detect */
387#define SHADOW_DTR 0x01000000 /* data terminal ready */
388#define SHADOW_RTS 0x02000000 /* request to send */
389#define SHADOW_OUT1 0x04000000 /* 16550 OUT1 bit */
390#define SHADOW_OUT2 0x08000000 /* 16550 OUT2 bit */
391#define SHADOW_LOOP 0x10000000 /* loopback enabled */
392
393/* bitmasks for IOC3_SRTR_<A:B> */
394#define SRTR_CNT 0x00000fff /* reload value for RX timer */
395#define SRTR_CNT_VAL 0x0fff0000 /* current value of RX timer */
396#define SRTR_CNT_VAL_SHIFT 16
397#define SRTR_HZ 16000 /* SRTR clock frequency */
398
399/* bitmasks for IOC3_SIO_IR, IOC3_SIO_IEC and IOC3_SIO_IES */
400#define SIO_IR_SA_TX_MT 0x00000001 /* Serial port A TX empty */
401#define SIO_IR_SA_RX_FULL 0x00000002 /* port A RX buf full */
402#define SIO_IR_SA_RX_HIGH 0x00000004 /* port A RX hiwat */
403#define SIO_IR_SA_RX_TIMER 0x00000008 /* port A RX timeout */
404#define SIO_IR_SA_DELTA_DCD 0x00000010 /* port A delta DCD */
405#define SIO_IR_SA_DELTA_CTS 0x00000020 /* port A delta CTS */
406#define SIO_IR_SA_INT 0x00000040 /* port A pass-thru intr */
407#define SIO_IR_SA_TX_EXPLICIT 0x00000080 /* port A explicit TX thru */
408#define SIO_IR_SA_MEMERR 0x00000100 /* port A PCI error */
409#define SIO_IR_SB_TX_MT 0x00000200 /* */
410#define SIO_IR_SB_RX_FULL 0x00000400 /* */
411#define SIO_IR_SB_RX_HIGH 0x00000800 /* */
412#define SIO_IR_SB_RX_TIMER 0x00001000 /* */
413#define SIO_IR_SB_DELTA_DCD 0x00002000 /* */
414#define SIO_IR_SB_DELTA_CTS 0x00004000 /* */
415#define SIO_IR_SB_INT 0x00008000 /* */
416#define SIO_IR_SB_TX_EXPLICIT 0x00010000 /* */
417#define SIO_IR_SB_MEMERR 0x00020000 /* */
418#define SIO_IR_PP_INT 0x00040000 /* P port pass-thru intr */
419#define SIO_IR_PP_INTA 0x00080000 /* PP context A thru */
420#define SIO_IR_PP_INTB 0x00100000 /* PP context B thru */
421#define SIO_IR_PP_MEMERR 0x00200000 /* PP PCI error */
422#define SIO_IR_KBD_INT 0x00400000 /* kbd/mouse intr */
423#define SIO_IR_RT_INT 0x08000000 /* RT output pulse */
424#define SIO_IR_GEN_INT1 0x10000000 /* RT input pulse */
425#define SIO_IR_GEN_INT_SHIFT 28
426
427/* per device interrupt masks */
428#define SIO_IR_SA (SIO_IR_SA_TX_MT | SIO_IR_SA_RX_FULL | \
429 SIO_IR_SA_RX_HIGH | SIO_IR_SA_RX_TIMER | \
430 SIO_IR_SA_DELTA_DCD | SIO_IR_SA_DELTA_CTS | \
431 SIO_IR_SA_INT | SIO_IR_SA_TX_EXPLICIT | \
432 SIO_IR_SA_MEMERR)
433#define SIO_IR_SB (SIO_IR_SB_TX_MT | SIO_IR_SB_RX_FULL | \
434 SIO_IR_SB_RX_HIGH | SIO_IR_SB_RX_TIMER | \
435 SIO_IR_SB_DELTA_DCD | SIO_IR_SB_DELTA_CTS | \
436 SIO_IR_SB_INT | SIO_IR_SB_TX_EXPLICIT | \
437 SIO_IR_SB_MEMERR)
438#define SIO_IR_PP (SIO_IR_PP_INT | SIO_IR_PP_INTA | \
439 SIO_IR_PP_INTB | SIO_IR_PP_MEMERR)
440#define SIO_IR_RT (SIO_IR_RT_INT | SIO_IR_GEN_INT1)
441
442/* macro to load pending interrupts */
443#define IOC3_PENDING_INTRS(mem) (PCI_INW(&((mem)->sio_ir)) & \
444 PCI_INW(&((mem)->sio_ies_ro)))
445
446/* bitmasks for SIO_CR */
447#define SIO_CR_SIO_RESET 0x00000001 /* reset the SIO */
448#define SIO_CR_SER_A_BASE 0x000000fe /* DMA poll addr port A */
449#define SIO_CR_SER_A_BASE_SHIFT 1
450#define SIO_CR_SER_B_BASE 0x00007f00 /* DMA poll addr port B */
451#define SIO_CR_SER_B_BASE_SHIFT 8
452#define SIO_SR_CMD_PULSE 0x00078000 /* byte bus strobe length */
453#define SIO_CR_CMD_PULSE_SHIFT 15
454#define SIO_CR_ARB_DIAG 0x00380000 /* cur !enet PCI requet (ro) */
455#define SIO_CR_ARB_DIAG_TXA 0x00000000
456#define SIO_CR_ARB_DIAG_RXA 0x00080000
457#define SIO_CR_ARB_DIAG_TXB 0x00100000
458#define SIO_CR_ARB_DIAG_RXB 0x00180000
459#define SIO_CR_ARB_DIAG_PP 0x00200000
460#define SIO_CR_ARB_DIAG_IDLE 0x00400000 /* 0 -> active request (ro) */
461
462/* bitmasks for INT_OUT */
463#define INT_OUT_COUNT 0x0000ffff /* pulse interval timer */
464#define INT_OUT_MODE 0x00070000 /* mode mask */
465#define INT_OUT_MODE_0 0x00000000 /* set output to 0 */
466#define INT_OUT_MODE_1 0x00040000 /* set output to 1 */
467#define INT_OUT_MODE_1PULSE 0x00050000 /* send 1 pulse */
468#define INT_OUT_MODE_PULSES 0x00060000 /* send 1 pulse every interval */
469#define INT_OUT_MODE_SQW 0x00070000 /* toggle output every interval */
470#define INT_OUT_DIAG 0x40000000 /* diag mode */
471#define INT_OUT_INT_OUT 0x80000000 /* current state of INT_OUT */
472
473/* time constants for INT_OUT */
474#define INT_OUT_NS_PER_TICK (30 * 260) /* 30 ns PCI clock, divisor=260 */
475#define INT_OUT_TICKS_PER_PULSE 3 /* outgoing pulse lasts 3 ticks */
476#define INT_OUT_US_TO_COUNT(x) /* convert uS to a count value */ \
477 (((x) * 10 + INT_OUT_NS_PER_TICK / 200) * \
478 100 / INT_OUT_NS_PER_TICK - 1)
479#define INT_OUT_COUNT_TO_US(x) /* convert count value to uS */ \
480 (((x) + 1) * INT_OUT_NS_PER_TICK / 1000)
481#define INT_OUT_MIN_TICKS 3 /* min period is width of pulse in "ticks" */
482#define INT_OUT_MAX_TICKS INT_OUT_COUNT /* largest possible count */
483
484/* bitmasks for GPCR */
485#define GPCR_DIR 0x000000ff /* tristate pin input or output */
486#define GPCR_DIR_PIN(x) (1<<(x)) /* access one of the DIR bits */
487#define GPCR_EDGE 0x000f0000 /* extint edge or level sensitive */
488#define GPCR_EDGE_PIN(x) (1<<((x)+15)) /* access one of the EDGE bits */
489
490/* values for GPCR */
491#define GPCR_INT_OUT_EN 0x00100000 /* enable INT_OUT to pin 0 */
492#define GPCR_MLAN_EN 0x00200000 /* enable MCR to pin 8 */
493#define GPCR_DIR_SERA_XCVR 0x00000080 /* Port A Transceiver select enable */
494#define GPCR_DIR_SERB_XCVR 0x00000040 /* Port B Transceiver select enable */
495#define GPCR_DIR_PHY_RST 0x00000020 /* ethernet PHY reset enable */
496
497/* defs for some of the generic I/O pins */
498#define GPCR_PHY_RESET 0x20 /* pin is output to PHY reset */
499#define GPCR_UARTB_MODESEL 0x40 /* pin is output to port B mode sel */
500#define GPCR_UARTA_MODESEL 0x80 /* pin is output to port A mode sel */
501
502#define GPPR_PHY_RESET_PIN 5 /* GIO pin controlling phy reset */
503#define GPPR_UARTB_MODESEL_PIN 6 /* GIO pin controlling uart b mode select */
504#define GPPR_UARTA_MODESEL_PIN 7 /* GIO pin controlling uart a mode select */
505
506#define EMCR_DUPLEX 0x00000001
507#define EMCR_PROMISC 0x00000002
508#define EMCR_PADEN 0x00000004
509#define EMCR_RXOFF_MASK 0x000001f8
510#define EMCR_RXOFF_SHIFT 3
511#define EMCR_RAMPAR 0x00000200
512#define EMCR_BADPAR 0x00000800
513#define EMCR_BUFSIZ 0x00001000
514#define EMCR_TXDMAEN 0x00002000
515#define EMCR_TXEN 0x00004000
516#define EMCR_RXDMAEN 0x00008000
517#define EMCR_RXEN 0x00010000
518#define EMCR_LOOPBACK 0x00020000
519#define EMCR_ARB_DIAG 0x001c0000
520#define EMCR_ARB_DIAG_IDLE 0x00200000
521#define EMCR_RST 0x80000000
522
523#define EISR_RXTIMERINT 0x00000001
524#define EISR_RXTHRESHINT 0x00000002
525#define EISR_RXOFLO 0x00000004
526#define EISR_RXBUFOFLO 0x00000008
527#define EISR_RXMEMERR 0x00000010
528#define EISR_RXPARERR 0x00000020
529#define EISR_TXEMPTY 0x00010000
530#define EISR_TXRTRY 0x00020000
531#define EISR_TXEXDEF 0x00040000
532#define EISR_TXLCOL 0x00080000
533#define EISR_TXGIANT 0x00100000
534#define EISR_TXBUFUFLO 0x00200000
535#define EISR_TXEXPLICIT 0x00400000
536#define EISR_TXCOLLWRAP 0x00800000
537#define EISR_TXDEFERWRAP 0x01000000
538#define EISR_TXMEMERR 0x02000000
539#define EISR_TXPARERR 0x04000000
540
541#define ERCSR_THRESH_MASK 0x000001ff /* enet RX threshold */
542#define ERCSR_RX_TMR 0x40000000 /* simulation only */
543#define ERCSR_DIAG_OFLO 0x80000000 /* simulation only */
544
545#define ERBR_ALIGNMENT 4096
546#define ERBR_L_RXRINGBASE_MASK 0xfffff000
547
548#define ERBAR_BARRIER_BIT 0x0100
549#define ERBAR_RXBARR_MASK 0xffff0000
550#define ERBAR_RXBARR_SHIFT 16
551
552#define ERCIR_RXCONSUME_MASK 0x00000fff
553
554#define ERPIR_RXPRODUCE_MASK 0x00000fff
555#define ERPIR_ARM 0x80000000
556
557#define ERTR_CNT_MASK 0x000007ff
558
559#define ETCSR_IPGT_MASK 0x0000007f
560#define ETCSR_IPGR1_MASK 0x00007f00
561#define ETCSR_IPGR1_SHIFT 8
562#define ETCSR_IPGR2_MASK 0x007f0000
563#define ETCSR_IPGR2_SHIFT 16
564#define ETCSR_NOTXCLK 0x80000000
565
566#define ETCDC_COLLCNT_MASK 0x0000ffff
567#define ETCDC_DEFERCNT_MASK 0xffff0000
568#define ETCDC_DEFERCNT_SHIFT 16
569
570#define ETBR_ALIGNMENT (64*1024)
571#define ETBR_L_RINGSZ_MASK 0x00000001
572#define ETBR_L_RINGSZ128 0
573#define ETBR_L_RINGSZ512 1
574#define ETBR_L_TXRINGBASE_MASK 0xffffc000
575
576#define ETCIR_TXCONSUME_MASK 0x0000ffff
577#define ETCIR_IDLE 0x80000000
578
579#define ETPIR_TXPRODUCE_MASK 0x0000ffff
580
581#define EBIR_TXBUFPROD_MASK 0x0000001f
582#define EBIR_TXBUFCONS_MASK 0x00001f00
583#define EBIR_TXBUFCONS_SHIFT 8
584#define EBIR_RXBUFPROD_MASK 0x007fc000
585#define EBIR_RXBUFPROD_SHIFT 14
586#define EBIR_RXBUFCONS_MASK 0xff800000
587#define EBIR_RXBUFCONS_SHIFT 23
588
589#define MICR_REGADDR_MASK 0x0000001f
590#define MICR_PHYADDR_MASK 0x000003e0
591#define MICR_PHYADDR_SHIFT 5
592#define MICR_READTRIG 0x00000400
593#define MICR_BUSY 0x00000800
594
595#define MIDR_DATA_MASK 0x0000ffff
596
597#define ERXBUF_IPCKSUM_MASK 0x0000ffff
598#define ERXBUF_BYTECNT_MASK 0x07ff0000
599#define ERXBUF_BYTECNT_SHIFT 16
600#define ERXBUF_V 0x80000000
601
602#define ERXBUF_CRCERR 0x00000001 /* aka RSV15 */
603#define ERXBUF_FRAMERR 0x00000002 /* aka RSV14 */
604#define ERXBUF_CODERR 0x00000004 /* aka RSV13 */
605#define ERXBUF_INVPREAMB 0x00000008 /* aka RSV18 */
606#define ERXBUF_LOLEN 0x00007000 /* aka RSV2_0 */
607#define ERXBUF_HILEN 0x03ff0000 /* aka RSV12_3 */
608#define ERXBUF_MULTICAST 0x04000000 /* aka RSV16 */
609#define ERXBUF_BROADCAST 0x08000000 /* aka RSV17 */
610#define ERXBUF_LONGEVENT 0x10000000 /* aka RSV19 */
611#define ERXBUF_BADPKT 0x20000000 /* aka RSV20 */
612#define ERXBUF_GOODPKT 0x40000000 /* aka RSV21 */
613#define ERXBUF_CARRIER 0x80000000 /* aka RSV22 */
614
615#define ETXD_BYTECNT_MASK 0x000007ff /* total byte count */
616#define ETXD_INTWHENDONE 0x00001000 /* intr when done */
617#define ETXD_D0V 0x00010000 /* data 0 valid */
618#define ETXD_B1V 0x00020000 /* buf 1 valid */
619#define ETXD_B2V 0x00040000 /* buf 2 valid */
620#define ETXD_DOCHECKSUM 0x00080000 /* insert ip cksum */
621#define ETXD_CHKOFF_MASK 0x07f00000 /* cksum byte offset */
622#define ETXD_CHKOFF_SHIFT 20
623
624#define ETXD_D0CNT_MASK 0x0000007f
625#define ETXD_B1CNT_MASK 0x0007ff00
626#define ETXD_B1CNT_SHIFT 8
627#define ETXD_B2CNT_MASK 0x7ff00000
628#define ETXD_B2CNT_SHIFT 20
629
630typedef enum ioc3_subdevs_e {
631 ioc3_subdev_ether,
632 ioc3_subdev_generic,
633 ioc3_subdev_nic,
634 ioc3_subdev_kbms,
635 ioc3_subdev_ttya,
636 ioc3_subdev_ttyb,
637 ioc3_subdev_ecpp,
638 ioc3_subdev_rt,
639 ioc3_nsubdevs
640} ioc3_subdev_t;
641
642/* subdevice disable bits,
643 * from the standard INFO_LBL_SUBDEVS
644 */
645#define IOC3_SDB_ETHER (1<<ioc3_subdev_ether)
646#define IOC3_SDB_GENERIC (1<<ioc3_subdev_generic)
647#define IOC3_SDB_NIC (1<<ioc3_subdev_nic)
648#define IOC3_SDB_KBMS (1<<ioc3_subdev_kbms)
649#define IOC3_SDB_TTYA (1<<ioc3_subdev_ttya)
650#define IOC3_SDB_TTYB (1<<ioc3_subdev_ttyb)
651#define IOC3_SDB_ECPP (1<<ioc3_subdev_ecpp)
652#define IOC3_SDB_RT (1<<ioc3_subdev_rt)
653
654#define IOC3_ALL_SUBDEVS ((1<<ioc3_nsubdevs)-1)
655
656#define IOC3_SDB_SERIAL (IOC3_SDB_TTYA|IOC3_SDB_TTYB)
657
658#define IOC3_STD_SUBDEVS IOC3_ALL_SUBDEVS
659
660#define IOC3_INTA_SUBDEVS IOC3_SDB_ETHER
661#define IOC3_INTB_SUBDEVS (IOC3_SDB_GENERIC|IOC3_SDB_KBMS|IOC3_SDB_SERIAL|IOC3_SDB_ECPP|IOC3_SDB_RT)
662
663#endif /* _IOC3_H */
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h
deleted file mode 100644
index 96cfd2ab1bcd..000000000000
--- a/include/asm-mips/sn/klconfig.h
+++ /dev/null
@@ -1,898 +0,0 @@
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 * Derived from IRIX <sys/SN/klconfig.h>.
7 *
8 * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc.
9 * Copyright (C) 1999, 2000 by Ralf Baechle
10 */
11#ifndef _ASM_SN_KLCONFIG_H
12#define _ASM_SN_KLCONFIG_H
13
14/*
15 * The KLCONFIG structures store info about the various BOARDs found
16 * during Hardware Discovery. In addition, it stores info about the
17 * components found on the BOARDs.
18 */
19
20/*
21 * WARNING:
22 * Certain assembly language routines (notably xxxxx.s) in the IP27PROM
23 * will depend on the format of the data structures in this file. In
24 * most cases, rearranging the fields can seriously break things.
25 * Adding fields in the beginning or middle can also break things.
26 * Add fields if necessary, to the end of a struct in such a way
27 * that offsets of existing fields do not change.
28 */
29
30#include <linux/types.h>
31#include <asm/sn/types.h>
32
33#if defined(CONFIG_SGI_IP27)
34
35#include <asm/sn/sn0/addrs.h>
36//#include <sys/SN/router.h>
37// XXX Stolen from <sys/SN/router.h>:
38#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */
39#include <asm/sn/fru.h>
40//#include <sys/graph.h>
41//#include <sys/xtalk/xbow.h>
42
43#elif defined(CONFIG_SGI_IP35)
44
45#include <asm/sn/sn1/addrs.h>
46#include <sys/sn/router.h>
47#include <sys/graph.h>
48#include <asm/xtalk/xbow.h>
49
50#endif /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
51
52#if defined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP35)
53#include <asm/sn/agent.h>
54#include <asm/fw/arc/types.h>
55#include <asm/fw/arc/hinv.h>
56#if defined(CONFIG_SGI_IP35)
57// The hack file has to be before vector and after sn0_fru....
58#include <asm/hack.h>
59#include <asm/sn/vector.h>
60#include <asm/xtalk/xtalk.h>
61#endif /* CONFIG_SGI_IP35 */
62#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */
63
64typedef u64 nic_t;
65
66#define KLCFGINFO_MAGIC 0xbeedbabe
67
68typedef s32 klconf_off_t;
69
70/*
71 * Some IMPORTANT OFFSETS. These are the offsets on all NODES.
72 */
73#define MAX_MODULE_ID 255
74#define SIZE_PAD 4096 /* 4k padding for structures */
75/*
76 * 1 NODE brd, 2 Router brd (1 8p, 1 meta), 6 Widgets,
77 * 2 Midplanes assuming no pci card cages
78 */
79#define MAX_SLOTS_PER_NODE (1 + 2 + 6 + 2)
80
81/* XXX if each node is guranteed to have some memory */
82
83#define MAX_PCI_DEVS 8
84
85/* lboard_t->brd_flags fields */
86/* All bits in this field are currently used. Try the pad fields if
87 you need more flag bits */
88
89#define ENABLE_BOARD 0x01
90#define FAILED_BOARD 0x02
91#define DUPLICATE_BOARD 0x04 /* Boards like midplanes/routers which
92 are discovered twice. Use one of them */
93#define VISITED_BOARD 0x08 /* Used for compact hub numbering. */
94#define LOCAL_MASTER_IO6 0x10 /* master io6 for that node */
95#define GLOBAL_MASTER_IO6 0x20
96#define THIRD_NIC_PRESENT 0x40 /* for future use */
97#define SECOND_NIC_PRESENT 0x80 /* addons like MIO are present */
98
99/* klinfo->flags fields */
100
101#define KLINFO_ENABLE 0x01 /* This component is enabled */
102#define KLINFO_FAILED 0x02 /* This component failed */
103#define KLINFO_DEVICE 0x04 /* This component is a device */
104#define KLINFO_VISITED 0x08 /* This component has been visited */
105#define KLINFO_CONTROLLER 0x10 /* This component is a device controller */
106#define KLINFO_INSTALL 0x20 /* Install a driver */
107#define KLINFO_HEADLESS 0x40 /* Headless (or hubless) component */
108#define IS_CONSOLE_IOC3(i) ((((klinfo_t *)i)->flags) & KLINFO_INSTALL)
109
110#define GB2 0x80000000
111
112#define MAX_RSV_PTRS 32
113
114/* Structures to manage various data storage areas */
115/* The numbers must be contiguous since the array index i
116 is used in the code to allocate various areas.
117*/
118
119#define BOARD_STRUCT 0
120#define COMPONENT_STRUCT 1
121#define ERRINFO_STRUCT 2
122#define KLMALLOC_TYPE_MAX (ERRINFO_STRUCT + 1)
123#define DEVICE_STRUCT 3
124
125
126typedef struct console_s {
127 unsigned long uart_base;
128 unsigned long config_base;
129 unsigned long memory_base;
130 short baud;
131 short flag;
132 int type;
133 nasid_t nasid;
134 char wid;
135 char npci;
136 nic_t baseio_nic;
137} console_t;
138
139typedef struct klc_malloc_hdr {
140 klconf_off_t km_base;
141 klconf_off_t km_limit;
142 klconf_off_t km_current;
143} klc_malloc_hdr_t;
144
145/* Functions/macros needed to use this structure */
146
147typedef struct kl_config_hdr {
148 u64 ch_magic; /* set this to KLCFGINFO_MAGIC */
149 u32 ch_version; /* structure version number */
150 klconf_off_t ch_malloc_hdr_off; /* offset of ch_malloc_hdr */
151 klconf_off_t ch_cons_off; /* offset of ch_cons */
152 klconf_off_t ch_board_info; /* the link list of boards */
153 console_t ch_cons_info; /* address info of the console */
154 klc_malloc_hdr_t ch_malloc_hdr[KLMALLOC_TYPE_MAX];
155 confidence_t ch_sw_belief; /* confidence that software is bad*/
156 confidence_t ch_sn0net_belief; /* confidence that sn0net is bad */
157} kl_config_hdr_t;
158
159
160#define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid)))
161#define KL_CONFIG_INFO_OFFSET(_nasid) \
162 (KL_CONFIG_HDR(_nasid)->ch_board_info)
163#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \
164 (KL_CONFIG_HDR(_nasid)->ch_board_info = (_off))
165
166#define KL_CONFIG_INFO(_nasid) \
167 (lboard_t *)((KL_CONFIG_HDR(_nasid)->ch_board_info) ? \
168 NODE_OFFSET_TO_K1((_nasid), KL_CONFIG_HDR(_nasid)->ch_board_info) : \
169 0)
170#define KL_CONFIG_MAGIC(_nasid) (KL_CONFIG_HDR(_nasid)->ch_magic)
171
172#define KL_CONFIG_CHECK_MAGIC(_nasid) \
173 (KL_CONFIG_HDR(_nasid)->ch_magic == KLCFGINFO_MAGIC)
174
175#define KL_CONFIG_HDR_INIT_MAGIC(_nasid) \
176 (KL_CONFIG_HDR(_nasid)->ch_magic = KLCFGINFO_MAGIC)
177
178/* --- New Macros for the changed kl_config_hdr_t structure --- */
179
180#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
181 ((unsigned long)_k + (_k->ch_malloc_hdr_off)))
182
183#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
184
185#define PTR_CH_CONS_INFO(_k) ((console_t *)\
186 ((unsigned long)_k + (_k->ch_cons_off)))
187
188#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
189
190/* ------------------------------------------------------------- */
191
192#define KL_CONFIG_INFO_START(_nasid) \
193 (klconf_off_t)(KLCONFIG_OFFSET(_nasid) + sizeof(kl_config_hdr_t))
194
195#define KL_CONFIG_BOARD_NASID(_brd) ((_brd)->brd_nasid)
196#define KL_CONFIG_BOARD_SET_NEXT(_brd, _off) ((_brd)->brd_next = (_off))
197
198#define KL_CONFIG_DUPLICATE_BOARD(_brd) ((_brd)->brd_flags & DUPLICATE_BOARD)
199
200#define XBOW_PORT_TYPE_HUB(_xbowp, _link) \
201 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_HUB)
202#define XBOW_PORT_TYPE_IO(_xbowp, _link) \
203 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_IO)
204
205#define XBOW_PORT_IS_ENABLED(_xbowp, _link) \
206 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_ENABLE)
207#define XBOW_PORT_NASID(_xbowp, _link) \
208 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_nasid)
209
210#define XBOW_PORT_IO 0x1
211#define XBOW_PORT_HUB 0x2
212#define XBOW_PORT_ENABLE 0x4
213
214#define SN0_PORT_FENCE_SHFT 0
215#define SN0_PORT_FENCE_MASK (1 << SN0_PORT_FENCE_SHFT)
216
217/*
218 * The KLCONFIG area is organized as a LINKED LIST of BOARDs. A BOARD
219 * can be either 'LOCAL' or 'REMOTE'. LOCAL means it is attached to
220 * the LOCAL/current NODE. REMOTE means it is attached to a different
221 * node.(TBD - Need a way to treat ROUTER boards.)
222 *
223 * There are 2 different structures to represent these boards -
224 * lboard - Local board, rboard - remote board. These 2 structures
225 * can be arbitrarily mixed in the LINKED LIST of BOARDs. (Refer
226 * Figure below). The first byte of the rboard or lboard structure
227 * is used to find out its type - no unions are used.
228 * If it is a lboard, then the config info of this board will be found
229 * on the local node. (LOCAL NODE BASE + offset value gives pointer to
230 * the structure.
231 * If it is a rboard, the local structure contains the node number
232 * and the offset of the beginning of the LINKED LIST on the remote node.
233 * The details of the hardware on a remote node can be built locally,
234 * if required, by reading the LINKED LIST on the remote node and
235 * ignoring all the rboards on that node.
236 *
237 * The local node uses the REMOTE NODE NUMBER + OFFSET to point to the
238 * First board info on the remote node. The remote node list is
239 * traversed as the local list, using the REMOTE BASE ADDRESS and not
240 * the local base address and ignoring all rboard values.
241 *
242 *
243 KLCONFIG
244
245 +------------+ +------------+ +------------+ +------------+
246 | lboard | +-->| lboard | +-->| rboard | +-->| lboard |
247 +------------+ | +------------+ | +------------+ | +------------+
248 | board info | | | board info | | |errinfo,bptr| | | board info |
249 +------------+ | +------------+ | +------------+ | +------------+
250 | offset |--+ | offset |--+ | offset |--+ |offset=NULL |
251 +------------+ +------------+ +------------+ +------------+
252
253
254 +------------+
255 | board info |
256 +------------+ +--------------------------------+
257 | compt 1 |------>| type, rev, diaginfo, size ... | (CPU)
258 +------------+ +--------------------------------+
259 | compt 2 |--+
260 +------------+ | +--------------------------------+
261 | ... | +--->| type, rev, diaginfo, size ... | (MEM_BANK)
262 +------------+ +--------------------------------+
263 | errinfo |--+
264 +------------+ | +--------------------------------+
265 +--->|r/l brd errinfo,compt err flags |
266 +--------------------------------+
267
268 *
269 * Each BOARD consists of COMPONENTs and the BOARD structure has
270 * pointers (offsets) to its COMPONENT structure.
271 * The COMPONENT structure has version info, size and speed info, revision,
272 * error info and the NIC info. This structure can accommodate any
273 * BOARD with arbitrary COMPONENT composition.
274 *
275 * The ERRORINFO part of each BOARD has error information
276 * that describes errors about the BOARD itself. It also has flags to
277 * indicate the COMPONENT(s) on the board that have errors. The error
278 * information specific to the COMPONENT is present in the respective
279 * COMPONENT structure.
280 *
281 * The ERRORINFO structure is also treated like a COMPONENT, ie. the
282 * BOARD has pointers(offset) to the ERRORINFO structure. The rboard
283 * structure also has a pointer to the ERRORINFO structure. This is
284 * the place to store ERRORINFO about a REMOTE NODE, if the HUB on
285 * that NODE is not working or if the REMOTE MEMORY is BAD. In cases where
286 * only the CPU of the REMOTE NODE is disabled, the ERRORINFO pointer can
287 * be a NODE NUMBER, REMOTE OFFSET combination, pointing to error info
288 * which is present on the REMOTE NODE.(TBD)
289 * REMOTE ERRINFO can be stored on any of the nearest nodes
290 * or on all the nearest nodes.(TBD)
291 * Like BOARD structures, REMOTE ERRINFO structures can be built locally
292 * using the rboard errinfo pointer.
293 *
294 * In order to get useful information from this Data organization, a set of
295 * interface routines are provided (TBD). The important thing to remember while
296 * manipulating the structures, is that, the NODE number information should
297 * be used. If the NODE is non-zero (remote) then each offset should
298 * be added to the REMOTE BASE ADDR else it should be added to the LOCAL BASE ADDR.
299 * This includes offsets for BOARDS, COMPONENTS and ERRORINFO.
300 *
301 * Note that these structures do not provide much info about connectivity.
302 * That info will be part of HWGRAPH, which is an extension of the cfg_t
303 * data structure. (ref IP27prom/cfg.h) It has to be extended to include
304 * the IO part of the Network(TBD).
305 *
306 * The data structures below define the above concepts.
307 */
308
309/*
310 * Values for CPU types
311 */
312#define KL_CPU_R4000 0x1 /* Standard R4000 */
313#define KL_CPU_TFP 0x2 /* TFP processor */
314#define KL_CPU_R10000 0x3 /* R10000 (T5) */
315#define KL_CPU_NONE (-1) /* no cpu present in slot */
316
317/*
318 * IP27 BOARD classes
319 */
320
321#define KLCLASS_MASK 0xf0
322#define KLCLASS_NONE 0x00
323#define KLCLASS_NODE 0x10 /* CPU, Memory and HUB board */
324#define KLCLASS_CPU KLCLASS_NODE
325#define KLCLASS_IO 0x20 /* BaseIO, 4 ch SCSI, ethernet, FDDI
326 and the non-graphics widget boards */
327#define KLCLASS_ROUTER 0x30 /* Router board */
328#define KLCLASS_MIDPLANE 0x40 /* We need to treat this as a board
329 so that we can record error info */
330#define KLCLASS_GFX 0x50 /* graphics boards */
331
332#define KLCLASS_PSEUDO_GFX 0x60 /* HDTV type cards that use a gfx
333 * hw ifc to xtalk and are not gfx
334 * class for sw purposes */
335
336#define KLCLASS_MAX 7 /* Bump this if a new CLASS is added */
337#define KLTYPE_MAX 10 /* Bump this if a new CLASS is added */
338
339#define KLCLASS_UNKNOWN 0xf0
340
341#define KLCLASS(_x) ((_x) & KLCLASS_MASK)
342
343/*
344 * IP27 board types
345 */
346
347#define KLTYPE_MASK 0x0f
348#define KLTYPE_NONE 0x00
349#define KLTYPE_EMPTY 0x00
350
351#define KLTYPE_WEIRDCPU (KLCLASS_CPU | 0x0)
352#define KLTYPE_IP27 (KLCLASS_CPU | 0x1) /* 2 CPUs(R10K) per board */
353
354#define KLTYPE_WEIRDIO (KLCLASS_IO | 0x0)
355#define KLTYPE_BASEIO (KLCLASS_IO | 0x1) /* IOC3, SuperIO, Bridge, SCSI */
356#define KLTYPE_IO6 KLTYPE_BASEIO /* Additional name */
357#define KLTYPE_4CHSCSI (KLCLASS_IO | 0x2)
358#define KLTYPE_MSCSI KLTYPE_4CHSCSI /* Additional name */
359#define KLTYPE_ETHERNET (KLCLASS_IO | 0x3)
360#define KLTYPE_MENET KLTYPE_ETHERNET /* Additional name */
361#define KLTYPE_FDDI (KLCLASS_IO | 0x4)
362#define KLTYPE_UNUSED (KLCLASS_IO | 0x5) /* XXX UNUSED */
363#define KLTYPE_HAROLD (KLCLASS_IO | 0x6) /* PCI SHOE BOX */
364#define KLTYPE_PCI KLTYPE_HAROLD
365#define KLTYPE_VME (KLCLASS_IO | 0x7) /* Any 3rd party VME card */
366#define KLTYPE_MIO (KLCLASS_IO | 0x8)
367#define KLTYPE_FC (KLCLASS_IO | 0x9)
368#define KLTYPE_LINC (KLCLASS_IO | 0xA)
369#define KLTYPE_TPU (KLCLASS_IO | 0xB) /* Tensor Processing Unit */
370#define KLTYPE_GSN_A (KLCLASS_IO | 0xC) /* Main GSN board */
371#define KLTYPE_GSN_B (KLCLASS_IO | 0xD) /* Auxiliary GSN board */
372
373#define KLTYPE_GFX (KLCLASS_GFX | 0x0) /* unknown graphics type */
374#define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1) /* KONA graphics on IP27 */
375#define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3) /* MGRAS graphics on IP27 */
376
377#define KLTYPE_WEIRDROUTER (KLCLASS_ROUTER | 0x0)
378#define KLTYPE_ROUTER (KLCLASS_ROUTER | 0x1)
379#define KLTYPE_ROUTER2 KLTYPE_ROUTER /* Obsolete! */
380#define KLTYPE_NULL_ROUTER (KLCLASS_ROUTER | 0x2)
381#define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3)
382
383#define KLTYPE_WEIRDMIDPLANE (KLCLASS_MIDPLANE | 0x0)
384#define KLTYPE_MIDPLANE8 (KLCLASS_MIDPLANE | 0x1) /* 8 slot backplane */
385#define KLTYPE_MIDPLANE KLTYPE_MIDPLANE8
386#define KLTYPE_PBRICK_XBOW (KLCLASS_MIDPLANE | 0x2)
387
388#define KLTYPE_IOBRICK (KLCLASS_IOBRICK | 0x0)
389#define KLTYPE_IBRICK (KLCLASS_IOBRICK | 0x1)
390#define KLTYPE_PBRICK (KLCLASS_IOBRICK | 0x2)
391#define KLTYPE_XBRICK (KLCLASS_IOBRICK | 0x3)
392
393#define KLTYPE_PBRICK_BRIDGE KLTYPE_PBRICK
394
395/* The value of type should be more than 8 so that hinv prints
396 * out the board name from the NIC string. For values less than
397 * 8 the name of the board needs to be hard coded in a few places.
398 * When bringup started nic names had not standardized and so we
399 * had to hard code. (For people interested in history.)
400 */
401#define KLTYPE_XTHD (KLCLASS_PSEUDO_GFX | 0x9)
402
403#define KLTYPE_UNKNOWN (KLCLASS_UNKNOWN | 0xf)
404
405#define KLTYPE(_x) ((_x) & KLTYPE_MASK)
406#define IS_MIO_PRESENT(l) ((l->brd_type == KLTYPE_BASEIO) && \
407 (l->brd_flags & SECOND_NIC_PRESENT))
408#define IS_MIO_IOC3(l, n) (IS_MIO_PRESENT(l) && (n > 2))
409
410/*
411 * board structures
412 */
413
414#define MAX_COMPTS_PER_BRD 24
415
416#define LOCAL_BOARD 1
417#define REMOTE_BOARD 2
418
419#define LBOARD_STRUCT_VERSION 2
420
421typedef struct lboard_s {
422 klconf_off_t brd_next; /* Next BOARD */
423 unsigned char struct_type; /* type of structure, local or remote */
424 unsigned char brd_type; /* type+class */
425 unsigned char brd_sversion; /* version of this structure */
426 unsigned char brd_brevision; /* board revision */
427 unsigned char brd_promver; /* board prom version, if any */
428 unsigned char brd_flags; /* Enabled, Disabled etc */
429 unsigned char brd_slot; /* slot number */
430 unsigned short brd_debugsw; /* Debug switches */
431 moduleid_t brd_module; /* module to which it belongs */
432 partid_t brd_partition; /* Partition number */
433 unsigned short brd_diagval; /* diagnostic value */
434 unsigned short brd_diagparm; /* diagnostic parameter */
435 unsigned char brd_inventory; /* inventory history */
436 unsigned char brd_numcompts; /* Number of components */
437 nic_t brd_nic; /* Number in CAN */
438 nasid_t brd_nasid; /* passed parameter */
439 klconf_off_t brd_compts[MAX_COMPTS_PER_BRD]; /* pointers to COMPONENTS */
440 klconf_off_t brd_errinfo; /* Board's error information */
441 struct lboard_s *brd_parent; /* Logical parent for this brd */
442 vertex_hdl_t brd_graph_link; /* vertex hdl to connect extern compts */
443 confidence_t brd_confidence; /* confidence that the board is bad */
444 nasid_t brd_owner; /* who owns this board */
445 unsigned char brd_nic_flags; /* To handle 8 more NICs */
446 char brd_name[32];
447} lboard_t;
448
449
450/*
451 * Make sure we pass back the calias space address for local boards.
452 * klconfig board traversal and error structure extraction defines.
453 */
454
455#define BOARD_SLOT(_brd) ((_brd)->brd_slot)
456
457#define KLCF_CLASS(_brd) KLCLASS((_brd)->brd_type)
458#define KLCF_TYPE(_brd) KLTYPE((_brd)->brd_type)
459#define KLCF_REMOTE(_brd) (((_brd)->struct_type & LOCAL_BOARD) ? 0 : 1)
460#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
461#define KLCF_MODULE_ID(_brd) ((_brd)->brd_module)
462
463#define KLCF_NEXT(_brd) \
464 ((_brd)->brd_next ? \
465 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\
466 NULL)
467#define KLCF_COMP(_brd, _ndx) \
468 (klinfo_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), \
469 (_brd)->brd_compts[(_ndx)]))
470
471#define KLCF_COMP_ERROR(_brd, _comp) \
472 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo))
473
474#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type)
475#define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */
476
477
478
479/*
480 * Generic info structure. This stores common info about a
481 * component.
482 */
483
484typedef struct klinfo_s { /* Generic info */
485 unsigned char struct_type; /* type of this structure */
486 unsigned char struct_version; /* version of this structure */
487 unsigned char flags; /* Enabled, disabled etc */
488 unsigned char revision; /* component revision */
489 unsigned short diagval; /* result of diagnostics */
490 unsigned short diagparm; /* diagnostic parameter */
491 unsigned char inventory; /* previous inventory status */
492 nic_t nic; /* MUst be aligned properly */
493 unsigned char physid; /* physical id of component */
494 unsigned int virtid; /* virtual id as seen by system */
495 unsigned char widid; /* Widget id - if applicable */
496 nasid_t nasid; /* node number - from parent */
497 char pad1; /* pad out structure. */
498 char pad2; /* pad out structure. */
499 COMPONENT *arcs_compt; /* ptr to the arcs struct for ease*/
500 klconf_off_t errinfo; /* component specific errors */
501 unsigned short pad3; /* pci fields have moved over to */
502 unsigned short pad4; /* klbri_t */
503} klinfo_t ;
504
505#define KLCONFIG_INFO_ENABLED(_i) ((_i)->flags & KLINFO_ENABLE)
506/*
507 * Component structures.
508 * Following are the currently identified components:
509 * CPU, HUB, MEM_BANK,
510 * XBOW(consists of 16 WIDGETs, each of which can be HUB or GRAPHICS or BRIDGE)
511 * BRIDGE, IOC3, SuperIO, SCSI, FDDI
512 * ROUTER
513 * GRAPHICS
514 */
515#define KLSTRUCT_UNKNOWN 0
516#define KLSTRUCT_CPU 1
517#define KLSTRUCT_HUB 2
518#define KLSTRUCT_MEMBNK 3
519#define KLSTRUCT_XBOW 4
520#define KLSTRUCT_BRI 5
521#define KLSTRUCT_IOC3 6
522#define KLSTRUCT_PCI 7
523#define KLSTRUCT_VME 8
524#define KLSTRUCT_ROU 9
525#define KLSTRUCT_GFX 10
526#define KLSTRUCT_SCSI 11
527#define KLSTRUCT_FDDI 12
528#define KLSTRUCT_MIO 13
529#define KLSTRUCT_DISK 14
530#define KLSTRUCT_TAPE 15
531#define KLSTRUCT_CDROM 16
532#define KLSTRUCT_HUB_UART 17
533#define KLSTRUCT_IOC3ENET 18
534#define KLSTRUCT_IOC3UART 19
535#define KLSTRUCT_UNUSED 20 /* XXX UNUSED */
536#define KLSTRUCT_IOC3PCKM 21
537#define KLSTRUCT_RAD 22
538#define KLSTRUCT_HUB_TTY 23
539#define KLSTRUCT_IOC3_TTY 24
540
541/* Early Access IO proms are compatible
542 only with KLSTRUCT values upto 24. */
543
544#define KLSTRUCT_FIBERCHANNEL 25
545#define KLSTRUCT_MOD_SERIAL_NUM 26
546#define KLSTRUCT_IOC3MS 27
547#define KLSTRUCT_TPU 28
548#define KLSTRUCT_GSN_A 29
549#define KLSTRUCT_GSN_B 30
550#define KLSTRUCT_XTHD 31
551
552/*
553 * These are the indices of various components within a lboard structure.
554 */
555
556#define IP27_CPU0_INDEX 0
557#define IP27_CPU1_INDEX 1
558#define IP27_HUB_INDEX 2
559#define IP27_MEM_INDEX 3
560
561#define BASEIO_BRIDGE_INDEX 0
562#define BASEIO_IOC3_INDEX 1
563#define BASEIO_SCSI1_INDEX 2
564#define BASEIO_SCSI2_INDEX 3
565
566#define MIDPLANE_XBOW_INDEX 0
567#define ROUTER_COMPONENT_INDEX 0
568
569#define CH4SCSI_BRIDGE_INDEX 0
570
571/* Info holders for various hardware components */
572
573typedef u64 *pci_t;
574typedef u64 *vmeb_t;
575typedef u64 *vmed_t;
576typedef u64 *fddi_t;
577typedef u64 *scsi_t;
578typedef u64 *mio_t;
579typedef u64 *graphics_t;
580typedef u64 *router_t;
581
582/*
583 * The port info in ip27_cfg area translates to a lboart_t in the
584 * KLCONFIG area. But since KLCONFIG does not use pointers, lboart_t
585 * is stored in terms of a nasid and a offset from start of KLCONFIG
586 * area on that nasid.
587 */
588typedef struct klport_s {
589 nasid_t port_nasid;
590 unsigned char port_flag;
591 klconf_off_t port_offset;
592} klport_t;
593
594typedef struct klcpu_s { /* CPU */
595 klinfo_t cpu_info;
596 unsigned short cpu_prid; /* Processor PRID value */
597 unsigned short cpu_fpirr; /* FPU IRR value */
598 unsigned short cpu_speed; /* Speed in MHZ */
599 unsigned short cpu_scachesz; /* secondary cache size in MB */
600 unsigned short cpu_scachespeed;/* secondary cache speed in MHz */
601} klcpu_t ;
602
603#define CPU_STRUCT_VERSION 2
604
605typedef struct klhub_s { /* HUB */
606 klinfo_t hub_info;
607 unsigned int hub_flags; /* PCFG_HUB_xxx flags */
608 klport_t hub_port; /* hub is connected to this */
609 nic_t hub_box_nic; /* nic of containing box */
610 klconf_off_t hub_mfg_nic; /* MFG NIC string */
611 u64 hub_speed; /* Speed of hub in HZ */
612} klhub_t ;
613
614typedef struct klhub_uart_s { /* HUB */
615 klinfo_t hubuart_info;
616 unsigned int hubuart_flags; /* PCFG_HUB_xxx flags */
617 nic_t hubuart_box_nic; /* nic of containing box */
618} klhub_uart_t ;
619
620#define MEMORY_STRUCT_VERSION 2
621
622typedef struct klmembnk_s { /* MEMORY BANK */
623 klinfo_t membnk_info;
624 short membnk_memsz; /* Total memory in megabytes */
625 short membnk_dimm_select; /* bank to physical addr mapping*/
626 short membnk_bnksz[MD_MEM_BANKS]; /* Memory bank sizes */
627 short membnk_attr;
628} klmembnk_t ;
629
630#define KLCONFIG_MEMBNK_SIZE(_info, _bank) \
631 ((_info)->membnk_bnksz[(_bank)])
632
633
634#define MEMBNK_PREMIUM 1
635#define KLCONFIG_MEMBNK_PREMIUM(_info, _bank) \
636 ((_info)->membnk_attr & (MEMBNK_PREMIUM << (_bank)))
637
638#define MAX_SERIAL_NUM_SIZE 10
639
640typedef struct klmod_serial_num_s {
641 klinfo_t snum_info;
642 union {
643 char snum_str[MAX_SERIAL_NUM_SIZE];
644 unsigned long long snum_int;
645 } snum;
646} klmod_serial_num_t;
647
648/* Macros needed to access serial number structure in lboard_t.
649 Hard coded values are necessary since we cannot treat
650 serial number struct as a component without losing compatibility
651 between prom versions. */
652
653#define GET_SNUM_COMP(_l) ((klmod_serial_num_t *)\
654 KLCF_COMP(_l, _l->brd_numcompts))
655
656#define MAX_XBOW_LINKS 16
657
658typedef struct klxbow_s { /* XBOW */
659 klinfo_t xbow_info ;
660 klport_t xbow_port_info[MAX_XBOW_LINKS] ; /* Module number */
661 int xbow_master_hub_link;
662 /* type of brd connected+component struct ptr+flags */
663} klxbow_t ;
664
665#define MAX_PCI_SLOTS 8
666
667typedef struct klpci_device_s {
668 s32 pci_device_id; /* 32 bits of vendor/device ID. */
669 s32 pci_device_pad; /* 32 bits of padding. */
670} klpci_device_t;
671
672#define BRIDGE_STRUCT_VERSION 2
673
674typedef struct klbri_s { /* BRIDGE */
675 klinfo_t bri_info ;
676 unsigned char bri_eprominfo ; /* IO6prom connected to bridge */
677 unsigned char bri_bustype ; /* PCI/VME BUS bridge/GIO */
678 pci_t pci_specific ; /* PCI Board config info */
679 klpci_device_t bri_devices[MAX_PCI_DEVS] ; /* PCI IDs */
680 klconf_off_t bri_mfg_nic ;
681} klbri_t ;
682
683#define MAX_IOC3_TTY 2
684
685typedef struct klioc3_s { /* IOC3 */
686 klinfo_t ioc3_info ;
687 unsigned char ioc3_ssram ; /* Info about ssram */
688 unsigned char ioc3_nvram ; /* Info about nvram */
689 klinfo_t ioc3_superio ; /* Info about superio */
690 klconf_off_t ioc3_tty_off ;
691 klinfo_t ioc3_enet ;
692 klconf_off_t ioc3_enet_off ;
693 klconf_off_t ioc3_kbd_off ;
694} klioc3_t ;
695
696#define MAX_VME_SLOTS 8
697
698typedef struct klvmeb_s { /* VME BRIDGE - PCI CTLR */
699 klinfo_t vmeb_info ;
700 vmeb_t vmeb_specific ;
701 klconf_off_t vmeb_brdinfo[MAX_VME_SLOTS] ; /* VME Board config info */
702} klvmeb_t ;
703
704typedef struct klvmed_s { /* VME DEVICE - VME BOARD */
705 klinfo_t vmed_info ;
706 vmed_t vmed_specific ;
707 klconf_off_t vmed_brdinfo[MAX_VME_SLOTS] ; /* VME Board config info */
708} klvmed_t ;
709
710#define ROUTER_VECTOR_VERS 2
711
712/* XXX - Don't we need the number of ports here?!? */
713typedef struct klrou_s { /* ROUTER */
714 klinfo_t rou_info ;
715 unsigned int rou_flags ; /* PCFG_ROUTER_xxx flags */
716 nic_t rou_box_nic ; /* nic of the containing module */
717 klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */
718 klconf_off_t rou_mfg_nic ; /* MFG NIC string */
719 u64 rou_vector; /* vector from master node */
720} klrou_t ;
721
722/*
723 * Graphics Controller/Device
724 *
725 * (IP27/IO6) Prom versions 6.13 (and 6.5.1 kernels) and earlier
726 * used a couple different structures to store graphics information.
727 * For compatibility reasons, the newer data structure preserves some
728 * of the layout so that fields that are used in the old versions remain
729 * in the same place (with the same info). Determination of what version
730 * of this structure we have is done by checking the cookie field.
731 */
732#define KLGFX_COOKIE 0x0c0de000
733
734typedef struct klgfx_s { /* GRAPHICS Device */
735 klinfo_t gfx_info;
736 klconf_off_t old_gndevs; /* for compatibility with older proms */
737 klconf_off_t old_gdoff0; /* for compatibility with older proms */
738 unsigned int cookie; /* for compatibility with older proms */
739 unsigned int moduleslot;
740 struct klgfx_s *gfx_next_pipe;
741 graphics_t gfx_specific;
742 klconf_off_t pad0; /* for compatibility with older proms */
743 klconf_off_t gfx_mfg_nic;
744} klgfx_t;
745
746typedef struct klxthd_s {
747 klinfo_t xthd_info ;
748 klconf_off_t xthd_mfg_nic ; /* MFG NIC string */
749} klxthd_t ;
750
751typedef struct kltpu_s { /* TPU board */
752 klinfo_t tpu_info ;
753 klconf_off_t tpu_mfg_nic ; /* MFG NIC string */
754} kltpu_t ;
755
756typedef struct klgsn_s { /* GSN board */
757 klinfo_t gsn_info ;
758 klconf_off_t gsn_mfg_nic ; /* MFG NIC string */
759} klgsn_t ;
760
761#define MAX_SCSI_DEVS 16
762
763/*
764 * NOTE: THis is the max sized kl* structure and is used in klmalloc.c
765 * to allocate space of type COMPONENT. Make sure that if the size of
766 * any other component struct becomes more than this, then redefine
767 * that as the size to be klmalloced.
768 */
769
770typedef struct klscsi_s { /* SCSI Controller */
771 klinfo_t scsi_info ;
772 scsi_t scsi_specific ;
773 unsigned char scsi_numdevs ;
774 klconf_off_t scsi_devinfo[MAX_SCSI_DEVS] ;
775} klscsi_t ;
776
777typedef struct klscdev_s { /* SCSI device */
778 klinfo_t scdev_info ;
779 struct scsidisk_data *scdev_cfg ; /* driver fills up this */
780} klscdev_t ;
781
782typedef struct klttydev_s { /* TTY device */
783 klinfo_t ttydev_info ;
784 struct terminal_data *ttydev_cfg ; /* driver fills up this */
785} klttydev_t ;
786
787typedef struct klenetdev_s { /* ENET device */
788 klinfo_t enetdev_info ;
789 struct net_data *enetdev_cfg ; /* driver fills up this */
790} klenetdev_t ;
791
792typedef struct klkbddev_s { /* KBD device */
793 klinfo_t kbddev_info ;
794 struct keyboard_data *kbddev_cfg ; /* driver fills up this */
795} klkbddev_t ;
796
797typedef struct klmsdev_s { /* mouse device */
798 klinfo_t msdev_info ;
799 void *msdev_cfg ;
800} klmsdev_t ;
801
802#define MAX_FDDI_DEVS 10 /* XXX Is this true */
803
804typedef struct klfddi_s { /* FDDI */
805 klinfo_t fddi_info ;
806 fddi_t fddi_specific ;
807 klconf_off_t fddi_devinfo[MAX_FDDI_DEVS] ;
808} klfddi_t ;
809
810typedef struct klmio_s { /* MIO */
811 klinfo_t mio_info ;
812 mio_t mio_specific ;
813} klmio_t ;
814
815
816typedef union klcomp_s {
817 klcpu_t kc_cpu;
818 klhub_t kc_hub;
819 klmembnk_t kc_mem;
820 klxbow_t kc_xbow;
821 klbri_t kc_bri;
822 klioc3_t kc_ioc3;
823 klvmeb_t kc_vmeb;
824 klvmed_t kc_vmed;
825 klrou_t kc_rou;
826 klgfx_t kc_gfx;
827 klscsi_t kc_scsi;
828 klscdev_t kc_scsi_dev;
829 klfddi_t kc_fddi;
830 klmio_t kc_mio;
831 klmod_serial_num_t kc_snum ;
832} klcomp_t;
833
834typedef union kldev_s { /* for device structure allocation */
835 klscdev_t kc_scsi_dev ;
836 klttydev_t kc_tty_dev ;
837 klenetdev_t kc_enet_dev ;
838 klkbddev_t kc_kbd_dev ;
839} kldev_t ;
840
841/* Data structure interface routines. TBD */
842
843/* Include launch info in this file itself? TBD */
844
845/*
846 * TBD - Can the ARCS and device driver related info also be included in the
847 * KLCONFIG area. On the IO4PROM, prom device driver info is part of cfgnode_t
848 * structure, viz private to the IO4prom.
849 */
850
851/*
852 * TBD - Allocation issues.
853 *
854 * Do we need to Mark off sepatate heaps for lboard_t, rboard_t, component,
855 * errinfo and allocate from them, or have a single heap and allocate all
856 * structures from it. Debug is easier in the former method since we can
857 * dump all similar structs in one command, but there will be lots of holes,
858 * in memory and max limits are needed for number of structures.
859 * Another way to make it organized, is to have a union of all components
860 * and allocate a aligned chunk of memory greater than the biggest
861 * component.
862 */
863
864typedef union {
865 lboard_t *lbinfo ;
866} biptr_t ;
867
868
869#define BRI_PER_XBOW 6
870#define PCI_PER_BRI 8
871#define DEV_PER_PCI 16
872
873
874/* Virtual dipswitch values (starting from switch "7"): */
875
876#define VDS_NOGFX 0x8000 /* Don't enable gfx and autoboot */
877#define VDS_NOMP 0x100 /* Don't start slave processors */
878#define VDS_MANUMODE 0x80 /* Manufacturing mode */
879#define VDS_NOARB 0x40 /* No bootmaster arbitration */
880#define VDS_PODMODE 0x20 /* Go straight to POD mode */
881#define VDS_NO_DIAGS 0x10 /* Don't run any diags after BM arb */
882#define VDS_DEFAULTS 0x08 /* Use default environment values */
883#define VDS_NOMEMCLEAR 0x04 /* Don't run mem cfg code */
884#define VDS_2ND_IO4 0x02 /* Boot from the second IO4 */
885#define VDS_DEBUG_PROM 0x01 /* Print PROM debugging messages */
886
887/* external declarations of Linux kernel functions. */
888
889extern lboard_t *find_lboard(lboard_t *start, unsigned char type);
890extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);
891extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);
892extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
893extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
894
895
896extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu);
897
898#endif /* _ASM_SN_KLCONFIG_H */
diff --git a/include/asm-mips/sn/kldir.h b/include/asm-mips/sn/kldir.h
deleted file mode 100644
index 1327e12e9645..000000000000
--- a/include/asm-mips/sn/kldir.h
+++ /dev/null
@@ -1,217 +0,0 @@
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 * Derived from IRIX <sys/SN/kldir.h>, revision 1.21.
7 *
8 * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc.
9 * Copyright (C) 1999, 2000 by Ralf Baechle
10 */
11#ifndef _ASM_SN_KLDIR_H
12#define _ASM_SN_KLDIR_H
13
14
15/*
16 * The kldir memory area resides at a fixed place in each node's memory and
17 * provides pointers to most other IP27 memory areas. This allows us to
18 * resize and/or relocate memory areas at a later time without breaking all
19 * firmware and kernels that use them. Indices in the array are
20 * permanently dedicated to areas listed below. Some memory areas (marked
21 * below) reside at a permanently fixed location, but are included in the
22 * directory for completeness.
23 */
24
25#define KLDIR_MAGIC 0x434d5f53505f5357
26
27/*
28 * The upper portion of the memory map applies during boot
29 * only and is overwritten by IRIX/SYMMON.
30 *
31 * MEMORY MAP PER NODE
32 *
33 * 0x2000000 (32M) +-----------------------------------------+
34 * | IO6 BUFFERS FOR FLASH ENET IOC3 |
35 * 0x1F80000 (31.5M) +-----------------------------------------+
36 * | IO6 TEXT/DATA/BSS/stack |
37 * 0x1C00000 (30M) +-----------------------------------------+
38 * | IO6 PROM DEBUG TEXT/DATA/BSS/stack |
39 * 0x0800000 (28M) +-----------------------------------------+
40 * | IP27 PROM TEXT/DATA/BSS/stack |
41 * 0x1B00000 (27M) +-----------------------------------------+
42 * | IP27 CFG |
43 * 0x1A00000 (26M) +-----------------------------------------+
44 * | Graphics PROM |
45 * 0x1800000 (24M) +-----------------------------------------+
46 * | 3rd Party PROM drivers |
47 * 0x1600000 (22M) +-----------------------------------------+
48 * | |
49 * | Free |
50 * | |
51 * +-----------------------------------------+
52 * | UNIX DEBUG Version |
53 * 0x190000 (2M--) +-----------------------------------------+
54 * | SYMMON |
55 * | (For UNIX Debug only) |
56 * 0x34000 (208K) +-----------------------------------------+
57 * | SYMMON STACK [NUM_CPU_PER_NODE] |
58 * | (For UNIX Debug only) |
59 * 0x25000 (148K) +-----------------------------------------+
60 * | KLCONFIG - II (temp) |
61 * | |
62 * | ---------------------------- |
63 * | |
64 * | UNIX NON-DEBUG Version |
65 * 0x19000 (100K) +-----------------------------------------+
66 *
67 *
68 * The lower portion of the memory map contains information that is
69 * permanent and is used by the IP27PROM, IO6PROM and IRIX.
70 *
71 * 0x19000 (100K) +-----------------------------------------+
72 * | |
73 * | PI Error Spools (32K) |
74 * | |
75 * 0x12000 (72K) +-----------------------------------------+
76 * | Unused |
77 * 0x11c00 (71K) +-----------------------------------------+
78 * | CPU 1 NMI Eframe area |
79 * 0x11a00 (70.5K) +-----------------------------------------+
80 * | CPU 0 NMI Eframe area |
81 * 0x11800 (70K) +-----------------------------------------+
82 * | CPU 1 NMI Register save area |
83 * 0x11600 (69.5K) +-----------------------------------------+
84 * | CPU 0 NMI Register save area |
85 * 0x11400 (69K) +-----------------------------------------+
86 * | GDA (1k) |
87 * 0x11000 (68K) +-----------------------------------------+
88 * | Early cache Exception stack |
89 * | and/or |
90 * | kernel/io6prom nmi registers |
91 * 0x10800 (66k) +-----------------------------------------+
92 * | cache error eframe |
93 * 0x10400 (65K) +-----------------------------------------+
94 * | Exception Handlers (UALIAS copy) |
95 * 0x10000 (64K) +-----------------------------------------+
96 * | |
97 * | |
98 * | KLCONFIG - I (permanent) (48K) |
99 * | |
100 * | |
101 * | |
102 * 0x4000 (16K) +-----------------------------------------+
103 * | NMI Handler (Protected Page) |
104 * 0x3000 (12K) +-----------------------------------------+
105 * | ARCS PVECTORS (master node only) |
106 * 0x2c00 (11K) +-----------------------------------------+
107 * | ARCS TVECTORS (master node only) |
108 * 0x2800 (10K) +-----------------------------------------+
109 * | LAUNCH [NUM_CPU] |
110 * 0x2400 (9K) +-----------------------------------------+
111 * | Low memory directory (KLDIR) |
112 * 0x2000 (8K) +-----------------------------------------+
113 * | ARCS SPB (1K) |
114 * 0x1000 (4K) +-----------------------------------------+
115 * | Early cache Exception stack |
116 * | and/or |
117 * | kernel/io6prom nmi registers |
118 * 0x800 (2k) +-----------------------------------------+
119 * | cache error eframe |
120 * 0x400 (1K) +-----------------------------------------+
121 * | Exception Handlers |
122 * 0x0 (0K) +-----------------------------------------+
123 */
124
125#ifdef __ASSEMBLY__
126#define KLDIR_OFF_MAGIC 0x00
127#define KLDIR_OFF_OFFSET 0x08
128#define KLDIR_OFF_POINTER 0x10
129#define KLDIR_OFF_SIZE 0x18
130#define KLDIR_OFF_COUNT 0x20
131#define KLDIR_OFF_STRIDE 0x28
132#endif /* __ASSEMBLY__ */
133
134/*
135 * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
136 * we define here. Since it's set up in the prom. We can't redefine it later
137 * and expect more space to be allocated. The way to find out the true size
138 * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE
139 * for a particular node.
140 */
141#define SYMMON_STACK_SIZE 0x8000
142
143#if defined(PROM)
144
145/*
146 * These defines are prom version dependent. No code other than the IP27
147 * prom should attempt to use these values.
148 */
149#define IP27_LAUNCH_OFFSET 0x2400
150#define IP27_LAUNCH_SIZE 0x400
151#define IP27_LAUNCH_COUNT 2
152#define IP27_LAUNCH_STRIDE 0x200
153
154#define IP27_KLCONFIG_OFFSET 0x4000
155#define IP27_KLCONFIG_SIZE 0xc000
156#define IP27_KLCONFIG_COUNT 1
157#define IP27_KLCONFIG_STRIDE 0
158
159#define IP27_NMI_OFFSET 0x3000
160#define IP27_NMI_SIZE 0x40
161#define IP27_NMI_COUNT 2
162#define IP27_NMI_STRIDE 0x40
163
164#define IP27_PI_ERROR_OFFSET 0x12000
165#define IP27_PI_ERROR_SIZE 0x4000
166#define IP27_PI_ERROR_COUNT 1
167#define IP27_PI_ERROR_STRIDE 0
168
169#define IP27_SYMMON_STK_OFFSET 0x25000
170#define IP27_SYMMON_STK_SIZE 0xe000
171#define IP27_SYMMON_STK_COUNT 2
172/* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */
173#define IP27_SYMMON_STK_STRIDE 0x7000
174
175#define IP27_FREEMEM_OFFSET 0x19000
176#define IP27_FREEMEM_SIZE -1
177#define IP27_FREEMEM_COUNT 1
178#define IP27_FREEMEM_STRIDE 0
179
180#endif /* PROM */
181/*
182 * There will be only one of these in a partition so the IO6 must set it up.
183 */
184#define IO6_GDA_OFFSET 0x11000
185#define IO6_GDA_SIZE 0x400
186#define IO6_GDA_COUNT 1
187#define IO6_GDA_STRIDE 0
188
189/*
190 * save area of kernel nmi regs in the prom format
191 */
192#define IP27_NMI_KREGS_OFFSET 0x11400
193#define IP27_NMI_KREGS_CPU_SIZE 0x200
194/*
195 * save area of kernel nmi regs in eframe format
196 */
197#define IP27_NMI_EFRAME_OFFSET 0x11800
198#define IP27_NMI_EFRAME_SIZE 0x200
199
200#define KLDIR_ENT_SIZE 0x40
201#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
202
203#ifndef __ASSEMBLY__
204typedef struct kldir_ent_s {
205 u64 magic; /* Indicates validity of entry */
206 off_t offset; /* Offset from start of node space */
207 unsigned long pointer; /* Pointer to area in some cases */
208 size_t size; /* Size in bytes */
209 u64 count; /* Repeat count if array, 1 if not */
210 size_t stride; /* Stride if array, 0 if not */
211 char rsvd[16]; /* Pad entry to 0x40 bytes */
212 /* NOTE: These 16 bytes are used in the Partition KLDIR
213 entry to store partition info. Refer to klpart.h for this. */
214} kldir_ent_t;
215#endif /* !__ASSEMBLY__ */
216
217#endif /* _ASM_SN_KLDIR_H */
diff --git a/include/asm-mips/sn/klkernvars.h b/include/asm-mips/sn/klkernvars.h
deleted file mode 100644
index 5de4c5e8ab30..000000000000
--- a/include/asm-mips/sn/klkernvars.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * File ported from IRIX to Linux by Kanoj Sarcar, 06/08/00.
3 * Copyright 2000 Silicon Graphics, Inc.
4 */
5#ifndef __ASM_SN_KLKERNVARS_H
6#define __ASM_SN_KLKERNVARS_H
7
8#define KV_MAGIC_OFFSET 0x0
9#define KV_RO_NASID_OFFSET 0x4
10#define KV_RW_NASID_OFFSET 0x6
11
12#define KV_MAGIC 0x5f4b565f
13
14#ifndef __ASSEMBLY__
15
16#include <asm/sn/types.h>
17
18typedef struct kern_vars_s {
19 int kv_magic;
20 nasid_t kv_ro_nasid;
21 nasid_t kv_rw_nasid;
22 unsigned long kv_ro_baseaddr;
23 unsigned long kv_rw_baseaddr;
24} kern_vars_t;
25
26#endif /* !__ASSEMBLY__ */
27
28#endif /* __ASM_SN_KLKERNVARS_H */
29
diff --git a/include/asm-mips/sn/launch.h b/include/asm-mips/sn/launch.h
deleted file mode 100644
index b7c2226312c6..000000000000
--- a/include/asm-mips/sn/launch.h
+++ /dev/null
@@ -1,106 +0,0 @@
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 * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
7 * Copyright (C) 2000 by Colin Ngam
8 */
9#ifndef _ASM_SN_LAUNCH_H
10#define _ASM_SN_LAUNCH_H
11
12#include <asm/sn/types.h>
13#include <asm/sn/addrs.h>
14
15/*
16 * The launch data structure resides at a fixed place in each node's memory
17 * and is used to communicate between the master processor and the slave
18 * processors.
19 *
20 * The master stores launch parameters in the launch structure
21 * corresponding to a target processor that is in a slave loop, then sends
22 * an interrupt to the slave processor. The slave calls the desired
23 * function, then returns to the slave loop. The master may poll or wait
24 * for the slaves to finish.
25 *
26 * There is an array of launch structures, one per CPU on the node. One
27 * interrupt level is used per local CPU.
28 */
29
30#define LAUNCH_MAGIC 0xaddbead2addbead3
31#ifdef CONFIG_SGI_IP27
32#define LAUNCH_SIZEOF 0x100
33#define LAUNCH_PADSZ 0xa0
34#endif
35
36#define LAUNCH_OFF_MAGIC 0x00 /* Struct offsets for assembly */
37#define LAUNCH_OFF_BUSY 0x08
38#define LAUNCH_OFF_CALL 0x10
39#define LAUNCH_OFF_CALLC 0x18
40#define LAUNCH_OFF_CALLPARM 0x20
41#define LAUNCH_OFF_STACK 0x28
42#define LAUNCH_OFF_GP 0x30
43#define LAUNCH_OFF_BEVUTLB 0x38
44#define LAUNCH_OFF_BEVNORMAL 0x40
45#define LAUNCH_OFF_BEVECC 0x48
46
47#define LAUNCH_STATE_DONE 0 /* Return value of LAUNCH_POLL */
48#define LAUNCH_STATE_SENT 1
49#define LAUNCH_STATE_RECD 2
50
51/*
52 * The launch routine is called only if the complement address is correct.
53 *
54 * Before control is transferred to a routine, the complement address
55 * is zeroed (invalidated) to prevent an accidental call from a spurious
56 * interrupt.
57 *
58 * The slave_launch routine turns on the BUSY flag, and the slave loop
59 * clears the BUSY flag after control is returned to it.
60 */
61
62#ifndef __ASSEMBLY__
63
64typedef int launch_state_t;
65typedef void (*launch_proc_t)(u64 call_parm);
66
67typedef struct launch_s {
68 volatile u64 magic; /* Magic number */
69 volatile u64 busy; /* Slave currently active */
70 volatile launch_proc_t call_addr; /* Func. for slave to call */
71 volatile u64 call_addr_c; /* 1's complement of call_addr*/
72 volatile u64 call_parm; /* Single parm passed to call*/
73 volatile void *stack_addr; /* Stack pointer for slave function */
74 volatile void *gp_addr; /* Global pointer for slave func. */
75 volatile char *bevutlb;/* Address of bev utlb ex handler */
76 volatile char *bevnormal;/*Address of bev normal ex handler */
77 volatile char *bevecc;/* Address of bev cache err handler */
78 volatile char pad[160]; /* Pad to LAUNCH_SIZEOF */
79} launch_t;
80
81/*
82 * PROM entry points for launch routines are determined by IPxxprom/start.s
83 */
84
85#define LAUNCH_SLAVE (*(void (*)(int nasid, int cpu, \
86 launch_proc_t call_addr, \
87 u64 call_parm, \
88 void *stack_addr, \
89 void *gp_addr)) \
90 IP27PROM_LAUNCHSLAVE)
91
92#define LAUNCH_WAIT (*(void (*)(int nasid, int cpu, int timeout_msec)) \
93 IP27PROM_WAITSLAVE)
94
95#define LAUNCH_POLL (*(launch_state_t (*)(int nasid, int cpu)) \
96 IP27PROM_POLLSLAVE)
97
98#define LAUNCH_LOOP (*(void (*)(void)) \
99 IP27PROM_SLAVELOOP)
100
101#define LAUNCH_FLASH (*(void (*)(void)) \
102 IP27PROM_FLASHLEDS)
103
104#endif /* !__ASSEMBLY__ */
105
106#endif /* _ASM_SN_LAUNCH_H */
diff --git a/include/asm-mips/sn/mapped_kernel.h b/include/asm-mips/sn/mapped_kernel.h
deleted file mode 100644
index c3dd5d0d525f..000000000000
--- a/include/asm-mips/sn/mapped_kernel.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * File created by Kanoj Sarcar 06/06/00.
3 * Copyright 2000 Silicon Graphics, Inc.
4 */
5#ifndef __ASM_SN_MAPPED_KERNEL_H
6#define __ASM_SN_MAPPED_KERNEL_H
7
8/*
9 * Note on how mapped kernels work: the text and data section is
10 * compiled at cksseg segment (LOADADDR = 0xc001c000), and the
11 * init/setup/data section gets a 16M virtual address bump in the
12 * ld.script file (so that tlblo0 and tlblo1 maps the sections).
13 * The vmlinux.64 section addresses are put in the xkseg range
14 * using the change-addresses makefile option. Use elfdump -of
15 * on IRIX to see where the sections go. The Origin loader loads
16 * the two sections contiguously in physical memory. The loader
17 * sets the entry point into kernel_entry using a xkphys address,
18 * but instead of using 0xa800000001160000, it uses the address
19 * 0xa800000000160000, which is where it physically loaded that
20 * code. So no jumps can be done before we have switched to using
21 * cksseg addresses.
22 */
23#include <asm/addrspace.h>
24
25#define REP_BASE CAC_BASE
26
27#ifdef CONFIG_MAPPED_KERNEL
28
29#define MAPPED_ADDR_RO_TO_PHYS(x) (x - REP_BASE)
30#define MAPPED_ADDR_RW_TO_PHYS(x) (x - REP_BASE - 16777216)
31
32#define MAPPED_KERN_RO_PHYSBASE(n) \
33 (PLAT_NODE_DATA(n)->kern_vars.kv_ro_baseaddr)
34#define MAPPED_KERN_RW_PHYSBASE(n) \
35 (PLAT_NODE_DATA(n)->kern_vars.kv_rw_baseaddr)
36
37#define MAPPED_KERN_RO_TO_PHYS(x) \
38 ((unsigned long)MAPPED_ADDR_RO_TO_PHYS(x) | \
39 MAPPED_KERN_RO_PHYSBASE(get_compact_nodeid()))
40#define MAPPED_KERN_RW_TO_PHYS(x) \
41 ((unsigned long)MAPPED_ADDR_RW_TO_PHYS(x) | \
42 MAPPED_KERN_RW_PHYSBASE(get_compact_nodeid()))
43
44#else /* CONFIG_MAPPED_KERNEL */
45
46#define MAPPED_KERN_RO_TO_PHYS(x) (x - REP_BASE)
47#define MAPPED_KERN_RW_TO_PHYS(x) (x - REP_BASE)
48
49#endif /* CONFIG_MAPPED_KERNEL */
50
51#define MAPPED_KERN_RO_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RO_TO_PHYS(x))
52#define MAPPED_KERN_RW_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RW_TO_PHYS(x))
53
54#endif /* __ASM_SN_MAPPED_KERNEL_H */
diff --git a/include/asm-mips/sn/nmi.h b/include/asm-mips/sn/nmi.h
deleted file mode 100644
index 6b7b0b5f3729..000000000000
--- a/include/asm-mips/sn/nmi.h
+++ /dev/null
@@ -1,125 +0,0 @@
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 * Copyright (C) 1992 - 1997 Silicon Graphics, Inc.
7 */
8#ifndef __ASM_SN_NMI_H
9#define __ASM_SN_NMI_H
10
11#ident "$Revision: 1.5 $"
12
13#include <asm/sn/addrs.h>
14
15/*
16 * The launch data structure resides at a fixed place in each node's memory
17 * and is used to communicate between the master processor and the slave
18 * processors.
19 *
20 * The master stores launch parameters in the launch structure
21 * corresponding to a target processor that is in a slave loop, then sends
22 * an interrupt to the slave processor. The slave calls the desired
23 * function, followed by an optional rendezvous function, then returns to
24 * the slave loop. The master does not wait for the slaves before
25 * returning.
26 *
27 * There is an array of launch structures, one per CPU on the node. One
28 * interrupt level is used per CPU.
29 */
30
31#define NMI_MAGIC 0x48414d4d455201
32#define NMI_SIZEOF 0x40
33
34#define NMI_OFF_MAGIC 0x00 /* Struct offsets for assembly */
35#define NMI_OFF_FLAGS 0x08
36#define NMI_OFF_CALL 0x10
37#define NMI_OFF_CALLC 0x18
38#define NMI_OFF_CALLPARM 0x20
39#define NMI_OFF_GMASTER 0x28
40
41/*
42 * The NMI routine is called only if the complement address is
43 * correct.
44 *
45 * Before control is transferred to a routine, the complement address
46 * is zeroed (invalidated) to prevent an accidental call from a spurious
47 * interrupt.
48 *
49 */
50
51#ifndef __ASSEMBLY__
52
53typedef struct nmi_s {
54 volatile unsigned long magic; /* Magic number */
55 volatile unsigned long flags; /* Combination of flags above */
56 volatile void *call_addr; /* Routine for slave to call */
57 volatile void *call_addr_c; /* 1's complement of address */
58 volatile void *call_parm; /* Single parm passed to call */
59 volatile unsigned long gmaster; /* Flag true only on global master*/
60} nmi_t;
61
62#endif /* !__ASSEMBLY__ */
63
64/* Following definitions are needed both in the prom & the kernel
65 * to identify the format of the nmi cpu register save area in the
66 * low memory on each node.
67 */
68#ifndef __ASSEMBLY__
69
70struct reg_struct {
71 unsigned long gpr[32];
72 unsigned long sr;
73 unsigned long cause;
74 unsigned long epc;
75 unsigned long badva;
76 unsigned long error_epc;
77 unsigned long cache_err;
78 unsigned long nmi_sr;
79};
80
81#endif /* !__ASSEMBLY__ */
82
83/* These are the assembly language offsets into the reg_struct structure */
84
85#define R0_OFF 0x0
86#define R1_OFF 0x8
87#define R2_OFF 0x10
88#define R3_OFF 0x18
89#define R4_OFF 0x20
90#define R5_OFF 0x28
91#define R6_OFF 0x30
92#define R7_OFF 0x38
93#define R8_OFF 0x40
94#define R9_OFF 0x48
95#define R10_OFF 0x50
96#define R11_OFF 0x58
97#define R12_OFF 0x60
98#define R13_OFF 0x68
99#define R14_OFF 0x70
100#define R15_OFF 0x78
101#define R16_OFF 0x80
102#define R17_OFF 0x88
103#define R18_OFF 0x90
104#define R19_OFF 0x98
105#define R20_OFF 0xa0
106#define R21_OFF 0xa8
107#define R22_OFF 0xb0
108#define R23_OFF 0xb8
109#define R24_OFF 0xc0
110#define R25_OFF 0xc8
111#define R26_OFF 0xd0
112#define R27_OFF 0xd8
113#define R28_OFF 0xe0
114#define R29_OFF 0xe8
115#define R30_OFF 0xf0
116#define R31_OFF 0xf8
117#define SR_OFF 0x100
118#define CAUSE_OFF 0x108
119#define EPC_OFF 0x110
120#define BADVA_OFF 0x118
121#define ERROR_EPC_OFF 0x120
122#define CACHE_ERR_OFF 0x128
123#define NMISR_OFF 0x130
124
125#endif /* __ASM_SN_NMI_H */
diff --git a/include/asm-mips/sn/sn0/addrs.h b/include/asm-mips/sn/sn0/addrs.h
deleted file mode 100644
index b06190093bbc..000000000000
--- a/include/asm-mips/sn/sn0/addrs.h
+++ /dev/null
@@ -1,288 +0,0 @@
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 * Derived from IRIX <sys/SN/SN0/addrs.h>, revision 1.126.
7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle
10 */
11#ifndef _ASM_SN_SN0_ADDRS_H
12#define _ASM_SN_SN0_ADDRS_H
13
14
15/*
16 * SN0 (on a T5) Address map
17 *
18 * This file contains a set of definitions and macros which are used
19 * to reference into the major address spaces (CAC, HSPEC, IO, MSPEC,
20 * and UNCAC) used by the SN0 architecture. It also contains addresses
21 * for "major" statically locatable PROM/Kernel data structures, such as
22 * the partition table, the configuration data structure, etc.
23 * We make an implicit assumption that the processor using this file
24 * follows the R10K's provisions for specifying uncached attributes;
25 * should this change, the base registers may very well become processor-
26 * dependent.
27 *
28 * For more information on the address spaces, see the "Local Resources"
29 * chapter of the Hub specification.
30 *
31 * NOTE: This header file is included both by C and by assembler source
32 * files. Please bracket any language-dependent definitions
33 * appropriately.
34 */
35
36/*
37 * Some of the macros here need to be casted to appropriate types when used
38 * from C. They definitely must not be casted from assembly language so we
39 * use some new ANSI preprocessor stuff to paste these on where needed.
40 */
41
42/*
43 * The following couple of definitions will eventually need to be variables,
44 * since the amount of address space assigned to each node depends on
45 * whether the system is running in N-mode (more nodes with less memory)
46 * or M-mode (fewer nodes with more memory). We expect that it will
47 * be a while before we need to make this decision dynamically, though,
48 * so for now we just use defines bracketed by an ifdef.
49 */
50
51#ifdef CONFIG_SGI_SN_N_MODE
52
53#define NODE_SIZE_BITS 31
54#define BWIN_SIZE_BITS 28
55
56#define NASID_BITS 9
57#define NASID_BITMASK (0x1ffLL)
58#define NASID_SHFT 31
59#define NASID_META_BITS 5
60#define NASID_LOCAL_BITS 4
61
62#define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10)
63#define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3)
64
65#else /* !defined(CONFIG_SGI_SN_N_MODE), assume that M-mode is desired */
66
67#define NODE_SIZE_BITS 32
68#define BWIN_SIZE_BITS 29
69
70#define NASID_BITMASK (0xffLL)
71#define NASID_BITS 8
72#define NASID_SHFT 32
73#define NASID_META_BITS 4
74#define NASID_LOCAL_BITS 4
75
76#define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10)
77#define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3)
78
79#endif /* !defined(CONFIG_SGI_SN_N_MODE) */
80
81#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS)
82
83#define NASID_MASK (UINT64_CAST NASID_BITMASK << NASID_SHFT)
84#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \
85 NASID_SHFT) & NASID_BITMASK)
86
87#if !defined(__ASSEMBLY__)
88
89#define NODE_SWIN_BASE(nasid, widget) \
90 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \
91 : RAW_NODE_SWIN_BASE(nasid, widget))
92#else /* __ASSEMBLY__ */
93#define NODE_SWIN_BASE(nasid, widget) \
94 (NODE_IO_BASE(nasid) + (UINT64_CAST(widget) << SWIN_SIZE_BITS))
95#endif /* __ASSEMBLY__ */
96
97/*
98 * The following definitions pertain to the IO special address
99 * space. They define the location of the big and little windows
100 * of any given node.
101 */
102
103#define BWIN_INDEX_BITS 3
104#define BWIN_SIZE (UINT64_CAST 1 << BWIN_SIZE_BITS)
105#define BWIN_SIZEMASK (BWIN_SIZE - 1)
106#define BWIN_WIDGET_MASK 0x7
107#define NODE_BWIN_BASE0(nasid) (NODE_IO_BASE(nasid) + BWIN_SIZE)
108#define NODE_BWIN_BASE(nasid, bigwin) (NODE_BWIN_BASE0(nasid) + \
109 (UINT64_CAST(bigwin) << BWIN_SIZE_BITS))
110
111#define BWIN_WIDGETADDR(addr) ((addr) & BWIN_SIZEMASK)
112#define BWIN_WINDOWNUM(addr) (((addr) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK)
113/*
114 * Verify if addr belongs to large window address of node with "nasid"
115 *
116 *
117 * NOTE: "addr" is expected to be XKPHYS address, and NOT physical
118 * address
119 *
120 *
121 */
122
123#define NODE_BWIN_ADDR(nasid, addr) \
124 (((addr) >= NODE_BWIN_BASE0(nasid)) && \
125 ((addr) < (NODE_BWIN_BASE(nasid, HUB_NUM_BIG_WINDOW) + \
126 BWIN_SIZE)))
127
128/*
129 * The following define the major position-independent aliases used
130 * in SN0.
131 * CALIAS -- Varies in size, points to the first n bytes of memory
132 * on the reader's node.
133 */
134
135#define CALIAS_BASE CAC_BASE
136
137
138
139#define BRIDGE_REG_PTR(_base, _off) ((volatile bridgereg_t *) \
140 ((__psunsigned_t)(_base) + (__psunsigned_t)(_off)))
141
142#define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid)))
143
144/* Turn on sable logging for the processors whose bits are set. */
145#define SABLE_LOG_TRIGGER(_map)
146
147#ifndef __ASSEMBLY__
148#define KERN_NMI_ADDR(nasid, slice) \
149 TO_NODE_UNCAC((nasid), IP27_NMI_KREGS_OFFSET + \
150 (IP27_NMI_KREGS_CPU_SIZE * (slice)))
151#endif /* !__ASSEMBLY__ */
152
153#ifdef PROM
154
155#define MISC_PROM_BASE PHYS_TO_K0(0x01300000)
156#define MISC_PROM_SIZE 0x200000
157
158#define DIAG_BASE PHYS_TO_K0(0x01500000)
159#define DIAG_SIZE 0x300000
160
161#define ROUTE_BASE PHYS_TO_K0(0x01800000)
162#define ROUTE_SIZE 0x200000
163
164#define IP27PROM_FLASH_HDR PHYS_TO_K0(0x01300000)
165#define IP27PROM_FLASH_DATA PHYS_TO_K0(0x01301000)
166#define IP27PROM_CORP_MAX 32
167#define IP27PROM_CORP PHYS_TO_K0(0x01800000)
168#define IP27PROM_CORP_SIZE 0x10000
169#define IP27PROM_CORP_STK PHYS_TO_K0(0x01810000)
170#define IP27PROM_CORP_STKSIZE 0x2000
171#define IP27PROM_DECOMP_BUF PHYS_TO_K0(0x01900000)
172#define IP27PROM_DECOMP_SIZE 0xfff00
173
174#define IP27PROM_BASE PHYS_TO_K0(0x01a00000)
175#define IP27PROM_BASE_MAPPED (UNCAC_BASE | 0x1fc00000)
176#define IP27PROM_SIZE_MAX 0x100000
177
178#define IP27PROM_PCFG PHYS_TO_K0(0x01b00000)
179#define IP27PROM_PCFG_SIZE 0xd0000
180#define IP27PROM_ERRDMP PHYS_TO_K1(0x01bd0000)
181#define IP27PROM_ERRDMP_SIZE 0xf000
182
183#define IP27PROM_INIT_START PHYS_TO_K1(0x01bd0000)
184#define IP27PROM_CONSOLE PHYS_TO_K1(0x01bdf000)
185#define IP27PROM_CONSOLE_SIZE 0x200
186#define IP27PROM_NETUART PHYS_TO_K1(0x01bdf200)
187#define IP27PROM_NETUART_SIZE 0x100
188#define IP27PROM_UNUSED1 PHYS_TO_K1(0x01bdf300)
189#define IP27PROM_UNUSED1_SIZE 0x500
190#define IP27PROM_ELSC_BASE_A PHYS_TO_K0(0x01bdf800)
191#define IP27PROM_ELSC_BASE_B PHYS_TO_K0(0x01bdfc00)
192#define IP27PROM_STACK_A PHYS_TO_K0(0x01be0000)
193#define IP27PROM_STACK_B PHYS_TO_K0(0x01bf0000)
194#define IP27PROM_STACK_SHFT 16
195#define IP27PROM_STACK_SIZE (1 << IP27PROM_STACK_SHFT)
196#define IP27PROM_INIT_END PHYS_TO_K0(0x01c00000)
197
198#define SLAVESTACK_BASE PHYS_TO_K0(0x01580000)
199#define SLAVESTACK_SIZE 0x40000
200
201#define ENETBUFS_BASE PHYS_TO_K0(0x01f80000)
202#define ENETBUFS_SIZE 0x20000
203
204#define IO6PROM_BASE PHYS_TO_K0(0x01c00000)
205#define IO6PROM_SIZE 0x400000
206#define IO6PROM_BASE_MAPPED (UNCAC_BASE | 0x11c00000)
207#define IO6DPROM_BASE PHYS_TO_K0(0x01c00000)
208#define IO6DPROM_SIZE 0x200000
209
210#define NODEBUGUNIX_ADDR PHYS_TO_K0(0x00019000)
211#define DEBUGUNIX_ADDR PHYS_TO_K0(0x00100000)
212
213#define IP27PROM_INT_LAUNCH 10 /* and 11 */
214#define IP27PROM_INT_NETUART 12 /* through 17 */
215
216#endif /* PROM */
217
218/*
219 * needed by symmon so it needs to be outside #if PROM
220 */
221#define IP27PROM_ELSC_SHFT 10
222#define IP27PROM_ELSC_SIZE (1 << IP27PROM_ELSC_SHFT)
223
224/*
225 * This address is used by IO6PROM to build MemoryDescriptors of
226 * free memory. This address is important since unix gets loaded
227 * at this address, and this memory has to be FREE if unix is to
228 * be loaded.
229 */
230
231#define FREEMEM_BASE PHYS_TO_K0(0x2000000)
232
233#define IO6PROM_STACK_SHFT 14 /* stack per cpu */
234#define IO6PROM_STACK_SIZE (1 << IO6PROM_STACK_SHFT)
235
236/*
237 * IP27 PROM vectors
238 */
239
240#define IP27PROM_ENTRY PHYS_TO_COMPATK1(0x1fc00000)
241#define IP27PROM_RESTART PHYS_TO_COMPATK1(0x1fc00008)
242#define IP27PROM_SLAVELOOP PHYS_TO_COMPATK1(0x1fc00010)
243#define IP27PROM_PODMODE PHYS_TO_COMPATK1(0x1fc00018)
244#define IP27PROM_IOC3UARTPOD PHYS_TO_COMPATK1(0x1fc00020)
245#define IP27PROM_FLASHLEDS PHYS_TO_COMPATK1(0x1fc00028)
246#define IP27PROM_REPOD PHYS_TO_COMPATK1(0x1fc00030)
247#define IP27PROM_LAUNCHSLAVE PHYS_TO_COMPATK1(0x1fc00038)
248#define IP27PROM_WAITSLAVE PHYS_TO_COMPATK1(0x1fc00040)
249#define IP27PROM_POLLSLAVE PHYS_TO_COMPATK1(0x1fc00048)
250
251#define KL_UART_BASE LOCAL_HUB_ADDR(MD_UREG0_0) /* base of UART regs */
252#define KL_UART_CMD LOCAL_HUB_ADDR(MD_UREG0_0) /* UART command reg */
253#define KL_UART_DATA LOCAL_HUB_ADDR(MD_UREG0_1) /* UART data reg */
254#define KL_I2C_REG MD_UREG0_0 /* I2C reg */
255
256#ifndef __ASSEMBLY__
257
258/* Address 0x400 to 0x1000 ualias points to cache error eframe + misc
259 * CACHE_ERR_SP_PTR could either contain an address to the stack, or
260 * the stack could start at CACHE_ERR_SP_PTR
261 */
262#if defined(HUB_ERR_STS_WAR)
263#define CACHE_ERR_EFRAME 0x480
264#else /* HUB_ERR_STS_WAR */
265#define CACHE_ERR_EFRAME 0x400
266#endif /* HUB_ERR_STS_WAR */
267
268#define CACHE_ERR_ECCFRAME (CACHE_ERR_EFRAME + EF_SIZE)
269#define CACHE_ERR_SP_PTR (0x1000 - 32) /* why -32? TBD */
270#define CACHE_ERR_IBASE_PTR (0x1000 - 40)
271#define CACHE_ERR_SP (CACHE_ERR_SP_PTR - 16)
272#define CACHE_ERR_AREA_SIZE (ARCS_SPB_OFFSET - CACHE_ERR_EFRAME)
273
274#endif /* !__ASSEMBLY__ */
275
276#define _ARCSPROM
277
278#if defined(HUB_ERR_STS_WAR)
279
280#define ERR_STS_WAR_REGISTER IIO_IIBUSERR
281#define ERR_STS_WAR_ADDR LOCAL_HUB_ADDR(IIO_IIBUSERR)
282#define ERR_STS_WAR_PHYSADDR TO_PHYS((__psunsigned_t)ERR_STS_WAR_ADDR)
283 /* Used to match addr in error reg. */
284#define OLD_ERR_STS_WAR_OFFSET ((MD_MEM_BANKS * MD_BANK_SIZE) - 0x100)
285
286#endif /* HUB_ERR_STS_WAR */
287
288#endif /* _ASM_SN_SN0_ADDRS_H */
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h
deleted file mode 100644
index f734f2007f24..000000000000
--- a/include/asm-mips/sn/sn0/arch.h
+++ /dev/null
@@ -1,72 +0,0 @@
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 * SGI IP27 specific setup.
7 *
8 * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
10 */
11#ifndef _ASM_SN_SN0_ARCH_H
12#define _ASM_SN_SN0_ARCH_H
13
14
15#ifndef SN0XXL /* 128 cpu SMP max */
16/*
17 * This is the maximum number of nodes that can be part of a kernel.
18 * Effectively, it's the maximum number of compact node ids (cnodeid_t).
19 */
20#define MAX_COMPACT_NODES 64
21
22/*
23 * MAXCPUS refers to the maximum number of CPUs in a single kernel.
24 * This is not necessarily the same as MAXNODES * CPUS_PER_NODE
25 */
26#define MAXCPUS 128
27
28#else /* SN0XXL system */
29
30#define MAX_COMPACT_NODES 128
31#define MAXCPUS 256
32
33#endif /* SN0XXL */
34
35/*
36 * This is the maximum number of NASIDS that can be present in a system.
37 * (Highest NASID plus one.)
38 */
39#define MAX_NASIDS 256
40
41/*
42 * MAX_REGIONS refers to the maximum number of hardware partitioned regions.
43 */
44#define MAX_REGIONS 64
45#define MAX_NONPREMIUM_REGIONS 16
46#define MAX_PREMIUM_REGIONS MAX_REGIONS
47
48/*
49 * MAX_PARITIONS refers to the maximum number of logically defined
50 * partitions the system can support.
51 */
52#define MAX_PARTITIONS MAX_REGIONS
53
54#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8)
55
56/*
57 * Slot constants for SN0
58 */
59#ifdef CONFIG_SGI_SN_N_MODE
60#define MAX_MEM_SLOTS 16 /* max slots per node */
61#else /* !CONFIG_SGI_SN_N_MODE, assume CONFIG_SGI_SN_M_MODE */
62#define MAX_MEM_SLOTS 32 /* max slots per node */
63#endif /* CONFIG_SGI_SN_M_MODE */
64
65#define SLOT_SHIFT (27)
66#define SLOT_MIN_MEM_SIZE (32*1024*1024)
67
68#define CPUS_PER_NODE 2 /* CPUs on a single hub */
69#define CPUS_PER_NODE_SHFT 1 /* Bits to shift in the node number */
70#define CPUS_PER_SUBNODE 2 /* CPUs on a single hub PI */
71
72#endif /* _ASM_SN_SN0_ARCH_H */
diff --git a/include/asm-mips/sn/sn0/hub.h b/include/asm-mips/sn/sn0/hub.h
deleted file mode 100644
index 3e228f8e7969..000000000000
--- a/include/asm-mips/sn/sn0/hub.h
+++ /dev/null
@@ -1,40 +0,0 @@
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 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
7 * Copyright (C) 1999 by Ralf Baechle
8 */
9#ifndef _ASM_SN_SN0_HUB_H
10#define _ASM_SN_SN0_HUB_H
11
12/* The secret password; used to release protection */
13#define HUB_PASSWORD 0x53474972756c6573ull
14
15#define CHIPID_HUB 0
16#define CHIPID_ROUTER 1
17
18#define HUB_REV_1_0 1
19#define HUB_REV_2_0 2
20#define HUB_REV_2_1 3
21#define HUB_REV_2_2 4
22#define HUB_REV_2_3 5
23#define HUB_REV_2_4 6
24
25#define MAX_HUB_PATH 80
26
27#include <asm/sn/sn0/addrs.h>
28#include <asm/sn/sn0/hubpi.h>
29#include <asm/sn/sn0/hubmd.h>
30#include <asm/sn/sn0/hubio.h>
31#include <asm/sn/sn0/hubni.h>
32//#include <asm/sn/sn0/hubcore.h>
33
34/* Translation of uncached attributes */
35#define UATTR_HSPEC 0
36#define UATTR_IO 1
37#define UATTR_MSPEC 2
38#define UATTR_UNCAC 3
39
40#endif /* _ASM_SN_SN0_HUB_H */
diff --git a/include/asm-mips/sn/sn0/hubio.h b/include/asm-mips/sn/sn0/hubio.h
deleted file mode 100644
index 0187895e556c..000000000000
--- a/include/asm-mips/sn/sn0/hubio.h
+++ /dev/null
@@ -1,972 +0,0 @@
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 * Derived from IRIX <sys/SN/SN0/hubio.h>, Revision 1.80.
7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle
10 */
11#ifndef _ASM_SGI_SN_SN0_HUBIO_H
12#define _ASM_SGI_SN_SN0_HUBIO_H
13
14/*
15 * Hub I/O interface registers
16 *
17 * All registers in this file are subject to change until Hub chip tapeout.
18 * In general, the longer software name should be used when available.
19 */
20
21/*
22 * Slightly friendlier names for some common registers.
23 * The hardware definitions follow.
24 */
25#define IIO_WIDGET IIO_WID /* Widget identification */
26#define IIO_WIDGET_STAT IIO_WSTAT /* Widget status register */
27#define IIO_WIDGET_CTRL IIO_WCR /* Widget control register */
28#define IIO_WIDGET_TOUT IIO_WRTO /* Widget request timeout */
29#define IIO_WIDGET_FLUSH IIO_WTFR /* Widget target flush */
30#define IIO_PROTECT IIO_ILAPR /* IO interface protection */
31#define IIO_PROTECT_OVRRD IIO_ILAPO /* IO protect override */
32#define IIO_OUTWIDGET_ACCESS IIO_IOWA /* Outbound widget access */
33#define IIO_INWIDGET_ACCESS IIO_IIWA /* Inbound widget access */
34#define IIO_INDEV_ERR_MASK IIO_IIDEM /* Inbound device error mask */
35#define IIO_LLP_CSR IIO_ILCSR /* LLP control and status */
36#define IIO_LLP_LOG IIO_ILLR /* LLP log */
37#define IIO_XTALKCC_TOUT IIO_IXCC /* Xtalk credit count timeout*/
38#define IIO_XTALKTT_TOUT IIO_IXTT /* Xtalk tail timeout */
39#define IIO_IO_ERR_CLR IIO_IECLR /* IO error clear */
40#define IIO_BTE_CRB_CNT IIO_IBCN /* IO BTE CRB count */
41
42#define IIO_LLP_CSR_IS_UP 0x00002000
43#define IIO_LLP_CSR_LLP_STAT_MASK 0x00003000
44#define IIO_LLP_CSR_LLP_STAT_SHFT 12
45
46/* key to IIO_PROTECT_OVRRD */
47#define IIO_PROTECT_OVRRD_KEY 0x53474972756c6573ull /* "SGIrules" */
48
49/* BTE register names */
50#define IIO_BTE_STAT_0 IIO_IBLS_0 /* Also BTE length/status 0 */
51#define IIO_BTE_SRC_0 IIO_IBSA_0 /* Also BTE source address 0 */
52#define IIO_BTE_DEST_0 IIO_IBDA_0 /* Also BTE dest. address 0 */
53#define IIO_BTE_CTRL_0 IIO_IBCT_0 /* Also BTE control/terminate 0 */
54#define IIO_BTE_NOTIFY_0 IIO_IBNA_0 /* Also BTE notification 0 */
55#define IIO_BTE_INT_0 IIO_IBIA_0 /* Also BTE interrupt 0 */
56#define IIO_BTE_OFF_0 0 /* Base offset from BTE 0 regs. */
57#define IIO_BTE_OFF_1 IIO_IBLS_1 - IIO_IBLS_0 /* Offset from base to BTE 1 */
58
59/* BTE register offsets from base */
60#define BTEOFF_STAT 0
61#define BTEOFF_SRC (IIO_BTE_SRC_0 - IIO_BTE_STAT_0)
62#define BTEOFF_DEST (IIO_BTE_DEST_0 - IIO_BTE_STAT_0)
63#define BTEOFF_CTRL (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0)
64#define BTEOFF_NOTIFY (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0)
65#define BTEOFF_INT (IIO_BTE_INT_0 - IIO_BTE_STAT_0)
66
67
68/*
69 * The following definitions use the names defined in the IO interface
70 * document for ease of reference. When possible, software should
71 * generally use the longer but clearer names defined above.
72 */
73
74#define IIO_BASE 0x400000
75#define IIO_BASE_BTE0 0x410000
76#define IIO_BASE_BTE1 0x420000
77#define IIO_BASE_PERF 0x430000
78#define IIO_PERF_CNT 0x430008
79
80#define IO_PERF_SETS 32
81
82#define IIO_WID 0x400000 /* Widget identification */
83#define IIO_WSTAT 0x400008 /* Widget status */
84#define IIO_WCR 0x400020 /* Widget control */
85
86#define IIO_WSTAT_ECRAZY (1ULL << 32) /* Hub gone crazy */
87#define IIO_WSTAT_TXRETRY (1ULL << 9) /* Hub Tx Retry timeout */
88#define IIO_WSTAT_TXRETRY_MASK (0x7F)
89#define IIO_WSTAT_TXRETRY_SHFT (16)
90#define IIO_WSTAT_TXRETRY_CNT(w) (((w) >> IIO_WSTAT_TXRETRY_SHFT) & \
91 IIO_WSTAT_TXRETRY_MASK)
92
93#define IIO_ILAPR 0x400100 /* Local Access Protection */
94#define IIO_ILAPO 0x400108 /* Protection override */
95#define IIO_IOWA 0x400110 /* outbound widget access */
96#define IIO_IIWA 0x400118 /* inbound widget access */
97#define IIO_IIDEM 0x400120 /* Inbound Device Error Mask */
98#define IIO_ILCSR 0x400128 /* LLP control and status */
99#define IIO_ILLR 0x400130 /* LLP Log */
100#define IIO_IIDSR 0x400138 /* Interrupt destination */
101
102#define IIO_IIBUSERR 0x1400208 /* Reads here cause a bus error. */
103
104/* IO Interrupt Destination Register */
105#define IIO_IIDSR_SENT_SHIFT 28
106#define IIO_IIDSR_SENT_MASK 0x10000000
107#define IIO_IIDSR_ENB_SHIFT 24
108#define IIO_IIDSR_ENB_MASK 0x01000000
109#define IIO_IIDSR_NODE_SHIFT 8
110#define IIO_IIDSR_NODE_MASK 0x0000ff00
111#define IIO_IIDSR_LVL_SHIFT 0
112#define IIO_IIDSR_LVL_MASK 0x0000003f
113
114
115/* GFX Flow Control Node/Widget Register */
116#define IIO_IGFX_0 0x400140 /* gfx node/widget register 0 */
117#define IIO_IGFX_1 0x400148 /* gfx node/widget register 1 */
118#define IIO_IGFX_W_NUM_BITS 4 /* size of widget num field */
119#define IIO_IGFX_W_NUM_MASK ((1<<IIO_IGFX_W_NUM_BITS)-1)
120#define IIO_IGFX_W_NUM_SHIFT 0
121#define IIO_IGFX_N_NUM_BITS 9 /* size of node num field */
122#define IIO_IGFX_N_NUM_MASK ((1<<IIO_IGFX_N_NUM_BITS)-1)
123#define IIO_IGFX_N_NUM_SHIFT 4
124#define IIO_IGFX_P_NUM_BITS 1 /* size of processor num field */
125#define IIO_IGFX_P_NUM_MASK ((1<<IIO_IGFX_P_NUM_BITS)-1)
126#define IIO_IGFX_P_NUM_SHIFT 16
127#define IIO_IGFX_VLD_BITS 1 /* size of valid field */
128#define IIO_IGFX_VLD_MASK ((1<<IIO_IGFX_VLD_BITS)-1)
129#define IIO_IGFX_VLD_SHIFT 20
130#define IIO_IGFX_INIT(widget, node, cpu, valid) (\
131 (((widget) & IIO_IGFX_W_NUM_MASK) << IIO_IGFX_W_NUM_SHIFT) | \
132 (((node) & IIO_IGFX_N_NUM_MASK) << IIO_IGFX_N_NUM_SHIFT) | \
133 (((cpu) & IIO_IGFX_P_NUM_MASK) << IIO_IGFX_P_NUM_SHIFT) | \
134 (((valid) & IIO_IGFX_VLD_MASK) << IIO_IGFX_VLD_SHIFT) )
135
136/* Scratch registers (not all bits available) */
137#define IIO_SCRATCH_REG0 0x400150
138#define IIO_SCRATCH_REG1 0x400158
139#define IIO_SCRATCH_MASK 0x0000000f00f11fff
140
141#define IIO_SCRATCH_BIT0_0 0x0000000800000000
142#define IIO_SCRATCH_BIT0_1 0x0000000400000000
143#define IIO_SCRATCH_BIT0_2 0x0000000200000000
144#define IIO_SCRATCH_BIT0_3 0x0000000100000000
145#define IIO_SCRATCH_BIT0_4 0x0000000000800000
146#define IIO_SCRATCH_BIT0_5 0x0000000000400000
147#define IIO_SCRATCH_BIT0_6 0x0000000000200000
148#define IIO_SCRATCH_BIT0_7 0x0000000000100000
149#define IIO_SCRATCH_BIT0_8 0x0000000000010000
150#define IIO_SCRATCH_BIT0_9 0x0000000000001000
151#define IIO_SCRATCH_BIT0_R 0x0000000000000fff
152
153/* IO Translation Table Entries */
154#define IIO_NUM_ITTES 7 /* ITTEs numbered 0..6 */
155 /* Hw manuals number them 1..7! */
156
157/*
158 * As a permanent workaround for a bug in the PI side of the hub, we've
159 * redefined big window 7 as small window 0.
160 */
161#define HUB_NUM_BIG_WINDOW IIO_NUM_ITTES - 1
162
163/*
164 * Use the top big window as a surrogate for the first small window
165 */
166#define SWIN0_BIGWIN HUB_NUM_BIG_WINDOW
167
168#define ILCSR_WARM_RESET 0x100
169/*
170 * The IO LLP control status register and widget control register
171 */
172#ifndef __ASSEMBLY__
173
174typedef union hubii_wid_u {
175 u64 wid_reg_value;
176 struct {
177 u64 wid_rsvd: 32, /* unused */
178 wid_rev_num: 4, /* revision number */
179 wid_part_num: 16, /* the widget type: hub=c101 */
180 wid_mfg_num: 11, /* Manufacturer id (IBM) */
181 wid_rsvd1: 1; /* Reserved */
182 } wid_fields_s;
183} hubii_wid_t;
184
185
186typedef union hubii_wcr_u {
187 u64 wcr_reg_value;
188 struct {
189 u64 wcr_rsvd: 41, /* unused */
190 wcr_e_thresh: 5, /* elasticity threshold */
191 wcr_dir_con: 1, /* widget direct connect */
192 wcr_f_bad_pkt: 1, /* Force bad llp pkt enable */
193 wcr_xbar_crd: 3, /* LLP crossbar credit */
194 wcr_rsvd1: 8, /* Reserved */
195 wcr_tag_mode: 1, /* Tag mode */
196 wcr_widget_id: 4; /* LLP crossbar credit */
197 } wcr_fields_s;
198} hubii_wcr_t;
199
200#define iwcr_dir_con wcr_fields_s.wcr_dir_con
201
202typedef union hubii_wstat_u {
203 u64 reg_value;
204 struct {
205 u64 rsvd1: 31,
206 crazy: 1, /* Crazy bit */
207 rsvd2: 8,
208 llp_tx_cnt: 8, /* LLP Xmit retry counter */
209 rsvd3: 6,
210 tx_max_rtry: 1, /* LLP Retry Timeout Signal */
211 rsvd4: 2,
212 xt_tail_to: 1, /* Xtalk Tail Timeout */
213 xt_crd_to: 1, /* Xtalk Credit Timeout */
214 pending: 4; /* Pending Requests */
215 } wstat_fields_s;
216} hubii_wstat_t;
217
218
219typedef union hubii_ilcsr_u {
220 u64 icsr_reg_value;
221 struct {
222 u64 icsr_rsvd: 22, /* unused */
223 icsr_max_burst: 10, /* max burst */
224 icsr_rsvd4: 6, /* reserved */
225 icsr_max_retry: 10, /* max retry */
226 icsr_rsvd3: 2, /* reserved */
227 icsr_lnk_stat: 2, /* link status */
228 icsr_bm8: 1, /* Bit mode 8 */
229 icsr_llp_en: 1, /* LLP enable bit */
230 icsr_rsvd2: 1, /* reserver */
231 icsr_wrm_reset: 1, /* Warm reset bit */
232 icsr_rsvd1: 2, /* Data ready offset */
233 icsr_null_to: 6; /* Null timeout */
234
235 } icsr_fields_s;
236} hubii_ilcsr_t;
237
238
239typedef union hubii_iowa_u {
240 u64 iowa_reg_value;
241 struct {
242 u64 iowa_rsvd: 48, /* unused */
243 iowa_wxoac: 8, /* xtalk widget access bits */
244 iowa_rsvd1: 7, /* xtalk widget access bits */
245 iowa_w0oac: 1; /* xtalk widget access bits */
246 } iowa_fields_s;
247} hubii_iowa_t;
248
249typedef union hubii_iiwa_u {
250 u64 iiwa_reg_value;
251 struct {
252 u64 iiwa_rsvd: 48, /* unused */
253 iiwa_wxiac: 8, /* hub wid access bits */
254 iiwa_rsvd1: 7, /* reserved */
255 iiwa_w0iac: 1; /* hub wid0 access */
256 } iiwa_fields_s;
257} hubii_iiwa_t;
258
259typedef union hubii_illr_u {
260 u64 illr_reg_value;
261 struct {
262 u64 illr_rsvd: 32, /* unused */
263 illr_cb_cnt: 16, /* checkbit error count */
264 illr_sn_cnt: 16; /* sequence number count */
265 } illr_fields_s;
266} hubii_illr_t;
267
268/* The structures below are defined to extract and modify the ii
269performance registers */
270
271/* io_perf_sel allows the caller to specify what tests will be
272 performed */
273typedef union io_perf_sel {
274 u64 perf_sel_reg;
275 struct {
276 u64 perf_rsvd : 48,
277 perf_icct : 8,
278 perf_ippr1 : 4,
279 perf_ippr0 : 4;
280 } perf_sel_bits;
281} io_perf_sel_t;
282
283/* io_perf_cnt is to extract the count from the hub registers. Due to
284 hardware problems there is only one counter, not two. */
285
286typedef union io_perf_cnt {
287 u64 perf_cnt;
288 struct {
289 u64 perf_rsvd1 : 32,
290 perf_rsvd2 : 12,
291 perf_cnt : 20;
292 } perf_cnt_bits;
293} io_perf_cnt_t;
294
295#endif /* !__ASSEMBLY__ */
296
297
298#define LNK_STAT_WORKING 0x2
299
300#define IIO_LLP_CB_MAX 0xffff
301#define IIO_LLP_SN_MAX 0xffff
302
303/* IO PRB Entries */
304#define IIO_NUM_IPRBS (9)
305#define IIO_IOPRB_0 0x400198 /* PRB entry 0 */
306#define IIO_IOPRB_8 0x4001a0 /* PRB entry 8 */
307#define IIO_IOPRB_9 0x4001a8 /* PRB entry 9 */
308#define IIO_IOPRB_A 0x4001b0 /* PRB entry a */
309#define IIO_IOPRB_B 0x4001b8 /* PRB entry b */
310#define IIO_IOPRB_C 0x4001c0 /* PRB entry c */
311#define IIO_IOPRB_D 0x4001c8 /* PRB entry d */
312#define IIO_IOPRB_E 0x4001d0 /* PRB entry e */
313#define IIO_IOPRB_F 0x4001d8 /* PRB entry f */
314
315
316#define IIO_IXCC 0x4001e0 /* Crosstalk credit count timeout */
317#define IIO_IXTCC IIO_IXCC
318#define IIO_IMEM 0x4001e8 /* Miscellaneous Enable Mask */
319#define IIO_IXTT 0x4001f0 /* Crosstalk tail timeout */
320#define IIO_IECLR 0x4001f8 /* IO error clear */
321#define IIO_IBCN 0x400200 /* IO BTE CRB count */
322
323/*
324 * IIO_IMEM Register fields.
325 */
326#define IIO_IMEM_W0ESD 0x1 /* Widget 0 shut down due to error */
327#define IIO_IMEM_B0ESD (1 << 4) /* BTE 0 shut down due to error */
328#define IIO_IMEM_B1ESD (1 << 8) /* BTE 1 Shut down due to error */
329
330/* PIO Read address Table Entries */
331#define IIO_IPCA 0x400300 /* PRB Counter adjust */
332#define IIO_NUM_PRTES 8 /* Total number of PRB table entries */
333#define IIO_PRTE_0 0x400308 /* PIO Read address table entry 0 */
334#define IIO_PRTE(_x) (IIO_PRTE_0 + (8 * (_x)))
335#define IIO_WIDPRTE(x) IIO_PRTE(((x) - 8)) /* widget ID to its PRTE num */
336#define IIO_IPDR 0x400388 /* PIO table entry deallocation */
337#define IIO_ICDR 0x400390 /* CRB Entry Deallocation */
338#define IIO_IFDR 0x400398 /* IOQ FIFO Depth */
339#define IIO_IIAP 0x4003a0 /* IIQ Arbitration Parameters */
340#define IIO_IMMR IIO_IIAP
341#define IIO_ICMR 0x4003a8 /* CRB Management Register */
342#define IIO_ICCR 0x4003b0 /* CRB Control Register */
343#define IIO_ICTO 0x4003b8 /* CRB Time Out Register */
344#define IIO_ICTP 0x4003c0 /* CRB Time Out Prescalar */
345
346
347/*
348 * ICMR register fields
349 */
350#define IIO_ICMR_PC_VLD_SHFT 36
351#define IIO_ICMR_PC_VLD_MASK (0x7fffUL << IIO_ICMR_PC_VLD_SHFT)
352
353#define IIO_ICMR_CRB_VLD_SHFT 20
354#define IIO_ICMR_CRB_VLD_MASK (0x7fffUL << IIO_ICMR_CRB_VLD_SHFT)
355
356#define IIO_ICMR_FC_CNT_SHFT 16
357#define IIO_ICMR_FC_CNT_MASK (0xf << IIO_ICMR_FC_CNT_SHFT)
358
359#define IIO_ICMR_C_CNT_SHFT 4
360#define IIO_ICMR_C_CNT_MASK (0xf << IIO_ICMR_C_CNT_SHFT)
361
362#define IIO_ICMR_P_CNT_SHFT 0
363#define IIO_ICMR_P_CNT_MASK (0xf << IIO_ICMR_P_CNT_SHFT)
364
365#define IIO_ICMR_PRECISE (1UL << 52)
366#define IIO_ICMR_CLR_RPPD (1UL << 13)
367#define IIO_ICMR_CLR_RQPD (1UL << 12)
368
369/*
370 * IIO PIO Deallocation register field masks : (IIO_IPDR)
371 */
372#define IIO_IPDR_PND (1 << 4)
373
374/*
375 * IIO CRB deallocation register field masks: (IIO_ICDR)
376 */
377#define IIO_ICDR_PND (1 << 4)
378
379/*
380 * IIO CRB control register Fields: IIO_ICCR
381 */
382#define IIO_ICCR_PENDING (0x10000)
383#define IIO_ICCR_CMD_MASK (0xFF)
384#define IIO_ICCR_CMD_SHFT (7)
385#define IIO_ICCR_CMD_NOP (0x0) /* No Op */
386#define IIO_ICCR_CMD_WAKE (0x100) /* Reactivate CRB entry and process */
387#define IIO_ICCR_CMD_TIMEOUT (0x200) /* Make CRB timeout & mark invalid */
388#define IIO_ICCR_CMD_EJECT (0x400) /* Contents of entry written to memory
389 * via a WB
390 */
391#define IIO_ICCR_CMD_FLUSH (0x800)
392
393/*
394 * CRB manipulation macros
395 * The CRB macros are slightly complicated, since there are up to
396 * four registers associated with each CRB entry.
397 */
398#define IIO_NUM_CRBS 15 /* Number of CRBs */
399#define IIO_NUM_NORMAL_CRBS 12 /* Number of regular CRB entries */
400#define IIO_NUM_PC_CRBS 4 /* Number of partial cache CRBs */
401#define IIO_ICRB_OFFSET 8
402#define IIO_ICRB_0 0x400400
403/* XXX - This is now tuneable:
404 #define IIO_FIRST_PC_ENTRY 12
405 */
406
407#define IIO_ICRB_A(_x) (IIO_ICRB_0 + (4 * IIO_ICRB_OFFSET * (_x)))
408#define IIO_ICRB_B(_x) (IIO_ICRB_A(_x) + 1*IIO_ICRB_OFFSET)
409#define IIO_ICRB_C(_x) (IIO_ICRB_A(_x) + 2*IIO_ICRB_OFFSET)
410#define IIO_ICRB_D(_x) (IIO_ICRB_A(_x) + 3*IIO_ICRB_OFFSET)
411
412/* XXX - IBUE register coming for Hub 2 */
413
414/*
415 *
416 * CRB Register description.
417 *
418 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
419 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
420 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
421 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
422 * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING
423 *
424 * Many of the fields in CRB are status bits used by hardware
425 * for implementation of the protocol. It's very dangerous to
426 * mess around with the CRB registers.
427 *
428 * It's OK to read the CRB registers and try to make sense out of the
429 * fields in CRB.
430 *
431 * Updating CRB requires all activities in Hub IIO to be quiesced.
432 * otherwise, a write to CRB could corrupt other CRB entries.
433 * CRBs are here only as a back door peek to hub IIO's status.
434 * Quiescing implies no dmas no PIOs
435 * either directly from the cpu or from sn0net.
436 * this is not something that can be done easily. So, AVOID updating
437 * CRBs.
438 */
439
440/*
441 * Fields in CRB Register A
442 */
443#ifndef __ASSEMBLY__
444typedef union icrba_u {
445 u64 reg_value;
446 struct {
447 u64 resvd: 6,
448 stall_bte0: 1, /* Stall BTE 0 */
449 stall_bte1: 1, /* Stall BTE 1 */
450 error: 1, /* CRB has an error */
451 ecode: 3, /* Error Code */
452 lnetuce: 1, /* SN0net Uncorrectable error */
453 mark: 1, /* CRB Has been marked */
454 xerr: 1, /* Error bit set in xtalk header */
455 sidn: 4, /* SIDN field from xtalk */
456 tnum: 5, /* TNUM field in xtalk */
457 addr: 38, /* Address of request */
458 valid: 1, /* Valid status */
459 iow: 1; /* IO Write operation */
460 } icrba_fields_s;
461} icrba_t;
462
463/* This is an alternate typedef for the HUB1 CRB A in order to allow
464 runtime selection of the format based on the REV_ID field of the
465 NI_STATUS_REV_ID register. */
466typedef union h1_icrba_u {
467 u64 reg_value;
468
469 struct {
470 u64 resvd: 6,
471 unused: 1, /* Unused but RW!! */
472 error: 1, /* CRB has an error */
473 ecode: 4, /* Error Code */
474 lnetuce: 1, /* SN0net Uncorrectable error */
475 mark: 1, /* CRB Has been marked */
476 xerr: 1, /* Error bit set in xtalk header */
477 sidn: 4, /* SIDN field from xtalk */
478 tnum: 5, /* TNUM field in xtalk */
479 addr: 38, /* Address of request */
480 valid: 1, /* Valid status */
481 iow: 1; /* IO Write operation */
482 } h1_icrba_fields_s;
483} h1_icrba_t;
484
485/* XXX - Is this still right? Check the spec. */
486#define ICRBN_A_CERR_SHFT 54
487#define ICRBN_A_ERR_MASK 0x3ff
488
489#endif /* !__ASSEMBLY__ */
490
491#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */
492
493/*
494 * values for "ecode" field
495 */
496#define IIO_ICRB_ECODE_DERR 0 /* Directory error due to IIO access */
497#define IIO_ICRB_ECODE_PERR 1 /* Poison error on IO access */
498#define IIO_ICRB_ECODE_WERR 2 /* Write error by IIO access
499 * e.g. WINV to a Read only line.
500 */
501#define IIO_ICRB_ECODE_AERR 3 /* Access error caused by IIO access */
502#define IIO_ICRB_ECODE_PWERR 4 /* Error on partial write */
503#define IIO_ICRB_ECODE_PRERR 5 /* Error on partial read */
504#define IIO_ICRB_ECODE_TOUT 6 /* CRB timeout before deallocating */
505#define IIO_ICRB_ECODE_XTERR 7 /* Incoming xtalk pkt had error bit */
506
507
508
509/*
510 * Fields in CRB Register B
511 */
512#ifndef __ASSEMBLY__
513typedef union icrbb_u {
514 u64 reg_value;
515 struct {
516 u64 rsvd1: 5,
517 btenum: 1, /* BTE to which entry belongs to */
518 cohtrans: 1, /* Coherent transaction */
519 xtsize: 2, /* Xtalk operation size
520 * 0: Double Word
521 * 1: 32 Bytes.
522 * 2: 128 Bytes,
523 * 3: Reserved.
524 */
525 srcnode: 9, /* Source Node ID */
526 srcinit: 2, /* Source Initiator:
527 * See below for field values.
528 */
529 useold: 1, /* Use OLD command for processing */
530 imsgtype: 2, /* Incoming message type
531 * see below for field values
532 */
533 imsg: 8, /* Incoming message */
534 initator: 3, /* Initiator of original request
535 * See below for field values.
536 */
537 reqtype: 5, /* Identifies type of request
538 * See below for field values.
539 */
540 rsvd2: 7,
541 ackcnt: 11, /* Invalidate ack count */
542 resp: 1, /* data response given to processor */
543 ack: 1, /* indicates data ack received */
544 hold: 1, /* entry is gathering inval acks */
545 wb_pend:1, /* waiting for writeback to complete */
546 intvn: 1, /* Intervention */
547 stall_ib: 1, /* Stall Ibuf (from crosstalk) */
548 stall_intr: 1; /* Stall internal interrupts */
549 } icrbb_field_s;
550} icrbb_t;
551
552/* This is an alternate typedef for the HUB1 CRB B in order to allow
553 runtime selection of the format based on the REV_ID field of the
554 NI_STATUS_REV_ID register. */
555typedef union h1_icrbb_u {
556 u64 reg_value;
557 struct {
558 u64 rsvd1: 5,
559 btenum: 1, /* BTE to which entry belongs to */
560 cohtrans: 1, /* Coherent transaction */
561 xtsize: 2, /* Xtalk operation size
562 * 0: Double Word
563 * 1: 32 Bytes.
564 * 2: 128 Bytes,
565 * 3: Reserved.
566 */
567 srcnode: 9, /* Source Node ID */
568 srcinit: 2, /* Source Initiator:
569 * See below for field values.
570 */
571 useold: 1, /* Use OLD command for processing */
572 imsgtype: 2, /* Incoming message type
573 * see below for field values
574 */
575 imsg: 8, /* Incoming message */
576 initator: 3, /* Initiator of original request
577 * See below for field values.
578 */
579 rsvd2: 1,
580 pcache: 1, /* entry belongs to partial cache */
581 reqtype: 5, /* Identifies type of request
582 * See below for field values.
583 */
584 stl_ib: 1, /* stall Ibus coming from xtalk */
585 stl_intr: 1, /* Stall internal interrupts */
586 stl_bte0: 1, /* Stall BTE 0 */
587 stl_bte1: 1, /* Stall BTE 1 */
588 intrvn: 1, /* Req was target of intervention */
589 ackcnt: 11, /* Invalidate ack count */
590 resp: 1, /* data response given to processor */
591 ack: 1, /* indicates data ack received */
592 hold: 1, /* entry is gathering inval acks */
593 wb_pend:1, /* waiting for writeback to complete */
594 sleep: 1, /* xtalk req sleeping till IO-sync */
595 pnd_reply: 1, /* replies not issed due to IOQ full */
596 pnd_req: 1; /* reqs not issued due to IOQ full */
597 } h1_icrbb_field_s;
598} h1_icrbb_t;
599
600
601#define b_imsgtype icrbb_field_s.imsgtype
602#define b_btenum icrbb_field_s.btenum
603#define b_cohtrans icrbb_field_s.cohtrans
604#define b_xtsize icrbb_field_s.xtsize
605#define b_srcnode icrbb_field_s.srcnode
606#define b_srcinit icrbb_field_s.srcinit
607#define b_imsgtype icrbb_field_s.imsgtype
608#define b_imsg icrbb_field_s.imsg
609#define b_initiator icrbb_field_s.initiator
610
611#endif /* !__ASSEMBLY__ */
612
613/*
614 * values for field xtsize
615 */
616#define IIO_ICRB_XTSIZE_DW 0 /* Xtalk operation size is 8 bytes */
617#define IIO_ICRB_XTSIZE_32 1 /* Xtalk operation size is 32 bytes */
618#define IIO_ICRB_XTSIZE_128 2 /* Xtalk operation size is 128 bytes */
619
620/*
621 * values for field srcinit
622 */
623#define IIO_ICRB_PROC0 0 /* Source of request is Proc 0 */
624#define IIO_ICRB_PROC1 1 /* Source of request is Proc 1 */
625#define IIO_ICRB_GB_REQ 2 /* Source is Guranteed BW request */
626#define IIO_ICRB_IO_REQ 3 /* Source is Normal IO request */
627
628/*
629 * Values for field imsgtype
630 */
631#define IIO_ICRB_IMSGT_XTALK 0 /* Incoming Meessage from Xtalk */
632#define IIO_ICRB_IMSGT_BTE 1 /* Incoming message from BTE */
633#define IIO_ICRB_IMSGT_SN0NET 2 /* Incoming message from SN0 net */
634#define IIO_ICRB_IMSGT_CRB 3 /* Incoming message from CRB ??? */
635
636/*
637 * values for field initiator.
638 */
639#define IIO_ICRB_INIT_XTALK 0 /* Message originated in xtalk */
640#define IIO_ICRB_INIT_BTE0 0x1 /* Message originated in BTE 0 */
641#define IIO_ICRB_INIT_SN0NET 0x2 /* Message originated in SN0net */
642#define IIO_ICRB_INIT_CRB 0x3 /* Message originated in CRB ? */
643#define IIO_ICRB_INIT_BTE1 0x5 /* MEssage originated in BTE 1 */
644
645/*
646 * Values for field reqtype.
647 */
648/* XXX - Need to fix this for Hub 2 */
649#define IIO_ICRB_REQ_DWRD 0 /* Request type double word */
650#define IIO_ICRB_REQ_QCLRD 1 /* Request is Qrtr Caceh line Rd */
651#define IIO_ICRB_REQ_BLKRD 2 /* Request is block read */
652#define IIO_ICRB_REQ_RSHU 6 /* Request is BTE block read */
653#define IIO_ICRB_REQ_REXU 7 /* request is BTE Excl Read */
654#define IIO_ICRB_REQ_RDEX 8 /* Request is Read Exclusive */
655#define IIO_ICRB_REQ_WINC 9 /* Request is Write Invalidate */
656#define IIO_ICRB_REQ_BWINV 10 /* Request is BTE Winv */
657#define IIO_ICRB_REQ_PIORD 11 /* Request is PIO read */
658#define IIO_ICRB_REQ_PIOWR 12 /* Request is PIO Write */
659#define IIO_ICRB_REQ_PRDM 13 /* Request is Fetch&Op */
660#define IIO_ICRB_REQ_PWRM 14 /* Request is Store &Op */
661#define IIO_ICRB_REQ_PTPWR 15 /* Request is Peer to peer */
662#define IIO_ICRB_REQ_WB 16 /* Request is Write back */
663#define IIO_ICRB_REQ_DEX 17 /* Retained DEX Cache line */
664
665/*
666 * Fields in CRB Register C
667 */
668
669#ifndef __ASSEMBLY__
670
671typedef union icrbc_s {
672 u64 reg_value;
673 struct {
674 u64 rsvd: 6,
675 sleep: 1,
676 pricnt: 4, /* Priority count sent with Read req */
677 pripsc: 4, /* Priority Pre scalar */
678 bteop: 1, /* BTE Operation */
679 push_be: 34, /* Push address Byte enable
680 * Holds push addr, if CRB is for BTE
681 * If CRB belongs to Partial cache,
682 * this contains byte enables bits
683 * ([47:46] = 0)
684 */
685 suppl: 11, /* Supplemental field */
686 barrop: 1, /* Barrier Op bit set in xtalk req */
687 doresp: 1, /* Xtalk req needs a response */
688 gbr: 1; /* GBR bit set in xtalk packet */
689 } icrbc_field_s;
690} icrbc_t;
691
692#define c_pricnt icrbc_field_s.pricnt
693#define c_pripsc icrbc_field_s.pripsc
694#define c_bteop icrbc_field_s.bteop
695#define c_bteaddr icrbc_field_s.push_be /* push_be field has 2 names */
696#define c_benable icrbc_field_s.push_be /* push_be field has 2 names */
697#define c_suppl icrbc_field_s.suppl
698#define c_barrop icrbc_field_s.barrop
699#define c_doresp icrbc_field_s.doresp
700#define c_gbr icrbc_field_s.gbr
701#endif /* !__ASSEMBLY__ */
702
703/*
704 * Fields in CRB Register D
705 */
706
707#ifndef __ASSEMBLY__
708typedef union icrbd_s {
709 u64 reg_value;
710 struct {
711 u64 rsvd: 38,
712 toutvld: 1, /* Timeout in progress for this CRB */
713 ctxtvld: 1, /* Context field below is valid */
714 rsvd2: 1,
715 context: 15, /* Bit vector:
716 * Has a bit set for each CRB entry
717 * which needs to be deallocated
718 * before this CRB entry is processed.
719 * Set only for barrier operations.
720 */
721 timeout: 8; /* Timeout Upper 8 bits */
722 } icrbd_field_s;
723} icrbd_t;
724
725#define icrbd_toutvld icrbd_field_s.toutvld
726#define icrbd_ctxtvld icrbd_field_s.ctxtvld
727#define icrbd_context icrbd_field_s.context
728
729
730typedef union hubii_ifdr_u {
731 u64 hi_ifdr_value;
732 struct {
733 u64 ifdr_rsvd: 49,
734 ifdr_maxrp: 7,
735 ifdr_rsvd1: 1,
736 ifdr_maxrq: 7;
737 } hi_ifdr_fields;
738} hubii_ifdr_t;
739
740#endif /* !__ASSEMBLY__ */
741
742/*
743 * Hardware designed names for the BTE control registers.
744 */
745#define IIO_IBLS_0 0x410000 /* BTE length/status 0 */
746#define IIO_IBSA_0 0x410008 /* BTE source address 0 */
747#define IIO_IBDA_0 0x410010 /* BTE destination address 0 */
748#define IIO_IBCT_0 0x410018 /* BTE control/terminate 0 */
749#define IIO_IBNA_0 0x410020 /* BTE notification address 0 */
750#define IIO_IBNR_0 IIO_IBNA_0
751#define IIO_IBIA_0 0x410028 /* BTE interrupt address 0 */
752
753#define IIO_IBLS_1 0x420000 /* BTE length/status 1 */
754#define IIO_IBSA_1 0x420008 /* BTE source address 1 */
755#define IIO_IBDA_1 0x420010 /* BTE destination address 1 */
756#define IIO_IBCT_1 0x420018 /* BTE control/terminate 1 */
757#define IIO_IBNA_1 0x420020 /* BTE notification address 1 */
758#define IIO_IBNR_1 IIO_IBNA_1
759#define IIO_IBIA_1 0x420028 /* BTE interrupt address 1 */
760
761/*
762 * More miscellaneous registers
763 */
764#define IIO_IPCR 0x430000 /* Performance Control */
765#define IIO_IPPR 0x430008 /* Performance Profiling */
766
767/*
768 * IO Error Clear register bit field definitions
769 */
770#define IECLR_BTE1 (1 << 18) /* clear bte error 1 ??? */
771#define IECLR_BTE0 (1 << 17) /* clear bte error 0 ??? */
772#define IECLR_CRAZY (1 << 16) /* clear crazy bit in wstat reg */
773#define IECLR_PRB_F (1 << 15) /* clear err bit in PRB_F reg */
774#define IECLR_PRB_E (1 << 14) /* clear err bit in PRB_E reg */
775#define IECLR_PRB_D (1 << 13) /* clear err bit in PRB_D reg */
776#define IECLR_PRB_C (1 << 12) /* clear err bit in PRB_C reg */
777#define IECLR_PRB_B (1 << 11) /* clear err bit in PRB_B reg */
778#define IECLR_PRB_A (1 << 10) /* clear err bit in PRB_A reg */
779#define IECLR_PRB_9 (1 << 9) /* clear err bit in PRB_9 reg */
780#define IECLR_PRB_8 (1 << 8) /* clear err bit in PRB_8 reg */
781#define IECLR_PRB_0 (1 << 0) /* clear err bit in PRB_0 reg */
782
783/*
784 * IO PIO Read Table Entry format
785 */
786
787#ifndef __ASSEMBLY__
788
789typedef union iprte_a {
790 u64 entry;
791 struct {
792 u64 rsvd1 : 7, /* Reserved field */
793 valid : 1, /* Maps to a timeout entry */
794 rsvd2 : 1,
795 srcnode : 9, /* Node which did this PIO */
796 initiator : 2, /* If T5A or T5B or IO */
797 rsvd3 : 3,
798 addr : 38, /* Physical address of PIO */
799 rsvd4 : 3;
800 } iprte_fields;
801} iprte_a_t;
802
803#define iprte_valid iprte_fields.valid
804#define iprte_timeout iprte_fields.timeout
805#define iprte_srcnode iprte_fields.srcnode
806#define iprte_init iprte_fields.initiator
807#define iprte_addr iprte_fields.addr
808
809#endif /* !__ASSEMBLY__ */
810
811#define IPRTE_ADDRSHFT 3
812
813/*
814 * Hub IIO PRB Register format.
815 */
816
817#ifndef __ASSEMBLY__
818/*
819 * Note: Fields bnakctr, anakctr, xtalkctrmode, ovflow fields are
820 * "Status" fields, and should only be used in case of clean up after errors.
821 */
822
823typedef union iprb_u {
824 u64 reg_value;
825 struct {
826 u64 rsvd1: 15,
827 error: 1, /* Widget rcvd wr resp pkt w/ error */
828 ovflow: 5, /* Over flow count. perf measurement */
829 fire_and_forget: 1, /* Launch Write without response */
830 mode: 2, /* Widget operation Mode */
831 rsvd2: 2,
832 bnakctr: 14,
833 rsvd3: 2,
834 anakctr: 14,
835 xtalkctr: 8;
836 } iprb_fields_s;
837} iprb_t;
838
839#define iprb_regval reg_value
840
841#define iprb_error iprb_fields_s.error
842#define iprb_ovflow iprb_fields_s.ovflow
843#define iprb_ff iprb_fields_s.fire_and_forget
844#define iprb_mode iprb_fields_s.mode
845#define iprb_bnakctr iprb_fields_s.bnakctr
846#define iprb_anakctr iprb_fields_s.anakctr
847#define iprb_xtalkctr iprb_fields_s.xtalkctr
848
849#endif /* !__ASSEMBLY__ */
850
851/*
852 * values for mode field in iprb_t.
853 * For details of the meanings of NAK and Accept, refer the PIO flow
854 * document
855 */
856#define IPRB_MODE_NORMAL (0)
857#define IPRB_MODE_COLLECT_A (1) /* PRB in collect A mode */
858#define IPRB_MODE_SERVICE_A (2) /* NAK B and Accept A */
859#define IPRB_MODE_SERVICE_B (3) /* NAK A and Accept B */
860
861/*
862 * IO CRB entry C_A to E_A : Partial (cache) CRBS
863 */
864#ifndef __ASSEMBLY__
865typedef union icrbp_a {
866 u64 ip_reg; /* the entire register value */
867 struct {
868 u64 error: 1, /* 63, error occurred */
869 ln_uce: 1, /* 62: uncorrectable memory */
870 ln_ae: 1, /* 61: protection violation */
871 ln_werr:1, /* 60: write access error */
872 ln_aerr:1, /* 59: sn0net: Address error */
873 ln_perr:1, /* 58: sn0net: poison error */
874 timeout:1, /* 57: CRB timed out */
875 l_bdpkt:1, /* 56: truncated pkt on sn0net */
876 c_bdpkt:1, /* 55: truncated pkt on xtalk */
877 c_err: 1, /* 54: incoming xtalk req, err set*/
878 rsvd1: 12, /* 53-42: reserved */
879 valid: 1, /* 41: Valid status */
880 sidn: 4, /* 40-37: SIDN field of xtalk rqst */
881 tnum: 5, /* 36-32: TNUM of xtalk request */
882 bo: 1, /* 31: barrier op set in xtalk rqst*/
883 resprqd:1, /* 30: xtalk rqst requires response*/
884 gbr: 1, /* 29: gbr bit set in xtalk rqst */
885 size: 2, /* 28-27: size of xtalk request */
886 excl: 4, /* 26-23: exclusive bit(s) */
887 stall: 3, /* 22-20: stall (xtalk, bte 0/1) */
888 intvn: 1, /* 19: rqst target of intervention*/
889 resp: 1, /* 18: Data response given to t5 */
890 ack: 1, /* 17: Data ack received. */
891 hold: 1, /* 16: crb gathering invalidate acks*/
892 wb: 1, /* 15: writeback pending. */
893 ack_cnt:11, /* 14-04: counter of invalidate acks*/
894 tscaler:4; /* 03-00: Timeout prescaler */
895 } ip_fmt;
896} icrbp_a_t;
897
898#endif /* !__ASSEMBLY__ */
899
900/*
901 * A couple of defines to go with the above structure.
902 */
903#define ICRBP_A_CERR_SHFT 54
904#define ICRBP_A_ERR_MASK 0x3ff
905
906#ifndef __ASSEMBLY__
907typedef union hubii_idsr {
908 u64 iin_reg;
909 struct {
910 u64 rsvd1 : 35,
911 isent : 1,
912 rsvd2 : 3,
913 ienable: 1,
914 rsvd : 7,
915 node : 9,
916 rsvd4 : 1,
917 level : 7;
918 } iin_fmt;
919} hubii_idsr_t;
920#endif /* !__ASSEMBLY__ */
921
922/*
923 * IO BTE Length/Status (IIO_IBLS) register bit field definitions
924 */
925#define IBLS_BUSY (0x1 << 20)
926#define IBLS_ERROR_SHFT 16
927#define IBLS_ERROR (0x1 << IBLS_ERROR_SHFT)
928#define IBLS_LENGTH_MASK 0xffff
929
930/*
931 * IO BTE Control/Terminate register (IBCT) register bit field definitions
932 */
933#define IBCT_POISON (0x1 << 8)
934#define IBCT_NOTIFY (0x1 << 4)
935#define IBCT_ZFIL_MODE (0x1 << 0)
936
937/*
938 * IO BTE Interrupt Address Register (IBIA) register bit field definitions
939 */
940#define IBIA_LEVEL_SHFT 16
941#define IBIA_LEVEL_MASK (0x7f << IBIA_LEVEL_SHFT)
942#define IBIA_NODE_ID_SHFT 0
943#define IBIA_NODE_ID_MASK (0x1ff)
944
945/*
946 * Miscellaneous hub constants
947 */
948
949/* Number of widgets supported by hub */
950#define HUB_NUM_WIDGET 9
951#define HUB_WIDGET_ID_MIN 0x8
952#define HUB_WIDGET_ID_MAX 0xf
953
954#define HUB_WIDGET_PART_NUM 0xc101
955#define MAX_HUBS_PER_XBOW 2
956
957/*
958 * Get a hub's widget id from widget control register
959 */
960#define IIO_WCR_WID_GET(nasid) (REMOTE_HUB_L(nasid, III_WCR) & 0xf)
961#define IIO_WST_ERROR_MASK (UINT64_CAST 1 << 32) /* Widget status error */
962
963/*
964 * Number of credits Hub widget has while sending req/response to
965 * xbow.
966 * Value of 3 is required by Xbow 1.1
967 * We may be able to increase this to 4 with Xbow 1.2.
968 */
969#define HUBII_XBOW_CREDIT 3
970#define HUBII_XBOW_REV2_CREDIT 4
971
972#endif /* _ASM_SGI_SN_SN0_HUBIO_H */
diff --git a/include/asm-mips/sn/sn0/hubmd.h b/include/asm-mips/sn/sn0/hubmd.h
deleted file mode 100644
index 14c225d80664..000000000000
--- a/include/asm-mips/sn/sn0/hubmd.h
+++ /dev/null
@@ -1,789 +0,0 @@
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 * Derived from IRIX <sys/SN/SN0/hubmd.h>, revision 1.59.
7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle
10 */
11#ifndef _ASM_SN_SN0_HUBMD_H
12#define _ASM_SN_SN0_HUBMD_H
13
14
15/*
16 * Hub Memory/Directory interface registers
17 */
18#define CACHE_SLINE_SIZE 128 /* Secondary cache line size on SN0 */
19
20#define MAX_REGIONS 64
21
22/* Hardware page size and shift */
23
24#define MD_PAGE_SIZE 4096 /* Page size in bytes */
25#define MD_PAGE_NUM_SHFT 12 /* Address to page number shift */
26
27/* Register offsets from LOCAL_HUB or REMOTE_HUB */
28
29#define MD_BASE 0x200000
30#define MD_BASE_PERF 0x210000
31#define MD_BASE_JUNK 0x220000
32
33#define MD_IO_PROTECT 0x200000 /* MD and core register protection */
34#define MD_IO_PROT_OVRRD 0x200008 /* Clear my bit in MD_IO_PROTECT */
35#define MD_HSPEC_PROTECT 0x200010 /* BDDIR, LBOOT, RBOOT protection */
36#define MD_MEMORY_CONFIG 0x200018 /* Memory/Directory DIMM control */
37#define MD_REFRESH_CONTROL 0x200020 /* Memory/Directory refresh ctrl */
38#define MD_FANDOP_CAC_STAT 0x200028 /* Fetch-and-op cache status */
39#define MD_MIG_DIFF_THRESH 0x200030 /* Page migr. count diff thresh. */
40#define MD_MIG_VALUE_THRESH 0x200038 /* Page migr. count abs. thresh. */
41#define MD_MIG_CANDIDATE 0x200040 /* Latest page migration candidate */
42#define MD_MIG_CANDIDATE_CLR 0x200048 /* Clear page migration candidate */
43#define MD_DIR_ERROR 0x200050 /* Directory DIMM error */
44#define MD_DIR_ERROR_CLR 0x200058 /* Directory DIMM error clear */
45#define MD_PROTOCOL_ERROR 0x200060 /* Directory protocol error */
46#define MD_PROTOCOL_ERROR_CLR 0x200068 /* Directory protocol error clear */
47#define MD_MEM_ERROR 0x200070 /* Memory DIMM error */
48#define MD_MEM_ERROR_CLR 0x200078 /* Memory DIMM error clear */
49#define MD_MISC_ERROR 0x200080 /* Miscellaneous MD error */
50#define MD_MISC_ERROR_CLR 0x200088 /* Miscellaneous MD error clear */
51#define MD_MEM_DIMM_INIT 0x200090 /* Memory DIMM mode initization. */
52#define MD_DIR_DIMM_INIT 0x200098 /* Directory DIMM mode init. */
53#define MD_MOQ_SIZE 0x2000a0 /* MD outgoing queue size */
54#define MD_MLAN_CTL 0x2000a8 /* NIC (Microlan) control register */
55
56#define MD_PERF_SEL 0x210000 /* Select perf monitor events */
57#define MD_PERF_CNT0 0x210010 /* Performance counter 0 */
58#define MD_PERF_CNT1 0x210018 /* Performance counter 1 */
59#define MD_PERF_CNT2 0x210020 /* Performance counter 2 */
60#define MD_PERF_CNT3 0x210028 /* Performance counter 3 */
61#define MD_PERF_CNT4 0x210030 /* Performance counter 4 */
62#define MD_PERF_CNT5 0x210038 /* Performance counter 5 */
63
64#define MD_UREG0_0 0x220000 /* uController/UART 0 register */
65#define MD_UREG0_1 0x220008 /* uController/UART 0 register */
66#define MD_UREG0_2 0x220010 /* uController/UART 0 register */
67#define MD_UREG0_3 0x220018 /* uController/UART 0 register */
68#define MD_UREG0_4 0x220020 /* uController/UART 0 register */
69#define MD_UREG0_5 0x220028 /* uController/UART 0 register */
70#define MD_UREG0_6 0x220030 /* uController/UART 0 register */
71#define MD_UREG0_7 0x220038 /* uController/UART 0 register */
72
73#define MD_SLOTID_USTAT 0x220048 /* Hub slot ID & UART/uCtlr status */
74#define MD_LED0 0x220050 /* Eight-bit LED for CPU A */
75#define MD_LED1 0x220058 /* Eight-bit LED for CPU B */
76
77#define MD_UREG1_0 0x220080 /* uController/UART 1 register */
78#define MD_UREG1_1 0x220088 /* uController/UART 1 register */
79#define MD_UREG1_2 0x220090 /* uController/UART 1 register */
80#define MD_UREG1_3 0x220098 /* uController/UART 1 register */
81#define MD_UREG1_4 0x2200a0 /* uController/UART 1 register */
82#define MD_UREG1_5 0x2200a8 /* uController/UART 1 register */
83#define MD_UREG1_6 0x2200b0 /* uController/UART 1 register */
84#define MD_UREG1_7 0x2200b8 /* uController/UART 1 register */
85#define MD_UREG1_8 0x2200c0 /* uController/UART 1 register */
86#define MD_UREG1_9 0x2200c8 /* uController/UART 1 register */
87#define MD_UREG1_10 0x2200d0 /* uController/UART 1 register */
88#define MD_UREG1_11 0x2200d8 /* uController/UART 1 register */
89#define MD_UREG1_12 0x2200e0 /* uController/UART 1 register */
90#define MD_UREG1_13 0x2200e8 /* uController/UART 1 register */
91#define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */
92#define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */
93
94#ifdef CONFIG_SGI_SN_N_MODE
95#define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */
96#else
97#define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */
98#endif
99
100/*
101 * MD_MEMORY_CONFIG fields
102 *
103 * MD_SIZE_xxx are useful for representing the size of a SIMM or bank
104 * (SIMM pair). They correspond to the values needed for the bit
105 * triplets (MMC_BANK_MASK) in the MD_MEMORY_CONFIG register for bank size.
106 * Bits not used by the MD are used by software.
107 */
108
109#define MD_SIZE_EMPTY 0 /* Valid in MEMORY_CONFIG */
110#define MD_SIZE_8MB 1
111#define MD_SIZE_16MB 2
112#define MD_SIZE_32MB 3 /* Broken in Hub 1 */
113#define MD_SIZE_64MB 4 /* Valid in MEMORY_CONFIG */
114#define MD_SIZE_128MB 5 /* Valid in MEMORY_CONFIG */
115#define MD_SIZE_256MB 6
116#define MD_SIZE_512MB 7 /* Valid in MEMORY_CONFIG */
117#define MD_SIZE_1GB 8
118#define MD_SIZE_2GB 9
119#define MD_SIZE_4GB 10
120
121#define MD_SIZE_BYTES(size) ((size) == 0 ? 0 : 0x400000L << (size))
122#define MD_SIZE_MBYTES(size) ((size) == 0 ? 0 : 4 << (size))
123
124#define MMC_FPROM_CYC_SHFT 49 /* Have to use UINT64_CAST, instead */
125#define MMC_FPROM_CYC_MASK (UINT64_CAST 31 << 49) /* of 'L' suffix, */
126#define MMC_FPROM_WR_SHFT 44 /* for assembler */
127#define MMC_FPROM_WR_MASK (UINT64_CAST 31 << 44)
128#define MMC_UCTLR_CYC_SHFT 39
129#define MMC_UCTLR_CYC_MASK (UINT64_CAST 31 << 39)
130#define MMC_UCTLR_WR_SHFT 34
131#define MMC_UCTLR_WR_MASK (UINT64_CAST 31 << 34)
132#define MMC_DIMM0_SEL_SHFT 32
133#define MMC_DIMM0_SEL_MASK (UINT64_CAST 3 << 32)
134#define MMC_IO_PROT_EN_SHFT 31
135#define MMC_IO_PROT_EN_MASK (UINT64_CAST 1 << 31)
136#define MMC_IO_PROT (UINT64_CAST 1 << 31)
137#define MMC_ARB_MLSS_SHFT 30
138#define MMC_ARB_MLSS_MASK (UINT64_CAST 1 << 30)
139#define MMC_ARB_MLSS (UINT64_CAST 1 << 30)
140#define MMC_IGNORE_ECC_SHFT 29
141#define MMC_IGNORE_ECC_MASK (UINT64_CAST 1 << 29)
142#define MMC_IGNORE_ECC (UINT64_CAST 1 << 29)
143#define MMC_DIR_PREMIUM_SHFT 28
144#define MMC_DIR_PREMIUM_MASK (UINT64_CAST 1 << 28)
145#define MMC_DIR_PREMIUM (UINT64_CAST 1 << 28)
146#define MMC_REPLY_GUAR_SHFT 24
147#define MMC_REPLY_GUAR_MASK (UINT64_CAST 15 << 24)
148#define MMC_BANK_SHFT(_b) ((_b) * 3)
149#define MMC_BANK_MASK(_b) (UINT64_CAST 7 << MMC_BANK_SHFT(_b))
150#define MMC_BANK_ALL_MASK 0xffffff
151#define MMC_RESET_DEFAULTS (UINT64_CAST 0x0f << MMC_FPROM_CYC_SHFT | \
152 UINT64_CAST 0x07 << MMC_FPROM_WR_SHFT | \
153 UINT64_CAST 0x1f << MMC_UCTLR_CYC_SHFT | \
154 UINT64_CAST 0x0f << MMC_UCTLR_WR_SHFT | \
155 MMC_IGNORE_ECC | MMC_DIR_PREMIUM | \
156 UINT64_CAST 0x0f << MMC_REPLY_GUAR_SHFT | \
157 MMC_BANK_ALL_MASK)
158
159/* MD_REFRESH_CONTROL fields */
160
161#define MRC_ENABLE_SHFT 63
162#define MRC_ENABLE_MASK (UINT64_CAST 1 << 63)
163#define MRC_ENABLE (UINT64_CAST 1 << 63)
164#define MRC_COUNTER_SHFT 12
165#define MRC_COUNTER_MASK (UINT64_CAST 0xfff << 12)
166#define MRC_CNT_THRESH_MASK 0xfff
167#define MRC_RESET_DEFAULTS (UINT64_CAST 0x400)
168
169/* MD_MEM_DIMM_INIT and MD_DIR_DIMM_INIT fields */
170
171#define MDI_SELECT_SHFT 32
172#define MDI_SELECT_MASK (UINT64_CAST 0x0f << 32)
173#define MDI_DIMM_MODE_MASK (UINT64_CAST 0xfff)
174
175/* MD_MOQ_SIZE fields */
176
177#define MMS_RP_SIZE_SHFT 8
178#define MMS_RP_SIZE_MASK (UINT64_CAST 0x3f << 8)
179#define MMS_RQ_SIZE_SHFT 0
180#define MMS_RQ_SIZE_MASK (UINT64_CAST 0x1f)
181#define MMS_RESET_DEFAULTS (0x32 << 8 | 0x12)
182
183/* MD_FANDOP_CAC_STAT fields */
184
185#define MFC_VALID_SHFT 63
186#define MFC_VALID_MASK (UINT64_CAST 1 << 63)
187#define MFC_VALID (UINT64_CAST 1 << 63)
188#define MFC_ADDR_SHFT 6
189#define MFC_ADDR_MASK (UINT64_CAST 0x3ffffff)
190
191/* MD_MLAN_CTL fields */
192
193#define MLAN_PHI1_SHFT 27
194#define MLAN_PHI1_MASK (UINT64_CAST 0x7f << 27)
195#define MLAN_PHI0_SHFT 20
196#define MLAN_PHI0_MASK (UINT64_CAST 0x7f << 27)
197#define MLAN_PULSE_SHFT 10
198#define MLAN_PULSE_MASK (UINT64_CAST 0x3ff << 10)
199#define MLAN_SAMPLE_SHFT 2
200#define MLAN_SAMPLE_MASK (UINT64_CAST 0xff << 2)
201#define MLAN_DONE_SHFT 1
202#define MLAN_DONE_MASK 2
203#define MLAN_DONE (UINT64_CAST 0x02)
204#define MLAN_RD_DATA (UINT64_CAST 0x01)
205#define MLAN_RESET_DEFAULTS (UINT64_CAST 0x31 << MLAN_PHI1_SHFT | \
206 UINT64_CAST 0x31 << MLAN_PHI0_SHFT)
207
208/* MD_SLOTID_USTAT bit definitions */
209
210#define MSU_CORECLK_TST_SHFT 7 /* You don't wanna know */
211#define MSU_CORECLK_TST_MASK (UINT64_CAST 1 << 7)
212#define MSU_CORECLK_TST (UINT64_CAST 1 << 7)
213#define MSU_CORECLK_SHFT 6 /* You don't wanna know */
214#define MSU_CORECLK_MASK (UINT64_CAST 1 << 6)
215#define MSU_CORECLK (UINT64_CAST 1 << 6)
216#define MSU_NETSYNC_SHFT 5 /* You don't wanna know */
217#define MSU_NETSYNC_MASK (UINT64_CAST 1 << 5)
218#define MSU_NETSYNC (UINT64_CAST 1 << 5)
219#define MSU_FPROMRDY_SHFT 4 /* Flash PROM ready bit */
220#define MSU_FPROMRDY_MASK (UINT64_CAST 1 << 4)
221#define MSU_FPROMRDY (UINT64_CAST 1 << 4)
222#define MSU_I2CINTR_SHFT 3 /* I2C interrupt bit */
223#define MSU_I2CINTR_MASK (UINT64_CAST 1 << 3)
224#define MSU_I2CINTR (UINT64_CAST 1 << 3)
225#define MSU_SLOTID_MASK 0xff
226#define MSU_SN0_SLOTID_SHFT 0 /* Slot ID */
227#define MSU_SN0_SLOTID_MASK (UINT64_CAST 7)
228#define MSU_SN00_SLOTID_SHFT 7
229#define MSU_SN00_SLOTID_MASK (UINT64_CAST 0x80)
230
231#define MSU_PIMM_PSC_SHFT 4
232#define MSU_PIMM_PSC_MASK (0xf << MSU_PIMM_PSC_SHFT)
233
234/* MD_MIG_DIFF_THRESH bit definitions */
235
236#define MD_MIG_DIFF_THRES_VALID_MASK (UINT64_CAST 0x1 << 63)
237#define MD_MIG_DIFF_THRES_VALID_SHFT 63
238#define MD_MIG_DIFF_THRES_VALUE_MASK (UINT64_CAST 0xfffff)
239
240/* MD_MIG_VALUE_THRESH bit definitions */
241
242#define MD_MIG_VALUE_THRES_VALID_MASK (UINT64_CAST 0x1 << 63)
243#define MD_MIG_VALUE_THRES_VALID_SHFT 63
244#define MD_MIG_VALUE_THRES_VALUE_MASK (UINT64_CAST 0xfffff)
245
246/* MD_MIG_CANDIDATE bit definitions */
247
248#define MD_MIG_CANDIDATE_VALID_MASK (UINT64_CAST 0x1 << 63)
249#define MD_MIG_CANDIDATE_VALID_SHFT 63
250#define MD_MIG_CANDIDATE_TYPE_MASK (UINT64_CAST 0x1 << 30)
251#define MD_MIG_CANDIDATE_TYPE_SHFT 30
252#define MD_MIG_CANDIDATE_OVERRUN_MASK (UINT64_CAST 0x1 << 29)
253#define MD_MIG_CANDIDATE_OVERRUN_SHFT 29
254#define MD_MIG_CANDIDATE_INITIATOR_MASK (UINT64_CAST 0x7ff << 18)
255#define MD_MIG_CANDIDATE_INITIATOR_SHFT 18
256#define MD_MIG_CANDIDATE_NODEID_MASK (UINT64_CAST 0x1ff << 20)
257#define MD_MIG_CANDIDATE_NODEID_SHFT 20
258#define MD_MIG_CANDIDATE_ADDR_MASK (UINT64_CAST 0x3ffff)
259#define MD_MIG_CANDIDATE_ADDR_SHFT 14 /* The address starts at bit 14 */
260
261/* Other MD definitions */
262
263#define MD_BANK_SHFT 29 /* log2(512 MB) */
264#define MD_BANK_MASK (UINT64_CAST 7 << 29)
265#define MD_BANK_SIZE (UINT64_CAST 1 << MD_BANK_SHFT) /* 512 MB */
266#define MD_BANK_OFFSET(_b) (UINT64_CAST (_b) << MD_BANK_SHFT)
267
268/*
269 * The following definitions cover the bit field definitions for the
270 * various MD registers. For multi-bit registers, we define both
271 * a shift amount and a mask value. By convention, if you want to
272 * isolate a field, you should mask the field and then shift it down,
273 * since this makes the masks useful without a shift.
274 */
275
276/* Directory entry states for both premium and standard SIMMs. */
277
278#define MD_DIR_SHARED (UINT64_CAST 0x0) /* 000 */
279#define MD_DIR_POISONED (UINT64_CAST 0x1) /* 001 */
280#define MD_DIR_EXCLUSIVE (UINT64_CAST 0x2) /* 010 */
281#define MD_DIR_BUSY_SHARED (UINT64_CAST 0x3) /* 011 */
282#define MD_DIR_BUSY_EXCL (UINT64_CAST 0x4) /* 100 */
283#define MD_DIR_WAIT (UINT64_CAST 0x5) /* 101 */
284#define MD_DIR_UNOWNED (UINT64_CAST 0x7) /* 111 */
285
286/*
287 * The MD_DIR_FORCE_ECC bit can be added directory entry write data
288 * to forcing the ECC to be written as-is instead of recalculated.
289 */
290
291#define MD_DIR_FORCE_ECC (UINT64_CAST 1 << 63)
292
293/*
294 * Premium SIMM directory entry shifts and masks. Each is valid only in the
295 * context(s) indicated, where A, B, and C indicate the directory entry format
296 * as shown, and low and/or high indicates which double-word of the entry.
297 *
298 * Format A: STATE = shared, FINE = 1
299 * Format B: STATE = shared, FINE = 0
300 * Format C: STATE != shared (FINE must be 0)
301 */
302
303#define MD_PDIR_MASK 0xffffffffffff /* Whole entry */
304#define MD_PDIR_ECC_SHFT 0 /* ABC low or high */
305#define MD_PDIR_ECC_MASK 0x7f
306#define MD_PDIR_PRIO_SHFT 8 /* ABC low */
307#define MD_PDIR_PRIO_MASK (0xf << 8)
308#define MD_PDIR_AX_SHFT 7 /* ABC low */
309#define MD_PDIR_AX_MASK (1 << 7)
310#define MD_PDIR_AX (1 << 7)
311#define MD_PDIR_FINE_SHFT 12 /* ABC low */
312#define MD_PDIR_FINE_MASK (1 << 12)
313#define MD_PDIR_FINE (1 << 12)
314#define MD_PDIR_OCT_SHFT 13 /* A low */
315#define MD_PDIR_OCT_MASK (7 << 13)
316#define MD_PDIR_STATE_SHFT 13 /* BC low */
317#define MD_PDIR_STATE_MASK (7 << 13)
318#define MD_PDIR_ONECNT_SHFT 16 /* BC low */
319#define MD_PDIR_ONECNT_MASK (0x3f << 16)
320#define MD_PDIR_PTR_SHFT 22 /* C low */
321#define MD_PDIR_PTR_MASK (UINT64_CAST 0x7ff << 22)
322#define MD_PDIR_VECMSB_SHFT 22 /* AB low */
323#define MD_PDIR_VECMSB_BITMASK 0x3ffffff
324#define MD_PDIR_VECMSB_BITSHFT 27
325#define MD_PDIR_VECMSB_MASK (UINT64_CAST MD_PDIR_VECMSB_BITMASK << 22)
326#define MD_PDIR_CWOFF_SHFT 7 /* C high */
327#define MD_PDIR_CWOFF_MASK (7 << 7)
328#define MD_PDIR_VECLSB_SHFT 10 /* AB high */
329#define MD_PDIR_VECLSB_BITMASK (UINT64_CAST 0x3fffffffff)
330#define MD_PDIR_VECLSB_BITSHFT 0
331#define MD_PDIR_VECLSB_MASK (MD_PDIR_VECLSB_BITMASK << 10)
332
333/*
334 * Directory initialization values
335 */
336
337#define MD_PDIR_INIT_LO (MD_DIR_UNOWNED << MD_PDIR_STATE_SHFT | \
338 MD_PDIR_AX)
339#define MD_PDIR_INIT_HI 0
340#define MD_PDIR_INIT_PROT (MD_PROT_RW << MD_PPROT_IO_SHFT | \
341 MD_PROT_RW << MD_PPROT_SHFT)
342
343/*
344 * Standard SIMM directory entry shifts and masks. Each is valid only in the
345 * context(s) indicated, where A and C indicate the directory entry format
346 * as shown, and low and/or high indicates which double-word of the entry.
347 *
348 * Format A: STATE == shared
349 * Format C: STATE != shared
350 */
351
352#define MD_SDIR_MASK 0xffff /* Whole entry */
353#define MD_SDIR_ECC_SHFT 0 /* AC low or high */
354#define MD_SDIR_ECC_MASK 0x1f
355#define MD_SDIR_PRIO_SHFT 6 /* AC low */
356#define MD_SDIR_PRIO_MASK (1 << 6)
357#define MD_SDIR_AX_SHFT 5 /* AC low */
358#define MD_SDIR_AX_MASK (1 << 5)
359#define MD_SDIR_AX (1 << 5)
360#define MD_SDIR_STATE_SHFT 7 /* AC low */
361#define MD_SDIR_STATE_MASK (7 << 7)
362#define MD_SDIR_PTR_SHFT 10 /* C low */
363#define MD_SDIR_PTR_MASK (0x3f << 10)
364#define MD_SDIR_CWOFF_SHFT 5 /* C high */
365#define MD_SDIR_CWOFF_MASK (7 << 5)
366#define MD_SDIR_VECMSB_SHFT 11 /* A low */
367#define MD_SDIR_VECMSB_BITMASK 0x1f
368#define MD_SDIR_VECMSB_BITSHFT 7
369#define MD_SDIR_VECMSB_MASK (MD_SDIR_VECMSB_BITMASK << 11)
370#define MD_SDIR_VECLSB_SHFT 5 /* A high */
371#define MD_SDIR_VECLSB_BITMASK 0x7ff
372#define MD_SDIR_VECLSB_BITSHFT 0
373#define MD_SDIR_VECLSB_MASK (MD_SDIR_VECLSB_BITMASK << 5)
374
375/*
376 * Directory initialization values
377 */
378
379#define MD_SDIR_INIT_LO (MD_DIR_UNOWNED << MD_SDIR_STATE_SHFT | \
380 MD_SDIR_AX)
381#define MD_SDIR_INIT_HI 0
382#define MD_SDIR_INIT_PROT (MD_PROT_RW << MD_SPROT_SHFT)
383
384/* Protection and migration field values */
385
386#define MD_PROT_RW (UINT64_CAST 0x6)
387#define MD_PROT_RO (UINT64_CAST 0x3)
388#define MD_PROT_NO (UINT64_CAST 0x0)
389#define MD_PROT_BAD (UINT64_CAST 0x5)
390
391/* Premium SIMM protection entry shifts and masks. */
392
393#define MD_PPROT_SHFT 0 /* Prot. field */
394#define MD_PPROT_MASK 7
395#define MD_PPROT_MIGMD_SHFT 3 /* Migration mode */
396#define MD_PPROT_MIGMD_MASK (3 << 3)
397#define MD_PPROT_REFCNT_SHFT 5 /* Reference count */
398#define MD_PPROT_REFCNT_WIDTH 0x7ffff
399#define MD_PPROT_REFCNT_MASK (MD_PPROT_REFCNT_WIDTH << 5)
400
401#define MD_PPROT_IO_SHFT 45 /* I/O Prot field */
402#define MD_PPROT_IO_MASK (UINT64_CAST 7 << 45)
403
404/* Standard SIMM protection entry shifts and masks. */
405
406#define MD_SPROT_SHFT 0 /* Prot. field */
407#define MD_SPROT_MASK 7
408#define MD_SPROT_MIGMD_SHFT 3 /* Migration mode */
409#define MD_SPROT_MIGMD_MASK (3 << 3)
410#define MD_SPROT_REFCNT_SHFT 5 /* Reference count */
411#define MD_SPROT_REFCNT_WIDTH 0x7ff
412#define MD_SPROT_REFCNT_MASK (MD_SPROT_REFCNT_WIDTH << 5)
413
414/* Migration modes used in protection entries */
415
416#define MD_PROT_MIGMD_IREL (UINT64_CAST 0x3 << 3)
417#define MD_PROT_MIGMD_IABS (UINT64_CAST 0x2 << 3)
418#define MD_PROT_MIGMD_PREL (UINT64_CAST 0x1 << 3)
419#define MD_PROT_MIGMD_OFF (UINT64_CAST 0x0 << 3)
420
421
422/*
423 * Operations on page migration threshold register
424 */
425
426#ifndef __ASSEMBLY__
427
428/*
429 * LED register macros
430 */
431
432#define CPU_LED_ADDR(_nasid, _slice) \
433 (private.p_sn00 ? \
434 REMOTE_HUB_ADDR((_nasid), MD_UREG1_0 + ((_slice) << 5)) : \
435 REMOTE_HUB_ADDR((_nasid), MD_LED0 + ((_slice) << 3)))
436
437#define SET_CPU_LEDS(_nasid, _slice, _val) \
438 (HUB_S(CPU_LED_ADDR(_nasid, _slice), (_val)))
439
440#define SET_MY_LEDS(_v) \
441 SET_CPU_LEDS(get_nasid(), get_slice(), (_v))
442
443/*
444 * Operations on Memory/Directory DIMM control register
445 */
446
447#define DIRTYPE_PREMIUM 1
448#define DIRTYPE_STANDARD 0
449#define MD_MEMORY_CONFIG_DIR_TYPE_GET(region) (\
450 (REMOTE_HUB_L(region, MD_MEMORY_CONFIG) & MMC_DIR_PREMIUM_MASK) >> \
451 MMC_DIR_PREMIUM_SHFT)
452
453
454/*
455 * Operations on page migration count difference and absolute threshold
456 * registers
457 */
458
459#define MD_MIG_DIFF_THRESH_GET(region) ( \
460 REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) & \
461 MD_MIG_DIFF_THRES_VALUE_MASK)
462
463#define MD_MIG_DIFF_THRESH_SET(region, value) ( \
464 REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH, \
465 MD_MIG_DIFF_THRES_VALID_MASK | (value)))
466
467#define MD_MIG_DIFF_THRESH_DISABLE(region) ( \
468 REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH, \
469 REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) \
470 & ~MD_MIG_DIFF_THRES_VALID_MASK))
471
472#define MD_MIG_DIFF_THRESH_ENABLE(region) ( \
473 REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH, \
474 REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) \
475 | MD_MIG_DIFF_THRES_VALID_MASK))
476
477#define MD_MIG_DIFF_THRESH_IS_ENABLED(region) ( \
478 REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) & \
479 MD_MIG_DIFF_THRES_VALID_MASK)
480
481#define MD_MIG_VALUE_THRESH_GET(region) ( \
482 REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) & \
483 MD_MIG_VALUE_THRES_VALUE_MASK)
484
485#define MD_MIG_VALUE_THRESH_SET(region, value) ( \
486 REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH, \
487 MD_MIG_VALUE_THRES_VALID_MASK | (value)))
488
489#define MD_MIG_VALUE_THRESH_DISABLE(region) ( \
490 REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH, \
491 REMOTE_HUB_L(region, MD_MIG_VALUE_THRESH) \
492 & ~MD_MIG_VALUE_THRES_VALID_MASK))
493
494#define MD_MIG_VALUE_THRESH_ENABLE(region) ( \
495 REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH, \
496 REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) \
497 | MD_MIG_VALUE_THRES_VALID_MASK))
498
499#define MD_MIG_VALUE_THRESH_IS_ENABLED(region) ( \
500 REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) & \
501 MD_MIG_VALUE_THRES_VALID_MASK)
502
503/*
504 * Operations on page migration candidate register
505 */
506
507#define MD_MIG_CANDIDATE_GET(my_region_id) ( \
508 REMOTE_HUB_L((my_region_id), MD_MIG_CANDIDATE_CLR))
509
510#define MD_MIG_CANDIDATE_HWPFN(value) ((value) & MD_MIG_CANDIDATE_ADDR_MASK)
511
512#define MD_MIG_CANDIDATE_NODEID(value) ( \
513 ((value) & MD_MIG_CANDIDATE_NODEID_MASK) >> MD_MIG_CANDIDATE_NODEID_SHFT)
514
515#define MD_MIG_CANDIDATE_TYPE(value) ( \
516 ((value) & MD_MIG_CANDIDATE_TYPE_MASK) >> MD_MIG_CANDIDATE_TYPE_SHFT)
517
518#define MD_MIG_CANDIDATE_VALID(value) ( \
519 ((value) & MD_MIG_CANDIDATE_VALID_MASK) >> MD_MIG_CANDIDATE_VALID_SHFT)
520
521/*
522 * Macros to retrieve fields in the protection entry
523 */
524
525/* for Premium SIMM */
526#define MD_PPROT_REFCNT_GET(value) ( \
527 ((value) & MD_PPROT_REFCNT_MASK) >> MD_PPROT_REFCNT_SHFT)
528
529#define MD_PPROT_MIGMD_GET(value) ( \
530 ((value) & MD_PPROT_MIGMD_MASK) >> MD_PPROT_MIGMD_SHFT)
531
532/* for Standard SIMM */
533#define MD_SPROT_REFCNT_GET(value) ( \
534 ((value) & MD_SPROT_REFCNT_MASK) >> MD_SPROT_REFCNT_SHFT)
535
536#define MD_SPROT_MIGMD_GET(value) ( \
537 ((value) & MD_SPROT_MIGMD_MASK) >> MD_SPROT_MIGMD_SHFT)
538
539/*
540 * Format of dir_error, mem_error, protocol_error and misc_error registers
541 */
542
543struct dir_error_reg {
544 u64 uce_vld: 1, /* 63: valid directory uce */
545 ae_vld: 1, /* 62: valid dir prot ecc error */
546 ce_vld: 1, /* 61: valid correctable ECC err*/
547 rsvd1: 19, /* 60-42: reserved */
548 bad_prot: 3, /* 41-39: encoding, bad access rights*/
549 bad_syn: 7, /* 38-32: bad dir syndrome */
550 rsvd2: 2, /* 31-30: reserved */
551 hspec_addr:27, /* 29-03: bddir space bad entry */
552 uce_ovr: 1, /* 2: multiple dir uce's */
553 ae_ovr: 1, /* 1: multiple prot ecc errs*/
554 ce_ovr: 1; /* 0: multiple correctable errs */
555};
556
557typedef union md_dir_error {
558 u64 derr_reg; /* the entire register */
559 struct dir_error_reg derr_fmt; /* the register format */
560} md_dir_error_t;
561
562
563struct mem_error_reg {
564 u64 uce_vld: 1, /* 63: valid memory uce */
565 ce_vld: 1, /* 62: valid correctable ECC err*/
566 rsvd1: 22, /* 61-40: reserved */
567 bad_syn: 8, /* 39-32: bad mem ecc syndrome */
568 address: 29, /* 31-03: bad entry pointer */
569 rsvd2: 1, /* 2: reserved */
570 uce_ovr: 1, /* 1: multiple mem uce's */
571 ce_ovr: 1; /* 0: multiple correctable errs */
572};
573
574
575typedef union md_mem_error {
576 u64 merr_reg; /* the entire register */
577 struct mem_error_reg merr_fmt; /* format of the mem_error reg */
578} md_mem_error_t;
579
580
581struct proto_error_reg {
582 u64 valid: 1, /* 63: valid protocol error */
583 rsvd1: 2, /* 62-61: reserved */
584 initiator:11, /* 60-50: id of request initiator*/
585 backoff: 2, /* 49-48: backoff control */
586 msg_type: 8, /* 47-40: type of request */
587 access: 2, /* 39-38: access rights of initiator*/
588 priority: 1, /* 37: priority level of requestor*/
589 dir_state: 4, /* 36-33: state of directory */
590 pointer_me:1, /* 32: initiator same as dir ptr */
591 address: 29, /* 31-03: request address */
592 rsvd2: 2, /* 02-01: reserved */
593 overrun: 1; /* 0: multiple protocol errs */
594};
595
596typedef union md_proto_error {
597 u64 perr_reg; /* the entire register */
598 struct proto_error_reg perr_fmt; /* format of the register */
599} md_proto_error_t;
600
601
602struct md_sdir_high_fmt {
603 unsigned short sd_hi_bvec : 11,
604 sd_hi_ecc : 5;
605};
606
607
608typedef union md_sdir_high {
609 /* The 16 bits of standard directory, upper word */
610 unsigned short sd_hi_val;
611 struct md_sdir_high_fmt sd_hi_fmt;
612}md_sdir_high_t;
613
614
615struct md_sdir_low_shared_fmt {
616 /* The meaning of lower directory, shared */
617 unsigned short sds_lo_bvec : 5,
618 sds_lo_unused: 1,
619 sds_lo_state : 3,
620 sds_lo_prio : 1,
621 sds_lo_ax : 1,
622 sds_lo_ecc : 5;
623};
624
625struct md_sdir_low_exclusive_fmt {
626 /* The meaning of lower directory, exclusive */
627 unsigned short sde_lo_ptr : 6,
628 sde_lo_state : 3,
629 sde_lo_prio : 1,
630 sde_lo_ax : 1,
631 sde_lo_ecc : 5;
632};
633
634
635typedef union md_sdir_low {
636 /* The 16 bits of standard directory, lower word */
637 unsigned short sd_lo_val;
638 struct md_sdir_low_exclusive_fmt sde_lo_fmt;
639 struct md_sdir_low_shared_fmt sds_lo_fmt;
640}md_sdir_low_t;
641
642
643
644struct md_pdir_high_fmt {
645 u64 pd_hi_unused : 16,
646 pd_hi_bvec : 38,
647 pd_hi_unused1 : 3,
648 pd_hi_ecc : 7;
649};
650
651
652typedef union md_pdir_high {
653 /* The 48 bits of standard directory, upper word */
654 u64 pd_hi_val;
655 struct md_pdir_high_fmt pd_hi_fmt;
656}md_pdir_high_t;
657
658
659struct md_pdir_low_shared_fmt {
660 /* The meaning of lower directory, shared */
661 u64 pds_lo_unused : 16,
662 pds_lo_bvec : 26,
663 pds_lo_cnt : 6,
664 pds_lo_state : 3,
665 pds_lo_ste : 1,
666 pds_lo_prio : 4,
667 pds_lo_ax : 1,
668 pds_lo_ecc : 7;
669};
670
671struct md_pdir_low_exclusive_fmt {
672 /* The meaning of lower directory, exclusive */
673 u64 pde_lo_unused : 31,
674 pde_lo_ptr : 11,
675 pde_lo_unused1 : 6,
676 pde_lo_state : 3,
677 pde_lo_ste : 1,
678 pde_lo_prio : 4,
679 pde_lo_ax : 1,
680 pde_lo_ecc : 7;
681};
682
683
684typedef union md_pdir_loent {
685 /* The 48 bits of premium directory, lower word */
686 u64 pd_lo_val;
687 struct md_pdir_low_exclusive_fmt pde_lo_fmt;
688 struct md_pdir_low_shared_fmt pds_lo_fmt;
689}md_pdir_low_t;
690
691
692/*
693 * the following two "union" definitions and two
694 * "struct" definitions are used in vmdump.c to
695 * represent directory memory information.
696 */
697
698typedef union md_dir_high {
699 md_sdir_high_t md_sdir_high;
700 md_pdir_high_t md_pdir_high;
701} md_dir_high_t;
702
703typedef union md_dir_low {
704 md_sdir_low_t md_sdir_low;
705 md_pdir_low_t md_pdir_low;
706} md_dir_low_t;
707
708typedef struct bddir_entry {
709 md_dir_low_t md_dir_low;
710 md_dir_high_t md_dir_high;
711} bddir_entry_t;
712
713typedef struct dir_mem_entry {
714 u64 prcpf[MAX_REGIONS];
715 bddir_entry_t directory_words[MD_PAGE_SIZE/CACHE_SLINE_SIZE];
716} dir_mem_entry_t;
717
718
719
720typedef union md_perf_sel {
721 u64 perf_sel_reg;
722 struct {
723 u64 perf_rsvd : 60,
724 perf_en : 1,
725 perf_sel : 3;
726 } perf_sel_bits;
727} md_perf_sel_t;
728
729typedef union md_perf_cnt {
730 u64 perf_cnt;
731 struct {
732 u64 perf_rsvd : 44,
733 perf_cnt : 20;
734 } perf_cnt_bits;
735} md_perf_cnt_t;
736
737
738#endif /* !__ASSEMBLY__ */
739
740
741#define DIR_ERROR_VALID_MASK 0xe000000000000000
742#define DIR_ERROR_VALID_SHFT 61
743#define DIR_ERROR_VALID_UCE 0x8000000000000000
744#define DIR_ERROR_VALID_AE 0x4000000000000000
745#define DIR_ERROR_VALID_CE 0x2000000000000000
746
747#define MEM_ERROR_VALID_MASK 0xc000000000000000
748#define MEM_ERROR_VALID_SHFT 62
749#define MEM_ERROR_VALID_UCE 0x8000000000000000
750#define MEM_ERROR_VALID_CE 0x4000000000000000
751
752#define PROTO_ERROR_VALID_MASK 0x8000000000000000
753
754#define MISC_ERROR_VALID_MASK 0x3ff
755
756/*
757 * Mask for hspec address that is stored in the dir error register.
758 * This represents bits 29 through 3.
759 */
760#define DIR_ERR_HSPEC_MASK 0x3ffffff8
761#define ERROR_HSPEC_MASK 0x3ffffff8
762#define ERROR_HSPEC_SHFT 3
763#define ERROR_ADDR_MASK 0xfffffff8
764#define ERROR_ADDR_SHFT 3
765
766/*
767 * MD_MISC_ERROR register defines.
768 */
769
770#define MMCE_VALID_MASK 0x3ff
771#define MMCE_ILL_MSG_SHFT 8
772#define MMCE_ILL_MSG_MASK (UINT64_CAST 0x03 << MMCE_ILL_MSG_SHFT)
773#define MMCE_ILL_REV_SHFT 6
774#define MMCE_ILL_REV_MASK (UINT64_CAST 0x03 << MMCE_ILL_REV_SHFT)
775#define MMCE_LONG_PACK_SHFT 4
776#define MMCE_LONG_PACK_MASK (UINT64_CAST 0x03 << MMCE_lONG_PACK_SHFT)
777#define MMCE_SHORT_PACK_SHFT 2
778#define MMCE_SHORT_PACK_MASK (UINT64_CAST 0x03 << MMCE_SHORT_PACK_SHFT)
779#define MMCE_BAD_DATA_SHFT 0
780#define MMCE_BAD_DATA_MASK (UINT64_CAST 0x03 << MMCE_BAD_DATA_SHFT)
781
782
783#define MD_PERF_COUNTERS 6
784#define MD_PERF_SETS 6
785
786#define MEM_DIMM_MASK 0xe0000000
787#define MEM_DIMM_SHFT 29
788
789#endif /* _ASM_SN_SN0_HUBMD_H */
diff --git a/include/asm-mips/sn/sn0/hubni.h b/include/asm-mips/sn/sn0/hubni.h
deleted file mode 100644
index b40d3ef97a12..000000000000
--- a/include/asm-mips/sn/sn0/hubni.h
+++ /dev/null
@@ -1,255 +0,0 @@
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 * Derived from IRIX <sys/SN/SN0/hubni.h>, Revision 1.27.
7 *
8 * Copyright (C) 1992-1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle
10 */
11#ifndef _ASM_SGI_SN0_HUBNI_H
12#define _ASM_SGI_SN0_HUBNI_H
13
14#ifndef __ASSEMBLY__
15#include <linux/types.h>
16#endif
17
18/*
19 * Hub Network Interface registers
20 *
21 * All registers in this file are subject to change until Hub chip tapeout.
22 */
23
24#define NI_BASE 0x600000
25#define NI_BASE_TABLES 0x630000
26
27#define NI_STATUS_REV_ID 0x600000 /* Hub network status, rev, and ID */
28#define NI_PORT_RESET 0x600008 /* Reset the network interface */
29#define NI_PROTECTION 0x600010 /* NI register access permissions */
30#define NI_GLOBAL_PARMS 0x600018 /* LLP parameters */
31#define NI_SCRATCH_REG0 0x600100 /* Scratch register 0 (64 bits) */
32#define NI_SCRATCH_REG1 0x600108 /* Scratch register 1 (64 bits) */
33#define NI_DIAG_PARMS 0x600110 /* Parameters for diags */
34
35#define NI_VECTOR_PARMS 0x600200 /* Vector PIO routing parameters */
36#define NI_VECTOR 0x600208 /* Vector PIO route */
37#define NI_VECTOR_DATA 0x600210 /* Vector PIO data */
38#define NI_VECTOR_STATUS 0x600300 /* Vector PIO return status */
39#define NI_RETURN_VECTOR 0x600308 /* Vector PIO return vector */
40#define NI_VECTOR_READ_DATA 0x600310 /* Vector PIO read data */
41#define NI_VECTOR_CLEAR 0x600380 /* Vector PIO read & clear status */
42
43#define NI_IO_PROTECT 0x600400 /* PIO protection bits */
44#define NI_IO_PROT_OVRRD 0x600408 /* PIO protection bit override */
45
46#define NI_AGE_CPU0_MEMORY 0x600500 /* CPU 0 memory age control */
47#define NI_AGE_CPU0_PIO 0x600508 /* CPU 0 PIO age control */
48#define NI_AGE_CPU1_MEMORY 0x600510 /* CPU 1 memory age control */
49#define NI_AGE_CPU1_PIO 0x600518 /* CPU 1 PIO age control */
50#define NI_AGE_GBR_MEMORY 0x600520 /* GBR memory age control */
51#define NI_AGE_GBR_PIO 0x600528 /* GBR PIO age control */
52#define NI_AGE_IO_MEMORY 0x600530 /* IO memory age control */
53#define NI_AGE_IO_PIO 0x600538 /* IO PIO age control */
54#define NI_AGE_REG_MIN NI_AGE_CPU0_MEMORY
55#define NI_AGE_REG_MAX NI_AGE_IO_PIO
56
57#define NI_PORT_PARMS 0x608000 /* LLP Parameters */
58#define NI_PORT_ERROR 0x608008 /* LLP Errors */
59#define NI_PORT_ERROR_CLEAR 0x608088 /* Clear the error bits */
60
61#define NI_META_TABLE0 0x638000 /* First meta routing table entry */
62#define NI_META_TABLE(_x) (NI_META_TABLE0 + (8 * (_x)))
63#define NI_META_ENTRIES 32
64
65#define NI_LOCAL_TABLE0 0x638100 /* First local routing table entry */
66#define NI_LOCAL_TABLE(_x) (NI_LOCAL_TABLE0 + (8 * (_x)))
67#define NI_LOCAL_ENTRIES 16
68
69/*
70 * NI_STATUS_REV_ID mask and shift definitions
71 * Have to use UINT64_CAST instead of 'L' suffix, for assembler.
72 */
73
74#define NSRI_8BITMODE_SHFT 30
75#define NSRI_8BITMODE_MASK (UINT64_CAST 0x1 << 30)
76#define NSRI_LINKUP_SHFT 29
77#define NSRI_LINKUP_MASK (UINT64_CAST 0x1 << 29)
78#define NSRI_DOWNREASON_SHFT 28 /* 0=failed, 1=never came */
79#define NSRI_DOWNREASON_MASK (UINT64_CAST 0x1 << 28) /* out of reset. */
80#define NSRI_MORENODES_SHFT 18
81#define NSRI_MORENODES_MASK (UINT64_CAST 1 << 18) /* Max. # of nodes */
82#define MORE_MEMORY 0
83#define MORE_NODES 1
84#define NSRI_REGIONSIZE_SHFT 17
85#define NSRI_REGIONSIZE_MASK (UINT64_CAST 1 << 17) /* Granularity */
86#define REGIONSIZE_FINE 1
87#define REGIONSIZE_COARSE 0
88#define NSRI_NODEID_SHFT 8
89#define NSRI_NODEID_MASK (UINT64_CAST 0x1ff << 8)/* Node (Hub) ID */
90#define NSRI_REV_SHFT 4
91#define NSRI_REV_MASK (UINT64_CAST 0xf << 4) /* Chip Revision */
92#define NSRI_CHIPID_SHFT 0
93#define NSRI_CHIPID_MASK (UINT64_CAST 0xf) /* Chip type ID */
94
95/*
96 * In fine mode, each node is a region. In coarse mode, there are
97 * eight nodes per region.
98 */
99#define NASID_TO_FINEREG_SHFT 0
100#define NASID_TO_COARSEREG_SHFT 3
101
102/* NI_PORT_RESET mask definitions */
103
104#define NPR_PORTRESET (UINT64_CAST 1 << 7) /* Send warm reset */
105#define NPR_LINKRESET (UINT64_CAST 1 << 1) /* Send link reset */
106#define NPR_LOCALRESET (UINT64_CAST 1) /* Reset entire hub */
107
108/* NI_PROTECTION mask and shift definitions */
109
110#define NPROT_RESETOK (UINT64_CAST 1)
111
112/* NI_GLOBAL_PARMS mask and shift definitions */
113
114#define NGP_MAXRETRY_SHFT 48 /* Maximum retries */
115#define NGP_MAXRETRY_MASK (UINT64_CAST 0x3ff << 48)
116#define NGP_TAILTOWRAP_SHFT 32 /* Tail timeout wrap */
117#define NGP_TAILTOWRAP_MASK (UINT64_CAST 0xffff << 32)
118
119#define NGP_CREDITTOVAL_SHFT 16 /* Tail timeout wrap */
120#define NGP_CREDITTOVAL_MASK (UINT64_CAST 0xf << 16)
121#define NGP_TAILTOVAL_SHFT 4 /* Tail timeout value */
122#define NGP_TAILTOVAL_MASK (UINT64_CAST 0xf << 4)
123
124/* NI_DIAG_PARMS mask and shift definitions */
125
126#define NDP_PORTTORESET (UINT64_CAST 1 << 18) /* Port tmout reset */
127#define NDP_LLP8BITMODE (UINT64_CAST 1 << 12) /* LLP 8-bit mode */
128#define NDP_PORTDISABLE (UINT64_CAST 1 << 6) /* Port disable */
129#define NDP_SENDERROR (UINT64_CAST 1) /* Send data error */
130
131/*
132 * NI_VECTOR_PARMS mask and shift definitions.
133 * TYPE may be any of the first four PIOTYPEs defined under NI_VECTOR_STATUS.
134 */
135
136#define NVP_PIOID_SHFT 40
137#define NVP_PIOID_MASK (UINT64_CAST 0x3ff << 40)
138#define NVP_WRITEID_SHFT 32
139#define NVP_WRITEID_MASK (UINT64_CAST 0xff << 32)
140#define NVP_ADDRESS_MASK (UINT64_CAST 0xffff8) /* Bits 19:3 */
141#define NVP_TYPE_SHFT 0
142#define NVP_TYPE_MASK (UINT64_CAST 0x3)
143
144/* NI_VECTOR_STATUS mask and shift definitions */
145
146#define NVS_VALID (UINT64_CAST 1 << 63)
147#define NVS_OVERRUN (UINT64_CAST 1 << 62)
148#define NVS_TARGET_SHFT 51
149#define NVS_TARGET_MASK (UINT64_CAST 0x3ff << 51)
150#define NVS_PIOID_SHFT 40
151#define NVS_PIOID_MASK (UINT64_CAST 0x3ff << 40)
152#define NVS_WRITEID_SHFT 32
153#define NVS_WRITEID_MASK (UINT64_CAST 0xff << 32)
154#define NVS_ADDRESS_MASK (UINT64_CAST 0xfffffff8) /* Bits 31:3 */
155#define NVS_TYPE_SHFT 0
156#define NVS_TYPE_MASK (UINT64_CAST 0x7)
157#define NVS_ERROR_MASK (UINT64_CAST 0x4) /* bit set means error */
158
159
160#define PIOTYPE_READ 0 /* VECTOR_PARMS and VECTOR_STATUS */
161#define PIOTYPE_WRITE 1 /* VECTOR_PARMS and VECTOR_STATUS */
162#define PIOTYPE_UNDEFINED 2 /* VECTOR_PARMS and VECTOR_STATUS */
163#define PIOTYPE_EXCHANGE 3 /* VECTOR_PARMS and VECTOR_STATUS */
164#define PIOTYPE_ADDR_ERR 4 /* VECTOR_STATUS only */
165#define PIOTYPE_CMD_ERR 5 /* VECTOR_STATUS only */
166#define PIOTYPE_PROT_ERR 6 /* VECTOR_STATUS only */
167#define PIOTYPE_UNKNOWN 7 /* VECTOR_STATUS only */
168
169/* NI_AGE_XXX mask and shift definitions */
170
171#define NAGE_VCH_SHFT 10
172#define NAGE_VCH_MASK (UINT64_CAST 3 << 10)
173#define NAGE_CC_SHFT 8
174#define NAGE_CC_MASK (UINT64_CAST 3 << 8)
175#define NAGE_AGE_SHFT 0
176#define NAGE_AGE_MASK (UINT64_CAST 0xff)
177#define NAGE_MASK (NAGE_VCH_MASK | NAGE_CC_MASK | NAGE_AGE_MASK)
178
179#define VCHANNEL_A 0
180#define VCHANNEL_B 1
181#define VCHANNEL_ANY 2
182
183/* NI_PORT_PARMS mask and shift definitions */
184
185#define NPP_NULLTO_SHFT 10
186#define NPP_NULLTO_MASK (UINT64_CAST 0x3f << 16)
187#define NPP_MAXBURST_SHFT 0
188#define NPP_MAXBURST_MASK (UINT64_CAST 0x3ff)
189#define NPP_RESET_DFLT_HUB20 ((UINT64_CAST 1 << NPP_NULLTO_SHFT) | \
190 (UINT64_CAST 0x3f0 << NPP_MAXBURST_SHFT))
191#define NPP_RESET_DEFAULTS ((UINT64_CAST 6 << NPP_NULLTO_SHFT) | \
192 (UINT64_CAST 0x3f0 << NPP_MAXBURST_SHFT))
193
194
195/* NI_PORT_ERROR mask and shift definitions */
196
197#define NPE_LINKRESET (UINT64_CAST 1 << 37)
198#define NPE_INTERNALERROR (UINT64_CAST 1 << 36)
199#define NPE_BADMESSAGE (UINT64_CAST 1 << 35)
200#define NPE_BADDEST (UINT64_CAST 1 << 34)
201#define NPE_FIFOOVERFLOW (UINT64_CAST 1 << 33)
202#define NPE_CREDITTO_SHFT 28
203#define NPE_CREDITTO_MASK (UINT64_CAST 0xf << 28)
204#define NPE_TAILTO_SHFT 24
205#define NPE_TAILTO_MASK (UINT64_CAST 0xf << 24)
206#define NPE_RETRYCOUNT_SHFT 16
207#define NPE_RETRYCOUNT_MASK (UINT64_CAST 0xff << 16)
208#define NPE_CBERRCOUNT_SHFT 8
209#define NPE_CBERRCOUNT_MASK (UINT64_CAST 0xff << 8)
210#define NPE_SNERRCOUNT_SHFT 0
211#define NPE_SNERRCOUNT_MASK (UINT64_CAST 0xff << 0)
212#define NPE_MASK 0x3effffffff
213
214#define NPE_COUNT_MAX 0xff
215
216#define NPE_FATAL_ERRORS (NPE_LINKRESET | NPE_INTERNALERROR | \
217 NPE_BADMESSAGE | NPE_BADDEST | \
218 NPE_FIFOOVERFLOW | NPE_CREDITTO_MASK | \
219 NPE_TAILTO_MASK)
220
221/* NI_META_TABLE mask and shift definitions */
222
223#define NMT_EXIT_PORT_MASK (UINT64_CAST 0xf)
224
225/* NI_LOCAL_TABLE mask and shift definitions */
226
227#define NLT_EXIT_PORT_MASK (UINT64_CAST 0xf)
228
229#ifndef __ASSEMBLY__
230
231typedef union hubni_port_error_u {
232 u64 nipe_reg_value;
233 struct {
234 u64 nipe_rsvd: 26, /* unused */
235 nipe_lnk_reset: 1, /* link reset */
236 nipe_intl_err: 1, /* internal error */
237 nipe_bad_msg: 1, /* bad message */
238 nipe_bad_dest: 1, /* bad dest */
239 nipe_fifo_ovfl: 1, /* fifo overflow */
240 nipe_rsvd1: 1, /* unused */
241 nipe_credit_to: 4, /* credit timeout */
242 nipe_tail_to: 4, /* tail timeout */
243 nipe_retry_cnt: 8, /* retry error count */
244 nipe_cb_cnt: 8, /* checkbit error count */
245 nipe_sn_cnt: 8; /* sequence number count */
246 } nipe_fields_s;
247} hubni_port_error_t;
248
249#define NI_LLP_RETRY_MAX 0xff
250#define NI_LLP_CB_MAX 0xff
251#define NI_LLP_SN_MAX 0xff
252
253#endif /* !__ASSEMBLY__ */
254
255#endif /* _ASM_SGI_SN0_HUBNI_H */
diff --git a/include/asm-mips/sn/sn0/hubpi.h b/include/asm-mips/sn/sn0/hubpi.h
deleted file mode 100644
index e39f5f9da040..000000000000
--- a/include/asm-mips/sn/sn0/hubpi.h
+++ /dev/null
@@ -1,409 +0,0 @@
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 * Derived from IRIX <sys/SN/SN0/hubpi.h>, revision 1.28.
7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle
10 */
11#ifndef _ASM_SN_SN0_HUBPI_H
12#define _ASM_SN_SN0_HUBPI_H
13
14#include <linux/types.h>
15
16/*
17 * Hub I/O interface registers
18 *
19 * All registers in this file are subject to change until Hub chip tapeout.
20 * All register "addresses" are actually offsets. Use the LOCAL_HUB
21 * or REMOTE_HUB macros to synthesize an actual address
22 */
23
24#define PI_BASE 0x000000
25
26/* General protection and control registers */
27
28#define PI_CPU_PROTECT 0x000000 /* CPU Protection */
29#define PI_PROT_OVERRD 0x000008 /* Clear CPU Protection bit */
30#define PI_IO_PROTECT 0x000010 /* Interrupt Pending Protection */
31#define PI_REGION_PRESENT 0x000018 /* Indicates whether region exists */
32#define PI_CPU_NUM 0x000020 /* CPU Number ID */
33#define PI_CALIAS_SIZE 0x000028 /* Cached Alias Size */
34#define PI_MAX_CRB_TIMEOUT 0x000030 /* Maximum Timeout for CRB */
35#define PI_CRB_SFACTOR 0x000038 /* Scale factor for CRB timeout */
36
37/* CALIAS values */
38#define PI_CALIAS_SIZE_0 0
39#define PI_CALIAS_SIZE_4K 1
40#define PI_CALIAS_SIZE_8K 2
41#define PI_CALIAS_SIZE_16K 3
42#define PI_CALIAS_SIZE_32K 4
43#define PI_CALIAS_SIZE_64K 5
44#define PI_CALIAS_SIZE_128K 6
45#define PI_CALIAS_SIZE_256K 7
46#define PI_CALIAS_SIZE_512K 8
47#define PI_CALIAS_SIZE_1M 9
48#define PI_CALIAS_SIZE_2M 10
49#define PI_CALIAS_SIZE_4M 11
50#define PI_CALIAS_SIZE_8M 12
51#define PI_CALIAS_SIZE_16M 13
52#define PI_CALIAS_SIZE_32M 14
53#define PI_CALIAS_SIZE_64M 15
54
55/* Processor control and status checking */
56
57#define PI_CPU_PRESENT_A 0x000040 /* CPU Present A */
58#define PI_CPU_PRESENT_B 0x000048 /* CPU Present B */
59#define PI_CPU_ENABLE_A 0x000050 /* CPU Enable A */
60#define PI_CPU_ENABLE_B 0x000058 /* CPU Enable B */
61#define PI_REPLY_LEVEL 0x000060 /* Reply Level */
62#define PI_HARDRESET_BIT 0x020068 /* Bit cleared by s/w on SR */
63#define PI_NMI_A 0x000070 /* NMI to CPU A */
64#define PI_NMI_B 0x000078 /* NMI to CPU B */
65#define PI_NMI_OFFSET (PI_NMI_B - PI_NMI_A)
66#define PI_SOFTRESET 0x000080 /* Softreset (to both CPUs) */
67
68/* Regular Interrupt register checking. */
69
70#define PI_INT_PEND_MOD 0x000090 /* Write to set pending ints */
71#define PI_INT_PEND0 0x000098 /* Read to get pending ints */
72#define PI_INT_PEND1 0x0000a0 /* Read to get pending ints */
73#define PI_INT_MASK0_A 0x0000a8 /* Interrupt Mask 0 for CPU A */
74#define PI_INT_MASK1_A 0x0000b0 /* Interrupt Mask 1 for CPU A */
75#define PI_INT_MASK0_B 0x0000b8 /* Interrupt Mask 0 for CPU B */
76#define PI_INT_MASK1_B 0x0000c0 /* Interrupt Mask 1 for CPU B */
77
78#define PI_INT_MASK_OFFSET 0x10 /* Offset from A to B */
79
80/* Crosscall interrupts */
81
82#define PI_CC_PEND_SET_A 0x0000c8 /* CC Interrupt Pending Set, CPU A */
83#define PI_CC_PEND_SET_B 0x0000d0 /* CC Interrupt Pending Set, CPU B */
84#define PI_CC_PEND_CLR_A 0x0000d8 /* CC Interrupt Pending Clr, CPU A */
85#define PI_CC_PEND_CLR_B 0x0000e0 /* CC Interrupt Pending Clr, CPU B */
86#define PI_CC_MASK 0x0000e8 /* CC Interrupt mask */
87
88#define PI_INT_SET_OFFSET 0x08 /* Offset from A to B */
89
90/* Realtime Counter and Profiler control registers */
91
92#define PI_RT_COUNT 0x030100 /* Real Time Counter */
93#define PI_RT_COMPARE_A 0x000108 /* Real Time Compare A */
94#define PI_RT_COMPARE_B 0x000110 /* Real Time Compare B */
95#define PI_PROFILE_COMPARE 0x000118 /* L5 int to both cpus when == RTC */
96#define PI_RT_PEND_A 0x000120 /* Set if RT int for A pending */
97#define PI_RT_PEND_B 0x000128 /* Set if RT int for B pending */
98#define PI_PROF_PEND_A 0x000130 /* Set if Prof int for A pending */
99#define PI_PROF_PEND_B 0x000138 /* Set if Prof int for B pending */
100#define PI_RT_EN_A 0x000140 /* RT int for CPU A enable */
101#define PI_RT_EN_B 0x000148 /* RT int for CPU B enable */
102#define PI_PROF_EN_A 0x000150 /* PROF int for CPU A enable */
103#define PI_PROF_EN_B 0x000158 /* PROF int for CPU B enable */
104#define PI_RT_LOCAL_CTRL 0x000160 /* RT control register */
105#define PI_RT_FILTER_CTRL 0x000168 /* GCLK Filter control register */
106
107#define PI_COUNT_OFFSET 0x08 /* A to B offset for all counts */
108
109/* Built-In Self Test support */
110
111#define PI_BIST_WRITE_DATA 0x000200 /* BIST write data */
112#define PI_BIST_READ_DATA 0x000208 /* BIST read data */
113#define PI_BIST_COUNT_TARG 0x000210 /* BIST Count and Target */
114#define PI_BIST_READY 0x000218 /* BIST Ready indicator */
115#define PI_BIST_SHIFT_LOAD 0x000220 /* BIST control */
116#define PI_BIST_SHIFT_UNLOAD 0x000228 /* BIST control */
117#define PI_BIST_ENTER_RUN 0x000230 /* BIST control */
118
119/* Graphics control registers */
120
121#define PI_GFX_PAGE_A 0x000300 /* Graphics page A */
122#define PI_GFX_CREDIT_CNTR_A 0x000308 /* Graphics credit counter A */
123#define PI_GFX_BIAS_A 0x000310 /* Graphics bias A */
124#define PI_GFX_INT_CNTR_A 0x000318 /* Graphics interrupt counter A */
125#define PI_GFX_INT_CMP_A 0x000320 /* Graphics interrupt comparator A */
126#define PI_GFX_PAGE_B 0x000328 /* Graphics page B */
127#define PI_GFX_CREDIT_CNTR_B 0x000330 /* Graphics credit counter B */
128#define PI_GFX_BIAS_B 0x000338 /* Graphics bias B */
129#define PI_GFX_INT_CNTR_B 0x000340 /* Graphics interrupt counter B */
130#define PI_GFX_INT_CMP_B 0x000348 /* Graphics interrupt comparator B */
131
132#define PI_GFX_OFFSET (PI_GFX_PAGE_B - PI_GFX_PAGE_A)
133#define PI_GFX_PAGE_ENABLE 0x0000010000000000LL
134
135/* Error and timeout registers */
136#define PI_ERR_INT_PEND 0x000400 /* Error Interrupt Pending */
137#define PI_ERR_INT_MASK_A 0x000408 /* Error Interrupt mask for CPU A */
138#define PI_ERR_INT_MASK_B 0x000410 /* Error Interrupt mask for CPU B */
139#define PI_ERR_STACK_ADDR_A 0x000418 /* Error stack address for CPU A */
140#define PI_ERR_STACK_ADDR_B 0x000420 /* Error stack address for CPU B */
141#define PI_ERR_STACK_SIZE 0x000428 /* Error Stack Size */
142#define PI_ERR_STATUS0_A 0x000430 /* Error Status 0A */
143#define PI_ERR_STATUS0_A_RCLR 0x000438 /* Error Status 0A clear on read */
144#define PI_ERR_STATUS1_A 0x000440 /* Error Status 1A */
145#define PI_ERR_STATUS1_A_RCLR 0x000448 /* Error Status 1A clear on read */
146#define PI_ERR_STATUS0_B 0x000450 /* Error Status 0B */
147#define PI_ERR_STATUS0_B_RCLR 0x000458 /* Error Status 0B clear on read */
148#define PI_ERR_STATUS1_B 0x000460 /* Error Status 1B */
149#define PI_ERR_STATUS1_B_RCLR 0x000468 /* Error Status 1B clear on read */
150#define PI_SPOOL_CMP_A 0x000470 /* Spool compare for CPU A */
151#define PI_SPOOL_CMP_B 0x000478 /* Spool compare for CPU B */
152#define PI_CRB_TIMEOUT_A 0x000480 /* Timed out CRB entries for A */
153#define PI_CRB_TIMEOUT_B 0x000488 /* Timed out CRB entries for B */
154#define PI_SYSAD_ERRCHK_EN 0x000490 /* Enables SYSAD error checking */
155#define PI_BAD_CHECK_BIT_A 0x000498 /* Force SYSAD check bit error */
156#define PI_BAD_CHECK_BIT_B 0x0004a0 /* Force SYSAD check bit error */
157#define PI_NACK_CNT_A 0x0004a8 /* Consecutive NACK counter */
158#define PI_NACK_CNT_B 0x0004b0 /* " " for CPU B */
159#define PI_NACK_CMP 0x0004b8 /* NACK count compare */
160#define PI_STACKADDR_OFFSET (PI_ERR_STACK_ADDR_B - PI_ERR_STACK_ADDR_A)
161#define PI_ERRSTAT_OFFSET (PI_ERR_STATUS0_B - PI_ERR_STATUS0_A)
162#define PI_RDCLR_OFFSET (PI_ERR_STATUS0_A_RCLR - PI_ERR_STATUS0_A)
163
164/* Bits in PI_ERR_INT_PEND */
165#define PI_ERR_SPOOL_CMP_B 0x00000001 /* Spool end hit high water */
166#define PI_ERR_SPOOL_CMP_A 0x00000002
167#define PI_ERR_SPUR_MSG_B 0x00000004 /* Spurious message intr. */
168#define PI_ERR_SPUR_MSG_A 0x00000008
169#define PI_ERR_WRB_TERR_B 0x00000010 /* WRB TERR */
170#define PI_ERR_WRB_TERR_A 0x00000020
171#define PI_ERR_WRB_WERR_B 0x00000040 /* WRB WERR */
172#define PI_ERR_WRB_WERR_A 0x00000080
173#define PI_ERR_SYSSTATE_B 0x00000100 /* SysState parity error */
174#define PI_ERR_SYSSTATE_A 0x00000200
175#define PI_ERR_SYSAD_DATA_B 0x00000400 /* SysAD data parity error */
176#define PI_ERR_SYSAD_DATA_A 0x00000800
177#define PI_ERR_SYSAD_ADDR_B 0x00001000 /* SysAD addr parity error */
178#define PI_ERR_SYSAD_ADDR_A 0x00002000
179#define PI_ERR_SYSCMD_DATA_B 0x00004000 /* SysCmd data parity error */
180#define PI_ERR_SYSCMD_DATA_A 0x00008000
181#define PI_ERR_SYSCMD_ADDR_B 0x00010000 /* SysCmd addr parity error */
182#define PI_ERR_SYSCMD_ADDR_A 0x00020000
183#define PI_ERR_BAD_SPOOL_B 0x00040000 /* Error spooling to memory */
184#define PI_ERR_BAD_SPOOL_A 0x00080000
185#define PI_ERR_UNCAC_UNCORR_B 0x00100000 /* Uncached uncorrectable */
186#define PI_ERR_UNCAC_UNCORR_A 0x00200000
187#define PI_ERR_SYSSTATE_TAG_B 0x00400000 /* SysState tag parity error */
188#define PI_ERR_SYSSTATE_TAG_A 0x00800000
189#define PI_ERR_MD_UNCORR 0x01000000 /* Must be cleared in MD */
190
191#define PI_ERR_CLEAR_ALL_A 0x00aaaaaa
192#define PI_ERR_CLEAR_ALL_B 0x00555555
193
194
195/*
196 * The following three macros define all possible error int pends.
197 */
198
199#define PI_FATAL_ERR_CPU_A (PI_ERR_SYSSTATE_TAG_A | \
200 PI_ERR_BAD_SPOOL_A | \
201 PI_ERR_SYSCMD_ADDR_A | \
202 PI_ERR_SYSCMD_DATA_A | \
203 PI_ERR_SYSAD_ADDR_A | \
204 PI_ERR_SYSAD_DATA_A | \
205 PI_ERR_SYSSTATE_A)
206
207#define PI_MISC_ERR_CPU_A (PI_ERR_UNCAC_UNCORR_A | \
208 PI_ERR_WRB_WERR_A | \
209 PI_ERR_WRB_TERR_A | \
210 PI_ERR_SPUR_MSG_A | \
211 PI_ERR_SPOOL_CMP_A)
212
213#define PI_FATAL_ERR_CPU_B (PI_ERR_SYSSTATE_TAG_B | \
214 PI_ERR_BAD_SPOOL_B | \
215 PI_ERR_SYSCMD_ADDR_B | \
216 PI_ERR_SYSCMD_DATA_B | \
217 PI_ERR_SYSAD_ADDR_B | \
218 PI_ERR_SYSAD_DATA_B | \
219 PI_ERR_SYSSTATE_B)
220
221#define PI_MISC_ERR_CPU_B (PI_ERR_UNCAC_UNCORR_B | \
222 PI_ERR_WRB_WERR_B | \
223 PI_ERR_WRB_TERR_B | \
224 PI_ERR_SPUR_MSG_B | \
225 PI_ERR_SPOOL_CMP_B)
226
227#define PI_ERR_GENERIC (PI_ERR_MD_UNCORR)
228
229/*
230 * Error types for PI_ERR_STATUS0_[AB] and error stack:
231 * Use the write types if WRBRRB is 1 else use the read types
232 */
233
234/* Fields in PI_ERR_STATUS0_[AB] */
235#define PI_ERR_ST0_TYPE_MASK 0x0000000000000007
236#define PI_ERR_ST0_TYPE_SHFT 0
237#define PI_ERR_ST0_REQNUM_MASK 0x0000000000000038
238#define PI_ERR_ST0_REQNUM_SHFT 3
239#define PI_ERR_ST0_SUPPL_MASK 0x000000000001ffc0
240#define PI_ERR_ST0_SUPPL_SHFT 6
241#define PI_ERR_ST0_CMD_MASK 0x0000000001fe0000
242#define PI_ERR_ST0_CMD_SHFT 17
243#define PI_ERR_ST0_ADDR_MASK 0x3ffffffffe000000
244#define PI_ERR_ST0_ADDR_SHFT 25
245#define PI_ERR_ST0_OVERRUN_MASK 0x4000000000000000
246#define PI_ERR_ST0_OVERRUN_SHFT 62
247#define PI_ERR_ST0_VALID_MASK 0x8000000000000000
248#define PI_ERR_ST0_VALID_SHFT 63
249
250/* Fields in PI_ERR_STATUS1_[AB] */
251#define PI_ERR_ST1_SPOOL_MASK 0x00000000001fffff
252#define PI_ERR_ST1_SPOOL_SHFT 0
253#define PI_ERR_ST1_TOUTCNT_MASK 0x000000001fe00000
254#define PI_ERR_ST1_TOUTCNT_SHFT 21
255#define PI_ERR_ST1_INVCNT_MASK 0x0000007fe0000000
256#define PI_ERR_ST1_INVCNT_SHFT 29
257#define PI_ERR_ST1_CRBNUM_MASK 0x0000038000000000
258#define PI_ERR_ST1_CRBNUM_SHFT 39
259#define PI_ERR_ST1_WRBRRB_MASK 0x0000040000000000
260#define PI_ERR_ST1_WRBRRB_SHFT 42
261#define PI_ERR_ST1_CRBSTAT_MASK 0x001ff80000000000
262#define PI_ERR_ST1_CRBSTAT_SHFT 43
263#define PI_ERR_ST1_MSGSRC_MASK 0xffe0000000000000
264#define PI_ERR_ST1_MSGSRC_SHFT 53
265
266/* Fields in the error stack */
267#define PI_ERR_STK_TYPE_MASK 0x0000000000000003
268#define PI_ERR_STK_TYPE_SHFT 0
269#define PI_ERR_STK_SUPPL_MASK 0x0000000000000038
270#define PI_ERR_STK_SUPPL_SHFT 3
271#define PI_ERR_STK_REQNUM_MASK 0x00000000000001c0
272#define PI_ERR_STK_REQNUM_SHFT 6
273#define PI_ERR_STK_CRBNUM_MASK 0x0000000000000e00
274#define PI_ERR_STK_CRBNUM_SHFT 9
275#define PI_ERR_STK_WRBRRB_MASK 0x0000000000001000
276#define PI_ERR_STK_WRBRRB_SHFT 12
277#define PI_ERR_STK_CRBSTAT_MASK 0x00000000007fe000
278#define PI_ERR_STK_CRBSTAT_SHFT 13
279#define PI_ERR_STK_CMD_MASK 0x000000007f800000
280#define PI_ERR_STK_CMD_SHFT 23
281#define PI_ERR_STK_ADDR_MASK 0xffffffff80000000
282#define PI_ERR_STK_ADDR_SHFT 31
283
284/* Error type in the error status or stack on Read CRBs */
285#define PI_ERR_RD_PRERR 1
286#define PI_ERR_RD_DERR 2
287#define PI_ERR_RD_TERR 3
288
289/* Error type in the error status or stack on Write CRBs */
290#define PI_ERR_WR_WERR 0
291#define PI_ERR_WR_PWERR 1
292#define PI_ERR_WR_TERR 3
293
294/* Read or Write CRB in error status or stack */
295#define PI_ERR_RRB 0
296#define PI_ERR_WRB 1
297#define PI_ERR_ANY_CRB 2
298
299/* Address masks in the error status and error stack are not the same */
300#define ERR_STK_ADDR_SHFT 7
301#define ERR_STAT0_ADDR_SHFT 3
302
303#define PI_MIN_STACK_SIZE 4096 /* For figuring out the size to set */
304#define PI_STACK_SIZE_SHFT 12 /* 4k */
305
306#define ERR_STACK_SIZE_BYTES(_sz) \
307 ((_sz) ? (PI_MIN_STACK_SIZE << ((_sz) - 1)) : 0)
308
309#ifndef __ASSEMBLY__
310/*
311 * format of error stack and error status registers.
312 */
313
314struct err_stack_format {
315 u64 sk_addr : 33, /* address */
316 sk_cmd : 8, /* message command */
317 sk_crb_sts : 10, /* status from RRB or WRB */
318 sk_rw_rb : 1, /* RRB == 0, WRB == 1 */
319 sk_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */
320 sk_t5_req : 3, /* RRB T5 request number */
321 sk_suppl : 3, /* lowest 3 bit of supplemental */
322 sk_err_type: 3; /* error type */
323};
324
325typedef union pi_err_stack {
326 u64 pi_stk_word;
327 struct err_stack_format pi_stk_fmt;
328} pi_err_stack_t;
329
330struct err_status0_format {
331 u64 s0_valid : 1, /* Valid */
332 s0_ovr_run : 1, /* Overrun, spooled to memory */
333 s0_addr : 37, /* address */
334 s0_cmd : 8, /* message command */
335 s0_supl : 11, /* message supplemental field */
336 s0_t5_req : 3, /* RRB T5 request number */
337 s0_err_type: 3; /* error type */
338};
339
340typedef union pi_err_stat0 {
341 u64 pi_stat0_word;
342 struct err_status0_format pi_stat0_fmt;
343} pi_err_stat0_t;
344
345struct err_status1_format {
346 u64 s1_src : 11, /* message source */
347 s1_crb_sts : 10, /* status from RRB or WRB */
348 s1_rw_rb : 1, /* RRB == 0, WRB == 1 */
349 s1_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */
350 s1_inval_cnt:10, /* signed invalidate counter RRB */
351 s1_to_cnt : 8, /* crb timeout counter */
352 s1_spl_cnt : 21; /* number spooled to memory */
353};
354
355typedef union pi_err_stat1 {
356 u64 pi_stat1_word;
357 struct err_status1_format pi_stat1_fmt;
358} pi_err_stat1_t;
359
360typedef u64 rtc_time_t;
361
362#endif /* !__ASSEMBLY__ */
363
364
365/* Bits in PI_SYSAD_ERRCHK_EN */
366#define PI_SYSAD_ERRCHK_ECCGEN 0x01 /* Enable ECC generation */
367#define PI_SYSAD_ERRCHK_QUALGEN 0x02 /* Enable data quality signal gen. */
368#define PI_SYSAD_ERRCHK_SADP 0x04 /* Enable SysAD parity checking */
369#define PI_SYSAD_ERRCHK_CMDP 0x08 /* Enable SysCmd parity checking */
370#define PI_SYSAD_ERRCHK_STATE 0x10 /* Enable SysState parity checking */
371#define PI_SYSAD_ERRCHK_QUAL 0x20 /* Enable data quality checking */
372#define PI_SYSAD_CHECK_ALL 0x3f /* Generate and check all signals. */
373
374/* Interrupt pending bits on R10000 */
375
376#define HUB_IP_PEND0 0x0400
377#define HUB_IP_PEND1_CC 0x0800
378#define HUB_IP_RT 0x1000
379#define HUB_IP_PROF 0x2000
380#define HUB_IP_ERROR 0x4000
381#define HUB_IP_MASK 0x7c00
382
383/* PI_RT_LOCAL_CTRL mask and shift definitions */
384
385#define PRLC_USE_INT_SHFT 16
386#define PRLC_USE_INT_MASK (UINT64_CAST 1 << 16)
387#define PRLC_USE_INT (UINT64_CAST 1 << 16)
388#define PRLC_GCLK_SHFT 15
389#define PRLC_GCLK_MASK (UINT64_CAST 1 << 15)
390#define PRLC_GCLK (UINT64_CAST 1 << 15)
391#define PRLC_GCLK_COUNT_SHFT 8
392#define PRLC_GCLK_COUNT_MASK (UINT64_CAST 0x7f << 8)
393#define PRLC_MAX_COUNT_SHFT 1
394#define PRLC_MAX_COUNT_MASK (UINT64_CAST 0x7f << 1)
395#define PRLC_GCLK_EN_SHFT 0
396#define PRLC_GCLK_EN_MASK (UINT64_CAST 1)
397#define PRLC_GCLK_EN (UINT64_CAST 1)
398
399/* PI_RT_FILTER_CTRL mask and shift definitions */
400
401/*
402 * Bits for NACK_CNT_A/B and NACK_CMP
403 */
404#define PI_NACK_CNT_EN_SHFT 20
405#define PI_NACK_CNT_EN_MASK 0x100000
406#define PI_NACK_CNT_MASK 0x0fffff
407#define PI_NACK_CNT_MAX 0x0fffff
408
409#endif /* _ASM_SN_SN0_HUBPI_H */
diff --git a/include/asm-mips/sn/sn0/ip27.h b/include/asm-mips/sn/sn0/ip27.h
deleted file mode 100644
index 3c97e0855c8d..000000000000
--- a/include/asm-mips/sn/sn0/ip27.h
+++ /dev/null
@@ -1,85 +0,0 @@
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 * Derived from IRIX <sys/SN/SN0/IP27.h>.
7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999, 2006 by Ralf Baechle
10 */
11#ifndef _ASM_SN_SN0_IP27_H
12#define _ASM_SN_SN0_IP27_H
13
14#include <asm/mipsregs.h>
15
16/*
17 * Simple definitions for the masks which remove SW bits from pte.
18 */
19
20#define TLBLO_HWBITSHIFT 0 /* Shift value, for masking */
21
22#ifndef __ASSEMBLY__
23
24#define CAUSE_BERRINTR IE_IRQ5
25
26#define ECCF_CACHE_ERR 0
27#define ECCF_TAGLO 1
28#define ECCF_ECC 2
29#define ECCF_ERROREPC 3
30#define ECCF_PADDR 4
31#define ECCF_SIZE (5 * sizeof(long))
32
33#endif /* !__ASSEMBLY__ */
34
35#ifdef __ASSEMBLY__
36
37/*
38 * KL_GET_CPUNUM (similar to EV_GET_SPNUM for EVEREST platform) reads
39 * the processor number of the calling processor. The proc parameters
40 * must be a register.
41 */
42#define KL_GET_CPUNUM(proc) \
43 dli proc, LOCAL_HUB(0); \
44 ld proc, PI_CPU_NUM(proc)
45
46#endif /* __ASSEMBLY__ */
47
48/*
49 * R10000 status register interrupt bit mask usage for IP27.
50 */
51#define SRB_SWTIMO IE_SW0 /* 0x0100 */
52#define SRB_NET IE_SW1 /* 0x0200 */
53#define SRB_DEV0 IE_IRQ0 /* 0x0400 */
54#define SRB_DEV1 IE_IRQ1 /* 0x0800 */
55#define SRB_TIMOCLK IE_IRQ2 /* 0x1000 */
56#define SRB_PROFCLK IE_IRQ3 /* 0x2000 */
57#define SRB_ERR IE_IRQ4 /* 0x4000 */
58#define SRB_SCHEDCLK IE_IRQ5 /* 0x8000 */
59
60#define SR_IBIT_HI SRB_DEV0
61#define SR_IBIT_PROF SRB_PROFCLK
62
63#define SRB_SWTIMO_IDX 0
64#define SRB_NET_IDX 1
65#define SRB_DEV0_IDX 2
66#define SRB_DEV1_IDX 3
67#define SRB_TIMOCLK_IDX 4
68#define SRB_PROFCLK_IDX 5
69#define SRB_ERR_IDX 6
70#define SRB_SCHEDCLK_IDX 7
71
72#define NUM_CAUSE_INTRS 8
73
74#define SCACHE_LINESIZE 128
75#define SCACHE_LINEMASK (SCACHE_LINESIZE - 1)
76
77#include <asm/sn/addrs.h>
78
79#define LED_CYCLE_MASK 0x0f
80#define LED_CYCLE_SHFT 4
81
82#define SEND_NMI(_nasid, _slice) \
83 REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1)
84
85#endif /* _ASM_SN_SN0_IP27_H */
diff --git a/include/asm-mips/sn/sn_private.h b/include/asm-mips/sn/sn_private.h
deleted file mode 100644
index 1a2c3025bf28..000000000000
--- a/include/asm-mips/sn/sn_private.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef __ASM_SN_SN_PRIVATE_H
2#define __ASM_SN_SN_PRIVATE_H
3
4#include <asm/sn/types.h>
5
6extern nasid_t master_nasid;
7
8extern void cpu_node_probe(void);
9extern cnodeid_t get_compact_nodeid(void);
10extern void hub_rtc_init(cnodeid_t);
11extern void cpu_time_init(void);
12extern void per_cpu_init(void);
13extern void install_cpu_nmi_handler(int slice);
14extern void install_ipi(void);
15extern void setup_replication_mask(void);
16extern void replicate_kernel_text(void);
17extern pfn_t node_getfirstfree(cnodeid_t);
18
19#endif /* __ASM_SN_SN_PRIVATE_H */
diff --git a/include/asm-mips/sn/types.h b/include/asm-mips/sn/types.h
deleted file mode 100644
index 74d0bb260b86..000000000000
--- a/include/asm-mips/sn/types.h
+++ /dev/null
@@ -1,26 +0,0 @@
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 * Copyright (C) 1999 Silicon Graphics, Inc.
7 * Copyright (C) 1999 by Ralf Baechle
8 */
9#ifndef _ASM_SN_TYPES_H
10#define _ASM_SN_TYPES_H
11
12#include <linux/types.h>
13
14typedef unsigned long cpuid_t;
15typedef unsigned long cnodemask_t;
16typedef signed short nasid_t; /* node id in numa-as-id space */
17typedef signed short cnodeid_t; /* node id in compact-id space */
18typedef signed char partid_t; /* partition ID type */
19typedef signed short moduleid_t; /* user-visible module number type */
20typedef signed short cmoduleid_t; /* kernel compact module id type */
21typedef unsigned char clusterid_t; /* Clusterid of the cell */
22typedef unsigned long pfn_t;
23
24typedef dev_t vertex_hdl_t; /* hardware graph vertex handle */
25
26#endif /* _ASM_SN_TYPES_H */
diff --git a/include/asm-mips/sni.h b/include/asm-mips/sni.h
deleted file mode 100644
index 8c1eb02c6d16..000000000000
--- a/include/asm-mips/sni.h
+++ /dev/null
@@ -1,244 +0,0 @@
1/*
2 * SNI specific definitions
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 (C) 1997, 1998 by Ralf Baechle
9 * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
10 */
11#ifndef __ASM_SNI_H
12#define __ASM_SNI_H
13
14extern unsigned int sni_brd_type;
15
16#define SNI_BRD_10 2
17#define SNI_BRD_10NEW 3
18#define SNI_BRD_TOWER_OASIC 4
19#define SNI_BRD_MINITOWER 5
20#define SNI_BRD_PCI_TOWER 6
21#define SNI_BRD_RM200 7
22#define SNI_BRD_PCI_MTOWER 8
23#define SNI_BRD_PCI_DESKTOP 9
24#define SNI_BRD_PCI_TOWER_CPLUS 10
25#define SNI_BRD_PCI_MTOWER_CPLUS 11
26
27/* RM400 cpu types */
28#define SNI_CPU_M8021 0x01
29#define SNI_CPU_M8030 0x04
30#define SNI_CPU_M8031 0x06
31#define SNI_CPU_M8034 0x0f
32#define SNI_CPU_M8037 0x07
33#define SNI_CPU_M8040 0x05
34#define SNI_CPU_M8043 0x09
35#define SNI_CPU_M8050 0x0b
36#define SNI_CPU_M8053 0x0d
37
38#define SNI_PORT_BASE CKSEG1ADDR(0xb4000000)
39
40#ifndef __MIPSEL__
41/*
42 * ASIC PCI registers for big endian configuration.
43 */
44#define PCIMT_UCONF CKSEG1ADDR(0xbfff0004)
45#define PCIMT_IOADTIMEOUT2 CKSEG1ADDR(0xbfff000c)
46#define PCIMT_IOMEMCONF CKSEG1ADDR(0xbfff0014)
47#define PCIMT_IOMMU CKSEG1ADDR(0xbfff001c)
48#define PCIMT_IOADTIMEOUT1 CKSEG1ADDR(0xbfff0024)
49#define PCIMT_DMAACCESS CKSEG1ADDR(0xbfff002c)
50#define PCIMT_DMAHIT CKSEG1ADDR(0xbfff0034)
51#define PCIMT_ERRSTATUS CKSEG1ADDR(0xbfff003c)
52#define PCIMT_ERRADDR CKSEG1ADDR(0xbfff0044)
53#define PCIMT_SYNDROME CKSEG1ADDR(0xbfff004c)
54#define PCIMT_ITPEND CKSEG1ADDR(0xbfff0054)
55#define IT_INT2 0x01
56#define IT_INTD 0x02
57#define IT_INTC 0x04
58#define IT_INTB 0x08
59#define IT_INTA 0x10
60#define IT_EISA 0x20
61#define IT_SCSI 0x40
62#define IT_ETH 0x80
63#define PCIMT_IRQSEL CKSEG1ADDR(0xbfff005c)
64#define PCIMT_TESTMEM CKSEG1ADDR(0xbfff0064)
65#define PCIMT_ECCREG CKSEG1ADDR(0xbfff006c)
66#define PCIMT_CONFIG_ADDRESS CKSEG1ADDR(0xbfff0074)
67#define PCIMT_ASIC_ID CKSEG1ADDR(0xbfff007c) /* read */
68#define PCIMT_SOFT_RESET CKSEG1ADDR(0xbfff007c) /* write */
69#define PCIMT_PIA_OE CKSEG1ADDR(0xbfff0084)
70#define PCIMT_PIA_DATAOUT CKSEG1ADDR(0xbfff008c)
71#define PCIMT_PIA_DATAIN CKSEG1ADDR(0xbfff0094)
72#define PCIMT_CACHECONF CKSEG1ADDR(0xbfff009c)
73#define PCIMT_INVSPACE CKSEG1ADDR(0xbfff00a4)
74#else
75/*
76 * ASIC PCI registers for little endian configuration.
77 */
78#define PCIMT_UCONF CKSEG1ADDR(0xbfff0000)
79#define PCIMT_IOADTIMEOUT2 CKSEG1ADDR(0xbfff0008)
80#define PCIMT_IOMEMCONF CKSEG1ADDR(0xbfff0010)
81#define PCIMT_IOMMU CKSEG1ADDR(0xbfff0018)
82#define PCIMT_IOADTIMEOUT1 CKSEG1ADDR(0xbfff0020)
83#define PCIMT_DMAACCESS CKSEG1ADDR(0xbfff0028)
84#define PCIMT_DMAHIT CKSEG1ADDR(0xbfff0030)
85#define PCIMT_ERRSTATUS CKSEG1ADDR(0xbfff0038)
86#define PCIMT_ERRADDR CKSEG1ADDR(0xbfff0040)
87#define PCIMT_SYNDROME CKSEG1ADDR(0xbfff0048)
88#define PCIMT_ITPEND CKSEG1ADDR(0xbfff0050)
89#define IT_INT2 0x01
90#define IT_INTD 0x02
91#define IT_INTC 0x04
92#define IT_INTB 0x08
93#define IT_INTA 0x10
94#define IT_EISA 0x20
95#define IT_SCSI 0x40
96#define IT_ETH 0x80
97#define PCIMT_IRQSEL CKSEG1ADDR(0xbfff0058)
98#define PCIMT_TESTMEM CKSEG1ADDR(0xbfff0060)
99#define PCIMT_ECCREG CKSEG1ADDR(0xbfff0068)
100#define PCIMT_CONFIG_ADDRESS CKSEG1ADDR(0xbfff0070)
101#define PCIMT_ASIC_ID CKSEG1ADDR(0xbfff0078) /* read */
102#define PCIMT_SOFT_RESET CKSEG1ADDR(0xbfff0078) /* write */
103#define PCIMT_PIA_OE CKSEG1ADDR(0xbfff0080)
104#define PCIMT_PIA_DATAOUT CKSEG1ADDR(0xbfff0088)
105#define PCIMT_PIA_DATAIN CKSEG1ADDR(0xbfff0090)
106#define PCIMT_CACHECONF CKSEG1ADDR(0xbfff0098)
107#define PCIMT_INVSPACE CKSEG1ADDR(0xbfff00a0)
108#endif
109
110#define PCIMT_PCI_CONF CKSEG1ADDR(0xbfff0100)
111
112/*
113 * Data port for the PCI bus in IO space
114 */
115#define PCIMT_CONFIG_DATA 0x0cfc
116
117/*
118 * Board specific registers
119 */
120#define PCIMT_CSMSR CKSEG1ADDR(0xbfd00000)
121#define PCIMT_CSSWITCH CKSEG1ADDR(0xbfd10000)
122#define PCIMT_CSITPEND CKSEG1ADDR(0xbfd20000)
123#define PCIMT_AUTO_PO_EN CKSEG1ADDR(0xbfd30000)
124#define PCIMT_CLR_TEMP CKSEG1ADDR(0xbfd40000)
125#define PCIMT_AUTO_PO_DIS CKSEG1ADDR(0xbfd50000)
126#define PCIMT_EXMSR CKSEG1ADDR(0xbfd60000)
127#define PCIMT_UNUSED1 CKSEG1ADDR(0xbfd70000)
128#define PCIMT_CSWCSM CKSEG1ADDR(0xbfd80000)
129#define PCIMT_UNUSED2 CKSEG1ADDR(0xbfd90000)
130#define PCIMT_CSLED CKSEG1ADDR(0xbfda0000)
131#define PCIMT_CSMAPISA CKSEG1ADDR(0xbfdb0000)
132#define PCIMT_CSRSTBP CKSEG1ADDR(0xbfdc0000)
133#define PCIMT_CLRPOFF CKSEG1ADDR(0xbfdd0000)
134#define PCIMT_CSTIMER CKSEG1ADDR(0xbfde0000)
135#define PCIMT_PWDN CKSEG1ADDR(0xbfdf0000)
136
137/*
138 * A20R based boards
139 */
140#define A20R_PT_CLOCK_BASE CKSEG1ADDR(0xbc040000)
141#define A20R_PT_TIM0_ACK CKSEG1ADDR(0xbc050000)
142#define A20R_PT_TIM1_ACK CKSEG1ADDR(0xbc060000)
143
144#define SNI_A20R_IRQ_BASE MIPS_CPU_IRQ_BASE
145#define SNI_A20R_IRQ_TIMER (SNI_A20R_IRQ_BASE+5)
146
147#define SNI_PCIT_INT_REG CKSEG1ADDR(0xbfff000c)
148
149#define SNI_PCIT_INT_START 24
150#define SNI_PCIT_INT_END 30
151
152#define PCIT_IRQ_ETHERNET (MIPS_CPU_IRQ_BASE + 5)
153#define PCIT_IRQ_INTA (SNI_PCIT_INT_START + 0)
154#define PCIT_IRQ_INTB (SNI_PCIT_INT_START + 1)
155#define PCIT_IRQ_INTC (SNI_PCIT_INT_START + 2)
156#define PCIT_IRQ_INTD (SNI_PCIT_INT_START + 3)
157#define PCIT_IRQ_SCSI0 (SNI_PCIT_INT_START + 4)
158#define PCIT_IRQ_SCSI1 (SNI_PCIT_INT_START + 5)
159
160
161/*
162 * Interrupt 0-16 are EISA interrupts. Interrupts from 16 on are assigned
163 * to the other interrupts generated by ASIC PCI.
164 *
165 * INT2 is a wired-or of the push button interrupt, high temperature interrupt
166 * ASIC PCI interrupt.
167 */
168#define PCIMT_KEYBOARD_IRQ 1
169#define PCIMT_IRQ_INT2 24
170#define PCIMT_IRQ_INTD 25
171#define PCIMT_IRQ_INTC 26
172#define PCIMT_IRQ_INTB 27
173#define PCIMT_IRQ_INTA 28
174#define PCIMT_IRQ_EISA 29
175#define PCIMT_IRQ_SCSI 30
176
177#define PCIMT_IRQ_ETHERNET (MIPS_CPU_IRQ_BASE+6)
178
179#if 0
180#define PCIMT_IRQ_TEMPERATURE 24
181#define PCIMT_IRQ_EISA_NMI 25
182#define PCIMT_IRQ_POWER_OFF 26
183#define PCIMT_IRQ_BUTTON 27
184#endif
185
186/*
187 * Base address for the mapped 16mb EISA bus segment.
188 */
189#define PCIMT_EISA_BASE CKSEG1ADDR(0xb0000000)
190
191/* PCI EISA Interrupt acknowledge */
192#define PCIMT_INT_ACKNOWLEDGE CKSEG1ADDR(0xba000000)
193
194/*
195 * SNI ID PROM
196 *
197 * SNI_IDPROM_MEMSIZE Memsize in 16MB quantities
198 * SNI_IDPROM_BRDTYPE Board Type
199 * SNI_IDPROM_CPUTYPE CPU Type on RM400
200 */
201#ifdef CONFIG_CPU_BIG_ENDIAN
202#define __SNI_END 0
203#endif
204#ifdef CONFIG_CPU_LITTLE_ENDIAN
205#define __SNI_END 3
206#endif
207#define SNI_IDPROM_BASE CKSEG1ADDR(0x1ff00000)
208#define SNI_IDPROM_MEMSIZE (SNI_IDPROM_BASE + (0x28 ^ __SNI_END))
209#define SNI_IDPROM_BRDTYPE (SNI_IDPROM_BASE + (0x29 ^ __SNI_END))
210#define SNI_IDPROM_CPUTYPE (SNI_IDPROM_BASE + (0x30 ^ __SNI_END))
211
212#define SNI_IDPROM_SIZE 0x1000
213
214/* board specific init functions */
215extern void sni_a20r_init(void);
216extern void sni_pcit_init(void);
217extern void sni_rm200_init(void);
218extern void sni_pcimt_init(void);
219
220/* board specific irq init functions */
221extern void sni_a20r_irq_init(void);
222extern void sni_pcit_irq_init(void);
223extern void sni_pcit_cplus_irq_init(void);
224extern void sni_rm200_irq_init(void);
225extern void sni_pcimt_irq_init(void);
226
227/* timer inits */
228extern void sni_cpu_time_init(void);
229
230/* eisa init for RM200/400 */
231#ifdef CONFIG_EISA
232extern int sni_eisa_root_init(void);
233#else
234static inline int sni_eisa_root_init(void)
235{
236 return 0;
237}
238#endif
239
240/* common irq stuff */
241extern void (*sni_hwint)(void);
242extern struct irqaction sni_isa_irq;
243
244#endif /* __ASM_SNI_H */
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h
deleted file mode 100644
index facc2d7a87ca..000000000000
--- a/include/asm-mips/socket.h
+++ /dev/null
@@ -1,117 +0,0 @@
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 * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SOCKET_H
10#define _ASM_SOCKET_H
11
12#include <asm/sockios.h>
13
14/*
15 * For setsockopt(2)
16 *
17 * This defines are ABI conformant as far as Linux supports these ...
18 */
19#define SOL_SOCKET 0xffff
20
21#define SO_DEBUG 0x0001 /* Record debugging information. */
22#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
23#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
24 SIGPIPE when they die. */
25#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
26#define SO_BROADCAST 0x0020 /* Allow transmission of
27 broadcast messages. */
28#define SO_LINGER 0x0080 /* Block on close of a reliable
29 socket to transmit pending data. */
30#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
31#if 0
32To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
33#endif
34
35#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
36#define SO_STYLE SO_TYPE /* Synonym */
37#define SO_ERROR 0x1007 /* get error status and clear */
38#define SO_SNDBUF 0x1001 /* Send buffer size. */
39#define SO_RCVBUF 0x1002 /* Receive buffer. */
40#define SO_SNDLOWAT 0x1003 /* send low-water mark */
41#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
42#define SO_SNDTIMEO 0x1005 /* send timeout */
43#define SO_RCVTIMEO 0x1006 /* receive timeout */
44#define SO_ACCEPTCONN 0x1009
45
46/* linux-specific, might as well be the same as on i386 */
47#define SO_NO_CHECK 11
48#define SO_PRIORITY 12
49#define SO_BSDCOMPAT 14
50
51#define SO_PASSCRED 17
52#define SO_PEERCRED 18
53
54/* Security levels - as per NRL IPv6 - don't actually do anything */
55#define SO_SECURITY_AUTHENTICATION 22
56#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
57#define SO_SECURITY_ENCRYPTION_NETWORK 24
58
59#define SO_BINDTODEVICE 25
60
61/* Socket filtering */
62#define SO_ATTACH_FILTER 26
63#define SO_DETACH_FILTER 27
64
65#define SO_PEERNAME 28
66#define SO_TIMESTAMP 29
67#define SCM_TIMESTAMP SO_TIMESTAMP
68
69#define SO_PEERSEC 30
70#define SO_SNDBUFFORCE 31
71#define SO_RCVBUFFORCE 33
72#define SO_PASSSEC 34
73#define SO_TIMESTAMPNS 35
74#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
75
76#define SO_MARK 36
77
78#ifdef __KERNEL__
79
80/** sock_type - Socket types
81 *
82 * Please notice that for binary compat reasons MIPS has to
83 * override the enum sock_type in include/linux/net.h, so
84 * we define ARCH_HAS_SOCKET_TYPES here.
85 *
86 * @SOCK_DGRAM - datagram (conn.less) socket
87 * @SOCK_STREAM - stream (connection) socket
88 * @SOCK_RAW - raw socket
89 * @SOCK_RDM - reliably-delivered message
90 * @SOCK_SEQPACKET - sequential packet socket
91 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
92 * For writing rarp and other similar things on the user level.
93 */
94enum sock_type {
95 SOCK_DGRAM = 1,
96 SOCK_STREAM = 2,
97 SOCK_RAW = 3,
98 SOCK_RDM = 4,
99 SOCK_SEQPACKET = 5,
100 SOCK_DCCP = 6,
101 SOCK_PACKET = 10,
102};
103
104#define SOCK_MAX (SOCK_PACKET + 1)
105/* Mask which covers at least up to SOCK_MASK-1. The
106 * * remaining bits are used as flags. */
107#define SOCK_TYPE_MASK 0xf
108
109/* Flags for socket, socketpair, paccept */
110#define SOCK_CLOEXEC O_CLOEXEC
111#define SOCK_NONBLOCK O_NONBLOCK
112
113#define ARCH_HAS_SOCKET_TYPES 1
114
115#endif /* __KERNEL__ */
116
117#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-mips/sockios.h b/include/asm-mips/sockios.h
deleted file mode 100644
index ed1a5f78d22f..000000000000
--- a/include/asm-mips/sockios.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Socket-level I/O control calls.
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 (C) 1995 by Ralf Baechle
9 */
10#ifndef _ASM_SOCKIOS_H
11#define _ASM_SOCKIOS_H
12
13#include <asm/ioctl.h>
14
15/* Socket-level I/O control calls. */
16#define FIOGETOWN _IOR('f', 123, int)
17#define FIOSETOWN _IOW('f', 124, int)
18
19#define SIOCATMARK _IOR('s', 7, int)
20#define SIOCSPGRP _IOW('s', 8, pid_t)
21#define SIOCGPGRP _IOR('s', 9, pid_t)
22
23#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
24#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
25
26#endif /* _ASM_SOCKIOS_H */
diff --git a/include/asm-mips/sparsemem.h b/include/asm-mips/sparsemem.h
deleted file mode 100644
index 795ac6c23203..000000000000
--- a/include/asm-mips/sparsemem.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef _MIPS_SPARSEMEM_H
2#define _MIPS_SPARSEMEM_H
3#ifdef CONFIG_SPARSEMEM
4
5/*
6 * SECTION_SIZE_BITS 2^N: how big each section will be
7 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
8 */
9#define SECTION_SIZE_BITS 28
10#define MAX_PHYSMEM_BITS 35
11
12#endif /* CONFIG_SPARSEMEM */
13#endif /* _MIPS_SPARSEMEM_H */
14
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
deleted file mode 100644
index bb897016c491..000000000000
--- a/include/asm-mips/spinlock.h
+++ /dev/null
@@ -1,376 +0,0 @@
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 * Copyright (C) 1999, 2000, 06 Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_SPINLOCK_H
10#define _ASM_SPINLOCK_H
11
12#include <asm/barrier.h>
13#include <asm/war.h>
14
15/*
16 * Your basic SMP spinlocks, allowing only a single CPU anywhere
17 */
18
19#define __raw_spin_is_locked(x) ((x)->lock != 0)
20#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
21#define __raw_spin_unlock_wait(x) \
22 do { cpu_relax(); } while ((x)->lock)
23
24/*
25 * Simple spin lock operations. There are two variants, one clears IRQ's
26 * on the local processor, one does not.
27 *
28 * We make no fairness assumptions. They have a cost.
29 */
30
31static inline void __raw_spin_lock(raw_spinlock_t *lock)
32{
33 unsigned int tmp;
34
35 if (R10000_LLSC_WAR) {
36 __asm__ __volatile__(
37 " .set noreorder # __raw_spin_lock \n"
38 "1: ll %1, %2 \n"
39 " bnez %1, 1b \n"
40 " li %1, 1 \n"
41 " sc %1, %0 \n"
42 " beqzl %1, 1b \n"
43 " nop \n"
44 " .set reorder \n"
45 : "=m" (lock->lock), "=&r" (tmp)
46 : "m" (lock->lock)
47 : "memory");
48 } else {
49 __asm__ __volatile__(
50 " .set noreorder # __raw_spin_lock \n"
51 "1: ll %1, %2 \n"
52 " bnez %1, 2f \n"
53 " li %1, 1 \n"
54 " sc %1, %0 \n"
55 " beqz %1, 2f \n"
56 " nop \n"
57 " .subsection 2 \n"
58 "2: ll %1, %2 \n"
59 " bnez %1, 2b \n"
60 " li %1, 1 \n"
61 " b 1b \n"
62 " nop \n"
63 " .previous \n"
64 " .set reorder \n"
65 : "=m" (lock->lock), "=&r" (tmp)
66 : "m" (lock->lock)
67 : "memory");
68 }
69
70 smp_llsc_mb();
71}
72
73static inline void __raw_spin_unlock(raw_spinlock_t *lock)
74{
75 smp_mb();
76
77 __asm__ __volatile__(
78 " .set noreorder # __raw_spin_unlock \n"
79 " sw $0, %0 \n"
80 " .set\treorder \n"
81 : "=m" (lock->lock)
82 : "m" (lock->lock)
83 : "memory");
84}
85
86static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
87{
88 unsigned int temp, res;
89
90 if (R10000_LLSC_WAR) {
91 __asm__ __volatile__(
92 " .set noreorder # __raw_spin_trylock \n"
93 "1: ll %0, %3 \n"
94 " ori %2, %0, 1 \n"
95 " sc %2, %1 \n"
96 " beqzl %2, 1b \n"
97 " nop \n"
98 " andi %2, %0, 1 \n"
99 " .set reorder"
100 : "=&r" (temp), "=m" (lock->lock), "=&r" (res)
101 : "m" (lock->lock)
102 : "memory");
103 } else {
104 __asm__ __volatile__(
105 " .set noreorder # __raw_spin_trylock \n"
106 "1: ll %0, %3 \n"
107 " ori %2, %0, 1 \n"
108 " sc %2, %1 \n"
109 " beqz %2, 2f \n"
110 " andi %2, %0, 1 \n"
111 " .subsection 2 \n"
112 "2: b 1b \n"
113 " nop \n"
114 " .previous \n"
115 " .set reorder"
116 : "=&r" (temp), "=m" (lock->lock), "=&r" (res)
117 : "m" (lock->lock)
118 : "memory");
119 }
120
121 smp_llsc_mb();
122
123 return res == 0;
124}
125
126/*
127 * Read-write spinlocks, allowing multiple readers but only one writer.
128 *
129 * NOTE! it is quite common to have readers in interrupts but no interrupt
130 * writers. For those circumstances we can "mix" irq-safe locks - any writer
131 * needs to get a irq-safe write-lock, but readers can get non-irqsafe
132 * read-locks.
133 */
134
135/*
136 * read_can_lock - would read_trylock() succeed?
137 * @lock: the rwlock in question.
138 */
139#define __raw_read_can_lock(rw) ((rw)->lock >= 0)
140
141/*
142 * write_can_lock - would write_trylock() succeed?
143 * @lock: the rwlock in question.
144 */
145#define __raw_write_can_lock(rw) (!(rw)->lock)
146
147static inline void __raw_read_lock(raw_rwlock_t *rw)
148{
149 unsigned int tmp;
150
151 if (R10000_LLSC_WAR) {
152 __asm__ __volatile__(
153 " .set noreorder # __raw_read_lock \n"
154 "1: ll %1, %2 \n"
155 " bltz %1, 1b \n"
156 " addu %1, 1 \n"
157 " sc %1, %0 \n"
158 " beqzl %1, 1b \n"
159 " nop \n"
160 " .set reorder \n"
161 : "=m" (rw->lock), "=&r" (tmp)
162 : "m" (rw->lock)
163 : "memory");
164 } else {
165 __asm__ __volatile__(
166 " .set noreorder # __raw_read_lock \n"
167 "1: ll %1, %2 \n"
168 " bltz %1, 2f \n"
169 " addu %1, 1 \n"
170 " sc %1, %0 \n"
171 " beqz %1, 1b \n"
172 " nop \n"
173 " .subsection 2 \n"
174 "2: ll %1, %2 \n"
175 " bltz %1, 2b \n"
176 " addu %1, 1 \n"
177 " b 1b \n"
178 " nop \n"
179 " .previous \n"
180 " .set reorder \n"
181 : "=m" (rw->lock), "=&r" (tmp)
182 : "m" (rw->lock)
183 : "memory");
184 }
185
186 smp_llsc_mb();
187}
188
189/* Note the use of sub, not subu which will make the kernel die with an
190 overflow exception if we ever try to unlock an rwlock that is already
191 unlocked or is being held by a writer. */
192static inline void __raw_read_unlock(raw_rwlock_t *rw)
193{
194 unsigned int tmp;
195
196 smp_llsc_mb();
197
198 if (R10000_LLSC_WAR) {
199 __asm__ __volatile__(
200 "1: ll %1, %2 # __raw_read_unlock \n"
201 " sub %1, 1 \n"
202 " sc %1, %0 \n"
203 " beqzl %1, 1b \n"
204 : "=m" (rw->lock), "=&r" (tmp)
205 : "m" (rw->lock)
206 : "memory");
207 } else {
208 __asm__ __volatile__(
209 " .set noreorder # __raw_read_unlock \n"
210 "1: ll %1, %2 \n"
211 " sub %1, 1 \n"
212 " sc %1, %0 \n"
213 " beqz %1, 2f \n"
214 " nop \n"
215 " .subsection 2 \n"
216 "2: b 1b \n"
217 " nop \n"
218 " .previous \n"
219 " .set reorder \n"
220 : "=m" (rw->lock), "=&r" (tmp)
221 : "m" (rw->lock)
222 : "memory");
223 }
224}
225
226static inline void __raw_write_lock(raw_rwlock_t *rw)
227{
228 unsigned int tmp;
229
230 if (R10000_LLSC_WAR) {
231 __asm__ __volatile__(
232 " .set noreorder # __raw_write_lock \n"
233 "1: ll %1, %2 \n"
234 " bnez %1, 1b \n"
235 " lui %1, 0x8000 \n"
236 " sc %1, %0 \n"
237 " beqzl %1, 1b \n"
238 " nop \n"
239 " .set reorder \n"
240 : "=m" (rw->lock), "=&r" (tmp)
241 : "m" (rw->lock)
242 : "memory");
243 } else {
244 __asm__ __volatile__(
245 " .set noreorder # __raw_write_lock \n"
246 "1: ll %1, %2 \n"
247 " bnez %1, 2f \n"
248 " lui %1, 0x8000 \n"
249 " sc %1, %0 \n"
250 " beqz %1, 2f \n"
251 " nop \n"
252 " .subsection 2 \n"
253 "2: ll %1, %2 \n"
254 " bnez %1, 2b \n"
255 " lui %1, 0x8000 \n"
256 " b 1b \n"
257 " nop \n"
258 " .previous \n"
259 " .set reorder \n"
260 : "=m" (rw->lock), "=&r" (tmp)
261 : "m" (rw->lock)
262 : "memory");
263 }
264
265 smp_llsc_mb();
266}
267
268static inline void __raw_write_unlock(raw_rwlock_t *rw)
269{
270 smp_mb();
271
272 __asm__ __volatile__(
273 " # __raw_write_unlock \n"
274 " sw $0, %0 \n"
275 : "=m" (rw->lock)
276 : "m" (rw->lock)
277 : "memory");
278}
279
280static inline int __raw_read_trylock(raw_rwlock_t *rw)
281{
282 unsigned int tmp;
283 int ret;
284
285 if (R10000_LLSC_WAR) {
286 __asm__ __volatile__(
287 " .set noreorder # __raw_read_trylock \n"
288 " li %2, 0 \n"
289 "1: ll %1, %3 \n"
290 " bltz %1, 2f \n"
291 " addu %1, 1 \n"
292 " sc %1, %0 \n"
293 " .set reorder \n"
294 " beqzl %1, 1b \n"
295 " nop \n"
296 __WEAK_LLSC_MB
297 " li %2, 1 \n"
298 "2: \n"
299 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
300 : "m" (rw->lock)
301 : "memory");
302 } else {
303 __asm__ __volatile__(
304 " .set noreorder # __raw_read_trylock \n"
305 " li %2, 0 \n"
306 "1: ll %1, %3 \n"
307 " bltz %1, 2f \n"
308 " addu %1, 1 \n"
309 " sc %1, %0 \n"
310 " beqz %1, 1b \n"
311 " nop \n"
312 " .set reorder \n"
313 __WEAK_LLSC_MB
314 " li %2, 1 \n"
315 "2: \n"
316 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
317 : "m" (rw->lock)
318 : "memory");
319 }
320
321 return ret;
322}
323
324static inline int __raw_write_trylock(raw_rwlock_t *rw)
325{
326 unsigned int tmp;
327 int ret;
328
329 if (R10000_LLSC_WAR) {
330 __asm__ __volatile__(
331 " .set noreorder # __raw_write_trylock \n"
332 " li %2, 0 \n"
333 "1: ll %1, %3 \n"
334 " bnez %1, 2f \n"
335 " lui %1, 0x8000 \n"
336 " sc %1, %0 \n"
337 " beqzl %1, 1b \n"
338 " nop \n"
339 __WEAK_LLSC_MB
340 " li %2, 1 \n"
341 " .set reorder \n"
342 "2: \n"
343 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
344 : "m" (rw->lock)
345 : "memory");
346 } else {
347 __asm__ __volatile__(
348 " .set noreorder # __raw_write_trylock \n"
349 " li %2, 0 \n"
350 "1: ll %1, %3 \n"
351 " bnez %1, 2f \n"
352 " lui %1, 0x8000 \n"
353 " sc %1, %0 \n"
354 " beqz %1, 3f \n"
355 " li %2, 1 \n"
356 "2: \n"
357 __WEAK_LLSC_MB
358 " .subsection 2 \n"
359 "3: b 1b \n"
360 " li %2, 0 \n"
361 " .previous \n"
362 " .set reorder \n"
363 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
364 : "m" (rw->lock)
365 : "memory");
366 }
367
368 return ret;
369}
370
371
372#define _raw_spin_relax(lock) cpu_relax()
373#define _raw_read_relax(lock) cpu_relax()
374#define _raw_write_relax(lock) cpu_relax()
375
376#endif /* _ASM_SPINLOCK_H */
diff --git a/include/asm-mips/spinlock_types.h b/include/asm-mips/spinlock_types.h
deleted file mode 100644
index ce26c5048b15..000000000000
--- a/include/asm-mips/spinlock_types.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _ASM_SPINLOCK_TYPES_H
2#define _ASM_SPINLOCK_TYPES_H
3
4#ifndef __LINUX_SPINLOCK_TYPES_H
5# error "please don't include this file directly"
6#endif
7
8typedef struct {
9 volatile unsigned int lock;
10} raw_spinlock_t;
11
12#define __RAW_SPIN_LOCK_UNLOCKED { 0 }
13
14typedef struct {
15 volatile unsigned int lock;
16} raw_rwlock_t;
17
18#define __RAW_RW_LOCK_UNLOCKED { 0 }
19
20#endif
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
deleted file mode 100644
index 051e1af0bb95..000000000000
--- a/include/asm-mips/stackframe.h
+++ /dev/null
@@ -1,524 +0,0 @@
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 * Copyright (C) 1994, 95, 96, 99, 2001 Ralf Baechle
7 * Copyright (C) 1994, 1995, 1996 Paul M. Antoine.
8 * Copyright (C) 1999 Silicon Graphics, Inc.
9 * Copyright (C) 2007 Maciej W. Rozycki
10 */
11#ifndef _ASM_STACKFRAME_H
12#define _ASM_STACKFRAME_H
13
14#include <linux/threads.h>
15
16#include <asm/asm.h>
17#include <asm/asmmacro.h>
18#include <asm/mipsregs.h>
19#include <asm/asm-offsets.h>
20
21/*
22 * For SMTC kernel, global IE should be left set, and interrupts
23 * controlled exclusively via IXMT.
24 */
25#ifdef CONFIG_MIPS_MT_SMTC
26#define STATMASK 0x1e
27#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
28#define STATMASK 0x3f
29#else
30#define STATMASK 0x1f
31#endif
32
33#ifdef CONFIG_MIPS_MT_SMTC
34#include <asm/mipsmtregs.h>
35#endif /* CONFIG_MIPS_MT_SMTC */
36
37 .macro SAVE_AT
38 .set push
39 .set noat
40 LONG_S $1, PT_R1(sp)
41 .set pop
42 .endm
43
44 .macro SAVE_TEMP
45#ifdef CONFIG_CPU_HAS_SMARTMIPS
46 mflhxu v1
47 LONG_S v1, PT_LO(sp)
48 mflhxu v1
49 LONG_S v1, PT_HI(sp)
50 mflhxu v1
51 LONG_S v1, PT_ACX(sp)
52#else
53 mfhi v1
54 LONG_S v1, PT_HI(sp)
55 mflo v1
56 LONG_S v1, PT_LO(sp)
57#endif
58#ifdef CONFIG_32BIT
59 LONG_S $8, PT_R8(sp)
60 LONG_S $9, PT_R9(sp)
61#endif
62 LONG_S $10, PT_R10(sp)
63 LONG_S $11, PT_R11(sp)
64 LONG_S $12, PT_R12(sp)
65 LONG_S $13, PT_R13(sp)
66 LONG_S $14, PT_R14(sp)
67 LONG_S $15, PT_R15(sp)
68 LONG_S $24, PT_R24(sp)
69 .endm
70
71 .macro SAVE_STATIC
72 LONG_S $16, PT_R16(sp)
73 LONG_S $17, PT_R17(sp)
74 LONG_S $18, PT_R18(sp)
75 LONG_S $19, PT_R19(sp)
76 LONG_S $20, PT_R20(sp)
77 LONG_S $21, PT_R21(sp)
78 LONG_S $22, PT_R22(sp)
79 LONG_S $23, PT_R23(sp)
80 LONG_S $30, PT_R30(sp)
81 .endm
82
83#ifdef CONFIG_SMP
84#ifdef CONFIG_MIPS_MT_SMTC
85#define PTEBASE_SHIFT 19 /* TCBIND */
86#else
87#define PTEBASE_SHIFT 23 /* CONTEXT */
88#endif
89 .macro get_saved_sp /* SMP variation */
90#ifdef CONFIG_MIPS_MT_SMTC
91 mfc0 k0, CP0_TCBIND
92#else
93 MFC0 k0, CP0_CONTEXT
94#endif
95#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
96 lui k1, %hi(kernelsp)
97#else
98 lui k1, %highest(kernelsp)
99 daddiu k1, %higher(kernelsp)
100 dsll k1, 16
101 daddiu k1, %hi(kernelsp)
102 dsll k1, 16
103#endif
104 LONG_SRL k0, PTEBASE_SHIFT
105 LONG_ADDU k1, k0
106 LONG_L k1, %lo(kernelsp)(k1)
107 .endm
108
109 .macro set_saved_sp stackp temp temp2
110#ifdef CONFIG_MIPS_MT_SMTC
111 mfc0 \temp, CP0_TCBIND
112#else
113 MFC0 \temp, CP0_CONTEXT
114#endif
115 LONG_SRL \temp, PTEBASE_SHIFT
116 LONG_S \stackp, kernelsp(\temp)
117 .endm
118#else
119 .macro get_saved_sp /* Uniprocessor variation */
120#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
121 lui k1, %hi(kernelsp)
122#else
123 lui k1, %highest(kernelsp)
124 daddiu k1, %higher(kernelsp)
125 dsll k1, k1, 16
126 daddiu k1, %hi(kernelsp)
127 dsll k1, k1, 16
128#endif
129 LONG_L k1, %lo(kernelsp)(k1)
130 .endm
131
132 .macro set_saved_sp stackp temp temp2
133 LONG_S \stackp, kernelsp
134 .endm
135#endif
136
137 .macro SAVE_SOME
138 .set push
139 .set noat
140 .set reorder
141 mfc0 k0, CP0_STATUS
142 sll k0, 3 /* extract cu0 bit */
143 .set noreorder
144 bltz k0, 8f
145 move k1, sp
146 .set reorder
147 /* Called from user mode, new stack. */
148 get_saved_sp
149#ifndef CONFIG_CPU_DADDI_WORKAROUNDS
1508: move k0, sp
151 PTR_SUBU sp, k1, PT_SIZE
152#else
153 .set at=k0
1548: PTR_SUBU k1, PT_SIZE
155 .set noat
156 move k0, sp
157 move sp, k1
158#endif
159 LONG_S k0, PT_R29(sp)
160 LONG_S $3, PT_R3(sp)
161 /*
162 * You might think that you don't need to save $0,
163 * but the FPU emulator and gdb remote debug stub
164 * need it to operate correctly
165 */
166 LONG_S $0, PT_R0(sp)
167 mfc0 v1, CP0_STATUS
168 LONG_S $2, PT_R2(sp)
169 LONG_S v1, PT_STATUS(sp)
170#ifdef CONFIG_MIPS_MT_SMTC
171 /*
172 * Ideally, these instructions would be shuffled in
173 * to cover the pipeline delay.
174 */
175 .set mips32
176 mfc0 v1, CP0_TCSTATUS
177 .set mips0
178 LONG_S v1, PT_TCSTATUS(sp)
179#endif /* CONFIG_MIPS_MT_SMTC */
180 LONG_S $4, PT_R4(sp)
181 mfc0 v1, CP0_CAUSE
182 LONG_S $5, PT_R5(sp)
183 LONG_S v1, PT_CAUSE(sp)
184 LONG_S $6, PT_R6(sp)
185 MFC0 v1, CP0_EPC
186 LONG_S $7, PT_R7(sp)
187#ifdef CONFIG_64BIT
188 LONG_S $8, PT_R8(sp)
189 LONG_S $9, PT_R9(sp)
190#endif
191 LONG_S v1, PT_EPC(sp)
192 LONG_S $25, PT_R25(sp)
193 LONG_S $28, PT_R28(sp)
194 LONG_S $31, PT_R31(sp)
195 ori $28, sp, _THREAD_MASK
196 xori $28, _THREAD_MASK
197 .set pop
198 .endm
199
200 .macro SAVE_ALL
201 SAVE_SOME
202 SAVE_AT
203 SAVE_TEMP
204 SAVE_STATIC
205 .endm
206
207 .macro RESTORE_AT
208 .set push
209 .set noat
210 LONG_L $1, PT_R1(sp)
211 .set pop
212 .endm
213
214 .macro RESTORE_TEMP
215#ifdef CONFIG_CPU_HAS_SMARTMIPS
216 LONG_L $24, PT_ACX(sp)
217 mtlhx $24
218 LONG_L $24, PT_HI(sp)
219 mtlhx $24
220 LONG_L $24, PT_LO(sp)
221 mtlhx $24
222#else
223 LONG_L $24, PT_LO(sp)
224 mtlo $24
225 LONG_L $24, PT_HI(sp)
226 mthi $24
227#endif
228#ifdef CONFIG_32BIT
229 LONG_L $8, PT_R8(sp)
230 LONG_L $9, PT_R9(sp)
231#endif
232 LONG_L $10, PT_R10(sp)
233 LONG_L $11, PT_R11(sp)
234 LONG_L $12, PT_R12(sp)
235 LONG_L $13, PT_R13(sp)
236 LONG_L $14, PT_R14(sp)
237 LONG_L $15, PT_R15(sp)
238 LONG_L $24, PT_R24(sp)
239 .endm
240
241 .macro RESTORE_STATIC
242 LONG_L $16, PT_R16(sp)
243 LONG_L $17, PT_R17(sp)
244 LONG_L $18, PT_R18(sp)
245 LONG_L $19, PT_R19(sp)
246 LONG_L $20, PT_R20(sp)
247 LONG_L $21, PT_R21(sp)
248 LONG_L $22, PT_R22(sp)
249 LONG_L $23, PT_R23(sp)
250 LONG_L $30, PT_R30(sp)
251 .endm
252
253#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
254
255 .macro RESTORE_SOME
256 .set push
257 .set reorder
258 .set noat
259 mfc0 a0, CP0_STATUS
260 li v1, 0xff00
261 ori a0, STATMASK
262 xori a0, STATMASK
263 mtc0 a0, CP0_STATUS
264 and a0, v1
265 LONG_L v0, PT_STATUS(sp)
266 nor v1, $0, v1
267 and v0, v1
268 or v0, a0
269 mtc0 v0, CP0_STATUS
270 LONG_L $31, PT_R31(sp)
271 LONG_L $28, PT_R28(sp)
272 LONG_L $25, PT_R25(sp)
273 LONG_L $7, PT_R7(sp)
274 LONG_L $6, PT_R6(sp)
275 LONG_L $5, PT_R5(sp)
276 LONG_L $4, PT_R4(sp)
277 LONG_L $3, PT_R3(sp)
278 LONG_L $2, PT_R2(sp)
279 .set pop
280 .endm
281
282 .macro RESTORE_SP_AND_RET
283 .set push
284 .set noreorder
285 LONG_L k0, PT_EPC(sp)
286 LONG_L sp, PT_R29(sp)
287 jr k0
288 rfe
289 .set pop
290 .endm
291
292#else
293 .macro RESTORE_SOME
294 .set push
295 .set reorder
296 .set noat
297#ifdef CONFIG_MIPS_MT_SMTC
298 .set mips32r2
299 /*
300 * This may not really be necessary if ints are already
301 * inhibited here.
302 */
303 mfc0 v0, CP0_TCSTATUS
304 ori v0, TCSTATUS_IXMT
305 mtc0 v0, CP0_TCSTATUS
306 _ehb
307 DMT 5 # dmt a1
308 jal mips_ihb
309#endif /* CONFIG_MIPS_MT_SMTC */
310 mfc0 a0, CP0_STATUS
311 ori a0, STATMASK
312 xori a0, STATMASK
313 mtc0 a0, CP0_STATUS
314 li v1, 0xff00
315 and a0, v1
316 LONG_L v0, PT_STATUS(sp)
317 nor v1, $0, v1
318 and v0, v1
319 or v0, a0
320 mtc0 v0, CP0_STATUS
321#ifdef CONFIG_MIPS_MT_SMTC
322/*
323 * Only after EXL/ERL have been restored to status can we
324 * restore TCStatus.IXMT.
325 */
326 LONG_L v1, PT_TCSTATUS(sp)
327 _ehb
328 mfc0 v0, CP0_TCSTATUS
329 andi v1, TCSTATUS_IXMT
330 /* We know that TCStatua.IXMT should be set from above */
331 xori v0, v0, TCSTATUS_IXMT
332 or v0, v0, v1
333 mtc0 v0, CP0_TCSTATUS
334 _ehb
335 andi a1, a1, VPECONTROL_TE
336 beqz a1, 1f
337 emt
3381:
339 .set mips0
340#endif /* CONFIG_MIPS_MT_SMTC */
341 LONG_L v1, PT_EPC(sp)
342 MTC0 v1, CP0_EPC
343 LONG_L $31, PT_R31(sp)
344 LONG_L $28, PT_R28(sp)
345 LONG_L $25, PT_R25(sp)
346#ifdef CONFIG_64BIT
347 LONG_L $8, PT_R8(sp)
348 LONG_L $9, PT_R9(sp)
349#endif
350 LONG_L $7, PT_R7(sp)
351 LONG_L $6, PT_R6(sp)
352 LONG_L $5, PT_R5(sp)
353 LONG_L $4, PT_R4(sp)
354 LONG_L $3, PT_R3(sp)
355 LONG_L $2, PT_R2(sp)
356 .set pop
357 .endm
358
359 .macro RESTORE_SP_AND_RET
360 LONG_L sp, PT_R29(sp)
361 .set mips3
362 eret
363 .set mips0
364 .endm
365
366#endif
367
368 .macro RESTORE_SP
369 LONG_L sp, PT_R29(sp)
370 .endm
371
372 .macro RESTORE_ALL
373 RESTORE_TEMP
374 RESTORE_STATIC
375 RESTORE_AT
376 RESTORE_SOME
377 RESTORE_SP
378 .endm
379
380 .macro RESTORE_ALL_AND_RET
381 RESTORE_TEMP
382 RESTORE_STATIC
383 RESTORE_AT
384 RESTORE_SOME
385 RESTORE_SP_AND_RET
386 .endm
387
388/*
389 * Move to kernel mode and disable interrupts.
390 * Set cp0 enable bit as sign that we're running on the kernel stack
391 */
392 .macro CLI
393#if !defined(CONFIG_MIPS_MT_SMTC)
394 mfc0 t0, CP0_STATUS
395 li t1, ST0_CU0 | STATMASK
396 or t0, t1
397 xori t0, STATMASK
398 mtc0 t0, CP0_STATUS
399#else /* CONFIG_MIPS_MT_SMTC */
400 /*
401 * For SMTC, we need to set privilege
402 * and disable interrupts only for the
403 * current TC, using the TCStatus register.
404 */
405 mfc0 t0, CP0_TCSTATUS
406 /* Fortunately CU 0 is in the same place in both registers */
407 /* Set TCU0, TMX, TKSU (for later inversion) and IXMT */
408 li t1, ST0_CU0 | 0x08001c00
409 or t0, t1
410 /* Clear TKSU, leave IXMT */
411 xori t0, 0x00001800
412 mtc0 t0, CP0_TCSTATUS
413 _ehb
414 /* We need to leave the global IE bit set, but clear EXL...*/
415 mfc0 t0, CP0_STATUS
416 ori t0, ST0_EXL | ST0_ERL
417 xori t0, ST0_EXL | ST0_ERL
418 mtc0 t0, CP0_STATUS
419#endif /* CONFIG_MIPS_MT_SMTC */
420 irq_disable_hazard
421 .endm
422
423/*
424 * Move to kernel mode and enable interrupts.
425 * Set cp0 enable bit as sign that we're running on the kernel stack
426 */
427 .macro STI
428#if !defined(CONFIG_MIPS_MT_SMTC)
429 mfc0 t0, CP0_STATUS
430 li t1, ST0_CU0 | STATMASK
431 or t0, t1
432 xori t0, STATMASK & ~1
433 mtc0 t0, CP0_STATUS
434#else /* CONFIG_MIPS_MT_SMTC */
435 /*
436 * For SMTC, we need to set privilege
437 * and enable interrupts only for the
438 * current TC, using the TCStatus register.
439 */
440 _ehb
441 mfc0 t0, CP0_TCSTATUS
442 /* Fortunately CU 0 is in the same place in both registers */
443 /* Set TCU0, TKSU (for later inversion) and IXMT */
444 li t1, ST0_CU0 | 0x08001c00
445 or t0, t1
446 /* Clear TKSU *and* IXMT */
447 xori t0, 0x00001c00
448 mtc0 t0, CP0_TCSTATUS
449 _ehb
450 /* We need to leave the global IE bit set, but clear EXL...*/
451 mfc0 t0, CP0_STATUS
452 ori t0, ST0_EXL
453 xori t0, ST0_EXL
454 mtc0 t0, CP0_STATUS
455 /* irq_enable_hazard below should expand to EHB for 24K/34K cpus */
456#endif /* CONFIG_MIPS_MT_SMTC */
457 irq_enable_hazard
458 .endm
459
460/*
461 * Just move to kernel mode and leave interrupts as they are. Note
462 * for the R3000 this means copying the previous enable from IEp.
463 * Set cp0 enable bit as sign that we're running on the kernel stack
464 */
465 .macro KMODE
466#ifdef CONFIG_MIPS_MT_SMTC
467 /*
468 * This gets baroque in SMTC. We want to
469 * protect the non-atomic clearing of EXL
470 * with DMT/EMT, but we don't want to take
471 * an interrupt while DMT is still in effect.
472 */
473
474 /* KMODE gets invoked from both reorder and noreorder code */
475 .set push
476 .set mips32r2
477 .set noreorder
478 mfc0 v0, CP0_TCSTATUS
479 andi v1, v0, TCSTATUS_IXMT
480 ori v0, TCSTATUS_IXMT
481 mtc0 v0, CP0_TCSTATUS
482 _ehb
483 DMT 2 # dmt v0
484 /*
485 * We don't know a priori if ra is "live"
486 */
487 move t0, ra
488 jal mips_ihb
489 nop /* delay slot */
490 move ra, t0
491#endif /* CONFIG_MIPS_MT_SMTC */
492 mfc0 t0, CP0_STATUS
493 li t1, ST0_CU0 | (STATMASK & ~1)
494#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
495 andi t2, t0, ST0_IEP
496 srl t2, 2
497 or t0, t2
498#endif
499 or t0, t1
500 xori t0, STATMASK & ~1
501 mtc0 t0, CP0_STATUS
502#ifdef CONFIG_MIPS_MT_SMTC
503 _ehb
504 andi v0, v0, VPECONTROL_TE
505 beqz v0, 2f
506 nop /* delay slot */
507 emt
5082:
509 mfc0 v0, CP0_TCSTATUS
510 /* Clear IXMT, then OR in previous value */
511 ori v0, TCSTATUS_IXMT
512 xori v0, TCSTATUS_IXMT
513 or v0, v1, v0
514 mtc0 v0, CP0_TCSTATUS
515 /*
516 * irq_disable_hazard below should expand to EHB
517 * on 24K/34K CPUS
518 */
519 .set pop
520#endif /* CONFIG_MIPS_MT_SMTC */
521 irq_disable_hazard
522 .endm
523
524#endif /* _ASM_STACKFRAME_H */
diff --git a/include/asm-mips/stacktrace.h b/include/asm-mips/stacktrace.h
deleted file mode 100644
index 0bf82818aa53..000000000000
--- a/include/asm-mips/stacktrace.h
+++ /dev/null
@@ -1,48 +0,0 @@
1#ifndef _ASM_STACKTRACE_H
2#define _ASM_STACKTRACE_H
3
4#include <asm/ptrace.h>
5
6#ifdef CONFIG_KALLSYMS
7extern int raw_show_trace;
8extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
9 unsigned long pc, unsigned long *ra);
10#else
11#define raw_show_trace 1
12static inline unsigned long unwind_stack(struct task_struct *task,
13 unsigned long *sp, unsigned long pc, unsigned long *ra)
14{
15 return 0;
16}
17#endif
18
19static __always_inline void prepare_frametrace(struct pt_regs *regs)
20{
21#ifndef CONFIG_KALLSYMS
22 /*
23 * Remove any garbage that may be in regs (specially func
24 * addresses) to avoid show_raw_backtrace() to report them
25 */
26 memset(regs, 0, sizeof(*regs));
27#endif
28 __asm__ __volatile__(
29 ".set push\n\t"
30 ".set noat\n\t"
31#ifdef CONFIG_64BIT
32 "1: dla $1, 1b\n\t"
33 "sd $1, %0\n\t"
34 "sd $29, %1\n\t"
35 "sd $31, %2\n\t"
36#else
37 "1: la $1, 1b\n\t"
38 "sw $1, %0\n\t"
39 "sw $29, %1\n\t"
40 "sw $31, %2\n\t"
41#endif
42 ".set pop\n\t"
43 : "=m" (regs->cp0_epc),
44 "=m" (regs->regs[29]), "=m" (regs->regs[31])
45 : : "memory");
46}
47
48#endif /* _ASM_STACKTRACE_H */
diff --git a/include/asm-mips/stat.h b/include/asm-mips/stat.h
deleted file mode 100644
index 6e00f751ab6d..000000000000
--- a/include/asm-mips/stat.h
+++ /dev/null
@@ -1,132 +0,0 @@
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 * Copyright (C) 1995, 1999, 2000 Ralf Baechle
7 * Copyright (C) 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_STAT_H
10#define _ASM_STAT_H
11
12#include <linux/types.h>
13
14#include <asm/sgidefs.h>
15
16#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
17
18struct stat {
19 unsigned st_dev;
20 long st_pad1[3]; /* Reserved for network id */
21 ino_t st_ino;
22 mode_t st_mode;
23 nlink_t st_nlink;
24 uid_t st_uid;
25 gid_t st_gid;
26 unsigned st_rdev;
27 long st_pad2[2];
28 off_t st_size;
29 long st_pad3;
30 /*
31 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
32 * but we don't have it under Linux.
33 */
34 time_t st_atime;
35 long st_atime_nsec;
36 time_t st_mtime;
37 long st_mtime_nsec;
38 time_t st_ctime;
39 long st_ctime_nsec;
40 long st_blksize;
41 long st_blocks;
42 long st_pad4[14];
43};
44
45/*
46 * This matches struct stat64 in glibc2.1, hence the absolutely insane
47 * amounts of padding around dev_t's. The memory layout is the same as of
48 * struct stat of the 64-bit kernel.
49 */
50
51struct stat64 {
52 unsigned long st_dev;
53 unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
54
55 unsigned long long st_ino;
56
57 mode_t st_mode;
58 nlink_t st_nlink;
59
60 uid_t st_uid;
61 gid_t st_gid;
62
63 unsigned long st_rdev;
64 unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
65
66 long long st_size;
67
68 /*
69 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
70 * but we don't have it under Linux.
71 */
72 time_t st_atime;
73 unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
74
75 time_t st_mtime;
76 unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
77
78 time_t st_ctime;
79 unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
80
81 unsigned long st_blksize;
82 unsigned long st_pad2;
83
84 long long st_blocks;
85};
86
87#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
88
89#if _MIPS_SIM == _MIPS_SIM_ABI64
90
91/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
92struct stat {
93 unsigned int st_dev;
94 unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
95
96 unsigned long st_ino;
97
98 mode_t st_mode;
99 nlink_t st_nlink;
100
101 uid_t st_uid;
102 gid_t st_gid;
103
104 unsigned int st_rdev;
105 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
106
107 off_t st_size;
108
109 /*
110 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
111 * but we don't have it under Linux.
112 */
113 unsigned int st_atime;
114 unsigned int st_atime_nsec;
115
116 unsigned int st_mtime;
117 unsigned int st_mtime_nsec;
118
119 unsigned int st_ctime;
120 unsigned int st_ctime_nsec;
121
122 unsigned int st_blksize;
123 unsigned int st_pad2;
124
125 unsigned long st_blocks;
126};
127
128#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
129
130#define STAT_HAVE_NSEC 1
131
132#endif /* _ASM_STAT_H */
diff --git a/include/asm-mips/statfs.h b/include/asm-mips/statfs.h
deleted file mode 100644
index c3ddf973c1c0..000000000000
--- a/include/asm-mips/statfs.h
+++ /dev/null
@@ -1,96 +0,0 @@
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 * Copyright (C) 1995, 1999 by Ralf Baechle
7 */
8#ifndef _ASM_STATFS_H
9#define _ASM_STATFS_H
10
11#include <linux/posix_types.h>
12#include <asm/sgidefs.h>
13
14#ifndef __KERNEL_STRICT_NAMES
15
16#include <linux/types.h>
17
18typedef __kernel_fsid_t fsid_t;
19
20#endif
21
22struct statfs {
23 long f_type;
24#define f_fstyp f_type
25 long f_bsize;
26 long f_frsize; /* Fragment size - unsupported */
27 long f_blocks;
28 long f_bfree;
29 long f_files;
30 long f_ffree;
31 long f_bavail;
32
33 /* Linux specials */
34 __kernel_fsid_t f_fsid;
35 long f_namelen;
36 long f_spare[6];
37};
38
39#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
40
41/*
42 * Unlike the traditional version the LFAPI version has none of the ABI junk
43 */
44struct statfs64 {
45 __u32 f_type;
46 __u32 f_bsize;
47 __u32 f_frsize; /* Fragment size - unsupported */
48 __u32 __pad;
49 __u64 f_blocks;
50 __u64 f_bfree;
51 __u64 f_files;
52 __u64 f_ffree;
53 __u64 f_bavail;
54 __kernel_fsid_t f_fsid;
55 __u32 f_namelen;
56 __u32 f_spare[6];
57};
58
59#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
60
61#if _MIPS_SIM == _MIPS_SIM_ABI64
62
63struct statfs64 { /* Same as struct statfs */
64 long f_type;
65 long f_bsize;
66 long f_frsize; /* Fragment size - unsupported */
67 long f_blocks;
68 long f_bfree;
69 long f_files;
70 long f_ffree;
71 long f_bavail;
72
73 /* Linux specials */
74 __kernel_fsid_t f_fsid;
75 long f_namelen;
76 long f_spare[6];
77};
78
79struct compat_statfs64 {
80 __u32 f_type;
81 __u32 f_bsize;
82 __u32 f_frsize; /* Fragment size - unsupported */
83 __u32 __pad;
84 __u64 f_blocks;
85 __u64 f_bfree;
86 __u64 f_files;
87 __u64 f_ffree;
88 __u64 f_bavail;
89 __kernel_fsid_t f_fsid;
90 __u32 f_namelen;
91 __u32 f_spare[6];
92};
93
94#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
95
96#endif /* _ASM_STATFS_H */
diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h
deleted file mode 100644
index 436e3ad352d9..000000000000
--- a/include/asm-mips/string.h
+++ /dev/null
@@ -1,143 +0,0 @@
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 * Copyright (c) 1994, 95, 96, 97, 98, 2000, 01 Ralf Baechle
7 * Copyright (c) 2000 by Silicon Graphics, Inc.
8 * Copyright (c) 2001 MIPS Technologies, Inc.
9 */
10#ifndef _ASM_STRING_H
11#define _ASM_STRING_H
12
13
14/*
15 * Most of the inline functions are rather naive implementations so I just
16 * didn't bother updating them for 64-bit ...
17 */
18#ifdef CONFIG_32BIT
19
20#ifndef IN_STRING_C
21
22#define __HAVE_ARCH_STRCPY
23static __inline__ char *strcpy(char *__dest, __const__ char *__src)
24{
25 char *__xdest = __dest;
26
27 __asm__ __volatile__(
28 ".set\tnoreorder\n\t"
29 ".set\tnoat\n"
30 "1:\tlbu\t$1,(%1)\n\t"
31 "addiu\t%1,1\n\t"
32 "sb\t$1,(%0)\n\t"
33 "bnez\t$1,1b\n\t"
34 "addiu\t%0,1\n\t"
35 ".set\tat\n\t"
36 ".set\treorder"
37 : "=r" (__dest), "=r" (__src)
38 : "0" (__dest), "1" (__src)
39 : "memory");
40
41 return __xdest;
42}
43
44#define __HAVE_ARCH_STRNCPY
45static __inline__ char *strncpy(char *__dest, __const__ char *__src, size_t __n)
46{
47 char *__xdest = __dest;
48
49 if (__n == 0)
50 return __xdest;
51
52 __asm__ __volatile__(
53 ".set\tnoreorder\n\t"
54 ".set\tnoat\n"
55 "1:\tlbu\t$1,(%1)\n\t"
56 "subu\t%2,1\n\t"
57 "sb\t$1,(%0)\n\t"
58 "beqz\t$1,2f\n\t"
59 "addiu\t%0,1\n\t"
60 "bnez\t%2,1b\n\t"
61 "addiu\t%1,1\n"
62 "2:\n\t"
63 ".set\tat\n\t"
64 ".set\treorder"
65 : "=r" (__dest), "=r" (__src), "=r" (__n)
66 : "0" (__dest), "1" (__src), "2" (__n)
67 : "memory");
68
69 return __xdest;
70}
71
72#define __HAVE_ARCH_STRCMP
73static __inline__ int strcmp(__const__ char *__cs, __const__ char *__ct)
74{
75 int __res;
76
77 __asm__ __volatile__(
78 ".set\tnoreorder\n\t"
79 ".set\tnoat\n\t"
80 "lbu\t%2,(%0)\n"
81 "1:\tlbu\t$1,(%1)\n\t"
82 "addiu\t%0,1\n\t"
83 "bne\t$1,%2,2f\n\t"
84 "addiu\t%1,1\n\t"
85 "bnez\t%2,1b\n\t"
86 "lbu\t%2,(%0)\n\t"
87#if defined(CONFIG_CPU_R3000)
88 "nop\n\t"
89#endif
90 "move\t%2,$1\n"
91 "2:\tsubu\t%2,$1\n"
92 "3:\t.set\tat\n\t"
93 ".set\treorder"
94 : "=r" (__cs), "=r" (__ct), "=r" (__res)
95 : "0" (__cs), "1" (__ct));
96
97 return __res;
98}
99
100#endif /* !defined(IN_STRING_C) */
101
102#define __HAVE_ARCH_STRNCMP
103static __inline__ int
104strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count)
105{
106 int __res;
107
108 __asm__ __volatile__(
109 ".set\tnoreorder\n\t"
110 ".set\tnoat\n"
111 "1:\tlbu\t%3,(%0)\n\t"
112 "beqz\t%2,2f\n\t"
113 "lbu\t$1,(%1)\n\t"
114 "subu\t%2,1\n\t"
115 "bne\t$1,%3,3f\n\t"
116 "addiu\t%0,1\n\t"
117 "bnez\t%3,1b\n\t"
118 "addiu\t%1,1\n"
119 "2:\n\t"
120#if defined(CONFIG_CPU_R3000)
121 "nop\n\t"
122#endif
123 "move\t%3,$1\n"
124 "3:\tsubu\t%3,$1\n\t"
125 ".set\tat\n\t"
126 ".set\treorder"
127 : "=r" (__cs), "=r" (__ct), "=r" (__count), "=r" (__res)
128 : "0" (__cs), "1" (__ct), "2" (__count));
129
130 return __res;
131}
132#endif /* CONFIG_32BIT */
133
134#define __HAVE_ARCH_MEMSET
135extern void *memset(void *__s, int __c, size_t __count);
136
137#define __HAVE_ARCH_MEMCPY
138extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
139
140#define __HAVE_ARCH_MEMMOVE
141extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
142
143#endif /* _ASM_STRING_H */
diff --git a/include/asm-mips/suspend.h b/include/asm-mips/suspend.h
deleted file mode 100644
index 2562f8f9be0e..000000000000
--- a/include/asm-mips/suspend.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_SUSPEND_H
2#define __ASM_SUSPEND_H
3
4/* Somewhen... Maybe :-) */
5
6#endif /* __ASM_SUSPEND_H */
diff --git a/include/asm-mips/sysmips.h b/include/asm-mips/sysmips.h
deleted file mode 100644
index 4f47b7d6a5f7..000000000000
--- a/include/asm-mips/sysmips.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Definitions for the MIPS sysmips(2) call
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 (C) 1995 by Ralf Baechle
9 */
10#ifndef _ASM_SYSMIPS_H
11#define _ASM_SYSMIPS_H
12
13/*
14 * Commands for the sysmips(2) call
15 *
16 * sysmips(2) is deprecated - though some existing software uses it.
17 * We only support the following commands.
18 */
19#define SETNAME 1 /* set hostname */
20#define FLUSH_CACHE 3 /* writeback and invalidate caches */
21#define MIPS_FIXADE 7 /* control address error fixing */
22#define MIPS_RDNVRAM 10 /* read NVRAM */
23#define MIPS_ATOMIC_SET 2001 /* atomically set variable */
24
25#endif /* _ASM_SYSMIPS_H */
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
deleted file mode 100644
index a944eda4faf5..000000000000
--- a/include/asm-mips/system.h
+++ /dev/null
@@ -1,220 +0,0 @@
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 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle
7 * Copyright (C) 1996 by Paul M. Antoine
8 * Copyright (C) 1999 Silicon Graphics
9 * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2000 MIPS Technologies, Inc.
11 */
12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H
14
15#include <linux/types.h>
16#include <linux/irqflags.h>
17
18#include <asm/addrspace.h>
19#include <asm/barrier.h>
20#include <asm/cmpxchg.h>
21#include <asm/cpu-features.h>
22#include <asm/dsp.h>
23#include <asm/war.h>
24
25
26/*
27 * switch_to(n) should switch tasks to task nr n, first
28 * checking that n isn't the current task, in which case it does nothing.
29 */
30extern asmlinkage void *resume(void *last, void *next, void *next_ti);
31
32struct task_struct;
33
34#ifdef CONFIG_MIPS_MT_FPAFF
35
36/*
37 * Handle the scheduler resume end of FPU affinity management. We do this
38 * inline to try to keep the overhead down. If we have been forced to run on
39 * a "CPU" with an FPU because of a previous high level of FP computation,
40 * but did not actually use the FPU during the most recent time-slice (CU1
41 * isn't set), we undo the restriction on cpus_allowed.
42 *
43 * We're not calling set_cpus_allowed() here, because we have no need to
44 * force prompt migration - we're already switching the current CPU to a
45 * different thread.
46 */
47
48#define __mips_mt_fpaff_switch_to(prev) \
49do { \
50 struct thread_info *__prev_ti = task_thread_info(prev); \
51 \
52 if (cpu_has_fpu && \
53 test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \
54 (!(KSTK_STATUS(prev) & ST0_CU1))) { \
55 clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \
56 prev->cpus_allowed = prev->thread.user_cpus_allowed; \
57 } \
58 next->thread.emulated_fp = 0; \
59} while(0)
60
61#else
62#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)
63#endif
64
65#define switch_to(prev, next, last) \
66do { \
67 __mips_mt_fpaff_switch_to(prev); \
68 if (cpu_has_dsp) \
69 __save_dsp(prev); \
70 (last) = resume(prev, next, task_thread_info(next)); \
71} while (0)
72
73#define finish_arch_switch(prev) \
74do { \
75 if (cpu_has_dsp) \
76 __restore_dsp(current); \
77 if (cpu_has_userlocal) \
78 write_c0_userlocal(current_thread_info()->tp_value); \
79} while (0)
80
81static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
82{
83 __u32 retval;
84
85 if (cpu_has_llsc && R10000_LLSC_WAR) {
86 unsigned long dummy;
87
88 __asm__ __volatile__(
89 " .set mips3 \n"
90 "1: ll %0, %3 # xchg_u32 \n"
91 " .set mips0 \n"
92 " move %2, %z4 \n"
93 " .set mips3 \n"
94 " sc %2, %1 \n"
95 " beqzl %2, 1b \n"
96 " .set mips0 \n"
97 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
98 : "R" (*m), "Jr" (val)
99 : "memory");
100 } else if (cpu_has_llsc) {
101 unsigned long dummy;
102
103 __asm__ __volatile__(
104 " .set mips3 \n"
105 "1: ll %0, %3 # xchg_u32 \n"
106 " .set mips0 \n"
107 " move %2, %z4 \n"
108 " .set mips3 \n"
109 " sc %2, %1 \n"
110 " beqz %2, 2f \n"
111 " .subsection 2 \n"
112 "2: b 1b \n"
113 " .previous \n"
114 " .set mips0 \n"
115 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
116 : "R" (*m), "Jr" (val)
117 : "memory");
118 } else {
119 unsigned long flags;
120
121 raw_local_irq_save(flags);
122 retval = *m;
123 *m = val;
124 raw_local_irq_restore(flags); /* implies memory barrier */
125 }
126
127 smp_llsc_mb();
128
129 return retval;
130}
131
132#ifdef CONFIG_64BIT
133static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
134{
135 __u64 retval;
136
137 if (cpu_has_llsc && R10000_LLSC_WAR) {
138 unsigned long dummy;
139
140 __asm__ __volatile__(
141 " .set mips3 \n"
142 "1: lld %0, %3 # xchg_u64 \n"
143 " move %2, %z4 \n"
144 " scd %2, %1 \n"
145 " beqzl %2, 1b \n"
146 " .set mips0 \n"
147 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
148 : "R" (*m), "Jr" (val)
149 : "memory");
150 } else if (cpu_has_llsc) {
151 unsigned long dummy;
152
153 __asm__ __volatile__(
154 " .set mips3 \n"
155 "1: lld %0, %3 # xchg_u64 \n"
156 " move %2, %z4 \n"
157 " scd %2, %1 \n"
158 " beqz %2, 2f \n"
159 " .subsection 2 \n"
160 "2: b 1b \n"
161 " .previous \n"
162 " .set mips0 \n"
163 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
164 : "R" (*m), "Jr" (val)
165 : "memory");
166 } else {
167 unsigned long flags;
168
169 raw_local_irq_save(flags);
170 retval = *m;
171 *m = val;
172 raw_local_irq_restore(flags); /* implies memory barrier */
173 }
174
175 smp_llsc_mb();
176
177 return retval;
178}
179#else
180extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 val);
181#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
182#endif
183
184/* This function doesn't exist, so you'll get a linker error
185 if something tries to do an invalid xchg(). */
186extern void __xchg_called_with_bad_pointer(void);
187
188static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
189{
190 switch (size) {
191 case 4:
192 return __xchg_u32(ptr, x);
193 case 8:
194 return __xchg_u64(ptr, x);
195 }
196 __xchg_called_with_bad_pointer();
197 return x;
198}
199
200#define xchg(ptr, x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
201
202extern void set_handler(unsigned long offset, void *addr, unsigned long len);
203extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
204
205typedef void (*vi_handler_t)(void);
206extern void *set_vi_handler(int n, vi_handler_t addr);
207
208extern void *set_except_vector(int n, void *addr);
209extern unsigned long ebase;
210extern void per_cpu_trap_init(void);
211
212/*
213 * See include/asm-ia64/system.h; prevents deadlock on SMP
214 * systems.
215 */
216#define __ARCH_WANT_UNLOCKED_CTXSW
217
218extern unsigned long arch_align_stack(unsigned long sp);
219
220#endif /* _ASM_SYSTEM_H */
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h
deleted file mode 100644
index c83c68444e86..000000000000
--- a/include/asm-mips/termbits.h
+++ /dev/null
@@ -1,226 +0,0 @@
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 * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 * Copyright (C) 2001 MIPS Technologies, Inc.
9 */
10#ifndef _ASM_TERMBITS_H
11#define _ASM_TERMBITS_H
12
13#include <linux/posix_types.h>
14
15typedef unsigned char cc_t;
16typedef unsigned int speed_t;
17typedef unsigned int tcflag_t;
18
19/*
20 * The ABI says nothing about NCC but seems to use NCCS as
21 * replacement for it in struct termio
22 */
23#define NCCS 23
24struct termios {
25 tcflag_t c_iflag; /* input mode flags */
26 tcflag_t c_oflag; /* output mode flags */
27 tcflag_t c_cflag; /* control mode flags */
28 tcflag_t c_lflag; /* local mode flags */
29 cc_t c_line; /* line discipline */
30 cc_t c_cc[NCCS]; /* control characters */
31};
32
33struct termios2 {
34 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */
36 tcflag_t c_cflag; /* control mode flags */
37 tcflag_t c_lflag; /* local mode flags */
38 cc_t c_line; /* line discipline */
39 cc_t c_cc[NCCS]; /* control characters */
40 speed_t c_ispeed; /* input speed */
41 speed_t c_ospeed; /* output speed */
42};
43
44struct ktermios {
45 tcflag_t c_iflag; /* input mode flags */
46 tcflag_t c_oflag; /* output mode flags */
47 tcflag_t c_cflag; /* control mode flags */
48 tcflag_t c_lflag; /* local mode flags */
49 cc_t c_line; /* line discipline */
50 cc_t c_cc[NCCS]; /* control characters */
51 speed_t c_ispeed; /* input speed */
52 speed_t c_ospeed; /* output speed */
53};
54
55/* c_cc characters */
56#define VINTR 0 /* Interrupt character [ISIG]. */
57#define VQUIT 1 /* Quit character [ISIG]. */
58#define VERASE 2 /* Erase character [ICANON]. */
59#define VKILL 3 /* Kill-line character [ICANON]. */
60#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
61#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
62#define VEOL2 6 /* Second EOL character [ICANON]. */
63#define VSWTC 7 /* ??? */
64#define VSWTCH VSWTC
65#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
66#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
67#define VSUSP 10 /* Suspend character [ISIG]. */
68#if 0
69/*
70 * VDSUSP is not supported
71 */
72#define VDSUSP 11 /* Delayed suspend character [ISIG]. */
73#endif
74#define VREPRINT 12 /* Reprint-line character [ICANON]. */
75#define VDISCARD 13 /* Discard character [IEXTEN]. */
76#define VWERASE 14 /* Word-erase character [ICANON]. */
77#define VLNEXT 15 /* Literal-next character [IEXTEN]. */
78#define VEOF 16 /* End-of-file character [ICANON]. */
79#define VEOL 17 /* End-of-line character [ICANON]. */
80
81/* c_iflag bits */
82#define IGNBRK 0000001 /* Ignore break condition. */
83#define BRKINT 0000002 /* Signal interrupt on break. */
84#define IGNPAR 0000004 /* Ignore characters with parity errors. */
85#define PARMRK 0000010 /* Mark parity and framing errors. */
86#define INPCK 0000020 /* Enable input parity check. */
87#define ISTRIP 0000040 /* Strip 8th bit off characters. */
88#define INLCR 0000100 /* Map NL to CR on input. */
89#define IGNCR 0000200 /* Ignore CR. */
90#define ICRNL 0000400 /* Map CR to NL on input. */
91#define IUCLC 0001000 /* Map upper case to lower case on input. */
92#define IXON 0002000 /* Enable start/stop output control. */
93#define IXANY 0004000 /* Any character will restart after stop. */
94#define IXOFF 0010000 /* Enable start/stop input control. */
95#define IMAXBEL 0020000 /* Ring bell when input queue is full. */
96#define IUTF8 0040000 /* Input is UTF-8 */
97
98/* c_oflag bits */
99#define OPOST 0000001 /* Perform output processing. */
100#define OLCUC 0000002 /* Map lower case to upper case on output. */
101#define ONLCR 0000004 /* Map NL to CR-NL on output. */
102#define OCRNL 0000010
103#define ONOCR 0000020
104#define ONLRET 0000040
105#define OFILL 0000100
106#define OFDEL 0000200
107#define NLDLY 0000400
108#define NL0 0000000
109#define NL1 0000400
110#define CRDLY 0003000
111#define CR0 0000000
112#define CR1 0001000
113#define CR2 0002000
114#define CR3 0003000
115#define TABDLY 0014000
116#define TAB0 0000000
117#define TAB1 0004000
118#define TAB2 0010000
119#define TAB3 0014000
120#define XTABS 0014000
121#define BSDLY 0020000
122#define BS0 0000000
123#define BS1 0020000
124#define VTDLY 0040000
125#define VT0 0000000
126#define VT1 0040000
127#define FFDLY 0100000
128#define FF0 0000000
129#define FF1 0100000
130/*
131#define PAGEOUT ???
132#define WRAP ???
133 */
134
135/* c_cflag bit meaning */
136#define CBAUD 0010017
137#define B0 0000000 /* hang up */
138#define B50 0000001
139#define B75 0000002
140#define B110 0000003
141#define B134 0000004
142#define B150 0000005
143#define B200 0000006
144#define B300 0000007
145#define B600 0000010
146#define B1200 0000011
147#define B1800 0000012
148#define B2400 0000013
149#define B4800 0000014
150#define B9600 0000015
151#define B19200 0000016
152#define B38400 0000017
153#define EXTA B19200
154#define EXTB B38400
155#define CSIZE 0000060 /* Number of bits per byte (mask). */
156#define CS5 0000000 /* 5 bits per byte. */
157#define CS6 0000020 /* 6 bits per byte. */
158#define CS7 0000040 /* 7 bits per byte. */
159#define CS8 0000060 /* 8 bits per byte. */
160#define CSTOPB 0000100 /* Two stop bits instead of one. */
161#define CREAD 0000200 /* Enable receiver. */
162#define PARENB 0000400 /* Parity enable. */
163#define PARODD 0001000 /* Odd parity instead of even. */
164#define HUPCL 0002000 /* Hang up on last close. */
165#define CLOCAL 0004000 /* Ignore modem status lines. */
166#define CBAUDEX 0010000
167#define BOTHER 0010000
168#define B57600 0010001
169#define B115200 0010002
170#define B230400 0010003
171#define B460800 0010004
172#define B500000 0010005
173#define B576000 0010006
174#define B921600 0010007
175#define B1000000 0010010
176#define B1152000 0010011
177#define B1500000 0010012
178#define B2000000 0010013
179#define B2500000 0010014
180#define B3000000 0010015
181#define B3500000 0010016
182#define B4000000 0010017
183#define CIBAUD 002003600000 /* input baud rate */
184#define CMSPAR 010000000000 /* mark or space (stick) parity */
185#define CRTSCTS 020000000000 /* flow control */
186
187#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
188
189/* c_lflag bits */
190#define ISIG 0000001 /* Enable signals. */
191#define ICANON 0000002 /* Do erase and kill processing. */
192#define XCASE 0000004
193#define ECHO 0000010 /* Enable echo. */
194#define ECHOE 0000020 /* Visual erase for ERASE. */
195#define ECHOK 0000040 /* Echo NL after KILL. */
196#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
197#define NOFLSH 0000200 /* Disable flush after interrupt. */
198#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
199#define ECHOCTL 0001000 /* Echo control characters as ^X. */
200#define ECHOPRT 0002000 /* Hardcopy visual erase. */
201#define ECHOKE 0004000 /* Visual erase for KILL. */
202#define FLUSHO 0020000
203#define PENDIN 0040000 /* Retype pending input (state). */
204#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
205#define ITOSTOP TOSTOP
206
207/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
208#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
209
210/* tcflow() and TCXONC use these */
211#define TCOOFF 0 /* Suspend output. */
212#define TCOON 1 /* Restart suspended output. */
213#define TCIOFF 2 /* Send a STOP character. */
214#define TCION 3 /* Send a START character. */
215
216/* tcflush() and TCFLSH use these */
217#define TCIFLUSH 0 /* Discard data received but not yet read. */
218#define TCOFLUSH 1 /* Discard data written but not yet sent. */
219#define TCIOFLUSH 2 /* Discard all pending data. */
220
221/* tcsetattr uses these */
222#define TCSANOW TCSETS /* Change immediately. */
223#define TCSADRAIN TCSETSW /* Change when pending output is written. */
224#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */
225
226#endif /* _ASM_TERMBITS_H */
diff --git a/include/asm-mips/termios.h b/include/asm-mips/termios.h
deleted file mode 100644
index a275661fa7e1..000000000000
--- a/include/asm-mips/termios.h
+++ /dev/null
@@ -1,132 +0,0 @@
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 * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_TERMIOS_H
10#define _ASM_TERMIOS_H
11
12#include <asm/termbits.h>
13#include <asm/ioctls.h>
14
15struct sgttyb {
16 char sg_ispeed;
17 char sg_ospeed;
18 char sg_erase;
19 char sg_kill;
20 int sg_flags; /* SGI special - int, not short */
21};
22
23struct tchars {
24 char t_intrc;
25 char t_quitc;
26 char t_startc;
27 char t_stopc;
28 char t_eofc;
29 char t_brkc;
30};
31
32struct ltchars {
33 char t_suspc; /* stop process signal */
34 char t_dsuspc; /* delayed stop process signal */
35 char t_rprntc; /* reprint line */
36 char t_flushc; /* flush output (toggles) */
37 char t_werasc; /* word erase */
38 char t_lnextc; /* literal next character */
39};
40
41/* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source
42 compatibility anyway ... */
43
44struct winsize {
45 unsigned short ws_row;
46 unsigned short ws_col;
47 unsigned short ws_xpixel;
48 unsigned short ws_ypixel;
49};
50
51#define NCC 8
52struct termio {
53 unsigned short c_iflag; /* input mode flags */
54 unsigned short c_oflag; /* output mode flags */
55 unsigned short c_cflag; /* control mode flags */
56 unsigned short c_lflag; /* local mode flags */
57 char c_line; /* line discipline */
58 unsigned char c_cc[NCCS]; /* control characters */
59};
60
61#ifdef __KERNEL__
62#include <linux/module.h>
63
64/*
65 * intr=^C quit=^\ erase=del kill=^U
66 * vmin=\1 vtime=\0 eol2=\0 swtc=\0
67 * start=^Q stop=^S susp=^Z vdsusp=
68 * reprint=^R discard=^U werase=^W lnext=^V
69 * eof=^D eol=\0
70 */
71#define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0"
72#endif
73
74/* modem lines */
75#define TIOCM_LE 0x001 /* line enable */
76#define TIOCM_DTR 0x002 /* data terminal ready */
77#define TIOCM_RTS 0x004 /* request to send */
78#define TIOCM_ST 0x010 /* secondary transmit */
79#define TIOCM_SR 0x020 /* secondary receive */
80#define TIOCM_CTS 0x040 /* clear to send */
81#define TIOCM_CAR 0x100 /* carrier detect */
82#define TIOCM_CD TIOCM_CAR
83#define TIOCM_RNG 0x200 /* ring */
84#define TIOCM_RI TIOCM_RNG
85#define TIOCM_DSR 0x400 /* data set ready */
86#define TIOCM_OUT1 0x2000
87#define TIOCM_OUT2 0x4000
88#define TIOCM_LOOP 0x8000
89
90#ifdef __KERNEL__
91
92#include <linux/string.h>
93
94/*
95 * Translate a "termio" structure into a "termios". Ugh.
96 */
97#define user_termio_to_kernel_termios(termios, termio) \
98({ \
99 unsigned short tmp; \
100 get_user(tmp, &(termio)->c_iflag); \
101 (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
102 get_user(tmp, &(termio)->c_oflag); \
103 (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
104 get_user(tmp, &(termio)->c_cflag); \
105 (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
106 get_user(tmp, &(termio)->c_lflag); \
107 (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
108 get_user((termios)->c_line, &(termio)->c_line); \
109 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
110})
111
112/*
113 * Translate a "termios" structure into a "termio". Ugh.
114 */
115#define kernel_termios_to_user_termio(termio, termios) \
116({ \
117 put_user((termios)->c_iflag, &(termio)->c_iflag); \
118 put_user((termios)->c_oflag, &(termio)->c_oflag); \
119 put_user((termios)->c_cflag, &(termio)->c_cflag); \
120 put_user((termios)->c_lflag, &(termio)->c_lflag); \
121 put_user((termios)->c_line, &(termio)->c_line); \
122 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
123})
124
125#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
126#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
127#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
128#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
129
130#endif /* defined(__KERNEL__) */
131
132#endif /* _ASM_TERMIOS_H */
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
deleted file mode 100644
index bb3060699df2..000000000000
--- a/include/asm-mips/thread_info.h
+++ /dev/null
@@ -1,151 +0,0 @@
1/* thread_info.h: MIPS low-level thread information
2 *
3 * Copyright (C) 2002 David Howells (dhowells@redhat.com)
4 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
5 */
6
7#ifndef _ASM_THREAD_INFO_H
8#define _ASM_THREAD_INFO_H
9
10#ifdef __KERNEL__
11
12
13#ifndef __ASSEMBLY__
14
15#include <asm/processor.h>
16
17/*
18 * low level task data that entry.S needs immediate access to
19 * - this struct should fit entirely inside of one cache line
20 * - this struct shares the supervisor stack pages
21 * - if the contents of this structure are changed, the assembly constants
22 * must also be changed
23 */
24struct thread_info {
25 struct task_struct *task; /* main task structure */
26 struct exec_domain *exec_domain; /* execution domain */
27 unsigned long flags; /* low level flags */
28 unsigned long tp_value; /* thread pointer */
29 __u32 cpu; /* current CPU */
30 int preempt_count; /* 0 => preemptable, <0 => BUG */
31
32 mm_segment_t addr_limit; /* thread address space:
33 0-0xBFFFFFFF for user-thead
34 0-0xFFFFFFFF for kernel-thread
35 */
36 struct restart_block restart_block;
37 struct pt_regs *regs;
38};
39
40/*
41 * macros/functions for gaining access to the thread information structure
42 *
43 * preempt_count needs to be 1 initially, until the scheduler is functional.
44 */
45#define INIT_THREAD_INFO(tsk) \
46{ \
47 .task = &tsk, \
48 .exec_domain = &default_exec_domain, \
49 .flags = _TIF_FIXADE, \
50 .cpu = 0, \
51 .preempt_count = 1, \
52 .addr_limit = KERNEL_DS, \
53 .restart_block = { \
54 .fn = do_no_restart_syscall, \
55 }, \
56}
57
58#define init_thread_info (init_thread_union.thread_info)
59#define init_stack (init_thread_union.stack)
60
61/* How to get the thread information struct from C. */
62register struct thread_info *__current_thread_info __asm__("$28");
63#define current_thread_info() __current_thread_info
64
65/* thread information allocation */
66#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT)
67#define THREAD_SIZE_ORDER (1)
68#endif
69#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_64BIT)
70#define THREAD_SIZE_ORDER (2)
71#endif
72#ifdef CONFIG_PAGE_SIZE_8KB
73#define THREAD_SIZE_ORDER (1)
74#endif
75#ifdef CONFIG_PAGE_SIZE_16KB
76#define THREAD_SIZE_ORDER (0)
77#endif
78#ifdef CONFIG_PAGE_SIZE_64KB
79#define THREAD_SIZE_ORDER (0)
80#endif
81
82#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
83#define THREAD_MASK (THREAD_SIZE - 1UL)
84
85#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
86
87#ifdef CONFIG_DEBUG_STACK_USAGE
88#define alloc_thread_info(tsk) \
89({ \
90 struct thread_info *ret; \
91 \
92 ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \
93 \
94 ret; \
95})
96#else
97#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
98#endif
99
100#define free_thread_info(info) kfree(info)
101
102#endif /* !__ASSEMBLY__ */
103
104#define PREEMPT_ACTIVE 0x10000000
105
106/*
107 * thread information flags
108 * - these are process state flags that various assembly files may need to
109 * access
110 * - pending work-to-be-done flags are in LSW
111 * - other flags in MSW
112 */
113#define TIF_SIGPENDING 1 /* signal pending */
114#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
115#define TIF_SYSCALL_AUDIT 3 /* syscall auditing active */
116#define TIF_SECCOMP 4 /* secure computing */
117#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
118#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
119#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
120#define TIF_MEMDIE 18
121#define TIF_FREEZE 19
122#define TIF_FIXADE 20 /* Fix address errors in software */
123#define TIF_LOGADE 21 /* Log address errors to syslog */
124#define TIF_32BIT_REGS 22 /* also implies 16/32 fprs */
125#define TIF_32BIT_ADDR 23 /* 32-bit address space (o32/n32) */
126#define TIF_FPUBOUND 24 /* thread bound to FPU-full CPU set */
127#define TIF_SYSCALL_TRACE 31 /* syscall trace active */
128
129#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
130#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
131#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
132#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
133#define _TIF_SECCOMP (1<<TIF_SECCOMP)
134#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
135#define _TIF_USEDFPU (1<<TIF_USEDFPU)
136#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
137#define _TIF_FREEZE (1<<TIF_FREEZE)
138#define _TIF_FIXADE (1<<TIF_FIXADE)
139#define _TIF_LOGADE (1<<TIF_LOGADE)
140#define _TIF_32BIT_REGS (1<<TIF_32BIT_REGS)
141#define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR)
142#define _TIF_FPUBOUND (1<<TIF_FPUBOUND)
143
144/* work to do on interrupt/exception return */
145#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)
146/* work to do on any return to u-space */
147#define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP)
148
149#endif /* __KERNEL__ */
150
151#endif /* _ASM_THREAD_INFO_H */
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
deleted file mode 100644
index d3bd5c5aa2ec..000000000000
--- a/include/asm-mips/time.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * Copyright (C) 2001, 2002, MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 * Copyright (c) 2003 Maciej W. Rozycki
5 *
6 * include/asm-mips/time.h
7 * header file for the new style time.c file and time services.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14#ifndef _ASM_TIME_H
15#define _ASM_TIME_H
16
17#include <linux/rtc.h>
18#include <linux/spinlock.h>
19#include <linux/clockchips.h>
20#include <linux/clocksource.h>
21
22extern spinlock_t rtc_lock;
23
24/*
25 * RTC ops. By default, they point to weak no-op RTC functions.
26 * rtc_mips_set_time - reverse the above translation and set time to RTC.
27 * rtc_mips_set_mmss - similar to rtc_set_time, but only min and sec need
28 * to be set. Used by RTC sync-up.
29 */
30extern int rtc_mips_set_time(unsigned long);
31extern int rtc_mips_set_mmss(unsigned long);
32
33/*
34 * board specific routines required by time_init().
35 */
36extern void plat_time_init(void);
37
38/*
39 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
40 * counter as a timer interrupt source.
41 */
42extern unsigned int mips_hpt_frequency;
43
44/*
45 * The performance counter IRQ on MIPS is a close relative to the timer IRQ
46 * so it lives here.
47 */
48extern int (*perf_irq)(void);
49
50/*
51 * Initialize the calling CPU's compare interrupt as clockevent device
52 */
53#ifdef CONFIG_CEVT_R4K
54extern int mips_clockevent_init(void);
55extern unsigned int __weak get_c0_compare_int(void);
56#else
57static inline int mips_clockevent_init(void)
58{
59 return -ENXIO;
60}
61#endif
62
63/*
64 * Initialize the count register as a clocksource
65 */
66#ifdef CONFIG_CEVT_R4K
67extern int init_mips_clocksource(void);
68#else
69static inline int init_mips_clocksource(void)
70{
71 return 0;
72}
73#endif
74
75extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock);
76extern void clockevent_set_clock(struct clock_event_device *cd,
77 unsigned int clock);
78
79#endif /* _ASM_TIME_H */
diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h
deleted file mode 100644
index 6529704aa73a..000000000000
--- a/include/asm-mips/timex.h
+++ /dev/null
@@ -1,43 +0,0 @@
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 * Copyright (C) 1998, 1999, 2003 by Ralf Baechle
7 */
8#ifndef _ASM_TIMEX_H
9#define _ASM_TIMEX_H
10
11#ifdef __KERNEL__
12
13#include <asm/mipsregs.h>
14
15/*
16 * This is the clock rate of the i8253 PIT. A MIPS system may not have
17 * a PIT by the symbol is used all over the kernel including some APIs.
18 * So keeping it defined to the number for the PIT is the only sane thing
19 * for now.
20 */
21#define CLOCK_TICK_RATE 1193182
22
23/*
24 * Standard way to access the cycle counter.
25 * Currently only used on SMP for scheduling.
26 *
27 * Only the low 32 bits are available as a continuously counting entity.
28 * But this only means we'll force a reschedule every 8 seconds or so,
29 * which isn't an evil thing.
30 *
31 * We know that all SMP capable CPUs have cycle counters.
32 */
33
34typedef unsigned int cycles_t;
35
36static inline cycles_t get_cycles(void)
37{
38 return 0;
39}
40
41#endif /* __KERNEL__ */
42
43#endif /* _ASM_TIMEX_H */
diff --git a/include/asm-mips/titan_dep.h b/include/asm-mips/titan_dep.h
deleted file mode 100644
index fee1908c65d2..000000000000
--- a/include/asm-mips/titan_dep.h
+++ /dev/null
@@ -1,231 +0,0 @@
1/*
2 * Copyright 2003 PMC-Sierra
3 * Author: Manish Lachwani (lachwani@pmc-sierra.com)
4 *
5 * Board specific definititions for the PMC-Sierra Yosemite
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __TITAN_DEP_H__
14#define __TITAN_DEP_H__
15
16#include <asm/addrspace.h> /* for KSEG1ADDR() */
17#include <asm/byteorder.h> /* for cpu_to_le32() */
18
19#define TITAN_READ(ofs) \
20 (*(volatile u32 *)(ocd_base+(ofs)))
21#define TITAN_READ_16(ofs) \
22 (*(volatile u16 *)(ocd_base+(ofs)))
23#define TITAN_READ_8(ofs) \
24 (*(volatile u8 *)(ocd_base+(ofs)))
25
26#define TITAN_WRITE(ofs, data) \
27 do { *(volatile u32 *)(ocd_base+(ofs)) = (data); } while (0)
28#define TITAN_WRITE_16(ofs, data) \
29 do { *(volatile u16 *)(ocd_base+(ofs)) = (data); } while (0)
30#define TITAN_WRITE_8(ofs, data) \
31 do { *(volatile u8 *)(ocd_base+(ofs)) = (data); } while (0)
32
33/*
34 * PCI specific defines
35 */
36#define TITAN_PCI_0_CONFIG_ADDRESS 0x780
37#define TITAN_PCI_0_CONFIG_DATA 0x784
38
39/*
40 * HT specific defines
41 */
42#define RM9000x2_HTLINK_REG 0xbb000644
43#define RM9000x2_BASE_ADDR 0xbb000000
44
45#define OCD_BASE 0xfb000000UL
46#define OCD_SIZE 0x3000UL
47
48extern unsigned long ocd_base;
49
50/*
51 * OCD Registers
52 */
53#define RM9000x2_OCD_LKB5 0x0128 /* Ethernet */
54#define RM9000x2_OCD_LKM5 0x012c
55
56#define RM9000x2_OCD_LKB7 0x0138 /* HT Region 0 */
57#define RM9000x2_OCD_LKM7 0x013c
58#define RM9000x2_OCD_LKB8 0x0140 /* HT Region 1 */
59#define RM9000x2_OCD_LKM8 0x0144
60
61#define RM9000x2_OCD_LKB9 0x0148 /* Local Bus */
62#define RM9000x2_OCD_LKM9 0x014c
63#define RM9000x2_OCD_LKB10 0x0150
64#define RM9000x2_OCD_LKM10 0x0154
65#define RM9000x2_OCD_LKB11 0x0158
66#define RM9000x2_OCD_LKM11 0x015c
67#define RM9000x2_OCD_LKB12 0x0160
68#define RM9000x2_OCD_LKM12 0x0164
69
70#define RM9000x2_OCD_LKB13 0x0168 /* Scratch RAM */
71#define RM9000x2_OCD_LKM13 0x016c
72
73#define RM9000x2_OCD_LPD0 0x0200 /* Local Bus */
74#define RM9000x2_OCD_LPD1 0x0210
75#define RM9000x2_OCD_LPD2 0x0220
76#define RM9000x2_OCD_LPD3 0x0230
77
78#define RM9000x2_OCD_HTDVID 0x0600 /* HT Device Header */
79#define RM9000x2_OCD_HTSC 0x0604
80#define RM9000x2_OCD_HTCCR 0x0608
81#define RM9000x2_OCD_HTBHL 0x060c
82#define RM9000x2_OCD_HTBAR0 0x0610
83#define RM9000x2_OCD_HTBAR1 0x0614
84#define RM9000x2_OCD_HTBAR2 0x0618
85#define RM9000x2_OCD_HTBAR3 0x061c
86#define RM9000x2_OCD_HTBAR4 0x0620
87#define RM9000x2_OCD_HTBAR5 0x0624
88#define RM9000x2_OCD_HTCBCPT 0x0628
89#define RM9000x2_OCD_HTSDVID 0x062c
90#define RM9000x2_OCD_HTXRA 0x0630
91#define RM9000x2_OCD_HTCAP1 0x0634
92#define RM9000x2_OCD_HTIL 0x063c
93
94#define RM9000x2_OCD_HTLCC 0x0640 /* HT Capability Block */
95#define RM9000x2_OCD_HTLINK 0x0644
96#define RM9000x2_OCD_HTFQREV 0x0648
97
98#define RM9000x2_OCD_HTERCTL 0x0668 /* HT Controller */
99#define RM9000x2_OCD_HTRXDB 0x066c
100#define RM9000x2_OCD_HTIMPED 0x0670
101#define RM9000x2_OCD_HTSWIMP 0x0674
102#define RM9000x2_OCD_HTCAL 0x0678
103
104#define RM9000x2_OCD_HTBAA30 0x0680
105#define RM9000x2_OCD_HTBAA54 0x0684
106#define RM9000x2_OCD_HTMASK0 0x0688
107#define RM9000x2_OCD_HTMASK1 0x068c
108#define RM9000x2_OCD_HTMASK2 0x0690
109#define RM9000x2_OCD_HTMASK3 0x0694
110#define RM9000x2_OCD_HTMASK4 0x0698
111#define RM9000x2_OCD_HTMASK5 0x069c
112
113#define RM9000x2_OCD_HTIFCTL 0x06a0
114#define RM9000x2_OCD_HTPLL 0x06a4
115
116#define RM9000x2_OCD_HTSRI 0x06b0
117#define RM9000x2_OCD_HTRXNUM 0x06b4
118#define RM9000x2_OCD_HTTXNUM 0x06b8
119
120#define RM9000x2_OCD_HTTXCNT 0x06c8
121
122#define RM9000x2_OCD_HTERROR 0x06d8
123#define RM9000x2_OCD_HTRCRCE 0x06dc
124#define RM9000x2_OCD_HTEOI 0x06e0
125
126#define RM9000x2_OCD_CRCR 0x06f0
127
128#define RM9000x2_OCD_HTCFGA 0x06f8
129#define RM9000x2_OCD_HTCFGD 0x06fc
130
131#define RM9000x2_OCD_INTMSG 0x0a00
132
133#define RM9000x2_OCD_INTPIN0 0x0a40
134#define RM9000x2_OCD_INTPIN1 0x0a44
135#define RM9000x2_OCD_INTPIN2 0x0a48
136#define RM9000x2_OCD_INTPIN3 0x0a4c
137#define RM9000x2_OCD_INTPIN4 0x0a50
138#define RM9000x2_OCD_INTPIN5 0x0a54
139#define RM9000x2_OCD_INTPIN6 0x0a58
140#define RM9000x2_OCD_INTPIN7 0x0a5c
141#define RM9000x2_OCD_SEM 0x0a60
142#define RM9000x2_OCD_SEMSET 0x0a64
143#define RM9000x2_OCD_SEMCLR 0x0a68
144
145#define RM9000x2_OCD_TKT 0x0a70
146#define RM9000x2_OCD_TKTINC 0x0a74
147
148#define RM9000x2_OCD_NMICONFIG 0x0ac0 /* Interrupts */
149#define RM9000x2_OCD_INTP0PRI 0x1a80
150#define RM9000x2_OCD_INTP1PRI 0x1a80
151#define RM9000x2_OCD_INTP0STATUS0 0x1b00
152#define RM9000x2_OCD_INTP0MASK0 0x1b04
153#define RM9000x2_OCD_INTP0SET0 0x1b08
154#define RM9000x2_OCD_INTP0CLEAR0 0x1b0c
155#define RM9000x2_OCD_INTP0STATUS1 0x1b10
156#define RM9000x2_OCD_INTP0MASK1 0x1b14
157#define RM9000x2_OCD_INTP0SET1 0x1b18
158#define RM9000x2_OCD_INTP0CLEAR1 0x1b1c
159#define RM9000x2_OCD_INTP0STATUS2 0x1b20
160#define RM9000x2_OCD_INTP0MASK2 0x1b24
161#define RM9000x2_OCD_INTP0SET2 0x1b28
162#define RM9000x2_OCD_INTP0CLEAR2 0x1b2c
163#define RM9000x2_OCD_INTP0STATUS3 0x1b30
164#define RM9000x2_OCD_INTP0MASK3 0x1b34
165#define RM9000x2_OCD_INTP0SET3 0x1b38
166#define RM9000x2_OCD_INTP0CLEAR3 0x1b3c
167#define RM9000x2_OCD_INTP0STATUS4 0x1b40
168#define RM9000x2_OCD_INTP0MASK4 0x1b44
169#define RM9000x2_OCD_INTP0SET4 0x1b48
170#define RM9000x2_OCD_INTP0CLEAR4 0x1b4c
171#define RM9000x2_OCD_INTP0STATUS5 0x1b50
172#define RM9000x2_OCD_INTP0MASK5 0x1b54
173#define RM9000x2_OCD_INTP0SET5 0x1b58
174#define RM9000x2_OCD_INTP0CLEAR5 0x1b5c
175#define RM9000x2_OCD_INTP0STATUS6 0x1b60
176#define RM9000x2_OCD_INTP0MASK6 0x1b64
177#define RM9000x2_OCD_INTP0SET6 0x1b68
178#define RM9000x2_OCD_INTP0CLEAR6 0x1b6c
179#define RM9000x2_OCD_INTP0STATUS7 0x1b70
180#define RM9000x2_OCD_INTP0MASK7 0x1b74
181#define RM9000x2_OCD_INTP0SET7 0x1b78
182#define RM9000x2_OCD_INTP0CLEAR7 0x1b7c
183#define RM9000x2_OCD_INTP1STATUS0 0x2b00
184#define RM9000x2_OCD_INTP1MASK0 0x2b04
185#define RM9000x2_OCD_INTP1SET0 0x2b08
186#define RM9000x2_OCD_INTP1CLEAR0 0x2b0c
187#define RM9000x2_OCD_INTP1STATUS1 0x2b10
188#define RM9000x2_OCD_INTP1MASK1 0x2b14
189#define RM9000x2_OCD_INTP1SET1 0x2b18
190#define RM9000x2_OCD_INTP1CLEAR1 0x2b1c
191#define RM9000x2_OCD_INTP1STATUS2 0x2b20
192#define RM9000x2_OCD_INTP1MASK2 0x2b24
193#define RM9000x2_OCD_INTP1SET2 0x2b28
194#define RM9000x2_OCD_INTP1CLEAR2 0x2b2c
195#define RM9000x2_OCD_INTP1STATUS3 0x2b30
196#define RM9000x2_OCD_INTP1MASK3 0x2b34
197#define RM9000x2_OCD_INTP1SET3 0x2b38
198#define RM9000x2_OCD_INTP1CLEAR3 0x2b3c
199#define RM9000x2_OCD_INTP1STATUS4 0x2b40
200#define RM9000x2_OCD_INTP1MASK4 0x2b44
201#define RM9000x2_OCD_INTP1SET4 0x2b48
202#define RM9000x2_OCD_INTP1CLEAR4 0x2b4c
203#define RM9000x2_OCD_INTP1STATUS5 0x2b50
204#define RM9000x2_OCD_INTP1MASK5 0x2b54
205#define RM9000x2_OCD_INTP1SET5 0x2b58
206#define RM9000x2_OCD_INTP1CLEAR5 0x2b5c
207#define RM9000x2_OCD_INTP1STATUS6 0x2b60
208#define RM9000x2_OCD_INTP1MASK6 0x2b64
209#define RM9000x2_OCD_INTP1SET6 0x2b68
210#define RM9000x2_OCD_INTP1CLEAR6 0x2b6c
211#define RM9000x2_OCD_INTP1STATUS7 0x2b70
212#define RM9000x2_OCD_INTP1MASK7 0x2b74
213#define RM9000x2_OCD_INTP1SET7 0x2b78
214#define RM9000x2_OCD_INTP1CLEAR7 0x2b7c
215
216#define OCD_READ(reg) (*(volatile unsigned int *)(ocd_base + (reg)))
217#define OCD_WRITE(reg, val) \
218 do { *(volatile unsigned int *)(ocd_base + (reg)) = (val); } while (0)
219
220/*
221 * Hypertransport specific macros
222 */
223#define RM9K_WRITE(ofs, data) *(volatile u_int32_t *)(RM9000x2_BASE_ADDR+ofs) = data
224#define RM9K_WRITE_8(ofs, data) *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs) = data
225#define RM9K_WRITE_16(ofs, data) *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs) = data
226
227#define RM9K_READ(ofs, val) *(val) = *(volatile u_int32_t *)(RM9000x2_BASE_ADDR+ofs)
228#define RM9K_READ_8(ofs, val) *(val) = *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs)
229#define RM9K_READ_16(ofs, val) *(val) = *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs)
230
231#endif
diff --git a/include/asm-mips/tlb.h b/include/asm-mips/tlb.h
deleted file mode 100644
index 80d9dfcf1e88..000000000000
--- a/include/asm-mips/tlb.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef __ASM_TLB_H
2#define __ASM_TLB_H
3
4/*
5 * MIPS doesn't need any special per-pte or per-vma handling, except
6 * we need to flush cache for area to be unmapped.
7 */
8#define tlb_start_vma(tlb, vma) \
9 do { \
10 if (!tlb->fullmm) \
11 flush_cache_range(vma, vma->vm_start, vma->vm_end); \
12 } while (0)
13#define tlb_end_vma(tlb, vma) do { } while (0)
14#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
15
16/*
17 * .. because we flush the whole mm when it fills up.
18 */
19#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
20
21#include <asm-generic/tlb.h>
22
23#endif /* __ASM_TLB_H */
diff --git a/include/asm-mips/tlbdebug.h b/include/asm-mips/tlbdebug.h
deleted file mode 100644
index bb8f5c29c3d9..000000000000
--- a/include/asm-mips/tlbdebug.h
+++ /dev/null
@@ -1,16 +0,0 @@
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 * Copyright (C) 2002 by Ralf Baechle
7 */
8#ifndef __ASM_TLBDEBUG_H
9#define __ASM_TLBDEBUG_H
10
11/*
12 * TLB debugging functions:
13 */
14extern void dump_tlb_all(void);
15
16#endif /* __ASM_TLBDEBUG_H */
diff --git a/include/asm-mips/tlbflush.h b/include/asm-mips/tlbflush.h
deleted file mode 100644
index 86b21de12e91..000000000000
--- a/include/asm-mips/tlbflush.h
+++ /dev/null
@@ -1,47 +0,0 @@
1#ifndef __ASM_TLBFLUSH_H
2#define __ASM_TLBFLUSH_H
3
4#include <linux/mm.h>
5
6/*
7 * TLB flushing:
8 *
9 * - flush_tlb_all() flushes all processes TLB entries
10 * - flush_tlb_mm(mm) flushes the specified mm context TLB entries
11 * - flush_tlb_page(vma, vmaddr) flushes one page
12 * - flush_tlb_range(vma, start, end) flushes a range of pages
13 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
14 */
15extern void local_flush_tlb_all(void);
16extern void local_flush_tlb_mm(struct mm_struct *mm);
17extern void local_flush_tlb_range(struct vm_area_struct *vma,
18 unsigned long start, unsigned long end);
19extern void local_flush_tlb_kernel_range(unsigned long start,
20 unsigned long end);
21extern void local_flush_tlb_page(struct vm_area_struct *vma,
22 unsigned long page);
23extern void local_flush_tlb_one(unsigned long vaddr);
24
25#ifdef CONFIG_SMP
26
27extern void flush_tlb_all(void);
28extern void flush_tlb_mm(struct mm_struct *);
29extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long,
30 unsigned long);
31extern void flush_tlb_kernel_range(unsigned long, unsigned long);
32extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
33extern void flush_tlb_one(unsigned long vaddr);
34
35#else /* CONFIG_SMP */
36
37#define flush_tlb_all() local_flush_tlb_all()
38#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
39#define flush_tlb_range(vma, vmaddr, end) local_flush_tlb_range(vma, vmaddr, end)
40#define flush_tlb_kernel_range(vmaddr,end) \
41 local_flush_tlb_kernel_range(vmaddr, end)
42#define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page)
43#define flush_tlb_one(vaddr) local_flush_tlb_one(vaddr)
44
45#endif /* CONFIG_SMP */
46
47#endif /* __ASM_TLBFLUSH_H */
diff --git a/include/asm-mips/topology.h b/include/asm-mips/topology.h
deleted file mode 100644
index 259145e07e97..000000000000
--- a/include/asm-mips/topology.h
+++ /dev/null
@@ -1,17 +0,0 @@
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 * Copyright (C) 2007 by Ralf Baechle
7 */
8#ifndef __ASM_TOPOLOGY_H
9#define __ASM_TOPOLOGY_H
10
11#include <topology.h>
12
13#ifdef CONFIG_SMP
14#define smt_capable() (smp_num_siblings > 1)
15#endif
16
17#endif /* __ASM_TOPOLOGY_H */
diff --git a/include/asm-mips/traps.h b/include/asm-mips/traps.h
deleted file mode 100644
index 90ff2f497c50..000000000000
--- a/include/asm-mips/traps.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Trap handling definitions.
3 *
4 * Copyright (C) 2002, 2003 Maciej W. Rozycki
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#ifndef _ASM_TRAPS_H
12#define _ASM_TRAPS_H
13
14/*
15 * Possible status responses for a board_be_handler backend.
16 */
17#define MIPS_BE_DISCARD 0 /* return with no action */
18#define MIPS_BE_FIXUP 1 /* return to the fixup code */
19#define MIPS_BE_FATAL 2 /* treat as an unrecoverable error */
20
21extern void (*board_be_init)(void);
22extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
23
24extern void (*board_nmi_handler_setup)(void);
25extern void (*board_ejtag_handler_setup)(void);
26extern void (*board_bind_eic_interrupt)(int irq, int regset);
27
28#endif /* _ASM_TRAPS_H */
diff --git a/include/asm-mips/txx9/generic.h b/include/asm-mips/txx9/generic.h
deleted file mode 100644
index 5b1ccf901c62..000000000000
--- a/include/asm-mips/txx9/generic.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * linux/include/asm-mips/txx9/generic.h
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#ifndef __ASM_TXX9_GENERIC_H
9#define __ASM_TXX9_GENERIC_H
10
11#include <linux/init.h>
12#include <linux/ioport.h> /* for struct resource */
13
14extern struct resource txx9_ce_res[];
15#define TXX9_CE(n) (unsigned long)(txx9_ce_res[(n)].start)
16extern unsigned int txx9_pcode;
17extern char txx9_pcode_str[8];
18void txx9_reg_res_init(unsigned int pcode, unsigned long base,
19 unsigned long size);
20
21extern unsigned int txx9_master_clock;
22extern unsigned int txx9_cpu_clock;
23extern unsigned int txx9_gbus_clock;
24#define TXX9_IMCLK (txx9_gbus_clock / 2)
25
26extern int txx9_ccfg_toeon;
27struct uart_port;
28int early_serial_txx9_setup(struct uart_port *port);
29
30struct pci_dev;
31struct txx9_board_vec {
32 const char *system;
33 void (*prom_init)(void);
34 void (*mem_setup)(void);
35 void (*irq_setup)(void);
36 void (*time_init)(void);
37 void (*arch_init)(void);
38 void (*device_init)(void);
39#ifdef CONFIG_PCI
40 int (*pci_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
41#endif
42};
43extern struct txx9_board_vec *txx9_board_vec;
44extern int (*txx9_irq_dispatch)(int pending);
45void prom_init_cmdline(void);
46char *prom_getcmdline(void);
47void txx9_wdt_init(unsigned long base);
48void txx9_spi_init(int busid, unsigned long base, int irq);
49void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr);
50void txx9_sio_init(unsigned long baseaddr, int irq,
51 unsigned int line, unsigned int sclk, int nocts);
52void prom_putchar(char c);
53#ifdef CONFIG_EARLY_PRINTK
54extern void (*txx9_prom_putchar)(char c);
55void txx9_sio_putchar_init(unsigned long baseaddr);
56#else
57static inline void txx9_sio_putchar_init(unsigned long baseaddr)
58{
59}
60#endif
61
62#endif /* __ASM_TXX9_GENERIC_H */
diff --git a/include/asm-mips/txx9/jmr3927.h b/include/asm-mips/txx9/jmr3927.h
deleted file mode 100644
index a409c446bf18..000000000000
--- a/include/asm-mips/txx9/jmr3927.h
+++ /dev/null
@@ -1,180 +0,0 @@
1/*
2 * Defines for the TJSYS JMR-TX3927
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 (C) 2000-2001 Toshiba Corporation
9 */
10#ifndef __ASM_TXX9_JMR3927_H
11#define __ASM_TXX9_JMR3927_H
12
13#include <asm/txx9/tx3927.h>
14#include <asm/addrspace.h>
15#include <asm/system.h>
16#include <asm/txx9irq.h>
17
18/* CS */
19#define JMR3927_ROMCE0 0x1fc00000 /* 4M */
20#define JMR3927_ROMCE1 0x1e000000 /* 4M */
21#define JMR3927_ROMCE2 0x14000000 /* 16M */
22#define JMR3927_ROMCE3 0x10000000 /* 64M */
23#define JMR3927_ROMCE5 0x1d000000 /* 4M */
24#define JMR3927_SDCS0 0x00000000 /* 32M */
25#define JMR3927_SDCS1 0x02000000 /* 32M */
26/* PCI Direct Mappings */
27
28#define JMR3927_PCIMEM 0x08000000
29#define JMR3927_PCIMEM_SIZE 0x08000000 /* 128M */
30#define JMR3927_PCIIO 0x15000000
31#define JMR3927_PCIIO_SIZE 0x01000000 /* 16M */
32
33#define JMR3927_SDRAM_SIZE 0x02000000 /* 32M */
34#define JMR3927_PORT_BASE KSEG1
35
36/* Address map (virtual address) */
37#define JMR3927_ROM0_BASE (KSEG1 + JMR3927_ROMCE0)
38#define JMR3927_ROM1_BASE (KSEG1 + JMR3927_ROMCE1)
39#define JMR3927_IOC_BASE (KSEG1 + JMR3927_ROMCE2)
40#define JMR3927_PCIMEM_BASE (KSEG1 + JMR3927_PCIMEM)
41#define JMR3927_PCIIO_BASE (KSEG1 + JMR3927_PCIIO)
42
43#define JMR3927_IOC_REV_ADDR (JMR3927_IOC_BASE + 0x00000000)
44#define JMR3927_IOC_NVRAMB_ADDR (JMR3927_IOC_BASE + 0x00010000)
45#define JMR3927_IOC_LED_ADDR (JMR3927_IOC_BASE + 0x00020000)
46#define JMR3927_IOC_DIPSW_ADDR (JMR3927_IOC_BASE + 0x00030000)
47#define JMR3927_IOC_BREV_ADDR (JMR3927_IOC_BASE + 0x00040000)
48#define JMR3927_IOC_DTR_ADDR (JMR3927_IOC_BASE + 0x00050000)
49#define JMR3927_IOC_INTS1_ADDR (JMR3927_IOC_BASE + 0x00080000)
50#define JMR3927_IOC_INTS2_ADDR (JMR3927_IOC_BASE + 0x00090000)
51#define JMR3927_IOC_INTM_ADDR (JMR3927_IOC_BASE + 0x000a0000)
52#define JMR3927_IOC_INTP_ADDR (JMR3927_IOC_BASE + 0x000b0000)
53#define JMR3927_IOC_RESET_ADDR (JMR3927_IOC_BASE + 0x000f0000)
54
55/* Flash ROM */
56#define JMR3927_FLASH_BASE (JMR3927_ROM0_BASE)
57#define JMR3927_FLASH_SIZE 0x00400000
58
59/* bits for IOC_REV/IOC_BREV (high byte) */
60#define JMR3927_IDT_MASK 0xfc
61#define JMR3927_REV_MASK 0x03
62#define JMR3927_IOC_IDT 0xe0
63
64/* bits for IOC_INTS1/IOC_INTS2/IOC_INTM/IOC_INTP (high byte) */
65#define JMR3927_IOC_INTB_PCIA 0
66#define JMR3927_IOC_INTB_PCIB 1
67#define JMR3927_IOC_INTB_PCIC 2
68#define JMR3927_IOC_INTB_PCID 3
69#define JMR3927_IOC_INTB_MODEM 4
70#define JMR3927_IOC_INTB_INT6 5
71#define JMR3927_IOC_INTB_INT7 6
72#define JMR3927_IOC_INTB_SOFT 7
73#define JMR3927_IOC_INTF_PCIA (1 << JMR3927_IOC_INTF_PCIA)
74#define JMR3927_IOC_INTF_PCIB (1 << JMR3927_IOC_INTB_PCIB)
75#define JMR3927_IOC_INTF_PCIC (1 << JMR3927_IOC_INTB_PCIC)
76#define JMR3927_IOC_INTF_PCID (1 << JMR3927_IOC_INTB_PCID)
77#define JMR3927_IOC_INTF_MODEM (1 << JMR3927_IOC_INTB_MODEM)
78#define JMR3927_IOC_INTF_INT6 (1 << JMR3927_IOC_INTB_INT6)
79#define JMR3927_IOC_INTF_INT7 (1 << JMR3927_IOC_INTB_INT7)
80#define JMR3927_IOC_INTF_SOFT (1 << JMR3927_IOC_INTB_SOFT)
81
82/* bits for IOC_RESET (high byte) */
83#define JMR3927_IOC_RESET_CPU 1
84#define JMR3927_IOC_RESET_PCI 2
85
86#if defined(__BIG_ENDIAN)
87#define jmr3927_ioc_reg_out(d, a) ((*(volatile unsigned char *)(a)) = (d))
88#define jmr3927_ioc_reg_in(a) (*(volatile unsigned char *)(a))
89#elif defined(__LITTLE_ENDIAN)
90#define jmr3927_ioc_reg_out(d, a) ((*(volatile unsigned char *)((a)^1)) = (d))
91#define jmr3927_ioc_reg_in(a) (*(volatile unsigned char *)((a)^1))
92#else
93#error "No Endian"
94#endif
95
96/* LED macro */
97#define jmr3927_led_set(n/*0-16*/) jmr3927_ioc_reg_out(~(n), JMR3927_IOC_LED_ADDR)
98
99#define jmr3927_led_and_set(n/*0-16*/) jmr3927_ioc_reg_out((~(n)) & jmr3927_ioc_reg_in(JMR3927_IOC_LED_ADDR), JMR3927_IOC_LED_ADDR)
100
101/* DIPSW4 macro */
102#define jmr3927_dipsw1() (gpio_get_value(11) == 0)
103#define jmr3927_dipsw2() (gpio_get_value(10) == 0)
104#define jmr3927_dipsw3() ((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 2) == 0)
105#define jmr3927_dipsw4() ((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 1) == 0)
106
107/*
108 * IRQ mappings
109 */
110
111/* These are the virtual IRQ numbers, we divide all IRQ's into
112 * 'spaces', the 'space' determines where and how to enable/disable
113 * that particular IRQ on an JMR machine. Add new 'spaces' as new
114 * IRQ hardware is supported.
115 */
116#define JMR3927_NR_IRQ_IRC 16 /* On-Chip IRC */
117#define JMR3927_NR_IRQ_IOC 8 /* PCI/MODEM/INT[6:7] */
118
119#define JMR3927_IRQ_IRC TXX9_IRQ_BASE
120#define JMR3927_IRQ_IOC (JMR3927_IRQ_IRC + JMR3927_NR_IRQ_IRC)
121#define JMR3927_IRQ_END (JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC)
122
123#define JMR3927_IRQ_IRC_INT0 (JMR3927_IRQ_IRC + TX3927_IR_INT0)
124#define JMR3927_IRQ_IRC_INT1 (JMR3927_IRQ_IRC + TX3927_IR_INT1)
125#define JMR3927_IRQ_IRC_INT2 (JMR3927_IRQ_IRC + TX3927_IR_INT2)
126#define JMR3927_IRQ_IRC_INT3 (JMR3927_IRQ_IRC + TX3927_IR_INT3)
127#define JMR3927_IRQ_IRC_INT4 (JMR3927_IRQ_IRC + TX3927_IR_INT4)
128#define JMR3927_IRQ_IRC_INT5 (JMR3927_IRQ_IRC + TX3927_IR_INT5)
129#define JMR3927_IRQ_IRC_SIO0 (JMR3927_IRQ_IRC + TX3927_IR_SIO0)
130#define JMR3927_IRQ_IRC_SIO1 (JMR3927_IRQ_IRC + TX3927_IR_SIO1)
131#define JMR3927_IRQ_IRC_SIO(ch) (JMR3927_IRQ_IRC + TX3927_IR_SIO(ch))
132#define JMR3927_IRQ_IRC_DMA (JMR3927_IRQ_IRC + TX3927_IR_DMA)
133#define JMR3927_IRQ_IRC_PIO (JMR3927_IRQ_IRC + TX3927_IR_PIO)
134#define JMR3927_IRQ_IRC_PCI (JMR3927_IRQ_IRC + TX3927_IR_PCI)
135#define JMR3927_IRQ_IRC_TMR(ch) (JMR3927_IRQ_IRC + TX3927_IR_TMR(ch))
136#define JMR3927_IRQ_IOC_PCIA (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIA)
137#define JMR3927_IRQ_IOC_PCIB (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIB)
138#define JMR3927_IRQ_IOC_PCIC (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIC)
139#define JMR3927_IRQ_IOC_PCID (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCID)
140#define JMR3927_IRQ_IOC_MODEM (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_MODEM)
141#define JMR3927_IRQ_IOC_INT6 (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_INT6)
142#define JMR3927_IRQ_IOC_INT7 (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_INT7)
143#define JMR3927_IRQ_IOC_SOFT (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_SOFT)
144
145/* IOC (PCI, MODEM) */
146#define JMR3927_IRQ_IOCINT JMR3927_IRQ_IRC_INT1
147/* TC35815 100M Ether (JMR-TX3912:JPW4:2-3 Short) */
148#define JMR3927_IRQ_ETHER0 JMR3927_IRQ_IRC_INT3
149
150/* Clocks */
151#define JMR3927_CORECLK 132710400 /* 132.7MHz */
152
153/*
154 * TX3927 Pin Configuration:
155 *
156 * PCFG bits Avail Dead
157 * SELSIO[1:0]:11 RXD[1:0], TXD[1:0] PIO[6:3]
158 * SELSIOC[0]:1 CTS[0], RTS[0] INT[5:4]
159 * SELSIOC[1]:0,SELDSF:0, GSDAO[0],GPCST[3] CTS[1], RTS[1],DSF,
160 * GDBGE* PIO[2:1]
161 * SELDMA[2]:1 DMAREQ[2],DMAACK[2] PIO[13:12]
162 * SELTMR[2:0]:000 TIMER[1:0]
163 * SELCS:0,SELDMA[1]:0 PIO[11;10] SDCS_CE[7:6],
164 * DMAREQ[1],DMAACK[1]
165 * SELDMA[0]:1 DMAREQ[0],DMAACK[0] PIO[9:8]
166 * SELDMA[3]:1 DMAREQ[3],DMAACK[3] PIO[15:14]
167 * SELDONE:1 DMADONE PIO[7]
168 *
169 * Usable pins are:
170 * RXD[1;0],TXD[1:0],CTS[0],RTS[0],
171 * DMAREQ[0,2,3],DMAACK[0,2,3],DMADONE,PIO[0,10,11]
172 * INT[3:0]
173 */
174
175void jmr3927_prom_init(void);
176void jmr3927_irq_setup(void);
177struct pci_dev;
178int jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
179
180#endif /* __ASM_TXX9_JMR3927_H */
diff --git a/include/asm-mips/txx9/pci.h b/include/asm-mips/txx9/pci.h
deleted file mode 100644
index 3d32529060aa..000000000000
--- a/include/asm-mips/txx9/pci.h
+++ /dev/null
@@ -1,39 +0,0 @@
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#ifndef __ASM_TXX9_PCI_H
7#define __ASM_TXX9_PCI_H
8
9#include <linux/pci.h>
10
11extern struct pci_controller txx9_primary_pcic;
12struct pci_controller *
13txx9_alloc_pci_controller(struct pci_controller *pcic,
14 unsigned long mem_base, unsigned long mem_size,
15 unsigned long io_base, unsigned long io_size);
16
17int txx9_pci66_check(struct pci_controller *hose, int top_bus,
18 int current_bus);
19extern int txx9_pci_mem_high __initdata;
20
21extern int txx9_pci_option;
22#define TXX9_PCI_OPT_PICMG 0x0002
23#define TXX9_PCI_OPT_CLK_33 0x0008
24#define TXX9_PCI_OPT_CLK_66 0x0010
25#define TXX9_PCI_OPT_CLK_MASK \
26 (TXX9_PCI_OPT_CLK_33 | TXX9_PCI_OPT_CLK_66)
27#define TXX9_PCI_OPT_CLK_AUTO TXX9_PCI_OPT_CLK_MASK
28
29enum txx9_pci_err_action {
30 TXX9_PCI_ERR_REPORT,
31 TXX9_PCI_ERR_IGNORE,
32 TXX9_PCI_ERR_PANIC,
33};
34extern enum txx9_pci_err_action txx9_pci_err_action;
35
36extern char * (*txx9_board_pcibios_setup)(char *str);
37char *txx9_pcibios_setup(char *str);
38
39#endif /* __ASM_TXX9_PCI_H */
diff --git a/include/asm-mips/txx9/rbtx4927.h b/include/asm-mips/txx9/rbtx4927.h
deleted file mode 100644
index 6fcec912c143..000000000000
--- a/include/asm-mips/txx9/rbtx4927.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/*
2 * Author: MontaVista Software, Inc.
3 * source@mvista.com
4 *
5 * Copyright 2001-2002 MontaVista Software Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
15 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27#ifndef __ASM_TXX9_RBTX4927_H
28#define __ASM_TXX9_RBTX4927_H
29
30#include <asm/txx9/tx4927.h>
31
32#define RBTX4927_PCIMEM 0x08000000
33#define RBTX4927_PCIMEM_SIZE 0x08000000
34#define RBTX4927_PCIIO 0x16000000
35#define RBTX4927_PCIIO_SIZE 0x01000000
36
37#define RBTX4927_IMASK_ADDR (IO_BASE + TXX9_CE(2) + 0x00002000)
38#define RBTX4927_IMSTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x00002006)
39#define RBTX4927_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f000)
40#define RBTX4927_SOFTRESETLOCK_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f002)
41#define RBTX4927_PCIRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f006)
42#define RBTX4927_BRAMRTC_BASE (IO_BASE + TXX9_CE(2) + 0x00010000)
43#define RBTX4927_ETHER_BASE (IO_BASE + TXX9_CE(2) + 0x00020000)
44
45/* Ethernet port address */
46#define RBTX4927_ETHER_ADDR (RBTX4927_ETHER_BASE + 0x280)
47
48#define rbtx4927_imask_addr ((__u8 __iomem *)RBTX4927_IMASK_ADDR)
49#define rbtx4927_imstat_addr ((__u8 __iomem *)RBTX4927_IMSTAT_ADDR)
50#define rbtx4927_softreset_addr ((__u8 __iomem *)RBTX4927_SOFTRESET_ADDR)
51#define rbtx4927_softresetlock_addr \
52 ((__u8 __iomem *)RBTX4927_SOFTRESETLOCK_ADDR)
53#define rbtx4927_pcireset_addr ((__u8 __iomem *)RBTX4927_PCIRESET_ADDR)
54
55/* bits for ISTAT/IMASK/IMSTAT */
56#define RBTX4927_INTB_PCID 0
57#define RBTX4927_INTB_PCIC 1
58#define RBTX4927_INTB_PCIB 2
59#define RBTX4927_INTB_PCIA 3
60#define RBTX4927_INTF_PCID (1 << RBTX4927_INTB_PCID)
61#define RBTX4927_INTF_PCIC (1 << RBTX4927_INTB_PCIC)
62#define RBTX4927_INTF_PCIB (1 << RBTX4927_INTB_PCIB)
63#define RBTX4927_INTF_PCIA (1 << RBTX4927_INTB_PCIA)
64
65#define RBTX4927_NR_IRQ_IOC 8 /* IOC */
66
67#define RBTX4927_IRQ_IOC (TXX9_IRQ_BASE + TX4927_NUM_IR)
68#define RBTX4927_IRQ_IOC_PCID (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCID)
69#define RBTX4927_IRQ_IOC_PCIC (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIC)
70#define RBTX4927_IRQ_IOC_PCIB (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIB)
71#define RBTX4927_IRQ_IOC_PCIA (RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIA)
72
73#define RBTX4927_IRQ_IOCINT (TXX9_IRQ_BASE + TX4927_IR_INT(1))
74
75#ifdef CONFIG_PCI
76#define RBTX4927_ISA_IO_OFFSET RBTX4927_PCIIO
77#else
78#define RBTX4927_ISA_IO_OFFSET 0
79#endif
80
81#define RBTX4927_RTL_8019_BASE (RBTX4927_ETHER_ADDR - mips_io_port_base)
82#define RBTX4927_RTL_8019_IRQ (TXX9_IRQ_BASE + TX4927_IR_INT(3))
83
84void rbtx4927_prom_init(void);
85void rbtx4927_irq_setup(void);
86struct pci_dev;
87int rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
88
89#endif /* __ASM_TXX9_RBTX4927_H */
diff --git a/include/asm-mips/txx9/rbtx4938.h b/include/asm-mips/txx9/rbtx4938.h
deleted file mode 100644
index 9f0441a28126..000000000000
--- a/include/asm-mips/txx9/rbtx4938.h
+++ /dev/null
@@ -1,145 +0,0 @@
1/*
2 * Definitions for TX4937/TX4938
3 *
4 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
5 * terms of the GNU General Public License version 2. This program is
6 * licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 *
9 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
10 */
11#ifndef __ASM_TXX9_RBTX4938_H
12#define __ASM_TXX9_RBTX4938_H
13
14#include <asm/addrspace.h>
15#include <asm/txx9irq.h>
16#include <asm/txx9/tx4938.h>
17
18/* Address map */
19#define RBTX4938_FPGA_REG_ADDR (IO_BASE + TXX9_CE(2) + 0x00000000)
20#define RBTX4938_FPGA_REV_ADDR (IO_BASE + TXX9_CE(2) + 0x00000002)
21#define RBTX4938_CONFIG1_ADDR (IO_BASE + TXX9_CE(2) + 0x00000004)
22#define RBTX4938_CONFIG2_ADDR (IO_BASE + TXX9_CE(2) + 0x00000006)
23#define RBTX4938_CONFIG3_ADDR (IO_BASE + TXX9_CE(2) + 0x00000008)
24#define RBTX4938_LED_ADDR (IO_BASE + TXX9_CE(2) + 0x00001000)
25#define RBTX4938_DIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001002)
26#define RBTX4938_BDIPSW_ADDR (IO_BASE + TXX9_CE(2) + 0x00001004)
27#define RBTX4938_IMASK_ADDR (IO_BASE + TXX9_CE(2) + 0x00002000)
28#define RBTX4938_IMASK2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002002)
29#define RBTX4938_INTPOL_ADDR (IO_BASE + TXX9_CE(2) + 0x00002004)
30#define RBTX4938_ISTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x00002006)
31#define RBTX4938_ISTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x00002008)
32#define RBTX4938_IMSTAT_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200a)
33#define RBTX4938_IMSTAT2_ADDR (IO_BASE + TXX9_CE(2) + 0x0000200c)
34#define RBTX4938_SOFTINT_ADDR (IO_BASE + TXX9_CE(2) + 0x00003000)
35#define RBTX4938_PIOSEL_ADDR (IO_BASE + TXX9_CE(2) + 0x00005000)
36#define RBTX4938_SPICS_ADDR (IO_BASE + TXX9_CE(2) + 0x00005002)
37#define RBTX4938_SFPWR_ADDR (IO_BASE + TXX9_CE(2) + 0x00005008)
38#define RBTX4938_SFVOL_ADDR (IO_BASE + TXX9_CE(2) + 0x0000500a)
39#define RBTX4938_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007000)
40#define RBTX4938_SOFTRESETLOCK_ADDR (IO_BASE + TXX9_CE(2) + 0x00007002)
41#define RBTX4938_PCIRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007004)
42#define RBTX4938_ETHER_BASE (IO_BASE + TXX9_CE(2) + 0x00020000)
43
44/* Ethernet port address (Jumperless Mode (W12:Open)) */
45#define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280)
46
47/* bits for ISTAT/IMASK/IMSTAT */
48#define RBTX4938_INTB_PCID 0
49#define RBTX4938_INTB_PCIC 1
50#define RBTX4938_INTB_PCIB 2
51#define RBTX4938_INTB_PCIA 3
52#define RBTX4938_INTB_RTC 4
53#define RBTX4938_INTB_ATA 5
54#define RBTX4938_INTB_MODEM 6
55#define RBTX4938_INTB_SWINT 7
56#define RBTX4938_INTF_PCID (1 << RBTX4938_INTB_PCID)
57#define RBTX4938_INTF_PCIC (1 << RBTX4938_INTB_PCIC)
58#define RBTX4938_INTF_PCIB (1 << RBTX4938_INTB_PCIB)
59#define RBTX4938_INTF_PCIA (1 << RBTX4938_INTB_PCIA)
60#define RBTX4938_INTF_RTC (1 << RBTX4938_INTB_RTC)
61#define RBTX4938_INTF_ATA (1 << RBTX4938_INTB_ATA)
62#define RBTX4938_INTF_MODEM (1 << RBTX4938_INTB_MODEM)
63#define RBTX4938_INTF_SWINT (1 << RBTX4938_INTB_SWINT)
64
65#define rbtx4938_fpga_rev_addr ((__u8 __iomem *)RBTX4938_FPGA_REV_ADDR)
66#define rbtx4938_led_addr ((__u8 __iomem *)RBTX4938_LED_ADDR)
67#define rbtx4938_dipsw_addr ((__u8 __iomem *)RBTX4938_DIPSW_ADDR)
68#define rbtx4938_bdipsw_addr ((__u8 __iomem *)RBTX4938_BDIPSW_ADDR)
69#define rbtx4938_imask_addr ((__u8 __iomem *)RBTX4938_IMASK_ADDR)
70#define rbtx4938_imask2_addr ((__u8 __iomem *)RBTX4938_IMASK2_ADDR)
71#define rbtx4938_intpol_addr ((__u8 __iomem *)RBTX4938_INTPOL_ADDR)
72#define rbtx4938_istat_addr ((__u8 __iomem *)RBTX4938_ISTAT_ADDR)
73#define rbtx4938_istat2_addr ((__u8 __iomem *)RBTX4938_ISTAT2_ADDR)
74#define rbtx4938_imstat_addr ((__u8 __iomem *)RBTX4938_IMSTAT_ADDR)
75#define rbtx4938_imstat2_addr ((__u8 __iomem *)RBTX4938_IMSTAT2_ADDR)
76#define rbtx4938_softint_addr ((__u8 __iomem *)RBTX4938_SOFTINT_ADDR)
77#define rbtx4938_piosel_addr ((__u8 __iomem *)RBTX4938_PIOSEL_ADDR)
78#define rbtx4938_spics_addr ((__u8 __iomem *)RBTX4938_SPICS_ADDR)
79#define rbtx4938_sfpwr_addr ((__u8 __iomem *)RBTX4938_SFPWR_ADDR)
80#define rbtx4938_sfvol_addr ((__u8 __iomem *)RBTX4938_SFVOL_ADDR)
81#define rbtx4938_softreset_addr ((__u8 __iomem *)RBTX4938_SOFTRESET_ADDR)
82#define rbtx4938_softresetlock_addr \
83 ((__u8 __iomem *)RBTX4938_SOFTRESETLOCK_ADDR)
84#define rbtx4938_pcireset_addr ((__u8 __iomem *)RBTX4938_PCIRESET_ADDR)
85
86/*
87 * IRQ mappings
88 */
89
90#define RBTX4938_SOFT_INT0 0 /* not used */
91#define RBTX4938_SOFT_INT1 1 /* not used */
92#define RBTX4938_IRC_INT 2
93#define RBTX4938_TIMER_INT 7
94
95/* These are the virtual IRQ numbers, we divide all IRQ's into
96 * 'spaces', the 'space' determines where and how to enable/disable
97 * that particular IRQ on an RBTX4938 machine. Add new 'spaces' as new
98 * IRQ hardware is supported.
99 */
100#define RBTX4938_NR_IRQ_IOC 8
101
102#define RBTX4938_IRQ_IRC TXX9_IRQ_BASE
103#define RBTX4938_IRQ_IOC (TXX9_IRQ_BASE + TX4938_NUM_IR)
104#define RBTX4938_IRQ_END (RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC)
105
106#define RBTX4938_IRQ_IRC_ECCERR (RBTX4938_IRQ_IRC + TX4938_IR_ECCERR)
107#define RBTX4938_IRQ_IRC_WTOERR (RBTX4938_IRQ_IRC + TX4938_IR_WTOERR)
108#define RBTX4938_IRQ_IRC_INT(n) (RBTX4938_IRQ_IRC + TX4938_IR_INT(n))
109#define RBTX4938_IRQ_IRC_SIO(n) (RBTX4938_IRQ_IRC + TX4938_IR_SIO(n))
110#define RBTX4938_IRQ_IRC_DMA(ch, n) (RBTX4938_IRQ_IRC + TX4938_IR_DMA(ch, n))
111#define RBTX4938_IRQ_IRC_PIO (RBTX4938_IRQ_IRC + TX4938_IR_PIO)
112#define RBTX4938_IRQ_IRC_PDMAC (RBTX4938_IRQ_IRC + TX4938_IR_PDMAC)
113#define RBTX4938_IRQ_IRC_PCIC (RBTX4938_IRQ_IRC + TX4938_IR_PCIC)
114#define RBTX4938_IRQ_IRC_TMR(n) (RBTX4938_IRQ_IRC + TX4938_IR_TMR(n))
115#define RBTX4938_IRQ_IRC_NDFMC (RBTX4938_IRQ_IRC + TX4938_IR_NDFMC)
116#define RBTX4938_IRQ_IRC_PCIERR (RBTX4938_IRQ_IRC + TX4938_IR_PCIERR)
117#define RBTX4938_IRQ_IRC_PCIPME (RBTX4938_IRQ_IRC + TX4938_IR_PCIPME)
118#define RBTX4938_IRQ_IRC_ACLC (RBTX4938_IRQ_IRC + TX4938_IR_ACLC)
119#define RBTX4938_IRQ_IRC_ACLCPME (RBTX4938_IRQ_IRC + TX4938_IR_ACLCPME)
120#define RBTX4938_IRQ_IRC_PCIC1 (RBTX4938_IRQ_IRC + TX4938_IR_PCIC1)
121#define RBTX4938_IRQ_IRC_SPI (RBTX4938_IRQ_IRC + TX4938_IR_SPI)
122#define RBTX4938_IRQ_IOC_PCID (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCID)
123#define RBTX4938_IRQ_IOC_PCIC (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIC)
124#define RBTX4938_IRQ_IOC_PCIB (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIB)
125#define RBTX4938_IRQ_IOC_PCIA (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIA)
126#define RBTX4938_IRQ_IOC_RTC (RBTX4938_IRQ_IOC + RBTX4938_INTB_RTC)
127#define RBTX4938_IRQ_IOC_ATA (RBTX4938_IRQ_IOC + RBTX4938_INTB_ATA)
128#define RBTX4938_IRQ_IOC_MODEM (RBTX4938_IRQ_IOC + RBTX4938_INTB_MODEM)
129#define RBTX4938_IRQ_IOC_SWINT (RBTX4938_IRQ_IOC + RBTX4938_INTB_SWINT)
130
131
132/* IOC (PCI, etc) */
133#define RBTX4938_IRQ_IOCINT (TXX9_IRQ_BASE + TX4938_IR_INT(0))
134/* Onboard 10M Ether */
135#define RBTX4938_IRQ_ETHER (TXX9_IRQ_BASE + TX4938_IR_INT(1))
136
137#define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base)
138#define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER)
139
140void rbtx4938_prom_init(void);
141void rbtx4938_irq_setup(void);
142struct pci_dev;
143int rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
144
145#endif /* __ASM_TXX9_RBTX4938_H */
diff --git a/include/asm-mips/txx9/smsc_fdc37m81x.h b/include/asm-mips/txx9/smsc_fdc37m81x.h
deleted file mode 100644
index 02e161d0755d..000000000000
--- a/include/asm-mips/txx9/smsc_fdc37m81x.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * Interface for smsc fdc48m81x Super IO chip
3 *
4 * Author: MontaVista Software, Inc. source@mvista.com
5 *
6 * 2001-2003 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 * Copyright (C) 2004 MontaVista Software Inc.
12 * Manish Lachwani, mlachwani@mvista.com
13 */
14
15#ifndef _SMSC_FDC37M81X_H_
16#define _SMSC_FDC37M81X_H_
17
18/* Common Registers */
19#define SMSC_FDC37M81X_CONFIG_INDEX 0x00
20#define SMSC_FDC37M81X_CONFIG_DATA 0x01
21#define SMSC_FDC37M81X_CONF 0x02
22#define SMSC_FDC37M81X_INDEX 0x03
23#define SMSC_FDC37M81X_DNUM 0x07
24#define SMSC_FDC37M81X_DID 0x20
25#define SMSC_FDC37M81X_DREV 0x21
26#define SMSC_FDC37M81X_PCNT 0x22
27#define SMSC_FDC37M81X_PMGT 0x23
28#define SMSC_FDC37M81X_OSC 0x24
29#define SMSC_FDC37M81X_CONFPA0 0x26
30#define SMSC_FDC37M81X_CONFPA1 0x27
31#define SMSC_FDC37M81X_TEST4 0x2B
32#define SMSC_FDC37M81X_TEST5 0x2C
33#define SMSC_FDC37M81X_TEST1 0x2D
34#define SMSC_FDC37M81X_TEST2 0x2E
35#define SMSC_FDC37M81X_TEST3 0x2F
36
37/* Logical device numbers */
38#define SMSC_FDC37M81X_FDD 0x00
39#define SMSC_FDC37M81X_PARALLEL 0x03
40#define SMSC_FDC37M81X_SERIAL1 0x04
41#define SMSC_FDC37M81X_SERIAL2 0x05
42#define SMSC_FDC37M81X_KBD 0x07
43#define SMSC_FDC37M81X_AUXIO 0x08
44#define SMSC_FDC37M81X_NONE 0xff
45
46/* Logical device Config Registers */
47#define SMSC_FDC37M81X_ACTIVE 0x30
48#define SMSC_FDC37M81X_BASEADDR0 0x60
49#define SMSC_FDC37M81X_BASEADDR1 0x61
50#define SMSC_FDC37M81X_INT 0x70
51#define SMSC_FDC37M81X_INT2 0x72
52#define SMSC_FDC37M81X_LDCR_F0 0xF0
53
54/* Chip Config Values */
55#define SMSC_FDC37M81X_CONFIG_ENTER 0x55
56#define SMSC_FDC37M81X_CONFIG_EXIT 0xaa
57#define SMSC_FDC37M81X_CHIP_ID 0x4d
58
59unsigned long smsc_fdc37m81x_init(unsigned long port);
60
61void smsc_fdc37m81x_config_beg(void);
62
63void smsc_fdc37m81x_config_end(void);
64
65void smsc_fdc37m81x_config_set(u8 reg, u8 val);
66
67#endif
diff --git a/include/asm-mips/txx9/spi.h b/include/asm-mips/txx9/spi.h
deleted file mode 100644
index ddfb2a0dc432..000000000000
--- a/include/asm-mips/txx9/spi.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Definitions for TX4937/TX4938 SPI
3 *
4 * Copyright (C) 2000-2001 Toshiba Corporation
5 *
6 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
7 * terms of the GNU General Public License version 2. This program is
8 * licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
12 */
13#ifndef __ASM_TXX9_SPI_H
14#define __ASM_TXX9_SPI_H
15
16extern int spi_eeprom_register(int chipid);
17extern int spi_eeprom_read(int chipid, int address, unsigned char *buf, int len);
18
19#endif /* __ASM_TXX9_SPI_H */
diff --git a/include/asm-mips/txx9/tx3927.h b/include/asm-mips/txx9/tx3927.h
deleted file mode 100644
index 587deb9592d2..000000000000
--- a/include/asm-mips/txx9/tx3927.h
+++ /dev/null
@@ -1,339 +0,0 @@
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 * Copyright (C) 2000 Toshiba Corporation
7 */
8#ifndef __ASM_TXX9_TX3927_H
9#define __ASM_TXX9_TX3927_H
10
11#define TX3927_REG_BASE 0xfffe0000UL
12#define TX3927_REG_SIZE 0x00010000
13#define TX3927_SDRAMC_REG (TX3927_REG_BASE + 0x8000)
14#define TX3927_ROMC_REG (TX3927_REG_BASE + 0x9000)
15#define TX3927_DMA_REG (TX3927_REG_BASE + 0xb000)
16#define TX3927_IRC_REG (TX3927_REG_BASE + 0xc000)
17#define TX3927_PCIC_REG (TX3927_REG_BASE + 0xd000)
18#define TX3927_CCFG_REG (TX3927_REG_BASE + 0xe000)
19#define TX3927_NR_TMR 3
20#define TX3927_TMR_REG(ch) (TX3927_REG_BASE + 0xf000 + (ch) * 0x100)
21#define TX3927_NR_SIO 2
22#define TX3927_SIO_REG(ch) (TX3927_REG_BASE + 0xf300 + (ch) * 0x100)
23#define TX3927_PIO_REG (TX3927_REG_BASE + 0xf500)
24
25struct tx3927_sdramc_reg {
26 volatile unsigned long cr[8];
27 volatile unsigned long tr[3];
28 volatile unsigned long cmd;
29 volatile unsigned long smrs[2];
30};
31
32struct tx3927_romc_reg {
33 volatile unsigned long cr[8];
34};
35
36struct tx3927_dma_reg {
37 struct tx3927_dma_ch_reg {
38 volatile unsigned long cha;
39 volatile unsigned long sar;
40 volatile unsigned long dar;
41 volatile unsigned long cntr;
42 volatile unsigned long sair;
43 volatile unsigned long dair;
44 volatile unsigned long ccr;
45 volatile unsigned long csr;
46 } ch[4];
47 volatile unsigned long dbr[8];
48 volatile unsigned long tdhr;
49 volatile unsigned long mcr;
50 volatile unsigned long unused0;
51};
52
53#include <asm/byteorder.h>
54
55#ifdef __BIG_ENDIAN
56#define endian_def_s2(e1, e2) \
57 volatile unsigned short e1, e2
58#define endian_def_sb2(e1, e2, e3) \
59 volatile unsigned short e1;volatile unsigned char e2, e3
60#define endian_def_b2s(e1, e2, e3) \
61 volatile unsigned char e1, e2;volatile unsigned short e3
62#define endian_def_b4(e1, e2, e3, e4) \
63 volatile unsigned char e1, e2, e3, e4
64#else
65#define endian_def_s2(e1, e2) \
66 volatile unsigned short e2, e1
67#define endian_def_sb2(e1, e2, e3) \
68 volatile unsigned char e3, e2;volatile unsigned short e1
69#define endian_def_b2s(e1, e2, e3) \
70 volatile unsigned short e3;volatile unsigned char e2, e1
71#define endian_def_b4(e1, e2, e3, e4) \
72 volatile unsigned char e4, e3, e2, e1
73#endif
74
75struct tx3927_pcic_reg {
76 endian_def_s2(did, vid);
77 endian_def_s2(pcistat, pcicmd);
78 endian_def_b4(cc, scc, rpli, rid);
79 endian_def_b4(unused0, ht, mlt, cls);
80 volatile unsigned long ioba; /* +10 */
81 volatile unsigned long mba;
82 volatile unsigned long unused1[5];
83 endian_def_s2(svid, ssvid);
84 volatile unsigned long unused2; /* +30 */
85 endian_def_sb2(unused3, unused4, capptr);
86 volatile unsigned long unused5;
87 endian_def_b4(ml, mg, ip, il);
88 volatile unsigned long unused6; /* +40 */
89 volatile unsigned long istat;
90 volatile unsigned long iim;
91 volatile unsigned long rrt;
92 volatile unsigned long unused7[3]; /* +50 */
93 volatile unsigned long ipbmma;
94 volatile unsigned long ipbioma; /* +60 */
95 volatile unsigned long ilbmma;
96 volatile unsigned long ilbioma;
97 volatile unsigned long unused8[9];
98 volatile unsigned long tc; /* +90 */
99 volatile unsigned long tstat;
100 volatile unsigned long tim;
101 volatile unsigned long tccmd;
102 volatile unsigned long pcirrt; /* +a0 */
103 volatile unsigned long pcirrt_cmd;
104 volatile unsigned long pcirrdt;
105 volatile unsigned long unused9[3];
106 volatile unsigned long tlboap;
107 volatile unsigned long tlbiap;
108 volatile unsigned long tlbmma; /* +c0 */
109 volatile unsigned long tlbioma;
110 volatile unsigned long sc_msg;
111 volatile unsigned long sc_be;
112 volatile unsigned long tbl; /* +d0 */
113 volatile unsigned long unused10[3];
114 volatile unsigned long pwmng; /* +e0 */
115 volatile unsigned long pwmngs;
116 volatile unsigned long unused11[6];
117 volatile unsigned long req_trace; /* +100 */
118 volatile unsigned long pbapmc;
119 volatile unsigned long pbapms;
120 volatile unsigned long pbapmim;
121 volatile unsigned long bm; /* +110 */
122 volatile unsigned long cpcibrs;
123 volatile unsigned long cpcibgs;
124 volatile unsigned long pbacs;
125 volatile unsigned long iobas; /* +120 */
126 volatile unsigned long mbas;
127 volatile unsigned long lbc;
128 volatile unsigned long lbstat;
129 volatile unsigned long lbim; /* +130 */
130 volatile unsigned long pcistatim;
131 volatile unsigned long ica;
132 volatile unsigned long icd;
133 volatile unsigned long iiadp; /* +140 */
134 volatile unsigned long iscdp;
135 volatile unsigned long mmas;
136 volatile unsigned long iomas;
137 volatile unsigned long ipciaddr; /* +150 */
138 volatile unsigned long ipcidata;
139 volatile unsigned long ipcibe;
140};
141
142struct tx3927_ccfg_reg {
143 volatile unsigned long ccfg;
144 volatile unsigned long crir;
145 volatile unsigned long pcfg;
146 volatile unsigned long tear;
147 volatile unsigned long pdcr;
148};
149
150/*
151 * SDRAMC
152 */
153
154/*
155 * ROMC
156 */
157
158/*
159 * DMA
160 */
161/* bits for MCR */
162#define TX3927_DMA_MCR_EIS(ch) (0x10000000<<(ch))
163#define TX3927_DMA_MCR_DIS(ch) (0x01000000<<(ch))
164#define TX3927_DMA_MCR_RSFIF 0x00000080
165#define TX3927_DMA_MCR_FIFUM(ch) (0x00000008<<(ch))
166#define TX3927_DMA_MCR_LE 0x00000004
167#define TX3927_DMA_MCR_RPRT 0x00000002
168#define TX3927_DMA_MCR_MSTEN 0x00000001
169
170/* bits for CCRn */
171#define TX3927_DMA_CCR_DBINH 0x04000000
172#define TX3927_DMA_CCR_SBINH 0x02000000
173#define TX3927_DMA_CCR_CHRST 0x01000000
174#define TX3927_DMA_CCR_RVBYTE 0x00800000
175#define TX3927_DMA_CCR_ACKPOL 0x00400000
176#define TX3927_DMA_CCR_REQPL 0x00200000
177#define TX3927_DMA_CCR_EGREQ 0x00100000
178#define TX3927_DMA_CCR_CHDN 0x00080000
179#define TX3927_DMA_CCR_DNCTL 0x00060000
180#define TX3927_DMA_CCR_EXTRQ 0x00010000
181#define TX3927_DMA_CCR_INTRQD 0x0000e000
182#define TX3927_DMA_CCR_INTENE 0x00001000
183#define TX3927_DMA_CCR_INTENC 0x00000800
184#define TX3927_DMA_CCR_INTENT 0x00000400
185#define TX3927_DMA_CCR_CHNEN 0x00000200
186#define TX3927_DMA_CCR_XFACT 0x00000100
187#define TX3927_DMA_CCR_SNOP 0x00000080
188#define TX3927_DMA_CCR_DSTINC 0x00000040
189#define TX3927_DMA_CCR_SRCINC 0x00000020
190#define TX3927_DMA_CCR_XFSZ(order) (((order) << 2) & 0x0000001c)
191#define TX3927_DMA_CCR_XFSZ_1W TX3927_DMA_CCR_XFSZ(2)
192#define TX3927_DMA_CCR_XFSZ_4W TX3927_DMA_CCR_XFSZ(4)
193#define TX3927_DMA_CCR_XFSZ_8W TX3927_DMA_CCR_XFSZ(5)
194#define TX3927_DMA_CCR_XFSZ_16W TX3927_DMA_CCR_XFSZ(6)
195#define TX3927_DMA_CCR_XFSZ_32W TX3927_DMA_CCR_XFSZ(7)
196#define TX3927_DMA_CCR_MEMIO 0x00000002
197#define TX3927_DMA_CCR_ONEAD 0x00000001
198
199/* bits for CSRn */
200#define TX3927_DMA_CSR_CHNACT 0x00000100
201#define TX3927_DMA_CSR_ABCHC 0x00000080
202#define TX3927_DMA_CSR_NCHNC 0x00000040
203#define TX3927_DMA_CSR_NTRNFC 0x00000020
204#define TX3927_DMA_CSR_EXTDN 0x00000010
205#define TX3927_DMA_CSR_CFERR 0x00000008
206#define TX3927_DMA_CSR_CHERR 0x00000004
207#define TX3927_DMA_CSR_DESERR 0x00000002
208#define TX3927_DMA_CSR_SORERR 0x00000001
209
210/*
211 * IRC
212 */
213#define TX3927_IR_INT0 0
214#define TX3927_IR_INT1 1
215#define TX3927_IR_INT2 2
216#define TX3927_IR_INT3 3
217#define TX3927_IR_INT4 4
218#define TX3927_IR_INT5 5
219#define TX3927_IR_SIO0 6
220#define TX3927_IR_SIO1 7
221#define TX3927_IR_SIO(ch) (6 + (ch))
222#define TX3927_IR_DMA 8
223#define TX3927_IR_PIO 9
224#define TX3927_IR_PCI 10
225#define TX3927_IR_TMR(ch) (13 + (ch))
226#define TX3927_NUM_IR 16
227
228/*
229 * PCIC
230 */
231/* bits for PCICMD */
232/* see PCI_COMMAND_XXX in linux/pci.h */
233
234/* bits for PCISTAT */
235/* see PCI_STATUS_XXX in linux/pci.h */
236#define PCI_STATUS_NEW_CAP 0x0010
237
238/* bits for ISTAT/IIM */
239#define TX3927_PCIC_IIM_ALL 0x00001600
240
241/* bits for TC */
242#define TX3927_PCIC_TC_OF16E 0x00000020
243#define TX3927_PCIC_TC_IF8E 0x00000010
244#define TX3927_PCIC_TC_OF8E 0x00000008
245
246/* bits for TSTAT/TIM */
247#define TX3927_PCIC_TIM_ALL 0x0003ffff
248
249/* bits for IOBA/MBA */
250/* see PCI_BASE_ADDRESS_XXX in linux/pci.h */
251
252/* bits for PBAPMC */
253#define TX3927_PCIC_PBAPMC_RPBA 0x00000004
254#define TX3927_PCIC_PBAPMC_PBAEN 0x00000002
255#define TX3927_PCIC_PBAPMC_BMCEN 0x00000001
256
257/* bits for LBSTAT/LBIM */
258#define TX3927_PCIC_LBIM_ALL 0x0000003e
259
260/* bits for PCISTATIM (see also PCI_STATUS_XXX in linux/pci.h */
261#define TX3927_PCIC_PCISTATIM_ALL 0x0000f900
262
263/* bits for LBC */
264#define TX3927_PCIC_LBC_IBSE 0x00004000
265#define TX3927_PCIC_LBC_TIBSE 0x00002000
266#define TX3927_PCIC_LBC_TMFBSE 0x00001000
267#define TX3927_PCIC_LBC_HRST 0x00000800
268#define TX3927_PCIC_LBC_SRST 0x00000400
269#define TX3927_PCIC_LBC_EPCAD 0x00000200
270#define TX3927_PCIC_LBC_MSDSE 0x00000100
271#define TX3927_PCIC_LBC_CRR 0x00000080
272#define TX3927_PCIC_LBC_ILMDE 0x00000040
273#define TX3927_PCIC_LBC_ILIDE 0x00000020
274
275#define TX3927_PCIC_IDSEL_AD_TO_SLOT(ad) ((ad) - 11)
276#define TX3927_PCIC_MAX_DEVNU TX3927_PCIC_IDSEL_AD_TO_SLOT(32)
277
278/*
279 * CCFG
280 */
281/* CCFG : Chip Configuration */
282#define TX3927_CCFG_TLBOFF 0x00020000
283#define TX3927_CCFG_BEOW 0x00010000
284#define TX3927_CCFG_WR 0x00008000
285#define TX3927_CCFG_TOE 0x00004000
286#define TX3927_CCFG_PCIXARB 0x00002000
287#define TX3927_CCFG_PCI3 0x00001000
288#define TX3927_CCFG_PSNP 0x00000800
289#define TX3927_CCFG_PPRI 0x00000400
290#define TX3927_CCFG_PLLM 0x00000030
291#define TX3927_CCFG_ENDIAN 0x00000004
292#define TX3927_CCFG_HALT 0x00000002
293#define TX3927_CCFG_ACEHOLD 0x00000001
294
295/* PCFG : Pin Configuration */
296#define TX3927_PCFG_SYSCLKEN 0x08000000
297#define TX3927_PCFG_SDRCLKEN_ALL 0x07c00000
298#define TX3927_PCFG_SDRCLKEN(ch) (0x00400000<<(ch))
299#define TX3927_PCFG_PCICLKEN_ALL 0x003c0000
300#define TX3927_PCFG_PCICLKEN(ch) (0x00040000<<(ch))
301#define TX3927_PCFG_SELALL 0x0003ffff
302#define TX3927_PCFG_SELCS 0x00020000
303#define TX3927_PCFG_SELDSF 0x00010000
304#define TX3927_PCFG_SELSIOC_ALL 0x0000c000
305#define TX3927_PCFG_SELSIOC(ch) (0x00004000<<(ch))
306#define TX3927_PCFG_SELSIO_ALL 0x00003000
307#define TX3927_PCFG_SELSIO(ch) (0x00001000<<(ch))
308#define TX3927_PCFG_SELTMR_ALL 0x00000e00
309#define TX3927_PCFG_SELTMR(ch) (0x00000200<<(ch))
310#define TX3927_PCFG_SELDONE 0x00000100
311#define TX3927_PCFG_INTDMA_ALL 0x000000f0
312#define TX3927_PCFG_INTDMA(ch) (0x00000010<<(ch))
313#define TX3927_PCFG_SELDMA_ALL 0x0000000f
314#define TX3927_PCFG_SELDMA(ch) (0x00000001<<(ch))
315
316#define tx3927_sdramcptr ((struct tx3927_sdramc_reg *)TX3927_SDRAMC_REG)
317#define tx3927_romcptr ((struct tx3927_romc_reg *)TX3927_ROMC_REG)
318#define tx3927_dmaptr ((struct tx3927_dma_reg *)TX3927_DMA_REG)
319#define tx3927_pcicptr ((struct tx3927_pcic_reg *)TX3927_PCIC_REG)
320#define tx3927_ccfgptr ((struct tx3927_ccfg_reg *)TX3927_CCFG_REG)
321#define tx3927_sioptr(ch) ((struct txx927_sio_reg *)TX3927_SIO_REG(ch))
322#define tx3927_pioptr ((struct txx9_pio_reg __iomem *)TX3927_PIO_REG)
323
324#define TX3927_REV_PCODE() (tx3927_ccfgptr->crir >> 16)
325#define TX3927_ROMC_BA(ch) (tx3927_romcptr->cr[(ch)] & 0xfff00000)
326#define TX3927_ROMC_SIZE(ch) \
327 (0x00100000 << ((tx3927_romcptr->cr[(ch)] >> 8) & 0xf))
328
329void tx3927_wdt_init(void);
330void tx3927_setup(void);
331void tx3927_time_init(unsigned int evt_tmrnr, unsigned int src_tmrnr);
332void tx3927_sio_init(unsigned int sclk, unsigned int cts_mask);
333struct pci_controller;
334void tx3927_pcic_setup(struct pci_controller *channel,
335 unsigned long sdram_size, int extarb);
336void tx3927_setup_pcierr_irq(void);
337void tx3927_irq_init(void);
338
339#endif /* __ASM_TXX9_TX3927_H */
diff --git a/include/asm-mips/txx9/tx4927.h b/include/asm-mips/txx9/tx4927.h
deleted file mode 100644
index 195f6515db9a..000000000000
--- a/include/asm-mips/txx9/tx4927.h
+++ /dev/null
@@ -1,255 +0,0 @@
1/*
2 * Author: MontaVista Software, Inc.
3 * source@mvista.com
4 *
5 * Copyright 2001-2006 MontaVista Software Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
15 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27#ifndef __ASM_TXX9_TX4927_H
28#define __ASM_TXX9_TX4927_H
29
30#include <linux/types.h>
31#include <linux/io.h>
32#include <asm/txx9irq.h>
33#include <asm/txx9/tx4927pcic.h>
34
35#ifdef CONFIG_64BIT
36#define TX4927_REG_BASE 0xffffffffff1f0000UL
37#else
38#define TX4927_REG_BASE 0xff1f0000UL
39#endif
40#define TX4927_REG_SIZE 0x00010000
41
42#define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000)
43#define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000)
44#define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000)
45#define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000)
46#define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600)
47#define TX4927_NR_TMR 3
48#define TX4927_TMR_REG(ch) (TX4927_REG_BASE + 0xf000 + (ch) * 0x100)
49#define TX4927_NR_SIO 2
50#define TX4927_SIO_REG(ch) (TX4927_REG_BASE + 0xf300 + (ch) * 0x100)
51#define TX4927_PIO_REG (TX4927_REG_BASE + 0xf500)
52
53#define TX4927_IR_INT(n) (2 + (n))
54#define TX4927_IR_SIO(n) (8 + (n))
55#define TX4927_IR_PCIC 16
56#define TX4927_NUM_IR_TMR 3
57#define TX4927_IR_TMR(n) (17 + (n))
58#define TX4927_IR_PCIERR 22
59#define TX4927_NUM_IR 32
60
61#define TX4927_IRC_INT 2 /* IP[2] in Status register */
62
63#define TX4927_NUM_PIO 16
64
65struct tx4927_sdramc_reg {
66 u64 cr[4];
67 u64 unused0[4];
68 u64 tr;
69 u64 unused1[2];
70 u64 cmd;
71};
72
73struct tx4927_ebusc_reg {
74 u64 cr[8];
75};
76
77struct tx4927_ccfg_reg {
78 u64 ccfg;
79 u64 crir;
80 u64 pcfg;
81 u64 toea;
82 u64 clkctr;
83 u64 unused0;
84 u64 garbc;
85 u64 unused1;
86 u64 unused2;
87 u64 ramp;
88};
89
90/*
91 * CCFG
92 */
93/* CCFG : Chip Configuration */
94#define TX4927_CCFG_WDRST 0x0000020000000000ULL
95#define TX4927_CCFG_WDREXEN 0x0000010000000000ULL
96#define TX4927_CCFG_BCFG_MASK 0x000000ff00000000ULL
97#define TX4927_CCFG_TINTDIS 0x01000000
98#define TX4927_CCFG_PCI66 0x00800000
99#define TX4927_CCFG_PCIMODE 0x00400000
100#define TX4927_CCFG_DIVMODE_MASK 0x000e0000
101#define TX4927_CCFG_DIVMODE_8 (0x0 << 17)
102#define TX4927_CCFG_DIVMODE_12 (0x1 << 17)
103#define TX4927_CCFG_DIVMODE_16 (0x2 << 17)
104#define TX4927_CCFG_DIVMODE_10 (0x3 << 17)
105#define TX4927_CCFG_DIVMODE_2 (0x4 << 17)
106#define TX4927_CCFG_DIVMODE_3 (0x5 << 17)
107#define TX4927_CCFG_DIVMODE_4 (0x6 << 17)
108#define TX4927_CCFG_DIVMODE_2_5 (0x7 << 17)
109#define TX4927_CCFG_BEOW 0x00010000
110#define TX4927_CCFG_WR 0x00008000
111#define TX4927_CCFG_TOE 0x00004000
112#define TX4927_CCFG_PCIARB 0x00002000
113#define TX4927_CCFG_PCIDIVMODE_MASK 0x00001800
114#define TX4927_CCFG_PCIDIVMODE_2_5 0x00000000
115#define TX4927_CCFG_PCIDIVMODE_3 0x00000800
116#define TX4927_CCFG_PCIDIVMODE_5 0x00001000
117#define TX4927_CCFG_PCIDIVMODE_6 0x00001800
118#define TX4927_CCFG_SYSSP_MASK 0x000000c0
119#define TX4927_CCFG_ENDIAN 0x00000004
120#define TX4927_CCFG_HALT 0x00000002
121#define TX4927_CCFG_ACEHOLD 0x00000001
122#define TX4927_CCFG_W1CBITS (TX4927_CCFG_WDRST | TX4927_CCFG_BEOW)
123
124/* PCFG : Pin Configuration */
125#define TX4927_PCFG_SDCLKDLY_MASK 0x30000000
126#define TX4927_PCFG_SDCLKDLY(d) ((d)<<28)
127#define TX4927_PCFG_SYSCLKEN 0x08000000
128#define TX4927_PCFG_SDCLKEN_ALL 0x07800000
129#define TX4927_PCFG_SDCLKEN(ch) (0x00800000<<(ch))
130#define TX4927_PCFG_PCICLKEN_ALL 0x003f0000
131#define TX4927_PCFG_PCICLKEN(ch) (0x00010000<<(ch))
132#define TX4927_PCFG_SEL2 0x00000200
133#define TX4927_PCFG_SEL1 0x00000100
134#define TX4927_PCFG_DMASEL_ALL 0x000000ff
135#define TX4927_PCFG_DMASEL0_MASK 0x00000003
136#define TX4927_PCFG_DMASEL1_MASK 0x0000000c
137#define TX4927_PCFG_DMASEL2_MASK 0x00000030
138#define TX4927_PCFG_DMASEL3_MASK 0x000000c0
139#define TX4927_PCFG_DMASEL0_DRQ0 0x00000000
140#define TX4927_PCFG_DMASEL0_SIO1 0x00000001
141#define TX4927_PCFG_DMASEL0_ACL0 0x00000002
142#define TX4927_PCFG_DMASEL0_ACL2 0x00000003
143#define TX4927_PCFG_DMASEL1_DRQ1 0x00000000
144#define TX4927_PCFG_DMASEL1_SIO1 0x00000004
145#define TX4927_PCFG_DMASEL1_ACL1 0x00000008
146#define TX4927_PCFG_DMASEL1_ACL3 0x0000000c
147#define TX4927_PCFG_DMASEL2_DRQ2 0x00000000 /* SEL2=0 */
148#define TX4927_PCFG_DMASEL2_SIO0 0x00000010 /* SEL2=0 */
149#define TX4927_PCFG_DMASEL2_ACL1 0x00000000 /* SEL2=1 */
150#define TX4927_PCFG_DMASEL2_ACL2 0x00000020 /* SEL2=1 */
151#define TX4927_PCFG_DMASEL2_ACL0 0x00000030 /* SEL2=1 */
152#define TX4927_PCFG_DMASEL3_DRQ3 0x00000000
153#define TX4927_PCFG_DMASEL3_SIO0 0x00000040
154#define TX4927_PCFG_DMASEL3_ACL3 0x00000080
155#define TX4927_PCFG_DMASEL3_ACL1 0x000000c0
156
157/* CLKCTR : Clock Control */
158#define TX4927_CLKCTR_ACLCKD 0x02000000
159#define TX4927_CLKCTR_PIOCKD 0x01000000
160#define TX4927_CLKCTR_DMACKD 0x00800000
161#define TX4927_CLKCTR_PCICKD 0x00400000
162#define TX4927_CLKCTR_TM0CKD 0x00100000
163#define TX4927_CLKCTR_TM1CKD 0x00080000
164#define TX4927_CLKCTR_TM2CKD 0x00040000
165#define TX4927_CLKCTR_SIO0CKD 0x00020000
166#define TX4927_CLKCTR_SIO1CKD 0x00010000
167#define TX4927_CLKCTR_ACLRST 0x00000200
168#define TX4927_CLKCTR_PIORST 0x00000100
169#define TX4927_CLKCTR_DMARST 0x00000080
170#define TX4927_CLKCTR_PCIRST 0x00000040
171#define TX4927_CLKCTR_TM0RST 0x00000010
172#define TX4927_CLKCTR_TM1RST 0x00000008
173#define TX4927_CLKCTR_TM2RST 0x00000004
174#define TX4927_CLKCTR_SIO0RST 0x00000002
175#define TX4927_CLKCTR_SIO1RST 0x00000001
176
177#define tx4927_sdramcptr \
178 ((struct tx4927_sdramc_reg __iomem *)TX4927_SDRAMC_REG)
179#define tx4927_pcicptr \
180 ((struct tx4927_pcic_reg __iomem *)TX4927_PCIC_REG)
181#define tx4927_ccfgptr \
182 ((struct tx4927_ccfg_reg __iomem *)TX4927_CCFG_REG)
183#define tx4927_ebuscptr \
184 ((struct tx4927_ebusc_reg __iomem *)TX4927_EBUSC_REG)
185#define tx4927_pioptr ((struct txx9_pio_reg __iomem *)TX4927_PIO_REG)
186
187#define TX4927_REV_PCODE() \
188 ((__u32)__raw_readq(&tx4927_ccfgptr->crir) >> 16)
189
190#define TX4927_SDRAMC_CR(ch) __raw_readq(&tx4927_sdramcptr->cr[(ch)])
191#define TX4927_SDRAMC_BA(ch) ((TX4927_SDRAMC_CR(ch) >> 49) << 21)
192#define TX4927_SDRAMC_SIZE(ch) \
193 ((((TX4927_SDRAMC_CR(ch) >> 33) & 0x7fff) + 1) << 21)
194
195#define TX4927_EBUSC_CR(ch) __raw_readq(&tx4927_ebuscptr->cr[(ch)])
196#define TX4927_EBUSC_BA(ch) ((TX4927_EBUSC_CR(ch) >> 48) << 20)
197#define TX4927_EBUSC_SIZE(ch) \
198 (0x00100000 << ((unsigned long)(TX4927_EBUSC_CR(ch) >> 8) & 0xf))
199
200/* utilities */
201static inline void txx9_clear64(__u64 __iomem *adr, __u64 bits)
202{
203#ifdef CONFIG_32BIT
204 unsigned long flags;
205 local_irq_save(flags);
206#endif
207 ____raw_writeq(____raw_readq(adr) & ~bits, adr);
208#ifdef CONFIG_32BIT
209 local_irq_restore(flags);
210#endif
211}
212static inline void txx9_set64(__u64 __iomem *adr, __u64 bits)
213{
214#ifdef CONFIG_32BIT
215 unsigned long flags;
216 local_irq_save(flags);
217#endif
218 ____raw_writeq(____raw_readq(adr) | bits, adr);
219#ifdef CONFIG_32BIT
220 local_irq_restore(flags);
221#endif
222}
223
224/* These functions are not interrupt safe. */
225static inline void tx4927_ccfg_clear(__u64 bits)
226{
227 ____raw_writeq(____raw_readq(&tx4927_ccfgptr->ccfg)
228 & ~(TX4927_CCFG_W1CBITS | bits),
229 &tx4927_ccfgptr->ccfg);
230}
231static inline void tx4927_ccfg_set(__u64 bits)
232{
233 ____raw_writeq((____raw_readq(&tx4927_ccfgptr->ccfg)
234 & ~TX4927_CCFG_W1CBITS) | bits,
235 &tx4927_ccfgptr->ccfg);
236}
237static inline void tx4927_ccfg_change(__u64 change, __u64 new)
238{
239 ____raw_writeq((____raw_readq(&tx4927_ccfgptr->ccfg)
240 & ~(TX4927_CCFG_W1CBITS | change)) |
241 new,
242 &tx4927_ccfgptr->ccfg);
243}
244
245unsigned int tx4927_get_mem_size(void);
246void tx4927_wdt_init(void);
247void tx4927_setup(void);
248void tx4927_time_init(unsigned int tmrnr);
249void tx4927_sio_init(unsigned int sclk, unsigned int cts_mask);
250int tx4927_report_pciclk(void);
251int tx4927_pciclk66_setup(void);
252void tx4927_setup_pcierr_irq(void);
253void tx4927_irq_init(void);
254
255#endif /* __ASM_TXX9_TX4927_H */
diff --git a/include/asm-mips/txx9/tx4927pcic.h b/include/asm-mips/txx9/tx4927pcic.h
deleted file mode 100644
index c470b8a5fe57..000000000000
--- a/include/asm-mips/txx9/tx4927pcic.h
+++ /dev/null
@@ -1,203 +0,0 @@
1/*
2 * include/asm-mips/txx9/tx4927pcic.h
3 * TX4927 PCI controller definitions.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9#ifndef __ASM_TXX9_TX4927PCIC_H
10#define __ASM_TXX9_TX4927PCIC_H
11
12#include <linux/pci.h>
13#include <linux/irqreturn.h>
14
15struct tx4927_pcic_reg {
16 u32 pciid;
17 u32 pcistatus;
18 u32 pciccrev;
19 u32 pcicfg1;
20 u32 p2gm0plbase; /* +10 */
21 u32 p2gm0pubase;
22 u32 p2gm1plbase;
23 u32 p2gm1pubase;
24 u32 p2gm2pbase; /* +20 */
25 u32 p2giopbase;
26 u32 unused0;
27 u32 pcisid;
28 u32 unused1; /* +30 */
29 u32 pcicapptr;
30 u32 unused2;
31 u32 pcicfg2;
32 u32 g2ptocnt; /* +40 */
33 u32 unused3[15];
34 u32 g2pstatus; /* +80 */
35 u32 g2pmask;
36 u32 pcisstatus;
37 u32 pcimask;
38 u32 p2gcfg; /* +90 */
39 u32 p2gstatus;
40 u32 p2gmask;
41 u32 p2gccmd;
42 u32 unused4[24]; /* +a0 */
43 u32 pbareqport; /* +100 */
44 u32 pbacfg;
45 u32 pbastatus;
46 u32 pbamask;
47 u32 pbabm; /* +110 */
48 u32 pbacreq;
49 u32 pbacgnt;
50 u32 pbacstate;
51 u64 g2pmgbase[3]; /* +120 */
52 u64 g2piogbase;
53 u32 g2pmmask[3]; /* +140 */
54 u32 g2piomask;
55 u64 g2pmpbase[3]; /* +150 */
56 u64 g2piopbase;
57 u32 pciccfg; /* +170 */
58 u32 pcicstatus;
59 u32 pcicmask;
60 u32 unused5;
61 u64 p2gmgbase[3]; /* +180 */
62 u64 p2giogbase;
63 u32 g2pcfgadrs; /* +1a0 */
64 u32 g2pcfgdata;
65 u32 unused6[8];
66 u32 g2pintack;
67 u32 g2pspc;
68 u32 unused7[12]; /* +1d0 */
69 u64 pdmca; /* +200 */
70 u64 pdmga;
71 u64 pdmpa;
72 u64 pdmctr;
73 u64 pdmcfg; /* +220 */
74 u64 pdmsts;
75};
76
77/* bits for PCICMD */
78/* see PCI_COMMAND_XXX in linux/pci_regs.h */
79
80/* bits for PCISTAT */
81/* see PCI_STATUS_XXX in linux/pci_regs.h */
82
83/* bits for IOBA/MBA */
84/* see PCI_BASE_ADDRESS_XXX in linux/pci_regs.h */
85
86/* bits for G2PSTATUS/G2PMASK */
87#define TX4927_PCIC_G2PSTATUS_ALL 0x00000003
88#define TX4927_PCIC_G2PSTATUS_TTOE 0x00000002
89#define TX4927_PCIC_G2PSTATUS_RTOE 0x00000001
90
91/* bits for PCIMASK (see also PCI_STATUS_XXX in linux/pci_regs.h */
92#define TX4927_PCIC_PCISTATUS_ALL 0x0000f900
93
94/* bits for PBACFG */
95#define TX4927_PCIC_PBACFG_FIXPA 0x00000008
96#define TX4927_PCIC_PBACFG_RPBA 0x00000004
97#define TX4927_PCIC_PBACFG_PBAEN 0x00000002
98#define TX4927_PCIC_PBACFG_BMCEN 0x00000001
99
100/* bits for PBASTATUS/PBAMASK */
101#define TX4927_PCIC_PBASTATUS_ALL 0x00000001
102#define TX4927_PCIC_PBASTATUS_BM 0x00000001
103
104/* bits for G2PMnGBASE */
105#define TX4927_PCIC_G2PMnGBASE_BSDIS 0x0000002000000000ULL
106#define TX4927_PCIC_G2PMnGBASE_ECHG 0x0000001000000000ULL
107
108/* bits for G2PIOGBASE */
109#define TX4927_PCIC_G2PIOGBASE_BSDIS 0x0000002000000000ULL
110#define TX4927_PCIC_G2PIOGBASE_ECHG 0x0000001000000000ULL
111
112/* bits for PCICSTATUS/PCICMASK */
113#define TX4927_PCIC_PCICSTATUS_ALL 0x000007b8
114#define TX4927_PCIC_PCICSTATUS_PME 0x00000400
115#define TX4927_PCIC_PCICSTATUS_TLB 0x00000200
116#define TX4927_PCIC_PCICSTATUS_NIB 0x00000100
117#define TX4927_PCIC_PCICSTATUS_ZIB 0x00000080
118#define TX4927_PCIC_PCICSTATUS_PERR 0x00000020
119#define TX4927_PCIC_PCICSTATUS_SERR 0x00000010
120#define TX4927_PCIC_PCICSTATUS_GBE 0x00000008
121#define TX4927_PCIC_PCICSTATUS_IWB 0x00000002
122#define TX4927_PCIC_PCICSTATUS_E2PDONE 0x00000001
123
124/* bits for PCICCFG */
125#define TX4927_PCIC_PCICCFG_GBWC_MASK 0x0fff0000
126#define TX4927_PCIC_PCICCFG_HRST 0x00000800
127#define TX4927_PCIC_PCICCFG_SRST 0x00000400
128#define TX4927_PCIC_PCICCFG_IRBER 0x00000200
129#define TX4927_PCIC_PCICCFG_G2PMEN(ch) (0x00000100>>(ch))
130#define TX4927_PCIC_PCICCFG_G2PM0EN 0x00000100
131#define TX4927_PCIC_PCICCFG_G2PM1EN 0x00000080
132#define TX4927_PCIC_PCICCFG_G2PM2EN 0x00000040
133#define TX4927_PCIC_PCICCFG_G2PIOEN 0x00000020
134#define TX4927_PCIC_PCICCFG_TCAR 0x00000010
135#define TX4927_PCIC_PCICCFG_ICAEN 0x00000008
136
137/* bits for P2GMnGBASE */
138#define TX4927_PCIC_P2GMnGBASE_TMEMEN 0x0000004000000000ULL
139#define TX4927_PCIC_P2GMnGBASE_TBSDIS 0x0000002000000000ULL
140#define TX4927_PCIC_P2GMnGBASE_TECHG 0x0000001000000000ULL
141
142/* bits for P2GIOGBASE */
143#define TX4927_PCIC_P2GIOGBASE_TIOEN 0x0000004000000000ULL
144#define TX4927_PCIC_P2GIOGBASE_TBSDIS 0x0000002000000000ULL
145#define TX4927_PCIC_P2GIOGBASE_TECHG 0x0000001000000000ULL
146
147#define TX4927_PCIC_IDSEL_AD_TO_SLOT(ad) ((ad) - 11)
148#define TX4927_PCIC_MAX_DEVNU TX4927_PCIC_IDSEL_AD_TO_SLOT(32)
149
150/* bits for PDMCFG */
151#define TX4927_PCIC_PDMCFG_RSTFIFO 0x00200000
152#define TX4927_PCIC_PDMCFG_EXFER 0x00100000
153#define TX4927_PCIC_PDMCFG_REQDLY_MASK 0x00003800
154#define TX4927_PCIC_PDMCFG_REQDLY_NONE (0 << 11)
155#define TX4927_PCIC_PDMCFG_REQDLY_16 (1 << 11)
156#define TX4927_PCIC_PDMCFG_REQDLY_32 (2 << 11)
157#define TX4927_PCIC_PDMCFG_REQDLY_64 (3 << 11)
158#define TX4927_PCIC_PDMCFG_REQDLY_128 (4 << 11)
159#define TX4927_PCIC_PDMCFG_REQDLY_256 (5 << 11)
160#define TX4927_PCIC_PDMCFG_REQDLY_512 (6 << 11)
161#define TX4927_PCIC_PDMCFG_REQDLY_1024 (7 << 11)
162#define TX4927_PCIC_PDMCFG_ERRIE 0x00000400
163#define TX4927_PCIC_PDMCFG_NCCMPIE 0x00000200
164#define TX4927_PCIC_PDMCFG_NTCMPIE 0x00000100
165#define TX4927_PCIC_PDMCFG_CHNEN 0x00000080
166#define TX4927_PCIC_PDMCFG_XFRACT 0x00000040
167#define TX4927_PCIC_PDMCFG_BSWAP 0x00000020
168#define TX4927_PCIC_PDMCFG_XFRSIZE_MASK 0x0000000c
169#define TX4927_PCIC_PDMCFG_XFRSIZE_1DW 0x00000000
170#define TX4927_PCIC_PDMCFG_XFRSIZE_1QW 0x00000004
171#define TX4927_PCIC_PDMCFG_XFRSIZE_4QW 0x00000008
172#define TX4927_PCIC_PDMCFG_XFRDIRC 0x00000002
173#define TX4927_PCIC_PDMCFG_CHRST 0x00000001
174
175/* bits for PDMSTS */
176#define TX4927_PCIC_PDMSTS_REQCNT_MASK 0x3f000000
177#define TX4927_PCIC_PDMSTS_FIFOCNT_MASK 0x00f00000
178#define TX4927_PCIC_PDMSTS_FIFOWP_MASK 0x000c0000
179#define TX4927_PCIC_PDMSTS_FIFORP_MASK 0x00030000
180#define TX4927_PCIC_PDMSTS_ERRINT 0x00000800
181#define TX4927_PCIC_PDMSTS_DONEINT 0x00000400
182#define TX4927_PCIC_PDMSTS_CHNEN 0x00000200
183#define TX4927_PCIC_PDMSTS_XFRACT 0x00000100
184#define TX4927_PCIC_PDMSTS_ACCMP 0x00000080
185#define TX4927_PCIC_PDMSTS_NCCMP 0x00000040
186#define TX4927_PCIC_PDMSTS_NTCMP 0x00000020
187#define TX4927_PCIC_PDMSTS_CFGERR 0x00000008
188#define TX4927_PCIC_PDMSTS_PCIERR 0x00000004
189#define TX4927_PCIC_PDMSTS_CHNERR 0x00000002
190#define TX4927_PCIC_PDMSTS_DATAERR 0x00000001
191#define TX4927_PCIC_PDMSTS_ALL_CMP 0x000000e0
192#define TX4927_PCIC_PDMSTS_ALL_ERR 0x0000000f
193
194struct tx4927_pcic_reg __iomem *get_tx4927_pcicptr(
195 struct pci_controller *channel);
196void tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr,
197 struct pci_controller *channel, int extarb);
198void tx4927_report_pcic_status(void);
199char *tx4927_pcibios_setup(char *str);
200void tx4927_dump_pcic_settings(void);
201irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id);
202
203#endif /* __ASM_TXX9_TX4927PCIC_H */
diff --git a/include/asm-mips/txx9/tx4938.h b/include/asm-mips/txx9/tx4938.h
deleted file mode 100644
index 8175d4ccbc39..000000000000
--- a/include/asm-mips/txx9/tx4938.h
+++ /dev/null
@@ -1,293 +0,0 @@
1/*
2 * Definitions for TX4937/TX4938
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#ifndef __ASM_TXX9_TX4938_H
13#define __ASM_TXX9_TX4938_H
14
15/* some controllers are compatible with 4927 */
16#include <asm/txx9/tx4927.h>
17
18#ifdef CONFIG_64BIT
19#define TX4938_REG_BASE 0xffffffffff1f0000UL /* == TX4937_REG_BASE */
20#else
21#define TX4938_REG_BASE 0xff1f0000UL /* == TX4937_REG_BASE */
22#endif
23#define TX4938_REG_SIZE 0x00010000 /* == TX4937_REG_SIZE */
24
25/* NDFMC, SRAMC, PCIC1, SPIC: TX4938 only */
26#define TX4938_NDFMC_REG (TX4938_REG_BASE + 0x5000)
27#define TX4938_SRAMC_REG (TX4938_REG_BASE + 0x6000)
28#define TX4938_PCIC1_REG (TX4938_REG_BASE + 0x7000)
29#define TX4938_SDRAMC_REG (TX4938_REG_BASE + 0x8000)
30#define TX4938_EBUSC_REG (TX4938_REG_BASE + 0x9000)
31#define TX4938_DMA_REG(ch) (TX4938_REG_BASE + 0xb000 + (ch) * 0x800)
32#define TX4938_PCIC_REG (TX4938_REG_BASE + 0xd000)
33#define TX4938_CCFG_REG (TX4938_REG_BASE + 0xe000)
34#define TX4938_NR_TMR 3
35#define TX4938_TMR_REG(ch) ((TX4938_REG_BASE + 0xf000) + (ch) * 0x100)
36#define TX4938_NR_SIO 2
37#define TX4938_SIO_REG(ch) ((TX4938_REG_BASE + 0xf300) + (ch) * 0x100)
38#define TX4938_PIO_REG (TX4938_REG_BASE + 0xf500)
39#define TX4938_IRC_REG (TX4938_REG_BASE + 0xf600)
40#define TX4938_ACLC_REG (TX4938_REG_BASE + 0xf700)
41#define TX4938_SPI_REG (TX4938_REG_BASE + 0xf800)
42
43struct tx4938_sramc_reg {
44 u64 cr;
45};
46
47struct tx4938_ccfg_reg {
48 u64 ccfg;
49 u64 crir;
50 u64 pcfg;
51 u64 toea;
52 u64 clkctr;
53 u64 unused0;
54 u64 garbc;
55 u64 unused1;
56 u64 unused2;
57 u64 ramp;
58 u64 unused3;
59 u64 jmpadr;
60};
61
62/*
63 * IRC
64 */
65
66#define TX4938_IR_ECCERR 0
67#define TX4938_IR_WTOERR 1
68#define TX4938_NUM_IR_INT 6
69#define TX4938_IR_INT(n) (2 + (n))
70#define TX4938_NUM_IR_SIO 2
71#define TX4938_IR_SIO(n) (8 + (n))
72#define TX4938_NUM_IR_DMA 4
73#define TX4938_IR_DMA(ch, n) ((ch ? 27 : 10) + (n)) /* 10-13, 27-30 */
74#define TX4938_IR_PIO 14
75#define TX4938_IR_PDMAC 15
76#define TX4938_IR_PCIC 16
77#define TX4938_NUM_IR_TMR 3
78#define TX4938_IR_TMR(n) (17 + (n))
79#define TX4938_IR_NDFMC 21
80#define TX4938_IR_PCIERR 22
81#define TX4938_IR_PCIPME 23
82#define TX4938_IR_ACLC 24
83#define TX4938_IR_ACLCPME 25
84#define TX4938_IR_PCIC1 26
85#define TX4938_IR_SPI 31
86#define TX4938_NUM_IR 32
87/* multiplex */
88#define TX4938_IR_ETH0 TX4938_IR_INT(4)
89#define TX4938_IR_ETH1 TX4938_IR_INT(3)
90
91#define TX4938_IRC_INT 2 /* IP[2] in Status register */
92
93#define TX4938_NUM_PIO 16
94
95/*
96 * CCFG
97 */
98/* CCFG : Chip Configuration */
99#define TX4938_CCFG_WDRST 0x0000020000000000ULL
100#define TX4938_CCFG_WDREXEN 0x0000010000000000ULL
101#define TX4938_CCFG_BCFG_MASK 0x000000ff00000000ULL
102#define TX4938_CCFG_TINTDIS 0x01000000
103#define TX4938_CCFG_PCI66 0x00800000
104#define TX4938_CCFG_PCIMODE 0x00400000
105#define TX4938_CCFG_PCI1_66 0x00200000
106#define TX4938_CCFG_DIVMODE_MASK 0x001e0000
107#define TX4938_CCFG_DIVMODE_2 (0x4 << 17)
108#define TX4938_CCFG_DIVMODE_2_5 (0xf << 17)
109#define TX4938_CCFG_DIVMODE_3 (0x5 << 17)
110#define TX4938_CCFG_DIVMODE_4 (0x6 << 17)
111#define TX4938_CCFG_DIVMODE_4_5 (0xd << 17)
112#define TX4938_CCFG_DIVMODE_8 (0x0 << 17)
113#define TX4938_CCFG_DIVMODE_10 (0xb << 17)
114#define TX4938_CCFG_DIVMODE_12 (0x1 << 17)
115#define TX4938_CCFG_DIVMODE_16 (0x2 << 17)
116#define TX4938_CCFG_DIVMODE_18 (0x9 << 17)
117#define TX4938_CCFG_BEOW 0x00010000
118#define TX4938_CCFG_WR 0x00008000
119#define TX4938_CCFG_TOE 0x00004000
120#define TX4938_CCFG_PCIARB 0x00002000
121#define TX4938_CCFG_PCIDIVMODE_MASK 0x00001c00
122#define TX4938_CCFG_PCIDIVMODE_4 (0x1 << 10)
123#define TX4938_CCFG_PCIDIVMODE_4_5 (0x3 << 10)
124#define TX4938_CCFG_PCIDIVMODE_5 (0x5 << 10)
125#define TX4938_CCFG_PCIDIVMODE_5_5 (0x7 << 10)
126#define TX4938_CCFG_PCIDIVMODE_8 (0x0 << 10)
127#define TX4938_CCFG_PCIDIVMODE_9 (0x2 << 10)
128#define TX4938_CCFG_PCIDIVMODE_10 (0x4 << 10)
129#define TX4938_CCFG_PCIDIVMODE_11 (0x6 << 10)
130#define TX4938_CCFG_PCI1DMD 0x00000100
131#define TX4938_CCFG_SYSSP_MASK 0x000000c0
132#define TX4938_CCFG_ENDIAN 0x00000004
133#define TX4938_CCFG_HALT 0x00000002
134#define TX4938_CCFG_ACEHOLD 0x00000001
135
136/* PCFG : Pin Configuration */
137#define TX4938_PCFG_ETH0_SEL 0x8000000000000000ULL
138#define TX4938_PCFG_ETH1_SEL 0x4000000000000000ULL
139#define TX4938_PCFG_ATA_SEL 0x2000000000000000ULL
140#define TX4938_PCFG_ISA_SEL 0x1000000000000000ULL
141#define TX4938_PCFG_SPI_SEL 0x0800000000000000ULL
142#define TX4938_PCFG_NDF_SEL 0x0400000000000000ULL
143#define TX4938_PCFG_SDCLKDLY_MASK 0x30000000
144#define TX4938_PCFG_SDCLKDLY(d) ((d)<<28)
145#define TX4938_PCFG_SYSCLKEN 0x08000000
146#define TX4938_PCFG_SDCLKEN_ALL 0x07800000
147#define TX4938_PCFG_SDCLKEN(ch) (0x00800000<<(ch))
148#define TX4938_PCFG_PCICLKEN_ALL 0x003f0000
149#define TX4938_PCFG_PCICLKEN(ch) (0x00010000<<(ch))
150#define TX4938_PCFG_SEL2 0x00000200
151#define TX4938_PCFG_SEL1 0x00000100
152#define TX4938_PCFG_DMASEL_ALL 0x0000000f
153#define TX4938_PCFG_DMASEL0_DRQ0 0x00000000
154#define TX4938_PCFG_DMASEL0_SIO1 0x00000001
155#define TX4938_PCFG_DMASEL1_DRQ1 0x00000000
156#define TX4938_PCFG_DMASEL1_SIO1 0x00000002
157#define TX4938_PCFG_DMASEL2_DRQ2 0x00000000
158#define TX4938_PCFG_DMASEL2_SIO0 0x00000004
159#define TX4938_PCFG_DMASEL3_DRQ3 0x00000000
160#define TX4938_PCFG_DMASEL3_SIO0 0x00000008
161
162/* CLKCTR : Clock Control */
163#define TX4938_CLKCTR_NDFCKD 0x0001000000000000ULL
164#define TX4938_CLKCTR_NDFRST 0x0000000100000000ULL
165#define TX4938_CLKCTR_ETH1CKD 0x80000000
166#define TX4938_CLKCTR_ETH0CKD 0x40000000
167#define TX4938_CLKCTR_SPICKD 0x20000000
168#define TX4938_CLKCTR_SRAMCKD 0x10000000
169#define TX4938_CLKCTR_PCIC1CKD 0x08000000
170#define TX4938_CLKCTR_DMA1CKD 0x04000000
171#define TX4938_CLKCTR_ACLCKD 0x02000000
172#define TX4938_CLKCTR_PIOCKD 0x01000000
173#define TX4938_CLKCTR_DMACKD 0x00800000
174#define TX4938_CLKCTR_PCICKD 0x00400000
175#define TX4938_CLKCTR_TM0CKD 0x00100000
176#define TX4938_CLKCTR_TM1CKD 0x00080000
177#define TX4938_CLKCTR_TM2CKD 0x00040000
178#define TX4938_CLKCTR_SIO0CKD 0x00020000
179#define TX4938_CLKCTR_SIO1CKD 0x00010000
180#define TX4938_CLKCTR_ETH1RST 0x00008000
181#define TX4938_CLKCTR_ETH0RST 0x00004000
182#define TX4938_CLKCTR_SPIRST 0x00002000
183#define TX4938_CLKCTR_SRAMRST 0x00001000
184#define TX4938_CLKCTR_PCIC1RST 0x00000800
185#define TX4938_CLKCTR_DMA1RST 0x00000400
186#define TX4938_CLKCTR_ACLRST 0x00000200
187#define TX4938_CLKCTR_PIORST 0x00000100
188#define TX4938_CLKCTR_DMARST 0x00000080
189#define TX4938_CLKCTR_PCIRST 0x00000040
190#define TX4938_CLKCTR_TM0RST 0x00000010
191#define TX4938_CLKCTR_TM1RST 0x00000008
192#define TX4938_CLKCTR_TM2RST 0x00000004
193#define TX4938_CLKCTR_SIO0RST 0x00000002
194#define TX4938_CLKCTR_SIO1RST 0x00000001
195
196/*
197 * DMA
198 */
199/* bits for MCR */
200#define TX4938_DMA_MCR_EIS(ch) (0x10000000<<(ch))
201#define TX4938_DMA_MCR_DIS(ch) (0x01000000<<(ch))
202#define TX4938_DMA_MCR_RSFIF 0x00000080
203#define TX4938_DMA_MCR_FIFUM(ch) (0x00000008<<(ch))
204#define TX4938_DMA_MCR_RPRT 0x00000002
205#define TX4938_DMA_MCR_MSTEN 0x00000001
206
207/* bits for CCRn */
208#define TX4938_DMA_CCR_IMMCHN 0x20000000
209#define TX4938_DMA_CCR_USEXFSZ 0x10000000
210#define TX4938_DMA_CCR_LE 0x08000000
211#define TX4938_DMA_CCR_DBINH 0x04000000
212#define TX4938_DMA_CCR_SBINH 0x02000000
213#define TX4938_DMA_CCR_CHRST 0x01000000
214#define TX4938_DMA_CCR_RVBYTE 0x00800000
215#define TX4938_DMA_CCR_ACKPOL 0x00400000
216#define TX4938_DMA_CCR_REQPL 0x00200000
217#define TX4938_DMA_CCR_EGREQ 0x00100000
218#define TX4938_DMA_CCR_CHDN 0x00080000
219#define TX4938_DMA_CCR_DNCTL 0x00060000
220#define TX4938_DMA_CCR_EXTRQ 0x00010000
221#define TX4938_DMA_CCR_INTRQD 0x0000e000
222#define TX4938_DMA_CCR_INTENE 0x00001000
223#define TX4938_DMA_CCR_INTENC 0x00000800
224#define TX4938_DMA_CCR_INTENT 0x00000400
225#define TX4938_DMA_CCR_CHNEN 0x00000200
226#define TX4938_DMA_CCR_XFACT 0x00000100
227#define TX4938_DMA_CCR_SMPCHN 0x00000020
228#define TX4938_DMA_CCR_XFSZ(order) (((order) << 2) & 0x0000001c)
229#define TX4938_DMA_CCR_XFSZ_1W TX4938_DMA_CCR_XFSZ(2)
230#define TX4938_DMA_CCR_XFSZ_2W TX4938_DMA_CCR_XFSZ(3)
231#define TX4938_DMA_CCR_XFSZ_4W TX4938_DMA_CCR_XFSZ(4)
232#define TX4938_DMA_CCR_XFSZ_8W TX4938_DMA_CCR_XFSZ(5)
233#define TX4938_DMA_CCR_XFSZ_16W TX4938_DMA_CCR_XFSZ(6)
234#define TX4938_DMA_CCR_XFSZ_32W TX4938_DMA_CCR_XFSZ(7)
235#define TX4938_DMA_CCR_MEMIO 0x00000002
236#define TX4938_DMA_CCR_SNGAD 0x00000001
237
238/* bits for CSRn */
239#define TX4938_DMA_CSR_CHNEN 0x00000400
240#define TX4938_DMA_CSR_STLXFER 0x00000200
241#define TX4938_DMA_CSR_CHNACT 0x00000100
242#define TX4938_DMA_CSR_ABCHC 0x00000080
243#define TX4938_DMA_CSR_NCHNC 0x00000040
244#define TX4938_DMA_CSR_NTRNFC 0x00000020
245#define TX4938_DMA_CSR_EXTDN 0x00000010
246#define TX4938_DMA_CSR_CFERR 0x00000008
247#define TX4938_DMA_CSR_CHERR 0x00000004
248#define TX4938_DMA_CSR_DESERR 0x00000002
249#define TX4938_DMA_CSR_SORERR 0x00000001
250
251#define tx4938_sdramcptr tx4927_sdramcptr
252#define tx4938_ebuscptr tx4927_ebuscptr
253#define tx4938_pcicptr tx4927_pcicptr
254#define tx4938_pcic1ptr \
255 ((struct tx4927_pcic_reg __iomem *)TX4938_PCIC1_REG)
256#define tx4938_ccfgptr \
257 ((struct tx4938_ccfg_reg __iomem *)TX4938_CCFG_REG)
258#define tx4938_pioptr ((struct txx9_pio_reg __iomem *)TX4938_PIO_REG)
259#define tx4938_sramcptr \
260 ((struct tx4938_sramc_reg __iomem *)TX4938_SRAMC_REG)
261
262
263#define TX4938_REV_PCODE() \
264 ((__u32)__raw_readq(&tx4938_ccfgptr->crir) >> 16)
265
266#define tx4938_ccfg_clear(bits) tx4927_ccfg_clear(bits)
267#define tx4938_ccfg_set(bits) tx4927_ccfg_set(bits)
268#define tx4938_ccfg_change(change, new) tx4927_ccfg_change(change, new)
269
270#define TX4938_SDRAMC_CR(ch) TX4927_SDRAMC_CR(ch)
271#define TX4938_SDRAMC_BA(ch) TX4927_SDRAMC_BA(ch)
272#define TX4938_SDRAMC_SIZE(ch) TX4927_SDRAMC_SIZE(ch)
273
274#define TX4938_EBUSC_CR(ch) TX4927_EBUSC_CR(ch)
275#define TX4938_EBUSC_BA(ch) TX4927_EBUSC_BA(ch)
276#define TX4938_EBUSC_SIZE(ch) TX4927_EBUSC_SIZE(ch)
277
278#define tx4938_get_mem_size() tx4927_get_mem_size()
279void tx4938_wdt_init(void);
280void tx4938_setup(void);
281void tx4938_time_init(unsigned int tmrnr);
282void tx4938_sio_init(unsigned int sclk, unsigned int cts_mask);
283void tx4938_spi_init(int busid);
284void tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1);
285int tx4938_report_pciclk(void);
286void tx4938_report_pci1clk(void);
287int tx4938_pciclk66_setup(void);
288struct pci_dev;
289int tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot);
290void tx4938_setup_pcierr_irq(void);
291void tx4938_irq_init(void);
292
293#endif
diff --git a/include/asm-mips/txx9irq.h b/include/asm-mips/txx9irq.h
deleted file mode 100644
index 5620879be37f..000000000000
--- a/include/asm-mips/txx9irq.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * include/asm-mips/txx9irq.h
3 * TX39/TX49 interrupt controller definitions.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9#ifndef __ASM_TXX9IRQ_H
10#define __ASM_TXX9IRQ_H
11
12#include <irq.h>
13
14#ifdef CONFIG_IRQ_CPU
15#define TXX9_IRQ_BASE (MIPS_CPU_IRQ_BASE + 8)
16#else
17#ifdef CONFIG_I8259
18#define TXX9_IRQ_BASE (I8259A_IRQ_BASE + 16)
19#else
20#define TXX9_IRQ_BASE 0
21#endif
22#endif
23
24#ifdef CONFIG_CPU_TX39XX
25#define TXx9_MAX_IR 16
26#else
27#define TXx9_MAX_IR 32
28#endif
29
30void txx9_irq_init(unsigned long baseaddr);
31int txx9_irq(void);
32int txx9_irq_set_pri(int irc_irq, int new_pri);
33
34#endif /* __ASM_TXX9IRQ_H */
diff --git a/include/asm-mips/txx9pio.h b/include/asm-mips/txx9pio.h
deleted file mode 100644
index 3d6fa9f8d513..000000000000
--- a/include/asm-mips/txx9pio.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * include/asm-mips/txx9pio.h
3 * TX39/TX49 PIO controller definitions.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9#ifndef __ASM_TXX9PIO_H
10#define __ASM_TXX9PIO_H
11
12#include <linux/types.h>
13
14struct txx9_pio_reg {
15 __u32 dout;
16 __u32 din;
17 __u32 dir;
18 __u32 od;
19 __u32 flag[2];
20 __u32 pol;
21 __u32 intc;
22 __u32 maskcpu;
23 __u32 maskext;
24};
25
26int txx9_gpio_init(unsigned long baseaddr,
27 unsigned int base, unsigned int num);
28
29#endif /* __ASM_TXX9PIO_H */
diff --git a/include/asm-mips/txx9tmr.h b/include/asm-mips/txx9tmr.h
deleted file mode 100644
index 67f70a8f09bd..000000000000
--- a/include/asm-mips/txx9tmr.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * include/asm-mips/txx9tmr.h
3 * TX39/TX49 timer controller definitions.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9#ifndef __ASM_TXX9TMR_H
10#define __ASM_TXX9TMR_H
11
12#include <linux/types.h>
13
14struct txx9_tmr_reg {
15 u32 tcr;
16 u32 tisr;
17 u32 cpra;
18 u32 cprb;
19 u32 itmr;
20 u32 unused0[3];
21 u32 ccdr;
22 u32 unused1[3];
23 u32 pgmr;
24 u32 unused2[3];
25 u32 wtmr;
26 u32 unused3[43];
27 u32 trr;
28};
29
30/* TMTCR : Timer Control */
31#define TXx9_TMTCR_TCE 0x00000080
32#define TXx9_TMTCR_CCDE 0x00000040
33#define TXx9_TMTCR_CRE 0x00000020
34#define TXx9_TMTCR_ECES 0x00000008
35#define TXx9_TMTCR_CCS 0x00000004
36#define TXx9_TMTCR_TMODE_MASK 0x00000003
37#define TXx9_TMTCR_TMODE_ITVL 0x00000000
38#define TXx9_TMTCR_TMODE_PGEN 0x00000001
39#define TXx9_TMTCR_TMODE_WDOG 0x00000002
40
41/* TMTISR : Timer Int. Status */
42#define TXx9_TMTISR_TPIBS 0x00000004
43#define TXx9_TMTISR_TPIAS 0x00000002
44#define TXx9_TMTISR_TIIS 0x00000001
45
46/* TMITMR : Interval Timer Mode */
47#define TXx9_TMITMR_TIIE 0x00008000
48#define TXx9_TMITMR_TZCE 0x00000001
49
50/* TMWTMR : Watchdog Timer Mode */
51#define TXx9_TMWTMR_TWIE 0x00008000
52#define TXx9_TMWTMR_WDIS 0x00000080
53#define TXx9_TMWTMR_TWC 0x00000001
54
55void txx9_clocksource_init(unsigned long baseaddr,
56 unsigned int imbusclk);
57void txx9_clockevent_init(unsigned long baseaddr, int irq,
58 unsigned int imbusclk);
59void txx9_tmr_init(unsigned long baseaddr);
60
61#ifdef CONFIG_CPU_TX39XX
62#define TXX9_TIMER_BITS 24
63#else
64#define TXX9_TIMER_BITS 32
65#endif
66
67#endif /* __ASM_TXX9TMR_H */
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
deleted file mode 100644
index bcbb8d675af5..000000000000
--- a/include/asm-mips/types.h
+++ /dev/null
@@ -1,54 +0,0 @@
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 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_TYPES_H
10#define _ASM_TYPES_H
11
12#if _MIPS_SZLONG == 64
13# include <asm-generic/int-l64.h>
14#else
15# include <asm-generic/int-ll64.h>
16#endif
17
18#ifndef __ASSEMBLY__
19
20typedef unsigned short umode_t;
21
22#endif /* __ASSEMBLY__ */
23
24/*
25 * These aren't exported outside the kernel to avoid name space clashes
26 */
27#ifdef __KERNEL__
28
29#define BITS_PER_LONG _MIPS_SZLONG
30
31#ifndef __ASSEMBLY__
32
33#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
34 || defined(CONFIG_64BIT)
35typedef u64 dma_addr_t;
36#else
37typedef u32 dma_addr_t;
38#endif
39typedef u64 dma64_addr_t;
40
41/*
42 * Don't use phys_t. You've been warned.
43 */
44#ifdef CONFIG_64BIT_PHYS_ADDR
45typedef unsigned long long phys_t;
46#else
47typedef unsigned long phys_t;
48#endif
49
50#endif /* __ASSEMBLY__ */
51
52#endif /* __KERNEL__ */
53
54#endif /* _ASM_TYPES_H */
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
deleted file mode 100644
index 66523d610950..000000000000
--- a/include/asm-mips/uaccess.h
+++ /dev/null
@@ -1,852 +0,0 @@
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 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 03, 04 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 * Copyright (C) 2007 Maciej W. Rozycki
9 */
10#ifndef _ASM_UACCESS_H
11#define _ASM_UACCESS_H
12
13#include <linux/kernel.h>
14#include <linux/errno.h>
15#include <linux/thread_info.h>
16#include <asm-generic/uaccess.h>
17
18/*
19 * The fs value determines whether argument validity checking should be
20 * performed or not. If get_fs() == USER_DS, checking is performed, with
21 * get_fs() == KERNEL_DS, checking is bypassed.
22 *
23 * For historical reasons, these macros are grossly misnamed.
24 */
25#ifdef CONFIG_32BIT
26
27#define __UA_LIMIT 0x80000000UL
28
29#define __UA_ADDR ".word"
30#define __UA_LA "la"
31#define __UA_ADDU "addu"
32#define __UA_t0 "$8"
33#define __UA_t1 "$9"
34
35#endif /* CONFIG_32BIT */
36
37#ifdef CONFIG_64BIT
38
39#define __UA_LIMIT (- TASK_SIZE)
40
41#define __UA_ADDR ".dword"
42#define __UA_LA "dla"
43#define __UA_ADDU "daddu"
44#define __UA_t0 "$12"
45#define __UA_t1 "$13"
46
47#endif /* CONFIG_64BIT */
48
49/*
50 * USER_DS is a bitmask that has the bits set that may not be set in a valid
51 * userspace address. Note that we limit 32-bit userspace to 0x7fff8000 but
52 * the arithmetic we're doing only works if the limit is a power of two, so
53 * we use 0x80000000 here on 32-bit kernels. If a process passes an invalid
54 * address in this range it's the process's problem, not ours :-)
55 */
56
57#define KERNEL_DS ((mm_segment_t) { 0UL })
58#define USER_DS ((mm_segment_t) { __UA_LIMIT })
59
60#define VERIFY_READ 0
61#define VERIFY_WRITE 1
62
63#define get_ds() (KERNEL_DS)
64#define get_fs() (current_thread_info()->addr_limit)
65#define set_fs(x) (current_thread_info()->addr_limit = (x))
66
67#define segment_eq(a, b) ((a).seg == (b).seg)
68
69
70/*
71 * Is a address valid? This does a straighforward calculation rather
72 * than tests.
73 *
74 * Address valid if:
75 * - "addr" doesn't have any high-bits set
76 * - AND "size" doesn't have any high-bits set
77 * - AND "addr+size" doesn't have any high-bits set
78 * - OR we are in kernel mode.
79 *
80 * __ua_size() is a trick to avoid runtime checking of positive constant
81 * sizes; for those we already know at compile time that the size is ok.
82 */
83#define __ua_size(size) \
84 ((__builtin_constant_p(size) && (signed long) (size) > 0) ? 0 : (size))
85
86/*
87 * access_ok: - Checks if a user space pointer is valid
88 * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that
89 * %VERIFY_WRITE is a superset of %VERIFY_READ - if it is safe
90 * to write to a block, it is always safe to read from it.
91 * @addr: User space pointer to start of block to check
92 * @size: Size of block to check
93 *
94 * Context: User context only. This function may sleep.
95 *
96 * Checks if a pointer to a block of memory in user space is valid.
97 *
98 * Returns true (nonzero) if the memory block may be valid, false (zero)
99 * if it is definitely invalid.
100 *
101 * Note that, depending on architecture, this function probably just
102 * checks that the pointer is in the user space range - after calling
103 * this function, memory access functions may still return -EFAULT.
104 */
105
106#define __access_mask get_fs().seg
107
108#define __access_ok(addr, size, mask) \
109 (((signed long)((mask) & ((addr) | ((addr) + (size)) | __ua_size(size)))) == 0)
110
111#define access_ok(type, addr, size) \
112 likely(__access_ok((unsigned long)(addr), (size), __access_mask))
113
114/*
115 * put_user: - Write a simple value into user space.
116 * @x: Value to copy to user space.
117 * @ptr: Destination address, in user space.
118 *
119 * Context: User context only. This function may sleep.
120 *
121 * This macro copies a single simple value from kernel space to user
122 * space. It supports simple types like char and int, but not larger
123 * data types like structures or arrays.
124 *
125 * @ptr must have pointer-to-simple-variable type, and @x must be assignable
126 * to the result of dereferencing @ptr.
127 *
128 * Returns zero on success, or -EFAULT on error.
129 */
130#define put_user(x,ptr) \
131 __put_user_check((x), (ptr), sizeof(*(ptr)))
132
133/*
134 * get_user: - Get a simple variable from user space.
135 * @x: Variable to store result.
136 * @ptr: Source address, in user space.
137 *
138 * Context: User context only. This function may sleep.
139 *
140 * This macro copies a single simple variable from user space to kernel
141 * space. It supports simple types like char and int, but not larger
142 * data types like structures or arrays.
143 *
144 * @ptr must have pointer-to-simple-variable type, and the result of
145 * dereferencing @ptr must be assignable to @x without a cast.
146 *
147 * Returns zero on success, or -EFAULT on error.
148 * On error, the variable @x is set to zero.
149 */
150#define get_user(x,ptr) \
151 __get_user_check((x), (ptr), sizeof(*(ptr)))
152
153/*
154 * __put_user: - Write a simple value into user space, with less checking.
155 * @x: Value to copy to user space.
156 * @ptr: Destination address, in user space.
157 *
158 * Context: User context only. This function may sleep.
159 *
160 * This macro copies a single simple value from kernel space to user
161 * space. It supports simple types like char and int, but not larger
162 * data types like structures or arrays.
163 *
164 * @ptr must have pointer-to-simple-variable type, and @x must be assignable
165 * to the result of dereferencing @ptr.
166 *
167 * Caller must check the pointer with access_ok() before calling this
168 * function.
169 *
170 * Returns zero on success, or -EFAULT on error.
171 */
172#define __put_user(x,ptr) \
173 __put_user_nocheck((x), (ptr), sizeof(*(ptr)))
174
175/*
176 * __get_user: - Get a simple variable from user space, with less checking.
177 * @x: Variable to store result.
178 * @ptr: Source address, in user space.
179 *
180 * Context: User context only. This function may sleep.
181 *
182 * This macro copies a single simple variable from user space to kernel
183 * space. It supports simple types like char and int, but not larger
184 * data types like structures or arrays.
185 *
186 * @ptr must have pointer-to-simple-variable type, and the result of
187 * dereferencing @ptr must be assignable to @x without a cast.
188 *
189 * Caller must check the pointer with access_ok() before calling this
190 * function.
191 *
192 * Returns zero on success, or -EFAULT on error.
193 * On error, the variable @x is set to zero.
194 */
195#define __get_user(x,ptr) \
196 __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
197
198struct __large_struct { unsigned long buf[100]; };
199#define __m(x) (*(struct __large_struct __user *)(x))
200
201/*
202 * Yuck. We need two variants, one for 64bit operation and one
203 * for 32 bit mode and old iron.
204 */
205#ifdef CONFIG_32BIT
206#define __GET_USER_DW(val, ptr) __get_user_asm_ll32(val, ptr)
207#endif
208#ifdef CONFIG_64BIT
209#define __GET_USER_DW(val, ptr) __get_user_asm(val, "ld", ptr)
210#endif
211
212extern void __get_user_unknown(void);
213
214#define __get_user_common(val, size, ptr) \
215do { \
216 switch (size) { \
217 case 1: __get_user_asm(val, "lb", ptr); break; \
218 case 2: __get_user_asm(val, "lh", ptr); break; \
219 case 4: __get_user_asm(val, "lw", ptr); break; \
220 case 8: __GET_USER_DW(val, ptr); break; \
221 default: __get_user_unknown(); break; \
222 } \
223} while (0)
224
225#define __get_user_nocheck(x, ptr, size) \
226({ \
227 long __gu_err; \
228 \
229 __get_user_common((x), size, ptr); \
230 __gu_err; \
231})
232
233#define __get_user_check(x, ptr, size) \
234({ \
235 long __gu_err = -EFAULT; \
236 const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \
237 \
238 if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \
239 __get_user_common((x), size, __gu_ptr); \
240 \
241 __gu_err; \
242})
243
244#define __get_user_asm(val, insn, addr) \
245{ \
246 long __gu_tmp; \
247 \
248 __asm__ __volatile__( \
249 "1: " insn " %1, %3 \n" \
250 "2: \n" \
251 " .section .fixup,\"ax\" \n" \
252 "3: li %0, %4 \n" \
253 " j 2b \n" \
254 " .previous \n" \
255 " .section __ex_table,\"a\" \n" \
256 " "__UA_ADDR "\t1b, 3b \n" \
257 " .previous \n" \
258 : "=r" (__gu_err), "=r" (__gu_tmp) \
259 : "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \
260 \
261 (val) = (__typeof__(*(addr))) __gu_tmp; \
262}
263
264/*
265 * Get a long long 64 using 32 bit registers.
266 */
267#define __get_user_asm_ll32(val, addr) \
268{ \
269 union { \
270 unsigned long long l; \
271 __typeof__(*(addr)) t; \
272 } __gu_tmp; \
273 \
274 __asm__ __volatile__( \
275 "1: lw %1, (%3) \n" \
276 "2: lw %D1, 4(%3) \n" \
277 "3: .section .fixup,\"ax\" \n" \
278 "4: li %0, %4 \n" \
279 " move %1, $0 \n" \
280 " move %D1, $0 \n" \
281 " j 3b \n" \
282 " .previous \n" \
283 " .section __ex_table,\"a\" \n" \
284 " " __UA_ADDR " 1b, 4b \n" \
285 " " __UA_ADDR " 2b, 4b \n" \
286 " .previous \n" \
287 : "=r" (__gu_err), "=&r" (__gu_tmp.l) \
288 : "0" (0), "r" (addr), "i" (-EFAULT)); \
289 \
290 (val) = __gu_tmp.t; \
291}
292
293/*
294 * Yuck. We need two variants, one for 64bit operation and one
295 * for 32 bit mode and old iron.
296 */
297#ifdef CONFIG_32BIT
298#define __PUT_USER_DW(ptr) __put_user_asm_ll32(ptr)
299#endif
300#ifdef CONFIG_64BIT
301#define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr)
302#endif
303
304#define __put_user_nocheck(x, ptr, size) \
305({ \
306 __typeof__(*(ptr)) __pu_val; \
307 long __pu_err = 0; \
308 \
309 __pu_val = (x); \
310 switch (size) { \
311 case 1: __put_user_asm("sb", ptr); break; \
312 case 2: __put_user_asm("sh", ptr); break; \
313 case 4: __put_user_asm("sw", ptr); break; \
314 case 8: __PUT_USER_DW(ptr); break; \
315 default: __put_user_unknown(); break; \
316 } \
317 __pu_err; \
318})
319
320#define __put_user_check(x, ptr, size) \
321({ \
322 __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
323 __typeof__(*(ptr)) __pu_val = (x); \
324 long __pu_err = -EFAULT; \
325 \
326 if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \
327 switch (size) { \
328 case 1: __put_user_asm("sb", __pu_addr); break; \
329 case 2: __put_user_asm("sh", __pu_addr); break; \
330 case 4: __put_user_asm("sw", __pu_addr); break; \
331 case 8: __PUT_USER_DW(__pu_addr); break; \
332 default: __put_user_unknown(); break; \
333 } \
334 } \
335 __pu_err; \
336})
337
338#define __put_user_asm(insn, ptr) \
339{ \
340 __asm__ __volatile__( \
341 "1: " insn " %z2, %3 # __put_user_asm\n" \
342 "2: \n" \
343 " .section .fixup,\"ax\" \n" \
344 "3: li %0, %4 \n" \
345 " j 2b \n" \
346 " .previous \n" \
347 " .section __ex_table,\"a\" \n" \
348 " " __UA_ADDR " 1b, 3b \n" \
349 " .previous \n" \
350 : "=r" (__pu_err) \
351 : "0" (0), "Jr" (__pu_val), "o" (__m(ptr)), \
352 "i" (-EFAULT)); \
353}
354
355#define __put_user_asm_ll32(ptr) \
356{ \
357 __asm__ __volatile__( \
358 "1: sw %2, (%3) # __put_user_asm_ll32 \n" \
359 "2: sw %D2, 4(%3) \n" \
360 "3: \n" \
361 " .section .fixup,\"ax\" \n" \
362 "4: li %0, %4 \n" \
363 " j 3b \n" \
364 " .previous \n" \
365 " .section __ex_table,\"a\" \n" \
366 " " __UA_ADDR " 1b, 4b \n" \
367 " " __UA_ADDR " 2b, 4b \n" \
368 " .previous" \
369 : "=r" (__pu_err) \
370 : "0" (0), "r" (__pu_val), "r" (ptr), \
371 "i" (-EFAULT)); \
372}
373
374extern void __put_user_unknown(void);
375
376/*
377 * We're generating jump to subroutines which will be outside the range of
378 * jump instructions
379 */
380#ifdef MODULE
381#define __MODULE_JAL(destination) \
382 ".set\tnoat\n\t" \
383 __UA_LA "\t$1, " #destination "\n\t" \
384 "jalr\t$1\n\t" \
385 ".set\tat\n\t"
386#else
387#define __MODULE_JAL(destination) \
388 "jal\t" #destination "\n\t"
389#endif
390
391#ifndef CONFIG_CPU_DADDI_WORKAROUNDS
392#define DADDI_SCRATCH "$0"
393#else
394#define DADDI_SCRATCH "$3"
395#endif
396
397extern size_t __copy_user(void *__to, const void *__from, size_t __n);
398
399#define __invoke_copy_to_user(to, from, n) \
400({ \
401 register void __user *__cu_to_r __asm__("$4"); \
402 register const void *__cu_from_r __asm__("$5"); \
403 register long __cu_len_r __asm__("$6"); \
404 \
405 __cu_to_r = (to); \
406 __cu_from_r = (from); \
407 __cu_len_r = (n); \
408 __asm__ __volatile__( \
409 __MODULE_JAL(__copy_user) \
410 : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \
411 : \
412 : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \
413 DADDI_SCRATCH, "memory"); \
414 __cu_len_r; \
415})
416
417/*
418 * __copy_to_user: - Copy a block of data into user space, with less checking.
419 * @to: Destination address, in user space.
420 * @from: Source address, in kernel space.
421 * @n: Number of bytes to copy.
422 *
423 * Context: User context only. This function may sleep.
424 *
425 * Copy data from kernel space to user space. Caller must check
426 * the specified block with access_ok() before calling this function.
427 *
428 * Returns number of bytes that could not be copied.
429 * On success, this will be zero.
430 */
431#define __copy_to_user(to, from, n) \
432({ \
433 void __user *__cu_to; \
434 const void *__cu_from; \
435 long __cu_len; \
436 \
437 might_sleep(); \
438 __cu_to = (to); \
439 __cu_from = (from); \
440 __cu_len = (n); \
441 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \
442 __cu_len; \
443})
444
445extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
446
447#define __copy_to_user_inatomic(to, from, n) \
448({ \
449 void __user *__cu_to; \
450 const void *__cu_from; \
451 long __cu_len; \
452 \
453 __cu_to = (to); \
454 __cu_from = (from); \
455 __cu_len = (n); \
456 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \
457 __cu_len; \
458})
459
460#define __copy_from_user_inatomic(to, from, n) \
461({ \
462 void *__cu_to; \
463 const void __user *__cu_from; \
464 long __cu_len; \
465 \
466 __cu_to = (to); \
467 __cu_from = (from); \
468 __cu_len = (n); \
469 __cu_len = __invoke_copy_from_user_inatomic(__cu_to, __cu_from, \
470 __cu_len); \
471 __cu_len; \
472})
473
474/*
475 * copy_to_user: - Copy a block of data into user space.
476 * @to: Destination address, in user space.
477 * @from: Source address, in kernel space.
478 * @n: Number of bytes to copy.
479 *
480 * Context: User context only. This function may sleep.
481 *
482 * Copy data from kernel space to user space.
483 *
484 * Returns number of bytes that could not be copied.
485 * On success, this will be zero.
486 */
487#define copy_to_user(to, from, n) \
488({ \
489 void __user *__cu_to; \
490 const void *__cu_from; \
491 long __cu_len; \
492 \
493 might_sleep(); \
494 __cu_to = (to); \
495 __cu_from = (from); \
496 __cu_len = (n); \
497 if (access_ok(VERIFY_WRITE, __cu_to, __cu_len)) \
498 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, \
499 __cu_len); \
500 __cu_len; \
501})
502
503#define __invoke_copy_from_user(to, from, n) \
504({ \
505 register void *__cu_to_r __asm__("$4"); \
506 register const void __user *__cu_from_r __asm__("$5"); \
507 register long __cu_len_r __asm__("$6"); \
508 \
509 __cu_to_r = (to); \
510 __cu_from_r = (from); \
511 __cu_len_r = (n); \
512 __asm__ __volatile__( \
513 ".set\tnoreorder\n\t" \
514 __MODULE_JAL(__copy_user) \
515 ".set\tnoat\n\t" \
516 __UA_ADDU "\t$1, %1, %2\n\t" \
517 ".set\tat\n\t" \
518 ".set\treorder" \
519 : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \
520 : \
521 : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \
522 DADDI_SCRATCH, "memory"); \
523 __cu_len_r; \
524})
525
526#define __invoke_copy_from_user_inatomic(to, from, n) \
527({ \
528 register void *__cu_to_r __asm__("$4"); \
529 register const void __user *__cu_from_r __asm__("$5"); \
530 register long __cu_len_r __asm__("$6"); \
531 \
532 __cu_to_r = (to); \
533 __cu_from_r = (from); \
534 __cu_len_r = (n); \
535 __asm__ __volatile__( \
536 ".set\tnoreorder\n\t" \
537 __MODULE_JAL(__copy_user_inatomic) \
538 ".set\tnoat\n\t" \
539 __UA_ADDU "\t$1, %1, %2\n\t" \
540 ".set\tat\n\t" \
541 ".set\treorder" \
542 : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \
543 : \
544 : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \
545 DADDI_SCRATCH, "memory"); \
546 __cu_len_r; \
547})
548
549/*
550 * __copy_from_user: - Copy a block of data from user space, with less checking.
551 * @to: Destination address, in kernel space.
552 * @from: Source address, in user space.
553 * @n: Number of bytes to copy.
554 *
555 * Context: User context only. This function may sleep.
556 *
557 * Copy data from user space to kernel space. Caller must check
558 * the specified block with access_ok() before calling this function.
559 *
560 * Returns number of bytes that could not be copied.
561 * On success, this will be zero.
562 *
563 * If some data could not be copied, this function will pad the copied
564 * data to the requested size using zero bytes.
565 */
566#define __copy_from_user(to, from, n) \
567({ \
568 void *__cu_to; \
569 const void __user *__cu_from; \
570 long __cu_len; \
571 \
572 might_sleep(); \
573 __cu_to = (to); \
574 __cu_from = (from); \
575 __cu_len = (n); \
576 __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \
577 __cu_len); \
578 __cu_len; \
579})
580
581/*
582 * copy_from_user: - Copy a block of data from user space.
583 * @to: Destination address, in kernel space.
584 * @from: Source address, in user space.
585 * @n: Number of bytes to copy.
586 *
587 * Context: User context only. This function may sleep.
588 *
589 * Copy data from user space to kernel space.
590 *
591 * Returns number of bytes that could not be copied.
592 * On success, this will be zero.
593 *
594 * If some data could not be copied, this function will pad the copied
595 * data to the requested size using zero bytes.
596 */
597#define copy_from_user(to, from, n) \
598({ \
599 void *__cu_to; \
600 const void __user *__cu_from; \
601 long __cu_len; \
602 \
603 might_sleep(); \
604 __cu_to = (to); \
605 __cu_from = (from); \
606 __cu_len = (n); \
607 if (access_ok(VERIFY_READ, __cu_from, __cu_len)) \
608 __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \
609 __cu_len); \
610 __cu_len; \
611})
612
613#define __copy_in_user(to, from, n) __copy_from_user(to, from, n)
614
615#define copy_in_user(to, from, n) \
616({ \
617 void __user *__cu_to; \
618 const void __user *__cu_from; \
619 long __cu_len; \
620 \
621 might_sleep(); \
622 __cu_to = (to); \
623 __cu_from = (from); \
624 __cu_len = (n); \
625 if (likely(access_ok(VERIFY_READ, __cu_from, __cu_len) && \
626 access_ok(VERIFY_WRITE, __cu_to, __cu_len))) \
627 __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \
628 __cu_len); \
629 __cu_len; \
630})
631
632/*
633 * __clear_user: - Zero a block of memory in user space, with less checking.
634 * @to: Destination address, in user space.
635 * @n: Number of bytes to zero.
636 *
637 * Zero a block of memory in user space. Caller must check
638 * the specified block with access_ok() before calling this function.
639 *
640 * Returns number of bytes that could not be cleared.
641 * On success, this will be zero.
642 */
643static inline __kernel_size_t
644__clear_user(void __user *addr, __kernel_size_t size)
645{
646 __kernel_size_t res;
647
648 might_sleep();
649 __asm__ __volatile__(
650 "move\t$4, %1\n\t"
651 "move\t$5, $0\n\t"
652 "move\t$6, %2\n\t"
653 __MODULE_JAL(__bzero)
654 "move\t%0, $6"
655 : "=r" (res)
656 : "r" (addr), "r" (size)
657 : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31");
658
659 return res;
660}
661
662#define clear_user(addr,n) \
663({ \
664 void __user * __cl_addr = (addr); \
665 unsigned long __cl_size = (n); \
666 if (__cl_size && access_ok(VERIFY_WRITE, \
667 ((unsigned long)(__cl_addr)), __cl_size)) \
668 __cl_size = __clear_user(__cl_addr, __cl_size); \
669 __cl_size; \
670})
671
672/*
673 * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
674 * @dst: Destination address, in kernel space. This buffer must be at
675 * least @count bytes long.
676 * @src: Source address, in user space.
677 * @count: Maximum number of bytes to copy, including the trailing NUL.
678 *
679 * Copies a NUL-terminated string from userspace to kernel space.
680 * Caller must check the specified block with access_ok() before calling
681 * this function.
682 *
683 * On success, returns the length of the string (not including the trailing
684 * NUL).
685 *
686 * If access to userspace fails, returns -EFAULT (some data may have been
687 * copied).
688 *
689 * If @count is smaller than the length of the string, copies @count bytes
690 * and returns @count.
691 */
692static inline long
693__strncpy_from_user(char *__to, const char __user *__from, long __len)
694{
695 long res;
696
697 might_sleep();
698 __asm__ __volatile__(
699 "move\t$4, %1\n\t"
700 "move\t$5, %2\n\t"
701 "move\t$6, %3\n\t"
702 __MODULE_JAL(__strncpy_from_user_nocheck_asm)
703 "move\t%0, $2"
704 : "=r" (res)
705 : "r" (__to), "r" (__from), "r" (__len)
706 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
707
708 return res;
709}
710
711/*
712 * strncpy_from_user: - Copy a NUL terminated string from userspace.
713 * @dst: Destination address, in kernel space. This buffer must be at
714 * least @count bytes long.
715 * @src: Source address, in user space.
716 * @count: Maximum number of bytes to copy, including the trailing NUL.
717 *
718 * Copies a NUL-terminated string from userspace to kernel space.
719 *
720 * On success, returns the length of the string (not including the trailing
721 * NUL).
722 *
723 * If access to userspace fails, returns -EFAULT (some data may have been
724 * copied).
725 *
726 * If @count is smaller than the length of the string, copies @count bytes
727 * and returns @count.
728 */
729static inline long
730strncpy_from_user(char *__to, const char __user *__from, long __len)
731{
732 long res;
733
734 might_sleep();
735 __asm__ __volatile__(
736 "move\t$4, %1\n\t"
737 "move\t$5, %2\n\t"
738 "move\t$6, %3\n\t"
739 __MODULE_JAL(__strncpy_from_user_asm)
740 "move\t%0, $2"
741 : "=r" (res)
742 : "r" (__to), "r" (__from), "r" (__len)
743 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
744
745 return res;
746}
747
748/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
749static inline long __strlen_user(const char __user *s)
750{
751 long res;
752
753 might_sleep();
754 __asm__ __volatile__(
755 "move\t$4, %1\n\t"
756 __MODULE_JAL(__strlen_user_nocheck_asm)
757 "move\t%0, $2"
758 : "=r" (res)
759 : "r" (s)
760 : "$2", "$4", __UA_t0, "$31");
761
762 return res;
763}
764
765/*
766 * strlen_user: - Get the size of a string in user space.
767 * @str: The string to measure.
768 *
769 * Context: User context only. This function may sleep.
770 *
771 * Get the size of a NUL-terminated string in user space.
772 *
773 * Returns the size of the string INCLUDING the terminating NUL.
774 * On exception, returns 0.
775 *
776 * If there is a limit on the length of a valid string, you may wish to
777 * consider using strnlen_user() instead.
778 */
779static inline long strlen_user(const char __user *s)
780{
781 long res;
782
783 might_sleep();
784 __asm__ __volatile__(
785 "move\t$4, %1\n\t"
786 __MODULE_JAL(__strlen_user_asm)
787 "move\t%0, $2"
788 : "=r" (res)
789 : "r" (s)
790 : "$2", "$4", __UA_t0, "$31");
791
792 return res;
793}
794
795/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
796static inline long __strnlen_user(const char __user *s, long n)
797{
798 long res;
799
800 might_sleep();
801 __asm__ __volatile__(
802 "move\t$4, %1\n\t"
803 "move\t$5, %2\n\t"
804 __MODULE_JAL(__strnlen_user_nocheck_asm)
805 "move\t%0, $2"
806 : "=r" (res)
807 : "r" (s), "r" (n)
808 : "$2", "$4", "$5", __UA_t0, "$31");
809
810 return res;
811}
812
813/*
814 * strlen_user: - Get the size of a string in user space.
815 * @str: The string to measure.
816 *
817 * Context: User context only. This function may sleep.
818 *
819 * Get the size of a NUL-terminated string in user space.
820 *
821 * Returns the size of the string INCLUDING the terminating NUL.
822 * On exception, returns 0.
823 *
824 * If there is a limit on the length of a valid string, you may wish to
825 * consider using strnlen_user() instead.
826 */
827static inline long strnlen_user(const char __user *s, long n)
828{
829 long res;
830
831 might_sleep();
832 __asm__ __volatile__(
833 "move\t$4, %1\n\t"
834 "move\t$5, %2\n\t"
835 __MODULE_JAL(__strnlen_user_asm)
836 "move\t%0, $2"
837 : "=r" (res)
838 : "r" (s), "r" (n)
839 : "$2", "$4", "$5", __UA_t0, "$31");
840
841 return res;
842}
843
844struct exception_table_entry
845{
846 unsigned long insn;
847 unsigned long nextinsn;
848};
849
850extern int fixup_exception(struct pt_regs *regs);
851
852#endif /* _ASM_UACCESS_H */
diff --git a/include/asm-mips/ucontext.h b/include/asm-mips/ucontext.h
deleted file mode 100644
index 8a4b20e88b81..000000000000
--- a/include/asm-mips/ucontext.h
+++ /dev/null
@@ -1,21 +0,0 @@
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 * Low level exception handling
7 *
8 * Copyright (C) 1998, 1999 by Ralf Baechle
9 */
10#ifndef _ASM_UCONTEXT_H
11#define _ASM_UCONTEXT_H
12
13struct ucontext {
14 unsigned long uc_flags;
15 struct ucontext *uc_link;
16 stack_t uc_stack;
17 struct sigcontext uc_mcontext;
18 sigset_t uc_sigmask; /* mask last for extensibility */
19};
20
21#endif /* _ASM_UCONTEXT_H */
diff --git a/include/asm-mips/unaligned.h b/include/asm-mips/unaligned.h
deleted file mode 100644
index 792404948571..000000000000
--- a/include/asm-mips/unaligned.h
+++ /dev/null
@@ -1,28 +0,0 @@
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 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef _ASM_MIPS_UNALIGNED_H
9#define _ASM_MIPS_UNALIGNED_H
10
11#include <linux/compiler.h>
12#if defined(__MIPSEB__)
13# include <linux/unaligned/be_struct.h>
14# include <linux/unaligned/le_byteshift.h>
15# include <linux/unaligned/generic.h>
16# define get_unaligned __get_unaligned_be
17# define put_unaligned __put_unaligned_be
18#elif defined(__MIPSEL__)
19# include <linux/unaligned/le_struct.h>
20# include <linux/unaligned/be_byteshift.h>
21# include <linux/unaligned/generic.h>
22# define get_unaligned __get_unaligned_le
23# define put_unaligned __put_unaligned_le
24#else
25# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
26#endif
27
28#endif /* _ASM_MIPS_UNALIGNED_H */
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
deleted file mode 100644
index 4964c82f85f9..000000000000
--- a/include/asm-mips/unistd.h
+++ /dev/null
@@ -1,1019 +0,0 @@
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 * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 *
9 * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
10 * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
11 */
12#ifndef _ASM_UNISTD_H
13#define _ASM_UNISTD_H
14
15#include <asm/sgidefs.h>
16
17#if _MIPS_SIM == _MIPS_SIM_ABI32
18
19/*
20 * Linux o32 style syscalls are in the range from 4000 to 4999.
21 */
22#define __NR_Linux 4000
23#define __NR_syscall (__NR_Linux + 0)
24#define __NR_exit (__NR_Linux + 1)
25#define __NR_fork (__NR_Linux + 2)
26#define __NR_read (__NR_Linux + 3)
27#define __NR_write (__NR_Linux + 4)
28#define __NR_open (__NR_Linux + 5)
29#define __NR_close (__NR_Linux + 6)
30#define __NR_waitpid (__NR_Linux + 7)
31#define __NR_creat (__NR_Linux + 8)
32#define __NR_link (__NR_Linux + 9)
33#define __NR_unlink (__NR_Linux + 10)
34#define __NR_execve (__NR_Linux + 11)
35#define __NR_chdir (__NR_Linux + 12)
36#define __NR_time (__NR_Linux + 13)
37#define __NR_mknod (__NR_Linux + 14)
38#define __NR_chmod (__NR_Linux + 15)
39#define __NR_lchown (__NR_Linux + 16)
40#define __NR_break (__NR_Linux + 17)
41#define __NR_unused18 (__NR_Linux + 18)
42#define __NR_lseek (__NR_Linux + 19)
43#define __NR_getpid (__NR_Linux + 20)
44#define __NR_mount (__NR_Linux + 21)
45#define __NR_umount (__NR_Linux + 22)
46#define __NR_setuid (__NR_Linux + 23)
47#define __NR_getuid (__NR_Linux + 24)
48#define __NR_stime (__NR_Linux + 25)
49#define __NR_ptrace (__NR_Linux + 26)
50#define __NR_alarm (__NR_Linux + 27)
51#define __NR_unused28 (__NR_Linux + 28)
52#define __NR_pause (__NR_Linux + 29)
53#define __NR_utime (__NR_Linux + 30)
54#define __NR_stty (__NR_Linux + 31)
55#define __NR_gtty (__NR_Linux + 32)
56#define __NR_access (__NR_Linux + 33)
57#define __NR_nice (__NR_Linux + 34)
58#define __NR_ftime (__NR_Linux + 35)
59#define __NR_sync (__NR_Linux + 36)
60#define __NR_kill (__NR_Linux + 37)
61#define __NR_rename (__NR_Linux + 38)
62#define __NR_mkdir (__NR_Linux + 39)
63#define __NR_rmdir (__NR_Linux + 40)
64#define __NR_dup (__NR_Linux + 41)
65#define __NR_pipe (__NR_Linux + 42)
66#define __NR_times (__NR_Linux + 43)
67#define __NR_prof (__NR_Linux + 44)
68#define __NR_brk (__NR_Linux + 45)
69#define __NR_setgid (__NR_Linux + 46)
70#define __NR_getgid (__NR_Linux + 47)
71#define __NR_signal (__NR_Linux + 48)
72#define __NR_geteuid (__NR_Linux + 49)
73#define __NR_getegid (__NR_Linux + 50)
74#define __NR_acct (__NR_Linux + 51)
75#define __NR_umount2 (__NR_Linux + 52)
76#define __NR_lock (__NR_Linux + 53)
77#define __NR_ioctl (__NR_Linux + 54)
78#define __NR_fcntl (__NR_Linux + 55)
79#define __NR_mpx (__NR_Linux + 56)
80#define __NR_setpgid (__NR_Linux + 57)
81#define __NR_ulimit (__NR_Linux + 58)
82#define __NR_unused59 (__NR_Linux + 59)
83#define __NR_umask (__NR_Linux + 60)
84#define __NR_chroot (__NR_Linux + 61)
85#define __NR_ustat (__NR_Linux + 62)
86#define __NR_dup2 (__NR_Linux + 63)
87#define __NR_getppid (__NR_Linux + 64)
88#define __NR_getpgrp (__NR_Linux + 65)
89#define __NR_setsid (__NR_Linux + 66)
90#define __NR_sigaction (__NR_Linux + 67)
91#define __NR_sgetmask (__NR_Linux + 68)
92#define __NR_ssetmask (__NR_Linux + 69)
93#define __NR_setreuid (__NR_Linux + 70)
94#define __NR_setregid (__NR_Linux + 71)
95#define __NR_sigsuspend (__NR_Linux + 72)
96#define __NR_sigpending (__NR_Linux + 73)
97#define __NR_sethostname (__NR_Linux + 74)
98#define __NR_setrlimit (__NR_Linux + 75)
99#define __NR_getrlimit (__NR_Linux + 76)
100#define __NR_getrusage (__NR_Linux + 77)
101#define __NR_gettimeofday (__NR_Linux + 78)
102#define __NR_settimeofday (__NR_Linux + 79)
103#define __NR_getgroups (__NR_Linux + 80)
104#define __NR_setgroups (__NR_Linux + 81)
105#define __NR_reserved82 (__NR_Linux + 82)
106#define __NR_symlink (__NR_Linux + 83)
107#define __NR_unused84 (__NR_Linux + 84)
108#define __NR_readlink (__NR_Linux + 85)
109#define __NR_uselib (__NR_Linux + 86)
110#define __NR_swapon (__NR_Linux + 87)
111#define __NR_reboot (__NR_Linux + 88)
112#define __NR_readdir (__NR_Linux + 89)
113#define __NR_mmap (__NR_Linux + 90)
114#define __NR_munmap (__NR_Linux + 91)
115#define __NR_truncate (__NR_Linux + 92)
116#define __NR_ftruncate (__NR_Linux + 93)
117#define __NR_fchmod (__NR_Linux + 94)
118#define __NR_fchown (__NR_Linux + 95)
119#define __NR_getpriority (__NR_Linux + 96)
120#define __NR_setpriority (__NR_Linux + 97)
121#define __NR_profil (__NR_Linux + 98)
122#define __NR_statfs (__NR_Linux + 99)
123#define __NR_fstatfs (__NR_Linux + 100)
124#define __NR_ioperm (__NR_Linux + 101)
125#define __NR_socketcall (__NR_Linux + 102)
126#define __NR_syslog (__NR_Linux + 103)
127#define __NR_setitimer (__NR_Linux + 104)
128#define __NR_getitimer (__NR_Linux + 105)
129#define __NR_stat (__NR_Linux + 106)
130#define __NR_lstat (__NR_Linux + 107)
131#define __NR_fstat (__NR_Linux + 108)
132#define __NR_unused109 (__NR_Linux + 109)
133#define __NR_iopl (__NR_Linux + 110)
134#define __NR_vhangup (__NR_Linux + 111)
135#define __NR_idle (__NR_Linux + 112)
136#define __NR_vm86 (__NR_Linux + 113)
137#define __NR_wait4 (__NR_Linux + 114)
138#define __NR_swapoff (__NR_Linux + 115)
139#define __NR_sysinfo (__NR_Linux + 116)
140#define __NR_ipc (__NR_Linux + 117)
141#define __NR_fsync (__NR_Linux + 118)
142#define __NR_sigreturn (__NR_Linux + 119)
143#define __NR_clone (__NR_Linux + 120)
144#define __NR_setdomainname (__NR_Linux + 121)
145#define __NR_uname (__NR_Linux + 122)
146#define __NR_modify_ldt (__NR_Linux + 123)
147#define __NR_adjtimex (__NR_Linux + 124)
148#define __NR_mprotect (__NR_Linux + 125)
149#define __NR_sigprocmask (__NR_Linux + 126)
150#define __NR_create_module (__NR_Linux + 127)
151#define __NR_init_module (__NR_Linux + 128)
152#define __NR_delete_module (__NR_Linux + 129)
153#define __NR_get_kernel_syms (__NR_Linux + 130)
154#define __NR_quotactl (__NR_Linux + 131)
155#define __NR_getpgid (__NR_Linux + 132)
156#define __NR_fchdir (__NR_Linux + 133)
157#define __NR_bdflush (__NR_Linux + 134)
158#define __NR_sysfs (__NR_Linux + 135)
159#define __NR_personality (__NR_Linux + 136)
160#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
161#define __NR_setfsuid (__NR_Linux + 138)
162#define __NR_setfsgid (__NR_Linux + 139)
163#define __NR__llseek (__NR_Linux + 140)
164#define __NR_getdents (__NR_Linux + 141)
165#define __NR__newselect (__NR_Linux + 142)
166#define __NR_flock (__NR_Linux + 143)
167#define __NR_msync (__NR_Linux + 144)
168#define __NR_readv (__NR_Linux + 145)
169#define __NR_writev (__NR_Linux + 146)
170#define __NR_cacheflush (__NR_Linux + 147)
171#define __NR_cachectl (__NR_Linux + 148)
172#define __NR_sysmips (__NR_Linux + 149)
173#define __NR_unused150 (__NR_Linux + 150)
174#define __NR_getsid (__NR_Linux + 151)
175#define __NR_fdatasync (__NR_Linux + 152)
176#define __NR__sysctl (__NR_Linux + 153)
177#define __NR_mlock (__NR_Linux + 154)
178#define __NR_munlock (__NR_Linux + 155)
179#define __NR_mlockall (__NR_Linux + 156)
180#define __NR_munlockall (__NR_Linux + 157)
181#define __NR_sched_setparam (__NR_Linux + 158)
182#define __NR_sched_getparam (__NR_Linux + 159)
183#define __NR_sched_setscheduler (__NR_Linux + 160)
184#define __NR_sched_getscheduler (__NR_Linux + 161)
185#define __NR_sched_yield (__NR_Linux + 162)
186#define __NR_sched_get_priority_max (__NR_Linux + 163)
187#define __NR_sched_get_priority_min (__NR_Linux + 164)
188#define __NR_sched_rr_get_interval (__NR_Linux + 165)
189#define __NR_nanosleep (__NR_Linux + 166)
190#define __NR_mremap (__NR_Linux + 167)
191#define __NR_accept (__NR_Linux + 168)
192#define __NR_bind (__NR_Linux + 169)
193#define __NR_connect (__NR_Linux + 170)
194#define __NR_getpeername (__NR_Linux + 171)
195#define __NR_getsockname (__NR_Linux + 172)
196#define __NR_getsockopt (__NR_Linux + 173)
197#define __NR_listen (__NR_Linux + 174)
198#define __NR_recv (__NR_Linux + 175)
199#define __NR_recvfrom (__NR_Linux + 176)
200#define __NR_recvmsg (__NR_Linux + 177)
201#define __NR_send (__NR_Linux + 178)
202#define __NR_sendmsg (__NR_Linux + 179)
203#define __NR_sendto (__NR_Linux + 180)
204#define __NR_setsockopt (__NR_Linux + 181)
205#define __NR_shutdown (__NR_Linux + 182)
206#define __NR_socket (__NR_Linux + 183)
207#define __NR_socketpair (__NR_Linux + 184)
208#define __NR_setresuid (__NR_Linux + 185)
209#define __NR_getresuid (__NR_Linux + 186)
210#define __NR_query_module (__NR_Linux + 187)
211#define __NR_poll (__NR_Linux + 188)
212#define __NR_nfsservctl (__NR_Linux + 189)
213#define __NR_setresgid (__NR_Linux + 190)
214#define __NR_getresgid (__NR_Linux + 191)
215#define __NR_prctl (__NR_Linux + 192)
216#define __NR_rt_sigreturn (__NR_Linux + 193)
217#define __NR_rt_sigaction (__NR_Linux + 194)
218#define __NR_rt_sigprocmask (__NR_Linux + 195)
219#define __NR_rt_sigpending (__NR_Linux + 196)
220#define __NR_rt_sigtimedwait (__NR_Linux + 197)
221#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
222#define __NR_rt_sigsuspend (__NR_Linux + 199)
223#define __NR_pread64 (__NR_Linux + 200)
224#define __NR_pwrite64 (__NR_Linux + 201)
225#define __NR_chown (__NR_Linux + 202)
226#define __NR_getcwd (__NR_Linux + 203)
227#define __NR_capget (__NR_Linux + 204)
228#define __NR_capset (__NR_Linux + 205)
229#define __NR_sigaltstack (__NR_Linux + 206)
230#define __NR_sendfile (__NR_Linux + 207)
231#define __NR_getpmsg (__NR_Linux + 208)
232#define __NR_putpmsg (__NR_Linux + 209)
233#define __NR_mmap2 (__NR_Linux + 210)
234#define __NR_truncate64 (__NR_Linux + 211)
235#define __NR_ftruncate64 (__NR_Linux + 212)
236#define __NR_stat64 (__NR_Linux + 213)
237#define __NR_lstat64 (__NR_Linux + 214)
238#define __NR_fstat64 (__NR_Linux + 215)
239#define __NR_pivot_root (__NR_Linux + 216)
240#define __NR_mincore (__NR_Linux + 217)
241#define __NR_madvise (__NR_Linux + 218)
242#define __NR_getdents64 (__NR_Linux + 219)
243#define __NR_fcntl64 (__NR_Linux + 220)
244#define __NR_reserved221 (__NR_Linux + 221)
245#define __NR_gettid (__NR_Linux + 222)
246#define __NR_readahead (__NR_Linux + 223)
247#define __NR_setxattr (__NR_Linux + 224)
248#define __NR_lsetxattr (__NR_Linux + 225)
249#define __NR_fsetxattr (__NR_Linux + 226)
250#define __NR_getxattr (__NR_Linux + 227)
251#define __NR_lgetxattr (__NR_Linux + 228)
252#define __NR_fgetxattr (__NR_Linux + 229)
253#define __NR_listxattr (__NR_Linux + 230)
254#define __NR_llistxattr (__NR_Linux + 231)
255#define __NR_flistxattr (__NR_Linux + 232)
256#define __NR_removexattr (__NR_Linux + 233)
257#define __NR_lremovexattr (__NR_Linux + 234)
258#define __NR_fremovexattr (__NR_Linux + 235)
259#define __NR_tkill (__NR_Linux + 236)
260#define __NR_sendfile64 (__NR_Linux + 237)
261#define __NR_futex (__NR_Linux + 238)
262#define __NR_sched_setaffinity (__NR_Linux + 239)
263#define __NR_sched_getaffinity (__NR_Linux + 240)
264#define __NR_io_setup (__NR_Linux + 241)
265#define __NR_io_destroy (__NR_Linux + 242)
266#define __NR_io_getevents (__NR_Linux + 243)
267#define __NR_io_submit (__NR_Linux + 244)
268#define __NR_io_cancel (__NR_Linux + 245)
269#define __NR_exit_group (__NR_Linux + 246)
270#define __NR_lookup_dcookie (__NR_Linux + 247)
271#define __NR_epoll_create (__NR_Linux + 248)
272#define __NR_epoll_ctl (__NR_Linux + 249)
273#define __NR_epoll_wait (__NR_Linux + 250)
274#define __NR_remap_file_pages (__NR_Linux + 251)
275#define __NR_set_tid_address (__NR_Linux + 252)
276#define __NR_restart_syscall (__NR_Linux + 253)
277#define __NR_fadvise64 (__NR_Linux + 254)
278#define __NR_statfs64 (__NR_Linux + 255)
279#define __NR_fstatfs64 (__NR_Linux + 256)
280#define __NR_timer_create (__NR_Linux + 257)
281#define __NR_timer_settime (__NR_Linux + 258)
282#define __NR_timer_gettime (__NR_Linux + 259)
283#define __NR_timer_getoverrun (__NR_Linux + 260)
284#define __NR_timer_delete (__NR_Linux + 261)
285#define __NR_clock_settime (__NR_Linux + 262)
286#define __NR_clock_gettime (__NR_Linux + 263)
287#define __NR_clock_getres (__NR_Linux + 264)
288#define __NR_clock_nanosleep (__NR_Linux + 265)
289#define __NR_tgkill (__NR_Linux + 266)
290#define __NR_utimes (__NR_Linux + 267)
291#define __NR_mbind (__NR_Linux + 268)
292#define __NR_get_mempolicy (__NR_Linux + 269)
293#define __NR_set_mempolicy (__NR_Linux + 270)
294#define __NR_mq_open (__NR_Linux + 271)
295#define __NR_mq_unlink (__NR_Linux + 272)
296#define __NR_mq_timedsend (__NR_Linux + 273)
297#define __NR_mq_timedreceive (__NR_Linux + 274)
298#define __NR_mq_notify (__NR_Linux + 275)
299#define __NR_mq_getsetattr (__NR_Linux + 276)
300#define __NR_vserver (__NR_Linux + 277)
301#define __NR_waitid (__NR_Linux + 278)
302/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
303#define __NR_add_key (__NR_Linux + 280)
304#define __NR_request_key (__NR_Linux + 281)
305#define __NR_keyctl (__NR_Linux + 282)
306#define __NR_set_thread_area (__NR_Linux + 283)
307#define __NR_inotify_init (__NR_Linux + 284)
308#define __NR_inotify_add_watch (__NR_Linux + 285)
309#define __NR_inotify_rm_watch (__NR_Linux + 286)
310#define __NR_migrate_pages (__NR_Linux + 287)
311#define __NR_openat (__NR_Linux + 288)
312#define __NR_mkdirat (__NR_Linux + 289)
313#define __NR_mknodat (__NR_Linux + 290)
314#define __NR_fchownat (__NR_Linux + 291)
315#define __NR_futimesat (__NR_Linux + 292)
316#define __NR_fstatat64 (__NR_Linux + 293)
317#define __NR_unlinkat (__NR_Linux + 294)
318#define __NR_renameat (__NR_Linux + 295)
319#define __NR_linkat (__NR_Linux + 296)
320#define __NR_symlinkat (__NR_Linux + 297)
321#define __NR_readlinkat (__NR_Linux + 298)
322#define __NR_fchmodat (__NR_Linux + 299)
323#define __NR_faccessat (__NR_Linux + 300)
324#define __NR_pselect6 (__NR_Linux + 301)
325#define __NR_ppoll (__NR_Linux + 302)
326#define __NR_unshare (__NR_Linux + 303)
327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305)
329#define __NR_tee (__NR_Linux + 306)
330#define __NR_vmsplice (__NR_Linux + 307)
331#define __NR_move_pages (__NR_Linux + 308)
332#define __NR_set_robust_list (__NR_Linux + 309)
333#define __NR_get_robust_list (__NR_Linux + 310)
334#define __NR_kexec_load (__NR_Linux + 311)
335#define __NR_getcpu (__NR_Linux + 312)
336#define __NR_epoll_pwait (__NR_Linux + 313)
337#define __NR_ioprio_set (__NR_Linux + 314)
338#define __NR_ioprio_get (__NR_Linux + 315)
339#define __NR_utimensat (__NR_Linux + 316)
340#define __NR_signalfd (__NR_Linux + 317)
341#define __NR_timerfd (__NR_Linux + 318)
342#define __NR_eventfd (__NR_Linux + 319)
343#define __NR_fallocate (__NR_Linux + 320)
344#define __NR_timerfd_create (__NR_Linux + 321)
345#define __NR_timerfd_gettime (__NR_Linux + 322)
346#define __NR_timerfd_settime (__NR_Linux + 323)
347
348/*
349 * Offset of the last Linux o32 flavoured syscall
350 */
351#define __NR_Linux_syscalls 323
352
353#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
354
355#define __NR_O32_Linux 4000
356#define __NR_O32_Linux_syscalls 323
357
358#if _MIPS_SIM == _MIPS_SIM_ABI64
359
360/*
361 * Linux 64-bit syscalls are in the range from 5000 to 5999.
362 */
363#define __NR_Linux 5000
364#define __NR_read (__NR_Linux + 0)
365#define __NR_write (__NR_Linux + 1)
366#define __NR_open (__NR_Linux + 2)
367#define __NR_close (__NR_Linux + 3)
368#define __NR_stat (__NR_Linux + 4)
369#define __NR_fstat (__NR_Linux + 5)
370#define __NR_lstat (__NR_Linux + 6)
371#define __NR_poll (__NR_Linux + 7)
372#define __NR_lseek (__NR_Linux + 8)
373#define __NR_mmap (__NR_Linux + 9)
374#define __NR_mprotect (__NR_Linux + 10)
375#define __NR_munmap (__NR_Linux + 11)
376#define __NR_brk (__NR_Linux + 12)
377#define __NR_rt_sigaction (__NR_Linux + 13)
378#define __NR_rt_sigprocmask (__NR_Linux + 14)
379#define __NR_ioctl (__NR_Linux + 15)
380#define __NR_pread64 (__NR_Linux + 16)
381#define __NR_pwrite64 (__NR_Linux + 17)
382#define __NR_readv (__NR_Linux + 18)
383#define __NR_writev (__NR_Linux + 19)
384#define __NR_access (__NR_Linux + 20)
385#define __NR_pipe (__NR_Linux + 21)
386#define __NR__newselect (__NR_Linux + 22)
387#define __NR_sched_yield (__NR_Linux + 23)
388#define __NR_mremap (__NR_Linux + 24)
389#define __NR_msync (__NR_Linux + 25)
390#define __NR_mincore (__NR_Linux + 26)
391#define __NR_madvise (__NR_Linux + 27)
392#define __NR_shmget (__NR_Linux + 28)
393#define __NR_shmat (__NR_Linux + 29)
394#define __NR_shmctl (__NR_Linux + 30)
395#define __NR_dup (__NR_Linux + 31)
396#define __NR_dup2 (__NR_Linux + 32)
397#define __NR_pause (__NR_Linux + 33)
398#define __NR_nanosleep (__NR_Linux + 34)
399#define __NR_getitimer (__NR_Linux + 35)
400#define __NR_setitimer (__NR_Linux + 36)
401#define __NR_alarm (__NR_Linux + 37)
402#define __NR_getpid (__NR_Linux + 38)
403#define __NR_sendfile (__NR_Linux + 39)
404#define __NR_socket (__NR_Linux + 40)
405#define __NR_connect (__NR_Linux + 41)
406#define __NR_accept (__NR_Linux + 42)
407#define __NR_sendto (__NR_Linux + 43)
408#define __NR_recvfrom (__NR_Linux + 44)
409#define __NR_sendmsg (__NR_Linux + 45)
410#define __NR_recvmsg (__NR_Linux + 46)
411#define __NR_shutdown (__NR_Linux + 47)
412#define __NR_bind (__NR_Linux + 48)
413#define __NR_listen (__NR_Linux + 49)
414#define __NR_getsockname (__NR_Linux + 50)
415#define __NR_getpeername (__NR_Linux + 51)
416#define __NR_socketpair (__NR_Linux + 52)
417#define __NR_setsockopt (__NR_Linux + 53)
418#define __NR_getsockopt (__NR_Linux + 54)
419#define __NR_clone (__NR_Linux + 55)
420#define __NR_fork (__NR_Linux + 56)
421#define __NR_execve (__NR_Linux + 57)
422#define __NR_exit (__NR_Linux + 58)
423#define __NR_wait4 (__NR_Linux + 59)
424#define __NR_kill (__NR_Linux + 60)
425#define __NR_uname (__NR_Linux + 61)
426#define __NR_semget (__NR_Linux + 62)
427#define __NR_semop (__NR_Linux + 63)
428#define __NR_semctl (__NR_Linux + 64)
429#define __NR_shmdt (__NR_Linux + 65)
430#define __NR_msgget (__NR_Linux + 66)
431#define __NR_msgsnd (__NR_Linux + 67)
432#define __NR_msgrcv (__NR_Linux + 68)
433#define __NR_msgctl (__NR_Linux + 69)
434#define __NR_fcntl (__NR_Linux + 70)
435#define __NR_flock (__NR_Linux + 71)
436#define __NR_fsync (__NR_Linux + 72)
437#define __NR_fdatasync (__NR_Linux + 73)
438#define __NR_truncate (__NR_Linux + 74)
439#define __NR_ftruncate (__NR_Linux + 75)
440#define __NR_getdents (__NR_Linux + 76)
441#define __NR_getcwd (__NR_Linux + 77)
442#define __NR_chdir (__NR_Linux + 78)
443#define __NR_fchdir (__NR_Linux + 79)
444#define __NR_rename (__NR_Linux + 80)
445#define __NR_mkdir (__NR_Linux + 81)
446#define __NR_rmdir (__NR_Linux + 82)
447#define __NR_creat (__NR_Linux + 83)
448#define __NR_link (__NR_Linux + 84)
449#define __NR_unlink (__NR_Linux + 85)
450#define __NR_symlink (__NR_Linux + 86)
451#define __NR_readlink (__NR_Linux + 87)
452#define __NR_chmod (__NR_Linux + 88)
453#define __NR_fchmod (__NR_Linux + 89)
454#define __NR_chown (__NR_Linux + 90)
455#define __NR_fchown (__NR_Linux + 91)
456#define __NR_lchown (__NR_Linux + 92)
457#define __NR_umask (__NR_Linux + 93)
458#define __NR_gettimeofday (__NR_Linux + 94)
459#define __NR_getrlimit (__NR_Linux + 95)
460#define __NR_getrusage (__NR_Linux + 96)
461#define __NR_sysinfo (__NR_Linux + 97)
462#define __NR_times (__NR_Linux + 98)
463#define __NR_ptrace (__NR_Linux + 99)
464#define __NR_getuid (__NR_Linux + 100)
465#define __NR_syslog (__NR_Linux + 101)
466#define __NR_getgid (__NR_Linux + 102)
467#define __NR_setuid (__NR_Linux + 103)
468#define __NR_setgid (__NR_Linux + 104)
469#define __NR_geteuid (__NR_Linux + 105)
470#define __NR_getegid (__NR_Linux + 106)
471#define __NR_setpgid (__NR_Linux + 107)
472#define __NR_getppid (__NR_Linux + 108)
473#define __NR_getpgrp (__NR_Linux + 109)
474#define __NR_setsid (__NR_Linux + 110)
475#define __NR_setreuid (__NR_Linux + 111)
476#define __NR_setregid (__NR_Linux + 112)
477#define __NR_getgroups (__NR_Linux + 113)
478#define __NR_setgroups (__NR_Linux + 114)
479#define __NR_setresuid (__NR_Linux + 115)
480#define __NR_getresuid (__NR_Linux + 116)
481#define __NR_setresgid (__NR_Linux + 117)
482#define __NR_getresgid (__NR_Linux + 118)
483#define __NR_getpgid (__NR_Linux + 119)
484#define __NR_setfsuid (__NR_Linux + 120)
485#define __NR_setfsgid (__NR_Linux + 121)
486#define __NR_getsid (__NR_Linux + 122)
487#define __NR_capget (__NR_Linux + 123)
488#define __NR_capset (__NR_Linux + 124)
489#define __NR_rt_sigpending (__NR_Linux + 125)
490#define __NR_rt_sigtimedwait (__NR_Linux + 126)
491#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
492#define __NR_rt_sigsuspend (__NR_Linux + 128)
493#define __NR_sigaltstack (__NR_Linux + 129)
494#define __NR_utime (__NR_Linux + 130)
495#define __NR_mknod (__NR_Linux + 131)
496#define __NR_personality (__NR_Linux + 132)
497#define __NR_ustat (__NR_Linux + 133)
498#define __NR_statfs (__NR_Linux + 134)
499#define __NR_fstatfs (__NR_Linux + 135)
500#define __NR_sysfs (__NR_Linux + 136)
501#define __NR_getpriority (__NR_Linux + 137)
502#define __NR_setpriority (__NR_Linux + 138)
503#define __NR_sched_setparam (__NR_Linux + 139)
504#define __NR_sched_getparam (__NR_Linux + 140)
505#define __NR_sched_setscheduler (__NR_Linux + 141)
506#define __NR_sched_getscheduler (__NR_Linux + 142)
507#define __NR_sched_get_priority_max (__NR_Linux + 143)
508#define __NR_sched_get_priority_min (__NR_Linux + 144)
509#define __NR_sched_rr_get_interval (__NR_Linux + 145)
510#define __NR_mlock (__NR_Linux + 146)
511#define __NR_munlock (__NR_Linux + 147)
512#define __NR_mlockall (__NR_Linux + 148)
513#define __NR_munlockall (__NR_Linux + 149)
514#define __NR_vhangup (__NR_Linux + 150)
515#define __NR_pivot_root (__NR_Linux + 151)
516#define __NR__sysctl (__NR_Linux + 152)
517#define __NR_prctl (__NR_Linux + 153)
518#define __NR_adjtimex (__NR_Linux + 154)
519#define __NR_setrlimit (__NR_Linux + 155)
520#define __NR_chroot (__NR_Linux + 156)
521#define __NR_sync (__NR_Linux + 157)
522#define __NR_acct (__NR_Linux + 158)
523#define __NR_settimeofday (__NR_Linux + 159)
524#define __NR_mount (__NR_Linux + 160)
525#define __NR_umount2 (__NR_Linux + 161)
526#define __NR_swapon (__NR_Linux + 162)
527#define __NR_swapoff (__NR_Linux + 163)
528#define __NR_reboot (__NR_Linux + 164)
529#define __NR_sethostname (__NR_Linux + 165)
530#define __NR_setdomainname (__NR_Linux + 166)
531#define __NR_create_module (__NR_Linux + 167)
532#define __NR_init_module (__NR_Linux + 168)
533#define __NR_delete_module (__NR_Linux + 169)
534#define __NR_get_kernel_syms (__NR_Linux + 170)
535#define __NR_query_module (__NR_Linux + 171)
536#define __NR_quotactl (__NR_Linux + 172)
537#define __NR_nfsservctl (__NR_Linux + 173)
538#define __NR_getpmsg (__NR_Linux + 174)
539#define __NR_putpmsg (__NR_Linux + 175)
540#define __NR_afs_syscall (__NR_Linux + 176)
541#define __NR_reserved177 (__NR_Linux + 177)
542#define __NR_gettid (__NR_Linux + 178)
543#define __NR_readahead (__NR_Linux + 179)
544#define __NR_setxattr (__NR_Linux + 180)
545#define __NR_lsetxattr (__NR_Linux + 181)
546#define __NR_fsetxattr (__NR_Linux + 182)
547#define __NR_getxattr (__NR_Linux + 183)
548#define __NR_lgetxattr (__NR_Linux + 184)
549#define __NR_fgetxattr (__NR_Linux + 185)
550#define __NR_listxattr (__NR_Linux + 186)
551#define __NR_llistxattr (__NR_Linux + 187)
552#define __NR_flistxattr (__NR_Linux + 188)
553#define __NR_removexattr (__NR_Linux + 189)
554#define __NR_lremovexattr (__NR_Linux + 190)
555#define __NR_fremovexattr (__NR_Linux + 191)
556#define __NR_tkill (__NR_Linux + 192)
557#define __NR_reserved193 (__NR_Linux + 193)
558#define __NR_futex (__NR_Linux + 194)
559#define __NR_sched_setaffinity (__NR_Linux + 195)
560#define __NR_sched_getaffinity (__NR_Linux + 196)
561#define __NR_cacheflush (__NR_Linux + 197)
562#define __NR_cachectl (__NR_Linux + 198)
563#define __NR_sysmips (__NR_Linux + 199)
564#define __NR_io_setup (__NR_Linux + 200)
565#define __NR_io_destroy (__NR_Linux + 201)
566#define __NR_io_getevents (__NR_Linux + 202)
567#define __NR_io_submit (__NR_Linux + 203)
568#define __NR_io_cancel (__NR_Linux + 204)
569#define __NR_exit_group (__NR_Linux + 205)
570#define __NR_lookup_dcookie (__NR_Linux + 206)
571#define __NR_epoll_create (__NR_Linux + 207)
572#define __NR_epoll_ctl (__NR_Linux + 208)
573#define __NR_epoll_wait (__NR_Linux + 209)
574#define __NR_remap_file_pages (__NR_Linux + 210)
575#define __NR_rt_sigreturn (__NR_Linux + 211)
576#define __NR_set_tid_address (__NR_Linux + 212)
577#define __NR_restart_syscall (__NR_Linux + 213)
578#define __NR_semtimedop (__NR_Linux + 214)
579#define __NR_fadvise64 (__NR_Linux + 215)
580#define __NR_timer_create (__NR_Linux + 216)
581#define __NR_timer_settime (__NR_Linux + 217)
582#define __NR_timer_gettime (__NR_Linux + 218)
583#define __NR_timer_getoverrun (__NR_Linux + 219)
584#define __NR_timer_delete (__NR_Linux + 220)
585#define __NR_clock_settime (__NR_Linux + 221)
586#define __NR_clock_gettime (__NR_Linux + 222)
587#define __NR_clock_getres (__NR_Linux + 223)
588#define __NR_clock_nanosleep (__NR_Linux + 224)
589#define __NR_tgkill (__NR_Linux + 225)
590#define __NR_utimes (__NR_Linux + 226)
591#define __NR_mbind (__NR_Linux + 227)
592#define __NR_get_mempolicy (__NR_Linux + 228)
593#define __NR_set_mempolicy (__NR_Linux + 229)
594#define __NR_mq_open (__NR_Linux + 230)
595#define __NR_mq_unlink (__NR_Linux + 231)
596#define __NR_mq_timedsend (__NR_Linux + 232)
597#define __NR_mq_timedreceive (__NR_Linux + 233)
598#define __NR_mq_notify (__NR_Linux + 234)
599#define __NR_mq_getsetattr (__NR_Linux + 235)
600#define __NR_vserver (__NR_Linux + 236)
601#define __NR_waitid (__NR_Linux + 237)
602/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
603#define __NR_add_key (__NR_Linux + 239)
604#define __NR_request_key (__NR_Linux + 240)
605#define __NR_keyctl (__NR_Linux + 241)
606#define __NR_set_thread_area (__NR_Linux + 242)
607#define __NR_inotify_init (__NR_Linux + 243)
608#define __NR_inotify_add_watch (__NR_Linux + 244)
609#define __NR_inotify_rm_watch (__NR_Linux + 245)
610#define __NR_migrate_pages (__NR_Linux + 246)
611#define __NR_openat (__NR_Linux + 247)
612#define __NR_mkdirat (__NR_Linux + 248)
613#define __NR_mknodat (__NR_Linux + 249)
614#define __NR_fchownat (__NR_Linux + 250)
615#define __NR_futimesat (__NR_Linux + 251)
616#define __NR_newfstatat (__NR_Linux + 252)
617#define __NR_unlinkat (__NR_Linux + 253)
618#define __NR_renameat (__NR_Linux + 254)
619#define __NR_linkat (__NR_Linux + 255)
620#define __NR_symlinkat (__NR_Linux + 256)
621#define __NR_readlinkat (__NR_Linux + 257)
622#define __NR_fchmodat (__NR_Linux + 258)
623#define __NR_faccessat (__NR_Linux + 259)
624#define __NR_pselect6 (__NR_Linux + 260)
625#define __NR_ppoll (__NR_Linux + 261)
626#define __NR_unshare (__NR_Linux + 262)
627#define __NR_splice (__NR_Linux + 263)
628#define __NR_sync_file_range (__NR_Linux + 264)
629#define __NR_tee (__NR_Linux + 265)
630#define __NR_vmsplice (__NR_Linux + 266)
631#define __NR_move_pages (__NR_Linux + 267)
632#define __NR_set_robust_list (__NR_Linux + 268)
633#define __NR_get_robust_list (__NR_Linux + 269)
634#define __NR_kexec_load (__NR_Linux + 270)
635#define __NR_getcpu (__NR_Linux + 271)
636#define __NR_epoll_pwait (__NR_Linux + 272)
637#define __NR_ioprio_set (__NR_Linux + 273)
638#define __NR_ioprio_get (__NR_Linux + 274)
639#define __NR_utimensat (__NR_Linux + 275)
640#define __NR_signalfd (__NR_Linux + 276)
641#define __NR_timerfd (__NR_Linux + 277)
642#define __NR_eventfd (__NR_Linux + 278)
643#define __NR_fallocate (__NR_Linux + 279)
644#define __NR_timerfd_create (__NR_Linux + 280)
645#define __NR_timerfd_gettime (__NR_Linux + 281)
646#define __NR_timerfd_settime (__NR_Linux + 282)
647
648/*
649 * Offset of the last Linux 64-bit flavoured syscall
650 */
651#define __NR_Linux_syscalls 282
652
653#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
654
655#define __NR_64_Linux 5000
656#define __NR_64_Linux_syscalls 282
657
658#if _MIPS_SIM == _MIPS_SIM_NABI32
659
660/*
661 * Linux N32 syscalls are in the range from 6000 to 6999.
662 */
663#define __NR_Linux 6000
664#define __NR_read (__NR_Linux + 0)
665#define __NR_write (__NR_Linux + 1)
666#define __NR_open (__NR_Linux + 2)
667#define __NR_close (__NR_Linux + 3)
668#define __NR_stat (__NR_Linux + 4)
669#define __NR_fstat (__NR_Linux + 5)
670#define __NR_lstat (__NR_Linux + 6)
671#define __NR_poll (__NR_Linux + 7)
672#define __NR_lseek (__NR_Linux + 8)
673#define __NR_mmap (__NR_Linux + 9)
674#define __NR_mprotect (__NR_Linux + 10)
675#define __NR_munmap (__NR_Linux + 11)
676#define __NR_brk (__NR_Linux + 12)
677#define __NR_rt_sigaction (__NR_Linux + 13)
678#define __NR_rt_sigprocmask (__NR_Linux + 14)
679#define __NR_ioctl (__NR_Linux + 15)
680#define __NR_pread64 (__NR_Linux + 16)
681#define __NR_pwrite64 (__NR_Linux + 17)
682#define __NR_readv (__NR_Linux + 18)
683#define __NR_writev (__NR_Linux + 19)
684#define __NR_access (__NR_Linux + 20)
685#define __NR_pipe (__NR_Linux + 21)
686#define __NR__newselect (__NR_Linux + 22)
687#define __NR_sched_yield (__NR_Linux + 23)
688#define __NR_mremap (__NR_Linux + 24)
689#define __NR_msync (__NR_Linux + 25)
690#define __NR_mincore (__NR_Linux + 26)
691#define __NR_madvise (__NR_Linux + 27)
692#define __NR_shmget (__NR_Linux + 28)
693#define __NR_shmat (__NR_Linux + 29)
694#define __NR_shmctl (__NR_Linux + 30)
695#define __NR_dup (__NR_Linux + 31)
696#define __NR_dup2 (__NR_Linux + 32)
697#define __NR_pause (__NR_Linux + 33)
698#define __NR_nanosleep (__NR_Linux + 34)
699#define __NR_getitimer (__NR_Linux + 35)
700#define __NR_setitimer (__NR_Linux + 36)
701#define __NR_alarm (__NR_Linux + 37)
702#define __NR_getpid (__NR_Linux + 38)
703#define __NR_sendfile (__NR_Linux + 39)
704#define __NR_socket (__NR_Linux + 40)
705#define __NR_connect (__NR_Linux + 41)
706#define __NR_accept (__NR_Linux + 42)
707#define __NR_sendto (__NR_Linux + 43)
708#define __NR_recvfrom (__NR_Linux + 44)
709#define __NR_sendmsg (__NR_Linux + 45)
710#define __NR_recvmsg (__NR_Linux + 46)
711#define __NR_shutdown (__NR_Linux + 47)
712#define __NR_bind (__NR_Linux + 48)
713#define __NR_listen (__NR_Linux + 49)
714#define __NR_getsockname (__NR_Linux + 50)
715#define __NR_getpeername (__NR_Linux + 51)
716#define __NR_socketpair (__NR_Linux + 52)
717#define __NR_setsockopt (__NR_Linux + 53)
718#define __NR_getsockopt (__NR_Linux + 54)
719#define __NR_clone (__NR_Linux + 55)
720#define __NR_fork (__NR_Linux + 56)
721#define __NR_execve (__NR_Linux + 57)
722#define __NR_exit (__NR_Linux + 58)
723#define __NR_wait4 (__NR_Linux + 59)
724#define __NR_kill (__NR_Linux + 60)
725#define __NR_uname (__NR_Linux + 61)
726#define __NR_semget (__NR_Linux + 62)
727#define __NR_semop (__NR_Linux + 63)
728#define __NR_semctl (__NR_Linux + 64)
729#define __NR_shmdt (__NR_Linux + 65)
730#define __NR_msgget (__NR_Linux + 66)
731#define __NR_msgsnd (__NR_Linux + 67)
732#define __NR_msgrcv (__NR_Linux + 68)
733#define __NR_msgctl (__NR_Linux + 69)
734#define __NR_fcntl (__NR_Linux + 70)
735#define __NR_flock (__NR_Linux + 71)
736#define __NR_fsync (__NR_Linux + 72)
737#define __NR_fdatasync (__NR_Linux + 73)
738#define __NR_truncate (__NR_Linux + 74)
739#define __NR_ftruncate (__NR_Linux + 75)
740#define __NR_getdents (__NR_Linux + 76)
741#define __NR_getcwd (__NR_Linux + 77)
742#define __NR_chdir (__NR_Linux + 78)
743#define __NR_fchdir (__NR_Linux + 79)
744#define __NR_rename (__NR_Linux + 80)
745#define __NR_mkdir (__NR_Linux + 81)
746#define __NR_rmdir (__NR_Linux + 82)
747#define __NR_creat (__NR_Linux + 83)
748#define __NR_link (__NR_Linux + 84)
749#define __NR_unlink (__NR_Linux + 85)
750#define __NR_symlink (__NR_Linux + 86)
751#define __NR_readlink (__NR_Linux + 87)
752#define __NR_chmod (__NR_Linux + 88)
753#define __NR_fchmod (__NR_Linux + 89)
754#define __NR_chown (__NR_Linux + 90)
755#define __NR_fchown (__NR_Linux + 91)
756#define __NR_lchown (__NR_Linux + 92)
757#define __NR_umask (__NR_Linux + 93)
758#define __NR_gettimeofday (__NR_Linux + 94)
759#define __NR_getrlimit (__NR_Linux + 95)
760#define __NR_getrusage (__NR_Linux + 96)
761#define __NR_sysinfo (__NR_Linux + 97)
762#define __NR_times (__NR_Linux + 98)
763#define __NR_ptrace (__NR_Linux + 99)
764#define __NR_getuid (__NR_Linux + 100)
765#define __NR_syslog (__NR_Linux + 101)
766#define __NR_getgid (__NR_Linux + 102)
767#define __NR_setuid (__NR_Linux + 103)
768#define __NR_setgid (__NR_Linux + 104)
769#define __NR_geteuid (__NR_Linux + 105)
770#define __NR_getegid (__NR_Linux + 106)
771#define __NR_setpgid (__NR_Linux + 107)
772#define __NR_getppid (__NR_Linux + 108)
773#define __NR_getpgrp (__NR_Linux + 109)
774#define __NR_setsid (__NR_Linux + 110)
775#define __NR_setreuid (__NR_Linux + 111)
776#define __NR_setregid (__NR_Linux + 112)
777#define __NR_getgroups (__NR_Linux + 113)
778#define __NR_setgroups (__NR_Linux + 114)
779#define __NR_setresuid (__NR_Linux + 115)
780#define __NR_getresuid (__NR_Linux + 116)
781#define __NR_setresgid (__NR_Linux + 117)
782#define __NR_getresgid (__NR_Linux + 118)
783#define __NR_getpgid (__NR_Linux + 119)
784#define __NR_setfsuid (__NR_Linux + 120)
785#define __NR_setfsgid (__NR_Linux + 121)
786#define __NR_getsid (__NR_Linux + 122)
787#define __NR_capget (__NR_Linux + 123)
788#define __NR_capset (__NR_Linux + 124)
789#define __NR_rt_sigpending (__NR_Linux + 125)
790#define __NR_rt_sigtimedwait (__NR_Linux + 126)
791#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
792#define __NR_rt_sigsuspend (__NR_Linux + 128)
793#define __NR_sigaltstack (__NR_Linux + 129)
794#define __NR_utime (__NR_Linux + 130)
795#define __NR_mknod (__NR_Linux + 131)
796#define __NR_personality (__NR_Linux + 132)
797#define __NR_ustat (__NR_Linux + 133)
798#define __NR_statfs (__NR_Linux + 134)
799#define __NR_fstatfs (__NR_Linux + 135)
800#define __NR_sysfs (__NR_Linux + 136)
801#define __NR_getpriority (__NR_Linux + 137)
802#define __NR_setpriority (__NR_Linux + 138)
803#define __NR_sched_setparam (__NR_Linux + 139)
804#define __NR_sched_getparam (__NR_Linux + 140)
805#define __NR_sched_setscheduler (__NR_Linux + 141)
806#define __NR_sched_getscheduler (__NR_Linux + 142)
807#define __NR_sched_get_priority_max (__NR_Linux + 143)
808#define __NR_sched_get_priority_min (__NR_Linux + 144)
809#define __NR_sched_rr_get_interval (__NR_Linux + 145)
810#define __NR_mlock (__NR_Linux + 146)
811#define __NR_munlock (__NR_Linux + 147)
812#define __NR_mlockall (__NR_Linux + 148)
813#define __NR_munlockall (__NR_Linux + 149)
814#define __NR_vhangup (__NR_Linux + 150)
815#define __NR_pivot_root (__NR_Linux + 151)
816#define __NR__sysctl (__NR_Linux + 152)
817#define __NR_prctl (__NR_Linux + 153)
818#define __NR_adjtimex (__NR_Linux + 154)
819#define __NR_setrlimit (__NR_Linux + 155)
820#define __NR_chroot (__NR_Linux + 156)
821#define __NR_sync (__NR_Linux + 157)
822#define __NR_acct (__NR_Linux + 158)
823#define __NR_settimeofday (__NR_Linux + 159)
824#define __NR_mount (__NR_Linux + 160)
825#define __NR_umount2 (__NR_Linux + 161)
826#define __NR_swapon (__NR_Linux + 162)
827#define __NR_swapoff (__NR_Linux + 163)
828#define __NR_reboot (__NR_Linux + 164)
829#define __NR_sethostname (__NR_Linux + 165)
830#define __NR_setdomainname (__NR_Linux + 166)
831#define __NR_create_module (__NR_Linux + 167)
832#define __NR_init_module (__NR_Linux + 168)
833#define __NR_delete_module (__NR_Linux + 169)
834#define __NR_get_kernel_syms (__NR_Linux + 170)
835#define __NR_query_module (__NR_Linux + 171)
836#define __NR_quotactl (__NR_Linux + 172)
837#define __NR_nfsservctl (__NR_Linux + 173)
838#define __NR_getpmsg (__NR_Linux + 174)
839#define __NR_putpmsg (__NR_Linux + 175)
840#define __NR_afs_syscall (__NR_Linux + 176)
841#define __NR_reserved177 (__NR_Linux + 177)
842#define __NR_gettid (__NR_Linux + 178)
843#define __NR_readahead (__NR_Linux + 179)
844#define __NR_setxattr (__NR_Linux + 180)
845#define __NR_lsetxattr (__NR_Linux + 181)
846#define __NR_fsetxattr (__NR_Linux + 182)
847#define __NR_getxattr (__NR_Linux + 183)
848#define __NR_lgetxattr (__NR_Linux + 184)
849#define __NR_fgetxattr (__NR_Linux + 185)
850#define __NR_listxattr (__NR_Linux + 186)
851#define __NR_llistxattr (__NR_Linux + 187)
852#define __NR_flistxattr (__NR_Linux + 188)
853#define __NR_removexattr (__NR_Linux + 189)
854#define __NR_lremovexattr (__NR_Linux + 190)
855#define __NR_fremovexattr (__NR_Linux + 191)
856#define __NR_tkill (__NR_Linux + 192)
857#define __NR_reserved193 (__NR_Linux + 193)
858#define __NR_futex (__NR_Linux + 194)
859#define __NR_sched_setaffinity (__NR_Linux + 195)
860#define __NR_sched_getaffinity (__NR_Linux + 196)
861#define __NR_cacheflush (__NR_Linux + 197)
862#define __NR_cachectl (__NR_Linux + 198)
863#define __NR_sysmips (__NR_Linux + 199)
864#define __NR_io_setup (__NR_Linux + 200)
865#define __NR_io_destroy (__NR_Linux + 201)
866#define __NR_io_getevents (__NR_Linux + 202)
867#define __NR_io_submit (__NR_Linux + 203)
868#define __NR_io_cancel (__NR_Linux + 204)
869#define __NR_exit_group (__NR_Linux + 205)
870#define __NR_lookup_dcookie (__NR_Linux + 206)
871#define __NR_epoll_create (__NR_Linux + 207)
872#define __NR_epoll_ctl (__NR_Linux + 208)
873#define __NR_epoll_wait (__NR_Linux + 209)
874#define __NR_remap_file_pages (__NR_Linux + 210)
875#define __NR_rt_sigreturn (__NR_Linux + 211)
876#define __NR_fcntl64 (__NR_Linux + 212)
877#define __NR_set_tid_address (__NR_Linux + 213)
878#define __NR_restart_syscall (__NR_Linux + 214)
879#define __NR_semtimedop (__NR_Linux + 215)
880#define __NR_fadvise64 (__NR_Linux + 216)
881#define __NR_statfs64 (__NR_Linux + 217)
882#define __NR_fstatfs64 (__NR_Linux + 218)
883#define __NR_sendfile64 (__NR_Linux + 219)
884#define __NR_timer_create (__NR_Linux + 220)
885#define __NR_timer_settime (__NR_Linux + 221)
886#define __NR_timer_gettime (__NR_Linux + 222)
887#define __NR_timer_getoverrun (__NR_Linux + 223)
888#define __NR_timer_delete (__NR_Linux + 224)
889#define __NR_clock_settime (__NR_Linux + 225)
890#define __NR_clock_gettime (__NR_Linux + 226)
891#define __NR_clock_getres (__NR_Linux + 227)
892#define __NR_clock_nanosleep (__NR_Linux + 228)
893#define __NR_tgkill (__NR_Linux + 229)
894#define __NR_utimes (__NR_Linux + 230)
895#define __NR_mbind (__NR_Linux + 231)
896#define __NR_get_mempolicy (__NR_Linux + 232)
897#define __NR_set_mempolicy (__NR_Linux + 233)
898#define __NR_mq_open (__NR_Linux + 234)
899#define __NR_mq_unlink (__NR_Linux + 235)
900#define __NR_mq_timedsend (__NR_Linux + 236)
901#define __NR_mq_timedreceive (__NR_Linux + 237)
902#define __NR_mq_notify (__NR_Linux + 238)
903#define __NR_mq_getsetattr (__NR_Linux + 239)
904#define __NR_vserver (__NR_Linux + 240)
905#define __NR_waitid (__NR_Linux + 241)
906/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
907#define __NR_add_key (__NR_Linux + 243)
908#define __NR_request_key (__NR_Linux + 244)
909#define __NR_keyctl (__NR_Linux + 245)
910#define __NR_set_thread_area (__NR_Linux + 246)
911#define __NR_inotify_init (__NR_Linux + 247)
912#define __NR_inotify_add_watch (__NR_Linux + 248)
913#define __NR_inotify_rm_watch (__NR_Linux + 249)
914#define __NR_migrate_pages (__NR_Linux + 250)
915#define __NR_openat (__NR_Linux + 251)
916#define __NR_mkdirat (__NR_Linux + 252)
917#define __NR_mknodat (__NR_Linux + 253)
918#define __NR_fchownat (__NR_Linux + 254)
919#define __NR_futimesat (__NR_Linux + 255)
920#define __NR_newfstatat (__NR_Linux + 256)
921#define __NR_unlinkat (__NR_Linux + 257)
922#define __NR_renameat (__NR_Linux + 258)
923#define __NR_linkat (__NR_Linux + 259)
924#define __NR_symlinkat (__NR_Linux + 260)
925#define __NR_readlinkat (__NR_Linux + 261)
926#define __NR_fchmodat (__NR_Linux + 262)
927#define __NR_faccessat (__NR_Linux + 263)
928#define __NR_pselect6 (__NR_Linux + 264)
929#define __NR_ppoll (__NR_Linux + 265)
930#define __NR_unshare (__NR_Linux + 266)
931#define __NR_splice (__NR_Linux + 267)
932#define __NR_sync_file_range (__NR_Linux + 268)
933#define __NR_tee (__NR_Linux + 269)
934#define __NR_vmsplice (__NR_Linux + 270)
935#define __NR_move_pages (__NR_Linux + 271)
936#define __NR_set_robust_list (__NR_Linux + 272)
937#define __NR_get_robust_list (__NR_Linux + 273)
938#define __NR_kexec_load (__NR_Linux + 274)
939#define __NR_getcpu (__NR_Linux + 275)
940#define __NR_epoll_pwait (__NR_Linux + 276)
941#define __NR_ioprio_set (__NR_Linux + 277)
942#define __NR_ioprio_get (__NR_Linux + 278)
943#define __NR_utimensat (__NR_Linux + 279)
944#define __NR_signalfd (__NR_Linux + 280)
945#define __NR_timerfd (__NR_Linux + 281)
946#define __NR_eventfd (__NR_Linux + 282)
947#define __NR_fallocate (__NR_Linux + 283)
948#define __NR_timerfd_create (__NR_Linux + 284)
949#define __NR_timerfd_gettime (__NR_Linux + 285)
950#define __NR_timerfd_settime (__NR_Linux + 286)
951
952/*
953 * Offset of the last N32 flavoured syscall
954 */
955#define __NR_Linux_syscalls 286
956
957#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
958
959#define __NR_N32_Linux 6000
960#define __NR_N32_Linux_syscalls 286
961
962#ifdef __KERNEL__
963
964#ifndef __ASSEMBLY__
965
966#define __ARCH_OMIT_COMPAT_SYS_GETDENTS64
967#define __ARCH_WANT_IPC_PARSE_VERSION
968#define __ARCH_WANT_OLD_READDIR
969#define __ARCH_WANT_SYS_ALARM
970#define __ARCH_WANT_SYS_GETHOSTNAME
971#define __ARCH_WANT_SYS_PAUSE
972#define __ARCH_WANT_SYS_SGETMASK
973#define __ARCH_WANT_SYS_UTIME
974#define __ARCH_WANT_SYS_WAITPID
975#define __ARCH_WANT_SYS_SOCKETCALL
976#define __ARCH_WANT_SYS_GETPGRP
977#define __ARCH_WANT_SYS_LLSEEK
978#define __ARCH_WANT_SYS_NICE
979#define __ARCH_WANT_SYS_OLD_GETRLIMIT
980#define __ARCH_WANT_SYS_OLDUMOUNT
981#define __ARCH_WANT_SYS_SIGPENDING
982#define __ARCH_WANT_SYS_SIGPROCMASK
983#define __ARCH_WANT_SYS_RT_SIGACTION
984# ifdef CONFIG_32BIT
985# define __ARCH_WANT_STAT64
986# define __ARCH_WANT_SYS_TIME
987# endif
988# ifdef CONFIG_MIPS32_O32
989# define __ARCH_WANT_COMPAT_SYS_TIME
990# endif
991
992/* whitelists for checksyscalls */
993#define __IGNORE_select
994#define __IGNORE_vfork
995#define __IGNORE_time
996#define __IGNORE_uselib
997#define __IGNORE_fadvise64_64
998#define __IGNORE_getdents64
999#if _MIPS_SIM == _MIPS_SIM_NABI32
1000#define __IGNORE_truncate64
1001#define __IGNORE_ftruncate64
1002#define __IGNORE_stat64
1003#define __IGNORE_lstat64
1004#define __IGNORE_fstat64
1005#define __IGNORE_fstatat64
1006#endif
1007
1008#endif /* !__ASSEMBLY__ */
1009
1010/*
1011 * "Conditional" syscalls
1012 *
1013 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
1014 * but it doesn't work on all toolchains, so we just do it by hand
1015 */
1016#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall")
1017
1018#endif /* __KERNEL__ */
1019#endif /* _ASM_UNISTD_H */
diff --git a/include/asm-mips/user.h b/include/asm-mips/user.h
deleted file mode 100644
index afa83a4c1888..000000000000
--- a/include/asm-mips/user.h
+++ /dev/null
@@ -1,58 +0,0 @@
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 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
7 */
8#ifndef _ASM_USER_H
9#define _ASM_USER_H
10
11#include <asm/page.h>
12#include <asm/reg.h>
13
14/*
15 * Core file format: The core file is written in such a way that gdb
16 * can understand it and provide useful information to the user (under
17 * linux we use the `trad-core' bfd, NOT the irix-core). The file
18 * contents are as follows:
19 *
20 * upage: 1 page consisting of a user struct that tells gdb
21 * what is present in the file. Directly after this is a
22 * copy of the task_struct, which is currently not used by gdb,
23 * but it may come in handy at some point. All of the registers
24 * are stored as part of the upage. The upage should always be
25 * only one page long.
26 * data: The data segment follows next. We use current->end_text to
27 * current->brk to pick up all of the user variables, plus any memory
28 * that may have been sbrk'ed. No attempt is made to determine if a
29 * page is demand-zero or if a page is totally unused, we just cover
30 * the entire range. All of the addresses are rounded in such a way
31 * that an integral number of pages is written.
32 * stack: We need the stack information in order to get a meaningful
33 * backtrace. We need to write the data from usp to
34 * current->start_stack, so we round each of these in order to be able
35 * to write an integer number of pages.
36 */
37struct user {
38 unsigned long regs[EF_SIZE / /* integer and fp regs */
39 sizeof(unsigned long) + 64];
40 size_t u_tsize; /* text size (pages) */
41 size_t u_dsize; /* data size (pages) */
42 size_t u_ssize; /* stack size (pages) */
43 unsigned long start_code; /* text starting address */
44 unsigned long start_data; /* data starting address */
45 unsigned long start_stack; /* stack starting address */
46 long int signal; /* signal causing core dump */
47 unsigned long u_ar0; /* help gdb find registers */
48 unsigned long magic; /* identifies a core file */
49 char u_comm[32]; /* user command name */
50};
51
52#define NBPG PAGE_SIZE
53#define UPAGES 1
54#define HOST_TEXT_START_ADDR (u.start_code)
55#define HOST_DATA_START_ADDR (u.start_data)
56#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
57
58#endif /* _ASM_USER_H */
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
deleted file mode 100644
index f4cff7e4fa8a..000000000000
--- a/include/asm-mips/vga.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Access to VGA videoram
3 *
4 * (c) 1998 Martin Mares <mj@ucw.cz>
5 */
6#ifndef _ASM_VGA_H
7#define _ASM_VGA_H
8
9#include <asm/byteorder.h>
10
11/*
12 * On the PC, we can just recalculate addresses and then
13 * access the videoram directly without any black magic.
14 */
15
16#define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x))
17
18#define vga_readb(x) (*(x))
19#define vga_writeb(x, y) (*(y) = (x))
20
21#define VT_BUF_HAVE_RW
22/*
23 * These are only needed for supporting VGA or MDA text mode, which use little
24 * endian byte ordering.
25 * In other cases, we can optimize by using native byte ordering and
26 * <linux/vt_buffer.h> has already done the right job for us.
27 */
28
29#undef scr_writew
30#undef scr_readw
31
32static inline void scr_writew(u16 val, volatile u16 *addr)
33{
34 *addr = cpu_to_le16(val);
35}
36
37static inline u16 scr_readw(volatile const u16 *addr)
38{
39 return le16_to_cpu(*addr);
40}
41
42#define scr_memcpyw(d, s, c) memcpy(d, s, c)
43#define scr_memmovew(d, s, c) memmove(d, s, c)
44#define VT_BUF_HAVE_MEMCPYW
45#define VT_BUF_HAVE_MEMMOVEW
46
47#endif /* _ASM_VGA_H */
diff --git a/include/asm-mips/vpe.h b/include/asm-mips/vpe.h
deleted file mode 100644
index c6e1b961537d..000000000000
--- a/include/asm-mips/vpe.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#ifndef _ASM_VPE_H
20#define _ASM_VPE_H
21
22struct vpe_notifications {
23 void (*start)(int vpe);
24 void (*stop)(int vpe);
25
26 struct list_head list;
27};
28
29
30extern int vpe_notify(int index, struct vpe_notifications *notify);
31
32extern void *vpe_get_shared(int index);
33extern int vpe_getuid(int index);
34extern int vpe_getgid(int index);
35extern char *vpe_getcwd(int index);
36
37#endif /* _ASM_VPE_H */
diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h
deleted file mode 100644
index e0ee05a3dfcc..000000000000
--- a/include/asm-mips/vr41xx/capcella.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * capcella.h, Include file for ZAO Networks Capcella.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ZAO_CAPCELLA_H
21#define __ZAO_CAPCELLA_H
22
23#include <asm/vr41xx/irq.h>
24
25/*
26 * General-Purpose I/O Pin Number
27 */
28#define PC104PLUS_INTA_PIN 2
29#define PC104PLUS_INTB_PIN 3
30#define PC104PLUS_INTC_PIN 4
31#define PC104PLUS_INTD_PIN 5
32
33/*
34 * Interrupt Number
35 */
36#define RTL8139_1_IRQ GIU_IRQ(PC104PLUS_INTC_PIN)
37#define RTL8139_2_IRQ GIU_IRQ(PC104PLUS_INTD_PIN)
38#define PC104PLUS_INTA_IRQ GIU_IRQ(PC104PLUS_INTA_PIN)
39#define PC104PLUS_INTB_IRQ GIU_IRQ(PC104PLUS_INTB_PIN)
40#define PC104PLUS_INTC_IRQ GIU_IRQ(PC104PLUS_INTC_PIN)
41#define PC104PLUS_INTD_IRQ GIU_IRQ(PC104PLUS_INTD_PIN)
42
43#endif /* __ZAO_CAPCELLA_H */
diff --git a/include/asm-mips/vr41xx/giu.h b/include/asm-mips/vr41xx/giu.h
deleted file mode 100644
index 0bcdd3a5c256..000000000000
--- a/include/asm-mips/vr41xx/giu.h
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * Include file for NEC VR4100 series General-purpose I/O Unit.
3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __NEC_VR41XX_GIU_H
21#define __NEC_VR41XX_GIU_H
22
23/*
24 * NEC VR4100 series GIU platform device IDs.
25 */
26enum {
27 GPIO_50PINS_PULLUPDOWN,
28 GPIO_36PINS,
29 GPIO_48PINS_EDGE_SELECT,
30};
31
32typedef enum {
33 IRQ_TRIGGER_LEVEL,
34 IRQ_TRIGGER_EDGE,
35 IRQ_TRIGGER_EDGE_FALLING,
36 IRQ_TRIGGER_EDGE_RISING,
37} irq_trigger_t;
38
39typedef enum {
40 IRQ_SIGNAL_THROUGH,
41 IRQ_SIGNAL_HOLD,
42} irq_signal_t;
43
44extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal);
45
46typedef enum {
47 IRQ_LEVEL_LOW,
48 IRQ_LEVEL_HIGH,
49} irq_level_t;
50
51extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level);
52
53typedef enum {
54 GPIO_DATA_LOW,
55 GPIO_DATA_HIGH,
56 GPIO_DATA_INVAL,
57} gpio_data_t;
58
59extern gpio_data_t vr41xx_gpio_get_pin(unsigned int pin);
60extern int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data);
61
62typedef enum {
63 GPIO_INPUT,
64 GPIO_OUTPUT,
65 GPIO_OUTPUT_DISABLE,
66} gpio_direction_t;
67
68extern int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir);
69
70typedef enum {
71 GPIO_PULL_DOWN,
72 GPIO_PULL_UP,
73 GPIO_PULL_DISABLE,
74} gpio_pull_t;
75
76extern int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull);
77
78#endif /* __NEC_VR41XX_GIU_H */
diff --git a/include/asm-mips/vr41xx/irq.h b/include/asm-mips/vr41xx/irq.h
deleted file mode 100644
index d315dfbc08f2..000000000000
--- a/include/asm-mips/vr41xx/irq.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * include/asm-mips/vr41xx/irq.h
3 *
4 * Interrupt numbers for NEC VR4100 series.
5 *
6 * Copyright (C) 1999 Michael Klar
7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17#ifndef __NEC_VR41XX_IRQ_H
18#define __NEC_VR41XX_IRQ_H
19
20/*
21 * CPU core Interrupt Numbers
22 */
23#define MIPS_CPU_IRQ_BASE 0
24#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
25#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
26#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
27#define INT0_IRQ MIPS_CPU_IRQ(2)
28#define INT1_IRQ MIPS_CPU_IRQ(3)
29#define INT2_IRQ MIPS_CPU_IRQ(4)
30#define INT3_IRQ MIPS_CPU_IRQ(5)
31#define INT4_IRQ MIPS_CPU_IRQ(6)
32#define TIMER_IRQ MIPS_CPU_IRQ(7)
33
34/*
35 * SYINT1 Interrupt Numbers
36 */
37#define SYSINT1_IRQ_BASE 8
38#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x))
39#define BATTRY_IRQ SYSINT1_IRQ(0)
40#define POWER_IRQ SYSINT1_IRQ(1)
41#define RTCLONG1_IRQ SYSINT1_IRQ(2)
42#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3)
43/* RFU */
44#define PIU_IRQ SYSINT1_IRQ(5)
45#define AIU_IRQ SYSINT1_IRQ(6)
46#define KIU_IRQ SYSINT1_IRQ(7)
47#define GIUINT_IRQ SYSINT1_IRQ(8)
48#define SIU_IRQ SYSINT1_IRQ(9)
49#define BUSERR_IRQ SYSINT1_IRQ(10)
50#define SOFTINT_IRQ SYSINT1_IRQ(11)
51#define CLKRUN_IRQ SYSINT1_IRQ(12)
52#define DOZEPIU_IRQ SYSINT1_IRQ(13)
53#define SYSINT1_IRQ_LAST DOZEPIU_IRQ
54
55/*
56 * SYSINT2 Interrupt Numbers
57 */
58#define SYSINT2_IRQ_BASE 24
59#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x))
60#define RTCLONG2_IRQ SYSINT2_IRQ(0)
61#define LED_IRQ SYSINT2_IRQ(1)
62#define HSP_IRQ SYSINT2_IRQ(2)
63#define TCLOCK_IRQ SYSINT2_IRQ(3)
64#define FIR_IRQ SYSINT2_IRQ(4)
65#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */
66#define DSIU_IRQ SYSINT2_IRQ(5)
67#define PCI_IRQ SYSINT2_IRQ(6)
68#define SCU_IRQ SYSINT2_IRQ(7)
69#define CSI_IRQ SYSINT2_IRQ(8)
70#define BCU_IRQ SYSINT2_IRQ(9)
71#define ETHERNET_IRQ SYSINT2_IRQ(10)
72#define SYSINT2_IRQ_LAST ETHERNET_IRQ
73
74/*
75 * GIU Interrupt Numbers
76 */
77#define GIU_IRQ_BASE 40
78#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */
79#define GIU_IRQ_LAST GIU_IRQ(31)
80
81/*
82 * VRC4173 Interrupt Numbers
83 */
84#define VRC4173_IRQ_BASE 72
85#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x))
86#define VRC4173_USB_IRQ VRC4173_IRQ(0)
87#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1)
88#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2)
89#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3)
90#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4)
91#define VRC4173_PIU_IRQ VRC4173_IRQ(5)
92#define VRC4173_AIU_IRQ VRC4173_IRQ(6)
93#define VRC4173_KIU_IRQ VRC4173_IRQ(7)
94#define VRC4173_GIU_IRQ VRC4173_IRQ(8)
95#define VRC4173_AC97_IRQ VRC4173_IRQ(9)
96#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10)
97/* RFU */
98#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13)
99#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ
100
101#endif /* __NEC_VR41XX_IRQ_H */
diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h
deleted file mode 100644
index 1d67df843dc3..000000000000
--- a/include/asm-mips/vr41xx/mpc30x.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * mpc30x.h, Include file for Victor MP-C303/304.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __VICTOR_MPC30X_H
21#define __VICTOR_MPC30X_H
22
23#include <asm/vr41xx/irq.h>
24
25/*
26 * General-Purpose I/O Pin Number
27 */
28#define VRC4173_PIN 1
29#define MQ200_PIN 4
30
31/*
32 * Interrupt Number
33 */
34#define VRC4173_CASCADE_IRQ GIU_IRQ(VRC4173_PIN)
35#define MQ200_IRQ GIU_IRQ(MQ200_PIN)
36
37#endif /* __VICTOR_MPC30X_H */
diff --git a/include/asm-mips/vr41xx/pci.h b/include/asm-mips/vr41xx/pci.h
deleted file mode 100644
index 6fc01ce19777..000000000000
--- a/include/asm-mips/vr41xx/pci.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * Include file for NEC VR4100 series PCI Control Unit.
3 *
4 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __NEC_VR41XX_PCI_H
21#define __NEC_VR41XX_PCI_H
22
23#define PCI_MASTER_ADDRESS_MASK 0x7fffffffU
24
25struct pci_master_address_conversion {
26 uint32_t bus_base_address;
27 uint32_t address_mask;
28 uint32_t pci_base_address;
29};
30
31struct pci_target_address_conversion {
32 uint32_t address_mask;
33 uint32_t bus_base_address;
34};
35
36typedef enum {
37 CANNOT_LOCK_FROM_DEVICE,
38 CAN_LOCK_FROM_DEVICE,
39} pci_exclusive_access_t;
40
41struct pci_mailbox_address {
42 uint32_t base_address;
43};
44
45struct pci_target_address_window {
46 uint32_t base_address;
47};
48
49typedef enum {
50 PCI_ARBITRATION_MODE_FAIR,
51 PCI_ARBITRATION_MODE_ALTERNATE_0,
52 PCI_ARBITRATION_MODE_ALTERNATE_B,
53} pci_arbiter_priority_control_t;
54
55typedef enum {
56 PCI_TAKE_AWAY_GNT_DISABLE,
57 PCI_TAKE_AWAY_GNT_ENABLE,
58} pci_take_away_gnt_mode_t;
59
60struct pci_controller_unit_setup {
61 struct pci_master_address_conversion *master_memory1;
62 struct pci_master_address_conversion *master_memory2;
63
64 struct pci_target_address_conversion *target_memory1;
65 struct pci_target_address_conversion *target_memory2;
66
67 struct pci_master_address_conversion *master_io;
68
69 pci_exclusive_access_t exclusive_access;
70
71 uint32_t pci_clock_max;
72 uint8_t wait_time_limit_from_irdy_to_trdy; /* Only VR4122 is supported */
73
74 struct pci_mailbox_address *mailbox;
75 struct pci_target_address_window *target_window1;
76 struct pci_target_address_window *target_window2;
77
78 uint8_t master_latency_timer;
79 uint8_t retry_limit;
80
81 pci_arbiter_priority_control_t arbiter_priority_control;
82 pci_take_away_gnt_mode_t take_away_gnt_mode;
83
84 struct resource *mem_resource;
85 struct resource *io_resource;
86};
87
88extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup);
89
90#endif /* __NEC_VR41XX_PCI_H */
diff --git a/include/asm-mips/vr41xx/siu.h b/include/asm-mips/vr41xx/siu.h
deleted file mode 100644
index da9f6e373409..000000000000
--- a/include/asm-mips/vr41xx/siu.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * Include file for NEC VR4100 series Serial Interface Unit.
3 *
4 * Copyright (C) 2005-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __NEC_VR41XX_SIU_H
21#define __NEC_VR41XX_SIU_H
22
23#define SIU_PORTS_MAX 2
24
25typedef enum {
26 SIU_INTERFACE_RS232C,
27 SIU_INTERFACE_IRDA,
28} siu_interface_t;
29
30extern void vr41xx_select_siu_interface(siu_interface_t interface);
31
32typedef enum {
33 SIU_USE_IRDA,
34 FIR_USE_IRDA,
35} irda_use_t;
36
37extern void vr41xx_use_irda(irda_use_t use);
38
39typedef enum {
40 SHARP_IRDA,
41 TEMIC_IRDA,
42 HP_IRDA,
43} irda_module_t;
44
45typedef enum {
46 IRDA_TX_1_5MBPS,
47 IRDA_TX_4MBPS,
48} irda_speed_t;
49
50extern void vr41xx_select_irda_module(irda_module_t module, irda_speed_t speed);
51
52#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
53extern void vr41xx_siu_early_setup(struct uart_port *port);
54#else
55static inline void vr41xx_siu_early_setup(struct uart_port *port) {}
56#endif
57
58#endif /* __NEC_VR41XX_SIU_H */
diff --git a/include/asm-mips/vr41xx/tb0219.h b/include/asm-mips/vr41xx/tb0219.h
deleted file mode 100644
index dc981b4be0a4..000000000000
--- a/include/asm-mips/vr41xx/tb0219.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * tb0219.h, Include file for TANBAC TB0219.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * Modified for TANBAC TB0219:
7 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp>
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#ifndef __TANBAC_TB0219_H
24#define __TANBAC_TB0219_H
25
26#include <asm/vr41xx/irq.h>
27
28/*
29 * General-Purpose I/O Pin Number
30 */
31#define TB0219_PCI_SLOT1_PIN 2
32#define TB0219_PCI_SLOT2_PIN 3
33#define TB0219_PCI_SLOT3_PIN 4
34
35/*
36 * Interrupt Number
37 */
38#define TB0219_PCI_SLOT1_IRQ GIU_IRQ(TB0219_PCI_SLOT1_PIN)
39#define TB0219_PCI_SLOT2_IRQ GIU_IRQ(TB0219_PCI_SLOT2_PIN)
40#define TB0219_PCI_SLOT3_IRQ GIU_IRQ(TB0219_PCI_SLOT3_PIN)
41
42#endif /* __TANBAC_TB0219_H */
diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h
deleted file mode 100644
index de527dcfa5f3..000000000000
--- a/include/asm-mips/vr41xx/tb0226.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * tb0226.h, Include file for TANBAC TB0226.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __TANBAC_TB0226_H
21#define __TANBAC_TB0226_H
22
23#include <asm/vr41xx/irq.h>
24
25/*
26 * General-Purpose I/O Pin Number
27 */
28#define GD82559_1_PIN 2
29#define GD82559_2_PIN 3
30#define UPD720100_INTA_PIN 4
31#define UPD720100_INTB_PIN 8
32#define UPD720100_INTC_PIN 13
33
34/*
35 * Interrupt Number
36 */
37#define GD82559_1_IRQ GIU_IRQ(GD82559_1_PIN)
38#define GD82559_2_IRQ GIU_IRQ(GD82559_2_PIN)
39#define UPD720100_INTA_IRQ GIU_IRQ(UPD720100_INTA_PIN)
40#define UPD720100_INTB_IRQ GIU_IRQ(UPD720100_INTB_PIN)
41#define UPD720100_INTC_IRQ GIU_IRQ(UPD720100_INTC_PIN)
42
43#endif /* __TANBAC_TB0226_H */
diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h
deleted file mode 100644
index 61bead68abf0..000000000000
--- a/include/asm-mips/vr41xx/tb0287.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * tb0287.h, Include file for TANBAC TB0287 mini-ITX board.
3 *
4 * Copyright (C) 2005 Media Lab Inc. <ito@mlb.co.jp>
5 *
6 * This code is largely based on tb0219.h.
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 Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#ifndef __TANBAC_TB0287_H
23#define __TANBAC_TB0287_H
24
25#include <asm/vr41xx/irq.h>
26
27/*
28 * General-Purpose I/O Pin Number
29 */
30#define TB0287_PCI_SLOT_PIN 2
31#define TB0287_SM501_PIN 3
32#define TB0287_SIL680A_PIN 8
33#define TB0287_RTL8110_PIN 13
34
35/*
36 * Interrupt Number
37 */
38#define TB0287_PCI_SLOT_IRQ GIU_IRQ(TB0287_PCI_SLOT_PIN)
39#define TB0287_SM501_IRQ GIU_IRQ(TB0287_SM501_PIN)
40#define TB0287_SIL680A_IRQ GIU_IRQ(TB0287_SIL680A_PIN)
41#define TB0287_RTL8110_IRQ GIU_IRQ(TB0287_RTL8110_PIN)
42
43#endif /* __TANBAC_TB0287_H */
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h
deleted file mode 100644
index 22be64971cc6..000000000000
--- a/include/asm-mips/vr41xx/vr41xx.h
+++ /dev/null
@@ -1,152 +0,0 @@
1/*
2 * include/asm-mips/vr41xx/vr41xx.h
3 *
4 * Include file for NEC VR4100 series.
5 *
6 * Copyright (C) 1999 Michael Klar
7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17#ifndef __NEC_VR41XX_H
18#define __NEC_VR41XX_H
19
20#include <linux/interrupt.h>
21
22/*
23 * CPU Revision
24 */
25/* VR4122 0x00000c70-0x00000c72 */
26#define PRID_VR4122_REV1_0 0x00000c70
27#define PRID_VR4122_REV2_0 0x00000c70
28#define PRID_VR4122_REV2_1 0x00000c70
29#define PRID_VR4122_REV3_0 0x00000c71
30#define PRID_VR4122_REV3_1 0x00000c72
31
32/* VR4181A 0x00000c73-0x00000c7f */
33#define PRID_VR4181A_REV1_0 0x00000c73
34#define PRID_VR4181A_REV1_1 0x00000c74
35
36/* VR4131 0x00000c80-0x00000c83 */
37#define PRID_VR4131_REV1_2 0x00000c80
38#define PRID_VR4131_REV2_0 0x00000c81
39#define PRID_VR4131_REV2_1 0x00000c82
40#define PRID_VR4131_REV2_2 0x00000c83
41
42/* VR4133 0x00000c84- */
43#define PRID_VR4133 0x00000c84
44
45/*
46 * Bus Control Uint
47 */
48extern unsigned long vr41xx_calculate_clock_frequency(void);
49extern unsigned long vr41xx_get_vtclock_frequency(void);
50extern unsigned long vr41xx_get_tclock_frequency(void);
51
52/*
53 * Clock Mask Unit
54 */
55typedef enum {
56 PIU_CLOCK,
57 SIU_CLOCK,
58 AIU_CLOCK,
59 KIU_CLOCK,
60 FIR_CLOCK,
61 DSIU_CLOCK,
62 CSI_CLOCK,
63 PCIU_CLOCK,
64 HSP_CLOCK,
65 PCI_CLOCK,
66 CEU_CLOCK,
67 ETHER0_CLOCK,
68 ETHER1_CLOCK
69} vr41xx_clock_t;
70
71extern void vr41xx_supply_clock(vr41xx_clock_t clock);
72extern void vr41xx_mask_clock(vr41xx_clock_t clock);
73
74/*
75 * Interrupt Control Unit
76 */
77extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
78extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int));
79
80#define PIUINT_COMMAND 0x0040
81#define PIUINT_DATA 0x0020
82#define PIUINT_PAGE1 0x0010
83#define PIUINT_PAGE0 0x0008
84#define PIUINT_DATALOST 0x0004
85#define PIUINT_STATUSCHANGE 0x0001
86
87extern void vr41xx_enable_piuint(uint16_t mask);
88extern void vr41xx_disable_piuint(uint16_t mask);
89
90#define AIUINT_INPUT_DMAEND 0x0800
91#define AIUINT_INPUT_DMAHALT 0x0400
92#define AIUINT_INPUT_DATALOST 0x0200
93#define AIUINT_INPUT_DATA 0x0100
94#define AIUINT_OUTPUT_DMAEND 0x0008
95#define AIUINT_OUTPUT_DMAHALT 0x0004
96#define AIUINT_OUTPUT_NODATA 0x0002
97
98extern void vr41xx_enable_aiuint(uint16_t mask);
99extern void vr41xx_disable_aiuint(uint16_t mask);
100
101#define KIUINT_DATALOST 0x0004
102#define KIUINT_DATAREADY 0x0002
103#define KIUINT_SCAN 0x0001
104
105extern void vr41xx_enable_kiuint(uint16_t mask);
106extern void vr41xx_disable_kiuint(uint16_t mask);
107
108#define DSIUINT_CTS 0x0800
109#define DSIUINT_RXERR 0x0400
110#define DSIUINT_RX 0x0200
111#define DSIUINT_TX 0x0100
112#define DSIUINT_ALL 0x0f00
113
114extern void vr41xx_enable_dsiuint(uint16_t mask);
115extern void vr41xx_disable_dsiuint(uint16_t mask);
116
117#define FIRINT_UNIT 0x0010
118#define FIRINT_RX_DMAEND 0x0008
119#define FIRINT_RX_DMAHALT 0x0004
120#define FIRINT_TX_DMAEND 0x0002
121#define FIRINT_TX_DMAHALT 0x0001
122
123extern void vr41xx_enable_firint(uint16_t mask);
124extern void vr41xx_disable_firint(uint16_t mask);
125
126extern void vr41xx_enable_pciint(void);
127extern void vr41xx_disable_pciint(void);
128
129extern void vr41xx_enable_scuint(void);
130extern void vr41xx_disable_scuint(void);
131
132#define CSIINT_TX_DMAEND 0x0040
133#define CSIINT_TX_DMAHALT 0x0020
134#define CSIINT_TX_DATA 0x0010
135#define CSIINT_TX_FIFOEMPTY 0x0008
136#define CSIINT_RX_DMAEND 0x0004
137#define CSIINT_RX_DMAHALT 0x0002
138#define CSIINT_RX_FIFOEMPTY 0x0001
139
140extern void vr41xx_enable_csiint(uint16_t mask);
141extern void vr41xx_disable_csiint(uint16_t mask);
142
143extern void vr41xx_enable_bcuint(void);
144extern void vr41xx_disable_bcuint(void);
145
146#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
147extern void vr41xx_siu_setup(void);
148#else
149static inline void vr41xx_siu_setup(void) {}
150#endif
151
152#endif /* __NEC_VR41XX_H */
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
deleted file mode 100644
index 22361d5e3bf0..000000000000
--- a/include/asm-mips/war.h
+++ /dev/null
@@ -1,244 +0,0 @@
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 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle
7 * Copyright (C) 2007 Maciej W. Rozycki
8 */
9#ifndef _ASM_WAR_H
10#define _ASM_WAR_H
11
12#include <war.h>
13
14/*
15 * Work around certain R4000 CPU errata (as implemented by GCC):
16 *
17 * - A double-word or a variable shift may give an incorrect result
18 * if executed immediately after starting an integer division:
19 * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
20 * erratum #28
21 * "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum
22 * #19
23 *
24 * - A double-word or a variable shift may give an incorrect result
25 * if executed while an integer multiplication is in progress:
26 * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
27 * errata #16 & #28
28 *
29 * - An integer division may give an incorrect result if started in
30 * a delay slot of a taken branch or a jump:
31 * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
32 * erratum #52
33 */
34#ifdef CONFIG_CPU_R4000_WORKAROUNDS
35#define R4000_WAR 1
36#else
37#define R4000_WAR 0
38#endif
39
40/*
41 * Work around certain R4400 CPU errata (as implemented by GCC):
42 *
43 * - A double-word or a variable shift may give an incorrect result
44 * if executed immediately after starting an integer division:
45 * "MIPS R4400MC Errata, Processor Revision 1.0", erratum #10
46 * "MIPS R4400MC Errata, Processor Revision 2.0 & 3.0", erratum #4
47 */
48#ifdef CONFIG_CPU_R4400_WORKAROUNDS
49#define R4400_WAR 1
50#else
51#define R4400_WAR 0
52#endif
53
54/*
55 * Work around the "daddi" and "daddiu" CPU errata:
56 *
57 * - The `daddi' instruction fails to trap on overflow.
58 * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
59 * erratum #23
60 *
61 * - The `daddiu' instruction can produce an incorrect result.
62 * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
63 * erratum #41
64 * "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum
65 * #15
66 * "MIPS R4400PC/SC Errata, Processor Revision 1.0", erratum #7
67 * "MIPS R4400MC Errata, Processor Revision 1.0", erratum #5
68 */
69#ifdef CONFIG_CPU_DADDI_WORKAROUNDS
70#define DADDI_WAR 1
71#else
72#define DADDI_WAR 0
73#endif
74
75/*
76 * Another R4600 erratum. Due to the lack of errata information the exact
77 * technical details aren't known. I've experimentally found that disabling
78 * interrupts during indexed I-cache flushes seems to be sufficient to deal
79 * with the issue.
80 */
81#ifndef R4600_V1_INDEX_ICACHEOP_WAR
82#error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your platform
83#endif
84
85/*
86 * Pleasures of the R4600 V1.x. Cite from the IDT R4600 V1.7 errata:
87 *
88 * 18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D,
89 * Hit_Invalidate_D and Create_Dirty_Excl_D should only be
90 * executed if there is no other dcache activity. If the dcache is
91 * accessed for another instruction immeidately preceding when these
92 * cache instructions are executing, it is possible that the dcache
93 * tag match outputs used by these cache instructions will be
94 * incorrect. These cache instructions should be preceded by at least
95 * four instructions that are not any kind of load or store
96 * instruction.
97 *
98 * This is not allowed: lw
99 * nop
100 * nop
101 * nop
102 * cache Hit_Writeback_Invalidate_D
103 *
104 * This is allowed: lw
105 * nop
106 * nop
107 * nop
108 * nop
109 * cache Hit_Writeback_Invalidate_D
110 */
111#ifndef R4600_V1_HIT_CACHEOP_WAR
112#error Check setting of R4600_V1_HIT_CACHEOP_WAR for your platform
113#endif
114
115
116/*
117 * Writeback and invalidate the primary cache dcache before DMA.
118 *
119 * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D,
120 * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only
121 * operate correctly if the internal data cache refill buffer is empty. These
122 * CACHE instructions should be separated from any potential data cache miss
123 * by a load instruction to an uncached address to empty the response buffer."
124 * (Revision 2.0 device errata from IDT available on http://www.idt.com/
125 * in .pdf format.)
126 */
127#ifndef R4600_V2_HIT_CACHEOP_WAR
128#error Check setting of R4600_V2_HIT_CACHEOP_WAR for your platform
129#endif
130
131/*
132 * When an interrupt happens on a CP0 register read instruction, CPU may
133 * lock up or read corrupted values of CP0 registers after it enters
134 * the exception handler.
135 *
136 * This workaround makes sure that we read a "safe" CP0 register as the
137 * first thing in the exception handler, which breaks one of the
138 * pre-conditions for this problem.
139 */
140#ifndef R5432_CP0_INTERRUPT_WAR
141#error Check setting of R5432_CP0_INTERRUPT_WAR for your platform
142#endif
143
144/*
145 * Workaround for the Sibyte M3 errata the text of which can be found at
146 *
147 * http://sibyte.broadcom.com/hw/bcm1250/docs/pass2errata.txt
148 *
149 * This will enable the use of a special TLB refill handler which does a
150 * consistency check on the information in c0_badvaddr and c0_entryhi and
151 * will just return and take the exception again if the information was
152 * found to be inconsistent.
153 */
154#ifndef BCM1250_M3_WAR
155#error Check setting of BCM1250_M3_WAR for your platform
156#endif
157
158/*
159 * This is a DUART workaround related to glitches around register accesses
160 */
161#ifndef SIBYTE_1956_WAR
162#error Check setting of SIBYTE_1956_WAR for your platform
163#endif
164
165/*
166 * Fill buffers not flushed on CACHE instructions
167 *
168 * Hit_Invalidate_I cacheops invalidate an icache line but the refill
169 * for that line can get stale data from the fill buffer instead of
170 * accessing memory if the previous icache miss was also to that line.
171 *
172 * Workaround: generate an icache refill from a different line
173 *
174 * Affects:
175 * MIPS 4K RTL revision <3.0, PRID revision <4
176 */
177#ifndef MIPS4K_ICACHE_REFILL_WAR
178#error Check setting of MIPS4K_ICACHE_REFILL_WAR for your platform
179#endif
180
181/*
182 * Missing implicit forced flush of evictions caused by CACHE
183 * instruction
184 *
185 * Evictions caused by a CACHE instructions are not forced on to the
186 * bus. The BIU gives higher priority to fetches than to the data from
187 * the eviction buffer and no collision detection is performed between
188 * fetches and pending data from the eviction buffer.
189 *
190 * Workaround: Execute a SYNC instruction after the cache instruction
191 *
192 * Affects:
193 * MIPS 5Kc,5Kf RTL revision <2.3, PRID revision <8
194 * MIPS 20Kc RTL revision <4.0, PRID revision <?
195 */
196#ifndef MIPS_CACHE_SYNC_WAR
197#error Check setting of MIPS_CACHE_SYNC_WAR for your platform
198#endif
199
200/*
201 * From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for
202 * the line which this instruction itself exists, the following
203 * operation is not guaranteed."
204 *
205 * Workaround: do two phase flushing for Index_Invalidate_I
206 */
207#ifndef TX49XX_ICACHE_INDEX_INV_WAR
208#error Check setting of TX49XX_ICACHE_INDEX_INV_WAR for your platform
209#endif
210
211/*
212 * On the RM9000 there is a problem which makes the CreateDirtyExclusive
213 * eache operation unusable on SMP systems.
214 */
215#ifndef RM9000_CDEX_SMP_WAR
216#error Check setting of RM9000_CDEX_SMP_WAR for your platform
217#endif
218
219/*
220 * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra
221 * opposes it being called that) where invalid instructions in the same
222 * I-cache line worth of instructions being fetched may case spurious
223 * exceptions.
224 */
225#ifndef ICACHE_REFILLS_WORKAROUND_WAR
226#error Check setting of ICACHE_REFILLS_WORKAROUND_WAR for your platform
227#endif
228
229/*
230 * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that
231 * may cause ll / sc and lld / scd sequences to execute non-atomically.
232 */
233#ifndef R10000_LLSC_WAR
234#error Check setting of R10000_LLSC_WAR for your platform
235#endif
236
237/*
238 * 34K core erratum: "Problems Executing the TLBR Instruction"
239 */
240#ifndef MIPS34K_MISSED_ITLB_WAR
241#error Check setting of MIPS34K_MISSED_ITLB_WAR for your platform
242#endif
243
244#endif /* _ASM_WAR_H */
diff --git a/include/asm-mips/wbflush.h b/include/asm-mips/wbflush.h
deleted file mode 100644
index eadc0ac47e24..000000000000
--- a/include/asm-mips/wbflush.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Header file for using the wbflush routine
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 (c) 1998 Harald Koerfgen
9 * Copyright (C) 2002 Maciej W. Rozycki
10 */
11#ifndef _ASM_WBFLUSH_H
12#define _ASM_WBFLUSH_H
13
14
15#ifdef CONFIG_CPU_HAS_WB
16
17extern void (*__wbflush)(void);
18extern void wbflush_setup(void);
19
20#define wbflush() \
21 do { \
22 __sync(); \
23 __wbflush(); \
24 } while (0)
25
26#else /* !CONFIG_CPU_HAS_WB */
27
28#define wbflush_setup() do { } while (0)
29
30#define wbflush() fast_iob()
31
32#endif /* !CONFIG_CPU_HAS_WB */
33
34#endif /* _ASM_WBFLUSH_H */
diff --git a/include/asm-mips/xor.h b/include/asm-mips/xor.h
deleted file mode 100644
index c82eb12a5b18..000000000000
--- a/include/asm-mips/xor.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/xor.h>
diff --git a/include/asm-mips/xtalk/xtalk.h b/include/asm-mips/xtalk/xtalk.h
deleted file mode 100644
index 79bac882a739..000000000000
--- a/include/asm-mips/xtalk/xtalk.h
+++ /dev/null
@@ -1,52 +0,0 @@
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 * xtalk.h -- platform-independent crosstalk interface, derived from
7 * IRIX <sys/PCI/bridge.h>, revision 1.38.
8 *
9 * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc.
10 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
11 */
12#ifndef _ASM_XTALK_XTALK_H
13#define _ASM_XTALK_XTALK_H
14
15#ifndef __ASSEMBLY__
16/*
17 * User-level device driver visible types
18 */
19typedef char xwidgetnum_t; /* xtalk widget number (0..15) */
20
21#define XWIDGET_NONE -1
22
23typedef int xwidget_part_num_t; /* xtalk widget part number */
24
25#define XWIDGET_PART_NUM_NONE -1
26
27typedef int xwidget_rev_num_t; /* xtalk widget revision number */
28
29#define XWIDGET_REV_NUM_NONE -1
30
31typedef int xwidget_mfg_num_t; /* xtalk widget manufacturing ID */
32
33#define XWIDGET_MFG_NUM_NONE -1
34
35typedef struct xtalk_piomap_s *xtalk_piomap_t;
36
37/* It is often convenient to fold the XIO target port
38 * number into the XIO address.
39 */
40#define XIO_NOWHERE (0xFFFFFFFFFFFFFFFFull)
41#define XIO_ADDR_BITS (0x0000FFFFFFFFFFFFull)
42#define XIO_PORT_BITS (0xF000000000000000ull)
43#define XIO_PORT_SHIFT (60)
44
45#define XIO_PACKED(x) (((x)&XIO_PORT_BITS) != 0)
46#define XIO_ADDR(x) ((x)&XIO_ADDR_BITS)
47#define XIO_PORT(x) ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT))
48#define XIO_PACK(p, o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS))
49
50#endif /* !__ASSEMBLY__ */
51
52#endif /* _ASM_XTALK_XTALK_H */
diff --git a/include/asm-mips/xtalk/xwidget.h b/include/asm-mips/xtalk/xwidget.h
deleted file mode 100644
index b4a13d7405ee..000000000000
--- a/include/asm-mips/xtalk/xwidget.h
+++ /dev/null
@@ -1,167 +0,0 @@
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 * xwidget.h - generic crosstalk widget header file, derived from IRIX
7 * <sys/xtalk/xtalkwidget.h>, revision 1.32.
8 *
9 * Copyright (C) 1996, 1999 Silcon Graphics, Inc.
10 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
11 */
12#ifndef _ASM_XTALK_XWIDGET_H
13#define _ASM_XTALK_XWIDGET_H
14
15#include <linux/types.h>
16#include <asm/xtalk/xtalk.h>
17
18#define WIDGET_ID 0x04
19#define WIDGET_STATUS 0x0c
20#define WIDGET_ERR_UPPER_ADDR 0x14
21#define WIDGET_ERR_LOWER_ADDR 0x1c
22#define WIDGET_CONTROL 0x24
23#define WIDGET_REQ_TIMEOUT 0x2c
24#define WIDGET_INTDEST_UPPER_ADDR 0x34
25#define WIDGET_INTDEST_LOWER_ADDR 0x3c
26#define WIDGET_ERR_CMD_WORD 0x44
27#define WIDGET_LLP_CFG 0x4c
28#define WIDGET_TFLUSH 0x54
29
30/* WIDGET_ID */
31#define WIDGET_REV_NUM 0xf0000000
32#define WIDGET_PART_NUM 0x0ffff000
33#define WIDGET_MFG_NUM 0x00000ffe
34#define WIDGET_REV_NUM_SHFT 28
35#define WIDGET_PART_NUM_SHFT 12
36#define WIDGET_MFG_NUM_SHFT 1
37
38#define XWIDGET_PART_NUM(widgetid) (((widgetid) & WIDGET_PART_NUM) >> WIDGET_PART_NUM_SHFT)
39#define XWIDGET_REV_NUM(widgetid) (((widgetid) & WIDGET_REV_NUM) >> WIDGET_REV_NUM_SHFT)
40#define XWIDGET_MFG_NUM(widgetid) (((widgetid) & WIDGET_MFG_NUM) >> WIDGET_MFG_NUM_SHFT)
41
42/* WIDGET_STATUS */
43#define WIDGET_LLP_REC_CNT 0xff000000
44#define WIDGET_LLP_TX_CNT 0x00ff0000
45#define WIDGET_PENDING 0x0000001f
46
47/* WIDGET_ERR_UPPER_ADDR */
48#define WIDGET_ERR_UPPER_ADDR_ONLY 0x0000ffff
49
50/* WIDGET_CONTROL */
51#define WIDGET_F_BAD_PKT 0x00010000
52#define WIDGET_LLP_XBAR_CRD 0x0000f000
53#define WIDGET_LLP_XBAR_CRD_SHFT 12
54#define WIDGET_CLR_RLLP_CNT 0x00000800
55#define WIDGET_CLR_TLLP_CNT 0x00000400
56#define WIDGET_SYS_END 0x00000200
57#define WIDGET_MAX_TRANS 0x000001f0
58#define WIDGET_WIDGET_ID 0x0000000f
59
60/* WIDGET_INTDEST_UPPER_ADDR */
61#define WIDGET_INT_VECTOR 0xff000000
62#define WIDGET_INT_VECTOR_SHFT 24
63#define WIDGET_TARGET_ID 0x000f0000
64#define WIDGET_TARGET_ID_SHFT 16
65#define WIDGET_UPP_ADDR 0x0000ffff
66
67/* WIDGET_ERR_CMD_WORD */
68#define WIDGET_DIDN 0xf0000000
69#define WIDGET_SIDN 0x0f000000
70#define WIDGET_PACTYP 0x00f00000
71#define WIDGET_TNUM 0x000f8000
72#define WIDGET_COHERENT 0x00004000
73#define WIDGET_DS 0x00003000
74#define WIDGET_GBR 0x00000800
75#define WIDGET_VBPM 0x00000400
76#define WIDGET_ERROR 0x00000200
77#define WIDGET_BARRIER 0x00000100
78
79/* WIDGET_LLP_CFG */
80#define WIDGET_LLP_MAXRETRY 0x03ff0000
81#define WIDGET_LLP_MAXRETRY_SHFT 16
82#define WIDGET_LLP_NULLTIMEOUT 0x0000fc00
83#define WIDGET_LLP_NULLTIMEOUT_SHFT 10
84#define WIDGET_LLP_MAXBURST 0x000003ff
85#define WIDGET_LLP_MAXBURST_SHFT 0
86
87/*
88 * according to the crosstalk spec, only 32-bits access to the widget
89 * configuration registers is allowed. some widgets may allow 64-bits
90 * access but software should not depend on it. registers beyond the
91 * widget target flush register are widget dependent thus will not be
92 * defined here
93 */
94#ifndef __ASSEMBLY__
95typedef u32 widgetreg_t;
96
97/* widget configuration registers */
98typedef volatile struct widget_cfg {
99 widgetreg_t w_pad_0; /* 0x00 */
100 widgetreg_t w_id; /* 0x04 */
101 widgetreg_t w_pad_1; /* 0x08 */
102 widgetreg_t w_status; /* 0x0c */
103 widgetreg_t w_pad_2; /* 0x10 */
104 widgetreg_t w_err_upper_addr; /* 0x14 */
105 widgetreg_t w_pad_3; /* 0x18 */
106 widgetreg_t w_err_lower_addr; /* 0x1c */
107 widgetreg_t w_pad_4; /* 0x20 */
108 widgetreg_t w_control; /* 0x24 */
109 widgetreg_t w_pad_5; /* 0x28 */
110 widgetreg_t w_req_timeout; /* 0x2c */
111 widgetreg_t w_pad_6; /* 0x30 */
112 widgetreg_t w_intdest_upper_addr; /* 0x34 */
113 widgetreg_t w_pad_7; /* 0x38 */
114 widgetreg_t w_intdest_lower_addr; /* 0x3c */
115 widgetreg_t w_pad_8; /* 0x40 */
116 widgetreg_t w_err_cmd_word; /* 0x44 */
117 widgetreg_t w_pad_9; /* 0x48 */
118 widgetreg_t w_llp_cfg; /* 0x4c */
119 widgetreg_t w_pad_10; /* 0x50 */
120 widgetreg_t w_tflush; /* 0x54 */
121} widget_cfg_t;
122
123typedef struct {
124 unsigned didn:4;
125 unsigned sidn:4;
126 unsigned pactyp:4;
127 unsigned tnum:5;
128 unsigned ct:1;
129 unsigned ds:2;
130 unsigned gbr:1;
131 unsigned vbpm:1;
132 unsigned error:1;
133 unsigned bo:1;
134 unsigned other:8;
135} w_err_cmd_word_f;
136
137typedef union {
138 widgetreg_t r;
139 w_err_cmd_word_f f;
140} w_err_cmd_word_u;
141
142typedef struct xwidget_info_s *xwidget_info_t;
143
144/*
145 * Crosstalk Widget Hardware Identification, as defined in the Crosstalk spec.
146 */
147typedef struct xwidget_hwid_s {
148 xwidget_part_num_t part_num;
149 xwidget_rev_num_t rev_num;
150 xwidget_mfg_num_t mfg_num;
151} *xwidget_hwid_t;
152
153
154/*
155 * Returns 1 if a driver that handles devices described by hwid1 is able
156 * to manage a device with hardwareid hwid2. NOTE: We don't check rev
157 * numbers at all.
158 */
159#define XWIDGET_HARDWARE_ID_MATCH(hwid1, hwid2) \
160 (((hwid1)->part_num == (hwid2)->part_num) && \
161 (((hwid1)->mfg_num == XWIDGET_MFG_NUM_NONE) || \
162 ((hwid2)->mfg_num == XWIDGET_MFG_NUM_NONE) || \
163 ((hwid1)->mfg_num == (hwid2)->mfg_num)))
164
165#endif /* !__ASSEMBLY__ */
166
167#endif /* _ASM_XTALK_XWIDGET_H */
diff --git a/include/asm-mn10300/elf.h b/include/asm-mn10300/elf.h
index 256a70466ca4..bf09f8bb392e 100644
--- a/include/asm-mn10300/elf.h
+++ b/include/asm-mn10300/elf.h
@@ -141,7 +141,7 @@ do { \
141#define ELF_PLATFORM (NULL) 141#define ELF_PLATFORM (NULL)
142 142
143#ifdef __KERNEL__ 143#ifdef __KERNEL__
144#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX) 144#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
145#endif 145#endif
146 146
147#endif /* _ASM_ELF_H */ 147#endif /* _ASM_ELF_H */
diff --git a/include/asm-parisc/a.out.h b/include/asm-parisc/a.out.h
deleted file mode 100644
index eb04e34c5bb1..000000000000
--- a/include/asm-parisc/a.out.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef __PARISC_A_OUT_H__
2#define __PARISC_A_OUT_H__
3
4struct exec
5{
6 unsigned int a_info; /* Use macros N_MAGIC, etc for access */
7 unsigned a_text; /* length of text, in bytes */
8 unsigned a_data; /* length of data, in bytes */
9 unsigned a_bss; /* length of uninitialized data area for file, in bytes */
10 unsigned a_syms; /* length of symbol table data in file, in bytes */
11 unsigned a_entry; /* start address */
12 unsigned a_trsize; /* length of relocation info for text, in bytes */
13 unsigned a_drsize; /* length of relocation info for data, in bytes */
14};
15
16#define N_TRSIZE(a) ((a).a_trsize)
17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms)
19
20#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-parisc/elf.h b/include/asm-parisc/elf.h
index d0a4a8262818..7fa675799e6d 100644
--- a/include/asm-parisc/elf.h
+++ b/include/asm-parisc/elf.h
@@ -236,7 +236,7 @@ typedef unsigned long elf_greg_t;
236 236
237#define ELF_PLATFORM ("PARISC\0") 237#define ELF_PLATFORM ("PARISC\0")
238 238
239#define SET_PERSONALITY(ex, ibcs2) \ 239#define SET_PERSONALITY(ex) \
240 current->personality = PER_LINUX; \ 240 current->personality = PER_LINUX; \
241 current->thread.map_base = DEFAULT_MAP_BASE; \ 241 current->thread.map_base = DEFAULT_MAP_BASE; \
242 current->thread.task_size = DEFAULT_TASK_SIZE \ 242 current->thread.task_size = DEFAULT_TASK_SIZE \
diff --git a/include/asm-parisc/sections.h b/include/asm-parisc/sections.h
index fdd43ec42ec5..9d13c3507ad6 100644
--- a/include/asm-parisc/sections.h
+++ b/include/asm-parisc/sections.h
@@ -4,4 +4,9 @@
4/* nothing to see, move along */ 4/* nothing to see, move along */
5#include <asm-generic/sections.h> 5#include <asm-generic/sections.h>
6 6
7#ifdef CONFIG_64BIT
8#undef dereference_function_descriptor
9void *dereference_function_descriptor(void *);
10#endif
11
7#endif 12#endif
diff --git a/include/asm-parisc/siginfo.h b/include/asm-parisc/siginfo.h
index d4909f55fe35..d7034728f377 100644
--- a/include/asm-parisc/siginfo.h
+++ b/include/asm-parisc/siginfo.h
@@ -3,11 +3,6 @@
3 3
4#include <asm-generic/siginfo.h> 4#include <asm-generic/siginfo.h>
5 5
6/*
7 * SIGTRAP si_codes
8 */
9#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
10#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint or watchpoint */
11#undef NSIGTRAP 6#undef NSIGTRAP
12#define NSIGTRAP 4 7#define NSIGTRAP 4
13 8
diff --git a/include/asm-parisc/statfs.h b/include/asm-parisc/statfs.h
index 1d2b8130b23d..324bea905dc6 100644
--- a/include/asm-parisc/statfs.h
+++ b/include/asm-parisc/statfs.h
@@ -1,58 +1,7 @@
1#ifndef _PARISC_STATFS_H 1#ifndef _PARISC_STATFS_H
2#define _PARISC_STATFS_H 2#define _PARISC_STATFS_H
3 3
4#ifndef __KERNEL_STRICT_NAMES 4#define __statfs_word long
5 5#include <asm-generic/statfs.h>
6#include <linux/types.h>
7
8typedef __kernel_fsid_t fsid_t;
9
10#endif
11
12/*
13 * It appears that PARISC could be 64 _or_ 32 bit.
14 * 64-bit fields must be explicitly 64-bit in statfs64.
15 */
16struct statfs {
17 long f_type;
18 long f_bsize;
19 long f_blocks;
20 long f_bfree;
21 long f_bavail;
22 long f_files;
23 long f_ffree;
24 __kernel_fsid_t f_fsid;
25 long f_namelen;
26 long f_frsize;
27 long f_spare[5];
28};
29
30struct statfs64 {
31 long f_type;
32 long f_bsize;
33 __u64 f_blocks;
34 __u64 f_bfree;
35 __u64 f_bavail;
36 __u64 f_files;
37 __u64 f_ffree;
38 __kernel_fsid_t f_fsid;
39 long f_namelen;
40 long f_frsize;
41 long f_spare[5];
42};
43
44struct compat_statfs64 {
45 __u32 f_type;
46 __u32 f_bsize;
47 __u64 f_blocks;
48 __u64 f_bfree;
49 __u64 f_bavail;
50 __u64 f_files;
51 __u64 f_ffree;
52 __kernel_fsid_t f_fsid;
53 __u32 f_namelen;
54 __u32 f_frsize;
55 __u32 f_spare[5];
56};
57 6
58#endif 7#endif
diff --git a/include/asm-um/dma-mapping.h b/include/asm-um/dma-mapping.h
index f0ee4fb55911..90fc708b320e 100644
--- a/include/asm-um/dma-mapping.h
+++ b/include/asm-um/dma-mapping.h
@@ -118,4 +118,11 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
118 BUG(); 118 BUG();
119} 119}
120 120
121static inline int
122dma_mapping_error(struct device *dev, dma_addr_t dma_handle)
123{
124 BUG();
125 return 0;
126}
127
121#endif 128#endif
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h
index 23d6893e8617..d0da9d7c5371 100644
--- a/include/asm-um/elf-i386.h
+++ b/include/asm-um/elf-i386.h
@@ -86,7 +86,7 @@ extern long elf_aux_hwcap;
86extern char * elf_aux_platform; 86extern char * elf_aux_platform;
87#define ELF_PLATFORM (elf_aux_platform) 87#define ELF_PLATFORM (elf_aux_platform)
88 88
89#define SET_PERSONALITY(ex, ibcs2) do { } while (0) 89#define SET_PERSONALITY(ex) do { } while (0)
90 90
91extern unsigned long vsyscall_ehdr; 91extern unsigned long vsyscall_ehdr;
92extern unsigned long vsyscall_end; 92extern unsigned long vsyscall_end;
diff --git a/include/asm-um/elf-ppc.h b/include/asm-um/elf-ppc.h
index d3b90b7ac3e9..af9463cd8ce5 100644
--- a/include/asm-um/elf-ppc.h
+++ b/include/asm-um/elf-ppc.h
@@ -5,7 +5,7 @@
5extern long elf_aux_hwcap; 5extern long elf_aux_hwcap;
6#define ELF_HWCAP (elf_aux_hwcap) 6#define ELF_HWCAP (elf_aux_hwcap)
7 7
8#define SET_PERSONALITY(ex, ibcs2) do ; while(0) 8#define SET_PERSONALITY(ex) do ; while(0)
9 9
10#define ELF_EXEC_PAGESIZE 4096 10#define ELF_EXEC_PAGESIZE 4096
11 11
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
index 3b2d5224a7e1..6e8a9195e952 100644
--- a/include/asm-um/elf-x86_64.h
+++ b/include/asm-um/elf-x86_64.h
@@ -114,6 +114,6 @@ extern long elf_aux_hwcap;
114 114
115#define ELF_PLATFORM "x86_64" 115#define ELF_PLATFORM "x86_64"
116 116
117#define SET_PERSONALITY(ex, ibcs2) do ; while(0) 117#define SET_PERSONALITY(ex) do ; while(0)
118 118
119#endif 119#endif
diff --git a/include/asm-x86/a.out-core.h b/include/asm-x86/a.out-core.h
index 714207a1c387..f5705761a37b 100644
--- a/include/asm-x86/a.out-core.h
+++ b/include/asm-x86/a.out-core.h
@@ -9,8 +9,8 @@
9 * 2 of the Licence, or (at your option) any later version. 9 * 2 of the Licence, or (at your option) any later version.
10 */ 10 */
11 11
12#ifndef _ASM_A_OUT_CORE_H 12#ifndef ASM_X86__A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H 13#define ASM_X86__A_OUT_CORE_H
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16#ifdef CONFIG_X86_32 16#ifdef CONFIG_X86_32
@@ -70,4 +70,4 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
70 70
71#endif /* CONFIG_X86_32 */ 71#endif /* CONFIG_X86_32 */
72#endif /* __KERNEL__ */ 72#endif /* __KERNEL__ */
73#endif /* _ASM_A_OUT_CORE_H */ 73#endif /* ASM_X86__A_OUT_CORE_H */
diff --git a/include/asm-x86/a.out.h b/include/asm-x86/a.out.h
index 4684f97a5bbd..0948748bc69c 100644
--- a/include/asm-x86/a.out.h
+++ b/include/asm-x86/a.out.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_A_OUT_H 1#ifndef ASM_X86__A_OUT_H
2#define _ASM_X86_A_OUT_H 2#define ASM_X86__A_OUT_H
3 3
4struct exec 4struct exec
5{ 5{
@@ -17,4 +17,4 @@ struct exec
17#define N_DRSIZE(a) ((a).a_drsize) 17#define N_DRSIZE(a) ((a).a_drsize)
18#define N_SYMSIZE(a) ((a).a_syms) 18#define N_SYMSIZE(a) ((a).a_syms)
19 19
20#endif /* _ASM_X86_A_OUT_H */ 20#endif /* ASM_X86__A_OUT_H */
diff --git a/include/asm-x86/acpi.h b/include/asm-x86/acpi.h
index 635d764dc13e..392e17336be1 100644
--- a/include/asm-x86/acpi.h
+++ b/include/asm-x86/acpi.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_ACPI_H 1#ifndef ASM_X86__ACPI_H
2#define _ASM_X86_ACPI_H 2#define ASM_X86__ACPI_H
3 3
4/* 4/*
5 * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 5 * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
@@ -140,6 +140,8 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
140 boot_cpu_data.x86_model <= 0x05 && 140 boot_cpu_data.x86_model <= 0x05 &&
141 boot_cpu_data.x86_mask < 0x0A) 141 boot_cpu_data.x86_mask < 0x0A)
142 return 1; 142 return 1;
143 else if (boot_cpu_has(X86_FEATURE_AMDC1E))
144 return 1;
143 else 145 else
144 return max_cstate; 146 return max_cstate;
145} 147}
@@ -173,4 +175,4 @@ static inline void acpi_fake_nodes(const struct bootnode *fake_nodes,
173 175
174#define acpi_unlazy_tlb(x) leave_mm(x) 176#define acpi_unlazy_tlb(x) leave_mm(x)
175 177
176#endif /*__X86_ASM_ACPI_H*/ 178#endif /* ASM_X86__ACPI_H */
diff --git a/include/asm-x86/agp.h b/include/asm-x86/agp.h
index e4004a9f6a9a..3617fd4fcdf9 100644
--- a/include/asm-x86/agp.h
+++ b/include/asm-x86/agp.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_AGP_H 1#ifndef ASM_X86__AGP_H
2#define _ASM_X86_AGP_H 2#define ASM_X86__AGP_H
3 3
4#include <asm/pgtable.h> 4#include <asm/pgtable.h>
5#include <asm/cacheflush.h> 5#include <asm/cacheflush.h>
@@ -32,4 +32,4 @@
32#define free_gatt_pages(table, order) \ 32#define free_gatt_pages(table, order) \
33 free_pages((unsigned long)(table), (order)) 33 free_pages((unsigned long)(table), (order))
34 34
35#endif 35#endif /* ASM_X86__AGP_H */
diff --git a/include/asm-x86/alternative.h b/include/asm-x86/alternative.h
index f6aa18eadf71..22d3c9862bf3 100644
--- a/include/asm-x86/alternative.h
+++ b/include/asm-x86/alternative.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_ALTERNATIVE_H 1#ifndef ASM_X86__ALTERNATIVE_H
2#define _ASM_X86_ALTERNATIVE_H 2#define ASM_X86__ALTERNATIVE_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/stddef.h> 5#include <linux/stddef.h>
@@ -180,4 +180,4 @@ extern void add_nops(void *insns, unsigned int len);
180extern void *text_poke(void *addr, const void *opcode, size_t len); 180extern void *text_poke(void *addr, const void *opcode, size_t len);
181extern void *text_poke_early(void *addr, const void *opcode, size_t len); 181extern void *text_poke_early(void *addr, const void *opcode, size_t len);
182 182
183#endif /* _ASM_X86_ALTERNATIVE_H */ 183#endif /* ASM_X86__ALTERNATIVE_H */
diff --git a/include/asm-x86/amd_iommu.h b/include/asm-x86/amd_iommu.h
index 30a12049353b..041d0db7da27 100644
--- a/include/asm-x86/amd_iommu.h
+++ b/include/asm-x86/amd_iommu.h
@@ -17,16 +17,19 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#ifndef _ASM_X86_AMD_IOMMU_H 20#ifndef ASM_X86__AMD_IOMMU_H
21#define _ASM_X86_AMD_IOMMU_H 21#define ASM_X86__AMD_IOMMU_H
22
23#include <linux/irqreturn.h>
22 24
23#ifdef CONFIG_AMD_IOMMU 25#ifdef CONFIG_AMD_IOMMU
24extern int amd_iommu_init(void); 26extern int amd_iommu_init(void);
25extern int amd_iommu_init_dma_ops(void); 27extern int amd_iommu_init_dma_ops(void);
26extern void amd_iommu_detect(void); 28extern void amd_iommu_detect(void);
29extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
27#else 30#else
28static inline int amd_iommu_init(void) { return -ENODEV; } 31static inline int amd_iommu_init(void) { return -ENODEV; }
29static inline void amd_iommu_detect(void) { } 32static inline void amd_iommu_detect(void) { }
30#endif 33#endif
31 34
32#endif 35#endif /* ASM_X86__AMD_IOMMU_H */
diff --git a/include/asm-x86/amd_iommu_types.h b/include/asm-x86/amd_iommu_types.h
index dcc812067394..b3085869a17b 100644
--- a/include/asm-x86/amd_iommu_types.h
+++ b/include/asm-x86/amd_iommu_types.h
@@ -17,8 +17,8 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20#ifndef __AMD_IOMMU_TYPES_H__ 20#ifndef ASM_X86__AMD_IOMMU_TYPES_H
21#define __AMD_IOMMU_TYPES_H__ 21#define ASM_X86__AMD_IOMMU_TYPES_H
22 22
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/list.h> 24#include <linux/list.h>
@@ -37,6 +37,7 @@
37/* Capability offsets used by the driver */ 37/* Capability offsets used by the driver */
38#define MMIO_CAP_HDR_OFFSET 0x00 38#define MMIO_CAP_HDR_OFFSET 0x00
39#define MMIO_RANGE_OFFSET 0x0c 39#define MMIO_RANGE_OFFSET 0x0c
40#define MMIO_MISC_OFFSET 0x10
40 41
41/* Masks, shifts and macros to parse the device range capability */ 42/* Masks, shifts and macros to parse the device range capability */
42#define MMIO_RANGE_LD_MASK 0xff000000 43#define MMIO_RANGE_LD_MASK 0xff000000
@@ -48,6 +49,7 @@
48#define MMIO_GET_LD(x) (((x) & MMIO_RANGE_LD_MASK) >> MMIO_RANGE_LD_SHIFT) 49#define MMIO_GET_LD(x) (((x) & MMIO_RANGE_LD_MASK) >> MMIO_RANGE_LD_SHIFT)
49#define MMIO_GET_FD(x) (((x) & MMIO_RANGE_FD_MASK) >> MMIO_RANGE_FD_SHIFT) 50#define MMIO_GET_FD(x) (((x) & MMIO_RANGE_FD_MASK) >> MMIO_RANGE_FD_SHIFT)
50#define MMIO_GET_BUS(x) (((x) & MMIO_RANGE_BUS_MASK) >> MMIO_RANGE_BUS_SHIFT) 51#define MMIO_GET_BUS(x) (((x) & MMIO_RANGE_BUS_MASK) >> MMIO_RANGE_BUS_SHIFT)
52#define MMIO_MSI_NUM(x) ((x) & 0x1f)
51 53
52/* Flag masks for the AMD IOMMU exclusion range */ 54/* Flag masks for the AMD IOMMU exclusion range */
53#define MMIO_EXCL_ENABLE_MASK 0x01ULL 55#define MMIO_EXCL_ENABLE_MASK 0x01ULL
@@ -69,6 +71,25 @@
69/* MMIO status bits */ 71/* MMIO status bits */
70#define MMIO_STATUS_COM_WAIT_INT_MASK 0x04 72#define MMIO_STATUS_COM_WAIT_INT_MASK 0x04
71 73
74/* event logging constants */
75#define EVENT_ENTRY_SIZE 0x10
76#define EVENT_TYPE_SHIFT 28
77#define EVENT_TYPE_MASK 0xf
78#define EVENT_TYPE_ILL_DEV 0x1
79#define EVENT_TYPE_IO_FAULT 0x2
80#define EVENT_TYPE_DEV_TAB_ERR 0x3
81#define EVENT_TYPE_PAGE_TAB_ERR 0x4
82#define EVENT_TYPE_ILL_CMD 0x5
83#define EVENT_TYPE_CMD_HARD_ERR 0x6
84#define EVENT_TYPE_IOTLB_INV_TO 0x7
85#define EVENT_TYPE_INV_DEV_REQ 0x8
86#define EVENT_DEVID_MASK 0xffff
87#define EVENT_DEVID_SHIFT 0
88#define EVENT_DOMID_MASK 0xffff
89#define EVENT_DOMID_SHIFT 0
90#define EVENT_FLAGS_MASK 0xfff
91#define EVENT_FLAGS_SHIFT 0x10
92
72/* feature control bits */ 93/* feature control bits */
73#define CONTROL_IOMMU_EN 0x00ULL 94#define CONTROL_IOMMU_EN 0x00ULL
74#define CONTROL_HT_TUN_EN 0x01ULL 95#define CONTROL_HT_TUN_EN 0x01ULL
@@ -109,6 +130,8 @@
109#define DEV_ENTRY_NMI_PASS 0xba 130#define DEV_ENTRY_NMI_PASS 0xba
110#define DEV_ENTRY_LINT0_PASS 0xbe 131#define DEV_ENTRY_LINT0_PASS 0xbe
111#define DEV_ENTRY_LINT1_PASS 0xbf 132#define DEV_ENTRY_LINT1_PASS 0xbf
133#define DEV_ENTRY_MODE_MASK 0x07
134#define DEV_ENTRY_MODE_SHIFT 0x09
112 135
113/* constants to configure the command buffer */ 136/* constants to configure the command buffer */
114#define CMD_BUFFER_SIZE 8192 137#define CMD_BUFFER_SIZE 8192
@@ -116,6 +139,10 @@
116#define MMIO_CMD_SIZE_SHIFT 56 139#define MMIO_CMD_SIZE_SHIFT 56
117#define MMIO_CMD_SIZE_512 (0x9ULL << MMIO_CMD_SIZE_SHIFT) 140#define MMIO_CMD_SIZE_512 (0x9ULL << MMIO_CMD_SIZE_SHIFT)
118 141
142/* constants for event buffer handling */
143#define EVT_BUFFER_SIZE 8192 /* 512 entries */
144#define EVT_LEN_MASK (0x9ULL << 56)
145
119#define PAGE_MODE_1_LEVEL 0x01 146#define PAGE_MODE_1_LEVEL 0x01
120#define PAGE_MODE_2_LEVEL 0x02 147#define PAGE_MODE_2_LEVEL 0x02
121#define PAGE_MODE_3_LEVEL 0x03 148#define PAGE_MODE_3_LEVEL 0x03
@@ -134,6 +161,7 @@
134#define IOMMU_MAP_SIZE_L3 (1ULL << 39) 161#define IOMMU_MAP_SIZE_L3 (1ULL << 39)
135 162
136#define IOMMU_PTE_P (1ULL << 0) 163#define IOMMU_PTE_P (1ULL << 0)
164#define IOMMU_PTE_TV (1ULL << 1)
137#define IOMMU_PTE_U (1ULL << 59) 165#define IOMMU_PTE_U (1ULL << 59)
138#define IOMMU_PTE_FC (1ULL << 60) 166#define IOMMU_PTE_FC (1ULL << 60)
139#define IOMMU_PTE_IR (1ULL << 61) 167#define IOMMU_PTE_IR (1ULL << 61)
@@ -159,6 +187,9 @@
159 187
160#define MAX_DOMAIN_ID 65536 188#define MAX_DOMAIN_ID 65536
161 189
190/* FIXME: move this macro to <linux/pci.h> */
191#define PCI_BUS(x) (((x) >> 8) & 0xff)
192
162/* 193/*
163 * This structure contains generic data for IOMMU protection domains 194 * This structure contains generic data for IOMMU protection domains
164 * independent of their use. 195 * independent of their use.
@@ -196,6 +227,15 @@ struct dma_ops_domain {
196 * just calculate its address in constant time. 227 * just calculate its address in constant time.
197 */ 228 */
198 u64 **pte_pages; 229 u64 **pte_pages;
230
231 /* This will be set to true when TLB needs to be flushed */
232 bool need_flush;
233
234 /*
235 * if this is a preallocated domain, keep the device for which it was
236 * preallocated in this variable
237 */
238 u16 target_dev;
199}; 239};
200 240
201/* 241/*
@@ -208,8 +248,9 @@ struct amd_iommu {
208 /* locks the accesses to the hardware */ 248 /* locks the accesses to the hardware */
209 spinlock_t lock; 249 spinlock_t lock;
210 250
211 /* device id of this IOMMU */ 251 /* Pointer to PCI device of this IOMMU */
212 u16 devid; 252 struct pci_dev *dev;
253
213 /* 254 /*
214 * Capability pointer. There could be more than one IOMMU per PCI 255 * Capability pointer. There could be more than one IOMMU per PCI
215 * device function if there are more than one AMD IOMMU capability 256 * device function if there are more than one AMD IOMMU capability
@@ -225,6 +266,9 @@ struct amd_iommu {
225 /* capabilities of that IOMMU read from ACPI */ 266 /* capabilities of that IOMMU read from ACPI */
226 u32 cap; 267 u32 cap;
227 268
269 /* pci domain of this IOMMU */
270 u16 pci_seg;
271
228 /* first device this IOMMU handles. read from PCI */ 272 /* first device this IOMMU handles. read from PCI */
229 u16 first_device; 273 u16 first_device;
230 /* last device this IOMMU handles. read from PCI */ 274 /* last device this IOMMU handles. read from PCI */
@@ -240,9 +284,19 @@ struct amd_iommu {
240 /* size of command buffer */ 284 /* size of command buffer */
241 u32 cmd_buf_size; 285 u32 cmd_buf_size;
242 286
287 /* event buffer virtual address */
288 u8 *evt_buf;
289 /* size of event buffer */
290 u32 evt_buf_size;
291 /* MSI number for event interrupt */
292 u16 evt_msi_num;
293
243 /* if one, we need to send a completion wait command */ 294 /* if one, we need to send a completion wait command */
244 int need_sync; 295 int need_sync;
245 296
297 /* true if interrupts for this IOMMU are already enabled */
298 bool int_enabled;
299
246 /* default dma_ops domain for that IOMMU */ 300 /* default dma_ops domain for that IOMMU */
247 struct dma_ops_domain *default_dom; 301 struct dma_ops_domain *default_dom;
248}; 302};
@@ -322,6 +376,12 @@ extern unsigned long *amd_iommu_pd_alloc_bitmap;
322/* will be 1 if device isolation is enabled */ 376/* will be 1 if device isolation is enabled */
323extern int amd_iommu_isolate; 377extern int amd_iommu_isolate;
324 378
379/*
380 * If true, the addresses will be flushed on unmap time, not when
381 * they are reused
382 */
383extern bool amd_iommu_unmap_flush;
384
325/* takes a PCI device id and prints it out in a readable form */ 385/* takes a PCI device id and prints it out in a readable form */
326static inline void print_devid(u16 devid, int nl) 386static inline void print_devid(u16 devid, int nl)
327{ 387{
@@ -341,4 +401,4 @@ static inline u16 calc_devid(u8 bus, u8 devfn)
341 return (((u16)bus) << 8) | devfn; 401 return (((u16)bus) << 8) | devfn;
342} 402}
343 403
344#endif 404#endif /* ASM_X86__AMD_IOMMU_TYPES_H */
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h
index 133c998161ca..d76a0839abe9 100644
--- a/include/asm-x86/apic.h
+++ b/include/asm-x86/apic.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_APIC_H 1#ifndef ASM_X86__APIC_H
2#define _ASM_X86_APIC_H 2#define ASM_X86__APIC_H
3 3
4#include <linux/pm.h> 4#include <linux/pm.h>
5#include <linux/delay.h> 5#include <linux/delay.h>
@@ -9,6 +9,8 @@
9#include <asm/apicdef.h> 9#include <asm/apicdef.h>
10#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/system.h> 11#include <asm/system.h>
12#include <asm/cpufeature.h>
13#include <asm/msr.h>
12 14
13#define ARCH_APICTIMER_STOPS_ON_C3 1 15#define ARCH_APICTIMER_STOPS_ON_C3 1
14 16
@@ -47,15 +49,18 @@ extern int disable_apic;
47#ifdef CONFIG_PARAVIRT 49#ifdef CONFIG_PARAVIRT
48#include <asm/paravirt.h> 50#include <asm/paravirt.h>
49#else 51#else
50#define apic_write native_apic_write
51#define apic_read native_apic_read
52#define setup_boot_clock setup_boot_APIC_clock 52#define setup_boot_clock setup_boot_APIC_clock
53#define setup_secondary_clock setup_secondary_APIC_clock 53#define setup_secondary_clock setup_secondary_APIC_clock
54#endif 54#endif
55 55
56extern int is_vsmp_box(void); 56extern int is_vsmp_box(void);
57extern void xapic_wait_icr_idle(void);
58extern u32 safe_xapic_wait_icr_idle(void);
59extern u64 xapic_icr_read(void);
60extern void xapic_icr_write(u32, u32);
61extern int setup_profiling_timer(unsigned int);
57 62
58static inline void native_apic_write(unsigned long reg, u32 v) 63static inline void native_apic_mem_write(u32 reg, u32 v)
59{ 64{
60 volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg); 65 volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg);
61 66
@@ -64,21 +69,72 @@ static inline void native_apic_write(unsigned long reg, u32 v)
64 ASM_OUTPUT2("0" (v), "m" (*addr))); 69 ASM_OUTPUT2("0" (v), "m" (*addr)));
65} 70}
66 71
67static inline u32 native_apic_read(unsigned long reg) 72static inline u32 native_apic_mem_read(u32 reg)
68{ 73{
69 return *((volatile u32 *)(APIC_BASE + reg)); 74 return *((volatile u32 *)(APIC_BASE + reg));
70} 75}
71 76
72extern void apic_wait_icr_idle(void); 77static inline void native_apic_msr_write(u32 reg, u32 v)
73extern u32 safe_apic_wait_icr_idle(void); 78{
79 if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
80 reg == APIC_LVR)
81 return;
82
83 wrmsr(APIC_BASE_MSR + (reg >> 4), v, 0);
84}
85
86static inline u32 native_apic_msr_read(u32 reg)
87{
88 u32 low, high;
89
90 if (reg == APIC_DFR)
91 return -1;
92
93 rdmsr(APIC_BASE_MSR + (reg >> 4), low, high);
94 return low;
95}
96
97#ifndef CONFIG_X86_32
98extern int x2apic, x2apic_preenabled;
99extern void check_x2apic(void);
100extern void enable_x2apic(void);
101extern void enable_IR_x2apic(void);
102extern void x2apic_icr_write(u32 low, u32 id);
103#endif
104
105struct apic_ops {
106 u32 (*read)(u32 reg);
107 void (*write)(u32 reg, u32 v);
108 u64 (*icr_read)(void);
109 void (*icr_write)(u32 low, u32 high);
110 void (*wait_icr_idle)(void);
111 u32 (*safe_wait_icr_idle)(void);
112};
113
114extern struct apic_ops *apic_ops;
115
116#define apic_read (apic_ops->read)
117#define apic_write (apic_ops->write)
118#define apic_icr_read (apic_ops->icr_read)
119#define apic_icr_write (apic_ops->icr_write)
120#define apic_wait_icr_idle (apic_ops->wait_icr_idle)
121#define safe_apic_wait_icr_idle (apic_ops->safe_wait_icr_idle)
122
74extern int get_physical_broadcast(void); 123extern int get_physical_broadcast(void);
75 124
125#ifdef CONFIG_X86_64
126static inline void ack_x2APIC_irq(void)
127{
128 /* Docs say use 0 for future compatibility */
129 native_apic_msr_write(APIC_EOI, 0);
130}
131#endif
132
133
76static inline void ack_APIC_irq(void) 134static inline void ack_APIC_irq(void)
77{ 135{
78 /* 136 /*
79 * ack_APIC_irq() actually gets compiled as a single instruction: 137 * ack_APIC_irq() actually gets compiled as a single instruction
80 * - a single rmw on Pentium/82489DX
81 * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
82 * ... yummie. 138 * ... yummie.
83 */ 139 */
84 140
@@ -128,4 +184,4 @@ static inline void init_apic_mappings(void) { }
128 184
129#endif /* !CONFIG_X86_LOCAL_APIC */ 185#endif /* !CONFIG_X86_LOCAL_APIC */
130 186
131#endif /* __ASM_APIC_H */ 187#endif /* ASM_X86__APIC_H */
diff --git a/include/asm-x86/apicdef.h b/include/asm-x86/apicdef.h
index 6b9008c78731..b922c85ac91d 100644
--- a/include/asm-x86/apicdef.h
+++ b/include/asm-x86/apicdef.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_APICDEF_H 1#ifndef ASM_X86__APICDEF_H
2#define _ASM_X86_APICDEF_H 2#define ASM_X86__APICDEF_H
3 3
4/* 4/*
5 * Constants for various Intel APICs. (local APIC, IOAPIC, etc.) 5 * Constants for various Intel APICs. (local APIC, IOAPIC, etc.)
@@ -105,6 +105,7 @@
105#define APIC_TMICT 0x380 105#define APIC_TMICT 0x380
106#define APIC_TMCCT 0x390 106#define APIC_TMCCT 0x390
107#define APIC_TDCR 0x3E0 107#define APIC_TDCR 0x3E0
108#define APIC_SELF_IPI 0x3F0
108#define APIC_TDR_DIV_TMBASE (1 << 2) 109#define APIC_TDR_DIV_TMBASE (1 << 2)
109#define APIC_TDR_DIV_1 0xB 110#define APIC_TDR_DIV_1 0xB
110#define APIC_TDR_DIV_2 0x0 111#define APIC_TDR_DIV_2 0x0
@@ -128,6 +129,8 @@
128#define APIC_EILVT3 0x530 129#define APIC_EILVT3 0x530
129 130
130#define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) 131#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))
132#define APIC_BASE_MSR 0x800
133#define X2APIC_ENABLE (1UL << 10)
131 134
132#ifdef CONFIG_X86_32 135#ifdef CONFIG_X86_32
133# define MAX_IO_APICS 64 136# define MAX_IO_APICS 64
@@ -411,4 +414,4 @@ struct local_apic {
411#else 414#else
412 #define BAD_APICID 0xFFFFu 415 #define BAD_APICID 0xFFFFu
413#endif 416#endif
414#endif 417#endif /* ASM_X86__APICDEF_H */
diff --git a/include/asm-x86/arch_hooks.h b/include/asm-x86/arch_hooks.h
index 8411750ceb63..de4596b24c23 100644
--- a/include/asm-x86/arch_hooks.h
+++ b/include/asm-x86/arch_hooks.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_ARCH_HOOKS_H 1#ifndef ASM_X86__ARCH_HOOKS_H
2#define _ASM_ARCH_HOOKS_H 2#define ASM_X86__ARCH_HOOKS_H
3 3
4#include <linux/interrupt.h> 4#include <linux/interrupt.h>
5 5
@@ -12,8 +12,6 @@
12/* these aren't arch hooks, they are generic routines 12/* these aren't arch hooks, they are generic routines
13 * that can be used by the hooks */ 13 * that can be used by the hooks */
14extern void init_ISA_irqs(void); 14extern void init_ISA_irqs(void);
15extern void apic_intr_init(void);
16extern void smp_intr_init(void);
17extern irqreturn_t timer_interrupt(int irq, void *dev_id); 15extern irqreturn_t timer_interrupt(int irq, void *dev_id);
18 16
19/* these are the defined hooks */ 17/* these are the defined hooks */
@@ -25,4 +23,4 @@ extern void pre_time_init_hook(void);
25extern void time_init_hook(void); 23extern void time_init_hook(void);
26extern void mca_nmi_hook(void); 24extern void mca_nmi_hook(void);
27 25
28#endif 26#endif /* ASM_X86__ARCH_HOOKS_H */
diff --git a/include/asm-x86/asm.h b/include/asm-x86/asm.h
index 97220321f39d..e1355f44d7c3 100644
--- a/include/asm-x86/asm.h
+++ b/include/asm-x86/asm.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_ASM_H 1#ifndef ASM_X86__ASM_H
2#define _ASM_X86_ASM_H 2#define ASM_X86__ASM_H
3 3
4#ifdef __ASSEMBLY__ 4#ifdef __ASSEMBLY__
5# define __ASM_FORM(x) x 5# define __ASM_FORM(x) x
@@ -20,17 +20,22 @@
20 20
21#define _ASM_PTR __ASM_SEL(.long, .quad) 21#define _ASM_PTR __ASM_SEL(.long, .quad)
22#define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) 22#define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8)
23#define _ASM_MOV_UL __ASM_SIZE(mov)
24 23
24#define _ASM_MOV __ASM_SIZE(mov)
25#define _ASM_INC __ASM_SIZE(inc) 25#define _ASM_INC __ASM_SIZE(inc)
26#define _ASM_DEC __ASM_SIZE(dec) 26#define _ASM_DEC __ASM_SIZE(dec)
27#define _ASM_ADD __ASM_SIZE(add) 27#define _ASM_ADD __ASM_SIZE(add)
28#define _ASM_SUB __ASM_SIZE(sub) 28#define _ASM_SUB __ASM_SIZE(sub)
29#define _ASM_XADD __ASM_SIZE(xadd) 29#define _ASM_XADD __ASM_SIZE(xadd)
30
30#define _ASM_AX __ASM_REG(ax) 31#define _ASM_AX __ASM_REG(ax)
31#define _ASM_BX __ASM_REG(bx) 32#define _ASM_BX __ASM_REG(bx)
32#define _ASM_CX __ASM_REG(cx) 33#define _ASM_CX __ASM_REG(cx)
33#define _ASM_DX __ASM_REG(dx) 34#define _ASM_DX __ASM_REG(dx)
35#define _ASM_SP __ASM_REG(sp)
36#define _ASM_BP __ASM_REG(bp)
37#define _ASM_SI __ASM_REG(si)
38#define _ASM_DI __ASM_REG(di)
34 39
35/* Exception table entry */ 40/* Exception table entry */
36# define _ASM_EXTABLE(from,to) \ 41# define _ASM_EXTABLE(from,to) \
@@ -39,4 +44,4 @@
39 _ASM_PTR #from "," #to "\n" \ 44 _ASM_PTR #from "," #to "\n" \
40 " .previous\n" 45 " .previous\n"
41 46
42#endif /* _ASM_X86_ASM_H */ 47#endif /* ASM_X86__ASM_H */
diff --git a/include/asm-x86/atomic_32.h b/include/asm-x86/atomic_32.h
index 21a4825148c0..14d3f0beb889 100644
--- a/include/asm-x86/atomic_32.h
+++ b/include/asm-x86/atomic_32.h
@@ -1,5 +1,5 @@
1#ifndef __ARCH_I386_ATOMIC__ 1#ifndef ASM_X86__ATOMIC_32_H
2#define __ARCH_I386_ATOMIC__ 2#define ASM_X86__ATOMIC_32_H
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <asm/processor.h> 5#include <asm/processor.h>
@@ -256,4 +256,4 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
256#define smp_mb__after_atomic_inc() barrier() 256#define smp_mb__after_atomic_inc() barrier()
257 257
258#include <asm-generic/atomic.h> 258#include <asm-generic/atomic.h>
259#endif 259#endif /* ASM_X86__ATOMIC_32_H */
diff --git a/include/asm-x86/atomic_64.h b/include/asm-x86/atomic_64.h
index 91c7d03e65bc..2cb218c4a356 100644
--- a/include/asm-x86/atomic_64.h
+++ b/include/asm-x86/atomic_64.h
@@ -1,5 +1,5 @@
1#ifndef __ARCH_X86_64_ATOMIC__ 1#ifndef ASM_X86__ATOMIC_64_H
2#define __ARCH_X86_64_ATOMIC__ 2#define ASM_X86__ATOMIC_64_H
3 3
4#include <asm/alternative.h> 4#include <asm/alternative.h>
5#include <asm/cmpxchg.h> 5#include <asm/cmpxchg.h>
@@ -470,4 +470,4 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
470#define smp_mb__after_atomic_inc() barrier() 470#define smp_mb__after_atomic_inc() barrier()
471 471
472#include <asm-generic/atomic.h> 472#include <asm-generic/atomic.h>
473#endif 473#endif /* ASM_X86__ATOMIC_64_H */
diff --git a/include/asm-x86/auxvec.h b/include/asm-x86/auxvec.h
index 87f5e6d5a020..12c7cac74202 100644
--- a/include/asm-x86/auxvec.h
+++ b/include/asm-x86/auxvec.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_AUXVEC_H 1#ifndef ASM_X86__AUXVEC_H
2#define _ASM_X86_AUXVEC_H 2#define ASM_X86__AUXVEC_H
3/* 3/*
4 * Architecture-neutral AT_ values in 0-17, leave some room 4 * Architecture-neutral AT_ values in 0-17, leave some room
5 * for more of them, start the x86-specific ones at 32. 5 * for more of them, start the x86-specific ones at 32.
@@ -9,4 +9,4 @@
9#endif 9#endif
10#define AT_SYSINFO_EHDR 33 10#define AT_SYSINFO_EHDR 33
11 11
12#endif 12#endif /* ASM_X86__AUXVEC_H */
diff --git a/include/asm-x86/mach-bigsmp/mach_apic.h b/include/asm-x86/bigsmp/apic.h
index c3b9dc6970c9..0a9cd7c5ca0c 100644
--- a/include/asm-x86/mach-bigsmp/mach_apic.h
+++ b/include/asm-x86/bigsmp/apic.h
@@ -11,7 +11,7 @@ static inline int apic_id_registered(void)
11 11
12/* Round robin the irqs amoung the online cpus */ 12/* Round robin the irqs amoung the online cpus */
13static inline cpumask_t target_cpus(void) 13static inline cpumask_t target_cpus(void)
14{ 14{
15 static unsigned long cpu = NR_CPUS; 15 static unsigned long cpu = NR_CPUS;
16 do { 16 do {
17 if (cpu >= NR_CPUS) 17 if (cpu >= NR_CPUS)
@@ -23,7 +23,7 @@ static inline cpumask_t target_cpus(void)
23} 23}
24 24
25#undef APIC_DEST_LOGICAL 25#undef APIC_DEST_LOGICAL
26#define APIC_DEST_LOGICAL 0 26#define APIC_DEST_LOGICAL 0
27#define TARGET_CPUS (target_cpus()) 27#define TARGET_CPUS (target_cpus())
28#define APIC_DFR_VALUE (APIC_DFR_FLAT) 28#define APIC_DFR_VALUE (APIC_DFR_FLAT)
29#define INT_DELIVERY_MODE (dest_Fixed) 29#define INT_DELIVERY_MODE (dest_Fixed)
diff --git a/include/asm-x86/mach-bigsmp/mach_apicdef.h b/include/asm-x86/bigsmp/apicdef.h
index a58ab5a75c8c..392c3f5ef2fe 100644
--- a/include/asm-x86/mach-bigsmp/mach_apicdef.h
+++ b/include/asm-x86/bigsmp/apicdef.h
@@ -3,10 +3,10 @@
3 3
4#define APIC_ID_MASK (0xFF<<24) 4#define APIC_ID_MASK (0xFF<<24)
5 5
6static inline unsigned get_apic_id(unsigned long x) 6static inline unsigned get_apic_id(unsigned long x)
7{ 7{
8 return (((x)>>24)&0xFF); 8 return (((x)>>24)&0xFF);
9} 9}
10 10
11#define GET_APIC_ID(x) get_apic_id(x) 11#define GET_APIC_ID(x) get_apic_id(x)
12 12
diff --git a/include/asm-x86/mach-bigsmp/mach_ipi.h b/include/asm-x86/bigsmp/ipi.h
index 9404c535b7ec..9404c535b7ec 100644
--- a/include/asm-x86/mach-bigsmp/mach_ipi.h
+++ b/include/asm-x86/bigsmp/ipi.h
diff --git a/include/asm-x86/bios_ebda.h b/include/asm-x86/bios_ebda.h
index 0033e50c13b2..79b4b88505d7 100644
--- a/include/asm-x86/bios_ebda.h
+++ b/include/asm-x86/bios_ebda.h
@@ -1,5 +1,5 @@
1#ifndef _MACH_BIOS_EBDA_H 1#ifndef ASM_X86__BIOS_EBDA_H
2#define _MACH_BIOS_EBDA_H 2#define ASM_X86__BIOS_EBDA_H
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5 5
@@ -16,4 +16,21 @@ static inline unsigned int get_bios_ebda(void)
16 16
17void reserve_ebda_region(void); 17void reserve_ebda_region(void);
18 18
19#endif /* _MACH_BIOS_EBDA_H */ 19#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
20/*
21 * This is obviously not a great place for this, but we want to be
22 * able to scatter it around anywhere in the kernel.
23 */
24void check_for_bios_corruption(void);
25void start_periodic_check_for_corruption(void);
26#else
27static inline void check_for_bios_corruption(void)
28{
29}
30
31static inline void start_periodic_check_for_corruption(void)
32{
33}
34#endif
35
36#endif /* ASM_X86__BIOS_EBDA_H */
diff --git a/include/asm-x86/bitops.h b/include/asm-x86/bitops.h
index cfb2b64f76e7..451a74762bd4 100644
--- a/include/asm-x86/bitops.h
+++ b/include/asm-x86/bitops.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_BITOPS_H 1#ifndef ASM_X86__BITOPS_H
2#define _ASM_X86_BITOPS_H 2#define ASM_X86__BITOPS_H
3 3
4/* 4/*
5 * Copyright 1992, Linus Torvalds. 5 * Copyright 1992, Linus Torvalds.
@@ -424,16 +424,6 @@ static inline int fls(int x)
424 424
425#undef ADDR 425#undef ADDR
426 426
427static inline void set_bit_string(unsigned long *bitmap,
428 unsigned long i, int len)
429{
430 unsigned long end = i + len;
431 while (i < end) {
432 __set_bit(i, bitmap);
433 i++;
434 }
435}
436
437#ifdef __KERNEL__ 427#ifdef __KERNEL__
438 428
439#include <asm-generic/bitops/sched.h> 429#include <asm-generic/bitops/sched.h>
@@ -458,4 +448,4 @@ static inline void set_bit_string(unsigned long *bitmap,
458#include <asm-generic/bitops/minix.h> 448#include <asm-generic/bitops/minix.h>
459 449
460#endif /* __KERNEL__ */ 450#endif /* __KERNEL__ */
461#endif /* _ASM_X86_BITOPS_H */ 451#endif /* ASM_X86__BITOPS_H */
diff --git a/include/asm-x86/boot.h b/include/asm-x86/boot.h
index 2faed7ecb092..1d63bd5d5946 100644
--- a/include/asm-x86/boot.h
+++ b/include/asm-x86/boot.h
@@ -1,10 +1,8 @@
1#ifndef _ASM_BOOT_H 1#ifndef ASM_X86__BOOT_H
2#define _ASM_BOOT_H 2#define ASM_X86__BOOT_H
3 3
4/* Don't touch these, unless you really know what you're doing. */ 4/* Don't touch these, unless you really know what you're doing. */
5#define DEF_INITSEG 0x9000
6#define DEF_SYSSEG 0x1000 5#define DEF_SYSSEG 0x1000
7#define DEF_SETUPSEG 0x9020
8#define DEF_SYSSIZE 0x7F00 6#define DEF_SYSSIZE 0x7F00
9 7
10/* Internal svga startup constants */ 8/* Internal svga startup constants */
@@ -25,4 +23,4 @@
25#define BOOT_STACK_SIZE 0x1000 23#define BOOT_STACK_SIZE 0x1000
26#endif 24#endif
27 25
28#endif /* _ASM_BOOT_H */ 26#endif /* ASM_X86__BOOT_H */
diff --git a/include/asm-x86/bootparam.h b/include/asm-x86/bootparam.h
index ae22bdf0ab14..ccf027e2d97d 100644
--- a/include/asm-x86/bootparam.h
+++ b/include/asm-x86/bootparam.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_BOOTPARAM_H 1#ifndef ASM_X86__BOOTPARAM_H
2#define _ASM_BOOTPARAM_H 2#define ASM_X86__BOOTPARAM_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/screen_info.h> 5#include <linux/screen_info.h>
@@ -108,4 +108,4 @@ struct boot_params {
108 __u8 _pad9[276]; /* 0xeec */ 108 __u8 _pad9[276]; /* 0xeec */
109} __attribute__((packed)); 109} __attribute__((packed));
110 110
111#endif /* _ASM_BOOTPARAM_H */ 111#endif /* ASM_X86__BOOTPARAM_H */
diff --git a/include/asm-x86/bug.h b/include/asm-x86/bug.h
index b69aa64b82a4..91ad43a54c47 100644
--- a/include/asm-x86/bug.h
+++ b/include/asm-x86/bug.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_BUG_H 1#ifndef ASM_X86__BUG_H
2#define _ASM_X86_BUG_H 2#define ASM_X86__BUG_H
3 3
4#ifdef CONFIG_BUG 4#ifdef CONFIG_BUG
5#define HAVE_ARCH_BUG 5#define HAVE_ARCH_BUG
@@ -36,4 +36,4 @@ do { \
36#endif /* !CONFIG_BUG */ 36#endif /* !CONFIG_BUG */
37 37
38#include <asm-generic/bug.h> 38#include <asm-generic/bug.h>
39#endif 39#endif /* ASM_X86__BUG_H */
diff --git a/include/asm-x86/bugs.h b/include/asm-x86/bugs.h
index 021cbdd5f258..dc604985f2ad 100644
--- a/include/asm-x86/bugs.h
+++ b/include/asm-x86/bugs.h
@@ -1,7 +1,12 @@
1#ifndef _ASM_X86_BUGS_H 1#ifndef ASM_X86__BUGS_H
2#define _ASM_X86_BUGS_H 2#define ASM_X86__BUGS_H
3 3
4extern void check_bugs(void); 4extern void check_bugs(void);
5
6#if defined(CONFIG_CPU_SUP_INTEL) && defined(CONFIG_X86_32)
5int ppro_with_ram_bug(void); 7int ppro_with_ram_bug(void);
8#else
9static inline int ppro_with_ram_bug(void) { return 0; }
10#endif
6 11
7#endif /* _ASM_X86_BUGS_H */ 12#endif /* ASM_X86__BUGS_H */
diff --git a/include/asm-x86/byteorder.h b/include/asm-x86/byteorder.h
index e02ae2d89acf..722f27d68105 100644
--- a/include/asm-x86/byteorder.h
+++ b/include/asm-x86/byteorder.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_BYTEORDER_H 1#ifndef ASM_X86__BYTEORDER_H
2#define _ASM_X86_BYTEORDER_H 2#define ASM_X86__BYTEORDER_H
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5#include <linux/compiler.h> 5#include <linux/compiler.h>
@@ -78,4 +78,4 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
78 78
79#include <linux/byteorder/little_endian.h> 79#include <linux/byteorder/little_endian.h>
80 80
81#endif /* _ASM_X86_BYTEORDER_H */ 81#endif /* ASM_X86__BYTEORDER_H */
diff --git a/include/asm-x86/cache.h b/include/asm-x86/cache.h
index 1e0bac86f38f..ea3f1cc06a97 100644
--- a/include/asm-x86/cache.h
+++ b/include/asm-x86/cache.h
@@ -1,5 +1,5 @@
1#ifndef _ARCH_X86_CACHE_H 1#ifndef ASM_X86__CACHE_H
2#define _ARCH_X86_CACHE_H 2#define ASM_X86__CACHE_H
3 3
4/* L1 cache line size */ 4/* L1 cache line size */
5#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 5#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
@@ -17,4 +17,4 @@
17#endif 17#endif
18#endif 18#endif
19 19
20#endif 20#endif /* ASM_X86__CACHE_H */
diff --git a/include/asm-x86/cacheflush.h b/include/asm-x86/cacheflush.h
index f4c0ab50d2c2..68840ef1b35a 100644
--- a/include/asm-x86/cacheflush.h
+++ b/include/asm-x86/cacheflush.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_CACHEFLUSH_H 1#ifndef ASM_X86__CACHEFLUSH_H
2#define _ASM_X86_CACHEFLUSH_H 2#define ASM_X86__CACHEFLUSH_H
3 3
4/* Keep includes the same across arches. */ 4/* Keep includes the same across arches. */
5#include <linux/mm.h> 5#include <linux/mm.h>
@@ -24,6 +24,8 @@
24#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 24#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
25 memcpy((dst), (src), (len)) 25 memcpy((dst), (src), (len))
26 26
27#define PG_non_WB PG_arch_1
28PAGEFLAG(NonWB, non_WB)
27 29
28/* 30/*
29 * The set_memory_* API can be used to change various attributes of a virtual 31 * The set_memory_* API can be used to change various attributes of a virtual
@@ -66,6 +68,9 @@ int set_memory_rw(unsigned long addr, int numpages);
66int set_memory_np(unsigned long addr, int numpages); 68int set_memory_np(unsigned long addr, int numpages);
67int set_memory_4k(unsigned long addr, int numpages); 69int set_memory_4k(unsigned long addr, int numpages);
68 70
71int set_memory_array_uc(unsigned long *addr, int addrinarray);
72int set_memory_array_wb(unsigned long *addr, int addrinarray);
73
69/* 74/*
70 * For legacy compatibility with the old APIs, a few functions 75 * For legacy compatibility with the old APIs, a few functions
71 * are provided that work on a "struct page". 76 * are provided that work on a "struct page".
@@ -96,8 +101,6 @@ int set_pages_rw(struct page *page, int numpages);
96 101
97void clflush_cache_range(void *addr, unsigned int size); 102void clflush_cache_range(void *addr, unsigned int size);
98 103
99void cpa_init(void);
100
101#ifdef CONFIG_DEBUG_RODATA 104#ifdef CONFIG_DEBUG_RODATA
102void mark_rodata_ro(void); 105void mark_rodata_ro(void);
103extern const int rodata_test_data; 106extern const int rodata_test_data;
@@ -112,4 +115,4 @@ static inline int rodata_test(void)
112} 115}
113#endif 116#endif
114 117
115#endif 118#endif /* ASM_X86__CACHEFLUSH_H */
diff --git a/include/asm-x86/calgary.h b/include/asm-x86/calgary.h
index 67f60406e2d8..933fd272f826 100644
--- a/include/asm-x86/calgary.h
+++ b/include/asm-x86/calgary.h
@@ -21,8 +21,8 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 22 */
23 23
24#ifndef _ASM_X86_64_CALGARY_H 24#ifndef ASM_X86__CALGARY_H
25#define _ASM_X86_64_CALGARY_H 25#define ASM_X86__CALGARY_H
26 26
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/device.h> 28#include <linux/device.h>
@@ -69,4 +69,4 @@ static inline int calgary_iommu_init(void) { return 1; }
69static inline void detect_calgary(void) { return; } 69static inline void detect_calgary(void) { return; }
70#endif 70#endif
71 71
72#endif /* _ASM_X86_64_CALGARY_H */ 72#endif /* ASM_X86__CALGARY_H */
diff --git a/include/asm-x86/checksum_32.h b/include/asm-x86/checksum_32.h
index 52bbb0d8c4c1..d041e8cda227 100644
--- a/include/asm-x86/checksum_32.h
+++ b/include/asm-x86/checksum_32.h
@@ -1,5 +1,5 @@
1#ifndef _I386_CHECKSUM_H 1#ifndef ASM_X86__CHECKSUM_32_H
2#define _I386_CHECKSUM_H 2#define ASM_X86__CHECKSUM_32_H
3 3
4#include <linux/in6.h> 4#include <linux/in6.h>
5 5
@@ -186,4 +186,4 @@ static inline __wsum csum_and_copy_to_user(const void *src,
186 return (__force __wsum)-1; /* invalid checksum */ 186 return (__force __wsum)-1; /* invalid checksum */
187} 187}
188 188
189#endif 189#endif /* ASM_X86__CHECKSUM_32_H */
diff --git a/include/asm-x86/checksum_64.h b/include/asm-x86/checksum_64.h
index 8bd861cc5267..110f403beb89 100644
--- a/include/asm-x86/checksum_64.h
+++ b/include/asm-x86/checksum_64.h
@@ -1,5 +1,5 @@
1#ifndef _X86_64_CHECKSUM_H 1#ifndef ASM_X86__CHECKSUM_64_H
2#define _X86_64_CHECKSUM_H 2#define ASM_X86__CHECKSUM_64_H
3 3
4/* 4/*
5 * Checksums for x86-64 5 * Checksums for x86-64
@@ -188,4 +188,4 @@ static inline unsigned add32_with_carry(unsigned a, unsigned b)
188 return a; 188 return a;
189} 189}
190 190
191#endif 191#endif /* ASM_X86__CHECKSUM_64_H */
diff --git a/include/asm-x86/cmpxchg_32.h b/include/asm-x86/cmpxchg_32.h
index bf5a69d1329e..0622e45cdf7c 100644
--- a/include/asm-x86/cmpxchg_32.h
+++ b/include/asm-x86/cmpxchg_32.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_CMPXCHG_H 1#ifndef ASM_X86__CMPXCHG_32_H
2#define __ASM_CMPXCHG_H 2#define ASM_X86__CMPXCHG_32_H
3 3
4#include <linux/bitops.h> /* for LOCK_PREFIX */ 4#include <linux/bitops.h> /* for LOCK_PREFIX */
5 5
@@ -341,4 +341,4 @@ extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
341 341
342#endif 342#endif
343 343
344#endif 344#endif /* ASM_X86__CMPXCHG_32_H */
diff --git a/include/asm-x86/cmpxchg_64.h b/include/asm-x86/cmpxchg_64.h
index 17463ccf8166..63c1a5e61b99 100644
--- a/include/asm-x86/cmpxchg_64.h
+++ b/include/asm-x86/cmpxchg_64.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_CMPXCHG_H 1#ifndef ASM_X86__CMPXCHG_64_H
2#define __ASM_CMPXCHG_H 2#define ASM_X86__CMPXCHG_64_H
3 3
4#include <asm/alternative.h> /* Provides LOCK_PREFIX */ 4#include <asm/alternative.h> /* Provides LOCK_PREFIX */
5 5
@@ -182,4 +182,4 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
182 cmpxchg_local((ptr), (o), (n)); \ 182 cmpxchg_local((ptr), (o), (n)); \
183}) 183})
184 184
185#endif 185#endif /* ASM_X86__CMPXCHG_64_H */
diff --git a/include/asm-x86/compat.h b/include/asm-x86/compat.h
index 1793ac317a30..6732b150949e 100644
--- a/include/asm-x86/compat.h
+++ b/include/asm-x86/compat.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_64_COMPAT_H 1#ifndef ASM_X86__COMPAT_H
2#define _ASM_X86_64_COMPAT_H 2#define ASM_X86__COMPAT_H
3 3
4/* 4/*
5 * Architecture specific compatibility types 5 * Architecture specific compatibility types
@@ -215,4 +215,4 @@ static inline int is_compat_task(void)
215 return current_thread_info()->status & TS_COMPAT; 215 return current_thread_info()->status & TS_COMPAT;
216} 216}
217 217
218#endif /* _ASM_X86_64_COMPAT_H */ 218#endif /* ASM_X86__COMPAT_H */
diff --git a/include/asm-x86/cpu.h b/include/asm-x86/cpu.h
index 73f2ea84fd74..83a115083f0d 100644
--- a/include/asm-x86/cpu.h
+++ b/include/asm-x86/cpu.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_I386_CPU_H_ 1#ifndef ASM_X86__CPU_H
2#define _ASM_I386_CPU_H_ 2#define ASM_X86__CPU_H
3 3
4#include <linux/device.h> 4#include <linux/device.h>
5#include <linux/cpu.h> 5#include <linux/cpu.h>
@@ -17,4 +17,4 @@ extern void arch_unregister_cpu(int);
17#endif 17#endif
18 18
19DECLARE_PER_CPU(int, cpu_state); 19DECLARE_PER_CPU(int, cpu_state);
20#endif /* _ASM_I386_CPU_H_ */ 20#endif /* ASM_X86__CPU_H */
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h
index 2f5a792b0acc..adfeae6586e1 100644
--- a/include/asm-x86/cpufeature.h
+++ b/include/asm-x86/cpufeature.h
@@ -1,12 +1,18 @@
1/* 1/*
2 * Defines x86 CPU feature bits 2 * Defines x86 CPU feature bits
3 */ 3 */
4#ifndef _ASM_X86_CPUFEATURE_H 4#ifndef ASM_X86__CPUFEATURE_H
5#define _ASM_X86_CPUFEATURE_H 5#define ASM_X86__CPUFEATURE_H
6 6
7#include <asm/required-features.h> 7#include <asm/required-features.h>
8 8
9#define NCAPINTS 8 /* N 32-bit words worth of info */ 9#define NCAPINTS 9 /* N 32-bit words worth of info */
10
11/*
12 * Note: If the comment begins with a quoted string, that string is used
13 * in /proc/cpuinfo instead of the macro name. If the string is "",
14 * this feature bit is not displayed in /proc/cpuinfo at all.
15 */
10 16
11/* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */ 17/* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */
12#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */ 18#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */
@@ -14,7 +20,7 @@
14#define X86_FEATURE_DE (0*32+ 2) /* Debugging Extensions */ 20#define X86_FEATURE_DE (0*32+ 2) /* Debugging Extensions */
15#define X86_FEATURE_PSE (0*32+ 3) /* Page Size Extensions */ 21#define X86_FEATURE_PSE (0*32+ 3) /* Page Size Extensions */
16#define X86_FEATURE_TSC (0*32+ 4) /* Time Stamp Counter */ 22#define X86_FEATURE_TSC (0*32+ 4) /* Time Stamp Counter */
17#define X86_FEATURE_MSR (0*32+ 5) /* Model-Specific Registers, RDMSR, WRMSR */ 23#define X86_FEATURE_MSR (0*32+ 5) /* Model-Specific Registers */
18#define X86_FEATURE_PAE (0*32+ 6) /* Physical Address Extensions */ 24#define X86_FEATURE_PAE (0*32+ 6) /* Physical Address Extensions */
19#define X86_FEATURE_MCE (0*32+ 7) /* Machine Check Architecture */ 25#define X86_FEATURE_MCE (0*32+ 7) /* Machine Check Architecture */
20#define X86_FEATURE_CX8 (0*32+ 8) /* CMPXCHG8 instruction */ 26#define X86_FEATURE_CX8 (0*32+ 8) /* CMPXCHG8 instruction */
@@ -23,22 +29,23 @@
23#define X86_FEATURE_MTRR (0*32+12) /* Memory Type Range Registers */ 29#define X86_FEATURE_MTRR (0*32+12) /* Memory Type Range Registers */
24#define X86_FEATURE_PGE (0*32+13) /* Page Global Enable */ 30#define X86_FEATURE_PGE (0*32+13) /* Page Global Enable */
25#define X86_FEATURE_MCA (0*32+14) /* Machine Check Architecture */ 31#define X86_FEATURE_MCA (0*32+14) /* Machine Check Architecture */
26#define X86_FEATURE_CMOV (0*32+15) /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */ 32#define X86_FEATURE_CMOV (0*32+15) /* CMOV instructions */
33 /* (plus FCMOVcc, FCOMI with FPU) */
27#define X86_FEATURE_PAT (0*32+16) /* Page Attribute Table */ 34#define X86_FEATURE_PAT (0*32+16) /* Page Attribute Table */
28#define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */ 35#define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */
29#define X86_FEATURE_PN (0*32+18) /* Processor serial number */ 36#define X86_FEATURE_PN (0*32+18) /* Processor serial number */
30#define X86_FEATURE_CLFLSH (0*32+19) /* Supports the CLFLUSH instruction */ 37#define X86_FEATURE_CLFLSH (0*32+19) /* "clflush" CLFLUSH instruction */
31#define X86_FEATURE_DS (0*32+21) /* Debug Store */ 38#define X86_FEATURE_DS (0*32+21) /* "dts" Debug Store */
32#define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */ 39#define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */
33#define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */ 40#define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */
34#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE and FXRSTOR instructions (fast save and restore */ 41#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE/FXRSTOR, CR4.OSFXSR */
35 /* of FPU context), and CR4.OSFXSR available */ 42#define X86_FEATURE_XMM (0*32+25) /* "sse" */
36#define X86_FEATURE_XMM (0*32+25) /* Streaming SIMD Extensions */ 43#define X86_FEATURE_XMM2 (0*32+26) /* "sse2" */
37#define X86_FEATURE_XMM2 (0*32+26) /* Streaming SIMD Extensions-2 */ 44#define X86_FEATURE_SELFSNOOP (0*32+27) /* "ss" CPU self snoop */
38#define X86_FEATURE_SELFSNOOP (0*32+27) /* CPU self snoop */
39#define X86_FEATURE_HT (0*32+28) /* Hyper-Threading */ 45#define X86_FEATURE_HT (0*32+28) /* Hyper-Threading */
40#define X86_FEATURE_ACC (0*32+29) /* Automatic clock control */ 46#define X86_FEATURE_ACC (0*32+29) /* "tm" Automatic clock control */
41#define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */ 47#define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */
48#define X86_FEATURE_PBE (0*32+31) /* Pending Break Enable */
42 49
43/* AMD-defined CPU features, CPUID level 0x80000001, word 1 */ 50/* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
44/* Don't duplicate feature flags which are redundant with Intel! */ 51/* Don't duplicate feature flags which are redundant with Intel! */
@@ -46,7 +53,8 @@
46#define X86_FEATURE_MP (1*32+19) /* MP Capable. */ 53#define X86_FEATURE_MP (1*32+19) /* MP Capable. */
47#define X86_FEATURE_NX (1*32+20) /* Execute Disable */ 54#define X86_FEATURE_NX (1*32+20) /* Execute Disable */
48#define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */ 55#define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */
49#define X86_FEATURE_GBPAGES (1*32+26) /* GB pages */ 56#define X86_FEATURE_FXSR_OPT (1*32+25) /* FXSAVE/FXRSTOR optimizations */
57#define X86_FEATURE_GBPAGES (1*32+26) /* "pdpe1gb" GB pages */
50#define X86_FEATURE_RDTSCP (1*32+27) /* RDTSCP */ 58#define X86_FEATURE_RDTSCP (1*32+27) /* RDTSCP */
51#define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */ 59#define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */
52#define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */ 60#define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */
@@ -64,50 +72,79 @@
64#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ 72#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */
65#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ 73#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */
66/* cpu types for specific tunings: */ 74/* cpu types for specific tunings: */
67#define X86_FEATURE_K8 (3*32+ 4) /* Opteron, Athlon64 */ 75#define X86_FEATURE_K8 (3*32+ 4) /* "" Opteron, Athlon64 */
68#define X86_FEATURE_K7 (3*32+ 5) /* Athlon */ 76#define X86_FEATURE_K7 (3*32+ 5) /* "" Athlon */
69#define X86_FEATURE_P3 (3*32+ 6) /* P3 */ 77#define X86_FEATURE_P3 (3*32+ 6) /* "" P3 */
70#define X86_FEATURE_P4 (3*32+ 7) /* P4 */ 78#define X86_FEATURE_P4 (3*32+ 7) /* "" P4 */
71#define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ 79#define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */
72#define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ 80#define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */
73#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ 81#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* "" FXSAVE leaks FOP/FIP/FOP */
74#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ 82#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */
75#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ 83#define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */
76#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ 84#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */
77#define X86_FEATURE_SYSCALL32 (3*32+14) /* syscall in ia32 userspace */ 85#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */
78#define X86_FEATURE_SYSENTER32 (3*32+15) /* sysenter in ia32 userspace */ 86#define X86_FEATURE_SYSCALL32 (3*32+14) /* "" syscall in ia32 userspace */
79#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ 87#define X86_FEATURE_SYSENTER32 (3*32+15) /* "" sysenter in ia32 userspace */
80#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ 88#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well */
81#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ 89#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* "" Mfence synchronizes RDTSC */
82#define X86_FEATURE_11AP (3*32+19) /* Bad local APIC aka 11AP */ 90#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* "" Lfence synchronizes RDTSC */
91#define X86_FEATURE_11AP (3*32+19) /* "" Bad local APIC aka 11AP */
92#define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */
93#define X86_FEATURE_AMDC1E (3*32+21) /* AMD C1E detected */
94#define X86_FEATURE_XTOPOLOGY (3*32+21) /* cpu topology enum extensions */
83 95
84/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 96/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
85#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 97#define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */
86#define X86_FEATURE_MWAIT (4*32+ 3) /* Monitor/Mwait support */ 98#define X86_FEATURE_PCLMULQDQ (4*32+ 1) /* PCLMULQDQ instruction */
87#define X86_FEATURE_DSCPL (4*32+ 4) /* CPL Qualified Debug Store */ 99#define X86_FEATURE_DTES64 (4*32+ 2) /* 64-bit Debug Store */
100#define X86_FEATURE_MWAIT (4*32+ 3) /* "monitor" Monitor/Mwait support */
101#define X86_FEATURE_DSCPL (4*32+ 4) /* "ds_cpl" CPL Qual. Debug Store */
102#define X86_FEATURE_VMX (4*32+ 5) /* Hardware virtualization */
103#define X86_FEATURE_SMX (4*32+ 6) /* Safer mode */
88#define X86_FEATURE_EST (4*32+ 7) /* Enhanced SpeedStep */ 104#define X86_FEATURE_EST (4*32+ 7) /* Enhanced SpeedStep */
89#define X86_FEATURE_TM2 (4*32+ 8) /* Thermal Monitor 2 */ 105#define X86_FEATURE_TM2 (4*32+ 8) /* Thermal Monitor 2 */
106#define X86_FEATURE_SSSE3 (4*32+ 9) /* Supplemental SSE-3 */
90#define X86_FEATURE_CID (4*32+10) /* Context ID */ 107#define X86_FEATURE_CID (4*32+10) /* Context ID */
108#define X86_FEATURE_FMA (4*32+12) /* Fused multiply-add */
91#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ 109#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */
92#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ 110#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */
111#define X86_FEATURE_PDCM (4*32+15) /* Performance Capabilities */
93#define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */ 112#define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */
113#define X86_FEATURE_XMM4_1 (4*32+19) /* "sse4_1" SSE-4.1 */
114#define X86_FEATURE_XMM4_2 (4*32+20) /* "sse4_2" SSE-4.2 */
115#define X86_FEATURE_X2APIC (4*32+21) /* x2APIC */
116#define X86_FEATURE_AES (4*32+25) /* AES instructions */
117#define X86_FEATURE_XSAVE (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */
118#define X86_FEATURE_OSXSAVE (4*32+27) /* "" XSAVE enabled in the OS */
119#define X86_FEATURE_AVX (4*32+28) /* Advanced Vector Extensions */
94 120
95/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ 121/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
96#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ 122#define X86_FEATURE_XSTORE (5*32+ 2) /* "rng" RNG present (xstore) */
97#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */ 123#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* "rng_en" RNG enabled */
98#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */ 124#define X86_FEATURE_XCRYPT (5*32+ 6) /* "ace" on-CPU crypto (xcrypt) */
99#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ 125#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* "ace_en" on-CPU crypto enabled */
100#define X86_FEATURE_ACE2 (5*32+ 8) /* Advanced Cryptography Engine v2 */ 126#define X86_FEATURE_ACE2 (5*32+ 8) /* Advanced Cryptography Engine v2 */
101#define X86_FEATURE_ACE2_EN (5*32+ 9) /* ACE v2 enabled */ 127#define X86_FEATURE_ACE2_EN (5*32+ 9) /* ACE v2 enabled */
102#define X86_FEATURE_PHE (5*32+ 10) /* PadLock Hash Engine */ 128#define X86_FEATURE_PHE (5*32+10) /* PadLock Hash Engine */
103#define X86_FEATURE_PHE_EN (5*32+ 11) /* PHE enabled */ 129#define X86_FEATURE_PHE_EN (5*32+11) /* PHE enabled */
104#define X86_FEATURE_PMM (5*32+ 12) /* PadLock Montgomery Multiplier */ 130#define X86_FEATURE_PMM (5*32+12) /* PadLock Montgomery Multiplier */
105#define X86_FEATURE_PMM_EN (5*32+ 13) /* PMM enabled */ 131#define X86_FEATURE_PMM_EN (5*32+13) /* PMM enabled */
106 132
107/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ 133/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */
108#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ 134#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */
109#define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */ 135#define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */
110#define X86_FEATURE_IBS (6*32+ 10) /* Instruction Based Sampling */ 136#define X86_FEATURE_SVM (6*32+ 2) /* Secure virtual machine */
137#define X86_FEATURE_EXTAPIC (6*32+ 3) /* Extended APIC space */
138#define X86_FEATURE_CR8_LEGACY (6*32+ 4) /* CR8 in 32-bit mode */
139#define X86_FEATURE_ABM (6*32+ 5) /* Advanced bit manipulation */
140#define X86_FEATURE_SSE4A (6*32+ 6) /* SSE-4A */
141#define X86_FEATURE_MISALIGNSSE (6*32+ 7) /* Misaligned SSE mode */
142#define X86_FEATURE_3DNOWPREFETCH (6*32+ 8) /* 3DNow prefetch instructions */
143#define X86_FEATURE_OSVW (6*32+ 9) /* OS Visible Workaround */
144#define X86_FEATURE_IBS (6*32+10) /* Instruction Based Sampling */
145#define X86_FEATURE_SSE5 (6*32+11) /* SSE-5 */
146#define X86_FEATURE_SKINIT (6*32+12) /* SKINIT/STGI instructions */
147#define X86_FEATURE_WDT (6*32+13) /* Watchdog timer */
111 148
112/* 149/*
113 * Auxiliary flags: Linux defined - For features scattered in various 150 * Auxiliary flags: Linux defined - For features scattered in various
@@ -115,6 +152,13 @@
115 */ 152 */
116#define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */ 153#define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */
117 154
155/* Virtualization flags: Linux defined */
156#define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */
157#define X86_FEATURE_VNMI (8*32+ 1) /* Intel Virtual NMI */
158#define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */
159#define X86_FEATURE_EPT (8*32+ 3) /* Intel Extended Page Table */
160#define X86_FEATURE_VPID (8*32+ 4) /* Intel Virtual Processor ID */
161
118#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 162#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
119 163
120#include <linux/bitops.h> 164#include <linux/bitops.h>
@@ -148,7 +192,7 @@ extern const char * const x86_power_flags[32];
148} while (0) 192} while (0)
149#define setup_force_cpu_cap(bit) do { \ 193#define setup_force_cpu_cap(bit) do { \
150 set_cpu_cap(&boot_cpu_data, bit); \ 194 set_cpu_cap(&boot_cpu_data, bit); \
151 clear_bit(bit, (unsigned long *)cleared_cpu_caps); \ 195 clear_bit(bit, (unsigned long *)cleared_cpu_caps); \
152} while (0) 196} while (0)
153 197
154#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU) 198#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU)
@@ -189,6 +233,10 @@ extern const char * const x86_power_flags[32];
189#define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES) 233#define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES)
190#define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON) 234#define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON)
191#define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT) 235#define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT)
236#define cpu_has_xmm4_1 boot_cpu_has(X86_FEATURE_XMM4_1)
237#define cpu_has_xmm4_2 boot_cpu_has(X86_FEATURE_XMM4_2)
238#define cpu_has_x2apic boot_cpu_has(X86_FEATURE_X2APIC)
239#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE)
192 240
193#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64) 241#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64)
194# define cpu_has_invlpg 1 242# define cpu_has_invlpg 1
@@ -220,4 +268,4 @@ extern const char * const x86_power_flags[32];
220 268
221#endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */ 269#endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */
222 270
223#endif /* _ASM_X86_CPUFEATURE_H */ 271#endif /* ASM_X86__CPUFEATURE_H */
diff --git a/include/asm-x86/current.h b/include/asm-x86/current.h
index 7515c19d4988..a863ead856f3 100644
--- a/include/asm-x86/current.h
+++ b/include/asm-x86/current.h
@@ -1,5 +1,5 @@
1#ifndef _X86_CURRENT_H 1#ifndef ASM_X86__CURRENT_H
2#define _X86_CURRENT_H 2#define ASM_X86__CURRENT_H
3 3
4#ifdef CONFIG_X86_32 4#ifdef CONFIG_X86_32
5#include <linux/compiler.h> 5#include <linux/compiler.h>
@@ -36,4 +36,4 @@ static __always_inline struct task_struct *get_current(void)
36 36
37#define current get_current() 37#define current get_current()
38 38
39#endif /* X86_CURRENT_H */ 39#endif /* ASM_X86__CURRENT_H */
diff --git a/include/asm-x86/debugreg.h b/include/asm-x86/debugreg.h
index c6344d572b03..ecb6907c3ea4 100644
--- a/include/asm-x86/debugreg.h
+++ b/include/asm-x86/debugreg.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_DEBUGREG_H 1#ifndef ASM_X86__DEBUGREG_H
2#define _ASM_X86_DEBUGREG_H 2#define ASM_X86__DEBUGREG_H
3 3
4 4
5/* Indicate the register numbers for a number of the specific 5/* Indicate the register numbers for a number of the specific
@@ -67,4 +67,4 @@
67#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ 67#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
68#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ 68#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
69 69
70#endif 70#endif /* ASM_X86__DEBUGREG_H */
diff --git a/include/asm-x86/delay.h b/include/asm-x86/delay.h
index 409a649204aa..8a0da95b4fc5 100644
--- a/include/asm-x86/delay.h
+++ b/include/asm-x86/delay.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_DELAY_H 1#ifndef ASM_X86__DELAY_H
2#define _ASM_X86_DELAY_H 2#define ASM_X86__DELAY_H
3 3
4/* 4/*
5 * Copyright (C) 1993 Linus Torvalds 5 * Copyright (C) 1993 Linus Torvalds
@@ -28,4 +28,4 @@ extern void __delay(unsigned long loops);
28 28
29void use_tsc_delay(void); 29void use_tsc_delay(void);
30 30
31#endif /* _ASM_X86_DELAY_H */ 31#endif /* ASM_X86__DELAY_H */
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index a44c4dc70590..f06adac7938c 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_DESC_H_ 1#ifndef ASM_X86__DESC_H
2#define _ASM_DESC_H_ 2#define ASM_X86__DESC_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <asm/desc_defs.h> 5#include <asm/desc_defs.h>
@@ -24,6 +24,11 @@ static inline void fill_ldt(struct desc_struct *desc,
24 desc->d = info->seg_32bit; 24 desc->d = info->seg_32bit;
25 desc->g = info->limit_in_pages; 25 desc->g = info->limit_in_pages;
26 desc->base2 = (info->base_addr & 0xff000000) >> 24; 26 desc->base2 = (info->base_addr & 0xff000000) >> 24;
27 /*
28 * Don't allow setting of the lm bit. It is useless anyway
29 * because 64bit system calls require __USER_CS:
30 */
31 desc->l = 0;
27} 32}
28 33
29extern struct desc_ptr idt_descr; 34extern struct desc_ptr idt_descr;
@@ -97,7 +102,15 @@ static inline int desc_empty(const void *ptr)
97 native_write_gdt_entry(dt, entry, desc, type) 102 native_write_gdt_entry(dt, entry, desc, type)
98#define write_idt_entry(dt, entry, g) \ 103#define write_idt_entry(dt, entry, g) \
99 native_write_idt_entry(dt, entry, g) 104 native_write_idt_entry(dt, entry, g)
100#endif 105
106static inline void paravirt_alloc_ldt(struct desc_struct *ldt, unsigned entries)
107{
108}
109
110static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries)
111{
112}
113#endif /* CONFIG_PARAVIRT */
101 114
102static inline void native_write_idt_entry(gate_desc *idt, int entry, 115static inline void native_write_idt_entry(gate_desc *idt, int entry,
103 const gate_desc *gate) 116 const gate_desc *gate)
@@ -338,20 +351,16 @@ static inline void set_system_intr_gate(unsigned int n, void *addr)
338 _set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS); 351 _set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS);
339} 352}
340 353
341static inline void set_trap_gate(unsigned int n, void *addr) 354static inline void set_system_trap_gate(unsigned int n, void *addr)
342{ 355{
343 BUG_ON((unsigned)n > 0xFF); 356 BUG_ON((unsigned)n > 0xFF);
344 _set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS); 357 _set_gate(n, GATE_TRAP, addr, 0x3, 0, __KERNEL_CS);
345} 358}
346 359
347static inline void set_system_gate(unsigned int n, void *addr) 360static inline void set_trap_gate(unsigned int n, void *addr)
348{ 361{
349 BUG_ON((unsigned)n > 0xFF); 362 BUG_ON((unsigned)n > 0xFF);
350#ifdef CONFIG_X86_32 363 _set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS);
351 _set_gate(n, GATE_TRAP, addr, 0x3, 0, __KERNEL_CS);
352#else
353 _set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS);
354#endif
355} 364}
356 365
357static inline void set_task_gate(unsigned int n, unsigned int gdt_entry) 366static inline void set_task_gate(unsigned int n, unsigned int gdt_entry)
@@ -366,7 +375,7 @@ static inline void set_intr_gate_ist(int n, void *addr, unsigned ist)
366 _set_gate(n, GATE_INTERRUPT, addr, 0, ist, __KERNEL_CS); 375 _set_gate(n, GATE_INTERRUPT, addr, 0, ist, __KERNEL_CS);
367} 376}
368 377
369static inline void set_system_gate_ist(int n, void *addr, unsigned ist) 378static inline void set_system_intr_gate_ist(int n, void *addr, unsigned ist)
370{ 379{
371 BUG_ON((unsigned)n > 0xFF); 380 BUG_ON((unsigned)n > 0xFF);
372 _set_gate(n, GATE_INTERRUPT, addr, 0x3, ist, __KERNEL_CS); 381 _set_gate(n, GATE_INTERRUPT, addr, 0x3, ist, __KERNEL_CS);
@@ -397,4 +406,4 @@ static inline void set_system_gate_ist(int n, void *addr, unsigned ist)
397 406
398#endif /* __ASSEMBLY__ */ 407#endif /* __ASSEMBLY__ */
399 408
400#endif 409#endif /* ASM_X86__DESC_H */
diff --git a/include/asm-x86/desc_defs.h b/include/asm-x86/desc_defs.h
index f7bacf357dac..b881db664b46 100644
--- a/include/asm-x86/desc_defs.h
+++ b/include/asm-x86/desc_defs.h
@@ -1,6 +1,6 @@
1/* Written 2000 by Andi Kleen */ 1/* Written 2000 by Andi Kleen */
2#ifndef __ARCH_DESC_DEFS_H 2#ifndef ASM_X86__DESC_DEFS_H
3#define __ARCH_DESC_DEFS_H 3#define ASM_X86__DESC_DEFS_H
4 4
5/* 5/*
6 * Segment descriptor structure definitions, usable from both x86_64 and i386 6 * Segment descriptor structure definitions, usable from both x86_64 and i386
@@ -92,4 +92,4 @@ struct desc_ptr {
92 92
93#endif /* !__ASSEMBLY__ */ 93#endif /* !__ASSEMBLY__ */
94 94
95#endif 95#endif /* ASM_X86__DESC_DEFS_H */
diff --git a/include/asm-x86/device.h b/include/asm-x86/device.h
index 3c034f48fdb0..1bece04c7d9d 100644
--- a/include/asm-x86/device.h
+++ b/include/asm-x86/device.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_DEVICE_H 1#ifndef ASM_X86__DEVICE_H
2#define _ASM_X86_DEVICE_H 2#define ASM_X86__DEVICE_H
3 3
4struct dev_archdata { 4struct dev_archdata {
5#ifdef CONFIG_ACPI 5#ifdef CONFIG_ACPI
@@ -13,4 +13,4 @@ struct dma_mapping_ops *dma_ops;
13#endif 13#endif
14}; 14};
15 15
16#endif /* _ASM_X86_DEVICE_H */ 16#endif /* ASM_X86__DEVICE_H */
diff --git a/include/asm-x86/div64.h b/include/asm-x86/div64.h
index 9a2d644c08ef..f9530f23f1d6 100644
--- a/include/asm-x86/div64.h
+++ b/include/asm-x86/div64.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_DIV64_H 1#ifndef ASM_X86__DIV64_H
2#define _ASM_X86_DIV64_H 2#define ASM_X86__DIV64_H
3 3
4#ifdef CONFIG_X86_32 4#ifdef CONFIG_X86_32
5 5
@@ -57,4 +57,4 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
57# include <asm-generic/div64.h> 57# include <asm-generic/div64.h>
58#endif /* CONFIG_X86_32 */ 58#endif /* CONFIG_X86_32 */
59 59
60#endif /* _ASM_X86_DIV64_H */ 60#endif /* ASM_X86__DIV64_H */
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h
index ad9cd6d49bfc..219c33d6361c 100644
--- a/include/asm-x86/dma-mapping.h
+++ b/include/asm-x86/dma-mapping.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_DMA_MAPPING_H_ 1#ifndef ASM_X86__DMA_MAPPING_H
2#define _ASM_DMA_MAPPING_H_ 2#define ASM_X86__DMA_MAPPING_H
3 3
4/* 4/*
5 * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for 5 * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
@@ -9,12 +9,12 @@
9#include <linux/scatterlist.h> 9#include <linux/scatterlist.h>
10#include <asm/io.h> 10#include <asm/io.h>
11#include <asm/swiotlb.h> 11#include <asm/swiotlb.h>
12#include <asm-generic/dma-coherent.h>
12 13
13extern dma_addr_t bad_dma_address; 14extern dma_addr_t bad_dma_address;
14extern int iommu_merge; 15extern int iommu_merge;
15extern struct device fallback_dev; 16extern struct device x86_dma_fallback_dev;
16extern int panic_on_overflow; 17extern int panic_on_overflow;
17extern int force_iommu;
18 18
19struct dma_mapping_ops { 19struct dma_mapping_ops {
20 int (*mapping_error)(struct device *dev, 20 int (*mapping_error)(struct device *dev,
@@ -25,9 +25,6 @@ struct dma_mapping_ops {
25 void *vaddr, dma_addr_t dma_handle); 25 void *vaddr, dma_addr_t dma_handle);
26 dma_addr_t (*map_single)(struct device *hwdev, phys_addr_t ptr, 26 dma_addr_t (*map_single)(struct device *hwdev, phys_addr_t ptr,
27 size_t size, int direction); 27 size_t size, int direction);
28 /* like map_single, but doesn't check the device mask */
29 dma_addr_t (*map_simple)(struct device *hwdev, phys_addr_t ptr,
30 size_t size, int direction);
31 void (*unmap_single)(struct device *dev, dma_addr_t addr, 28 void (*unmap_single)(struct device *dev, dma_addr_t addr,
32 size_t size, int direction); 29 size_t size, int direction);
33 void (*sync_single_for_cpu)(struct device *hwdev, 30 void (*sync_single_for_cpu)(struct device *hwdev,
@@ -68,7 +65,7 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
68 return dma_ops; 65 return dma_ops;
69 else 66 else
70 return dev->archdata.dma_ops; 67 return dev->archdata.dma_ops;
71#endif 68#endif /* ASM_X86__DMA_MAPPING_H */
72} 69}
73 70
74/* Make sure we keep the same behaviour */ 71/* Make sure we keep the same behaviour */
@@ -87,17 +84,14 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
87 84
88#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 85#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
89#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 86#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
90 87#define dma_is_consistent(d, h) (1)
91void *dma_alloc_coherent(struct device *dev, size_t size,
92 dma_addr_t *dma_handle, gfp_t flag);
93
94void dma_free_coherent(struct device *dev, size_t size,
95 void *vaddr, dma_addr_t dma_handle);
96
97 88
98extern int dma_supported(struct device *hwdev, u64 mask); 89extern int dma_supported(struct device *hwdev, u64 mask);
99extern int dma_set_mask(struct device *dev, u64 mask); 90extern int dma_set_mask(struct device *dev, u64 mask);
100 91
92extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
93 dma_addr_t *dma_addr, gfp_t flag);
94
101static inline dma_addr_t 95static inline dma_addr_t
102dma_map_single(struct device *hwdev, void *ptr, size_t size, 96dma_map_single(struct device *hwdev, void *ptr, size_t size,
103 int direction) 97 int direction)
@@ -247,7 +241,68 @@ static inline int dma_get_cache_alignment(void)
247 return boot_cpu_data.x86_clflush_size; 241 return boot_cpu_data.x86_clflush_size;
248} 242}
249 243
250#define dma_is_consistent(d, h) (1) 244static inline unsigned long dma_alloc_coherent_mask(struct device *dev,
245 gfp_t gfp)
246{
247 unsigned long dma_mask = 0;
248
249 dma_mask = dev->coherent_dma_mask;
250 if (!dma_mask)
251 dma_mask = (gfp & GFP_DMA) ? DMA_24BIT_MASK : DMA_32BIT_MASK;
252
253 return dma_mask;
254}
255
256static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp)
257{
258#ifdef CONFIG_X86_64
259 unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp);
260
261 if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA))
262 gfp |= GFP_DMA32;
263#endif
264 return gfp;
265}
266
267static inline void *
268dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
269 gfp_t gfp)
270{
271 struct dma_mapping_ops *ops = get_dma_ops(dev);
272 void *memory;
273
274 gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
275
276 if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
277 return memory;
278
279 if (!dev) {
280 dev = &x86_dma_fallback_dev;
281 gfp |= GFP_DMA;
282 }
283
284 if (!is_device_dma_capable(dev))
285 return NULL;
286
287 if (!ops->alloc_coherent)
288 return NULL;
289
290 return ops->alloc_coherent(dev, size, dma_handle,
291 dma_alloc_coherent_gfp_flags(dev, gfp));
292}
293
294static inline void dma_free_coherent(struct device *dev, size_t size,
295 void *vaddr, dma_addr_t bus)
296{
297 struct dma_mapping_ops *ops = get_dma_ops(dev);
298
299 WARN_ON(irqs_disabled()); /* for portability */
300
301 if (dma_release_from_coherent(dev, get_order(size), vaddr))
302 return;
303
304 if (ops->free_coherent)
305 ops->free_coherent(dev, size, vaddr, bus);
306}
251 307
252#include <asm-generic/dma-coherent.h>
253#endif 308#endif
diff --git a/include/asm-x86/dma.h b/include/asm-x86/dma.h
index ca1098a7e580..c9f7a4eec555 100644
--- a/include/asm-x86/dma.h
+++ b/include/asm-x86/dma.h
@@ -5,8 +5,8 @@
5 * and John Boyd, Nov. 1992. 5 * and John Boyd, Nov. 1992.
6 */ 6 */
7 7
8#ifndef _ASM_X86_DMA_H 8#ifndef ASM_X86__DMA_H
9#define _ASM_X86_DMA_H 9#define ASM_X86__DMA_H
10 10
11#include <linux/spinlock.h> /* And spinlocks */ 11#include <linux/spinlock.h> /* And spinlocks */
12#include <asm/io.h> /* need byte IO */ 12#include <asm/io.h> /* need byte IO */
@@ -315,4 +315,4 @@ extern int isa_dma_bridge_buggy;
315#define isa_dma_bridge_buggy (0) 315#define isa_dma_bridge_buggy (0)
316#endif 316#endif
317 317
318#endif /* _ASM_X86_DMA_H */ 318#endif /* ASM_X86__DMA_H */
diff --git a/include/asm-x86/dmi.h b/include/asm-x86/dmi.h
index 58a86571fe0f..1cff6fe81fa5 100644
--- a/include/asm-x86/dmi.h
+++ b/include/asm-x86/dmi.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_DMI_H 1#ifndef ASM_X86__DMI_H
2#define _ASM_X86_DMI_H 2#define ASM_X86__DMI_H
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5 5
@@ -23,4 +23,4 @@ static inline void *dmi_alloc(unsigned len)
23#define dmi_ioremap early_ioremap 23#define dmi_ioremap early_ioremap
24#define dmi_iounmap early_iounmap 24#define dmi_iounmap early_iounmap
25 25
26#endif 26#endif /* ASM_X86__DMI_H */
diff --git a/include/asm-x86/ds.h b/include/asm-x86/ds.h
index 7881368142fa..c3c953a45b21 100644
--- a/include/asm-x86/ds.h
+++ b/include/asm-x86/ds.h
@@ -2,71 +2,237 @@
2 * Debug Store (DS) support 2 * Debug Store (DS) support
3 * 3 *
4 * This provides a low-level interface to the hardware's Debug Store 4 * This provides a low-level interface to the hardware's Debug Store
5 * feature that is used for last branch recording (LBR) and 5 * feature that is used for branch trace store (BTS) and
6 * precise-event based sampling (PEBS). 6 * precise-event based sampling (PEBS).
7 * 7 *
8 * Different architectures use a different DS layout/pointer size. 8 * It manages:
9 * The below functions therefore work on a void*. 9 * - per-thread and per-cpu allocation of BTS and PEBS
10 * - buffer memory allocation (optional)
11 * - buffer overflow handling
12 * - buffer access
10 * 13 *
14 * It assumes:
15 * - get_task_struct on all parameter tasks
16 * - current is allowed to trace parameter tasks
11 * 17 *
12 * Since there is no user for PEBS, yet, only LBR (or branch
13 * trace store, BTS) is supported.
14 * 18 *
15 * 19 * Copyright (C) 2007-2008 Intel Corporation.
16 * Copyright (C) 2007 Intel Corporation. 20 * Markus Metzger <markus.t.metzger@intel.com>, 2007-2008
17 * Markus Metzger <markus.t.metzger@intel.com>, Dec 2007
18 */ 21 */
19 22
20#ifndef _ASM_X86_DS_H 23#ifndef ASM_X86__DS_H
21#define _ASM_X86_DS_H 24#define ASM_X86__DS_H
25
26#ifdef CONFIG_X86_DS
22 27
23#include <linux/types.h> 28#include <linux/types.h>
24#include <linux/init.h> 29#include <linux/init.h>
25 30
26struct cpuinfo_x86;
27 31
32struct task_struct;
28 33
29/* a branch trace record entry 34/*
35 * Request BTS or PEBS
36 *
37 * Due to alignement constraints, the actual buffer may be slightly
38 * smaller than the requested or provided buffer.
30 * 39 *
31 * In order to unify the interface between various processor versions, 40 * Returns 0 on success; -Eerrno otherwise
32 * we use the below data structure for all processors. 41 *
42 * task: the task to request recording for;
43 * NULL for per-cpu recording on the current cpu
44 * base: the base pointer for the (non-pageable) buffer;
45 * NULL if buffer allocation requested
46 * size: the size of the requested or provided buffer
47 * ovfl: pointer to a function to be called on buffer overflow;
48 * NULL if cyclic buffer requested
33 */ 49 */
34enum bts_qualifier { 50typedef void (*ds_ovfl_callback_t)(struct task_struct *);
35 BTS_INVALID = 0, 51extern int ds_request_bts(struct task_struct *task, void *base, size_t size,
36 BTS_BRANCH, 52 ds_ovfl_callback_t ovfl);
37 BTS_TASK_ARRIVES, 53extern int ds_request_pebs(struct task_struct *task, void *base, size_t size,
38 BTS_TASK_DEPARTS 54 ds_ovfl_callback_t ovfl);
39};
40 55
41struct bts_struct { 56/*
42 u64 qualifier; 57 * Release BTS or PEBS resources
43 union { 58 *
44 /* BTS_BRANCH */ 59 * Frees buffers allocated on ds_request.
45 struct { 60 *
46 u64 from_ip; 61 * Returns 0 on success; -Eerrno otherwise
47 u64 to_ip; 62 *
48 } lbr; 63 * task: the task to release resources for;
49 /* BTS_TASK_ARRIVES or 64 * NULL to release resources for the current cpu
50 BTS_TASK_DEPARTS */ 65 */
51 u64 jiffies; 66extern int ds_release_bts(struct task_struct *task);
52 } variant; 67extern int ds_release_pebs(struct task_struct *task);
68
69/*
70 * Return the (array) index of the write pointer.
71 * (assuming an array of BTS/PEBS records)
72 *
73 * Returns -Eerrno on error
74 *
75 * task: the task to access;
76 * NULL to access the current cpu
77 * pos (out): if not NULL, will hold the result
78 */
79extern int ds_get_bts_index(struct task_struct *task, size_t *pos);
80extern int ds_get_pebs_index(struct task_struct *task, size_t *pos);
81
82/*
83 * Return the (array) index one record beyond the end of the array.
84 * (assuming an array of BTS/PEBS records)
85 *
86 * Returns -Eerrno on error
87 *
88 * task: the task to access;
89 * NULL to access the current cpu
90 * pos (out): if not NULL, will hold the result
91 */
92extern int ds_get_bts_end(struct task_struct *task, size_t *pos);
93extern int ds_get_pebs_end(struct task_struct *task, size_t *pos);
94
95/*
96 * Provide a pointer to the BTS/PEBS record at parameter index.
97 * (assuming an array of BTS/PEBS records)
98 *
99 * The pointer points directly into the buffer. The user is
100 * responsible for copying the record.
101 *
102 * Returns the size of a single record on success; -Eerrno on error
103 *
104 * task: the task to access;
105 * NULL to access the current cpu
106 * index: the index of the requested record
107 * record (out): pointer to the requested record
108 */
109extern int ds_access_bts(struct task_struct *task,
110 size_t index, const void **record);
111extern int ds_access_pebs(struct task_struct *task,
112 size_t index, const void **record);
113
114/*
115 * Write one or more BTS/PEBS records at the write pointer index and
116 * advance the write pointer.
117 *
118 * If size is not a multiple of the record size, trailing bytes are
119 * zeroed out.
120 *
121 * May result in one or more overflow notifications.
122 *
123 * If called during overflow handling, that is, with index >=
124 * interrupt threshold, the write will wrap around.
125 *
126 * An overflow notification is given if and when the interrupt
127 * threshold is reached during or after the write.
128 *
129 * Returns the number of bytes written or -Eerrno.
130 *
131 * task: the task to access;
132 * NULL to access the current cpu
133 * buffer: the buffer to write
134 * size: the size of the buffer
135 */
136extern int ds_write_bts(struct task_struct *task,
137 const void *buffer, size_t size);
138extern int ds_write_pebs(struct task_struct *task,
139 const void *buffer, size_t size);
140
141/*
142 * Same as ds_write_bts/pebs, but omit ownership checks.
143 *
144 * This is needed to have some other task than the owner of the
145 * BTS/PEBS buffer or the parameter task itself write into the
146 * respective buffer.
147 */
148extern int ds_unchecked_write_bts(struct task_struct *task,
149 const void *buffer, size_t size);
150extern int ds_unchecked_write_pebs(struct task_struct *task,
151 const void *buffer, size_t size);
152
153/*
154 * Reset the write pointer of the BTS/PEBS buffer.
155 *
156 * Returns 0 on success; -Eerrno on error
157 *
158 * task: the task to access;
159 * NULL to access the current cpu
160 */
161extern int ds_reset_bts(struct task_struct *task);
162extern int ds_reset_pebs(struct task_struct *task);
163
164/*
165 * Clear the BTS/PEBS buffer and reset the write pointer.
166 * The entire buffer will be zeroed out.
167 *
168 * Returns 0 on success; -Eerrno on error
169 *
170 * task: the task to access;
171 * NULL to access the current cpu
172 */
173extern int ds_clear_bts(struct task_struct *task);
174extern int ds_clear_pebs(struct task_struct *task);
175
176/*
177 * Provide the PEBS counter reset value.
178 *
179 * Returns 0 on success; -Eerrno on error
180 *
181 * task: the task to access;
182 * NULL to access the current cpu
183 * value (out): the counter reset value
184 */
185extern int ds_get_pebs_reset(struct task_struct *task, u64 *value);
186
187/*
188 * Set the PEBS counter reset value.
189 *
190 * Returns 0 on success; -Eerrno on error
191 *
192 * task: the task to access;
193 * NULL to access the current cpu
194 * value: the new counter reset value
195 */
196extern int ds_set_pebs_reset(struct task_struct *task, u64 value);
197
198/*
199 * Initialization
200 */
201struct cpuinfo_x86;
202extern void __cpuinit ds_init_intel(struct cpuinfo_x86 *);
203
204
205
206/*
207 * The DS context - part of struct thread_struct.
208 */
209struct ds_context {
210 /* pointer to the DS configuration; goes into MSR_IA32_DS_AREA */
211 unsigned char *ds;
212 /* the owner of the BTS and PEBS configuration, respectively */
213 struct task_struct *owner[2];
214 /* buffer overflow notification function for BTS and PEBS */
215 ds_ovfl_callback_t callback[2];
216 /* the original buffer address */
217 void *buffer[2];
218 /* the number of allocated pages for on-request allocated buffers */
219 unsigned int pages[2];
220 /* use count */
221 unsigned long count;
222 /* a pointer to the context location inside the thread_struct
223 * or the per_cpu context array */
224 struct ds_context **this;
225 /* a pointer to the task owning this context, or NULL, if the
226 * context is owned by a cpu */
227 struct task_struct *task;
53}; 228};
54 229
55/* Overflow handling mechanisms */ 230/* called by exit_thread() to free leftover contexts */
56#define DS_O_SIGNAL 1 /* send overflow signal */ 231extern void ds_free(struct ds_context *context);
57#define DS_O_WRAP 2 /* wrap around */ 232
58 233#else /* CONFIG_X86_DS */
59extern int ds_allocate(void **, size_t); 234
60extern int ds_free(void **); 235#define ds_init_intel(config) do {} while (0)
61extern int ds_get_bts_size(void *); 236
62extern int ds_get_bts_end(void *); 237#endif /* CONFIG_X86_DS */
63extern int ds_get_bts_index(void *); 238#endif /* ASM_X86__DS_H */
64extern int ds_set_overflow(void *, int);
65extern int ds_get_overflow(void *);
66extern int ds_clear(void *);
67extern int ds_read_bts(void *, int, struct bts_struct *);
68extern int ds_write_bts(void *, const struct bts_struct *);
69extern unsigned long ds_debugctl_mask(void);
70extern void __cpuinit ds_init_intel(struct cpuinfo_x86 *c);
71
72#endif /* _ASM_X86_DS_H */
diff --git a/include/asm-x86/dwarf2.h b/include/asm-x86/dwarf2.h
index 738bb9fb3e53..21d1bc32ad7c 100644
--- a/include/asm-x86/dwarf2.h
+++ b/include/asm-x86/dwarf2.h
@@ -1,5 +1,5 @@
1#ifndef _DWARF2_H 1#ifndef ASM_X86__DWARF2_H
2#define _DWARF2_H 2#define ASM_X86__DWARF2_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#warning "asm/dwarf2.h should be only included in pure assembly files" 5#warning "asm/dwarf2.h should be only included in pure assembly files"
@@ -58,4 +58,4 @@
58 58
59#endif 59#endif
60 60
61#endif 61#endif /* ASM_X86__DWARF2_H */
diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h
index 16a31e2c7c57..5abbdec06bd2 100644
--- a/include/asm-x86/e820.h
+++ b/include/asm-x86/e820.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_E820_H 1#ifndef ASM_X86__E820_H
2#define __ASM_E820_H 2#define ASM_X86__E820_H
3#define E820MAP 0x2d0 /* our map */ 3#define E820MAP 0x2d0 /* our map */
4#define E820MAX 128 /* number of entries in E820MAP */ 4#define E820MAX 128 /* number of entries in E820MAP */
5 5
@@ -43,6 +43,7 @@
43#define E820_RESERVED 2 43#define E820_RESERVED 2
44#define E820_ACPI 3 44#define E820_ACPI 3
45#define E820_NVS 4 45#define E820_NVS 4
46#define E820_UNUSABLE 5
46 47
47/* reserved RAM used by kernel itself */ 48/* reserved RAM used by kernel itself */
48#define E820_RESERVED_KERN 128 49#define E820_RESERVED_KERN 128
@@ -64,6 +65,7 @@ struct e820map {
64extern struct e820map e820; 65extern struct e820map e820;
65extern struct e820map e820_saved; 66extern struct e820map e820_saved;
66 67
68extern unsigned long pci_mem_start;
67extern int e820_any_mapped(u64 start, u64 end, unsigned type); 69extern int e820_any_mapped(u64 start, u64 end, unsigned type);
68extern int e820_all_mapped(u64 start, u64 end, unsigned type); 70extern int e820_all_mapped(u64 start, u64 end, unsigned type);
69extern void e820_add_region(u64 start, u64 size, int type); 71extern void e820_add_region(u64 start, u64 size, int type);
@@ -120,6 +122,7 @@ extern void e820_register_active_regions(int nid, unsigned long start_pfn,
120extern u64 e820_hole_size(u64 start, u64 end); 122extern u64 e820_hole_size(u64 start, u64 end);
121extern void finish_e820_parsing(void); 123extern void finish_e820_parsing(void);
122extern void e820_reserve_resources(void); 124extern void e820_reserve_resources(void);
125extern void e820_reserve_resources_late(void);
123extern void setup_memory_map(void); 126extern void setup_memory_map(void);
124extern char *default_machine_specific_memory_setup(void); 127extern char *default_machine_specific_memory_setup(void);
125extern char *machine_specific_memory_setup(void); 128extern char *machine_specific_memory_setup(void);
@@ -140,4 +143,4 @@ extern char *memory_setup(void);
140#define HIGH_MEMORY (1024*1024) 143#define HIGH_MEMORY (1024*1024)
141#endif /* __KERNEL__ */ 144#endif /* __KERNEL__ */
142 145
143#endif /* __ASM_E820_H */ 146#endif /* ASM_X86__E820_H */
diff --git a/include/asm-x86/edac.h b/include/asm-x86/edac.h
index a8088f63a30e..9493c5b27bbd 100644
--- a/include/asm-x86/edac.h
+++ b/include/asm-x86/edac.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_EDAC_H 1#ifndef ASM_X86__EDAC_H
2#define _ASM_X86_EDAC_H 2#define ASM_X86__EDAC_H
3 3
4/* ECC atomic, DMA, SMP and interrupt safe scrub function */ 4/* ECC atomic, DMA, SMP and interrupt safe scrub function */
5 5
@@ -15,4 +15,4 @@ static inline void atomic_scrub(void *va, u32 size)
15 asm volatile("lock; addl $0, %0"::"m" (*virt_addr)); 15 asm volatile("lock; addl $0, %0"::"m" (*virt_addr));
16} 16}
17 17
18#endif 18#endif /* ASM_X86__EDAC_H */
diff --git a/include/asm-x86/efi.h b/include/asm-x86/efi.h
index d4f2b0abe929..ed2de22e8705 100644
--- a/include/asm-x86/efi.h
+++ b/include/asm-x86/efi.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_EFI_H 1#ifndef ASM_X86__EFI_H
2#define _ASM_X86_EFI_H 2#define ASM_X86__EFI_H
3 3
4#ifdef CONFIG_X86_32 4#ifdef CONFIG_X86_32
5 5
@@ -94,4 +94,4 @@ extern void efi_reserve_early(void);
94extern void efi_call_phys_prelog(void); 94extern void efi_call_phys_prelog(void);
95extern void efi_call_phys_epilog(void); 95extern void efi_call_phys_epilog(void);
96 96
97#endif 97#endif /* ASM_X86__EFI_H */
diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h
index 7be4733c793e..26bc15f01e78 100644
--- a/include/asm-x86/elf.h
+++ b/include/asm-x86/elf.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_ELF_H 1#ifndef ASM_X86__ELF_H
2#define _ASM_X86_ELF_H 2#define ASM_X86__ELF_H
3 3
4/* 4/*
5 * ELF register definitions.. 5 * ELF register definitions..
@@ -148,8 +148,9 @@ do { \
148 148
149static inline void start_ia32_thread(struct pt_regs *regs, u32 ip, u32 sp) 149static inline void start_ia32_thread(struct pt_regs *regs, u32 ip, u32 sp)
150{ 150{
151 asm volatile("movl %0,%%fs" :: "r" (0)); 151 loadsegment(fs, 0);
152 asm volatile("movl %0,%%es; movl %0,%%ds" : : "r" (__USER32_DS)); 152 loadsegment(ds, __USER32_DS);
153 loadsegment(es, __USER32_DS);
153 load_gs_index(0); 154 load_gs_index(0);
154 regs->ip = ip; 155 regs->ip = ip;
155 regs->sp = sp; 156 regs->sp = sp;
@@ -185,7 +186,7 @@ do { \
185 set_fs(USER_DS); \ 186 set_fs(USER_DS); \
186} while (0) 187} while (0)
187 188
188#define COMPAT_SET_PERSONALITY(ex, ibcs2) \ 189#define COMPAT_SET_PERSONALITY(ex) \
189do { \ 190do { \
190 if (test_thread_flag(TIF_IA32)) \ 191 if (test_thread_flag(TIF_IA32)) \
191 clear_thread_flag(TIF_ABI_PENDING); \ 192 clear_thread_flag(TIF_ABI_PENDING); \
@@ -266,7 +267,7 @@ extern int force_personality32;
266 For the moment, we have only optimizations for the Intel generations, 267 For the moment, we have only optimizations for the Intel generations,
267 but that could change... */ 268 but that could change... */
268 269
269#define SET_PERSONALITY(ex, ibcs2) set_personality_64bit() 270#define SET_PERSONALITY(ex) set_personality_64bit()
270 271
271/* 272/*
272 * An executable for which elf_read_implies_exec() returns TRUE will 273 * An executable for which elf_read_implies_exec() returns TRUE will
@@ -332,4 +333,4 @@ extern int syscall32_setup_pages(struct linux_binprm *, int exstack);
332extern unsigned long arch_randomize_brk(struct mm_struct *mm); 333extern unsigned long arch_randomize_brk(struct mm_struct *mm);
333#define arch_randomize_brk arch_randomize_brk 334#define arch_randomize_brk arch_randomize_brk
334 335
335#endif 336#endif /* ASM_X86__ELF_H */
diff --git a/include/asm-x86/emergency-restart.h b/include/asm-x86/emergency-restart.h
index 8e6aef19f8f0..190d0d8b71e3 100644
--- a/include/asm-x86/emergency-restart.h
+++ b/include/asm-x86/emergency-restart.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_EMERGENCY_RESTART_H 1#ifndef ASM_X86__EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H 2#define ASM_X86__EMERGENCY_RESTART_H
3 3
4enum reboot_type { 4enum reboot_type {
5 BOOT_TRIPLE = 't', 5 BOOT_TRIPLE = 't',
@@ -15,4 +15,4 @@ extern enum reboot_type reboot_type;
15 15
16extern void machine_emergency_restart(void); 16extern void machine_emergency_restart(void);
17 17
18#endif /* _ASM_EMERGENCY_RESTART_H */ 18#endif /* ASM_X86__EMERGENCY_RESTART_H */
diff --git a/include/asm-x86/mach-es7000/mach_apic.h b/include/asm-x86/es7000/apic.h
index 0a3fdf930672..aae50c2fb303 100644
--- a/include/asm-x86/mach-es7000/mach_apic.h
+++ b/include/asm-x86/es7000/apic.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_APIC_H 1#ifndef __ASM_ES7000_APIC_H
2#define __ASM_MACH_APIC_H 2#define __ASM_ES7000_APIC_H
3 3
4#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu) 4#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
5#define esr_disable (1) 5#define esr_disable (1)
@@ -10,7 +10,7 @@ static inline int apic_id_registered(void)
10} 10}
11 11
12static inline cpumask_t target_cpus(void) 12static inline cpumask_t target_cpus(void)
13{ 13{
14#if defined CONFIG_ES7000_CLUSTERED_APIC 14#if defined CONFIG_ES7000_CLUSTERED_APIC
15 return CPU_MASK_ALL; 15 return CPU_MASK_ALL;
16#else 16#else
@@ -23,24 +23,24 @@ static inline cpumask_t target_cpus(void)
23#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) 23#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
24#define INT_DELIVERY_MODE (dest_LowestPrio) 24#define INT_DELIVERY_MODE (dest_LowestPrio)
25#define INT_DEST_MODE (1) /* logical delivery broadcast to all procs */ 25#define INT_DEST_MODE (1) /* logical delivery broadcast to all procs */
26#define NO_BALANCE_IRQ (1) 26#define NO_BALANCE_IRQ (1)
27#undef WAKE_SECONDARY_VIA_INIT 27#undef WAKE_SECONDARY_VIA_INIT
28#define WAKE_SECONDARY_VIA_MIP 28#define WAKE_SECONDARY_VIA_MIP
29#else 29#else
30#define APIC_DFR_VALUE (APIC_DFR_FLAT) 30#define APIC_DFR_VALUE (APIC_DFR_FLAT)
31#define INT_DELIVERY_MODE (dest_Fixed) 31#define INT_DELIVERY_MODE (dest_Fixed)
32#define INT_DEST_MODE (0) /* phys delivery to target procs */ 32#define INT_DEST_MODE (0) /* phys delivery to target procs */
33#define NO_BALANCE_IRQ (0) 33#define NO_BALANCE_IRQ (0)
34#undef APIC_DEST_LOGICAL 34#undef APIC_DEST_LOGICAL
35#define APIC_DEST_LOGICAL 0x0 35#define APIC_DEST_LOGICAL 0x0
36#define WAKE_SECONDARY_VIA_INIT 36#define WAKE_SECONDARY_VIA_INIT
37#endif 37#endif
38 38
39static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) 39static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
40{ 40{
41 return 0; 41 return 0;
42} 42}
43static inline unsigned long check_apicid_present(int bit) 43static inline unsigned long check_apicid_present(int bit)
44{ 44{
45 return physid_isset(bit, phys_cpu_present_map); 45 return physid_isset(bit, phys_cpu_present_map);
46} 46}
@@ -80,7 +80,7 @@ static inline void setup_apic_routing(void)
80{ 80{
81 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id()); 81 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
82 printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n", 82 printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
83 (apic_version[apic] == 0x14) ? 83 (apic_version[apic] == 0x14) ?
84 "Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_addr(TARGET_CPUS)[0]); 84 "Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_addr(TARGET_CPUS)[0]);
85} 85}
86 86
@@ -141,7 +141,7 @@ static inline void setup_portio_remap(void)
141extern unsigned int boot_cpu_physical_apicid; 141extern unsigned int boot_cpu_physical_apicid;
142static inline int check_phys_apicid_present(int cpu_physical_apicid) 142static inline int check_phys_apicid_present(int cpu_physical_apicid)
143{ 143{
144 boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); 144 boot_cpu_physical_apicid = read_apic_id();
145 return (1); 145 return (1);
146} 146}
147 147
@@ -150,7 +150,7 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
150 int num_bits_set; 150 int num_bits_set;
151 int cpus_found = 0; 151 int cpus_found = 0;
152 int cpu; 152 int cpu;
153 int apicid; 153 int apicid;
154 154
155 num_bits_set = cpus_weight(cpumask); 155 num_bits_set = cpus_weight(cpumask);
156 /* Return id to all */ 156 /* Return id to all */
@@ -160,18 +160,18 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
160#else 160#else
161 return cpu_to_logical_apicid(0); 161 return cpu_to_logical_apicid(0);
162#endif 162#endif
163 /* 163 /*
164 * The cpus in the mask must all be on the apic cluster. If are not 164 * The cpus in the mask must all be on the apic cluster. If are not
165 * on the same apicid cluster return default value of TARGET_CPUS. 165 * on the same apicid cluster return default value of TARGET_CPUS.
166 */ 166 */
167 cpu = first_cpu(cpumask); 167 cpu = first_cpu(cpumask);
168 apicid = cpu_to_logical_apicid(cpu); 168 apicid = cpu_to_logical_apicid(cpu);
169 while (cpus_found < num_bits_set) { 169 while (cpus_found < num_bits_set) {
170 if (cpu_isset(cpu, cpumask)) { 170 if (cpu_isset(cpu, cpumask)) {
171 int new_apicid = cpu_to_logical_apicid(cpu); 171 int new_apicid = cpu_to_logical_apicid(cpu);
172 if (apicid_cluster(apicid) != 172 if (apicid_cluster(apicid) !=
173 apicid_cluster(new_apicid)){ 173 apicid_cluster(new_apicid)){
174 printk ("%s: Not a valid mask!\n",__FUNCTION__); 174 printk ("%s: Not a valid mask!\n", __func__);
175#if defined CONFIG_ES7000_CLUSTERED_APIC 175#if defined CONFIG_ES7000_CLUSTERED_APIC
176 return 0xFF; 176 return 0xFF;
177#else 177#else
@@ -191,4 +191,4 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
191 return cpuid_apic >> index_msb; 191 return cpuid_apic >> index_msb;
192} 192}
193 193
194#endif /* __ASM_MACH_APIC_H */ 194#endif /* __ASM_ES7000_APIC_H */
diff --git a/include/asm-x86/es7000/apicdef.h b/include/asm-x86/es7000/apicdef.h
new file mode 100644
index 000000000000..8b234a3cb851
--- /dev/null
+++ b/include/asm-x86/es7000/apicdef.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_ES7000_APICDEF_H
2#define __ASM_ES7000_APICDEF_H
3
4#define APIC_ID_MASK (0xFF<<24)
5
6static inline unsigned get_apic_id(unsigned long x)
7{
8 return (((x)>>24)&0xFF);
9}
10
11#define GET_APIC_ID(x) get_apic_id(x)
12
13#endif
diff --git a/include/asm-x86/mach-es7000/mach_ipi.h b/include/asm-x86/es7000/ipi.h
index 5e61bd220b06..632a955fcc0a 100644
--- a/include/asm-x86/mach-es7000/mach_ipi.h
+++ b/include/asm-x86/es7000/ipi.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_ES7000_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_ES7000_IPI_H
3 3
4void send_IPI_mask_sequence(cpumask_t mask, int vector); 4void send_IPI_mask_sequence(cpumask_t mask, int vector);
5 5
@@ -21,4 +21,4 @@ static inline void send_IPI_all(int vector)
21 send_IPI_mask(cpu_online_map, vector); 21 send_IPI_mask(cpu_online_map, vector);
22} 22}
23 23
24#endif /* __ASM_MACH_IPI_H */ 24#endif /* __ASM_ES7000_IPI_H */
diff --git a/include/asm-x86/mach-es7000/mach_mpparse.h b/include/asm-x86/es7000/mpparse.h
index ef26d3523625..ed5a3caae141 100644
--- a/include/asm-x86/mach-es7000/mach_mpparse.h
+++ b/include/asm-x86/es7000/mpparse.h
@@ -1,10 +1,11 @@
1#ifndef __ASM_MACH_MPPARSE_H 1#ifndef __ASM_ES7000_MPPARSE_H
2#define __ASM_MACH_MPPARSE_H 2#define __ASM_ES7000_MPPARSE_H
3 3
4#include <linux/acpi.h> 4#include <linux/acpi.h>
5 5
6extern int parse_unisys_oem (char *oemptr); 6extern int parse_unisys_oem (char *oemptr);
7extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); 7extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
8extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr);
8extern void setup_unisys(void); 9extern void setup_unisys(void);
9 10
10#ifndef CONFIG_X86_GENERICARCH 11#ifndef CONFIG_X86_GENERICARCH
diff --git a/include/asm-x86/mach-es7000/mach_wakecpu.h b/include/asm-x86/es7000/wakecpu.h
index 84ff58314501..3ffc5a7bf667 100644
--- a/include/asm-x86/mach-es7000/mach_wakecpu.h
+++ b/include/asm-x86/es7000/wakecpu.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_MACH_WAKECPU_H 1#ifndef __ASM_ES7000_WAKECPU_H
2#define __ASM_MACH_WAKECPU_H 2#define __ASM_ES7000_WAKECPU_H
3 3
4/* 4/*
5 * This file copes with machines that wakeup secondary CPUs by the 5 * This file copes with machines that wakeup secondary CPUs by the
6 * INIT, INIT, STARTUP sequence. 6 * INIT, INIT, STARTUP sequence.
7 */ 7 */
diff --git a/include/asm-x86/fb.h b/include/asm-x86/fb.h
index 53018464aea6..aca38dbd9a64 100644
--- a/include/asm-x86/fb.h
+++ b/include/asm-x86/fb.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_FB_H 1#ifndef ASM_X86__FB_H
2#define _ASM_X86_FB_H 2#define ASM_X86__FB_H
3 3
4#include <linux/fb.h> 4#include <linux/fb.h>
5#include <linux/fs.h> 5#include <linux/fs.h>
@@ -18,4 +18,4 @@ extern int fb_is_primary_device(struct fb_info *info);
18static inline int fb_is_primary_device(struct fb_info *info) { return 0; } 18static inline int fb_is_primary_device(struct fb_info *info) { return 0; }
19#endif 19#endif
20 20
21#endif /* _ASM_X86_FB_H */ 21#endif /* ASM_X86__FB_H */
diff --git a/include/asm-x86/fixmap.h b/include/asm-x86/fixmap.h
index 44d4f8217349..78e33a1bc591 100644
--- a/include/asm-x86/fixmap.h
+++ b/include/asm-x86/fixmap.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_FIXMAP_H 1#ifndef ASM_X86__FIXMAP_H
2#define _ASM_FIXMAP_H 2#define ASM_X86__FIXMAP_H
3 3
4#ifdef CONFIG_X86_32 4#ifdef CONFIG_X86_32
5# include "fixmap_32.h" 5# include "fixmap_32.h"
@@ -65,4 +65,4 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
65 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); 65 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
66 return __virt_to_fix(vaddr); 66 return __virt_to_fix(vaddr);
67} 67}
68#endif 68#endif /* ASM_X86__FIXMAP_H */
diff --git a/include/asm-x86/fixmap_32.h b/include/asm-x86/fixmap_32.h
index f1ac2b2167d7..8844002da0e0 100644
--- a/include/asm-x86/fixmap_32.h
+++ b/include/asm-x86/fixmap_32.h
@@ -10,8 +10,8 @@
10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11 */ 11 */
12 12
13#ifndef _ASM_FIXMAP_32_H 13#ifndef ASM_X86__FIXMAP_32_H
14#define _ASM_FIXMAP_32_H 14#define ASM_X86__FIXMAP_32_H
15 15
16 16
17/* used by vmalloc.c, vsyscall.lds.S. 17/* used by vmalloc.c, vsyscall.lds.S.
@@ -94,10 +94,10 @@ enum fixed_addresses {
94 * can have a single pgd entry and a single pte table: 94 * can have a single pgd entry and a single pte table:
95 */ 95 */
96#define NR_FIX_BTMAPS 64 96#define NR_FIX_BTMAPS 64
97#define FIX_BTMAPS_NESTING 4 97#define FIX_BTMAPS_SLOTS 4
98 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - 98 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
99 (__end_of_permanent_fixed_addresses & 255), 99 (__end_of_permanent_fixed_addresses & 255),
100 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_NESTING - 1, 100 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
101 FIX_WP_TEST, 101 FIX_WP_TEST,
102#ifdef CONFIG_ACPI 102#ifdef CONFIG_ACPI
103 FIX_ACPI_BEGIN, 103 FIX_ACPI_BEGIN,
@@ -120,4 +120,4 @@ extern void reserve_top_address(unsigned long reserve);
120#define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE) 120#define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE)
121 121
122#endif /* !__ASSEMBLY__ */ 122#endif /* !__ASSEMBLY__ */
123#endif 123#endif /* ASM_X86__FIXMAP_32_H */
diff --git a/include/asm-x86/fixmap_64.h b/include/asm-x86/fixmap_64.h
index 00f3d74a0524..dab4751d1307 100644
--- a/include/asm-x86/fixmap_64.h
+++ b/include/asm-x86/fixmap_64.h
@@ -8,8 +8,8 @@
8 * Copyright (C) 1998 Ingo Molnar 8 * Copyright (C) 1998 Ingo Molnar
9 */ 9 */
10 10
11#ifndef _ASM_FIXMAP_64_H 11#ifndef ASM_X86__FIXMAP_64_H
12#define _ASM_FIXMAP_64_H 12#define ASM_X86__FIXMAP_64_H
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <asm/acpi.h> 15#include <asm/acpi.h>
@@ -49,6 +49,7 @@ enum fixed_addresses {
49#ifdef CONFIG_PARAVIRT 49#ifdef CONFIG_PARAVIRT
50 FIX_PARAVIRT_BOOTMAP, 50 FIX_PARAVIRT_BOOTMAP,
51#endif 51#endif
52 __end_of_permanent_fixed_addresses,
52#ifdef CONFIG_ACPI 53#ifdef CONFIG_ACPI
53 FIX_ACPI_BEGIN, 54 FIX_ACPI_BEGIN,
54 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1, 55 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
@@ -56,19 +57,18 @@ enum fixed_addresses {
56#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT 57#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
57 FIX_OHCI1394_BASE, 58 FIX_OHCI1394_BASE,
58#endif 59#endif
59 __end_of_permanent_fixed_addresses,
60 /* 60 /*
61 * 256 temporary boot-time mappings, used by early_ioremap(), 61 * 256 temporary boot-time mappings, used by early_ioremap(),
62 * before ioremap() is functional. 62 * before ioremap() is functional.
63 * 63 *
64 * We round it up to the next 512 pages boundary so that we 64 * We round it up to the next 256 pages boundary so that we
65 * can have a single pgd entry and a single pte table: 65 * can have a single pgd entry and a single pte table:
66 */ 66 */
67#define NR_FIX_BTMAPS 64 67#define NR_FIX_BTMAPS 64
68#define FIX_BTMAPS_NESTING 4 68#define FIX_BTMAPS_SLOTS 4
69 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 512 - 69 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
70 (__end_of_permanent_fixed_addresses & 511), 70 (__end_of_permanent_fixed_addresses & 255),
71 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_NESTING - 1, 71 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
72 __end_of_fixed_addresses 72 __end_of_fixed_addresses
73}; 73};
74 74
@@ -80,4 +80,4 @@ enum fixed_addresses {
80#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL) 80#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
81#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE) 81#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
82 82
83#endif 83#endif /* ASM_X86__FIXMAP_64_H */
diff --git a/include/asm-x86/floppy.h b/include/asm-x86/floppy.h
index dbe82a5c5eac..7d83a3a83e37 100644
--- a/include/asm-x86/floppy.h
+++ b/include/asm-x86/floppy.h
@@ -7,8 +7,8 @@
7 * 7 *
8 * Copyright (C) 1995 8 * Copyright (C) 1995
9 */ 9 */
10#ifndef _ASM_X86_FLOPPY_H 10#ifndef ASM_X86__FLOPPY_H
11#define _ASM_X86_FLOPPY_H 11#define ASM_X86__FLOPPY_H
12 12
13#include <linux/vmalloc.h> 13#include <linux/vmalloc.h>
14 14
@@ -278,4 +278,4 @@ static int FDC2 = -1;
278 278
279#define EXTRA_FLOPPY_PARAMS 279#define EXTRA_FLOPPY_PARAMS
280 280
281#endif /* _ASM_X86_FLOPPY_H */ 281#endif /* ASM_X86__FLOPPY_H */
diff --git a/include/asm-x86/ftrace.h b/include/asm-x86/ftrace.h
index 5c68b32ee1c8..be0e004ad148 100644
--- a/include/asm-x86/ftrace.h
+++ b/include/asm-x86/ftrace.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_FTRACE 1#ifndef ASM_X86__FTRACE_H
2#define _ASM_X86_FTRACE 2#define ASM_X86__FTRACE_H
3 3
4#ifdef CONFIG_FTRACE 4#ifdef CONFIG_FTRACE
5#define MCOUNT_ADDR ((long)(mcount)) 5#define MCOUNT_ADDR ((long)(mcount))
@@ -11,4 +11,4 @@ extern void mcount(void);
11 11
12#endif /* CONFIG_FTRACE */ 12#endif /* CONFIG_FTRACE */
13 13
14#endif /* _ASM_X86_FTRACE */ 14#endif /* ASM_X86__FTRACE_H */
diff --git a/include/asm-x86/futex.h b/include/asm-x86/futex.h
index e7a76b37b333..06b924ef6fa5 100644
--- a/include/asm-x86/futex.h
+++ b/include/asm-x86/futex.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_FUTEX_H 1#ifndef ASM_X86__FUTEX_H
2#define _ASM_X86_FUTEX_H 2#define ASM_X86__FUTEX_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
@@ -25,7 +25,7 @@
25 asm volatile("1:\tmovl %2, %0\n" \ 25 asm volatile("1:\tmovl %2, %0\n" \
26 "\tmovl\t%0, %3\n" \ 26 "\tmovl\t%0, %3\n" \
27 "\t" insn "\n" \ 27 "\t" insn "\n" \
28 "2:\tlock; cmpxchgl %3, %2\n" \ 28 "2:\t" LOCK_PREFIX "cmpxchgl %3, %2\n" \
29 "\tjnz\t1b\n" \ 29 "\tjnz\t1b\n" \
30 "3:\t.section .fixup,\"ax\"\n" \ 30 "3:\t.section .fixup,\"ax\"\n" \
31 "4:\tmov\t%5, %1\n" \ 31 "4:\tmov\t%5, %1\n" \
@@ -64,7 +64,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
64 __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg); 64 __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
65 break; 65 break;
66 case FUTEX_OP_ADD: 66 case FUTEX_OP_ADD:
67 __futex_atomic_op1("lock; xaddl %0, %2", ret, oldval, 67 __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
68 uaddr, oparg); 68 uaddr, oparg);
69 break; 69 break;
70 case FUTEX_OP_OR: 70 case FUTEX_OP_OR:
@@ -122,7 +122,7 @@ static inline int futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval,
122 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) 122 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
123 return -EFAULT; 123 return -EFAULT;
124 124
125 asm volatile("1:\tlock; cmpxchgl %3, %1\n" 125 asm volatile("1:\t" LOCK_PREFIX "cmpxchgl %3, %1\n"
126 "2:\t.section .fixup, \"ax\"\n" 126 "2:\t.section .fixup, \"ax\"\n"
127 "3:\tmov %2, %0\n" 127 "3:\tmov %2, %0\n"
128 "\tjmp 2b\n" 128 "\tjmp 2b\n"
@@ -137,4 +137,4 @@ static inline int futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval,
137} 137}
138 138
139#endif 139#endif
140#endif 140#endif /* ASM_X86__FUTEX_H */
diff --git a/include/asm-x86/gart.h b/include/asm-x86/gart.h
index 3f62a83887f3..605edb39ef9e 100644
--- a/include/asm-x86/gart.h
+++ b/include/asm-x86/gart.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X8664_GART_H 1#ifndef ASM_X86__GART_H
2#define _ASM_X8664_GART_H 1 2#define ASM_X86__GART_H
3 3
4#include <asm/e820.h> 4#include <asm/e820.h>
5 5
@@ -29,6 +29,8 @@ extern int fix_aperture;
29#define AMD64_GARTCACHECTL 0x9c 29#define AMD64_GARTCACHECTL 0x9c
30#define AMD64_GARTEN (1<<0) 30#define AMD64_GARTEN (1<<0)
31 31
32extern int agp_amd64_init(void);
33
32static inline void enable_gart_translation(struct pci_dev *dev, u64 addr) 34static inline void enable_gart_translation(struct pci_dev *dev, u64 addr)
33{ 35{
34 u32 tmp, ctl; 36 u32 tmp, ctl;
@@ -52,15 +54,15 @@ static inline int aperture_valid(u64 aper_base, u32 aper_size, u32 min_size)
52 return 0; 54 return 0;
53 55
54 if (aper_base + aper_size > 0x100000000ULL) { 56 if (aper_base + aper_size > 0x100000000ULL) {
55 printk(KERN_ERR "Aperture beyond 4GB. Ignoring.\n"); 57 printk(KERN_INFO "Aperture beyond 4GB. Ignoring.\n");
56 return 0; 58 return 0;
57 } 59 }
58 if (e820_any_mapped(aper_base, aper_base + aper_size, E820_RAM)) { 60 if (e820_any_mapped(aper_base, aper_base + aper_size, E820_RAM)) {
59 printk(KERN_ERR "Aperture pointing to e820 RAM. Ignoring.\n"); 61 printk(KERN_INFO "Aperture pointing to e820 RAM. Ignoring.\n");
60 return 0; 62 return 0;
61 } 63 }
62 if (aper_size < min_size) { 64 if (aper_size < min_size) {
63 printk(KERN_ERR "Aperture too small (%d MB) than (%d MB)\n", 65 printk(KERN_INFO "Aperture too small (%d MB) than (%d MB)\n",
64 aper_size>>20, min_size>>20); 66 aper_size>>20, min_size>>20);
65 return 0; 67 return 0;
66 } 68 }
@@ -68,4 +70,4 @@ static inline int aperture_valid(u64 aper_base, u32 aper_size, u32 min_size)
68 return 1; 70 return 1;
69} 71}
70 72
71#endif 73#endif /* ASM_X86__GART_H */
diff --git a/include/asm-x86/genapic_32.h b/include/asm-x86/genapic_32.h
index b02ea6e17de8..34280f027664 100644
--- a/include/asm-x86/genapic_32.h
+++ b/include/asm-x86/genapic_32.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_GENAPIC_H 1#ifndef ASM_X86__GENAPIC_32_H
2#define _ASM_GENAPIC_H 1 2#define ASM_X86__GENAPIC_32_H
3 3
4#include <asm/mpspec.h> 4#include <asm/mpspec.h>
5 5
@@ -118,6 +118,7 @@ enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
118#define get_uv_system_type() UV_NONE 118#define get_uv_system_type() UV_NONE
119#define is_uv_system() 0 119#define is_uv_system() 0
120#define uv_wakeup_secondary(a, b) 1 120#define uv_wakeup_secondary(a, b) 1
121#define uv_system_init() do {} while (0)
121 122
122 123
123#endif 124#endif /* ASM_X86__GENAPIC_32_H */
diff --git a/include/asm-x86/genapic_64.h b/include/asm-x86/genapic_64.h
index 0f8504627c41..ed6a4886c082 100644
--- a/include/asm-x86/genapic_64.h
+++ b/include/asm-x86/genapic_64.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_GENAPIC_H 1#ifndef ASM_X86__GENAPIC_64_H
2#define _ASM_GENAPIC_H 1 2#define ASM_X86__GENAPIC_64_H
3 3
4/* 4/*
5 * Copyright 2004 James Cleverdon, IBM. 5 * Copyright 2004 James Cleverdon, IBM.
@@ -14,6 +14,7 @@
14 14
15struct genapic { 15struct genapic {
16 char *name; 16 char *name;
17 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
17 u32 int_delivery_mode; 18 u32 int_delivery_mode;
18 u32 int_dest_mode; 19 u32 int_dest_mode;
19 int (*apic_id_registered)(void); 20 int (*apic_id_registered)(void);
@@ -24,17 +25,24 @@ struct genapic {
24 void (*send_IPI_mask)(cpumask_t mask, int vector); 25 void (*send_IPI_mask)(cpumask_t mask, int vector);
25 void (*send_IPI_allbutself)(int vector); 26 void (*send_IPI_allbutself)(int vector);
26 void (*send_IPI_all)(int vector); 27 void (*send_IPI_all)(int vector);
28 void (*send_IPI_self)(int vector);
27 /* */ 29 /* */
28 unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask); 30 unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
29 unsigned int (*phys_pkg_id)(int index_msb); 31 unsigned int (*phys_pkg_id)(int index_msb);
32 unsigned int (*get_apic_id)(unsigned long x);
33 unsigned long (*set_apic_id)(unsigned int id);
34 unsigned long apic_id_mask;
30}; 35};
31 36
32extern struct genapic *genapic; 37extern struct genapic *genapic;
33 38
34extern struct genapic apic_flat; 39extern struct genapic apic_flat;
35extern struct genapic apic_physflat; 40extern struct genapic apic_physflat;
41extern struct genapic apic_x2apic_cluster;
42extern struct genapic apic_x2apic_phys;
36extern int acpi_madt_oem_check(char *, char *); 43extern int acpi_madt_oem_check(char *, char *);
37 44
45extern void apic_send_IPI_self(int vector);
38enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC}; 46enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
39extern enum uv_system_type get_uv_system_type(void); 47extern enum uv_system_type get_uv_system_type(void);
40extern int is_uv_system(void); 48extern int is_uv_system(void);
@@ -42,8 +50,9 @@ extern int is_uv_system(void);
42extern struct genapic apic_x2apic_uv_x; 50extern struct genapic apic_x2apic_uv_x;
43DECLARE_PER_CPU(int, x2apic_extra_bits); 51DECLARE_PER_CPU(int, x2apic_extra_bits);
44extern void uv_cpu_init(void); 52extern void uv_cpu_init(void);
53extern void uv_system_init(void);
45extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); 54extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip);
46 55
47extern void setup_apic_routing(void); 56extern void setup_apic_routing(void);
48 57
49#endif 58#endif /* ASM_X86__GENAPIC_64_H */
diff --git a/include/asm-x86/geode.h b/include/asm-x86/geode.h
index 2c1cda0b8a86..3f3444be2638 100644
--- a/include/asm-x86/geode.h
+++ b/include/asm-x86/geode.h
@@ -7,8 +7,8 @@
7 * as published by the Free Software Foundation. 7 * as published by the Free Software Foundation.
8 */ 8 */
9 9
10#ifndef _ASM_GEODE_H_ 10#ifndef ASM_X86__GEODE_H
11#define _ASM_GEODE_H_ 11#define ASM_X86__GEODE_H
12 12
13#include <asm/processor.h> 13#include <asm/processor.h>
14#include <linux/io.h> 14#include <linux/io.h>
@@ -250,4 +250,4 @@ extern int __init mfgpt_timer_setup(void);
250static inline int mfgpt_timer_setup(void) { return 0; } 250static inline int mfgpt_timer_setup(void) { return 0; }
251#endif 251#endif
252 252
253#endif 253#endif /* ASM_X86__GEODE_H */
diff --git a/include/asm-x86/gpio.h b/include/asm-x86/gpio.h
index c4c91b37c104..497fb980d962 100644
--- a/include/asm-x86/gpio.h
+++ b/include/asm-x86/gpio.h
@@ -53,4 +53,4 @@ static inline int irq_to_gpio(unsigned int irq)
53 53
54#endif /* CONFIG_GPIOLIB */ 54#endif /* CONFIG_GPIOLIB */
55 55
56#endif /* _ASM_I386_GPIO_H */ 56#endif /* ASM_X86__GPIO_H */
diff --git a/include/asm-x86/hardirq_32.h b/include/asm-x86/hardirq_32.h
index 4f85f0f4b563..700fe230d919 100644
--- a/include/asm-x86/hardirq_32.h
+++ b/include/asm-x86/hardirq_32.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef ASM_X86__HARDIRQ_32_H
2#define __ASM_HARDIRQ_H 2#define ASM_X86__HARDIRQ_32_H
3 3
4#include <linux/threads.h> 4#include <linux/threads.h>
5#include <linux/irq.h> 5#include <linux/irq.h>
@@ -25,4 +25,4 @@ DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
25void ack_bad_irq(unsigned int irq); 25void ack_bad_irq(unsigned int irq);
26#include <linux/irq_cpustat.h> 26#include <linux/irq_cpustat.h>
27 27
28#endif /* __ASM_HARDIRQ_H */ 28#endif /* ASM_X86__HARDIRQ_32_H */
diff --git a/include/asm-x86/hardirq_64.h b/include/asm-x86/hardirq_64.h
index 95d5e090ed89..f8bd2919a8ce 100644
--- a/include/asm-x86/hardirq_64.h
+++ b/include/asm-x86/hardirq_64.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef ASM_X86__HARDIRQ_64_H
2#define __ASM_HARDIRQ_H 2#define ASM_X86__HARDIRQ_64_H
3 3
4#include <linux/threads.h> 4#include <linux/threads.h>
5#include <linux/irq.h> 5#include <linux/irq.h>
@@ -20,4 +20,4 @@
20 20
21extern void ack_bad_irq(unsigned int irq); 21extern void ack_bad_irq(unsigned int irq);
22 22
23#endif /* __ASM_HARDIRQ_H */ 23#endif /* ASM_X86__HARDIRQ_64_H */
diff --git a/include/asm-x86/highmem.h b/include/asm-x86/highmem.h
index 4514b16cc723..bc3f6a280316 100644
--- a/include/asm-x86/highmem.h
+++ b/include/asm-x86/highmem.h
@@ -15,8 +15,8 @@
15 * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com> 15 * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
16 */ 16 */
17 17
18#ifndef _ASM_HIGHMEM_H 18#ifndef ASM_X86__HIGHMEM_H
19#define _ASM_HIGHMEM_H 19#define ASM_X86__HIGHMEM_H
20 20
21#ifdef __KERNEL__ 21#ifdef __KERNEL__
22 22
@@ -79,4 +79,4 @@ extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
79 79
80#endif /* __KERNEL__ */ 80#endif /* __KERNEL__ */
81 81
82#endif /* _ASM_HIGHMEM_H */ 82#endif /* ASM_X86__HIGHMEM_H */
diff --git a/include/asm-x86/hpet.h b/include/asm-x86/hpet.h
index 82f1ac641bd7..cbbbb6d4dd32 100644
--- a/include/asm-x86/hpet.h
+++ b/include/asm-x86/hpet.h
@@ -1,5 +1,5 @@
1#ifndef ASM_X86_HPET_H 1#ifndef ASM_X86__HPET_H
2#define ASM_X86_HPET_H 2#define ASM_X86__HPET_H
3 3
4#ifdef CONFIG_HPET_TIMER 4#ifdef CONFIG_HPET_TIMER
5 5
@@ -90,4 +90,4 @@ static inline int is_hpet_enabled(void) { return 0; }
90#define hpet_readl(a) 0 90#define hpet_readl(a) 0
91 91
92#endif 92#endif
93#endif /* ASM_X86_HPET_H */ 93#endif /* ASM_X86__HPET_H */
diff --git a/include/asm-x86/hugetlb.h b/include/asm-x86/hugetlb.h
index 439a9acc132d..0b7ec5dc0884 100644
--- a/include/asm-x86/hugetlb.h
+++ b/include/asm-x86/hugetlb.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_HUGETLB_H 1#ifndef ASM_X86__HUGETLB_H
2#define _ASM_X86_HUGETLB_H 2#define ASM_X86__HUGETLB_H
3 3
4#include <asm/page.h> 4#include <asm/page.h>
5 5
@@ -90,4 +90,4 @@ static inline void arch_release_hugepage(struct page *page)
90{ 90{
91} 91}
92 92
93#endif /* _ASM_X86_HUGETLB_H */ 93#endif /* ASM_X86__HUGETLB_H */
diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h
index edd0b95f14d0..50f6e0316b50 100644
--- a/include/asm-x86/hw_irq.h
+++ b/include/asm-x86/hw_irq.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_HW_IRQ_H 1#ifndef ASM_X86__HW_IRQ_H
2#define _ASM_HW_IRQ_H 2#define ASM_X86__HW_IRQ_H
3 3
4/* 4/*
5 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar 5 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
@@ -64,7 +64,6 @@ extern unsigned long io_apic_irqs;
64extern void init_VISWS_APIC_irqs(void); 64extern void init_VISWS_APIC_irqs(void);
65extern void setup_IO_APIC(void); 65extern void setup_IO_APIC(void);
66extern void disable_IO_APIC(void); 66extern void disable_IO_APIC(void);
67extern void print_IO_APIC(void);
68extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); 67extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
69extern void setup_ioapic_dest(void); 68extern void setup_ioapic_dest(void);
70 69
@@ -73,7 +72,9 @@ extern void enable_IO_APIC(void);
73#endif 72#endif
74 73
75/* IPI functions */ 74/* IPI functions */
75#ifdef CONFIG_X86_32
76extern void send_IPI_self(int vector); 76extern void send_IPI_self(int vector);
77#endif
77extern void send_IPI(int dest, int vector); 78extern void send_IPI(int dest, int vector);
78 79
79/* Statistics */ 80/* Statistics */
@@ -93,6 +94,26 @@ extern asmlinkage void qic_reschedule_interrupt(void);
93extern asmlinkage void qic_enable_irq_interrupt(void); 94extern asmlinkage void qic_enable_irq_interrupt(void);
94extern asmlinkage void qic_call_function_interrupt(void); 95extern asmlinkage void qic_call_function_interrupt(void);
95 96
97/* SMP */
98extern void smp_apic_timer_interrupt(struct pt_regs *);
99#ifdef CONFIG_X86_32
100extern void smp_spurious_interrupt(struct pt_regs *);
101extern void smp_error_interrupt(struct pt_regs *);
102#else
103extern asmlinkage void smp_spurious_interrupt(void);
104extern asmlinkage void smp_error_interrupt(void);
105#endif
106#ifdef CONFIG_X86_SMP
107extern void smp_reschedule_interrupt(struct pt_regs *);
108extern void smp_call_function_interrupt(struct pt_regs *);
109extern void smp_call_function_single_interrupt(struct pt_regs *);
110#ifdef CONFIG_X86_32
111extern void smp_invalidate_interrupt(struct pt_regs *);
112#else
113extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *);
114#endif
115#endif
116
96#ifdef CONFIG_X86_32 117#ifdef CONFIG_X86_32
97extern void (*const interrupt[NR_IRQS])(void); 118extern void (*const interrupt[NR_IRQS])(void);
98#else 119#else
@@ -112,4 +133,4 @@ static inline void __setup_vector_irq(int cpu) {}
112 133
113#endif /* !ASSEMBLY_ */ 134#endif /* !ASSEMBLY_ */
114 135
115#endif 136#endif /* ASM_X86__HW_IRQ_H */
diff --git a/include/asm-x86/hypertransport.h b/include/asm-x86/hypertransport.h
index d2bbd238b3e1..cc011a3bc1c2 100644
--- a/include/asm-x86/hypertransport.h
+++ b/include/asm-x86/hypertransport.h
@@ -1,5 +1,5 @@
1#ifndef ASM_HYPERTRANSPORT_H 1#ifndef ASM_X86__HYPERTRANSPORT_H
2#define ASM_HYPERTRANSPORT_H 2#define ASM_X86__HYPERTRANSPORT_H
3 3
4/* 4/*
5 * Constants for x86 Hypertransport Interrupts. 5 * Constants for x86 Hypertransport Interrupts.
@@ -42,4 +42,4 @@
42#define HT_IRQ_HIGH_DEST_ID(v) \ 42#define HT_IRQ_HIGH_DEST_ID(v) \
43 ((((v) >> 8) << HT_IRQ_HIGH_DEST_ID_SHIFT) & HT_IRQ_HIGH_DEST_ID_MASK) 43 ((((v) >> 8) << HT_IRQ_HIGH_DEST_ID_SHIFT) & HT_IRQ_HIGH_DEST_ID_MASK)
44 44
45#endif /* ASM_HYPERTRANSPORT_H */ 45#endif /* ASM_X86__HYPERTRANSPORT_H */
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h
index 56d00e31aec0..9ba862a4eac0 100644
--- a/include/asm-x86/i387.h
+++ b/include/asm-x86/i387.h
@@ -7,8 +7,8 @@
7 * x86-64 work by Andi Kleen 2002 7 * x86-64 work by Andi Kleen 2002
8 */ 8 */
9 9
10#ifndef _ASM_X86_I387_H 10#ifndef ASM_X86__I387_H
11#define _ASM_X86_I387_H 11#define ASM_X86__I387_H
12 12
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
@@ -19,23 +19,32 @@
19#include <asm/sigcontext.h> 19#include <asm/sigcontext.h>
20#include <asm/user.h> 20#include <asm/user.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/xsave.h>
22 23
24extern unsigned int sig_xstate_size;
23extern void fpu_init(void); 25extern void fpu_init(void);
24extern void mxcsr_feature_mask_init(void); 26extern void mxcsr_feature_mask_init(void);
25extern int init_fpu(struct task_struct *child); 27extern int init_fpu(struct task_struct *child);
26extern asmlinkage void math_state_restore(void); 28extern asmlinkage void math_state_restore(void);
27extern void init_thread_xstate(void); 29extern void init_thread_xstate(void);
30extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
28 31
29extern user_regset_active_fn fpregs_active, xfpregs_active; 32extern user_regset_active_fn fpregs_active, xfpregs_active;
30extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get; 33extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get;
31extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set; 34extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set;
32 35
36extern struct _fpx_sw_bytes fx_sw_reserved;
33#ifdef CONFIG_IA32_EMULATION 37#ifdef CONFIG_IA32_EMULATION
38extern unsigned int sig_xstate_ia32_size;
39extern struct _fpx_sw_bytes fx_sw_reserved_ia32;
34struct _fpstate_ia32; 40struct _fpstate_ia32;
35extern int save_i387_ia32(struct _fpstate_ia32 __user *buf); 41struct _xstate_ia32;
36extern int restore_i387_ia32(struct _fpstate_ia32 __user *buf); 42extern int save_i387_xstate_ia32(void __user *buf);
43extern int restore_i387_xstate_ia32(void __user *buf);
37#endif 44#endif
38 45
46#define X87_FSW_ES (1 << 7) /* Exception Summary */
47
39#ifdef CONFIG_X86_64 48#ifdef CONFIG_X86_64
40 49
41/* Ignore delayed exceptions from user space */ 50/* Ignore delayed exceptions from user space */
@@ -46,7 +55,7 @@ static inline void tolerant_fwait(void)
46 _ASM_EXTABLE(1b, 2b)); 55 _ASM_EXTABLE(1b, 2b));
47} 56}
48 57
49static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) 58static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
50{ 59{
51 int err; 60 int err;
52 61
@@ -66,15 +75,31 @@ static inline int restore_fpu_checking(struct i387_fxsave_struct *fx)
66 return err; 75 return err;
67} 76}
68 77
69#define X87_FSW_ES (1 << 7) /* Exception Summary */ 78static inline int restore_fpu_checking(struct task_struct *tsk)
79{
80 if (task_thread_info(tsk)->status & TS_XSAVE)
81 return xrstor_checking(&tsk->thread.xstate->xsave);
82 else
83 return fxrstor_checking(&tsk->thread.xstate->fxsave);
84}
70 85
71/* AMD CPUs don't save/restore FDP/FIP/FOP unless an exception 86/* AMD CPUs don't save/restore FDP/FIP/FOP unless an exception
72 is pending. Clear the x87 state here by setting it to fixed 87 is pending. Clear the x87 state here by setting it to fixed
73 values. The kernel data segment can be sometimes 0 and sometimes 88 values. The kernel data segment can be sometimes 0 and sometimes
74 new user value. Both should be ok. 89 new user value. Both should be ok.
75 Use the PDA as safe address because it should be already in L1. */ 90 Use the PDA as safe address because it should be already in L1. */
76static inline void clear_fpu_state(struct i387_fxsave_struct *fx) 91static inline void clear_fpu_state(struct task_struct *tsk)
77{ 92{
93 struct xsave_struct *xstate = &tsk->thread.xstate->xsave;
94 struct i387_fxsave_struct *fx = &tsk->thread.xstate->fxsave;
95
96 /*
97 * xsave header may indicate the init state of the FP.
98 */
99 if ((task_thread_info(tsk)->status & TS_XSAVE) &&
100 !(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
101 return;
102
78 if (unlikely(fx->swd & X87_FSW_ES)) 103 if (unlikely(fx->swd & X87_FSW_ES))
79 asm volatile("fnclex"); 104 asm volatile("fnclex");
80 alternative_input(ASM_NOP8 ASM_NOP2, 105 alternative_input(ASM_NOP8 ASM_NOP2,
@@ -83,7 +108,7 @@ static inline void clear_fpu_state(struct i387_fxsave_struct *fx)
83 X86_FEATURE_FXSAVE_LEAK); 108 X86_FEATURE_FXSAVE_LEAK);
84} 109}
85 110
86static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) 111static inline int fxsave_user(struct i387_fxsave_struct __user *fx)
87{ 112{
88 int err; 113 int err;
89 114
@@ -107,7 +132,7 @@ static inline int save_i387_checking(struct i387_fxsave_struct __user *fx)
107 return err; 132 return err;
108} 133}
109 134
110static inline void __save_init_fpu(struct task_struct *tsk) 135static inline void fxsave(struct task_struct *tsk)
111{ 136{
112 /* Using "rex64; fxsave %0" is broken because, if the memory operand 137 /* Using "rex64; fxsave %0" is broken because, if the memory operand
113 uses any extended registers for addressing, a second REX prefix 138 uses any extended registers for addressing, a second REX prefix
@@ -132,7 +157,16 @@ static inline void __save_init_fpu(struct task_struct *tsk)
132 : "=m" (tsk->thread.xstate->fxsave) 157 : "=m" (tsk->thread.xstate->fxsave)
133 : "cdaSDb" (&tsk->thread.xstate->fxsave)); 158 : "cdaSDb" (&tsk->thread.xstate->fxsave));
134#endif 159#endif
135 clear_fpu_state(&tsk->thread.xstate->fxsave); 160}
161
162static inline void __save_init_fpu(struct task_struct *tsk)
163{
164 if (task_thread_info(tsk)->status & TS_XSAVE)
165 xsave(tsk);
166 else
167 fxsave(tsk);
168
169 clear_fpu_state(tsk);
136 task_thread_info(tsk)->status &= ~TS_USEDFPU; 170 task_thread_info(tsk)->status &= ~TS_USEDFPU;
137} 171}
138 172
@@ -147,6 +181,10 @@ static inline void tolerant_fwait(void)
147 181
148static inline void restore_fpu(struct task_struct *tsk) 182static inline void restore_fpu(struct task_struct *tsk)
149{ 183{
184 if (task_thread_info(tsk)->status & TS_XSAVE) {
185 xrstor_checking(&tsk->thread.xstate->xsave);
186 return;
187 }
150 /* 188 /*
151 * The "nop" is needed to make the instructions the same 189 * The "nop" is needed to make the instructions the same
152 * length. 190 * length.
@@ -172,6 +210,27 @@ static inline void restore_fpu(struct task_struct *tsk)
172 */ 210 */
173static inline void __save_init_fpu(struct task_struct *tsk) 211static inline void __save_init_fpu(struct task_struct *tsk)
174{ 212{
213 if (task_thread_info(tsk)->status & TS_XSAVE) {
214 struct xsave_struct *xstate = &tsk->thread.xstate->xsave;
215 struct i387_fxsave_struct *fx = &tsk->thread.xstate->fxsave;
216
217 xsave(tsk);
218
219 /*
220 * xsave header may indicate the init state of the FP.
221 */
222 if (!(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
223 goto end;
224
225 if (unlikely(fx->swd & X87_FSW_ES))
226 asm volatile("fnclex");
227
228 /*
229 * we can do a simple return here or be paranoid :)
230 */
231 goto clear_state;
232 }
233
175 /* Use more nops than strictly needed in case the compiler 234 /* Use more nops than strictly needed in case the compiler
176 varies code */ 235 varies code */
177 alternative_input( 236 alternative_input(
@@ -181,6 +240,7 @@ static inline void __save_init_fpu(struct task_struct *tsk)
181 X86_FEATURE_FXSR, 240 X86_FEATURE_FXSR,
182 [fx] "m" (tsk->thread.xstate->fxsave), 241 [fx] "m" (tsk->thread.xstate->fxsave),
183 [fsw] "m" (tsk->thread.xstate->fxsave.swd) : "memory"); 242 [fsw] "m" (tsk->thread.xstate->fxsave.swd) : "memory");
243clear_state:
184 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception 244 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
185 is pending. Clear the x87 state here by setting it to fixed 245 is pending. Clear the x87 state here by setting it to fixed
186 values. safe_address is a random variable that should be in L1 */ 246 values. safe_address is a random variable that should be in L1 */
@@ -190,16 +250,17 @@ static inline void __save_init_fpu(struct task_struct *tsk)
190 "fildl %[addr]", /* set F?P to defined value */ 250 "fildl %[addr]", /* set F?P to defined value */
191 X86_FEATURE_FXSAVE_LEAK, 251 X86_FEATURE_FXSAVE_LEAK,
192 [addr] "m" (safe_address)); 252 [addr] "m" (safe_address));
253end:
193 task_thread_info(tsk)->status &= ~TS_USEDFPU; 254 task_thread_info(tsk)->status &= ~TS_USEDFPU;
194} 255}
195 256
257#endif /* CONFIG_X86_64 */
258
196/* 259/*
197 * Signal frame handlers... 260 * Signal frame handlers...
198 */ 261 */
199extern int save_i387(struct _fpstate __user *buf); 262extern int save_i387_xstate(void __user *buf);
200extern int restore_i387(struct _fpstate __user *buf); 263extern int restore_i387_xstate(void __user *buf);
201
202#endif /* CONFIG_X86_64 */
203 264
204static inline void __unlazy_fpu(struct task_struct *tsk) 265static inline void __unlazy_fpu(struct task_struct *tsk)
205{ 266{
@@ -336,4 +397,4 @@ static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk)
336 } 397 }
337} 398}
338 399
339#endif /* _ASM_X86_I387_H */ 400#endif /* ASM_X86__I387_H */
diff --git a/include/asm-x86/i8253.h b/include/asm-x86/i8253.h
index b51c0487fc41..15a5b530044e 100644
--- a/include/asm-x86/i8253.h
+++ b/include/asm-x86/i8253.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_I8253_H__ 1#ifndef ASM_X86__I8253_H
2#define __ASM_I8253_H__ 2#define ASM_X86__I8253_H
3 3
4/* i8253A PIT registers */ 4/* i8253A PIT registers */
5#define PIT_MODE 0x43 5#define PIT_MODE 0x43
@@ -15,4 +15,4 @@ extern void setup_pit_timer(void);
15#define inb_pit inb_p 15#define inb_pit inb_p
16#define outb_pit outb_p 16#define outb_pit outb_p
17 17
18#endif /* __ASM_I8253_H__ */ 18#endif /* ASM_X86__I8253_H */
diff --git a/include/asm-x86/i8259.h b/include/asm-x86/i8259.h
index 2f98df91f1f2..23c1b3baaecd 100644
--- a/include/asm-x86/i8259.h
+++ b/include/asm-x86/i8259.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_I8259_H__ 1#ifndef ASM_X86__I8259_H
2#define __ASM_I8259_H__ 2#define ASM_X86__I8259_H
3 3
4#include <linux/delay.h> 4#include <linux/delay.h>
5 5
@@ -57,4 +57,7 @@ static inline void outb_pic(unsigned char value, unsigned int port)
57 57
58extern struct irq_chip i8259A_chip; 58extern struct irq_chip i8259A_chip;
59 59
60#endif /* __ASM_I8259_H__ */ 60extern void mask_8259A(void);
61extern void unmask_8259A(void);
62
63#endif /* ASM_X86__I8259_H */
diff --git a/include/asm-x86/ia32.h b/include/asm-x86/ia32.h
index 55d3abe5276f..f932f7ad51dd 100644
--- a/include/asm-x86/ia32.h
+++ b/include/asm-x86/ia32.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_64_IA32_H 1#ifndef ASM_X86__IA32_H
2#define _ASM_X86_64_IA32_H 2#define ASM_X86__IA32_H
3 3
4 4
5#ifdef CONFIG_IA32_EMULATION 5#ifdef CONFIG_IA32_EMULATION
@@ -167,4 +167,4 @@ extern void ia32_pick_mmap_layout(struct mm_struct *mm);
167 167
168#endif /* !CONFIG_IA32_SUPPORT */ 168#endif /* !CONFIG_IA32_SUPPORT */
169 169
170#endif 170#endif /* ASM_X86__IA32_H */
diff --git a/include/asm-x86/ia32_unistd.h b/include/asm-x86/ia32_unistd.h
index 61cea9e7c5c1..dbd887d8a5a5 100644
--- a/include/asm-x86/ia32_unistd.h
+++ b/include/asm-x86/ia32_unistd.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_64_IA32_UNISTD_H_ 1#ifndef ASM_X86__IA32_UNISTD_H
2#define _ASM_X86_64_IA32_UNISTD_H_ 2#define ASM_X86__IA32_UNISTD_H
3 3
4/* 4/*
5 * This file contains the system call numbers of the ia32 port, 5 * This file contains the system call numbers of the ia32 port,
@@ -15,4 +15,4 @@
15#define __NR_ia32_sigreturn 119 15#define __NR_ia32_sigreturn 119
16#define __NR_ia32_rt_sigreturn 173 16#define __NR_ia32_rt_sigreturn 173
17 17
18#endif /* _ASM_X86_64_IA32_UNISTD_H_ */ 18#endif /* ASM_X86__IA32_UNISTD_H */
diff --git a/include/asm-x86/idle.h b/include/asm-x86/idle.h
index d240e5b30a45..baa3f783d27d 100644
--- a/include/asm-x86/idle.h
+++ b/include/asm-x86/idle.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_64_IDLE_H 1#ifndef ASM_X86__IDLE_H
2#define _ASM_X86_64_IDLE_H 1 2#define ASM_X86__IDLE_H
3 3
4#define IDLE_START 1 4#define IDLE_START 1
5#define IDLE_END 2 5#define IDLE_END 2
@@ -10,4 +10,6 @@ void idle_notifier_register(struct notifier_block *n);
10void enter_idle(void); 10void enter_idle(void);
11void exit_idle(void); 11void exit_idle(void);
12 12
13#endif 13void c1e_remove_cpu(int cpu);
14
15#endif /* ASM_X86__IDLE_H */
diff --git a/include/asm-x86/intel_arch_perfmon.h b/include/asm-x86/intel_arch_perfmon.h
index fa0fd068bc2e..07c03c6c9a16 100644
--- a/include/asm-x86/intel_arch_perfmon.h
+++ b/include/asm-x86/intel_arch_perfmon.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_INTEL_ARCH_PERFMON_H 1#ifndef ASM_X86__INTEL_ARCH_PERFMON_H
2#define _ASM_X86_INTEL_ARCH_PERFMON_H 2#define ASM_X86__INTEL_ARCH_PERFMON_H
3 3
4#define MSR_ARCH_PERFMON_PERFCTR0 0xc1 4#define MSR_ARCH_PERFMON_PERFCTR0 0xc1
5#define MSR_ARCH_PERFMON_PERFCTR1 0xc2 5#define MSR_ARCH_PERFMON_PERFCTR1 0xc2
@@ -28,4 +28,4 @@ union cpuid10_eax {
28 unsigned int full; 28 unsigned int full;
29}; 29};
30 30
31#endif /* _ASM_X86_INTEL_ARCH_PERFMON_H */ 31#endif /* ASM_X86__INTEL_ARCH_PERFMON_H */
diff --git a/include/asm-x86/io.h b/include/asm-x86/io.h
index 0f954dc89cb3..a233f835e0b5 100644
--- a/include/asm-x86/io.h
+++ b/include/asm-x86/io.h
@@ -1,24 +1,10 @@
1#ifndef _ASM_X86_IO_H 1#ifndef ASM_X86__IO_H
2#define _ASM_X86_IO_H 2#define ASM_X86__IO_H
3 3
4#define ARCH_HAS_IOREMAP_WC 4#define ARCH_HAS_IOREMAP_WC
5 5
6#include <linux/compiler.h> 6#include <linux/compiler.h>
7 7
8/*
9 * early_ioremap() and early_iounmap() are for temporary early boot-time
10 * mappings, before the real ioremap() is functional.
11 * A boot-time mapping is currently limited to at most 16 pages.
12 */
13#ifndef __ASSEMBLY__
14extern void early_ioremap_init(void);
15extern void early_ioremap_clear(void);
16extern void early_ioremap_reset(void);
17extern void *early_ioremap(unsigned long offset, unsigned long size);
18extern void early_iounmap(void *addr, unsigned long size);
19extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
20#endif
21
22#define build_mmio_read(name, size, type, reg, barrier) \ 8#define build_mmio_read(name, size, type, reg, barrier) \
23static inline type name(const volatile void __iomem *addr) \ 9static inline type name(const volatile void __iomem *addr) \
24{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \ 10{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \
@@ -73,6 +59,8 @@ build_mmio_write(__writeq, "q", unsigned long, "r", )
73#define writeq writeq 59#define writeq writeq
74#endif 60#endif
75 61
62extern int iommu_bio_merge;
63
76#ifdef CONFIG_X86_32 64#ifdef CONFIG_X86_32
77# include "io_32.h" 65# include "io_32.h"
78#else 66#else
@@ -95,8 +83,9 @@ extern void early_ioremap_init(void);
95extern void early_ioremap_clear(void); 83extern void early_ioremap_clear(void);
96extern void early_ioremap_reset(void); 84extern void early_ioremap_reset(void);
97extern void *early_ioremap(unsigned long offset, unsigned long size); 85extern void *early_ioremap(unsigned long offset, unsigned long size);
86extern void *early_memremap(unsigned long offset, unsigned long size);
98extern void early_iounmap(void *addr, unsigned long size); 87extern void early_iounmap(void *addr, unsigned long size);
99extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); 88extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
100 89
101 90
102#endif /* _ASM_X86_IO_H */ 91#endif /* ASM_X86__IO_H */
diff --git a/include/asm-x86/io_32.h b/include/asm-x86/io_32.h
index e876d89ac156..4f7d878bda18 100644
--- a/include/asm-x86/io_32.h
+++ b/include/asm-x86/io_32.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_IO_H 1#ifndef ASM_X86__IO_32_H
2#define _ASM_IO_H 2#define ASM_X86__IO_32_H
3 3
4#include <linux/string.h> 4#include <linux/string.h>
5#include <linux/compiler.h> 5#include <linux/compiler.h>
@@ -281,4 +281,4 @@ BUILDIO(b, b, char)
281BUILDIO(w, w, short) 281BUILDIO(w, w, short)
282BUILDIO(l, , int) 282BUILDIO(l, , int)
283 283
284#endif 284#endif /* ASM_X86__IO_32_H */
diff --git a/include/asm-x86/io_64.h b/include/asm-x86/io_64.h
index 22995c5c5adc..ee6e086b7dfe 100644
--- a/include/asm-x86/io_64.h
+++ b/include/asm-x86/io_64.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_IO_H 1#ifndef ASM_X86__IO_64_H
2#define _ASM_IO_H 2#define ASM_X86__IO_64_H
3 3
4 4
5/* 5/*
@@ -165,9 +165,6 @@ static inline void *phys_to_virt(unsigned long address)
165 165
166#include <asm-generic/iomap.h> 166#include <asm-generic/iomap.h>
167 167
168extern void *early_ioremap(unsigned long addr, unsigned long size);
169extern void early_iounmap(void *addr, unsigned long size);
170
171/* 168/*
172 * This one maps high address device memory and turns off caching for that area. 169 * This one maps high address device memory and turns off caching for that area.
173 * it's useful if some control registers are in such an area and write combining 170 * it's useful if some control registers are in such an area and write combining
@@ -235,7 +232,6 @@ void memset_io(volatile void __iomem *a, int b, size_t c);
235 232
236#define flush_write_buffers() 233#define flush_write_buffers()
237 234
238extern int iommu_bio_merge;
239#define BIO_VMERGE_BOUNDARY iommu_bio_merge 235#define BIO_VMERGE_BOUNDARY iommu_bio_merge
240 236
241/* 237/*
@@ -245,4 +241,4 @@ extern int iommu_bio_merge;
245 241
246#endif /* __KERNEL__ */ 242#endif /* __KERNEL__ */
247 243
248#endif 244#endif /* ASM_X86__IO_64_H */
diff --git a/include/asm-x86/io_apic.h b/include/asm-x86/io_apic.h
index 14f82bbcb5fd..8ec68a50cf10 100644
--- a/include/asm-x86/io_apic.h
+++ b/include/asm-x86/io_apic.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_IO_APIC_H 1#ifndef ASM_X86__IO_APIC_H
2#define __ASM_IO_APIC_H 2#define ASM_X86__IO_APIC_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/mpspec.h> 5#include <asm/mpspec.h>
@@ -107,6 +107,20 @@ struct IO_APIC_route_entry {
107 107
108} __attribute__ ((packed)); 108} __attribute__ ((packed));
109 109
110struct IR_IO_APIC_route_entry {
111 __u64 vector : 8,
112 zero : 3,
113 index2 : 1,
114 delivery_status : 1,
115 polarity : 1,
116 irr : 1,
117 trigger : 1,
118 mask : 1,
119 reserved : 31,
120 format : 1,
121 index : 15;
122} __attribute__ ((packed));
123
110#ifdef CONFIG_X86_IO_APIC 124#ifdef CONFIG_X86_IO_APIC
111 125
112/* 126/*
@@ -183,10 +197,16 @@ extern int io_apic_set_pci_routing(int ioapic, int pin, int irq,
183extern int (*ioapic_renumber_irq)(int ioapic, int irq); 197extern int (*ioapic_renumber_irq)(int ioapic, int irq);
184extern void ioapic_init_mappings(void); 198extern void ioapic_init_mappings(void);
185 199
200#ifdef CONFIG_X86_64
201extern int save_mask_IO_APIC_setup(void);
202extern void restore_IO_APIC_setup(void);
203extern void reinit_intr_remapped_IO_APIC(int);
204#endif
205
186#else /* !CONFIG_X86_IO_APIC */ 206#else /* !CONFIG_X86_IO_APIC */
187#define io_apic_assign_pci_irqs 0 207#define io_apic_assign_pci_irqs 0
188static const int timer_through_8259 = 0; 208static const int timer_through_8259 = 0;
189static inline void ioapic_init_mappings(void) { } 209static inline void ioapic_init_mappings(void) { }
190#endif 210#endif
191 211
192#endif 212#endif /* ASM_X86__IO_APIC_H */
diff --git a/include/asm-x86/ioctls.h b/include/asm-x86/ioctls.h
index c0c338bd4068..06752a649044 100644
--- a/include/asm-x86/ioctls.h
+++ b/include/asm-x86/ioctls.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_IOCTLS_H 1#ifndef ASM_X86__IOCTLS_H
2#define _ASM_X86_IOCTLS_H 2#define ASM_X86__IOCTLS_H
3 3
4#include <asm/ioctl.h> 4#include <asm/ioctl.h>
5 5
@@ -51,9 +51,15 @@
51#define TCSETS2 _IOW('T', 0x2B, struct termios2) 51#define TCSETS2 _IOW('T', 0x2B, struct termios2)
52#define TCSETSW2 _IOW('T', 0x2C, struct termios2) 52#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
53#define TCSETSF2 _IOW('T', 0x2D, struct termios2) 53#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
54#define TIOCGRS485 0x542E
55#define TIOCSRS485 0x542F
54#define TIOCGPTN _IOR('T', 0x30, unsigned int) 56#define TIOCGPTN _IOR('T', 0x30, unsigned int)
55 /* Get Pty Number (of pty-mux device) */ 57 /* Get Pty Number (of pty-mux device) */
56#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ 58#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
59#define TCGETX 0x5432 /* SYS5 TCGETX compatibility */
60#define TCSETX 0x5433
61#define TCSETXF 0x5434
62#define TCSETXW 0x5435
57 63
58#define FIONCLEX 0x5450 64#define FIONCLEX 0x5450
59#define FIOCLEX 0x5451 65#define FIOCLEX 0x5451
@@ -85,4 +91,4 @@
85 91
86#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 92#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
87 93
88#endif 94#endif /* ASM_X86__IOCTLS_H */
diff --git a/include/asm-x86/iommu.h b/include/asm-x86/iommu.h
index 5f888cc5be49..961e746da977 100644
--- a/include/asm-x86/iommu.h
+++ b/include/asm-x86/iommu.h
@@ -1,13 +1,14 @@
1#ifndef _ASM_X8664_IOMMU_H 1#ifndef ASM_X86__IOMMU_H
2#define _ASM_X8664_IOMMU_H 1 2#define ASM_X86__IOMMU_H
3 3
4extern void pci_iommu_shutdown(void); 4extern void pci_iommu_shutdown(void);
5extern void no_iommu_init(void); 5extern void no_iommu_init(void);
6extern struct dma_mapping_ops nommu_dma_ops; 6extern struct dma_mapping_ops nommu_dma_ops;
7extern int force_iommu, no_iommu; 7extern int force_iommu, no_iommu;
8extern int iommu_detected; 8extern int iommu_detected;
9extern int dmar_disabled;
9 10
10extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len); 11extern unsigned long iommu_nr_pages(unsigned long addr, unsigned long len);
11 12
12#ifdef CONFIG_GART_IOMMU 13#ifdef CONFIG_GART_IOMMU
13extern int gart_iommu_aperture; 14extern int gart_iommu_aperture;
@@ -42,4 +43,4 @@ static inline void gart_iommu_hole_init(void)
42} 43}
43#endif 44#endif
44 45
45#endif 46#endif /* ASM_X86__IOMMU_H */
diff --git a/include/asm-x86/ipcbuf.h b/include/asm-x86/ipcbuf.h
index ee678fd51594..910304fbdc8f 100644
--- a/include/asm-x86/ipcbuf.h
+++ b/include/asm-x86/ipcbuf.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_IPCBUF_H 1#ifndef ASM_X86__IPCBUF_H
2#define _ASM_X86_IPCBUF_H 2#define ASM_X86__IPCBUF_H
3 3
4/* 4/*
5 * The ipc64_perm structure for x86 architecture. 5 * The ipc64_perm structure for x86 architecture.
@@ -25,4 +25,4 @@ struct ipc64_perm {
25 unsigned long __unused2; 25 unsigned long __unused2;
26}; 26};
27 27
28#endif /* _ASM_X86_IPCBUF_H */ 28#endif /* ASM_X86__IPCBUF_H */
diff --git a/include/asm-x86/ipi.h b/include/asm-x86/ipi.h
index bb1c09f7a76c..30a692cfaff8 100644
--- a/include/asm-x86/ipi.h
+++ b/include/asm-x86/ipi.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_IPI_H 1#ifndef ASM_X86__IPI_H
2#define __ASM_IPI_H 2#define ASM_X86__IPI_H
3 3
4/* 4/*
5 * Copyright 2004 James Cleverdon, IBM. 5 * Copyright 2004 James Cleverdon, IBM.
@@ -49,6 +49,12 @@ static inline int __prepare_ICR2(unsigned int mask)
49 return SET_APIC_DEST_FIELD(mask); 49 return SET_APIC_DEST_FIELD(mask);
50} 50}
51 51
52static inline void __xapic_wait_icr_idle(void)
53{
54 while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY)
55 cpu_relax();
56}
57
52static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, 58static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
53 unsigned int dest) 59 unsigned int dest)
54{ 60{
@@ -64,7 +70,7 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
64 /* 70 /*
65 * Wait for idle. 71 * Wait for idle.
66 */ 72 */
67 apic_wait_icr_idle(); 73 __xapic_wait_icr_idle();
68 74
69 /* 75 /*
70 * No need to touch the target chip field 76 * No need to touch the target chip field
@@ -74,7 +80,7 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
74 /* 80 /*
75 * Send the IPI. The write to APIC_ICR fires this off. 81 * Send the IPI. The write to APIC_ICR fires this off.
76 */ 82 */
77 apic_write(APIC_ICR, cfg); 83 native_apic_mem_write(APIC_ICR, cfg);
78} 84}
79 85
80/* 86/*
@@ -92,13 +98,13 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,
92 if (unlikely(vector == NMI_VECTOR)) 98 if (unlikely(vector == NMI_VECTOR))
93 safe_apic_wait_icr_idle(); 99 safe_apic_wait_icr_idle();
94 else 100 else
95 apic_wait_icr_idle(); 101 __xapic_wait_icr_idle();
96 102
97 /* 103 /*
98 * prepare target chip field 104 * prepare target chip field
99 */ 105 */
100 cfg = __prepare_ICR2(mask); 106 cfg = __prepare_ICR2(mask);
101 apic_write(APIC_ICR2, cfg); 107 native_apic_mem_write(APIC_ICR2, cfg);
102 108
103 /* 109 /*
104 * program the ICR 110 * program the ICR
@@ -108,7 +114,7 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,
108 /* 114 /*
109 * Send the IPI. The write to APIC_ICR fires this off. 115 * Send the IPI. The write to APIC_ICR fires this off.
110 */ 116 */
111 apic_write(APIC_ICR, cfg); 117 native_apic_mem_write(APIC_ICR, cfg);
112} 118}
113 119
114static inline void send_IPI_mask_sequence(cpumask_t mask, int vector) 120static inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
@@ -129,4 +135,4 @@ static inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
129 local_irq_restore(flags); 135 local_irq_restore(flags);
130} 136}
131 137
132#endif /* __ASM_IPI_H */ 138#endif /* ASM_X86__IPI_H */
diff --git a/include/asm-x86/irq.h b/include/asm-x86/irq.h
index 1a2925757317..1e5f2909c1db 100644
--- a/include/asm-x86/irq.h
+++ b/include/asm-x86/irq.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_IRQ_H 1#ifndef ASM_X86__IRQ_H
2#define _ASM_IRQ_H 2#define ASM_X86__IRQ_H
3/* 3/*
4 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar 4 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
5 * 5 *
@@ -47,4 +47,4 @@ extern void native_init_IRQ(void);
47/* Interrupt vector management */ 47/* Interrupt vector management */
48extern DECLARE_BITMAP(used_vectors, NR_VECTORS); 48extern DECLARE_BITMAP(used_vectors, NR_VECTORS);
49 49
50#endif /* _ASM_IRQ_H */ 50#endif /* ASM_X86__IRQ_H */
diff --git a/include/asm-x86/irq_regs_32.h b/include/asm-x86/irq_regs_32.h
index 3368b20c0b48..316a3b258871 100644
--- a/include/asm-x86/irq_regs_32.h
+++ b/include/asm-x86/irq_regs_32.h
@@ -4,8 +4,8 @@
4 * 4 *
5 * Jeremy Fitzhardinge <jeremy@goop.org> 5 * Jeremy Fitzhardinge <jeremy@goop.org>
6 */ 6 */
7#ifndef _ASM_I386_IRQ_REGS_H 7#ifndef ASM_X86__IRQ_REGS_32_H
8#define _ASM_I386_IRQ_REGS_H 8#define ASM_X86__IRQ_REGS_32_H
9 9
10#include <asm/percpu.h> 10#include <asm/percpu.h>
11 11
@@ -26,4 +26,4 @@ static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
26 return old_regs; 26 return old_regs;
27} 27}
28 28
29#endif /* _ASM_I386_IRQ_REGS_H */ 29#endif /* ASM_X86__IRQ_REGS_32_H */
diff --git a/include/asm-x86/irq_remapping.h b/include/asm-x86/irq_remapping.h
new file mode 100644
index 000000000000..78242c6ffa58
--- /dev/null
+++ b/include/asm-x86/irq_remapping.h
@@ -0,0 +1,8 @@
1#ifndef _ASM_IRQ_REMAPPING_H
2#define _ASM_IRQ_REMAPPING_H
3
4extern int x2apic;
5
6#define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8)
7
8#endif
diff --git a/include/asm-x86/irq_vectors.h b/include/asm-x86/irq_vectors.h
index b95d167b7fb2..c5d2d767a1f3 100644
--- a/include/asm-x86/irq_vectors.h
+++ b/include/asm-x86/irq_vectors.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_IRQ_VECTORS_H 1#ifndef ASM_X86__IRQ_VECTORS_H
2#define _ASM_IRQ_VECTORS_H 2#define ASM_X86__IRQ_VECTORS_H
3 3
4#include <linux/threads.h> 4#include <linux/threads.h>
5 5
@@ -76,6 +76,7 @@
76#define CALL_FUNCTION_SINGLE_VECTOR 0xfb 76#define CALL_FUNCTION_SINGLE_VECTOR 0xfb
77#define THERMAL_APIC_VECTOR 0xfa 77#define THERMAL_APIC_VECTOR 0xfa
78#define THRESHOLD_APIC_VECTOR 0xf9 78#define THRESHOLD_APIC_VECTOR 0xf9
79#define UV_BAU_MESSAGE 0xf8
79#define INVALIDATE_TLB_VECTOR_END 0xf7 80#define INVALIDATE_TLB_VECTOR_END 0xf7
80#define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */ 81#define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */
81 82
@@ -178,4 +179,4 @@
178#define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8) 179#define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8)
179 180
180 181
181#endif /* _ASM_IRQ_VECTORS_H */ 182#endif /* ASM_X86__IRQ_VECTORS_H */
diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h
index 424acb48cd61..2bdab21f0898 100644
--- a/include/asm-x86/irqflags.h
+++ b/include/asm-x86/irqflags.h
@@ -166,27 +166,6 @@ static inline int raw_irqs_disabled(void)
166 return raw_irqs_disabled_flags(flags); 166 return raw_irqs_disabled_flags(flags);
167} 167}
168 168
169/*
170 * makes the traced hardirq state match with the machine state
171 *
172 * should be a rarely used function, only in places where its
173 * otherwise impossible to know the irq state, like in traps.
174 */
175static inline void trace_hardirqs_fixup_flags(unsigned long flags)
176{
177 if (raw_irqs_disabled_flags(flags))
178 trace_hardirqs_off();
179 else
180 trace_hardirqs_on();
181}
182
183static inline void trace_hardirqs_fixup(void)
184{
185 unsigned long flags = __raw_local_save_flags();
186
187 trace_hardirqs_fixup_flags(flags);
188}
189
190#else 169#else
191 170
192#ifdef CONFIG_X86_64 171#ifdef CONFIG_X86_64
diff --git a/include/asm-x86/ist.h b/include/asm-x86/ist.h
index 6ec6ceed95a7..35a2fe9bc921 100644
--- a/include/asm-x86/ist.h
+++ b/include/asm-x86/ist.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_IST_H 1#ifndef ASM_X86__IST_H
2#define _ASM_IST_H 2#define ASM_X86__IST_H
3 3
4/* 4/*
5 * Include file for the interface to IST BIOS 5 * Include file for the interface to IST BIOS
@@ -31,4 +31,4 @@ struct ist_info {
31extern struct ist_info ist_info; 31extern struct ist_info ist_info;
32 32
33#endif /* __KERNEL__ */ 33#endif /* __KERNEL__ */
34#endif /* _ASM_IST_H */ 34#endif /* ASM_X86__IST_H */
diff --git a/include/asm-x86/k8.h b/include/asm-x86/k8.h
index 452e2b696ff4..2bbaf4370a55 100644
--- a/include/asm-x86/k8.h
+++ b/include/asm-x86/k8.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_K8_H 1#ifndef ASM_X86__K8_H
2#define _ASM_K8_H 1 2#define ASM_X86__K8_H
3 3
4#include <linux/pci.h> 4#include <linux/pci.h>
5 5
@@ -12,4 +12,4 @@ extern int cache_k8_northbridges(void);
12extern void k8_flush_garts(void); 12extern void k8_flush_garts(void);
13extern int k8_scan_nodes(unsigned long start, unsigned long end); 13extern int k8_scan_nodes(unsigned long start, unsigned long end);
14 14
15#endif 15#endif /* ASM_X86__K8_H */
diff --git a/include/asm-x86/kdebug.h b/include/asm-x86/kdebug.h
index 96651bb59ba1..fbbab66ee9df 100644
--- a/include/asm-x86/kdebug.h
+++ b/include/asm-x86/kdebug.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_KDEBUG_H 1#ifndef ASM_X86__KDEBUG_H
2#define _ASM_X86_KDEBUG_H 2#define ASM_X86__KDEBUG_H
3 3
4#include <linux/notifier.h> 4#include <linux/notifier.h>
5 5
@@ -27,12 +27,11 @@ extern void printk_address(unsigned long address, int reliable);
27extern void die(const char *, struct pt_regs *,long); 27extern void die(const char *, struct pt_regs *,long);
28extern int __must_check __die(const char *, struct pt_regs *, long); 28extern int __must_check __die(const char *, struct pt_regs *, long);
29extern void show_registers(struct pt_regs *regs); 29extern void show_registers(struct pt_regs *regs);
30extern void __show_registers(struct pt_regs *, int all);
31extern void show_trace(struct task_struct *t, struct pt_regs *regs, 30extern void show_trace(struct task_struct *t, struct pt_regs *regs,
32 unsigned long *sp, unsigned long bp); 31 unsigned long *sp, unsigned long bp);
33extern void __show_regs(struct pt_regs *regs); 32extern void __show_regs(struct pt_regs *regs, int all);
34extern void show_regs(struct pt_regs *regs); 33extern void show_regs(struct pt_regs *regs);
35extern unsigned long oops_begin(void); 34extern unsigned long oops_begin(void);
36extern void oops_end(unsigned long, struct pt_regs *, int signr); 35extern void oops_end(unsigned long, struct pt_regs *, int signr);
37 36
38#endif 37#endif /* ASM_X86__KDEBUG_H */
diff --git a/include/asm-x86/kexec.h b/include/asm-x86/kexec.h
index 4246ab7dc988..ea09600d6129 100644
--- a/include/asm-x86/kexec.h
+++ b/include/asm-x86/kexec.h
@@ -1,5 +1,5 @@
1#ifndef _KEXEC_H 1#ifndef ASM_X86__KEXEC_H
2#define _KEXEC_H 2#define ASM_X86__KEXEC_H
3 3
4#ifdef CONFIG_X86_32 4#ifdef CONFIG_X86_32
5# define PA_CONTROL_PAGE 0 5# define PA_CONTROL_PAGE 0
@@ -172,4 +172,4 @@ relocate_kernel(unsigned long indirection_page,
172 172
173#endif /* __ASSEMBLY__ */ 173#endif /* __ASSEMBLY__ */
174 174
175#endif /* _KEXEC_H */ 175#endif /* ASM_X86__KEXEC_H */
diff --git a/include/asm-x86/kgdb.h b/include/asm-x86/kgdb.h
index 484c47554f3b..d283863354de 100644
--- a/include/asm-x86/kgdb.h
+++ b/include/asm-x86/kgdb.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_KGDB_H_ 1#ifndef ASM_X86__KGDB_H
2#define _ASM_KGDB_H_ 2#define ASM_X86__KGDB_H
3 3
4/* 4/*
5 * Copyright (C) 2001-2004 Amit S. Kale 5 * Copyright (C) 2001-2004 Amit S. Kale
@@ -39,12 +39,13 @@ enum regnames {
39 GDB_FS, /* 14 */ 39 GDB_FS, /* 14 */
40 GDB_GS, /* 15 */ 40 GDB_GS, /* 15 */
41}; 41};
42#define NUMREGBYTES ((GDB_GS+1)*4)
42#else /* ! CONFIG_X86_32 */ 43#else /* ! CONFIG_X86_32 */
43enum regnames { 44enum regnames64 {
44 GDB_AX, /* 0 */ 45 GDB_AX, /* 0 */
45 GDB_DX, /* 1 */ 46 GDB_BX, /* 1 */
46 GDB_CX, /* 2 */ 47 GDB_CX, /* 2 */
47 GDB_BX, /* 3 */ 48 GDB_DX, /* 3 */
48 GDB_SI, /* 4 */ 49 GDB_SI, /* 4 */
49 GDB_DI, /* 5 */ 50 GDB_DI, /* 5 */
50 GDB_BP, /* 6 */ 51 GDB_BP, /* 6 */
@@ -58,18 +59,15 @@ enum regnames {
58 GDB_R14, /* 14 */ 59 GDB_R14, /* 14 */
59 GDB_R15, /* 15 */ 60 GDB_R15, /* 15 */
60 GDB_PC, /* 16 */ 61 GDB_PC, /* 16 */
61 GDB_PS, /* 17 */
62}; 62};
63#endif /* CONFIG_X86_32 */
64 63
65/* 64enum regnames32 {
66 * Number of bytes of registers: 65 GDB_PS = 34,
67 */ 66 GDB_CS,
68#ifdef CONFIG_X86_32 67 GDB_SS,
69# define NUMREGBYTES 64 68};
70#else 69#define NUMREGBYTES ((GDB_SS+1)*4)
71# define NUMREGBYTES ((GDB_PS+1)*8) 70#endif /* CONFIG_X86_32 */
72#endif
73 71
74static inline void arch_kgdb_breakpoint(void) 72static inline void arch_kgdb_breakpoint(void)
75{ 73{
@@ -78,4 +76,4 @@ static inline void arch_kgdb_breakpoint(void)
78#define BREAK_INSTR_SIZE 1 76#define BREAK_INSTR_SIZE 1
79#define CACHE_FLUSH_IS_SAFE 1 77#define CACHE_FLUSH_IS_SAFE 1
80 78
81#endif /* _ASM_KGDB_H_ */ 79#endif /* ASM_X86__KGDB_H */
diff --git a/include/asm-x86/kmap_types.h b/include/asm-x86/kmap_types.h
index 5f4174132a22..89f44493e643 100644
--- a/include/asm-x86/kmap_types.h
+++ b/include/asm-x86/kmap_types.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_KMAP_TYPES_H 1#ifndef ASM_X86__KMAP_TYPES_H
2#define _ASM_X86_KMAP_TYPES_H 2#define ASM_X86__KMAP_TYPES_H
3 3
4#if defined(CONFIG_X86_32) && defined(CONFIG_DEBUG_HIGHMEM) 4#if defined(CONFIG_X86_32) && defined(CONFIG_DEBUG_HIGHMEM)
5# define D(n) __KM_FENCE_##n , 5# define D(n) __KM_FENCE_##n ,
@@ -26,4 +26,4 @@ D(13) KM_TYPE_NR
26 26
27#undef D 27#undef D
28 28
29#endif 29#endif /* ASM_X86__KMAP_TYPES_H */
diff --git a/include/asm-x86/kprobes.h b/include/asm-x86/kprobes.h
index 54980b0b3892..8a0748d01036 100644
--- a/include/asm-x86/kprobes.h
+++ b/include/asm-x86/kprobes.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_KPROBES_H 1#ifndef ASM_X86__KPROBES_H
2#define _ASM_KPROBES_H 2#define ASM_X86__KPROBES_H
3/* 3/*
4 * Kernel Probes (KProbes) 4 * Kernel Probes (KProbes)
5 * 5 *
@@ -82,16 +82,7 @@ struct kprobe_ctlblk {
82 struct prev_kprobe prev_kprobe; 82 struct prev_kprobe prev_kprobe;
83}; 83};
84 84
85/* trap3/1 are intr gates for kprobes. So, restore the status of IF,
86 * if necessary, before executing the original int3/1 (trap) handler.
87 */
88static inline void restore_interrupts(struct pt_regs *regs)
89{
90 if (regs->flags & X86_EFLAGS_IF)
91 local_irq_enable();
92}
93
94extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 85extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
95extern int kprobe_exceptions_notify(struct notifier_block *self, 86extern int kprobe_exceptions_notify(struct notifier_block *self,
96 unsigned long val, void *data); 87 unsigned long val, void *data);
97#endif /* _ASM_KPROBES_H */ 88#endif /* ASM_X86__KPROBES_H */
diff --git a/include/asm-x86/kvm.h b/include/asm-x86/kvm.h
index 6f1840812e59..ba0dd791fadf 100644
--- a/include/asm-x86/kvm.h
+++ b/include/asm-x86/kvm.h
@@ -1,5 +1,5 @@
1#ifndef __LINUX_KVM_X86_H 1#ifndef ASM_X86__KVM_H
2#define __LINUX_KVM_X86_H 2#define ASM_X86__KVM_H
3 3
4/* 4/*
5 * KVM x86 specific structures and definitions 5 * KVM x86 specific structures and definitions
@@ -208,26 +208,4 @@ struct kvm_pit_channel_state {
208struct kvm_pit_state { 208struct kvm_pit_state {
209 struct kvm_pit_channel_state channels[3]; 209 struct kvm_pit_channel_state channels[3];
210}; 210};
211 211#endif /* ASM_X86__KVM_H */
212#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
213#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
214#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
215#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
216#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
217#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
218#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
219#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
220#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
221#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
222#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
223#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
224#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
225#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
226#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
227#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
228#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
229#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
230#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
231#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
232
233#endif
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index 0f3c53114614..411fb8cfb24e 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -1,4 +1,4 @@
1#/* 1/*
2 * Kernel-based Virtual Machine driver for Linux 2 * Kernel-based Virtual Machine driver for Linux
3 * 3 *
4 * This header defines architecture specific interfaces, x86 version 4 * This header defines architecture specific interfaces, x86 version
@@ -8,8 +8,8 @@
8 * 8 *
9 */ 9 */
10 10
11#ifndef ASM_KVM_HOST_H 11#ifndef ASM_X86__KVM_HOST_H
12#define ASM_KVM_HOST_H 12#define ASM_X86__KVM_HOST_H
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/mm.h> 15#include <linux/mm.h>
@@ -57,6 +57,10 @@
57#define KVM_PAGES_PER_HPAGE (KVM_HPAGE_SIZE / PAGE_SIZE) 57#define KVM_PAGES_PER_HPAGE (KVM_HPAGE_SIZE / PAGE_SIZE)
58 58
59#define DE_VECTOR 0 59#define DE_VECTOR 0
60#define DB_VECTOR 1
61#define BP_VECTOR 3
62#define OF_VECTOR 4
63#define BR_VECTOR 5
60#define UD_VECTOR 6 64#define UD_VECTOR 6
61#define NM_VECTOR 7 65#define NM_VECTOR 7
62#define DF_VECTOR 8 66#define DF_VECTOR 8
@@ -65,6 +69,7 @@
65#define SS_VECTOR 12 69#define SS_VECTOR 12
66#define GP_VECTOR 13 70#define GP_VECTOR 13
67#define PF_VECTOR 14 71#define PF_VECTOR 14
72#define MF_VECTOR 16
68#define MC_VECTOR 18 73#define MC_VECTOR 18
69 74
70#define SELECTOR_TI_MASK (1 << 2) 75#define SELECTOR_TI_MASK (1 << 2)
@@ -89,7 +94,7 @@ extern struct list_head vm_list;
89struct kvm_vcpu; 94struct kvm_vcpu;
90struct kvm; 95struct kvm;
91 96
92enum { 97enum kvm_reg {
93 VCPU_REGS_RAX = 0, 98 VCPU_REGS_RAX = 0,
94 VCPU_REGS_RCX = 1, 99 VCPU_REGS_RCX = 1,
95 VCPU_REGS_RDX = 2, 100 VCPU_REGS_RDX = 2,
@@ -108,6 +113,7 @@ enum {
108 VCPU_REGS_R14 = 14, 113 VCPU_REGS_R14 = 14,
109 VCPU_REGS_R15 = 15, 114 VCPU_REGS_R15 = 15,
110#endif 115#endif
116 VCPU_REGS_RIP,
111 NR_VCPU_REGS 117 NR_VCPU_REGS
112}; 118};
113 119
@@ -189,10 +195,20 @@ struct kvm_mmu_page {
189 */ 195 */
190 int multimapped; /* More than one parent_pte? */ 196 int multimapped; /* More than one parent_pte? */
191 int root_count; /* Currently serving as active root */ 197 int root_count; /* Currently serving as active root */
198 bool unsync;
199 bool unsync_children;
192 union { 200 union {
193 u64 *parent_pte; /* !multimapped */ 201 u64 *parent_pte; /* !multimapped */
194 struct hlist_head parent_ptes; /* multimapped, kvm_pte_chain */ 202 struct hlist_head parent_ptes; /* multimapped, kvm_pte_chain */
195 }; 203 };
204 DECLARE_BITMAP(unsync_child_bitmap, 512);
205};
206
207struct kvm_pv_mmu_op_buffer {
208 void *ptr;
209 unsigned len;
210 unsigned processed;
211 char buf[512] __aligned(sizeof(long));
196}; 212};
197 213
198/* 214/*
@@ -207,6 +223,9 @@ struct kvm_mmu {
207 gpa_t (*gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t gva); 223 gpa_t (*gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t gva);
208 void (*prefetch_page)(struct kvm_vcpu *vcpu, 224 void (*prefetch_page)(struct kvm_vcpu *vcpu,
209 struct kvm_mmu_page *page); 225 struct kvm_mmu_page *page);
226 int (*sync_page)(struct kvm_vcpu *vcpu,
227 struct kvm_mmu_page *sp);
228 void (*invlpg)(struct kvm_vcpu *vcpu, gva_t gva);
210 hpa_t root_hpa; 229 hpa_t root_hpa;
211 int root_level; 230 int root_level;
212 int shadow_root_level; 231 int shadow_root_level;
@@ -219,8 +238,13 @@ struct kvm_vcpu_arch {
219 int interrupt_window_open; 238 int interrupt_window_open;
220 unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */ 239 unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
221 DECLARE_BITMAP(irq_pending, KVM_NR_INTERRUPTS); 240 DECLARE_BITMAP(irq_pending, KVM_NR_INTERRUPTS);
222 unsigned long regs[NR_VCPU_REGS]; /* for rsp: vcpu_load_rsp_rip() */ 241 /*
223 unsigned long rip; /* needs vcpu_load_rsp_rip() */ 242 * rip and regs accesses must go through
243 * kvm_{register,rip}_{read,write} functions.
244 */
245 unsigned long regs[NR_VCPU_REGS];
246 u32 regs_avail;
247 u32 regs_dirty;
224 248
225 unsigned long cr0; 249 unsigned long cr0;
226 unsigned long cr2; 250 unsigned long cr2;
@@ -237,6 +261,9 @@ struct kvm_vcpu_arch {
237 bool tpr_access_reporting; 261 bool tpr_access_reporting;
238 262
239 struct kvm_mmu mmu; 263 struct kvm_mmu mmu;
264 /* only needed in kvm_pv_mmu_op() path, but it's hot so
265 * put it here to avoid allocation */
266 struct kvm_pv_mmu_op_buffer mmu_op_buffer;
240 267
241 struct kvm_mmu_memory_cache mmu_pte_chain_cache; 268 struct kvm_mmu_memory_cache mmu_pte_chain_cache;
242 struct kvm_mmu_memory_cache mmu_rmap_desc_cache; 269 struct kvm_mmu_memory_cache mmu_rmap_desc_cache;
@@ -269,6 +296,11 @@ struct kvm_vcpu_arch {
269 u32 error_code; 296 u32 error_code;
270 } exception; 297 } exception;
271 298
299 struct kvm_queued_interrupt {
300 bool pending;
301 u8 nr;
302 } interrupt;
303
272 struct { 304 struct {
273 int active; 305 int active;
274 u8 save_iopl; 306 u8 save_iopl;
@@ -294,6 +326,7 @@ struct kvm_vcpu_arch {
294 struct page *time_page; 326 struct page *time_page;
295 327
296 bool nmi_pending; 328 bool nmi_pending;
329 bool nmi_injected;
297 330
298 u64 mtrr[0x100]; 331 u64 mtrr[0x100];
299}; 332};
@@ -316,9 +349,12 @@ struct kvm_arch{
316 * Hash table of struct kvm_mmu_page. 349 * Hash table of struct kvm_mmu_page.
317 */ 350 */
318 struct list_head active_mmu_pages; 351 struct list_head active_mmu_pages;
352 struct list_head assigned_dev_head;
353 struct dmar_domain *intel_iommu_domain;
319 struct kvm_pic *vpic; 354 struct kvm_pic *vpic;
320 struct kvm_ioapic *vioapic; 355 struct kvm_ioapic *vioapic;
321 struct kvm_pit *vpit; 356 struct kvm_pit *vpit;
357 struct hlist_head irq_ack_notifier_list;
322 358
323 int round_robin_prev_vcpu; 359 int round_robin_prev_vcpu;
324 unsigned int tss_addr; 360 unsigned int tss_addr;
@@ -338,6 +374,7 @@ struct kvm_vm_stat {
338 u32 mmu_flooded; 374 u32 mmu_flooded;
339 u32 mmu_recycled; 375 u32 mmu_recycled;
340 u32 mmu_cache_miss; 376 u32 mmu_cache_miss;
377 u32 mmu_unsync;
341 u32 remote_tlb_flush; 378 u32 remote_tlb_flush;
342 u32 lpages; 379 u32 lpages;
343}; 380};
@@ -364,6 +401,7 @@ struct kvm_vcpu_stat {
364 u32 insn_emulation; 401 u32 insn_emulation;
365 u32 insn_emulation_fail; 402 u32 insn_emulation_fail;
366 u32 hypercalls; 403 u32 hypercalls;
404 u32 irq_injections;
367}; 405};
368 406
369struct descriptor_table { 407struct descriptor_table {
@@ -414,8 +452,7 @@ struct kvm_x86_ops {
414 unsigned long (*get_dr)(struct kvm_vcpu *vcpu, int dr); 452 unsigned long (*get_dr)(struct kvm_vcpu *vcpu, int dr);
415 void (*set_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long value, 453 void (*set_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long value,
416 int *exception); 454 int *exception);
417 void (*cache_regs)(struct kvm_vcpu *vcpu); 455 void (*cache_reg)(struct kvm_vcpu *vcpu, enum kvm_reg reg);
418 void (*decache_regs)(struct kvm_vcpu *vcpu);
419 unsigned long (*get_rflags)(struct kvm_vcpu *vcpu); 456 unsigned long (*get_rflags)(struct kvm_vcpu *vcpu);
420 void (*set_rflags)(struct kvm_vcpu *vcpu, unsigned long rflags); 457 void (*set_rflags)(struct kvm_vcpu *vcpu, unsigned long rflags);
421 458
@@ -528,6 +565,8 @@ void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code);
528void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2, 565void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2,
529 u32 error_code); 566 u32 error_code);
530 567
568void kvm_pic_set_irq(void *opaque, int irq, int level);
569
531void kvm_inject_nmi(struct kvm_vcpu *vcpu); 570void kvm_inject_nmi(struct kvm_vcpu *vcpu);
532 571
533void fx_init(struct kvm_vcpu *vcpu); 572void fx_init(struct kvm_vcpu *vcpu);
@@ -550,12 +589,14 @@ int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva);
550void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); 589void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu);
551int kvm_mmu_load(struct kvm_vcpu *vcpu); 590int kvm_mmu_load(struct kvm_vcpu *vcpu);
552void kvm_mmu_unload(struct kvm_vcpu *vcpu); 591void kvm_mmu_unload(struct kvm_vcpu *vcpu);
592void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu);
553 593
554int kvm_emulate_hypercall(struct kvm_vcpu *vcpu); 594int kvm_emulate_hypercall(struct kvm_vcpu *vcpu);
555 595
556int kvm_fix_hypercall(struct kvm_vcpu *vcpu); 596int kvm_fix_hypercall(struct kvm_vcpu *vcpu);
557 597
558int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code); 598int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code);
599void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva);
559 600
560void kvm_enable_tdp(void); 601void kvm_enable_tdp(void);
561void kvm_disable_tdp(void); 602void kvm_disable_tdp(void);
@@ -686,33 +727,6 @@ enum {
686 TASK_SWITCH_GATE = 3, 727 TASK_SWITCH_GATE = 3,
687}; 728};
688 729
689#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
690 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
691 vcpu, 5, d1, d2, d3, d4, d5)
692#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
693 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
694 vcpu, 4, d1, d2, d3, d4, 0)
695#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
696 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
697 vcpu, 3, d1, d2, d3, 0, 0)
698#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
699 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
700 vcpu, 2, d1, d2, 0, 0, 0)
701#define KVMTRACE_1D(evt, vcpu, d1, name) \
702 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
703 vcpu, 1, d1, 0, 0, 0, 0)
704#define KVMTRACE_0D(evt, vcpu, name) \
705 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
706 vcpu, 0, 0, 0, 0, 0, 0)
707
708#ifdef CONFIG_64BIT
709# define KVM_EX_ENTRY ".quad"
710# define KVM_EX_PUSH "pushq"
711#else
712# define KVM_EX_ENTRY ".long"
713# define KVM_EX_PUSH "pushl"
714#endif
715
716/* 730/*
717 * Hardware virtualization extension instructions may fault if a 731 * Hardware virtualization extension instructions may fault if a
718 * reboot turns off virtualization while processes are running. 732 * reboot turns off virtualization while processes are running.
@@ -722,17 +736,17 @@ asmlinkage void kvm_handle_fault_on_reboot(void);
722 736
723#define __kvm_handle_fault_on_reboot(insn) \ 737#define __kvm_handle_fault_on_reboot(insn) \
724 "666: " insn "\n\t" \ 738 "666: " insn "\n\t" \
725 ".pushsection .text.fixup, \"ax\" \n" \ 739 ".pushsection .fixup, \"ax\" \n" \
726 "667: \n\t" \ 740 "667: \n\t" \
727 KVM_EX_PUSH " $666b \n\t" \ 741 __ASM_SIZE(push) " $666b \n\t" \
728 "jmp kvm_handle_fault_on_reboot \n\t" \ 742 "jmp kvm_handle_fault_on_reboot \n\t" \
729 ".popsection \n\t" \ 743 ".popsection \n\t" \
730 ".pushsection __ex_table, \"a\" \n\t" \ 744 ".pushsection __ex_table, \"a\" \n\t" \
731 KVM_EX_ENTRY " 666b, 667b \n\t" \ 745 _ASM_PTR " 666b, 667b \n\t" \
732 ".popsection" 746 ".popsection"
733 747
734#define KVM_ARCH_WANT_MMU_NOTIFIER 748#define KVM_ARCH_WANT_MMU_NOTIFIER
735int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); 749int kvm_unmap_hva(struct kvm *kvm, unsigned long hva);
736int kvm_age_hva(struct kvm *kvm, unsigned long hva); 750int kvm_age_hva(struct kvm *kvm, unsigned long hva);
737 751
738#endif 752#endif /* ASM_X86__KVM_HOST_H */
diff --git a/include/asm-x86/kvm_para.h b/include/asm-x86/kvm_para.h
index 76f392146daa..30054fded4fb 100644
--- a/include/asm-x86/kvm_para.h
+++ b/include/asm-x86/kvm_para.h
@@ -1,5 +1,5 @@
1#ifndef __X86_KVM_PARA_H 1#ifndef ASM_X86__KVM_PARA_H
2#define __X86_KVM_PARA_H 2#define ASM_X86__KVM_PARA_H
3 3
4/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It 4/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It
5 * should be used to determine that a VM is running under KVM. 5 * should be used to determine that a VM is running under KVM.
@@ -144,4 +144,4 @@ static inline unsigned int kvm_arch_para_features(void)
144 144
145#endif 145#endif
146 146
147#endif 147#endif /* ASM_X86__KVM_PARA_H */
diff --git a/include/asm-x86/kvm_x86_emulate.h b/include/asm-x86/kvm_x86_emulate.h
index 4e8c1e48d91d..e2d9b030c1ac 100644
--- a/include/asm-x86/kvm_x86_emulate.h
+++ b/include/asm-x86/kvm_x86_emulate.h
@@ -8,8 +8,8 @@
8 * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4 8 * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4
9 */ 9 */
10 10
11#ifndef __X86_EMULATE_H__ 11#ifndef ASM_X86__KVM_X86_EMULATE_H
12#define __X86_EMULATE_H__ 12#define ASM_X86__KVM_X86_EMULATE_H
13 13
14struct x86_emulate_ctxt; 14struct x86_emulate_ctxt;
15 15
@@ -181,4 +181,4 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt,
181int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, 181int x86_emulate_insn(struct x86_emulate_ctxt *ctxt,
182 struct x86_emulate_ops *ops); 182 struct x86_emulate_ops *ops);
183 183
184#endif /* __X86_EMULATE_H__ */ 184#endif /* ASM_X86__KVM_X86_EMULATE_H */
diff --git a/include/asm-x86/ldt.h b/include/asm-x86/ldt.h
index 20c597242b53..a5228504d867 100644
--- a/include/asm-x86/ldt.h
+++ b/include/asm-x86/ldt.h
@@ -3,8 +3,8 @@
3 * 3 *
4 * Definitions of structures used with the modify_ldt system call. 4 * Definitions of structures used with the modify_ldt system call.
5 */ 5 */
6#ifndef _ASM_X86_LDT_H 6#ifndef ASM_X86__LDT_H
7#define _ASM_X86_LDT_H 7#define ASM_X86__LDT_H
8 8
9/* Maximum number of LDT entries supported. */ 9/* Maximum number of LDT entries supported. */
10#define LDT_ENTRIES 8192 10#define LDT_ENTRIES 8192
@@ -37,4 +37,4 @@ struct user_desc {
37#define MODIFY_LDT_CONTENTS_CODE 2 37#define MODIFY_LDT_CONTENTS_CODE 2
38 38
39#endif /* !__ASSEMBLY__ */ 39#endif /* !__ASSEMBLY__ */
40#endif 40#endif /* ASM_X86__LDT_H */
diff --git a/include/asm-x86/lguest.h b/include/asm-x86/lguest.h
index be4a7247fa2b..7505e947ed27 100644
--- a/include/asm-x86/lguest.h
+++ b/include/asm-x86/lguest.h
@@ -1,5 +1,5 @@
1#ifndef _X86_LGUEST_H 1#ifndef ASM_X86__LGUEST_H
2#define _X86_LGUEST_H 2#define ASM_X86__LGUEST_H
3 3
4#define GDT_ENTRY_LGUEST_CS 10 4#define GDT_ENTRY_LGUEST_CS 10
5#define GDT_ENTRY_LGUEST_DS 11 5#define GDT_ENTRY_LGUEST_DS 11
@@ -91,4 +91,4 @@ static inline void lguest_set_ts(void)
91 91
92#endif /* __ASSEMBLY__ */ 92#endif /* __ASSEMBLY__ */
93 93
94#endif 94#endif /* ASM_X86__LGUEST_H */
diff --git a/include/asm-x86/lguest_hcall.h b/include/asm-x86/lguest_hcall.h
index a3241f28e34a..8f034ba4b53e 100644
--- a/include/asm-x86/lguest_hcall.h
+++ b/include/asm-x86/lguest_hcall.h
@@ -1,6 +1,6 @@
1/* Architecture specific portion of the lguest hypercalls */ 1/* Architecture specific portion of the lguest hypercalls */
2#ifndef _X86_LGUEST_HCALL_H 2#ifndef ASM_X86__LGUEST_HCALL_H
3#define _X86_LGUEST_HCALL_H 3#define ASM_X86__LGUEST_HCALL_H
4 4
5#define LHCALL_FLUSH_ASYNC 0 5#define LHCALL_FLUSH_ASYNC 0
6#define LHCALL_LGUEST_INIT 1 6#define LHCALL_LGUEST_INIT 1
@@ -68,4 +68,4 @@ struct hcall_args {
68}; 68};
69 69
70#endif /* !__ASSEMBLY__ */ 70#endif /* !__ASSEMBLY__ */
71#endif /* _I386_LGUEST_HCALL_H */ 71#endif /* ASM_X86__LGUEST_HCALL_H */
diff --git a/include/asm-x86/linkage.h b/include/asm-x86/linkage.h
index 64e444f8e85b..42d8b62ee8ab 100644
--- a/include/asm-x86/linkage.h
+++ b/include/asm-x86/linkage.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_LINKAGE_H 1#ifndef ASM_X86__LINKAGE_H
2#define __ASM_LINKAGE_H 2#define ASM_X86__LINKAGE_H
3 3
4#undef notrace 4#undef notrace
5#define notrace __attribute__((no_instrument_function)) 5#define notrace __attribute__((no_instrument_function))
@@ -57,5 +57,5 @@
57#define __ALIGN_STR ".align 16,0x90" 57#define __ALIGN_STR ".align 16,0x90"
58#endif 58#endif
59 59
60#endif 60#endif /* ASM_X86__LINKAGE_H */
61 61
diff --git a/include/asm-x86/local.h b/include/asm-x86/local.h
index 330a72496abd..ae91994fd6c9 100644
--- a/include/asm-x86/local.h
+++ b/include/asm-x86/local.h
@@ -1,5 +1,5 @@
1#ifndef _ARCH_LOCAL_H 1#ifndef ASM_X86__LOCAL_H
2#define _ARCH_LOCAL_H 2#define ASM_X86__LOCAL_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5 5
@@ -232,4 +232,4 @@ static inline long local_sub_return(long i, local_t *l)
232#define __cpu_local_add(i, l) cpu_local_add((i), (l)) 232#define __cpu_local_add(i, l) cpu_local_add((i), (l))
233#define __cpu_local_sub(i, l) cpu_local_sub((i), (l)) 233#define __cpu_local_sub(i, l) cpu_local_sub((i), (l))
234 234
235#endif /* _ARCH_LOCAL_H */ 235#endif /* ASM_X86__LOCAL_H */
diff --git a/include/asm-x86/mach-default/apm.h b/include/asm-x86/mach-default/apm.h
index 989f34c37d32..2aa61b54fbd5 100644
--- a/include/asm-x86/mach-default/apm.h
+++ b/include/asm-x86/mach-default/apm.h
@@ -3,8 +3,8 @@
3 * Split out from apm.c by Osamu Tomita <tomita@cinet.co.jp> 3 * Split out from apm.c by Osamu Tomita <tomita@cinet.co.jp>
4 */ 4 */
5 5
6#ifndef _ASM_APM_H 6#ifndef ASM_X86__MACH_DEFAULT__APM_H
7#define _ASM_APM_H 7#define ASM_X86__MACH_DEFAULT__APM_H
8 8
9#ifdef APM_ZERO_SEGS 9#ifdef APM_ZERO_SEGS
10# define APM_DO_ZERO_SEGS \ 10# define APM_DO_ZERO_SEGS \
@@ -70,4 +70,4 @@ static inline u8 apm_bios_call_simple_asm(u32 func, u32 ebx_in,
70 return error; 70 return error;
71} 71}
72 72
73#endif /* _ASM_APM_H */ 73#endif /* ASM_X86__MACH_DEFAULT__APM_H */
diff --git a/include/asm-x86/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h
index f3226b9a6b82..2a330a41b3dd 100644
--- a/include/asm-x86/mach-default/mach_apic.h
+++ b/include/asm-x86/mach-default/mach_apic.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_APIC_H 1#ifndef ASM_X86__MACH_DEFAULT__MACH_APIC_H
2#define __ASM_MACH_APIC_H 2#define ASM_X86__MACH_DEFAULT__MACH_APIC_H
3 3
4#ifdef CONFIG_X86_LOCAL_APIC 4#ifdef CONFIG_X86_LOCAL_APIC
5 5
@@ -30,6 +30,8 @@ static inline cpumask_t target_cpus(void)
30#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) 30#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
31#define phys_pkg_id (genapic->phys_pkg_id) 31#define phys_pkg_id (genapic->phys_pkg_id)
32#define vector_allocation_domain (genapic->vector_allocation_domain) 32#define vector_allocation_domain (genapic->vector_allocation_domain)
33#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID)))
34#define send_IPI_self (genapic->send_IPI_self)
33extern void setup_apic_routing(void); 35extern void setup_apic_routing(void);
34#else 36#else
35#define INT_DELIVERY_MODE dest_LowestPrio 37#define INT_DELIVERY_MODE dest_LowestPrio
@@ -54,7 +56,7 @@ static inline void init_apic_ldr(void)
54 56
55static inline int apic_id_registered(void) 57static inline int apic_id_registered(void)
56{ 58{
57 return physid_isset(GET_APIC_ID(read_apic_id()), phys_cpu_present_map); 59 return physid_isset(read_apic_id(), phys_cpu_present_map);
58} 60}
59 61
60static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 62static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
@@ -138,4 +140,4 @@ static inline void enable_apic_mode(void)
138} 140}
139 141
140#endif /* CONFIG_X86_LOCAL_APIC */ 142#endif /* CONFIG_X86_LOCAL_APIC */
141#endif /* __ASM_MACH_APIC_H */ 143#endif /* ASM_X86__MACH_DEFAULT__MACH_APIC_H */
diff --git a/include/asm-x86/mach-default/mach_apicdef.h b/include/asm-x86/mach-default/mach_apicdef.h
index e4b29ba37de6..0c2d41c41b20 100644
--- a/include/asm-x86/mach-default/mach_apicdef.h
+++ b/include/asm-x86/mach-default/mach_apicdef.h
@@ -1,12 +1,12 @@
1#ifndef __ASM_MACH_APICDEF_H 1#ifndef ASM_X86__MACH_DEFAULT__MACH_APICDEF_H
2#define __ASM_MACH_APICDEF_H 2#define ASM_X86__MACH_DEFAULT__MACH_APICDEF_H
3 3
4#include <asm/apic.h> 4#include <asm/apic.h>
5 5
6#ifdef CONFIG_X86_64 6#ifdef CONFIG_X86_64
7#define APIC_ID_MASK (0xFFu<<24) 7#define APIC_ID_MASK (genapic->apic_id_mask)
8#define GET_APIC_ID(x) (((x)>>24)&0xFFu) 8#define GET_APIC_ID(x) (genapic->get_apic_id(x))
9#define SET_APIC_ID(x) (((x)<<24)) 9#define SET_APIC_ID(x) (genapic->set_apic_id(x))
10#else 10#else
11#define APIC_ID_MASK (0xF<<24) 11#define APIC_ID_MASK (0xF<<24)
12static inline unsigned get_apic_id(unsigned long x) 12static inline unsigned get_apic_id(unsigned long x)
@@ -21,4 +21,4 @@ static inline unsigned get_apic_id(unsigned long x)
21#define GET_APIC_ID(x) get_apic_id(x) 21#define GET_APIC_ID(x) get_apic_id(x)
22#endif 22#endif
23 23
24#endif 24#endif /* ASM_X86__MACH_DEFAULT__MACH_APICDEF_H */
diff --git a/include/asm-x86/mach-default/mach_ipi.h b/include/asm-x86/mach-default/mach_ipi.h
index be323364e68f..674bc7e50c35 100644
--- a/include/asm-x86/mach-default/mach_ipi.h
+++ b/include/asm-x86/mach-default/mach_ipi.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef ASM_X86__MACH_DEFAULT__MACH_IPI_H
2#define __ASM_MACH_IPI_H 2#define ASM_X86__MACH_DEFAULT__MACH_IPI_H
3 3
4/* Avoid include hell */ 4/* Avoid include hell */
5#define NMI_VECTOR 0x02 5#define NMI_VECTOR 0x02
@@ -61,4 +61,4 @@ static inline void send_IPI_all(int vector)
61} 61}
62#endif 62#endif
63 63
64#endif /* __ASM_MACH_IPI_H */ 64#endif /* ASM_X86__MACH_DEFAULT__MACH_IPI_H */
diff --git a/include/asm-x86/mach-default/mach_mpparse.h b/include/asm-x86/mach-default/mach_mpparse.h
index d14108505bb8..9c381f2815ac 100644
--- a/include/asm-x86/mach-default/mach_mpparse.h
+++ b/include/asm-x86/mach-default/mach_mpparse.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_MPPARSE_H 1#ifndef ASM_X86__MACH_DEFAULT__MACH_MPPARSE_H
2#define __ASM_MACH_MPPARSE_H 2#define ASM_X86__MACH_DEFAULT__MACH_MPPARSE_H
3 3
4static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 4static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
5 char *productid) 5 char *productid)
@@ -14,4 +14,4 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
14} 14}
15 15
16 16
17#endif /* __ASM_MACH_MPPARSE_H */ 17#endif /* ASM_X86__MACH_DEFAULT__MACH_MPPARSE_H */
diff --git a/include/asm-x86/mach-default/mach_mpspec.h b/include/asm-x86/mach-default/mach_mpspec.h
index 51c9a9775932..d77646f011f1 100644
--- a/include/asm-x86/mach-default/mach_mpspec.h
+++ b/include/asm-x86/mach-default/mach_mpspec.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_MPSPEC_H 1#ifndef ASM_X86__MACH_DEFAULT__MACH_MPSPEC_H
2#define __ASM_MACH_MPSPEC_H 2#define ASM_X86__MACH_DEFAULT__MACH_MPSPEC_H
3 3
4#define MAX_IRQ_SOURCES 256 4#define MAX_IRQ_SOURCES 256
5 5
@@ -9,4 +9,4 @@
9#define MAX_MP_BUSSES 32 9#define MAX_MP_BUSSES 32
10#endif 10#endif
11 11
12#endif /* __ASM_MACH_MPSPEC_H */ 12#endif /* ASM_X86__MACH_DEFAULT__MACH_MPSPEC_H */
diff --git a/include/asm-x86/mach-default/mach_timer.h b/include/asm-x86/mach-default/mach_timer.h
index 4b76e536cd98..990b15833834 100644
--- a/include/asm-x86/mach-default/mach_timer.h
+++ b/include/asm-x86/mach-default/mach_timer.h
@@ -10,8 +10,8 @@
10 * directly because of the awkward 8-bit access mechanism of the 82C54 10 * directly because of the awkward 8-bit access mechanism of the 82C54
11 * device. 11 * device.
12 */ 12 */
13#ifndef _MACH_TIMER_H 13#ifndef ASM_X86__MACH_DEFAULT__MACH_TIMER_H
14#define _MACH_TIMER_H 14#define ASM_X86__MACH_DEFAULT__MACH_TIMER_H
15 15
16#define CALIBRATE_TIME_MSEC 30 /* 30 msecs */ 16#define CALIBRATE_TIME_MSEC 30 /* 30 msecs */
17#define CALIBRATE_LATCH \ 17#define CALIBRATE_LATCH \
@@ -45,4 +45,4 @@ static inline void mach_countup(unsigned long *count_p)
45 *count_p = count; 45 *count_p = count;
46} 46}
47 47
48#endif /* !_MACH_TIMER_H */ 48#endif /* ASM_X86__MACH_DEFAULT__MACH_TIMER_H */
diff --git a/include/asm-x86/mach-default/mach_traps.h b/include/asm-x86/mach-default/mach_traps.h
index 2fe7705c0484..ff8778f26b84 100644
--- a/include/asm-x86/mach-default/mach_traps.h
+++ b/include/asm-x86/mach-default/mach_traps.h
@@ -2,17 +2,11 @@
2 * Machine specific NMI handling for generic. 2 * Machine specific NMI handling for generic.
3 * Split out from traps.c by Osamu Tomita <tomita@cinet.co.jp> 3 * Split out from traps.c by Osamu Tomita <tomita@cinet.co.jp>
4 */ 4 */
5#ifndef _MACH_TRAPS_H 5#ifndef ASM_X86__MACH_DEFAULT__MACH_TRAPS_H
6#define _MACH_TRAPS_H 6#define ASM_X86__MACH_DEFAULT__MACH_TRAPS_H
7 7
8#include <asm/mc146818rtc.h> 8#include <asm/mc146818rtc.h>
9 9
10static inline void clear_mem_error(unsigned char reason)
11{
12 reason = (reason & 0xf) | 4;
13 outb(reason, 0x61);
14}
15
16static inline unsigned char get_nmi_reason(void) 10static inline unsigned char get_nmi_reason(void)
17{ 11{
18 return inb(0x61); 12 return inb(0x61);
@@ -36,4 +30,4 @@ static inline void reassert_nmi(void)
36 unlock_cmos(); 30 unlock_cmos();
37} 31}
38 32
39#endif /* !_MACH_TRAPS_H */ 33#endif /* ASM_X86__MACH_DEFAULT__MACH_TRAPS_H */
diff --git a/include/asm-x86/mach-default/mach_wakecpu.h b/include/asm-x86/mach-default/mach_wakecpu.h
index 3ebb17893aa5..361b810f5160 100644
--- a/include/asm-x86/mach-default/mach_wakecpu.h
+++ b/include/asm-x86/mach-default/mach_wakecpu.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_WAKECPU_H 1#ifndef ASM_X86__MACH_DEFAULT__MACH_WAKECPU_H
2#define __ASM_MACH_WAKECPU_H 2#define ASM_X86__MACH_DEFAULT__MACH_WAKECPU_H
3 3
4/* 4/*
5 * This file copes with machines that wakeup secondary CPUs by the 5 * This file copes with machines that wakeup secondary CPUs by the
@@ -39,4 +39,4 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
39 #define inquire_remote_apic(apicid) {} 39 #define inquire_remote_apic(apicid) {}
40#endif 40#endif
41 41
42#endif /* __ASM_MACH_WAKECPU_H */ 42#endif /* ASM_X86__MACH_DEFAULT__MACH_WAKECPU_H */
diff --git a/include/asm-x86/mach-es7000/mach_apicdef.h b/include/asm-x86/mach-es7000/mach_apicdef.h
deleted file mode 100644
index a58ab5a75c8c..000000000000
--- a/include/asm-x86/mach-es7000/mach_apicdef.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ASM_MACH_APICDEF_H
2#define __ASM_MACH_APICDEF_H
3
4#define APIC_ID_MASK (0xFF<<24)
5
6static inline unsigned get_apic_id(unsigned long x)
7{
8 return (((x)>>24)&0xFF);
9}
10
11#define GET_APIC_ID(x) get_apic_id(x)
12
13#endif
diff --git a/include/asm-x86/mach-generic/gpio.h b/include/asm-x86/mach-generic/gpio.h
index 5305dcb96df2..6ce0f7786ef8 100644
--- a/include/asm-x86/mach-generic/gpio.h
+++ b/include/asm-x86/mach-generic/gpio.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_GENERIC_GPIO_H 1#ifndef ASM_X86__MACH_GENERIC__GPIO_H
2#define __ASM_MACH_GENERIC_GPIO_H 2#define ASM_X86__MACH_GENERIC__GPIO_H
3 3
4int gpio_request(unsigned gpio, const char *label); 4int gpio_request(unsigned gpio, const char *label);
5void gpio_free(unsigned gpio); 5void gpio_free(unsigned gpio);
@@ -12,4 +12,4 @@ int irq_to_gpio(unsigned irq);
12 12
13#include <asm-generic/gpio.h> /* cansleep wrappers */ 13#include <asm-generic/gpio.h> /* cansleep wrappers */
14 14
15#endif /* __ASM_MACH_GENERIC_GPIO_H */ 15#endif /* ASM_X86__MACH_GENERIC__GPIO_H */
diff --git a/include/asm-x86/mach-generic/irq_vectors_limits.h b/include/asm-x86/mach-generic/irq_vectors_limits.h
index 890ce3f5e09a..f7870e1a220d 100644
--- a/include/asm-x86/mach-generic/irq_vectors_limits.h
+++ b/include/asm-x86/mach-generic/irq_vectors_limits.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_IRQ_VECTORS_LIMITS_H 1#ifndef ASM_X86__MACH_GENERIC__IRQ_VECTORS_LIMITS_H
2#define _ASM_IRQ_VECTORS_LIMITS_H 2#define ASM_X86__MACH_GENERIC__IRQ_VECTORS_LIMITS_H
3 3
4/* 4/*
5 * For Summit or generic (i.e. installer) kernels, we have lots of I/O APICs, 5 * For Summit or generic (i.e. installer) kernels, we have lots of I/O APICs,
@@ -11,4 +11,4 @@
11#define NR_IRQS 224 11#define NR_IRQS 224
12#define NR_IRQ_VECTORS 1024 12#define NR_IRQ_VECTORS 1024
13 13
14#endif /* _ASM_IRQ_VECTORS_LIMITS_H */ 14#endif /* ASM_X86__MACH_GENERIC__IRQ_VECTORS_LIMITS_H */
diff --git a/include/asm-x86/mach-generic/mach_apic.h b/include/asm-x86/mach-generic/mach_apic.h
index 6eff343e1233..5d010c6881dd 100644
--- a/include/asm-x86/mach-generic/mach_apic.h
+++ b/include/asm-x86/mach-generic/mach_apic.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_APIC_H 1#ifndef ASM_X86__MACH_GENERIC__MACH_APIC_H
2#define __ASM_MACH_APIC_H 2#define ASM_X86__MACH_GENERIC__MACH_APIC_H
3 3
4#include <asm/genapic.h> 4#include <asm/genapic.h>
5 5
@@ -29,4 +29,4 @@
29 29
30extern void generic_bigsmp_probe(void); 30extern void generic_bigsmp_probe(void);
31 31
32#endif /* __ASM_MACH_APIC_H */ 32#endif /* ASM_X86__MACH_GENERIC__MACH_APIC_H */
diff --git a/include/asm-x86/mach-generic/mach_apicdef.h b/include/asm-x86/mach-generic/mach_apicdef.h
index 28ed98972ca8..1657f38b8f27 100644
--- a/include/asm-x86/mach-generic/mach_apicdef.h
+++ b/include/asm-x86/mach-generic/mach_apicdef.h
@@ -1,5 +1,5 @@
1#ifndef _GENAPIC_MACH_APICDEF_H 1#ifndef ASM_X86__MACH_GENERIC__MACH_APICDEF_H
2#define _GENAPIC_MACH_APICDEF_H 1 2#define ASM_X86__MACH_GENERIC__MACH_APICDEF_H
3 3
4#ifndef APIC_DEFINITION 4#ifndef APIC_DEFINITION
5#include <asm/genapic.h> 5#include <asm/genapic.h>
@@ -8,4 +8,4 @@
8#define APIC_ID_MASK (genapic->apic_id_mask) 8#define APIC_ID_MASK (genapic->apic_id_mask)
9#endif 9#endif
10 10
11#endif 11#endif /* ASM_X86__MACH_GENERIC__MACH_APICDEF_H */
diff --git a/include/asm-x86/mach-generic/mach_ipi.h b/include/asm-x86/mach-generic/mach_ipi.h
index 441b0fe3ed1d..f67433dbd65f 100644
--- a/include/asm-x86/mach-generic/mach_ipi.h
+++ b/include/asm-x86/mach-generic/mach_ipi.h
@@ -1,5 +1,5 @@
1#ifndef _MACH_IPI_H 1#ifndef ASM_X86__MACH_GENERIC__MACH_IPI_H
2#define _MACH_IPI_H 1 2#define ASM_X86__MACH_GENERIC__MACH_IPI_H
3 3
4#include <asm/genapic.h> 4#include <asm/genapic.h>
5 5
@@ -7,4 +7,4 @@
7#define send_IPI_allbutself (genapic->send_IPI_allbutself) 7#define send_IPI_allbutself (genapic->send_IPI_allbutself)
8#define send_IPI_all (genapic->send_IPI_all) 8#define send_IPI_all (genapic->send_IPI_all)
9 9
10#endif 10#endif /* ASM_X86__MACH_GENERIC__MACH_IPI_H */
diff --git a/include/asm-x86/mach-generic/mach_mpparse.h b/include/asm-x86/mach-generic/mach_mpparse.h
index 586cadbf3787..3115564e557c 100644
--- a/include/asm-x86/mach-generic/mach_mpparse.h
+++ b/include/asm-x86/mach-generic/mach_mpparse.h
@@ -1,5 +1,5 @@
1#ifndef _MACH_MPPARSE_H 1#ifndef ASM_X86__MACH_GENERIC__MACH_MPPARSE_H
2#define _MACH_MPPARSE_H 1 2#define ASM_X86__MACH_GENERIC__MACH_MPPARSE_H
3 3
4 4
5extern int mps_oem_check(struct mp_config_table *mpc, char *oem, 5extern int mps_oem_check(struct mp_config_table *mpc, char *oem,
@@ -7,4 +7,4 @@ extern int mps_oem_check(struct mp_config_table *mpc, char *oem,
7 7
8extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id); 8extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
9 9
10#endif 10#endif /* ASM_X86__MACH_GENERIC__MACH_MPPARSE_H */
diff --git a/include/asm-x86/mach-generic/mach_mpspec.h b/include/asm-x86/mach-generic/mach_mpspec.h
index c83c120be538..6061b153613e 100644
--- a/include/asm-x86/mach-generic/mach_mpspec.h
+++ b/include/asm-x86/mach-generic/mach_mpspec.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_MPSPEC_H 1#ifndef ASM_X86__MACH_GENERIC__MACH_MPSPEC_H
2#define __ASM_MACH_MPSPEC_H 2#define ASM_X86__MACH_GENERIC__MACH_MPSPEC_H
3 3
4#define MAX_IRQ_SOURCES 256 4#define MAX_IRQ_SOURCES 256
5 5
@@ -9,4 +9,4 @@
9 9
10extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, 10extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem,
11 char *productid); 11 char *productid);
12#endif /* __ASM_MACH_MPSPEC_H */ 12#endif /* ASM_X86__MACH_GENERIC__MACH_MPSPEC_H */
diff --git a/include/asm-x86/mach-rdc321x/gpio.h b/include/asm-x86/mach-rdc321x/gpio.h
index acce0b7d397b..94b6cdf532e2 100644
--- a/include/asm-x86/mach-rdc321x/gpio.h
+++ b/include/asm-x86/mach-rdc321x/gpio.h
@@ -1,5 +1,7 @@
1#ifndef _RDC321X_GPIO_H 1#ifndef ASM_X86__MACH_RDC321X__GPIO_H
2#define _RDC321X_GPIO_H 2#define ASM_X86__MACH_RDC321X__GPIO_H
3
4#include <linux/kernel.h>
3 5
4extern int rdc_gpio_get_value(unsigned gpio); 6extern int rdc_gpio_get_value(unsigned gpio);
5extern void rdc_gpio_set_value(unsigned gpio, int value); 7extern void rdc_gpio_set_value(unsigned gpio, int value);
@@ -18,6 +20,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
18 20
19static inline void gpio_free(unsigned gpio) 21static inline void gpio_free(unsigned gpio)
20{ 22{
23 might_sleep();
21 rdc_gpio_free(gpio); 24 rdc_gpio_free(gpio);
22} 25}
23 26
@@ -54,4 +57,4 @@ static inline int irq_to_gpio(unsigned irq)
54/* For cansleep */ 57/* For cansleep */
55#include <asm-generic/gpio.h> 58#include <asm-generic/gpio.h>
56 59
57#endif /* _RDC321X_GPIO_H_ */ 60#endif /* ASM_X86__MACH_RDC321X__GPIO_H */
diff --git a/include/asm-x86/mach-summit/mach_apicdef.h b/include/asm-x86/mach-summit/mach_apicdef.h
deleted file mode 100644
index a58ab5a75c8c..000000000000
--- a/include/asm-x86/mach-summit/mach_apicdef.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ASM_MACH_APICDEF_H
2#define __ASM_MACH_APICDEF_H
3
4#define APIC_ID_MASK (0xFF<<24)
5
6static inline unsigned get_apic_id(unsigned long x)
7{
8 return (((x)>>24)&0xFF);
9}
10
11#define GET_APIC_ID(x) get_apic_id(x)
12
13#endif
diff --git a/include/asm-x86/math_emu.h b/include/asm-x86/math_emu.h
index 9bf4ae93ab10..5768d8e95c8c 100644
--- a/include/asm-x86/math_emu.h
+++ b/include/asm-x86/math_emu.h
@@ -1,5 +1,5 @@
1#ifndef _I386_MATH_EMU_H 1#ifndef ASM_X86__MATH_EMU_H
2#define _I386_MATH_EMU_H 2#define ASM_X86__MATH_EMU_H
3 3
4/* This structure matches the layout of the data saved to the stack 4/* This structure matches the layout of the data saved to the stack
5 following a device-not-present interrupt, part of it saved 5 following a device-not-present interrupt, part of it saved
@@ -28,4 +28,4 @@ struct info {
28 long ___vm86_fs; 28 long ___vm86_fs;
29 long ___vm86_gs; 29 long ___vm86_gs;
30}; 30};
31#endif 31#endif /* ASM_X86__MATH_EMU_H */
diff --git a/include/asm-x86/mc146818rtc.h b/include/asm-x86/mc146818rtc.h
index daf1ccde77af..a995f33176cd 100644
--- a/include/asm-x86/mc146818rtc.h
+++ b/include/asm-x86/mc146818rtc.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * Machine dependent access functions for RTC registers. 2 * Machine dependent access functions for RTC registers.
3 */ 3 */
4#ifndef _ASM_MC146818RTC_H 4#ifndef ASM_X86__MC146818RTC_H
5#define _ASM_MC146818RTC_H 5#define ASM_X86__MC146818RTC_H
6 6
7#include <asm/io.h> 7#include <asm/io.h>
8#include <asm/system.h> 8#include <asm/system.h>
@@ -101,4 +101,4 @@ extern unsigned long mach_get_cmos_time(void);
101 101
102#define RTC_IRQ 8 102#define RTC_IRQ 8
103 103
104#endif /* _ASM_MC146818RTC_H */ 104#endif /* ASM_X86__MC146818RTC_H */
diff --git a/include/asm-x86/mca.h b/include/asm-x86/mca.h
index 09adf2eac4dc..60d1ed287b13 100644
--- a/include/asm-x86/mca.h
+++ b/include/asm-x86/mca.h
@@ -1,8 +1,8 @@
1/* -*- mode: c; c-basic-offset: 8 -*- */ 1/* -*- mode: c; c-basic-offset: 8 -*- */
2 2
3/* Platform specific MCA defines */ 3/* Platform specific MCA defines */
4#ifndef _ASM_MCA_H 4#ifndef ASM_X86__MCA_H
5#define _ASM_MCA_H 5#define ASM_X86__MCA_H
6 6
7/* Maximal number of MCA slots - actually, some machines have less, but 7/* Maximal number of MCA slots - actually, some machines have less, but
8 * they all have sufficient number of POS registers to cover 8. 8 * they all have sufficient number of POS registers to cover 8.
@@ -40,4 +40,4 @@
40 */ 40 */
41#define MCA_NUMADAPTERS (MCA_MAX_SLOT_NR+3) 41#define MCA_NUMADAPTERS (MCA_MAX_SLOT_NR+3)
42 42
43#endif 43#endif /* ASM_X86__MCA_H */
diff --git a/include/asm-x86/mca_dma.h b/include/asm-x86/mca_dma.h
index c3dca6edc6b1..49f22be237d2 100644
--- a/include/asm-x86/mca_dma.h
+++ b/include/asm-x86/mca_dma.h
@@ -1,5 +1,5 @@
1#ifndef MCA_DMA_H 1#ifndef ASM_X86__MCA_DMA_H
2#define MCA_DMA_H 2#define ASM_X86__MCA_DMA_H
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5#include <linux/ioport.h> 5#include <linux/ioport.h>
@@ -198,4 +198,4 @@ static inline void mca_set_dma_mode(unsigned int dmanr, unsigned int mode)
198 outb(mode, MCA_DMA_REG_EXE); 198 outb(mode, MCA_DMA_REG_EXE);
199} 199}
200 200
201#endif /* MCA_DMA_H */ 201#endif /* ASM_X86__MCA_DMA_H */
diff --git a/include/asm-x86/mce.h b/include/asm-x86/mce.h
index 94f1fd79e22a..036133eaf744 100644
--- a/include/asm-x86/mce.h
+++ b/include/asm-x86/mce.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_MCE_H 1#ifndef ASM_X86__MCE_H
2#define _ASM_X86_MCE_H 2#define ASM_X86__MCE_H
3 3
4#ifdef __x86_64__ 4#ifdef __x86_64__
5 5
@@ -92,6 +92,7 @@ extern int mce_disabled;
92 92
93void mce_log(struct mce *m); 93void mce_log(struct mce *m);
94DECLARE_PER_CPU(struct sys_device, device_mce); 94DECLARE_PER_CPU(struct sys_device, device_mce);
95extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
95 96
96#ifdef CONFIG_X86_MCE_INTEL 97#ifdef CONFIG_X86_MCE_INTEL
97void mce_intel_feature_init(struct cpuinfo_x86 *c); 98void mce_intel_feature_init(struct cpuinfo_x86 *c);
@@ -126,4 +127,4 @@ extern void restart_mce(void);
126 127
127#endif /* __KERNEL__ */ 128#endif /* __KERNEL__ */
128 129
129#endif 130#endif /* ASM_X86__MCE_H */
diff --git a/include/asm-x86/microcode.h b/include/asm-x86/microcode.h
new file mode 100644
index 000000000000..62c793bb70ca
--- /dev/null
+++ b/include/asm-x86/microcode.h
@@ -0,0 +1,47 @@
1#ifndef ASM_X86__MICROCODE_H
2#define ASM_X86__MICROCODE_H
3
4struct cpu_signature {
5 unsigned int sig;
6 unsigned int pf;
7 unsigned int rev;
8};
9
10struct device;
11
12struct microcode_ops {
13 int (*request_microcode_user) (int cpu, const void __user *buf, size_t size);
14 int (*request_microcode_fw) (int cpu, struct device *device);
15
16 void (*apply_microcode) (int cpu);
17
18 int (*collect_cpu_info) (int cpu, struct cpu_signature *csig);
19 void (*microcode_fini_cpu) (int cpu);
20};
21
22struct ucode_cpu_info {
23 struct cpu_signature cpu_sig;
24 int valid;
25 void *mc;
26};
27extern struct ucode_cpu_info ucode_cpu_info[];
28
29#ifdef CONFIG_MICROCODE_INTEL
30extern struct microcode_ops * __init init_intel_microcode(void);
31#else
32static inline struct microcode_ops * __init init_intel_microcode(void)
33{
34 return NULL;
35}
36#endif /* CONFIG_MICROCODE_INTEL */
37
38#ifdef CONFIG_MICROCODE_AMD
39extern struct microcode_ops * __init init_amd_microcode(void);
40#else
41static inline struct microcode_ops * __init init_amd_microcode(void)
42{
43 return NULL;
44}
45#endif
46
47#endif /* ASM_X86__MICROCODE_H */
diff --git a/include/asm-x86/mman.h b/include/asm-x86/mman.h
index 90bc4108a4fd..4ef28e6de383 100644
--- a/include/asm-x86/mman.h
+++ b/include/asm-x86/mman.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_MMAN_H 1#ifndef ASM_X86__MMAN_H
2#define _ASM_X86_MMAN_H 2#define ASM_X86__MMAN_H
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman.h>
5 5
@@ -17,4 +17,4 @@
17#define MCL_CURRENT 1 /* lock all current mappings */ 17#define MCL_CURRENT 1 /* lock all current mappings */
18#define MCL_FUTURE 2 /* lock all future mappings */ 18#define MCL_FUTURE 2 /* lock all future mappings */
19 19
20#endif /* _ASM_X86_MMAN_H */ 20#endif /* ASM_X86__MMAN_H */
diff --git a/include/asm-x86/mmconfig.h b/include/asm-x86/mmconfig.h
index e293ab81e850..fb79b1cf5d07 100644
--- a/include/asm-x86/mmconfig.h
+++ b/include/asm-x86/mmconfig.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_MMCONFIG_H 1#ifndef ASM_X86__MMCONFIG_H
2#define _ASM_MMCONFIG_H 2#define ASM_X86__MMCONFIG_H
3 3
4#ifdef CONFIG_PCI_MMCONFIG 4#ifdef CONFIG_PCI_MMCONFIG
5extern void __cpuinit fam10h_check_enable_mmcfg(void); 5extern void __cpuinit fam10h_check_enable_mmcfg(void);
@@ -9,4 +9,4 @@ static inline void fam10h_check_enable_mmcfg(void) { }
9static inline void check_enable_amd_mmconf_dmi(void) { } 9static inline void check_enable_amd_mmconf_dmi(void) { }
10#endif 10#endif
11 11
12#endif 12#endif /* ASM_X86__MMCONFIG_H */
diff --git a/include/asm-x86/mmu.h b/include/asm-x86/mmu.h
index 00e88679e11f..9d5aff14334a 100644
--- a/include/asm-x86/mmu.h
+++ b/include/asm-x86/mmu.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_MMU_H 1#ifndef ASM_X86__MMU_H
2#define _ASM_X86_MMU_H 2#define ASM_X86__MMU_H
3 3
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <linux/mutex.h> 5#include <linux/mutex.h>
@@ -7,14 +7,9 @@
7/* 7/*
8 * The x86 doesn't have a mmu context, but 8 * The x86 doesn't have a mmu context, but
9 * we put the segment information here. 9 * we put the segment information here.
10 *
11 * cpu_vm_mask is used to optimize ldt flushing.
12 */ 10 */
13typedef struct { 11typedef struct {
14 void *ldt; 12 void *ldt;
15#ifdef CONFIG_X86_64
16 rwlock_t ldtlock;
17#endif
18 int size; 13 int size;
19 struct mutex lock; 14 struct mutex lock;
20 void *vdso; 15 void *vdso;
@@ -28,4 +23,4 @@ static inline void leave_mm(int cpu)
28} 23}
29#endif 24#endif
30 25
31#endif /* _ASM_X86_MMU_H */ 26#endif /* ASM_X86__MMU_H */
diff --git a/include/asm-x86/mmu_context.h b/include/asm-x86/mmu_context.h
index fac57014e7c6..8ec940bfd079 100644
--- a/include/asm-x86/mmu_context.h
+++ b/include/asm-x86/mmu_context.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_X86_MMU_CONTEXT_H 1#ifndef ASM_X86__MMU_CONTEXT_H
2#define __ASM_X86_MMU_CONTEXT_H 2#define ASM_X86__MMU_CONTEXT_H
3 3
4#include <asm/desc.h> 4#include <asm/desc.h>
5#include <asm/atomic.h> 5#include <asm/atomic.h>
@@ -34,4 +34,4 @@ do { \
34} while (0); 34} while (0);
35 35
36 36
37#endif /* __ASM_X86_MMU_CONTEXT_H */ 37#endif /* ASM_X86__MMU_CONTEXT_H */
diff --git a/include/asm-x86/mmu_context_32.h b/include/asm-x86/mmu_context_32.h
index 824fc575c6d8..cce6f6e4afd6 100644
--- a/include/asm-x86/mmu_context_32.h
+++ b/include/asm-x86/mmu_context_32.h
@@ -1,5 +1,5 @@
1#ifndef __I386_SCHED_H 1#ifndef ASM_X86__MMU_CONTEXT_32_H
2#define __I386_SCHED_H 2#define ASM_X86__MMU_CONTEXT_32_H
3 3
4static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) 4static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
5{ 5{
@@ -53,4 +53,4 @@ static inline void switch_mm(struct mm_struct *prev,
53#define deactivate_mm(tsk, mm) \ 53#define deactivate_mm(tsk, mm) \
54 asm("movl %0,%%gs": :"r" (0)); 54 asm("movl %0,%%gs": :"r" (0));
55 55
56#endif 56#endif /* ASM_X86__MMU_CONTEXT_32_H */
diff --git a/include/asm-x86/mmu_context_64.h b/include/asm-x86/mmu_context_64.h
index c7000634ccae..26758673c828 100644
--- a/include/asm-x86/mmu_context_64.h
+++ b/include/asm-x86/mmu_context_64.h
@@ -1,5 +1,5 @@
1#ifndef __X86_64_MMU_CONTEXT_H 1#ifndef ASM_X86__MMU_CONTEXT_64_H
2#define __X86_64_MMU_CONTEXT_H 2#define ASM_X86__MMU_CONTEXT_64_H
3 3
4#include <asm/pda.h> 4#include <asm/pda.h>
5 5
@@ -51,4 +51,4 @@ do { \
51 asm volatile("movl %0,%%fs"::"r"(0)); \ 51 asm volatile("movl %0,%%fs"::"r"(0)); \
52} while (0) 52} while (0)
53 53
54#endif 54#endif /* ASM_X86__MMU_CONTEXT_64_H */
diff --git a/include/asm-x86/mmx.h b/include/asm-x86/mmx.h
index 940881218ff8..2e7299bb3653 100644
--- a/include/asm-x86/mmx.h
+++ b/include/asm-x86/mmx.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_MMX_H 1#ifndef ASM_X86__MMX_H
2#define _ASM_MMX_H 2#define ASM_X86__MMX_H
3 3
4/* 4/*
5 * MMX 3Dnow! helper operations 5 * MMX 3Dnow! helper operations
@@ -11,4 +11,4 @@ extern void *_mmx_memcpy(void *to, const void *from, size_t size);
11extern void mmx_clear_page(void *page); 11extern void mmx_clear_page(void *page);
12extern void mmx_copy_page(void *to, void *from); 12extern void mmx_copy_page(void *to, void *from);
13 13
14#endif 14#endif /* ASM_X86__MMX_H */
diff --git a/include/asm-x86/mmzone_32.h b/include/asm-x86/mmzone_32.h
index 5862e6460658..121b65d61d86 100644
--- a/include/asm-x86/mmzone_32.h
+++ b/include/asm-x86/mmzone_32.h
@@ -3,8 +3,8 @@
3 * 3 *
4 */ 4 */
5 5
6#ifndef _ASM_MMZONE_H_ 6#ifndef ASM_X86__MMZONE_32_H
7#define _ASM_MMZONE_H_ 7#define ASM_X86__MMZONE_32_H
8 8
9#include <asm/smp.h> 9#include <asm/smp.h>
10 10
@@ -131,4 +131,4 @@ static inline int pfn_valid(int pfn)
131}) 131})
132#endif /* CONFIG_NEED_MULTIPLE_NODES */ 132#endif /* CONFIG_NEED_MULTIPLE_NODES */
133 133
134#endif /* _ASM_MMZONE_H_ */ 134#endif /* ASM_X86__MMZONE_32_H */
diff --git a/include/asm-x86/mmzone_64.h b/include/asm-x86/mmzone_64.h
index 594bd0dc1d08..6480f3333b2a 100644
--- a/include/asm-x86/mmzone_64.h
+++ b/include/asm-x86/mmzone_64.h
@@ -1,13 +1,13 @@
1/* K8 NUMA support */ 1/* K8 NUMA support */
2/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */ 2/* Copyright 2002,2003 by Andi Kleen, SuSE Labs */
3/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */ 3/* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */
4#ifndef _ASM_X86_64_MMZONE_H 4#ifndef ASM_X86__MMZONE_64_H
5#define _ASM_X86_64_MMZONE_H 1 5#define ASM_X86__MMZONE_64_H
6 6
7 7
8#ifdef CONFIG_NUMA 8#ifdef CONFIG_NUMA
9 9
10#define VIRTUAL_BUG_ON(x) 10#include <linux/mmdebug.h>
11 11
12#include <asm/smp.h> 12#include <asm/smp.h>
13 13
@@ -29,7 +29,6 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
29{ 29{
30 unsigned nid; 30 unsigned nid;
31 VIRTUAL_BUG_ON(!memnodemap); 31 VIRTUAL_BUG_ON(!memnodemap);
32 VIRTUAL_BUG_ON((addr >> memnode_shift) >= memnodemapsize);
33 nid = memnodemap[addr >> memnode_shift]; 32 nid = memnodemap[addr >> memnode_shift];
34 VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); 33 VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]);
35 return nid; 34 return nid;
@@ -49,4 +48,4 @@ extern int early_pfn_to_nid(unsigned long pfn);
49#endif 48#endif
50 49
51#endif 50#endif
52#endif 51#endif /* ASM_X86__MMZONE_64_H */
diff --git a/include/asm-x86/module.h b/include/asm-x86/module.h
index bfedb247871c..864f2005fc1d 100644
--- a/include/asm-x86/module.h
+++ b/include/asm-x86/module.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_MODULE_H 1#ifndef ASM_X86__MODULE_H
2#define _ASM_MODULE_H 2#define ASM_X86__MODULE_H
3 3
4/* x86_32/64 are simple */ 4/* x86_32/64 are simple */
5struct mod_arch_specific {}; 5struct mod_arch_specific {};
@@ -52,8 +52,6 @@ struct mod_arch_specific {};
52#define MODULE_PROC_FAMILY "EFFICEON " 52#define MODULE_PROC_FAMILY "EFFICEON "
53#elif defined CONFIG_MWINCHIPC6 53#elif defined CONFIG_MWINCHIPC6
54#define MODULE_PROC_FAMILY "WINCHIPC6 " 54#define MODULE_PROC_FAMILY "WINCHIPC6 "
55#elif defined CONFIG_MWINCHIP2
56#define MODULE_PROC_FAMILY "WINCHIP2 "
57#elif defined CONFIG_MWINCHIP3D 55#elif defined CONFIG_MWINCHIP3D
58#define MODULE_PROC_FAMILY "WINCHIP3D " 56#define MODULE_PROC_FAMILY "WINCHIP3D "
59#elif defined CONFIG_MCYRIXIII 57#elif defined CONFIG_MCYRIXIII
@@ -79,4 +77,4 @@ struct mod_arch_specific {};
79# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_STACKSIZE 77# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_STACKSIZE
80#endif 78#endif
81 79
82#endif /* _ASM_MODULE_H */ 80#endif /* ASM_X86__MODULE_H */
diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h
index b6995e567fcc..be2241a818f1 100644
--- a/include/asm-x86/mpspec.h
+++ b/include/asm-x86/mpspec.h
@@ -1,15 +1,16 @@
1#ifndef _AM_X86_MPSPEC_H 1#ifndef ASM_X86__MPSPEC_H
2#define _AM_X86_MPSPEC_H 2#define ASM_X86__MPSPEC_H
3 3
4#include <linux/init.h> 4#include <linux/init.h>
5 5
6#include <asm/mpspec_def.h> 6#include <asm/mpspec_def.h>
7 7
8extern int apic_version[MAX_APICS];
9
8#ifdef CONFIG_X86_32 10#ifdef CONFIG_X86_32
9#include <mach_mpspec.h> 11#include <mach_mpspec.h>
10 12
11extern unsigned int def_to_bigsmp; 13extern unsigned int def_to_bigsmp;
12extern int apic_version[MAX_APICS];
13extern u8 apicid_2_node[]; 14extern u8 apicid_2_node[];
14extern int pic_mode; 15extern int pic_mode;
15 16
@@ -141,4 +142,4 @@ static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map)
141 142
142extern physid_mask_t phys_cpu_present_map; 143extern physid_mask_t phys_cpu_present_map;
143 144
144#endif 145#endif /* ASM_X86__MPSPEC_H */
diff --git a/include/asm-x86/mpspec_def.h b/include/asm-x86/mpspec_def.h
index 38d1e73b49e4..79166b048012 100644
--- a/include/asm-x86/mpspec_def.h
+++ b/include/asm-x86/mpspec_def.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MPSPEC_DEF_H 1#ifndef ASM_X86__MPSPEC_DEF_H
2#define __ASM_MPSPEC_DEF_H 2#define ASM_X86__MPSPEC_DEF_H
3 3
4/* 4/*
5 * Structure definitions for SMP machines following the 5 * Structure definitions for SMP machines following the
@@ -177,4 +177,4 @@ enum mp_bustype {
177 MP_BUS_PCI, 177 MP_BUS_PCI,
178 MP_BUS_MCA, 178 MP_BUS_MCA,
179}; 179};
180#endif 180#endif /* ASM_X86__MPSPEC_DEF_H */
diff --git a/include/asm-x86/msgbuf.h b/include/asm-x86/msgbuf.h
index 7e4e9481f51c..1b538c907a3d 100644
--- a/include/asm-x86/msgbuf.h
+++ b/include/asm-x86/msgbuf.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_MSGBUF_H 1#ifndef ASM_X86__MSGBUF_H
2#define _ASM_X86_MSGBUF_H 2#define ASM_X86__MSGBUF_H
3 3
4/* 4/*
5 * The msqid64_ds structure for i386 architecture. 5 * The msqid64_ds structure for i386 architecture.
@@ -36,4 +36,4 @@ struct msqid64_ds {
36 unsigned long __unused5; 36 unsigned long __unused5;
37}; 37};
38 38
39#endif /* _ASM_X86_MSGBUF_H */ 39#endif /* ASM_X86__MSGBUF_H */
diff --git a/include/asm-x86/msidef.h b/include/asm-x86/msidef.h
index 296f29ce426d..ed9190246876 100644
--- a/include/asm-x86/msidef.h
+++ b/include/asm-x86/msidef.h
@@ -1,5 +1,5 @@
1#ifndef ASM_MSIDEF_H 1#ifndef ASM_X86__MSIDEF_H
2#define ASM_MSIDEF_H 2#define ASM_X86__MSIDEF_H
3 3
4/* 4/*
5 * Constants for Intel APIC based MSI messages. 5 * Constants for Intel APIC based MSI messages.
@@ -48,4 +48,8 @@
48#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \ 48#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \
49 MSI_ADDR_DEST_ID_MASK) 49 MSI_ADDR_DEST_ID_MASK)
50 50
51#endif /* ASM_MSIDEF_H */ 51#define MSI_ADDR_IR_EXT_INT (1 << 4)
52#define MSI_ADDR_IR_SHV (1 << 3)
53#define MSI_ADDR_IR_INDEX1(index) ((index & 0x8000) >> 13)
54#define MSI_ADDR_IR_INDEX2(index) ((index & 0x7fff) << 5)
55#endif /* ASM_X86__MSIDEF_H */
diff --git a/include/asm-x86/msr-index.h b/include/asm-x86/msr-index.h
index 44bce773012e..dabd10f0bbee 100644
--- a/include/asm-x86/msr-index.h
+++ b/include/asm-x86/msr-index.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MSR_INDEX_H 1#ifndef ASM_X86__MSR_INDEX_H
2#define __ASM_MSR_INDEX_H 2#define ASM_X86__MSR_INDEX_H
3 3
4/* CPU model specific register (MSR) numbers */ 4/* CPU model specific register (MSR) numbers */
5 5
@@ -176,6 +176,10 @@
176#define MSR_IA32_TSC 0x00000010 176#define MSR_IA32_TSC 0x00000010
177#define MSR_IA32_PLATFORM_ID 0x00000017 177#define MSR_IA32_PLATFORM_ID 0x00000017
178#define MSR_IA32_EBL_CR_POWERON 0x0000002a 178#define MSR_IA32_EBL_CR_POWERON 0x0000002a
179#define MSR_IA32_FEATURE_CONTROL 0x0000003a
180
181#define FEATURE_CONTROL_LOCKED (1<<0)
182#define FEATURE_CONTROL_VMXON_ENABLED (1<<2)
179 183
180#define MSR_IA32_APICBASE 0x0000001b 184#define MSR_IA32_APICBASE 0x0000001b
181#define MSR_IA32_APICBASE_BSP (1<<8) 185#define MSR_IA32_APICBASE_BSP (1<<8)
@@ -310,4 +314,19 @@
310/* Geode defined MSRs */ 314/* Geode defined MSRs */
311#define MSR_GEODE_BUSCONT_CONF0 0x00001900 315#define MSR_GEODE_BUSCONT_CONF0 0x00001900
312 316
313#endif /* __ASM_MSR_INDEX_H */ 317/* Intel VT MSRs */
318#define MSR_IA32_VMX_BASIC 0x00000480
319#define MSR_IA32_VMX_PINBASED_CTLS 0x00000481
320#define MSR_IA32_VMX_PROCBASED_CTLS 0x00000482
321#define MSR_IA32_VMX_EXIT_CTLS 0x00000483
322#define MSR_IA32_VMX_ENTRY_CTLS 0x00000484
323#define MSR_IA32_VMX_MISC 0x00000485
324#define MSR_IA32_VMX_CR0_FIXED0 0x00000486
325#define MSR_IA32_VMX_CR0_FIXED1 0x00000487
326#define MSR_IA32_VMX_CR4_FIXED0 0x00000488
327#define MSR_IA32_VMX_CR4_FIXED1 0x00000489
328#define MSR_IA32_VMX_VMCS_ENUM 0x0000048a
329#define MSR_IA32_VMX_PROCBASED_CTLS2 0x0000048b
330#define MSR_IA32_VMX_EPT_VPID_CAP 0x0000048c
331
332#endif /* ASM_X86__MSR_INDEX_H */
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index ca110ee73f07..530af1f6389e 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_X86_MSR_H_ 1#ifndef ASM_X86__MSR_H
2#define __ASM_X86_MSR_H_ 2#define ASM_X86__MSR_H
3 3
4#include <asm/msr-index.h> 4#include <asm/msr-index.h>
5 5
@@ -52,6 +52,22 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
52{ 52{
53 DECLARE_ARGS(val, low, high); 53 DECLARE_ARGS(val, low, high);
54 54
55 asm volatile("2: rdmsr ; xor %[err],%[err]\n"
56 "1:\n\t"
57 ".section .fixup,\"ax\"\n\t"
58 "3: mov %[fault],%[err] ; jmp 1b\n\t"
59 ".previous\n\t"
60 _ASM_EXTABLE(2b, 3b)
61 : [err] "=r" (*err), EAX_EDX_RET(val, low, high)
62 : "c" (msr), [fault] "i" (-EFAULT));
63 return EAX_EDX_VAL(val, low, high);
64}
65
66static inline unsigned long long native_read_msr_amd_safe(unsigned int msr,
67 int *err)
68{
69 DECLARE_ARGS(val, low, high);
70
55 asm volatile("2: rdmsr ; xor %0,%0\n" 71 asm volatile("2: rdmsr ; xor %0,%0\n"
56 "1:\n\t" 72 "1:\n\t"
57 ".section .fixup,\"ax\"\n\t" 73 ".section .fixup,\"ax\"\n\t"
@@ -59,7 +75,7 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
59 ".previous\n\t" 75 ".previous\n\t"
60 _ASM_EXTABLE(2b, 3b) 76 _ASM_EXTABLE(2b, 3b)
61 : "=r" (*err), EAX_EDX_RET(val, low, high) 77 : "=r" (*err), EAX_EDX_RET(val, low, high)
62 : "c" (msr), "i" (-EFAULT)); 78 : "c" (msr), "D" (0x9c5a203a), "i" (-EFAULT));
63 return EAX_EDX_VAL(val, low, high); 79 return EAX_EDX_VAL(val, low, high);
64} 80}
65 81
@@ -73,15 +89,15 @@ static inline int native_write_msr_safe(unsigned int msr,
73 unsigned low, unsigned high) 89 unsigned low, unsigned high)
74{ 90{
75 int err; 91 int err;
76 asm volatile("2: wrmsr ; xor %0,%0\n" 92 asm volatile("2: wrmsr ; xor %[err],%[err]\n"
77 "1:\n\t" 93 "1:\n\t"
78 ".section .fixup,\"ax\"\n\t" 94 ".section .fixup,\"ax\"\n\t"
79 "3: mov %4,%0 ; jmp 1b\n\t" 95 "3: mov %[fault],%[err] ; jmp 1b\n\t"
80 ".previous\n\t" 96 ".previous\n\t"
81 _ASM_EXTABLE(2b, 3b) 97 _ASM_EXTABLE(2b, 3b)
82 : "=a" (err) 98 : [err] "=a" (err)
83 : "c" (msr), "0" (low), "d" (high), 99 : "c" (msr), "0" (low), "d" (high),
84 "i" (-EFAULT) 100 [fault] "i" (-EFAULT)
85 : "memory"); 101 : "memory");
86 return err; 102 return err;
87} 103}
@@ -158,6 +174,13 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p)
158 *p = native_read_msr_safe(msr, &err); 174 *p = native_read_msr_safe(msr, &err);
159 return err; 175 return err;
160} 176}
177static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p)
178{
179 int err;
180
181 *p = native_read_msr_amd_safe(msr, &err);
182 return err;
183}
161 184
162#define rdtscl(low) \ 185#define rdtscl(low) \
163 ((low) = (u32)native_read_tsc()) 186 ((low) = (u32)native_read_tsc())
@@ -192,19 +215,20 @@ do { \
192#define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0) 215#define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0)
193 216
194#ifdef CONFIG_SMP 217#ifdef CONFIG_SMP
195void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 218int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
196void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 219int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
197int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 220int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
198
199int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 221int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
200#else /* CONFIG_SMP */ 222#else /* CONFIG_SMP */
201static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 223static inline int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
202{ 224{
203 rdmsr(msr_no, *l, *h); 225 rdmsr(msr_no, *l, *h);
226 return 0;
204} 227}
205static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) 228static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
206{ 229{
207 wrmsr(msr_no, l, h); 230 wrmsr(msr_no, l, h);
231 return 0;
208} 232}
209static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, 233static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no,
210 u32 *l, u32 *h) 234 u32 *l, u32 *h)
@@ -220,4 +244,4 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
220#endif /* __KERNEL__ */ 244#endif /* __KERNEL__ */
221 245
222 246
223#endif 247#endif /* ASM_X86__MSR_H */
diff --git a/include/asm-x86/mtrr.h b/include/asm-x86/mtrr.h
index a69a01a51729..23a7f83da953 100644
--- a/include/asm-x86/mtrr.h
+++ b/include/asm-x86/mtrr.h
@@ -20,8 +20,8 @@
20 The postal address is: 20 The postal address is:
21 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia. 21 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
22*/ 22*/
23#ifndef _ASM_X86_MTRR_H 23#ifndef ASM_X86__MTRR_H
24#define _ASM_X86_MTRR_H 24#define ASM_X86__MTRR_H
25 25
26#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
@@ -170,4 +170,4 @@ struct mtrr_gentry32 {
170 170
171#endif /* __KERNEL__ */ 171#endif /* __KERNEL__ */
172 172
173#endif /* _ASM_X86_MTRR_H */ 173#endif /* ASM_X86__MTRR_H */
diff --git a/include/asm-x86/mutex_32.h b/include/asm-x86/mutex_32.h
index 73e928ef5f03..25c16d8ba3c7 100644
--- a/include/asm-x86/mutex_32.h
+++ b/include/asm-x86/mutex_32.h
@@ -6,8 +6,8 @@
6 * 6 *
7 * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> 7 * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
8 */ 8 */
9#ifndef _ASM_MUTEX_H 9#ifndef ASM_X86__MUTEX_32_H
10#define _ASM_MUTEX_H 10#define ASM_X86__MUTEX_32_H
11 11
12#include <asm/alternative.h> 12#include <asm/alternative.h>
13 13
@@ -122,4 +122,4 @@ static inline int __mutex_fastpath_trylock(atomic_t *count,
122#endif 122#endif
123} 123}
124 124
125#endif 125#endif /* ASM_X86__MUTEX_32_H */
diff --git a/include/asm-x86/mutex_64.h b/include/asm-x86/mutex_64.h
index f3fae9becb38..918ba21ab9d9 100644
--- a/include/asm-x86/mutex_64.h
+++ b/include/asm-x86/mutex_64.h
@@ -6,8 +6,8 @@
6 * 6 *
7 * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> 7 * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
8 */ 8 */
9#ifndef _ASM_MUTEX_H 9#ifndef ASM_X86__MUTEX_64_H
10#define _ASM_MUTEX_H 10#define ASM_X86__MUTEX_64_H
11 11
12/** 12/**
13 * __mutex_fastpath_lock - decrement and call function if negative 13 * __mutex_fastpath_lock - decrement and call function if negative
@@ -97,4 +97,4 @@ static inline int __mutex_fastpath_trylock(atomic_t *count,
97 return 0; 97 return 0;
98} 98}
99 99
100#endif 100#endif /* ASM_X86__MUTEX_64_H */
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h
index 21f8d0202a82..a53f829a97c5 100644
--- a/include/asm-x86/nmi.h
+++ b/include/asm-x86/nmi.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_NMI_H_ 1#ifndef ASM_X86__NMI_H
2#define _ASM_X86_NMI_H_ 2#define ASM_X86__NMI_H
3 3
4#include <linux/pm.h> 4#include <linux/pm.h>
5#include <asm/irq.h> 5#include <asm/irq.h>
@@ -15,10 +15,6 @@
15 */ 15 */
16int do_nmi_callback(struct pt_regs *regs, int cpu); 16int do_nmi_callback(struct pt_regs *regs, int cpu);
17 17
18#ifdef CONFIG_X86_64
19extern void default_do_nmi(struct pt_regs *);
20#endif
21
22extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); 18extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
23extern int check_nmi_watchdog(void); 19extern int check_nmi_watchdog(void);
24extern int nmi_watchdog_enabled; 20extern int nmi_watchdog_enabled;
@@ -34,6 +30,7 @@ extern void stop_apic_nmi_watchdog(void *);
34extern void disable_timer_nmi_watchdog(void); 30extern void disable_timer_nmi_watchdog(void);
35extern void enable_timer_nmi_watchdog(void); 31extern void enable_timer_nmi_watchdog(void);
36extern int nmi_watchdog_tick(struct pt_regs *regs, unsigned reason); 32extern int nmi_watchdog_tick(struct pt_regs *regs, unsigned reason);
33extern void cpu_nmi_set_wd_enabled(void);
37 34
38extern atomic_t nmi_active; 35extern atomic_t nmi_active;
39extern unsigned int nmi_watchdog; 36extern unsigned int nmi_watchdog;
@@ -81,4 +78,4 @@ void enable_lapic_nmi_watchdog(void);
81void stop_nmi(void); 78void stop_nmi(void);
82void restart_nmi(void); 79void restart_nmi(void);
83 80
84#endif 81#endif /* ASM_X86__NMI_H */
diff --git a/include/asm-x86/nops.h b/include/asm-x86/nops.h
index ad0bedd10b89..ae742721ae73 100644
--- a/include/asm-x86/nops.h
+++ b/include/asm-x86/nops.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_NOPS_H 1#ifndef ASM_X86__NOPS_H
2#define _ASM_NOPS_H 1 2#define ASM_X86__NOPS_H
3 3
4/* Define nops for use with alternative() */ 4/* Define nops for use with alternative() */
5 5
@@ -115,4 +115,4 @@
115 115
116#define ASM_NOP_MAX 8 116#define ASM_NOP_MAX 8
117 117
118#endif 118#endif /* ASM_X86__NOPS_H */
diff --git a/include/asm-x86/numa_32.h b/include/asm-x86/numa_32.h
index 220d7b7707a0..44cb07855c5b 100644
--- a/include/asm-x86/numa_32.h
+++ b/include/asm-x86/numa_32.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_32_NUMA_H 1#ifndef ASM_X86__NUMA_32_H
2#define _ASM_X86_32_NUMA_H 1 2#define ASM_X86__NUMA_32_H
3 3
4extern int pxm_to_nid(int pxm); 4extern int pxm_to_nid(int pxm);
5extern void numa_remove_cpu(int cpu); 5extern void numa_remove_cpu(int cpu);
@@ -8,4 +8,4 @@ extern void numa_remove_cpu(int cpu);
8extern void set_highmem_pages_init(void); 8extern void set_highmem_pages_init(void);
9#endif 9#endif
10 10
11#endif /* _ASM_X86_32_NUMA_H */ 11#endif /* ASM_X86__NUMA_32_H */
diff --git a/include/asm-x86/numa_64.h b/include/asm-x86/numa_64.h
index 3830094434a9..15c990395b02 100644
--- a/include/asm-x86/numa_64.h
+++ b/include/asm-x86/numa_64.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X8664_NUMA_H 1#ifndef ASM_X86__NUMA_64_H
2#define _ASM_X8664_NUMA_H 1 2#define ASM_X86__NUMA_64_H
3 3
4#include <linux/nodemask.h> 4#include <linux/nodemask.h>
5#include <asm/apicdef.h> 5#include <asm/apicdef.h>
@@ -40,4 +40,4 @@ static inline void numa_add_cpu(int cpu, int node) { }
40static inline void numa_remove_cpu(int cpu) { } 40static inline void numa_remove_cpu(int cpu) { }
41#endif 41#endif
42 42
43#endif 43#endif /* ASM_X86__NUMA_64_H */
diff --git a/include/asm-x86/numaq.h b/include/asm-x86/numaq.h
index 34b92d581fa3..124bf7d4b70a 100644
--- a/include/asm-x86/numaq.h
+++ b/include/asm-x86/numaq.h
@@ -23,8 +23,8 @@
23 * Send feedback to <gone@us.ibm.com> 23 * Send feedback to <gone@us.ibm.com>
24 */ 24 */
25 25
26#ifndef NUMAQ_H 26#ifndef ASM_X86__NUMAQ_H
27#define NUMAQ_H 27#define ASM_X86__NUMAQ_H
28 28
29#ifdef CONFIG_X86_NUMAQ 29#ifdef CONFIG_X86_NUMAQ
30 30
@@ -165,5 +165,5 @@ static inline int get_memcfg_numaq(void)
165 return 0; 165 return 0;
166} 166}
167#endif /* CONFIG_X86_NUMAQ */ 167#endif /* CONFIG_X86_NUMAQ */
168#endif /* NUMAQ_H */ 168#endif /* ASM_X86__NUMAQ_H */
169 169
diff --git a/include/asm-x86/mach-numaq/mach_apic.h b/include/asm-x86/numaq/apic.h
index d802465e026a..a8344ba6ea15 100644
--- a/include/asm-x86/mach-numaq/mach_apic.h
+++ b/include/asm-x86/numaq/apic.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_APIC_H 1#ifndef __ASM_NUMAQ_APIC_H
2#define __ASM_MACH_APIC_H 2#define __ASM_NUMAQ_APIC_H
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5#include <linux/mmzone.h> 5#include <linux/mmzone.h>
@@ -135,4 +135,4 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
135 return cpuid_apic >> index_msb; 135 return cpuid_apic >> index_msb;
136} 136}
137 137
138#endif /* __ASM_MACH_APIC_H */ 138#endif /* __ASM_NUMAQ_APIC_H */
diff --git a/include/asm-x86/mach-numaq/mach_apicdef.h b/include/asm-x86/numaq/apicdef.h
index bf439d0690f5..e012a46cc22a 100644
--- a/include/asm-x86/mach-numaq/mach_apicdef.h
+++ b/include/asm-x86/numaq/apicdef.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_APICDEF_H 1#ifndef __ASM_NUMAQ_APICDEF_H
2#define __ASM_MACH_APICDEF_H 2#define __ASM_NUMAQ_APICDEF_H
3 3
4 4
5#define APIC_ID_MASK (0xF<<24) 5#define APIC_ID_MASK (0xF<<24)
diff --git a/include/asm-x86/mach-numaq/mach_ipi.h b/include/asm-x86/numaq/ipi.h
index c6044488e9e6..935588d286cf 100644
--- a/include/asm-x86/mach-numaq/mach_ipi.h
+++ b/include/asm-x86/numaq/ipi.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_NUMAQ_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_NUMAQ_IPI_H
3 3
4void send_IPI_mask_sequence(cpumask_t, int vector); 4void send_IPI_mask_sequence(cpumask_t, int vector);
5 5
@@ -22,4 +22,4 @@ static inline void send_IPI_all(int vector)
22 send_IPI_mask(cpu_online_map, vector); 22 send_IPI_mask(cpu_online_map, vector);
23} 23}
24 24
25#endif /* __ASM_MACH_IPI_H */ 25#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/include/asm-x86/mach-numaq/mach_mpparse.h b/include/asm-x86/numaq/mpparse.h
index 626aef6b155f..252292e077b6 100644
--- a/include/asm-x86/mach-numaq/mach_mpparse.h
+++ b/include/asm-x86/numaq/mpparse.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_MACH_MPPARSE_H 1#ifndef __ASM_NUMAQ_MPPARSE_H
2#define __ASM_MACH_MPPARSE_H 2#define __ASM_NUMAQ_MPPARSE_H
3 3
4extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, 4extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem,
5 char *productid); 5 char *productid);
6 6
7#endif /* __ASM_MACH_MPPARSE_H */ 7#endif /* __ASM_NUMAQ_MPPARSE_H */
diff --git a/include/asm-x86/mach-numaq/mach_wakecpu.h b/include/asm-x86/numaq/wakecpu.h
index 00530041a991..c577bda5b1c5 100644
--- a/include/asm-x86/mach-numaq/mach_wakecpu.h
+++ b/include/asm-x86/numaq/wakecpu.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_WAKECPU_H 1#ifndef __ASM_NUMAQ_WAKECPU_H
2#define __ASM_MACH_WAKECPU_H 2#define __ASM_NUMAQ_WAKECPU_H
3 3
4/* This file copes with machines that wakeup secondary CPUs by NMIs */ 4/* This file copes with machines that wakeup secondary CPUs by NMIs */
5 5
@@ -40,4 +40,4 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
40 40
41#define inquire_remote_apic(apicid) {} 41#define inquire_remote_apic(apicid) {}
42 42
43#endif /* __ASM_MACH_WAKECPU_H */ 43#endif /* __ASM_NUMAQ_WAKECPU_H */
diff --git a/include/asm-x86/olpc.h b/include/asm-x86/olpc.h
index 97d47133486f..d7328b1a05c1 100644
--- a/include/asm-x86/olpc.h
+++ b/include/asm-x86/olpc.h
@@ -1,7 +1,7 @@
1/* OLPC machine specific definitions */ 1/* OLPC machine specific definitions */
2 2
3#ifndef ASM_OLPC_H_ 3#ifndef ASM_X86__OLPC_H
4#define ASM_OLPC_H_ 4#define ASM_X86__OLPC_H
5 5
6#include <asm/geode.h> 6#include <asm/geode.h>
7 7
@@ -129,4 +129,4 @@ extern int olpc_ec_mask_unset(uint8_t bits);
129#define OLPC_GPIO_LID geode_gpio(26) 129#define OLPC_GPIO_LID geode_gpio(26)
130#define OLPC_GPIO_ECSCI geode_gpio(27) 130#define OLPC_GPIO_ECSCI geode_gpio(27)
131 131
132#endif 132#endif /* ASM_X86__OLPC_H */
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h
index 49982110e4d9..d4f1d5791fc1 100644
--- a/include/asm-x86/page.h
+++ b/include/asm-x86/page.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PAGE_H 1#ifndef ASM_X86__PAGE_H
2#define _ASM_X86_PAGE_H 2#define ASM_X86__PAGE_H
3 3
4#include <linux/const.h> 4#include <linux/const.h>
5 5
@@ -57,6 +57,7 @@ typedef struct { pgdval_t pgd; } pgd_t;
57typedef struct { pgprotval_t pgprot; } pgprot_t; 57typedef struct { pgprotval_t pgprot; } pgprot_t;
58 58
59extern int page_is_ram(unsigned long pagenr); 59extern int page_is_ram(unsigned long pagenr);
60extern int pagerange_is_ram(unsigned long start, unsigned long end);
60extern int devmem_is_allowed(unsigned long pagenr); 61extern int devmem_is_allowed(unsigned long pagenr);
61extern void map_devmem(unsigned long pfn, unsigned long size, 62extern void map_devmem(unsigned long pfn, unsigned long size,
62 pgprot_t vma_prot); 63 pgprot_t vma_prot);
@@ -178,6 +179,7 @@ static inline pteval_t native_pte_flags(pte_t pte)
178#endif /* CONFIG_PARAVIRT */ 179#endif /* CONFIG_PARAVIRT */
179 180
180#define __pa(x) __phys_addr((unsigned long)(x)) 181#define __pa(x) __phys_addr((unsigned long)(x))
182#define __pa_nodebug(x) __phys_addr_nodebug((unsigned long)(x))
181/* __pa_symbol should be used for C visible symbols. 183/* __pa_symbol should be used for C visible symbols.
182 This seems to be the official gcc blessed way to do such arithmetic. */ 184 This seems to be the official gcc blessed way to do such arithmetic. */
183#define __pa_symbol(x) __pa(__phys_reloc_hide((unsigned long)(x))) 185#define __pa_symbol(x) __pa(__phys_reloc_hide((unsigned long)(x)))
@@ -187,9 +189,14 @@ static inline pteval_t native_pte_flags(pte_t pte)
187#define __boot_va(x) __va(x) 189#define __boot_va(x) __va(x)
188#define __boot_pa(x) __pa(x) 190#define __boot_pa(x) __pa(x)
189 191
192/*
193 * virt_to_page(kaddr) returns a valid pointer if and only if
194 * virt_addr_valid(kaddr) returns true.
195 */
190#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 196#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
191#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 197#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
192#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 198extern bool __virt_addr_valid(unsigned long kaddr);
199#define virt_addr_valid(kaddr) __virt_addr_valid((unsigned long) (kaddr))
193 200
194#endif /* __ASSEMBLY__ */ 201#endif /* __ASSEMBLY__ */
195 202
@@ -199,4 +206,4 @@ static inline pteval_t native_pte_flags(pte_t pte)
199#define __HAVE_ARCH_GATE_AREA 1 206#define __HAVE_ARCH_GATE_AREA 1
200 207
201#endif /* __KERNEL__ */ 208#endif /* __KERNEL__ */
202#endif /* _ASM_X86_PAGE_H */ 209#endif /* ASM_X86__PAGE_H */
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h
index ab8528793f08..bdf5dba4cfb0 100644
--- a/include/asm-x86/page_32.h
+++ b/include/asm-x86/page_32.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PAGE_32_H 1#ifndef ASM_X86__PAGE_32_H
2#define _ASM_X86_PAGE_32_H 2#define ASM_X86__PAGE_32_H
3 3
4/* 4/*
5 * This handles the memory map. 5 * This handles the memory map.
@@ -20,6 +20,12 @@
20#endif 20#endif
21#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) 21#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
22 22
23#define STACKFAULT_STACK 0
24#define DOUBLEFAULT_STACK 1
25#define NMI_STACK 0
26#define DEBUG_STACK 0
27#define MCE_STACK 0
28#define N_EXCEPTION_STACKS 1
23 29
24#ifdef CONFIG_X86_PAE 30#ifdef CONFIG_X86_PAE
25/* 44=32+12, the limit we can fit into an unsigned long pfn */ 31/* 44=32+12, the limit we can fit into an unsigned long pfn */
@@ -33,7 +39,6 @@ typedef u64 pmdval_t;
33typedef u64 pudval_t; 39typedef u64 pudval_t;
34typedef u64 pgdval_t; 40typedef u64 pgdval_t;
35typedef u64 pgprotval_t; 41typedef u64 pgprotval_t;
36typedef u64 phys_addr_t;
37 42
38typedef union { 43typedef union {
39 struct { 44 struct {
@@ -54,7 +59,6 @@ typedef unsigned long pmdval_t;
54typedef unsigned long pudval_t; 59typedef unsigned long pudval_t;
55typedef unsigned long pgdval_t; 60typedef unsigned long pgdval_t;
56typedef unsigned long pgprotval_t; 61typedef unsigned long pgprotval_t;
57typedef unsigned long phys_addr_t;
58 62
59typedef union { 63typedef union {
60 pteval_t pte; 64 pteval_t pte;
@@ -73,7 +77,12 @@ typedef struct page *pgtable_t;
73#endif 77#endif
74 78
75#ifndef __ASSEMBLY__ 79#ifndef __ASSEMBLY__
76#define __phys_addr(x) ((x) - PAGE_OFFSET) 80#define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET)
81#ifdef CONFIG_DEBUG_VIRTUAL
82extern unsigned long __phys_addr(unsigned long);
83#else
84#define __phys_addr(x) __phys_addr_nodebug(x)
85#endif
77#define __phys_reloc_hide(x) RELOC_HIDE((x), 0) 86#define __phys_reloc_hide(x) RELOC_HIDE((x), 0)
78 87
79#ifdef CONFIG_FLATMEM 88#ifdef CONFIG_FLATMEM
@@ -89,13 +98,11 @@ extern int nx_enabled;
89extern unsigned int __VMALLOC_RESERVE; 98extern unsigned int __VMALLOC_RESERVE;
90extern int sysctl_legacy_va_layout; 99extern int sysctl_legacy_va_layout;
91 100
92#define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
93#define MAXMEM (-__PAGE_OFFSET - __VMALLOC_RESERVE)
94
95extern void find_low_pfn_range(void); 101extern void find_low_pfn_range(void);
96extern unsigned long init_memory_mapping(unsigned long start, 102extern unsigned long init_memory_mapping(unsigned long start,
97 unsigned long end); 103 unsigned long end);
98extern void initmem_init(unsigned long, unsigned long); 104extern void initmem_init(unsigned long, unsigned long);
105extern void free_initmem(void);
99extern void setup_bootmem_allocator(void); 106extern void setup_bootmem_allocator(void);
100 107
101 108
@@ -126,4 +133,4 @@ static inline void copy_page(void *to, void *from)
126#endif /* CONFIG_X86_3DNOW */ 133#endif /* CONFIG_X86_3DNOW */
127#endif /* !__ASSEMBLY__ */ 134#endif /* !__ASSEMBLY__ */
128 135
129#endif /* _ASM_X86_PAGE_32_H */ 136#endif /* ASM_X86__PAGE_32_H */
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index c6916c83e6b1..49380b8c7e25 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -1,5 +1,5 @@
1#ifndef _X86_64_PAGE_H 1#ifndef ASM_X86__PAGE_64_H
2#define _X86_64_PAGE_H 2#define ASM_X86__PAGE_64_H
3 3
4#define PAGETABLE_LEVELS 4 4#define PAGETABLE_LEVELS 4
5 5
@@ -79,7 +79,6 @@ typedef unsigned long pmdval_t;
79typedef unsigned long pudval_t; 79typedef unsigned long pudval_t;
80typedef unsigned long pgdval_t; 80typedef unsigned long pgdval_t;
81typedef unsigned long pgprotval_t; 81typedef unsigned long pgprotval_t;
82typedef unsigned long phys_addr_t;
83 82
84typedef struct page *pgtable_t; 83typedef struct page *pgtable_t;
85 84
@@ -91,6 +90,7 @@ extern unsigned long init_memory_mapping(unsigned long start,
91 unsigned long end); 90 unsigned long end);
92 91
93extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn); 92extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
93extern void free_initmem(void);
94 94
95extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); 95extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
96extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); 96extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
@@ -102,4 +102,4 @@ extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
102#endif 102#endif
103 103
104 104
105#endif /* _X86_64_PAGE_H */ 105#endif /* ASM_X86__PAGE_64_H */
diff --git a/include/asm-x86/param.h b/include/asm-x86/param.h
index 6f0d0422f4ca..0009cfb11a5f 100644
--- a/include/asm-x86/param.h
+++ b/include/asm-x86/param.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PARAM_H 1#ifndef ASM_X86__PARAM_H
2#define _ASM_X86_PARAM_H 2#define ASM_X86__PARAM_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5# define HZ CONFIG_HZ /* Internal kernel timer frequency */ 5# define HZ CONFIG_HZ /* Internal kernel timer frequency */
@@ -19,4 +19,4 @@
19 19
20#define MAXHOSTNAMELEN 64 /* max length of hostname */ 20#define MAXHOSTNAMELEN 64 /* max length of hostname */
21 21
22#endif /* _ASM_X86_PARAM_H */ 22#endif /* ASM_X86__PARAM_H */
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index fbbde93f12d6..8d6ae2f760d0 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_PARAVIRT_H 1#ifndef ASM_X86__PARAVIRT_H
2#define __ASM_PARAVIRT_H 2#define ASM_X86__PARAVIRT_H
3/* Various instructions on x86 need to be replaced for 3/* Various instructions on x86 need to be replaced for
4 * para-virtualization: those hooks are defined here. */ 4 * para-virtualization: those hooks are defined here. */
5 5
@@ -124,6 +124,9 @@ struct pv_cpu_ops {
124 int entrynum, const void *desc, int size); 124 int entrynum, const void *desc, int size);
125 void (*write_idt_entry)(gate_desc *, 125 void (*write_idt_entry)(gate_desc *,
126 int entrynum, const gate_desc *gate); 126 int entrynum, const gate_desc *gate);
127 void (*alloc_ldt)(struct desc_struct *ldt, unsigned entries);
128 void (*free_ldt)(struct desc_struct *ldt, unsigned entries);
129
127 void (*load_sp0)(struct tss_struct *tss, struct thread_struct *t); 130 void (*load_sp0)(struct tss_struct *tss, struct thread_struct *t);
128 131
129 void (*set_iopl_mask)(unsigned mask); 132 void (*set_iopl_mask)(unsigned mask);
@@ -137,6 +140,7 @@ struct pv_cpu_ops {
137 140
138 /* MSR, PMC and TSR operations. 141 /* MSR, PMC and TSR operations.
139 err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */ 142 err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */
143 u64 (*read_msr_amd)(unsigned int msr, int *err);
140 u64 (*read_msr)(unsigned int msr, int *err); 144 u64 (*read_msr)(unsigned int msr, int *err);
141 int (*write_msr)(unsigned int msr, unsigned low, unsigned high); 145 int (*write_msr)(unsigned int msr, unsigned low, unsigned high);
142 146
@@ -200,12 +204,6 @@ struct pv_irq_ops {
200 204
201struct pv_apic_ops { 205struct pv_apic_ops {
202#ifdef CONFIG_X86_LOCAL_APIC 206#ifdef CONFIG_X86_LOCAL_APIC
203 /*
204 * Direct APIC operations, principally for VMI. Ideally
205 * these shouldn't be in this interface.
206 */
207 void (*apic_write)(unsigned long reg, u32 v);
208 u32 (*apic_read)(unsigned long reg);
209 void (*setup_boot_clock)(void); 207 void (*setup_boot_clock)(void);
210 void (*setup_secondary_clock)(void); 208 void (*setup_secondary_clock)(void);
211 209
@@ -257,13 +255,13 @@ struct pv_mmu_ops {
257 * Hooks for allocating/releasing pagetable pages when they're 255 * Hooks for allocating/releasing pagetable pages when they're
258 * attached to a pagetable 256 * attached to a pagetable
259 */ 257 */
260 void (*alloc_pte)(struct mm_struct *mm, u32 pfn); 258 void (*alloc_pte)(struct mm_struct *mm, unsigned long pfn);
261 void (*alloc_pmd)(struct mm_struct *mm, u32 pfn); 259 void (*alloc_pmd)(struct mm_struct *mm, unsigned long pfn);
262 void (*alloc_pmd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count); 260 void (*alloc_pmd_clone)(unsigned long pfn, unsigned long clonepfn, unsigned long start, unsigned long count);
263 void (*alloc_pud)(struct mm_struct *mm, u32 pfn); 261 void (*alloc_pud)(struct mm_struct *mm, unsigned long pfn);
264 void (*release_pte)(u32 pfn); 262 void (*release_pte)(unsigned long pfn);
265 void (*release_pmd)(u32 pfn); 263 void (*release_pmd)(unsigned long pfn);
266 void (*release_pud)(u32 pfn); 264 void (*release_pud)(unsigned long pfn);
267 265
268 /* Pagetable manipulation functions */ 266 /* Pagetable manipulation functions */
269 void (*set_pte)(pte_t *ptep, pte_t pteval); 267 void (*set_pte)(pte_t *ptep, pte_t pteval);
@@ -330,6 +328,7 @@ struct pv_lock_ops {
330 int (*spin_is_locked)(struct raw_spinlock *lock); 328 int (*spin_is_locked)(struct raw_spinlock *lock);
331 int (*spin_is_contended)(struct raw_spinlock *lock); 329 int (*spin_is_contended)(struct raw_spinlock *lock);
332 void (*spin_lock)(struct raw_spinlock *lock); 330 void (*spin_lock)(struct raw_spinlock *lock);
331 void (*spin_lock_flags)(struct raw_spinlock *lock, unsigned long flags);
333 int (*spin_trylock)(struct raw_spinlock *lock); 332 int (*spin_trylock)(struct raw_spinlock *lock);
334 void (*spin_unlock)(struct raw_spinlock *lock); 333 void (*spin_unlock)(struct raw_spinlock *lock);
335}; 334};
@@ -726,6 +725,10 @@ static inline u64 paravirt_read_msr(unsigned msr, int *err)
726{ 725{
727 return PVOP_CALL2(u64, pv_cpu_ops.read_msr, msr, err); 726 return PVOP_CALL2(u64, pv_cpu_ops.read_msr, msr, err);
728} 727}
728static inline u64 paravirt_read_msr_amd(unsigned msr, int *err)
729{
730 return PVOP_CALL2(u64, pv_cpu_ops.read_msr_amd, msr, err);
731}
729static inline int paravirt_write_msr(unsigned msr, unsigned low, unsigned high) 732static inline int paravirt_write_msr(unsigned msr, unsigned low, unsigned high)
730{ 733{
731 return PVOP_CALL3(int, pv_cpu_ops.write_msr, msr, low, high); 734 return PVOP_CALL3(int, pv_cpu_ops.write_msr, msr, low, high);
@@ -771,6 +774,13 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p)
771 *p = paravirt_read_msr(msr, &err); 774 *p = paravirt_read_msr(msr, &err);
772 return err; 775 return err;
773} 776}
777static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p)
778{
779 int err;
780
781 *p = paravirt_read_msr_amd(msr, &err);
782 return err;
783}
774 784
775static inline u64 paravirt_read_tsc(void) 785static inline u64 paravirt_read_tsc(void)
776{ 786{
@@ -824,6 +834,16 @@ do { \
824 (aux) = __aux; \ 834 (aux) = __aux; \
825} while (0) 835} while (0)
826 836
837static inline void paravirt_alloc_ldt(struct desc_struct *ldt, unsigned entries)
838{
839 PVOP_VCALL2(pv_cpu_ops.alloc_ldt, ldt, entries);
840}
841
842static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries)
843{
844 PVOP_VCALL2(pv_cpu_ops.free_ldt, ldt, entries);
845}
846
827static inline void load_TR_desc(void) 847static inline void load_TR_desc(void)
828{ 848{
829 PVOP_VCALL0(pv_cpu_ops.load_tr_desc); 849 PVOP_VCALL0(pv_cpu_ops.load_tr_desc);
@@ -898,19 +918,6 @@ static inline void slow_down_io(void)
898} 918}
899 919
900#ifdef CONFIG_X86_LOCAL_APIC 920#ifdef CONFIG_X86_LOCAL_APIC
901/*
902 * Basic functions accessing APICs.
903 */
904static inline void apic_write(unsigned long reg, u32 v)
905{
906 PVOP_VCALL2(pv_apic_ops.apic_write, reg, v);
907}
908
909static inline u32 apic_read(unsigned long reg)
910{
911 return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg);
912}
913
914static inline void setup_boot_clock(void) 921static inline void setup_boot_clock(void)
915{ 922{
916 PVOP_VCALL0(pv_apic_ops.setup_boot_clock); 923 PVOP_VCALL0(pv_apic_ops.setup_boot_clock);
@@ -993,35 +1000,35 @@ static inline void paravirt_pgd_free(struct mm_struct *mm, pgd_t *pgd)
993 PVOP_VCALL2(pv_mmu_ops.pgd_free, mm, pgd); 1000 PVOP_VCALL2(pv_mmu_ops.pgd_free, mm, pgd);
994} 1001}
995 1002
996static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned pfn) 1003static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned long pfn)
997{ 1004{
998 PVOP_VCALL2(pv_mmu_ops.alloc_pte, mm, pfn); 1005 PVOP_VCALL2(pv_mmu_ops.alloc_pte, mm, pfn);
999} 1006}
1000static inline void paravirt_release_pte(unsigned pfn) 1007static inline void paravirt_release_pte(unsigned long pfn)
1001{ 1008{
1002 PVOP_VCALL1(pv_mmu_ops.release_pte, pfn); 1009 PVOP_VCALL1(pv_mmu_ops.release_pte, pfn);
1003} 1010}
1004 1011
1005static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned pfn) 1012static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
1006{ 1013{
1007 PVOP_VCALL2(pv_mmu_ops.alloc_pmd, mm, pfn); 1014 PVOP_VCALL2(pv_mmu_ops.alloc_pmd, mm, pfn);
1008} 1015}
1009 1016
1010static inline void paravirt_alloc_pmd_clone(unsigned pfn, unsigned clonepfn, 1017static inline void paravirt_alloc_pmd_clone(unsigned long pfn, unsigned long clonepfn,
1011 unsigned start, unsigned count) 1018 unsigned long start, unsigned long count)
1012{ 1019{
1013 PVOP_VCALL4(pv_mmu_ops.alloc_pmd_clone, pfn, clonepfn, start, count); 1020 PVOP_VCALL4(pv_mmu_ops.alloc_pmd_clone, pfn, clonepfn, start, count);
1014} 1021}
1015static inline void paravirt_release_pmd(unsigned pfn) 1022static inline void paravirt_release_pmd(unsigned long pfn)
1016{ 1023{
1017 PVOP_VCALL1(pv_mmu_ops.release_pmd, pfn); 1024 PVOP_VCALL1(pv_mmu_ops.release_pmd, pfn);
1018} 1025}
1019 1026
1020static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned pfn) 1027static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned long pfn)
1021{ 1028{
1022 PVOP_VCALL2(pv_mmu_ops.alloc_pud, mm, pfn); 1029 PVOP_VCALL2(pv_mmu_ops.alloc_pud, mm, pfn);
1023} 1030}
1024static inline void paravirt_release_pud(unsigned pfn) 1031static inline void paravirt_release_pud(unsigned long pfn)
1025{ 1032{
1026 PVOP_VCALL1(pv_mmu_ops.release_pud, pfn); 1033 PVOP_VCALL1(pv_mmu_ops.release_pud, pfn);
1027} 1034}
@@ -1401,6 +1408,12 @@ static __always_inline void __raw_spin_lock(struct raw_spinlock *lock)
1401 PVOP_VCALL1(pv_lock_ops.spin_lock, lock); 1408 PVOP_VCALL1(pv_lock_ops.spin_lock, lock);
1402} 1409}
1403 1410
1411static __always_inline void __raw_spin_lock_flags(struct raw_spinlock *lock,
1412 unsigned long flags)
1413{
1414 PVOP_VCALL2(pv_lock_ops.spin_lock_flags, lock, flags);
1415}
1416
1404static __always_inline int __raw_spin_trylock(struct raw_spinlock *lock) 1417static __always_inline int __raw_spin_trylock(struct raw_spinlock *lock)
1405{ 1418{
1406 return PVOP_CALL1(int, pv_lock_ops.spin_trylock, lock); 1419 return PVOP_CALL1(int, pv_lock_ops.spin_trylock, lock);
@@ -1634,4 +1647,4 @@ static inline unsigned long __raw_local_irq_save(void)
1634 1647
1635#endif /* __ASSEMBLY__ */ 1648#endif /* __ASSEMBLY__ */
1636#endif /* CONFIG_PARAVIRT */ 1649#endif /* CONFIG_PARAVIRT */
1637#endif /* __ASM_PARAVIRT_H */ 1650#endif /* ASM_X86__PARAVIRT_H */
diff --git a/include/asm-x86/parport.h b/include/asm-x86/parport.h
index 3c4ffeb467e9..2e3dda4dc3d9 100644
--- a/include/asm-x86/parport.h
+++ b/include/asm-x86/parport.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PARPORT_H 1#ifndef ASM_X86__PARPORT_H
2#define _ASM_X86_PARPORT_H 2#define ASM_X86__PARPORT_H
3 3
4static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); 4static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma);
5static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) 5static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
@@ -7,4 +7,4 @@ static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
7 return parport_pc_find_isa_ports(autoirq, autodma); 7 return parport_pc_find_isa_ports(autoirq, autodma);
8} 8}
9 9
10#endif /* _ASM_X86_PARPORT_H */ 10#endif /* ASM_X86__PARPORT_H */
diff --git a/include/asm-x86/pat.h b/include/asm-x86/pat.h
index 7edc47307217..482c3e3f9879 100644
--- a/include/asm-x86/pat.h
+++ b/include/asm-x86/pat.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_PAT_H 1#ifndef ASM_X86__PAT_H
2#define _ASM_PAT_H 2#define ASM_X86__PAT_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
@@ -19,4 +19,4 @@ extern int free_memtype(u64 start, u64 end);
19 19
20extern void pat_disable(char *reason); 20extern void pat_disable(char *reason);
21 21
22#endif 22#endif /* ASM_X86__PAT_H */
diff --git a/include/asm-x86/pci-direct.h b/include/asm-x86/pci-direct.h
index 80c775d9fe20..da42be07b690 100644
--- a/include/asm-x86/pci-direct.h
+++ b/include/asm-x86/pci-direct.h
@@ -1,5 +1,5 @@
1#ifndef ASM_PCI_DIRECT_H 1#ifndef ASM_X86__PCI_DIRECT_H
2#define ASM_PCI_DIRECT_H 1 2#define ASM_X86__PCI_DIRECT_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
@@ -18,4 +18,4 @@ extern int early_pci_allowed(void);
18extern unsigned int pci_early_dump_regs; 18extern unsigned int pci_early_dump_regs;
19extern void early_dump_pci_device(u8 bus, u8 slot, u8 func); 19extern void early_dump_pci_device(u8 bus, u8 slot, u8 func);
20extern void early_dump_pci_devices(void); 20extern void early_dump_pci_devices(void);
21#endif 21#endif /* ASM_X86__PCI_DIRECT_H */
diff --git a/include/asm-x86/pci.h b/include/asm-x86/pci.h
index 2db14cf17db8..602583192991 100644
--- a/include/asm-x86/pci.h
+++ b/include/asm-x86/pci.h
@@ -1,5 +1,5 @@
1#ifndef __x86_PCI_H 1#ifndef ASM_X86__PCI_H
2#define __x86_PCI_H 2#define ASM_X86__PCI_H
3 3
4#include <linux/mm.h> /* for struct page */ 4#include <linux/mm.h> /* for struct page */
5#include <linux/types.h> 5#include <linux/types.h>
@@ -111,4 +111,4 @@ static inline cpumask_t __pcibus_to_cpumask(struct pci_bus *bus)
111} 111}
112#endif 112#endif
113 113
114#endif 114#endif /* ASM_X86__PCI_H */
diff --git a/include/asm-x86/pci_32.h b/include/asm-x86/pci_32.h
index a50d46851285..3f2288207c0c 100644
--- a/include/asm-x86/pci_32.h
+++ b/include/asm-x86/pci_32.h
@@ -1,5 +1,5 @@
1#ifndef __i386_PCI_H 1#ifndef ASM_X86__PCI_32_H
2#define __i386_PCI_H 2#define ASM_X86__PCI_32_H
3 3
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
@@ -31,4 +31,4 @@ struct pci_dev;
31#endif /* __KERNEL__ */ 31#endif /* __KERNEL__ */
32 32
33 33
34#endif /* __i386_PCI_H */ 34#endif /* ASM_X86__PCI_32_H */
diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h
index f330234ffa5c..f72e12d5770e 100644
--- a/include/asm-x86/pci_64.h
+++ b/include/asm-x86/pci_64.h
@@ -1,5 +1,5 @@
1#ifndef __x8664_PCI_H 1#ifndef ASM_X86__PCI_64_H
2#define __x8664_PCI_H 2#define ASM_X86__PCI_64_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
@@ -63,4 +63,4 @@ extern void pci_iommu_alloc(void);
63 63
64#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
65 65
66#endif /* __x8664_PCI_H */ 66#endif /* ASM_X86__PCI_64_H */
diff --git a/include/asm-x86/pda.h b/include/asm-x86/pda.h
index b34e9a7cc80b..80860afffbdb 100644
--- a/include/asm-x86/pda.h
+++ b/include/asm-x86/pda.h
@@ -1,5 +1,5 @@
1#ifndef X86_64_PDA_H 1#ifndef ASM_X86__PDA_H
2#define X86_64_PDA_H 2#define ASM_X86__PDA_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <linux/stddef.h> 5#include <linux/stddef.h>
@@ -134,4 +134,4 @@ do { \
134 134
135#define PDA_STACKOFFSET (5*8) 135#define PDA_STACKOFFSET (5*8)
136 136
137#endif 137#endif /* ASM_X86__PDA_H */
diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h
index f643a3a92da0..e10a1d0678cf 100644
--- a/include/asm-x86/percpu.h
+++ b/include/asm-x86/percpu.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PERCPU_H_ 1#ifndef ASM_X86__PERCPU_H
2#define _ASM_X86_PERCPU_H_ 2#define ASM_X86__PERCPU_H
3 3
4#ifdef CONFIG_X86_64 4#ifdef CONFIG_X86_64
5#include <linux/compiler.h> 5#include <linux/compiler.h>
@@ -215,4 +215,4 @@ do { \
215 215
216#endif /* !CONFIG_SMP */ 216#endif /* !CONFIG_SMP */
217 217
218#endif /* _ASM_X86_PERCPU_H_ */ 218#endif /* ASM_X86__PERCPU_H */
diff --git a/include/asm-x86/pgalloc.h b/include/asm-x86/pgalloc.h
index d63ea431cb3b..3cd23adedae8 100644
--- a/include/asm-x86/pgalloc.h
+++ b/include/asm-x86/pgalloc.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PGALLOC_H 1#ifndef ASM_X86__PGALLOC_H
2#define _ASM_X86_PGALLOC_H 2#define ASM_X86__PGALLOC_H
3 3
4#include <linux/threads.h> 4#include <linux/threads.h>
5#include <linux/mm.h> /* for struct page */ 5#include <linux/mm.h> /* for struct page */
@@ -111,4 +111,4 @@ extern void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud);
111#endif /* PAGETABLE_LEVELS > 3 */ 111#endif /* PAGETABLE_LEVELS > 3 */
112#endif /* PAGETABLE_LEVELS > 2 */ 112#endif /* PAGETABLE_LEVELS > 2 */
113 113
114#endif /* _ASM_X86_PGALLOC_H */ 114#endif /* ASM_X86__PGALLOC_H */
diff --git a/include/asm-x86/pgtable-2level-defs.h b/include/asm-x86/pgtable-2level-defs.h
index 0f71c9f13da4..7ec48f4e5347 100644
--- a/include/asm-x86/pgtable-2level-defs.h
+++ b/include/asm-x86/pgtable-2level-defs.h
@@ -1,5 +1,5 @@
1#ifndef _I386_PGTABLE_2LEVEL_DEFS_H 1#ifndef ASM_X86__PGTABLE_2LEVEL_DEFS_H
2#define _I386_PGTABLE_2LEVEL_DEFS_H 2#define ASM_X86__PGTABLE_2LEVEL_DEFS_H
3 3
4#define SHARED_KERNEL_PMD 0 4#define SHARED_KERNEL_PMD 0
5 5
@@ -17,4 +17,4 @@
17 17
18#define PTRS_PER_PTE 1024 18#define PTRS_PER_PTE 1024
19 19
20#endif /* _I386_PGTABLE_2LEVEL_DEFS_H */ 20#endif /* ASM_X86__PGTABLE_2LEVEL_DEFS_H */
diff --git a/include/asm-x86/pgtable-2level.h b/include/asm-x86/pgtable-2level.h
index 46bc52c0eae1..81762081dcd8 100644
--- a/include/asm-x86/pgtable-2level.h
+++ b/include/asm-x86/pgtable-2level.h
@@ -1,5 +1,5 @@
1#ifndef _I386_PGTABLE_2LEVEL_H 1#ifndef ASM_X86__PGTABLE_2LEVEL_H
2#define _I386_PGTABLE_2LEVEL_H 2#define ASM_X86__PGTABLE_2LEVEL_H
3 3
4#define pte_ERROR(e) \ 4#define pte_ERROR(e) \
5 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low) 5 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low)
@@ -53,9 +53,7 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
53#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) 53#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
54#endif 54#endif
55 55
56#define pte_page(x) pfn_to_page(pte_pfn(x))
57#define pte_none(x) (!(x).pte_low) 56#define pte_none(x) (!(x).pte_low)
58#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
59 57
60/* 58/*
61 * Bits 0, 6 and 7 are taken, split up the 29 bits of offset 59 * Bits 0, 6 and 7 are taken, split up the 29 bits of offset
@@ -78,4 +76,4 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
78#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low }) 76#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low })
79#define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) 77#define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val })
80 78
81#endif /* _I386_PGTABLE_2LEVEL_H */ 79#endif /* ASM_X86__PGTABLE_2LEVEL_H */
diff --git a/include/asm-x86/pgtable-3level-defs.h b/include/asm-x86/pgtable-3level-defs.h
index 448ac9516314..c05fe6ff3720 100644
--- a/include/asm-x86/pgtable-3level-defs.h
+++ b/include/asm-x86/pgtable-3level-defs.h
@@ -1,5 +1,5 @@
1#ifndef _I386_PGTABLE_3LEVEL_DEFS_H 1#ifndef ASM_X86__PGTABLE_3LEVEL_DEFS_H
2#define _I386_PGTABLE_3LEVEL_DEFS_H 2#define ASM_X86__PGTABLE_3LEVEL_DEFS_H
3 3
4#ifdef CONFIG_PARAVIRT 4#ifdef CONFIG_PARAVIRT
5#define SHARED_KERNEL_PMD (pv_info.shared_kernel_pmd) 5#define SHARED_KERNEL_PMD (pv_info.shared_kernel_pmd)
@@ -25,4 +25,4 @@
25 */ 25 */
26#define PTRS_PER_PTE 512 26#define PTRS_PER_PTE 512
27 27
28#endif /* _I386_PGTABLE_3LEVEL_DEFS_H */ 28#endif /* ASM_X86__PGTABLE_3LEVEL_DEFS_H */
diff --git a/include/asm-x86/pgtable-3level.h b/include/asm-x86/pgtable-3level.h
index 105057f34032..75f4276b5ddb 100644
--- a/include/asm-x86/pgtable-3level.h
+++ b/include/asm-x86/pgtable-3level.h
@@ -1,5 +1,5 @@
1#ifndef _I386_PGTABLE_3LEVEL_H 1#ifndef ASM_X86__PGTABLE_3LEVEL_H
2#define _I386_PGTABLE_3LEVEL_H 2#define ASM_X86__PGTABLE_3LEVEL_H
3 3
4/* 4/*
5 * Intel Physical Address Extension (PAE) Mode - three-level page 5 * Intel Physical Address Extension (PAE) Mode - three-level page
@@ -151,18 +151,11 @@ static inline int pte_same(pte_t a, pte_t b)
151 return a.pte_low == b.pte_low && a.pte_high == b.pte_high; 151 return a.pte_low == b.pte_low && a.pte_high == b.pte_high;
152} 152}
153 153
154#define pte_page(x) pfn_to_page(pte_pfn(x))
155
156static inline int pte_none(pte_t pte) 154static inline int pte_none(pte_t pte)
157{ 155{
158 return !pte.pte_low && !pte.pte_high; 156 return !pte.pte_low && !pte.pte_high;
159} 157}
160 158
161static inline unsigned long pte_pfn(pte_t pte)
162{
163 return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
164}
165
166/* 159/*
167 * Bits 0, 6 and 7 are taken in the low part of the pte, 160 * Bits 0, 6 and 7 are taken in the low part of the pte,
168 * put the 32 bits of offset into the high part. 161 * put the 32 bits of offset into the high part.
@@ -179,4 +172,4 @@ static inline unsigned long pte_pfn(pte_t pte)
179#define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high }) 172#define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high })
180#define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } }) 173#define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } })
181 174
182#endif /* _I386_PGTABLE_3LEVEL_H */ 175#endif /* ASM_X86__PGTABLE_3LEVEL_H */
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index 04caa2f544df..88a53b1a17f0 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PGTABLE_H 1#ifndef ASM_X86__PGTABLE_H
2#define _ASM_X86_PGTABLE_H 2#define ASM_X86__PGTABLE_H
3 3
4#define FIRST_USER_ADDRESS 0 4#define FIRST_USER_ADDRESS 0
5 5
@@ -15,10 +15,11 @@
15#define _PAGE_BIT_PAT 7 /* on 4KB pages */ 15#define _PAGE_BIT_PAT 7 /* on 4KB pages */
16#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */ 16#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */
17#define _PAGE_BIT_UNUSED1 9 /* available for programmer */ 17#define _PAGE_BIT_UNUSED1 9 /* available for programmer */
18#define _PAGE_BIT_UNUSED2 10 18#define _PAGE_BIT_IOMAP 10 /* flag used to indicate IO mapping */
19#define _PAGE_BIT_UNUSED3 11 19#define _PAGE_BIT_UNUSED3 11
20#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */ 20#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */
21#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1 21#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1
22#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1
22#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ 23#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */
23 24
24#define _PAGE_PRESENT (_AT(pteval_t, 1) << _PAGE_BIT_PRESENT) 25#define _PAGE_PRESENT (_AT(pteval_t, 1) << _PAGE_BIT_PRESENT)
@@ -31,11 +32,12 @@
31#define _PAGE_PSE (_AT(pteval_t, 1) << _PAGE_BIT_PSE) 32#define _PAGE_PSE (_AT(pteval_t, 1) << _PAGE_BIT_PSE)
32#define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL) 33#define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL)
33#define _PAGE_UNUSED1 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED1) 34#define _PAGE_UNUSED1 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED1)
34#define _PAGE_UNUSED2 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED2) 35#define _PAGE_IOMAP (_AT(pteval_t, 1) << _PAGE_BIT_IOMAP)
35#define _PAGE_UNUSED3 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED3) 36#define _PAGE_UNUSED3 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED3)
36#define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) 37#define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT)
37#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) 38#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
38#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) 39#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
40#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
39#define __HAVE_ARCH_PTE_SPECIAL 41#define __HAVE_ARCH_PTE_SPECIAL
40 42
41#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) 43#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
@@ -97,6 +99,11 @@
97#define __PAGE_KERNEL_LARGE_NOCACHE (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE) 99#define __PAGE_KERNEL_LARGE_NOCACHE (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE)
98#define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE) 100#define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
99 101
102#define __PAGE_KERNEL_IO (__PAGE_KERNEL | _PAGE_IOMAP)
103#define __PAGE_KERNEL_IO_NOCACHE (__PAGE_KERNEL_NOCACHE | _PAGE_IOMAP)
104#define __PAGE_KERNEL_IO_UC_MINUS (__PAGE_KERNEL_UC_MINUS | _PAGE_IOMAP)
105#define __PAGE_KERNEL_IO_WC (__PAGE_KERNEL_WC | _PAGE_IOMAP)
106
100#define PAGE_KERNEL __pgprot(__PAGE_KERNEL) 107#define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
101#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO) 108#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
102#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC) 109#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
@@ -111,6 +118,11 @@
111#define PAGE_KERNEL_VSYSCALL __pgprot(__PAGE_KERNEL_VSYSCALL) 118#define PAGE_KERNEL_VSYSCALL __pgprot(__PAGE_KERNEL_VSYSCALL)
112#define PAGE_KERNEL_VSYSCALL_NOCACHE __pgprot(__PAGE_KERNEL_VSYSCALL_NOCACHE) 119#define PAGE_KERNEL_VSYSCALL_NOCACHE __pgprot(__PAGE_KERNEL_VSYSCALL_NOCACHE)
113 120
121#define PAGE_KERNEL_IO __pgprot(__PAGE_KERNEL_IO)
122#define PAGE_KERNEL_IO_NOCACHE __pgprot(__PAGE_KERNEL_IO_NOCACHE)
123#define PAGE_KERNEL_IO_UC_MINUS __pgprot(__PAGE_KERNEL_IO_UC_MINUS)
124#define PAGE_KERNEL_IO_WC __pgprot(__PAGE_KERNEL_IO_WC)
125
114/* xwr */ 126/* xwr */
115#define __P000 PAGE_NONE 127#define __P000 PAGE_NONE
116#define __P001 PAGE_READONLY 128#define __P001 PAGE_READONLY
@@ -130,6 +142,22 @@
130#define __S110 PAGE_SHARED_EXEC 142#define __S110 PAGE_SHARED_EXEC
131#define __S111 PAGE_SHARED_EXEC 143#define __S111 PAGE_SHARED_EXEC
132 144
145/*
146 * early identity mapping pte attrib macros.
147 */
148#ifdef CONFIG_X86_64
149#define __PAGE_KERNEL_IDENT_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
150#else
151/*
152 * For PDE_IDENT_ATTR include USER bit. As the PDE and PTE protection
153 * bits are combined, this will alow user to access the high address mapped
154 * VDSO in the presence of CONFIG_COMPAT_VDSO
155 */
156#define PTE_IDENT_ATTR 0x003 /* PRESENT+RW */
157#define PDE_IDENT_ATTR 0x067 /* PRESENT+RW+USER+DIRTY+ACCESSED */
158#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
159#endif
160
133#ifndef __ASSEMBLY__ 161#ifndef __ASSEMBLY__
134 162
135/* 163/*
@@ -183,9 +211,16 @@ static inline int pte_exec(pte_t pte)
183 211
184static inline int pte_special(pte_t pte) 212static inline int pte_special(pte_t pte)
185{ 213{
186 return pte_val(pte) & _PAGE_SPECIAL; 214 return pte_flags(pte) & _PAGE_SPECIAL;
187} 215}
188 216
217static inline unsigned long pte_pfn(pte_t pte)
218{
219 return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
220}
221
222#define pte_page(pte) pfn_to_page(pte_pfn(pte))
223
189static inline int pmd_large(pmd_t pte) 224static inline int pmd_large(pmd_t pte)
190{ 225{
191 return (pmd_val(pte) & (_PAGE_PSE | _PAGE_PRESENT)) == 226 return (pmd_val(pte) & (_PAGE_PSE | _PAGE_PRESENT)) ==
@@ -313,6 +348,8 @@ static inline void native_pagetable_setup_start(pgd_t *base) {}
313static inline void native_pagetable_setup_done(pgd_t *base) {} 348static inline void native_pagetable_setup_done(pgd_t *base) {}
314#endif 349#endif
315 350
351extern int arch_report_meminfo(char *page);
352
316#ifdef CONFIG_PARAVIRT 353#ifdef CONFIG_PARAVIRT
317#include <asm/paravirt.h> 354#include <asm/paravirt.h>
318#else /* !CONFIG_PARAVIRT */ 355#else /* !CONFIG_PARAVIRT */
@@ -521,4 +558,4 @@ static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
521#include <asm-generic/pgtable.h> 558#include <asm-generic/pgtable.h>
522#endif /* __ASSEMBLY__ */ 559#endif /* __ASSEMBLY__ */
523 560
524#endif /* _ASM_X86_PGTABLE_H */ 561#endif /* ASM_X86__PGTABLE_H */
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h
index 5c3b26567a95..8de702dc7d62 100644
--- a/include/asm-x86/pgtable_32.h
+++ b/include/asm-x86/pgtable_32.h
@@ -1,5 +1,5 @@
1#ifndef _I386_PGTABLE_H 1#ifndef ASM_X86__PGTABLE_32_H
2#define _I386_PGTABLE_H 2#define ASM_X86__PGTABLE_32_H
3 3
4 4
5/* 5/*
@@ -31,6 +31,7 @@ static inline void pgtable_cache_init(void) { }
31static inline void check_pgt_cache(void) { } 31static inline void check_pgt_cache(void) { }
32void paging_init(void); 32void paging_init(void);
33 33
34extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
34 35
35/* 36/*
36 * The Linux x86 paging architecture is 'compile-time dual-mode', it 37 * The Linux x86 paging architecture is 'compile-time dual-mode', it
@@ -56,8 +57,7 @@ void paging_init(void);
56 * area for the same reason. ;) 57 * area for the same reason. ;)
57 */ 58 */
58#define VMALLOC_OFFSET (8 * 1024 * 1024) 59#define VMALLOC_OFFSET (8 * 1024 * 1024)
59#define VMALLOC_START (((unsigned long)high_memory + 2 * VMALLOC_OFFSET - 1) \ 60#define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET)
60 & ~(VMALLOC_OFFSET - 1))
61#ifdef CONFIG_X86_PAE 61#ifdef CONFIG_X86_PAE
62#define LAST_PKMAP 512 62#define LAST_PKMAP 512
63#else 63#else
@@ -73,6 +73,8 @@ void paging_init(void);
73# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE) 73# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE)
74#endif 74#endif
75 75
76#define MAXMEM (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE)
77
76/* 78/*
77 * Define this if things work differently on an i386 and an i486: 79 * Define this if things work differently on an i386 and an i486:
78 * it will (on an i486) warn about kernel memory accesses that are 80 * it will (on an i486) warn about kernel memory accesses that are
@@ -186,4 +188,4 @@ do { \
186#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 188#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
187 remap_pfn_range(vma, vaddr, pfn, size, prot) 189 remap_pfn_range(vma, vaddr, pfn, size, prot)
188 190
189#endif /* _I386_PGTABLE_H */ 191#endif /* ASM_X86__PGTABLE_32_H */
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h
index 549144d03d99..fde9770e53d1 100644
--- a/include/asm-x86/pgtable_64.h
+++ b/include/asm-x86/pgtable_64.h
@@ -1,5 +1,5 @@
1#ifndef _X86_64_PGTABLE_H 1#ifndef ASM_X86__PGTABLE_64_H
2#define _X86_64_PGTABLE_H 2#define ASM_X86__PGTABLE_64_H
3 3
4#include <linux/const.h> 4#include <linux/const.h>
5#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
@@ -175,8 +175,6 @@ static inline int pmd_bad(pmd_t pmd)
175#define pte_present(x) (pte_val((x)) & (_PAGE_PRESENT | _PAGE_PROTNONE)) 175#define pte_present(x) (pte_val((x)) & (_PAGE_PRESENT | _PAGE_PROTNONE))
176 176
177#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */ 177#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */
178#define pte_page(x) pfn_to_page(pte_pfn((x)))
179#define pte_pfn(x) ((pte_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT)
180 178
181/* 179/*
182 * Macro to mark a page protection value as "uncacheable". 180 * Macro to mark a page protection value as "uncacheable".
@@ -284,4 +282,4 @@ extern void cleanup_highmap(void);
284#define __HAVE_ARCH_PTE_SAME 282#define __HAVE_ARCH_PTE_SAME
285#endif /* !__ASSEMBLY__ */ 283#endif /* !__ASSEMBLY__ */
286 284
287#endif /* _X86_64_PGTABLE_H */ 285#endif /* ASM_X86__PGTABLE_64_H */
diff --git a/include/asm-x86/posix_types_32.h b/include/asm-x86/posix_types_32.h
index b031efda37ec..70cf2bb05939 100644
--- a/include/asm-x86/posix_types_32.h
+++ b/include/asm-x86/posix_types_32.h
@@ -1,5 +1,5 @@
1#ifndef __ARCH_I386_POSIX_TYPES_H 1#ifndef ASM_X86__POSIX_TYPES_32_H
2#define __ARCH_I386_POSIX_TYPES_H 2#define ASM_X86__POSIX_TYPES_32_H
3 3
4/* 4/*
5 * This file is generally used by user-level software, so you need to 5 * This file is generally used by user-level software, so you need to
@@ -82,4 +82,4 @@ do { \
82 82
83#endif /* defined(__KERNEL__) */ 83#endif /* defined(__KERNEL__) */
84 84
85#endif 85#endif /* ASM_X86__POSIX_TYPES_32_H */
diff --git a/include/asm-x86/posix_types_64.h b/include/asm-x86/posix_types_64.h
index d6624c95854a..388b4e7f4a44 100644
--- a/include/asm-x86/posix_types_64.h
+++ b/include/asm-x86/posix_types_64.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_64_POSIX_TYPES_H 1#ifndef ASM_X86__POSIX_TYPES_64_H
2#define _ASM_X86_64_POSIX_TYPES_H 2#define ASM_X86__POSIX_TYPES_64_H
3 3
4/* 4/*
5 * This file is generally used by user-level software, so you need to 5 * This file is generally used by user-level software, so you need to
@@ -116,4 +116,4 @@ static inline void __FD_ZERO(__kernel_fd_set *p)
116 116
117#endif /* defined(__KERNEL__) */ 117#endif /* defined(__KERNEL__) */
118 118
119#endif 119#endif /* ASM_X86__POSIX_TYPES_64_H */
diff --git a/include/asm-x86/prctl.h b/include/asm-x86/prctl.h
index 52952adef1ca..e7ae34eb4103 100644
--- a/include/asm-x86/prctl.h
+++ b/include/asm-x86/prctl.h
@@ -1,5 +1,5 @@
1#ifndef X86_64_PRCTL_H 1#ifndef ASM_X86__PRCTL_H
2#define X86_64_PRCTL_H 1 2#define ASM_X86__PRCTL_H
3 3
4#define ARCH_SET_GS 0x1001 4#define ARCH_SET_GS 0x1001
5#define ARCH_SET_FS 0x1002 5#define ARCH_SET_FS 0x1002
@@ -7,4 +7,4 @@
7#define ARCH_GET_GS 0x1004 7#define ARCH_GET_GS 0x1004
8 8
9 9
10#endif 10#endif /* ASM_X86__PRCTL_H */
diff --git a/include/asm-x86/processor-cyrix.h b/include/asm-x86/processor-cyrix.h
index 97568ada1f97..1198f2a0e42c 100644
--- a/include/asm-x86/processor-cyrix.h
+++ b/include/asm-x86/processor-cyrix.h
@@ -28,3 +28,11 @@ static inline void setCx86(u8 reg, u8 data)
28 outb(reg, 0x22); 28 outb(reg, 0x22);
29 outb(data, 0x23); 29 outb(data, 0x23);
30} 30}
31
32#define getCx86_old(reg) ({ outb((reg), 0x22); inb(0x23); })
33
34#define setCx86_old(reg, data) do { \
35 outb((reg), 0x22); \
36 outb((data), 0x23); \
37} while (0)
38
diff --git a/include/asm-x86/processor-flags.h b/include/asm-x86/processor-flags.h
index eff2ecd7fff0..dc5f0712f9fa 100644
--- a/include/asm-x86/processor-flags.h
+++ b/include/asm-x86/processor-flags.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_I386_PROCESSOR_FLAGS_H 1#ifndef ASM_X86__PROCESSOR_FLAGS_H
2#define __ASM_I386_PROCESSOR_FLAGS_H 2#define ASM_X86__PROCESSOR_FLAGS_H
3/* Various flags defined: can be included from assembler. */ 3/* Various flags defined: can be included from assembler. */
4 4
5/* 5/*
@@ -59,6 +59,7 @@
59#define X86_CR4_OSFXSR 0x00000200 /* enable fast FPU save and restore */ 59#define X86_CR4_OSFXSR 0x00000200 /* enable fast FPU save and restore */
60#define X86_CR4_OSXMMEXCPT 0x00000400 /* enable unmasked SSE exceptions */ 60#define X86_CR4_OSXMMEXCPT 0x00000400 /* enable unmasked SSE exceptions */
61#define X86_CR4_VMXE 0x00002000 /* enable VMX virtualization */ 61#define X86_CR4_VMXE 0x00002000 /* enable VMX virtualization */
62#define X86_CR4_OSXSAVE 0x00040000 /* enable xsave and xrestore */
62 63
63/* 64/*
64 * x86-64 Task Priority Register, CR8 65 * x86-64 Task Priority Register, CR8
@@ -96,4 +97,4 @@
96#endif 97#endif
97#endif 98#endif
98 99
99#endif /* __ASM_I386_PROCESSOR_FLAGS_H */ 100#endif /* ASM_X86__PROCESSOR_FLAGS_H */
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 4df3e2f6fb56..ee7cbb30773a 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_X86_PROCESSOR_H 1#ifndef ASM_X86__PROCESSOR_H
2#define __ASM_X86_PROCESSOR_H 2#define ASM_X86__PROCESSOR_H
3 3
4#include <asm/processor-flags.h> 4#include <asm/processor-flags.h>
5 5
@@ -20,6 +20,7 @@ struct mm_struct;
20#include <asm/msr.h> 20#include <asm/msr.h>
21#include <asm/desc_defs.h> 21#include <asm/desc_defs.h>
22#include <asm/nops.h> 22#include <asm/nops.h>
23#include <asm/ds.h>
23 24
24#include <linux/personality.h> 25#include <linux/personality.h>
25#include <linux/cpumask.h> 26#include <linux/cpumask.h>
@@ -75,11 +76,11 @@ struct cpuinfo_x86 {
75 int x86_tlbsize; 76 int x86_tlbsize;
76 __u8 x86_virt_bits; 77 __u8 x86_virt_bits;
77 __u8 x86_phys_bits; 78 __u8 x86_phys_bits;
79#endif
78 /* CPUID returned core id bits: */ 80 /* CPUID returned core id bits: */
79 __u8 x86_coreid_bits; 81 __u8 x86_coreid_bits;
80 /* Max extended CPUID function supported: */ 82 /* Max extended CPUID function supported: */
81 __u32 extended_cpuid_level; 83 __u32 extended_cpuid_level;
82#endif
83 /* Maximum supported CPUID level, -1=no CPUID: */ 84 /* Maximum supported CPUID level, -1=no CPUID: */
84 int cpuid_level; 85 int cpuid_level;
85 __u32 x86_capability[NCAPINTS]; 86 __u32 x86_capability[NCAPINTS];
@@ -140,6 +141,8 @@ DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info);
140#define current_cpu_data boot_cpu_data 141#define current_cpu_data boot_cpu_data
141#endif 142#endif
142 143
144extern const struct seq_operations cpuinfo_op;
145
143static inline int hlt_works(int cpu) 146static inline int hlt_works(int cpu)
144{ 147{
145#ifdef CONFIG_X86_32 148#ifdef CONFIG_X86_32
@@ -153,6 +156,8 @@ static inline int hlt_works(int cpu)
153 156
154extern void cpu_detect(struct cpuinfo_x86 *c); 157extern void cpu_detect(struct cpuinfo_x86 *c);
155 158
159extern struct pt_regs *idle_regs(struct pt_regs *);
160
156extern void early_cpu_init(void); 161extern void early_cpu_init(void);
157extern void identify_boot_cpu(void); 162extern void identify_boot_cpu(void);
158extern void identify_secondary_cpu(struct cpuinfo_x86 *); 163extern void identify_secondary_cpu(struct cpuinfo_x86 *);
@@ -161,11 +166,8 @@ extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
161extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 166extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
162extern unsigned short num_cache_leaves; 167extern unsigned short num_cache_leaves;
163 168
164#if defined(CONFIG_X86_HT) || defined(CONFIG_X86_64) 169extern void detect_extended_topology(struct cpuinfo_x86 *c);
165extern void detect_ht(struct cpuinfo_x86 *c); 170extern void detect_ht(struct cpuinfo_x86 *c);
166#else
167static inline void detect_ht(struct cpuinfo_x86 *c) {}
168#endif
169 171
170static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, 172static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
171 unsigned int *ecx, unsigned int *edx) 173 unsigned int *ecx, unsigned int *edx)
@@ -322,7 +324,12 @@ struct i387_fxsave_struct {
322 /* 16*16 bytes for each XMM-reg = 256 bytes: */ 324 /* 16*16 bytes for each XMM-reg = 256 bytes: */
323 u32 xmm_space[64]; 325 u32 xmm_space[64];
324 326
325 u32 padding[24]; 327 u32 padding[12];
328
329 union {
330 u32 padding1[12];
331 u32 sw_reserved[12];
332 };
326 333
327} __attribute__((aligned(16))); 334} __attribute__((aligned(16)));
328 335
@@ -346,10 +353,23 @@ struct i387_soft_struct {
346 u32 entry_eip; 353 u32 entry_eip;
347}; 354};
348 355
356struct xsave_hdr_struct {
357 u64 xstate_bv;
358 u64 reserved1[2];
359 u64 reserved2[5];
360} __attribute__((packed));
361
362struct xsave_struct {
363 struct i387_fxsave_struct i387;
364 struct xsave_hdr_struct xsave_hdr;
365 /* new processor state extensions will go here */
366} __attribute__ ((packed, aligned (64)));
367
349union thread_xstate { 368union thread_xstate {
350 struct i387_fsave_struct fsave; 369 struct i387_fsave_struct fsave;
351 struct i387_fxsave_struct fxsave; 370 struct i387_fxsave_struct fxsave;
352 struct i387_soft_struct soft; 371 struct i387_soft_struct soft;
372 struct xsave_struct xsave;
353}; 373};
354 374
355#ifdef CONFIG_X86_64 375#ifdef CONFIG_X86_64
@@ -411,9 +431,14 @@ struct thread_struct {
411 unsigned io_bitmap_max; 431 unsigned io_bitmap_max;
412/* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ 432/* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */
413 unsigned long debugctlmsr; 433 unsigned long debugctlmsr;
414/* Debug Store - if not 0 points to a DS Save Area configuration; 434#ifdef CONFIG_X86_DS
415 * goes into MSR_IA32_DS_AREA */ 435/* Debug Store context; see include/asm-x86/ds.h; goes into MSR_IA32_DS_AREA */
416 unsigned long ds_area_msr; 436 struct ds_context *ds_ctx;
437#endif /* CONFIG_X86_DS */
438#ifdef CONFIG_X86_PTRACE_BTS
439/* the signal to send on a bts buffer overflow */
440 unsigned int bts_ovfl_signal;
441#endif /* CONFIG_X86_PTRACE_BTS */
417}; 442};
418 443
419static inline unsigned long native_get_debugreg(int regno) 444static inline unsigned long native_get_debugreg(int regno)
@@ -561,41 +586,6 @@ static inline void clear_in_cr4(unsigned long mask)
561 write_cr4(cr4); 586 write_cr4(cr4);
562} 587}
563 588
564struct microcode_header {
565 unsigned int hdrver;
566 unsigned int rev;
567 unsigned int date;
568 unsigned int sig;
569 unsigned int cksum;
570 unsigned int ldrver;
571 unsigned int pf;
572 unsigned int datasize;
573 unsigned int totalsize;
574 unsigned int reserved[3];
575};
576
577struct microcode {
578 struct microcode_header hdr;
579 unsigned int bits[0];
580};
581
582typedef struct microcode microcode_t;
583typedef struct microcode_header microcode_header_t;
584
585/* microcode format is extended from prescott processors */
586struct extended_signature {
587 unsigned int sig;
588 unsigned int pf;
589 unsigned int cksum;
590};
591
592struct extended_sigtable {
593 unsigned int count;
594 unsigned int cksum;
595 unsigned int reserved[3];
596 struct extended_signature sigs[0];
597};
598
599typedef struct { 589typedef struct {
600 unsigned long seg; 590 unsigned long seg;
601} mm_segment_t; 591} mm_segment_t;
@@ -943,4 +933,4 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
943extern int get_tsc_mode(unsigned long adr); 933extern int get_tsc_mode(unsigned long adr);
944extern int set_tsc_mode(unsigned int val); 934extern int set_tsc_mode(unsigned int val);
945 935
946#endif 936#endif /* ASM_X86__PROCESSOR_H */
diff --git a/include/asm-x86/proto.h b/include/asm-x86/proto.h
index 3dd458c385c0..6e89e8b4de0e 100644
--- a/include/asm-x86/proto.h
+++ b/include/asm-x86/proto.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X8664_PROTO_H 1#ifndef ASM_X86__PROTO_H
2#define _ASM_X8664_PROTO_H 1 2#define ASM_X86__PROTO_H
3 3
4#include <asm/ldt.h> 4#include <asm/ldt.h>
5 5
@@ -29,4 +29,4 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
29#define round_up(x, y) (((x) + (y) - 1) & ~((y) - 1)) 29#define round_up(x, y) (((x) + (y) - 1) & ~((y) - 1))
30#define round_down(x, y) ((x) & ~((y) - 1)) 30#define round_down(x, y) ((x) & ~((y) - 1))
31 31
32#endif 32#endif /* ASM_X86__PROTO_H */
diff --git a/include/asm-x86/ptrace-abi.h b/include/asm-x86/ptrace-abi.h
index 72e7b9db29bb..4298b8882a78 100644
--- a/include/asm-x86/ptrace-abi.h
+++ b/include/asm-x86/ptrace-abi.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PTRACE_ABI_H 1#ifndef ASM_X86__PTRACE_ABI_H
2#define _ASM_X86_PTRACE_ABI_H 2#define ASM_X86__PTRACE_ABI_H
3 3
4#ifdef __i386__ 4#ifdef __i386__
5 5
@@ -80,8 +80,9 @@
80 80
81#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ 81#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
82 82
83#ifndef __ASSEMBLY__ 83#ifdef CONFIG_X86_PTRACE_BTS
84 84
85#ifndef __ASSEMBLY__
85#include <asm/types.h> 86#include <asm/types.h>
86 87
87/* configuration/status structure used in PTRACE_BTS_CONFIG and 88/* configuration/status structure used in PTRACE_BTS_CONFIG and
@@ -97,20 +98,20 @@ struct ptrace_bts_config {
97 /* actual size of bts_struct in bytes */ 98 /* actual size of bts_struct in bytes */
98 __u32 bts_size; 99 __u32 bts_size;
99}; 100};
100#endif 101#endif /* __ASSEMBLY__ */
101 102
102#define PTRACE_BTS_O_TRACE 0x1 /* branch trace */ 103#define PTRACE_BTS_O_TRACE 0x1 /* branch trace */
103#define PTRACE_BTS_O_SCHED 0x2 /* scheduling events w/ jiffies */ 104#define PTRACE_BTS_O_SCHED 0x2 /* scheduling events w/ jiffies */
104#define PTRACE_BTS_O_SIGNAL 0x4 /* send SIG<signal> on buffer overflow 105#define PTRACE_BTS_O_SIGNAL 0x4 /* send SIG<signal> on buffer overflow
105 instead of wrapping around */ 106 instead of wrapping around */
106#define PTRACE_BTS_O_CUT_SIZE 0x8 /* cut requested size to max available 107#define PTRACE_BTS_O_ALLOC 0x8 /* (re)allocate buffer */
107 instead of failing */
108 108
109#define PTRACE_BTS_CONFIG 40 109#define PTRACE_BTS_CONFIG 40
110/* Configure branch trace recording. 110/* Configure branch trace recording.
111 ADDR points to a struct ptrace_bts_config. 111 ADDR points to a struct ptrace_bts_config.
112 DATA gives the size of that buffer. 112 DATA gives the size of that buffer.
113 A new buffer is allocated, iff the size changes. 113 A new buffer is allocated, if requested in the flags.
114 An overflow signal may only be requested for new buffers.
114 Returns the number of bytes read. 115 Returns the number of bytes read.
115*/ 116*/
116#define PTRACE_BTS_STATUS 41 117#define PTRACE_BTS_STATUS 41
@@ -119,7 +120,7 @@ struct ptrace_bts_config {
119 Returns the number of bytes written. 120 Returns the number of bytes written.
120*/ 121*/
121#define PTRACE_BTS_SIZE 42 122#define PTRACE_BTS_SIZE 42
122/* Return the number of available BTS records. 123/* Return the number of available BTS records for draining.
123 DATA and ADDR are ignored. 124 DATA and ADDR are ignored.
124*/ 125*/
125#define PTRACE_BTS_GET 43 126#define PTRACE_BTS_GET 43
@@ -139,5 +140,6 @@ struct ptrace_bts_config {
139 BTS records are read from oldest to newest. 140 BTS records are read from oldest to newest.
140 Returns number of BTS records drained. 141 Returns number of BTS records drained.
141*/ 142*/
143#endif /* CONFIG_X86_PTRACE_BTS */
142 144
143#endif 145#endif /* ASM_X86__PTRACE_ABI_H */
diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h
index 8a71db803da6..a2025525a15a 100644
--- a/include/asm-x86/ptrace.h
+++ b/include/asm-x86/ptrace.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PTRACE_H 1#ifndef ASM_X86__PTRACE_H
2#define _ASM_X86_PTRACE_H 2#define ASM_X86__PTRACE_H
3 3
4#include <linux/compiler.h> /* For __user */ 4#include <linux/compiler.h> /* For __user */
5#include <asm/ptrace-abi.h> 5#include <asm/ptrace-abi.h>
@@ -127,26 +127,59 @@ struct pt_regs {
127#endif /* __KERNEL__ */ 127#endif /* __KERNEL__ */
128#endif /* !__i386__ */ 128#endif /* !__i386__ */
129 129
130
131#ifdef CONFIG_X86_PTRACE_BTS
132/* a branch trace record entry
133 *
134 * In order to unify the interface between various processor versions,
135 * we use the below data structure for all processors.
136 */
137enum bts_qualifier {
138 BTS_INVALID = 0,
139 BTS_BRANCH,
140 BTS_TASK_ARRIVES,
141 BTS_TASK_DEPARTS
142};
143
144struct bts_struct {
145 __u64 qualifier;
146 union {
147 /* BTS_BRANCH */
148 struct {
149 __u64 from_ip;
150 __u64 to_ip;
151 } lbr;
152 /* BTS_TASK_ARRIVES or
153 BTS_TASK_DEPARTS */
154 __u64 jiffies;
155 } variant;
156};
157#endif /* CONFIG_X86_PTRACE_BTS */
158
130#ifdef __KERNEL__ 159#ifdef __KERNEL__
131 160
132/* the DS BTS struct is used for ptrace as well */ 161#include <linux/init.h>
133#include <asm/ds.h>
134 162
163struct cpuinfo_x86;
135struct task_struct; 164struct task_struct;
136 165
166#ifdef CONFIG_X86_PTRACE_BTS
167extern void __cpuinit ptrace_bts_init_intel(struct cpuinfo_x86 *);
137extern void ptrace_bts_take_timestamp(struct task_struct *, enum bts_qualifier); 168extern void ptrace_bts_take_timestamp(struct task_struct *, enum bts_qualifier);
169#else
170#define ptrace_bts_init_intel(config) do {} while (0)
171#endif /* CONFIG_X86_PTRACE_BTS */
138 172
139extern unsigned long profile_pc(struct pt_regs *regs); 173extern unsigned long profile_pc(struct pt_regs *regs);
140 174
141extern unsigned long 175extern unsigned long
142convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); 176convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs);
143
144#ifdef CONFIG_X86_32
145extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, 177extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs,
146 int error_code); 178 int error_code, int si_code);
147#else
148void signal_fault(struct pt_regs *regs, void __user *frame, char *where); 179void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
149#endif 180
181extern long syscall_trace_enter(struct pt_regs *);
182extern void syscall_trace_leave(struct pt_regs *);
150 183
151static inline unsigned long regs_return_value(struct pt_regs *regs) 184static inline unsigned long regs_return_value(struct pt_regs *regs)
152{ 185{
@@ -213,6 +246,11 @@ static inline unsigned long frame_pointer(struct pt_regs *regs)
213 return regs->bp; 246 return regs->bp;
214} 247}
215 248
249static inline unsigned long user_stack_pointer(struct pt_regs *regs)
250{
251 return regs->sp;
252}
253
216/* 254/*
217 * These are defined as per linux/ptrace.h, which see. 255 * These are defined as per linux/ptrace.h, which see.
218 */ 256 */
@@ -239,4 +277,4 @@ extern int do_set_thread_area(struct task_struct *p, int idx,
239 277
240#endif /* !__ASSEMBLY__ */ 278#endif /* !__ASSEMBLY__ */
241 279
242#endif 280#endif /* ASM_X86__PTRACE_H */
diff --git a/include/asm-x86/pvclock-abi.h b/include/asm-x86/pvclock-abi.h
index 6857f840b243..edb3b4ecfc81 100644
--- a/include/asm-x86/pvclock-abi.h
+++ b/include/asm-x86/pvclock-abi.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_PVCLOCK_ABI_H_ 1#ifndef ASM_X86__PVCLOCK_ABI_H
2#define _ASM_X86_PVCLOCK_ABI_H_ 2#define ASM_X86__PVCLOCK_ABI_H
3#ifndef __ASSEMBLY__ 3#ifndef __ASSEMBLY__
4 4
5/* 5/*
@@ -39,4 +39,4 @@ struct pvclock_wall_clock {
39} __attribute__((__packed__)); 39} __attribute__((__packed__));
40 40
41#endif /* __ASSEMBLY__ */ 41#endif /* __ASSEMBLY__ */
42#endif /* _ASM_X86_PVCLOCK_ABI_H_ */ 42#endif /* ASM_X86__PVCLOCK_ABI_H */
diff --git a/include/asm-x86/pvclock.h b/include/asm-x86/pvclock.h
index 85b1bba8e0a3..ad29e277fd6d 100644
--- a/include/asm-x86/pvclock.h
+++ b/include/asm-x86/pvclock.h
@@ -1,13 +1,14 @@
1#ifndef _ASM_X86_PVCLOCK_H_ 1#ifndef ASM_X86__PVCLOCK_H
2#define _ASM_X86_PVCLOCK_H_ 2#define ASM_X86__PVCLOCK_H
3 3
4#include <linux/clocksource.h> 4#include <linux/clocksource.h>
5#include <asm/pvclock-abi.h> 5#include <asm/pvclock-abi.h>
6 6
7/* some helper functions for xen and kvm pv clock sources */ 7/* some helper functions for xen and kvm pv clock sources */
8cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src); 8cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src);
9unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src);
9void pvclock_read_wallclock(struct pvclock_wall_clock *wall, 10void pvclock_read_wallclock(struct pvclock_wall_clock *wall,
10 struct pvclock_vcpu_time_info *vcpu, 11 struct pvclock_vcpu_time_info *vcpu,
11 struct timespec *ts); 12 struct timespec *ts);
12 13
13#endif /* _ASM_X86_PVCLOCK_H_ */ 14#endif /* ASM_X86__PVCLOCK_H */
diff --git a/include/asm-x86/reboot.h b/include/asm-x86/reboot.h
index 206f355786dc..1c2f0ce9e31e 100644
--- a/include/asm-x86/reboot.h
+++ b/include/asm-x86/reboot.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_REBOOT_H 1#ifndef ASM_X86__REBOOT_H
2#define _ASM_REBOOT_H 2#define ASM_X86__REBOOT_H
3 3
4struct pt_regs; 4struct pt_regs;
5 5
@@ -18,4 +18,4 @@ void native_machine_crash_shutdown(struct pt_regs *regs);
18void native_machine_shutdown(void); 18void native_machine_shutdown(void);
19void machine_real_restart(const unsigned char *code, int length); 19void machine_real_restart(const unsigned char *code, int length);
20 20
21#endif /* _ASM_REBOOT_H */ 21#endif /* ASM_X86__REBOOT_H */
diff --git a/include/asm-x86/reboot_fixups.h b/include/asm-x86/reboot_fixups.h
index 0cb7d87c2b68..2c2987d97570 100644
--- a/include/asm-x86/reboot_fixups.h
+++ b/include/asm-x86/reboot_fixups.h
@@ -1,6 +1,6 @@
1#ifndef _LINUX_REBOOT_FIXUPS_H 1#ifndef ASM_X86__REBOOT_FIXUPS_H
2#define _LINUX_REBOOT_FIXUPS_H 2#define ASM_X86__REBOOT_FIXUPS_H
3 3
4extern void mach_reboot_fixups(void); 4extern void mach_reboot_fixups(void);
5 5
6#endif /* _LINUX_REBOOT_FIXUPS_H */ 6#endif /* ASM_X86__REBOOT_FIXUPS_H */
diff --git a/include/asm-x86/required-features.h b/include/asm-x86/required-features.h
index adec887dd7cd..a01c4e376331 100644
--- a/include/asm-x86/required-features.h
+++ b/include/asm-x86/required-features.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_REQUIRED_FEATURES_H 1#ifndef ASM_X86__REQUIRED_FEATURES_H
2#define _ASM_REQUIRED_FEATURES_H 1 2#define ASM_X86__REQUIRED_FEATURES_H
3 3
4/* Define minimum CPUID feature set for kernel These bits are checked 4/* Define minimum CPUID feature set for kernel These bits are checked
5 really early to actually display a visible error message before the 5 really early to actually display a visible error message before the
@@ -41,6 +41,12 @@
41# define NEED_3DNOW 0 41# define NEED_3DNOW 0
42#endif 42#endif
43 43
44#if defined(CONFIG_X86_P6_NOP) || defined(CONFIG_X86_64)
45# define NEED_NOPL (1<<(X86_FEATURE_NOPL & 31))
46#else
47# define NEED_NOPL 0
48#endif
49
44#ifdef CONFIG_X86_64 50#ifdef CONFIG_X86_64
45#define NEED_PSE 0 51#define NEED_PSE 0
46#define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) 52#define NEED_MSR (1<<(X86_FEATURE_MSR & 31))
@@ -67,10 +73,10 @@
67#define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW) 73#define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW)
68 74
69#define REQUIRED_MASK2 0 75#define REQUIRED_MASK2 0
70#define REQUIRED_MASK3 0 76#define REQUIRED_MASK3 (NEED_NOPL)
71#define REQUIRED_MASK4 0 77#define REQUIRED_MASK4 0
72#define REQUIRED_MASK5 0 78#define REQUIRED_MASK5 0
73#define REQUIRED_MASK6 0 79#define REQUIRED_MASK6 0
74#define REQUIRED_MASK7 0 80#define REQUIRED_MASK7 0
75 81
76#endif 82#endif /* ASM_X86__REQUIRED_FEATURES_H */
diff --git a/include/asm-x86/resume-trace.h b/include/asm-x86/resume-trace.h
index 8d9f0b41ee86..e39376d7de50 100644
--- a/include/asm-x86/resume-trace.h
+++ b/include/asm-x86/resume-trace.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_RESUME_TRACE_H 1#ifndef ASM_X86__RESUME_TRACE_H
2#define _ASM_X86_RESUME_TRACE_H 2#define ASM_X86__RESUME_TRACE_H
3 3
4#include <asm/asm.h> 4#include <asm/asm.h>
5 5
@@ -7,7 +7,7 @@
7do { \ 7do { \
8 if (pm_trace_enabled) { \ 8 if (pm_trace_enabled) { \
9 const void *tracedata; \ 9 const void *tracedata; \
10 asm volatile(_ASM_MOV_UL " $1f,%0\n" \ 10 asm volatile(_ASM_MOV " $1f,%0\n" \
11 ".section .tracedata,\"a\"\n" \ 11 ".section .tracedata,\"a\"\n" \
12 "1:\t.word %c1\n\t" \ 12 "1:\t.word %c1\n\t" \
13 _ASM_PTR " %c2\n" \ 13 _ASM_PTR " %c2\n" \
@@ -18,4 +18,4 @@ do { \
18 } \ 18 } \
19} while (0) 19} while (0)
20 20
21#endif 21#endif /* ASM_X86__RESUME_TRACE_H */
diff --git a/include/asm-x86/rio.h b/include/asm-x86/rio.h
index c9448bd8968f..5e1256bdee83 100644
--- a/include/asm-x86/rio.h
+++ b/include/asm-x86/rio.h
@@ -5,8 +5,8 @@
5 * Author: Laurent Vivier <Laurent.Vivier@bull.net> 5 * Author: Laurent Vivier <Laurent.Vivier@bull.net>
6 */ 6 */
7 7
8#ifndef __ASM_RIO_H 8#ifndef ASM_X86__RIO_H
9#define __ASM_RIO_H 9#define ASM_X86__RIO_H
10 10
11#define RIO_TABLE_VERSION 3 11#define RIO_TABLE_VERSION 3
12 12
@@ -60,4 +60,4 @@ enum {
60 ALT_CALGARY = 5, /* Second Planar Calgary */ 60 ALT_CALGARY = 5, /* Second Planar Calgary */
61}; 61};
62 62
63#endif /* __ASM_RIO_H */ 63#endif /* ASM_X86__RIO_H */
diff --git a/include/asm-x86/rwlock.h b/include/asm-x86/rwlock.h
index 6a8c0d645108..48a3109e1a7d 100644
--- a/include/asm-x86/rwlock.h
+++ b/include/asm-x86/rwlock.h
@@ -1,8 +1,8 @@
1#ifndef _ASM_X86_RWLOCK_H 1#ifndef ASM_X86__RWLOCK_H
2#define _ASM_X86_RWLOCK_H 2#define ASM_X86__RWLOCK_H
3 3
4#define RW_LOCK_BIAS 0x01000000 4#define RW_LOCK_BIAS 0x01000000
5 5
6/* Actual code is in asm/spinlock.h or in arch/x86/lib/rwlock.S */ 6/* Actual code is in asm/spinlock.h or in arch/x86/lib/rwlock.S */
7 7
8#endif /* _ASM_X86_RWLOCK_H */ 8#endif /* ASM_X86__RWLOCK_H */
diff --git a/include/asm-x86/rwsem.h b/include/asm-x86/rwsem.h
index 750f2a3542b3..3ff3015b71a8 100644
--- a/include/asm-x86/rwsem.h
+++ b/include/asm-x86/rwsem.h
@@ -29,8 +29,8 @@
29 * front, then they'll all be woken up, but no other readers will be. 29 * front, then they'll all be woken up, but no other readers will be.
30 */ 30 */
31 31
32#ifndef _I386_RWSEM_H 32#ifndef ASM_X86__RWSEM_H
33#define _I386_RWSEM_H 33#define ASM_X86__RWSEM_H
34 34
35#ifndef _LINUX_RWSEM_H 35#ifndef _LINUX_RWSEM_H
36#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" 36#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead"
@@ -262,4 +262,4 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem)
262} 262}
263 263
264#endif /* __KERNEL__ */ 264#endif /* __KERNEL__ */
265#endif /* _I386_RWSEM_H */ 265#endif /* ASM_X86__RWSEM_H */
diff --git a/include/asm-x86/scatterlist.h b/include/asm-x86/scatterlist.h
index c0432061f81a..ee48f880005d 100644
--- a/include/asm-x86/scatterlist.h
+++ b/include/asm-x86/scatterlist.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SCATTERLIST_H 1#ifndef ASM_X86__SCATTERLIST_H
2#define _ASM_X86_SCATTERLIST_H 2#define ASM_X86__SCATTERLIST_H
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5 5
@@ -30,4 +30,4 @@ struct scatterlist {
30# define sg_dma_len(sg) ((sg)->dma_length) 30# define sg_dma_len(sg) ((sg)->dma_length)
31#endif 31#endif
32 32
33#endif 33#endif /* ASM_X86__SCATTERLIST_H */
diff --git a/include/asm-x86/seccomp_32.h b/include/asm-x86/seccomp_32.h
index 36e71c5f306f..cf9ab2dbcef1 100644
--- a/include/asm-x86/seccomp_32.h
+++ b/include/asm-x86/seccomp_32.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_SECCOMP_H 1#ifndef ASM_X86__SECCOMP_32_H
2#define _ASM_SECCOMP_H 2#define ASM_X86__SECCOMP_32_H
3 3
4#include <linux/thread_info.h> 4#include <linux/thread_info.h>
5 5
@@ -14,4 +14,4 @@
14#define __NR_seccomp_exit __NR_exit 14#define __NR_seccomp_exit __NR_exit
15#define __NR_seccomp_sigreturn __NR_sigreturn 15#define __NR_seccomp_sigreturn __NR_sigreturn
16 16
17#endif /* _ASM_SECCOMP_H */ 17#endif /* ASM_X86__SECCOMP_32_H */
diff --git a/include/asm-x86/seccomp_64.h b/include/asm-x86/seccomp_64.h
index 76cfe69aa63c..03274cea751f 100644
--- a/include/asm-x86/seccomp_64.h
+++ b/include/asm-x86/seccomp_64.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_SECCOMP_H 1#ifndef ASM_X86__SECCOMP_64_H
2#define _ASM_SECCOMP_H 2#define ASM_X86__SECCOMP_64_H
3 3
4#include <linux/thread_info.h> 4#include <linux/thread_info.h>
5 5
@@ -22,4 +22,4 @@
22#define __NR_seccomp_exit_32 __NR_ia32_exit 22#define __NR_seccomp_exit_32 __NR_ia32_exit
23#define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn 23#define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn
24 24
25#endif /* _ASM_SECCOMP_H */ 25#endif /* ASM_X86__SECCOMP_64_H */
diff --git a/include/asm-x86/segment.h b/include/asm-x86/segment.h
index 646452ea9ea3..5d6e69454891 100644
--- a/include/asm-x86/segment.h
+++ b/include/asm-x86/segment.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SEGMENT_H_ 1#ifndef ASM_X86__SEGMENT_H
2#define _ASM_X86_SEGMENT_H_ 2#define ASM_X86__SEGMENT_H
3 3
4/* Constructor for a conventional segment GDT (or LDT) entry */ 4/* Constructor for a conventional segment GDT (or LDT) entry */
5/* This is a macro so it can be used in initializers */ 5/* This is a macro so it can be used in initializers */
@@ -131,12 +131,6 @@
131 * Matching rules for certain types of segments. 131 * Matching rules for certain types of segments.
132 */ 132 */
133 133
134/* Matches only __KERNEL_CS, ignoring PnP / USER / APM segments */
135#define SEGMENT_IS_KERNEL_CODE(x) (((x) & 0xfc) == GDT_ENTRY_KERNEL_CS * 8)
136
137/* Matches __KERNEL_CS and __USER_CS (they must be 2 entries apart) */
138#define SEGMENT_IS_FLAT_CODE(x) (((x) & 0xec) == GDT_ENTRY_KERNEL_CS * 8)
139
140/* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */ 134/* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */
141#define SEGMENT_IS_PNP_CODE(x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8) 135#define SEGMENT_IS_PNP_CODE(x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8)
142 136
@@ -212,4 +206,4 @@ extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][10];
212#endif 206#endif
213#endif 207#endif
214 208
215#endif 209#endif /* ASM_X86__SEGMENT_H */
diff --git a/include/asm-x86/sembuf.h b/include/asm-x86/sembuf.h
index ee50c801f7b7..81f06b7e5a3f 100644
--- a/include/asm-x86/sembuf.h
+++ b/include/asm-x86/sembuf.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SEMBUF_H 1#ifndef ASM_X86__SEMBUF_H
2#define _ASM_X86_SEMBUF_H 2#define ASM_X86__SEMBUF_H
3 3
4/* 4/*
5 * The semid64_ds structure for x86 architecture. 5 * The semid64_ds structure for x86 architecture.
@@ -21,4 +21,4 @@ struct semid64_ds {
21 unsigned long __unused4; 21 unsigned long __unused4;
22}; 22};
23 23
24#endif /* _ASM_X86_SEMBUF_H */ 24#endif /* ASM_X86__SEMBUF_H */
diff --git a/include/asm-x86/serial.h b/include/asm-x86/serial.h
index 628c801535ea..303660b671e5 100644
--- a/include/asm-x86/serial.h
+++ b/include/asm-x86/serial.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SERIAL_H 1#ifndef ASM_X86__SERIAL_H
2#define _ASM_X86_SERIAL_H 2#define ASM_X86__SERIAL_H
3 3
4/* 4/*
5 * This assumes you have a 1.8432 MHz clock for your UART. 5 * This assumes you have a 1.8432 MHz clock for your UART.
@@ -26,4 +26,4 @@
26 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 26 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
27 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 27 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
28 28
29#endif /* _ASM_X86_SERIAL_H */ 29#endif /* ASM_X86__SERIAL_H */
diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h
index a07c6f1c01e1..11b6cc14b289 100644
--- a/include/asm-x86/setup.h
+++ b/include/asm-x86/setup.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SETUP_H 1#ifndef ASM_X86__SETUP_H
2#define _ASM_X86_SETUP_H 2#define ASM_X86__SETUP_H
3 3
4#define COMMAND_LINE_SIZE 2048 4#define COMMAND_LINE_SIZE 2048
5 5
@@ -38,9 +38,11 @@ struct x86_quirks {
38 void (*mpc_oem_pci_bus)(struct mpc_config_bus *m); 38 void (*mpc_oem_pci_bus)(struct mpc_config_bus *m);
39 void (*smp_read_mpc_oem)(struct mp_config_oemtable *oemtable, 39 void (*smp_read_mpc_oem)(struct mp_config_oemtable *oemtable,
40 unsigned short oemsize); 40 unsigned short oemsize);
41 int (*setup_ioapic_ids)(void);
41}; 42};
42 43
43extern struct x86_quirks *x86_quirks; 44extern struct x86_quirks *x86_quirks;
45extern unsigned long saved_video_mode;
44 46
45#ifndef CONFIG_PARAVIRT 47#ifndef CONFIG_PARAVIRT
46#define paravirt_post_allocator_init() do {} while (0) 48#define paravirt_post_allocator_init() do {} while (0)
@@ -100,4 +102,4 @@ void __init x86_64_start_reservations(char *real_mode_data);
100#endif /* __ASSEMBLY__ */ 102#endif /* __ASSEMBLY__ */
101#endif /* __KERNEL__ */ 103#endif /* __KERNEL__ */
102 104
103#endif /* _ASM_X86_SETUP_H */ 105#endif /* ASM_X86__SETUP_H */
diff --git a/include/asm-x86/shmbuf.h b/include/asm-x86/shmbuf.h
index b51413b74971..f51aec2298e9 100644
--- a/include/asm-x86/shmbuf.h
+++ b/include/asm-x86/shmbuf.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SHMBUF_H 1#ifndef ASM_X86__SHMBUF_H
2#define _ASM_X86_SHMBUF_H 2#define ASM_X86__SHMBUF_H
3 3
4/* 4/*
5 * The shmid64_ds structure for x86 architecture. 5 * The shmid64_ds structure for x86 architecture.
@@ -48,4 +48,4 @@ struct shminfo64 {
48 unsigned long __unused4; 48 unsigned long __unused4;
49}; 49};
50 50
51#endif /* _ASM_X86_SHMBUF_H */ 51#endif /* ASM_X86__SHMBUF_H */
diff --git a/include/asm-x86/shmparam.h b/include/asm-x86/shmparam.h
index 0880cf0917b9..a83a1fd96a0e 100644
--- a/include/asm-x86/shmparam.h
+++ b/include/asm-x86/shmparam.h
@@ -1,6 +1,6 @@
1#ifndef _ASM_X86_SHMPARAM_H 1#ifndef ASM_X86__SHMPARAM_H
2#define _ASM_X86_SHMPARAM_H 2#define ASM_X86__SHMPARAM_H
3 3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ 4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5 5
6#endif /* _ASM_X86_SHMPARAM_H */ 6#endif /* ASM_X86__SHMPARAM_H */
diff --git a/include/asm-x86/sigcontext.h b/include/asm-x86/sigcontext.h
index 2f9c884d2c0f..ee813f4fe5d5 100644
--- a/include/asm-x86/sigcontext.h
+++ b/include/asm-x86/sigcontext.h
@@ -1,9 +1,43 @@
1#ifndef _ASM_X86_SIGCONTEXT_H 1#ifndef ASM_X86__SIGCONTEXT_H
2#define _ASM_X86_SIGCONTEXT_H 2#define ASM_X86__SIGCONTEXT_H
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <asm/types.h> 5#include <asm/types.h>
6 6
7#define FP_XSTATE_MAGIC1 0x46505853U
8#define FP_XSTATE_MAGIC2 0x46505845U
9#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
10
11/*
12 * bytes 464..511 in the current 512byte layout of fxsave/fxrstor frame
13 * are reserved for SW usage. On cpu's supporting xsave/xrstor, these bytes
14 * are used to extended the fpstate pointer in the sigcontext, which now
15 * includes the extended state information along with fpstate information.
16 *
17 * Presence of FP_XSTATE_MAGIC1 at the beginning of this SW reserved
18 * area and FP_XSTATE_MAGIC2 at the end of memory layout
19 * (extended_size - FP_XSTATE_MAGIC2_SIZE) indicates the presence of the
20 * extended state information in the memory layout pointed by the fpstate
21 * pointer in sigcontext.
22 */
23struct _fpx_sw_bytes {
24 __u32 magic1; /* FP_XSTATE_MAGIC1 */
25 __u32 extended_size; /* total size of the layout referred by
26 * fpstate pointer in the sigcontext.
27 */
28 __u64 xstate_bv;
29 /* feature bit mask (including fp/sse/extended
30 * state) that is present in the memory
31 * layout.
32 */
33 __u32 xstate_size; /* actual xsave state size, based on the
34 * features saved in the layout.
35 * 'extended_size' will be greater than
36 * 'xstate_size'.
37 */
38 __u32 padding[7]; /* for future use. */
39};
40
7#ifdef __i386__ 41#ifdef __i386__
8/* 42/*
9 * As documented in the iBCS2 standard.. 43 * As documented in the iBCS2 standard..
@@ -53,7 +87,13 @@ struct _fpstate {
53 unsigned long reserved; 87 unsigned long reserved;
54 struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */ 88 struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
55 struct _xmmreg _xmm[8]; 89 struct _xmmreg _xmm[8];
56 unsigned long padding[56]; 90 unsigned long padding1[44];
91
92 union {
93 unsigned long padding2[12];
94 struct _fpx_sw_bytes sw_reserved; /* represents the extended
95 * state info */
96 };
57}; 97};
58 98
59#define X86_FXSR_MAGIC 0x0000 99#define X86_FXSR_MAGIC 0x0000
@@ -79,7 +119,15 @@ struct sigcontext {
79 unsigned long flags; 119 unsigned long flags;
80 unsigned long sp_at_signal; 120 unsigned long sp_at_signal;
81 unsigned short ss, __ssh; 121 unsigned short ss, __ssh;
82 struct _fpstate __user *fpstate; 122
123 /*
124 * fpstate is really (struct _fpstate *) or (struct _xstate *)
125 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
126 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
127 * of extended memory layout. See comments at the defintion of
128 * (struct _fpx_sw_bytes)
129 */
130 void __user *fpstate; /* zero when no FPU/extended context */
83 unsigned long oldmask; 131 unsigned long oldmask;
84 unsigned long cr2; 132 unsigned long cr2;
85}; 133};
@@ -130,7 +178,12 @@ struct _fpstate {
130 __u32 mxcsr_mask; 178 __u32 mxcsr_mask;
131 __u32 st_space[32]; /* 8*16 bytes for each FP-reg */ 179 __u32 st_space[32]; /* 8*16 bytes for each FP-reg */
132 __u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg */ 180 __u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg */
133 __u32 reserved2[24]; 181 __u32 reserved2[12];
182 union {
183 __u32 reserved3[12];
184 struct _fpx_sw_bytes sw_reserved; /* represents the extended
185 * state information */
186 };
134}; 187};
135 188
136#ifdef __KERNEL__ 189#ifdef __KERNEL__
@@ -161,7 +214,15 @@ struct sigcontext {
161 unsigned long trapno; 214 unsigned long trapno;
162 unsigned long oldmask; 215 unsigned long oldmask;
163 unsigned long cr2; 216 unsigned long cr2;
164 struct _fpstate __user *fpstate; /* zero when no FPU context */ 217
218 /*
219 * fpstate is really (struct _fpstate *) or (struct _xstate *)
220 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
221 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
222 * of extended memory layout. See comments at the defintion of
223 * (struct _fpx_sw_bytes)
224 */
225 void __user *fpstate; /* zero when no FPU/extended context */
165 unsigned long reserved1[8]; 226 unsigned long reserved1[8];
166}; 227};
167#else /* __KERNEL__ */ 228#else /* __KERNEL__ */
@@ -202,4 +263,22 @@ struct sigcontext {
202 263
203#endif /* !__i386__ */ 264#endif /* !__i386__ */
204 265
205#endif 266struct _xsave_hdr {
267 __u64 xstate_bv;
268 __u64 reserved1[2];
269 __u64 reserved2[5];
270};
271
272/*
273 * Extended state pointed by the fpstate pointer in the sigcontext.
274 * In addition to the fpstate, information encoded in the xstate_hdr
275 * indicates the presence of other extended state information
276 * supported by the processor and OS.
277 */
278struct _xstate {
279 struct _fpstate fpstate;
280 struct _xsave_hdr xstate_hdr;
281 /* new processor state extensions go here */
282};
283
284#endif /* ASM_X86__SIGCONTEXT_H */
diff --git a/include/asm-x86/sigcontext32.h b/include/asm-x86/sigcontext32.h
index 57a9686fb491..8c347032c2f2 100644
--- a/include/asm-x86/sigcontext32.h
+++ b/include/asm-x86/sigcontext32.h
@@ -1,5 +1,5 @@
1#ifndef _SIGCONTEXT32_H 1#ifndef ASM_X86__SIGCONTEXT32_H
2#define _SIGCONTEXT32_H 1 2#define ASM_X86__SIGCONTEXT32_H
3 3
4/* signal context for 32bit programs. */ 4/* signal context for 32bit programs. */
5 5
@@ -40,7 +40,11 @@ struct _fpstate_ia32 {
40 __u32 reserved; 40 __u32 reserved;
41 struct _fpxreg _fxsr_st[8]; 41 struct _fpxreg _fxsr_st[8];
42 struct _xmmreg _xmm[8]; /* It's actually 16 */ 42 struct _xmmreg _xmm[8]; /* It's actually 16 */
43 __u32 padding[56]; 43 __u32 padding[44];
44 union {
45 __u32 padding2[12];
46 struct _fpx_sw_bytes sw_reserved;
47 };
44}; 48};
45 49
46struct sigcontext_ia32 { 50struct sigcontext_ia32 {
@@ -68,4 +72,4 @@ struct sigcontext_ia32 {
68 unsigned int cr2; 72 unsigned int cr2;
69}; 73};
70 74
71#endif 75#endif /* ASM_X86__SIGCONTEXT32_H */
diff --git a/include/asm-x86/siginfo.h b/include/asm-x86/siginfo.h
index a477bea0c2a1..808bdfb2958c 100644
--- a/include/asm-x86/siginfo.h
+++ b/include/asm-x86/siginfo.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SIGINFO_H 1#ifndef ASM_X86__SIGINFO_H
2#define _ASM_X86_SIGINFO_H 2#define ASM_X86__SIGINFO_H
3 3
4#ifdef __x86_64__ 4#ifdef __x86_64__
5# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 5# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
@@ -7,4 +7,4 @@
7 7
8#include <asm-generic/siginfo.h> 8#include <asm-generic/siginfo.h>
9 9
10#endif 10#endif /* ASM_X86__SIGINFO_H */
diff --git a/include/asm-x86/signal.h b/include/asm-x86/signal.h
index 6dac49364e95..65acc82d267a 100644
--- a/include/asm-x86/signal.h
+++ b/include/asm-x86/signal.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SIGNAL_H 1#ifndef ASM_X86__SIGNAL_H
2#define _ASM_X86_SIGNAL_H 2#define ASM_X86__SIGNAL_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <linux/types.h> 5#include <linux/types.h>
@@ -140,6 +140,9 @@ struct sigaction {
140struct k_sigaction { 140struct k_sigaction {
141 struct sigaction sa; 141 struct sigaction sa;
142}; 142};
143
144extern void do_notify_resume(struct pt_regs *, void *, __u32);
145
143# else /* __KERNEL__ */ 146# else /* __KERNEL__ */
144/* Here we must cater to libcs that poke about in kernel headers. */ 147/* Here we must cater to libcs that poke about in kernel headers. */
145 148
@@ -256,4 +259,4 @@ struct pt_regs;
256#endif /* __KERNEL__ */ 259#endif /* __KERNEL__ */
257#endif /* __ASSEMBLY__ */ 260#endif /* __ASSEMBLY__ */
258 261
259#endif 262#endif /* ASM_X86__SIGNAL_H */
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h
index 3c877f74f279..a6afc29f2dd9 100644
--- a/include/asm-x86/smp.h
+++ b/include/asm-x86/smp.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SMP_H_ 1#ifndef ASM_X86__SMP_H
2#define _ASM_X86_SMP_H_ 2#define ASM_X86__SMP_H
3#ifndef __ASSEMBLY__ 3#ifndef __ASSEMBLY__
4#include <linux/cpumask.h> 4#include <linux/cpumask.h>
5#include <linux/init.h> 5#include <linux/init.h>
@@ -34,6 +34,9 @@ extern cpumask_t cpu_initialized;
34DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 34DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
35DECLARE_PER_CPU(cpumask_t, cpu_core_map); 35DECLARE_PER_CPU(cpumask_t, cpu_core_map);
36DECLARE_PER_CPU(u16, cpu_llc_id); 36DECLARE_PER_CPU(u16, cpu_llc_id);
37#ifdef CONFIG_X86_32
38DECLARE_PER_CPU(int, cpu_number);
39#endif
37 40
38DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); 41DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid);
39DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); 42DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
@@ -47,12 +50,16 @@ extern struct {
47struct smp_ops { 50struct smp_ops {
48 void (*smp_prepare_boot_cpu)(void); 51 void (*smp_prepare_boot_cpu)(void);
49 void (*smp_prepare_cpus)(unsigned max_cpus); 52 void (*smp_prepare_cpus)(unsigned max_cpus);
50 int (*cpu_up)(unsigned cpu);
51 void (*smp_cpus_done)(unsigned max_cpus); 53 void (*smp_cpus_done)(unsigned max_cpus);
52 54
53 void (*smp_send_stop)(void); 55 void (*smp_send_stop)(void);
54 void (*smp_send_reschedule)(int cpu); 56 void (*smp_send_reschedule)(int cpu);
55 57
58 int (*cpu_up)(unsigned cpu);
59 int (*cpu_disable)(void);
60 void (*cpu_die)(unsigned int cpu);
61 void (*play_dead)(void);
62
56 void (*send_call_func_ipi)(cpumask_t mask); 63 void (*send_call_func_ipi)(cpumask_t mask);
57 void (*send_call_func_single_ipi)(int cpu); 64 void (*send_call_func_single_ipi)(int cpu);
58}; 65};
@@ -91,6 +98,21 @@ static inline int __cpu_up(unsigned int cpu)
91 return smp_ops.cpu_up(cpu); 98 return smp_ops.cpu_up(cpu);
92} 99}
93 100
101static inline int __cpu_disable(void)
102{
103 return smp_ops.cpu_disable();
104}
105
106static inline void __cpu_die(unsigned int cpu)
107{
108 smp_ops.cpu_die(cpu);
109}
110
111static inline void play_dead(void)
112{
113 smp_ops.play_dead();
114}
115
94static inline void smp_send_reschedule(int cpu) 116static inline void smp_send_reschedule(int cpu)
95{ 117{
96 smp_ops.smp_send_reschedule(cpu); 118 smp_ops.smp_send_reschedule(cpu);
@@ -106,15 +128,20 @@ static inline void arch_send_call_function_ipi(cpumask_t mask)
106 smp_ops.send_call_func_ipi(mask); 128 smp_ops.send_call_func_ipi(mask);
107} 129}
108 130
131void cpu_disable_common(void);
109void native_smp_prepare_boot_cpu(void); 132void native_smp_prepare_boot_cpu(void);
110void native_smp_prepare_cpus(unsigned int max_cpus); 133void native_smp_prepare_cpus(unsigned int max_cpus);
111void native_smp_cpus_done(unsigned int max_cpus); 134void native_smp_cpus_done(unsigned int max_cpus);
112int native_cpu_up(unsigned int cpunum); 135int native_cpu_up(unsigned int cpunum);
136int native_cpu_disable(void);
137void native_cpu_die(unsigned int cpu);
138void native_play_dead(void);
139void play_dead_common(void);
140
113void native_send_call_func_ipi(cpumask_t mask); 141void native_send_call_func_ipi(cpumask_t mask);
114void native_send_call_func_single_ipi(int cpu); 142void native_send_call_func_single_ipi(int cpu);
115 143
116extern int __cpu_disable(void); 144extern void prefill_possible_map(void);
117extern void __cpu_die(unsigned int cpu);
118 145
119void smp_store_cpu_info(int id); 146void smp_store_cpu_info(int id);
120#define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu) 147#define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu)
@@ -124,15 +151,11 @@ static inline int num_booting_cpus(void)
124{ 151{
125 return cpus_weight(cpu_callout_map); 152 return cpus_weight(cpu_callout_map);
126} 153}
127#endif /* CONFIG_SMP */
128
129#if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_CPU)
130extern void prefill_possible_map(void);
131#else 154#else
132static inline void prefill_possible_map(void) 155static inline void prefill_possible_map(void)
133{ 156{
134} 157}
135#endif 158#endif /* CONFIG_SMP */
136 159
137extern unsigned disabled_cpus __cpuinitdata; 160extern unsigned disabled_cpus __cpuinitdata;
138 161
@@ -142,7 +165,6 @@ extern unsigned disabled_cpus __cpuinitdata;
142 * from the initial startup. We map APIC_BASE very early in page_setup(), 165 * from the initial startup. We map APIC_BASE very early in page_setup(),
143 * so this is correct in the x86 case. 166 * so this is correct in the x86 case.
144 */ 167 */
145DECLARE_PER_CPU(int, cpu_number);
146#define raw_smp_processor_id() (x86_read_percpu(cpu_number)) 168#define raw_smp_processor_id() (x86_read_percpu(cpu_number))
147extern int safe_smp_processor_id(void); 169extern int safe_smp_processor_id(void);
148 170
@@ -165,30 +187,33 @@ extern int safe_smp_processor_id(void);
165 187
166#ifdef CONFIG_X86_LOCAL_APIC 188#ifdef CONFIG_X86_LOCAL_APIC
167 189
190#ifndef CONFIG_X86_64
168static inline int logical_smp_processor_id(void) 191static inline int logical_smp_processor_id(void)
169{ 192{
170 /* we don't want to mark this access volatile - bad code generation */ 193 /* we don't want to mark this access volatile - bad code generation */
171 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); 194 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
172} 195}
173 196
174#ifndef CONFIG_X86_64 197#include <mach_apicdef.h>
175static inline unsigned int read_apic_id(void) 198static inline unsigned int read_apic_id(void)
176{ 199{
177 return *(u32 *)(APIC_BASE + APIC_ID); 200 unsigned int reg;
201
202 reg = *(u32 *)(APIC_BASE + APIC_ID);
203
204 return GET_APIC_ID(reg);
178} 205}
179#else
180extern unsigned int read_apic_id(void);
181#endif 206#endif
182 207
183 208
184# ifdef APIC_DEFINITION 209# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
185extern int hard_smp_processor_id(void); 210extern int hard_smp_processor_id(void);
186# else 211# else
187# include <mach_apicdef.h> 212#include <mach_apicdef.h>
188static inline int hard_smp_processor_id(void) 213static inline int hard_smp_processor_id(void)
189{ 214{
190 /* we don't want to mark this access volatile - bad code generation */ 215 /* we don't want to mark this access volatile - bad code generation */
191 return GET_APIC_ID(read_apic_id()); 216 return read_apic_id();
192} 217}
193# endif /* APIC_DEFINITION */ 218# endif /* APIC_DEFINITION */
194 219
@@ -200,9 +225,5 @@ static inline int hard_smp_processor_id(void)
200 225
201#endif /* CONFIG_X86_LOCAL_APIC */ 226#endif /* CONFIG_X86_LOCAL_APIC */
202 227
203#ifdef CONFIG_HOTPLUG_CPU
204extern void cpu_uninit(void);
205#endif
206
207#endif /* __ASSEMBLY__ */ 228#endif /* __ASSEMBLY__ */
208#endif 229#endif /* ASM_X86__SMP_H */
diff --git a/include/asm-x86/socket.h b/include/asm-x86/socket.h
index 80af9c4ccad7..db73274c83c3 100644
--- a/include/asm-x86/socket.h
+++ b/include/asm-x86/socket.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_SOCKET_H 1#ifndef ASM_X86__SOCKET_H
2#define _ASM_SOCKET_H 2#define ASM_X86__SOCKET_H
3 3
4#include <asm/sockios.h> 4#include <asm/sockios.h>
5 5
@@ -54,4 +54,4 @@
54 54
55#define SO_MARK 36 55#define SO_MARK 36
56 56
57#endif /* _ASM_SOCKET_H */ 57#endif /* ASM_X86__SOCKET_H */
diff --git a/include/asm-x86/sockios.h b/include/asm-x86/sockios.h
index 49cc72b5d3c9..a006704fdc84 100644
--- a/include/asm-x86/sockios.h
+++ b/include/asm-x86/sockios.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SOCKIOS_H 1#ifndef ASM_X86__SOCKIOS_H
2#define _ASM_X86_SOCKIOS_H 2#define ASM_X86__SOCKIOS_H
3 3
4/* Socket-level I/O control calls. */ 4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901 5#define FIOSETOWN 0x8901
@@ -10,4 +10,4 @@
10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ 10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ 11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
12 12
13#endif /* _ASM_X86_SOCKIOS_H */ 13#endif /* ASM_X86__SOCKIOS_H */
diff --git a/include/asm-x86/sparsemem.h b/include/asm-x86/sparsemem.h
index 9bd48b0a534b..38f8e6bc3186 100644
--- a/include/asm-x86/sparsemem.h
+++ b/include/asm-x86/sparsemem.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SPARSEMEM_H 1#ifndef ASM_X86__SPARSEMEM_H
2#define _ASM_X86_SPARSEMEM_H 2#define ASM_X86__SPARSEMEM_H
3 3
4#ifdef CONFIG_SPARSEMEM 4#ifdef CONFIG_SPARSEMEM
5/* 5/*
@@ -31,4 +31,4 @@
31#endif 31#endif
32 32
33#endif /* CONFIG_SPARSEMEM */ 33#endif /* CONFIG_SPARSEMEM */
34#endif 34#endif /* ASM_X86__SPARSEMEM_H */
diff --git a/include/asm-x86/spinlock.h b/include/asm-x86/spinlock.h
index e39c790dbfd2..157ff7fab97a 100644
--- a/include/asm-x86/spinlock.h
+++ b/include/asm-x86/spinlock.h
@@ -1,5 +1,5 @@
1#ifndef _X86_SPINLOCK_H_ 1#ifndef ASM_X86__SPINLOCK_H
2#define _X86_SPINLOCK_H_ 2#define ASM_X86__SPINLOCK_H
3 3
4#include <asm/atomic.h> 4#include <asm/atomic.h>
5#include <asm/rwlock.h> 5#include <asm/rwlock.h>
@@ -21,8 +21,10 @@
21 21
22#ifdef CONFIG_X86_32 22#ifdef CONFIG_X86_32
23# define LOCK_PTR_REG "a" 23# define LOCK_PTR_REG "a"
24# define REG_PTR_MODE "k"
24#else 25#else
25# define LOCK_PTR_REG "D" 26# define LOCK_PTR_REG "D"
27# define REG_PTR_MODE "q"
26#endif 28#endif
27 29
28#if defined(CONFIG_X86_32) && \ 30#if defined(CONFIG_X86_32) && \
@@ -54,19 +56,7 @@
54 * much between them in performance though, especially as locks are out of line. 56 * much between them in performance though, especially as locks are out of line.
55 */ 57 */
56#if (NR_CPUS < 256) 58#if (NR_CPUS < 256)
57static inline int __ticket_spin_is_locked(raw_spinlock_t *lock) 59#define TICKET_SHIFT 8
58{
59 int tmp = ACCESS_ONCE(lock->slock);
60
61 return (((tmp >> 8) & 0xff) != (tmp & 0xff));
62}
63
64static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
65{
66 int tmp = ACCESS_ONCE(lock->slock);
67
68 return (((tmp >> 8) - tmp) & 0xff) > 1;
69}
70 60
71static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock) 61static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
72{ 62{
@@ -89,19 +79,17 @@ static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
89 79
90static __always_inline int __ticket_spin_trylock(raw_spinlock_t *lock) 80static __always_inline int __ticket_spin_trylock(raw_spinlock_t *lock)
91{ 81{
92 int tmp; 82 int tmp, new;
93 short new;
94 83
95 asm volatile("movw %2,%w0\n\t" 84 asm volatile("movzwl %2, %0\n\t"
96 "cmpb %h0,%b0\n\t" 85 "cmpb %h0,%b0\n\t"
86 "leal 0x100(%" REG_PTR_MODE "0), %1\n\t"
97 "jne 1f\n\t" 87 "jne 1f\n\t"
98 "movw %w0,%w1\n\t" 88 LOCK_PREFIX "cmpxchgw %w1,%2\n\t"
99 "incb %h1\n\t"
100 "lock ; cmpxchgw %w1,%2\n\t"
101 "1:" 89 "1:"
102 "sete %b1\n\t" 90 "sete %b1\n\t"
103 "movzbl %b1,%0\n\t" 91 "movzbl %b1,%0\n\t"
104 : "=&a" (tmp), "=Q" (new), "+m" (lock->slock) 92 : "=&a" (tmp), "=&q" (new), "+m" (lock->slock)
105 : 93 :
106 : "memory", "cc"); 94 : "memory", "cc");
107 95
@@ -116,26 +104,14 @@ static __always_inline void __ticket_spin_unlock(raw_spinlock_t *lock)
116 : "memory", "cc"); 104 : "memory", "cc");
117} 105}
118#else 106#else
119static inline int __ticket_spin_is_locked(raw_spinlock_t *lock) 107#define TICKET_SHIFT 16
120{
121 int tmp = ACCESS_ONCE(lock->slock);
122
123 return (((tmp >> 16) & 0xffff) != (tmp & 0xffff));
124}
125
126static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
127{
128 int tmp = ACCESS_ONCE(lock->slock);
129
130 return (((tmp >> 16) - tmp) & 0xffff) > 1;
131}
132 108
133static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock) 109static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
134{ 110{
135 int inc = 0x00010000; 111 int inc = 0x00010000;
136 int tmp; 112 int tmp;
137 113
138 asm volatile("lock ; xaddl %0, %1\n" 114 asm volatile(LOCK_PREFIX "xaddl %0, %1\n"
139 "movzwl %w0, %2\n\t" 115 "movzwl %w0, %2\n\t"
140 "shrl $16, %0\n\t" 116 "shrl $16, %0\n\t"
141 "1:\t" 117 "1:\t"
@@ -146,7 +122,7 @@ static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
146 /* don't need lfence here, because loads are in-order */ 122 /* don't need lfence here, because loads are in-order */
147 "jmp 1b\n" 123 "jmp 1b\n"
148 "2:" 124 "2:"
149 : "+Q" (inc), "+m" (lock->slock), "=r" (tmp) 125 : "+r" (inc), "+m" (lock->slock), "=&r" (tmp)
150 : 126 :
151 : "memory", "cc"); 127 : "memory", "cc");
152} 128}
@@ -160,13 +136,13 @@ static __always_inline int __ticket_spin_trylock(raw_spinlock_t *lock)
160 "movl %0,%1\n\t" 136 "movl %0,%1\n\t"
161 "roll $16, %0\n\t" 137 "roll $16, %0\n\t"
162 "cmpl %0,%1\n\t" 138 "cmpl %0,%1\n\t"
139 "leal 0x00010000(%" REG_PTR_MODE "0), %1\n\t"
163 "jne 1f\n\t" 140 "jne 1f\n\t"
164 "addl $0x00010000, %1\n\t" 141 LOCK_PREFIX "cmpxchgl %1,%2\n\t"
165 "lock ; cmpxchgl %1,%2\n\t"
166 "1:" 142 "1:"
167 "sete %b1\n\t" 143 "sete %b1\n\t"
168 "movzbl %b1,%0\n\t" 144 "movzbl %b1,%0\n\t"
169 : "=&a" (tmp), "=r" (new), "+m" (lock->slock) 145 : "=&a" (tmp), "=&q" (new), "+m" (lock->slock)
170 : 146 :
171 : "memory", "cc"); 147 : "memory", "cc");
172 148
@@ -182,7 +158,19 @@ static __always_inline void __ticket_spin_unlock(raw_spinlock_t *lock)
182} 158}
183#endif 159#endif
184 160
185#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 161static inline int __ticket_spin_is_locked(raw_spinlock_t *lock)
162{
163 int tmp = ACCESS_ONCE(lock->slock);
164
165 return !!(((tmp >> TICKET_SHIFT) ^ tmp) & ((1 << TICKET_SHIFT) - 1));
166}
167
168static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
169{
170 int tmp = ACCESS_ONCE(lock->slock);
171
172 return (((tmp >> TICKET_SHIFT) - tmp) & ((1 << TICKET_SHIFT) - 1)) > 1;
173}
186 174
187#ifdef CONFIG_PARAVIRT 175#ifdef CONFIG_PARAVIRT
188/* 176/*
@@ -272,6 +260,13 @@ static __always_inline void __raw_spin_unlock(raw_spinlock_t *lock)
272{ 260{
273 __ticket_spin_unlock(lock); 261 __ticket_spin_unlock(lock);
274} 262}
263
264static __always_inline void __raw_spin_lock_flags(raw_spinlock_t *lock,
265 unsigned long flags)
266{
267 __raw_spin_lock(lock);
268}
269
275#endif /* CONFIG_PARAVIRT */ 270#endif /* CONFIG_PARAVIRT */
276 271
277static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock) 272static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock)
@@ -366,4 +361,4 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
366#define _raw_read_relax(lock) cpu_relax() 361#define _raw_read_relax(lock) cpu_relax()
367#define _raw_write_relax(lock) cpu_relax() 362#define _raw_write_relax(lock) cpu_relax()
368 363
369#endif 364#endif /* ASM_X86__SPINLOCK_H */
diff --git a/include/asm-x86/spinlock_types.h b/include/asm-x86/spinlock_types.h
index 06c071c9eee9..6aa9b562c508 100644
--- a/include/asm-x86/spinlock_types.h
+++ b/include/asm-x86/spinlock_types.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_SPINLOCK_TYPES_H 1#ifndef ASM_X86__SPINLOCK_TYPES_H
2#define __ASM_SPINLOCK_TYPES_H 2#define ASM_X86__SPINLOCK_TYPES_H
3 3
4#ifndef __LINUX_SPINLOCK_TYPES_H 4#ifndef __LINUX_SPINLOCK_TYPES_H
5# error "please don't include this file directly" 5# error "please don't include this file directly"
@@ -17,4 +17,4 @@ typedef struct {
17 17
18#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS } 18#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS }
19 19
20#endif 20#endif /* ASM_X86__SPINLOCK_TYPES_H */
diff --git a/include/asm-x86/srat.h b/include/asm-x86/srat.h
index 774c919dc232..5363e4f7e1cd 100644
--- a/include/asm-x86/srat.h
+++ b/include/asm-x86/srat.h
@@ -24,8 +24,8 @@
24 * Send feedback to Pat Gaughen <gone@us.ibm.com> 24 * Send feedback to Pat Gaughen <gone@us.ibm.com>
25 */ 25 */
26 26
27#ifndef _ASM_SRAT_H_ 27#ifndef ASM_X86__SRAT_H
28#define _ASM_SRAT_H_ 28#define ASM_X86__SRAT_H
29 29
30#ifdef CONFIG_ACPI_NUMA 30#ifdef CONFIG_ACPI_NUMA
31extern int get_memcfg_from_srat(void); 31extern int get_memcfg_from_srat(void);
@@ -36,4 +36,4 @@ static inline int get_memcfg_from_srat(void)
36} 36}
37#endif 37#endif
38 38
39#endif /* _ASM_SRAT_H_ */ 39#endif /* ASM_X86__SRAT_H */
diff --git a/include/asm-x86/stacktrace.h b/include/asm-x86/stacktrace.h
index 30f82526a8e2..f43517e28532 100644
--- a/include/asm-x86/stacktrace.h
+++ b/include/asm-x86/stacktrace.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_STACKTRACE_H 1#ifndef ASM_X86__STACKTRACE_H
2#define _ASM_STACKTRACE_H 1 2#define ASM_X86__STACKTRACE_H
3 3
4extern int kstack_depth_to_print; 4extern int kstack_depth_to_print;
5 5
@@ -18,4 +18,4 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
18 unsigned long *stack, unsigned long bp, 18 unsigned long *stack, unsigned long bp,
19 const struct stacktrace_ops *ops, void *data); 19 const struct stacktrace_ops *ops, void *data);
20 20
21#endif 21#endif /* ASM_X86__STACKTRACE_H */
diff --git a/include/asm-x86/stat.h b/include/asm-x86/stat.h
index 5c22dcb5d17e..1e120f628905 100644
--- a/include/asm-x86/stat.h
+++ b/include/asm-x86/stat.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_STAT_H 1#ifndef ASM_X86__STAT_H
2#define _ASM_X86_STAT_H 2#define ASM_X86__STAT_H
3 3
4#define STAT_HAVE_NSEC 1 4#define STAT_HAVE_NSEC 1
5 5
@@ -111,4 +111,4 @@ struct __old_kernel_stat {
111#endif 111#endif
112}; 112};
113 113
114#endif 114#endif /* ASM_X86__STAT_H */
diff --git a/include/asm-x86/statfs.h b/include/asm-x86/statfs.h
index 7c651aa97252..ca5dc19dd461 100644
--- a/include/asm-x86/statfs.h
+++ b/include/asm-x86/statfs.h
@@ -1,63 +1,12 @@
1#ifndef _ASM_X86_STATFS_H 1#ifndef ASM_X86__STATFS_H
2#define _ASM_X86_STATFS_H 2#define ASM_X86__STATFS_H
3
4#ifdef __i386__
5#include <asm-generic/statfs.h>
6#else
7
8#ifndef __KERNEL_STRICT_NAMES
9
10#include <linux/types.h>
11
12typedef __kernel_fsid_t fsid_t;
13
14#endif
15 3
16/* 4/*
17 * This is ugly -- we're already 64-bit clean, so just duplicate the 5 * We need compat_statfs64 to be packed, because the i386 ABI won't
18 * definitions. 6 * add padding at the end to bring it to a multiple of 8 bytes, but
7 * the x86_64 ABI will.
19 */ 8 */
20struct statfs { 9#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
21 long f_type;
22 long f_bsize;
23 long f_blocks;
24 long f_bfree;
25 long f_bavail;
26 long f_files;
27 long f_ffree;
28 __kernel_fsid_t f_fsid;
29 long f_namelen;
30 long f_frsize;
31 long f_spare[5];
32};
33
34struct statfs64 {
35 long f_type;
36 long f_bsize;
37 long f_blocks;
38 long f_bfree;
39 long f_bavail;
40 long f_files;
41 long f_ffree;
42 __kernel_fsid_t f_fsid;
43 long f_namelen;
44 long f_frsize;
45 long f_spare[5];
46};
47 10
48struct compat_statfs64 { 11#include <asm-generic/statfs.h>
49 __u32 f_type; 12#endif /* ASM_X86__STATFS_H */
50 __u32 f_bsize;
51 __u64 f_blocks;
52 __u64 f_bfree;
53 __u64 f_bavail;
54 __u64 f_files;
55 __u64 f_ffree;
56 __kernel_fsid_t f_fsid;
57 __u32 f_namelen;
58 __u32 f_frsize;
59 __u32 f_spare[5];
60} __attribute__((packed));
61
62#endif /* !__i386__ */
63#endif
diff --git a/include/asm-x86/string_32.h b/include/asm-x86/string_32.h
index 193578cd1fd9..487843ed245a 100644
--- a/include/asm-x86/string_32.h
+++ b/include/asm-x86/string_32.h
@@ -1,5 +1,5 @@
1#ifndef _I386_STRING_H_ 1#ifndef ASM_X86__STRING_32_H
2#define _I386_STRING_H_ 2#define ASM_X86__STRING_32_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
@@ -323,4 +323,4 @@ extern void *memscan(void *addr, int c, size_t size);
323 323
324#endif /* __KERNEL__ */ 324#endif /* __KERNEL__ */
325 325
326#endif 326#endif /* ASM_X86__STRING_32_H */
diff --git a/include/asm-x86/string_64.h b/include/asm-x86/string_64.h
index 52b5ab383395..a2add11d3b66 100644
--- a/include/asm-x86/string_64.h
+++ b/include/asm-x86/string_64.h
@@ -1,5 +1,5 @@
1#ifndef _X86_64_STRING_H_ 1#ifndef ASM_X86__STRING_64_H
2#define _X86_64_STRING_H_ 2#define ASM_X86__STRING_64_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
@@ -57,4 +57,4 @@ int strcmp(const char *cs, const char *ct);
57 57
58#endif /* __KERNEL__ */ 58#endif /* __KERNEL__ */
59 59
60#endif 60#endif /* ASM_X86__STRING_64_H */
diff --git a/include/asm-x86/mach-summit/mach_apic.h b/include/asm-x86/summit/apic.h
index c47e2ab5c5ca..394b00bb5e72 100644
--- a/include/asm-x86/mach-summit/mach_apic.h
+++ b/include/asm-x86/summit/apic.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_APIC_H 1#ifndef __ASM_SUMMIT_APIC_H
2#define __ASM_MACH_APIC_H 2#define __ASM_SUMMIT_APIC_H
3 3
4#include <asm/smp.h> 4#include <asm/smp.h>
5 5
@@ -21,7 +21,7 @@ static inline cpumask_t target_cpus(void)
21 * Just start on cpu 0. IRQ balancing will spread load 21 * Just start on cpu 0. IRQ balancing will spread load
22 */ 22 */
23 return cpumask_of_cpu(0); 23 return cpumask_of_cpu(0);
24} 24}
25#define TARGET_CPUS (target_cpus()) 25#define TARGET_CPUS (target_cpus())
26 26
27#define INT_DELIVERY_MODE (dest_LowestPrio) 27#define INT_DELIVERY_MODE (dest_LowestPrio)
@@ -30,10 +30,10 @@ static inline cpumask_t target_cpus(void)
30static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) 30static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
31{ 31{
32 return 0; 32 return 0;
33} 33}
34 34
35/* we don't use the phys_cpu_present_map to indicate apicid presence */ 35/* we don't use the phys_cpu_present_map to indicate apicid presence */
36static inline unsigned long check_apicid_present(int bit) 36static inline unsigned long check_apicid_present(int bit)
37{ 37{
38 return 1; 38 return 1;
39} 39}
@@ -122,7 +122,7 @@ static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_id_map)
122 122
123static inline physid_mask_t apicid_to_cpu_present(int apicid) 123static inline physid_mask_t apicid_to_cpu_present(int apicid)
124{ 124{
125 return physid_mask_of_physid(apicid); 125 return physid_mask_of_physid(0);
126} 126}
127 127
128static inline void setup_portio_remap(void) 128static inline void setup_portio_remap(void)
@@ -143,24 +143,24 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
143 int num_bits_set; 143 int num_bits_set;
144 int cpus_found = 0; 144 int cpus_found = 0;
145 int cpu; 145 int cpu;
146 int apicid; 146 int apicid;
147 147
148 num_bits_set = cpus_weight(cpumask); 148 num_bits_set = cpus_weight(cpumask);
149 /* Return id to all */ 149 /* Return id to all */
150 if (num_bits_set == NR_CPUS) 150 if (num_bits_set == NR_CPUS)
151 return (int) 0xFF; 151 return (int) 0xFF;
152 /* 152 /*
153 * The cpus in the mask must all be on the apic cluster. If are not 153 * The cpus in the mask must all be on the apic cluster. If are not
154 * on the same apicid cluster return default value of TARGET_CPUS. 154 * on the same apicid cluster return default value of TARGET_CPUS.
155 */ 155 */
156 cpu = first_cpu(cpumask); 156 cpu = first_cpu(cpumask);
157 apicid = cpu_to_logical_apicid(cpu); 157 apicid = cpu_to_logical_apicid(cpu);
158 while (cpus_found < num_bits_set) { 158 while (cpus_found < num_bits_set) {
159 if (cpu_isset(cpu, cpumask)) { 159 if (cpu_isset(cpu, cpumask)) {
160 int new_apicid = cpu_to_logical_apicid(cpu); 160 int new_apicid = cpu_to_logical_apicid(cpu);
161 if (apicid_cluster(apicid) != 161 if (apicid_cluster(apicid) !=
162 apicid_cluster(new_apicid)){ 162 apicid_cluster(new_apicid)){
163 printk ("%s: Not a valid mask!\n",__FUNCTION__); 163 printk ("%s: Not a valid mask!\n", __func__);
164 return 0xFF; 164 return 0xFF;
165 } 165 }
166 apicid = apicid | new_apicid; 166 apicid = apicid | new_apicid;
@@ -182,4 +182,4 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
182 return hard_smp_processor_id() >> index_msb; 182 return hard_smp_processor_id() >> index_msb;
183} 183}
184 184
185#endif /* __ASM_MACH_APIC_H */ 185#endif /* __ASM_SUMMIT_APIC_H */
diff --git a/include/asm-x86/summit/apicdef.h b/include/asm-x86/summit/apicdef.h
new file mode 100644
index 000000000000..f3fbca1f61c1
--- /dev/null
+++ b/include/asm-x86/summit/apicdef.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_SUMMIT_APICDEF_H
2#define __ASM_SUMMIT_APICDEF_H
3
4#define APIC_ID_MASK (0xFF<<24)
5
6static inline unsigned get_apic_id(unsigned long x)
7{
8 return (x>>24)&0xFF;
9}
10
11#define GET_APIC_ID(x) get_apic_id(x)
12
13#endif
diff --git a/include/asm-x86/mach-summit/mach_ipi.h b/include/asm-x86/summit/ipi.h
index 9404c535b7ec..53bd1e7bd7b4 100644
--- a/include/asm-x86/mach-summit/mach_ipi.h
+++ b/include/asm-x86/summit/ipi.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_SUMMIT_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_SUMMIT_IPI_H
3 3
4void send_IPI_mask_sequence(cpumask_t mask, int vector); 4void send_IPI_mask_sequence(cpumask_t mask, int vector);
5 5
@@ -22,4 +22,4 @@ static inline void send_IPI_all(int vector)
22 send_IPI_mask(cpu_online_map, vector); 22 send_IPI_mask(cpu_online_map, vector);
23} 23}
24 24
25#endif /* __ASM_MACH_IPI_H */ 25#endif /* __ASM_SUMMIT_IPI_H */
diff --git a/include/asm-x86/mach-summit/irq_vectors_limits.h b/include/asm-x86/summit/irq_vectors_limits.h
index 890ce3f5e09a..890ce3f5e09a 100644
--- a/include/asm-x86/mach-summit/irq_vectors_limits.h
+++ b/include/asm-x86/summit/irq_vectors_limits.h
diff --git a/include/asm-x86/mach-summit/mach_mpparse.h b/include/asm-x86/summit/mpparse.h
index fdf591701339..013ce6fab2d5 100644
--- a/include/asm-x86/mach-summit/mach_mpparse.h
+++ b/include/asm-x86/summit/mpparse.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_MPPARSE_H 1#ifndef __ASM_SUMMIT_MPPARSE_H
2#define __ASM_MACH_MPPARSE_H 2#define __ASM_SUMMIT_MPPARSE_H
3 3
4#include <mach_apic.h>
5#include <asm/tsc.h> 4#include <asm/tsc.h>
6 5
7extern int use_cyclone; 6extern int use_cyclone;
@@ -12,11 +11,11 @@ extern void setup_summit(void);
12#define setup_summit() {} 11#define setup_summit() {}
13#endif 12#endif
14 13
15static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 14static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
16 char *productid) 15 char *productid)
17{ 16{
18 if (!strncmp(oem, "IBM ENSW", 8) && 17 if (!strncmp(oem, "IBM ENSW", 8) &&
19 (!strncmp(productid, "VIGIL SMP", 9) 18 (!strncmp(productid, "VIGIL SMP", 9)
20 || !strncmp(productid, "EXA", 3) 19 || !strncmp(productid, "EXA", 3)
21 || !strncmp(productid, "RUTHLESS SMP", 12))){ 20 || !strncmp(productid, "RUTHLESS SMP", 12))){
22 mark_tsc_unstable("Summit based system"); 21 mark_tsc_unstable("Summit based system");
@@ -107,4 +106,4 @@ static inline int is_WPEG(struct rio_detail *rio){
107 rio->type == LookOutAWPEG || rio->type == LookOutBWPEG); 106 rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
108} 107}
109 108
110#endif /* __ASM_MACH_MPPARSE_H */ 109#endif /* __ASM_SUMMIT_MPPARSE_H */
diff --git a/include/asm-x86/suspend_32.h b/include/asm-x86/suspend_32.h
index 8675c6782a7d..acb6d4d491f4 100644
--- a/include/asm-x86/suspend_32.h
+++ b/include/asm-x86/suspend_32.h
@@ -3,8 +3,8 @@
3 * Based on code 3 * Based on code
4 * Copyright 2001 Patrick Mochel <mochel@osdl.org> 4 * Copyright 2001 Patrick Mochel <mochel@osdl.org>
5 */ 5 */
6#ifndef __ASM_X86_32_SUSPEND_H 6#ifndef ASM_X86__SUSPEND_32_H
7#define __ASM_X86_32_SUSPEND_H 7#define ASM_X86__SUSPEND_32_H
8 8
9#include <asm/desc.h> 9#include <asm/desc.h>
10#include <asm/i387.h> 10#include <asm/i387.h>
@@ -48,4 +48,4 @@ static inline void acpi_save_register_state(unsigned long return_point)
48extern int acpi_save_state_mem(void); 48extern int acpi_save_state_mem(void);
49#endif 49#endif
50 50
51#endif /* __ASM_X86_32_SUSPEND_H */ 51#endif /* ASM_X86__SUSPEND_32_H */
diff --git a/include/asm-x86/suspend_64.h b/include/asm-x86/suspend_64.h
index dc3262b43072..cf821dd310e8 100644
--- a/include/asm-x86/suspend_64.h
+++ b/include/asm-x86/suspend_64.h
@@ -3,8 +3,8 @@
3 * Based on code 3 * Based on code
4 * Copyright 2001 Patrick Mochel <mochel@osdl.org> 4 * Copyright 2001 Patrick Mochel <mochel@osdl.org>
5 */ 5 */
6#ifndef __ASM_X86_64_SUSPEND_H 6#ifndef ASM_X86__SUSPEND_64_H
7#define __ASM_X86_64_SUSPEND_H 7#define ASM_X86__SUSPEND_64_H
8 8
9#include <asm/desc.h> 9#include <asm/desc.h>
10#include <asm/i387.h> 10#include <asm/i387.h>
@@ -49,4 +49,4 @@ extern int acpi_save_state_mem(void);
49extern char core_restore_code; 49extern char core_restore_code;
50extern char restore_registers; 50extern char restore_registers;
51 51
52#endif /* __ASM_X86_64_SUSPEND_H */ 52#endif /* ASM_X86__SUSPEND_64_H */
diff --git a/include/asm-x86/swiotlb.h b/include/asm-x86/swiotlb.h
index 2730b351afcf..1e20adbcad4b 100644
--- a/include/asm-x86/swiotlb.h
+++ b/include/asm-x86/swiotlb.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_SWIOTLB_H 1#ifndef ASM_X86__SWIOTLB_H
2#define _ASM_SWIOTLB_H 1 2#define ASM_X86__SWIOTLB_H
3 3
4#include <asm/dma-mapping.h> 4#include <asm/dma-mapping.h>
5 5
@@ -55,4 +55,4 @@ static inline void pci_swiotlb_init(void)
55 55
56static inline void dma_mark_clean(void *addr, size_t size) {} 56static inline void dma_mark_clean(void *addr, size_t size) {}
57 57
58#endif /* _ASM_SWIOTLB_H */ 58#endif /* ASM_X86__SWIOTLB_H */
diff --git a/include/asm-x86/sync_bitops.h b/include/asm-x86/sync_bitops.h
index b47a1d0b8a83..b689bee71104 100644
--- a/include/asm-x86/sync_bitops.h
+++ b/include/asm-x86/sync_bitops.h
@@ -1,5 +1,5 @@
1#ifndef _I386_SYNC_BITOPS_H 1#ifndef ASM_X86__SYNC_BITOPS_H
2#define _I386_SYNC_BITOPS_H 2#define ASM_X86__SYNC_BITOPS_H
3 3
4/* 4/*
5 * Copyright 1992, Linus Torvalds. 5 * Copyright 1992, Linus Torvalds.
@@ -127,4 +127,4 @@ static inline int sync_test_and_change_bit(int nr, volatile unsigned long *addr)
127 127
128#undef ADDR 128#undef ADDR
129 129
130#endif /* _I386_SYNC_BITOPS_H */ 130#endif /* ASM_X86__SYNC_BITOPS_H */
diff --git a/include/asm-x86/syscall.h b/include/asm-x86/syscall.h
new file mode 100644
index 000000000000..04c47dc5597c
--- /dev/null
+++ b/include/asm-x86/syscall.h
@@ -0,0 +1,211 @@
1/*
2 * Access to user system call parameters and results
3 *
4 * Copyright (C) 2008 Red Hat, Inc. All rights reserved.
5 *
6 * This copyrighted material is made available to anyone wishing to use,
7 * modify, copy, or redistribute it subject to the terms and conditions
8 * of the GNU General Public License v.2.
9 *
10 * See asm-generic/syscall.h for descriptions of what we must do here.
11 */
12
13#ifndef _ASM_SYSCALL_H
14#define _ASM_SYSCALL_H 1
15
16#include <linux/sched.h>
17#include <linux/err.h>
18
19static inline long syscall_get_nr(struct task_struct *task,
20 struct pt_regs *regs)
21{
22 /*
23 * We always sign-extend a -1 value being set here,
24 * so this is always either -1L or a syscall number.
25 */
26 return regs->orig_ax;
27}
28
29static inline void syscall_rollback(struct task_struct *task,
30 struct pt_regs *regs)
31{
32 regs->ax = regs->orig_ax;
33}
34
35static inline long syscall_get_error(struct task_struct *task,
36 struct pt_regs *regs)
37{
38 unsigned long error = regs->ax;
39#ifdef CONFIG_IA32_EMULATION
40 /*
41 * TS_COMPAT is set for 32-bit syscall entries and then
42 * remains set until we return to user mode.
43 */
44 if (task_thread_info(task)->status & TS_COMPAT)
45 /*
46 * Sign-extend the value so (int)-EFOO becomes (long)-EFOO
47 * and will match correctly in comparisons.
48 */
49 error = (long) (int) error;
50#endif
51 return IS_ERR_VALUE(error) ? error : 0;
52}
53
54static inline long syscall_get_return_value(struct task_struct *task,
55 struct pt_regs *regs)
56{
57 return regs->ax;
58}
59
60static inline void syscall_set_return_value(struct task_struct *task,
61 struct pt_regs *regs,
62 int error, long val)
63{
64 regs->ax = (long) error ?: val;
65}
66
67#ifdef CONFIG_X86_32
68
69static inline void syscall_get_arguments(struct task_struct *task,
70 struct pt_regs *regs,
71 unsigned int i, unsigned int n,
72 unsigned long *args)
73{
74 BUG_ON(i + n > 6);
75 memcpy(args, &regs->bx + i, n * sizeof(args[0]));
76}
77
78static inline void syscall_set_arguments(struct task_struct *task,
79 struct pt_regs *regs,
80 unsigned int i, unsigned int n,
81 const unsigned long *args)
82{
83 BUG_ON(i + n > 6);
84 memcpy(&regs->bx + i, args, n * sizeof(args[0]));
85}
86
87#else /* CONFIG_X86_64 */
88
89static inline void syscall_get_arguments(struct task_struct *task,
90 struct pt_regs *regs,
91 unsigned int i, unsigned int n,
92 unsigned long *args)
93{
94# ifdef CONFIG_IA32_EMULATION
95 if (task_thread_info(task)->status & TS_COMPAT)
96 switch (i + n) {
97 case 6:
98 if (!n--) break;
99 *args++ = regs->bp;
100 case 5:
101 if (!n--) break;
102 *args++ = regs->di;
103 case 4:
104 if (!n--) break;
105 *args++ = regs->si;
106 case 3:
107 if (!n--) break;
108 *args++ = regs->dx;
109 case 2:
110 if (!n--) break;
111 *args++ = regs->cx;
112 case 1:
113 if (!n--) break;
114 *args++ = regs->bx;
115 case 0:
116 if (!n--) break;
117 default:
118 BUG();
119 break;
120 }
121 else
122# endif
123 switch (i + n) {
124 case 6:
125 if (!n--) break;
126 *args++ = regs->r9;
127 case 5:
128 if (!n--) break;
129 *args++ = regs->r8;
130 case 4:
131 if (!n--) break;
132 *args++ = regs->r10;
133 case 3:
134 if (!n--) break;
135 *args++ = regs->dx;
136 case 2:
137 if (!n--) break;
138 *args++ = regs->si;
139 case 1:
140 if (!n--) break;
141 *args++ = regs->di;
142 case 0:
143 if (!n--) break;
144 default:
145 BUG();
146 break;
147 }
148}
149
150static inline void syscall_set_arguments(struct task_struct *task,
151 struct pt_regs *regs,
152 unsigned int i, unsigned int n,
153 const unsigned long *args)
154{
155# ifdef CONFIG_IA32_EMULATION
156 if (task_thread_info(task)->status & TS_COMPAT)
157 switch (i + n) {
158 case 6:
159 if (!n--) break;
160 regs->bp = *args++;
161 case 5:
162 if (!n--) break;
163 regs->di = *args++;
164 case 4:
165 if (!n--) break;
166 regs->si = *args++;
167 case 3:
168 if (!n--) break;
169 regs->dx = *args++;
170 case 2:
171 if (!n--) break;
172 regs->cx = *args++;
173 case 1:
174 if (!n--) break;
175 regs->bx = *args++;
176 case 0:
177 if (!n--) break;
178 default:
179 BUG();
180 }
181 else
182# endif
183 switch (i + n) {
184 case 6:
185 if (!n--) break;
186 regs->r9 = *args++;
187 case 5:
188 if (!n--) break;
189 regs->r8 = *args++;
190 case 4:
191 if (!n--) break;
192 regs->r10 = *args++;
193 case 3:
194 if (!n--) break;
195 regs->dx = *args++;
196 case 2:
197 if (!n--) break;
198 regs->si = *args++;
199 case 1:
200 if (!n--) break;
201 regs->di = *args++;
202 case 0:
203 if (!n--) break;
204 default:
205 BUG();
206 }
207}
208
209#endif /* CONFIG_X86_32 */
210
211#endif /* _ASM_SYSCALL_H */
diff --git a/include/asm-x86/syscalls.h b/include/asm-x86/syscalls.h
new file mode 100644
index 000000000000..87803da44010
--- /dev/null
+++ b/include/asm-x86/syscalls.h
@@ -0,0 +1,93 @@
1/*
2 * syscalls.h - Linux syscall interfaces (arch-specific)
3 *
4 * Copyright (c) 2008 Jaswinder Singh
5 *
6 * This file is released under the GPLv2.
7 * See the file COPYING for more details.
8 */
9
10#ifndef _ASM_X86_SYSCALLS_H
11#define _ASM_X86_SYSCALLS_H
12
13#include <linux/compiler.h>
14#include <linux/linkage.h>
15#include <linux/types.h>
16#include <linux/signal.h>
17
18/* Common in X86_32 and X86_64 */
19/* kernel/ioport.c */
20asmlinkage long sys_ioperm(unsigned long, unsigned long, int);
21
22/* X86_32 only */
23#ifdef CONFIG_X86_32
24/* kernel/process_32.c */
25asmlinkage int sys_fork(struct pt_regs);
26asmlinkage int sys_clone(struct pt_regs);
27asmlinkage int sys_vfork(struct pt_regs);
28asmlinkage int sys_execve(struct pt_regs);
29
30/* kernel/signal_32.c */
31asmlinkage int sys_sigsuspend(int, int, old_sigset_t);
32asmlinkage int sys_sigaction(int, const struct old_sigaction __user *,
33 struct old_sigaction __user *);
34asmlinkage int sys_sigaltstack(unsigned long);
35asmlinkage unsigned long sys_sigreturn(unsigned long);
36asmlinkage int sys_rt_sigreturn(unsigned long);
37
38/* kernel/ioport.c */
39asmlinkage long sys_iopl(unsigned long);
40
41/* kernel/ldt.c */
42asmlinkage int sys_modify_ldt(int, void __user *, unsigned long);
43
44/* kernel/sys_i386_32.c */
45asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long,
46 unsigned long, unsigned long, unsigned long);
47struct mmap_arg_struct;
48asmlinkage int old_mmap(struct mmap_arg_struct __user *);
49struct sel_arg_struct;
50asmlinkage int old_select(struct sel_arg_struct __user *);
51asmlinkage int sys_ipc(uint, int, int, int, void __user *, long);
52struct old_utsname;
53asmlinkage int sys_uname(struct old_utsname __user *);
54struct oldold_utsname;
55asmlinkage int sys_olduname(struct oldold_utsname __user *);
56
57/* kernel/tls.c */
58asmlinkage int sys_set_thread_area(struct user_desc __user *);
59asmlinkage int sys_get_thread_area(struct user_desc __user *);
60
61/* kernel/vm86_32.c */
62asmlinkage int sys_vm86old(struct pt_regs);
63asmlinkage int sys_vm86(struct pt_regs);
64
65#else /* CONFIG_X86_32 */
66
67/* X86_64 only */
68/* kernel/process_64.c */
69asmlinkage long sys_fork(struct pt_regs *);
70asmlinkage long sys_clone(unsigned long, unsigned long,
71 void __user *, void __user *,
72 struct pt_regs *);
73asmlinkage long sys_vfork(struct pt_regs *);
74asmlinkage long sys_execve(char __user *, char __user * __user *,
75 char __user * __user *,
76 struct pt_regs *);
77
78/* kernel/ioport.c */
79asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
80
81/* kernel/signal_64.c */
82asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *,
83 struct pt_regs *);
84asmlinkage long sys_rt_sigreturn(struct pt_regs *);
85
86/* kernel/sys_x86_64.c */
87asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long,
88 unsigned long, unsigned long, unsigned long);
89struct new_utsname;
90asmlinkage long sys_uname(struct new_utsname __user *);
91
92#endif /* CONFIG_X86_32 */
93#endif /* _ASM_X86_SYSCALLS_H */
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h
index 983ce37c491f..b20c894660f9 100644
--- a/include/asm-x86/system.h
+++ b/include/asm-x86/system.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_SYSTEM_H_ 1#ifndef ASM_X86__SYSTEM_H
2#define _ASM_X86_SYSTEM_H_ 2#define ASM_X86__SYSTEM_H
3 3
4#include <asm/asm.h> 4#include <asm/asm.h>
5#include <asm/segment.h> 5#include <asm/segment.h>
@@ -64,7 +64,10 @@ do { \
64 \ 64 \
65 /* regparm parameters for __switch_to(): */ \ 65 /* regparm parameters for __switch_to(): */ \
66 [prev] "a" (prev), \ 66 [prev] "a" (prev), \
67 [next] "d" (next)); \ 67 [next] "d" (next) \
68 \
69 : /* reloaded segment registers */ \
70 "memory"); \
68} while (0) 71} while (0)
69 72
70/* 73/*
@@ -419,4 +422,4 @@ static inline void rdtsc_barrier(void)
419 alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); 422 alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
420} 423}
421 424
422#endif 425#endif /* ASM_X86__SYSTEM_H */
diff --git a/include/asm-x86/system_64.h b/include/asm-x86/system_64.h
index 97fa251ccb2b..5aedb8bffc5a 100644
--- a/include/asm-x86/system_64.h
+++ b/include/asm-x86/system_64.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_SYSTEM_H 1#ifndef ASM_X86__SYSTEM_64_H
2#define __ASM_SYSTEM_H 2#define ASM_X86__SYSTEM_64_H
3 3
4#include <asm/segment.h> 4#include <asm/segment.h>
5#include <asm/cmpxchg.h> 5#include <asm/cmpxchg.h>
@@ -19,4 +19,4 @@ static inline void write_cr8(unsigned long val)
19 19
20#include <linux/irqflags.h> 20#include <linux/irqflags.h>
21 21
22#endif 22#endif /* ASM_X86__SYSTEM_64_H */
diff --git a/include/asm-x86/tce.h b/include/asm-x86/tce.h
index b1a4ea00df78..e7932d7fbbab 100644
--- a/include/asm-x86/tce.h
+++ b/include/asm-x86/tce.h
@@ -21,8 +21,8 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 22 */
23 23
24#ifndef _ASM_X86_64_TCE_H 24#ifndef ASM_X86__TCE_H
25#define _ASM_X86_64_TCE_H 25#define ASM_X86__TCE_H
26 26
27extern unsigned int specified_table_size; 27extern unsigned int specified_table_size;
28struct iommu_table; 28struct iommu_table;
@@ -45,4 +45,4 @@ extern void * __init alloc_tce_table(void);
45extern void __init free_tce_table(void *tbl); 45extern void __init free_tce_table(void *tbl);
46extern int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar); 46extern int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar);
47 47
48#endif /* _ASM_X86_64_TCE_H */ 48#endif /* ASM_X86__TCE_H */
diff --git a/include/asm-x86/termbits.h b/include/asm-x86/termbits.h
index af1b70ea440f..3d00dc5e0c71 100644
--- a/include/asm-x86/termbits.h
+++ b/include/asm-x86/termbits.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_TERMBITS_H 1#ifndef ASM_X86__TERMBITS_H
2#define _ASM_X86_TERMBITS_H 2#define ASM_X86__TERMBITS_H
3 3
4#include <linux/posix_types.h> 4#include <linux/posix_types.h>
5 5
@@ -195,4 +195,4 @@ struct ktermios {
195#define TCSADRAIN 1 195#define TCSADRAIN 1
196#define TCSAFLUSH 2 196#define TCSAFLUSH 2
197 197
198#endif /* _ASM_X86_TERMBITS_H */ 198#endif /* ASM_X86__TERMBITS_H */
diff --git a/include/asm-x86/termios.h b/include/asm-x86/termios.h
index f72956331c49..e235db248071 100644
--- a/include/asm-x86/termios.h
+++ b/include/asm-x86/termios.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_TERMIOS_H 1#ifndef ASM_X86__TERMIOS_H
2#define _ASM_X86_TERMIOS_H 2#define ASM_X86__TERMIOS_H
3 3
4#include <asm/termbits.h> 4#include <asm/termbits.h>
5#include <asm/ioctls.h> 5#include <asm/ioctls.h>
@@ -110,4 +110,4 @@ static inline int kernel_termios_to_user_termios_1(struct termios __user *u,
110 110
111#endif /* __KERNEL__ */ 111#endif /* __KERNEL__ */
112 112
113#endif /* _ASM_X86_TERMIOS_H */ 113#endif /* ASM_X86__TERMIOS_H */
diff --git a/include/asm-x86/therm_throt.h b/include/asm-x86/therm_throt.h
index 399bf6026b16..1c7f57b6b66e 100644
--- a/include/asm-x86/therm_throt.h
+++ b/include/asm-x86/therm_throt.h
@@ -1,9 +1,9 @@
1#ifndef __ASM_I386_THERM_THROT_H__ 1#ifndef ASM_X86__THERM_THROT_H
2#define __ASM_I386_THERM_THROT_H__ 1 2#define ASM_X86__THERM_THROT_H
3 3
4#include <asm/atomic.h> 4#include <asm/atomic.h>
5 5
6extern atomic_t therm_throt_en; 6extern atomic_t therm_throt_en;
7int therm_throt_process(int curr); 7int therm_throt_process(int curr);
8 8
9#endif /* __ASM_I386_THERM_THROT_H__ */ 9#endif /* ASM_X86__THERM_THROT_H */
diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h
index da0a675adf94..3f4e52bb77f5 100644
--- a/include/asm-x86/thread_info.h
+++ b/include/asm-x86/thread_info.h
@@ -4,8 +4,8 @@
4 * - Incorporating suggestions made by Linus Torvalds and Dave Miller 4 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
5 */ 5 */
6 6
7#ifndef _ASM_X86_THREAD_INFO_H 7#ifndef ASM_X86__THREAD_INFO_H
8#define _ASM_X86_THREAD_INFO_H 8#define ASM_X86__THREAD_INFO_H
9 9
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <asm/page.h> 11#include <asm/page.h>
@@ -71,6 +71,7 @@ struct thread_info {
71 * Warning: layout of LSW is hardcoded in entry.S 71 * Warning: layout of LSW is hardcoded in entry.S
72 */ 72 */
73#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 73#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
74#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
74#define TIF_SIGPENDING 2 /* signal pending */ 75#define TIF_SIGPENDING 2 /* signal pending */
75#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 76#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
76#define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ 77#define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/
@@ -93,6 +94,7 @@ struct thread_info {
93#define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */ 94#define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */
94 95
95#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 96#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
97#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
96#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 98#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
97#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 99#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
98#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 100#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
@@ -133,7 +135,7 @@ struct thread_info {
133 135
134/* Only used for 64 bit */ 136/* Only used for 64 bit */
135#define _TIF_DO_NOTIFY_MASK \ 137#define _TIF_DO_NOTIFY_MASK \
136 (_TIF_SIGPENDING|_TIF_MCE_NOTIFY) 138 (_TIF_SIGPENDING|_TIF_MCE_NOTIFY|_TIF_NOTIFY_RESUME)
137 139
138/* flags to check in __switch_to() */ 140/* flags to check in __switch_to() */
139#define _TIF_WORK_CTXSW \ 141#define _TIF_WORK_CTXSW \
@@ -239,6 +241,7 @@ static inline struct thread_info *stack_thread_info(void)
239#define TS_POLLING 0x0004 /* true if in idle loop 241#define TS_POLLING 0x0004 /* true if in idle loop
240 and not sleeping */ 242 and not sleeping */
241#define TS_RESTORE_SIGMASK 0x0008 /* restore signal mask in do_signal() */ 243#define TS_RESTORE_SIGMASK 0x0008 /* restore signal mask in do_signal() */
244#define TS_XSAVE 0x0010 /* Use xsave/xrstor */
242 245
243#define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) 246#define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING)
244 247
@@ -258,4 +261,4 @@ extern void free_thread_info(struct thread_info *ti);
258extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); 261extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
259#define arch_task_cache_init arch_task_cache_init 262#define arch_task_cache_init arch_task_cache_init
260#endif 263#endif
261#endif /* _ASM_X86_THREAD_INFO_H */ 264#endif /* ASM_X86__THREAD_INFO_H */
diff --git a/include/asm-x86/time.h b/include/asm-x86/time.h
index a17fa473e91d..3e724eef7ac4 100644
--- a/include/asm-x86/time.h
+++ b/include/asm-x86/time.h
@@ -1,5 +1,5 @@
1#ifndef _ASMX86_TIME_H 1#ifndef ASM_X86__TIME_H
2#define _ASMX86_TIME_H 2#define ASM_X86__TIME_H
3 3
4extern void hpet_time_init(void); 4extern void hpet_time_init(void);
5 5
@@ -46,6 +46,8 @@ static inline int native_set_wallclock(unsigned long nowtime)
46 46
47#endif 47#endif
48 48
49extern void time_init(void);
50
49#ifdef CONFIG_PARAVIRT 51#ifdef CONFIG_PARAVIRT
50#include <asm/paravirt.h> 52#include <asm/paravirt.h>
51#else /* !CONFIG_PARAVIRT */ 53#else /* !CONFIG_PARAVIRT */
@@ -58,4 +60,4 @@ static inline int native_set_wallclock(unsigned long nowtime)
58 60
59extern unsigned long __init calibrate_cpu(void); 61extern unsigned long __init calibrate_cpu(void);
60 62
61#endif 63#endif /* ASM_X86__TIME_H */
diff --git a/include/asm-x86/timer.h b/include/asm-x86/timer.h
index fb2a4ddddf3d..d0babce4b47a 100644
--- a/include/asm-x86/timer.h
+++ b/include/asm-x86/timer.h
@@ -1,5 +1,5 @@
1#ifndef _ASMi386_TIMER_H 1#ifndef ASM_X86__TIMER_H
2#define _ASMi386_TIMER_H 2#define ASM_X86__TIMER_H
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/pm.h> 4#include <linux/pm.h>
5#include <linux/percpu.h> 5#include <linux/percpu.h>
@@ -9,9 +9,12 @@
9unsigned long long native_sched_clock(void); 9unsigned long long native_sched_clock(void);
10unsigned long native_calibrate_tsc(void); 10unsigned long native_calibrate_tsc(void);
11 11
12#ifdef CONFIG_X86_32
12extern int timer_ack; 13extern int timer_ack;
13extern int no_timer_check;
14extern int recalibrate_cpu_khz(void); 14extern int recalibrate_cpu_khz(void);
15#endif /* CONFIG_X86_32 */
16
17extern int no_timer_check;
15 18
16#ifndef CONFIG_PARAVIRT 19#ifndef CONFIG_PARAVIRT
17#define calibrate_tsc() native_calibrate_tsc() 20#define calibrate_tsc() native_calibrate_tsc()
@@ -60,4 +63,4 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc)
60 return ns; 63 return ns;
61} 64}
62 65
63#endif 66#endif /* ASM_X86__TIMER_H */
diff --git a/include/asm-x86/timex.h b/include/asm-x86/timex.h
index 43e5a78500c5..d1ce2416a5da 100644
--- a/include/asm-x86/timex.h
+++ b/include/asm-x86/timex.h
@@ -1,6 +1,6 @@
1/* x86 architecture timex specifications */ 1/* x86 architecture timex specifications */
2#ifndef _ASM_X86_TIMEX_H 2#ifndef ASM_X86__TIMEX_H
3#define _ASM_X86_TIMEX_H 3#define ASM_X86__TIMEX_H
4 4
5#include <asm/processor.h> 5#include <asm/processor.h>
6#include <asm/tsc.h> 6#include <asm/tsc.h>
@@ -16,4 +16,4 @@
16 16
17#define ARCH_HAS_READ_CURRENT_TIMER 17#define ARCH_HAS_READ_CURRENT_TIMER
18 18
19#endif 19#endif /* ASM_X86__TIMEX_H */
diff --git a/include/asm-x86/tlb.h b/include/asm-x86/tlb.h
index e4e9e2d07a93..db36e9e89e87 100644
--- a/include/asm-x86/tlb.h
+++ b/include/asm-x86/tlb.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_TLB_H 1#ifndef ASM_X86__TLB_H
2#define _ASM_X86_TLB_H 2#define ASM_X86__TLB_H
3 3
4#define tlb_start_vma(tlb, vma) do { } while (0) 4#define tlb_start_vma(tlb, vma) do { } while (0)
5#define tlb_end_vma(tlb, vma) do { } while (0) 5#define tlb_end_vma(tlb, vma) do { } while (0)
@@ -8,4 +8,4 @@
8 8
9#include <asm-generic/tlb.h> 9#include <asm-generic/tlb.h>
10 10
11#endif 11#endif /* ASM_X86__TLB_H */
diff --git a/include/asm-x86/tlbflush.h b/include/asm-x86/tlbflush.h
index 35c76ceb9f40..3cdd08b5bdb7 100644
--- a/include/asm-x86/tlbflush.h
+++ b/include/asm-x86/tlbflush.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_TLBFLUSH_H 1#ifndef ASM_X86__TLBFLUSH_H
2#define _ASM_X86_TLBFLUSH_H 2#define ASM_X86__TLBFLUSH_H
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
@@ -119,6 +119,10 @@ static inline void native_flush_tlb_others(const cpumask_t *cpumask,
119{ 119{
120} 120}
121 121
122static inline void reset_lazy_tlbstate(void)
123{
124}
125
122#else /* SMP */ 126#else /* SMP */
123 127
124#include <asm/smp.h> 128#include <asm/smp.h>
@@ -151,6 +155,12 @@ struct tlb_state {
151 char __cacheline_padding[L1_CACHE_BYTES-8]; 155 char __cacheline_padding[L1_CACHE_BYTES-8];
152}; 156};
153DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate); 157DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate);
158
159void reset_lazy_tlbstate(void);
160#else
161static inline void reset_lazy_tlbstate(void)
162{
163}
154#endif 164#endif
155 165
156#endif /* SMP */ 166#endif /* SMP */
@@ -165,4 +175,4 @@ static inline void flush_tlb_kernel_range(unsigned long start,
165 flush_tlb_all(); 175 flush_tlb_all();
166} 176}
167 177
168#endif /* _ASM_X86_TLBFLUSH_H */ 178#endif /* ASM_X86__TLBFLUSH_H */
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index 90ac7718469a..7eca9bc022b2 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -22,8 +22,8 @@
22 * 22 *
23 * Send feedback to <colpatch@us.ibm.com> 23 * Send feedback to <colpatch@us.ibm.com>
24 */ 24 */
25#ifndef _ASM_X86_TOPOLOGY_H 25#ifndef ASM_X86__TOPOLOGY_H
26#define _ASM_X86_TOPOLOGY_H 26#define ASM_X86__TOPOLOGY_H
27 27
28#ifdef CONFIG_X86_32 28#ifdef CONFIG_X86_32
29# ifdef CONFIG_X86_HT 29# ifdef CONFIG_X86_HT
@@ -255,4 +255,4 @@ static inline void set_mp_bus_to_node(int busnum, int node)
255} 255}
256#endif 256#endif
257 257
258#endif /* _ASM_X86_TOPOLOGY_H */ 258#endif /* ASM_X86__TOPOLOGY_H */
diff --git a/include/asm-x86/trampoline.h b/include/asm-x86/trampoline.h
index b156b08d0131..0406bbd898a9 100644
--- a/include/asm-x86/trampoline.h
+++ b/include/asm-x86/trampoline.h
@@ -1,5 +1,5 @@
1#ifndef __TRAMPOLINE_HEADER 1#ifndef ASM_X86__TRAMPOLINE_H
2#define __TRAMPOLINE_HEADER 2#define ASM_X86__TRAMPOLINE_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5 5
@@ -18,4 +18,4 @@ extern unsigned long setup_trampoline(void);
18 18
19#endif /* __ASSEMBLY__ */ 19#endif /* __ASSEMBLY__ */
20 20
21#endif /* __TRAMPOLINE_HEADER */ 21#endif /* ASM_X86__TRAMPOLINE_H */
diff --git a/include/asm-x86/traps.h b/include/asm-x86/traps.h
index a4b65a71bd66..6c3dc2c65751 100644
--- a/include/asm-x86/traps.h
+++ b/include/asm-x86/traps.h
@@ -1,7 +1,14 @@
1#ifndef _ASM_X86_TRAPS_H 1#ifndef ASM_X86__TRAPS_H
2#define _ASM_X86_TRAPS_H 2#define ASM_X86__TRAPS_H
3
4#include <asm/debugreg.h>
5
6#ifdef CONFIG_X86_32
7#define dotraplinkage
8#else
9#define dotraplinkage asmlinkage
10#endif
3 11
4/* Common in X86_32 and X86_64 */
5asmlinkage void divide_error(void); 12asmlinkage void divide_error(void);
6asmlinkage void debug(void); 13asmlinkage void debug(void);
7asmlinkage void nmi(void); 14asmlinkage void nmi(void);
@@ -10,57 +17,65 @@ asmlinkage void overflow(void);
10asmlinkage void bounds(void); 17asmlinkage void bounds(void);
11asmlinkage void invalid_op(void); 18asmlinkage void invalid_op(void);
12asmlinkage void device_not_available(void); 19asmlinkage void device_not_available(void);
20#ifdef CONFIG_X86_64
21asmlinkage void double_fault(void);
22#endif
13asmlinkage void coprocessor_segment_overrun(void); 23asmlinkage void coprocessor_segment_overrun(void);
14asmlinkage void invalid_TSS(void); 24asmlinkage void invalid_TSS(void);
15asmlinkage void segment_not_present(void); 25asmlinkage void segment_not_present(void);
16asmlinkage void stack_segment(void); 26asmlinkage void stack_segment(void);
17asmlinkage void general_protection(void); 27asmlinkage void general_protection(void);
18asmlinkage void page_fault(void); 28asmlinkage void page_fault(void);
29asmlinkage void spurious_interrupt_bug(void);
19asmlinkage void coprocessor_error(void); 30asmlinkage void coprocessor_error(void);
20asmlinkage void simd_coprocessor_error(void);
21asmlinkage void alignment_check(void); 31asmlinkage void alignment_check(void);
22asmlinkage void spurious_interrupt_bug(void);
23#ifdef CONFIG_X86_MCE 32#ifdef CONFIG_X86_MCE
24asmlinkage void machine_check(void); 33asmlinkage void machine_check(void);
25#endif /* CONFIG_X86_MCE */ 34#endif /* CONFIG_X86_MCE */
35asmlinkage void simd_coprocessor_error(void);
26 36
27void do_divide_error(struct pt_regs *, long); 37dotraplinkage void do_divide_error(struct pt_regs *, long);
28void do_overflow(struct pt_regs *, long); 38dotraplinkage void do_debug(struct pt_regs *, long);
29void do_bounds(struct pt_regs *, long); 39dotraplinkage void do_nmi(struct pt_regs *, long);
30void do_coprocessor_segment_overrun(struct pt_regs *, long); 40dotraplinkage void do_int3(struct pt_regs *, long);
31void do_invalid_TSS(struct pt_regs *, long); 41dotraplinkage void do_overflow(struct pt_regs *, long);
32void do_segment_not_present(struct pt_regs *, long); 42dotraplinkage void do_bounds(struct pt_regs *, long);
33void do_stack_segment(struct pt_regs *, long); 43dotraplinkage void do_invalid_op(struct pt_regs *, long);
34void do_alignment_check(struct pt_regs *, long); 44dotraplinkage void do_device_not_available(struct pt_regs *, long);
35void do_invalid_op(struct pt_regs *, long); 45dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long);
36void do_general_protection(struct pt_regs *, long); 46dotraplinkage void do_invalid_TSS(struct pt_regs *, long);
37void do_nmi(struct pt_regs *, long); 47dotraplinkage void do_segment_not_present(struct pt_regs *, long);
48dotraplinkage void do_stack_segment(struct pt_regs *, long);
49dotraplinkage void do_general_protection(struct pt_regs *, long);
50dotraplinkage void do_page_fault(struct pt_regs *, unsigned long);
51dotraplinkage void do_spurious_interrupt_bug(struct pt_regs *, long);
52dotraplinkage void do_coprocessor_error(struct pt_regs *, long);
53dotraplinkage void do_alignment_check(struct pt_regs *, long);
54#ifdef CONFIG_X86_MCE
55dotraplinkage void do_machine_check(struct pt_regs *, long);
56#endif
57dotraplinkage void do_simd_coprocessor_error(struct pt_regs *, long);
58#ifdef CONFIG_X86_32
59dotraplinkage void do_iret_error(struct pt_regs *, long);
60#endif
61
62static inline int get_si_code(unsigned long condition)
63{
64 if (condition & DR_STEP)
65 return TRAP_TRACE;
66 else if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))
67 return TRAP_HWBKPT;
68 else
69 return TRAP_BRKPT;
70}
38 71
39extern int panic_on_unrecovered_nmi; 72extern int panic_on_unrecovered_nmi;
40extern int kstack_depth_to_print; 73extern int kstack_depth_to_print;
41 74
42#ifdef CONFIG_X86_32 75#ifdef CONFIG_X86_32
43
44void do_iret_error(struct pt_regs *, long);
45void do_int3(struct pt_regs *, long);
46void do_debug(struct pt_regs *, long);
47void math_error(void __user *); 76void math_error(void __user *);
48void do_coprocessor_error(struct pt_regs *, long);
49void do_simd_coprocessor_error(struct pt_regs *, long);
50void do_spurious_interrupt_bug(struct pt_regs *, long);
51unsigned long patch_espfix_desc(unsigned long, unsigned long); 77unsigned long patch_espfix_desc(unsigned long, unsigned long);
52asmlinkage void math_emulate(long); 78asmlinkage void math_emulate(long);
79#endif
53 80
54#else /* CONFIG_X86_32 */ 81#endif /* ASM_X86__TRAPS_H */
55
56asmlinkage void double_fault(void);
57
58asmlinkage void do_int3(struct pt_regs *, long);
59asmlinkage void do_stack_segment(struct pt_regs *, long);
60asmlinkage void do_debug(struct pt_regs *, unsigned long);
61asmlinkage void do_coprocessor_error(struct pt_regs *);
62asmlinkage void do_simd_coprocessor_error(struct pt_regs *);
63asmlinkage void do_spurious_interrupt_bug(struct pt_regs *);
64
65#endif /* CONFIG_X86_32 */
66#endif /* _ASM_X86_TRAPS_H */
diff --git a/include/asm-x86/tsc.h b/include/asm-x86/tsc.h
index cb6f6ee45b8f..ad0f5c41e78c 100644
--- a/include/asm-x86/tsc.h
+++ b/include/asm-x86/tsc.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * x86 TSC related functions 2 * x86 TSC related functions
3 */ 3 */
4#ifndef _ASM_X86_TSC_H 4#ifndef ASM_X86__TSC_H
5#define _ASM_X86_TSC_H 5#define ASM_X86__TSC_H
6 6
7#include <asm/processor.h> 7#include <asm/processor.h>
8 8
@@ -59,4 +59,4 @@ extern void check_tsc_sync_target(void);
59 59
60extern int notsc_setup(char *); 60extern int notsc_setup(char *);
61 61
62#endif 62#endif /* ASM_X86__TSC_H */
diff --git a/include/asm-x86/types.h b/include/asm-x86/types.h
index 1ac80cd9acf8..e78b52e17444 100644
--- a/include/asm-x86/types.h
+++ b/include/asm-x86/types.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_TYPES_H 1#ifndef ASM_X86__TYPES_H
2#define _ASM_X86_TYPES_H 2#define ASM_X86__TYPES_H
3 3
4#include <asm-generic/int-ll64.h> 4#include <asm-generic/int-ll64.h>
5 5
@@ -33,4 +33,4 @@ typedef u32 dma_addr_t;
33#endif /* __ASSEMBLY__ */ 33#endif /* __ASSEMBLY__ */
34#endif /* __KERNEL__ */ 34#endif /* __KERNEL__ */
35 35
36#endif 36#endif /* ASM_X86__TYPES_H */
diff --git a/include/asm-x86/uaccess.h b/include/asm-x86/uaccess.h
index 5f702d1d5218..48ebc0ad40ec 100644
--- a/include/asm-x86/uaccess.h
+++ b/include/asm-x86/uaccess.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_UACCES_H_ 1#ifndef ASM_X86__UACCESS_H
2#define _ASM_UACCES_H_ 2#define ASM_X86__UACCESS_H
3/* 3/*
4 * User space memory access functions 4 * User space memory access functions
5 */ 5 */
@@ -450,5 +450,5 @@ extern struct movsl_mask {
450# include "uaccess_64.h" 450# include "uaccess_64.h"
451#endif 451#endif
452 452
453#endif 453#endif /* ASM_X86__UACCESS_H */
454 454
diff --git a/include/asm-x86/uaccess_32.h b/include/asm-x86/uaccess_32.h
index 6fdef39a0bcb..6b5b57d9c6d1 100644
--- a/include/asm-x86/uaccess_32.h
+++ b/include/asm-x86/uaccess_32.h
@@ -1,5 +1,5 @@
1#ifndef __i386_UACCESS_H 1#ifndef ASM_X86__UACCESS_32_H
2#define __i386_UACCESS_H 2#define ASM_X86__UACCESS_32_H
3 3
4/* 4/*
5 * User space memory access functions 5 * User space memory access functions
@@ -215,4 +215,4 @@ long strnlen_user(const char __user *str, long n);
215unsigned long __must_check clear_user(void __user *mem, unsigned long len); 215unsigned long __must_check clear_user(void __user *mem, unsigned long len);
216unsigned long __must_check __clear_user(void __user *mem, unsigned long len); 216unsigned long __must_check __clear_user(void __user *mem, unsigned long len);
217 217
218#endif /* __i386_UACCESS_H */ 218#endif /* ASM_X86__UACCESS_32_H */
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index 515d4dce96b5..c96c1f5d07a2 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -1,5 +1,5 @@
1#ifndef __X86_64_UACCESS_H 1#ifndef ASM_X86__UACCESS_64_H
2#define __X86_64_UACCESS_H 2#define ASM_X86__UACCESS_64_H
3 3
4/* 4/*
5 * User space memory access functions 5 * User space memory access functions
@@ -7,6 +7,7 @@
7#include <linux/compiler.h> 7#include <linux/compiler.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/prefetch.h> 9#include <linux/prefetch.h>
10#include <linux/lockdep.h>
10#include <asm/page.h> 11#include <asm/page.h>
11 12
12/* 13/*
@@ -198,4 +199,4 @@ static inline int __copy_from_user_inatomic_nocache(void *dst,
198unsigned long 199unsigned long
199copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest); 200copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest);
200 201
201#endif /* __X86_64_UACCESS_H */ 202#endif /* ASM_X86__UACCESS_64_H */
diff --git a/include/asm-x86/ucontext.h b/include/asm-x86/ucontext.h
index 50a79f7fcde9..89eaa5456a7e 100644
--- a/include/asm-x86/ucontext.h
+++ b/include/asm-x86/ucontext.h
@@ -1,5 +1,11 @@
1#ifndef _ASM_X86_UCONTEXT_H 1#ifndef ASM_X86__UCONTEXT_H
2#define _ASM_X86_UCONTEXT_H 2#define ASM_X86__UCONTEXT_H
3
4#define UC_FP_XSTATE 0x1 /* indicates the presence of extended state
5 * information in the memory layout pointed
6 * by the fpstate pointer in the ucontext's
7 * sigcontext struct (uc_mcontext).
8 */
3 9
4struct ucontext { 10struct ucontext {
5 unsigned long uc_flags; 11 unsigned long uc_flags;
@@ -9,4 +15,4 @@ struct ucontext {
9 sigset_t uc_sigmask; /* mask last for extensibility */ 15 sigset_t uc_sigmask; /* mask last for extensibility */
10}; 16};
11 17
12#endif /* _ASM_X86_UCONTEXT_H */ 18#endif /* ASM_X86__UCONTEXT_H */
diff --git a/include/asm-x86/unaligned.h b/include/asm-x86/unaligned.h
index a7bd416b4763..59dcdec37160 100644
--- a/include/asm-x86/unaligned.h
+++ b/include/asm-x86/unaligned.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_UNALIGNED_H 1#ifndef ASM_X86__UNALIGNED_H
2#define _ASM_X86_UNALIGNED_H 2#define ASM_X86__UNALIGNED_H
3 3
4/* 4/*
5 * The x86 can do unaligned accesses itself. 5 * The x86 can do unaligned accesses itself.
@@ -11,4 +11,4 @@
11#define get_unaligned __get_unaligned_le 11#define get_unaligned __get_unaligned_le
12#define put_unaligned __put_unaligned_le 12#define put_unaligned __put_unaligned_le
13 13
14#endif /* _ASM_X86_UNALIGNED_H */ 14#endif /* ASM_X86__UNALIGNED_H */
diff --git a/include/asm-x86/unistd_32.h b/include/asm-x86/unistd_32.h
index d7394673b772..017f4a87c913 100644
--- a/include/asm-x86/unistd_32.h
+++ b/include/asm-x86/unistd_32.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_I386_UNISTD_H_ 1#ifndef ASM_X86__UNISTD_32_H
2#define _ASM_I386_UNISTD_H_ 2#define ASM_X86__UNISTD_32_H
3 3
4/* 4/*
5 * This file contains the system call numbers. 5 * This file contains the system call numbers.
@@ -376,4 +376,4 @@
376#endif 376#endif
377 377
378#endif /* __KERNEL__ */ 378#endif /* __KERNEL__ */
379#endif /* _ASM_I386_UNISTD_H_ */ 379#endif /* ASM_X86__UNISTD_32_H */
diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h
index 3a341d791792..ace83f1f6787 100644
--- a/include/asm-x86/unistd_64.h
+++ b/include/asm-x86/unistd_64.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_64_UNISTD_H_ 1#ifndef ASM_X86__UNISTD_64_H
2#define _ASM_X86_64_UNISTD_H_ 2#define ASM_X86__UNISTD_64_H
3 3
4#ifndef __SYSCALL 4#ifndef __SYSCALL
5#define __SYSCALL(a, b) 5#define __SYSCALL(a, b)
@@ -690,4 +690,4 @@ __SYSCALL(__NR_inotify_init1, sys_inotify_init1)
690#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 690#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
691#endif /* __KERNEL__ */ 691#endif /* __KERNEL__ */
692 692
693#endif /* _ASM_X86_64_UNISTD_H_ */ 693#endif /* ASM_X86__UNISTD_64_H */
diff --git a/include/asm-x86/unwind.h b/include/asm-x86/unwind.h
index 8b064bd9c553..a2151567db44 100644
--- a/include/asm-x86/unwind.h
+++ b/include/asm-x86/unwind.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_UNWIND_H 1#ifndef ASM_X86__UNWIND_H
2#define _ASM_X86_UNWIND_H 2#define ASM_X86__UNWIND_H
3 3
4#define UNW_PC(frame) ((void)(frame), 0UL) 4#define UNW_PC(frame) ((void)(frame), 0UL)
5#define UNW_SP(frame) ((void)(frame), 0UL) 5#define UNW_SP(frame) ((void)(frame), 0UL)
@@ -10,4 +10,4 @@ static inline int arch_unw_user_mode(const void *info)
10 return 0; 10 return 0;
11} 11}
12 12
13#endif /* _ASM_X86_UNWIND_H */ 13#endif /* ASM_X86__UNWIND_H */
diff --git a/include/asm-x86/user32.h b/include/asm-x86/user32.h
index a3d910047879..aa66c1857f06 100644
--- a/include/asm-x86/user32.h
+++ b/include/asm-x86/user32.h
@@ -1,5 +1,5 @@
1#ifndef USER32_H 1#ifndef ASM_X86__USER32_H
2#define USER32_H 1 2#define ASM_X86__USER32_H
3 3
4/* IA32 compatible user structures for ptrace. 4/* IA32 compatible user structures for ptrace.
5 * These should be used for 32bit coredumps too. */ 5 * These should be used for 32bit coredumps too. */
@@ -67,4 +67,4 @@ struct user32 {
67}; 67};
68 68
69 69
70#endif 70#endif /* ASM_X86__USER32_H */
diff --git a/include/asm-x86/user_32.h b/include/asm-x86/user_32.h
index d6e51edc259d..e0fe2f55f1a6 100644
--- a/include/asm-x86/user_32.h
+++ b/include/asm-x86/user_32.h
@@ -1,5 +1,5 @@
1#ifndef _I386_USER_H 1#ifndef ASM_X86__USER_32_H
2#define _I386_USER_H 2#define ASM_X86__USER_32_H
3 3
4#include <asm/page.h> 4#include <asm/page.h>
5/* Core file format: The core file is written in such a way that gdb 5/* Core file format: The core file is written in such a way that gdb
@@ -128,4 +128,4 @@ struct user{
128#define HOST_TEXT_START_ADDR (u.start_code) 128#define HOST_TEXT_START_ADDR (u.start_code)
129#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 129#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
130 130
131#endif /* _I386_USER_H */ 131#endif /* ASM_X86__USER_32_H */
diff --git a/include/asm-x86/user_64.h b/include/asm-x86/user_64.h
index 6037b634c77f..38b5799863b4 100644
--- a/include/asm-x86/user_64.h
+++ b/include/asm-x86/user_64.h
@@ -1,5 +1,5 @@
1#ifndef _X86_64_USER_H 1#ifndef ASM_X86__USER_64_H
2#define _X86_64_USER_H 2#define ASM_X86__USER_64_H
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5#include <asm/page.h> 5#include <asm/page.h>
@@ -134,4 +134,4 @@ struct user {
134#define HOST_TEXT_START_ADDR (u.start_code) 134#define HOST_TEXT_START_ADDR (u.start_code)
135#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 135#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
136 136
137#endif /* _X86_64_USER_H */ 137#endif /* ASM_X86__USER_64_H */
diff --git a/include/asm-x86/uv/bios.h b/include/asm-x86/uv/bios.h
index aa73362ff5df..7cd6d7ec1308 100644
--- a/include/asm-x86/uv/bios.h
+++ b/include/asm-x86/uv/bios.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_BIOS_H 1#ifndef ASM_X86__UV__BIOS_H
2#define _ASM_X86_BIOS_H 2#define ASM_X86__UV__BIOS_H
3 3
4/* 4/*
5 * BIOS layer definitions. 5 * BIOS layer definitions.
@@ -65,4 +65,4 @@ x86_bios_freq_base(unsigned long which, unsigned long *ticks_per_second,
65 unsigned long *drift_info); 65 unsigned long *drift_info);
66extern const char *x86_bios_strerror(long status); 66extern const char *x86_bios_strerror(long status);
67 67
68#endif /* _ASM_X86_BIOS_H */ 68#endif /* ASM_X86__UV__BIOS_H */
diff --git a/include/asm-x86/uv/uv_bau.h b/include/asm-x86/uv/uv_bau.h
index 91ac0dfb7588..77153fb18f5e 100644
--- a/include/asm-x86/uv/uv_bau.h
+++ b/include/asm-x86/uv/uv_bau.h
@@ -8,8 +8,8 @@
8 * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10 10
11#ifndef __ASM_X86_UV_BAU__ 11#ifndef ASM_X86__UV__UV_BAU_H
12#define __ASM_X86_UV_BAU__ 12#define ASM_X86__UV__UV_BAU_H
13 13
14#include <linux/bitmap.h> 14#include <linux/bitmap.h>
15#define BITSPERBYTE 8 15#define BITSPERBYTE 8
@@ -40,11 +40,6 @@
40#define UV_ACTIVATION_DESCRIPTOR_SIZE 32 40#define UV_ACTIVATION_DESCRIPTOR_SIZE 32
41#define UV_DISTRIBUTION_SIZE 256 41#define UV_DISTRIBUTION_SIZE 256
42#define UV_SW_ACK_NPENDING 8 42#define UV_SW_ACK_NPENDING 8
43#define UV_BAU_MESSAGE 200
44/*
45 * Messaging irq; see irq_64.h and include/asm-x86/hw_irq_64.h
46 * To be dynamically allocated in the future
47 */
48#define UV_NET_ENDPOINT_INTD 0x38 43#define UV_NET_ENDPOINT_INTD 0x38
49#define UV_DESC_BASE_PNODE_SHIFT 49 44#define UV_DESC_BASE_PNODE_SHIFT 49
50#define UV_PAYLOADQ_PNODE_SHIFT 49 45#define UV_PAYLOADQ_PNODE_SHIFT 49
@@ -334,4 +329,4 @@ extern int uv_flush_tlb_others(cpumask_t *, struct mm_struct *, unsigned long);
334extern void uv_bau_message_intr1(void); 329extern void uv_bau_message_intr1(void);
335extern void uv_bau_timeout_intr1(void); 330extern void uv_bau_timeout_intr1(void);
336 331
337#endif /* __ASM_X86_UV_BAU__ */ 332#endif /* ASM_X86__UV__UV_BAU_H */
diff --git a/include/asm-x86/uv/uv_hub.h b/include/asm-x86/uv/uv_hub.h
index a4ef26e5850b..bdb5b01afbf5 100644
--- a/include/asm-x86/uv/uv_hub.h
+++ b/include/asm-x86/uv/uv_hub.h
@@ -8,8 +8,8 @@
8 * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10 10
11#ifndef __ASM_X86_UV_HUB_H__ 11#ifndef ASM_X86__UV__UV_HUB_H
12#define __ASM_X86_UV_HUB_H__ 12#define ASM_X86__UV__UV_HUB_H
13 13
14#include <linux/numa.h> 14#include <linux/numa.h>
15#include <linux/percpu.h> 15#include <linux/percpu.h>
@@ -350,5 +350,5 @@ static inline int uv_num_possible_blades(void)
350 return uv_possible_blades; 350 return uv_possible_blades;
351} 351}
352 352
353#endif /* __ASM_X86_UV_HUB__ */ 353#endif /* ASM_X86__UV__UV_HUB_H */
354 354
diff --git a/include/asm-x86/uv/uv_mmrs.h b/include/asm-x86/uv/uv_mmrs.h
index 151fd7fcb809..8b03d89d2459 100644
--- a/include/asm-x86/uv/uv_mmrs.h
+++ b/include/asm-x86/uv/uv_mmrs.h
@@ -8,8 +8,8 @@
8 * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10 10
11#ifndef __ASM_X86_UV_MMRS__ 11#ifndef ASM_X86__UV__UV_MMRS_H
12#define __ASM_X86_UV_MMRS__ 12#define ASM_X86__UV__UV_MMRS_H
13 13
14#define UV_MMR_ENABLE (1UL << 63) 14#define UV_MMR_ENABLE (1UL << 63)
15 15
@@ -1292,4 +1292,4 @@ union uvh_si_alias2_overlay_config_u {
1292}; 1292};
1293 1293
1294 1294
1295#endif /* __ASM_X86_UV_MMRS__ */ 1295#endif /* ASM_X86__UV__UV_MMRS_H */
diff --git a/include/asm-x86/vdso.h b/include/asm-x86/vdso.h
index 8e18fb80f5e6..4ab320913ea3 100644
--- a/include/asm-x86/vdso.h
+++ b/include/asm-x86/vdso.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_VDSO_H 1#ifndef ASM_X86__VDSO_H
2#define _ASM_X86_VDSO_H 1 2#define ASM_X86__VDSO_H
3 3
4#ifdef CONFIG_X86_64 4#ifdef CONFIG_X86_64
5extern const char VDSO64_PRELINK[]; 5extern const char VDSO64_PRELINK[];
@@ -44,4 +44,4 @@ extern const char vdso32_int80_start, vdso32_int80_end;
44extern const char vdso32_syscall_start, vdso32_syscall_end; 44extern const char vdso32_syscall_start, vdso32_syscall_end;
45extern const char vdso32_sysenter_start, vdso32_sysenter_end; 45extern const char vdso32_sysenter_start, vdso32_sysenter_end;
46 46
47#endif /* asm-x86/vdso.h */ 47#endif /* ASM_X86__VDSO_H */
diff --git a/include/asm-x86/vga.h b/include/asm-x86/vga.h
index 0ccf804377e6..b9e493d07d07 100644
--- a/include/asm-x86/vga.h
+++ b/include/asm-x86/vga.h
@@ -4,8 +4,8 @@
4 * (c) 1998 Martin Mares <mj@ucw.cz> 4 * (c) 1998 Martin Mares <mj@ucw.cz>
5 */ 5 */
6 6
7#ifndef _LINUX_ASM_VGA_H_ 7#ifndef ASM_X86__VGA_H
8#define _LINUX_ASM_VGA_H_ 8#define ASM_X86__VGA_H
9 9
10/* 10/*
11 * On the PC, we can just recalculate addresses and then 11 * On the PC, we can just recalculate addresses and then
@@ -17,4 +17,4 @@
17#define vga_readb(x) (*(x)) 17#define vga_readb(x) (*(x))
18#define vga_writeb(x, y) (*(y) = (x)) 18#define vga_writeb(x, y) (*(y) = (x))
19 19
20#endif 20#endif /* ASM_X86__VGA_H */
diff --git a/include/asm-x86/vgtod.h b/include/asm-x86/vgtod.h
index 3301f0929342..38fd13364021 100644
--- a/include/asm-x86/vgtod.h
+++ b/include/asm-x86/vgtod.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_VGTOD_H 1#ifndef ASM_X86__VGTOD_H
2#define _ASM_VGTOD_H 1 2#define ASM_X86__VGTOD_H
3 3
4#include <asm/vsyscall.h> 4#include <asm/vsyscall.h>
5#include <linux/clocksource.h> 5#include <linux/clocksource.h>
@@ -26,4 +26,4 @@ extern struct vsyscall_gtod_data __vsyscall_gtod_data
26__section_vsyscall_gtod_data; 26__section_vsyscall_gtod_data;
27extern struct vsyscall_gtod_data vsyscall_gtod_data; 27extern struct vsyscall_gtod_data vsyscall_gtod_data;
28 28
29#endif 29#endif /* ASM_X86__VGTOD_H */
diff --git a/include/asm-x86/visws/cobalt.h b/include/asm-x86/visws/cobalt.h
index 995258831b7f..9627a8fe84e9 100644
--- a/include/asm-x86/visws/cobalt.h
+++ b/include/asm-x86/visws/cobalt.h
@@ -1,5 +1,5 @@
1#ifndef __I386_SGI_COBALT_H 1#ifndef ASM_X86__VISWS__COBALT_H
2#define __I386_SGI_COBALT_H 2#define ASM_X86__VISWS__COBALT_H
3 3
4#include <asm/fixmap.h> 4#include <asm/fixmap.h>
5 5
@@ -122,4 +122,4 @@ extern char visws_board_type;
122 122
123extern char visws_board_rev; 123extern char visws_board_rev;
124 124
125#endif /* __I386_SGI_COBALT_H */ 125#endif /* ASM_X86__VISWS__COBALT_H */
diff --git a/include/asm-x86/visws/lithium.h b/include/asm-x86/visws/lithium.h
index dfcd4f07ab85..b36d3b378c63 100644
--- a/include/asm-x86/visws/lithium.h
+++ b/include/asm-x86/visws/lithium.h
@@ -1,5 +1,5 @@
1#ifndef __I386_SGI_LITHIUM_H 1#ifndef ASM_X86__VISWS__LITHIUM_H
2#define __I386_SGI_LITHIUM_H 2#define ASM_X86__VISWS__LITHIUM_H
3 3
4#include <asm/fixmap.h> 4#include <asm/fixmap.h>
5 5
@@ -49,5 +49,5 @@ static inline unsigned short li_pcib_read16(unsigned long reg)
49 return *((volatile unsigned short *)(LI_PCIB_VADDR+reg)); 49 return *((volatile unsigned short *)(LI_PCIB_VADDR+reg));
50} 50}
51 51
52#endif 52#endif /* ASM_X86__VISWS__LITHIUM_H */
53 53
diff --git a/include/asm-x86/visws/piix4.h b/include/asm-x86/visws/piix4.h
index 83ea4f46e419..61c938045ec9 100644
--- a/include/asm-x86/visws/piix4.h
+++ b/include/asm-x86/visws/piix4.h
@@ -1,5 +1,5 @@
1#ifndef __I386_SGI_PIIX_H 1#ifndef ASM_X86__VISWS__PIIX4_H
2#define __I386_SGI_PIIX_H 2#define ASM_X86__VISWS__PIIX4_H
3 3
4/* 4/*
5 * PIIX4 as used on SGI Visual Workstations 5 * PIIX4 as used on SGI Visual Workstations
@@ -104,4 +104,4 @@
104 */ 104 */
105#define PIIX_GPI_STPCLK 0x4 // STPCLK signal routed back in 105#define PIIX_GPI_STPCLK 0x4 // STPCLK signal routed back in
106 106
107#endif 107#endif /* ASM_X86__VISWS__PIIX4_H */
diff --git a/include/asm-x86/vm86.h b/include/asm-x86/vm86.h
index 5ce351325e01..998bd18eb737 100644
--- a/include/asm-x86/vm86.h
+++ b/include/asm-x86/vm86.h
@@ -1,5 +1,5 @@
1#ifndef _LINUX_VM86_H 1#ifndef ASM_X86__VM86_H
2#define _LINUX_VM86_H 2#define ASM_X86__VM86_H
3 3
4/* 4/*
5 * I'm guessing at the VIF/VIP flag usage, but hope that this is how 5 * I'm guessing at the VIF/VIP flag usage, but hope that this is how
@@ -205,4 +205,4 @@ static inline int handle_vm86_trap(struct kernel_vm86_regs *a, long b, int c)
205 205
206#endif /* __KERNEL__ */ 206#endif /* __KERNEL__ */
207 207
208#endif 208#endif /* ASM_X86__VM86_H */
diff --git a/include/asm-x86/vmi_time.h b/include/asm-x86/vmi_time.h
index c3118c385156..b2d39e6a08b7 100644
--- a/include/asm-x86/vmi_time.h
+++ b/include/asm-x86/vmi_time.h
@@ -22,8 +22,8 @@
22 * 22 *
23 */ 23 */
24 24
25#ifndef __VMI_TIME_H 25#ifndef ASM_X86__VMI_TIME_H
26#define __VMI_TIME_H 26#define ASM_X86__VMI_TIME_H
27 27
28/* 28/*
29 * Raw VMI call indices for timer functions 29 * Raw VMI call indices for timer functions
@@ -95,4 +95,4 @@ extern void __devinit vmi_time_ap_init(void);
95 95
96#define CONFIG_VMI_ALARM_HZ 100 96#define CONFIG_VMI_ALARM_HZ 100
97 97
98#endif 98#endif /* ASM_X86__VMI_TIME_H */
diff --git a/include/asm-x86/vsyscall.h b/include/asm-x86/vsyscall.h
index 6b66ff905af0..dcd4682413de 100644
--- a/include/asm-x86/vsyscall.h
+++ b/include/asm-x86/vsyscall.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_X86_64_VSYSCALL_H_ 1#ifndef ASM_X86__VSYSCALL_H
2#define _ASM_X86_64_VSYSCALL_H_ 2#define ASM_X86__VSYSCALL_H
3 3
4enum vsyscall_num { 4enum vsyscall_num {
5 __NR_vgettimeofday, 5 __NR_vgettimeofday,
@@ -41,4 +41,4 @@ extern void map_vsyscall(void);
41 41
42#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
43 43
44#endif /* _ASM_X86_64_VSYSCALL_H_ */ 44#endif /* ASM_X86__VSYSCALL_H */
diff --git a/include/asm-x86/xcr.h b/include/asm-x86/xcr.h
new file mode 100644
index 000000000000..f2cba4e79a23
--- /dev/null
+++ b/include/asm-x86/xcr.h
@@ -0,0 +1,49 @@
1/* -*- linux-c -*- ------------------------------------------------------- *
2 *
3 * Copyright 2008 rPath, Inc. - All Rights Reserved
4 *
5 * This file is part of the Linux kernel, and is made available under
6 * the terms of the GNU General Public License version 2 or (at your
7 * option) any later version; incorporated herein by reference.
8 *
9 * ----------------------------------------------------------------------- */
10
11/*
12 * asm-x86/xcr.h
13 *
14 * Definitions for the eXtended Control Register instructions
15 */
16
17#ifndef _ASM_X86_XCR_H
18#define _ASM_X86_XCR_H
19
20#define XCR_XFEATURE_ENABLED_MASK 0x00000000
21
22#ifdef __KERNEL__
23# ifndef __ASSEMBLY__
24
25#include <linux/types.h>
26
27static inline u64 xgetbv(u32 index)
28{
29 u32 eax, edx;
30
31 asm volatile(".byte 0x0f,0x01,0xd0" /* xgetbv */
32 : "=a" (eax), "=d" (edx)
33 : "c" (index));
34 return eax + ((u64)edx << 32);
35}
36
37static inline void xsetbv(u32 index, u64 value)
38{
39 u32 eax = value;
40 u32 edx = value >> 32;
41
42 asm volatile(".byte 0x0f,0x01,0xd1" /* xsetbv */
43 : : "a" (eax), "d" (edx), "c" (index));
44}
45
46# endif /* __ASSEMBLY__ */
47#endif /* __KERNEL__ */
48
49#endif /* _ASM_X86_XCR_H */
diff --git a/include/asm-x86/xen/events.h b/include/asm-x86/xen/events.h
index 8ded74720024..8151f5b8b6cb 100644
--- a/include/asm-x86/xen/events.h
+++ b/include/asm-x86/xen/events.h
@@ -1,5 +1,5 @@
1#ifndef __XEN_EVENTS_H 1#ifndef ASM_X86__XEN__EVENTS_H
2#define __XEN_EVENTS_H 2#define ASM_X86__XEN__EVENTS_H
3 3
4enum ipi_vector { 4enum ipi_vector {
5 XEN_RESCHEDULE_VECTOR, 5 XEN_RESCHEDULE_VECTOR,
@@ -21,4 +21,4 @@ static inline void xen_do_IRQ(int irq, struct pt_regs *regs)
21 do_IRQ(regs); 21 do_IRQ(regs);
22} 22}
23 23
24#endif /* __XEN_EVENTS_H */ 24#endif /* ASM_X86__XEN__EVENTS_H */
diff --git a/include/asm-x86/xen/grant_table.h b/include/asm-x86/xen/grant_table.h
index 2444d4593a3b..c4baab4d2b68 100644
--- a/include/asm-x86/xen/grant_table.h
+++ b/include/asm-x86/xen/grant_table.h
@@ -1,7 +1,7 @@
1#ifndef __XEN_GRANT_TABLE_H 1#ifndef ASM_X86__XEN__GRANT_TABLE_H
2#define __XEN_GRANT_TABLE_H 2#define ASM_X86__XEN__GRANT_TABLE_H
3 3
4#define xen_alloc_vm_area(size) alloc_vm_area(size) 4#define xen_alloc_vm_area(size) alloc_vm_area(size)
5#define xen_free_vm_area(area) free_vm_area(area) 5#define xen_free_vm_area(area) free_vm_area(area)
6 6
7#endif /* __XEN_GRANT_TABLE_H */ 7#endif /* ASM_X86__XEN__GRANT_TABLE_H */
diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index 91cb7fd5c123..44f4259bee3f 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -30,8 +30,8 @@
30 * IN THE SOFTWARE. 30 * IN THE SOFTWARE.
31 */ 31 */
32 32
33#ifndef __HYPERCALL_H__ 33#ifndef ASM_X86__XEN__HYPERCALL_H
34#define __HYPERCALL_H__ 34#define ASM_X86__XEN__HYPERCALL_H
35 35
36#include <linux/errno.h> 36#include <linux/errno.h>
37#include <linux/string.h> 37#include <linux/string.h>
@@ -524,4 +524,4 @@ MULTI_stack_switch(struct multicall_entry *mcl,
524 mcl->args[1] = esp; 524 mcl->args[1] = esp;
525} 525}
526 526
527#endif /* __HYPERCALL_H__ */ 527#endif /* ASM_X86__XEN__HYPERCALL_H */
diff --git a/include/asm-x86/xen/hypervisor.h b/include/asm-x86/xen/hypervisor.h
index 8e15dd28c91f..445a24759560 100644
--- a/include/asm-x86/xen/hypervisor.h
+++ b/include/asm-x86/xen/hypervisor.h
@@ -30,12 +30,11 @@
30 * IN THE SOFTWARE. 30 * IN THE SOFTWARE.
31 */ 31 */
32 32
33#ifndef __HYPERVISOR_H__ 33#ifndef ASM_X86__XEN__HYPERVISOR_H
34#define __HYPERVISOR_H__ 34#define ASM_X86__XEN__HYPERVISOR_H
35 35
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/kernel.h> 37#include <linux/kernel.h>
38#include <linux/version.h>
39 38
40#include <xen/interface/xen.h> 39#include <xen/interface/xen.h>
41#include <xen/interface/version.h> 40#include <xen/interface/version.h>
@@ -55,7 +54,6 @@
55/* arch/i386/kernel/setup.c */ 54/* arch/i386/kernel/setup.c */
56extern struct shared_info *HYPERVISOR_shared_info; 55extern struct shared_info *HYPERVISOR_shared_info;
57extern struct start_info *xen_start_info; 56extern struct start_info *xen_start_info;
58#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
59 57
60/* arch/i386/mach-xen/evtchn.c */ 58/* arch/i386/mach-xen/evtchn.c */
61/* Force a proper event-channel callback from Xen. */ 59/* Force a proper event-channel callback from Xen. */
@@ -68,6 +66,17 @@ u64 jiffies_to_st(unsigned long jiffies);
68#define MULTI_UVMFLAGS_INDEX 3 66#define MULTI_UVMFLAGS_INDEX 3
69#define MULTI_UVMDOMID_INDEX 4 67#define MULTI_UVMDOMID_INDEX 4
70 68
71#define is_running_on_xen() (xen_start_info ? 1 : 0) 69enum xen_domain_type {
70 XEN_NATIVE,
71 XEN_PV_DOMAIN,
72 XEN_HVM_DOMAIN,
73};
72 74
73#endif /* __HYPERVISOR_H__ */ 75extern enum xen_domain_type xen_domain_type;
76
77#define xen_domain() (xen_domain_type != XEN_NATIVE)
78#define xen_pv_domain() (xen_domain_type == XEN_PV_DOMAIN)
79#define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags & SIF_INITDOMAIN)
80#define xen_hvm_domain() (xen_domain_type == XEN_HVM_DOMAIN)
81
82#endif /* ASM_X86__XEN__HYPERVISOR_H */
diff --git a/include/asm-x86/xen/interface.h b/include/asm-x86/xen/interface.h
index 9d810f2538a2..d077bba96da9 100644
--- a/include/asm-x86/xen/interface.h
+++ b/include/asm-x86/xen/interface.h
@@ -6,8 +6,8 @@
6 * Copyright (c) 2004, K A Fraser 6 * Copyright (c) 2004, K A Fraser
7 */ 7 */
8 8
9#ifndef __ASM_X86_XEN_INTERFACE_H 9#ifndef ASM_X86__XEN__INTERFACE_H
10#define __ASM_X86_XEN_INTERFACE_H 10#define ASM_X86__XEN__INTERFACE_H
11 11
12#ifdef __XEN__ 12#ifdef __XEN__
13#define __DEFINE_GUEST_HANDLE(name, type) \ 13#define __DEFINE_GUEST_HANDLE(name, type) \
@@ -172,4 +172,4 @@ DEFINE_GUEST_HANDLE_STRUCT(vcpu_guest_context);
172#define XEN_CPUID XEN_EMULATE_PREFIX "cpuid" 172#define XEN_CPUID XEN_EMULATE_PREFIX "cpuid"
173#endif 173#endif
174 174
175#endif /* __ASM_X86_XEN_INTERFACE_H */ 175#endif /* ASM_X86__XEN__INTERFACE_H */
diff --git a/include/asm-x86/xen/interface_32.h b/include/asm-x86/xen/interface_32.h
index d8ac41d5db86..08167e19fc66 100644
--- a/include/asm-x86/xen/interface_32.h
+++ b/include/asm-x86/xen/interface_32.h
@@ -6,8 +6,8 @@
6 * Copyright (c) 2004, K A Fraser 6 * Copyright (c) 2004, K A Fraser
7 */ 7 */
8 8
9#ifndef __ASM_X86_XEN_INTERFACE_32_H 9#ifndef ASM_X86__XEN__INTERFACE_32_H
10#define __ASM_X86_XEN_INTERFACE_32_H 10#define ASM_X86__XEN__INTERFACE_32_H
11 11
12 12
13/* 13/*
@@ -94,4 +94,4 @@ typedef struct xen_callback xen_callback_t;
94#define xen_pfn_to_cr3(pfn) (((unsigned)(pfn) << 12) | ((unsigned)(pfn) >> 20)) 94#define xen_pfn_to_cr3(pfn) (((unsigned)(pfn) << 12) | ((unsigned)(pfn) >> 20))
95#define xen_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3) << 20)) 95#define xen_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3) << 20))
96 96
97#endif /* __ASM_X86_XEN_INTERFACE_32_H */ 97#endif /* ASM_X86__XEN__INTERFACE_32_H */
diff --git a/include/asm-x86/xen/interface_64.h b/include/asm-x86/xen/interface_64.h
index 842266ce96e6..046c0f1e01d4 100644
--- a/include/asm-x86/xen/interface_64.h
+++ b/include/asm-x86/xen/interface_64.h
@@ -1,5 +1,5 @@
1#ifndef __ASM_X86_XEN_INTERFACE_64_H 1#ifndef ASM_X86__XEN__INTERFACE_64_H
2#define __ASM_X86_XEN_INTERFACE_64_H 2#define ASM_X86__XEN__INTERFACE_64_H
3 3
4/* 4/*
5 * 64-bit segment selectors 5 * 64-bit segment selectors
@@ -156,4 +156,4 @@ typedef unsigned long xen_callback_t;
156#endif /* !__ASSEMBLY__ */ 156#endif /* !__ASSEMBLY__ */
157 157
158 158
159#endif /* __ASM_X86_XEN_INTERFACE_64_H */ 159#endif /* ASM_X86__XEN__INTERFACE_64_H */
diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h
index 7b3835d3b77d..d5eada0a48d9 100644
--- a/include/asm-x86/xen/page.h
+++ b/include/asm-x86/xen/page.h
@@ -1,5 +1,5 @@
1#ifndef __XEN_PAGE_H 1#ifndef ASM_X86__XEN__PAGE_H
2#define __XEN_PAGE_H 2#define ASM_X86__XEN__PAGE_H
3 3
4#include <linux/pfn.h> 4#include <linux/pfn.h>
5 5
@@ -76,13 +76,13 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
76static inline xmaddr_t phys_to_machine(xpaddr_t phys) 76static inline xmaddr_t phys_to_machine(xpaddr_t phys)
77{ 77{
78 unsigned offset = phys.paddr & ~PAGE_MASK; 78 unsigned offset = phys.paddr & ~PAGE_MASK;
79 return XMADDR(PFN_PHYS((u64)pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset); 79 return XMADDR(PFN_PHYS(pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
80} 80}
81 81
82static inline xpaddr_t machine_to_phys(xmaddr_t machine) 82static inline xpaddr_t machine_to_phys(xmaddr_t machine)
83{ 83{
84 unsigned offset = machine.maddr & ~PAGE_MASK; 84 unsigned offset = machine.maddr & ~PAGE_MASK;
85 return XPADDR(PFN_PHYS((u64)mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset); 85 return XPADDR(PFN_PHYS(mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
86} 86}
87 87
88/* 88/*
@@ -162,4 +162,4 @@ xmaddr_t arbitrary_virt_to_machine(void *address);
162void make_lowmem_page_readonly(void *vaddr); 162void make_lowmem_page_readonly(void *vaddr);
163void make_lowmem_page_readwrite(void *vaddr); 163void make_lowmem_page_readwrite(void *vaddr);
164 164
165#endif /* __XEN_PAGE_H */ 165#endif /* ASM_X86__XEN__PAGE_H */
diff --git a/include/asm-x86/xsave.h b/include/asm-x86/xsave.h
new file mode 100644
index 000000000000..08e9a1ac07a9
--- /dev/null
+++ b/include/asm-x86/xsave.h
@@ -0,0 +1,118 @@
1#ifndef __ASM_X86_XSAVE_H
2#define __ASM_X86_XSAVE_H
3
4#include <linux/types.h>
5#include <asm/processor.h>
6#include <asm/i387.h>
7
8#define XSTATE_FP 0x1
9#define XSTATE_SSE 0x2
10
11#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
12
13#define FXSAVE_SIZE 512
14
15/*
16 * These are the features that the OS can handle currently.
17 */
18#define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE)
19
20#ifdef CONFIG_X86_64
21#define REX_PREFIX "0x48, "
22#else
23#define REX_PREFIX
24#endif
25
26extern unsigned int xstate_size;
27extern u64 pcntxt_mask;
28extern struct xsave_struct *init_xstate_buf;
29
30extern void xsave_cntxt_init(void);
31extern void xsave_init(void);
32extern int init_fpu(struct task_struct *child);
33extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
34 void __user *fpstate,
35 struct _fpx_sw_bytes *sw);
36
37static inline int xrstor_checking(struct xsave_struct *fx)
38{
39 int err;
40
41 asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
42 "2:\n"
43 ".section .fixup,\"ax\"\n"
44 "3: movl $-1,%[err]\n"
45 " jmp 2b\n"
46 ".previous\n"
47 _ASM_EXTABLE(1b, 3b)
48 : [err] "=r" (err)
49 : "D" (fx), "m" (*fx), "a" (-1), "d" (-1), "0" (0)
50 : "memory");
51
52 return err;
53}
54
55static inline int xsave_user(struct xsave_struct __user *buf)
56{
57 int err;
58 __asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
59 "2:\n"
60 ".section .fixup,\"ax\"\n"
61 "3: movl $-1,%[err]\n"
62 " jmp 2b\n"
63 ".previous\n"
64 ".section __ex_table,\"a\"\n"
65 _ASM_ALIGN "\n"
66 _ASM_PTR "1b,3b\n"
67 ".previous"
68 : [err] "=r" (err)
69 : "D" (buf), "a" (-1), "d" (-1), "0" (0)
70 : "memory");
71 if (unlikely(err) && __clear_user(buf, xstate_size))
72 err = -EFAULT;
73 /* No need to clear here because the caller clears USED_MATH */
74 return err;
75}
76
77static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
78{
79 int err;
80 struct xsave_struct *xstate = ((__force struct xsave_struct *)buf);
81 u32 lmask = mask;
82 u32 hmask = mask >> 32;
83
84 __asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n"
85 "2:\n"
86 ".section .fixup,\"ax\"\n"
87 "3: movl $-1,%[err]\n"
88 " jmp 2b\n"
89 ".previous\n"
90 ".section __ex_table,\"a\"\n"
91 _ASM_ALIGN "\n"
92 _ASM_PTR "1b,3b\n"
93 ".previous"
94 : [err] "=r" (err)
95 : "D" (xstate), "a" (lmask), "d" (hmask), "0" (0)
96 : "memory"); /* memory required? */
97 return err;
98}
99
100static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
101{
102 u32 lmask = mask;
103 u32 hmask = mask >> 32;
104
105 asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
106 : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
107 : "memory");
108}
109
110static inline void xsave(struct task_struct *tsk)
111{
112 /* This, however, we can work around by forcing the compiler to select
113 an addressing mode that doesn't require extended registers. */
114 __asm__ __volatile__(".byte " REX_PREFIX "0x0f,0xae,0x27"
115 : : "D" (&(tsk->thread.xstate->xsave)),
116 "a" (-1), "d"(-1) : "memory");
117}
118#endif
diff --git a/include/asm-xtensa/a.out.h b/include/asm-xtensa/a.out.h
deleted file mode 100644
index fdf13702924a..000000000000
--- a/include/asm-xtensa/a.out.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * include/asm-xtensa/a.out.h
3 *
4 * Dummy a.out file. Xtensa does not support the a.out format, but the kernel
5 * seems to depend on it.
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_A_OUT_H
15#define _XTENSA_A_OUT_H
16
17struct exec
18{
19 unsigned long a_info;
20 unsigned a_text;
21 unsigned a_data;
22 unsigned a_bss;
23 unsigned a_syms;
24 unsigned a_entry;
25 unsigned a_trsize;
26 unsigned a_drsize;
27};
28
29#endif /* _XTENSA_A_OUT_H */
diff --git a/include/asm-xtensa/elf.h b/include/asm-xtensa/elf.h
index ca6e5101a2cb..c3f53e755ca5 100644
--- a/include/asm-xtensa/elf.h
+++ b/include/asm-xtensa/elf.h
@@ -189,7 +189,7 @@ typedef struct {
189#endif 189#endif
190} elf_xtregs_t; 190} elf_xtregs_t;
191 191
192#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) 192#define SET_PERSONALITY(ex) set_personality(PER_LINUX_32BIT)
193 193
194struct task_struct; 194struct task_struct;
195 195
diff --git a/include/crypto/internal/rng.h b/include/crypto/internal/rng.h
new file mode 100644
index 000000000000..896973369573
--- /dev/null
+++ b/include/crypto/internal/rng.h
@@ -0,0 +1,26 @@
1/*
2 * RNG: Random Number Generator algorithms under the crypto API
3 *
4 * Copyright (c) 2008 Neil Horman <nhorman@tuxdriver.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 */
12
13#ifndef _CRYPTO_INTERNAL_RNG_H
14#define _CRYPTO_INTERNAL_RNG_H
15
16#include <crypto/algapi.h>
17#include <crypto/rng.h>
18
19extern const struct crypto_type crypto_rng_type;
20
21static inline void *crypto_rng_ctx(struct crypto_rng *tfm)
22{
23 return crypto_tfm_ctx(&tfm->base);
24}
25
26#endif
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h
index ccc32bad9a89..2ba42cd7d6aa 100644
--- a/include/crypto/internal/skcipher.h
+++ b/include/crypto/internal/skcipher.h
@@ -15,7 +15,6 @@
15 15
16#include <crypto/algapi.h> 16#include <crypto/algapi.h>
17#include <crypto/skcipher.h> 17#include <crypto/skcipher.h>
18#include <linux/init.h>
19#include <linux/types.h> 18#include <linux/types.h>
20 19
21struct rtattr; 20struct rtattr;
@@ -65,11 +64,6 @@ void skcipher_geniv_free(struct crypto_instance *inst);
65int skcipher_geniv_init(struct crypto_tfm *tfm); 64int skcipher_geniv_init(struct crypto_tfm *tfm);
66void skcipher_geniv_exit(struct crypto_tfm *tfm); 65void skcipher_geniv_exit(struct crypto_tfm *tfm);
67 66
68int __init eseqiv_module_init(void);
69void __exit eseqiv_module_exit(void);
70int __init chainiv_module_init(void);
71void chainiv_module_exit(void);
72
73static inline struct crypto_ablkcipher *skcipher_geniv_cipher( 67static inline struct crypto_ablkcipher *skcipher_geniv_cipher(
74 struct crypto_ablkcipher *geniv) 68 struct crypto_ablkcipher *geniv)
75{ 69{
diff --git a/include/crypto/rng.h b/include/crypto/rng.h
new file mode 100644
index 000000000000..c93f9b917925
--- /dev/null
+++ b/include/crypto/rng.h
@@ -0,0 +1,75 @@
1/*
2 * RNG: Random Number Generator algorithms under the crypto API
3 *
4 * Copyright (c) 2008 Neil Horman <nhorman@tuxdriver.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 */
12
13#ifndef _CRYPTO_RNG_H
14#define _CRYPTO_RNG_H
15
16#include <linux/crypto.h>
17
18extern struct crypto_rng *crypto_default_rng;
19
20int crypto_get_default_rng(void);
21void crypto_put_default_rng(void);
22
23static inline struct crypto_rng *__crypto_rng_cast(struct crypto_tfm *tfm)
24{
25 return (struct crypto_rng *)tfm;
26}
27
28static inline struct crypto_rng *crypto_alloc_rng(const char *alg_name,
29 u32 type, u32 mask)
30{
31 type &= ~CRYPTO_ALG_TYPE_MASK;
32 type |= CRYPTO_ALG_TYPE_RNG;
33 mask |= CRYPTO_ALG_TYPE_MASK;
34
35 return __crypto_rng_cast(crypto_alloc_base(alg_name, type, mask));
36}
37
38static inline struct crypto_tfm *crypto_rng_tfm(struct crypto_rng *tfm)
39{
40 return &tfm->base;
41}
42
43static inline struct rng_alg *crypto_rng_alg(struct crypto_rng *tfm)
44{
45 return &crypto_rng_tfm(tfm)->__crt_alg->cra_rng;
46}
47
48static inline struct rng_tfm *crypto_rng_crt(struct crypto_rng *tfm)
49{
50 return &crypto_rng_tfm(tfm)->crt_rng;
51}
52
53static inline void crypto_free_rng(struct crypto_rng *tfm)
54{
55 crypto_free_tfm(crypto_rng_tfm(tfm));
56}
57
58static inline int crypto_rng_get_bytes(struct crypto_rng *tfm,
59 u8 *rdata, unsigned int dlen)
60{
61 return crypto_rng_crt(tfm)->rng_gen_random(tfm, rdata, dlen);
62}
63
64static inline int crypto_rng_reset(struct crypto_rng *tfm,
65 u8 *seed, unsigned int slen)
66{
67 return crypto_rng_crt(tfm)->rng_reset(tfm, seed, slen);
68}
69
70static inline int crypto_rng_seedsize(struct crypto_rng *tfm)
71{
72 return crypto_rng_alg(tfm)->seedsize;
73}
74
75#endif
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 38d3c6b8276a..f46ba4b57da4 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -36,7 +36,6 @@
36#ifndef _DRM_H_ 36#ifndef _DRM_H_
37#define _DRM_H_ 37#define _DRM_H_
38 38
39#if defined(__linux__)
40#if defined(__KERNEL__) 39#if defined(__KERNEL__)
41#endif 40#endif
42#include <asm/ioctl.h> /* For _IO* macros */ 41#include <asm/ioctl.h> /* For _IO* macros */
@@ -46,22 +45,6 @@
46#define DRM_IOC_WRITE _IOC_WRITE 45#define DRM_IOC_WRITE _IOC_WRITE
47#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE 46#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
48#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) 47#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
49#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
50#if defined(__FreeBSD__) && defined(IN_MODULE)
51/* Prevent name collision when including sys/ioccom.h */
52#undef ioctl
53#include <sys/ioccom.h>
54#define ioctl(a,b,c) xf86ioctl(a,b,c)
55#else
56#include <sys/ioccom.h>
57#endif /* __FreeBSD__ && xf86ioctl */
58#define DRM_IOCTL_NR(n) ((n) & 0xff)
59#define DRM_IOC_VOID IOC_VOID
60#define DRM_IOC_READ IOC_OUT
61#define DRM_IOC_WRITE IOC_IN
62#define DRM_IOC_READWRITE IOC_INOUT
63#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
64#endif
65 48
66#define DRM_MAJOR 226 49#define DRM_MAJOR 226
67#define DRM_MAX_MINOR 15 50#define DRM_MAX_MINOR 15
@@ -471,6 +454,7 @@ struct drm_irq_busid {
471enum drm_vblank_seq_type { 454enum drm_vblank_seq_type {
472 _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ 455 _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
473 _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ 456 _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
457 _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
474 _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ 458 _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
475 _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ 459 _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
476 _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ 460 _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */
@@ -503,6 +487,19 @@ union drm_wait_vblank {
503 struct drm_wait_vblank_reply reply; 487 struct drm_wait_vblank_reply reply;
504}; 488};
505 489
490#define _DRM_PRE_MODESET 1
491#define _DRM_POST_MODESET 2
492
493/**
494 * DRM_IOCTL_MODESET_CTL ioctl argument type
495 *
496 * \sa drmModesetCtl().
497 */
498struct drm_modeset_ctl {
499 uint32_t crtc;
500 uint32_t cmd;
501};
502
506/** 503/**
507 * DRM_IOCTL_AGP_ENABLE ioctl argument type. 504 * DRM_IOCTL_AGP_ENABLE ioctl argument type.
508 * 505 *
@@ -573,6 +570,34 @@ struct drm_set_version {
573 int drm_dd_minor; 570 int drm_dd_minor;
574}; 571};
575 572
573/** DRM_IOCTL_GEM_CLOSE ioctl argument type */
574struct drm_gem_close {
575 /** Handle of the object to be closed. */
576 uint32_t handle;
577 uint32_t pad;
578};
579
580/** DRM_IOCTL_GEM_FLINK ioctl argument type */
581struct drm_gem_flink {
582 /** Handle for the object being named */
583 uint32_t handle;
584
585 /** Returned global name */
586 uint32_t name;
587};
588
589/** DRM_IOCTL_GEM_OPEN ioctl argument type */
590struct drm_gem_open {
591 /** Name of object being opened */
592 uint32_t name;
593
594 /** Returned handle for the object */
595 uint32_t handle;
596
597 /** Returned size of the object */
598 uint64_t size;
599};
600
576#define DRM_IOCTL_BASE 'd' 601#define DRM_IOCTL_BASE 'd'
577#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) 602#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
578#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) 603#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
@@ -587,6 +612,10 @@ struct drm_set_version {
587#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) 612#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
588#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) 613#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
589#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) 614#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
615#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
616#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
617#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
618#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
590 619
591#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) 620#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
592#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) 621#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 1c1b13e29223..59c796b46ee7 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -104,6 +104,7 @@ struct drm_device;
104#define DRIVER_DMA_QUEUE 0x200 104#define DRIVER_DMA_QUEUE 0x200
105#define DRIVER_FB_DMA 0x400 105#define DRIVER_FB_DMA 0x400
106#define DRIVER_IRQ_VBL2 0x800 106#define DRIVER_IRQ_VBL2 0x800
107#define DRIVER_GEM 0x1000
107 108
108/***********************************************************************/ 109/***********************************************************************/
109/** \name Begin the DRM... */ 110/** \name Begin the DRM... */
@@ -387,6 +388,10 @@ struct drm_file {
387 struct drm_minor *minor; 388 struct drm_minor *minor;
388 int remove_auth_on_close; 389 int remove_auth_on_close;
389 unsigned long lock_count; 390 unsigned long lock_count;
391 /** Mapping of mm object handles to object pointers. */
392 struct idr object_idr;
393 /** Lock for synchronization of access to object_idr. */
394 spinlock_t table_lock;
390 struct file *filp; 395 struct file *filp;
391 void *driver_priv; 396 void *driver_priv;
392}; 397};
@@ -558,6 +563,56 @@ struct drm_ati_pcigart_info {
558}; 563};
559 564
560/** 565/**
566 * This structure defines the drm_mm memory object, which will be used by the
567 * DRM for its buffer objects.
568 */
569struct drm_gem_object {
570 /** Reference count of this object */
571 struct kref refcount;
572
573 /** Handle count of this object. Each handle also holds a reference */
574 struct kref handlecount;
575
576 /** Related drm device */
577 struct drm_device *dev;
578
579 /** File representing the shmem storage */
580 struct file *filp;
581
582 /**
583 * Size of the object, in bytes. Immutable over the object's
584 * lifetime.
585 */
586 size_t size;
587
588 /**
589 * Global name for this object, starts at 1. 0 means unnamed.
590 * Access is covered by the object_name_lock in the related drm_device
591 */
592 int name;
593
594 /**
595 * Memory domains. These monitor which caches contain read/write data
596 * related to the object. When transitioning from one set of domains
597 * to another, the driver is called to ensure that caches are suitably
598 * flushed and invalidated
599 */
600 uint32_t read_domains;
601 uint32_t write_domain;
602
603 /**
604 * While validating an exec operation, the
605 * new read/write domain values are computed here.
606 * They will be transferred to the above values
607 * at the point that any cache flushing occurs
608 */
609 uint32_t pending_read_domains;
610 uint32_t pending_write_domain;
611
612 void *driver_private;
613};
614
615/**
561 * DRM driver structure. This structure represent the common code for 616 * DRM driver structure. This structure represent the common code for
562 * a family of cards. There will one drm_device for each card present 617 * a family of cards. There will one drm_device for each card present
563 * in this family 618 * in this family
@@ -580,11 +635,54 @@ struct drm_driver {
580 int (*kernel_context_switch) (struct drm_device *dev, int old, 635 int (*kernel_context_switch) (struct drm_device *dev, int old,
581 int new); 636 int new);
582 void (*kernel_context_switch_unlock) (struct drm_device *dev); 637 void (*kernel_context_switch_unlock) (struct drm_device *dev);
583 int (*vblank_wait) (struct drm_device *dev, unsigned int *sequence);
584 int (*vblank_wait2) (struct drm_device *dev, unsigned int *sequence);
585 int (*dri_library_name) (struct drm_device *dev, char *buf); 638 int (*dri_library_name) (struct drm_device *dev, char *buf);
586 639
587 /** 640 /**
641 * get_vblank_counter - get raw hardware vblank counter
642 * @dev: DRM device
643 * @crtc: counter to fetch
644 *
645 * Driver callback for fetching a raw hardware vblank counter
646 * for @crtc. If a device doesn't have a hardware counter, the
647 * driver can simply return the value of drm_vblank_count and
648 * make the enable_vblank() and disable_vblank() hooks into no-ops,
649 * leaving interrupts enabled at all times.
650 *
651 * Wraparound handling and loss of events due to modesetting is dealt
652 * with in the DRM core code.
653 *
654 * RETURNS
655 * Raw vblank counter value.
656 */
657 u32 (*get_vblank_counter) (struct drm_device *dev, int crtc);
658
659 /**
660 * enable_vblank - enable vblank interrupt events
661 * @dev: DRM device
662 * @crtc: which irq to enable
663 *
664 * Enable vblank interrupts for @crtc. If the device doesn't have
665 * a hardware vblank counter, this routine should be a no-op, since
666 * interrupts will have to stay on to keep the count accurate.
667 *
668 * RETURNS
669 * Zero on success, appropriate errno if the given @crtc's vblank
670 * interrupt cannot be enabled.
671 */
672 int (*enable_vblank) (struct drm_device *dev, int crtc);
673
674 /**
675 * disable_vblank - disable vblank interrupt events
676 * @dev: DRM device
677 * @crtc: which irq to enable
678 *
679 * Disable vblank interrupts for @crtc. If the device doesn't have
680 * a hardware vblank counter, this routine should be a no-op, since
681 * interrupts will have to stay on to keep the count accurate.
682 */
683 void (*disable_vblank) (struct drm_device *dev, int crtc);
684
685 /**
588 * Called by \c drm_device_is_agp. Typically used to determine if a 686 * Called by \c drm_device_is_agp. Typically used to determine if a
589 * card is really attached to AGP or not. 687 * card is really attached to AGP or not.
590 * 688 *
@@ -601,7 +699,7 @@ struct drm_driver {
601 699
602 irqreturn_t(*irq_handler) (DRM_IRQ_ARGS); 700 irqreturn_t(*irq_handler) (DRM_IRQ_ARGS);
603 void (*irq_preinstall) (struct drm_device *dev); 701 void (*irq_preinstall) (struct drm_device *dev);
604 void (*irq_postinstall) (struct drm_device *dev); 702 int (*irq_postinstall) (struct drm_device *dev);
605 void (*irq_uninstall) (struct drm_device *dev); 703 void (*irq_uninstall) (struct drm_device *dev);
606 void (*reclaim_buffers) (struct drm_device *dev, 704 void (*reclaim_buffers) (struct drm_device *dev,
607 struct drm_file * file_priv); 705 struct drm_file * file_priv);
@@ -614,6 +712,18 @@ struct drm_driver {
614 void (*set_version) (struct drm_device *dev, 712 void (*set_version) (struct drm_device *dev,
615 struct drm_set_version *sv); 713 struct drm_set_version *sv);
616 714
715 int (*proc_init)(struct drm_minor *minor);
716 void (*proc_cleanup)(struct drm_minor *minor);
717
718 /**
719 * Driver-specific constructor for drm_gem_objects, to set up
720 * obj->driver_private.
721 *
722 * Returns 0 on success.
723 */
724 int (*gem_init_object) (struct drm_gem_object *obj);
725 void (*gem_free_object) (struct drm_gem_object *obj);
726
617 int major; 727 int major;
618 int minor; 728 int minor;
619 int patchlevel; 729 int patchlevel;
@@ -714,7 +824,6 @@ struct drm_device {
714 824
715 /** \name Context support */ 825 /** \name Context support */
716 /*@{ */ 826 /*@{ */
717 int irq; /**< Interrupt used by board */
718 int irq_enabled; /**< True if irq handler is enabled */ 827 int irq_enabled; /**< True if irq handler is enabled */
719 __volatile__ long context_flag; /**< Context swapping flag */ 828 __volatile__ long context_flag; /**< Context swapping flag */
720 __volatile__ long interrupt_flag; /**< Interruption handler flag */ 829 __volatile__ long interrupt_flag; /**< Interruption handler flag */
@@ -730,13 +839,28 @@ struct drm_device {
730 /** \name VBLANK IRQ support */ 839 /** \name VBLANK IRQ support */
731 /*@{ */ 840 /*@{ */
732 841
733 wait_queue_head_t vbl_queue; /**< VBLANK wait queue */ 842 /*
734 atomic_t vbl_received; 843 * At load time, disabling the vblank interrupt won't be allowed since
735 atomic_t vbl_received2; /**< number of secondary VBLANK interrupts */ 844 * old clients may not call the modeset ioctl and therefore misbehave.
845 * Once the modeset ioctl *has* been called though, we can safely
846 * disable them when unused.
847 */
848 int vblank_disable_allowed;
849
850 wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */
851 atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */
736 spinlock_t vbl_lock; 852 spinlock_t vbl_lock;
737 struct list_head vbl_sigs; /**< signal list to send on VBLANK */ 853 struct list_head *vbl_sigs; /**< signal list to send on VBLANK */
738 struct list_head vbl_sigs2; /**< signals to send on secondary VBLANK */ 854 atomic_t vbl_signal_pending; /* number of signals pending on all crtcs*/
739 unsigned int vbl_pending; 855 atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */
856 u32 *last_vblank; /* protected by dev->vbl_lock, used */
857 /* for wraparound handling */
858 int *vblank_enabled; /* so we don't call enable more than
859 once per disable */
860 int *vblank_inmodeset; /* Display driver is setting mode */
861 struct timer_list vblank_disable_timer;
862
863 u32 max_vblank_count; /**< size of vblank counter register */
740 spinlock_t tasklet_lock; /**< For drm_locked_tasklet */ 864 spinlock_t tasklet_lock; /**< For drm_locked_tasklet */
741 void (*locked_tasklet_func)(struct drm_device *dev); 865 void (*locked_tasklet_func)(struct drm_device *dev);
742 866
@@ -757,6 +881,7 @@ struct drm_device {
757 struct pci_controller *hose; 881 struct pci_controller *hose;
758#endif 882#endif
759 struct drm_sg_mem *sg; /**< Scatter gather memory */ 883 struct drm_sg_mem *sg; /**< Scatter gather memory */
884 int num_crtcs; /**< Number of CRTCs on this device */
760 void *dev_private; /**< device private data */ 885 void *dev_private; /**< device private data */
761 struct drm_sigdata sigdata; /**< For block_all_signals */ 886 struct drm_sigdata sigdata; /**< For block_all_signals */
762 sigset_t sigmask; 887 sigset_t sigmask;
@@ -771,8 +896,29 @@ struct drm_device {
771 spinlock_t drw_lock; 896 spinlock_t drw_lock;
772 struct idr drw_idr; 897 struct idr drw_idr;
773 /*@} */ 898 /*@} */
899
900 /** \name GEM information */
901 /*@{ */
902 spinlock_t object_name_lock;
903 struct idr object_name_idr;
904 atomic_t object_count;
905 atomic_t object_memory;
906 atomic_t pin_count;
907 atomic_t pin_memory;
908 atomic_t gtt_count;
909 atomic_t gtt_memory;
910 uint32_t gtt_total;
911 uint32_t invalidate_domains; /* domains pending invalidation */
912 uint32_t flush_domains; /* domains pending flush */
913 /*@} */
914
774}; 915};
775 916
917static inline int drm_dev_to_irq(struct drm_device *dev)
918{
919 return dev->pdev->irq;
920}
921
776static __inline__ int drm_core_check_feature(struct drm_device *dev, 922static __inline__ int drm_core_check_feature(struct drm_device *dev,
777 int feature) 923 int feature)
778{ 924{
@@ -867,6 +1013,11 @@ extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
867extern DRM_AGP_MEM *drm_alloc_agp(struct drm_device *dev, int pages, u32 type); 1013extern DRM_AGP_MEM *drm_alloc_agp(struct drm_device *dev, int pages, u32 type);
868extern int drm_free_agp(DRM_AGP_MEM * handle, int pages); 1014extern int drm_free_agp(DRM_AGP_MEM * handle, int pages);
869extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); 1015extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
1016extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
1017 struct page **pages,
1018 unsigned long num_pages,
1019 uint32_t gtt_offset,
1020 uint32_t type);
870extern int drm_unbind_agp(DRM_AGP_MEM * handle); 1021extern int drm_unbind_agp(DRM_AGP_MEM * handle);
871 1022
872 /* Misc. IOCTL support (drm_ioctl.h) */ 1023 /* Misc. IOCTL support (drm_ioctl.h) */
@@ -929,6 +1080,9 @@ extern int drm_getmagic(struct drm_device *dev, void *data,
929extern int drm_authmagic(struct drm_device *dev, void *data, 1080extern int drm_authmagic(struct drm_device *dev, void *data,
930 struct drm_file *file_priv); 1081 struct drm_file *file_priv);
931 1082
1083/* Cache management (drm_cache.c) */
1084void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
1085
932 /* Locking IOCTL support (drm_lock.h) */ 1086 /* Locking IOCTL support (drm_lock.h) */
933extern int drm_lock(struct drm_device *dev, void *data, 1087extern int drm_lock(struct drm_device *dev, void *data,
934 struct drm_file *file_priv); 1088 struct drm_file *file_priv);
@@ -985,15 +1139,25 @@ extern void drm_core_reclaim_buffers(struct drm_device *dev,
985extern int drm_control(struct drm_device *dev, void *data, 1139extern int drm_control(struct drm_device *dev, void *data,
986 struct drm_file *file_priv); 1140 struct drm_file *file_priv);
987extern irqreturn_t drm_irq_handler(DRM_IRQ_ARGS); 1141extern irqreturn_t drm_irq_handler(DRM_IRQ_ARGS);
1142extern int drm_irq_install(struct drm_device *dev);
988extern int drm_irq_uninstall(struct drm_device *dev); 1143extern int drm_irq_uninstall(struct drm_device *dev);
989extern void drm_driver_irq_preinstall(struct drm_device *dev); 1144extern void drm_driver_irq_preinstall(struct drm_device *dev);
990extern void drm_driver_irq_postinstall(struct drm_device *dev); 1145extern void drm_driver_irq_postinstall(struct drm_device *dev);
991extern void drm_driver_irq_uninstall(struct drm_device *dev); 1146extern void drm_driver_irq_uninstall(struct drm_device *dev);
992 1147
1148extern int drm_vblank_init(struct drm_device *dev, int num_crtcs);
993extern int drm_wait_vblank(struct drm_device *dev, void *data, 1149extern int drm_wait_vblank(struct drm_device *dev, void *data,
994 struct drm_file *file_priv); 1150 struct drm_file *filp);
995extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); 1151extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq);
996extern void drm_vbl_send_signals(struct drm_device *dev); 1152extern void drm_locked_tasklet(struct drm_device *dev,
1153 void(*func)(struct drm_device *));
1154extern u32 drm_vblank_count(struct drm_device *dev, int crtc);
1155extern void drm_handle_vblank(struct drm_device *dev, int crtc);
1156extern int drm_vblank_get(struct drm_device *dev, int crtc);
1157extern void drm_vblank_put(struct drm_device *dev, int crtc);
1158/* Modesetting support */
1159extern int drm_modeset_ctl(struct drm_device *dev, void *data,
1160 struct drm_file *file_priv);
997extern void drm_locked_tasklet(struct drm_device *dev, void(*func)(struct drm_device*)); 1161extern void drm_locked_tasklet(struct drm_device *dev, void(*func)(struct drm_device*));
998 1162
999 /* AGP/GART support (drm_agpsupport.h) */ 1163 /* AGP/GART support (drm_agpsupport.h) */
@@ -1026,6 +1190,7 @@ extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size
1026extern int drm_agp_free_memory(DRM_AGP_MEM * handle); 1190extern int drm_agp_free_memory(DRM_AGP_MEM * handle);
1027extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start); 1191extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start);
1028extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle); 1192extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
1193extern void drm_agp_chipset_flush(struct drm_device *dev);
1029 1194
1030 /* Stub support (drm_stub.h) */ 1195 /* Stub support (drm_stub.h) */
1031extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, 1196extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
@@ -1088,6 +1253,66 @@ extern unsigned long drm_mm_tail_space(struct drm_mm *mm);
1088extern int drm_mm_remove_space_from_tail(struct drm_mm *mm, unsigned long size); 1253extern int drm_mm_remove_space_from_tail(struct drm_mm *mm, unsigned long size);
1089extern int drm_mm_add_space_to_tail(struct drm_mm *mm, unsigned long size); 1254extern int drm_mm_add_space_to_tail(struct drm_mm *mm, unsigned long size);
1090 1255
1256/* Graphics Execution Manager library functions (drm_gem.c) */
1257int drm_gem_init(struct drm_device *dev);
1258void drm_gem_object_free(struct kref *kref);
1259struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
1260 size_t size);
1261void drm_gem_object_handle_free(struct kref *kref);
1262
1263static inline void
1264drm_gem_object_reference(struct drm_gem_object *obj)
1265{
1266 kref_get(&obj->refcount);
1267}
1268
1269static inline void
1270drm_gem_object_unreference(struct drm_gem_object *obj)
1271{
1272 if (obj == NULL)
1273 return;
1274
1275 kref_put(&obj->refcount, drm_gem_object_free);
1276}
1277
1278int drm_gem_handle_create(struct drm_file *file_priv,
1279 struct drm_gem_object *obj,
1280 int *handlep);
1281
1282static inline void
1283drm_gem_object_handle_reference(struct drm_gem_object *obj)
1284{
1285 drm_gem_object_reference(obj);
1286 kref_get(&obj->handlecount);
1287}
1288
1289static inline void
1290drm_gem_object_handle_unreference(struct drm_gem_object *obj)
1291{
1292 if (obj == NULL)
1293 return;
1294
1295 /*
1296 * Must bump handle count first as this may be the last
1297 * ref, in which case the object would disappear before we
1298 * checked for a name
1299 */
1300 kref_put(&obj->handlecount, drm_gem_object_handle_free);
1301 drm_gem_object_unreference(obj);
1302}
1303
1304struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
1305 struct drm_file *filp,
1306 int handle);
1307int drm_gem_close_ioctl(struct drm_device *dev, void *data,
1308 struct drm_file *file_priv);
1309int drm_gem_flink_ioctl(struct drm_device *dev, void *data,
1310 struct drm_file *file_priv);
1311int drm_gem_open_ioctl(struct drm_device *dev, void *data,
1312 struct drm_file *file_priv);
1313void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
1314void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
1315
1091extern void drm_core_ioremap(struct drm_map *map, struct drm_device *dev); 1316extern void drm_core_ioremap(struct drm_map *map, struct drm_device *dev);
1092extern void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev); 1317extern void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev);
1093extern void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev); 1318extern void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev);
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 135bd19499fc..da04109741e8 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -84,18 +84,18 @@
84 {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 84 {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
85 {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 85 {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
86 {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 86 {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
87 {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 87 {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
88 {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 88 {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
89 {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 89 {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
90 {0x1002, 0x554B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 90 {0x1002, 0x554B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
91 {0x1002, 0x554C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 91 {0x1002, 0x554C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
92 {0x1002, 0x554D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 92 {0x1002, 0x554D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
93 {0x1002, 0x554E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 93 {0x1002, 0x554E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
94 {0x1002, 0x554F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 94 {0x1002, 0x554F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
95 {0x1002, 0x5550, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 95 {0x1002, 0x5550, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
96 {0x1002, 0x5551, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 96 {0x1002, 0x5551, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
97 {0x1002, 0x5552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 97 {0x1002, 0x5552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
98 {0x1002, 0x5554, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 98 {0x1002, 0x5554, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
99 {0x1002, 0x564A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 99 {0x1002, 0x564A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
100 {0x1002, 0x564B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 100 {0x1002, 0x564B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
101 {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 101 {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -113,8 +113,10 @@
113 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 113 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
114 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 114 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
115 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ 115 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \
116 {0x1002, 0x5a61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 116 {0x1002, 0x5a41, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_IGPGART}, \
117 {0x1002, 0x5a62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 117 {0x1002, 0x5a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
118 {0x1002, 0x5a61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_IGPGART}, \
119 {0x1002, 0x5a62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
118 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 120 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
119 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 121 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
120 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 122 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
@@ -122,16 +124,16 @@
122 {0x1002, 0x5b65, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 124 {0x1002, 0x5b65, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
123 {0x1002, 0x5c61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \ 125 {0x1002, 0x5c61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \
124 {0x1002, 0x5c63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \ 126 {0x1002, 0x5c63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \
125 {0x1002, 0x5d48, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 127 {0x1002, 0x5d48, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
126 {0x1002, 0x5d49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 128 {0x1002, 0x5d49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
127 {0x1002, 0x5d4a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 129 {0x1002, 0x5d4a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
128 {0x1002, 0x5d4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 130 {0x1002, 0x5d4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
129 {0x1002, 0x5d4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 131 {0x1002, 0x5d4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
130 {0x1002, 0x5d4e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 132 {0x1002, 0x5d4e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
131 {0x1002, 0x5d4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 133 {0x1002, 0x5d4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
132 {0x1002, 0x5d50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 134 {0x1002, 0x5d50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
133 {0x1002, 0x5d52, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 135 {0x1002, 0x5d52, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
134 {0x1002, 0x5d57, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 136 {0x1002, 0x5d57, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
135 {0x1002, 0x5e48, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ 137 {0x1002, 0x5e48, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
136 {0x1002, 0x5e4a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ 138 {0x1002, 0x5e4a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
137 {0x1002, 0x5e4b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ 139 {0x1002, 0x5e4b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
@@ -237,6 +239,10 @@
237 {0x1002, 0x7835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 239 {0x1002, 0x7835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
238 {0x1002, 0x791e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \ 240 {0x1002, 0x791e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
239 {0x1002, 0x791f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \ 241 {0x1002, 0x791f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
242 {0x1002, 0x796c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
243 {0x1002, 0x796d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
244 {0x1002, 0x796e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
245 {0x1002, 0x796f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS740|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
240 {0, 0, 0} 246 {0, 0, 0}
241 247
242#define r128_PCI_IDS \ 248#define r128_PCI_IDS \
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 05c66cf03a9e..eb4b35031a55 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -143,6 +143,22 @@ typedef struct _drm_i915_sarea {
143#define DRM_I915_GET_VBLANK_PIPE 0x0e 143#define DRM_I915_GET_VBLANK_PIPE 0x0e
144#define DRM_I915_VBLANK_SWAP 0x0f 144#define DRM_I915_VBLANK_SWAP 0x0f
145#define DRM_I915_HWS_ADDR 0x11 145#define DRM_I915_HWS_ADDR 0x11
146#define DRM_I915_GEM_INIT 0x13
147#define DRM_I915_GEM_EXECBUFFER 0x14
148#define DRM_I915_GEM_PIN 0x15
149#define DRM_I915_GEM_UNPIN 0x16
150#define DRM_I915_GEM_BUSY 0x17
151#define DRM_I915_GEM_THROTTLE 0x18
152#define DRM_I915_GEM_ENTERVT 0x19
153#define DRM_I915_GEM_LEAVEVT 0x1a
154#define DRM_I915_GEM_CREATE 0x1b
155#define DRM_I915_GEM_PREAD 0x1c
156#define DRM_I915_GEM_PWRITE 0x1d
157#define DRM_I915_GEM_MMAP 0x1e
158#define DRM_I915_GEM_SET_DOMAIN 0x1f
159#define DRM_I915_GEM_SW_FINISH 0x20
160#define DRM_I915_GEM_SET_TILING 0x21
161#define DRM_I915_GEM_GET_TILING 0x22
146 162
147#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 163#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
148#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) 164#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -160,6 +176,20 @@ typedef struct _drm_i915_sarea {
160#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t) 176#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
161#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t) 177#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
162#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) 178#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
179#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
180#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
181#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
182#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
183#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
184#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
185#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
186#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
187#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
188#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
189#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
190#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
191#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
192#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
163 193
164/* Allow drivers to submit batchbuffers directly to hardware, relying 194/* Allow drivers to submit batchbuffers directly to hardware, relying
165 * on the security mechanisms provided by hardware. 195 * on the security mechanisms provided by hardware.
@@ -200,6 +230,8 @@ typedef struct drm_i915_irq_wait {
200#define I915_PARAM_IRQ_ACTIVE 1 230#define I915_PARAM_IRQ_ACTIVE 1
201#define I915_PARAM_ALLOW_BATCHBUFFER 2 231#define I915_PARAM_ALLOW_BATCHBUFFER 2
202#define I915_PARAM_LAST_DISPATCH 3 232#define I915_PARAM_LAST_DISPATCH 3
233#define I915_PARAM_CHIPSET_ID 4
234#define I915_PARAM_HAS_GEM 5
203 235
204typedef struct drm_i915_getparam { 236typedef struct drm_i915_getparam {
205 int param; 237 int param;
@@ -267,4 +299,305 @@ typedef struct drm_i915_hws_addr {
267 uint64_t addr; 299 uint64_t addr;
268} drm_i915_hws_addr_t; 300} drm_i915_hws_addr_t;
269 301
302struct drm_i915_gem_init {
303 /**
304 * Beginning offset in the GTT to be managed by the DRM memory
305 * manager.
306 */
307 uint64_t gtt_start;
308 /**
309 * Ending offset in the GTT to be managed by the DRM memory
310 * manager.
311 */
312 uint64_t gtt_end;
313};
314
315struct drm_i915_gem_create {
316 /**
317 * Requested size for the object.
318 *
319 * The (page-aligned) allocated size for the object will be returned.
320 */
321 uint64_t size;
322 /**
323 * Returned handle for the object.
324 *
325 * Object handles are nonzero.
326 */
327 uint32_t handle;
328 uint32_t pad;
329};
330
331struct drm_i915_gem_pread {
332 /** Handle for the object being read. */
333 uint32_t handle;
334 uint32_t pad;
335 /** Offset into the object to read from */
336 uint64_t offset;
337 /** Length of data to read */
338 uint64_t size;
339 /**
340 * Pointer to write the data into.
341 *
342 * This is a fixed-size type for 32/64 compatibility.
343 */
344 uint64_t data_ptr;
345};
346
347struct drm_i915_gem_pwrite {
348 /** Handle for the object being written to. */
349 uint32_t handle;
350 uint32_t pad;
351 /** Offset into the object to write to */
352 uint64_t offset;
353 /** Length of data to write */
354 uint64_t size;
355 /**
356 * Pointer to read the data from.
357 *
358 * This is a fixed-size type for 32/64 compatibility.
359 */
360 uint64_t data_ptr;
361};
362
363struct drm_i915_gem_mmap {
364 /** Handle for the object being mapped. */
365 uint32_t handle;
366 uint32_t pad;
367 /** Offset in the object to map. */
368 uint64_t offset;
369 /**
370 * Length of data to map.
371 *
372 * The value will be page-aligned.
373 */
374 uint64_t size;
375 /**
376 * Returned pointer the data was mapped at.
377 *
378 * This is a fixed-size type for 32/64 compatibility.
379 */
380 uint64_t addr_ptr;
381};
382
383struct drm_i915_gem_set_domain {
384 /** Handle for the object */
385 uint32_t handle;
386
387 /** New read domains */
388 uint32_t read_domains;
389
390 /** New write domain */
391 uint32_t write_domain;
392};
393
394struct drm_i915_gem_sw_finish {
395 /** Handle for the object */
396 uint32_t handle;
397};
398
399struct drm_i915_gem_relocation_entry {
400 /**
401 * Handle of the buffer being pointed to by this relocation entry.
402 *
403 * It's appealing to make this be an index into the mm_validate_entry
404 * list to refer to the buffer, but this allows the driver to create
405 * a relocation list for state buffers and not re-write it per
406 * exec using the buffer.
407 */
408 uint32_t target_handle;
409
410 /**
411 * Value to be added to the offset of the target buffer to make up
412 * the relocation entry.
413 */
414 uint32_t delta;
415
416 /** Offset in the buffer the relocation entry will be written into */
417 uint64_t offset;
418
419 /**
420 * Offset value of the target buffer that the relocation entry was last
421 * written as.
422 *
423 * If the buffer has the same offset as last time, we can skip syncing
424 * and writing the relocation. This value is written back out by
425 * the execbuffer ioctl when the relocation is written.
426 */
427 uint64_t presumed_offset;
428
429 /**
430 * Target memory domains read by this operation.
431 */
432 uint32_t read_domains;
433
434 /**
435 * Target memory domains written by this operation.
436 *
437 * Note that only one domain may be written by the whole
438 * execbuffer operation, so that where there are conflicts,
439 * the application will get -EINVAL back.
440 */
441 uint32_t write_domain;
442};
443
444/** @{
445 * Intel memory domains
446 *
447 * Most of these just align with the various caches in
448 * the system and are used to flush and invalidate as
449 * objects end up cached in different domains.
450 */
451/** CPU cache */
452#define I915_GEM_DOMAIN_CPU 0x00000001
453/** Render cache, used by 2D and 3D drawing */
454#define I915_GEM_DOMAIN_RENDER 0x00000002
455/** Sampler cache, used by texture engine */
456#define I915_GEM_DOMAIN_SAMPLER 0x00000004
457/** Command queue, used to load batch buffers */
458#define I915_GEM_DOMAIN_COMMAND 0x00000008
459/** Instruction cache, used by shader programs */
460#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
461/** Vertex address cache */
462#define I915_GEM_DOMAIN_VERTEX 0x00000020
463/** GTT domain - aperture and scanout */
464#define I915_GEM_DOMAIN_GTT 0x00000040
465/** @} */
466
467struct drm_i915_gem_exec_object {
468 /**
469 * User's handle for a buffer to be bound into the GTT for this
470 * operation.
471 */
472 uint32_t handle;
473
474 /** Number of relocations to be performed on this buffer */
475 uint32_t relocation_count;
476 /**
477 * Pointer to array of struct drm_i915_gem_relocation_entry containing
478 * the relocations to be performed in this buffer.
479 */
480 uint64_t relocs_ptr;
481
482 /** Required alignment in graphics aperture */
483 uint64_t alignment;
484
485 /**
486 * Returned value of the updated offset of the object, for future
487 * presumed_offset writes.
488 */
489 uint64_t offset;
490};
491
492struct drm_i915_gem_execbuffer {
493 /**
494 * List of buffers to be validated with their relocations to be
495 * performend on them.
496 *
497 * This is a pointer to an array of struct drm_i915_gem_validate_entry.
498 *
499 * These buffers must be listed in an order such that all relocations
500 * a buffer is performing refer to buffers that have already appeared
501 * in the validate list.
502 */
503 uint64_t buffers_ptr;
504 uint32_t buffer_count;
505
506 /** Offset in the batchbuffer to start execution from. */
507 uint32_t batch_start_offset;
508 /** Bytes used in batchbuffer from batch_start_offset */
509 uint32_t batch_len;
510 uint32_t DR1;
511 uint32_t DR4;
512 uint32_t num_cliprects;
513 /** This is a struct drm_clip_rect *cliprects */
514 uint64_t cliprects_ptr;
515};
516
517struct drm_i915_gem_pin {
518 /** Handle of the buffer to be pinned. */
519 uint32_t handle;
520 uint32_t pad;
521
522 /** alignment required within the aperture */
523 uint64_t alignment;
524
525 /** Returned GTT offset of the buffer. */
526 uint64_t offset;
527};
528
529struct drm_i915_gem_unpin {
530 /** Handle of the buffer to be unpinned. */
531 uint32_t handle;
532 uint32_t pad;
533};
534
535struct drm_i915_gem_busy {
536 /** Handle of the buffer to check for busy */
537 uint32_t handle;
538
539 /** Return busy status (1 if busy, 0 if idle) */
540 uint32_t busy;
541};
542
543#define I915_TILING_NONE 0
544#define I915_TILING_X 1
545#define I915_TILING_Y 2
546
547#define I915_BIT_6_SWIZZLE_NONE 0
548#define I915_BIT_6_SWIZZLE_9 1
549#define I915_BIT_6_SWIZZLE_9_10 2
550#define I915_BIT_6_SWIZZLE_9_11 3
551#define I915_BIT_6_SWIZZLE_9_10_11 4
552/* Not seen by userland */
553#define I915_BIT_6_SWIZZLE_UNKNOWN 5
554
555struct drm_i915_gem_set_tiling {
556 /** Handle of the buffer to have its tiling state updated */
557 uint32_t handle;
558
559 /**
560 * Tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
561 * I915_TILING_Y).
562 *
563 * This value is to be set on request, and will be updated by the
564 * kernel on successful return with the actual chosen tiling layout.
565 *
566 * The tiling mode may be demoted to I915_TILING_NONE when the system
567 * has bit 6 swizzling that can't be managed correctly by GEM.
568 *
569 * Buffer contents become undefined when changing tiling_mode.
570 */
571 uint32_t tiling_mode;
572
573 /**
574 * Stride in bytes for the object when in I915_TILING_X or
575 * I915_TILING_Y.
576 */
577 uint32_t stride;
578
579 /**
580 * Returned address bit 6 swizzling required for CPU access through
581 * mmap mapping.
582 */
583 uint32_t swizzle_mode;
584};
585
586struct drm_i915_gem_get_tiling {
587 /** Handle of the buffer to get tiling state for. */
588 uint32_t handle;
589
590 /**
591 * Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
592 * I915_TILING_Y).
593 */
594 uint32_t tiling_mode;
595
596 /**
597 * Returned address bit 6 swizzling required for CPU access through
598 * mmap mapping.
599 */
600 uint32_t swizzle_mode;
601};
602
270#endif /* _I915_DRM_H_ */ 603#endif /* _I915_DRM_H_ */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 7d970678f940..bf9aca548f14 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -107,6 +107,7 @@ header-y += keyctl.h
107header-y += limits.h 107header-y += limits.h
108header-y += magic.h 108header-y += magic.h
109header-y += major.h 109header-y += major.h
110header-y += map_to_7segment.h
110header-y += matroxfb.h 111header-y += matroxfb.h
111header-y += meye.h 112header-y += meye.h
112header-y += minix_fs.h 113header-y += minix_fs.h
@@ -126,6 +127,7 @@ header-y += pci_regs.h
126header-y += pfkeyv2.h 127header-y += pfkeyv2.h
127header-y += pg.h 128header-y += pg.h
128header-y += phantom.h 129header-y += phantom.h
130header-y += phonet.h
129header-y += pkt_cls.h 131header-y += pkt_cls.h
130header-y += pkt_sched.h 132header-y += pkt_sched.h
131header-y += posix_types.h 133header-y += posix_types.h
@@ -167,7 +169,8 @@ unifdef-y += acct.h
167unifdef-y += adb.h 169unifdef-y += adb.h
168unifdef-y += adfs_fs.h 170unifdef-y += adfs_fs.h
169unifdef-y += agpgart.h 171unifdef-y += agpgart.h
170ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) 172ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
173 $(srctree)/include/asm-$(SRCARCH)/a.out.h),)
171unifdef-y += a.out.h 174unifdef-y += a.out.h
172endif 175endif
173unifdef-y += apm_bios.h 176unifdef-y += apm_bios.h
@@ -179,6 +182,7 @@ unifdef-y += audit.h
179unifdef-y += auto_fs.h 182unifdef-y += auto_fs.h
180unifdef-y += auxvec.h 183unifdef-y += auxvec.h
181unifdef-y += binfmts.h 184unifdef-y += binfmts.h
185unifdef-y += blktrace_api.h
182unifdef-y += capability.h 186unifdef-y += capability.h
183unifdef-y += capi.h 187unifdef-y += capi.h
184unifdef-y += cciss_ioctl.h 188unifdef-y += cciss_ioctl.h
@@ -231,6 +235,7 @@ unifdef-y += if_fddi.h
231unifdef-y += if_frad.h 235unifdef-y += if_frad.h
232unifdef-y += if_ltalk.h 236unifdef-y += if_ltalk.h
233unifdef-y += if_link.h 237unifdef-y += if_link.h
238unifdef-y += if_phonet.h
234unifdef-y += if_pppol2tp.h 239unifdef-y += if_pppol2tp.h
235unifdef-y += if_pppox.h 240unifdef-y += if_pppox.h
236unifdef-y += if_tr.h 241unifdef-y += if_tr.h
@@ -258,7 +263,8 @@ unifdef-y += kd.h
258unifdef-y += kernelcapi.h 263unifdef-y += kernelcapi.h
259unifdef-y += kernel.h 264unifdef-y += kernel.h
260unifdef-y += keyboard.h 265unifdef-y += keyboard.h
261ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) 266ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
267 $(srctree)/include/asm-$(SRCARCH)/kvm.h),)
262unifdef-y += kvm.h 268unifdef-y += kvm.h
263endif 269endif
264unifdef-y += llc.h 270unifdef-y += llc.h
@@ -297,7 +303,6 @@ unifdef-y += parport.h
297unifdef-y += patchkey.h 303unifdef-y += patchkey.h
298unifdef-y += pci.h 304unifdef-y += pci.h
299unifdef-y += personality.h 305unifdef-y += personality.h
300unifdef-y += pim.h
301unifdef-y += pktcdvd.h 306unifdef-y += pktcdvd.h
302unifdef-y += pmu.h 307unifdef-y += pmu.h
303unifdef-y += poll.h 308unifdef-y += poll.h
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 09b276c35227..f6b8cf99b596 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -204,12 +204,21 @@ struct kioctx {
204/* prototypes */ 204/* prototypes */
205extern unsigned aio_max_size; 205extern unsigned aio_max_size;
206 206
207#ifdef CONFIG_AIO
207extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); 208extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb);
208extern int aio_put_req(struct kiocb *iocb); 209extern int aio_put_req(struct kiocb *iocb);
209extern void kick_iocb(struct kiocb *iocb); 210extern void kick_iocb(struct kiocb *iocb);
210extern int aio_complete(struct kiocb *iocb, long res, long res2); 211extern int aio_complete(struct kiocb *iocb, long res, long res2);
211struct mm_struct; 212struct mm_struct;
212extern void exit_aio(struct mm_struct *mm); 213extern void exit_aio(struct mm_struct *mm);
214#else
215static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; }
216static inline int aio_put_req(struct kiocb *iocb) { return 0; }
217static inline void kick_iocb(struct kiocb *iocb) { }
218static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; }
219struct mm_struct;
220static inline void exit_aio(struct mm_struct *mm) { }
221#endif /* CONFIG_AIO */
213 222
214#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) 223#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
215 224
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 1ce19c1ef0e9..a53318b8cbd0 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -30,6 +30,7 @@
30#define __LINUX_ATA_H__ 30#define __LINUX_ATA_H__
31 31
32#include <linux/types.h> 32#include <linux/types.h>
33#include <asm/byteorder.h>
33 34
34/* defines only for the constants which don't work well as enums */ 35/* defines only for the constants which don't work well as enums */
35#define ATA_DMA_BOUNDARY 0xffffUL 36#define ATA_DMA_BOUNDARY 0xffffUL
@@ -88,6 +89,7 @@ enum {
88 ATA_ID_DLF = 128, 89 ATA_ID_DLF = 128,
89 ATA_ID_CSFO = 129, 90 ATA_ID_CSFO = 129,
90 ATA_ID_CFA_POWER = 160, 91 ATA_ID_CFA_POWER = 160,
92 ATA_ID_ROT_SPEED = 217,
91 ATA_ID_PIO4 = (1 << 1), 93 ATA_ID_PIO4 = (1 << 1),
92 94
93 ATA_ID_SERNO_LEN = 20, 95 ATA_ID_SERNO_LEN = 20,
@@ -557,6 +559,15 @@ static inline int ata_id_has_flush(const u16 *id)
557 return id[ATA_ID_COMMAND_SET_2] & (1 << 12); 559 return id[ATA_ID_COMMAND_SET_2] & (1 << 12);
558} 560}
559 561
562static inline int ata_id_flush_enabled(const u16 *id)
563{
564 if (ata_id_has_flush(id) == 0)
565 return 0;
566 if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
567 return 0;
568 return id[ATA_ID_CFS_ENABLE_2] & (1 << 12);
569}
570
560static inline int ata_id_has_flush_ext(const u16 *id) 571static inline int ata_id_has_flush_ext(const u16 *id)
561{ 572{
562 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) 573 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
@@ -564,6 +575,19 @@ static inline int ata_id_has_flush_ext(const u16 *id)
564 return id[ATA_ID_COMMAND_SET_2] & (1 << 13); 575 return id[ATA_ID_COMMAND_SET_2] & (1 << 13);
565} 576}
566 577
578static inline int ata_id_flush_ext_enabled(const u16 *id)
579{
580 if (ata_id_has_flush_ext(id) == 0)
581 return 0;
582 if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
583 return 0;
584 /*
585 * some Maxtor disks have bit 13 defined incorrectly
586 * so check bit 10 too
587 */
588 return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400;
589}
590
567static inline int ata_id_has_lba48(const u16 *id) 591static inline int ata_id_has_lba48(const u16 *id)
568{ 592{
569 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) 593 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
@@ -573,6 +597,15 @@ static inline int ata_id_has_lba48(const u16 *id)
573 return id[ATA_ID_COMMAND_SET_2] & (1 << 10); 597 return id[ATA_ID_COMMAND_SET_2] & (1 << 10);
574} 598}
575 599
600static inline int ata_id_lba48_enabled(const u16 *id)
601{
602 if (ata_id_has_lba48(id) == 0)
603 return 0;
604 if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
605 return 0;
606 return id[ATA_ID_CFS_ENABLE_2] & (1 << 10);
607}
608
576static inline int ata_id_hpa_enabled(const u16 *id) 609static inline int ata_id_hpa_enabled(const u16 *id)
577{ 610{
578 /* Yes children, word 83 valid bits cover word 82 data */ 611 /* Yes children, word 83 valid bits cover word 82 data */
@@ -644,7 +677,15 @@ static inline unsigned int ata_id_major_version(const u16 *id)
644 677
645static inline int ata_id_is_sata(const u16 *id) 678static inline int ata_id_is_sata(const u16 *id)
646{ 679{
647 return ata_id_major_version(id) >= 5 && id[ATA_ID_HW_CONFIG] == 0; 680 /*
681 * See if word 93 is 0 AND drive is at least ATA-5 compatible
682 * verifying that word 80 by casting it to a signed type --
683 * this trick allows us to filter out the reserved values of
684 * 0x0000 and 0xffff along with the earlier ATA revisions...
685 */
686 if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020)
687 return 1;
688 return 0;
648} 689}
649 690
650static inline int ata_id_has_tpm(const u16 *id) 691static inline int ata_id_has_tpm(const u16 *id)
@@ -667,6 +708,15 @@ static inline int ata_id_has_dword_io(const u16 *id)
667 return 0; 708 return 0;
668} 709}
669 710
711static inline int ata_id_has_unload(const u16 *id)
712{
713 if (ata_id_major_version(id) >= 7 &&
714 (id[ATA_ID_CFSSE] & 0xC000) == 0x4000 &&
715 id[ATA_ID_CFSSE] & (1 << 13))
716 return 1;
717 return 0;
718}
719
670static inline int ata_id_current_chs_valid(const u16 *id) 720static inline int ata_id_current_chs_valid(const u16 *id)
671{ 721{
672 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 722 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
@@ -691,6 +741,11 @@ static inline int ata_id_is_cfa(const u16 *id)
691 return 0; 741 return 0;
692} 742}
693 743
744static inline int ata_id_is_ssd(const u16 *id)
745{
746 return id[ATA_ID_ROT_SPEED] == 0x01;
747}
748
694static inline int ata_drive_40wire(const u16 *dev_id) 749static inline int ata_drive_40wire(const u16 *dev_id)
695{ 750{
696 if (ata_id_is_sata(dev_id)) 751 if (ata_id_is_sata(dev_id))
@@ -727,6 +782,76 @@ static inline int atapi_id_dmadir(const u16 *dev_id)
727 return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000); 782 return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000);
728} 783}
729 784
785/*
786 * ata_id_is_lba_capacity_ok() performs a sanity check on
787 * the claimed LBA capacity value for the device.
788 *
789 * Returns 1 if LBA capacity looks sensible, 0 otherwise.
790 *
791 * It is called only once for each device.
792 */
793static inline int ata_id_is_lba_capacity_ok(u16 *id)
794{
795 unsigned long lba_sects, chs_sects, head, tail;
796
797 /* No non-LBA info .. so valid! */
798 if (id[ATA_ID_CYLS] == 0)
799 return 1;
800
801 lba_sects = ata_id_u32(id, ATA_ID_LBA_CAPACITY);
802
803 /*
804 * The ATA spec tells large drives to return
805 * C/H/S = 16383/16/63 independent of their size.
806 * Some drives can be jumpered to use 15 heads instead of 16.
807 * Some drives can be jumpered to use 4092 cyls instead of 16383.
808 */
809 if ((id[ATA_ID_CYLS] == 16383 ||
810 (id[ATA_ID_CYLS] == 4092 && id[ATA_ID_CUR_CYLS] == 16383)) &&
811 id[ATA_ID_SECTORS] == 63 &&
812 (id[ATA_ID_HEADS] == 15 || id[ATA_ID_HEADS] == 16) &&
813 (lba_sects >= 16383 * 63 * id[ATA_ID_HEADS]))
814 return 1;
815
816 chs_sects = id[ATA_ID_CYLS] * id[ATA_ID_HEADS] * id[ATA_ID_SECTORS];
817
818 /* perform a rough sanity check on lba_sects: within 10% is OK */
819 if (lba_sects - chs_sects < chs_sects/10)
820 return 1;
821
822 /* some drives have the word order reversed */
823 head = (lba_sects >> 16) & 0xffff;
824 tail = lba_sects & 0xffff;
825 lba_sects = head | (tail << 16);
826
827 if (lba_sects - chs_sects < chs_sects/10) {
828 *(__le32 *)&id[ATA_ID_LBA_CAPACITY] = __cpu_to_le32(lba_sects);
829 return 1; /* LBA capacity is (now) good */
830 }
831
832 return 0; /* LBA capacity value may be bad */
833}
834
835static inline void ata_id_to_hd_driveid(u16 *id)
836{
837#ifdef __BIG_ENDIAN
838 /* accessed in struct hd_driveid as 8-bit values */
839 id[ATA_ID_MAX_MULTSECT] = __cpu_to_le16(id[ATA_ID_MAX_MULTSECT]);
840 id[ATA_ID_CAPABILITY] = __cpu_to_le16(id[ATA_ID_CAPABILITY]);
841 id[ATA_ID_OLD_PIO_MODES] = __cpu_to_le16(id[ATA_ID_OLD_PIO_MODES]);
842 id[ATA_ID_OLD_DMA_MODES] = __cpu_to_le16(id[ATA_ID_OLD_DMA_MODES]);
843 id[ATA_ID_MULTSECT] = __cpu_to_le16(id[ATA_ID_MULTSECT]);
844
845 /* as 32-bit values */
846 *(u32 *)&id[ATA_ID_LBA_CAPACITY] = ata_id_u32(id, ATA_ID_LBA_CAPACITY);
847 *(u32 *)&id[ATA_ID_SPG] = ata_id_u32(id, ATA_ID_SPG);
848
849 /* as 64-bit value */
850 *(u64 *)&id[ATA_ID_LBA_CAPACITY_2] =
851 ata_id_u64(id, ATA_ID_LBA_CAPACITY_2);
852#endif
853}
854
730static inline int is_multi_taskfile(struct ata_taskfile *tf) 855static inline int is_multi_taskfile(struct ata_taskfile *tf)
731{ 856{
732 return (tf->command == ATA_CMD_READ_MULTI) || 857 return (tf->command == ATA_CMD_READ_MULTI) ||
@@ -745,7 +870,7 @@ static inline int ata_ok(u8 status)
745static inline int lba_28_ok(u64 block, u32 n_block) 870static inline int lba_28_ok(u64 block, u32 n_block)
746{ 871{
747 /* check the ending block number */ 872 /* check the ending block number */
748 return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); 873 return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256);
749} 874}
750 875
751static inline int lba_48_ok(u64 block, u32 n_block) 876static inline int lba_48_ok(u64 block, u32 n_block)
diff --git a/include/linux/auto_dev-ioctl.h b/include/linux/auto_dev-ioctl.h
new file mode 100644
index 000000000000..f4d05ccd731f
--- /dev/null
+++ b/include/linux/auto_dev-ioctl.h
@@ -0,0 +1,157 @@
1/*
2 * Copyright 2008 Red Hat, Inc. All rights reserved.
3 * Copyright 2008 Ian Kent <raven@themaw.net>
4 *
5 * This file is part of the Linux kernel and is made available under
6 * the terms of the GNU General Public License, version 2, or at your
7 * option, any later version, incorporated herein by reference.
8 */
9
10#ifndef _LINUX_AUTO_DEV_IOCTL_H
11#define _LINUX_AUTO_DEV_IOCTL_H
12
13#include <linux/types.h>
14
15#define AUTOFS_DEVICE_NAME "autofs"
16
17#define AUTOFS_DEV_IOCTL_VERSION_MAJOR 1
18#define AUTOFS_DEV_IOCTL_VERSION_MINOR 0
19
20#define AUTOFS_DEVID_LEN 16
21
22#define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl)
23
24/*
25 * An ioctl interface for autofs mount point control.
26 */
27
28/*
29 * All the ioctls use this structure.
30 * When sending a path size must account for the total length
31 * of the chunk of memory otherwise is is the size of the
32 * structure.
33 */
34
35struct autofs_dev_ioctl {
36 __u32 ver_major;
37 __u32 ver_minor;
38 __u32 size; /* total size of data passed in
39 * including this struct */
40 __s32 ioctlfd; /* automount command fd */
41
42 __u32 arg1; /* Command parameters */
43 __u32 arg2;
44
45 char path[0];
46};
47
48static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
49{
50 in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
51 in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
52 in->size = sizeof(struct autofs_dev_ioctl);
53 in->ioctlfd = -1;
54 in->arg1 = 0;
55 in->arg2 = 0;
56 return;
57}
58
59/*
60 * If you change this make sure you make the corresponding change
61 * to autofs-dev-ioctl.c:lookup_ioctl()
62 */
63enum {
64 /* Get various version info */
65 AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71,
66 AUTOFS_DEV_IOCTL_PROTOVER_CMD,
67 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD,
68
69 /* Open mount ioctl fd */
70 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD,
71
72 /* Close mount ioctl fd */
73 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD,
74
75 /* Mount/expire status returns */
76 AUTOFS_DEV_IOCTL_READY_CMD,
77 AUTOFS_DEV_IOCTL_FAIL_CMD,
78
79 /* Activate/deactivate autofs mount */
80 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD,
81 AUTOFS_DEV_IOCTL_CATATONIC_CMD,
82
83 /* Expiry timeout */
84 AUTOFS_DEV_IOCTL_TIMEOUT_CMD,
85
86 /* Get mount last requesting uid and gid */
87 AUTOFS_DEV_IOCTL_REQUESTER_CMD,
88
89 /* Check for eligible expire candidates */
90 AUTOFS_DEV_IOCTL_EXPIRE_CMD,
91
92 /* Request busy status */
93 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD,
94
95 /* Check if path is a mountpoint */
96 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD,
97};
98
99#define AUTOFS_IOCTL 0x93
100
101#define AUTOFS_DEV_IOCTL_VERSION \
102 _IOWR(AUTOFS_IOCTL, \
103 AUTOFS_DEV_IOCTL_VERSION_CMD, struct autofs_dev_ioctl)
104
105#define AUTOFS_DEV_IOCTL_PROTOVER \
106 _IOWR(AUTOFS_IOCTL, \
107 AUTOFS_DEV_IOCTL_PROTOVER_CMD, struct autofs_dev_ioctl)
108
109#define AUTOFS_DEV_IOCTL_PROTOSUBVER \
110 _IOWR(AUTOFS_IOCTL, \
111 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, struct autofs_dev_ioctl)
112
113#define AUTOFS_DEV_IOCTL_OPENMOUNT \
114 _IOWR(AUTOFS_IOCTL, \
115 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, struct autofs_dev_ioctl)
116
117#define AUTOFS_DEV_IOCTL_CLOSEMOUNT \
118 _IOWR(AUTOFS_IOCTL, \
119 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, struct autofs_dev_ioctl)
120
121#define AUTOFS_DEV_IOCTL_READY \
122 _IOWR(AUTOFS_IOCTL, \
123 AUTOFS_DEV_IOCTL_READY_CMD, struct autofs_dev_ioctl)
124
125#define AUTOFS_DEV_IOCTL_FAIL \
126 _IOWR(AUTOFS_IOCTL, \
127 AUTOFS_DEV_IOCTL_FAIL_CMD, struct autofs_dev_ioctl)
128
129#define AUTOFS_DEV_IOCTL_SETPIPEFD \
130 _IOWR(AUTOFS_IOCTL, \
131 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, struct autofs_dev_ioctl)
132
133#define AUTOFS_DEV_IOCTL_CATATONIC \
134 _IOWR(AUTOFS_IOCTL, \
135 AUTOFS_DEV_IOCTL_CATATONIC_CMD, struct autofs_dev_ioctl)
136
137#define AUTOFS_DEV_IOCTL_TIMEOUT \
138 _IOWR(AUTOFS_IOCTL, \
139 AUTOFS_DEV_IOCTL_TIMEOUT_CMD, struct autofs_dev_ioctl)
140
141#define AUTOFS_DEV_IOCTL_REQUESTER \
142 _IOWR(AUTOFS_IOCTL, \
143 AUTOFS_DEV_IOCTL_REQUESTER_CMD, struct autofs_dev_ioctl)
144
145#define AUTOFS_DEV_IOCTL_EXPIRE \
146 _IOWR(AUTOFS_IOCTL, \
147 AUTOFS_DEV_IOCTL_EXPIRE_CMD, struct autofs_dev_ioctl)
148
149#define AUTOFS_DEV_IOCTL_ASKUMOUNT \
150 _IOWR(AUTOFS_IOCTL, \
151 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, struct autofs_dev_ioctl)
152
153#define AUTOFS_DEV_IOCTL_ISMOUNTPOINT \
154 _IOWR(AUTOFS_IOCTL, \
155 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, struct autofs_dev_ioctl)
156
157#endif /* _LINUX_AUTO_DEV_IOCTL_H */
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h
index b785c6f8644d..2253716d4b92 100644
--- a/include/linux/auto_fs4.h
+++ b/include/linux/auto_fs4.h
@@ -23,12 +23,17 @@
23#define AUTOFS_MIN_PROTO_VERSION 3 23#define AUTOFS_MIN_PROTO_VERSION 3
24#define AUTOFS_MAX_PROTO_VERSION 5 24#define AUTOFS_MAX_PROTO_VERSION 5
25 25
26#define AUTOFS_PROTO_SUBVERSION 0 26#define AUTOFS_PROTO_SUBVERSION 1
27 27
28/* Mask for expire behaviour */ 28/* Mask for expire behaviour */
29#define AUTOFS_EXP_IMMEDIATE 1 29#define AUTOFS_EXP_IMMEDIATE 1
30#define AUTOFS_EXP_LEAVES 2 30#define AUTOFS_EXP_LEAVES 2
31 31
32#define AUTOFS_TYPE_ANY 0x0000
33#define AUTOFS_TYPE_INDIRECT 0x0001
34#define AUTOFS_TYPE_DIRECT 0x0002
35#define AUTOFS_TYPE_OFFSET 0x0004
36
32/* Daemon notification packet types */ 37/* Daemon notification packet types */
33enum autofs_notify { 38enum autofs_notify {
34 NFY_NONE, 39 NFY_NONE,
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 826f62350805..7394b5b349ff 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -36,6 +36,10 @@ struct linux_binprm{
36 unsigned long p; /* current top of mem */ 36 unsigned long p; /* current top of mem */
37 unsigned int sh_bang:1, 37 unsigned int sh_bang:1,
38 misc_bang:1; 38 misc_bang:1;
39#ifdef __alpha__
40 unsigned int taso:1;
41#endif
42 unsigned int recursion_depth;
39 struct file * file; 43 struct file * file;
40 int e_uid, e_gid; 44 int e_uid, e_gid;
41 kernel_cap_t cap_post_exec_permitted; 45 kernel_cap_t cap_post_exec_permitted;
@@ -58,6 +62,7 @@ struct linux_binprm{
58#define BINPRM_FLAGS_EXECFD_BIT 1 62#define BINPRM_FLAGS_EXECFD_BIT 1
59#define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) 63#define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT)
60 64
65#define BINPRM_MAX_RECURSION 4
61 66
62/* 67/*
63 * This structure defines the functions that are used to load the binary formats that 68 * This structure defines the functions that are used to load the binary formats that
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 0933a14e6414..1c91a176b9ae 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -26,21 +26,8 @@
26 26
27#ifdef CONFIG_BLOCK 27#ifdef CONFIG_BLOCK
28 28
29/* Platforms may set this to teach the BIO layer about IOMMU hardware. */
30#include <asm/io.h> 29#include <asm/io.h>
31 30
32#if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY)
33#define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1))
34#define BIOVEC_VIRT_OVERSIZE(x) ((x) > BIO_VMERGE_MAX_SIZE)
35#else
36#define BIOVEC_VIRT_START_SIZE(x) 0
37#define BIOVEC_VIRT_OVERSIZE(x) 0
38#endif
39
40#ifndef BIO_VMERGE_BOUNDARY
41#define BIO_VMERGE_BOUNDARY 0
42#endif
43
44#define BIO_DEBUG 31#define BIO_DEBUG
45 32
46#ifdef BIO_DEBUG 33#ifdef BIO_DEBUG
@@ -88,25 +75,21 @@ struct bio {
88 /* Number of segments in this BIO after 75 /* Number of segments in this BIO after
89 * physical address coalescing is performed. 76 * physical address coalescing is performed.
90 */ 77 */
91 unsigned short bi_phys_segments; 78 unsigned int bi_phys_segments;
92
93 /* Number of segments after physical and DMA remapping
94 * hardware coalescing is performed.
95 */
96 unsigned short bi_hw_segments;
97 79
98 unsigned int bi_size; /* residual I/O count */ 80 unsigned int bi_size; /* residual I/O count */
99 81
100 /* 82 /*
101 * To keep track of the max hw size, we account for the 83 * To keep track of the max segment size, we account for the
102 * sizes of the first and last virtually mergeable segments 84 * sizes of the first and last mergeable segments in this bio.
103 * in this bio
104 */ 85 */
105 unsigned int bi_hw_front_size; 86 unsigned int bi_seg_front_size;
106 unsigned int bi_hw_back_size; 87 unsigned int bi_seg_back_size;
107 88
108 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ 89 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
109 90
91 unsigned int bi_comp_cpu; /* completion CPU */
92
110 struct bio_vec *bi_io_vec; /* the actual vec list */ 93 struct bio_vec *bi_io_vec; /* the actual vec list */
111 94
112 bio_end_io_t *bi_end_io; 95 bio_end_io_t *bi_end_io;
@@ -126,11 +109,14 @@ struct bio {
126#define BIO_UPTODATE 0 /* ok after I/O completion */ 109#define BIO_UPTODATE 0 /* ok after I/O completion */
127#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */ 110#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */
128#define BIO_EOF 2 /* out-out-bounds error */ 111#define BIO_EOF 2 /* out-out-bounds error */
129#define BIO_SEG_VALID 3 /* nr_hw_seg valid */ 112#define BIO_SEG_VALID 3 /* bi_phys_segments valid */
130#define BIO_CLONED 4 /* doesn't own data */ 113#define BIO_CLONED 4 /* doesn't own data */
131#define BIO_BOUNCED 5 /* bio is a bounce bio */ 114#define BIO_BOUNCED 5 /* bio is a bounce bio */
132#define BIO_USER_MAPPED 6 /* contains user pages */ 115#define BIO_USER_MAPPED 6 /* contains user pages */
133#define BIO_EOPNOTSUPP 7 /* not supported */ 116#define BIO_EOPNOTSUPP 7 /* not supported */
117#define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */
118#define BIO_NULL_MAPPED 9 /* contains invalid user pages */
119#define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */
134#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) 120#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
135 121
136/* 122/*
@@ -144,18 +130,36 @@ struct bio {
144/* 130/*
145 * bio bi_rw flags 131 * bio bi_rw flags
146 * 132 *
147 * bit 0 -- read (not set) or write (set) 133 * bit 0 -- data direction
134 * If not set, bio is a read from device. If set, it's a write to device.
148 * bit 1 -- rw-ahead when set 135 * bit 1 -- rw-ahead when set
149 * bit 2 -- barrier 136 * bit 2 -- barrier
150 * bit 3 -- fail fast, don't want low level driver retries 137 * Insert a serialization point in the IO queue, forcing previously
151 * bit 4 -- synchronous I/O hint: the block layer will unplug immediately 138 * submitted IO to be completed before this oen is issued.
139 * bit 3 -- synchronous I/O hint: the block layer will unplug immediately
140 * Note that this does NOT indicate that the IO itself is sync, just
141 * that the block layer will not postpone issue of this IO by plugging.
142 * bit 4 -- metadata request
143 * Used for tracing to differentiate metadata and data IO. May also
144 * get some preferential treatment in the IO scheduler
145 * bit 5 -- discard sectors
146 * Informs the lower level device that this range of sectors is no longer
147 * used by the file system and may thus be freed by the device. Used
148 * for flash based storage.
149 * bit 6 -- fail fast device errors
150 * bit 7 -- fail fast transport errors
151 * bit 8 -- fail fast driver errors
152 * Don't want driver retries for any fast fail whatever the reason.
152 */ 153 */
153#define BIO_RW 0 154#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
154#define BIO_RW_AHEAD 1 155#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
155#define BIO_RW_BARRIER 2 156#define BIO_RW_BARRIER 2
156#define BIO_RW_FAILFAST 3 157#define BIO_RW_SYNC 3
157#define BIO_RW_SYNC 4 158#define BIO_RW_META 4
158#define BIO_RW_META 5 159#define BIO_RW_DISCARD 5
160#define BIO_RW_FAILFAST_DEV 6
161#define BIO_RW_FAILFAST_TRANSPORT 7
162#define BIO_RW_FAILFAST_DRIVER 8
159 163
160/* 164/*
161 * upper 16 bits of bi_rw define the io priority of this bio 165 * upper 16 bits of bi_rw define the io priority of this bio
@@ -182,17 +186,21 @@ struct bio {
182#define bio_sectors(bio) ((bio)->bi_size >> 9) 186#define bio_sectors(bio) ((bio)->bi_size >> 9)
183#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) 187#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
184#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) 188#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
185#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) 189#define bio_failfast_dev(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV))
190#define bio_failfast_transport(bio) \
191 ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT))
192#define bio_failfast_driver(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DRIVER))
186#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) 193#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
187#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) 194#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
188#define bio_empty_barrier(bio) (bio_barrier(bio) && !(bio)->bi_size) 195#define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD))
196#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio))
189 197
190static inline unsigned int bio_cur_sectors(struct bio *bio) 198static inline unsigned int bio_cur_sectors(struct bio *bio)
191{ 199{
192 if (bio->bi_vcnt) 200 if (bio->bi_vcnt)
193 return bio_iovec(bio)->bv_len >> 9; 201 return bio_iovec(bio)->bv_len >> 9;
194 202 else /* dataless requests such as discard */
195 return 0; 203 return bio->bi_size >> 9;
196} 204}
197 205
198static inline void *bio_data(struct bio *bio) 206static inline void *bio_data(struct bio *bio)
@@ -236,8 +244,6 @@ static inline void *bio_data(struct bio *bio)
236 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) 244 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
237#endif 245#endif
238 246
239#define BIOVEC_VIRT_MERGEABLE(vec1, vec2) \
240 ((((bvec_to_phys((vec1)) + (vec1)->bv_len) | bvec_to_phys((vec2))) & (BIO_VMERGE_BOUNDARY - 1)) == 0)
241#define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ 247#define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \
242 (((addr1) | (mask)) == (((addr2) - 1) | (mask))) 248 (((addr1) | (mask)) == (((addr2) - 1) | (mask)))
243#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ 249#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \
@@ -319,15 +325,14 @@ struct bio_pair {
319 atomic_t cnt; 325 atomic_t cnt;
320 int error; 326 int error;
321}; 327};
322extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, 328extern struct bio_pair *bio_split(struct bio *bi, int first_sectors);
323 int first_sectors);
324extern mempool_t *bio_split_pool;
325extern void bio_pair_release(struct bio_pair *dbio); 329extern void bio_pair_release(struct bio_pair *dbio);
326 330
327extern struct bio_set *bioset_create(int, int); 331extern struct bio_set *bioset_create(int, int);
328extern void bioset_free(struct bio_set *); 332extern void bioset_free(struct bio_set *);
329 333
330extern struct bio *bio_alloc(gfp_t, int); 334extern struct bio *bio_alloc(gfp_t, int);
335extern struct bio *bio_kmalloc(gfp_t, int);
331extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); 336extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *);
332extern void bio_put(struct bio *); 337extern void bio_put(struct bio *);
333extern void bio_free(struct bio *, struct bio_set *); 338extern void bio_free(struct bio *, struct bio_set *);
@@ -335,7 +340,6 @@ extern void bio_free(struct bio *, struct bio_set *);
335extern void bio_endio(struct bio *, int); 340extern void bio_endio(struct bio *, int);
336struct request_queue; 341struct request_queue;
337extern int bio_phys_segments(struct request_queue *, struct bio *); 342extern int bio_phys_segments(struct request_queue *, struct bio *);
338extern int bio_hw_segments(struct request_queue *, struct bio *);
339 343
340extern void __bio_clone(struct bio *, struct bio *); 344extern void __bio_clone(struct bio *, struct bio *);
341extern struct bio *bio_clone(struct bio *, gfp_t); 345extern struct bio *bio_clone(struct bio *, gfp_t);
@@ -346,12 +350,14 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
346extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, 350extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
347 unsigned int, unsigned int); 351 unsigned int, unsigned int);
348extern int bio_get_nr_vecs(struct block_device *); 352extern int bio_get_nr_vecs(struct block_device *);
353extern sector_t bio_sector_offset(struct bio *, unsigned short, unsigned int);
349extern struct bio *bio_map_user(struct request_queue *, struct block_device *, 354extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
350 unsigned long, unsigned int, int); 355 unsigned long, unsigned int, int, gfp_t);
351struct sg_iovec; 356struct sg_iovec;
357struct rq_map_data;
352extern struct bio *bio_map_user_iov(struct request_queue *, 358extern struct bio *bio_map_user_iov(struct request_queue *,
353 struct block_device *, 359 struct block_device *,
354 struct sg_iovec *, int, int); 360 struct sg_iovec *, int, int, gfp_t);
355extern void bio_unmap_user(struct bio *); 361extern void bio_unmap_user(struct bio *);
356extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, 362extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
357 gfp_t); 363 gfp_t);
@@ -359,15 +365,25 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
359 gfp_t, int); 365 gfp_t, int);
360extern void bio_set_pages_dirty(struct bio *bio); 366extern void bio_set_pages_dirty(struct bio *bio);
361extern void bio_check_pages_dirty(struct bio *bio); 367extern void bio_check_pages_dirty(struct bio *bio);
362extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 368extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *,
363extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *, 369 unsigned long, unsigned int, int, gfp_t);
364 int, int); 370extern struct bio *bio_copy_user_iov(struct request_queue *,
371 struct rq_map_data *, struct sg_iovec *,
372 int, int, gfp_t);
365extern int bio_uncopy_user(struct bio *); 373extern int bio_uncopy_user(struct bio *);
366void zero_fill_bio(struct bio *bio); 374void zero_fill_bio(struct bio *bio);
367extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); 375extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *);
368extern unsigned int bvec_nr_vecs(unsigned short idx); 376extern unsigned int bvec_nr_vecs(unsigned short idx);
369 377
370/* 378/*
379 * Allow queuer to specify a completion CPU for this bio
380 */
381static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu)
382{
383 bio->bi_comp_cpu = cpu;
384}
385
386/*
371 * bio_set is used to allow other portions of the IO system to 387 * bio_set is used to allow other portions of the IO system to
372 * allocate their own private memory pools for bio and iovec structures. 388 * allocate their own private memory pools for bio and iovec structures.
373 * These memory pools in turn all allocate from the bio_slab 389 * These memory pools in turn all allocate from the bio_slab
@@ -445,6 +461,14 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
445 __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) 461 __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
446#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) 462#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
447 463
464/*
465 * Check whether this bio carries any data or not. A NULL bio is allowed.
466 */
467static inline int bio_has_data(struct bio *bio)
468{
469 return bio && bio->bi_io_vec != NULL;
470}
471
448#if defined(CONFIG_BLK_DEV_INTEGRITY) 472#if defined(CONFIG_BLK_DEV_INTEGRITY)
449 473
450#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) 474#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))
@@ -458,14 +482,7 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
458#define bip_for_each_vec(bvl, bip, i) \ 482#define bip_for_each_vec(bvl, bip, i) \
459 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) 483 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx)
460 484
461static inline int bio_integrity(struct bio *bio) 485#define bio_integrity(bio) (bio->bi_integrity != NULL)
462{
463#if defined(CONFIG_BLK_DEV_INTEGRITY)
464 return bio->bi_integrity != NULL;
465#else
466 return 0;
467#endif
468}
469 486
470extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); 487extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
471extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); 488extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index e61f22be4d0e..b4fe68fe3a57 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -16,7 +16,9 @@
16#include <linux/bio.h> 16#include <linux/bio.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/stringify.h> 18#include <linux/stringify.h>
19#include <linux/gfp.h>
19#include <linux/bsg.h> 20#include <linux/bsg.h>
21#include <linux/smp.h>
20 22
21#include <asm/scatterlist.h> 23#include <asm/scatterlist.h>
22 24
@@ -54,7 +56,6 @@ enum rq_cmd_type_bits {
54 REQ_TYPE_PM_SUSPEND, /* suspend request */ 56 REQ_TYPE_PM_SUSPEND, /* suspend request */
55 REQ_TYPE_PM_RESUME, /* resume request */ 57 REQ_TYPE_PM_RESUME, /* resume request */
56 REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ 58 REQ_TYPE_PM_SHUTDOWN, /* shutdown request */
57 REQ_TYPE_FLUSH, /* flush request */
58 REQ_TYPE_SPECIAL, /* driver defined type */ 59 REQ_TYPE_SPECIAL, /* driver defined type */
59 REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ 60 REQ_TYPE_LINUX_BLOCK, /* generic block layer message */
60 /* 61 /*
@@ -76,19 +77,20 @@ enum rq_cmd_type_bits {
76 * 77 *
77 */ 78 */
78enum { 79enum {
79 /*
80 * just examples for now
81 */
82 REQ_LB_OP_EJECT = 0x40, /* eject request */ 80 REQ_LB_OP_EJECT = 0x40, /* eject request */
83 REQ_LB_OP_FLUSH = 0x41, /* flush device */ 81 REQ_LB_OP_FLUSH = 0x41, /* flush request */
82 REQ_LB_OP_DISCARD = 0x42, /* discard sectors */
84}; 83};
85 84
86/* 85/*
87 * request type modified bits. first three bits match BIO_RW* bits, important 86 * request type modified bits. first two bits match BIO_RW* bits, important
88 */ 87 */
89enum rq_flag_bits { 88enum rq_flag_bits {
90 __REQ_RW, /* not set, read. set, write */ 89 __REQ_RW, /* not set, read. set, write */
91 __REQ_FAILFAST, /* no low level driver retries */ 90 __REQ_FAILFAST_DEV, /* no driver retries of device errors */
91 __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
92 __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */
93 __REQ_DISCARD, /* request to discard sectors */
92 __REQ_SORTED, /* elevator knows about this request */ 94 __REQ_SORTED, /* elevator knows about this request */
93 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 95 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
94 __REQ_HARDBARRIER, /* may not be passed by drive either */ 96 __REQ_HARDBARRIER, /* may not be passed by drive either */
@@ -111,7 +113,10 @@ enum rq_flag_bits {
111}; 113};
112 114
113#define REQ_RW (1 << __REQ_RW) 115#define REQ_RW (1 << __REQ_RW)
114#define REQ_FAILFAST (1 << __REQ_FAILFAST) 116#define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV)
117#define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT)
118#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER)
119#define REQ_DISCARD (1 << __REQ_DISCARD)
115#define REQ_SORTED (1 << __REQ_SORTED) 120#define REQ_SORTED (1 << __REQ_SORTED)
116#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) 121#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
117#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) 122#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
@@ -140,12 +145,14 @@ enum rq_flag_bits {
140 */ 145 */
141struct request { 146struct request {
142 struct list_head queuelist; 147 struct list_head queuelist;
143 struct list_head donelist; 148 struct call_single_data csd;
149 int cpu;
144 150
145 struct request_queue *q; 151 struct request_queue *q;
146 152
147 unsigned int cmd_flags; 153 unsigned int cmd_flags;
148 enum rq_cmd_type_bits cmd_type; 154 enum rq_cmd_type_bits cmd_type;
155 unsigned long atomic_flags;
149 156
150 /* Maintain bio traversal state for part by part I/O submission. 157 /* Maintain bio traversal state for part by part I/O submission.
151 * hard_* are block layer internals, no driver should touch them! 158 * hard_* are block layer internals, no driver should touch them!
@@ -190,13 +197,6 @@ struct request {
190 */ 197 */
191 unsigned short nr_phys_segments; 198 unsigned short nr_phys_segments;
192 199
193 /* Number of scatter-gather addr+len pairs after
194 * physical and DMA remapping hardware coalescing is performed.
195 * This is the number of scatter-gather entries the driver
196 * will actually have to deal with after DMA mapping is done.
197 */
198 unsigned short nr_hw_segments;
199
200 unsigned short ioprio; 200 unsigned short ioprio;
201 201
202 void *special; 202 void *special;
@@ -220,6 +220,8 @@ struct request {
220 void *data; 220 void *data;
221 void *sense; 221 void *sense;
222 222
223 unsigned long deadline;
224 struct list_head timeout_list;
223 unsigned int timeout; 225 unsigned int timeout;
224 int retries; 226 int retries;
225 227
@@ -233,6 +235,11 @@ struct request {
233 struct request *next_rq; 235 struct request *next_rq;
234}; 236};
235 237
238static inline unsigned short req_get_ioprio(struct request *req)
239{
240 return req->ioprio;
241}
242
236/* 243/*
237 * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME 244 * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME
238 * requests. Some step values could eventually be made generic. 245 * requests. Some step values could eventually be made generic.
@@ -252,6 +259,7 @@ typedef void (request_fn_proc) (struct request_queue *q);
252typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); 259typedef int (make_request_fn) (struct request_queue *q, struct bio *bio);
253typedef int (prep_rq_fn) (struct request_queue *, struct request *); 260typedef int (prep_rq_fn) (struct request_queue *, struct request *);
254typedef void (unplug_fn) (struct request_queue *); 261typedef void (unplug_fn) (struct request_queue *);
262typedef int (prepare_discard_fn) (struct request_queue *, struct request *);
255 263
256struct bio_vec; 264struct bio_vec;
257struct bvec_merge_data { 265struct bvec_merge_data {
@@ -265,6 +273,15 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *,
265typedef void (prepare_flush_fn) (struct request_queue *, struct request *); 273typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
266typedef void (softirq_done_fn)(struct request *); 274typedef void (softirq_done_fn)(struct request *);
267typedef int (dma_drain_needed_fn)(struct request *); 275typedef int (dma_drain_needed_fn)(struct request *);
276typedef int (lld_busy_fn) (struct request_queue *q);
277
278enum blk_eh_timer_return {
279 BLK_EH_NOT_HANDLED,
280 BLK_EH_HANDLED,
281 BLK_EH_RESET_TIMER,
282};
283
284typedef enum blk_eh_timer_return (rq_timed_out_fn)(struct request *);
268 285
269enum blk_queue_state { 286enum blk_queue_state {
270 Queue_down, 287 Queue_down,
@@ -280,6 +297,15 @@ struct blk_queue_tag {
280 atomic_t refcnt; /* map can be shared */ 297 atomic_t refcnt; /* map can be shared */
281}; 298};
282 299
300#define BLK_SCSI_MAX_CMDS (256)
301#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
302
303struct blk_cmd_filter {
304 unsigned long read_ok[BLK_SCSI_CMD_PER_LONG];
305 unsigned long write_ok[BLK_SCSI_CMD_PER_LONG];
306 struct kobject kobj;
307};
308
283struct request_queue 309struct request_queue
284{ 310{
285 /* 311 /*
@@ -298,10 +324,13 @@ struct request_queue
298 make_request_fn *make_request_fn; 324 make_request_fn *make_request_fn;
299 prep_rq_fn *prep_rq_fn; 325 prep_rq_fn *prep_rq_fn;
300 unplug_fn *unplug_fn; 326 unplug_fn *unplug_fn;
327 prepare_discard_fn *prepare_discard_fn;
301 merge_bvec_fn *merge_bvec_fn; 328 merge_bvec_fn *merge_bvec_fn;
302 prepare_flush_fn *prepare_flush_fn; 329 prepare_flush_fn *prepare_flush_fn;
303 softirq_done_fn *softirq_done_fn; 330 softirq_done_fn *softirq_done_fn;
331 rq_timed_out_fn *rq_timed_out_fn;
304 dma_drain_needed_fn *dma_drain_needed; 332 dma_drain_needed_fn *dma_drain_needed;
333 lld_busy_fn *lld_busy_fn;
305 334
306 /* 335 /*
307 * Dispatch queue sorting 336 * Dispatch queue sorting
@@ -376,6 +405,10 @@ struct request_queue
376 unsigned int nr_sorted; 405 unsigned int nr_sorted;
377 unsigned int in_flight; 406 unsigned int in_flight;
378 407
408 unsigned int rq_timeout;
409 struct timer_list timeout;
410 struct list_head timeout_list;
411
379 /* 412 /*
380 * sg stuff 413 * sg stuff
381 */ 414 */
@@ -398,6 +431,7 @@ struct request_queue
398#if defined(CONFIG_BLK_DEV_BSG) 431#if defined(CONFIG_BLK_DEV_BSG)
399 struct bsg_class_device bsg_dev; 432 struct bsg_class_device bsg_dev;
400#endif 433#endif
434 struct blk_cmd_filter cmd_filter;
401}; 435};
402 436
403#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 437#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
@@ -411,6 +445,10 @@ struct request_queue
411#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ 445#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
412#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ 446#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */
413#define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ 447#define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */
448#define QUEUE_FLAG_SAME_COMP 11 /* force complete on same CPU */
449#define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */
450#define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */
451#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */
414 452
415static inline int queue_is_locked(struct request_queue *q) 453static inline int queue_is_locked(struct request_queue *q)
416{ 454{
@@ -516,26 +554,36 @@ enum {
516#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 554#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
517#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 555#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
518#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) 556#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
557#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
519#define blk_queue_flushing(q) ((q)->ordseq) 558#define blk_queue_flushing(q) ((q)->ordseq)
559#define blk_queue_stackable(q) \
560 test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags)
520 561
521#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) 562#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS)
522#define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) 563#define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC)
523#define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL) 564#define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL)
524#define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE) 565#define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE)
525 566
526#define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) 567#define blk_failfast_dev(rq) ((rq)->cmd_flags & REQ_FAILFAST_DEV)
568#define blk_failfast_transport(rq) ((rq)->cmd_flags & REQ_FAILFAST_TRANSPORT)
569#define blk_failfast_driver(rq) ((rq)->cmd_flags & REQ_FAILFAST_DRIVER)
570#define blk_noretry_request(rq) (blk_failfast_dev(rq) || \
571 blk_failfast_transport(rq) || \
572 blk_failfast_driver(rq))
527#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) 573#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED)
528 574
529#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) 575#define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq)))
530 576
531#define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) 577#define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND)
532#define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) 578#define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME)
533#define blk_pm_request(rq) \ 579#define blk_pm_request(rq) \
534 (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) 580 (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq))
535 581
582#define blk_rq_cpu_valid(rq) ((rq)->cpu != -1)
536#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) 583#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED)
537#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) 584#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
538#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) 585#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
586#define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD)
539#define blk_bidi_rq(rq) ((rq)->next_rq != NULL) 587#define blk_bidi_rq(rq) ((rq)->next_rq != NULL)
540#define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) 588#define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors)
541/* rq->queuelist of dequeued request must be list_empty() */ 589/* rq->queuelist of dequeued request must be list_empty() */
@@ -582,7 +630,8 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw)
582#define RQ_NOMERGE_FLAGS \ 630#define RQ_NOMERGE_FLAGS \
583 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) 631 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER)
584#define rq_mergeable(rq) \ 632#define rq_mergeable(rq) \
585 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) 633 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
634 (blk_discard_rq(rq) || blk_fs_request((rq))))
586 635
587/* 636/*
588 * q->prep_rq_fn return values 637 * q->prep_rq_fn return values
@@ -627,6 +676,12 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio)
627} 676}
628#endif /* CONFIG_MMU */ 677#endif /* CONFIG_MMU */
629 678
679struct rq_map_data {
680 struct page **pages;
681 int page_order;
682 int nr_entries;
683};
684
630struct req_iterator { 685struct req_iterator {
631 int i; 686 int i;
632 struct bio *bio; 687 struct bio *bio;
@@ -654,6 +709,10 @@ extern void __blk_put_request(struct request_queue *, struct request *);
654extern struct request *blk_get_request(struct request_queue *, int, gfp_t); 709extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
655extern void blk_insert_request(struct request_queue *, struct request *, int, void *); 710extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
656extern void blk_requeue_request(struct request_queue *, struct request *); 711extern void blk_requeue_request(struct request_queue *, struct request *);
712extern int blk_rq_check_limits(struct request_queue *q, struct request *rq);
713extern int blk_lld_busy(struct request_queue *q);
714extern int blk_insert_cloned_request(struct request_queue *q,
715 struct request *rq);
657extern void blk_plug_device(struct request_queue *); 716extern void blk_plug_device(struct request_queue *);
658extern void blk_plug_device_unlocked(struct request_queue *); 717extern void blk_plug_device_unlocked(struct request_queue *);
659extern int blk_remove_plug(struct request_queue *); 718extern int blk_remove_plug(struct request_queue *);
@@ -695,11 +754,14 @@ extern void __blk_stop_queue(struct request_queue *q);
695extern void __blk_run_queue(struct request_queue *); 754extern void __blk_run_queue(struct request_queue *);
696extern void blk_run_queue(struct request_queue *); 755extern void blk_run_queue(struct request_queue *);
697extern void blk_start_queueing(struct request_queue *); 756extern void blk_start_queueing(struct request_queue *);
698extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long); 757extern int blk_rq_map_user(struct request_queue *, struct request *,
758 struct rq_map_data *, void __user *, unsigned long,
759 gfp_t);
699extern int blk_rq_unmap_user(struct bio *); 760extern int blk_rq_unmap_user(struct bio *);
700extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); 761extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
701extern int blk_rq_map_user_iov(struct request_queue *, struct request *, 762extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
702 struct sg_iovec *, int, unsigned int); 763 struct rq_map_data *, struct sg_iovec *, int,
764 unsigned int, gfp_t);
703extern int blk_execute_rq(struct request_queue *, struct gendisk *, 765extern int blk_execute_rq(struct request_queue *, struct gendisk *,
704 struct request *, int); 766 struct request *, int);
705extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, 767extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
@@ -740,12 +802,15 @@ extern int __blk_end_request(struct request *rq, int error,
740extern int blk_end_bidi_request(struct request *rq, int error, 802extern int blk_end_bidi_request(struct request *rq, int error,
741 unsigned int nr_bytes, unsigned int bidi_bytes); 803 unsigned int nr_bytes, unsigned int bidi_bytes);
742extern void end_request(struct request *, int); 804extern void end_request(struct request *, int);
743extern void end_queued_request(struct request *, int);
744extern void end_dequeued_request(struct request *, int);
745extern int blk_end_request_callback(struct request *rq, int error, 805extern int blk_end_request_callback(struct request *rq, int error,
746 unsigned int nr_bytes, 806 unsigned int nr_bytes,
747 int (drv_callback)(struct request *)); 807 int (drv_callback)(struct request *));
748extern void blk_complete_request(struct request *); 808extern void blk_complete_request(struct request *);
809extern void __blk_complete_request(struct request *);
810extern void blk_abort_request(struct request *);
811extern void blk_abort_queue(struct request_queue *);
812extern void blk_update_request(struct request *rq, int error,
813 unsigned int nr_bytes);
749 814
750/* 815/*
751 * blk_end_request() takes bytes instead of sectors as a complete size. 816 * blk_end_request() takes bytes instead of sectors as a complete size.
@@ -780,12 +845,16 @@ extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int);
780extern int blk_queue_dma_drain(struct request_queue *q, 845extern int blk_queue_dma_drain(struct request_queue *q,
781 dma_drain_needed_fn *dma_drain_needed, 846 dma_drain_needed_fn *dma_drain_needed,
782 void *buf, unsigned int size); 847 void *buf, unsigned int size);
848extern void blk_queue_lld_busy(struct request_queue *q, lld_busy_fn *fn);
783extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); 849extern void blk_queue_segment_boundary(struct request_queue *, unsigned long);
784extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); 850extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn);
785extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); 851extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *);
786extern void blk_queue_dma_alignment(struct request_queue *, int); 852extern void blk_queue_dma_alignment(struct request_queue *, int);
787extern void blk_queue_update_dma_alignment(struct request_queue *, int); 853extern void blk_queue_update_dma_alignment(struct request_queue *, int);
788extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); 854extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *);
855extern void blk_queue_set_discard(struct request_queue *, prepare_discard_fn *);
856extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *);
857extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
789extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 858extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
790extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); 859extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *);
791extern int blk_do_ordered(struct request_queue *, struct request **); 860extern int blk_do_ordered(struct request_queue *, struct request **);
@@ -796,7 +865,6 @@ extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int);
796extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); 865extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
797extern void blk_dump_rq_flags(struct request *, char *); 866extern void blk_dump_rq_flags(struct request *, char *);
798extern void generic_unplug_device(struct request_queue *); 867extern void generic_unplug_device(struct request_queue *);
799extern void __generic_unplug_device(struct request_queue *);
800extern long nr_blockdev_pages(void); 868extern long nr_blockdev_pages(void);
801 869
802int blk_get_queue(struct request_queue *); 870int blk_get_queue(struct request_queue *);
@@ -807,8 +875,6 @@ extern void blk_put_queue(struct request_queue *);
807/* 875/*
808 * tag stuff 876 * tag stuff
809 */ 877 */
810#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
811#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
812#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) 878#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
813extern int blk_queue_start_tag(struct request_queue *, struct request *); 879extern int blk_queue_start_tag(struct request_queue *, struct request *);
814extern struct request *blk_queue_find_tag(struct request_queue *, int); 880extern struct request *blk_queue_find_tag(struct request_queue *, int);
@@ -829,15 +895,23 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
829} 895}
830 896
831extern int blkdev_issue_flush(struct block_device *, sector_t *); 897extern int blkdev_issue_flush(struct block_device *, sector_t *);
898extern int blkdev_issue_discard(struct block_device *,
899 sector_t sector, sector_t nr_sects, gfp_t);
900
901static inline int sb_issue_discard(struct super_block *sb,
902 sector_t block, sector_t nr_blocks)
903{
904 block <<= (sb->s_blocksize_bits - 9);
905 nr_blocks <<= (sb->s_blocksize_bits - 9);
906 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL);
907}
832 908
833/* 909/*
834* command filter functions 910* command filter functions
835*/ 911*/
836extern int blk_verify_command(struct file *file, unsigned char *cmd); 912extern int blk_verify_command(struct blk_cmd_filter *filter,
837extern int blk_cmd_filter_verify_command(struct blk_scsi_cmd_filter *filter, 913 unsigned char *cmd, int has_write_perm);
838 unsigned char *cmd, mode_t *f_mode); 914extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
839extern int blk_register_filter(struct gendisk *disk);
840extern void blk_unregister_filter(struct gendisk *disk);
841 915
842#define MAX_PHYS_SEGMENTS 128 916#define MAX_PHYS_SEGMENTS 128
843#define MAX_HW_SEGMENTS 128 917#define MAX_HW_SEGMENTS 128
@@ -868,6 +942,13 @@ static inline int queue_dma_alignment(struct request_queue *q)
868 return q ? q->dma_alignment : 511; 942 return q ? q->dma_alignment : 511;
869} 943}
870 944
945static inline int blk_rq_aligned(struct request_queue *q, void *addr,
946 unsigned int len)
947{
948 unsigned int alignment = queue_dma_alignment(q) | q->dma_pad_mask;
949 return !((unsigned long)addr & alignment) && !(len & alignment);
950}
951
871/* assumes size > 256 */ 952/* assumes size > 256 */
872static inline unsigned int blksize_bits(unsigned int size) 953static inline unsigned int blksize_bits(unsigned int size)
873{ 954{
@@ -894,7 +975,7 @@ static inline void put_dev_sector(Sector p)
894} 975}
895 976
896struct work_struct; 977struct work_struct;
897int kblockd_schedule_work(struct work_struct *work); 978int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
898void kblockd_flush_work(struct work_struct *work); 979void kblockd_flush_work(struct work_struct *work);
899 980
900#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 981#define MODULE_ALIAS_BLOCKDEV(major,minor) \
@@ -939,49 +1020,19 @@ struct blk_integrity {
939 1020
940extern int blk_integrity_register(struct gendisk *, struct blk_integrity *); 1021extern int blk_integrity_register(struct gendisk *, struct blk_integrity *);
941extern void blk_integrity_unregister(struct gendisk *); 1022extern void blk_integrity_unregister(struct gendisk *);
942extern int blk_integrity_compare(struct block_device *, struct block_device *); 1023extern int blk_integrity_compare(struct gendisk *, struct gendisk *);
943extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *); 1024extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *);
944extern int blk_rq_count_integrity_sg(struct request *); 1025extern int blk_rq_count_integrity_sg(struct request *);
945 1026
946static inline unsigned short blk_integrity_tuple_size(struct blk_integrity *bi) 1027static inline
947{ 1028struct blk_integrity *bdev_get_integrity(struct block_device *bdev)
948 if (bi)
949 return bi->tuple_size;
950
951 return 0;
952}
953
954static inline struct blk_integrity *bdev_get_integrity(struct block_device *bdev)
955{ 1029{
956 return bdev->bd_disk->integrity; 1030 return bdev->bd_disk->integrity;
957} 1031}
958 1032
959static inline unsigned int bdev_get_tag_size(struct block_device *bdev) 1033static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
960{ 1034{
961 struct blk_integrity *bi = bdev_get_integrity(bdev); 1035 return disk->integrity;
962
963 if (bi)
964 return bi->tag_size;
965
966 return 0;
967}
968
969static inline int bdev_integrity_enabled(struct block_device *bdev, int rw)
970{
971 struct blk_integrity *bi = bdev_get_integrity(bdev);
972
973 if (bi == NULL)
974 return 0;
975
976 if (rw == READ && bi->verify_fn != NULL &&
977 (bi->flags & INTEGRITY_FLAG_READ))
978 return 1;
979
980 if (rw == WRITE && bi->generate_fn != NULL &&
981 (bi->flags & INTEGRITY_FLAG_WRITE))
982 return 1;
983
984 return 0;
985} 1036}
986 1037
987static inline int blk_integrity_rq(struct request *rq) 1038static inline int blk_integrity_rq(struct request *rq)
@@ -998,7 +1049,7 @@ static inline int blk_integrity_rq(struct request *rq)
998#define blk_rq_count_integrity_sg(a) (0) 1049#define blk_rq_count_integrity_sg(a) (0)
999#define blk_rq_map_integrity_sg(a, b) (0) 1050#define blk_rq_map_integrity_sg(a, b) (0)
1000#define bdev_get_integrity(a) (0) 1051#define bdev_get_integrity(a) (0)
1001#define bdev_get_tag_size(a) (0) 1052#define blk_get_integrity(a) (0)
1002#define blk_integrity_compare(a, b) (0) 1053#define blk_integrity_compare(a, b) (0)
1003#define blk_integrity_register(a, b) (0) 1054#define blk_integrity_register(a, b) (0)
1004#define blk_integrity_unregister(a) do { } while (0); 1055#define blk_integrity_unregister(a) do { } while (0);
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index d084b8d227a5..bdf505d33e77 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -1,8 +1,10 @@
1#ifndef BLKTRACE_H 1#ifndef BLKTRACE_H
2#define BLKTRACE_H 2#define BLKTRACE_H
3 3
4#ifdef __KERNEL__
4#include <linux/blkdev.h> 5#include <linux/blkdev.h>
5#include <linux/relay.h> 6#include <linux/relay.h>
7#endif
6 8
7/* 9/*
8 * Trace categories 10 * Trace categories
@@ -21,6 +23,8 @@ enum blktrace_cat {
21 BLK_TC_NOTIFY = 1 << 10, /* special message */ 23 BLK_TC_NOTIFY = 1 << 10, /* special message */
22 BLK_TC_AHEAD = 1 << 11, /* readahead */ 24 BLK_TC_AHEAD = 1 << 11, /* readahead */
23 BLK_TC_META = 1 << 12, /* metadata */ 25 BLK_TC_META = 1 << 12, /* metadata */
26 BLK_TC_DISCARD = 1 << 13, /* discard requests */
27 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
24 28
25 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 29 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
26}; 30};
@@ -47,6 +51,8 @@ enum blktrace_act {
47 __BLK_TA_SPLIT, /* bio was split */ 51 __BLK_TA_SPLIT, /* bio was split */
48 __BLK_TA_BOUNCE, /* bio was bounced */ 52 __BLK_TA_BOUNCE, /* bio was bounced */
49 __BLK_TA_REMAP, /* bio was remapped */ 53 __BLK_TA_REMAP, /* bio was remapped */
54 __BLK_TA_ABORT, /* request aborted */
55 __BLK_TA_DRV_DATA, /* driver-specific binary data */
50}; 56};
51 57
52/* 58/*
@@ -77,6 +83,8 @@ enum blktrace_notify {
77#define BLK_TA_SPLIT (__BLK_TA_SPLIT) 83#define BLK_TA_SPLIT (__BLK_TA_SPLIT)
78#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) 84#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
79#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) 85#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
86#define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
87#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
80 88
81#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) 89#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
82#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) 90#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
@@ -89,17 +97,17 @@ enum blktrace_notify {
89 * The trace itself 97 * The trace itself
90 */ 98 */
91struct blk_io_trace { 99struct blk_io_trace {
92 u32 magic; /* MAGIC << 8 | version */ 100 __u32 magic; /* MAGIC << 8 | version */
93 u32 sequence; /* event number */ 101 __u32 sequence; /* event number */
94 u64 time; /* in microseconds */ 102 __u64 time; /* in microseconds */
95 u64 sector; /* disk offset */ 103 __u64 sector; /* disk offset */
96 u32 bytes; /* transfer length */ 104 __u32 bytes; /* transfer length */
97 u32 action; /* what happened */ 105 __u32 action; /* what happened */
98 u32 pid; /* who did it */ 106 __u32 pid; /* who did it */
99 u32 device; /* device number */ 107 __u32 device; /* device number */
100 u32 cpu; /* on what cpu did it happen */ 108 __u32 cpu; /* on what cpu did it happen */
101 u16 error; /* completion error */ 109 __u16 error; /* completion error */
102 u16 pdu_len; /* length of data after this trace */ 110 __u16 pdu_len; /* length of data after this trace */
103}; 111};
104 112
105/* 113/*
@@ -117,6 +125,23 @@ enum {
117 Blktrace_stopped, 125 Blktrace_stopped,
118}; 126};
119 127
128#define BLKTRACE_BDEV_SIZE 32
129
130/*
131 * User setup structure passed with BLKTRACESTART
132 */
133struct blk_user_trace_setup {
134 char name[BLKTRACE_BDEV_SIZE]; /* output */
135 __u16 act_mask; /* input */
136 __u32 buf_size; /* input */
137 __u32 buf_nr; /* input */
138 __u64 start_lba;
139 __u64 end_lba;
140 __u32 pid;
141};
142
143#ifdef __KERNEL__
144#if defined(CONFIG_BLK_DEV_IO_TRACE)
120struct blk_trace { 145struct blk_trace {
121 int trace_state; 146 int trace_state;
122 struct rchan *rchan; 147 struct rchan *rchan;
@@ -133,21 +158,6 @@ struct blk_trace {
133 atomic_t dropped; 158 atomic_t dropped;
134}; 159};
135 160
136/*
137 * User setup structure passed with BLKTRACESTART
138 */
139struct blk_user_trace_setup {
140 char name[BDEVNAME_SIZE]; /* output */
141 u16 act_mask; /* input */
142 u32 buf_size; /* input */
143 u32 buf_nr; /* input */
144 u64 start_lba;
145 u64 end_lba;
146 u32 pid;
147};
148
149#ifdef __KERNEL__
150#if defined(CONFIG_BLK_DEV_IO_TRACE)
151extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); 161extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
152extern void blk_trace_shutdown(struct request_queue *); 162extern void blk_trace_shutdown(struct request_queue *);
153extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); 163extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
@@ -195,6 +205,9 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
195 if (likely(!bt)) 205 if (likely(!bt))
196 return; 206 return;
197 207
208 if (blk_discard_rq(rq))
209 rw |= (1 << BIO_RW_DISCARD);
210
198 if (blk_pc_request(rq)) { 211 if (blk_pc_request(rq)) {
199 what |= BLK_TC_ACT(BLK_TC_PC); 212 what |= BLK_TC_ACT(BLK_TC_PC);
200 __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); 213 __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd);
@@ -307,6 +320,34 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
307 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); 320 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
308} 321}
309 322
323/**
324 * blk_add_driver_data - Add binary message with driver-specific data
325 * @q: queue the io is for
326 * @rq: io request
327 * @data: driver-specific data
328 * @len: length of driver-specific data
329 *
330 * Description:
331 * Some drivers might want to write driver-specific data per request.
332 *
333 **/
334static inline void blk_add_driver_data(struct request_queue *q,
335 struct request *rq,
336 void *data, size_t len)
337{
338 struct blk_trace *bt = q->blk_trace;
339
340 if (likely(!bt))
341 return;
342
343 if (blk_pc_request(rq))
344 __blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA,
345 rq->errors, len, data);
346 else
347 __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
348 0, BLK_TA_DRV_DATA, rq->errors, len, data);
349}
350
310extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, 351extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
311 char __user *arg); 352 char __user *arg);
312extern int blk_trace_startstop(struct request_queue *q, int start); 353extern int blk_trace_startstop(struct request_queue *q, int start);
@@ -320,6 +361,7 @@ extern int blk_trace_remove(struct request_queue *q);
320#define blk_add_trace_generic(q, rq, rw, what) do { } while (0) 361#define blk_add_trace_generic(q, rq, rw, what) do { } while (0)
321#define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) 362#define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0)
322#define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) 363#define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0)
364#define blk_add_driver_data(q, rq, data, len) do {} while (0)
323#define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) 365#define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY)
324#define blk_trace_setup(q, name, dev, arg) (-ENOTTY) 366#define blk_trace_setup(q, name, dev, arg) (-ENOTTY)
325#define blk_trace_startstop(q, start) (-ENOTTY) 367#define blk_trace_startstop(q, start) (-ENOTTY)
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index c98dd7cb7076..30934e4bfaab 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -326,7 +326,8 @@ struct cgroup_subsys {
326 */ 326 */
327 void (*mm_owner_changed)(struct cgroup_subsys *ss, 327 void (*mm_owner_changed)(struct cgroup_subsys *ss,
328 struct cgroup *old, 328 struct cgroup *old,
329 struct cgroup *new); 329 struct cgroup *new,
330 struct task_struct *p);
330 int subsys_id; 331 int subsys_id;
331 int active; 332 int active;
332 int disabled; 333 int disabled;
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 5ca8c6fddb56..778777316ea4 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -35,6 +35,8 @@ struct clk;
35 * clk_get may return different clock producers depending on @dev.) 35 * clk_get may return different clock producers depending on @dev.)
36 * 36 *
37 * Drivers must assume that the clock source is not enabled. 37 * Drivers must assume that the clock source is not enabled.
38 *
39 * clk_get should not be called from within interrupt context.
38 */ 40 */
39struct clk *clk_get(struct device *dev, const char *id); 41struct clk *clk_get(struct device *dev, const char *id);
40 42
@@ -76,6 +78,8 @@ unsigned long clk_get_rate(struct clk *clk);
76 * Note: drivers must ensure that all clk_enable calls made on this 78 * Note: drivers must ensure that all clk_enable calls made on this
77 * clock source are balanced by clk_disable calls prior to calling 79 * clock source are balanced by clk_disable calls prior to calling
78 * this function. 80 * this function.
81 *
82 * clk_put should not be called from within interrupt context.
79 */ 83 */
80void clk_put(struct clk *clk); 84void clk_put(struct clk *clk);
81 85
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index c33b0dc28e4d..ed3a5d473e52 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -127,6 +127,8 @@ extern int clockevents_register_notifier(struct notifier_block *nb);
127extern int clockevents_program_event(struct clock_event_device *dev, 127extern int clockevents_program_event(struct clock_event_device *dev,
128 ktime_t expires, ktime_t now); 128 ktime_t expires, ktime_t now);
129 129
130extern void clockevents_handle_noop(struct clock_event_device *dev);
131
130#ifdef CONFIG_GENERIC_CLOCKEVENTS 132#ifdef CONFIG_GENERIC_CLOCKEVENTS
131extern void clockevents_notify(unsigned long reason, void *arg); 133extern void clockevents_notify(unsigned long reason, void *arg);
132#else 134#else
diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h
new file mode 100644
index 000000000000..8c0f9505b48c
--- /dev/null
+++ b/include/linux/cnt32_to_63.h
@@ -0,0 +1,80 @@
1/*
2 * Extend a 32-bit counter to 63 bits
3 *
4 * Author: Nicolas Pitre
5 * Created: December 3, 2006
6 * Copyright: 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
10 * as published by the Free Software Foundation.
11 */
12
13#ifndef __LINUX_CNT32_TO_63_H__
14#define __LINUX_CNT32_TO_63_H__
15
16#include <linux/compiler.h>
17#include <linux/types.h>
18#include <asm/byteorder.h>
19
20/* this is used only to give gcc a clue about good code generation */
21union cnt32_to_63 {
22 struct {
23#if defined(__LITTLE_ENDIAN)
24 u32 lo, hi;
25#elif defined(__BIG_ENDIAN)
26 u32 hi, lo;
27#endif
28 };
29 u64 val;
30};
31
32
33/**
34 * cnt32_to_63 - Expand a 32-bit counter to a 63-bit counter
35 * @cnt_lo: The low part of the counter
36 *
37 * Many hardware clock counters are only 32 bits wide and therefore have
38 * a relatively short period making wrap-arounds rather frequent. This
39 * is a problem when implementing sched_clock() for example, where a 64-bit
40 * non-wrapping monotonic value is expected to be returned.
41 *
42 * To overcome that limitation, let's extend a 32-bit counter to 63 bits
43 * in a completely lock free fashion. Bits 0 to 31 of the clock are provided
44 * by the hardware while bits 32 to 62 are stored in memory. The top bit in
45 * memory is used to synchronize with the hardware clock half-period. When
46 * the top bit of both counters (hardware and in memory) differ then the
47 * memory is updated with a new value, incrementing it when the hardware
48 * counter wraps around.
49 *
50 * Because a word store in memory is atomic then the incremented value will
51 * always be in synch with the top bit indicating to any potential concurrent
52 * reader if the value in memory is up to date or not with regards to the
53 * needed increment. And any race in updating the value in memory is harmless
54 * as the same value would simply be stored more than once.
55 *
56 * The only restriction for the algorithm to work properly is that this
57 * code must be executed at least once per each half period of the 32-bit
58 * counter to properly update the state bit in memory. This is usually not a
59 * problem in practice, but if it is then a kernel timer could be scheduled
60 * to manage for this code to be executed often enough.
61 *
62 * Note that the top bit (bit 63) in the returned value should be considered
63 * as garbage. It is not cleared here because callers are likely to use a
64 * multiplier on the returned value which can get rid of the top bit
65 * implicitly by making the multiplier even, therefore saving on a runtime
66 * clear-bit instruction. Otherwise caller must remember to clear the top
67 * bit explicitly.
68 */
69#define cnt32_to_63(cnt_lo) \
70({ \
71 static volatile u32 __m_cnt_hi; \
72 union cnt32_to_63 __x; \
73 __x.hi = __m_cnt_hi; \
74 __x.lo = (cnt_lo); \
75 if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \
76 __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \
77 __x.val; \
78})
79
80#endif
diff --git a/include/linux/compat.h b/include/linux/compat.h
index cf8d11cad5ae..f061a1ea1b74 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -78,7 +78,6 @@ typedef struct {
78 compat_sigset_word sig[_COMPAT_NSIG_WORDS]; 78 compat_sigset_word sig[_COMPAT_NSIG_WORDS];
79} compat_sigset_t; 79} compat_sigset_t;
80 80
81extern int cp_compat_stat(struct kstat *, struct compat_stat __user *);
82extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); 81extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *);
83extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); 82extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *);
84 83
@@ -235,6 +234,11 @@ extern int get_compat_itimerspec(struct itimerspec *dst,
235extern int put_compat_itimerspec(struct compat_itimerspec __user *dst, 234extern int put_compat_itimerspec(struct compat_itimerspec __user *dst,
236 const struct itimerspec *src); 235 const struct itimerspec *src);
237 236
237asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv,
238 struct timezone __user *tz);
239asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv,
240 struct timezone __user *tz);
241
238asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); 242asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
239 243
240extern int compat_printk(const char *fmt, ...); 244extern int compat_printk(const char *fmt, ...);
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index c8bd2daf95ec..8322141ee480 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -190,7 +190,9 @@ extern void __chk_io_ptr(const volatile void __iomem *);
190 * ACCESS_ONCE() in different C statements. 190 * ACCESS_ONCE() in different C statements.
191 * 191 *
192 * This macro does absolutely -nothing- to prevent the CPU from reordering, 192 * This macro does absolutely -nothing- to prevent the CPU from reordering,
193 * merging, or refetching absolutely anything at any time. 193 * merging, or refetching absolutely anything at any time. Its main intended
194 * use is to mediate communication between process-level code and irq/NMI
195 * handlers, all running on the same CPU.
194 */ 196 */
195#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) 197#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
196 198
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 02ef8835999c..4a6b604ef7e4 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -10,6 +10,18 @@
10 10
11#include <linux/wait.h> 11#include <linux/wait.h>
12 12
13/**
14 * struct completion - structure used to maintain state for a "completion"
15 *
16 * This is the opaque structure used to maintain the state for a "completion".
17 * Completions currently use a FIFO to queue threads that have to wait for
18 * the "completion" event.
19 *
20 * See also: complete(), wait_for_completion() (and friends _timeout,
21 * _interruptible, _interruptible_timeout, and _killable), init_completion(),
22 * and macros DECLARE_COMPLETION(), DECLARE_COMPLETION_ONSTACK(), and
23 * INIT_COMPLETION().
24 */
13struct completion { 25struct completion {
14 unsigned int done; 26 unsigned int done;
15 wait_queue_head_t wait; 27 wait_queue_head_t wait;
@@ -21,6 +33,14 @@ struct completion {
21#define COMPLETION_INITIALIZER_ONSTACK(work) \ 33#define COMPLETION_INITIALIZER_ONSTACK(work) \
22 ({ init_completion(&work); work; }) 34 ({ init_completion(&work); work; })
23 35
36/**
37 * DECLARE_COMPLETION: - declare and initialize a completion structure
38 * @work: identifier for the completion structure
39 *
40 * This macro declares and initializes a completion structure. Generally used
41 * for static declarations. You should use the _ONSTACK variant for automatic
42 * variables.
43 */
24#define DECLARE_COMPLETION(work) \ 44#define DECLARE_COMPLETION(work) \
25 struct completion work = COMPLETION_INITIALIZER(work) 45 struct completion work = COMPLETION_INITIALIZER(work)
26 46
@@ -29,6 +49,13 @@ struct completion {
29 * completions - so we use the _ONSTACK() variant for those that 49 * completions - so we use the _ONSTACK() variant for those that
30 * are on the kernel stack: 50 * are on the kernel stack:
31 */ 51 */
52/**
53 * DECLARE_COMPLETION_ONSTACK: - declare and initialize a completion structure
54 * @work: identifier for the completion structure
55 *
56 * This macro declares and initializes a completion structure on the kernel
57 * stack.
58 */
32#ifdef CONFIG_LOCKDEP 59#ifdef CONFIG_LOCKDEP
33# define DECLARE_COMPLETION_ONSTACK(work) \ 60# define DECLARE_COMPLETION_ONSTACK(work) \
34 struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) 61 struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
@@ -36,6 +63,13 @@ struct completion {
36# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) 63# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
37#endif 64#endif
38 65
66/**
67 * init_completion: - Initialize a dynamically allocated completion
68 * @x: completion structure that is to be initialized
69 *
70 * This inline function will initialize a dynamically created completion
71 * structure.
72 */
39static inline void init_completion(struct completion *x) 73static inline void init_completion(struct completion *x)
40{ 74{
41 x->done = 0; 75 x->done = 0;
@@ -55,6 +89,13 @@ extern bool completion_done(struct completion *x);
55extern void complete(struct completion *); 89extern void complete(struct completion *);
56extern void complete_all(struct completion *); 90extern void complete_all(struct completion *);
57 91
92/**
93 * INIT_COMPLETION: - reinitialize a completion structure
94 * @x: completion structure to be reinitialized
95 *
96 * This macro should be used to reinitialize a completion structure so it can
97 * be reused. This is especially important after complete_all() is used.
98 */
58#define INIT_COMPLETION(x) ((x).done = 0) 99#define INIT_COMPLETION(x) ((x).done = 0)
59 100
60 101
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index b03f80a078be..d71f7c0f931b 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -53,7 +53,6 @@ struct vc_data {
53 unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */ 53 unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */
54 struct console_font vc_font; /* Current VC font set */ 54 struct console_font vc_font; /* Current VC font set */
55 unsigned short vc_video_erase_char; /* Background erase character */ 55 unsigned short vc_video_erase_char; /* Background erase character */
56 unsigned short vc_scrl_erase_char; /* Erase character for scroll */
57 /* VT terminal data */ 56 /* VT terminal data */
58 unsigned int vc_state; /* Escape sequence parser state */ 57 unsigned int vc_state; /* Escape sequence parser state */
59 unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */ 58 unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index d7faf8808497..c2747ac2ae43 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -69,6 +69,7 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
69#endif 69#endif
70 70
71int cpu_up(unsigned int cpu); 71int cpu_up(unsigned int cpu);
72void notify_cpu_starting(unsigned int cpu);
72extern void cpu_hotplug_init(void); 73extern void cpu_hotplug_init(void);
73extern void cpu_maps_update_begin(void); 74extern void cpu_maps_update_begin(void);
74extern void cpu_maps_update_done(void); 75extern void cpu_maps_update_done(void);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 6fd5668aa572..1ee608fd7b77 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -187,7 +187,8 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
187 unsigned int relation); 187 unsigned int relation);
188 188
189 189
190extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy); 190extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy,
191 unsigned int cpu);
191 192
192int cpufreq_register_governor(struct cpufreq_governor *governor); 193int cpufreq_register_governor(struct cpufreq_governor *governor);
193void cpufreq_unregister_governor(struct cpufreq_governor *governor); 194void cpufreq_unregister_governor(struct cpufreq_governor *governor);
@@ -226,7 +227,9 @@ struct cpufreq_driver {
226 unsigned int (*get) (unsigned int cpu); 227 unsigned int (*get) (unsigned int cpu);
227 228
228 /* optional */ 229 /* optional */
229 unsigned int (*getavg) (unsigned int cpu); 230 unsigned int (*getavg) (struct cpufreq_policy *policy,
231 unsigned int cpu);
232
230 int (*exit) (struct cpufreq_policy *policy); 233 int (*exit) (struct cpufreq_policy *policy);
231 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 234 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
232 int (*resume) (struct cpufreq_policy *policy); 235 int (*resume) (struct cpufreq_policy *policy);
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index e8f450c499b0..2691926fb506 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -160,7 +160,7 @@ static inline int current_cpuset_is_being_rebound(void)
160 160
161static inline void rebuild_sched_domains(void) 161static inline void rebuild_sched_domains(void)
162{ 162{
163 partition_sched_domains(0, NULL, NULL); 163 partition_sched_domains(1, NULL, NULL);
164} 164}
165 165
166#endif /* !CONFIG_CPUSETS */ 166#endif /* !CONFIG_CPUSETS */
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index c43dc47fdf75..3d2317e4af2e 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -38,6 +38,7 @@
38#define CRYPTO_ALG_TYPE_DIGEST 0x00000008 38#define CRYPTO_ALG_TYPE_DIGEST 0x00000008
39#define CRYPTO_ALG_TYPE_HASH 0x00000009 39#define CRYPTO_ALG_TYPE_HASH 0x00000009
40#define CRYPTO_ALG_TYPE_AHASH 0x0000000a 40#define CRYPTO_ALG_TYPE_AHASH 0x0000000a
41#define CRYPTO_ALG_TYPE_RNG 0x0000000c
41 42
42#define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e 43#define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e
43#define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c 44#define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c
@@ -61,6 +62,14 @@
61#define CRYPTO_ALG_GENIV 0x00000200 62#define CRYPTO_ALG_GENIV 0x00000200
62 63
63/* 64/*
65 * Set if the algorithm has passed automated run-time testing. Note that
66 * if there is no run-time testing for a given algorithm it is considered
67 * to have passed.
68 */
69
70#define CRYPTO_ALG_TESTED 0x00000400
71
72/*
64 * Transform masks and values (for crt_flags). 73 * Transform masks and values (for crt_flags).
65 */ 74 */
66#define CRYPTO_TFM_REQ_MASK 0x000fff00 75#define CRYPTO_TFM_REQ_MASK 0x000fff00
@@ -105,6 +114,7 @@ struct crypto_aead;
105struct crypto_blkcipher; 114struct crypto_blkcipher;
106struct crypto_hash; 115struct crypto_hash;
107struct crypto_ahash; 116struct crypto_ahash;
117struct crypto_rng;
108struct crypto_tfm; 118struct crypto_tfm;
109struct crypto_type; 119struct crypto_type;
110struct aead_givcrypt_request; 120struct aead_givcrypt_request;
@@ -290,6 +300,15 @@ struct compress_alg {
290 unsigned int slen, u8 *dst, unsigned int *dlen); 300 unsigned int slen, u8 *dst, unsigned int *dlen);
291}; 301};
292 302
303struct rng_alg {
304 int (*rng_make_random)(struct crypto_rng *tfm, u8 *rdata,
305 unsigned int dlen);
306 int (*rng_reset)(struct crypto_rng *tfm, u8 *seed, unsigned int slen);
307
308 unsigned int seedsize;
309};
310
311
293#define cra_ablkcipher cra_u.ablkcipher 312#define cra_ablkcipher cra_u.ablkcipher
294#define cra_aead cra_u.aead 313#define cra_aead cra_u.aead
295#define cra_blkcipher cra_u.blkcipher 314#define cra_blkcipher cra_u.blkcipher
@@ -298,6 +317,7 @@ struct compress_alg {
298#define cra_hash cra_u.hash 317#define cra_hash cra_u.hash
299#define cra_ahash cra_u.ahash 318#define cra_ahash cra_u.ahash
300#define cra_compress cra_u.compress 319#define cra_compress cra_u.compress
320#define cra_rng cra_u.rng
301 321
302struct crypto_alg { 322struct crypto_alg {
303 struct list_head cra_list; 323 struct list_head cra_list;
@@ -325,6 +345,7 @@ struct crypto_alg {
325 struct hash_alg hash; 345 struct hash_alg hash;
326 struct ahash_alg ahash; 346 struct ahash_alg ahash;
327 struct compress_alg compress; 347 struct compress_alg compress;
348 struct rng_alg rng;
328 } cra_u; 349 } cra_u;
329 350
330 int (*cra_init)(struct crypto_tfm *tfm); 351 int (*cra_init)(struct crypto_tfm *tfm);
@@ -430,6 +451,12 @@ struct compress_tfm {
430 u8 *dst, unsigned int *dlen); 451 u8 *dst, unsigned int *dlen);
431}; 452};
432 453
454struct rng_tfm {
455 int (*rng_gen_random)(struct crypto_rng *tfm, u8 *rdata,
456 unsigned int dlen);
457 int (*rng_reset)(struct crypto_rng *tfm, u8 *seed, unsigned int slen);
458};
459
433#define crt_ablkcipher crt_u.ablkcipher 460#define crt_ablkcipher crt_u.ablkcipher
434#define crt_aead crt_u.aead 461#define crt_aead crt_u.aead
435#define crt_blkcipher crt_u.blkcipher 462#define crt_blkcipher crt_u.blkcipher
@@ -437,6 +464,7 @@ struct compress_tfm {
437#define crt_hash crt_u.hash 464#define crt_hash crt_u.hash
438#define crt_ahash crt_u.ahash 465#define crt_ahash crt_u.ahash
439#define crt_compress crt_u.compress 466#define crt_compress crt_u.compress
467#define crt_rng crt_u.rng
440 468
441struct crypto_tfm { 469struct crypto_tfm {
442 470
@@ -450,6 +478,7 @@ struct crypto_tfm {
450 struct hash_tfm hash; 478 struct hash_tfm hash;
451 struct ahash_tfm ahash; 479 struct ahash_tfm ahash;
452 struct compress_tfm compress; 480 struct compress_tfm compress;
481 struct rng_tfm rng;
453 } crt_u; 482 } crt_u;
454 483
455 struct crypto_alg *__crt_alg; 484 struct crypto_alg *__crt_alg;
@@ -481,6 +510,10 @@ struct crypto_hash {
481 struct crypto_tfm base; 510 struct crypto_tfm base;
482}; 511};
483 512
513struct crypto_rng {
514 struct crypto_tfm base;
515};
516
484enum { 517enum {
485 CRYPTOA_UNSPEC, 518 CRYPTOA_UNSPEC,
486 CRYPTOA_ALG, 519 CRYPTOA_ALG,
@@ -515,6 +548,8 @@ struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags);
515struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); 548struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask);
516void crypto_free_tfm(struct crypto_tfm *tfm); 549void crypto_free_tfm(struct crypto_tfm *tfm);
517 550
551int alg_test(const char *driver, const char *alg, u32 type, u32 mask);
552
518/* 553/*
519 * Transform helpers which query the underlying algorithm. 554 * Transform helpers which query the underlying algorithm.
520 */ 555 */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 07aa198f19ed..efba1de629ac 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -230,7 +230,7 @@ extern void d_delete(struct dentry *);
230extern struct dentry * d_alloc(struct dentry *, const struct qstr *); 230extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
231extern struct dentry * d_alloc_anon(struct inode *); 231extern struct dentry * d_alloc_anon(struct inode *);
232extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 232extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
233extern struct dentry * d_add_ci(struct inode *, struct dentry *, struct qstr *); 233extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *);
234extern void shrink_dcache_sb(struct super_block *); 234extern void shrink_dcache_sb(struct super_block *);
235extern void shrink_dcache_parent(struct dentry *); 235extern void shrink_dcache_parent(struct dentry *);
236extern void shrink_dcache_for_umount(struct super_block *); 236extern void shrink_dcache_for_umount(struct super_block *);
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index a90222e3297d..08d783592b73 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -13,7 +13,6 @@
13 13
14struct dm_target; 14struct dm_target;
15struct dm_table; 15struct dm_table;
16struct dm_dev;
17struct mapped_device; 16struct mapped_device;
18struct bio_vec; 17struct bio_vec;
19 18
@@ -84,6 +83,12 @@ void dm_error(const char *message);
84 */ 83 */
85void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); 84void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev);
86 85
86struct dm_dev {
87 struct block_device *bdev;
88 int mode;
89 char name[16];
90};
91
87/* 92/*
88 * Constructors should call these functions to ensure destination devices 93 * Constructors should call these functions to ensure destination devices
89 * are opened/closed correctly. 94 * are opened/closed correctly.
@@ -202,6 +207,7 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid);
202struct gendisk *dm_disk(struct mapped_device *md); 207struct gendisk *dm_disk(struct mapped_device *md);
203int dm_suspended(struct mapped_device *md); 208int dm_suspended(struct mapped_device *md);
204int dm_noflush_suspending(struct dm_target *ti); 209int dm_noflush_suspending(struct dm_target *ti);
210union map_info *dm_get_mapinfo(struct bio *bio);
205 211
206/* 212/*
207 * Geometry functions. 213 * Geometry functions.
@@ -232,6 +238,11 @@ int dm_table_add_target(struct dm_table *t, const char *type,
232int dm_table_complete(struct dm_table *t); 238int dm_table_complete(struct dm_table *t);
233 239
234/* 240/*
241 * Unplug all devices in a table.
242 */
243void dm_table_unplug_all(struct dm_table *t);
244
245/*
235 * Table reference counting. 246 * Table reference counting.
236 */ 247 */
237struct dm_table *dm_get_table(struct mapped_device *md); 248struct dm_table *dm_get_table(struct mapped_device *md);
@@ -256,6 +267,11 @@ void dm_table_event(struct dm_table *t);
256 */ 267 */
257int dm_swap_table(struct mapped_device *md, struct dm_table *t); 268int dm_swap_table(struct mapped_device *md, struct dm_table *t);
258 269
270/*
271 * A wrapper around vmalloc.
272 */
273void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
274
259/*----------------------------------------------------------------- 275/*-----------------------------------------------------------------
260 * Macros. 276 * Macros.
261 *---------------------------------------------------------------*/ 277 *---------------------------------------------------------------*/
diff --git a/include/linux/device.h b/include/linux/device.h
index d24a47f80f9c..987f5912720a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -90,6 +90,9 @@ int __must_check bus_for_each_drv(struct bus_type *bus,
90 struct device_driver *start, void *data, 90 struct device_driver *start, void *data,
91 int (*fn)(struct device_driver *, void *)); 91 int (*fn)(struct device_driver *, void *));
92 92
93void bus_sort_breadthfirst(struct bus_type *bus,
94 int (*compare)(const struct device *a,
95 const struct device *b));
93/* 96/*
94 * Bus notifiers: Get notified of addition/removal of devices 97 * Bus notifiers: Get notified of addition/removal of devices
95 * and binding/unbinding of drivers to devices. 98 * and binding/unbinding of drivers to devices.
@@ -199,6 +202,11 @@ struct class {
199 struct class_private *p; 202 struct class_private *p;
200}; 203};
201 204
205struct class_dev_iter {
206 struct klist_iter ki;
207 const struct device_type *type;
208};
209
202extern struct kobject *sysfs_dev_block_kobj; 210extern struct kobject *sysfs_dev_block_kobj;
203extern struct kobject *sysfs_dev_char_kobj; 211extern struct kobject *sysfs_dev_char_kobj;
204extern int __must_check __class_register(struct class *class, 212extern int __must_check __class_register(struct class *class,
@@ -213,6 +221,13 @@ extern void class_unregister(struct class *class);
213 __class_register(class, &__key); \ 221 __class_register(class, &__key); \
214}) 222})
215 223
224extern void class_dev_iter_init(struct class_dev_iter *iter,
225 struct class *class,
226 struct device *start,
227 const struct device_type *type);
228extern struct device *class_dev_iter_next(struct class_dev_iter *iter);
229extern void class_dev_iter_exit(struct class_dev_iter *iter);
230
216extern int class_for_each_device(struct class *class, struct device *start, 231extern int class_for_each_device(struct class *class, struct device *start,
217 void *data, 232 void *data,
218 int (*fn)(struct device *dev, void *data)); 233 int (*fn)(struct device *dev, void *data));
@@ -358,6 +373,7 @@ struct device {
358 373
359 struct kobject kobj; 374 struct kobject kobj;
360 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 375 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
376 const char *init_name; /* initial name of the device */
361 struct device_type *type; 377 struct device_type *type;
362 unsigned uevent_suppress:1; 378 unsigned uevent_suppress:1;
363 379
@@ -395,7 +411,7 @@ struct device {
395 spinlock_t devres_lock; 411 spinlock_t devres_lock;
396 struct list_head devres_head; 412 struct list_head devres_head;
397 413
398 struct list_head node; 414 struct klist_node knode_class;
399 struct class *class; 415 struct class *class;
400 dev_t devt; /* dev_t, creates the sysfs "dev" */ 416 dev_t devt; /* dev_t, creates the sysfs "dev" */
401 struct attribute_group **groups; /* optional groups */ 417 struct attribute_group **groups; /* optional groups */
@@ -406,7 +422,7 @@ struct device {
406/* Get the wakeup routines, which depend on struct device */ 422/* Get the wakeup routines, which depend on struct device */
407#include <linux/pm_wakeup.h> 423#include <linux/pm_wakeup.h>
408 424
409static inline const char *dev_name(struct device *dev) 425static inline const char *dev_name(const struct device *dev)
410{ 426{
411 /* will be changed into kobject_name(&dev->kobj) in the near future */ 427 /* will be changed into kobject_name(&dev->kobj) in the near future */
412 return dev->bus_id; 428 return dev->bus_id;
@@ -489,7 +505,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
489 dev_t devt, void *drvdata, 505 dev_t devt, void *drvdata,
490 const char *fmt, ...) 506 const char *fmt, ...)
491 __attribute__((format(printf, 5, 6))); 507 __attribute__((format(printf, 5, 6)));
492#define device_create_drvdata device_create
493extern void device_destroy(struct class *cls, dev_t devt); 508extern void device_destroy(struct class *cls, dev_t devt);
494 509
495/* 510/*
@@ -518,7 +533,7 @@ extern void device_shutdown(void);
518extern void sysdev_shutdown(void); 533extern void sysdev_shutdown(void);
519 534
520/* debugging and troubleshooting/diagnostic helpers. */ 535/* debugging and troubleshooting/diagnostic helpers. */
521extern const char *dev_driver_string(struct device *dev); 536extern const char *dev_driver_string(const struct device *dev);
522#define dev_printk(level, dev, format, arg...) \ 537#define dev_printk(level, dev, format, arg...) \
523 printk(level "%s %s: " format , dev_driver_string(dev) , \ 538 printk(level "%s %s: " format , dev_driver_string(dev) , \
524 dev_name(dev) , ## arg) 539 dev_name(dev) , ## arg)
@@ -538,7 +553,11 @@ extern const char *dev_driver_string(struct device *dev);
538#define dev_info(dev, format, arg...) \ 553#define dev_info(dev, format, arg...) \
539 dev_printk(KERN_INFO , dev , format , ## arg) 554 dev_printk(KERN_INFO , dev , format , ## arg)
540 555
541#ifdef DEBUG 556#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
557#define dev_dbg(dev, format, ...) do { \
558 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
559 } while (0)
560#elif defined(DEBUG)
542#define dev_dbg(dev, format, arg...) \ 561#define dev_dbg(dev, format, arg...) \
543 dev_printk(KERN_DEBUG , dev , format , ## arg) 562 dev_printk(KERN_DEBUG , dev , format , ## arg)
544#else 563#else
@@ -554,6 +573,14 @@ extern const char *dev_driver_string(struct device *dev);
554 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) 573 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
555#endif 574#endif
556 575
576/*
577 * dev_WARN() acts like dev_printk(), but with the key difference
578 * of using a WARN/WARN_ON to get the message out, including the
579 * file/line information and a backtrace.
580 */
581#define dev_WARN(dev, format, arg...) \
582 WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg);
583
557/* Create alias, so I can be autoloaded. */ 584/* Create alias, so I can be autoloaded. */
558#define MODULE_ALIAS_CHARDEV(major,minor) \ 585#define MODULE_ALIAS_CHARDEV(major,minor) \
559 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) 586 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index 154769cad3f3..5ce0e5fd712e 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -17,20 +17,31 @@
17 17
18#ifdef CONFIG_UNIX98_PTYS 18#ifdef CONFIG_UNIX98_PTYS
19 19
20int devpts_new_index(void); 20int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(int idx); 21void devpts_kill_index(struct inode *ptmx_inode, int idx);
22int devpts_pty_new(struct tty_struct *tty); /* mknod in devpts */ 22/* mknod in devpts */
23struct tty_struct *devpts_get_tty(int number); /* get tty structure */ 23int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
24void devpts_pty_kill(int number); /* unlink */ 24/* get tty structure */
25struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number);
26/* unlink */
27void devpts_pty_kill(struct tty_struct *tty);
25 28
26#else 29#else
27 30
28/* Dummy stubs in the no-pty case */ 31/* Dummy stubs in the no-pty case */
29static inline int devpts_new_index(void) { return -EINVAL; } 32static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
30static inline void devpts_kill_index(int idx) { } 33static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
31static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; } 34static inline int devpts_pty_new(struct inode *ptmx_inode,
32static inline struct tty_struct *devpts_get_tty(int number) { return NULL; } 35 struct tty_struct *tty)
33static inline void devpts_pty_kill(int number) { } 36{
37 return -EINVAL;
38}
39static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode,
40 int number)
41{
42 return NULL;
43}
44static inline void devpts_pty_kill(struct tty_struct *tty) { }
34 45
35#endif 46#endif
36 47
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 203a025e30e5..b9cd38603fd8 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -2,7 +2,7 @@
2******************************************************************************* 2*******************************************************************************
3** 3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 5** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
6** 6**
7** This copyrighted material is made available to anyone wishing to use, 7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions 8** modify, copy, or redistribute it subject to the terms and conditions
@@ -65,9 +65,12 @@ struct dlm_lksb {
65 char * sb_lvbptr; 65 char * sb_lvbptr;
66}; 66};
67 67
68/* dlm_new_lockspace() flags */
69
68#define DLM_LSFL_NODIR 0x00000001 70#define DLM_LSFL_NODIR 0x00000001
69#define DLM_LSFL_TIMEWARN 0x00000002 71#define DLM_LSFL_TIMEWARN 0x00000002
70#define DLM_LSFL_FS 0x00000004 72#define DLM_LSFL_FS 0x00000004
73#define DLM_LSFL_NEWEXCL 0x00000008
71 74
72#ifdef __KERNEL__ 75#ifdef __KERNEL__
73 76
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h
index c6034508fed9..3060783c4191 100644
--- a/include/linux/dlm_device.h
+++ b/include/linux/dlm_device.h
@@ -26,7 +26,7 @@
26/* Version of the device interface */ 26/* Version of the device interface */
27#define DLM_DEVICE_VERSION_MAJOR 6 27#define DLM_DEVICE_VERSION_MAJOR 6
28#define DLM_DEVICE_VERSION_MINOR 0 28#define DLM_DEVICE_VERSION_MINOR 0
29#define DLM_DEVICE_VERSION_PATCH 0 29#define DLM_DEVICE_VERSION_PATCH 1
30 30
31/* struct passed to the lock write */ 31/* struct passed to the lock write */
32struct dlm_lock_params { 32struct dlm_lock_params {
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 952e0f857ac9..ba9114ec5d3a 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -48,6 +48,11 @@ static inline int is_device_dma_capable(struct device *dev)
48 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; 48 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
49} 49}
50 50
51static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
52{
53 return addr + size <= mask;
54}
55
51#ifdef CONFIG_HAS_DMA 56#ifdef CONFIG_HAS_DMA
52#include <asm/dma-mapping.h> 57#include <asm/dma-mapping.h>
53#else 58#else
@@ -58,6 +63,13 @@ static inline int is_device_dma_capable(struct device *dev)
58#define dma_sync_single dma_sync_single_for_cpu 63#define dma_sync_single dma_sync_single_for_cpu
59#define dma_sync_sg dma_sync_sg_for_cpu 64#define dma_sync_sg dma_sync_sg_for_cpu
60 65
66static inline u64 dma_get_mask(struct device *dev)
67{
68 if (dev && dev->dma_mask && *dev->dma_mask)
69 return *dev->dma_mask;
70 return DMA_32BIT_MASK;
71}
72
61extern u64 dma_get_required_mask(struct device *dev); 73extern u64 dma_get_required_mask(struct device *dev);
62 74
63static inline unsigned int dma_get_max_seg_size(struct device *dev) 75static inline unsigned int dma_get_max_seg_size(struct device *dev)
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
new file mode 100644
index 000000000000..bff5c65f81dc
--- /dev/null
+++ b/include/linux/dma_remapping.h
@@ -0,0 +1,157 @@
1#ifndef _DMA_REMAPPING_H
2#define _DMA_REMAPPING_H
3
4/*
5 * We need a fixed PAGE_SIZE of 4K irrespective of
6 * arch PAGE_SIZE for IOMMU page tables.
7 */
8#define PAGE_SHIFT_4K (12)
9#define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K)
10#define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K)
11#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
12
13#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT_4K)
14#define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK)
15#define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK)
16
17
18/*
19 * 0: Present
20 * 1-11: Reserved
21 * 12-63: Context Ptr (12 - (haw-1))
22 * 64-127: Reserved
23 */
24struct root_entry {
25 u64 val;
26 u64 rsvd1;
27};
28#define ROOT_ENTRY_NR (PAGE_SIZE_4K/sizeof(struct root_entry))
29static inline bool root_present(struct root_entry *root)
30{
31 return (root->val & 1);
32}
33static inline void set_root_present(struct root_entry *root)
34{
35 root->val |= 1;
36}
37static inline void set_root_value(struct root_entry *root, unsigned long value)
38{
39 root->val |= value & PAGE_MASK_4K;
40}
41
42struct context_entry;
43static inline struct context_entry *
44get_context_addr_from_root(struct root_entry *root)
45{
46 return (struct context_entry *)
47 (root_present(root)?phys_to_virt(
48 root->val & PAGE_MASK_4K):
49 NULL);
50}
51
52/*
53 * low 64 bits:
54 * 0: present
55 * 1: fault processing disable
56 * 2-3: translation type
57 * 12-63: address space root
58 * high 64 bits:
59 * 0-2: address width
60 * 3-6: aval
61 * 8-23: domain id
62 */
63struct context_entry {
64 u64 lo;
65 u64 hi;
66};
67#define context_present(c) ((c).lo & 1)
68#define context_fault_disable(c) (((c).lo >> 1) & 1)
69#define context_translation_type(c) (((c).lo >> 2) & 3)
70#define context_address_root(c) ((c).lo & PAGE_MASK_4K)
71#define context_address_width(c) ((c).hi & 7)
72#define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1))
73
74#define context_set_present(c) do {(c).lo |= 1;} while (0)
75#define context_set_fault_enable(c) \
76 do {(c).lo &= (((u64)-1) << 2) | 1;} while (0)
77#define context_set_translation_type(c, val) \
78 do { \
79 (c).lo &= (((u64)-1) << 4) | 3; \
80 (c).lo |= ((val) & 3) << 2; \
81 } while (0)
82#define CONTEXT_TT_MULTI_LEVEL 0
83#define context_set_address_root(c, val) \
84 do {(c).lo |= (val) & PAGE_MASK_4K;} while (0)
85#define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0)
86#define context_set_domain_id(c, val) \
87 do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0)
88#define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0)
89
90/*
91 * 0: readable
92 * 1: writable
93 * 2-6: reserved
94 * 7: super page
95 * 8-11: available
96 * 12-63: Host physcial address
97 */
98struct dma_pte {
99 u64 val;
100};
101#define dma_clear_pte(p) do {(p).val = 0;} while (0)
102
103#define DMA_PTE_READ (1)
104#define DMA_PTE_WRITE (2)
105
106#define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0)
107#define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0)
108#define dma_set_pte_prot(p, prot) \
109 do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
110#define dma_pte_addr(p) ((p).val & PAGE_MASK_4K)
111#define dma_set_pte_addr(p, addr) do {\
112 (p).val |= ((addr) & PAGE_MASK_4K); } while (0)
113#define dma_pte_present(p) (((p).val & 3) != 0)
114
115struct intel_iommu;
116
117struct dmar_domain {
118 int id; /* domain id */
119 struct intel_iommu *iommu; /* back pointer to owning iommu */
120
121 struct list_head devices; /* all devices' list */
122 struct iova_domain iovad; /* iova's that belong to this domain */
123
124 struct dma_pte *pgd; /* virtual address */
125 spinlock_t mapping_lock; /* page table lock */
126 int gaw; /* max guest address width */
127
128 /* adjusted guest address width, 0 is level 2 30-bit */
129 int agaw;
130
131#define DOMAIN_FLAG_MULTIPLE_DEVICES 1
132 int flags;
133};
134
135/* PCI domain-device relationship */
136struct device_domain_info {
137 struct list_head link; /* link to domain siblings */
138 struct list_head global; /* link to global list */
139 u8 bus; /* PCI bus numer */
140 u8 devfn; /* PCI devfn number */
141 struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */
142 struct dmar_domain *domain; /* pointer to domain */
143};
144
145extern int init_dmars(void);
146extern void free_dmar_iommu(struct intel_iommu *iommu);
147
148extern int dmar_disabled;
149
150#ifndef CONFIG_DMAR_GFX_WA
151static inline void iommu_prepare_gfx_mapping(void)
152{
153 return;
154}
155#endif /* !CONFIG_DMAR_GFX_WA */
156
157#endif
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 56c73b847551..c360c558e59e 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -25,9 +25,99 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/msi.h> 26#include <linux/msi.h>
27 27
28#ifdef CONFIG_DMAR 28#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
29struct intel_iommu; 29struct intel_iommu;
30 30
31struct dmar_drhd_unit {
32 struct list_head list; /* list of drhd units */
33 struct acpi_dmar_header *hdr; /* ACPI header */
34 u64 reg_base_addr; /* register base address*/
35 struct pci_dev **devices; /* target device array */
36 int devices_cnt; /* target device count */
37 u8 ignored:1; /* ignore drhd */
38 u8 include_all:1;
39 struct intel_iommu *iommu;
40};
41
42extern struct list_head dmar_drhd_units;
43
44#define for_each_drhd_unit(drhd) \
45 list_for_each_entry(drhd, &dmar_drhd_units, list)
46
47extern int dmar_table_init(void);
48extern int early_dmar_detect(void);
49extern int dmar_dev_scope_init(void);
50
51/* Intel IOMMU detection */
52extern void detect_intel_iommu(void);
53
54
55extern int parse_ioapics_under_ir(void);
56extern int alloc_iommu(struct dmar_drhd_unit *);
57#else
58static inline void detect_intel_iommu(void)
59{
60 return;
61}
62
63static inline int dmar_table_init(void)
64{
65 return -ENODEV;
66}
67#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */
68
69#ifdef CONFIG_INTR_REMAP
70extern int intr_remapping_enabled;
71extern int enable_intr_remapping(int);
72
73struct irte {
74 union {
75 struct {
76 __u64 present : 1,
77 fpd : 1,
78 dst_mode : 1,
79 redir_hint : 1,
80 trigger_mode : 1,
81 dlvry_mode : 3,
82 avail : 4,
83 __reserved_1 : 4,
84 vector : 8,
85 __reserved_2 : 8,
86 dest_id : 32;
87 };
88 __u64 low;
89 };
90
91 union {
92 struct {
93 __u64 sid : 16,
94 sq : 2,
95 svt : 2,
96 __reserved_3 : 44;
97 };
98 __u64 high;
99 };
100};
101extern int get_irte(int irq, struct irte *entry);
102extern int modify_irte(int irq, struct irte *irte_modified);
103extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count);
104extern int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index,
105 u16 sub_handle);
106extern int map_irq_to_irte_handle(int irq, u16 *sub_handle);
107extern int clear_irte_irq(int irq, struct intel_iommu *iommu, u16 index);
108extern int flush_irte(int irq);
109extern int free_irte(int irq);
110
111extern int irq_remapped(int irq);
112extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
113extern struct intel_iommu *map_ioapic_to_ir(int apic);
114#else
115#define irq_remapped(irq) (0)
116#define enable_intr_remapping(mode) (-1)
117#define intr_remapping_enabled (0)
118#endif
119
120#ifdef CONFIG_DMAR
31extern const char *dmar_get_fault_reason(u8 fault_reason); 121extern const char *dmar_get_fault_reason(u8 fault_reason);
32 122
33/* Can't use the common MSI interrupt functions 123/* Can't use the common MSI interrupt functions
@@ -40,47 +130,30 @@ extern void dmar_msi_write(int irq, struct msi_msg *msg);
40extern int dmar_set_interrupt(struct intel_iommu *iommu); 130extern int dmar_set_interrupt(struct intel_iommu *iommu);
41extern int arch_setup_dmar_msi(unsigned int irq); 131extern int arch_setup_dmar_msi(unsigned int irq);
42 132
43/* Intel IOMMU detection and initialization functions */ 133extern int iommu_detected, no_iommu;
44extern void detect_intel_iommu(void);
45extern int intel_iommu_init(void);
46
47extern int dmar_table_init(void);
48extern int early_dmar_detect(void);
49
50extern struct list_head dmar_drhd_units;
51extern struct list_head dmar_rmrr_units; 134extern struct list_head dmar_rmrr_units;
52
53struct dmar_drhd_unit {
54 struct list_head list; /* list of drhd units */
55 u64 reg_base_addr; /* register base address*/
56 struct pci_dev **devices; /* target device array */
57 int devices_cnt; /* target device count */
58 u8 ignored:1; /* ignore drhd */
59 u8 include_all:1;
60 struct intel_iommu *iommu;
61};
62
63struct dmar_rmrr_unit { 135struct dmar_rmrr_unit {
64 struct list_head list; /* list of rmrr units */ 136 struct list_head list; /* list of rmrr units */
137 struct acpi_dmar_header *hdr; /* ACPI header */
65 u64 base_address; /* reserved base address*/ 138 u64 base_address; /* reserved base address*/
66 u64 end_address; /* reserved end address */ 139 u64 end_address; /* reserved end address */
67 struct pci_dev **devices; /* target devices */ 140 struct pci_dev **devices; /* target devices */
68 int devices_cnt; /* target device count */ 141 int devices_cnt; /* target device count */
69}; 142};
70 143
71#define for_each_drhd_unit(drhd) \
72 list_for_each_entry(drhd, &dmar_drhd_units, list)
73#define for_each_rmrr_units(rmrr) \ 144#define for_each_rmrr_units(rmrr) \
74 list_for_each_entry(rmrr, &dmar_rmrr_units, list) 145 list_for_each_entry(rmrr, &dmar_rmrr_units, list)
146/* Intel DMAR initialization functions */
147extern int intel_iommu_init(void);
148extern int dmar_disabled;
75#else 149#else
76static inline void detect_intel_iommu(void)
77{
78 return;
79}
80static inline int intel_iommu_init(void) 150static inline int intel_iommu_init(void)
81{ 151{
152#ifdef CONFIG_INTR_REMAP
153 return dmar_dev_scope_init();
154#else
82 return -ENODEV; 155 return -ENODEV;
156#endif
83} 157}
84
85#endif /* !CONFIG_DMAR */ 158#endif /* !CONFIG_DMAR */
86#endif /* __DMAR_H__ */ 159#endif /* __DMAR_H__ */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 2a063b64133f..e5084eb5943a 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -2,29 +2,9 @@
2#define __DMI_H__ 2#define __DMI_H__
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/mod_devicetable.h>
5 6
6enum dmi_field { 7/* enum dmi_field is in mod_devicetable.h */
7 DMI_NONE,
8 DMI_BIOS_VENDOR,
9 DMI_BIOS_VERSION,
10 DMI_BIOS_DATE,
11 DMI_SYS_VENDOR,
12 DMI_PRODUCT_NAME,
13 DMI_PRODUCT_VERSION,
14 DMI_PRODUCT_SERIAL,
15 DMI_PRODUCT_UUID,
16 DMI_BOARD_VENDOR,
17 DMI_BOARD_NAME,
18 DMI_BOARD_VERSION,
19 DMI_BOARD_SERIAL,
20 DMI_BOARD_ASSET_TAG,
21 DMI_CHASSIS_VENDOR,
22 DMI_CHASSIS_TYPE,
23 DMI_CHASSIS_VERSION,
24 DMI_CHASSIS_SERIAL,
25 DMI_CHASSIS_ASSET_TAG,
26 DMI_STRING_MAX,
27};
28 8
29enum dmi_device_type { 9enum dmi_device_type {
30 DMI_DEV_TYPE_ANY = 0, 10 DMI_DEV_TYPE_ANY = 0,
@@ -48,23 +28,6 @@ struct dmi_header {
48 u16 handle; 28 u16 handle;
49}; 29};
50 30
51/*
52 * DMI callbacks for problem boards
53 */
54struct dmi_strmatch {
55 u8 slot;
56 char *substr;
57};
58
59struct dmi_system_id {
60 int (*callback)(const struct dmi_system_id *);
61 const char *ident;
62 struct dmi_strmatch matches[4];
63 void *driver_data;
64};
65
66#define DMI_MATCH(a, b) { a, b }
67
68struct dmi_device { 31struct dmi_device {
69 struct list_head list; 32 struct list_head list;
70 int type; 33 int type;
diff --git a/include/linux/ds1286.h b/include/linux/ds1286.h
index d8989860e4ce..45ea0aa0aeb9 100644
--- a/include/linux/ds1286.h
+++ b/include/linux/ds1286.h
@@ -8,8 +8,6 @@
8#ifndef __LINUX_DS1286_H 8#ifndef __LINUX_DS1286_H
9#define __LINUX_DS1286_H 9#define __LINUX_DS1286_H
10 10
11#include <asm/ds1286.h>
12
13/********************************************************************** 11/**********************************************************************
14 * register summary 12 * register summary
15 **********************************************************************/ 13 **********************************************************************/
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index c8cbd90ba375..79a8ed8e6a7d 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -62,6 +62,7 @@ typedef enum fe_caps {
62 FE_CAN_HIERARCHY_AUTO = 0x100000, 62 FE_CAN_HIERARCHY_AUTO = 0x100000,
63 FE_CAN_8VSB = 0x200000, 63 FE_CAN_8VSB = 0x200000,
64 FE_CAN_16VSB = 0x400000, 64 FE_CAN_16VSB = 0x400000,
65 FE_HAS_EXTENDED_CAPS = 0x800000, // We need more bitspace for newer APIs, indicate this.
65 FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) 66 FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending)
66 FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically 67 FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically
67 FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output 68 FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output
@@ -147,7 +148,9 @@ typedef enum fe_code_rate {
147 FEC_6_7, 148 FEC_6_7,
148 FEC_7_8, 149 FEC_7_8,
149 FEC_8_9, 150 FEC_8_9,
150 FEC_AUTO 151 FEC_AUTO,
152 FEC_3_5,
153 FEC_9_10,
151} fe_code_rate_t; 154} fe_code_rate_t;
152 155
153 156
@@ -160,7 +163,11 @@ typedef enum fe_modulation {
160 QAM_256, 163 QAM_256,
161 QAM_AUTO, 164 QAM_AUTO,
162 VSB_8, 165 VSB_8,
163 VSB_16 166 VSB_16,
167 PSK_8,
168 APSK_16,
169 APSK_32,
170 DQPSK,
164} fe_modulation_t; 171} fe_modulation_t;
165 172
166typedef enum fe_transmit_mode { 173typedef enum fe_transmit_mode {
@@ -239,6 +246,107 @@ struct dvb_frontend_event {
239 struct dvb_frontend_parameters parameters; 246 struct dvb_frontend_parameters parameters;
240}; 247};
241 248
249/* S2API Commands */
250#define DTV_UNDEFINED 0
251#define DTV_TUNE 1
252#define DTV_CLEAR 2
253#define DTV_FREQUENCY 3
254#define DTV_MODULATION 4
255#define DTV_BANDWIDTH_HZ 5
256#define DTV_INVERSION 6
257#define DTV_DISEQC_MASTER 7
258#define DTV_SYMBOL_RATE 8
259#define DTV_INNER_FEC 9
260#define DTV_VOLTAGE 10
261#define DTV_TONE 11
262#define DTV_PILOT 12
263#define DTV_ROLLOFF 13
264#define DTV_DISEQC_SLAVE_REPLY 14
265
266/* Basic enumeration set for querying unlimited capabilities */
267#define DTV_FE_CAPABILITY_COUNT 15
268#define DTV_FE_CAPABILITY 16
269#define DTV_DELIVERY_SYSTEM 17
270
271#define DTV_API_VERSION 35
272#define DTV_API_VERSION 35
273#define DTV_CODE_RATE_HP 36
274#define DTV_CODE_RATE_LP 37
275#define DTV_GUARD_INTERVAL 38
276#define DTV_TRANSMISSION_MODE 39
277#define DTV_HIERARCHY 40
278
279#define DTV_MAX_COMMAND DTV_HIERARCHY
280
281typedef enum fe_pilot {
282 PILOT_ON,
283 PILOT_OFF,
284 PILOT_AUTO,
285} fe_pilot_t;
286
287typedef enum fe_rolloff {
288 ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
289 ROLLOFF_20,
290 ROLLOFF_25,
291 ROLLOFF_AUTO,
292} fe_rolloff_t;
293
294typedef enum fe_delivery_system {
295 SYS_UNDEFINED,
296 SYS_DVBC_ANNEX_AC,
297 SYS_DVBC_ANNEX_B,
298 SYS_DVBT,
299 SYS_DSS,
300 SYS_DVBS,
301 SYS_DVBS2,
302 SYS_DVBH,
303 SYS_ISDBT,
304 SYS_ISDBS,
305 SYS_ISDBC,
306 SYS_ATSC,
307 SYS_ATSCMH,
308 SYS_DMBTH,
309 SYS_CMMB,
310 SYS_DAB,
311} fe_delivery_system_t;
312
313struct dtv_cmds_h {
314 char *name; /* A display name for debugging purposes */
315
316 __u32 cmd; /* A unique ID */
317
318 /* Flags */
319 __u32 set:1; /* Either a set or get property */
320 __u32 buffer:1; /* Does this property use the buffer? */
321 __u32 reserved:30; /* Align */
322};
323
324struct dtv_property {
325 __u32 cmd;
326 __u32 reserved[3];
327 union {
328 __u32 data;
329 struct {
330 __u8 data[32];
331 __u32 len;
332 __u32 reserved1[3];
333 void *reserved2;
334 } buffer;
335 } u;
336 int result;
337} __attribute__ ((packed));
338
339/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
340#define DTV_IOCTL_MAX_MSGS 64
341
342struct dtv_properties {
343 __u32 num;
344 struct dtv_property *props;
345};
346
347#define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)
348#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)
349
242 350
243/** 351/**
244 * When set, this flag will disable any zigzagging or other "normal" tuning 352 * When set, this flag will disable any zigzagging or other "normal" tuning
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
index 126e0c26cb09..25b823b81734 100644
--- a/include/linux/dvb/version.h
+++ b/include/linux/dvb/version.h
@@ -23,7 +23,7 @@
23#ifndef _DVBVERSION_H_ 23#ifndef _DVBVERSION_H_
24#define _DVBVERSION_H_ 24#define _DVBVERSION_H_
25 25
26#define DVB_API_VERSION 3 26#define DVB_API_VERSION 5
27#define DVB_API_VERSION_MINOR 2 27#define DVB_API_VERSION_MINOR 0
28 28
29#endif /*_DVBVERSION_H_*/ 29#endif /*_DVBVERSION_H_*/
diff --git a/include/linux/dynamic_printk.h b/include/linux/dynamic_printk.h
new file mode 100644
index 000000000000..2d528d009074
--- /dev/null
+++ b/include/linux/dynamic_printk.h
@@ -0,0 +1,93 @@
1#ifndef _DYNAMIC_PRINTK_H
2#define _DYNAMIC_PRINTK_H
3
4#define DYNAMIC_DEBUG_HASH_BITS 6
5#define DEBUG_HASH_TABLE_SIZE (1 << DYNAMIC_DEBUG_HASH_BITS)
6
7#define TYPE_BOOLEAN 1
8
9#define DYNAMIC_ENABLED_ALL 0
10#define DYNAMIC_ENABLED_NONE 1
11#define DYNAMIC_ENABLED_SOME 2
12
13extern int dynamic_enabled;
14
15/* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which
16 * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They
17 * use independent hash functions, to reduce the chance of false positives.
18 */
19extern long long dynamic_printk_enabled;
20extern long long dynamic_printk_enabled2;
21
22struct mod_debug {
23 char *modname;
24 char *logical_modname;
25 char *flag_names;
26 int type;
27 int hash;
28 int hash2;
29} __attribute__((aligned(8)));
30
31int register_dynamic_debug_module(char *mod_name, int type, char *share_name,
32 char *flags, int hash, int hash2);
33
34#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
35extern int unregister_dynamic_debug_module(char *mod_name);
36extern int __dynamic_dbg_enabled_helper(char *modname, int type,
37 int value, int hash);
38
39#define __dynamic_dbg_enabled(module, type, value, level, hash) ({ \
40 int __ret = 0; \
41 if (unlikely((dynamic_printk_enabled & (1LL << DEBUG_HASH)) && \
42 (dynamic_printk_enabled2 & (1LL << DEBUG_HASH2)))) \
43 __ret = __dynamic_dbg_enabled_helper(module, type, \
44 value, hash);\
45 __ret; })
46
47#define dynamic_pr_debug(fmt, ...) do { \
48 static char mod_name[] \
49 __attribute__((section("__verbose_strings"))) \
50 = KBUILD_MODNAME; \
51 static struct mod_debug descriptor \
52 __used \
53 __attribute__((section("__verbose"), aligned(8))) = \
54 { mod_name, mod_name, NULL, TYPE_BOOLEAN, DEBUG_HASH, DEBUG_HASH2 };\
55 if (__dynamic_dbg_enabled(KBUILD_MODNAME, TYPE_BOOLEAN, \
56 0, 0, DEBUG_HASH)) \
57 printk(KERN_DEBUG KBUILD_MODNAME ":" fmt, \
58 ##__VA_ARGS__); \
59 } while (0)
60
61#define dynamic_dev_dbg(dev, format, ...) do { \
62 static char mod_name[] \
63 __attribute__((section("__verbose_strings"))) \
64 = KBUILD_MODNAME; \
65 static struct mod_debug descriptor \
66 __used \
67 __attribute__((section("__verbose"), aligned(8))) = \
68 { mod_name, mod_name, NULL, TYPE_BOOLEAN, DEBUG_HASH, DEBUG_HASH2 };\
69 if (__dynamic_dbg_enabled(KBUILD_MODNAME, TYPE_BOOLEAN, \
70 0, 0, DEBUG_HASH)) \
71 dev_printk(KERN_DEBUG, dev, \
72 KBUILD_MODNAME ": " format, \
73 ##__VA_ARGS__); \
74 } while (0)
75
76#else
77
78static inline int unregister_dynamic_debug_module(const char *mod_name)
79{
80 return 0;
81}
82static inline int __dynamic_dbg_enabled_helper(char *modname, int type,
83 int value, int hash)
84{
85 return 0;
86}
87
88#define __dynamic_dbg_enabled(module, type, value, level, hash) ({ 0; })
89#define dynamic_pr_debug(fmt, ...) do { } while (0)
90#define dynamic_dev_dbg(dev, format, ...) do { } while (0)
91#endif
92
93#endif
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 639624b55fbe..92f6f634e3e6 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -112,6 +112,7 @@ extern struct request *elv_latter_request(struct request_queue *, struct request
112extern int elv_register_queue(struct request_queue *q); 112extern int elv_register_queue(struct request_queue *q);
113extern void elv_unregister_queue(struct request_queue *q); 113extern void elv_unregister_queue(struct request_queue *q);
114extern int elv_may_queue(struct request_queue *, int); 114extern int elv_may_queue(struct request_queue *, int);
115extern void elv_abort_queue(struct request_queue *);
115extern void elv_completed_request(struct request_queue *, struct request *); 116extern void elv_completed_request(struct request_queue *, struct request *);
116extern int elv_set_request(struct request_queue *, struct request *, gfp_t); 117extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
117extern void elv_put_request(struct request_queue *, struct request *); 118extern void elv_put_request(struct request_queue *, struct request *);
@@ -173,15 +174,15 @@ enum {
173#define rb_entry_rq(node) rb_entry((node), struct request, rb_node) 174#define rb_entry_rq(node) rb_entry((node), struct request, rb_node)
174 175
175/* 176/*
176 * Hack to reuse the donelist list_head as the fifo time holder while 177 * Hack to reuse the csd.list list_head as the fifo time holder while
177 * the request is in the io scheduler. Saves an unsigned long in rq. 178 * the request is in the io scheduler. Saves an unsigned long in rq.
178 */ 179 */
179#define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next) 180#define rq_fifo_time(rq) ((unsigned long) (rq)->csd.list.next)
180#define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp)) 181#define rq_set_fifo_time(rq,exp) ((rq)->csd.list.next = (void *) (exp))
181#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) 182#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
182#define rq_fifo_clear(rq) do { \ 183#define rq_fifo_clear(rq) do { \
183 list_del_init(&(rq)->queuelist); \ 184 list_del_init(&(rq)->queuelist); \
184 INIT_LIST_HEAD(&(rq)->donelist); \ 185 INIT_LIST_HEAD(&(rq)->csd.list); \
185 } while (0) 186 } while (0)
186 187
187/* 188/*
diff --git a/include/linux/elf.h b/include/linux/elf.h
index edc3dac3f02f..0b61ca41a044 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -360,6 +360,7 @@ typedef struct elf64_shdr {
360#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ 360#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
361#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ 361#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
362#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ 362#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
363#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
363 364
364 365
365/* Note header in a PT_NOTE section */ 366/* Note header in a PT_NOTE section */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 2efe7b863cff..78c775a83f7c 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -47,7 +47,7 @@
47#ifdef EXT2FS_DEBUG 47#ifdef EXT2FS_DEBUG
48# define ext2_debug(f, a...) { \ 48# define ext2_debug(f, a...) { \
49 printk ("EXT2-fs DEBUG (%s, %d): %s:", \ 49 printk ("EXT2-fs DEBUG (%s, %d): %s:", \
50 __FILE__, __LINE__, __FUNCTION__); \ 50 __FILE__, __LINE__, __func__); \
51 printk (f, ## a); \ 51 printk (f, ## a); \
52 } 52 }
53#else 53#else
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 80171ee89a22..159d9b476cd7 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -43,7 +43,7 @@
43#define ext3_debug(f, a...) \ 43#define ext3_debug(f, a...) \
44 do { \ 44 do { \
45 printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \ 45 printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \
46 __FILE__, __LINE__, __FUNCTION__); \ 46 __FILE__, __LINE__, __func__); \
47 printk (KERN_DEBUG f, ## a); \ 47 printk (KERN_DEBUG f, ## a); \
48 } while (0) 48 } while (0)
49#else 49#else
@@ -837,6 +837,8 @@ extern void ext3_truncate (struct inode *);
837extern void ext3_set_inode_flags(struct inode *); 837extern void ext3_set_inode_flags(struct inode *);
838extern void ext3_get_inode_flags(struct ext3_inode_info *); 838extern void ext3_get_inode_flags(struct ext3_inode_info *);
839extern void ext3_set_aops(struct inode *inode); 839extern void ext3_set_aops(struct inode *inode);
840extern int ext3_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
841 u64 start, u64 len);
840 842
841/* ioctl.c */ 843/* ioctl.c */
842extern int ext3_ioctl (struct inode *, struct file *, unsigned int, 844extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
@@ -869,7 +871,7 @@ extern void ext3_update_dynamic_rev (struct super_block *sb);
869#define ext3_std_error(sb, errno) \ 871#define ext3_std_error(sb, errno) \
870do { \ 872do { \
871 if ((errno)) \ 873 if ((errno)) \
872 __ext3_std_error((sb), __FUNCTION__, (errno)); \ 874 __ext3_std_error((sb), __func__, (errno)); \
873} while (0) 875} while (0)
874 876
875/* 877/*
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h
index 8c43b13a02fe..cf82d519be40 100644
--- a/include/linux/ext3_jbd.h
+++ b/include/linux/ext3_jbd.h
@@ -137,17 +137,17 @@ int __ext3_journal_dirty_metadata(const char *where,
137 handle_t *handle, struct buffer_head *bh); 137 handle_t *handle, struct buffer_head *bh);
138 138
139#define ext3_journal_get_undo_access(handle, bh) \ 139#define ext3_journal_get_undo_access(handle, bh) \
140 __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh)) 140 __ext3_journal_get_undo_access(__func__, (handle), (bh))
141#define ext3_journal_get_write_access(handle, bh) \ 141#define ext3_journal_get_write_access(handle, bh) \
142 __ext3_journal_get_write_access(__FUNCTION__, (handle), (bh)) 142 __ext3_journal_get_write_access(__func__, (handle), (bh))
143#define ext3_journal_revoke(handle, blocknr, bh) \ 143#define ext3_journal_revoke(handle, blocknr, bh) \
144 __ext3_journal_revoke(__FUNCTION__, (handle), (blocknr), (bh)) 144 __ext3_journal_revoke(__func__, (handle), (blocknr), (bh))
145#define ext3_journal_get_create_access(handle, bh) \ 145#define ext3_journal_get_create_access(handle, bh) \
146 __ext3_journal_get_create_access(__FUNCTION__, (handle), (bh)) 146 __ext3_journal_get_create_access(__func__, (handle), (bh))
147#define ext3_journal_dirty_metadata(handle, bh) \ 147#define ext3_journal_dirty_metadata(handle, bh) \
148 __ext3_journal_dirty_metadata(__FUNCTION__, (handle), (bh)) 148 __ext3_journal_dirty_metadata(__func__, (handle), (bh))
149#define ext3_journal_forget(handle, bh) \ 149#define ext3_journal_forget(handle, bh) \
150 __ext3_journal_forget(__FUNCTION__, (handle), (bh)) 150 __ext3_journal_forget(__func__, (handle), (bh))
151 151
152int ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh); 152int ext3_journal_dirty_data(handle_t *handle, struct buffer_head *bh);
153 153
@@ -160,7 +160,7 @@ static inline handle_t *ext3_journal_start(struct inode *inode, int nblocks)
160} 160}
161 161
162#define ext3_journal_stop(handle) \ 162#define ext3_journal_stop(handle) \
163 __ext3_journal_stop(__FUNCTION__, (handle)) 163 __ext3_journal_stop(__func__, (handle))
164 164
165static inline handle_t *ext3_journal_current_handle(void) 165static inline handle_t *ext3_journal_current_handle(void)
166{ 166{
diff --git a/include/linux/fd.h b/include/linux/fd.h
index b6bd41d2b460..f5d194af07a8 100644
--- a/include/linux/fd.h
+++ b/include/linux/fd.h
@@ -15,10 +15,16 @@ struct floppy_struct {
15 sect, /* sectors per track */ 15 sect, /* sectors per track */
16 head, /* nr of heads */ 16 head, /* nr of heads */
17 track, /* nr of tracks */ 17 track, /* nr of tracks */
18 stretch; /* !=0 means double track steps */ 18 stretch; /* bit 0 !=0 means double track steps */
19 /* bit 1 != 0 means swap sides */
20 /* bits 2..9 give the first sector */
21 /* number (the LSB is flipped) */
19#define FD_STRETCH 1 22#define FD_STRETCH 1
20#define FD_SWAPSIDES 2 23#define FD_SWAPSIDES 2
21#define FD_ZEROBASED 4 24#define FD_ZEROBASED 4
25#define FD_SECTBASEMASK 0x3FC
26#define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
27#define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
22 28
23 unsigned char gap, /* gap1 size */ 29 unsigned char gap, /* gap1 size */
24 30
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h
new file mode 100644
index 000000000000..671decbd2aeb
--- /dev/null
+++ b/include/linux/fiemap.h
@@ -0,0 +1,64 @@
1/*
2 * FS_IOC_FIEMAP ioctl infrastructure.
3 *
4 * Some portions copyright (C) 2007 Cluster File Systems, Inc
5 *
6 * Authors: Mark Fasheh <mfasheh@suse.com>
7 * Kalpak Shah <kalpak.shah@sun.com>
8 * Andreas Dilger <adilger@sun.com>
9 */
10
11#ifndef _LINUX_FIEMAP_H
12#define _LINUX_FIEMAP_H
13
14struct fiemap_extent {
15 __u64 fe_logical; /* logical offset in bytes for the start of
16 * the extent from the beginning of the file */
17 __u64 fe_physical; /* physical offset in bytes for the start
18 * of the extent from the beginning of the disk */
19 __u64 fe_length; /* length in bytes for this extent */
20 __u64 fe_reserved64[2];
21 __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
22 __u32 fe_reserved[3];
23};
24
25struct fiemap {
26 __u64 fm_start; /* logical offset (inclusive) at
27 * which to start mapping (in) */
28 __u64 fm_length; /* logical length of mapping which
29 * userspace wants (in) */
30 __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
31 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
32 __u32 fm_extent_count; /* size of fm_extents array (in) */
33 __u32 fm_reserved;
34 struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
35};
36
37#define FIEMAP_MAX_OFFSET (~0ULL)
38
39#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
40#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
41
42#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
43
44#define FIEMAP_EXTENT_LAST 0x00000001 /* Last extent in file. */
45#define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */
46#define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending.
47 * Sets EXTENT_UNKNOWN. */
48#define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data can not be read
49 * while fs is unmounted */
50#define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Data is encrypted by fs.
51 * Sets EXTENT_NO_BYPASS. */
52#define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Extent offsets may not be
53 * block aligned. */
54#define FIEMAP_EXTENT_DATA_INLINE 0x00000200 /* Data mixed with metadata.
55 * Sets EXTENT_NOT_ALIGNED.*/
56#define FIEMAP_EXTENT_DATA_TAIL 0x00000400 /* Multiple files in block.
57 * Sets EXTENT_NOT_ALIGNED.*/
58#define FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but
59 * no data (i.e. zero). */
60#define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively
61 * support extents. Result
62 * merged for efficiency. */
63
64#endif /* _LINUX_FIEMAP_H */
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 0f0e271f97fa..4d078e99c017 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -154,8 +154,13 @@ struct fw_cdev_event_iso_interrupt {
154 * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST 154 * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST
155 * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT 155 * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT
156 * 156 *
157 * Convenience union for userspace use. Events could be read(2) into a char 157 * Convenience union for userspace use. Events could be read(2) into an
158 * buffer and then cast to this union for further processing. 158 * appropriately aligned char buffer and then cast to this union for further
159 * processing. Note that for a request, response or iso_interrupt event,
160 * the data[] or header[] may make the size of the full event larger than
161 * sizeof(union fw_cdev_event). Also note that if you attempt to read(2)
162 * an event into a buffer that is not large enough for it, the data that does
163 * not fit will be discarded so that the next read(2) will return a new event.
159 */ 164 */
160union fw_cdev_event { 165union fw_cdev_event {
161 struct fw_cdev_event_common common; 166 struct fw_cdev_event_common common;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 580b513668fe..a6a625be13fc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -86,7 +86,9 @@ extern int dir_notify_enable;
86#define READ_META (READ | (1 << BIO_RW_META)) 86#define READ_META (READ | (1 << BIO_RW_META))
87#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) 87#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
88#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) 88#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC))
89#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) 89#define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER))
90#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
91#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
90 92
91#define SEL_IN 1 93#define SEL_IN 1
92#define SEL_OUT 2 94#define SEL_OUT 2
@@ -222,6 +224,7 @@ extern int dir_notify_enable;
222#define BLKTRACESTART _IO(0x12,116) 224#define BLKTRACESTART _IO(0x12,116)
223#define BLKTRACESTOP _IO(0x12,117) 225#define BLKTRACESTOP _IO(0x12,117)
224#define BLKTRACETEARDOWN _IO(0x12,118) 226#define BLKTRACETEARDOWN _IO(0x12,118)
227#define BLKDISCARD _IO(0x12,119)
225 228
226#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 229#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
227#define FIBMAP _IO(0x00,1) /* bmap access */ 230#define FIBMAP _IO(0x00,1) /* bmap access */
@@ -231,6 +234,7 @@ extern int dir_notify_enable;
231#define FS_IOC_SETFLAGS _IOW('f', 2, long) 234#define FS_IOC_SETFLAGS _IOW('f', 2, long)
232#define FS_IOC_GETVERSION _IOR('v', 1, long) 235#define FS_IOC_GETVERSION _IOR('v', 1, long)
233#define FS_IOC_SETVERSION _IOW('v', 2, long) 236#define FS_IOC_SETVERSION _IOW('v', 2, long)
237#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
234#define FS_IOC32_GETFLAGS _IOR('f', 1, int) 238#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
235#define FS_IOC32_SETFLAGS _IOW('f', 2, int) 239#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
236#define FS_IOC32_GETVERSION _IOR('v', 1, int) 240#define FS_IOC32_GETVERSION _IOR('v', 1, int)
@@ -291,6 +295,7 @@ extern int dir_notify_enable;
291#include <linux/mutex.h> 295#include <linux/mutex.h>
292#include <linux/capability.h> 296#include <linux/capability.h>
293#include <linux/semaphore.h> 297#include <linux/semaphore.h>
298#include <linux/fiemap.h>
294 299
295#include <asm/atomic.h> 300#include <asm/atomic.h>
296#include <asm/byteorder.h> 301#include <asm/byteorder.h>
@@ -942,6 +947,14 @@ struct lock_manager_operations {
942 int (*fl_change)(struct file_lock **, int); 947 int (*fl_change)(struct file_lock **, int);
943}; 948};
944 949
950struct lock_manager {
951 struct list_head list;
952};
953
954void locks_start_grace(struct lock_manager *);
955void locks_end_grace(struct lock_manager *);
956int locks_in_grace(void);
957
945/* that will die - we need it for nfs_lock_info */ 958/* that will die - we need it for nfs_lock_info */
946#include <linux/nfs_fs_i.h> 959#include <linux/nfs_fs_i.h>
947 960
@@ -983,6 +996,13 @@ struct file_lock {
983 996
984#include <linux/fcntl.h> 997#include <linux/fcntl.h>
985 998
999extern void send_sigio(struct fown_struct *fown, int fd, int band);
1000
1001/* fs/sync.c */
1002extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
1003 loff_t endbyte, unsigned int flags);
1004
1005#ifdef CONFIG_FILE_LOCKING
986extern int fcntl_getlk(struct file *, struct flock __user *); 1006extern int fcntl_getlk(struct file *, struct flock __user *);
987extern int fcntl_setlk(unsigned int, struct file *, unsigned int, 1007extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
988 struct flock __user *); 1008 struct flock __user *);
@@ -993,14 +1013,9 @@ extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
993 struct flock64 __user *); 1013 struct flock64 __user *);
994#endif 1014#endif
995 1015
996extern void send_sigio(struct fown_struct *fown, int fd, int band);
997extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); 1016extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
998extern int fcntl_getlease(struct file *filp); 1017extern int fcntl_getlease(struct file *filp);
999 1018
1000/* fs/sync.c */
1001extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
1002 loff_t endbyte, unsigned int flags);
1003
1004/* fs/locks.c */ 1019/* fs/locks.c */
1005extern void locks_init_lock(struct file_lock *); 1020extern void locks_init_lock(struct file_lock *);
1006extern void locks_copy_lock(struct file_lock *, struct file_lock *); 1021extern void locks_copy_lock(struct file_lock *, struct file_lock *);
@@ -1023,6 +1038,37 @@ extern int lease_modify(struct file_lock **, int);
1023extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 1038extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
1024extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 1039extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1025extern struct seq_operations locks_seq_operations; 1040extern struct seq_operations locks_seq_operations;
1041#else /* !CONFIG_FILE_LOCKING */
1042#define fcntl_getlk(a, b) ({ -EINVAL; })
1043#define fcntl_setlk(a, b, c, d) ({ -EACCES; })
1044#if BITS_PER_LONG == 32
1045#define fcntl_getlk64(a, b) ({ -EINVAL; })
1046#define fcntl_setlk64(a, b, c, d) ({ -EACCES; })
1047#endif
1048#define fcntl_setlease(a, b, c) ({ 0; })
1049#define fcntl_getlease(a) ({ 0; })
1050#define locks_init_lock(a) ({ })
1051#define __locks_copy_lock(a, b) ({ })
1052#define locks_copy_lock(a, b) ({ })
1053#define locks_remove_posix(a, b) ({ })
1054#define locks_remove_flock(a) ({ })
1055#define posix_test_lock(a, b) ({ 0; })
1056#define posix_lock_file(a, b, c) ({ -ENOLCK; })
1057#define posix_lock_file_wait(a, b) ({ -ENOLCK; })
1058#define posix_unblock_lock(a, b) (-ENOENT)
1059#define vfs_test_lock(a, b) ({ 0; })
1060#define vfs_lock_file(a, b, c, d) (-ENOLCK)
1061#define vfs_cancel_lock(a, b) ({ 0; })
1062#define flock_lock_file_wait(a, b) ({ -ENOLCK; })
1063#define __break_lease(a, b) ({ 0; })
1064#define lease_get_mtime(a, b) ({ })
1065#define generic_setlease(a, b, c) ({ -EINVAL; })
1066#define vfs_setlease(a, b, c) ({ -EINVAL; })
1067#define lease_modify(a, b) ({ -EINVAL; })
1068#define lock_may_read(a, b, c) ({ 1; })
1069#define lock_may_write(a, b, c) ({ 1; })
1070#endif /* !CONFIG_FILE_LOCKING */
1071
1026 1072
1027struct fasync_struct { 1073struct fasync_struct {
1028 int magic; 1074 int magic;
@@ -1179,6 +1225,20 @@ extern void dentry_unhash(struct dentry *dentry);
1179extern int file_permission(struct file *, int); 1225extern int file_permission(struct file *, int);
1180 1226
1181/* 1227/*
1228 * VFS FS_IOC_FIEMAP helper definitions.
1229 */
1230struct fiemap_extent_info {
1231 unsigned int fi_flags; /* Flags as passed from user */
1232 unsigned int fi_extents_mapped; /* Number of mapped extents */
1233 unsigned int fi_extents_max; /* Size of fiemap_extent array */
1234 struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent
1235 * array */
1236};
1237int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
1238 u64 phys, u64 len, u32 flags);
1239int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
1240
1241/*
1182 * File types 1242 * File types
1183 * 1243 *
1184 * NOTE! These match bits 12..15 of stat.st_mode 1244 * NOTE! These match bits 12..15 of stat.st_mode
@@ -1287,6 +1347,8 @@ struct inode_operations {
1287 void (*truncate_range)(struct inode *, loff_t, loff_t); 1347 void (*truncate_range)(struct inode *, loff_t, loff_t);
1288 long (*fallocate)(struct inode *inode, int mode, loff_t offset, 1348 long (*fallocate)(struct inode *inode, int mode, loff_t offset,
1289 loff_t len); 1349 loff_t len);
1350 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
1351 u64 len);
1290}; 1352};
1291 1353
1292struct seq_file; 1354struct seq_file;
@@ -1554,9 +1616,12 @@ extern int vfs_statfs(struct dentry *, struct kstatfs *);
1554/* /sys/fs */ 1616/* /sys/fs */
1555extern struct kobject *fs_kobj; 1617extern struct kobject *fs_kobj;
1556 1618
1619extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1620
1557#define FLOCK_VERIFY_READ 1 1621#define FLOCK_VERIFY_READ 1
1558#define FLOCK_VERIFY_WRITE 2 1622#define FLOCK_VERIFY_WRITE 2
1559 1623
1624#ifdef CONFIG_FILE_LOCKING
1560extern int locks_mandatory_locked(struct inode *); 1625extern int locks_mandatory_locked(struct inode *);
1561extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); 1626extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
1562 1627
@@ -1587,8 +1652,6 @@ static inline int locks_verify_locked(struct inode *inode)
1587 return 0; 1652 return 0;
1588} 1653}
1589 1654
1590extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1591
1592static inline int locks_verify_truncate(struct inode *inode, 1655static inline int locks_verify_truncate(struct inode *inode,
1593 struct file *filp, 1656 struct file *filp,
1594 loff_t size) 1657 loff_t size)
@@ -1609,6 +1672,15 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1609 return __break_lease(inode, mode); 1672 return __break_lease(inode, mode);
1610 return 0; 1673 return 0;
1611} 1674}
1675#else /* !CONFIG_FILE_LOCKING */
1676#define locks_mandatory_locked(a) ({ 0; })
1677#define locks_mandatory_area(a, b, c, d, e) ({ 0; })
1678#define __mandatory_lock(a) ({ 0; })
1679#define mandatory_lock(a) ({ 0; })
1680#define locks_verify_locked(a) ({ 0; })
1681#define locks_verify_truncate(a, b, c) ({ 0; })
1682#define break_lease(a, b) ({ 0; })
1683#endif /* CONFIG_FILE_LOCKING */
1612 1684
1613/* fs/open.c */ 1685/* fs/open.c */
1614 1686
@@ -1682,6 +1754,7 @@ extern void chrdev_show(struct seq_file *,off_t);
1682 1754
1683/* fs/block_dev.c */ 1755/* fs/block_dev.c */
1684#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ 1756#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
1757#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */
1685 1758
1686#ifdef CONFIG_BLOCK 1759#ifdef CONFIG_BLOCK
1687#define BLKDEV_MAJOR_HASH_SIZE 255 1760#define BLKDEV_MAJOR_HASH_SIZE 255
@@ -1718,6 +1791,9 @@ extern int fs_may_remount_ro(struct super_block *);
1718 */ 1791 */
1719#define bio_data_dir(bio) ((bio)->bi_rw & 1) 1792#define bio_data_dir(bio) ((bio)->bi_rw & 1)
1720 1793
1794extern void check_disk_size_change(struct gendisk *disk,
1795 struct block_device *bdev);
1796extern int revalidate_disk(struct gendisk *);
1721extern int check_disk_change(struct block_device *); 1797extern int check_disk_change(struct block_device *);
1722extern int __invalidate_device(struct block_device *); 1798extern int __invalidate_device(struct block_device *);
1723extern int invalidate_partition(struct gendisk *, int); 1799extern int invalidate_partition(struct gendisk *, int);
@@ -1980,6 +2056,9 @@ extern int vfs_fstat(unsigned int, struct kstat *);
1980 2056
1981extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, 2057extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
1982 unsigned long arg); 2058 unsigned long arg);
2059extern int generic_block_fiemap(struct inode *inode,
2060 struct fiemap_extent_info *fieinfo, u64 start,
2061 u64 len, get_block_t *get_block);
1983 2062
1984extern void get_filesystem(struct file_system_type *fs); 2063extern void get_filesystem(struct file_system_type *fs);
1985extern void put_filesystem(struct file_system_type *fs); 2064extern void put_filesystem(struct file_system_type *fs);
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h
index 809bb9ffc788..36b61ff39277 100644
--- a/include/linux/fs_uart_pd.h
+++ b/include/linux/fs_uart_pd.h
@@ -12,7 +12,6 @@
12#ifndef FS_UART_PD_H 12#ifndef FS_UART_PD_H
13#define FS_UART_PD_H 13#define FS_UART_PD_H
14 14
15#include <linux/version.h>
16#include <asm/types.h> 15#include <asm/types.h>
17 16
18enum fs_uart_id { 17enum fs_uart_id {
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index f64e29c0ef3f..0cd825f7363a 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -146,10 +146,11 @@ static inline void gameport_unpin_driver(struct gameport *gameport)
146 mutex_unlock(&gameport->drv_mutex); 146 mutex_unlock(&gameport->drv_mutex);
147} 147}
148 148
149void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); 149int __gameport_register_driver(struct gameport_driver *drv,
150static inline void gameport_register_driver(struct gameport_driver *drv) 150 struct module *owner, const char *mod_name);
151static inline int __must_check gameport_register_driver(struct gameport_driver *drv)
151{ 152{
152 __gameport_register_driver(drv, THIS_MODULE); 153 return __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME);
153} 154}
154 155
155void gameport_unregister_driver(struct gameport_driver *drv); 156void gameport_unregister_driver(struct gameport_driver *drv);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 118216f1bd3c..206cdf96c3a7 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -11,12 +11,15 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/kdev_t.h> 13#include <linux/kdev_t.h>
14#include <linux/rcupdate.h>
14 15
15#ifdef CONFIG_BLOCK 16#ifdef CONFIG_BLOCK
16 17
17#define kobj_to_dev(k) container_of(k, struct device, kobj) 18#define kobj_to_dev(k) container_of((k), struct device, kobj)
18#define dev_to_disk(device) container_of(device, struct gendisk, dev) 19#define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev)
19#define dev_to_part(device) container_of(device, struct hd_struct, dev) 20#define dev_to_part(device) container_of((device), struct hd_struct, __dev)
21#define disk_to_dev(disk) (&(disk)->part0.__dev)
22#define part_to_dev(part) (&((part)->__dev))
20 23
21extern struct device_type part_type; 24extern struct device_type part_type;
22extern struct kobject *block_depr; 25extern struct kobject *block_depr;
@@ -55,6 +58,9 @@ enum {
55 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ 58 UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */
56}; 59};
57 60
61#define DISK_MAX_PARTS 256
62#define DISK_NAME_LEN 32
63
58#include <linux/major.h> 64#include <linux/major.h>
59#include <linux/device.h> 65#include <linux/device.h>
60#include <linux/smp.h> 66#include <linux/smp.h>
@@ -87,7 +93,7 @@ struct disk_stats {
87struct hd_struct { 93struct hd_struct {
88 sector_t start_sect; 94 sector_t start_sect;
89 sector_t nr_sects; 95 sector_t nr_sects;
90 struct device dev; 96 struct device __dev;
91 struct kobject *holder_dir; 97 struct kobject *holder_dir;
92 int policy, partno; 98 int policy, partno;
93#ifdef CONFIG_FAIL_MAKE_REQUEST 99#ifdef CONFIG_FAIL_MAKE_REQUEST
@@ -100,6 +106,7 @@ struct hd_struct {
100#else 106#else
101 struct disk_stats dkstats; 107 struct disk_stats dkstats;
102#endif 108#endif
109 struct rcu_head rcu_head;
103}; 110};
104 111
105#define GENHD_FL_REMOVABLE 1 112#define GENHD_FL_REMOVABLE 1
@@ -108,7 +115,7 @@ struct hd_struct {
108#define GENHD_FL_CD 8 115#define GENHD_FL_CD 8
109#define GENHD_FL_UP 16 116#define GENHD_FL_UP 16
110#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 117#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
111#define GENHD_FL_FAIL 64 118#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */
112 119
113#define BLK_SCSI_MAX_CMDS (256) 120#define BLK_SCSI_MAX_CMDS (256)
114#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) 121#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
@@ -119,99 +126,137 @@ struct blk_scsi_cmd_filter {
119 struct kobject kobj; 126 struct kobject kobj;
120}; 127};
121 128
129struct disk_part_tbl {
130 struct rcu_head rcu_head;
131 int len;
132 struct hd_struct *part[];
133};
134
122struct gendisk { 135struct gendisk {
136 /* major, first_minor and minors are input parameters only,
137 * don't use directly. Use disk_devt() and disk_max_parts().
138 */
123 int major; /* major number of driver */ 139 int major; /* major number of driver */
124 int first_minor; 140 int first_minor;
125 int minors; /* maximum number of minors, =1 for 141 int minors; /* maximum number of minors, =1 for
126 * disks that can't be partitioned. */ 142 * disks that can't be partitioned. */
127 char disk_name[32]; /* name of major driver */ 143
128 struct hd_struct **part; /* [indexed by minor] */ 144 char disk_name[DISK_NAME_LEN]; /* name of major driver */
145
146 /* Array of pointers to partitions indexed by partno.
147 * Protected with matching bdev lock but stat and other
148 * non-critical accesses use RCU. Always access through
149 * helpers.
150 */
151 struct disk_part_tbl *part_tbl;
152 struct hd_struct part0;
153
129 struct block_device_operations *fops; 154 struct block_device_operations *fops;
130 struct request_queue *queue; 155 struct request_queue *queue;
131 struct blk_scsi_cmd_filter cmd_filter;
132 void *private_data; 156 void *private_data;
133 sector_t capacity;
134 157
135 int flags; 158 int flags;
136 struct device *driverfs_dev; // FIXME: remove 159 struct device *driverfs_dev; // FIXME: remove
137 struct device dev;
138 struct kobject *holder_dir;
139 struct kobject *slave_dir; 160 struct kobject *slave_dir;
140 161
141 struct timer_rand_state *random; 162 struct timer_rand_state *random;
142 int policy;
143 163
144 atomic_t sync_io; /* RAID */ 164 atomic_t sync_io; /* RAID */
145 unsigned long stamp;
146 int in_flight;
147#ifdef CONFIG_SMP
148 struct disk_stats *dkstats;
149#else
150 struct disk_stats dkstats;
151#endif
152 struct work_struct async_notify; 165 struct work_struct async_notify;
153#ifdef CONFIG_BLK_DEV_INTEGRITY 166#ifdef CONFIG_BLK_DEV_INTEGRITY
154 struct blk_integrity *integrity; 167 struct blk_integrity *integrity;
155#endif 168#endif
169 int node_id;
156}; 170};
157 171
158/* 172static inline struct gendisk *part_to_disk(struct hd_struct *part)
159 * Macros to operate on percpu disk statistics:
160 *
161 * The __ variants should only be called in critical sections. The full
162 * variants disable/enable preemption.
163 */
164static inline struct hd_struct *get_part(struct gendisk *gendiskp,
165 sector_t sector)
166{ 173{
167 struct hd_struct *part; 174 if (likely(part)) {
168 int i; 175 if (part->partno)
169 for (i = 0; i < gendiskp->minors - 1; i++) { 176 return dev_to_disk(part_to_dev(part)->parent);
170 part = gendiskp->part[i]; 177 else
171 if (part && part->start_sect <= sector 178 return dev_to_disk(part_to_dev(part));
172 && sector < part->start_sect + part->nr_sects)
173 return part;
174 } 179 }
175 return NULL; 180 return NULL;
176} 181}
177 182
178#ifdef CONFIG_SMP 183static inline int disk_max_parts(struct gendisk *disk)
179#define __disk_stat_add(gendiskp, field, addnd) \ 184{
180 (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) 185 if (disk->flags & GENHD_FL_EXT_DEVT)
186 return DISK_MAX_PARTS;
187 return disk->minors;
188}
181 189
182#define disk_stat_read(gendiskp, field) \ 190static inline bool disk_partitionable(struct gendisk *disk)
183({ \ 191{
184 typeof(gendiskp->dkstats->field) res = 0; \ 192 return disk_max_parts(disk) > 1;
185 int i; \ 193}
186 for_each_possible_cpu(i) \
187 res += per_cpu_ptr(gendiskp->dkstats, i)->field; \
188 res; \
189})
190 194
191static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { 195static inline dev_t disk_devt(struct gendisk *disk)
192 int i; 196{
197 return disk_to_dev(disk)->devt;
198}
193 199
194 for_each_possible_cpu(i) 200static inline dev_t part_devt(struct hd_struct *part)
195 memset(per_cpu_ptr(gendiskp->dkstats, i), value, 201{
196 sizeof(struct disk_stats)); 202 return part_to_dev(part)->devt;
197} 203}
198 204
199#define __part_stat_add(part, field, addnd) \ 205extern struct hd_struct *disk_get_part(struct gendisk *disk, int partno);
200 (per_cpu_ptr(part->dkstats, smp_processor_id())->field += addnd)
201 206
202#define __all_stat_add(gendiskp, part, field, addnd, sector) \ 207static inline void disk_put_part(struct hd_struct *part)
203({ \ 208{
204 if (part) \ 209 if (likely(part))
205 __part_stat_add(part, field, addnd); \ 210 put_device(part_to_dev(part));
206 __disk_stat_add(gendiskp, field, addnd); \ 211}
207}) 212
213/*
214 * Smarter partition iterator without context limits.
215 */
216#define DISK_PITER_REVERSE (1 << 0) /* iterate in the reverse direction */
217#define DISK_PITER_INCL_EMPTY (1 << 1) /* include 0-sized parts */
218#define DISK_PITER_INCL_PART0 (1 << 2) /* include partition 0 */
219
220struct disk_part_iter {
221 struct gendisk *disk;
222 struct hd_struct *part;
223 int idx;
224 unsigned int flags;
225};
226
227extern void disk_part_iter_init(struct disk_part_iter *piter,
228 struct gendisk *disk, unsigned int flags);
229extern struct hd_struct *disk_part_iter_next(struct disk_part_iter *piter);
230extern void disk_part_iter_exit(struct disk_part_iter *piter);
231
232extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk,
233 sector_t sector);
234
235/*
236 * Macros to operate on percpu disk statistics:
237 *
238 * {disk|part|all}_stat_{add|sub|inc|dec}() modify the stat counters
239 * and should be called between disk_stat_lock() and
240 * disk_stat_unlock().
241 *
242 * part_stat_read() can be called at any time.
243 *
244 * part_stat_{add|set_all}() and {init|free}_part_stats are for
245 * internal use only.
246 */
247#ifdef CONFIG_SMP
248#define part_stat_lock() ({ rcu_read_lock(); get_cpu(); })
249#define part_stat_unlock() do { put_cpu(); rcu_read_unlock(); } while (0)
250
251#define __part_stat_add(cpu, part, field, addnd) \
252 (per_cpu_ptr((part)->dkstats, (cpu))->field += (addnd))
208 253
209#define part_stat_read(part, field) \ 254#define part_stat_read(part, field) \
210({ \ 255({ \
211 typeof(part->dkstats->field) res = 0; \ 256 typeof((part)->dkstats->field) res = 0; \
212 int i; \ 257 int i; \
213 for_each_possible_cpu(i) \ 258 for_each_possible_cpu(i) \
214 res += per_cpu_ptr(part->dkstats, i)->field; \ 259 res += per_cpu_ptr((part)->dkstats, i)->field; \
215 res; \ 260 res; \
216}) 261})
217 262
@@ -223,171 +268,107 @@ static inline void part_stat_set_all(struct hd_struct *part, int value)
223 memset(per_cpu_ptr(part->dkstats, i), value, 268 memset(per_cpu_ptr(part->dkstats, i), value,
224 sizeof(struct disk_stats)); 269 sizeof(struct disk_stats));
225} 270}
226
227#else /* !CONFIG_SMP */
228#define __disk_stat_add(gendiskp, field, addnd) \
229 (gendiskp->dkstats.field += addnd)
230#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field)
231 271
232static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) 272static inline int init_part_stats(struct hd_struct *part)
233{ 273{
234 memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); 274 part->dkstats = alloc_percpu(struct disk_stats);
275 if (!part->dkstats)
276 return 0;
277 return 1;
235} 278}
236 279
237#define __part_stat_add(part, field, addnd) \ 280static inline void free_part_stats(struct hd_struct *part)
238 (part->dkstats.field += addnd)
239
240#define __all_stat_add(gendiskp, part, field, addnd, sector) \
241({ \
242 if (part) \
243 part->dkstats.field += addnd; \
244 __disk_stat_add(gendiskp, field, addnd); \
245})
246
247#define part_stat_read(part, field) (part->dkstats.field)
248
249static inline void part_stat_set_all(struct hd_struct *part, int value)
250{ 281{
251 memset(&part->dkstats, value, sizeof(struct disk_stats)); 282 free_percpu(part->dkstats);
252} 283}
253 284
254#endif /* CONFIG_SMP */ 285#else /* !CONFIG_SMP */
286#define part_stat_lock() ({ rcu_read_lock(); 0; })
287#define part_stat_unlock() rcu_read_unlock()
255 288
256#define disk_stat_add(gendiskp, field, addnd) \ 289#define __part_stat_add(cpu, part, field, addnd) \
257 do { \ 290 ((part)->dkstats.field += addnd)
258 preempt_disable(); \ 291
259 __disk_stat_add(gendiskp, field, addnd); \ 292#define part_stat_read(part, field) ((part)->dkstats.field)
260 preempt_enable(); \
261 } while (0)
262
263#define __disk_stat_dec(gendiskp, field) __disk_stat_add(gendiskp, field, -1)
264#define disk_stat_dec(gendiskp, field) disk_stat_add(gendiskp, field, -1)
265
266#define __disk_stat_inc(gendiskp, field) __disk_stat_add(gendiskp, field, 1)
267#define disk_stat_inc(gendiskp, field) disk_stat_add(gendiskp, field, 1)
268
269#define __disk_stat_sub(gendiskp, field, subnd) \
270 __disk_stat_add(gendiskp, field, -subnd)
271#define disk_stat_sub(gendiskp, field, subnd) \
272 disk_stat_add(gendiskp, field, -subnd)
273
274#define part_stat_add(gendiskp, field, addnd) \
275 do { \
276 preempt_disable(); \
277 __part_stat_add(gendiskp, field, addnd);\
278 preempt_enable(); \
279 } while (0)
280
281#define __part_stat_dec(gendiskp, field) __part_stat_add(gendiskp, field, -1)
282#define part_stat_dec(gendiskp, field) part_stat_add(gendiskp, field, -1)
283
284#define __part_stat_inc(gendiskp, field) __part_stat_add(gendiskp, field, 1)
285#define part_stat_inc(gendiskp, field) part_stat_add(gendiskp, field, 1)
286
287#define __part_stat_sub(gendiskp, field, subnd) \
288 __part_stat_add(gendiskp, field, -subnd)
289#define part_stat_sub(gendiskp, field, subnd) \
290 part_stat_add(gendiskp, field, -subnd)
291
292#define all_stat_add(gendiskp, part, field, addnd, sector) \
293 do { \
294 preempt_disable(); \
295 __all_stat_add(gendiskp, part, field, addnd, sector); \
296 preempt_enable(); \
297 } while (0)
298
299#define __all_stat_dec(gendiskp, field, sector) \
300 __all_stat_add(gendiskp, field, -1, sector)
301#define all_stat_dec(gendiskp, field, sector) \
302 all_stat_add(gendiskp, field, -1, sector)
303
304#define __all_stat_inc(gendiskp, part, field, sector) \
305 __all_stat_add(gendiskp, part, field, 1, sector)
306#define all_stat_inc(gendiskp, part, field, sector) \
307 all_stat_add(gendiskp, part, field, 1, sector)
308
309#define __all_stat_sub(gendiskp, part, field, subnd, sector) \
310 __all_stat_add(gendiskp, part, field, -subnd, sector)
311#define all_stat_sub(gendiskp, part, field, subnd, sector) \
312 all_stat_add(gendiskp, part, field, -subnd, sector)
313
314/* Inlines to alloc and free disk stats in struct gendisk */
315#ifdef CONFIG_SMP
316static inline int init_disk_stats(struct gendisk *disk)
317{
318 disk->dkstats = alloc_percpu(struct disk_stats);
319 if (!disk->dkstats)
320 return 0;
321 return 1;
322}
323 293
324static inline void free_disk_stats(struct gendisk *disk) 294static inline void part_stat_set_all(struct hd_struct *part, int value)
325{ 295{
326 free_percpu(disk->dkstats); 296 memset(&part->dkstats, value, sizeof(struct disk_stats));
327} 297}
328 298
329static inline int init_part_stats(struct hd_struct *part) 299static inline int init_part_stats(struct hd_struct *part)
330{ 300{
331 part->dkstats = alloc_percpu(struct disk_stats);
332 if (!part->dkstats)
333 return 0;
334 return 1; 301 return 1;
335} 302}
336 303
337static inline void free_part_stats(struct hd_struct *part) 304static inline void free_part_stats(struct hd_struct *part)
338{ 305{
339 free_percpu(part->dkstats);
340}
341
342#else /* CONFIG_SMP */
343static inline int init_disk_stats(struct gendisk *disk)
344{
345 return 1;
346} 306}
347 307
348static inline void free_disk_stats(struct gendisk *disk) 308#endif /* CONFIG_SMP */
349{
350}
351 309
352static inline int init_part_stats(struct hd_struct *part) 310#define part_stat_add(cpu, part, field, addnd) do { \
311 __part_stat_add((cpu), (part), field, addnd); \
312 if ((part)->partno) \
313 __part_stat_add((cpu), &part_to_disk((part))->part0, \
314 field, addnd); \
315} while (0)
316
317#define part_stat_dec(cpu, gendiskp, field) \
318 part_stat_add(cpu, gendiskp, field, -1)
319#define part_stat_inc(cpu, gendiskp, field) \
320 part_stat_add(cpu, gendiskp, field, 1)
321#define part_stat_sub(cpu, gendiskp, field, subnd) \
322 part_stat_add(cpu, gendiskp, field, -subnd)
323
324static inline void part_inc_in_flight(struct hd_struct *part)
353{ 325{
354 return 1; 326 part->in_flight++;
327 if (part->partno)
328 part_to_disk(part)->part0.in_flight++;
355} 329}
356 330
357static inline void free_part_stats(struct hd_struct *part) 331static inline void part_dec_in_flight(struct hd_struct *part)
358{ 332{
333 part->in_flight--;
334 if (part->partno)
335 part_to_disk(part)->part0.in_flight--;
359} 336}
360#endif /* CONFIG_SMP */
361 337
362/* drivers/block/ll_rw_blk.c */ 338/* drivers/block/ll_rw_blk.c */
363extern void disk_round_stats(struct gendisk *disk); 339extern void part_round_stats(int cpu, struct hd_struct *part);
364extern void part_round_stats(struct hd_struct *part);
365 340
366/* drivers/block/genhd.c */ 341/* drivers/block/genhd.c */
367extern int get_blkdev_list(char *, int); 342extern int get_blkdev_list(char *, int);
368extern void add_disk(struct gendisk *disk); 343extern void add_disk(struct gendisk *disk);
369extern void del_gendisk(struct gendisk *gp); 344extern void del_gendisk(struct gendisk *gp);
370extern void unlink_gendisk(struct gendisk *gp); 345extern void unlink_gendisk(struct gendisk *gp);
371extern struct gendisk *get_gendisk(dev_t dev, int *part); 346extern struct gendisk *get_gendisk(dev_t dev, int *partno);
347extern struct block_device *bdget_disk(struct gendisk *disk, int partno);
372 348
373extern void set_device_ro(struct block_device *bdev, int flag); 349extern void set_device_ro(struct block_device *bdev, int flag);
374extern void set_disk_ro(struct gendisk *disk, int flag); 350extern void set_disk_ro(struct gendisk *disk, int flag);
375 351
352static inline int get_disk_ro(struct gendisk *disk)
353{
354 return disk->part0.policy;
355}
356
376/* drivers/char/random.c */ 357/* drivers/char/random.c */
377extern void add_disk_randomness(struct gendisk *disk); 358extern void add_disk_randomness(struct gendisk *disk);
378extern void rand_initialize_disk(struct gendisk *disk); 359extern void rand_initialize_disk(struct gendisk *disk);
379 360
380static inline sector_t get_start_sect(struct block_device *bdev) 361static inline sector_t get_start_sect(struct block_device *bdev)
381{ 362{
382 return bdev->bd_contains == bdev ? 0 : bdev->bd_part->start_sect; 363 return bdev->bd_part->start_sect;
383} 364}
384static inline sector_t get_capacity(struct gendisk *disk) 365static inline sector_t get_capacity(struct gendisk *disk)
385{ 366{
386 return disk->capacity; 367 return disk->part0.nr_sects;
387} 368}
388static inline void set_capacity(struct gendisk *disk, sector_t size) 369static inline void set_capacity(struct gendisk *disk, sector_t size)
389{ 370{
390 disk->capacity = size; 371 disk->part0.nr_sects = size;
391} 372}
392 373
393#ifdef CONFIG_SOLARIS_X86_PARTITION 374#ifdef CONFIG_SOLARIS_X86_PARTITION
@@ -537,9 +518,12 @@ struct unixware_disklabel {
537#define ADDPART_FLAG_RAID 1 518#define ADDPART_FLAG_RAID 1
538#define ADDPART_FLAG_WHOLEDISK 2 519#define ADDPART_FLAG_WHOLEDISK 2
539 520
540extern dev_t blk_lookup_devt(const char *name, int part); 521extern int blk_alloc_devt(struct hd_struct *part, dev_t *devt);
541extern char *disk_name (struct gendisk *hd, int part, char *buf); 522extern void blk_free_devt(dev_t devt);
523extern dev_t blk_lookup_devt(const char *name, int partno);
524extern char *disk_name (struct gendisk *hd, int partno, char *buf);
542 525
526extern int disk_expand_part_tbl(struct gendisk *disk, int target);
543extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); 527extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
544extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int); 528extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int);
545extern void delete_partition(struct gendisk *, int); 529extern void delete_partition(struct gendisk *, int);
@@ -556,16 +540,23 @@ extern void blk_register_region(dev_t devt, unsigned long range,
556 void *data); 540 void *data);
557extern void blk_unregister_region(dev_t devt, unsigned long range); 541extern void blk_unregister_region(dev_t devt, unsigned long range);
558 542
559static inline struct block_device *bdget_disk(struct gendisk *disk, int index) 543extern ssize_t part_size_show(struct device *dev,
560{ 544 struct device_attribute *attr, char *buf);
561 return bdget(MKDEV(disk->major, disk->first_minor) + index); 545extern ssize_t part_stat_show(struct device *dev,
562} 546 struct device_attribute *attr, char *buf);
547#ifdef CONFIG_FAIL_MAKE_REQUEST
548extern ssize_t part_fail_show(struct device *dev,
549 struct device_attribute *attr, char *buf);
550extern ssize_t part_fail_store(struct device *dev,
551 struct device_attribute *attr,
552 const char *buf, size_t count);
553#endif /* CONFIG_FAIL_MAKE_REQUEST */
563 554
564#else /* CONFIG_BLOCK */ 555#else /* CONFIG_BLOCK */
565 556
566static inline void printk_all_partitions(void) { } 557static inline void printk_all_partitions(void) { }
567 558
568static inline dev_t blk_lookup_devt(const char *name, int part) 559static inline dev_t blk_lookup_devt(const char *name, int partno)
569{ 560{
570 dev_t devt = MKDEV(0, 0); 561 dev_t devt = MKDEV(0, 0);
571 return devt; 562 return devt;
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index c3c19f926e6f..14d0df0b5749 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -118,7 +118,11 @@ struct gfs2_sb {
118 118
119 char sb_lockproto[GFS2_LOCKNAME_LEN]; 119 char sb_lockproto[GFS2_LOCKNAME_LEN];
120 char sb_locktable[GFS2_LOCKNAME_LEN]; 120 char sb_locktable[GFS2_LOCKNAME_LEN];
121 /* In gfs1, quota and license dinodes followed */ 121
122 struct gfs2_inum __pad3; /* Was quota inode in gfs1 */
123 struct gfs2_inum __pad4; /* Was licence inode in gfs1 */
124#define GFS2_HAS_UUID 1
125 __u8 sb_uuid[16]; /* The UUID, maybe 0 for backwards compat */
122}; 126};
123 127
124/* 128/*
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 730a20b83576..e10c49a5b96e 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -8,6 +8,7 @@
8 8
9#else 9#else
10 10
11#include <linux/kernel.h>
11#include <linux/types.h> 12#include <linux/types.h>
12#include <linux/errno.h> 13#include <linux/errno.h>
13 14
@@ -32,6 +33,8 @@ static inline int gpio_request(unsigned gpio, const char *label)
32 33
33static inline void gpio_free(unsigned gpio) 34static inline void gpio_free(unsigned gpio)
34{ 35{
36 might_sleep();
37
35 /* GPIO can never have been requested */ 38 /* GPIO can never have been requested */
36 WARN_ON(1); 39 WARN_ON(1);
37} 40}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index ac4e678a04ed..f13bca2dd53b 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -67,6 +67,7 @@
67#include <linux/types.h> 67#include <linux/types.h>
68#include <linux/slab.h> 68#include <linux/slab.h>
69#include <linux/list.h> 69#include <linux/list.h>
70#include <linux/mod_devicetable.h> /* hid_device_id */
70#include <linux/timer.h> 71#include <linux/timer.h>
71#include <linux/workqueue.h> 72#include <linux/workqueue.h>
72#include <linux/input.h> 73#include <linux/input.h>
@@ -246,6 +247,19 @@ struct hid_item {
246#define HID_FEATURE_REPORT 2 247#define HID_FEATURE_REPORT 2
247 248
248/* 249/*
250 * HID connect requests
251 */
252
253#define HID_CONNECT_HIDINPUT 0x01
254#define HID_CONNECT_HIDINPUT_FORCE 0x02
255#define HID_CONNECT_HIDRAW 0x04
256#define HID_CONNECT_HIDDEV 0x08
257#define HID_CONNECT_HIDDEV_FORCE 0x10
258#define HID_CONNECT_FF 0x20
259#define HID_CONNECT_DEFAULT (HID_CONNECT_HIDINPUT|HID_CONNECT_HIDRAW| \
260 HID_CONNECT_HIDDEV|HID_CONNECT_FF)
261
262/*
249 * HID device quirks. 263 * HID device quirks.
250 */ 264 */
251 265
@@ -256,48 +270,11 @@ struct hid_item {
256 270
257#define HID_QUIRK_INVERT 0x00000001 271#define HID_QUIRK_INVERT 0x00000001
258#define HID_QUIRK_NOTOUCH 0x00000002 272#define HID_QUIRK_NOTOUCH 0x00000002
259#define HID_QUIRK_IGNORE 0x00000004
260#define HID_QUIRK_NOGET 0x00000008 273#define HID_QUIRK_NOGET 0x00000008
261#define HID_QUIRK_HIDDEV 0x00000010
262#define HID_QUIRK_BADPAD 0x00000020 274#define HID_QUIRK_BADPAD 0x00000020
263#define HID_QUIRK_MULTI_INPUT 0x00000040 275#define HID_QUIRK_MULTI_INPUT 0x00000040
264#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080
265#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100
266#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200
267#define HID_QUIRK_MIGHTYMOUSE 0x00000400
268#define HID_QUIRK_APPLE_HAS_FN 0x00000800
269#define HID_QUIRK_APPLE_FN_ON 0x00001000
270#define HID_QUIRK_INVERT_HWHEEL 0x00002000
271#define HID_QUIRK_APPLE_ISO_KEYBOARD 0x00004000
272#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000
273#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 276#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
274#define HID_QUIRK_IGNORE_MOUSE 0x00020000
275#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00040000
276#define HID_QUIRK_DUPLICATE_USAGES 0x00080000
277#define HID_QUIRK_RESET_LEDS 0x00100000
278#define HID_QUIRK_HIDINPUT 0x00200000
279#define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000
280#define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000
281#define HID_QUIRK_IGNORE_HIDINPUT 0x01000000
282#define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000
283#define HID_QUIRK_HWHEEL_WHEEL_INVERT 0x04000000
284#define HID_QUIRK_MICROSOFT_KEYS 0x08000000
285#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 277#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
286#define HID_QUIRK_APPLE_NUMLOCK_EMULATION 0x20000000
287
288/*
289 * Separate quirks for runtime report descriptor fixup
290 */
291
292#define HID_QUIRK_RDESC_CYMOTION 0x00000001
293#define HID_QUIRK_RDESC_LOGITECH 0x00000002
294#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004
295#define HID_QUIRK_RDESC_PETALYNX 0x00000008
296#define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010
297#define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020
298#define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040
299#define HID_QUIRK_RDESC_MICROSOFT_RECV_1028 0x00000080
300#define HID_QUIRK_RDESC_SUNPLUS_WDESKTOP 0x00000100
301 278
302/* 279/*
303 * This is the global environment of the parser. This information is 280 * This is the global environment of the parser. This information is
@@ -411,12 +388,21 @@ struct hid_report_enum {
411struct hid_control_fifo { 388struct hid_control_fifo {
412 unsigned char dir; 389 unsigned char dir;
413 struct hid_report *report; 390 struct hid_report *report;
391 char *raw_report;
392};
393
394struct hid_output_fifo {
395 struct hid_report *report;
396 char *raw_report;
414}; 397};
415 398
416#define HID_CLAIMED_INPUT 1 399#define HID_CLAIMED_INPUT 1
417#define HID_CLAIMED_HIDDEV 2 400#define HID_CLAIMED_HIDDEV 2
418#define HID_CLAIMED_HIDRAW 4 401#define HID_CLAIMED_HIDRAW 4
419 402
403#define HID_STAT_ADDED 1
404#define HID_STAT_PARSED 2
405
420#define HID_CTRL_RUNNING 1 406#define HID_CTRL_RUNNING 1
421#define HID_OUT_RUNNING 2 407#define HID_OUT_RUNNING 2
422#define HID_IN_RUNNING 3 408#define HID_IN_RUNNING 3
@@ -431,22 +417,28 @@ struct hid_input {
431 struct input_dev *input; 417 struct input_dev *input;
432}; 418};
433 419
420struct hid_driver;
421struct hid_ll_driver;
422
434struct hid_device { /* device report descriptor */ 423struct hid_device { /* device report descriptor */
435 __u8 *rdesc; 424 __u8 *rdesc;
436 unsigned rsize; 425 unsigned rsize;
437 struct hid_collection *collection; /* List of HID collections */ 426 struct hid_collection *collection; /* List of HID collections */
438 unsigned collection_size; /* Number of allocated hid_collections */ 427 unsigned collection_size; /* Number of allocated hid_collections */
439 unsigned maxcollection; /* Number of parsed collections */ 428 unsigned maxcollection; /* Number of parsed collections */
440 unsigned maxapplication; /* Number of applications */ 429 unsigned maxapplication; /* Number of applications */
441 unsigned short bus; /* BUS ID */ 430 __u16 bus; /* BUS ID */
442 unsigned short vendor; /* Vendor ID */ 431 __u32 vendor; /* Vendor ID */
443 unsigned short product; /* Product ID */ 432 __u32 product; /* Product ID */
444 unsigned version; /* HID version */ 433 __u32 version; /* HID version */
445 unsigned country; /* HID country */ 434 unsigned country; /* HID country */
446 struct hid_report_enum report_enum[HID_REPORT_TYPES]; 435 struct hid_report_enum report_enum[HID_REPORT_TYPES];
447 436
448 struct device *dev; /* device */ 437 struct device dev; /* device */
438 struct hid_driver *driver;
439 struct hid_ll_driver *ll_driver;
449 440
441 unsigned int status; /* see STAT flags above */
450 unsigned claimed; /* Claimed by hidinput, hiddev? */ 442 unsigned claimed; /* Claimed by hidinput, hiddev? */
451 unsigned quirks; /* Various quirks the device can pull on us */ 443 unsigned quirks; /* Various quirks the device can pull on us */
452 444
@@ -462,26 +454,29 @@ struct hid_device { /* device report descriptor */
462 454
463 void *driver_data; 455 void *driver_data;
464 456
465 __s32 delayed_value; /* For A4 Tech mice hwheel quirk */ 457 /* temporary hid_ff handling (until moved to the drivers) */
466 458 int (*ff_init)(struct hid_device *);
467 /* device-specific function pointers */
468 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
469 int (*hid_open) (struct hid_device *);
470 void (*hid_close) (struct hid_device *);
471 459
472 /* hiddev event handler */ 460 /* hiddev event handler */
461 int (*hiddev_connect)(struct hid_device *, unsigned int);
473 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 462 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
474 struct hid_usage *, __s32); 463 struct hid_usage *, __s32);
475 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 464 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
476 465
477 /* handler for raw output data, used by hidraw */ 466 /* handler for raw output data, used by hidraw */
478 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); 467 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
479#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
480 unsigned long apple_pressed_fn[BITS_TO_LONGS(KEY_CNT)];
481 unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)];
482#endif
483}; 468};
484 469
470static inline void *hid_get_drvdata(struct hid_device *hdev)
471{
472 return dev_get_drvdata(&hdev->dev);
473}
474
475static inline void hid_set_drvdata(struct hid_device *hdev, void *data)
476{
477 dev_set_drvdata(&hdev->dev, data);
478}
479
485#define HID_GLOBAL_STACK_SIZE 4 480#define HID_GLOBAL_STACK_SIZE 4
486#define HID_COLLECTION_STACK_SIZE 4 481#define HID_COLLECTION_STACK_SIZE 4
487 482
@@ -510,6 +505,107 @@ struct hid_descriptor {
510 struct hid_class_descriptor desc[1]; 505 struct hid_class_descriptor desc[1];
511} __attribute__ ((packed)); 506} __attribute__ ((packed));
512 507
508#define HID_DEVICE(b, ven, prod) \
509 .bus = (b), \
510 .vendor = (ven), .product = (prod)
511
512#define HID_USB_DEVICE(ven, prod) HID_DEVICE(BUS_USB, ven, prod)
513#define HID_BLUETOOTH_DEVICE(ven, prod) HID_DEVICE(BUS_BLUETOOTH, ven, prod)
514
515#define HID_REPORT_ID(rep) \
516 .report_type = (rep)
517#define HID_USAGE_ID(uhid, utype, ucode) \
518 .usage_hid = (uhid), .usage_type = (utype), .usage_code = (ucode)
519/* we don't want to catch types and codes equal to 0 */
520#define HID_TERMINATOR (HID_ANY_ID - 1)
521
522struct hid_report_id {
523 __u32 report_type;
524};
525struct hid_usage_id {
526 __u32 usage_hid;
527 __u32 usage_type;
528 __u32 usage_code;
529};
530
531/**
532 * struct hid_driver
533 * @name: driver name (e.g. "Footech_bar-wheel")
534 * @id_table: which devices is this driver for (must be non-NULL for probe
535 * to be called)
536 * @probe: new device inserted
537 * @remove: device removed (NULL if not a hot-plug capable driver)
538 * @report_table: on which reports to call raw_event (NULL means all)
539 * @raw_event: if report in report_table, this hook is called (NULL means nop)
540 * @usage_table: on which events to call event (NULL means all)
541 * @event: if usage in usage_table, this hook is called (NULL means nop)
542 * @report_fixup: called before report descriptor parsing (NULL means nop)
543 * @input_mapping: invoked on input registering before mapping an usage
544 * @input_mapped: invoked on input registering after mapping an usage
545 *
546 * raw_event and event should return 0 on no action performed, 1 when no
547 * further processing should be done and negative on error
548 *
549 * input_mapping shall return a negative value to completely ignore this usage
550 * (e.g. doubled or invalid usage), zero to continue with parsing of this
551 * usage by generic code (no special handling needed) or positive to skip
552 * generic parsing (needed special handling which was done in the hook already)
553 * input_mapped shall return negative to inform the layer that this usage
554 * should not be considered for further processing or zero to notify that
555 * no processing was performed and should be done in a generic manner
556 * Both these functions may be NULL which means the same behavior as returning
557 * zero from them.
558 */
559struct hid_driver {
560 char *name;
561 const struct hid_device_id *id_table;
562
563 int (*probe)(struct hid_device *dev, const struct hid_device_id *id);
564 void (*remove)(struct hid_device *dev);
565
566 const struct hid_report_id *report_table;
567 int (*raw_event)(struct hid_device *hdev, struct hid_report *report,
568 u8 *data, int size);
569 const struct hid_usage_id *usage_table;
570 int (*event)(struct hid_device *hdev, struct hid_field *field,
571 struct hid_usage *usage, __s32 value);
572
573 void (*report_fixup)(struct hid_device *hdev, __u8 *buf,
574 unsigned int size);
575
576 int (*input_mapping)(struct hid_device *hdev,
577 struct hid_input *hidinput, struct hid_field *field,
578 struct hid_usage *usage, unsigned long **bit, int *max);
579 int (*input_mapped)(struct hid_device *hdev,
580 struct hid_input *hidinput, struct hid_field *field,
581 struct hid_usage *usage, unsigned long **bit, int *max);
582/* private: */
583 struct device_driver driver;
584};
585
586/**
587 * hid_ll_driver - low level driver callbacks
588 * @start: called on probe to start the device
589 * @stop: called on remove
590 * @open: called by input layer on open
591 * @close: called by input layer on close
592 * @hidinput_input_event: event input event (e.g. ff or leds)
593 * @parse: this method is called only once to parse the device data,
594 * shouldn't allocate anything to not leak memory
595 */
596struct hid_ll_driver {
597 int (*start)(struct hid_device *hdev);
598 void (*stop)(struct hid_device *hdev);
599
600 int (*open)(struct hid_device *hdev);
601 void (*close)(struct hid_device *hdev);
602
603 int (*hidinput_input_event) (struct input_dev *idev, unsigned int type,
604 unsigned int code, int value);
605
606 int (*parse)(struct hid_device *hdev);
607};
608
513/* Applications from HID Usage Tables 4/8/99 Version 1.1 */ 609/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
514/* We ignore a few input applications that are not widely used */ 610/* We ignore a few input applications that are not widely used */
515#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002)) 611#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002))
@@ -520,43 +616,157 @@ struct hid_descriptor {
520extern int hid_debug; 616extern int hid_debug;
521#endif 617#endif
522 618
619extern int hid_add_device(struct hid_device *);
620extern void hid_destroy_device(struct hid_device *);
621
622extern int __must_check __hid_register_driver(struct hid_driver *,
623 struct module *, const char *mod_name);
624static inline int __must_check hid_register_driver(struct hid_driver *driver)
625{
626 return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
627}
628extern void hid_unregister_driver(struct hid_driver *);
629
523extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 630extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
524extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); 631extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
525extern int hidinput_connect(struct hid_device *); 632extern int hidinput_connect(struct hid_device *hid, unsigned int force);
526extern void hidinput_disconnect(struct hid_device *); 633extern void hidinput_disconnect(struct hid_device *);
527 634
528int hid_set_field(struct hid_field *, unsigned, __s32); 635int hid_set_field(struct hid_field *, unsigned, __s32);
529int hid_input_report(struct hid_device *, int type, u8 *, int, int); 636int hid_input_report(struct hid_device *, int type, u8 *, int, int);
530int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 637int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
531int hidinput_mapping_quirks(struct hid_usage *, struct input_dev *, unsigned long **, int *);
532int hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
533int hidinput_apple_event(struct hid_device *, struct input_dev *, struct hid_usage *, __s32);
534void hid_output_report(struct hid_report *report, __u8 *data); 638void hid_output_report(struct hid_report *report, __u8 *data);
535void hid_free_device(struct hid_device *device); 639struct hid_device *hid_allocate_device(void);
536struct hid_device *hid_parse_report(__u8 *start, unsigned size); 640int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
641int hid_connect(struct hid_device *hid, unsigned int connect_mask);
642
643/**
644 * hid_map_usage - map usage input bits
645 *
646 * @hidinput: hidinput which we are interested in
647 * @usage: usage to fill in
648 * @bit: pointer to input->{}bit (out parameter)
649 * @max: maximal valid usage->code to consider later (out parameter)
650 * @type: input event type (EV_KEY, EV_REL, ...)
651 * @c: code which corresponds to this usage and type
652 */
653static inline void hid_map_usage(struct hid_input *hidinput,
654 struct hid_usage *usage, unsigned long **bit, int *max,
655 __u8 type, __u16 c)
656{
657 struct input_dev *input = hidinput->input;
658
659 usage->type = type;
660 usage->code = c;
661
662 switch (type) {
663 case EV_ABS:
664 *bit = input->absbit;
665 *max = ABS_MAX;
666 break;
667 case EV_REL:
668 *bit = input->relbit;
669 *max = REL_MAX;
670 break;
671 case EV_KEY:
672 *bit = input->keybit;
673 *max = KEY_MAX;
674 break;
675 case EV_LED:
676 *bit = input->ledbit;
677 *max = LED_MAX;
678 break;
679 }
680}
681
682/**
683 * hid_map_usage_clear - map usage input bits and clear the input bit
684 *
685 * The same as hid_map_usage, except the @c bit is also cleared in supported
686 * bits (@bit).
687 */
688static inline void hid_map_usage_clear(struct hid_input *hidinput,
689 struct hid_usage *usage, unsigned long **bit, int *max,
690 __u8 type, __u16 c)
691{
692 hid_map_usage(hidinput, usage, bit, max, type, c);
693 clear_bit(c, *bit);
694}
695
696/**
697 * hid_parse - parse HW reports
698 *
699 * @hdev: hid device
700 *
701 * Call this from probe after you set up the device (if needed). Your
702 * report_fixup will be called (if non-NULL) after reading raw report from
703 * device before passing it to hid layer for real parsing.
704 */
705static inline int __must_check hid_parse(struct hid_device *hdev)
706{
707 int ret;
708
709 if (hdev->status & HID_STAT_PARSED)
710 return 0;
711
712 ret = hdev->ll_driver->parse(hdev);
713 if (!ret)
714 hdev->status |= HID_STAT_PARSED;
715
716 return ret;
717}
718
719/**
720 * hid_hw_start - start underlaying HW
721 *
722 * @hdev: hid device
723 * @connect_mask: which outputs to connect, see HID_CONNECT_*
724 *
725 * Call this in probe function *after* hid_parse. This will setup HW buffers
726 * and start the device (if not deffered to device open). hid_hw_stop must be
727 * called if this was successfull.
728 */
729static inline int __must_check hid_hw_start(struct hid_device *hdev,
730 unsigned int connect_mask)
731{
732 int ret = hdev->ll_driver->start(hdev);
733 if (ret || !connect_mask)
734 return ret;
735 ret = hid_connect(hdev, connect_mask);
736 if (ret)
737 hdev->ll_driver->stop(hdev);
738 return ret;
739}
740
741/**
742 * hid_hw_stop - stop underlaying HW
743 *
744 * @hdev: hid device
745 *
746 * This is usually called from remove function or from probe when something
747 * failed and hid_hw_start was called already.
748 */
749static inline void hid_hw_stop(struct hid_device *hdev)
750{
751 hdev->ll_driver->stop(hdev);
752}
753
754void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
755 int interrupt);
756
757extern int hid_generic_init(void);
758extern void hid_generic_exit(void);
537 759
538/* HID quirks API */ 760/* HID quirks API */
539u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); 761u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
540int usbhid_quirks_init(char **quirks_param); 762int usbhid_quirks_init(char **quirks_param);
541void usbhid_quirks_exit(void); 763void usbhid_quirks_exit(void);
542void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **); 764void usbhid_set_leds(struct hid_device *hid);
543
544#ifdef CONFIG_HID_FF
545int hid_ff_init(struct hid_device *hid);
546 765
547int hid_lgff_init(struct hid_device *hid);
548int hid_lg2ff_init(struct hid_device *hid);
549int hid_plff_init(struct hid_device *hid);
550int hid_tmff_init(struct hid_device *hid);
551int hid_zpff_init(struct hid_device *hid);
552#ifdef CONFIG_HID_PID 766#ifdef CONFIG_HID_PID
553int hid_pidff_init(struct hid_device *hid); 767int hid_pidff_init(struct hid_device *hid);
554#else 768#else
555static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } 769#define hid_pidff_init NULL
556#endif
557
558#else
559static inline int hid_ff_init(struct hid_device *hid) { return -1; }
560#endif 770#endif
561 771
562#ifdef CONFIG_HID_DEBUG 772#ifdef CONFIG_HID_DEBUG
@@ -572,10 +782,23 @@ dbg_hid(const char *fmt, ...)
572 return 0; 782 return 0;
573} 783}
574#define dbg_hid_line dbg_hid 784#define dbg_hid_line dbg_hid
575#endif 785#endif /* HID_DEBUG */
576 786
577#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 787#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
578 __FILE__ , ## arg) 788 __FILE__ , ## arg)
579#endif 789#endif /* HID_FF */
790
791#ifdef CONFIG_HID_COMPAT
792#define HID_COMPAT_LOAD_DRIVER(name) \
793void hid_compat_##name(void) { } \
794EXPORT_SYMBOL(hid_compat_##name)
795#else
796#define HID_COMPAT_LOAD_DRIVER(name)
797#endif /* HID_COMPAT */
798#define HID_COMPAT_CALL_DRIVER(name) do { \
799 extern void hid_compat_##name(void); \
800 hid_compat_##name(); \
801} while (0)
802
580#endif 803#endif
581 804
diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
index a416b904ba90..c760ae0eb6a1 100644
--- a/include/linux/hiddev.h
+++ b/include/linux/hiddev.h
@@ -182,26 +182,28 @@ struct hiddev_usage_ref_multi {
182/* To traverse the input report descriptor info for a HID device, perform the 182/* To traverse the input report descriptor info for a HID device, perform the
183 * following: 183 * following:
184 * 184 *
185 * rinfo.report_type = HID_REPORT_TYPE_INPUT; 185 * rinfo.report_type = HID_REPORT_TYPE_INPUT;
186 * rinfo.report_id = HID_REPORT_ID_FIRST; 186 * rinfo.report_id = HID_REPORT_ID_FIRST;
187 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); 187 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
188 * 188 *
189 * while (ret >= 0) { 189 * while (ret >= 0) {
190 * for (i = 0; i < rinfo.num_fields; i++) { 190 * for (i = 0; i < rinfo.num_fields; i++) {
191 * finfo.report_type = rinfo.report_type; 191 * finfo.report_type = rinfo.report_type;
192 * finfo.report_id = rinfo.report_id; 192 * finfo.report_id = rinfo.report_id;
193 * finfo.field_index = i; 193 * finfo.field_index = i;
194 * ioctl(fd, HIDIOCGFIELDINFO, &finfo); 194 * ioctl(fd, HIDIOCGFIELDINFO, &finfo);
195 * for (j = 0; j < finfo.maxusage; j++) { 195 * for (j = 0; j < finfo.maxusage; j++) {
196 * uref.field_index = i; 196 * uref.report_type = rinfo.report_type;
197 * uref.usage_index = j; 197 * uref.report_id = rinfo.report_id;
198 * ioctl(fd, HIDIOCGUCODE, &uref); 198 * uref.field_index = i;
199 * ioctl(fd, HIDIOCGUSAGE, &uref); 199 * uref.usage_index = j;
200 * } 200 * ioctl(fd, HIDIOCGUCODE, &uref);
201 * } 201 * ioctl(fd, HIDIOCGUSAGE, &uref);
202 * rinfo.report_id |= HID_REPORT_ID_NEXT; 202 * }
203 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo); 203 * }
204 * } 204 * rinfo.report_id |= HID_REPORT_ID_NEXT;
205 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
206 * }
205 */ 207 */
206 208
207 209
@@ -217,7 +219,7 @@ struct hid_field;
217struct hid_report; 219struct hid_report;
218 220
219#ifdef CONFIG_USB_HIDDEV 221#ifdef CONFIG_USB_HIDDEV
220int hiddev_connect(struct hid_device *); 222int hiddev_connect(struct hid_device *hid, unsigned int force);
221void hiddev_disconnect(struct hid_device *); 223void hiddev_disconnect(struct hid_device *);
222void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, 224void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
223 struct hid_usage *usage, __s32 value); 225 struct hid_usage *usage, __s32 value);
@@ -225,7 +227,9 @@ void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
225int __init hiddev_init(void); 227int __init hiddev_init(void);
226void hiddev_exit(void); 228void hiddev_exit(void);
227#else 229#else
228static inline int hiddev_connect(struct hid_device *hid) { return -1; } 230static inline int hiddev_connect(struct hid_device *hid,
231 unsigned int force)
232{ return -1; }
229static inline void hiddev_disconnect(struct hid_device *hid) { } 233static inline void hiddev_disconnect(struct hid_device *hid) { }
230static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, 234static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
231 struct hid_usage *usage, __s32 value) { } 235 struct hid_usage *usage, __s32 value) { }
diff --git a/include/linux/hpet.h b/include/linux/hpet.h
index 2dc29ce6c8e4..79f63a27bcef 100644
--- a/include/linux/hpet.h
+++ b/include/linux/hpet.h
@@ -37,6 +37,7 @@ struct hpet {
37#define hpet_compare _u1._hpet_compare 37#define hpet_compare _u1._hpet_compare
38 38
39#define HPET_MAX_TIMERS (32) 39#define HPET_MAX_TIMERS (32)
40#define HPET_MAX_IRQ (32)
40 41
41/* 42/*
42 * HPET general capabilities register 43 * HPET general capabilities register
@@ -64,7 +65,7 @@ struct hpet {
64 */ 65 */
65 66
66#define Tn_INT_ROUTE_CAP_MASK (0xffffffff00000000ULL) 67#define Tn_INT_ROUTE_CAP_MASK (0xffffffff00000000ULL)
67#define Tn_INI_ROUTE_CAP_SHIFT (32UL) 68#define Tn_INT_ROUTE_CAP_SHIFT (32UL)
68#define Tn_FSB_INT_DELCAP_MASK (0x8000UL) 69#define Tn_FSB_INT_DELCAP_MASK (0x8000UL)
69#define Tn_FSB_INT_DELCAP_SHIFT (15) 70#define Tn_FSB_INT_DELCAP_SHIFT (15)
70#define Tn_FSB_EN_CNF_MASK (0x4000UL) 71#define Tn_FSB_EN_CNF_MASK (0x4000UL)
@@ -91,23 +92,14 @@ struct hpet {
91 * exported interfaces 92 * exported interfaces
92 */ 93 */
93 94
94struct hpet_task {
95 void (*ht_func) (void *);
96 void *ht_data;
97 void *ht_opaque;
98};
99
100struct hpet_data { 95struct hpet_data {
101 unsigned long hd_phys_address; 96 unsigned long hd_phys_address;
102 void __iomem *hd_address; 97 void __iomem *hd_address;
103 unsigned short hd_nirqs; 98 unsigned short hd_nirqs;
104 unsigned short hd_flags;
105 unsigned int hd_state; /* timer allocated */ 99 unsigned int hd_state; /* timer allocated */
106 unsigned int hd_irq[HPET_MAX_TIMERS]; 100 unsigned int hd_irq[HPET_MAX_TIMERS];
107}; 101};
108 102
109#define HPET_DATA_PLATFORM 0x0001 /* platform call to hpet_alloc */
110
111static inline void hpet_reserve_timer(struct hpet_data *hd, int timer) 103static inline void hpet_reserve_timer(struct hpet_data *hd, int timer)
112{ 104{
113 hd->hd_state |= (1 << timer); 105 hd->hd_state |= (1 << timer);
@@ -125,7 +117,7 @@ struct hpet_info {
125 unsigned short hi_timer; 117 unsigned short hi_timer;
126}; 118};
127 119
128#define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ 120#define HPET_INFO_PERIODIC 0x0010 /* periodic-capable comparator */
129 121
130#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ 122#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
131#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ 123#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 6d93dce61cbb..9a4e35cd5f79 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -47,14 +47,22 @@ enum hrtimer_restart {
47 * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context 47 * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context
48 * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and 48 * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and
49 * does not restart the timer 49 * does not restart the timer
50 * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context 50 * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context
51 * Special mode for tick emultation 51 * Special mode for tick emulation and
52 * scheduler timer. Such timers are per
53 * cpu and not allowed to be migrated on
54 * cpu unplug.
55 * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context
56 * with timer->base lock unlocked
57 * used for timers which call wakeup to
58 * avoid lock order problems with rq->lock
52 */ 59 */
53enum hrtimer_cb_mode { 60enum hrtimer_cb_mode {
54 HRTIMER_CB_SOFTIRQ, 61 HRTIMER_CB_SOFTIRQ,
55 HRTIMER_CB_IRQSAFE, 62 HRTIMER_CB_IRQSAFE,
56 HRTIMER_CB_IRQSAFE_NO_RESTART, 63 HRTIMER_CB_IRQSAFE_NO_RESTART,
57 HRTIMER_CB_IRQSAFE_NO_SOFTIRQ, 64 HRTIMER_CB_IRQSAFE_PERCPU,
65 HRTIMER_CB_IRQSAFE_UNLOCKED,
58}; 66};
59 67
60/* 68/*
@@ -67,9 +75,10 @@ enum hrtimer_cb_mode {
67 * 0x02 callback function running 75 * 0x02 callback function running
68 * 0x04 callback pending (high resolution mode) 76 * 0x04 callback pending (high resolution mode)
69 * 77 *
70 * Special case: 78 * Special cases:
71 * 0x03 callback function running and enqueued 79 * 0x03 callback function running and enqueued
72 * (was requeued on another CPU) 80 * (was requeued on another CPU)
81 * 0x09 timer was migrated on CPU hotunplug
73 * The "callback function running and enqueued" status is only possible on 82 * The "callback function running and enqueued" status is only possible on
74 * SMP. It happens for example when a posix timer expired and the callback 83 * SMP. It happens for example when a posix timer expired and the callback
75 * queued a signal. Between dropping the lock which protects the posix timer 84 * queued a signal. Between dropping the lock which protects the posix timer
@@ -87,6 +96,7 @@ enum hrtimer_cb_mode {
87#define HRTIMER_STATE_ENQUEUED 0x01 96#define HRTIMER_STATE_ENQUEUED 0x01
88#define HRTIMER_STATE_CALLBACK 0x02 97#define HRTIMER_STATE_CALLBACK 0x02
89#define HRTIMER_STATE_PENDING 0x04 98#define HRTIMER_STATE_PENDING 0x04
99#define HRTIMER_STATE_MIGRATE 0x08
90 100
91/** 101/**
92 * struct hrtimer - the basic hrtimer structure 102 * struct hrtimer - the basic hrtimer structure
@@ -115,12 +125,12 @@ struct hrtimer {
115 enum hrtimer_restart (*function)(struct hrtimer *); 125 enum hrtimer_restart (*function)(struct hrtimer *);
116 struct hrtimer_clock_base *base; 126 struct hrtimer_clock_base *base;
117 unsigned long state; 127 unsigned long state;
118 enum hrtimer_cb_mode cb_mode;
119 struct list_head cb_entry; 128 struct list_head cb_entry;
129 enum hrtimer_cb_mode cb_mode;
120#ifdef CONFIG_TIMER_STATS 130#ifdef CONFIG_TIMER_STATS
131 int start_pid;
121 void *start_site; 132 void *start_site;
122 char start_comm[16]; 133 char start_comm[16];
123 int start_pid;
124#endif 134#endif
125}; 135};
126 136
@@ -145,10 +155,8 @@ struct hrtimer_sleeper {
145 * @first: pointer to the timer node which expires first 155 * @first: pointer to the timer node which expires first
146 * @resolution: the resolution of the clock, in nanoseconds 156 * @resolution: the resolution of the clock, in nanoseconds
147 * @get_time: function to retrieve the current time of the clock 157 * @get_time: function to retrieve the current time of the clock
148 * @get_softirq_time: function to retrieve the current time from the softirq
149 * @softirq_time: the time when running the hrtimer queue in the softirq 158 * @softirq_time: the time when running the hrtimer queue in the softirq
150 * @offset: offset of this clock to the monotonic base 159 * @offset: offset of this clock to the monotonic base
151 * @reprogram: function to reprogram the timer event
152 */ 160 */
153struct hrtimer_clock_base { 161struct hrtimer_clock_base {
154 struct hrtimer_cpu_base *cpu_base; 162 struct hrtimer_cpu_base *cpu_base;
@@ -157,13 +165,9 @@ struct hrtimer_clock_base {
157 struct rb_node *first; 165 struct rb_node *first;
158 ktime_t resolution; 166 ktime_t resolution;
159 ktime_t (*get_time)(void); 167 ktime_t (*get_time)(void);
160 ktime_t (*get_softirq_time)(void);
161 ktime_t softirq_time; 168 ktime_t softirq_time;
162#ifdef CONFIG_HIGH_RES_TIMERS 169#ifdef CONFIG_HIGH_RES_TIMERS
163 ktime_t offset; 170 ktime_t offset;
164 int (*reprogram)(struct hrtimer *t,
165 struct hrtimer_clock_base *b,
166 ktime_t n);
167#endif 171#endif
168}; 172};
169 173
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index bf34c5f4c051..01d67ba9e985 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -41,7 +41,6 @@
41#define I2C_DRIVERID_SAA7110 22 /* video decoder */ 41#define I2C_DRIVERID_SAA7110 22 /* video decoder */
42#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ 42#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */
43#define I2C_DRIVERID_PCF8583 25 /* real time clock */ 43#define I2C_DRIVERID_PCF8583 25 /* real time clock */
44#define I2C_DRIVERID_SAB3036 26 /* SAB3036 tuner */
45#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ 44#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */
46#define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ 45#define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */
47#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ 46#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */
@@ -61,7 +60,7 @@
61#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ 60#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */
62#define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */ 61#define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */
63#define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */ 62#define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */
64#define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */ 63#define I2C_DRIVERID_SAA7127 72 /* saa7127 video encoder */
65#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ 64#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */
66#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ 65#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */
67#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ 66#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 08be0d21864c..06115128047f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -97,7 +97,19 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
97 97
98/** 98/**
99 * struct i2c_driver - represent an I2C device driver 99 * struct i2c_driver - represent an I2C device driver
100 * @id: Unique driver ID (optional)
100 * @class: What kind of i2c device we instantiate (for detect) 101 * @class: What kind of i2c device we instantiate (for detect)
102 * @attach_adapter: Callback for bus addition (for legacy drivers)
103 * @detach_adapter: Callback for bus removal (for legacy drivers)
104 * @detach_client: Callback for device removal (for legacy drivers)
105 * @probe: Callback for device binding (new-style drivers)
106 * @remove: Callback for device unbinding (new-style drivers)
107 * @shutdown: Callback for device shutdown
108 * @suspend: Callback for device suspend
109 * @resume: Callback for device resume
110 * @command: Callback for bus-wide signaling (optional)
111 * @driver: Device driver model driver
112 * @id_table: List of I2C devices supported by this driver
101 * @detect: Callback for device detection 113 * @detect: Callback for device detection
102 * @address_data: The I2C addresses to probe, ignore or force (for detect) 114 * @address_data: The I2C addresses to probe, ignore or force (for detect)
103 * @clients: List of detected clients we created (for i2c-core use only) 115 * @clients: List of detected clients we created (for i2c-core use only)
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 75ae6d8aba4f..4c4e57d1f19d 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -570,7 +570,6 @@ struct i2o_controller {
570#endif 570#endif
571 spinlock_t lock; /* lock for controller 571 spinlock_t lock; /* lock for controller
572 configuration */ 572 configuration */
573
574 void *driver_data[I2O_MAX_DRIVERS]; /* storage for drivers */ 573 void *driver_data[I2O_MAX_DRIVERS]; /* storage for drivers */
575}; 574};
576 575
@@ -691,289 +690,22 @@ static inline u32 i2o_dma_high(dma_addr_t dma_addr)
691}; 690};
692#endif 691#endif
693 692
694/** 693extern u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size);
695 * i2o_sg_tablesize - Calculate the maximum number of elements in a SGL 694extern dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr,
696 * @c: I2O controller for which the calculation should be done
697 * @body_size: maximum body size used for message in 32-bit words.
698 *
699 * Return the maximum number of SG elements in a SG list.
700 */
701static inline u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size)
702{
703 i2o_status_block *sb = c->status_block.virt;
704 u16 sg_count =
705 (sb->inbound_frame_size - sizeof(struct i2o_message) / 4) -
706 body_size;
707
708 if (c->pae_support) {
709 /*
710 * for 64-bit a SG attribute element must be added and each
711 * SG element needs 12 bytes instead of 8.
712 */
713 sg_count -= 2;
714 sg_count /= 3;
715 } else
716 sg_count /= 2;
717
718 if (c->short_req && (sg_count > 8))
719 sg_count = 8;
720
721 return sg_count;
722};
723
724/**
725 * i2o_dma_map_single - Map pointer to controller and fill in I2O message.
726 * @c: I2O controller
727 * @ptr: pointer to the data which should be mapped
728 * @size: size of data in bytes
729 * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE
730 * @sg_ptr: pointer to the SG list inside the I2O message
731 *
732 * This function does all necessary DMA handling and also writes the I2O
733 * SGL elements into the I2O message. For details on DMA handling see also
734 * dma_map_single(). The pointer sg_ptr will only be set to the end of the
735 * SG list if the allocation was successful.
736 *
737 * Returns DMA address which must be checked for failures using
738 * dma_mapping_error().
739 */
740static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr,
741 size_t size, 695 size_t size,
742 enum dma_data_direction direction, 696 enum dma_data_direction direction,
743 u32 ** sg_ptr) 697 u32 ** sg_ptr);
744{ 698extern int i2o_dma_map_sg(struct i2o_controller *c,
745 u32 sg_flags;
746 u32 *mptr = *sg_ptr;
747 dma_addr_t dma_addr;
748
749 switch (direction) {
750 case DMA_TO_DEVICE:
751 sg_flags = 0xd4000000;
752 break;
753 case DMA_FROM_DEVICE:
754 sg_flags = 0xd0000000;
755 break;
756 default:
757 return 0;
758 }
759
760 dma_addr = dma_map_single(&c->pdev->dev, ptr, size, direction);
761 if (!dma_mapping_error(&c->pdev->dev, dma_addr)) {
762#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
763 if ((sizeof(dma_addr_t) > 4) && c->pae_support) {
764 *mptr++ = cpu_to_le32(0x7C020002);
765 *mptr++ = cpu_to_le32(PAGE_SIZE);
766 }
767#endif
768
769 *mptr++ = cpu_to_le32(sg_flags | size);
770 *mptr++ = cpu_to_le32(i2o_dma_low(dma_addr));
771#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
772 if ((sizeof(dma_addr_t) > 4) && c->pae_support)
773 *mptr++ = cpu_to_le32(i2o_dma_high(dma_addr));
774#endif
775 *sg_ptr = mptr;
776 }
777 return dma_addr;
778};
779
780/**
781 * i2o_dma_map_sg - Map a SG List to controller and fill in I2O message.
782 * @c: I2O controller
783 * @sg: SG list to be mapped
784 * @sg_count: number of elements in the SG list
785 * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE
786 * @sg_ptr: pointer to the SG list inside the I2O message
787 *
788 * This function does all necessary DMA handling and also writes the I2O
789 * SGL elements into the I2O message. For details on DMA handling see also
790 * dma_map_sg(). The pointer sg_ptr will only be set to the end of the SG
791 * list if the allocation was successful.
792 *
793 * Returns 0 on failure or 1 on success.
794 */
795static inline int i2o_dma_map_sg(struct i2o_controller *c,
796 struct scatterlist *sg, int sg_count, 699 struct scatterlist *sg, int sg_count,
797 enum dma_data_direction direction, 700 enum dma_data_direction direction,
798 u32 ** sg_ptr) 701 u32 ** sg_ptr);
799{ 702extern int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, size_t len);
800 u32 sg_flags; 703extern void i2o_dma_free(struct device *dev, struct i2o_dma *addr);
801 u32 *mptr = *sg_ptr; 704extern int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr,
802 705 size_t len);
803 switch (direction) { 706extern int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
804 case DMA_TO_DEVICE: 707 size_t size, int min_nr);
805 sg_flags = 0x14000000; 708extern void i2o_pool_free(struct i2o_pool *pool);
806 break;
807 case DMA_FROM_DEVICE:
808 sg_flags = 0x10000000;
809 break;
810 default:
811 return 0;
812 }
813
814 sg_count = dma_map_sg(&c->pdev->dev, sg, sg_count, direction);
815 if (!sg_count)
816 return 0;
817
818#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
819 if ((sizeof(dma_addr_t) > 4) && c->pae_support) {
820 *mptr++ = cpu_to_le32(0x7C020002);
821 *mptr++ = cpu_to_le32(PAGE_SIZE);
822 }
823#endif
824
825 while (sg_count-- > 0) {
826 if (!sg_count)
827 sg_flags |= 0xC0000000;
828 *mptr++ = cpu_to_le32(sg_flags | sg_dma_len(sg));
829 *mptr++ = cpu_to_le32(i2o_dma_low(sg_dma_address(sg)));
830#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
831 if ((sizeof(dma_addr_t) > 4) && c->pae_support)
832 *mptr++ = cpu_to_le32(i2o_dma_high(sg_dma_address(sg)));
833#endif
834 sg = sg_next(sg);
835 }
836 *sg_ptr = mptr;
837
838 return 1;
839};
840
841/**
842 * i2o_dma_alloc - Allocate DMA memory
843 * @dev: struct device pointer to the PCI device of the I2O controller
844 * @addr: i2o_dma struct which should get the DMA buffer
845 * @len: length of the new DMA memory
846 * @gfp_mask: GFP mask
847 *
848 * Allocate a coherent DMA memory and write the pointers into addr.
849 *
850 * Returns 0 on success or -ENOMEM on failure.
851 */
852static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr,
853 size_t len, gfp_t gfp_mask)
854{
855 struct pci_dev *pdev = to_pci_dev(dev);
856 int dma_64 = 0;
857
858 if ((sizeof(dma_addr_t) > 4) && (pdev->dma_mask == DMA_64BIT_MASK)) {
859 dma_64 = 1;
860 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK))
861 return -ENOMEM;
862 }
863
864 addr->virt = dma_alloc_coherent(dev, len, &addr->phys, gfp_mask);
865
866 if ((sizeof(dma_addr_t) > 4) && dma_64)
867 if (pci_set_dma_mask(pdev, DMA_64BIT_MASK))
868 printk(KERN_WARNING "i2o: unable to set 64-bit DMA");
869
870 if (!addr->virt)
871 return -ENOMEM;
872
873 memset(addr->virt, 0, len);
874 addr->len = len;
875
876 return 0;
877};
878
879/**
880 * i2o_dma_free - Free DMA memory
881 * @dev: struct device pointer to the PCI device of the I2O controller
882 * @addr: i2o_dma struct which contains the DMA buffer
883 *
884 * Free a coherent DMA memory and set virtual address of addr to NULL.
885 */
886static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr)
887{
888 if (addr->virt) {
889 if (addr->phys)
890 dma_free_coherent(dev, addr->len, addr->virt,
891 addr->phys);
892 else
893 kfree(addr->virt);
894 addr->virt = NULL;
895 }
896};
897
898/**
899 * i2o_dma_realloc - Realloc DMA memory
900 * @dev: struct device pointer to the PCI device of the I2O controller
901 * @addr: pointer to a i2o_dma struct DMA buffer
902 * @len: new length of memory
903 * @gfp_mask: GFP mask
904 *
905 * If there was something allocated in the addr, free it first. If len > 0
906 * than try to allocate it and write the addresses back to the addr
907 * structure. If len == 0 set the virtual address to NULL.
908 *
909 * Returns the 0 on success or negative error code on failure.
910 */
911static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr,
912 size_t len, gfp_t gfp_mask)
913{
914 i2o_dma_free(dev, addr);
915
916 if (len)
917 return i2o_dma_alloc(dev, addr, len, gfp_mask);
918
919 return 0;
920};
921
922/*
923 * i2o_pool_alloc - Allocate an slab cache and mempool
924 * @mempool: pointer to struct i2o_pool to write data into.
925 * @name: name which is used to identify cache
926 * @size: size of each object
927 * @min_nr: minimum number of objects
928 *
929 * First allocates a slab cache with name and size. Then allocates a
930 * mempool which uses the slab cache for allocation and freeing.
931 *
932 * Returns 0 on success or negative error code on failure.
933 */
934static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
935 size_t size, int min_nr)
936{
937 pool->name = kmalloc(strlen(name) + 1, GFP_KERNEL);
938 if (!pool->name)
939 goto exit;
940 strcpy(pool->name, name);
941
942 pool->slab =
943 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
944 if (!pool->slab)
945 goto free_name;
946
947 pool->mempool = mempool_create_slab_pool(min_nr, pool->slab);
948 if (!pool->mempool)
949 goto free_slab;
950
951 return 0;
952
953 free_slab:
954 kmem_cache_destroy(pool->slab);
955
956 free_name:
957 kfree(pool->name);
958
959 exit:
960 return -ENOMEM;
961};
962
963/*
964 * i2o_pool_free - Free slab cache and mempool again
965 * @mempool: pointer to struct i2o_pool which should be freed
966 *
967 * Note that you have to return all objects to the mempool again before
968 * calling i2o_pool_free().
969 */
970static inline void i2o_pool_free(struct i2o_pool *pool)
971{
972 mempool_destroy(pool->mempool);
973 kmem_cache_destroy(pool->slab);
974 kfree(pool->name);
975};
976
977/* I2O driver (OSM) functions */ 709/* I2O driver (OSM) functions */
978extern int i2o_driver_register(struct i2o_driver *); 710extern int i2o_driver_register(struct i2o_driver *);
979extern void i2o_driver_unregister(struct i2o_driver *); 711extern void i2o_driver_unregister(struct i2o_driver *);
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 03067443198a..a93a8dd33118 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -40,16 +40,18 @@ struct icmp6hdr {
40 struct icmpv6_nd_ra { 40 struct icmpv6_nd_ra {
41 __u8 hop_limit; 41 __u8 hop_limit;
42#if defined(__LITTLE_ENDIAN_BITFIELD) 42#if defined(__LITTLE_ENDIAN_BITFIELD)
43 __u8 reserved:4, 43 __u8 reserved:3,
44 router_pref:2, 44 router_pref:2,
45 home_agent:1,
45 other:1, 46 other:1,
46 managed:1; 47 managed:1;
47 48
48#elif defined(__BIG_ENDIAN_BITFIELD) 49#elif defined(__BIG_ENDIAN_BITFIELD)
49 __u8 managed:1, 50 __u8 managed:1,
50 other:1, 51 other:1,
52 home_agent:1,
51 router_pref:2, 53 router_pref:2,
52 reserved:4; 54 reserved:3;
53#else 55#else
54#error "Please fix <asm/byteorder.h>" 56#error "Please fix <asm/byteorder.h>"
55#endif 57#endif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 87c12ed96954..c47e371554c1 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -8,7 +8,7 @@
8 8
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/ioport.h> 10#include <linux/ioport.h>
11#include <linux/hdreg.h> 11#include <linux/ata.h>
12#include <linux/blkdev.h> 12#include <linux/blkdev.h>
13#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
@@ -17,6 +17,7 @@
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <linux/completion.h> 19#include <linux/completion.h>
20#include <linux/pm.h>
20#ifdef CONFIG_BLK_DEV_IDEACPI 21#ifdef CONFIG_BLK_DEV_IDEACPI
21#include <acpi/acpi.h> 22#include <acpi/acpi.h>
22#endif 23#endif
@@ -47,12 +48,6 @@ typedef unsigned char byte; /* used everywhere */
47#define ERROR_RESET 3 /* Reset controller every 4th retry */ 48#define ERROR_RESET 3 /* Reset controller every 4th retry */
48#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ 49#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */
49 50
50/*
51 * state flags
52 */
53
54#define DMA_PIO_RETRY 1 /* retrying in PIO */
55
56#define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) 51#define HWIF(drive) ((ide_hwif_t *)((drive)->hwif))
57#define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) 52#define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup))
58 53
@@ -87,12 +82,13 @@ struct ide_io_ports {
87}; 82};
88 83
89#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) 84#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good))
90#define BAD_R_STAT (BUSY_STAT | ERR_STAT)
91#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT)
92#define BAD_STAT (BAD_R_STAT | DRQ_STAT)
93#define DRIVE_READY (READY_STAT | SEEK_STAT)
94 85
95#define BAD_CRC (ABRT_ERR | ICRC_ERR) 86#define BAD_R_STAT (ATA_BUSY | ATA_ERR)
87#define BAD_W_STAT (BAD_R_STAT | ATA_DF)
88#define BAD_STAT (BAD_R_STAT | ATA_DRQ)
89#define DRIVE_READY (ATA_DRDY | ATA_DSC)
90
91#define BAD_CRC (ATA_ABORTED | ATA_ICRC)
96 92
97#define SATA_NR_PORTS (3) /* 16 possible ?? */ 93#define SATA_NR_PORTS (3) /* 16 possible ?? */
98 94
@@ -125,24 +121,43 @@ struct ide_io_ports {
125#define PARTN_BITS 6 /* number of minor dev bits for partitions */ 121#define PARTN_BITS 6 /* number of minor dev bits for partitions */
126#define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */ 122#define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */
127#define SECTOR_SIZE 512 123#define SECTOR_SIZE 512
128#define SECTOR_WORDS (SECTOR_SIZE / 4) /* number of 32bit words per sector */ 124
129#define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t))) 125#define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t)))
130 126
131/* 127/*
132 * Timeouts for various operations: 128 * Timeouts for various operations:
133 */ 129 */
134#define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */ 130enum {
135#define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ 131 /* spec allows up to 20ms */
136#define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */ 132 WAIT_DRQ = HZ / 10, /* 100ms */
137#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ 133 /* some laptops are very slow */
138#define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ 134 WAIT_READY = 5 * HZ, /* 5s */
139#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ 135 /* should be less than 3ms (?), if all ATAPI CD is closed at boot */
136 WAIT_PIDENTIFY = 10 * HZ, /* 10s */
137 /* worst case when spinning up */
138 WAIT_WORSTCASE = 30 * HZ, /* 30s */
139 /* maximum wait for an IRQ to happen */
140 WAIT_CMD = 10 * HZ, /* 10s */
141 /* Some drives require a longer IRQ timeout. */
142 WAIT_FLOPPY_CMD = 50 * HZ, /* 50s */
143 /*
144 * Some drives (for example, Seagate STT3401A Travan) require a very
145 * long timeout, because they don't return an interrupt or clear their
146 * BSY bit until after the command completes (even retension commands).
147 */
148 WAIT_TAPE_CMD = 900 * HZ, /* 900s */
149 /* minimum sleep time */
150 WAIT_MIN_SLEEP = HZ / 50, /* 20ms */
151};
140 152
141/* 153/*
142 * Op codes for special requests to be handled by ide_special_rq(). 154 * Op codes for special requests to be handled by ide_special_rq().
143 * Values should be in the range of 0x20 to 0x3f. 155 * Values should be in the range of 0x20 to 0x3f.
144 */ 156 */
145#define REQ_DRIVE_RESET 0x20 157#define REQ_DRIVE_RESET 0x20
158#define REQ_DEVSET_EXEC 0x21
159#define REQ_PARK_HEADS 0x22
160#define REQ_UNPARK_HEADS 0x23
146 161
147/* 162/*
148 * Check for an interrupt and acknowledge the interrupt status 163 * Check for an interrupt and acknowledge the interrupt status
@@ -249,8 +264,6 @@ static inline int __ide_default_irq(unsigned long base)
249 * set_geometry : respecify drive geometry 264 * set_geometry : respecify drive geometry
250 * recalibrate : seek to cyl 0 265 * recalibrate : seek to cyl 0
251 * set_multmode : set multmode count 266 * set_multmode : set multmode count
252 * set_tune : tune interface for drive
253 * serviced : service command
254 * reserved : unused 267 * reserved : unused
255 */ 268 */
256typedef union { 269typedef union {
@@ -259,43 +272,11 @@ typedef union {
259 unsigned set_geometry : 1; 272 unsigned set_geometry : 1;
260 unsigned recalibrate : 1; 273 unsigned recalibrate : 1;
261 unsigned set_multmode : 1; 274 unsigned set_multmode : 1;
262 unsigned set_tune : 1; 275 unsigned reserved : 5;
263 unsigned serviced : 1;
264 unsigned reserved : 3;
265 } b; 276 } b;
266} special_t; 277} special_t;
267 278
268/* 279/*
269 * ATA-IDE Select Register, aka Device-Head
270 *
271 * head : always zeros here
272 * unit : drive select number: 0/1
273 * bit5 : always 1
274 * lba : using LBA instead of CHS
275 * bit7 : always 1
276 */
277typedef union {
278 unsigned all : 8;
279 struct {
280#if defined(__LITTLE_ENDIAN_BITFIELD)
281 unsigned head : 4;
282 unsigned unit : 1;
283 unsigned bit5 : 1;
284 unsigned lba : 1;
285 unsigned bit7 : 1;
286#elif defined(__BIG_ENDIAN_BITFIELD)
287 unsigned bit7 : 1;
288 unsigned lba : 1;
289 unsigned bit5 : 1;
290 unsigned unit : 1;
291 unsigned head : 4;
292#else
293#error "Please fix <asm/byteorder.h>"
294#endif
295 } b;
296} select_t, ata_select_t;
297
298/*
299 * Status returned from various ide_ functions 280 * Status returned from various ide_ functions
300 */ 281 */
301typedef enum { 282typedef enum {
@@ -303,8 +284,177 @@ typedef enum {
303 ide_started, /* a drive operation was started, handler was set */ 284 ide_started, /* a drive operation was started, handler was set */
304} ide_startstop_t; 285} ide_startstop_t;
305 286
287enum {
288 IDE_TFLAG_LBA48 = (1 << 0),
289 IDE_TFLAG_FLAGGED = (1 << 2),
290 IDE_TFLAG_OUT_DATA = (1 << 3),
291 IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4),
292 IDE_TFLAG_OUT_HOB_NSECT = (1 << 5),
293 IDE_TFLAG_OUT_HOB_LBAL = (1 << 6),
294 IDE_TFLAG_OUT_HOB_LBAM = (1 << 7),
295 IDE_TFLAG_OUT_HOB_LBAH = (1 << 8),
296 IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE |
297 IDE_TFLAG_OUT_HOB_NSECT |
298 IDE_TFLAG_OUT_HOB_LBAL |
299 IDE_TFLAG_OUT_HOB_LBAM |
300 IDE_TFLAG_OUT_HOB_LBAH,
301 IDE_TFLAG_OUT_FEATURE = (1 << 9),
302 IDE_TFLAG_OUT_NSECT = (1 << 10),
303 IDE_TFLAG_OUT_LBAL = (1 << 11),
304 IDE_TFLAG_OUT_LBAM = (1 << 12),
305 IDE_TFLAG_OUT_LBAH = (1 << 13),
306 IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE |
307 IDE_TFLAG_OUT_NSECT |
308 IDE_TFLAG_OUT_LBAL |
309 IDE_TFLAG_OUT_LBAM |
310 IDE_TFLAG_OUT_LBAH,
311 IDE_TFLAG_OUT_DEVICE = (1 << 14),
312 IDE_TFLAG_WRITE = (1 << 15),
313 IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16),
314 IDE_TFLAG_IN_DATA = (1 << 17),
315 IDE_TFLAG_CUSTOM_HANDLER = (1 << 18),
316 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 19),
317 IDE_TFLAG_IN_HOB_FEATURE = (1 << 20),
318 IDE_TFLAG_IN_HOB_NSECT = (1 << 21),
319 IDE_TFLAG_IN_HOB_LBAL = (1 << 22),
320 IDE_TFLAG_IN_HOB_LBAM = (1 << 23),
321 IDE_TFLAG_IN_HOB_LBAH = (1 << 24),
322 IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL |
323 IDE_TFLAG_IN_HOB_LBAM |
324 IDE_TFLAG_IN_HOB_LBAH,
325 IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE |
326 IDE_TFLAG_IN_HOB_NSECT |
327 IDE_TFLAG_IN_HOB_LBA,
328 IDE_TFLAG_IN_FEATURE = (1 << 1),
329 IDE_TFLAG_IN_NSECT = (1 << 25),
330 IDE_TFLAG_IN_LBAL = (1 << 26),
331 IDE_TFLAG_IN_LBAM = (1 << 27),
332 IDE_TFLAG_IN_LBAH = (1 << 28),
333 IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL |
334 IDE_TFLAG_IN_LBAM |
335 IDE_TFLAG_IN_LBAH,
336 IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
337 IDE_TFLAG_IN_LBA,
338 IDE_TFLAG_IN_DEVICE = (1 << 29),
339 IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB |
340 IDE_TFLAG_IN_HOB,
341 IDE_TFLAG_TF = IDE_TFLAG_OUT_TF |
342 IDE_TFLAG_IN_TF,
343 IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE |
344 IDE_TFLAG_IN_DEVICE,
345 /* force 16-bit I/O operations */
346 IDE_TFLAG_IO_16BIT = (1 << 30),
347 /* ide_task_t was allocated using kmalloc() */
348 IDE_TFLAG_DYN = (1 << 31),
349};
350
351struct ide_taskfile {
352 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */
353
354 u8 hob_feature; /* 1-5: additional data to support LBA48 */
355 u8 hob_nsect;
356 u8 hob_lbal;
357 u8 hob_lbam;
358 u8 hob_lbah;
359
360 u8 data; /* 6: low data byte (for TASKFILE IOCTL) */
361
362 union { /*  7: */
363 u8 error; /* read: error */
364 u8 feature; /* write: feature */
365 };
366
367 u8 nsect; /* 8: number of sectors */
368 u8 lbal; /* 9: LBA low */
369 u8 lbam; /* 10: LBA mid */
370 u8 lbah; /* 11: LBA high */
371
372 u8 device; /* 12: device select */
373
374 union { /* 13: */
375 u8 status; /*  read: status  */
376 u8 command; /* write: command */
377 };
378};
379
380typedef struct ide_task_s {
381 union {
382 struct ide_taskfile tf;
383 u8 tf_array[14];
384 };
385 u32 tf_flags;
386 int data_phase;
387 struct request *rq; /* copy of request */
388 void *special; /* valid_t generally */
389} ide_task_t;
390
391/* ATAPI packet command flags */
392enum {
393 /* set when an error is considered normal - no retry (ide-tape) */
394 PC_FLAG_ABORT = (1 << 0),
395 PC_FLAG_SUPPRESS_ERROR = (1 << 1),
396 PC_FLAG_WAIT_FOR_DSC = (1 << 2),
397 PC_FLAG_DMA_OK = (1 << 3),
398 PC_FLAG_DMA_IN_PROGRESS = (1 << 4),
399 PC_FLAG_DMA_ERROR = (1 << 5),
400 PC_FLAG_WRITING = (1 << 6),
401 /* command timed out */
402 PC_FLAG_TIMEDOUT = (1 << 7),
403};
404
405/*
406 * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes.
407 * This is used for several packet commands (not for READ/WRITE commands).
408 */
409#define IDE_PC_BUFFER_SIZE 256
410
411struct ide_atapi_pc {
412 /* actual packet bytes */
413 u8 c[12];
414 /* incremented on each retry */
415 int retries;
416 int error;
417
418 /* bytes to transfer */
419 int req_xfer;
420 /* bytes actually transferred */
421 int xferred;
422
423 /* data buffer */
424 u8 *buf;
425 /* current buffer position */
426 u8 *cur_pos;
427 int buf_size;
428 /* missing/available data on the current buffer */
429 int b_count;
430
431 /* the corresponding request */
432 struct request *rq;
433
434 unsigned long flags;
435
436 /*
437 * those are more or less driver-specific and some of them are subject
438 * to change/removal later.
439 */
440 u8 pc_buf[IDE_PC_BUFFER_SIZE];
441
442 /* idetape only */
443 struct idetape_bh *bh;
444 char *b_data;
445
446 /* idescsi only for now */
447 struct scatterlist *sg;
448 unsigned int sg_cnt;
449
450 struct scsi_cmnd *scsi_cmd;
451 void (*done) (struct scsi_cmnd *);
452
453 unsigned long timeout;
454};
455
456struct ide_devset;
306struct ide_driver_s; 457struct ide_driver_s;
307struct ide_settings_s;
308 458
309#ifdef CONFIG_BLK_DEV_IDEACPI 459#ifdef CONFIG_BLK_DEV_IDEACPI
310struct ide_acpi_drive_link; 460struct ide_acpi_drive_link;
@@ -315,10 +465,10 @@ struct ide_acpi_hwif_link;
315enum { 465enum {
316 IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), 466 IDE_AFLAG_DRQ_INTERRUPT = (1 << 0),
317 IDE_AFLAG_MEDIA_CHANGED = (1 << 1), 467 IDE_AFLAG_MEDIA_CHANGED = (1 << 1),
318
319 /* ide-cd */
320 /* Drive cannot lock the door. */ 468 /* Drive cannot lock the door. */
321 IDE_AFLAG_NO_DOORLOCK = (1 << 2), 469 IDE_AFLAG_NO_DOORLOCK = (1 << 2),
470
471 /* ide-cd */
322 /* Drive cannot eject the disc. */ 472 /* Drive cannot eject the disc. */
323 IDE_AFLAG_NO_EJECT = (1 << 3), 473 IDE_AFLAG_NO_EJECT = (1 << 3),
324 /* Drive is a pre ATAPI 1.2 drive. */ 474 /* Drive is a pre ATAPI 1.2 drive. */
@@ -354,19 +504,81 @@ enum {
354 IDE_AFLAG_CLIK_DRIVE = (1 << 19), 504 IDE_AFLAG_CLIK_DRIVE = (1 << 19),
355 /* Requires BH algorithm for packets */ 505 /* Requires BH algorithm for packets */
356 IDE_AFLAG_ZIP_DRIVE = (1 << 20), 506 IDE_AFLAG_ZIP_DRIVE = (1 << 20),
507 /* Write protect */
508 IDE_AFLAG_WP = (1 << 21),
509 /* Supports format progress report */
510 IDE_AFLAG_SRFP = (1 << 22),
357 511
358 /* ide-tape */ 512 /* ide-tape */
359 IDE_AFLAG_IGNORE_DSC = (1 << 21), 513 IDE_AFLAG_IGNORE_DSC = (1 << 23),
360 /* 0 When the tape position is unknown */ 514 /* 0 When the tape position is unknown */
361 IDE_AFLAG_ADDRESS_VALID = (1 << 22), 515 IDE_AFLAG_ADDRESS_VALID = (1 << 24),
362 /* Device already opened */ 516 /* Device already opened */
363 IDE_AFLAG_BUSY = (1 << 23), 517 IDE_AFLAG_BUSY = (1 << 25),
364 /* Attempt to auto-detect the current user block size */ 518 /* Attempt to auto-detect the current user block size */
365 IDE_AFLAG_DETECT_BS = (1 << 24), 519 IDE_AFLAG_DETECT_BS = (1 << 26),
366 /* Currently on a filemark */ 520 /* Currently on a filemark */
367 IDE_AFLAG_FILEMARK = (1 << 25), 521 IDE_AFLAG_FILEMARK = (1 << 27),
368 /* 0 = no tape is loaded, so we don't rewind after ejecting */ 522 /* 0 = no tape is loaded, so we don't rewind after ejecting */
369 IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) 523 IDE_AFLAG_MEDIUM_PRESENT = (1 << 28),
524
525 IDE_AFLAG_NO_AUTOCLOSE = (1 << 29),
526};
527
528/* device flags */
529enum {
530 /* restore settings after device reset */
531 IDE_DFLAG_KEEP_SETTINGS = (1 << 0),
532 /* device is using DMA for read/write */
533 IDE_DFLAG_USING_DMA = (1 << 1),
534 /* okay to unmask other IRQs */
535 IDE_DFLAG_UNMASK = (1 << 2),
536 /* don't attempt flushes */
537 IDE_DFLAG_NOFLUSH = (1 << 3),
538 /* DSC overlap */
539 IDE_DFLAG_DSC_OVERLAP = (1 << 4),
540 /* give potential excess bandwidth */
541 IDE_DFLAG_NICE1 = (1 << 5),
542 /* device is physically present */
543 IDE_DFLAG_PRESENT = (1 << 6),
544 /* device ejected hint */
545 IDE_DFLAG_DEAD = (1 << 7),
546 /* id read from device (synthetic if not set) */
547 IDE_DFLAG_ID_READ = (1 << 8),
548 IDE_DFLAG_NOPROBE = (1 << 9),
549 /* need to do check_media_change() */
550 IDE_DFLAG_REMOVABLE = (1 << 10),
551 /* needed for removable devices */
552 IDE_DFLAG_ATTACH = (1 << 11),
553 IDE_DFLAG_FORCED_GEOM = (1 << 12),
554 /* disallow setting unmask bit */
555 IDE_DFLAG_NO_UNMASK = (1 << 13),
556 /* disallow enabling 32-bit I/O */
557 IDE_DFLAG_NO_IO_32BIT = (1 << 14),
558 /* for removable only: door lock/unlock works */
559 IDE_DFLAG_DOORLOCKING = (1 << 15),
560 /* disallow DMA */
561 IDE_DFLAG_NODMA = (1 << 16),
562 /* powermanagment told us not to do anything, so sleep nicely */
563 IDE_DFLAG_BLOCKED = (1 << 17),
564 /* ide-scsi emulation */
565 IDE_DFLAG_SCSI = (1 << 18),
566 /* sleeping & sleep field valid */
567 IDE_DFLAG_SLEEPING = (1 << 19),
568 IDE_DFLAG_POST_RESET = (1 << 20),
569 IDE_DFLAG_UDMA33_WARNED = (1 << 21),
570 IDE_DFLAG_LBA48 = (1 << 22),
571 /* status of write cache */
572 IDE_DFLAG_WCACHE = (1 << 23),
573 /* used for ignoring ATA_DF */
574 IDE_DFLAG_NOWERR = (1 << 24),
575 /* retrying in PIO */
576 IDE_DFLAG_DMA_PIO_RETRY = (1 << 25),
577 IDE_DFLAG_LBA = (1 << 26),
578 /* don't unload heads */
579 IDE_DFLAG_NO_UNLOAD = (1 << 27),
580 /* heads unloaded, please don't reset port */
581 IDE_DFLAG_PARKED = (1 << 28)
370}; 582};
371 583
372struct ide_drive_s { 584struct ide_drive_s {
@@ -378,72 +590,47 @@ struct ide_drive_s {
378 struct request *rq; /* current request */ 590 struct request *rq; /* current request */
379 struct ide_drive_s *next; /* circular list of hwgroup drives */ 591 struct ide_drive_s *next; /* circular list of hwgroup drives */
380 void *driver_data; /* extra driver data */ 592 void *driver_data; /* extra driver data */
381 struct hd_driveid *id; /* drive model identification info */ 593 u16 *id; /* identification info */
382#ifdef CONFIG_IDE_PROC_FS 594#ifdef CONFIG_IDE_PROC_FS
383 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ 595 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */
384 struct ide_settings_s *settings;/* /proc/ide/ drive settings */ 596 const struct ide_proc_devset *settings; /* /proc/ide/ drive settings */
385#endif 597#endif
386 struct hwif_s *hwif; /* actually (ide_hwif_t *) */ 598 struct hwif_s *hwif; /* actually (ide_hwif_t *) */
387 599
600 unsigned long dev_flags;
601
388 unsigned long sleep; /* sleep until this time */ 602 unsigned long sleep; /* sleep until this time */
389 unsigned long service_start; /* time we started last request */ 603 unsigned long service_start; /* time we started last request */
390 unsigned long service_time; /* service time of last request */ 604 unsigned long service_time; /* service time of last request */
391 unsigned long timeout; /* max time to wait for irq */ 605 unsigned long timeout; /* max time to wait for irq */
392 606
393 special_t special; /* special action flags */ 607 special_t special; /* special action flags */
394 select_t select; /* basic drive/head select reg value */
395 608
396 u8 keep_settings; /* restore settings after drive reset */ 609 u8 select; /* basic drive/head select reg value */
397 u8 using_dma; /* disk is using dma for read/write */
398 u8 retry_pio; /* retrying dma capable host in pio */ 610 u8 retry_pio; /* retrying dma capable host in pio */
399 u8 state; /* retry state */
400 u8 waiting_for_dma; /* dma currently in progress */ 611 u8 waiting_for_dma; /* dma currently in progress */
401 u8 unmask; /* okay to unmask other irqs */ 612 u8 dma; /* atapi dma flag */
402 u8 noflush; /* don't attempt flushes */ 613
403 u8 dsc_overlap; /* DSC overlap */
404 u8 nice1; /* give potential excess bandwidth */
405
406 unsigned present : 1; /* drive is physically present */
407 unsigned dead : 1; /* device ejected hint */
408 unsigned id_read : 1; /* 1=id read from disk 0 = synthetic */
409 unsigned noprobe : 1; /* from: hdx=noprobe */
410 unsigned removable : 1; /* 1 if need to do check_media_change */
411 unsigned attach : 1; /* needed for removable devices */
412 unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */
413 unsigned no_unmask : 1; /* disallow setting unmask bit */
414 unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */
415 unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */
416 unsigned doorlocking : 1; /* for removable only: door lock/unlock works */
417 unsigned nodma : 1; /* disallow DMA */
418 unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
419 unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */
420 unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */
421 unsigned sleeping : 1; /* 1=sleeping & sleep field valid */
422 unsigned post_reset : 1;
423 unsigned udma33_warned : 1;
424
425 u8 addressing; /* 0=28-bit, 1=48-bit, 2=48-bit doing 28-bit */
426 u8 quirk_list; /* considered quirky, set for a specific host */ 614 u8 quirk_list; /* considered quirky, set for a specific host */
427 u8 init_speed; /* transfer rate set at boot */ 615 u8 init_speed; /* transfer rate set at boot */
428 u8 current_speed; /* current transfer rate set */ 616 u8 current_speed; /* current transfer rate set */
429 u8 desired_speed; /* desired transfer rate set */ 617 u8 desired_speed; /* desired transfer rate set */
430 u8 dn; /* now wide spread use */ 618 u8 dn; /* now wide spread use */
431 u8 wcache; /* status of write cache */
432 u8 acoustic; /* acoustic management */ 619 u8 acoustic; /* acoustic management */
433 u8 media; /* disk, cdrom, tape, floppy, ... */ 620 u8 media; /* disk, cdrom, tape, floppy, ... */
434 u8 ready_stat; /* min status value for drive ready */ 621 u8 ready_stat; /* min status value for drive ready */
435 u8 mult_count; /* current multiple sector setting */ 622 u8 mult_count; /* current multiple sector setting */
436 u8 mult_req; /* requested multiple sector setting */ 623 u8 mult_req; /* requested multiple sector setting */
437 u8 tune_req; /* requested drive tuning setting */
438 u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ 624 u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */
439 u8 bad_wstat; /* used for ignoring WRERR_STAT */ 625 u8 bad_wstat; /* used for ignoring ATA_DF */
440 u8 nowerr; /* used for ignoring WRERR_STAT */
441 u8 sect0; /* offset of first sector for DM6:DDO */
442 u8 head; /* "real" number of heads */ 626 u8 head; /* "real" number of heads */
443 u8 sect; /* "real" sectors per track */ 627 u8 sect; /* "real" sectors per track */
444 u8 bios_head; /* BIOS/fdisk/LILO number of heads */ 628 u8 bios_head; /* BIOS/fdisk/LILO number of heads */
445 u8 bios_sect; /* BIOS/fdisk/LILO sectors per track */ 629 u8 bios_sect; /* BIOS/fdisk/LILO sectors per track */
446 630
631 /* delay this long before sending packet command */
632 u8 pc_delay;
633
447 unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ 634 unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */
448 unsigned int cyl; /* "real" number of cyls */ 635 unsigned int cyl; /* "real" number of cyls */
449 unsigned int drive_data; /* used by set_pio_mode/selectproc */ 636 unsigned int drive_data; /* used by set_pio_mode/selectproc */
@@ -455,6 +642,9 @@ struct ide_drive_s {
455 642
456 int lun; /* logical unit */ 643 int lun; /* logical unit */
457 int crc_count; /* crc counter to reduce drive speed */ 644 int crc_count; /* crc counter to reduce drive speed */
645
646 unsigned long debug_mask; /* debugging levels switch */
647
458#ifdef CONFIG_BLK_DEV_IDEACPI 648#ifdef CONFIG_BLK_DEV_IDEACPI
459 struct ide_acpi_drive_link *acpidata; 649 struct ide_acpi_drive_link *acpidata;
460#endif 650#endif
@@ -462,21 +652,32 @@ struct ide_drive_s {
462 struct device gendev; 652 struct device gendev;
463 struct completion gendev_rel_comp; /* to deal with device release() */ 653 struct completion gendev_rel_comp; /* to deal with device release() */
464 654
655 /* current packet command */
656 struct ide_atapi_pc *pc;
657
465 /* callback for packet commands */ 658 /* callback for packet commands */
466 void (*pc_callback)(struct ide_drive_s *); 659 void (*pc_callback)(struct ide_drive_s *, int);
660
661 void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *);
662 int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
663 unsigned int, int);
467 664
468 unsigned long atapi_flags; 665 unsigned long atapi_flags;
666
667 struct ide_atapi_pc request_sense_pc;
668 struct request request_sense_rq;
469}; 669};
470 670
471typedef struct ide_drive_s ide_drive_t; 671typedef struct ide_drive_s ide_drive_t;
472 672
473#define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) 673#define to_ide_device(dev) container_of(dev, ide_drive_t, gendev)
474 674
475#define IDE_CHIPSET_PCI_MASK \ 675#define to_ide_drv(obj, cont_type) \
476 ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) 676 container_of(obj, struct cont_type, kref)
477#define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) 677
678#define ide_drv_g(disk, cont_type) \
679 container_of((disk)->private_data, struct cont_type, driver)
478 680
479struct ide_task_s;
480struct ide_port_info; 681struct ide_port_info;
481 682
482struct ide_tp_ops { 683struct ide_tp_ops {
@@ -510,6 +711,7 @@ extern const struct ide_tp_ops default_tp_ops;
510 * @resetproc: routine to reset controller after a disk reset 711 * @resetproc: routine to reset controller after a disk reset
511 * @maskproc: special host masking for drive selection 712 * @maskproc: special host masking for drive selection
512 * @quirkproc: check host's drive quirk list 713 * @quirkproc: check host's drive quirk list
714 * @clear_irq: clear IRQ
513 * 715 *
514 * @mdma_filter: filter MDMA modes 716 * @mdma_filter: filter MDMA modes
515 * @udma_filter: filter UDMA modes 717 * @udma_filter: filter UDMA modes
@@ -526,6 +728,7 @@ struct ide_port_ops {
526 void (*resetproc)(ide_drive_t *); 728 void (*resetproc)(ide_drive_t *);
527 void (*maskproc)(ide_drive_t *, int); 729 void (*maskproc)(ide_drive_t *, int);
528 void (*quirkproc)(ide_drive_t *); 730 void (*quirkproc)(ide_drive_t *);
731 void (*clear_irq)(ide_drive_t *);
529 732
530 u8 (*mdma_filter)(ide_drive_t *); 733 u8 (*mdma_filter)(ide_drive_t *);
531 u8 (*udma_filter)(ide_drive_t *); 734 u8 (*udma_filter)(ide_drive_t *);
@@ -565,7 +768,6 @@ typedef struct hwif_s {
565 u8 major; /* our major number */ 768 u8 major; /* our major number */
566 u8 index; /* 0 for ide0; 1 for ide1; ... */ 769 u8 index; /* 0 for ide0; 1 for ide1; ... */
567 u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ 770 u8 channel; /* for dual-port chips: 0=primary, 1=secondary */
568 u8 bus_state; /* power state of the IDE bus */
569 771
570 u32 host_flags; 772 u32 host_flags;
571 773
@@ -589,12 +791,16 @@ typedef struct hwif_s {
589 const struct ide_port_ops *port_ops; 791 const struct ide_port_ops *port_ops;
590 const struct ide_dma_ops *dma_ops; 792 const struct ide_dma_ops *dma_ops;
591 793
592 void (*ide_dma_clear_irq)(ide_drive_t *drive);
593
594 /* dma physical region descriptor table (cpu view) */ 794 /* dma physical region descriptor table (cpu view) */
595 unsigned int *dmatable_cpu; 795 unsigned int *dmatable_cpu;
596 /* dma physical region descriptor table (dma view) */ 796 /* dma physical region descriptor table (dma view) */
597 dma_addr_t dmatable_dma; 797 dma_addr_t dmatable_dma;
798
799 /* maximum number of PRD table entries */
800 int prd_max_nents;
801 /* PRD entry size in bytes */
802 int prd_ent_size;
803
598 /* Scatter-gather list used to build the above */ 804 /* Scatter-gather list used to build the above */
599 struct scatterlist *sg_table; 805 struct scatterlist *sg_table;
600 int sg_max_nents; /* Maximum number of entries in it */ 806 int sg_max_nents; /* Maximum number of entries in it */
@@ -604,6 +810,8 @@ typedef struct hwif_s {
604 /* data phase of the active command (currently only valid for PIO/DMA) */ 810 /* data phase of the active command (currently only valid for PIO/DMA) */
605 int data_phase; 811 int data_phase;
606 812
813 struct ide_task_s task; /* current command */
814
607 unsigned int nsect; 815 unsigned int nsect;
608 unsigned int nleft; 816 unsigned int nleft;
609 struct scatterlist *cursg; 817 struct scatterlist *cursg;
@@ -632,17 +840,18 @@ typedef struct hwif_s {
632 840
633 void *hwif_data; /* extra hwif data */ 841 void *hwif_data; /* extra hwif data */
634 842
635 unsigned dma;
636
637#ifdef CONFIG_BLK_DEV_IDEACPI 843#ifdef CONFIG_BLK_DEV_IDEACPI
638 struct ide_acpi_hwif_link *acpidata; 844 struct ide_acpi_hwif_link *acpidata;
639#endif 845#endif
640} ____cacheline_internodealigned_in_smp ide_hwif_t; 846} ____cacheline_internodealigned_in_smp ide_hwif_t;
641 847
848#define MAX_HOST_PORTS 4
849
642struct ide_host { 850struct ide_host {
643 ide_hwif_t *ports[MAX_HWIFS]; 851 ide_hwif_t *ports[MAX_HOST_PORTS];
644 unsigned int n_ports; 852 unsigned int n_ports;
645 struct device *dev[2]; 853 struct device *dev[2];
854 unsigned int (*init_chipset)(struct pci_dev *);
646 unsigned long host_flags; 855 unsigned long host_flags;
647 void *host_priv; 856 void *host_priv;
648}; 857};
@@ -690,102 +899,116 @@ typedef struct ide_driver_s ide_driver_t;
690 899
691extern struct mutex ide_setting_mtx; 900extern struct mutex ide_setting_mtx;
692 901
693int set_io_32bit(ide_drive_t *, int); 902/*
694int set_pio_mode(ide_drive_t *, int); 903 * configurable drive settings
695int set_using_dma(ide_drive_t *, int); 904 */
696 905
697/* ATAPI packet command flags */ 906#define DS_SYNC (1 << 0)
698enum { 907
699 /* set when an error is considered normal - no retry (ide-tape) */ 908struct ide_devset {
700 PC_FLAG_ABORT = (1 << 0), 909 int (*get)(ide_drive_t *);
701 PC_FLAG_SUPPRESS_ERROR = (1 << 1), 910 int (*set)(ide_drive_t *, int);
702 PC_FLAG_WAIT_FOR_DSC = (1 << 2), 911 unsigned int flags;
703 PC_FLAG_DMA_OK = (1 << 3),
704 PC_FLAG_DMA_IN_PROGRESS = (1 << 4),
705 PC_FLAG_DMA_ERROR = (1 << 5),
706 PC_FLAG_WRITING = (1 << 6),
707 /* command timed out */
708 PC_FLAG_TIMEDOUT = (1 << 7),
709}; 912};
710 913
711struct ide_atapi_pc { 914#define __DEVSET(_flags, _get, _set) { \
712 /* actual packet bytes */ 915 .flags = _flags, \
713 u8 c[12]; 916 .get = _get, \
714 /* incremented on each retry */ 917 .set = _set, \
715 int retries; 918}
716 int error;
717 919
718 /* bytes to transfer */ 920#define ide_devset_get(name, field) \
719 int req_xfer; 921static int get_##name(ide_drive_t *drive) \
720 /* bytes actually transferred */ 922{ \
721 int xferred; 923 return drive->field; \
924}
722 925
723 /* data buffer */ 926#define ide_devset_set(name, field) \
724 u8 *buf; 927static int set_##name(ide_drive_t *drive, int arg) \
725 /* current buffer position */ 928{ \
726 u8 *cur_pos; 929 drive->field = arg; \
727 int buf_size; 930 return 0; \
728 /* missing/available data on the current buffer */ 931}
729 int b_count;
730 932
731 /* the corresponding request */ 933#define ide_devset_get_flag(name, flag) \
732 struct request *rq; 934static int get_##name(ide_drive_t *drive) \
935{ \
936 return !!(drive->dev_flags & flag); \
937}
733 938
734 unsigned long flags; 939#define ide_devset_set_flag(name, flag) \
940static int set_##name(ide_drive_t *drive, int arg) \
941{ \
942 if (arg) \
943 drive->dev_flags |= flag; \
944 else \
945 drive->dev_flags &= ~flag; \
946 return 0; \
947}
735 948
736 /* 949#define __IDE_DEVSET(_name, _flags, _get, _set) \
737 * those are more or less driver-specific and some of them are subject 950const struct ide_devset ide_devset_##_name = \
738 * to change/removal later. 951 __DEVSET(_flags, _get, _set)
739 */
740 u8 pc_buf[256];
741 952
742 /* idetape only */ 953#define IDE_DEVSET(_name, _flags, _get, _set) \
743 struct idetape_bh *bh; 954static __IDE_DEVSET(_name, _flags, _get, _set)
744 char *b_data;
745 955
746 /* idescsi only for now */ 956#define ide_devset_rw(_name, _func) \
747 struct scatterlist *sg; 957IDE_DEVSET(_name, 0, get_##_func, set_##_func)
748 unsigned int sg_cnt;
749 958
750 struct scsi_cmnd *scsi_cmd; 959#define ide_devset_w(_name, _func) \
751 void (*done) (struct scsi_cmnd *); 960IDE_DEVSET(_name, 0, NULL, set_##_func)
752 961
753 unsigned long timeout; 962#define ide_ext_devset_rw(_name, _func) \
754}; 963__IDE_DEVSET(_name, 0, get_##_func, set_##_func)
964
965#define ide_ext_devset_rw_sync(_name, _func) \
966__IDE_DEVSET(_name, DS_SYNC, get_##_func, set_##_func)
967
968#define ide_decl_devset(_name) \
969extern const struct ide_devset ide_devset_##_name
970
971ide_decl_devset(io_32bit);
972ide_decl_devset(keepsettings);
973ide_decl_devset(pio_mode);
974ide_decl_devset(unmaskirq);
975ide_decl_devset(using_dma);
755 976
756#ifdef CONFIG_IDE_PROC_FS 977#ifdef CONFIG_IDE_PROC_FS
757/* 978/*
758 * configurable drive settings 979 * /proc/ide interface
759 */ 980 */
760 981
761#define TYPE_INT 0 982#define ide_devset_rw_field(_name, _field) \
762#define TYPE_BYTE 1 983ide_devset_get(_name, _field); \
763#define TYPE_SHORT 2 984ide_devset_set(_name, _field); \
985IDE_DEVSET(_name, DS_SYNC, get_##_name, set_##_name)
986
987#define ide_devset_rw_flag(_name, _field) \
988ide_devset_get_flag(_name, _field); \
989ide_devset_set_flag(_name, _field); \
990IDE_DEVSET(_name, DS_SYNC, get_##_name, set_##_name)
991
992struct ide_proc_devset {
993 const char *name;
994 const struct ide_devset *setting;
995 int min, max;
996 int (*mulf)(ide_drive_t *);
997 int (*divf)(ide_drive_t *);
998};
764 999
765#define SETTING_READ (1 << 0) 1000#define __IDE_PROC_DEVSET(_name, _min, _max, _mulf, _divf) { \
766#define SETTING_WRITE (1 << 1) 1001 .name = __stringify(_name), \
767#define SETTING_RW (SETTING_READ | SETTING_WRITE) 1002 .setting = &ide_devset_##_name, \
1003 .min = _min, \
1004 .max = _max, \
1005 .mulf = _mulf, \
1006 .divf = _divf, \
1007}
768 1008
769typedef int (ide_procset_t)(ide_drive_t *, int); 1009#define IDE_PROC_DEVSET(_name, _min, _max) \
770typedef struct ide_settings_s { 1010__IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL)
771 char *name;
772 int rw;
773 int data_type;
774 int min;
775 int max;
776 int mul_factor;
777 int div_factor;
778 void *data;
779 ide_procset_t *set;
780 int auto_remove;
781 struct ide_settings_s *next;
782} ide_settings_t;
783
784int ide_add_setting(ide_drive_t *, const char *, int, int, int, int, int, int, void *, ide_procset_t *set);
785 1011
786/*
787 * /proc/ide interface
788 */
789typedef struct { 1012typedef struct {
790 const char *name; 1013 const char *name;
791 mode_t mode; 1014 mode_t mode;
@@ -802,8 +1025,6 @@ void ide_proc_unregister_port(ide_hwif_t *);
802void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); 1025void ide_proc_register_driver(ide_drive_t *, ide_driver_t *);
803void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); 1026void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *);
804 1027
805void ide_add_generic_settings(ide_drive_t *);
806
807read_proc_t proc_ide_read_capacity; 1028read_proc_t proc_ide_read_capacity;
808read_proc_t proc_ide_read_geometry; 1029read_proc_t proc_ide_read_geometry;
809 1030
@@ -831,41 +1052,58 @@ static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; }
831static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } 1052static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; }
832static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } 1053static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; }
833static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } 1054static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; }
834static inline void ide_add_generic_settings(ide_drive_t *drive) { ; }
835#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; 1055#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
836#endif 1056#endif
837 1057
1058enum {
1059 /* enter/exit functions */
1060 IDE_DBG_FUNC = (1 << 0),
1061 /* sense key/asc handling */
1062 IDE_DBG_SENSE = (1 << 1),
1063 /* packet commands handling */
1064 IDE_DBG_PC = (1 << 2),
1065 /* request handling */
1066 IDE_DBG_RQ = (1 << 3),
1067 /* driver probing/setup */
1068 IDE_DBG_PROBE = (1 << 4),
1069};
1070
1071/* DRV_NAME has to be defined in the driver before using the macro below */
1072#define __ide_debug_log(lvl, fmt, args...) \
1073{ \
1074 if (unlikely(drive->debug_mask & lvl)) \
1075 printk(KERN_INFO DRV_NAME ": " fmt, ## args); \
1076}
1077
838/* 1078/*
839 * Power Management step value (rq->pm->pm_step). 1079 * Power Management state machine (rq->pm->pm_step).
840 *
841 * The step value starts at 0 (ide_pm_state_start_suspend) for a
842 * suspend operation or 1000 (ide_pm_state_start_resume) for a
843 * resume operation.
844 * 1080 *
845 * For each step, the core calls the subdriver start_power_step() first. 1081 * For each step, the core calls ide_start_power_step() first.
846 * This can return: 1082 * This can return:
847 * - ide_stopped : In this case, the core calls us back again unless 1083 * - ide_stopped : In this case, the core calls us back again unless
848 * step have been set to ide_power_state_completed. 1084 * step have been set to ide_power_state_completed.
849 * - ide_started : In this case, the channel is left busy until an 1085 * - ide_started : In this case, the channel is left busy until an
850 * async event (interrupt) occurs. 1086 * async event (interrupt) occurs.
851 * Typically, start_power_step() will issue a taskfile request with 1087 * Typically, ide_start_power_step() will issue a taskfile request with
852 * do_rw_taskfile(). 1088 * do_rw_taskfile().
853 * 1089 *
854 * Upon reception of the interrupt, the core will call complete_power_step() 1090 * Upon reception of the interrupt, the core will call ide_complete_power_step()
855 * with the error code if any. This routine should update the step value 1091 * with the error code if any. This routine should update the step value
856 * and return. It should not start a new request. The core will call 1092 * and return. It should not start a new request. The core will call
857 * start_power_step for the new step value, unless step have been set to 1093 * ide_start_power_step() for the new step value, unless step have been
858 * ide_power_state_completed. 1094 * set to IDE_PM_COMPLETED.
859 *
860 * Subdrivers are expected to define their own additional power
861 * steps from 1..999 for suspend and from 1001..1999 for resume,
862 * other values are reserved for future use.
863 */ 1095 */
864
865enum { 1096enum {
866 ide_pm_state_completed = -1, 1097 IDE_PM_START_SUSPEND,
867 ide_pm_state_start_suspend = 0, 1098 IDE_PM_FLUSH_CACHE = IDE_PM_START_SUSPEND,
868 ide_pm_state_start_resume = 1000, 1099 IDE_PM_STANDBY,
1100
1101 IDE_PM_START_RESUME,
1102 IDE_PM_RESTORE_PIO = IDE_PM_START_RESUME,
1103 IDE_PM_IDLE,
1104 IDE_PM_RESTORE_DMA,
1105
1106 IDE_PM_COMPLETED,
869}; 1107};
870 1108
871/* 1109/*
@@ -876,8 +1114,6 @@ enum {
876 */ 1114 */
877struct ide_driver_s { 1115struct ide_driver_s {
878 const char *version; 1116 const char *version;
879 u8 media;
880 unsigned supports_dsc_overlap : 1;
881 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); 1117 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
882 int (*end_request)(ide_drive_t *, int, int); 1118 int (*end_request)(ide_drive_t *, int, int);
883 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); 1119 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);
@@ -887,7 +1123,8 @@ struct ide_driver_s {
887 void (*resume)(ide_drive_t *); 1123 void (*resume)(ide_drive_t *);
888 void (*shutdown)(ide_drive_t *); 1124 void (*shutdown)(ide_drive_t *);
889#ifdef CONFIG_IDE_PROC_FS 1125#ifdef CONFIG_IDE_PROC_FS
890 ide_proc_entry_t *proc; 1126 ide_proc_entry_t *proc;
1127 const struct ide_proc_devset *settings;
891#endif 1128#endif
892}; 1129};
893 1130
@@ -896,7 +1133,17 @@ struct ide_driver_s {
896int ide_device_get(ide_drive_t *); 1133int ide_device_get(ide_drive_t *);
897void ide_device_put(ide_drive_t *); 1134void ide_device_put(ide_drive_t *);
898 1135
899int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); 1136struct ide_ioctl_devset {
1137 unsigned int get_ioctl;
1138 unsigned int set_ioctl;
1139 const struct ide_devset *setting;
1140};
1141
1142int ide_setting_ioctl(ide_drive_t *, struct block_device *, unsigned int,
1143 unsigned long, const struct ide_ioctl_devset *);
1144
1145int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *,
1146 unsigned, unsigned long);
900 1147
901extern int ide_vlb_clk; 1148extern int ide_vlb_clk;
902extern int ide_pci_clk; 1149extern int ide_pci_clk;
@@ -918,122 +1165,23 @@ ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
918 1165
919ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); 1166ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
920 1167
921extern void ide_fix_driveid(struct hd_driveid *); 1168void ide_fix_driveid(u16 *);
922 1169
923extern void ide_fixstring(u8 *, const int, const int); 1170extern void ide_fixstring(u8 *, const int, const int);
924 1171
1172int ide_busy_sleep(ide_hwif_t *, unsigned long, int);
1173
925int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); 1174int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
926 1175
927extern ide_startstop_t ide_do_reset (ide_drive_t *); 1176extern ide_startstop_t ide_do_reset (ide_drive_t *);
928 1177
1178extern int ide_devset_execute(ide_drive_t *drive,
1179 const struct ide_devset *setting, int arg);
1180
929extern void ide_do_drive_cmd(ide_drive_t *, struct request *); 1181extern void ide_do_drive_cmd(ide_drive_t *, struct request *);
930 1182
931extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); 1183extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
932 1184
933enum {
934 IDE_TFLAG_LBA48 = (1 << 0),
935 IDE_TFLAG_FLAGGED = (1 << 2),
936 IDE_TFLAG_OUT_DATA = (1 << 3),
937 IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4),
938 IDE_TFLAG_OUT_HOB_NSECT = (1 << 5),
939 IDE_TFLAG_OUT_HOB_LBAL = (1 << 6),
940 IDE_TFLAG_OUT_HOB_LBAM = (1 << 7),
941 IDE_TFLAG_OUT_HOB_LBAH = (1 << 8),
942 IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE |
943 IDE_TFLAG_OUT_HOB_NSECT |
944 IDE_TFLAG_OUT_HOB_LBAL |
945 IDE_TFLAG_OUT_HOB_LBAM |
946 IDE_TFLAG_OUT_HOB_LBAH,
947 IDE_TFLAG_OUT_FEATURE = (1 << 9),
948 IDE_TFLAG_OUT_NSECT = (1 << 10),
949 IDE_TFLAG_OUT_LBAL = (1 << 11),
950 IDE_TFLAG_OUT_LBAM = (1 << 12),
951 IDE_TFLAG_OUT_LBAH = (1 << 13),
952 IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE |
953 IDE_TFLAG_OUT_NSECT |
954 IDE_TFLAG_OUT_LBAL |
955 IDE_TFLAG_OUT_LBAM |
956 IDE_TFLAG_OUT_LBAH,
957 IDE_TFLAG_OUT_DEVICE = (1 << 14),
958 IDE_TFLAG_WRITE = (1 << 15),
959 IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16),
960 IDE_TFLAG_IN_DATA = (1 << 17),
961 IDE_TFLAG_CUSTOM_HANDLER = (1 << 18),
962 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 19),
963 IDE_TFLAG_IN_HOB_FEATURE = (1 << 20),
964 IDE_TFLAG_IN_HOB_NSECT = (1 << 21),
965 IDE_TFLAG_IN_HOB_LBAL = (1 << 22),
966 IDE_TFLAG_IN_HOB_LBAM = (1 << 23),
967 IDE_TFLAG_IN_HOB_LBAH = (1 << 24),
968 IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL |
969 IDE_TFLAG_IN_HOB_LBAM |
970 IDE_TFLAG_IN_HOB_LBAH,
971 IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE |
972 IDE_TFLAG_IN_HOB_NSECT |
973 IDE_TFLAG_IN_HOB_LBA,
974 IDE_TFLAG_IN_FEATURE = (1 << 1),
975 IDE_TFLAG_IN_NSECT = (1 << 25),
976 IDE_TFLAG_IN_LBAL = (1 << 26),
977 IDE_TFLAG_IN_LBAM = (1 << 27),
978 IDE_TFLAG_IN_LBAH = (1 << 28),
979 IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL |
980 IDE_TFLAG_IN_LBAM |
981 IDE_TFLAG_IN_LBAH,
982 IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
983 IDE_TFLAG_IN_LBA,
984 IDE_TFLAG_IN_DEVICE = (1 << 29),
985 IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB |
986 IDE_TFLAG_IN_HOB,
987 IDE_TFLAG_TF = IDE_TFLAG_OUT_TF |
988 IDE_TFLAG_IN_TF,
989 IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE |
990 IDE_TFLAG_IN_DEVICE,
991 /* force 16-bit I/O operations */
992 IDE_TFLAG_IO_16BIT = (1 << 30),
993 /* ide_task_t was allocated using kmalloc() */
994 IDE_TFLAG_DYN = (1 << 31),
995};
996
997struct ide_taskfile {
998 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */
999
1000 u8 hob_feature; /* 1-5: additional data to support LBA48 */
1001 u8 hob_nsect;
1002 u8 hob_lbal;
1003 u8 hob_lbam;
1004 u8 hob_lbah;
1005
1006 u8 data; /* 6: low data byte (for TASKFILE IOCTL) */
1007
1008 union { /*  7: */
1009 u8 error; /* read: error */
1010 u8 feature; /* write: feature */
1011 };
1012
1013 u8 nsect; /* 8: number of sectors */
1014 u8 lbal; /* 9: LBA low */
1015 u8 lbam; /* 10: LBA mid */
1016 u8 lbah; /* 11: LBA high */
1017
1018 u8 device; /* 12: device select */
1019
1020 union { /* 13: */
1021 u8 status; /*  read: status  */
1022 u8 command; /* write: command */
1023 };
1024};
1025
1026typedef struct ide_task_s {
1027 union {
1028 struct ide_taskfile tf;
1029 u8 tf_array[14];
1030 };
1031 u32 tf_flags;
1032 int data_phase;
1033 struct request *rq; /* copy of request */
1034 void *special; /* valid_t generally */
1035} ide_task_t;
1036
1037void ide_tf_dump(const char *, struct ide_taskfile *); 1185void ide_tf_dump(const char *, struct ide_taskfile *);
1038 1186
1039void ide_exec_command(ide_hwif_t *, u8); 1187void ide_exec_command(ide_hwif_t *, u8);
@@ -1049,6 +1197,8 @@ void ide_tf_read(ide_drive_t *, ide_task_t *);
1049void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); 1197void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int);
1050void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); 1198void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int);
1051 1199
1200int ide_io_buffers(ide_drive_t *, struct ide_atapi_pc *, unsigned int, int);
1201
1052extern void SELECT_DRIVE(ide_drive_t *); 1202extern void SELECT_DRIVE(ide_drive_t *);
1053void SELECT_MASK(ide_drive_t *, int); 1203void SELECT_MASK(ide_drive_t *, int);
1054 1204
@@ -1059,16 +1209,46 @@ extern int drive_is_ready(ide_drive_t *);
1059 1209
1060void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); 1210void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8);
1061 1211
1062ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, 1212int ide_check_atapi_device(ide_drive_t *, const char *);
1063 ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, 1213
1064 void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *), 1214void ide_init_pc(struct ide_atapi_pc *);
1065 void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *), 1215
1066 void (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned int, 1216/* Disk head parking */
1067 int)); 1217extern wait_queue_head_t ide_park_wq;
1068ide_startstop_t ide_transfer_pc(ide_drive_t *, struct ide_atapi_pc *, 1218ssize_t ide_park_show(struct device *dev, struct device_attribute *attr,
1069 ide_handler_t *, unsigned int, ide_expiry_t *); 1219 char *buf);
1070ide_startstop_t ide_issue_pc(ide_drive_t *, struct ide_atapi_pc *, 1220ssize_t ide_park_store(struct device *dev, struct device_attribute *attr,
1071 ide_handler_t *, unsigned int, ide_expiry_t *); 1221 const char *buf, size_t len);
1222
1223/*
1224 * Special requests for ide-tape block device strategy routine.
1225 *
1226 * In order to service a character device command, we add special requests to
1227 * the tail of our block device request queue and wait for their completion.
1228 */
1229enum {
1230 REQ_IDETAPE_PC1 = (1 << 0), /* packet command (first stage) */
1231 REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */
1232 REQ_IDETAPE_READ = (1 << 2),
1233 REQ_IDETAPE_WRITE = (1 << 3),
1234};
1235
1236int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *);
1237
1238int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *);
1239int ide_do_start_stop(ide_drive_t *, struct gendisk *, int);
1240int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
1241void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *);
1242void ide_retry_pc(ide_drive_t *, struct gendisk *);
1243
1244static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc)
1245{
1246 return max_t(unsigned long, WAIT_CMD, pc->timeout - jiffies);
1247}
1248
1249int ide_scsi_expiry(ide_drive_t *);
1250
1251ide_startstop_t ide_issue_pc(ide_drive_t *, unsigned int, ide_expiry_t *);
1072 1252
1073ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); 1253ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
1074 1254
@@ -1078,8 +1258,6 @@ int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
1078int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); 1258int ide_no_data_taskfile(ide_drive_t *, ide_task_t *);
1079 1259
1080int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); 1260int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
1081int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);
1082int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long);
1083 1261
1084extern int ide_driveid_update(ide_drive_t *); 1262extern int ide_driveid_update(ide_drive_t *);
1085extern int ide_config_drive_speed(ide_drive_t *, u8); 1263extern int ide_config_drive_speed(ide_drive_t *, u8);
@@ -1090,7 +1268,6 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout);
1090 1268
1091extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); 1269extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
1092 1270
1093extern int ide_spin_wait_hwgroup(ide_drive_t *);
1094extern void ide_timer_expiry(unsigned long); 1271extern void ide_timer_expiry(unsigned long);
1095extern irqreturn_t ide_intr(int irq, void *dev_id); 1272extern irqreturn_t ide_intr(int irq, void *dev_id);
1096extern void do_ide_request(struct request_queue *); 1273extern void do_ide_request(struct request_queue *);
@@ -1111,7 +1288,6 @@ void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
1111#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 1288#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
1112int ide_pci_set_master(struct pci_dev *, const char *); 1289int ide_pci_set_master(struct pci_dev *, const char *);
1113unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); 1290unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *);
1114extern const struct ide_dma_ops sff_dma_ops;
1115int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); 1291int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *);
1116int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); 1292int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
1117#else 1293#else
@@ -1228,6 +1404,14 @@ int ide_pci_init_two(struct pci_dev *, struct pci_dev *,
1228 const struct ide_port_info *, void *); 1404 const struct ide_port_info *, void *);
1229void ide_pci_remove(struct pci_dev *); 1405void ide_pci_remove(struct pci_dev *);
1230 1406
1407#ifdef CONFIG_PM
1408int ide_pci_suspend(struct pci_dev *, pm_message_t);
1409int ide_pci_resume(struct pci_dev *);
1410#else
1411#define ide_pci_suspend NULL
1412#define ide_pci_resume NULL
1413#endif
1414
1231void ide_map_sg(ide_drive_t *, struct request *); 1415void ide_map_sg(ide_drive_t *, struct request *);
1232void ide_init_sg_cmd(ide_drive_t *, struct request *); 1416void ide_init_sg_cmd(ide_drive_t *, struct request *);
1233 1417
@@ -1239,9 +1423,10 @@ struct drive_list_entry {
1239 const char *id_firmware; 1423 const char *id_firmware;
1240}; 1424};
1241 1425
1242int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); 1426int ide_in_drive_list(u16 *, const struct drive_list_entry *);
1243 1427
1244#ifdef CONFIG_BLK_DEV_IDEDMA 1428#ifdef CONFIG_BLK_DEV_IDEDMA
1429int ide_dma_good_drive(ide_drive_t *);
1245int __ide_dma_bad_drive(ide_drive_t *); 1430int __ide_dma_bad_drive(ide_drive_t *);
1246int ide_id_dma_bug(ide_drive_t *); 1431int ide_id_dma_bug(ide_drive_t *);
1247 1432
@@ -1259,24 +1444,29 @@ int ide_set_dma(ide_drive_t *);
1259void ide_check_dma_crc(ide_drive_t *); 1444void ide_check_dma_crc(ide_drive_t *);
1260ide_startstop_t ide_dma_intr(ide_drive_t *); 1445ide_startstop_t ide_dma_intr(ide_drive_t *);
1261 1446
1447int ide_allocate_dma_engine(ide_hwif_t *);
1448void ide_release_dma_engine(ide_hwif_t *);
1449
1262int ide_build_sglist(ide_drive_t *, struct request *); 1450int ide_build_sglist(ide_drive_t *, struct request *);
1263void ide_destroy_dmatable(ide_drive_t *); 1451void ide_destroy_dmatable(ide_drive_t *);
1264 1452
1265#ifdef CONFIG_BLK_DEV_IDEDMA_SFF 1453#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
1454int config_drive_for_dma(ide_drive_t *);
1266extern int ide_build_dmatable(ide_drive_t *, struct request *); 1455extern int ide_build_dmatable(ide_drive_t *, struct request *);
1267int ide_allocate_dma_engine(ide_hwif_t *);
1268void ide_release_dma_engine(ide_hwif_t *);
1269
1270void ide_dma_host_set(ide_drive_t *, int); 1456void ide_dma_host_set(ide_drive_t *, int);
1271extern int ide_dma_setup(ide_drive_t *); 1457extern int ide_dma_setup(ide_drive_t *);
1272void ide_dma_exec_cmd(ide_drive_t *, u8); 1458void ide_dma_exec_cmd(ide_drive_t *, u8);
1273extern void ide_dma_start(ide_drive_t *); 1459extern void ide_dma_start(ide_drive_t *);
1274extern int __ide_dma_end(ide_drive_t *); 1460int ide_dma_end(ide_drive_t *);
1275int ide_dma_test_irq(ide_drive_t *); 1461int ide_dma_test_irq(ide_drive_t *);
1276extern void ide_dma_lost_irq(ide_drive_t *); 1462extern const struct ide_dma_ops sff_dma_ops;
1277extern void ide_dma_timeout(ide_drive_t *); 1463#else
1464static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
1278#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ 1465#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
1279 1466
1467void ide_dma_lost_irq(ide_drive_t *);
1468void ide_dma_timeout(ide_drive_t *);
1469
1280#else 1470#else
1281static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } 1471static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
1282static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } 1472static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; }
@@ -1287,11 +1477,8 @@ static inline void ide_dma_on(ide_drive_t *drive) { ; }
1287static inline void ide_dma_verbose(ide_drive_t *drive) { ; } 1477static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1288static inline int ide_set_dma(ide_drive_t *drive) { return 1; } 1478static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1289static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } 1479static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1290#endif /* CONFIG_BLK_DEV_IDEDMA */
1291
1292#ifndef CONFIG_BLK_DEV_IDEDMA_SFF
1293static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } 1480static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; }
1294#endif 1481#endif /* CONFIG_BLK_DEV_IDEDMA */
1295 1482
1296#ifdef CONFIG_BLK_DEV_IDEACPI 1483#ifdef CONFIG_BLK_DEV_IDEACPI
1297extern int ide_acpi_exec_tfs(ide_drive_t *drive); 1484extern int ide_acpi_exec_tfs(ide_drive_t *drive);
@@ -1319,7 +1506,6 @@ void ide_undecoded_slave(ide_drive_t *);
1319 1506
1320void ide_port_apply_params(ide_hwif_t *); 1507void ide_port_apply_params(ide_hwif_t *);
1321 1508
1322struct ide_host *ide_host_alloc_all(const struct ide_port_info *, hw_regs_t **);
1323struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); 1509struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **);
1324void ide_host_free(struct ide_host *); 1510void ide_host_free(struct ide_host *);
1325int ide_host_register(struct ide_host *, const struct ide_port_info *, 1511int ide_host_register(struct ide_host *, const struct ide_port_info *,
@@ -1345,24 +1531,6 @@ const char *ide_xfer_verbose(u8 mode);
1345extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1531extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1346extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1532extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
1347 1533
1348static inline int ide_dev_has_iordy(struct hd_driveid *id)
1349{
1350 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0;
1351}
1352
1353static inline int ide_dev_is_sata(struct hd_driveid *id)
1354{
1355 /*
1356 * See if word 93 is 0 AND drive is at least ATA-5 compatible
1357 * verifying that word 80 by casting it to a signed type --
1358 * this trick allows us to filter out the reserved values of
1359 * 0x0000 and 0xffff along with the earlier ATA revisions...
1360 */
1361 if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020)
1362 return 1;
1363 return 0;
1364}
1365
1366u64 ide_get_lba_addr(struct ide_taskfile *, int); 1534u64 ide_get_lba_addr(struct ide_taskfile *, int);
1367u8 ide_dump_status(ide_drive_t *, const char *, u8); 1535u8 ide_dump_status(ide_drive_t *, const char *, u8);
1368 1536
@@ -1434,13 +1602,6 @@ extern struct mutex ide_cfg_mtx;
1434extern struct bus_type ide_bus_type; 1602extern struct bus_type ide_bus_type;
1435extern struct class *ide_port_class; 1603extern struct class *ide_port_class;
1436 1604
1437/* check if CACHE FLUSH (EXT) command is supported (bits defined in ATA-6) */
1438#define ide_id_has_flush_cache(id) ((id)->cfs_enable_2 & 0x3000)
1439
1440/* some Maxtor disks have bit 13 defined incorrectly so check bit 10 too */
1441#define ide_id_has_flush_cache_ext(id) \
1442 (((id)->cfs_enable_2 & 0x2400) == 0x2400)
1443
1444static inline void ide_dump_identify(u8 *id) 1605static inline void ide_dump_identify(u8 *id)
1445{ 1606{
1446 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0); 1607 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0);
@@ -1448,14 +1609,13 @@ static inline void ide_dump_identify(u8 *id)
1448 1609
1449static inline int hwif_to_node(ide_hwif_t *hwif) 1610static inline int hwif_to_node(ide_hwif_t *hwif)
1450{ 1611{
1451 struct pci_dev *dev = to_pci_dev(hwif->dev); 1612 return hwif->dev ? dev_to_node(hwif->dev) : -1;
1452 return hwif->dev ? pcibus_to_node(dev->bus) : -1;
1453} 1613}
1454 1614
1455static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) 1615static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive)
1456{ 1616{
1457 ide_hwif_t *hwif = HWIF(drive); 1617 ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1];
1458 1618
1459 return &hwif->drives[(drive->dn ^ 1) & 1]; 1619 return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL;
1460} 1620}
1461#endif /* _IDE_H */ 1621#endif /* _IDE_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 7f4df7c7659d..14126bc36641 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -471,6 +471,11 @@ struct ieee80211s_hdr {
471 u8 eaddr3[6]; 471 u8 eaddr3[6];
472} __attribute__ ((packed)); 472} __attribute__ ((packed));
473 473
474/* Mesh flags */
475#define MESH_FLAGS_AE_A4 0x1
476#define MESH_FLAGS_AE_A5_A6 0x2
477#define MESH_FLAGS_PS_DEEP 0x4
478
474/** 479/**
475 * struct ieee80211_quiet_ie 480 * struct ieee80211_quiet_ie
476 * 481 *
@@ -643,6 +648,9 @@ struct ieee80211_mgmt {
643 } u; 648 } u;
644} __attribute__ ((packed)); 649} __attribute__ ((packed));
645 650
651/* mgmt header + 1 byte category code */
652#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
653
646 654
647/* Control frames */ 655/* Control frames */
648struct ieee80211_rts { 656struct ieee80211_rts {
@@ -708,12 +716,13 @@ struct ieee80211_ht_addt_info {
708 716
709/* 802.11n HT capabilities masks */ 717/* 802.11n HT capabilities masks */
710#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 718#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002
711#define IEEE80211_HT_CAP_MIMO_PS 0x000C 719#define IEEE80211_HT_CAP_SM_PS 0x000C
712#define IEEE80211_HT_CAP_GRN_FLD 0x0010 720#define IEEE80211_HT_CAP_GRN_FLD 0x0010
713#define IEEE80211_HT_CAP_SGI_20 0x0020 721#define IEEE80211_HT_CAP_SGI_20 0x0020
714#define IEEE80211_HT_CAP_SGI_40 0x0040 722#define IEEE80211_HT_CAP_SGI_40 0x0040
715#define IEEE80211_HT_CAP_DELAY_BA 0x0400 723#define IEEE80211_HT_CAP_DELAY_BA 0x0400
716#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 724#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
725#define IEEE80211_HT_CAP_DSSSCCK40 0x1000
717/* 802.11n HT capability AMPDU settings */ 726/* 802.11n HT capability AMPDU settings */
718#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 727#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03
719#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C 728#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C
@@ -736,11 +745,26 @@ struct ieee80211_ht_addt_info {
736#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 745#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004
737#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 746#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010
738 747
739/* MIMO Power Save Modes */ 748/* block-ack parameters */
740#define WLAN_HT_CAP_MIMO_PS_STATIC 0 749#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002
741#define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1 750#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C
742#define WLAN_HT_CAP_MIMO_PS_INVALID 2 751#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0
743#define WLAN_HT_CAP_MIMO_PS_DISABLED 3 752#define IEEE80211_DELBA_PARAM_TID_MASK 0xF000
753#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
754
755/*
756 * A-PMDU buffer sizes
757 * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
758 */
759#define IEEE80211_MIN_AMPDU_BUF 0x8
760#define IEEE80211_MAX_AMPDU_BUF 0x40
761
762
763/* Spatial Multiplexing Power Save Modes */
764#define WLAN_HT_CAP_SM_PS_STATIC 0
765#define WLAN_HT_CAP_SM_PS_DYNAMIC 1
766#define WLAN_HT_CAP_SM_PS_INVALID 2
767#define WLAN_HT_CAP_SM_PS_DISABLED 3
744 768
745/* Authentication algorithms */ 769/* Authentication algorithms */
746#define WLAN_AUTH_OPEN 0 770#define WLAN_AUTH_OPEN 0
diff --git a/include/linux/if.h b/include/linux/if.h
index 5c9d1fa93fef..65246846c844 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -24,6 +24,7 @@
24#include <linux/compiler.h> /* for "__user" et al */ 24#include <linux/compiler.h> /* for "__user" et al */
25 25
26#define IFNAMSIZ 16 26#define IFNAMSIZ 16
27#define IFALIASZ 256
27#include <linux/hdlc/ioctl.h> 28#include <linux/hdlc/ioctl.h>
28 29
29/* Standard interface flags (netdevice->flags). */ 30/* Standard interface flags (netdevice->flags). */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index e157c1399b61..7f3c735f422b 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -9,7 +9,7 @@
9 * 9 *
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 * Donald Becker, <becker@super.org> 11 * Donald Becker, <becker@super.org>
12 * Alan Cox, <alan@redhat.com> 12 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
13 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> 13 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
14 * 14 *
15 * This program is free software; you can redistribute it and/or 15 * This program is free software; you can redistribute it and/or
@@ -56,6 +56,7 @@
56#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ 56#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
57#define ETH_P_CUST 0x6006 /* DEC Customer use */ 57#define ETH_P_CUST 0x6006 /* DEC Customer use */
58#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ 58#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
59#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */
59#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ 60#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
60#define ETH_P_ATALK 0x809B /* Appletalk DDP */ 61#define ETH_P_ATALK 0x809B /* Appletalk DDP */
61#define ETH_P_AARP 0x80F3 /* Appletalk AARP */ 62#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
@@ -74,8 +75,10 @@
74#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport 75#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
75 * over Ethernet 76 * over Ethernet
76 */ 77 */
78#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
77#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ 79#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
78#define ETH_P_TIPC 0x88CA /* TIPC */ 80#define ETH_P_TIPC 0x88CA /* TIPC */
81#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
79 82
80/* 83/*
81 * Non DIX types. Won't clash for 1500 types. 84 * Non DIX types. Won't clash for 1500 types.
@@ -99,6 +102,9 @@
99#define ETH_P_ECONET 0x0018 /* Acorn Econet */ 102#define ETH_P_ECONET 0x0018 /* Acorn Econet */
100#define ETH_P_HDLC 0x0019 /* HDLC frames */ 103#define ETH_P_HDLC 0x0019 /* HDLC frames */
101#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ 104#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
105#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
106#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
107#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
102 108
103/* 109/*
104 * This is an Ethernet frame header. 110 * This is an Ethernet frame header.
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index ae77daed6c2f..45de1046dbbf 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -12,7 +12,7 @@
12 * if_fddi.h is based on previous if_ether.h and if_tr.h work by 12 * if_fddi.h is based on previous if_ether.h and if_tr.h work by
13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
14 * Donald Becker, <becker@super.org> 14 * Donald Becker, <becker@super.org>
15 * Alan Cox, <alan@redhat.com> 15 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
16 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> 16 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
17 * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> 17 * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
18 * 18 *
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h
index 94d31ca7d71a..f0f23516bb59 100644
--- a/include/linux/if_hippi.h
+++ b/include/linux/if_hippi.h
@@ -9,7 +9,7 @@
9 * 9 *
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 * Donald Becker, <becker@super.org> 11 * Donald Becker, <becker@super.org>
12 * Alan Cox, <alan@redhat.com> 12 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
13 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> 13 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
14 * Jes Sorensen, <Jes.Sorensen@cern.ch> 14 * Jes Sorensen, <Jes.Sorensen@cern.ch>
15 * 15 *
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 84c3492ae5cb..f9032c88716a 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -79,6 +79,7 @@ enum
79 IFLA_LINKINFO, 79 IFLA_LINKINFO,
80#define IFLA_LINKINFO IFLA_LINKINFO 80#define IFLA_LINKINFO IFLA_LINKINFO
81 IFLA_NET_NS_PID, 81 IFLA_NET_NS_PID,
82 IFLA_IFALIAS,
82 __IFLA_MAX 83 __IFLA_MAX
83}; 84};
84 85
diff --git a/include/linux/if_phonet.h b/include/linux/if_phonet.h
new file mode 100644
index 000000000000..d70034bcec05
--- /dev/null
+++ b/include/linux/if_phonet.h
@@ -0,0 +1,19 @@
1/*
2 * File: if_phonet.h
3 *
4 * Phonet interface kernel definitions
5 *
6 * Copyright (C) 2008 Nokia Corporation. All rights reserved.
7 */
8#ifndef LINUX_IF_PHONET_H
9#define LINUX_IF_PHONET_H
10
11#define PHONET_MIN_MTU 6 /* pn_length = 0 */
12#define PHONET_MAX_MTU 65541 /* pn_length = 0xffff */
13#define PHONET_DEV_MTU PHONET_MAX_MTU
14
15#ifdef __KERNEL__
16extern struct header_ops phonet_header_ops;
17#endif
18
19#endif
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index d4efe4014705..aeab2cb32a9c 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -2,6 +2,7 @@
2#define _IF_TUNNEL_H_ 2#define _IF_TUNNEL_H_
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/ip.h>
5 6
6#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) 7#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
7#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) 8#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
@@ -47,4 +48,22 @@ struct ip_tunnel_prl {
47/* PRL flags */ 48/* PRL flags */
48#define PRL_DEFAULT 0x0001 49#define PRL_DEFAULT 0x0001
49 50
51enum
52{
53 IFLA_GRE_UNSPEC,
54 IFLA_GRE_LINK,
55 IFLA_GRE_IFLAGS,
56 IFLA_GRE_OFLAGS,
57 IFLA_GRE_IKEY,
58 IFLA_GRE_OKEY,
59 IFLA_GRE_LOCAL,
60 IFLA_GRE_REMOTE,
61 IFLA_GRE_TTL,
62 IFLA_GRE_TOS,
63 IFLA_GRE_PMTUDISC,
64 __IFLA_GRE_MAX,
65};
66
67#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
68
50#endif /* _IF_TUNNEL_H_ */ 69#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 7bb3c095c15b..f734a0ba0698 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -2,7 +2,7 @@
2 * Linux NET3: Internet Group Management Protocol [IGMP] 2 * Linux NET3: Internet Group Management Protocol [IGMP]
3 * 3 *
4 * Authors: 4 * Authors:
5 * Alan Cox <Alan.Cox@linux.org> 5 * Alan Cox <alan@lxorguk.ukuu.org.uk>
6 * 6 *
7 * Extended to talk the BSD extended IGMP protocol of mrouted 3.6 7 * Extended to talk the BSD extended IGMP protocol of mrouted 3.6
8 * 8 *
diff --git a/include/linux/in.h b/include/linux/in.h
index 4065313cd7ee..db458beef19d 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -75,6 +75,7 @@ struct in_addr {
75#define IP_IPSEC_POLICY 16 75#define IP_IPSEC_POLICY 16
76#define IP_XFRM_POLICY 17 76#define IP_XFRM_POLICY 17
77#define IP_PASSSEC 18 77#define IP_PASSSEC 18
78#define IP_TRANSPARENT 19
78 79
79/* BSD compatibility */ 80/* BSD compatibility */
80#define IP_RECVRETOPTS IP_RETOPTS 81#define IP_RECVRETOPTS IP_RETOPTS
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index c6f51ad52d5b..06fcdb45106b 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -25,6 +25,7 @@ struct in_device
25 struct in_ifaddr *ifa_list; /* IP ifaddr chain */ 25 struct in_ifaddr *ifa_list; /* IP ifaddr chain */
26 rwlock_t mc_list_lock; 26 rwlock_t mc_list_lock;
27 struct ip_mc_list *mc_list; /* IP multicast filter chain */ 27 struct ip_mc_list *mc_list; /* IP multicast filter chain */
28 int mc_count; /* Number of installed mcasts */
28 spinlock_t mc_tomb_lock; 29 spinlock_t mc_tomb_lock;
29 struct ip_mc_list *mc_tomb; 30 struct ip_mc_list *mc_tomb;
30 unsigned long mr_v1_seen; 31 unsigned long mr_v1_seen;
diff --git a/include/linux/init.h b/include/linux/init.h
index 93538b696e3d..ad63824460e3 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -233,9 +233,6 @@ struct obs_kernel_param {
233 __attribute__((aligned((sizeof(long))))) \ 233 __attribute__((aligned((sizeof(long))))) \
234 = { __setup_str_##unique_id, fn, early } 234 = { __setup_str_##unique_id, fn, early }
235 235
236#define __setup_null_param(str, unique_id) \
237 __setup_param(str, unique_id, NULL, 0)
238
239#define __setup(str, fn) \ 236#define __setup(str, fn) \
240 __setup_param(str, fn, fn, 0) 237 __setup_param(str, fn, fn, 0)
241 238
@@ -296,7 +293,6 @@ void __init parse_early_param(void);
296 void cleanup_module(void) __attribute__((alias(#exitfn))); 293 void cleanup_module(void) __attribute__((alias(#exitfn)));
297 294
298#define __setup_param(str, unique_id, fn) /* nothing */ 295#define __setup_param(str, unique_id, fn) /* nothing */
299#define __setup_null_param(str, unique_id) /* nothing */
300#define __setup(str, func) /* nothing */ 296#define __setup(str, func) /* nothing */
301#endif 297#endif
302 298
diff --git a/include/linux/input.h b/include/linux/input.h
index a5802c9c81a4..b86fb5581ce6 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -577,9 +577,22 @@ struct input_absinfo {
577#define KEY_BRL_DOT9 0x1f9 577#define KEY_BRL_DOT9 0x1f9
578#define KEY_BRL_DOT10 0x1fa 578#define KEY_BRL_DOT10 0x1fa
579 579
580#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */
581#define KEY_NUMERIC_1 0x201 /* and other keypads */
582#define KEY_NUMERIC_2 0x202
583#define KEY_NUMERIC_3 0x203
584#define KEY_NUMERIC_4 0x204
585#define KEY_NUMERIC_5 0x205
586#define KEY_NUMERIC_6 0x206
587#define KEY_NUMERIC_7 0x207
588#define KEY_NUMERIC_8 0x208
589#define KEY_NUMERIC_9 0x209
590#define KEY_NUMERIC_STAR 0x20a
591#define KEY_NUMERIC_POUND 0x20b
592
580/* We avoid low common keys in module aliases so they don't get huge. */ 593/* We avoid low common keys in module aliases so they don't get huge. */
581#define KEY_MIN_INTERESTING KEY_MUTE 594#define KEY_MIN_INTERESTING KEY_MUTE
582#define KEY_MAX 0x1ff 595#define KEY_MAX 0x2ff
583#define KEY_CNT (KEY_MAX+1) 596#define KEY_CNT (KEY_MAX+1)
584 597
585/* 598/*
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
new file mode 100644
index 000000000000..2e117f30a76c
--- /dev/null
+++ b/include/linux/intel-iommu.h
@@ -0,0 +1,327 @@
1/*
2 * Copyright (c) 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Copyright (C) 2006-2008 Intel Corporation
18 * Author: Ashok Raj <ashok.raj@intel.com>
19 * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
20 */
21
22#ifndef _INTEL_IOMMU_H_
23#define _INTEL_IOMMU_H_
24
25#include <linux/types.h>
26#include <linux/msi.h>
27#include <linux/sysdev.h>
28#include <linux/iova.h>
29#include <linux/io.h>
30#include <linux/dma_remapping.h>
31#include <asm/cacheflush.h>
32
33/*
34 * Intel IOMMU register specification per version 1.0 public spec.
35 */
36
37#define DMAR_VER_REG 0x0 /* Arch version supported by this IOMMU */
38#define DMAR_CAP_REG 0x8 /* Hardware supported capabilities */
39#define DMAR_ECAP_REG 0x10 /* Extended capabilities supported */
40#define DMAR_GCMD_REG 0x18 /* Global command register */
41#define DMAR_GSTS_REG 0x1c /* Global status register */
42#define DMAR_RTADDR_REG 0x20 /* Root entry table */
43#define DMAR_CCMD_REG 0x28 /* Context command reg */
44#define DMAR_FSTS_REG 0x34 /* Fault Status register */
45#define DMAR_FECTL_REG 0x38 /* Fault control register */
46#define DMAR_FEDATA_REG 0x3c /* Fault event interrupt data register */
47#define DMAR_FEADDR_REG 0x40 /* Fault event interrupt addr register */
48#define DMAR_FEUADDR_REG 0x44 /* Upper address register */
49#define DMAR_AFLOG_REG 0x58 /* Advanced Fault control */
50#define DMAR_PMEN_REG 0x64 /* Enable Protected Memory Region */
51#define DMAR_PLMBASE_REG 0x68 /* PMRR Low addr */
52#define DMAR_PLMLIMIT_REG 0x6c /* PMRR low limit */
53#define DMAR_PHMBASE_REG 0x70 /* pmrr high base addr */
54#define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */
55#define DMAR_IQH_REG 0x80 /* Invalidation queue head register */
56#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */
57#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */
58#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */
59#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */
60
61#define OFFSET_STRIDE (9)
62/*
63#define dmar_readl(dmar, reg) readl(dmar + reg)
64#define dmar_readq(dmar, reg) ({ \
65 u32 lo, hi; \
66 lo = readl(dmar + reg); \
67 hi = readl(dmar + reg + 4); \
68 (((u64) hi) << 32) + lo; })
69*/
70static inline u64 dmar_readq(void __iomem *addr)
71{
72 u32 lo, hi;
73 lo = readl(addr);
74 hi = readl(addr + 4);
75 return (((u64) hi) << 32) + lo;
76}
77
78static inline void dmar_writeq(void __iomem *addr, u64 val)
79{
80 writel((u32)val, addr);
81 writel((u32)(val >> 32), addr + 4);
82}
83
84#define DMAR_VER_MAJOR(v) (((v) & 0xf0) >> 4)
85#define DMAR_VER_MINOR(v) ((v) & 0x0f)
86
87/*
88 * Decoding Capability Register
89 */
90#define cap_read_drain(c) (((c) >> 55) & 1)
91#define cap_write_drain(c) (((c) >> 54) & 1)
92#define cap_max_amask_val(c) (((c) >> 48) & 0x3f)
93#define cap_num_fault_regs(c) ((((c) >> 40) & 0xff) + 1)
94#define cap_pgsel_inv(c) (((c) >> 39) & 1)
95
96#define cap_super_page_val(c) (((c) >> 34) & 0xf)
97#define cap_super_offset(c) (((find_first_bit(&cap_super_page_val(c), 4)) \
98 * OFFSET_STRIDE) + 21)
99
100#define cap_fault_reg_offset(c) ((((c) >> 24) & 0x3ff) * 16)
101#define cap_max_fault_reg_offset(c) \
102 (cap_fault_reg_offset(c) + cap_num_fault_regs(c) * 16)
103
104#define cap_zlr(c) (((c) >> 22) & 1)
105#define cap_isoch(c) (((c) >> 23) & 1)
106#define cap_mgaw(c) ((((c) >> 16) & 0x3f) + 1)
107#define cap_sagaw(c) (((c) >> 8) & 0x1f)
108#define cap_caching_mode(c) (((c) >> 7) & 1)
109#define cap_phmr(c) (((c) >> 6) & 1)
110#define cap_plmr(c) (((c) >> 5) & 1)
111#define cap_rwbf(c) (((c) >> 4) & 1)
112#define cap_afl(c) (((c) >> 3) & 1)
113#define cap_ndoms(c) (((unsigned long)1) << (4 + 2 * ((c) & 0x7)))
114/*
115 * Extended Capability Register
116 */
117
118#define ecap_niotlb_iunits(e) ((((e) >> 24) & 0xff) + 1)
119#define ecap_iotlb_offset(e) ((((e) >> 8) & 0x3ff) * 16)
120#define ecap_max_iotlb_offset(e) \
121 (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16)
122#define ecap_coherent(e) ((e) & 0x1)
123#define ecap_qis(e) ((e) & 0x2)
124#define ecap_eim_support(e) ((e >> 4) & 0x1)
125#define ecap_ir_support(e) ((e >> 3) & 0x1)
126#define ecap_max_handle_mask(e) ((e >> 20) & 0xf)
127
128
129/* IOTLB_REG */
130#define DMA_TLB_GLOBAL_FLUSH (((u64)1) << 60)
131#define DMA_TLB_DSI_FLUSH (((u64)2) << 60)
132#define DMA_TLB_PSI_FLUSH (((u64)3) << 60)
133#define DMA_TLB_IIRG(type) ((type >> 60) & 7)
134#define DMA_TLB_IAIG(val) (((val) >> 57) & 7)
135#define DMA_TLB_READ_DRAIN (((u64)1) << 49)
136#define DMA_TLB_WRITE_DRAIN (((u64)1) << 48)
137#define DMA_TLB_DID(id) (((u64)((id) & 0xffff)) << 32)
138#define DMA_TLB_IVT (((u64)1) << 63)
139#define DMA_TLB_IH_NONLEAF (((u64)1) << 6)
140#define DMA_TLB_MAX_SIZE (0x3f)
141
142/* INVALID_DESC */
143#define DMA_ID_TLB_GLOBAL_FLUSH (((u64)1) << 3)
144#define DMA_ID_TLB_DSI_FLUSH (((u64)2) << 3)
145#define DMA_ID_TLB_PSI_FLUSH (((u64)3) << 3)
146#define DMA_ID_TLB_READ_DRAIN (((u64)1) << 7)
147#define DMA_ID_TLB_WRITE_DRAIN (((u64)1) << 6)
148#define DMA_ID_TLB_DID(id) (((u64)((id & 0xffff) << 16)))
149#define DMA_ID_TLB_IH_NONLEAF (((u64)1) << 6)
150#define DMA_ID_TLB_ADDR(addr) (addr)
151#define DMA_ID_TLB_ADDR_MASK(mask) (mask)
152
153/* PMEN_REG */
154#define DMA_PMEN_EPM (((u32)1)<<31)
155#define DMA_PMEN_PRS (((u32)1)<<0)
156
157/* GCMD_REG */
158#define DMA_GCMD_TE (((u32)1) << 31)
159#define DMA_GCMD_SRTP (((u32)1) << 30)
160#define DMA_GCMD_SFL (((u32)1) << 29)
161#define DMA_GCMD_EAFL (((u32)1) << 28)
162#define DMA_GCMD_WBF (((u32)1) << 27)
163#define DMA_GCMD_QIE (((u32)1) << 26)
164#define DMA_GCMD_SIRTP (((u32)1) << 24)
165#define DMA_GCMD_IRE (((u32) 1) << 25)
166
167/* GSTS_REG */
168#define DMA_GSTS_TES (((u32)1) << 31)
169#define DMA_GSTS_RTPS (((u32)1) << 30)
170#define DMA_GSTS_FLS (((u32)1) << 29)
171#define DMA_GSTS_AFLS (((u32)1) << 28)
172#define DMA_GSTS_WBFS (((u32)1) << 27)
173#define DMA_GSTS_QIES (((u32)1) << 26)
174#define DMA_GSTS_IRTPS (((u32)1) << 24)
175#define DMA_GSTS_IRES (((u32)1) << 25)
176
177/* CCMD_REG */
178#define DMA_CCMD_ICC (((u64)1) << 63)
179#define DMA_CCMD_GLOBAL_INVL (((u64)1) << 61)
180#define DMA_CCMD_DOMAIN_INVL (((u64)2) << 61)
181#define DMA_CCMD_DEVICE_INVL (((u64)3) << 61)
182#define DMA_CCMD_FM(m) (((u64)((m) & 0x3)) << 32)
183#define DMA_CCMD_MASK_NOBIT 0
184#define DMA_CCMD_MASK_1BIT 1
185#define DMA_CCMD_MASK_2BIT 2
186#define DMA_CCMD_MASK_3BIT 3
187#define DMA_CCMD_SID(s) (((u64)((s) & 0xffff)) << 16)
188#define DMA_CCMD_DID(d) ((u64)((d) & 0xffff))
189
190/* FECTL_REG */
191#define DMA_FECTL_IM (((u32)1) << 31)
192
193/* FSTS_REG */
194#define DMA_FSTS_PPF ((u32)2)
195#define DMA_FSTS_PFO ((u32)1)
196#define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
197
198/* FRCD_REG, 32 bits access */
199#define DMA_FRCD_F (((u32)1) << 31)
200#define dma_frcd_type(d) ((d >> 30) & 1)
201#define dma_frcd_fault_reason(c) (c & 0xff)
202#define dma_frcd_source_id(c) (c & 0xffff)
203#define dma_frcd_page_addr(d) (d & (((u64)-1) << 12)) /* low 64 bit */
204
205#define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) /* 10sec */
206
207#define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \
208{\
209 cycles_t start_time = get_cycles();\
210 while (1) {\
211 sts = op (iommu->reg + offset);\
212 if (cond)\
213 break;\
214 if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start_time))\
215 panic("DMAR hardware is malfunctioning\n");\
216 cpu_relax();\
217 }\
218}
219
220#define QI_LENGTH 256 /* queue length */
221
222enum {
223 QI_FREE,
224 QI_IN_USE,
225 QI_DONE
226};
227
228#define QI_CC_TYPE 0x1
229#define QI_IOTLB_TYPE 0x2
230#define QI_DIOTLB_TYPE 0x3
231#define QI_IEC_TYPE 0x4
232#define QI_IWD_TYPE 0x5
233
234#define QI_IEC_SELECTIVE (((u64)1) << 4)
235#define QI_IEC_IIDEX(idx) (((u64)(idx & 0xffff) << 32))
236#define QI_IEC_IM(m) (((u64)(m & 0x1f) << 27))
237
238#define QI_IWD_STATUS_DATA(d) (((u64)d) << 32)
239#define QI_IWD_STATUS_WRITE (((u64)1) << 5)
240
241struct qi_desc {
242 u64 low, high;
243};
244
245struct q_inval {
246 spinlock_t q_lock;
247 struct qi_desc *desc; /* invalidation queue */
248 int *desc_status; /* desc status */
249 int free_head; /* first free entry */
250 int free_tail; /* last free entry */
251 int free_cnt;
252};
253
254#ifdef CONFIG_INTR_REMAP
255/* 1MB - maximum possible interrupt remapping table size */
256#define INTR_REMAP_PAGE_ORDER 8
257#define INTR_REMAP_TABLE_REG_SIZE 0xf
258
259#define INTR_REMAP_TABLE_ENTRIES 65536
260
261struct ir_table {
262 struct irte *base;
263};
264#endif
265
266struct intel_iommu {
267 void __iomem *reg; /* Pointer to hardware regs, virtual addr */
268 u64 cap;
269 u64 ecap;
270 int seg;
271 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */
272 spinlock_t register_lock; /* protect register handling */
273 int seq_id; /* sequence id of the iommu */
274
275#ifdef CONFIG_DMAR
276 unsigned long *domain_ids; /* bitmap of domains */
277 struct dmar_domain **domains; /* ptr to domains */
278 spinlock_t lock; /* protect context, domain ids */
279 struct root_entry *root_entry; /* virtual address */
280
281 unsigned int irq;
282 unsigned char name[7]; /* Device Name */
283 struct msi_msg saved_msg;
284 struct sys_device sysdev;
285#endif
286 struct q_inval *qi; /* Queued invalidation info */
287#ifdef CONFIG_INTR_REMAP
288 struct ir_table *ir_table; /* Interrupt remapping info */
289#endif
290};
291
292static inline void __iommu_flush_cache(
293 struct intel_iommu *iommu, void *addr, int size)
294{
295 if (!ecap_coherent(iommu->ecap))
296 clflush_cache_range(addr, size);
297}
298
299extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);
300
301extern int alloc_iommu(struct dmar_drhd_unit *drhd);
302extern void free_iommu(struct intel_iommu *iommu);
303extern int dmar_enable_qi(struct intel_iommu *iommu);
304extern void qi_global_iec(struct intel_iommu *iommu);
305
306extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
307
308void intel_iommu_domain_exit(struct dmar_domain *domain);
309struct dmar_domain *intel_iommu_domain_alloc(struct pci_dev *pdev);
310int intel_iommu_context_mapping(struct dmar_domain *domain,
311 struct pci_dev *pdev);
312int intel_iommu_page_mapping(struct dmar_domain *domain, dma_addr_t iova,
313 u64 hpa, size_t size, int prot);
314void intel_iommu_detach_dev(struct dmar_domain *domain, u8 bus, u8 devfn);
315struct dmar_domain *intel_iommu_find_domain(struct pci_dev *pdev);
316u64 intel_iommu_iova_to_pfn(struct dmar_domain *domain, u64 iova);
317
318#ifdef CONFIG_DMAR
319int intel_iommu_found(void);
320#else /* CONFIG_DMAR */
321static inline int intel_iommu_found(void)
322{
323 return 0;
324}
325#endif /* CONFIG_DMAR */
326
327#endif
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 58ff4e74b2f3..35a61dc60d51 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -11,6 +11,8 @@
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/irqflags.h> 13#include <linux/irqflags.h>
14#include <linux/smp.h>
15#include <linux/percpu.h>
14#include <asm/atomic.h> 16#include <asm/atomic.h>
15#include <asm/ptrace.h> 17#include <asm/ptrace.h>
16#include <asm/system.h> 18#include <asm/system.h>
@@ -252,6 +254,8 @@ enum
252 HRTIMER_SOFTIRQ, 254 HRTIMER_SOFTIRQ,
253#endif 255#endif
254 RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ 256 RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
257
258 NR_SOFTIRQS
255}; 259};
256 260
257/* softirq mask and active fields moved to irq_cpustat_t in 261/* softirq mask and active fields moved to irq_cpustat_t in
@@ -271,6 +275,25 @@ extern void softirq_init(void);
271extern void raise_softirq_irqoff(unsigned int nr); 275extern void raise_softirq_irqoff(unsigned int nr);
272extern void raise_softirq(unsigned int nr); 276extern void raise_softirq(unsigned int nr);
273 277
278/* This is the worklist that queues up per-cpu softirq work.
279 *
280 * send_remote_sendirq() adds work to these lists, and
281 * the softirq handler itself dequeues from them. The queues
282 * are protected by disabling local cpu interrupts and they must
283 * only be accessed by the local cpu that they are for.
284 */
285DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list);
286
287/* Try to send a softirq to a remote cpu. If this cannot be done, the
288 * work will be queued to the local cpu.
289 */
290extern void send_remote_softirq(struct call_single_data *cp, int cpu, int softirq);
291
292/* Like send_remote_softirq(), but the caller must disable local cpu interrupts
293 * and compute the current cpu, passed in as 'this_cpu'.
294 */
295extern void __send_remote_softirq(struct call_single_data *cp, int cpu,
296 int this_cpu, int softirq);
274 297
275/* Tasklets --- multithreaded analogue of BHs. 298/* Tasklets --- multithreaded analogue of BHs.
276 299
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h
index c975caf75385..3b068e5b5671 100644
--- a/include/linux/iommu-helper.h
+++ b/include/linux/iommu-helper.h
@@ -1,6 +1,20 @@
1#ifndef _LINUX_IOMMU_HELPER_H
2#define _LINUX_IOMMU_HELPER_H
3
4static inline unsigned long iommu_device_max_index(unsigned long size,
5 unsigned long offset,
6 u64 dma_mask)
7{
8 if (size + offset > dma_mask)
9 return dma_mask - offset + 1;
10 else
11 return size;
12}
13
1extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, 14extern int iommu_is_span_boundary(unsigned int index, unsigned int nr,
2 unsigned long shift, 15 unsigned long shift,
3 unsigned long boundary_size); 16 unsigned long boundary_size);
17extern void iommu_area_reserve(unsigned long *map, unsigned long i, int len);
4extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, 18extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
5 unsigned long start, unsigned int nr, 19 unsigned long start, unsigned int nr,
6 unsigned long shift, 20 unsigned long shift,
@@ -8,3 +22,8 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
8 unsigned long align_mask); 22 unsigned long align_mask);
9extern void iommu_area_free(unsigned long *map, unsigned long start, 23extern void iommu_area_free(unsigned long *map, unsigned long start,
10 unsigned int nr); 24 unsigned int nr);
25
26extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len,
27 unsigned long io_page_size);
28
29#endif
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 22d2115458c6..041e95aac2bf 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -34,7 +34,8 @@ struct resource_list {
34 */ 34 */
35#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ 35#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
36 36
37#define IORESOURCE_IO 0x00000100 /* Resource type */ 37#define IORESOURCE_TYPE_BITS 0x00000f00 /* Resource type */
38#define IORESOURCE_IO 0x00000100
38#define IORESOURCE_MEM 0x00000200 39#define IORESOURCE_MEM 0x00000200
39#define IORESOURCE_IRQ 0x00000400 40#define IORESOURCE_IRQ 0x00000400
40#define IORESOURCE_DMA 0x00000800 41#define IORESOURCE_DMA 0x00000800
@@ -108,7 +109,11 @@ extern struct resource iomem_resource;
108 109
109extern int request_resource(struct resource *root, struct resource *new); 110extern int request_resource(struct resource *root, struct resource *new);
110extern int release_resource(struct resource *new); 111extern int release_resource(struct resource *new);
112extern void reserve_region_with_split(struct resource *root,
113 resource_size_t start, resource_size_t end,
114 const char *name);
111extern int insert_resource(struct resource *parent, struct resource *new); 115extern int insert_resource(struct resource *parent, struct resource *new);
116extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
112extern int allocate_resource(struct resource *root, struct resource *new, 117extern int allocate_resource(struct resource *root, struct resource *new,
113 resource_size_t size, resource_size_t min, 118 resource_size_t size, resource_size_t min,
114 resource_size_t max, resource_size_t align, 119 resource_size_t max, resource_size_t align,
@@ -122,6 +127,10 @@ static inline resource_size_t resource_size(struct resource *res)
122{ 127{
123 return res->end - res->start + 1; 128 return res->end - res->start + 1;
124} 129}
130static inline unsigned long resource_type(struct resource *res)
131{
132 return res->flags & IORESOURCE_TYPE_BITS;
133}
125 134
126/* Convenience shorthand with allocation */ 135/* Convenience shorthand with allocation */
127#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) 136#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
@@ -158,13 +167,14 @@ extern struct resource * __devm_request_region(struct device *dev,
158 struct resource *parent, resource_size_t start, 167 struct resource *parent, resource_size_t start,
159 resource_size_t n, const char *name); 168 resource_size_t n, const char *name);
160 169
161#define devm_release_region(start,n) \ 170#define devm_release_region(dev, start, n) \
162 __devm_release_region(dev, &ioport_resource, (start), (n)) 171 __devm_release_region(dev, &ioport_resource, (start), (n))
163#define devm_release_mem_region(start,n) \ 172#define devm_release_mem_region(dev, start, n) \
164 __devm_release_region(dev, &iomem_resource, (start), (n)) 173 __devm_release_region(dev, &iomem_resource, (start), (n))
165 174
166extern void __devm_release_region(struct device *dev, struct resource *parent, 175extern void __devm_release_region(struct device *dev, struct resource *parent,
167 resource_size_t start, resource_size_t n); 176 resource_size_t start, resource_size_t n);
177extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
168 178
169#endif /* __ASSEMBLY__ */ 179#endif /* __ASSEMBLY__ */
170#endif /* _LINUX_IOPORT_H */ 180#endif /* _LINUX_IOPORT_H */
diff --git a/include/linux/iova.h b/include/linux/iova.h
new file mode 100644
index 000000000000..228f6c94b69c
--- /dev/null
+++ b/include/linux/iova.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright (c) 2006, Intel Corporation.
3 *
4 * This file is released under the GPLv2.
5 *
6 * Copyright (C) 2006-2008 Intel Corporation
7 * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
8 *
9 */
10
11#ifndef _IOVA_H_
12#define _IOVA_H_
13
14#include <linux/types.h>
15#include <linux/kernel.h>
16#include <linux/rbtree.h>
17#include <linux/dma-mapping.h>
18
19/* IO virtual address start page frame number */
20#define IOVA_START_PFN (1)
21
22/* iova structure */
23struct iova {
24 struct rb_node node;
25 unsigned long pfn_hi; /* IOMMU dish out addr hi */
26 unsigned long pfn_lo; /* IOMMU dish out addr lo */
27};
28
29/* holds all the iova translations for a domain */
30struct iova_domain {
31 spinlock_t iova_alloc_lock;/* Lock to protect iova allocation */
32 spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */
33 struct rb_root rbroot; /* iova domain rbtree root */
34 struct rb_node *cached32_node; /* Save last alloced node */
35 unsigned long dma_32bit_pfn;
36};
37
38struct iova *alloc_iova_mem(void);
39void free_iova_mem(struct iova *iova);
40void free_iova(struct iova_domain *iovad, unsigned long pfn);
41void __free_iova(struct iova_domain *iovad, struct iova *iova);
42struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size,
43 unsigned long limit_pfn,
44 bool size_aligned);
45struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo,
46 unsigned long pfn_hi);
47void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to);
48void init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit);
49struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn);
50void put_iova_domain(struct iova_domain *iovad);
51
52#endif
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
index ec6eb49af2d8..0f434a28fb58 100644
--- a/include/linux/ip_vs.h
+++ b/include/linux/ip_vs.h
@@ -242,4 +242,164 @@ struct ip_vs_daemon_user {
242 int syncid; 242 int syncid;
243}; 243};
244 244
245/*
246 *
247 * IPVS Generic Netlink interface definitions
248 *
249 */
250
251/* Generic Netlink family info */
252
253#define IPVS_GENL_NAME "IPVS"
254#define IPVS_GENL_VERSION 0x1
255
256struct ip_vs_flags {
257 __be32 flags;
258 __be32 mask;
259};
260
261/* Generic Netlink command attributes */
262enum {
263 IPVS_CMD_UNSPEC = 0,
264
265 IPVS_CMD_NEW_SERVICE, /* add service */
266 IPVS_CMD_SET_SERVICE, /* modify service */
267 IPVS_CMD_DEL_SERVICE, /* delete service */
268 IPVS_CMD_GET_SERVICE, /* get service info */
269
270 IPVS_CMD_NEW_DEST, /* add destination */
271 IPVS_CMD_SET_DEST, /* modify destination */
272 IPVS_CMD_DEL_DEST, /* delete destination */
273 IPVS_CMD_GET_DEST, /* get destination info */
274
275 IPVS_CMD_NEW_DAEMON, /* start sync daemon */
276 IPVS_CMD_DEL_DAEMON, /* stop sync daemon */
277 IPVS_CMD_GET_DAEMON, /* get sync daemon status */
278
279 IPVS_CMD_SET_CONFIG, /* set config settings */
280 IPVS_CMD_GET_CONFIG, /* get config settings */
281
282 IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */
283 IPVS_CMD_GET_INFO, /* get general IPVS info */
284
285 IPVS_CMD_ZERO, /* zero all counters and stats */
286 IPVS_CMD_FLUSH, /* flush services and dests */
287
288 __IPVS_CMD_MAX,
289};
290
291#define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1)
292
293/* Attributes used in the first level of commands */
294enum {
295 IPVS_CMD_ATTR_UNSPEC = 0,
296 IPVS_CMD_ATTR_SERVICE, /* nested service attribute */
297 IPVS_CMD_ATTR_DEST, /* nested destination attribute */
298 IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */
299 IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */
300 IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */
301 IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */
302 __IPVS_CMD_ATTR_MAX,
303};
304
305#define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
306
307/*
308 * Attributes used to describe a service
309 *
310 * Used inside nested attribute IPVS_CMD_ATTR_SERVICE
311 */
312enum {
313 IPVS_SVC_ATTR_UNSPEC = 0,
314 IPVS_SVC_ATTR_AF, /* address family */
315 IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */
316 IPVS_SVC_ATTR_ADDR, /* virtual service address */
317 IPVS_SVC_ATTR_PORT, /* virtual service port */
318 IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */
319
320 IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */
321 IPVS_SVC_ATTR_FLAGS, /* virtual service flags */
322 IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */
323 IPVS_SVC_ATTR_NETMASK, /* persistent netmask */
324
325 IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */
326 __IPVS_SVC_ATTR_MAX,
327};
328
329#define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
330
331/*
332 * Attributes used to describe a destination (real server)
333 *
334 * Used inside nested attribute IPVS_CMD_ATTR_DEST
335 */
336enum {
337 IPVS_DEST_ATTR_UNSPEC = 0,
338 IPVS_DEST_ATTR_ADDR, /* real server address */
339 IPVS_DEST_ATTR_PORT, /* real server port */
340
341 IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */
342 IPVS_DEST_ATTR_WEIGHT, /* destination weight */
343
344 IPVS_DEST_ATTR_U_THRESH, /* upper threshold */
345 IPVS_DEST_ATTR_L_THRESH, /* lower threshold */
346
347 IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */
348 IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */
349 IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */
350
351 IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */
352 __IPVS_DEST_ATTR_MAX,
353};
354
355#define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1)
356
357/*
358 * Attributes describing a sync daemon
359 *
360 * Used inside nested attribute IPVS_CMD_ATTR_DAEMON
361 */
362enum {
363 IPVS_DAEMON_ATTR_UNSPEC = 0,
364 IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */
365 IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */
366 IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */
367 __IPVS_DAEMON_ATTR_MAX,
368};
369
370#define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1)
371
372/*
373 * Attributes used to describe service or destination entry statistics
374 *
375 * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS
376 */
377enum {
378 IPVS_STATS_ATTR_UNSPEC = 0,
379 IPVS_STATS_ATTR_CONNS, /* connections scheduled */
380 IPVS_STATS_ATTR_INPKTS, /* incoming packets */
381 IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */
382 IPVS_STATS_ATTR_INBYTES, /* incoming bytes */
383 IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */
384
385 IPVS_STATS_ATTR_CPS, /* current connection rate */
386 IPVS_STATS_ATTR_INPPS, /* current in packet rate */
387 IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */
388 IPVS_STATS_ATTR_INBPS, /* current in byte rate */
389 IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */
390 __IPVS_STATS_ATTR_MAX,
391};
392
393#define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1)
394
395/* Attributes used in response to IPVS_CMD_GET_INFO command */
396enum {
397 IPVS_INFO_ATTR_UNSPEC = 0,
398 IPVS_INFO_ATTR_VERSION, /* IPVS version number */
399 IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */
400 __IPVS_INFO_ATTR_MAX,
401};
402
403#define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1)
404
245#endif /* _IP_VS_H */ 405#endif /* _IP_VS_H */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 8ccb462ea42c..8d9411bc60f6 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -62,6 +62,7 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
62#define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */ 62#define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */
63#define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */ 63#define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */
64#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */ 64#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */
65#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */
65 66
66#ifdef CONFIG_IRQ_PER_CPU 67#ifdef CONFIG_IRQ_PER_CPU
67# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 68# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 8687a7dc0632..4c218ee7587a 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -157,7 +157,7 @@ typedef struct {
157 157
158typedef struct { 158typedef struct {
159 int mp_mrru; /* unused */ 159 int mp_mrru; /* unused */
160 struct sk_buff * frags; /* fragments sl list -- use skb->next */ 160 struct sk_buff_head frags; /* fragments sl list */
161 long frames; /* number of frames in the frame list */ 161 long frames; /* number of frames in the frame list */
162 unsigned int seq; /* last processed packet seq #: any packets 162 unsigned int seq; /* last processed packet seq #: any packets
163 * with smaller seq # will be dropped 163 * with smaller seq # will be dropped
diff --git a/include/linux/ivtv.h b/include/linux/ivtv.h
index 17ca64b5a66c..f2720280b9ec 100644
--- a/include/linux/ivtv.h
+++ b/include/linux/ivtv.h
@@ -23,6 +23,7 @@
23 23
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/videodev2.h>
26 27
27/* ivtv knows several distinct output modes: MPEG streaming, 28/* ivtv knows several distinct output modes: MPEG streaming,
28 YUV streaming, YUV updates through user DMA and the passthrough 29 YUV streaming, YUV updates through user DMA and the passthrough
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 07a9b52a2654..7ebbcb1c9ba4 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -61,7 +61,7 @@ extern u8 journal_enable_debug;
61 do { \ 61 do { \
62 if ((n) <= journal_enable_debug) { \ 62 if ((n) <= journal_enable_debug) { \
63 printk (KERN_DEBUG "(%s, %d): %s: ", \ 63 printk (KERN_DEBUG "(%s, %d): %s: ", \
64 __FILE__, __LINE__, __FUNCTION__); \ 64 __FILE__, __LINE__, __func__); \
65 printk (f, ## a); \ 65 printk (f, ## a); \
66 } \ 66 } \
67 } while (0) 67 } while (0)
@@ -984,7 +984,7 @@ extern int cleanup_journal_tail(journal_t *);
984 984
985#define jbd_ENOSYS() \ 985#define jbd_ENOSYS() \
986do { \ 986do { \
987 printk (KERN_ERR "JBD unimplemented function %s\n", __FUNCTION__); \ 987 printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \
988 current->state = TASK_UNINTERRUPTIBLE; \ 988 current->state = TASK_UNINTERRUPTIBLE; \
989 schedule(); \ 989 schedule(); \
990} while (1) 990} while (1)
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 3dd209007098..c7d106ef22e2 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -61,7 +61,7 @@ extern u8 jbd2_journal_enable_debug;
61 do { \ 61 do { \
62 if ((n) <= jbd2_journal_enable_debug) { \ 62 if ((n) <= jbd2_journal_enable_debug) { \
63 printk (KERN_DEBUG "(%s, %d): %s: ", \ 63 printk (KERN_DEBUG "(%s, %d): %s: ", \
64 __FILE__, __LINE__, __FUNCTION__); \ 64 __FILE__, __LINE__, __func__); \
65 printk (f, ## a); \ 65 printk (f, ## a); \
66 } \ 66 } \
67 } while (0) 67 } while (0)
@@ -641,6 +641,11 @@ struct transaction_s
641 */ 641 */
642 int t_handle_count; 642 int t_handle_count;
643 643
644 /*
645 * For use by the filesystem to store fs-specific data
646 * structures associated with the transaction
647 */
648 struct list_head t_private_list;
644}; 649};
645 650
646struct transaction_run_stats_s { 651struct transaction_run_stats_s {
@@ -850,7 +855,8 @@ struct journal_s
850 */ 855 */
851 struct block_device *j_dev; 856 struct block_device *j_dev;
852 int j_blocksize; 857 int j_blocksize;
853 unsigned long long j_blk_offset; 858 unsigned long long j_blk_offset;
859 char j_devname[BDEVNAME_SIZE+24];
854 860
855 /* 861 /*
856 * Device which holds the client fs. For internal journal this will be 862 * Device which holds the client fs. For internal journal this will be
@@ -934,6 +940,10 @@ struct journal_s
934 940
935 pid_t j_last_sync_writer; 941 pid_t j_last_sync_writer;
936 942
943 /* This function is called when a transaction is closed */
944 void (*j_commit_callback)(journal_t *,
945 transaction_t *);
946
937 /* 947 /*
938 * Journal statistics 948 * Journal statistics
939 */ 949 */
@@ -966,6 +976,9 @@ struct journal_s
966#define JBD2_FLUSHED 0x008 /* The journal superblock has been flushed */ 976#define JBD2_FLUSHED 0x008 /* The journal superblock has been flushed */
967#define JBD2_LOADED 0x010 /* The journal superblock has been loaded */ 977#define JBD2_LOADED 0x010 /* The journal superblock has been loaded */
968#define JBD2_BARRIER 0x020 /* Use IDE barriers */ 978#define JBD2_BARRIER 0x020 /* Use IDE barriers */
979#define JBD2_ABORT_ON_SYNCDATA_ERR 0x040 /* Abort the journal on file
980 * data write error in ordered
981 * mode */
969 982
970/* 983/*
971 * Function declarations for the journaling transaction and buffer 984 * Function declarations for the journaling transaction and buffer
@@ -1059,7 +1072,7 @@ extern void jbd2_journal_clear_features
1059 (journal_t *, unsigned long, unsigned long, unsigned long); 1072 (journal_t *, unsigned long, unsigned long, unsigned long);
1060extern int jbd2_journal_create (journal_t *); 1073extern int jbd2_journal_create (journal_t *);
1061extern int jbd2_journal_load (journal_t *journal); 1074extern int jbd2_journal_load (journal_t *journal);
1062extern void jbd2_journal_destroy (journal_t *); 1075extern int jbd2_journal_destroy (journal_t *);
1063extern int jbd2_journal_recover (journal_t *journal); 1076extern int jbd2_journal_recover (journal_t *journal);
1064extern int jbd2_journal_wipe (journal_t *, int); 1077extern int jbd2_journal_wipe (journal_t *, int);
1065extern int jbd2_journal_skip_recovery (journal_t *); 1078extern int jbd2_journal_skip_recovery (journal_t *);
@@ -1139,7 +1152,7 @@ extern int jbd2_cleanup_journal_tail(journal_t *);
1139 1152
1140#define jbd_ENOSYS() \ 1153#define jbd_ENOSYS() \
1141do { \ 1154do { \
1142 printk (KERN_ERR "JBD unimplemented function %s\n", __FUNCTION__); \ 1155 printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \
1143 current->state = TASK_UNINTERRUPTIBLE; \ 1156 current->state = TASK_UNINTERRUPTIBLE; \
1144 schedule(); \ 1157 schedule(); \
1145} while (1) 1158} while (1)
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h
index 8a62d1e84b9b..bb70ebb6a2d5 100644
--- a/include/linux/journal-head.h
+++ b/include/linux/journal-head.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * buffer_head fields for JBD 4 * buffer_head fields for JBD
5 * 5 *
6 * 27 May 2001 Andrew Morton <akpm@digeo.com> 6 * 27 May 2001 Andrew Morton
7 * Created - pulled out of fs.h 7 * Created - pulled out of fs.h
8 */ 8 */
9 9
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index b96144887444..f3fe34391d8e 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -93,12 +93,10 @@ static inline void print_symbol(const char *fmt, unsigned long addr)
93} 93}
94 94
95/* 95/*
96 * Pretty-print a function pointer. 96 * Pretty-print a function pointer. This function is deprecated.
97 * 97 * Please use the "%pF" vsprintf format instead.
98 * ia64 and ppc64 function pointers are really function descriptors,
99 * which contain a pointer the real address.
100 */ 98 */
101static inline void print_fn_descriptor_symbol(const char *fmt, void *addr) 99static inline void __deprecated print_fn_descriptor_symbol(const char *fmt, void *addr)
102{ 100{
103#if defined(CONFIG_IA64) || defined(CONFIG_PPC64) 101#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
104 addr = *(void **)addr; 102 addr = *(void **)addr;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2651f805ba6d..5a566b705ca9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -16,6 +16,7 @@
16#include <linux/log2.h> 16#include <linux/log2.h>
17#include <linux/typecheck.h> 17#include <linux/typecheck.h>
18#include <linux/ratelimit.h> 18#include <linux/ratelimit.h>
19#include <linux/dynamic_printk.h>
19#include <asm/byteorder.h> 20#include <asm/byteorder.h>
20#include <asm/bug.h> 21#include <asm/bug.h>
21 22
@@ -182,7 +183,7 @@ extern int vsscanf(const char *, const char *, va_list)
182 183
183extern int get_option(char **str, int *pint); 184extern int get_option(char **str, int *pint);
184extern char *get_options(const char *str, int nints, int *ints); 185extern char *get_options(const char *str, int nints, int *ints);
185extern unsigned long long memparse(char *ptr, char **retptr); 186extern unsigned long long memparse(const char *ptr, char **retptr);
186 187
187extern int core_kernel_text(unsigned long addr); 188extern int core_kernel_text(unsigned long addr);
188extern int __kernel_text_address(unsigned long addr); 189extern int __kernel_text_address(unsigned long addr);
@@ -213,6 +214,9 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
213 { return false; } 214 { return false; }
214#endif 215#endif
215 216
217extern int printk_needs_cpu(int cpu);
218extern void printk_tick(void);
219
216extern void asmlinkage __attribute__((format(printf, 1, 2))) 220extern void asmlinkage __attribute__((format(printf, 1, 2)))
217 early_printk(const char *fmt, ...); 221 early_printk(const char *fmt, ...);
218 222
@@ -235,9 +239,10 @@ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in
235extern int panic_timeout; 239extern int panic_timeout;
236extern int panic_on_oops; 240extern int panic_on_oops;
237extern int panic_on_unrecovered_nmi; 241extern int panic_on_unrecovered_nmi;
238extern int tainted;
239extern const char *print_tainted(void); 242extern const char *print_tainted(void);
240extern void add_taint(unsigned); 243extern void add_taint(unsigned flag);
244extern int test_taint(unsigned flag);
245extern unsigned long get_taint(void);
241extern int root_mountflags; 246extern int root_mountflags;
242 247
243/* Values used for system_state */ 248/* Values used for system_state */
@@ -250,16 +255,17 @@ extern enum system_states {
250 SYSTEM_SUSPEND_DISK, 255 SYSTEM_SUSPEND_DISK,
251} system_state; 256} system_state;
252 257
253#define TAINT_PROPRIETARY_MODULE (1<<0) 258#define TAINT_PROPRIETARY_MODULE 0
254#define TAINT_FORCED_MODULE (1<<1) 259#define TAINT_FORCED_MODULE 1
255#define TAINT_UNSAFE_SMP (1<<2) 260#define TAINT_UNSAFE_SMP 2
256#define TAINT_FORCED_RMMOD (1<<3) 261#define TAINT_FORCED_RMMOD 3
257#define TAINT_MACHINE_CHECK (1<<4) 262#define TAINT_MACHINE_CHECK 4
258#define TAINT_BAD_PAGE (1<<5) 263#define TAINT_BAD_PAGE 5
259#define TAINT_USER (1<<6) 264#define TAINT_USER 6
260#define TAINT_DIE (1<<7) 265#define TAINT_DIE 7
261#define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) 266#define TAINT_OVERRIDDEN_ACPI_TABLE 8
262#define TAINT_WARN (1<<9) 267#define TAINT_WARN 9
268#define TAINT_CRAP 10
263 269
264extern void dump_stack(void) __cold; 270extern void dump_stack(void) __cold;
265 271
@@ -303,8 +309,12 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
303#define pr_info(fmt, arg...) \ 309#define pr_info(fmt, arg...) \
304 printk(KERN_INFO fmt, ##arg) 310 printk(KERN_INFO fmt, ##arg)
305 311
306#ifdef DEBUG
307/* If you are writing a driver, please use dev_dbg instead */ 312/* If you are writing a driver, please use dev_dbg instead */
313#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
314#define pr_debug(fmt, ...) do { \
315 dynamic_pr_debug(fmt, ##__VA_ARGS__); \
316 } while (0)
317#elif defined(DEBUG)
308#define pr_debug(fmt, arg...) \ 318#define pr_debug(fmt, arg...) \
309 printk(KERN_DEBUG fmt, ##arg) 319 printk(KERN_DEBUG fmt, ##arg)
310#else 320#else
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index cf9f40a91c9c..cac3750cd65e 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -52,6 +52,7 @@ static inline int kstat_irqs(int irq)
52 return sum; 52 return sum;
53} 53}
54 54
55extern unsigned long long task_delta_exec(struct task_struct *);
55extern void account_user_time(struct task_struct *, cputime_t); 56extern void account_user_time(struct task_struct *, cputime_t);
56extern void account_user_time_scaled(struct task_struct *, cputime_t); 57extern void account_user_time_scaled(struct task_struct *, cputime_t);
57extern void account_system_time(struct task_struct *, int, cputime_t); 58extern void account_system_time(struct task_struct *, int, cputime_t);
diff --git a/include/linux/key.h b/include/linux/key.h
index c45c962d1cc5..1b70e35a71e3 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -299,6 +299,7 @@ extern void key_init(void);
299#define key_validate(k) 0 299#define key_validate(k) 0
300#define key_serial(k) 0 300#define key_serial(k) 0
301#define key_get(k) ({ NULL; }) 301#define key_get(k) ({ NULL; })
302#define key_revoke(k) do { } while(0)
302#define key_put(k) do { } while(0) 303#define key_put(k) do { } while(0)
303#define key_ref_put(k) do { } while(0) 304#define key_ref_put(k) do { } while(0)
304#define make_key_ref(k, p) ({ NULL; }) 305#define make_key_ref(k, p) ({ NULL; })
diff --git a/include/linux/klist.h b/include/linux/klist.h
index 06c338ef7f1b..8ea98db223e5 100644
--- a/include/linux/klist.h
+++ b/include/linux/klist.h
@@ -38,7 +38,7 @@ extern void klist_init(struct klist *k, void (*get)(struct klist_node *),
38 void (*put)(struct klist_node *)); 38 void (*put)(struct klist_node *));
39 39
40struct klist_node { 40struct klist_node {
41 struct klist *n_klist; 41 void *n_klist; /* never access directly */
42 struct list_head n_node; 42 struct list_head n_node;
43 struct kref n_ref; 43 struct kref n_ref;
44 struct completion n_removed; 44 struct completion n_removed;
@@ -57,7 +57,6 @@ extern int klist_node_attached(struct klist_node *n);
57 57
58struct klist_iter { 58struct klist_iter {
59 struct klist *i_klist; 59 struct klist *i_klist;
60 struct list_head *i_head;
61 struct klist_node *i_cur; 60 struct klist_node *i_cur;
62}; 61};
63 62
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index a1a91577813c..92213a9194e1 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -99,4 +99,7 @@ struct file;
99extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], 99extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[],
100 struct file **filp); 100 struct file **filp);
101 101
102extern int usermodehelper_disable(void);
103extern void usermodehelper_enable(void);
104
102#endif /* __LINUX_KMOD_H__ */ 105#endif /* __LINUX_KMOD_H__ */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 69511f74f912..797fcd781242 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -311,21 +311,32 @@ struct kvm_s390_interrupt {
311 311
312/* This structure represents a single trace buffer record. */ 312/* This structure represents a single trace buffer record. */
313struct kvm_trace_rec { 313struct kvm_trace_rec {
314 __u32 event:28; 314 /* variable rec_val
315 __u32 extra_u32:3; 315 * is split into:
316 __u32 cycle_in:1; 316 * bits 0 - 27 -> event id
317 * bits 28 -30 -> number of extra data args of size u32
318 * bits 31 -> binary indicator for if tsc is in record
319 */
320 __u32 rec_val;
317 __u32 pid; 321 __u32 pid;
318 __u32 vcpu_id; 322 __u32 vcpu_id;
319 union { 323 union {
320 struct { 324 struct {
321 __u64 cycle_u64; 325 __u64 timestamp;
322 __u32 extra_u32[KVM_TRC_EXTRA_MAX]; 326 __u32 extra_u32[KVM_TRC_EXTRA_MAX];
323 } cycle; 327 } __attribute__((packed)) timestamp;
324 struct { 328 struct {
325 __u32 extra_u32[KVM_TRC_EXTRA_MAX]; 329 __u32 extra_u32[KVM_TRC_EXTRA_MAX];
326 } nocycle; 330 } notimestamp;
327 } u; 331 } u;
328} __attribute__((packed)); 332};
333
334#define TRACE_REC_EVENT_ID(val) \
335 (0x0fffffff & (val))
336#define TRACE_REC_NUM_DATA_ARGS(val) \
337 (0x70000000 & ((val) << 28))
338#define TRACE_REC_TCS(val) \
339 (0x80000000 & ((val) << 31))
329 340
330#define KVMIO 0xAE 341#define KVMIO 0xAE
331 342
@@ -372,6 +383,10 @@ struct kvm_trace_rec {
372#define KVM_CAP_MP_STATE 14 383#define KVM_CAP_MP_STATE 14
373#define KVM_CAP_COALESCED_MMIO 15 384#define KVM_CAP_COALESCED_MMIO 15
374#define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ 385#define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */
386#if defined(CONFIG_X86)||defined(CONFIG_IA64)
387#define KVM_CAP_DEVICE_ASSIGNMENT 17
388#endif
389#define KVM_CAP_IOMMU 18
375 390
376/* 391/*
377 * ioctls for VM fds 392 * ioctls for VM fds
@@ -401,6 +416,10 @@ struct kvm_trace_rec {
401 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) 416 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone)
402#define KVM_UNREGISTER_COALESCED_MMIO \ 417#define KVM_UNREGISTER_COALESCED_MMIO \
403 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) 418 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone)
419#define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \
420 struct kvm_assigned_pci_dev)
421#define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \
422 struct kvm_assigned_irq)
404 423
405/* 424/*
406 * ioctls for vcpu fds 425 * ioctls for vcpu fds
@@ -440,4 +459,45 @@ struct kvm_trace_rec {
440#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) 459#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
441#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) 460#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
442 461
462#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
463#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
464#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
465#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
466#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
467#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
468#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
469#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
470#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
471#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
472#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
473#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
474#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
475#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
476#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
477#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
478#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
479#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
480#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
481#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
482#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
483#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
484#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
485#define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19)
486
487struct kvm_assigned_pci_dev {
488 __u32 assigned_dev_id;
489 __u32 busnr;
490 __u32 devfn;
491 __u32 flags;
492};
493
494struct kvm_assigned_irq {
495 __u32 assigned_dev_id;
496 __u32 host_irq;
497 __u32 guest_irq;
498 __u32 flags;
499};
500
501#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
502
443#endif 503#endif
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 8525afc53107..3833c48fae3a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -34,6 +34,8 @@
34#define KVM_REQ_MMU_RELOAD 3 34#define KVM_REQ_MMU_RELOAD 3
35#define KVM_REQ_TRIPLE_FAULT 4 35#define KVM_REQ_TRIPLE_FAULT 4
36#define KVM_REQ_PENDING_TIMER 5 36#define KVM_REQ_PENDING_TIMER 5
37#define KVM_REQ_UNHALT 6
38#define KVM_REQ_MMU_SYNC 7
37 39
38struct kvm_vcpu; 40struct kvm_vcpu;
39extern struct kmem_cache *kvm_vcpu_cache; 41extern struct kmem_cache *kvm_vcpu_cache;
@@ -279,12 +281,68 @@ void kvm_free_physmem(struct kvm *kvm);
279 281
280struct kvm *kvm_arch_create_vm(void); 282struct kvm *kvm_arch_create_vm(void);
281void kvm_arch_destroy_vm(struct kvm *kvm); 283void kvm_arch_destroy_vm(struct kvm *kvm);
284void kvm_free_all_assigned_devices(struct kvm *kvm);
282 285
283int kvm_cpu_get_interrupt(struct kvm_vcpu *v); 286int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
284int kvm_cpu_has_interrupt(struct kvm_vcpu *v); 287int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
285int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); 288int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
286void kvm_vcpu_kick(struct kvm_vcpu *vcpu); 289void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
287 290
291int kvm_is_mmio_pfn(pfn_t pfn);
292
293struct kvm_irq_ack_notifier {
294 struct hlist_node link;
295 unsigned gsi;
296 void (*irq_acked)(struct kvm_irq_ack_notifier *kian);
297};
298
299struct kvm_assigned_dev_kernel {
300 struct kvm_irq_ack_notifier ack_notifier;
301 struct work_struct interrupt_work;
302 struct list_head list;
303 int assigned_dev_id;
304 int host_busnr;
305 int host_devfn;
306 int host_irq;
307 int guest_irq;
308 int irq_requested;
309 struct pci_dev *dev;
310 struct kvm *kvm;
311};
312void kvm_set_irq(struct kvm *kvm, int irq, int level);
313void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi);
314void kvm_register_irq_ack_notifier(struct kvm *kvm,
315 struct kvm_irq_ack_notifier *kian);
316void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
317 struct kvm_irq_ack_notifier *kian);
318
319#ifdef CONFIG_DMAR
320int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn,
321 unsigned long npages);
322int kvm_iommu_map_guest(struct kvm *kvm,
323 struct kvm_assigned_dev_kernel *assigned_dev);
324int kvm_iommu_unmap_guest(struct kvm *kvm);
325#else /* CONFIG_DMAR */
326static inline int kvm_iommu_map_pages(struct kvm *kvm,
327 gfn_t base_gfn,
328 unsigned long npages)
329{
330 return 0;
331}
332
333static inline int kvm_iommu_map_guest(struct kvm *kvm,
334 struct kvm_assigned_dev_kernel
335 *assigned_dev)
336{
337 return -ENODEV;
338}
339
340static inline int kvm_iommu_unmap_guest(struct kvm *kvm)
341{
342 return 0;
343}
344#endif /* CONFIG_DMAR */
345
288static inline void kvm_guest_enter(void) 346static inline void kvm_guest_enter(void)
289{ 347{
290 account_system_vtime(current); 348 account_system_vtime(current);
@@ -307,6 +365,11 @@ static inline gpa_t gfn_to_gpa(gfn_t gfn)
307 return (gpa_t)gfn << PAGE_SHIFT; 365 return (gpa_t)gfn << PAGE_SHIFT;
308} 366}
309 367
368static inline hpa_t pfn_to_hpa(pfn_t pfn)
369{
370 return (hpa_t)pfn << PAGE_SHIFT;
371}
372
310static inline void kvm_migrate_timers(struct kvm_vcpu *vcpu) 373static inline void kvm_migrate_timers(struct kvm_vcpu *vcpu)
311{ 374{
312 set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests); 375 set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests);
@@ -326,6 +389,25 @@ struct kvm_stats_debugfs_item {
326extern struct kvm_stats_debugfs_item debugfs_entries[]; 389extern struct kvm_stats_debugfs_item debugfs_entries[];
327extern struct dentry *kvm_debugfs_dir; 390extern struct dentry *kvm_debugfs_dir;
328 391
392#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
393 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
394 vcpu, 5, d1, d2, d3, d4, d5)
395#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
396 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
397 vcpu, 4, d1, d2, d3, d4, 0)
398#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
399 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
400 vcpu, 3, d1, d2, d3, 0, 0)
401#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
402 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
403 vcpu, 2, d1, d2, 0, 0, 0)
404#define KVMTRACE_1D(evt, vcpu, d1, name) \
405 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
406 vcpu, 1, d1, 0, 0, 0, 0)
407#define KVMTRACE_0D(evt, vcpu, name) \
408 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
409 vcpu, 0, 0, 0, 0, 0, 0)
410
329#ifdef CONFIG_KVM_TRACE 411#ifdef CONFIG_KVM_TRACE
330int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); 412int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg);
331void kvm_trace_cleanup(void); 413void kvm_trace_cleanup(void);
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 173febac6656..c67fecafff90 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -11,6 +11,7 @@
11#include <linux/device.h> 11#include <linux/device.h>
12#include <linux/mutex.h> 12#include <linux/mutex.h>
13#include <linux/notifier.h> 13#include <linux/notifier.h>
14#include <linux/fb.h>
14 15
15/* Notes on locking: 16/* Notes on locking:
16 * 17 *
@@ -45,6 +46,8 @@ struct lcd_ops {
45 int (*get_contrast)(struct lcd_device *); 46 int (*get_contrast)(struct lcd_device *);
46 /* Set LCD panel contrast */ 47 /* Set LCD panel contrast */
47 int (*set_contrast)(struct lcd_device *, int contrast); 48 int (*set_contrast)(struct lcd_device *, int contrast);
49 /* Set LCD panel mode (resolutions ...) */
50 int (*set_mode)(struct lcd_device *, struct fb_videomode *);
48 /* Check if given framebuffer device is the one LCD is bound to; 51 /* Check if given framebuffer device is the one LCD is bound to;
49 return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ 52 return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */
50 int (*check_fb)(struct lcd_device *, struct fb_info *); 53 int (*check_fb)(struct lcd_device *, struct fb_info *);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 06b80337303b..947cf84e555d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -146,6 +146,7 @@ enum {
146 ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ 146 ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */
147 ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ 147 ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */
148 ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ 148 ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */
149 ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */
149 ATA_DFLAG_INIT_MASK = (1 << 24) - 1, 150 ATA_DFLAG_INIT_MASK = (1 << 24) - 1,
150 151
151 ATA_DFLAG_DETACH = (1 << 24), 152 ATA_DFLAG_DETACH = (1 << 24),
@@ -163,6 +164,7 @@ enum {
163 ATA_DEV_NONE = 9, /* no device */ 164 ATA_DEV_NONE = 9, /* no device */
164 165
165 /* struct ata_link flags */ 166 /* struct ata_link flags */
167 ATA_LFLAG_NO_HRST = (1 << 1), /* avoid hardreset */
166 ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ 168 ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */
167 ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ 169 ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */
168 ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ 170 ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */
@@ -243,6 +245,7 @@ enum {
243 ATA_TMOUT_BOOT = 30000, /* heuristic */ 245 ATA_TMOUT_BOOT = 30000, /* heuristic */
244 ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */ 246 ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */
245 ATA_TMOUT_INTERNAL_QUICK = 5000, 247 ATA_TMOUT_INTERNAL_QUICK = 5000,
248 ATA_TMOUT_MAX_PARK = 30000,
246 249
247 /* FIXME: GoVault needs 2s but we can't afford that without 250 /* FIXME: GoVault needs 2s but we can't afford that without
248 * parallel probing. 800ms is enough for iVDR disk 251 * parallel probing. 800ms is enough for iVDR disk
@@ -318,8 +321,11 @@ enum {
318 ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, 321 ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
319 ATA_EH_ENABLE_LINK = (1 << 3), 322 ATA_EH_ENABLE_LINK = (1 << 3),
320 ATA_EH_LPM = (1 << 4), /* link power management action */ 323 ATA_EH_LPM = (1 << 4), /* link power management action */
324 ATA_EH_PARK = (1 << 5), /* unload heads and stop I/O */
321 325
322 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, 326 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_PARK,
327 ATA_EH_ALL_ACTIONS = ATA_EH_REVALIDATE | ATA_EH_RESET |
328 ATA_EH_ENABLE_LINK | ATA_EH_LPM,
323 329
324 /* ata_eh_info->flags */ 330 /* ata_eh_info->flags */
325 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ 331 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
@@ -451,6 +457,7 @@ enum link_pm {
451 MEDIUM_POWER, 457 MEDIUM_POWER,
452}; 458};
453extern struct device_attribute dev_attr_link_power_management_policy; 459extern struct device_attribute dev_attr_link_power_management_policy;
460extern struct device_attribute dev_attr_unload_heads;
454extern struct device_attribute dev_attr_em_message_type; 461extern struct device_attribute dev_attr_em_message_type;
455extern struct device_attribute dev_attr_em_message; 462extern struct device_attribute dev_attr_em_message;
456extern struct device_attribute dev_attr_sw_activity; 463extern struct device_attribute dev_attr_sw_activity;
@@ -553,8 +560,8 @@ struct ata_ering {
553struct ata_device { 560struct ata_device {
554 struct ata_link *link; 561 struct ata_link *link;
555 unsigned int devno; /* 0 or 1 */ 562 unsigned int devno; /* 0 or 1 */
556 unsigned long flags; /* ATA_DFLAG_xxx */
557 unsigned int horkage; /* List of broken features */ 563 unsigned int horkage; /* List of broken features */
564 unsigned long flags; /* ATA_DFLAG_xxx */
558 struct scsi_device *sdev; /* attached SCSI device */ 565 struct scsi_device *sdev; /* attached SCSI device */
559#ifdef CONFIG_ATA_ACPI 566#ifdef CONFIG_ATA_ACPI
560 acpi_handle acpi_handle; 567 acpi_handle acpi_handle;
@@ -563,6 +570,7 @@ struct ata_device {
563 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 570 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
564 u64 n_sectors; /* size of device, if ATA */ 571 u64 n_sectors; /* size of device, if ATA */
565 unsigned int class; /* ATA_DEV_xxx */ 572 unsigned int class; /* ATA_DEV_xxx */
573 unsigned long unpark_deadline;
566 574
567 u8 pio_mode; 575 u8 pio_mode;
568 u8 dma_mode; 576 u8 dma_mode;
@@ -620,6 +628,7 @@ struct ata_eh_context {
620 [ATA_EH_CMD_TIMEOUT_TABLE_SIZE]; 628 [ATA_EH_CMD_TIMEOUT_TABLE_SIZE];
621 unsigned int classes[ATA_MAX_DEVICES]; 629 unsigned int classes[ATA_MAX_DEVICES];
622 unsigned int did_probe_mask; 630 unsigned int did_probe_mask;
631 unsigned int unloaded_mask;
623 unsigned int saved_ncq_enabled; 632 unsigned int saved_ncq_enabled;
624 u8 saved_xfer_mode[ATA_MAX_DEVICES]; 633 u8 saved_xfer_mode[ATA_MAX_DEVICES];
625 /* timestamp for the last reset attempt or success */ 634 /* timestamp for the last reset attempt or success */
@@ -646,6 +655,7 @@ struct ata_link {
646 655
647 unsigned int flags; /* ATA_LFLAG_xxx */ 656 unsigned int flags; /* ATA_LFLAG_xxx */
648 657
658 u32 saved_scontrol; /* SControl on probe */
649 unsigned int hw_sata_spd_limit; 659 unsigned int hw_sata_spd_limit;
650 unsigned int sata_spd_limit; 660 unsigned int sata_spd_limit;
651 unsigned int sata_spd; /* current SATA PHY speed */ 661 unsigned int sata_spd; /* current SATA PHY speed */
@@ -686,7 +696,8 @@ struct ata_port {
686 unsigned int qc_active; 696 unsigned int qc_active;
687 int nr_active_links; /* #links with active qcs */ 697 int nr_active_links; /* #links with active qcs */
688 698
689 struct ata_link link; /* host default link */ 699 struct ata_link link; /* host default link */
700 struct ata_link *slave_link; /* see ata_slave_link_init() */
690 701
691 int nr_pmp_links; /* nr of available PMP links */ 702 int nr_pmp_links; /* nr of available PMP links */
692 struct ata_link *pmp_link; /* array of PMP links */ 703 struct ata_link *pmp_link; /* array of PMP links */
@@ -707,6 +718,7 @@ struct ata_port {
707 struct list_head eh_done_q; 718 struct list_head eh_done_q;
708 wait_queue_head_t eh_wait_q; 719 wait_queue_head_t eh_wait_q;
709 int eh_tries; 720 int eh_tries;
721 struct completion park_req_pending;
710 722
711 pm_message_t pm_mesg; 723 pm_message_t pm_mesg;
712 int *pm_result; 724 int *pm_result;
@@ -770,8 +782,8 @@ struct ata_port_operations {
770 /* 782 /*
771 * Optional features 783 * Optional features
772 */ 784 */
773 int (*scr_read)(struct ata_port *ap, unsigned int sc_reg, u32 *val); 785 int (*scr_read)(struct ata_link *link, unsigned int sc_reg, u32 *val);
774 int (*scr_write)(struct ata_port *ap, unsigned int sc_reg, u32 val); 786 int (*scr_write)(struct ata_link *link, unsigned int sc_reg, u32 val);
775 void (*pmp_attach)(struct ata_port *ap); 787 void (*pmp_attach)(struct ata_port *ap);
776 void (*pmp_detach)(struct ata_port *ap); 788 void (*pmp_detach)(struct ata_port *ap);
777 int (*enable_pm)(struct ata_port *ap, enum link_pm policy); 789 int (*enable_pm)(struct ata_port *ap, enum link_pm policy);
@@ -893,6 +905,7 @@ extern void ata_port_disable(struct ata_port *);
893extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); 905extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports);
894extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, 906extern struct ata_host *ata_host_alloc_pinfo(struct device *dev,
895 const struct ata_port_info * const * ppi, int n_ports); 907 const struct ata_port_info * const * ppi, int n_ports);
908extern int ata_slave_link_init(struct ata_port *ap);
896extern int ata_host_start(struct ata_host *host); 909extern int ata_host_start(struct ata_host *host);
897extern int ata_host_register(struct ata_host *host, 910extern int ata_host_register(struct ata_host *host,
898 struct scsi_host_template *sht); 911 struct scsi_host_template *sht);
@@ -918,8 +931,8 @@ extern int sata_scr_valid(struct ata_link *link);
918extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); 931extern int sata_scr_read(struct ata_link *link, int reg, u32 *val);
919extern int sata_scr_write(struct ata_link *link, int reg, u32 val); 932extern int sata_scr_write(struct ata_link *link, int reg, u32 val);
920extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); 933extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val);
921extern int ata_link_online(struct ata_link *link); 934extern bool ata_link_online(struct ata_link *link);
922extern int ata_link_offline(struct ata_link *link); 935extern bool ata_link_offline(struct ata_link *link);
923#ifdef CONFIG_PM 936#ifdef CONFIG_PM
924extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); 937extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
925extern void ata_host_resume(struct ata_host *host); 938extern void ata_host_resume(struct ata_host *host);
@@ -1096,6 +1109,7 @@ extern void ata_std_error_handler(struct ata_port *ap);
1096 */ 1109 */
1097extern const struct ata_port_operations ata_base_port_ops; 1110extern const struct ata_port_operations ata_base_port_ops;
1098extern const struct ata_port_operations sata_port_ops; 1111extern const struct ata_port_operations sata_port_ops;
1112extern struct device_attribute *ata_common_sdev_attrs[];
1099 1113
1100#define ATA_BASE_SHT(drv_name) \ 1114#define ATA_BASE_SHT(drv_name) \
1101 .module = THIS_MODULE, \ 1115 .module = THIS_MODULE, \
@@ -1110,7 +1124,8 @@ extern const struct ata_port_operations sata_port_ops;
1110 .proc_name = drv_name, \ 1124 .proc_name = drv_name, \
1111 .slave_configure = ata_scsi_slave_config, \ 1125 .slave_configure = ata_scsi_slave_config, \
1112 .slave_destroy = ata_scsi_slave_destroy, \ 1126 .slave_destroy = ata_scsi_slave_destroy, \
1113 .bios_param = ata_std_bios_param 1127 .bios_param = ata_std_bios_param, \
1128 .sdev_attrs = ata_common_sdev_attrs
1114 1129
1115#define ATA_NCQ_SHT(drv_name) \ 1130#define ATA_NCQ_SHT(drv_name) \
1116 ATA_BASE_SHT(drv_name), \ 1131 ATA_BASE_SHT(drv_name), \
@@ -1132,7 +1147,7 @@ static inline bool sata_pmp_attached(struct ata_port *ap)
1132 1147
1133static inline int ata_is_host_link(const struct ata_link *link) 1148static inline int ata_is_host_link(const struct ata_link *link)
1134{ 1149{
1135 return link == &link->ap->link; 1150 return link == &link->ap->link || link == link->ap->slave_link;
1136} 1151}
1137#else /* CONFIG_SATA_PMP */ 1152#else /* CONFIG_SATA_PMP */
1138static inline bool sata_pmp_supported(struct ata_port *ap) 1153static inline bool sata_pmp_supported(struct ata_port *ap)
@@ -1165,7 +1180,7 @@ static inline int sata_srst_pmp(struct ata_link *link)
1165 printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) 1180 printk("%sata%u: "fmt, lv, (ap)->print_id , ##args)
1166 1181
1167#define ata_link_printk(link, lv, fmt, args...) do { \ 1182#define ata_link_printk(link, lv, fmt, args...) do { \
1168 if (sata_pmp_attached((link)->ap)) \ 1183 if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \
1169 printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ 1184 printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \
1170 (link)->pmp , ##args); \ 1185 (link)->pmp , ##args); \
1171 else \ 1186 else \
@@ -1263,34 +1278,17 @@ static inline int ata_link_active(struct ata_link *link)
1263 return ata_tag_valid(link->active_tag) || link->sactive; 1278 return ata_tag_valid(link->active_tag) || link->sactive;
1264} 1279}
1265 1280
1266static inline struct ata_link *ata_port_first_link(struct ata_port *ap) 1281extern struct ata_link *__ata_port_next_link(struct ata_port *ap,
1267{ 1282 struct ata_link *link,
1268 if (sata_pmp_attached(ap)) 1283 bool dev_only);
1269 return ap->pmp_link;
1270 return &ap->link;
1271}
1272
1273static inline struct ata_link *ata_port_next_link(struct ata_link *link)
1274{
1275 struct ata_port *ap = link->ap;
1276
1277 if (ata_is_host_link(link)) {
1278 if (!sata_pmp_attached(ap))
1279 return NULL;
1280 return ap->pmp_link;
1281 }
1282
1283 if (++link < ap->nr_pmp_links + ap->pmp_link)
1284 return link;
1285 return NULL;
1286}
1287 1284
1288#define __ata_port_for_each_link(lk, ap) \ 1285#define __ata_port_for_each_link(link, ap) \
1289 for ((lk) = &(ap)->link; (lk); (lk) = ata_port_next_link(lk)) 1286 for ((link) = __ata_port_next_link((ap), NULL, false); (link); \
1287 (link) = __ata_port_next_link((ap), (link), false))
1290 1288
1291#define ata_port_for_each_link(link, ap) \ 1289#define ata_port_for_each_link(link, ap) \
1292 for ((link) = ata_port_first_link(ap); (link); \ 1290 for ((link) = __ata_port_next_link((ap), NULL, true); (link); \
1293 (link) = ata_port_next_link(link)) 1291 (link) = __ata_port_next_link((ap), (link), true))
1294 1292
1295#define ata_link_for_each_dev(dev, link) \ 1293#define ata_link_for_each_dev(dev, link) \
1296 for ((dev) = (link)->device; \ 1294 for ((dev) = (link)->device; \
@@ -1427,6 +1425,28 @@ static inline unsigned long ata_deadline(unsigned long from_jiffies,
1427 return from_jiffies + msecs_to_jiffies(timeout_msecs); 1425 return from_jiffies + msecs_to_jiffies(timeout_msecs);
1428} 1426}
1429 1427
1428/* Don't open code these in drivers as there are traps. Firstly the range may
1429 change in future hardware and specs, secondly 0xFF means 'no DMA' but is
1430 > UDMA_0. Dyma ddreigiau */
1431
1432static inline int ata_using_mwdma(struct ata_device *adev)
1433{
1434 if (adev->dma_mode >= XFER_MW_DMA_0 && adev->dma_mode <= XFER_MW_DMA_4)
1435 return 1;
1436 return 0;
1437}
1438
1439static inline int ata_using_udma(struct ata_device *adev)
1440{
1441 if (adev->dma_mode >= XFER_UDMA_0 && adev->dma_mode <= XFER_UDMA_7)
1442 return 1;
1443 return 0;
1444}
1445
1446static inline int ata_dma_enabled(struct ata_device *adev)
1447{
1448 return (adev->dma_mode == 0xFF ? 0 : 1);
1449}
1430 1450
1431/************************************************************************** 1451/**************************************************************************
1432 * PMP - drivers/ata/libata-pmp.c 1452 * PMP - drivers/ata/libata-pmp.c
diff --git a/include/linux/list.h b/include/linux/list.h
index db35ef02e745..969f6e92d089 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -619,6 +619,19 @@ static inline void hlist_add_after(struct hlist_node *n,
619 next->next->pprev = &next->next; 619 next->next->pprev = &next->next;
620} 620}
621 621
622/*
623 * Move a list from one list head to another. Fixup the pprev
624 * reference of the first entry if it exists.
625 */
626static inline void hlist_move_list(struct hlist_head *old,
627 struct hlist_head *new)
628{
629 new->first = old->first;
630 if (new->first)
631 new->first->pprev = &new->first;
632 old->first = NULL;
633}
634
622#define hlist_entry(ptr, type, member) container_of(ptr,type,member) 635#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
623 636
624#define hlist_for_each(pos, head) \ 637#define hlist_for_each(pos, head) \
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index 3d25bcd139d1..e5872dc994c0 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -27,7 +27,6 @@ struct nlmsvc_binding {
27 struct nfs_fh *, 27 struct nfs_fh *,
28 struct file **); 28 struct file **);
29 void (*fclose)(struct file *); 29 void (*fclose)(struct file *);
30 unsigned long (*get_grace_period)(void);
31}; 30};
32 31
33extern struct nlmsvc_binding * nlmsvc_ops; 32extern struct nlmsvc_binding * nlmsvc_ops;
@@ -53,15 +52,7 @@ extern void nlmclnt_done(struct nlm_host *host);
53 52
54extern int nlmclnt_proc(struct nlm_host *host, int cmd, 53extern int nlmclnt_proc(struct nlm_host *host, int cmd,
55 struct file_lock *fl); 54 struct file_lock *fl);
56extern int lockd_up(int proto); 55extern int lockd_up(void);
57extern void lockd_down(void); 56extern void lockd_down(void);
58 57
59unsigned long get_nfs_grace_period(void);
60
61#ifdef CONFIG_NFSD_V4
62unsigned long get_nfs4_grace_period(void);
63#else
64static inline unsigned long get_nfs4_grace_period(void) {return 0;}
65#endif
66
67#endif /* LINUX_LOCKD_BIND_H */ 58#endif /* LINUX_LOCKD_BIND_H */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index dbb87ab282e8..b56d5aa9b194 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -12,6 +12,8 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/in6.h>
16#include <net/ipv6.h>
15#include <linux/fs.h> 17#include <linux/fs.h>
16#include <linux/kref.h> 18#include <linux/kref.h>
17#include <linux/utsname.h> 19#include <linux/utsname.h>
@@ -38,8 +40,9 @@
38 */ 40 */
39struct nlm_host { 41struct nlm_host {
40 struct hlist_node h_hash; /* doubly linked list */ 42 struct hlist_node h_hash; /* doubly linked list */
41 struct sockaddr_in h_addr; /* peer address */ 43 struct sockaddr_storage h_addr; /* peer address */
42 struct sockaddr_in h_saddr; /* our address (optional) */ 44 size_t h_addrlen;
45 struct sockaddr_storage h_srcaddr; /* our address (optional) */
43 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ 46 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
44 char * h_name; /* remote hostname */ 47 char * h_name; /* remote hostname */
45 u32 h_version; /* interface version */ 48 u32 h_version; /* interface version */
@@ -61,18 +64,56 @@ struct nlm_host {
61 struct list_head h_granted; /* Locks in GRANTED state */ 64 struct list_head h_granted; /* Locks in GRANTED state */
62 struct list_head h_reclaim; /* Locks in RECLAIM state */ 65 struct list_head h_reclaim; /* Locks in RECLAIM state */
63 struct nsm_handle * h_nsmhandle; /* NSM status handle */ 66 struct nsm_handle * h_nsmhandle; /* NSM status handle */
67
68 char h_addrbuf[48], /* address eyecatchers */
69 h_srcaddrbuf[48];
64}; 70};
65 71
66struct nsm_handle { 72struct nsm_handle {
67 struct list_head sm_link; 73 struct list_head sm_link;
68 atomic_t sm_count; 74 atomic_t sm_count;
69 char * sm_name; 75 char * sm_name;
70 struct sockaddr_in sm_addr; 76 struct sockaddr_storage sm_addr;
77 size_t sm_addrlen;
71 unsigned int sm_monitored : 1, 78 unsigned int sm_monitored : 1,
72 sm_sticky : 1; /* don't unmonitor */ 79 sm_sticky : 1; /* don't unmonitor */
80 char sm_addrbuf[48]; /* address eyecatcher */
73}; 81};
74 82
75/* 83/*
84 * Rigorous type checking on sockaddr type conversions
85 */
86static inline struct sockaddr_in *nlm_addr_in(const struct nlm_host *host)
87{
88 return (struct sockaddr_in *)&host->h_addr;
89}
90
91static inline struct sockaddr *nlm_addr(const struct nlm_host *host)
92{
93 return (struct sockaddr *)&host->h_addr;
94}
95
96static inline struct sockaddr_in *nlm_srcaddr_in(const struct nlm_host *host)
97{
98 return (struct sockaddr_in *)&host->h_srcaddr;
99}
100
101static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host)
102{
103 return (struct sockaddr *)&host->h_srcaddr;
104}
105
106static inline struct sockaddr_in *nsm_addr_in(const struct nsm_handle *handle)
107{
108 return (struct sockaddr_in *)&handle->sm_addr;
109}
110
111static inline struct sockaddr *nsm_addr(const struct nsm_handle *handle)
112{
113 return (struct sockaddr *)&handle->sm_addr;
114}
115
116/*
76 * Map an fl_owner_t into a unique 32-bit "pid" 117 * Map an fl_owner_t into a unique 32-bit "pid"
77 */ 118 */
78struct nlm_lockowner { 119struct nlm_lockowner {
@@ -166,7 +207,8 @@ int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *);
166struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); 207struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl);
167void nlmclnt_finish_block(struct nlm_wait *block); 208void nlmclnt_finish_block(struct nlm_wait *block);
168int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); 209int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout);
169__be32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); 210__be32 nlmclnt_grant(const struct sockaddr *addr,
211 const struct nlm_lock *lock);
170void nlmclnt_recovery(struct nlm_host *); 212void nlmclnt_recovery(struct nlm_host *);
171int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); 213int nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
172void nlmclnt_next_cookie(struct nlm_cookie *); 214void nlmclnt_next_cookie(struct nlm_cookie *);
@@ -174,12 +216,14 @@ void nlmclnt_next_cookie(struct nlm_cookie *);
174/* 216/*
175 * Host cache 217 * Host cache
176 */ 218 */
177struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *sin, 219struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
178 int proto, u32 version, 220 const size_t salen,
221 const unsigned short protocol,
222 const u32 version,
223 const char *hostname);
224struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp,
179 const char *hostname, 225 const char *hostname,
180 unsigned int hostname_len); 226 const size_t hostname_len);
181struct nlm_host *nlmsvc_lookup_host(struct svc_rqst *, const char *,
182 unsigned int);
183struct rpc_clnt * nlm_bind_host(struct nlm_host *); 227struct rpc_clnt * nlm_bind_host(struct nlm_host *);
184void nlm_rebind_host(struct nlm_host *); 228void nlm_rebind_host(struct nlm_host *);
185struct nlm_host * nlm_get_host(struct nlm_host *); 229struct nlm_host * nlm_get_host(struct nlm_host *);
@@ -201,7 +245,7 @@ typedef int (*nlm_host_match_fn_t)(void *cur, struct nlm_host *ref);
201 */ 245 */
202__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, 246__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
203 struct nlm_host *, struct nlm_lock *, int, 247 struct nlm_host *, struct nlm_lock *, int,
204 struct nlm_cookie *); 248 struct nlm_cookie *, int);
205__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); 249__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
206__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, 250__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
207 struct nlm_host *, struct nlm_lock *, 251 struct nlm_host *, struct nlm_lock *,
@@ -233,15 +277,82 @@ static inline struct inode *nlmsvc_file_inode(struct nlm_file *file)
233 return file->f_file->f_path.dentry->d_inode; 277 return file->f_file->f_path.dentry->d_inode;
234} 278}
235 279
280static inline int __nlm_privileged_request4(const struct sockaddr *sap)
281{
282 const struct sockaddr_in *sin = (struct sockaddr_in *)sap;
283 return (sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) &&
284 (ntohs(sin->sin_port) < 1024);
285}
286
287#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
288static inline int __nlm_privileged_request6(const struct sockaddr *sap)
289{
290 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
291 return (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK) &&
292 (ntohs(sin6->sin6_port) < 1024);
293}
294#else /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
295static inline int __nlm_privileged_request6(const struct sockaddr *sap)
296{
297 return 0;
298}
299#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
300
236/* 301/*
237 * Compare two host addresses (needs modifying for ipv6) 302 * Ensure incoming requests are from local privileged callers.
303 *
304 * Return TRUE if sender is local and is connecting via a privileged port;
305 * otherwise return FALSE.
238 */ 306 */
239static inline int nlm_cmp_addr(const struct sockaddr_in *sin1, 307static inline int nlm_privileged_requester(const struct svc_rqst *rqstp)
240 const struct sockaddr_in *sin2)
241{ 308{
309 const struct sockaddr *sap = svc_addr(rqstp);
310
311 switch (sap->sa_family) {
312 case AF_INET:
313 return __nlm_privileged_request4(sap);
314 case AF_INET6:
315 return __nlm_privileged_request6(sap);
316 default:
317 return 0;
318 }
319}
320
321static inline int __nlm_cmp_addr4(const struct sockaddr *sap1,
322 const struct sockaddr *sap2)
323{
324 const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1;
325 const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2;
242 return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; 326 return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr;
243} 327}
244 328
329static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
330 const struct sockaddr *sap2)
331{
332 const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1;
333 const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2;
334 return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
335}
336
337/*
338 * Compare two host addresses
339 *
340 * Return TRUE if the addresses are the same; otherwise FALSE.
341 */
342static inline int nlm_cmp_addr(const struct sockaddr *sap1,
343 const struct sockaddr *sap2)
344{
345 if (sap1->sa_family == sap2->sa_family) {
346 switch (sap1->sa_family) {
347 case AF_INET:
348 return __nlm_cmp_addr4(sap1, sap2);
349 case AF_INET6:
350 return __nlm_cmp_addr6(sap1, sap2);
351 }
352 }
353 return 0;
354}
355
245/* 356/*
246 * Compare two NLM locks. 357 * Compare two NLM locks.
247 * When the second lock is of type F_UNLCK, this acts like a wildcard. 358 * When the second lock is of type F_UNLCK, this acts like a wildcard.
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h
index df18fa053bcd..d6b3a802c046 100644
--- a/include/linux/lockd/xdr.h
+++ b/include/linux/lockd/xdr.h
@@ -81,8 +81,6 @@ struct nlm_reboot {
81 unsigned int len; 81 unsigned int len;
82 u32 state; 82 u32 state;
83 __be32 addr; 83 __be32 addr;
84 __be32 vers;
85 __be32 proto;
86}; 84};
87 85
88/* 86/*
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 1fa0c2ce4dec..f7f3fdddbef0 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -6,6 +6,10 @@
6#define AFS_SUPER_MAGIC 0x5346414F 6#define AFS_SUPER_MAGIC 0x5346414F
7#define AUTOFS_SUPER_MAGIC 0x0187 7#define AUTOFS_SUPER_MAGIC 0x0187
8#define CODA_SUPER_MAGIC 0x73757245 8#define CODA_SUPER_MAGIC 0x73757245
9#define DEBUGFS_MAGIC 0x64626720
10#define SYSFS_MAGIC 0x62656572
11#define SECURITYFS_MAGIC 0x73636673
12#define TMPFS_MAGIC 0x01021994
9#define EFS_SUPER_MAGIC 0x414A53 13#define EFS_SUPER_MAGIC 0x414A53
10#define EXT2_SUPER_MAGIC 0xEF53 14#define EXT2_SUPER_MAGIC 0xEF53
11#define EXT3_SUPER_MAGIC 0xEF53 15#define EXT3_SUPER_MAGIC 0xEF53
diff --git a/include/linux/major.h b/include/linux/major.h
index 53d5fafd85c3..88249452b935 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -170,4 +170,6 @@
170 170
171#define VIOTAPE_MAJOR 230 171#define VIOTAPE_MAJOR 230
172 172
173#define BLOCK_EXT_MAJOR 259
174
173#endif 175#endif
diff --git a/include/linux/map_to_7segment.h b/include/linux/map_to_7segment.h
new file mode 100644
index 000000000000..7df8432c4402
--- /dev/null
+++ b/include/linux/map_to_7segment.h
@@ -0,0 +1,187 @@
1/*
2 * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com>
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 as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef MAP_TO_7SEGMENT_H
20#define MAP_TO_7SEGMENT_H
21
22/* This file provides translation primitives and tables for the conversion
23 * of (ASCII) characters to a 7-segments notation.
24 *
25 * The 7 segment's wikipedia notation below is used as standard.
26 * See: http://en.wikipedia.org/wiki/Seven_segment_display
27 *
28 * Notation: +-a-+
29 * f b
30 * +-g-+
31 * e c
32 * +-d-+
33 *
34 * Usage:
35 *
36 * Register a map variable, and fill it with a character set:
37 * static SEG7_DEFAULT_MAP(map_seg7);
38 *
39 *
40 * Then use for conversion:
41 * seg7 = map_to_seg7(&map_seg7, some_char);
42 * ...
43 *
44 * In device drivers it is recommended, if required, to make the char map
45 * accessible via the sysfs interface using the following scheme:
46 *
47 * static ssize_t show_map(struct device *dev, char *buf) {
48 * memcpy(buf, &map_seg7, sizeof(map_seg7));
49 * return sizeof(map_seg7);
50 * }
51 * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) {
52 * if(cnt != sizeof(map_seg7))
53 * return -EINVAL;
54 * memcpy(&map_seg7, buf, cnt);
55 * return cnt;
56 * }
57 * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map);
58 *
59 * History:
60 * 2005-05-31 RFC linux-kernel@vger.kernel.org
61 */
62#include <linux/errno.h>
63
64
65#define BIT_SEG7_A 0
66#define BIT_SEG7_B 1
67#define BIT_SEG7_C 2
68#define BIT_SEG7_D 3
69#define BIT_SEG7_E 4
70#define BIT_SEG7_F 5
71#define BIT_SEG7_G 6
72#define BIT_SEG7_RESERVED 7
73
74struct seg7_conversion_map {
75 unsigned char table[128];
76};
77
78static inline int map_to_seg7(struct seg7_conversion_map *map, int c)
79{
80 return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL;
81}
82
83#define SEG7_CONVERSION_MAP(_name, _map) \
84 struct seg7_conversion_map _name = { .table = { _map } }
85
86/*
87 * It is recommended to use a facility that allows user space to redefine
88 * custom character sets for LCD devices. Please use a sysfs interface
89 * as described above.
90 */
91#define MAP_TO_SEG7_SYSFS_FILE "map_seg7"
92
93/*******************************************************************************
94 * ASCII conversion table
95 ******************************************************************************/
96
97#define _SEG7(l,a,b,c,d,e,f,g) \
98 ( a<<BIT_SEG7_A | b<<BIT_SEG7_B | c<<BIT_SEG7_C | d<<BIT_SEG7_D | \
99 e<<BIT_SEG7_E | f<<BIT_SEG7_F | g<<BIT_SEG7_G )
100
101#define _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
102 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
103
104#define _MAP_33_47_ASCII_SEG7_SYMBOL \
105 _SEG7('!',0,0,0,0,1,1,0), _SEG7('"',0,1,0,0,0,1,0), _SEG7('#',0,1,1,0,1,1,0),\
106 _SEG7('$',1,0,1,1,0,1,1), _SEG7('%',0,0,1,0,0,1,0), _SEG7('&',1,0,1,1,1,1,1),\
107 _SEG7('\'',0,0,0,0,0,1,0),_SEG7('(',1,0,0,1,1,1,0), _SEG7(')',1,1,1,1,0,0,0),\
108 _SEG7('*',0,1,1,0,1,1,1), _SEG7('+',0,1,1,0,0,0,1), _SEG7(',',0,0,0,0,1,0,0),\
109 _SEG7('-',0,0,0,0,0,0,1), _SEG7('.',0,0,0,0,1,0,0), _SEG7('/',0,1,0,0,1,0,1),
110
111#define _MAP_48_57_ASCII_SEG7_NUMERIC \
112 _SEG7('0',1,1,1,1,1,1,0), _SEG7('1',0,1,1,0,0,0,0), _SEG7('2',1,1,0,1,1,0,1),\
113 _SEG7('3',1,1,1,1,0,0,1), _SEG7('4',0,1,1,0,0,1,1), _SEG7('5',1,0,1,1,0,1,1),\
114 _SEG7('6',1,0,1,1,1,1,1), _SEG7('7',1,1,1,0,0,0,0), _SEG7('8',1,1,1,1,1,1,1),\
115 _SEG7('9',1,1,1,1,0,1,1),
116
117#define _MAP_58_64_ASCII_SEG7_SYMBOL \
118 _SEG7(':',0,0,0,1,0,0,1), _SEG7(';',0,0,0,1,0,0,1), _SEG7('<',1,0,0,0,0,1,1),\
119 _SEG7('=',0,0,0,1,0,0,1), _SEG7('>',1,1,0,0,0,0,1), _SEG7('?',1,1,1,0,0,1,0),\
120 _SEG7('@',1,1,0,1,1,1,1),
121
122#define _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \
123 _SEG7('A',1,1,1,0,1,1,1), _SEG7('B',1,1,1,1,1,1,1), _SEG7('C',1,0,0,1,1,1,0),\
124 _SEG7('D',1,1,1,1,1,1,0), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\
125 _SEG7('G',1,1,1,1,0,1,1), _SEG7('H',0,1,1,0,1,1,1), _SEG7('I',0,1,1,0,0,0,0),\
126 _SEG7('J',0,1,1,1,0,0,0), _SEG7('K',0,1,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\
127 _SEG7('M',1,1,1,0,1,1,0), _SEG7('N',1,1,1,0,1,1,0), _SEG7('O',1,1,1,1,1,1,0),\
128 _SEG7('P',1,1,0,0,1,1,1), _SEG7('Q',1,1,1,1,1,1,0), _SEG7('R',1,1,1,0,1,1,1),\
129 _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('U',0,1,1,1,1,1,0),\
130 _SEG7('V',0,1,1,1,1,1,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\
131 _SEG7('Y',0,1,1,0,0,1,1), _SEG7('Z',1,1,0,1,1,0,1),
132
133#define _MAP_91_96_ASCII_SEG7_SYMBOL \
134 _SEG7('[',1,0,0,1,1,1,0), _SEG7('\\',0,0,1,0,0,1,1),_SEG7(']',1,1,1,1,0,0,0),\
135 _SEG7('^',1,1,0,0,0,1,0), _SEG7('_',0,0,0,1,0,0,0), _SEG7('`',0,1,0,0,0,0,0),
136
137#define _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
138 _SEG7('A',1,1,1,0,1,1,1), _SEG7('b',0,0,1,1,1,1,1), _SEG7('c',0,0,0,1,1,0,1),\
139 _SEG7('d',0,1,1,1,1,0,1), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\
140 _SEG7('G',1,1,1,1,0,1,1), _SEG7('h',0,0,1,0,1,1,1), _SEG7('i',0,0,1,0,0,0,0),\
141 _SEG7('j',0,0,1,1,0,0,0), _SEG7('k',0,0,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\
142 _SEG7('M',1,1,1,0,1,1,0), _SEG7('n',0,0,1,0,1,0,1), _SEG7('o',0,0,1,1,1,0,1),\
143 _SEG7('P',1,1,0,0,1,1,1), _SEG7('q',1,1,1,0,0,1,1), _SEG7('r',0,0,0,0,1,0,1),\
144 _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('u',0,0,1,1,1,0,0),\
145 _SEG7('v',0,0,1,1,1,0,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\
146 _SEG7('y',0,1,1,1,0,1,1), _SEG7('Z',1,1,0,1,1,0,1),
147
148#define _MAP_123_126_ASCII_SEG7_SYMBOL \
149 _SEG7('{',1,0,0,1,1,1,0), _SEG7('|',0,0,0,0,1,1,0), _SEG7('}',1,1,1,1,0,0,0),\
150 _SEG7('~',1,0,0,0,0,0,0),
151
152/* Maps */
153
154/* This set tries to map as close as possible to the visible characteristics
155 * of the ASCII symbol, lowercase and uppercase letters may differ in
156 * presentation on the display.
157 */
158#define MAP_ASCII7SEG_ALPHANUM \
159 _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
160 _MAP_33_47_ASCII_SEG7_SYMBOL \
161 _MAP_48_57_ASCII_SEG7_NUMERIC \
162 _MAP_58_64_ASCII_SEG7_SYMBOL \
163 _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \
164 _MAP_91_96_ASCII_SEG7_SYMBOL \
165 _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
166 _MAP_123_126_ASCII_SEG7_SYMBOL
167
168/* This set tries to map as close as possible to the symbolic characteristics
169 * of the ASCII character for maximum discrimination.
170 * For now this means all alpha chars are in lower case representations.
171 * (This for example facilitates the use of hex numbers with uppercase input.)
172 */
173#define MAP_ASCII7SEG_ALPHANUM_LC \
174 _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
175 _MAP_33_47_ASCII_SEG7_SYMBOL \
176 _MAP_48_57_ASCII_SEG7_NUMERIC \
177 _MAP_58_64_ASCII_SEG7_SYMBOL \
178 _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
179 _MAP_91_96_ASCII_SEG7_SYMBOL \
180 _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
181 _MAP_123_126_ASCII_SEG7_SYMBOL
182
183#define SEG7_DEFAULT_MAP(_name) \
184 SEG7_CONVERSION_MAP(_name,MAP_ASCII7SEG_ALPHANUM)
185
186#endif /* MAP_TO_7SEGMENT_H */
187
diff --git a/include/linux/memstick.h b/include/linux/memstick.h
index a9f998a3f48b..d0c37e682234 100644
--- a/include/linux/memstick.h
+++ b/include/linux/memstick.h
@@ -21,30 +21,30 @@
21struct ms_status_register { 21struct ms_status_register {
22 unsigned char reserved; 22 unsigned char reserved;
23 unsigned char interrupt; 23 unsigned char interrupt;
24#define MEMSTICK_INT_CMDNAK 0x0001 24#define MEMSTICK_INT_CMDNAK 0x01
25#define MEMSTICK_INT_IOREQ 0x0008 25#define MEMSTICK_INT_IOREQ 0x08
26#define MEMSTICK_INT_IOBREQ 0x0010 26#define MEMSTICK_INT_IOBREQ 0x10
27#define MEMSTICK_INT_BREQ 0x0020 27#define MEMSTICK_INT_BREQ 0x20
28#define MEMSTICK_INT_ERR 0x0040 28#define MEMSTICK_INT_ERR 0x40
29#define MEMSTICK_INT_CED 0x0080 29#define MEMSTICK_INT_CED 0x80
30 30
31 unsigned char status0; 31 unsigned char status0;
32#define MEMSTICK_STATUS0_WP 0x0001 32#define MEMSTICK_STATUS0_WP 0x01
33#define MEMSTICK_STATUS0_SL 0x0002 33#define MEMSTICK_STATUS0_SL 0x02
34#define MEMSTICK_STATUS0_BF 0x0010 34#define MEMSTICK_STATUS0_BF 0x10
35#define MEMSTICK_STATUS0_BE 0x0020 35#define MEMSTICK_STATUS0_BE 0x20
36#define MEMSTICK_STATUS0_FB0 0x0040 36#define MEMSTICK_STATUS0_FB0 0x40
37#define MEMSTICK_STATUS0_MB 0x0080 37#define MEMSTICK_STATUS0_MB 0x80
38 38
39 unsigned char status1; 39 unsigned char status1;
40#define MEMSTICK_STATUS1_UCFG 0x0001 40#define MEMSTICK_STATUS1_UCFG 0x01
41#define MEMSTICK_STATUS1_FGER 0x0002 41#define MEMSTICK_STATUS1_FGER 0x02
42#define MEMSTICK_STATUS1_UCEX 0x0004 42#define MEMSTICK_STATUS1_UCEX 0x04
43#define MEMSTICK_STATUS1_EXER 0x0008 43#define MEMSTICK_STATUS1_EXER 0x08
44#define MEMSTICK_STATUS1_UCDT 0x0010 44#define MEMSTICK_STATUS1_UCDT 0x10
45#define MEMSTICK_STATUS1_DTER 0x0020 45#define MEMSTICK_STATUS1_DTER 0x20
46#define MEMSTICK_STATUS1_FBI 0x0040 46#define MEMSTICK_STATUS1_FB1 0x40
47#define MEMSTICK_STATUS1_MB 0x0080 47#define MEMSTICK_STATUS1_MB 0x80
48} __attribute__((packed)); 48} __attribute__((packed));
49 49
50struct ms_id_register { 50struct ms_id_register {
@@ -56,32 +56,32 @@ struct ms_id_register {
56 56
57struct ms_param_register { 57struct ms_param_register {
58 unsigned char system; 58 unsigned char system;
59#define MEMSTICK_SYS_ATEN 0xc0
60#define MEMSTICK_SYS_BAMD 0x80
61#define MEMSTICK_SYS_PAM 0x08 59#define MEMSTICK_SYS_PAM 0x08
60#define MEMSTICK_SYS_BAMD 0x80
62 61
63 unsigned char block_address_msb; 62 unsigned char block_address_msb;
64 unsigned short block_address; 63 unsigned short block_address;
65 unsigned char cp; 64 unsigned char cp;
66#define MEMSTICK_CP_BLOCK 0x0000 65#define MEMSTICK_CP_BLOCK 0x00
67#define MEMSTICK_CP_PAGE 0x0020 66#define MEMSTICK_CP_PAGE 0x20
68#define MEMSTICK_CP_EXTRA 0x0040 67#define MEMSTICK_CP_EXTRA 0x40
69#define MEMSTICK_CP_OVERWRITE 0x0080 68#define MEMSTICK_CP_OVERWRITE 0x80
70 69
71 unsigned char page_address; 70 unsigned char page_address;
72} __attribute__((packed)); 71} __attribute__((packed));
73 72
74struct ms_extra_data_register { 73struct ms_extra_data_register {
75 unsigned char overwrite_flag; 74 unsigned char overwrite_flag;
76#define MEMSTICK_OVERWRITE_UPDATA 0x0010 75#define MEMSTICK_OVERWRITE_UDST 0x10
77#define MEMSTICK_OVERWRITE_PAGE 0x0060 76#define MEMSTICK_OVERWRITE_PGST1 0x20
78#define MEMSTICK_OVERWRITE_BLOCK 0x0080 77#define MEMSTICK_OVERWRITE_PGST0 0x40
78#define MEMSTICK_OVERWRITE_BKST 0x80
79 79
80 unsigned char management_flag; 80 unsigned char management_flag;
81#define MEMSTICK_MANAGEMENT_SYSTEM 0x0004 81#define MEMSTICK_MANAGEMENT_SYSFLG 0x04
82#define MEMSTICK_MANAGEMENT_TRANS_TABLE 0x0008 82#define MEMSTICK_MANAGEMENT_ATFLG 0x08
83#define MEMSTICK_MANAGEMENT_COPY 0x0010 83#define MEMSTICK_MANAGEMENT_SCMS1 0x10
84#define MEMSTICK_MANAGEMENT_ACCESS 0x0020 84#define MEMSTICK_MANAGEMENT_SCMS0 0x20
85 85
86 unsigned short logical_address; 86 unsigned short logical_address;
87} __attribute__((packed)); 87} __attribute__((packed));
@@ -96,9 +96,9 @@ struct ms_register {
96 96
97struct mspro_param_register { 97struct mspro_param_register {
98 unsigned char system; 98 unsigned char system;
99#define MEMSTICK_SYS_SERIAL 0x80
100#define MEMSTICK_SYS_PAR4 0x00 99#define MEMSTICK_SYS_PAR4 0x00
101#define MEMSTICK_SYS_PAR8 0x40 100#define MEMSTICK_SYS_PAR8 0x40
101#define MEMSTICK_SYS_SERIAL 0x80
102 102
103 unsigned short data_count; 103 unsigned short data_count;
104 unsigned int data_address; 104 unsigned int data_address;
@@ -147,7 +147,7 @@ struct ms_register_addr {
147 unsigned char w_length; 147 unsigned char w_length;
148} __attribute__((packed)); 148} __attribute__((packed));
149 149
150enum { 150enum memstick_tpc {
151 MS_TPC_READ_MG_STATUS = 0x01, 151 MS_TPC_READ_MG_STATUS = 0x01,
152 MS_TPC_READ_LONG_DATA = 0x02, 152 MS_TPC_READ_LONG_DATA = 0x02,
153 MS_TPC_READ_SHORT_DATA = 0x03, 153 MS_TPC_READ_SHORT_DATA = 0x03,
@@ -167,7 +167,7 @@ enum {
167 MS_TPC_SET_CMD = 0x0e 167 MS_TPC_SET_CMD = 0x0e
168}; 168};
169 169
170enum { 170enum memstick_command {
171 MS_CMD_BLOCK_END = 0x33, 171 MS_CMD_BLOCK_END = 0x33,
172 MS_CMD_RESET = 0x3c, 172 MS_CMD_RESET = 0x3c,
173 MS_CMD_BLOCK_WRITE = 0x55, 173 MS_CMD_BLOCK_WRITE = 0x55,
@@ -201,8 +201,6 @@ enum {
201 201
202/*** Driver structures and functions ***/ 202/*** Driver structures and functions ***/
203 203
204#define MEMSTICK_PART_SHIFT 3
205
206enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; 204enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE };
207 205
208#define MEMSTICK_POWER_OFF 0 206#define MEMSTICK_POWER_OFF 0
@@ -215,24 +213,27 @@ enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE };
215struct memstick_host; 213struct memstick_host;
216struct memstick_driver; 214struct memstick_driver;
217 215
216struct memstick_device_id {
217 unsigned char match_flags;
218#define MEMSTICK_MATCH_ALL 0x01 218#define MEMSTICK_MATCH_ALL 0x01
219 219
220 unsigned char type;
220#define MEMSTICK_TYPE_LEGACY 0xff 221#define MEMSTICK_TYPE_LEGACY 0xff
221#define MEMSTICK_TYPE_DUO 0x00 222#define MEMSTICK_TYPE_DUO 0x00
222#define MEMSTICK_TYPE_PRO 0x01 223#define MEMSTICK_TYPE_PRO 0x01
223 224
225 unsigned char category;
224#define MEMSTICK_CATEGORY_STORAGE 0xff 226#define MEMSTICK_CATEGORY_STORAGE 0xff
225#define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 227#define MEMSTICK_CATEGORY_STORAGE_DUO 0x00
228#define MEMSTICK_CATEGORY_IO 0x01
229#define MEMSTICK_CATEGORY_IO_PRO 0x10
226 230
227#define MEMSTICK_CLASS_GENERIC 0xff
228#define MEMSTICK_CLASS_GENERIC_DUO 0x00
229
230
231struct memstick_device_id {
232 unsigned char match_flags;
233 unsigned char type;
234 unsigned char category;
235 unsigned char class; 231 unsigned char class;
232#define MEMSTICK_CLASS_FLASH 0xff
233#define MEMSTICK_CLASS_DUO 0x00
234#define MEMSTICK_CLASS_ROM 0x01
235#define MEMSTICK_CLASS_RO 0x02
236#define MEMSTICK_CLASS_WP 0x03
236}; 237};
237 238
238struct memstick_request { 239struct memstick_request {
@@ -319,9 +320,9 @@ void memstick_suspend_host(struct memstick_host *host);
319void memstick_resume_host(struct memstick_host *host); 320void memstick_resume_host(struct memstick_host *host);
320 321
321void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, 322void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc,
322 struct scatterlist *sg); 323 const struct scatterlist *sg);
323void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, 324void memstick_init_req(struct memstick_request *mrq, unsigned char tpc,
324 void *buf, size_t length); 325 const void *buf, size_t length);
325int memstick_next_req(struct memstick_host *host, 326int memstick_next_req(struct memstick_host *host,
326 struct memstick_request **mrq); 327 struct memstick_request **mrq);
327void memstick_new_req(struct memstick_host *host); 328void memstick_new_req(struct memstick_host *host);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index ec612e66391c..516d955ab8a1 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,6 +1,8 @@
1#ifndef MFD_TMIO_H 1#ifndef MFD_TMIO_H
2#define MFD_TMIO_H 2#define MFD_TMIO_H
3 3
4#include <linux/fb.h>
5
4#define tmio_ioread8(addr) readb(addr) 6#define tmio_ioread8(addr) readb(addr)
5#define tmio_ioread16(addr) readw(addr) 7#define tmio_ioread16(addr) readw(addr)
6#define tmio_ioread16_rep(r, b, l) readsw(r, b, l) 8#define tmio_ioread16_rep(r, b, l) readsw(r, b, l)
@@ -25,4 +27,21 @@ struct tmio_nand_data {
25 unsigned int num_partitions; 27 unsigned int num_partitions;
26}; 28};
27 29
30#define FBIO_TMIO_ACC_WRITE 0x7C639300
31#define FBIO_TMIO_ACC_SYNC 0x7C639301
32
33struct tmio_fb_data {
34 int (*lcd_set_power)(struct platform_device *fb_dev,
35 bool on);
36 int (*lcd_mode)(struct platform_device *fb_dev,
37 const struct fb_videomode *mode);
38 int num_modes;
39 struct fb_videomode *modes;
40
41 /* in mm: size of screen */
42 int height;
43 int width;
44};
45
46
28#endif 47#endif
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h
new file mode 100644
index 000000000000..217bb22ebb8e
--- /dev/null
+++ b/include/linux/mfd/wm8350/audio.h
@@ -0,0 +1,598 @@
1/*
2 * audio.h -- Audio Driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __LINUX_MFD_WM8350_AUDIO_H_
14#define __LINUX_MFD_WM8350_AUDIO_H_
15
16#include <linux/platform_device.h>
17
18#define WM8350_CLOCK_CONTROL_1 0x28
19#define WM8350_CLOCK_CONTROL_2 0x29
20#define WM8350_FLL_CONTROL_1 0x2A
21#define WM8350_FLL_CONTROL_2 0x2B
22#define WM8350_FLL_CONTROL_3 0x2C
23#define WM8350_FLL_CONTROL_4 0x2D
24#define WM8350_DAC_CONTROL 0x30
25#define WM8350_DAC_DIGITAL_VOLUME_L 0x32
26#define WM8350_DAC_DIGITAL_VOLUME_R 0x33
27#define WM8350_DAC_LR_RATE 0x35
28#define WM8350_DAC_CLOCK_CONTROL 0x36
29#define WM8350_DAC_MUTE 0x3A
30#define WM8350_DAC_MUTE_VOLUME 0x3B
31#define WM8350_DAC_SIDE 0x3C
32#define WM8350_ADC_CONTROL 0x40
33#define WM8350_ADC_DIGITAL_VOLUME_L 0x42
34#define WM8350_ADC_DIGITAL_VOLUME_R 0x43
35#define WM8350_ADC_DIVIDER 0x44
36#define WM8350_ADC_LR_RATE 0x46
37#define WM8350_INPUT_CONTROL 0x48
38#define WM8350_IN3_INPUT_CONTROL 0x49
39#define WM8350_MIC_BIAS_CONTROL 0x4A
40#define WM8350_OUTPUT_CONTROL 0x4C
41#define WM8350_JACK_DETECT 0x4D
42#define WM8350_ANTI_POP_CONTROL 0x4E
43#define WM8350_LEFT_INPUT_VOLUME 0x50
44#define WM8350_RIGHT_INPUT_VOLUME 0x51
45#define WM8350_LEFT_MIXER_CONTROL 0x58
46#define WM8350_RIGHT_MIXER_CONTROL 0x59
47#define WM8350_OUT3_MIXER_CONTROL 0x5C
48#define WM8350_OUT4_MIXER_CONTROL 0x5D
49#define WM8350_OUTPUT_LEFT_MIXER_VOLUME 0x60
50#define WM8350_OUTPUT_RIGHT_MIXER_VOLUME 0x61
51#define WM8350_INPUT_MIXER_VOLUME_L 0x62
52#define WM8350_INPUT_MIXER_VOLUME_R 0x63
53#define WM8350_INPUT_MIXER_VOLUME 0x64
54#define WM8350_LOUT1_VOLUME 0x68
55#define WM8350_ROUT1_VOLUME 0x69
56#define WM8350_LOUT2_VOLUME 0x6A
57#define WM8350_ROUT2_VOLUME 0x6B
58#define WM8350_BEEP_VOLUME 0x6F
59#define WM8350_AI_FORMATING 0x70
60#define WM8350_ADC_DAC_COMP 0x71
61#define WM8350_AI_ADC_CONTROL 0x72
62#define WM8350_AI_DAC_CONTROL 0x73
63#define WM8350_AIF_TEST 0x74
64#define WM8350_JACK_PIN_STATUS 0xE7
65
66/* Bit values for R08 (0x08) */
67#define WM8350_CODEC_ISEL_1_5 0 /* x1.5 */
68#define WM8350_CODEC_ISEL_1_0 1 /* x1.0 */
69#define WM8350_CODEC_ISEL_0_75 2 /* x0.75 */
70#define WM8350_CODEC_ISEL_0_5 3 /* x0.5 */
71
72#define WM8350_VMID_OFF 0
73#define WM8350_VMID_500K 1
74#define WM8350_VMID_100K 2
75#define WM8350_VMID_10K 3
76
77/*
78 * R40 (0x28) - Clock Control 1
79 */
80#define WM8350_TOCLK_RATE 0x4000
81#define WM8350_MCLK_SEL 0x0800
82#define WM8350_MCLK_DIV_MASK 0x0100
83#define WM8350_BCLK_DIV_MASK 0x00F0
84#define WM8350_OPCLK_DIV_MASK 0x0007
85
86/*
87 * R41 (0x29) - Clock Control 2
88 */
89#define WM8350_LRC_ADC_SEL 0x8000
90#define WM8350_MCLK_DIR 0x0001
91
92/*
93 * R42 (0x2A) - FLL Control 1
94 */
95#define WM8350_FLL_DITHER_WIDTH_MASK 0x3000
96#define WM8350_FLL_DITHER_HP 0x0800
97#define WM8350_FLL_OUTDIV_MASK 0x0700
98#define WM8350_FLL_RSP_RATE_MASK 0x00F0
99#define WM8350_FLL_RATE_MASK 0x0007
100
101/*
102 * R43 (0x2B) - FLL Control 2
103 */
104#define WM8350_FLL_RATIO_MASK 0xF800
105#define WM8350_FLL_N_MASK 0x03FF
106
107/*
108 * R44 (0x2C) - FLL Control 3
109 */
110#define WM8350_FLL_K_MASK 0xFFFF
111
112/*
113 * R45 (0x2D) - FLL Control 4
114 */
115#define WM8350_FLL_FRAC 0x0020
116#define WM8350_FLL_SLOW_LOCK_REF 0x0010
117#define WM8350_FLL_CLK_SRC_MASK 0x0003
118
119/*
120 * R48 (0x30) - DAC Control
121 */
122#define WM8350_DAC_MONO 0x2000
123#define WM8350_AIF_LRCLKRATE 0x1000
124#define WM8350_DEEMP_MASK 0x0030
125#define WM8350_DACL_DATINV 0x0002
126#define WM8350_DACR_DATINV 0x0001
127
128/*
129 * R50 (0x32) - DAC Digital Volume L
130 */
131#define WM8350_DAC_VU 0x0100
132#define WM8350_DACL_VOL_MASK 0x00FF
133
134/*
135 * R51 (0x33) - DAC Digital Volume R
136 */
137#define WM8350_DAC_VU 0x0100
138#define WM8350_DACR_VOL_MASK 0x00FF
139
140/*
141 * R53 (0x35) - DAC LR Rate
142 */
143#define WM8350_DACLRC_ENA 0x0800
144#define WM8350_DACLRC_RATE_MASK 0x07FF
145
146/*
147 * R54 (0x36) - DAC Clock Control
148 */
149#define WM8350_DACCLK_POL 0x0010
150#define WM8350_DAC_CLKDIV_MASK 0x0007
151
152/*
153 * R58 (0x3A) - DAC Mute
154 */
155#define WM8350_DAC_MUTE_ENA 0x4000
156
157/*
158 * R59 (0x3B) - DAC Mute Volume
159 */
160#define WM8350_DAC_MUTEMODE 0x4000
161#define WM8350_DAC_MUTERATE 0x2000
162#define WM8350_DAC_SB_FILT 0x1000
163
164/*
165 * R60 (0x3C) - DAC Side
166 */
167#define WM8350_ADC_TO_DACL_MASK 0x3000
168#define WM8350_ADC_TO_DACR_MASK 0x0C00
169
170/*
171 * R64 (0x40) - ADC Control
172 */
173#define WM8350_ADC_HPF_CUT_MASK 0x0300
174#define WM8350_ADCL_DATINV 0x0002
175#define WM8350_ADCR_DATINV 0x0001
176
177/*
178 * R66 (0x42) - ADC Digital Volume L
179 */
180#define WM8350_ADC_VU 0x0100
181#define WM8350_ADCL_VOL_MASK 0x00FF
182
183/*
184 * R67 (0x43) - ADC Digital Volume R
185 */
186#define WM8350_ADC_VU 0x0100
187#define WM8350_ADCR_VOL_MASK 0x00FF
188
189/*
190 * R68 (0x44) - ADC Divider
191 */
192#define WM8350_ADCL_DAC_SVOL_MASK 0x0F00
193#define WM8350_ADCR_DAC_SVOL_MASK 0x00F0
194#define WM8350_ADCCLK_POL 0x0008
195#define WM8350_ADC_CLKDIV_MASK 0x0007
196
197/*
198 * R70 (0x46) - ADC LR Rate
199 */
200#define WM8350_ADCLRC_ENA 0x0800
201#define WM8350_ADCLRC_RATE_MASK 0x07FF
202
203/*
204 * R72 (0x48) - Input Control
205 */
206#define WM8350_IN2R_ENA 0x0400
207#define WM8350_IN1RN_ENA 0x0200
208#define WM8350_IN1RP_ENA 0x0100
209#define WM8350_IN2L_ENA 0x0004
210#define WM8350_IN1LN_ENA 0x0002
211#define WM8350_IN1LP_ENA 0x0001
212
213/*
214 * R73 (0x49) - IN3 Input Control
215 */
216#define WM8350_IN3R_SHORT 0x4000
217#define WM8350_IN3L_SHORT 0x0040
218
219/*
220 * R74 (0x4A) - Mic Bias Control
221 */
222#define WM8350_MICBSEL 0x4000
223#define WM8350_MCDTHR_MASK 0x001C
224#define WM8350_MCDSCTHR_MASK 0x0003
225
226/*
227 * R76 (0x4C) - Output Control
228 */
229#define WM8350_OUT4_VROI 0x0800
230#define WM8350_OUT3_VROI 0x0400
231#define WM8350_OUT2_VROI 0x0200
232#define WM8350_OUT1_VROI 0x0100
233#define WM8350_OUT2_FB 0x0004
234#define WM8350_OUT1_FB 0x0001
235
236/*
237 * R77 (0x4D) - Jack Detect
238 */
239#define WM8350_JDL_ENA 0x8000
240#define WM8350_JDR_ENA 0x4000
241
242/*
243 * R78 (0x4E) - Anti Pop Control
244 */
245#define WM8350_ANTI_POP_MASK 0x0300
246#define WM8350_DIS_OP_LN4_MASK 0x00C0
247#define WM8350_DIS_OP_LN3_MASK 0x0030
248#define WM8350_DIS_OP_OUT2_MASK 0x000C
249#define WM8350_DIS_OP_OUT1_MASK 0x0003
250
251/*
252 * R80 (0x50) - Left Input Volume
253 */
254#define WM8350_INL_MUTE 0x4000
255#define WM8350_INL_ZC 0x2000
256#define WM8350_IN_VU 0x0100
257#define WM8350_INL_VOL_MASK 0x00FC
258
259/*
260 * R81 (0x51) - Right Input Volume
261 */
262#define WM8350_INR_MUTE 0x4000
263#define WM8350_INR_ZC 0x2000
264#define WM8350_IN_VU 0x0100
265#define WM8350_INR_VOL_MASK 0x00FC
266
267/*
268 * R88 (0x58) - Left Mixer Control
269 */
270#define WM8350_DACR_TO_MIXOUTL 0x1000
271#define WM8350_DACL_TO_MIXOUTL 0x0800
272#define WM8350_IN3L_TO_MIXOUTL 0x0004
273#define WM8350_INR_TO_MIXOUTL 0x0002
274#define WM8350_INL_TO_MIXOUTL 0x0001
275
276/*
277 * R89 (0x59) - Right Mixer Control
278 */
279#define WM8350_DACR_TO_MIXOUTR 0x1000
280#define WM8350_DACL_TO_MIXOUTR 0x0800
281#define WM8350_IN3R_TO_MIXOUTR 0x0008
282#define WM8350_INR_TO_MIXOUTR 0x0002
283#define WM8350_INL_TO_MIXOUTR 0x0001
284
285/*
286 * R92 (0x5C) - OUT3 Mixer Control
287 */
288#define WM8350_DACL_TO_OUT3 0x0800
289#define WM8350_MIXINL_TO_OUT3 0x0100
290#define WM8350_OUT4_TO_OUT3 0x0008
291#define WM8350_MIXOUTL_TO_OUT3 0x0001
292
293/*
294 * R93 (0x5D) - OUT4 Mixer Control
295 */
296#define WM8350_DACR_TO_OUT4 0x1000
297#define WM8350_DACL_TO_OUT4 0x0800
298#define WM8350_OUT4_ATTN 0x0400
299#define WM8350_MIXINR_TO_OUT4 0x0200
300#define WM8350_OUT3_TO_OUT4 0x0004
301#define WM8350_MIXOUTR_TO_OUT4 0x0002
302#define WM8350_MIXOUTL_TO_OUT4 0x0001
303
304/*
305 * R96 (0x60) - Output Left Mixer Volume
306 */
307#define WM8350_IN3L_MIXOUTL_VOL_MASK 0x0E00
308#define WM8350_IN3L_MIXOUTL_VOL_SHIFT 9
309#define WM8350_INR_MIXOUTL_VOL_MASK 0x00E0
310#define WM8350_INR_MIXOUTL_VOL_SHIFT 5
311#define WM8350_INL_MIXOUTL_VOL_MASK 0x000E
312#define WM8350_INL_MIXOUTL_VOL_SHIFT 1
313
314/* Bit values for R96 (0x60) */
315#define WM8350_IN3L_MIXOUTL_VOL_OFF 0
316#define WM8350_IN3L_MIXOUTL_VOL_M12DB 1
317#define WM8350_IN3L_MIXOUTL_VOL_M9DB 2
318#define WM8350_IN3L_MIXOUTL_VOL_M6DB 3
319#define WM8350_IN3L_MIXOUTL_VOL_M3DB 4
320#define WM8350_IN3L_MIXOUTL_VOL_0DB 5
321#define WM8350_IN3L_MIXOUTL_VOL_3DB 6
322#define WM8350_IN3L_MIXOUTL_VOL_6DB 7
323
324#define WM8350_INR_MIXOUTL_VOL_OFF 0
325#define WM8350_INR_MIXOUTL_VOL_M12DB 1
326#define WM8350_INR_MIXOUTL_VOL_M9DB 2
327#define WM8350_INR_MIXOUTL_VOL_M6DB 3
328#define WM8350_INR_MIXOUTL_VOL_M3DB 4
329#define WM8350_INR_MIXOUTL_VOL_0DB 5
330#define WM8350_INR_MIXOUTL_VOL_3DB 6
331#define WM8350_INR_MIXOUTL_VOL_6DB 7
332
333#define WM8350_INL_MIXOUTL_VOL_OFF 0
334#define WM8350_INL_MIXOUTL_VOL_M12DB 1
335#define WM8350_INL_MIXOUTL_VOL_M9DB 2
336#define WM8350_INL_MIXOUTL_VOL_M6DB 3
337#define WM8350_INL_MIXOUTL_VOL_M3DB 4
338#define WM8350_INL_MIXOUTL_VOL_0DB 5
339#define WM8350_INL_MIXOUTL_VOL_3DB 6
340#define WM8350_INL_MIXOUTL_VOL_6DB 7
341
342/*
343 * R97 (0x61) - Output Right Mixer Volume
344 */
345#define WM8350_IN3R_MIXOUTR_VOL_MASK 0xE000
346#define WM8350_IN3R_MIXOUTR_VOL_SHIFT 13
347#define WM8350_INR_MIXOUTR_VOL_MASK 0x00E0
348#define WM8350_INR_MIXOUTR_VOL_SHIFT 5
349#define WM8350_INL_MIXOUTR_VOL_MASK 0x000E
350#define WM8350_INL_MIXOUTR_VOL_SHIFT 1
351
352/* Bit values for R96 (0x60) */
353#define WM8350_IN3R_MIXOUTR_VOL_OFF 0
354#define WM8350_IN3R_MIXOUTR_VOL_M12DB 1
355#define WM8350_IN3R_MIXOUTR_VOL_M9DB 2
356#define WM8350_IN3R_MIXOUTR_VOL_M6DB 3
357#define WM8350_IN3R_MIXOUTR_VOL_M3DB 4
358#define WM8350_IN3R_MIXOUTR_VOL_0DB 5
359#define WM8350_IN3R_MIXOUTR_VOL_3DB 6
360#define WM8350_IN3R_MIXOUTR_VOL_6DB 7
361
362#define WM8350_INR_MIXOUTR_VOL_OFF 0
363#define WM8350_INR_MIXOUTR_VOL_M12DB 1
364#define WM8350_INR_MIXOUTR_VOL_M9DB 2
365#define WM8350_INR_MIXOUTR_VOL_M6DB 3
366#define WM8350_INR_MIXOUTR_VOL_M3DB 4
367#define WM8350_INR_MIXOUTR_VOL_0DB 5
368#define WM8350_INR_MIXOUTR_VOL_3DB 6
369#define WM8350_INR_MIXOUTR_VOL_6DB 7
370
371#define WM8350_INL_MIXOUTR_VOL_OFF 0
372#define WM8350_INL_MIXOUTR_VOL_M12DB 1
373#define WM8350_INL_MIXOUTR_VOL_M9DB 2
374#define WM8350_INL_MIXOUTR_VOL_M6DB 3
375#define WM8350_INL_MIXOUTR_VOL_M3DB 4
376#define WM8350_INL_MIXOUTR_VOL_0DB 5
377#define WM8350_INL_MIXOUTR_VOL_3DB 6
378#define WM8350_INL_MIXOUTR_VOL_6DB 7
379
380/*
381 * R98 (0x62) - Input Mixer Volume L
382 */
383#define WM8350_IN3L_MIXINL_VOL_MASK 0x0E00
384#define WM8350_IN2L_MIXINL_VOL_MASK 0x000E
385#define WM8350_INL_MIXINL_VOL 0x0001
386
387/*
388 * R99 (0x63) - Input Mixer Volume R
389 */
390#define WM8350_IN3R_MIXINR_VOL_MASK 0xE000
391#define WM8350_IN2R_MIXINR_VOL_MASK 0x00E0
392#define WM8350_INR_MIXINR_VOL 0x0001
393
394/*
395 * R100 (0x64) - Input Mixer Volume
396 */
397#define WM8350_OUT4_MIXIN_DST 0x8000
398#define WM8350_OUT4_MIXIN_VOL_MASK 0x000E
399
400/*
401 * R104 (0x68) - LOUT1 Volume
402 */
403#define WM8350_OUT1L_MUTE 0x4000
404#define WM8350_OUT1L_ZC 0x2000
405#define WM8350_OUT1_VU 0x0100
406#define WM8350_OUT1L_VOL_MASK 0x00FC
407#define WM8350_OUT1L_VOL_SHIFT 2
408
409/*
410 * R105 (0x69) - ROUT1 Volume
411 */
412#define WM8350_OUT1R_MUTE 0x4000
413#define WM8350_OUT1R_ZC 0x2000
414#define WM8350_OUT1_VU 0x0100
415#define WM8350_OUT1R_VOL_MASK 0x00FC
416#define WM8350_OUT1R_VOL_SHIFT 2
417
418/*
419 * R106 (0x6A) - LOUT2 Volume
420 */
421#define WM8350_OUT2L_MUTE 0x4000
422#define WM8350_OUT2L_ZC 0x2000
423#define WM8350_OUT2_VU 0x0100
424#define WM8350_OUT2L_VOL_MASK 0x00FC
425
426/*
427 * R107 (0x6B) - ROUT2 Volume
428 */
429#define WM8350_OUT2R_MUTE 0x4000
430#define WM8350_OUT2R_ZC 0x2000
431#define WM8350_OUT2R_INV 0x0400
432#define WM8350_OUT2R_INV_MUTE 0x0200
433#define WM8350_OUT2_VU 0x0100
434#define WM8350_OUT2R_VOL_MASK 0x00FC
435
436/*
437 * R111 (0x6F) - BEEP Volume
438 */
439#define WM8350_IN3R_OUT2R_VOL_MASK 0x00E0
440
441/*
442 * R112 (0x70) - AI Formating
443 */
444#define WM8350_AIF_BCLK_INV 0x8000
445#define WM8350_AIF_TRI 0x2000
446#define WM8350_AIF_LRCLK_INV 0x1000
447#define WM8350_AIF_WL_MASK 0x0C00
448#define WM8350_AIF_FMT_MASK 0x0300
449
450/*
451 * R113 (0x71) - ADC DAC COMP
452 */
453#define WM8350_DAC_COMP 0x0080
454#define WM8350_DAC_COMPMODE 0x0040
455#define WM8350_ADC_COMP 0x0020
456#define WM8350_ADC_COMPMODE 0x0010
457#define WM8350_LOOPBACK 0x0001
458
459/*
460 * R114 (0x72) - AI ADC Control
461 */
462#define WM8350_AIFADC_PD 0x0080
463#define WM8350_AIFADCL_SRC 0x0040
464#define WM8350_AIFADCR_SRC 0x0020
465#define WM8350_AIFADC_TDM_CHAN 0x0010
466#define WM8350_AIFADC_TDM 0x0008
467
468/*
469 * R115 (0x73) - AI DAC Control
470 */
471#define WM8350_BCLK_MSTR 0x4000
472#define WM8350_AIFDAC_PD 0x0080
473#define WM8350_DACL_SRC 0x0040
474#define WM8350_DACR_SRC 0x0020
475#define WM8350_AIFDAC_TDM_CHAN 0x0010
476#define WM8350_AIFDAC_TDM 0x0008
477#define WM8350_DAC_BOOST_MASK 0x0003
478
479/*
480 * R116 (0x74) - AIF Test
481 */
482#define WM8350_CODEC_BYP 0x4000
483#define WM8350_AIFADC_WR_TST 0x2000
484#define WM8350_AIFADC_RD_TST 0x1000
485#define WM8350_AIFDAC_WR_TST 0x0800
486#define WM8350_AIFDAC_RD_TST 0x0400
487#define WM8350_AIFADC_ASYN 0x0020
488#define WM8350_AIFDAC_ASYN 0x0010
489
490/*
491 * R231 (0xE7) - Jack Status
492 */
493#define WM8350_JACK_R_LVL 0x0400
494
495/*
496 * WM8350 Platform setup
497 */
498#define WM8350_S_CURVE_NONE 0x0
499#define WM8350_S_CURVE_FAST 0x1
500#define WM8350_S_CURVE_MEDIUM 0x2
501#define WM8350_S_CURVE_SLOW 0x3
502
503#define WM8350_DISCHARGE_OFF 0x0
504#define WM8350_DISCHARGE_FAST 0x1
505#define WM8350_DISCHARGE_MEDIUM 0x2
506#define WM8350_DISCHARGE_SLOW 0x3
507
508#define WM8350_TIE_OFF_500R 0x0
509#define WM8350_TIE_OFF_30K 0x1
510
511/*
512 * Clock sources & directions
513 */
514#define WM8350_SYSCLK 0
515
516#define WM8350_MCLK_SEL_PLL_MCLK 0
517#define WM8350_MCLK_SEL_PLL_DAC 1
518#define WM8350_MCLK_SEL_PLL_ADC 2
519#define WM8350_MCLK_SEL_PLL_32K 3
520#define WM8350_MCLK_SEL_MCLK 5
521
522#define WM8350_MCLK_DIR_OUT 0
523#define WM8350_MCLK_DIR_IN 1
524
525/* clock divider id's */
526#define WM8350_ADC_CLKDIV 0
527#define WM8350_DAC_CLKDIV 1
528#define WM8350_BCLK_CLKDIV 2
529#define WM8350_OPCLK_CLKDIV 3
530#define WM8350_TO_CLKDIV 4
531#define WM8350_SYS_CLKDIV 5
532#define WM8350_DACLR_CLKDIV 6
533#define WM8350_ADCLR_CLKDIV 7
534
535/* ADC clock dividers */
536#define WM8350_ADCDIV_1 0x0
537#define WM8350_ADCDIV_1_5 0x1
538#define WM8350_ADCDIV_2 0x2
539#define WM8350_ADCDIV_3 0x3
540#define WM8350_ADCDIV_4 0x4
541#define WM8350_ADCDIV_5_5 0x5
542#define WM8350_ADCDIV_6 0x6
543
544/* ADC clock dividers */
545#define WM8350_DACDIV_1 0x0
546#define WM8350_DACDIV_1_5 0x1
547#define WM8350_DACDIV_2 0x2
548#define WM8350_DACDIV_3 0x3
549#define WM8350_DACDIV_4 0x4
550#define WM8350_DACDIV_5_5 0x5
551#define WM8350_DACDIV_6 0x6
552
553/* BCLK clock dividers */
554#define WM8350_BCLK_DIV_1 (0x0 << 4)
555#define WM8350_BCLK_DIV_1_5 (0x1 << 4)
556#define WM8350_BCLK_DIV_2 (0x2 << 4)
557#define WM8350_BCLK_DIV_3 (0x3 << 4)
558#define WM8350_BCLK_DIV_4 (0x4 << 4)
559#define WM8350_BCLK_DIV_5_5 (0x5 << 4)
560#define WM8350_BCLK_DIV_6 (0x6 << 4)
561#define WM8350_BCLK_DIV_8 (0x7 << 4)
562#define WM8350_BCLK_DIV_11 (0x8 << 4)
563#define WM8350_BCLK_DIV_12 (0x9 << 4)
564#define WM8350_BCLK_DIV_16 (0xa << 4)
565#define WM8350_BCLK_DIV_22 (0xb << 4)
566#define WM8350_BCLK_DIV_24 (0xc << 4)
567#define WM8350_BCLK_DIV_32 (0xd << 4)
568#define WM8350_BCLK_DIV_44 (0xe << 4)
569#define WM8350_BCLK_DIV_48 (0xf << 4)
570
571/* Sys (MCLK) clock dividers */
572#define WM8350_MCLK_DIV_1 (0x0 << 8)
573#define WM8350_MCLK_DIV_2 (0x1 << 8)
574
575/* OP clock dividers */
576#define WM8350_OPCLK_DIV_1 0x0
577#define WM8350_OPCLK_DIV_2 0x1
578#define WM8350_OPCLK_DIV_3 0x2
579#define WM8350_OPCLK_DIV_4 0x3
580#define WM8350_OPCLK_DIV_5_5 0x4
581#define WM8350_OPCLK_DIV_6 0x5
582
583/* DAI ID */
584#define WM8350_HIFI_DAI 0
585
586/*
587 * Audio interrupts.
588 */
589#define WM8350_IRQ_CODEC_JCK_DET_L 39
590#define WM8350_IRQ_CODEC_JCK_DET_R 40
591#define WM8350_IRQ_CODEC_MICSCD 41
592#define WM8350_IRQ_CODEC_MICD 42
593
594struct wm8350_codec {
595 struct platform_device *pdev;
596};
597
598#endif
diff --git a/include/linux/mfd/wm8350/comparator.h b/include/linux/mfd/wm8350/comparator.h
new file mode 100644
index 000000000000..053788649452
--- /dev/null
+++ b/include/linux/mfd/wm8350/comparator.h
@@ -0,0 +1,167 @@
1/*
2 * comparator.h -- Comparator Aux ADC for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef __LINUX_MFD_WM8350_COMPARATOR_H_
13#define __LINUX_MFD_WM8350_COMPARATOR_H_
14
15/*
16 * Registers
17 */
18
19#define WM8350_DIGITISER_CONTROL_1 0x90
20#define WM8350_DIGITISER_CONTROL_2 0x91
21#define WM8350_AUX1_READBACK 0x98
22#define WM8350_AUX2_READBACK 0x99
23#define WM8350_AUX3_READBACK 0x9A
24#define WM8350_AUX4_READBACK 0x9B
25#define WM8350_CHIP_TEMP_READBACK 0x9F
26#define WM8350_GENERIC_COMPARATOR_CONTROL 0xA3
27#define WM8350_GENERIC_COMPARATOR_1 0xA4
28#define WM8350_GENERIC_COMPARATOR_2 0xA5
29#define WM8350_GENERIC_COMPARATOR_3 0xA6
30#define WM8350_GENERIC_COMPARATOR_4 0xA7
31
32/*
33 * R144 (0x90) - Digitiser Control (1)
34 */
35#define WM8350_AUXADC_CTC 0x4000
36#define WM8350_AUXADC_POLL 0x2000
37#define WM8350_AUXADC_HIB_MODE 0x1000
38#define WM8350_AUXADC_SEL8 0x0080
39#define WM8350_AUXADC_SEL7 0x0040
40#define WM8350_AUXADC_SEL6 0x0020
41#define WM8350_AUXADC_SEL5 0x0010
42#define WM8350_AUXADC_SEL4 0x0008
43#define WM8350_AUXADC_SEL3 0x0004
44#define WM8350_AUXADC_SEL2 0x0002
45#define WM8350_AUXADC_SEL1 0x0001
46
47/*
48 * R145 (0x91) - Digitiser Control (2)
49 */
50#define WM8350_AUXADC_MASKMODE_MASK 0x3000
51#define WM8350_AUXADC_CRATE_MASK 0x0700
52#define WM8350_AUXADC_CAL 0x0004
53#define WM8350_AUX_RBMODE 0x0002
54#define WM8350_AUXADC_WAIT 0x0001
55
56/*
57 * R152 (0x98) - AUX1 Readback
58 */
59#define WM8350_AUXADC_SCALE1_MASK 0x6000
60#define WM8350_AUXADC_REF1 0x1000
61#define WM8350_AUXADC_DATA1_MASK 0x0FFF
62
63/*
64 * R153 (0x99) - AUX2 Readback
65 */
66#define WM8350_AUXADC_SCALE2_MASK 0x6000
67#define WM8350_AUXADC_REF2 0x1000
68#define WM8350_AUXADC_DATA2_MASK 0x0FFF
69
70/*
71 * R154 (0x9A) - AUX3 Readback
72 */
73#define WM8350_AUXADC_SCALE3_MASK 0x6000
74#define WM8350_AUXADC_REF3 0x1000
75#define WM8350_AUXADC_DATA3_MASK 0x0FFF
76
77/*
78 * R155 (0x9B) - AUX4 Readback
79 */
80#define WM8350_AUXADC_SCALE4_MASK 0x6000
81#define WM8350_AUXADC_REF4 0x1000
82#define WM8350_AUXADC_DATA4_MASK 0x0FFF
83
84/*
85 * R156 (0x9C) - USB Voltage Readback
86 */
87#define WM8350_AUXADC_DATA_USB_MASK 0x0FFF
88
89/*
90 * R157 (0x9D) - LINE Voltage Readback
91 */
92#define WM8350_AUXADC_DATA_LINE_MASK 0x0FFF
93
94/*
95 * R158 (0x9E) - BATT Voltage Readback
96 */
97#define WM8350_AUXADC_DATA_BATT_MASK 0x0FFF
98
99/*
100 * R159 (0x9F) - Chip Temp Readback
101 */
102#define WM8350_AUXADC_DATA_CHIPTEMP_MASK 0x0FFF
103
104/*
105 * R163 (0xA3) - Generic Comparator Control
106 */
107#define WM8350_DCMP4_ENA 0x0008
108#define WM8350_DCMP3_ENA 0x0004
109#define WM8350_DCMP2_ENA 0x0002
110#define WM8350_DCMP1_ENA 0x0001
111
112/*
113 * R164 (0xA4) - Generic comparator 1
114 */
115#define WM8350_DCMP1_SRCSEL_MASK 0xE000
116#define WM8350_DCMP1_GT 0x1000
117#define WM8350_DCMP1_THR_MASK 0x0FFF
118
119/*
120 * R165 (0xA5) - Generic comparator 2
121 */
122#define WM8350_DCMP2_SRCSEL_MASK 0xE000
123#define WM8350_DCMP2_GT 0x1000
124#define WM8350_DCMP2_THR_MASK 0x0FFF
125
126/*
127 * R166 (0xA6) - Generic comparator 3
128 */
129#define WM8350_DCMP3_SRCSEL_MASK 0xE000
130#define WM8350_DCMP3_GT 0x1000
131#define WM8350_DCMP3_THR_MASK 0x0FFF
132
133/*
134 * R167 (0xA7) - Generic comparator 4
135 */
136#define WM8350_DCMP4_SRCSEL_MASK 0xE000
137#define WM8350_DCMP4_GT 0x1000
138#define WM8350_DCMP4_THR_MASK 0x0FFF
139
140/*
141 * Interrupts.
142 */
143#define WM8350_IRQ_AUXADC_DATARDY 16
144#define WM8350_IRQ_AUXADC_DCOMP4 17
145#define WM8350_IRQ_AUXADC_DCOMP3 18
146#define WM8350_IRQ_AUXADC_DCOMP2 19
147#define WM8350_IRQ_AUXADC_DCOMP1 20
148#define WM8350_IRQ_SYS_HYST_COMP_FAIL 21
149#define WM8350_IRQ_SYS_CHIP_GT115 22
150#define WM8350_IRQ_SYS_CHIP_GT140 23
151
152/*
153 * USB/2, LINE & BATT = ((VRTC * 2) / 4095)) * 10e6 uV
154 * Where VRTC = 2.7 V
155 */
156#define WM8350_AUX_COEFF 1319
157
158#define WM8350_AUXADC_AUX1 0
159#define WM8350_AUXADC_AUX2 1
160#define WM8350_AUXADC_AUX3 2
161#define WM8350_AUXADC_AUX4 3
162#define WM8350_AUXADC_USB 4
163#define WM8350_AUXADC_LINE 5
164#define WM8350_AUXADC_BATT 6
165#define WM8350_AUXADC_TEMP 7
166
167#endif
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
new file mode 100644
index 000000000000..6ebf97f2a475
--- /dev/null
+++ b/include/linux/mfd/wm8350/core.h
@@ -0,0 +1,631 @@
1/*
2 * core.h -- Core Driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __LINUX_MFD_WM8350_CORE_H_
14#define __LINUX_MFD_WM8350_CORE_H_
15
16#include <linux/kernel.h>
17#include <linux/mutex.h>
18#include <linux/workqueue.h>
19
20#include <linux/mfd/wm8350/audio.h>
21#include <linux/mfd/wm8350/gpio.h>
22#include <linux/mfd/wm8350/pmic.h>
23#include <linux/mfd/wm8350/rtc.h>
24#include <linux/mfd/wm8350/supply.h>
25#include <linux/mfd/wm8350/wdt.h>
26
27/*
28 * Register values.
29 */
30#define WM8350_RESET_ID 0x00
31#define WM8350_ID 0x01
32#define WM8350_SYSTEM_CONTROL_1 0x03
33#define WM8350_SYSTEM_CONTROL_2 0x04
34#define WM8350_SYSTEM_HIBERNATE 0x05
35#define WM8350_INTERFACE_CONTROL 0x06
36#define WM8350_POWER_MGMT_1 0x08
37#define WM8350_POWER_MGMT_2 0x09
38#define WM8350_POWER_MGMT_3 0x0A
39#define WM8350_POWER_MGMT_4 0x0B
40#define WM8350_POWER_MGMT_5 0x0C
41#define WM8350_POWER_MGMT_6 0x0D
42#define WM8350_POWER_MGMT_7 0x0E
43
44#define WM8350_SYSTEM_INTERRUPTS 0x18
45#define WM8350_INT_STATUS_1 0x19
46#define WM8350_INT_STATUS_2 0x1A
47#define WM8350_POWER_UP_INT_STATUS 0x1B
48#define WM8350_UNDER_VOLTAGE_INT_STATUS 0x1C
49#define WM8350_OVER_CURRENT_INT_STATUS 0x1D
50#define WM8350_GPIO_INT_STATUS 0x1E
51#define WM8350_COMPARATOR_INT_STATUS 0x1F
52#define WM8350_SYSTEM_INTERRUPTS_MASK 0x20
53#define WM8350_INT_STATUS_1_MASK 0x21
54#define WM8350_INT_STATUS_2_MASK 0x22
55#define WM8350_POWER_UP_INT_STATUS_MASK 0x23
56#define WM8350_UNDER_VOLTAGE_INT_STATUS_MASK 0x24
57#define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25
58#define WM8350_GPIO_INT_STATUS_MASK 0x26
59#define WM8350_COMPARATOR_INT_STATUS_MASK 0x27
60
61#define WM8350_MAX_REGISTER 0xFF
62
63/*
64 * Field Definitions.
65 */
66
67/*
68 * R0 (0x00) - Reset/ID
69 */
70#define WM8350_SW_RESET_CHIP_ID_MASK 0xFFFF
71
72/*
73 * R1 (0x01) - ID
74 */
75#define WM8350_CHIP_REV_MASK 0x7000
76#define WM8350_CONF_STS_MASK 0x0C00
77#define WM8350_CUST_ID_MASK 0x00FF
78
79/*
80 * R3 (0x03) - System Control 1
81 */
82#define WM8350_CHIP_ON 0x8000
83#define WM8350_POWERCYCLE 0x2000
84#define WM8350_VCC_FAULT_OV 0x1000
85#define WM8350_REG_RSTB_TIME_MASK 0x0C00
86#define WM8350_BG_SLEEP 0x0200
87#define WM8350_MEM_VALID 0x0020
88#define WM8350_CHIP_SET_UP 0x0010
89#define WM8350_ON_DEB_T 0x0008
90#define WM8350_ON_POL 0x0002
91#define WM8350_IRQ_POL 0x0001
92
93/*
94 * R4 (0x04) - System Control 2
95 */
96#define WM8350_USB_SUSPEND_8MA 0x8000
97#define WM8350_USB_SUSPEND 0x4000
98#define WM8350_USB_MSTR 0x2000
99#define WM8350_USB_MSTR_SRC 0x1000
100#define WM8350_USB_500MA 0x0800
101#define WM8350_USB_NOLIM 0x0400
102
103/*
104 * R5 (0x05) - System Hibernate
105 */
106#define WM8350_HIBERNATE 0x8000
107#define WM8350_WDOG_HIB_MODE 0x0080
108#define WM8350_REG_HIB_STARTUP_SEQ 0x0040
109#define WM8350_REG_RESET_HIB_MODE 0x0020
110#define WM8350_RST_HIB_MODE 0x0010
111#define WM8350_IRQ_HIB_MODE 0x0008
112#define WM8350_MEMRST_HIB_MODE 0x0004
113#define WM8350_PCCOMP_HIB_MODE 0x0002
114#define WM8350_TEMPMON_HIB_MODE 0x0001
115
116/*
117 * R6 (0x06) - Interface Control
118 */
119#define WM8350_USE_DEV_PINS 0x8000
120#define WM8350_USE_DEV_PINS_MASK 0x8000
121#define WM8350_USE_DEV_PINS_SHIFT 15
122#define WM8350_DEV_ADDR_MASK 0x6000
123#define WM8350_DEV_ADDR_SHIFT 13
124#define WM8350_CONFIG_DONE 0x1000
125#define WM8350_CONFIG_DONE_MASK 0x1000
126#define WM8350_CONFIG_DONE_SHIFT 12
127#define WM8350_RECONFIG_AT_ON 0x0800
128#define WM8350_RECONFIG_AT_ON_MASK 0x0800
129#define WM8350_RECONFIG_AT_ON_SHIFT 11
130#define WM8350_AUTOINC 0x0200
131#define WM8350_AUTOINC_MASK 0x0200
132#define WM8350_AUTOINC_SHIFT 9
133#define WM8350_ARA 0x0100
134#define WM8350_ARA_MASK 0x0100
135#define WM8350_ARA_SHIFT 8
136#define WM8350_SPI_CFG 0x0008
137#define WM8350_SPI_CFG_MASK 0x0008
138#define WM8350_SPI_CFG_SHIFT 3
139#define WM8350_SPI_4WIRE 0x0004
140#define WM8350_SPI_4WIRE_MASK 0x0004
141#define WM8350_SPI_4WIRE_SHIFT 2
142#define WM8350_SPI_3WIRE 0x0002
143#define WM8350_SPI_3WIRE_MASK 0x0002
144#define WM8350_SPI_3WIRE_SHIFT 1
145
146/* Bit values for R06 (0x06) */
147#define WM8350_USE_DEV_PINS_PRIMARY 0
148#define WM8350_USE_DEV_PINS_DEV 1
149
150#define WM8350_DEV_ADDR_34 0
151#define WM8350_DEV_ADDR_36 1
152#define WM8350_DEV_ADDR_3C 2
153#define WM8350_DEV_ADDR_3E 3
154
155#define WM8350_CONFIG_DONE_OFF 0
156#define WM8350_CONFIG_DONE_DONE 1
157
158#define WM8350_RECONFIG_AT_ON_OFF 0
159#define WM8350_RECONFIG_AT_ON_ON 1
160
161#define WM8350_AUTOINC_OFF 0
162#define WM8350_AUTOINC_ON 1
163
164#define WM8350_ARA_OFF 0
165#define WM8350_ARA_ON 1
166
167#define WM8350_SPI_CFG_CMOS 0
168#define WM8350_SPI_CFG_OD 1
169
170#define WM8350_SPI_4WIRE_3WIRE 0
171#define WM8350_SPI_4WIRE_4WIRE 1
172
173#define WM8350_SPI_3WIRE_I2C 0
174#define WM8350_SPI_3WIRE_SPI 1
175
176/*
177 * R8 (0x08) - Power mgmt (1)
178 */
179#define WM8350_CODEC_ISEL_MASK 0xC000
180#define WM8350_VBUFEN 0x2000
181#define WM8350_OUTPUT_DRAIN_EN 0x0400
182#define WM8350_MIC_DET_ENA 0x0100
183#define WM8350_BIASEN 0x0020
184#define WM8350_MICBEN 0x0010
185#define WM8350_VMIDEN 0x0004
186#define WM8350_VMID_MASK 0x0003
187#define WM8350_VMID_SHIFT 0
188
189/*
190 * R9 (0x09) - Power mgmt (2)
191 */
192#define WM8350_IN3R_ENA 0x0800
193#define WM8350_IN3L_ENA 0x0400
194#define WM8350_INR_ENA 0x0200
195#define WM8350_INL_ENA 0x0100
196#define WM8350_MIXINR_ENA 0x0080
197#define WM8350_MIXINL_ENA 0x0040
198#define WM8350_OUT4_ENA 0x0020
199#define WM8350_OUT3_ENA 0x0010
200#define WM8350_MIXOUTR_ENA 0x0002
201#define WM8350_MIXOUTL_ENA 0x0001
202
203/*
204 * R10 (0x0A) - Power mgmt (3)
205 */
206#define WM8350_IN3R_TO_OUT2R 0x0080
207#define WM8350_OUT2R_ENA 0x0008
208#define WM8350_OUT2L_ENA 0x0004
209#define WM8350_OUT1R_ENA 0x0002
210#define WM8350_OUT1L_ENA 0x0001
211
212/*
213 * R11 (0x0B) - Power mgmt (4)
214 */
215#define WM8350_SYSCLK_ENA 0x4000
216#define WM8350_ADC_HPF_ENA 0x2000
217#define WM8350_FLL_ENA 0x0800
218#define WM8350_FLL_OSC_ENA 0x0400
219#define WM8350_TOCLK_ENA 0x0100
220#define WM8350_DACR_ENA 0x0020
221#define WM8350_DACL_ENA 0x0010
222#define WM8350_ADCR_ENA 0x0008
223#define WM8350_ADCL_ENA 0x0004
224
225/*
226 * R12 (0x0C) - Power mgmt (5)
227 */
228#define WM8350_CODEC_ENA 0x1000
229#define WM8350_RTC_TICK_ENA 0x0800
230#define WM8350_OSC32K_ENA 0x0400
231#define WM8350_CHG_ENA 0x0200
232#define WM8350_ACC_DET_ENA 0x0100
233#define WM8350_AUXADC_ENA 0x0080
234#define WM8350_DCMP4_ENA 0x0008
235#define WM8350_DCMP3_ENA 0x0004
236#define WM8350_DCMP2_ENA 0x0002
237#define WM8350_DCMP1_ENA 0x0001
238
239/*
240 * R13 (0x0D) - Power mgmt (6)
241 */
242#define WM8350_LS_ENA 0x8000
243#define WM8350_LDO4_ENA 0x0800
244#define WM8350_LDO3_ENA 0x0400
245#define WM8350_LDO2_ENA 0x0200
246#define WM8350_LDO1_ENA 0x0100
247#define WM8350_DC6_ENA 0x0020
248#define WM8350_DC5_ENA 0x0010
249#define WM8350_DC4_ENA 0x0008
250#define WM8350_DC3_ENA 0x0004
251#define WM8350_DC2_ENA 0x0002
252#define WM8350_DC1_ENA 0x0001
253
254/*
255 * R14 (0x0E) - Power mgmt (7)
256 */
257#define WM8350_CS2_ENA 0x0002
258#define WM8350_CS1_ENA 0x0001
259
260/*
261 * R24 (0x18) - System Interrupts
262 */
263#define WM8350_OC_INT 0x2000
264#define WM8350_UV_INT 0x1000
265#define WM8350_PUTO_INT 0x0800
266#define WM8350_CS_INT 0x0200
267#define WM8350_EXT_INT 0x0100
268#define WM8350_CODEC_INT 0x0080
269#define WM8350_GP_INT 0x0040
270#define WM8350_AUXADC_INT 0x0020
271#define WM8350_RTC_INT 0x0010
272#define WM8350_SYS_INT 0x0008
273#define WM8350_CHG_INT 0x0004
274#define WM8350_USB_INT 0x0002
275#define WM8350_WKUP_INT 0x0001
276
277/*
278 * R25 (0x19) - Interrupt Status 1
279 */
280#define WM8350_CHG_BAT_HOT_EINT 0x8000
281#define WM8350_CHG_BAT_COLD_EINT 0x4000
282#define WM8350_CHG_BAT_FAIL_EINT 0x2000
283#define WM8350_CHG_TO_EINT 0x1000
284#define WM8350_CHG_END_EINT 0x0800
285#define WM8350_CHG_START_EINT 0x0400
286#define WM8350_CHG_FAST_RDY_EINT 0x0200
287#define WM8350_RTC_PER_EINT 0x0080
288#define WM8350_RTC_SEC_EINT 0x0040
289#define WM8350_RTC_ALM_EINT 0x0020
290#define WM8350_CHG_VBATT_LT_3P9_EINT 0x0004
291#define WM8350_CHG_VBATT_LT_3P1_EINT 0x0002
292#define WM8350_CHG_VBATT_LT_2P85_EINT 0x0001
293
294/*
295 * R26 (0x1A) - Interrupt Status 2
296 */
297#define WM8350_CS1_EINT 0x2000
298#define WM8350_CS2_EINT 0x1000
299#define WM8350_USB_LIMIT_EINT 0x0400
300#define WM8350_AUXADC_DATARDY_EINT 0x0100
301#define WM8350_AUXADC_DCOMP4_EINT 0x0080
302#define WM8350_AUXADC_DCOMP3_EINT 0x0040
303#define WM8350_AUXADC_DCOMP2_EINT 0x0020
304#define WM8350_AUXADC_DCOMP1_EINT 0x0010
305#define WM8350_SYS_HYST_COMP_FAIL_EINT 0x0008
306#define WM8350_SYS_CHIP_GT115_EINT 0x0004
307#define WM8350_SYS_CHIP_GT140_EINT 0x0002
308#define WM8350_SYS_WDOG_TO_EINT 0x0001
309
310/*
311 * R27 (0x1B) - Power Up Interrupt Status
312 */
313#define WM8350_PUTO_LDO4_EINT 0x0800
314#define WM8350_PUTO_LDO3_EINT 0x0400
315#define WM8350_PUTO_LDO2_EINT 0x0200
316#define WM8350_PUTO_LDO1_EINT 0x0100
317#define WM8350_PUTO_DC6_EINT 0x0020
318#define WM8350_PUTO_DC5_EINT 0x0010
319#define WM8350_PUTO_DC4_EINT 0x0008
320#define WM8350_PUTO_DC3_EINT 0x0004
321#define WM8350_PUTO_DC2_EINT 0x0002
322#define WM8350_PUTO_DC1_EINT 0x0001
323
324/*
325 * R28 (0x1C) - Under Voltage Interrupt status
326 */
327#define WM8350_UV_LDO4_EINT 0x0800
328#define WM8350_UV_LDO3_EINT 0x0400
329#define WM8350_UV_LDO2_EINT 0x0200
330#define WM8350_UV_LDO1_EINT 0x0100
331#define WM8350_UV_DC6_EINT 0x0020
332#define WM8350_UV_DC5_EINT 0x0010
333#define WM8350_UV_DC4_EINT 0x0008
334#define WM8350_UV_DC3_EINT 0x0004
335#define WM8350_UV_DC2_EINT 0x0002
336#define WM8350_UV_DC1_EINT 0x0001
337
338/*
339 * R29 (0x1D) - Over Current Interrupt status
340 */
341#define WM8350_OC_LS_EINT 0x8000
342
343/*
344 * R30 (0x1E) - GPIO Interrupt Status
345 */
346#define WM8350_GP12_EINT 0x1000
347#define WM8350_GP11_EINT 0x0800
348#define WM8350_GP10_EINT 0x0400
349#define WM8350_GP9_EINT 0x0200
350#define WM8350_GP8_EINT 0x0100
351#define WM8350_GP7_EINT 0x0080
352#define WM8350_GP6_EINT 0x0040
353#define WM8350_GP5_EINT 0x0020
354#define WM8350_GP4_EINT 0x0010
355#define WM8350_GP3_EINT 0x0008
356#define WM8350_GP2_EINT 0x0004
357#define WM8350_GP1_EINT 0x0002
358#define WM8350_GP0_EINT 0x0001
359
360/*
361 * R31 (0x1F) - Comparator Interrupt Status
362 */
363#define WM8350_EXT_USB_FB_EINT 0x8000
364#define WM8350_EXT_WALL_FB_EINT 0x4000
365#define WM8350_EXT_BAT_FB_EINT 0x2000
366#define WM8350_CODEC_JCK_DET_L_EINT 0x0800
367#define WM8350_CODEC_JCK_DET_R_EINT 0x0400
368#define WM8350_CODEC_MICSCD_EINT 0x0200
369#define WM8350_CODEC_MICD_EINT 0x0100
370#define WM8350_WKUP_OFF_STATE_EINT 0x0040
371#define WM8350_WKUP_HIB_STATE_EINT 0x0020
372#define WM8350_WKUP_CONV_FAULT_EINT 0x0010
373#define WM8350_WKUP_WDOG_RST_EINT 0x0008
374#define WM8350_WKUP_GP_PWR_ON_EINT 0x0004
375#define WM8350_WKUP_ONKEY_EINT 0x0002
376#define WM8350_WKUP_GP_WAKEUP_EINT 0x0001
377
378/*
379 * R32 (0x20) - System Interrupts Mask
380 */
381#define WM8350_IM_OC_INT 0x2000
382#define WM8350_IM_UV_INT 0x1000
383#define WM8350_IM_PUTO_INT 0x0800
384#define WM8350_IM_SPARE_INT 0x0400
385#define WM8350_IM_CS_INT 0x0200
386#define WM8350_IM_EXT_INT 0x0100
387#define WM8350_IM_CODEC_INT 0x0080
388#define WM8350_IM_GP_INT 0x0040
389#define WM8350_IM_AUXADC_INT 0x0020
390#define WM8350_IM_RTC_INT 0x0010
391#define WM8350_IM_SYS_INT 0x0008
392#define WM8350_IM_CHG_INT 0x0004
393#define WM8350_IM_USB_INT 0x0002
394#define WM8350_IM_WKUP_INT 0x0001
395
396/*
397 * R33 (0x21) - Interrupt Status 1 Mask
398 */
399#define WM8350_IM_CHG_BAT_HOT_EINT 0x8000
400#define WM8350_IM_CHG_BAT_COLD_EINT 0x4000
401#define WM8350_IM_CHG_BAT_FAIL_EINT 0x2000
402#define WM8350_IM_CHG_TO_EINT 0x1000
403#define WM8350_IM_CHG_END_EINT 0x0800
404#define WM8350_IM_CHG_START_EINT 0x0400
405#define WM8350_IM_CHG_FAST_RDY_EINT 0x0200
406#define WM8350_IM_RTC_PER_EINT 0x0080
407#define WM8350_IM_RTC_SEC_EINT 0x0040
408#define WM8350_IM_RTC_ALM_EINT 0x0020
409#define WM8350_IM_CHG_VBATT_LT_3P9_EINT 0x0004
410#define WM8350_IM_CHG_VBATT_LT_3P1_EINT 0x0002
411#define WM8350_IM_CHG_VBATT_LT_2P85_EINT 0x0001
412
413/*
414 * R34 (0x22) - Interrupt Status 2 Mask
415 */
416#define WM8350_IM_SPARE2_EINT 0x8000
417#define WM8350_IM_SPARE1_EINT 0x4000
418#define WM8350_IM_CS1_EINT 0x2000
419#define WM8350_IM_CS2_EINT 0x1000
420#define WM8350_IM_USB_LIMIT_EINT 0x0400
421#define WM8350_IM_AUXADC_DATARDY_EINT 0x0100
422#define WM8350_IM_AUXADC_DCOMP4_EINT 0x0080
423#define WM8350_IM_AUXADC_DCOMP3_EINT 0x0040
424#define WM8350_IM_AUXADC_DCOMP2_EINT 0x0020
425#define WM8350_IM_AUXADC_DCOMP1_EINT 0x0010
426#define WM8350_IM_SYS_HYST_COMP_FAIL_EINT 0x0008
427#define WM8350_IM_SYS_CHIP_GT115_EINT 0x0004
428#define WM8350_IM_SYS_CHIP_GT140_EINT 0x0002
429#define WM8350_IM_SYS_WDOG_TO_EINT 0x0001
430
431/*
432 * R35 (0x23) - Power Up Interrupt Status Mask
433 */
434#define WM8350_IM_PUTO_LDO4_EINT 0x0800
435#define WM8350_IM_PUTO_LDO3_EINT 0x0400
436#define WM8350_IM_PUTO_LDO2_EINT 0x0200
437#define WM8350_IM_PUTO_LDO1_EINT 0x0100
438#define WM8350_IM_PUTO_DC6_EINT 0x0020
439#define WM8350_IM_PUTO_DC5_EINT 0x0010
440#define WM8350_IM_PUTO_DC4_EINT 0x0008
441#define WM8350_IM_PUTO_DC3_EINT 0x0004
442#define WM8350_IM_PUTO_DC2_EINT 0x0002
443#define WM8350_IM_PUTO_DC1_EINT 0x0001
444
445/*
446 * R36 (0x24) - Under Voltage Interrupt status Mask
447 */
448#define WM8350_IM_UV_LDO4_EINT 0x0800
449#define WM8350_IM_UV_LDO3_EINT 0x0400
450#define WM8350_IM_UV_LDO2_EINT 0x0200
451#define WM8350_IM_UV_LDO1_EINT 0x0100
452#define WM8350_IM_UV_DC6_EINT 0x0020
453#define WM8350_IM_UV_DC5_EINT 0x0010
454#define WM8350_IM_UV_DC4_EINT 0x0008
455#define WM8350_IM_UV_DC3_EINT 0x0004
456#define WM8350_IM_UV_DC2_EINT 0x0002
457#define WM8350_IM_UV_DC1_EINT 0x0001
458
459/*
460 * R37 (0x25) - Over Current Interrupt status Mask
461 */
462#define WM8350_IM_OC_LS_EINT 0x8000
463
464/*
465 * R38 (0x26) - GPIO Interrupt Status Mask
466 */
467#define WM8350_IM_GP12_EINT 0x1000
468#define WM8350_IM_GP11_EINT 0x0800
469#define WM8350_IM_GP10_EINT 0x0400
470#define WM8350_IM_GP9_EINT 0x0200
471#define WM8350_IM_GP8_EINT 0x0100
472#define WM8350_IM_GP7_EINT 0x0080
473#define WM8350_IM_GP6_EINT 0x0040
474#define WM8350_IM_GP5_EINT 0x0020
475#define WM8350_IM_GP4_EINT 0x0010
476#define WM8350_IM_GP3_EINT 0x0008
477#define WM8350_IM_GP2_EINT 0x0004
478#define WM8350_IM_GP1_EINT 0x0002
479#define WM8350_IM_GP0_EINT 0x0001
480
481/*
482 * R39 (0x27) - Comparator Interrupt Status Mask
483 */
484#define WM8350_IM_EXT_USB_FB_EINT 0x8000
485#define WM8350_IM_EXT_WALL_FB_EINT 0x4000
486#define WM8350_IM_EXT_BAT_FB_EINT 0x2000
487#define WM8350_IM_CODEC_JCK_DET_L_EINT 0x0800
488#define WM8350_IM_CODEC_JCK_DET_R_EINT 0x0400
489#define WM8350_IM_CODEC_MICSCD_EINT 0x0200
490#define WM8350_IM_CODEC_MICD_EINT 0x0100
491#define WM8350_IM_WKUP_OFF_STATE_EINT 0x0040
492#define WM8350_IM_WKUP_HIB_STATE_EINT 0x0020
493#define WM8350_IM_WKUP_CONV_FAULT_EINT 0x0010
494#define WM8350_IM_WKUP_WDOG_RST_EINT 0x0008
495#define WM8350_IM_WKUP_GP_PWR_ON_EINT 0x0004
496#define WM8350_IM_WKUP_ONKEY_EINT 0x0002
497#define WM8350_IM_WKUP_GP_WAKEUP_EINT 0x0001
498
499/*
500 * R220 (0xDC) - RAM BIST 1
501 */
502#define WM8350_READ_STATUS 0x0800
503#define WM8350_TSTRAM_CLK 0x0100
504#define WM8350_TSTRAM_CLK_ENA 0x0080
505#define WM8350_STARTSEQ 0x0040
506#define WM8350_READ_SRC 0x0020
507#define WM8350_COUNT_DIR 0x0010
508#define WM8350_TSTRAM_MODE_MASK 0x000E
509#define WM8350_TSTRAM_ENA 0x0001
510
511/*
512 * R225 (0xE1) - DCDC/LDO status
513 */
514#define WM8350_LS_STS 0x8000
515#define WM8350_LDO4_STS 0x0800
516#define WM8350_LDO3_STS 0x0400
517#define WM8350_LDO2_STS 0x0200
518#define WM8350_LDO1_STS 0x0100
519#define WM8350_DC6_STS 0x0020
520#define WM8350_DC5_STS 0x0010
521#define WM8350_DC4_STS 0x0008
522#define WM8350_DC3_STS 0x0004
523#define WM8350_DC2_STS 0x0002
524#define WM8350_DC1_STS 0x0001
525
526/* WM8350 wake up conditions */
527#define WM8350_IRQ_WKUP_OFF_STATE 43
528#define WM8350_IRQ_WKUP_HIB_STATE 44
529#define WM8350_IRQ_WKUP_CONV_FAULT 45
530#define WM8350_IRQ_WKUP_WDOG_RST 46
531#define WM8350_IRQ_WKUP_GP_PWR_ON 47
532#define WM8350_IRQ_WKUP_ONKEY 48
533#define WM8350_IRQ_WKUP_GP_WAKEUP 49
534
535/* wm8350 chip revisions */
536#define WM8350_REV_E 0x4
537#define WM8350_REV_F 0x5
538#define WM8350_REV_G 0x6
539
540#define WM8350_NUM_IRQ 63
541
542struct wm8350_reg_access {
543 u16 readable; /* Mask of readable bits */
544 u16 writable; /* Mask of writable bits */
545 u16 vol; /* Mask of volatile bits */
546};
547extern const struct wm8350_reg_access wm8350_reg_io_map[];
548extern const u16 wm8350_mode0_defaults[];
549extern const u16 wm8350_mode1_defaults[];
550extern const u16 wm8350_mode2_defaults[];
551extern const u16 wm8350_mode3_defaults[];
552
553struct wm8350;
554
555struct wm8350_irq {
556 void (*handler) (struct wm8350 *, int, void *);
557 void *data;
558};
559
560struct wm8350 {
561 int rev; /* chip revision */
562
563 struct device *dev;
564
565 /* device IO */
566 union {
567 struct i2c_client *i2c_client;
568 struct spi_device *spi_device;
569 };
570 int (*read_dev)(struct wm8350 *wm8350, char reg, int size, void *dest);
571 int (*write_dev)(struct wm8350 *wm8350, char reg, int size,
572 void *src);
573 u16 *reg_cache;
574
575 /* Interrupt handling */
576 struct work_struct irq_work;
577 struct mutex irq_mutex; /* IRQ table mutex */
578 struct wm8350_irq irq[WM8350_NUM_IRQ];
579 int chip_irq;
580
581 /* Client devices */
582 struct wm8350_codec codec;
583 struct wm8350_gpio gpio;
584 struct wm8350_pmic pmic;
585 struct wm8350_power power;
586 struct wm8350_rtc rtc;
587 struct wm8350_wdt wdt;
588};
589
590/**
591 * Data to be supplied by the platform to initialise the WM8350.
592 *
593 * @init: Function called during driver initialisation. Should be
594 * used by the platform to configure GPIO functions and similar.
595 */
596struct wm8350_platform_data {
597 int (*init)(struct wm8350 *wm8350);
598};
599
600
601/*
602 * WM8350 device initialisation and exit.
603 */
604int wm8350_device_init(struct wm8350 *wm8350, int irq,
605 struct wm8350_platform_data *pdata);
606void wm8350_device_exit(struct wm8350 *wm8350);
607
608/*
609 * WM8350 device IO
610 */
611int wm8350_clear_bits(struct wm8350 *wm8350, u16 reg, u16 mask);
612int wm8350_set_bits(struct wm8350 *wm8350, u16 reg, u16 mask);
613u16 wm8350_reg_read(struct wm8350 *wm8350, int reg);
614int wm8350_reg_write(struct wm8350 *wm8350, int reg, u16 val);
615int wm8350_reg_lock(struct wm8350 *wm8350);
616int wm8350_reg_unlock(struct wm8350 *wm8350);
617int wm8350_block_read(struct wm8350 *wm8350, int reg, int size, u16 *dest);
618int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src);
619
620/*
621 * WM8350 internal interrupts
622 */
623int wm8350_register_irq(struct wm8350 *wm8350, int irq,
624 void (*handler) (struct wm8350 *, int, void *),
625 void *data);
626int wm8350_free_irq(struct wm8350 *wm8350, int irq);
627int wm8350_mask_irq(struct wm8350 *wm8350, int irq);
628int wm8350_unmask_irq(struct wm8350 *wm8350, int irq);
629
630
631#endif
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h
new file mode 100644
index 000000000000..ed91e8f5d298
--- /dev/null
+++ b/include/linux/mfd/wm8350/gpio.h
@@ -0,0 +1,342 @@
1/*
2 * gpio.h -- GPIO Driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __LINUX_MFD_WM8350_GPIO_H_
14#define __LINUX_MFD_WM8350_GPIO_H_
15
16#include <linux/platform_device.h>
17
18/*
19 * GPIO Registers.
20 */
21#define WM8350_GPIO_DEBOUNCE 0x80
22#define WM8350_GPIO_PIN_PULL_UP_CONTROL 0x81
23#define WM8350_GPIO_PULL_DOWN_CONTROL 0x82
24#define WM8350_GPIO_INT_MODE 0x83
25#define WM8350_GPIO_CONTROL 0x85
26#define WM8350_GPIO_CONFIGURATION_I_O 0x86
27#define WM8350_GPIO_PIN_POLARITY_TYPE 0x87
28#define WM8350_GPIO_FUNCTION_SELECT_1 0x8C
29#define WM8350_GPIO_FUNCTION_SELECT_2 0x8D
30#define WM8350_GPIO_FUNCTION_SELECT_3 0x8E
31#define WM8350_GPIO_FUNCTION_SELECT_4 0x8F
32
33/*
34 * GPIO Functions
35 */
36#define WM8350_GPIO0_GPIO_IN 0x0
37#define WM8350_GPIO0_GPIO_OUT 0x0
38#define WM8350_GPIO0_PWR_ON_IN 0x1
39#define WM8350_GPIO0_PWR_ON_OUT 0x1
40#define WM8350_GPIO0_LDO_EN_IN 0x2
41#define WM8350_GPIO0_VRTC_OUT 0x2
42#define WM8350_GPIO0_LPWR1_IN 0x3
43#define WM8350_GPIO0_POR_B_OUT 0x3
44
45#define WM8350_GPIO1_GPIO_IN 0x0
46#define WM8350_GPIO1_GPIO_OUT 0x0
47#define WM8350_GPIO1_PWR_ON_IN 0x1
48#define WM8350_GPIO1_DO_CONF_OUT 0x1
49#define WM8350_GPIO1_LDO_EN_IN 0x2
50#define WM8350_GPIO1_RESET_OUT 0x2
51#define WM8350_GPIO1_LPWR2_IN 0x3
52#define WM8350_GPIO1_MEMRST_OUT 0x3
53
54#define WM8350_GPIO2_GPIO_IN 0x0
55#define WM8350_GPIO2_GPIO_OUT 0x0
56#define WM8350_GPIO2_PWR_ON_IN 0x1
57#define WM8350_GPIO2_PWR_ON_OUT 0x1
58#define WM8350_GPIO2_WAKE_UP_IN 0x2
59#define WM8350_GPIO2_VRTC_OUT 0x2
60#define WM8350_GPIO2_32KHZ_IN 0x3
61#define WM8350_GPIO2_32KHZ_OUT 0x3
62
63#define WM8350_GPIO3_GPIO_IN 0x0
64#define WM8350_GPIO3_GPIO_OUT 0x0
65#define WM8350_GPIO3_PWR_ON_IN 0x1
66#define WM8350_GPIO3_P_CLK_OUT 0x1
67#define WM8350_GPIO3_LDO_EN_IN 0x2
68#define WM8350_GPIO3_VRTC_OUT 0x2
69#define WM8350_GPIO3_PWR_OFF_IN 0x3
70#define WM8350_GPIO3_32KHZ_OUT 0x3
71
72#define WM8350_GPIO4_GPIO_IN 0x0
73#define WM8350_GPIO4_GPIO_OUT 0x0
74#define WM8350_GPIO4_MR_IN 0x1
75#define WM8350_GPIO4_MEM_RST_OUT 0x1
76#define WM8350_GPIO4_FLASH_IN 0x2
77#define WM8350_GPIO4_ADA_OUT 0x2
78#define WM8350_GPIO4_HIBERNATE_IN 0x3
79#define WM8350_GPIO4_FLASH_OUT 0x3
80#define WM8350_GPIO4_MICDET_OUT 0x4
81#define WM8350_GPIO4_MICSHT_OUT 0x5
82
83#define WM8350_GPIO5_GPIO_IN 0x0
84#define WM8350_GPIO5_GPIO_OUT 0x0
85#define WM8350_GPIO5_LPWR1_IN 0x1
86#define WM8350_GPIO5_P_CLK_OUT 0x1
87#define WM8350_GPIO5_ADCLRCLK_IN 0x2
88#define WM8350_GPIO5_ADCLRCLK_OUT 0x2
89#define WM8350_GPIO5_HIBERNATE_IN 0x3
90#define WM8350_GPIO5_32KHZ_OUT 0x3
91#define WM8350_GPIO5_MICDET_OUT 0x4
92#define WM8350_GPIO5_MICSHT_OUT 0x5
93#define WM8350_GPIO5_ADA_OUT 0x6
94#define WM8350_GPIO5_OPCLK_OUT 0x7
95
96#define WM8350_GPIO6_GPIO_IN 0x0
97#define WM8350_GPIO6_GPIO_OUT 0x0
98#define WM8350_GPIO6_LPWR2_IN 0x1
99#define WM8350_GPIO6_MEMRST_OUT 0x1
100#define WM8350_GPIO6_FLASH_IN 0x2
101#define WM8350_GPIO6_ADA_OUT 0x2
102#define WM8350_GPIO6_HIBERNATE_IN 0x3
103#define WM8350_GPIO6_RTC_OUT 0x3
104#define WM8350_GPIO6_MICDET_OUT 0x4
105#define WM8350_GPIO6_MICSHT_OUT 0x5
106#define WM8350_GPIO6_ADCLRCLKB_OUT 0x6
107#define WM8350_GPIO6_SDOUT_OUT 0x7
108
109#define WM8350_GPIO7_GPIO_IN 0x0
110#define WM8350_GPIO7_GPIO_OUT 0x0
111#define WM8350_GPIO7_LPWR3_IN 0x1
112#define WM8350_GPIO7_P_CLK_OUT 0x1
113#define WM8350_GPIO7_MASK_IN 0x2
114#define WM8350_GPIO7_VCC_FAULT_OUT 0x2
115#define WM8350_GPIO7_HIBERNATE_IN 0x3
116#define WM8350_GPIO7_BATT_FAULT_OUT 0x3
117#define WM8350_GPIO7_MICDET_OUT 0x4
118#define WM8350_GPIO7_MICSHT_OUT 0x5
119#define WM8350_GPIO7_ADA_OUT 0x6
120#define WM8350_GPIO7_CSB_IN 0x7
121
122#define WM8350_GPIO8_GPIO_IN 0x0
123#define WM8350_GPIO8_GPIO_OUT 0x0
124#define WM8350_GPIO8_MR_IN 0x1
125#define WM8350_GPIO8_VCC_FAULT_OUT 0x1
126#define WM8350_GPIO8_ADCBCLK_IN 0x2
127#define WM8350_GPIO8_ADCBCLK_OUT 0x2
128#define WM8350_GPIO8_PWR_OFF_IN 0x3
129#define WM8350_GPIO8_BATT_FAULT_OUT 0x3
130#define WM8350_GPIO8_ALTSCL_IN 0xf
131
132#define WM8350_GPIO9_GPIO_IN 0x0
133#define WM8350_GPIO9_GPIO_OUT 0x0
134#define WM8350_GPIO9_HEARTBEAT_IN 0x1
135#define WM8350_GPIO9_VCC_FAULT_OUT 0x1
136#define WM8350_GPIO9_MASK_IN 0x2
137#define WM8350_GPIO9_LINE_GT_BATT_OUT 0x2
138#define WM8350_GPIO9_PWR_OFF_IN 0x3
139#define WM8350_GPIO9_BATT_FAULT_OUT 0x3
140#define WM8350_GPIO9_ALTSDA_OUT 0xf
141
142#define WM8350_GPIO10_GPIO_IN 0x0
143#define WM8350_GPIO10_GPIO_OUT 0x0
144#define WM8350_GPIO10_ISINKC_OUT 0x1
145#define WM8350_GPIO10_PWR_OFF_IN 0x2
146#define WM8350_GPIO10_LINE_GT_BATT_OUT 0x2
147#define WM8350_GPIO10_CHD_IND_IN 0x3
148
149#define WM8350_GPIO11_GPIO_IN 0x0
150#define WM8350_GPIO11_GPIO_OUT 0x0
151#define WM8350_GPIO11_ISINKD_OUT 0x1
152#define WM8350_GPIO11_WAKEUP_IN 0x2
153#define WM8350_GPIO11_LINE_GT_BATT_OUT 0x2
154#define WM8350_GPIO11_CHD_IND_IN 0x3
155
156#define WM8350_GPIO12_GPIO_IN 0x0
157#define WM8350_GPIO12_GPIO_OUT 0x0
158#define WM8350_GPIO12_ISINKE_OUT 0x1
159#define WM8350_GPIO12_LINE_GT_BATT_OUT 0x2
160#define WM8350_GPIO12_LINE_EN_OUT 0x3
161#define WM8350_GPIO12_32KHZ_OUT 0x4
162
163#define WM8350_GPIO_DIR_IN 0
164#define WM8350_GPIO_DIR_OUT 1
165#define WM8350_GPIO_ACTIVE_LOW 0
166#define WM8350_GPIO_ACTIVE_HIGH 1
167#define WM8350_GPIO_PULL_NONE 0
168#define WM8350_GPIO_PULL_UP 1
169#define WM8350_GPIO_PULL_DOWN 2
170#define WM8350_GPIO_INVERT_OFF 0
171#define WM8350_GPIO_INVERT_ON 1
172#define WM8350_GPIO_DEBOUNCE_OFF 0
173#define WM8350_GPIO_DEBOUNCE_ON 1
174
175/*
176 * R128 (0x80) - GPIO Debounce
177 */
178#define WM8350_GP12_DB 0x1000
179#define WM8350_GP11_DB 0x0800
180#define WM8350_GP10_DB 0x0400
181#define WM8350_GP9_DB 0x0200
182#define WM8350_GP8_DB 0x0100
183#define WM8350_GP7_DB 0x0080
184#define WM8350_GP6_DB 0x0040
185#define WM8350_GP5_DB 0x0020
186#define WM8350_GP4_DB 0x0010
187#define WM8350_GP3_DB 0x0008
188#define WM8350_GP2_DB 0x0004
189#define WM8350_GP1_DB 0x0002
190#define WM8350_GP0_DB 0x0001
191
192/*
193 * R129 (0x81) - GPIO Pin pull up Control
194 */
195#define WM8350_GP12_PU 0x1000
196#define WM8350_GP11_PU 0x0800
197#define WM8350_GP10_PU 0x0400
198#define WM8350_GP9_PU 0x0200
199#define WM8350_GP8_PU 0x0100
200#define WM8350_GP7_PU 0x0080
201#define WM8350_GP6_PU 0x0040
202#define WM8350_GP5_PU 0x0020
203#define WM8350_GP4_PU 0x0010
204#define WM8350_GP3_PU 0x0008
205#define WM8350_GP2_PU 0x0004
206#define WM8350_GP1_PU 0x0002
207#define WM8350_GP0_PU 0x0001
208
209/*
210 * R130 (0x82) - GPIO Pull down Control
211 */
212#define WM8350_GP12_PD 0x1000
213#define WM8350_GP11_PD 0x0800
214#define WM8350_GP10_PD 0x0400
215#define WM8350_GP9_PD 0x0200
216#define WM8350_GP8_PD 0x0100
217#define WM8350_GP7_PD 0x0080
218#define WM8350_GP6_PD 0x0040
219#define WM8350_GP5_PD 0x0020
220#define WM8350_GP4_PD 0x0010
221#define WM8350_GP3_PD 0x0008
222#define WM8350_GP2_PD 0x0004
223#define WM8350_GP1_PD 0x0002
224#define WM8350_GP0_PD 0x0001
225
226/*
227 * R131 (0x83) - GPIO Interrupt Mode
228 */
229#define WM8350_GP12_INTMODE 0x1000
230#define WM8350_GP11_INTMODE 0x0800
231#define WM8350_GP10_INTMODE 0x0400
232#define WM8350_GP9_INTMODE 0x0200
233#define WM8350_GP8_INTMODE 0x0100
234#define WM8350_GP7_INTMODE 0x0080
235#define WM8350_GP6_INTMODE 0x0040
236#define WM8350_GP5_INTMODE 0x0020
237#define WM8350_GP4_INTMODE 0x0010
238#define WM8350_GP3_INTMODE 0x0008
239#define WM8350_GP2_INTMODE 0x0004
240#define WM8350_GP1_INTMODE 0x0002
241#define WM8350_GP0_INTMODE 0x0001
242
243/*
244 * R133 (0x85) - GPIO Control
245 */
246#define WM8350_GP_DBTIME_MASK 0x00C0
247
248/*
249 * R134 (0x86) - GPIO Configuration (i/o)
250 */
251#define WM8350_GP12_DIR 0x1000
252#define WM8350_GP11_DIR 0x0800
253#define WM8350_GP10_DIR 0x0400
254#define WM8350_GP9_DIR 0x0200
255#define WM8350_GP8_DIR 0x0100
256#define WM8350_GP7_DIR 0x0080
257#define WM8350_GP6_DIR 0x0040
258#define WM8350_GP5_DIR 0x0020
259#define WM8350_GP4_DIR 0x0010
260#define WM8350_GP3_DIR 0x0008
261#define WM8350_GP2_DIR 0x0004
262#define WM8350_GP1_DIR 0x0002
263#define WM8350_GP0_DIR 0x0001
264
265/*
266 * R135 (0x87) - GPIO Pin Polarity / Type
267 */
268#define WM8350_GP12_CFG 0x1000
269#define WM8350_GP11_CFG 0x0800
270#define WM8350_GP10_CFG 0x0400
271#define WM8350_GP9_CFG 0x0200
272#define WM8350_GP8_CFG 0x0100
273#define WM8350_GP7_CFG 0x0080
274#define WM8350_GP6_CFG 0x0040
275#define WM8350_GP5_CFG 0x0020
276#define WM8350_GP4_CFG 0x0010
277#define WM8350_GP3_CFG 0x0008
278#define WM8350_GP2_CFG 0x0004
279#define WM8350_GP1_CFG 0x0002
280#define WM8350_GP0_CFG 0x0001
281
282/*
283 * R140 (0x8C) - GPIO Function Select 1
284 */
285#define WM8350_GP3_FN_MASK 0xF000
286#define WM8350_GP2_FN_MASK 0x0F00
287#define WM8350_GP1_FN_MASK 0x00F0
288#define WM8350_GP0_FN_MASK 0x000F
289
290/*
291 * R141 (0x8D) - GPIO Function Select 2
292 */
293#define WM8350_GP7_FN_MASK 0xF000
294#define WM8350_GP6_FN_MASK 0x0F00
295#define WM8350_GP5_FN_MASK 0x00F0
296#define WM8350_GP4_FN_MASK 0x000F
297
298/*
299 * R142 (0x8E) - GPIO Function Select 3
300 */
301#define WM8350_GP11_FN_MASK 0xF000
302#define WM8350_GP10_FN_MASK 0x0F00
303#define WM8350_GP9_FN_MASK 0x00F0
304#define WM8350_GP8_FN_MASK 0x000F
305
306/*
307 * R143 (0x8F) - GPIO Function Select 4
308 */
309#define WM8350_GP12_FN_MASK 0x000F
310
311/*
312 * R230 (0xE6) - GPIO Pin Status
313 */
314#define WM8350_GP12_LVL 0x1000
315#define WM8350_GP11_LVL 0x0800
316#define WM8350_GP10_LVL 0x0400
317#define WM8350_GP9_LVL 0x0200
318#define WM8350_GP8_LVL 0x0100
319#define WM8350_GP7_LVL 0x0080
320#define WM8350_GP6_LVL 0x0040
321#define WM8350_GP5_LVL 0x0020
322#define WM8350_GP4_LVL 0x0010
323#define WM8350_GP3_LVL 0x0008
324#define WM8350_GP2_LVL 0x0004
325#define WM8350_GP1_LVL 0x0002
326#define WM8350_GP0_LVL 0x0001
327
328struct wm8350;
329
330int wm8350_gpio_config(struct wm8350 *wm8350, int gpio, int dir, int func,
331 int pol, int pull, int invert, int debounce);
332
333struct wm8350_gpio {
334 struct platform_device *pdev;
335};
336
337/*
338 * GPIO Interrupts
339 */
340#define WM8350_IRQ_GPIO(x) (50 + x)
341
342#endif
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h
new file mode 100644
index 000000000000..69b69e07f62f
--- /dev/null
+++ b/include/linux/mfd/wm8350/pmic.h
@@ -0,0 +1,741 @@
1/*
2 * pmic.h -- Power Managment Driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __LINUX_MFD_WM8350_PMIC_H
14#define __LINUX_MFD_WM8350_PMIC_H
15
16/*
17 * Register values.
18 */
19
20#define WM8350_CURRENT_SINK_DRIVER_A 0xAC
21#define WM8350_CSA_FLASH_CONTROL 0xAD
22#define WM8350_CURRENT_SINK_DRIVER_B 0xAE
23#define WM8350_CSB_FLASH_CONTROL 0xAF
24#define WM8350_DCDC_LDO_REQUESTED 0xB0
25#define WM8350_DCDC_ACTIVE_OPTIONS 0xB1
26#define WM8350_DCDC_SLEEP_OPTIONS 0xB2
27#define WM8350_POWER_CHECK_COMPARATOR 0xB3
28#define WM8350_DCDC1_CONTROL 0xB4
29#define WM8350_DCDC1_TIMEOUTS 0xB5
30#define WM8350_DCDC1_LOW_POWER 0xB6
31#define WM8350_DCDC2_CONTROL 0xB7
32#define WM8350_DCDC2_TIMEOUTS 0xB8
33#define WM8350_DCDC3_CONTROL 0xBA
34#define WM8350_DCDC3_TIMEOUTS 0xBB
35#define WM8350_DCDC3_LOW_POWER 0xBC
36#define WM8350_DCDC4_CONTROL 0xBD
37#define WM8350_DCDC4_TIMEOUTS 0xBE
38#define WM8350_DCDC4_LOW_POWER 0xBF
39#define WM8350_DCDC5_CONTROL 0xC0
40#define WM8350_DCDC5_TIMEOUTS 0xC1
41#define WM8350_DCDC6_CONTROL 0xC3
42#define WM8350_DCDC6_TIMEOUTS 0xC4
43#define WM8350_DCDC6_LOW_POWER 0xC5
44#define WM8350_LIMIT_SWITCH_CONTROL 0xC7
45#define WM8350_LDO1_CONTROL 0xC8
46#define WM8350_LDO1_TIMEOUTS 0xC9
47#define WM8350_LDO1_LOW_POWER 0xCA
48#define WM8350_LDO2_CONTROL 0xCB
49#define WM8350_LDO2_TIMEOUTS 0xCC
50#define WM8350_LDO2_LOW_POWER 0xCD
51#define WM8350_LDO3_CONTROL 0xCE
52#define WM8350_LDO3_TIMEOUTS 0xCF
53#define WM8350_LDO3_LOW_POWER 0xD0
54#define WM8350_LDO4_CONTROL 0xD1
55#define WM8350_LDO4_TIMEOUTS 0xD2
56#define WM8350_LDO4_LOW_POWER 0xD3
57#define WM8350_VCC_FAULT_MASKS 0xD7
58#define WM8350_MAIN_BANDGAP_CONTROL 0xD8
59#define WM8350_OSC_CONTROL 0xD9
60#define WM8350_RTC_TICK_CONTROL 0xDA
61#define WM8350_SECURITY 0xDB
62#define WM8350_RAM_BIST_1 0xDC
63#define WM8350_DCDC_LDO_STATUS 0xE1
64#define WM8350_GPIO_PIN_STATUS 0xE6
65
66#define WM8350_DCDC1_FORCE_PWM 0xF8
67#define WM8350_DCDC3_FORCE_PWM 0xFA
68#define WM8350_DCDC4_FORCE_PWM 0xFB
69#define WM8350_DCDC6_FORCE_PWM 0xFD
70
71/*
72 * R172 (0xAC) - Current Sink Driver A
73 */
74#define WM8350_CS1_HIB_MODE 0x1000
75#define WM8350_CS1_HIB_MODE_MASK 0x1000
76#define WM8350_CS1_HIB_MODE_SHIFT 12
77#define WM8350_CS1_ISEL_MASK 0x003F
78#define WM8350_CS1_ISEL_SHIFT 0
79
80/* Bit values for R172 (0xAC) */
81#define WM8350_CS1_HIB_MODE_DISABLE 0
82#define WM8350_CS1_HIB_MODE_LEAVE 1
83
84#define WM8350_CS1_ISEL_220M 0x3F
85
86/*
87 * R173 (0xAD) - CSA Flash control
88 */
89#define WM8350_CS1_FLASH_MODE 0x8000
90#define WM8350_CS1_TRIGSRC 0x4000
91#define WM8350_CS1_DRIVE 0x2000
92#define WM8350_CS1_FLASH_DUR_MASK 0x0300
93#define WM8350_CS1_OFF_RAMP_MASK 0x0030
94#define WM8350_CS1_ON_RAMP_MASK 0x0003
95
96/*
97 * R174 (0xAE) - Current Sink Driver B
98 */
99#define WM8350_CS2_HIB_MODE 0x1000
100#define WM8350_CS2_ISEL_MASK 0x003F
101
102/*
103 * R175 (0xAF) - CSB Flash control
104 */
105#define WM8350_CS2_FLASH_MODE 0x8000
106#define WM8350_CS2_TRIGSRC 0x4000
107#define WM8350_CS2_DRIVE 0x2000
108#define WM8350_CS2_FLASH_DUR_MASK 0x0300
109#define WM8350_CS2_OFF_RAMP_MASK 0x0030
110#define WM8350_CS2_ON_RAMP_MASK 0x0003
111
112/*
113 * R176 (0xB0) - DCDC/LDO requested
114 */
115#define WM8350_LS_ENA 0x8000
116#define WM8350_LDO4_ENA 0x0800
117#define WM8350_LDO3_ENA 0x0400
118#define WM8350_LDO2_ENA 0x0200
119#define WM8350_LDO1_ENA 0x0100
120#define WM8350_DC6_ENA 0x0020
121#define WM8350_DC5_ENA 0x0010
122#define WM8350_DC4_ENA 0x0008
123#define WM8350_DC3_ENA 0x0004
124#define WM8350_DC2_ENA 0x0002
125#define WM8350_DC1_ENA 0x0001
126
127/*
128 * R177 (0xB1) - DCDC Active options
129 */
130#define WM8350_PUTO_MASK 0x3000
131#define WM8350_PWRUP_DELAY_MASK 0x0300
132#define WM8350_DC6_ACTIVE 0x0020
133#define WM8350_DC4_ACTIVE 0x0008
134#define WM8350_DC3_ACTIVE 0x0004
135#define WM8350_DC1_ACTIVE 0x0001
136
137/*
138 * R178 (0xB2) - DCDC Sleep options
139 */
140#define WM8350_DC6_SLEEP 0x0020
141#define WM8350_DC4_SLEEP 0x0008
142#define WM8350_DC3_SLEEP 0x0004
143#define WM8350_DC1_SLEEP 0x0001
144
145/*
146 * R179 (0xB3) - Power-check comparator
147 */
148#define WM8350_PCCMP_ERRACT 0x4000
149#define WM8350_PCCMP_RAIL 0x0100
150#define WM8350_PCCMP_OFF_THR_MASK 0x0070
151#define WM8350_PCCMP_ON_THR_MASK 0x0007
152
153/*
154 * R180 (0xB4) - DCDC1 Control
155 */
156#define WM8350_DC1_OPFLT 0x0400
157#define WM8350_DC1_VSEL_MASK 0x007F
158#define WM8350_DC1_VSEL_SHIFT 0
159
160/*
161 * R181 (0xB5) - DCDC1 Timeouts
162 */
163#define WM8350_DC1_ERRACT_MASK 0xC000
164#define WM8350_DC1_ERRACT_SHIFT 14
165#define WM8350_DC1_ENSLOT_MASK 0x3C00
166#define WM8350_DC1_ENSLOT_SHIFT 10
167#define WM8350_DC1_SDSLOT_MASK 0x03C0
168#define WM8350_DC1_UVTO_MASK 0x0030
169#define WM8350_DC1_SDSLOT_SHIFT 6
170
171/* Bit values for R181 (0xB5) */
172#define WM8350_DC1_ERRACT_NONE 0
173#define WM8350_DC1_ERRACT_SHUTDOWN_CONV 1
174#define WM8350_DC1_ERRACT_SHUTDOWN_SYS 2
175
176/*
177 * R182 (0xB6) - DCDC1 Low Power
178 */
179#define WM8350_DC1_HIB_MODE_MASK 0x7000
180#define WM8350_DC1_HIB_TRIG_MASK 0x0300
181#define WM8350_DC1_VIMG_MASK 0x007F
182
183/*
184 * R183 (0xB7) - DCDC2 Control
185 */
186#define WM8350_DC2_MODE 0x4000
187#define WM8350_DC2_MODE_MASK 0x4000
188#define WM8350_DC2_MODE_SHIFT 14
189#define WM8350_DC2_HIB_MODE 0x1000
190#define WM8350_DC2_HIB_MODE_MASK 0x1000
191#define WM8350_DC2_HIB_MODE_SHIFT 12
192#define WM8350_DC2_HIB_TRIG_MASK 0x0300
193#define WM8350_DC2_HIB_TRIG_SHIFT 8
194#define WM8350_DC2_ILIM 0x0040
195#define WM8350_DC2_ILIM_MASK 0x0040
196#define WM8350_DC2_ILIM_SHIFT 6
197#define WM8350_DC2_RMP_MASK 0x0018
198#define WM8350_DC2_RMP_SHIFT 3
199#define WM8350_DC2_FBSRC_MASK 0x0003
200#define WM8350_DC2_FBSRC_SHIFT 0
201
202/* Bit values for R183 (0xB7) */
203#define WM8350_DC2_MODE_BOOST 0
204#define WM8350_DC2_MODE_SWITCH 1
205
206#define WM8350_DC2_HIB_MODE_ACTIVE 1
207#define WM8350_DC2_HIB_MODE_DISABLE 0
208
209#define WM8350_DC2_HIB_TRIG_NONE 0
210#define WM8350_DC2_HIB_TRIG_LPWR1 1
211#define WM8350_DC2_HIB_TRIG_LPWR2 2
212#define WM8350_DC2_HIB_TRIG_LPWR3 3
213
214#define WM8350_DC2_ILIM_HIGH 0
215#define WM8350_DC2_ILIM_LOW 1
216
217#define WM8350_DC2_RMP_30V 0
218#define WM8350_DC2_RMP_20V 1
219#define WM8350_DC2_RMP_10V 2
220#define WM8350_DC2_RMP_5V 3
221
222#define WM8350_DC2_FBSRC_FB2 0
223#define WM8350_DC2_FBSRC_ISINKA 1
224#define WM8350_DC2_FBSRC_ISINKB 2
225#define WM8350_DC2_FBSRC_USB 3
226
227/*
228 * R184 (0xB8) - DCDC2 Timeouts
229 */
230#define WM8350_DC2_ERRACT_MASK 0xC000
231#define WM8350_DC2_ERRACT_SHIFT 14
232#define WM8350_DC2_ENSLOT_MASK 0x3C00
233#define WM8350_DC2_ENSLOT_SHIFT 10
234#define WM8350_DC2_SDSLOT_MASK 0x03C0
235#define WM8350_DC2_UVTO_MASK 0x0030
236
237/* Bit values for R184 (0xB8) */
238#define WM8350_DC2_ERRACT_NONE 0
239#define WM8350_DC2_ERRACT_SHUTDOWN_CONV 1
240#define WM8350_DC2_ERRACT_SHUTDOWN_SYS 2
241
242/*
243 * R186 (0xBA) - DCDC3 Control
244 */
245#define WM8350_DC3_OPFLT 0x0400
246#define WM8350_DC3_VSEL_MASK 0x007F
247#define WM8350_DC3_VSEL_SHIFT 0
248
249/*
250 * R187 (0xBB) - DCDC3 Timeouts
251 */
252#define WM8350_DC3_ERRACT_MASK 0xC000
253#define WM8350_DC3_ERRACT_SHIFT 14
254#define WM8350_DC3_ENSLOT_MASK 0x3C00
255#define WM8350_DC3_ENSLOT_SHIFT 10
256#define WM8350_DC3_SDSLOT_MASK 0x03C0
257#define WM8350_DC3_UVTO_MASK 0x0030
258#define WM8350_DC3_SDSLOT_SHIFT 6
259
260/* Bit values for R187 (0xBB) */
261#define WM8350_DC3_ERRACT_NONE 0
262#define WM8350_DC3_ERRACT_SHUTDOWN_CONV 1
263#define WM8350_DC3_ERRACT_SHUTDOWN_SYS 2
264/*
265 * R188 (0xBC) - DCDC3 Low Power
266 */
267#define WM8350_DC3_HIB_MODE_MASK 0x7000
268#define WM8350_DC3_HIB_TRIG_MASK 0x0300
269#define WM8350_DC3_VIMG_MASK 0x007F
270
271/*
272 * R189 (0xBD) - DCDC4 Control
273 */
274#define WM8350_DC4_OPFLT 0x0400
275#define WM8350_DC4_VSEL_MASK 0x007F
276#define WM8350_DC4_VSEL_SHIFT 0
277
278/*
279 * R190 (0xBE) - DCDC4 Timeouts
280 */
281#define WM8350_DC4_ERRACT_MASK 0xC000
282#define WM8350_DC4_ERRACT_SHIFT 14
283#define WM8350_DC4_ENSLOT_MASK 0x3C00
284#define WM8350_DC4_ENSLOT_SHIFT 10
285#define WM8350_DC4_SDSLOT_MASK 0x03C0
286#define WM8350_DC4_UVTO_MASK 0x0030
287#define WM8350_DC4_SDSLOT_SHIFT 6
288
289/* Bit values for R190 (0xBE) */
290#define WM8350_DC4_ERRACT_NONE 0
291#define WM8350_DC4_ERRACT_SHUTDOWN_CONV 1
292#define WM8350_DC4_ERRACT_SHUTDOWN_SYS 2
293
294/*
295 * R191 (0xBF) - DCDC4 Low Power
296 */
297#define WM8350_DC4_HIB_MODE_MASK 0x7000
298#define WM8350_DC4_HIB_TRIG_MASK 0x0300
299#define WM8350_DC4_VIMG_MASK 0x007F
300
301/*
302 * R192 (0xC0) - DCDC5 Control
303 */
304#define WM8350_DC5_MODE 0x4000
305#define WM8350_DC5_MODE_MASK 0x4000
306#define WM8350_DC5_MODE_SHIFT 14
307#define WM8350_DC5_HIB_MODE 0x1000
308#define WM8350_DC5_HIB_MODE_MASK 0x1000
309#define WM8350_DC5_HIB_MODE_SHIFT 12
310#define WM8350_DC5_HIB_TRIG_MASK 0x0300
311#define WM8350_DC5_HIB_TRIG_SHIFT 8
312#define WM8350_DC5_ILIM 0x0040
313#define WM8350_DC5_ILIM_MASK 0x0040
314#define WM8350_DC5_ILIM_SHIFT 6
315#define WM8350_DC5_RMP_MASK 0x0018
316#define WM8350_DC5_RMP_SHIFT 3
317#define WM8350_DC5_FBSRC_MASK 0x0003
318#define WM8350_DC5_FBSRC_SHIFT 0
319
320/* Bit values for R192 (0xC0) */
321#define WM8350_DC5_MODE_BOOST 0
322#define WM8350_DC5_MODE_SWITCH 1
323
324#define WM8350_DC5_HIB_MODE_ACTIVE 1
325#define WM8350_DC5_HIB_MODE_DISABLE 0
326
327#define WM8350_DC5_HIB_TRIG_NONE 0
328#define WM8350_DC5_HIB_TRIG_LPWR1 1
329#define WM8350_DC5_HIB_TRIG_LPWR2 2
330#define WM8350_DC5_HIB_TRIG_LPWR3 3
331
332#define WM8350_DC5_ILIM_HIGH 0
333#define WM8350_DC5_ILIM_LOW 1
334
335#define WM8350_DC5_RMP_30V 0
336#define WM8350_DC5_RMP_20V 1
337#define WM8350_DC5_RMP_10V 2
338#define WM8350_DC5_RMP_5V 3
339
340#define WM8350_DC5_FBSRC_FB2 0
341#define WM8350_DC5_FBSRC_ISINKA 1
342#define WM8350_DC5_FBSRC_ISINKB 2
343#define WM8350_DC5_FBSRC_USB 3
344
345/*
346 * R193 (0xC1) - DCDC5 Timeouts
347 */
348#define WM8350_DC5_ERRACT_MASK 0xC000
349#define WM8350_DC5_ERRACT_SHIFT 14
350#define WM8350_DC5_ENSLOT_MASK 0x3C00
351#define WM8350_DC5_ENSLOT_SHIFT 10
352#define WM8350_DC5_SDSLOT_MASK 0x03C0
353#define WM8350_DC5_UVTO_MASK 0x0030
354#define WM8350_DC5_SDSLOT_SHIFT 6
355
356/* Bit values for R193 (0xC1) */
357#define WM8350_DC5_ERRACT_NONE 0
358#define WM8350_DC5_ERRACT_SHUTDOWN_CONV 1
359#define WM8350_DC5_ERRACT_SHUTDOWN_SYS 2
360
361/*
362 * R195 (0xC3) - DCDC6 Control
363 */
364#define WM8350_DC6_OPFLT 0x0400
365#define WM8350_DC6_VSEL_MASK 0x007F
366#define WM8350_DC6_VSEL_SHIFT 0
367
368/*
369 * R196 (0xC4) - DCDC6 Timeouts
370 */
371#define WM8350_DC6_ERRACT_MASK 0xC000
372#define WM8350_DC6_ERRACT_SHIFT 14
373#define WM8350_DC6_ENSLOT_MASK 0x3C00
374#define WM8350_DC6_ENSLOT_SHIFT 10
375#define WM8350_DC6_SDSLOT_MASK 0x03C0
376#define WM8350_DC6_UVTO_MASK 0x0030
377#define WM8350_DC6_SDSLOT_SHIFT 6
378
379/* Bit values for R196 (0xC4) */
380#define WM8350_DC6_ERRACT_NONE 0
381#define WM8350_DC6_ERRACT_SHUTDOWN_CONV 1
382#define WM8350_DC6_ERRACT_SHUTDOWN_SYS 2
383
384/*
385 * R197 (0xC5) - DCDC6 Low Power
386 */
387#define WM8350_DC6_HIB_MODE_MASK 0x7000
388#define WM8350_DC6_HIB_TRIG_MASK 0x0300
389#define WM8350_DC6_VIMG_MASK 0x007F
390
391/*
392 * R199 (0xC7) - Limit Switch Control
393 */
394#define WM8350_LS_ERRACT_MASK 0xC000
395#define WM8350_LS_ERRACT_SHIFT 14
396#define WM8350_LS_ENSLOT_MASK 0x3C00
397#define WM8350_LS_ENSLOT_SHIFT 10
398#define WM8350_LS_SDSLOT_MASK 0x03C0
399#define WM8350_LS_SDSLOT_SHIFT 6
400#define WM8350_LS_HIB_MODE 0x0010
401#define WM8350_LS_HIB_MODE_MASK 0x0010
402#define WM8350_LS_HIB_MODE_SHIFT 4
403#define WM8350_LS_HIB_PROT 0x0002
404#define WM8350_LS_HIB_PROT_MASK 0x0002
405#define WM8350_LS_HIB_PROT_SHIFT 1
406#define WM8350_LS_PROT 0x0001
407#define WM8350_LS_PROT_MASK 0x0001
408#define WM8350_LS_PROT_SHIFT 0
409
410/* Bit values for R199 (0xC7) */
411#define WM8350_LS_ERRACT_NONE 0
412#define WM8350_LS_ERRACT_SHUTDOWN_CONV 1
413#define WM8350_LS_ERRACT_SHUTDOWN_SYS 2
414
415/*
416 * R200 (0xC8) - LDO1 Control
417 */
418#define WM8350_LDO1_SWI 0x4000
419#define WM8350_LDO1_OPFLT 0x0400
420#define WM8350_LDO1_VSEL_MASK 0x001F
421#define WM8350_LDO1_VSEL_SHIFT 0
422
423/*
424 * R201 (0xC9) - LDO1 Timeouts
425 */
426#define WM8350_LDO1_ERRACT_MASK 0xC000
427#define WM8350_LDO1_ERRACT_SHIFT 14
428#define WM8350_LDO1_ENSLOT_MASK 0x3C00
429#define WM8350_LDO1_ENSLOT_SHIFT 10
430#define WM8350_LDO1_SDSLOT_MASK 0x03C0
431#define WM8350_LDO1_UVTO_MASK 0x0030
432#define WM8350_LDO1_SDSLOT_SHIFT 6
433
434/* Bit values for R201 (0xC9) */
435#define WM8350_LDO1_ERRACT_NONE 0
436#define WM8350_LDO1_ERRACT_SHUTDOWN_CONV 1
437#define WM8350_LDO1_ERRACT_SHUTDOWN_SYS 2
438
439/*
440 * R202 (0xCA) - LDO1 Low Power
441 */
442#define WM8350_LDO1_HIB_MODE_MASK 0x3000
443#define WM8350_LDO1_HIB_TRIG_MASK 0x0300
444#define WM8350_LDO1_VIMG_MASK 0x001F
445#define WM8350_LDO1_HIB_MODE_DIS (0x1 << 12)
446
447
448/*
449 * R203 (0xCB) - LDO2 Control
450 */
451#define WM8350_LDO2_SWI 0x4000
452#define WM8350_LDO2_OPFLT 0x0400
453#define WM8350_LDO2_VSEL_MASK 0x001F
454#define WM8350_LDO2_VSEL_SHIFT 0
455
456/*
457 * R204 (0xCC) - LDO2 Timeouts
458 */
459#define WM8350_LDO2_ERRACT_MASK 0xC000
460#define WM8350_LDO2_ERRACT_SHIFT 14
461#define WM8350_LDO2_ENSLOT_MASK 0x3C00
462#define WM8350_LDO2_ENSLOT_SHIFT 10
463#define WM8350_LDO2_SDSLOT_MASK 0x03C0
464#define WM8350_LDO2_SDSLOT_SHIFT 6
465
466/* Bit values for R204 (0xCC) */
467#define WM8350_LDO2_ERRACT_NONE 0
468#define WM8350_LDO2_ERRACT_SHUTDOWN_CONV 1
469#define WM8350_LDO2_ERRACT_SHUTDOWN_SYS 2
470
471/*
472 * R205 (0xCD) - LDO2 Low Power
473 */
474#define WM8350_LDO2_HIB_MODE_MASK 0x3000
475#define WM8350_LDO2_HIB_TRIG_MASK 0x0300
476#define WM8350_LDO2_VIMG_MASK 0x001F
477
478/*
479 * R206 (0xCE) - LDO3 Control
480 */
481#define WM8350_LDO3_SWI 0x4000
482#define WM8350_LDO3_OPFLT 0x0400
483#define WM8350_LDO3_VSEL_MASK 0x001F
484#define WM8350_LDO3_VSEL_SHIFT 0
485
486/*
487 * R207 (0xCF) - LDO3 Timeouts
488 */
489#define WM8350_LDO3_ERRACT_MASK 0xC000
490#define WM8350_LDO3_ERRACT_SHIFT 14
491#define WM8350_LDO3_ENSLOT_MASK 0x3C00
492#define WM8350_LDO3_ENSLOT_SHIFT 10
493#define WM8350_LDO3_SDSLOT_MASK 0x03C0
494#define WM8350_LDO3_UVTO_MASK 0x0030
495#define WM8350_LDO3_SDSLOT_SHIFT 6
496
497/* Bit values for R207 (0xCF) */
498#define WM8350_LDO3_ERRACT_NONE 0
499#define WM8350_LDO3_ERRACT_SHUTDOWN_CONV 1
500#define WM8350_LDO3_ERRACT_SHUTDOWN_SYS 2
501
502/*
503 * R208 (0xD0) - LDO3 Low Power
504 */
505#define WM8350_LDO3_HIB_MODE_MASK 0x3000
506#define WM8350_LDO3_HIB_TRIG_MASK 0x0300
507#define WM8350_LDO3_VIMG_MASK 0x001F
508
509/*
510 * R209 (0xD1) - LDO4 Control
511 */
512#define WM8350_LDO4_SWI 0x4000
513#define WM8350_LDO4_OPFLT 0x0400
514#define WM8350_LDO4_VSEL_MASK 0x001F
515#define WM8350_LDO4_VSEL_SHIFT 0
516
517/*
518 * R210 (0xD2) - LDO4 Timeouts
519 */
520#define WM8350_LDO4_ERRACT_MASK 0xC000
521#define WM8350_LDO4_ERRACT_SHIFT 14
522#define WM8350_LDO4_ENSLOT_MASK 0x3C00
523#define WM8350_LDO4_ENSLOT_SHIFT 10
524#define WM8350_LDO4_SDSLOT_MASK 0x03C0
525#define WM8350_LDO4_UVTO_MASK 0x0030
526#define WM8350_LDO4_SDSLOT_SHIFT 6
527
528/* Bit values for R210 (0xD2) */
529#define WM8350_LDO4_ERRACT_NONE 0
530#define WM8350_LDO4_ERRACT_SHUTDOWN_CONV 1
531#define WM8350_LDO4_ERRACT_SHUTDOWN_SYS 2
532
533/*
534 * R211 (0xD3) - LDO4 Low Power
535 */
536#define WM8350_LDO4_HIB_MODE_MASK 0x3000
537#define WM8350_LDO4_HIB_TRIG_MASK 0x0300
538#define WM8350_LDO4_VIMG_MASK 0x001F
539
540/*
541 * R215 (0xD7) - VCC_FAULT Masks
542 */
543#define WM8350_LS_FAULT 0x8000
544#define WM8350_LDO4_FAULT 0x0800
545#define WM8350_LDO3_FAULT 0x0400
546#define WM8350_LDO2_FAULT 0x0200
547#define WM8350_LDO1_FAULT 0x0100
548#define WM8350_DC6_FAULT 0x0020
549#define WM8350_DC5_FAULT 0x0010
550#define WM8350_DC4_FAULT 0x0008
551#define WM8350_DC3_FAULT 0x0004
552#define WM8350_DC2_FAULT 0x0002
553#define WM8350_DC1_FAULT 0x0001
554
555/*
556 * R216 (0xD8) - Main Bandgap Control
557 */
558#define WM8350_MBG_LOAD_FUSES 0x8000
559#define WM8350_MBG_FUSE_WPREP 0x4000
560#define WM8350_MBG_FUSE_WRITE 0x2000
561#define WM8350_MBG_FUSE_TRIM_MASK 0x1F00
562#define WM8350_MBG_TRIM_SRC 0x0020
563#define WM8350_MBG_USER_TRIM_MASK 0x001F
564
565/*
566 * R217 (0xD9) - OSC Control
567 */
568#define WM8350_OSC_LOAD_FUSES 0x8000
569#define WM8350_OSC_FUSE_WPREP 0x4000
570#define WM8350_OSC_FUSE_WRITE 0x2000
571#define WM8350_OSC_FUSE_TRIM_MASK 0x0F00
572#define WM8350_OSC_TRIM_SRC 0x0020
573#define WM8350_OSC_USER_TRIM_MASK 0x000F
574
575/*
576 * R248 (0xF8) - DCDC1 Force PWM
577 */
578#define WM8350_DCDC1_FORCE_PWM_ENA 0x0010
579
580/*
581 * R250 (0xFA) - DCDC3 Force PWM
582 */
583#define WM8350_DCDC3_FORCE_PWM_ENA 0x0010
584
585/*
586 * R251 (0xFB) - DCDC4 Force PWM
587 */
588#define WM8350_DCDC4_FORCE_PWM_ENA 0x0010
589
590/*
591 * R253 (0xFD) - DCDC1 Force PWM
592 */
593#define WM8350_DCDC6_FORCE_PWM_ENA 0x0010
594
595/*
596 * DCDC's
597 */
598#define WM8350_DCDC_1 0
599#define WM8350_DCDC_2 1
600#define WM8350_DCDC_3 2
601#define WM8350_DCDC_4 3
602#define WM8350_DCDC_5 4
603#define WM8350_DCDC_6 5
604
605/* DCDC modes */
606#define WM8350_DCDC_ACTIVE_STANDBY 0
607#define WM8350_DCDC_ACTIVE_PULSE 1
608#define WM8350_DCDC_SLEEP_NORMAL 0
609#define WM8350_DCDC_SLEEP_LOW 1
610
611/* DCDC Low power (Hibernate) mode */
612#define WM8350_DCDC_HIB_MODE_CUR (0 << 12)
613#define WM8350_DCDC_HIB_MODE_IMAGE (1 << 12)
614#define WM8350_DCDC_HIB_MODE_STANDBY (2 << 12)
615#define WM8350_DCDC_HIB_MODE_LDO (4 << 12)
616#define WM8350_DCDC_HIB_MODE_LDO_IM (5 << 12)
617#define WM8350_DCDC_HIB_MODE_DIS (7 << 12)
618#define WM8350_DCDC_HIB_MODE_MASK (7 << 12)
619
620/* DCDC Low Power (Hibernate) signal */
621#define WM8350_DCDC_HIB_SIG_REG (0 << 8)
622#define WM8350_DCDC_HIB_SIG_LPWR1 (1 << 8)
623#define WM8350_DCDC_HIB_SIG_LPWR2 (2 << 8)
624#define WM8350_DCDC_HIB_SIG_LPWR3 (3 << 8)
625
626/* LDO Low power (Hibernate) mode */
627#define WM8350_LDO_HIB_MODE_IMAGE (0 << 0)
628#define WM8350_LDO_HIB_MODE_DIS (1 << 0)
629
630/* LDO Low Power (Hibernate) signal */
631#define WM8350_LDO_HIB_SIG_REG (0 << 8)
632#define WM8350_LDO_HIB_SIG_LPWR1 (1 << 8)
633#define WM8350_LDO_HIB_SIG_LPWR2 (2 << 8)
634#define WM8350_LDO_HIB_SIG_LPWR3 (3 << 8)
635
636/*
637 * LDOs
638 */
639#define WM8350_LDO_1 6
640#define WM8350_LDO_2 7
641#define WM8350_LDO_3 8
642#define WM8350_LDO_4 9
643
644/*
645 * ISINKs
646 */
647#define WM8350_ISINK_A 10
648#define WM8350_ISINK_B 11
649
650#define WM8350_ISINK_MODE_BOOST 0
651#define WM8350_ISINK_MODE_SWITCH 1
652#define WM8350_ISINK_ILIM_NORMAL 0
653#define WM8350_ISINK_ILIM_LOW 1
654
655#define WM8350_ISINK_FLASH_DISABLE 0
656#define WM8350_ISINK_FLASH_ENABLE 1
657#define WM8350_ISINK_FLASH_TRIG_BIT 0
658#define WM8350_ISINK_FLASH_TRIG_GPIO 1
659#define WM8350_ISINK_FLASH_MODE_EN (1 << 13)
660#define WM8350_ISINK_FLASH_MODE_DIS (0 << 13)
661#define WM8350_ISINK_FLASH_DUR_32MS (0 << 8)
662#define WM8350_ISINK_FLASH_DUR_64MS (1 << 8)
663#define WM8350_ISINK_FLASH_DUR_96MS (2 << 8)
664#define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8)
665#define WM8350_ISINK_FLASH_ON_INSTANT (0 << 4)
666#define WM8350_ISINK_FLASH_ON_0_25S (1 << 4)
667#define WM8350_ISINK_FLASH_ON_0_50S (2 << 4)
668#define WM8350_ISINK_FLASH_ON_1_00S (3 << 4)
669#define WM8350_ISINK_FLASH_ON_1_95S (1 << 4)
670#define WM8350_ISINK_FLASH_ON_3_91S (2 << 4)
671#define WM8350_ISINK_FLASH_ON_7_80S (3 << 4)
672#define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 0)
673#define WM8350_ISINK_FLASH_OFF_0_25S (1 << 0)
674#define WM8350_ISINK_FLASH_OFF_0_50S (2 << 0)
675#define WM8350_ISINK_FLASH_OFF_1_00S (3 << 0)
676#define WM8350_ISINK_FLASH_OFF_1_95S (1 << 0)
677#define WM8350_ISINK_FLASH_OFF_3_91S (2 << 0)
678#define WM8350_ISINK_FLASH_OFF_7_80S (3 << 0)
679
680/*
681 * Regulator Interrupts.
682 */
683#define WM8350_IRQ_CS1 13
684#define WM8350_IRQ_CS2 14
685#define WM8350_IRQ_UV_LDO4 25
686#define WM8350_IRQ_UV_LDO3 26
687#define WM8350_IRQ_UV_LDO2 27
688#define WM8350_IRQ_UV_LDO1 28
689#define WM8350_IRQ_UV_DC6 29
690#define WM8350_IRQ_UV_DC5 30
691#define WM8350_IRQ_UV_DC4 31
692#define WM8350_IRQ_UV_DC3 32
693#define WM8350_IRQ_UV_DC2 33
694#define WM8350_IRQ_UV_DC1 34
695#define WM8350_IRQ_OC_LS 35
696
697#define NUM_WM8350_REGULATORS 12
698
699struct wm8350;
700struct platform_device;
701struct regulator_init_data;
702
703struct wm8350_pmic {
704 /* ISINK to DCDC mapping */
705 int isink_A_dcdc;
706 int isink_B_dcdc;
707
708 /* hibernate configs */
709 u16 dcdc1_hib_mode;
710 u16 dcdc3_hib_mode;
711 u16 dcdc4_hib_mode;
712 u16 dcdc6_hib_mode;
713
714 /* regulator devices */
715 struct platform_device *pdev[NUM_WM8350_REGULATORS];
716};
717
718int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
719 struct regulator_init_data *initdata);
720
721/*
722 * Additional DCDC control not supported via regulator API
723 */
724int wm8350_dcdc_set_slot(struct wm8350 *wm8350, int dcdc, u16 start,
725 u16 stop, u16 fault);
726int wm8350_dcdc25_set_mode(struct wm8350 *wm8350, int dcdc, u16 mode,
727 u16 ilim, u16 ramp, u16 feedback);
728
729/*
730 * Additional LDO control not supported via regulator API
731 */
732int wm8350_ldo_set_slot(struct wm8350 *wm8350, int ldo, u16 start, u16 stop);
733
734/*
735 * Additional ISINK control not supported via regulator API
736 */
737int wm8350_isink_set_flash(struct wm8350 *wm8350, int isink, u16 mode,
738 u16 trigger, u16 duration, u16 on_ramp,
739 u16 off_ramp, u16 drive);
740
741#endif
diff --git a/include/linux/mfd/wm8350/rtc.h b/include/linux/mfd/wm8350/rtc.h
new file mode 100644
index 000000000000..dfda69e9f440
--- /dev/null
+++ b/include/linux/mfd/wm8350/rtc.h
@@ -0,0 +1,266 @@
1/*
2 * rtc.h -- RTC driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef __LINUX_MFD_WM8350_RTC_H
13#define __LINUX_MFD_WM8350_RTC_H
14
15#include <linux/platform_device.h>
16
17/*
18 * Register values.
19 */
20#define WM8350_RTC_SECONDS_MINUTES 0x10
21#define WM8350_RTC_HOURS_DAY 0x11
22#define WM8350_RTC_DATE_MONTH 0x12
23#define WM8350_RTC_YEAR 0x13
24#define WM8350_ALARM_SECONDS_MINUTES 0x14
25#define WM8350_ALARM_HOURS_DAY 0x15
26#define WM8350_ALARM_DATE_MONTH 0x16
27#define WM8350_RTC_TIME_CONTROL 0x17
28
29/*
30 * R16 (0x10) - RTC Seconds/Minutes
31 */
32#define WM8350_RTC_MINS_MASK 0x7F00
33#define WM8350_RTC_MINS_SHIFT 8
34#define WM8350_RTC_SECS_MASK 0x007F
35#define WM8350_RTC_SECS_SHIFT 0
36
37/*
38 * R17 (0x11) - RTC Hours/Day
39 */
40#define WM8350_RTC_DAY_MASK 0x0700
41#define WM8350_RTC_DAY_SHIFT 8
42#define WM8350_RTC_HPM_MASK 0x0020
43#define WM8350_RTC_HPM_SHIFT 5
44#define WM8350_RTC_HRS_MASK 0x001F
45#define WM8350_RTC_HRS_SHIFT 0
46
47/* Bit values for R21 (0x15) */
48#define WM8350_RTC_DAY_SUN 1
49#define WM8350_RTC_DAY_MON 2
50#define WM8350_RTC_DAY_TUE 3
51#define WM8350_RTC_DAY_WED 4
52#define WM8350_RTC_DAY_THU 5
53#define WM8350_RTC_DAY_FRI 6
54#define WM8350_RTC_DAY_SAT 7
55
56#define WM8350_RTC_HPM_AM 0
57#define WM8350_RTC_HPM_PM 1
58
59/*
60 * R18 (0x12) - RTC Date/Month
61 */
62#define WM8350_RTC_MTH_MASK 0x1F00
63#define WM8350_RTC_MTH_SHIFT 8
64#define WM8350_RTC_DATE_MASK 0x003F
65#define WM8350_RTC_DATE_SHIFT 0
66
67/* Bit values for R22 (0x16) */
68#define WM8350_RTC_MTH_JAN 1
69#define WM8350_RTC_MTH_FEB 2
70#define WM8350_RTC_MTH_MAR 3
71#define WM8350_RTC_MTH_APR 4
72#define WM8350_RTC_MTH_MAY 5
73#define WM8350_RTC_MTH_JUN 6
74#define WM8350_RTC_MTH_JUL 7
75#define WM8350_RTC_MTH_AUG 8
76#define WM8350_RTC_MTH_SEP 9
77#define WM8350_RTC_MTH_OCT 10
78#define WM8350_RTC_MTH_NOV 11
79#define WM8350_RTC_MTH_DEC 12
80#define WM8350_RTC_MTH_JAN_BCD 0x01
81#define WM8350_RTC_MTH_FEB_BCD 0x02
82#define WM8350_RTC_MTH_MAR_BCD 0x03
83#define WM8350_RTC_MTH_APR_BCD 0x04
84#define WM8350_RTC_MTH_MAY_BCD 0x05
85#define WM8350_RTC_MTH_JUN_BCD 0x06
86#define WM8350_RTC_MTH_JUL_BCD 0x07
87#define WM8350_RTC_MTH_AUG_BCD 0x08
88#define WM8350_RTC_MTH_SEP_BCD 0x09
89#define WM8350_RTC_MTH_OCT_BCD 0x10
90#define WM8350_RTC_MTH_NOV_BCD 0x11
91#define WM8350_RTC_MTH_DEC_BCD 0x12
92
93/*
94 * R19 (0x13) - RTC Year
95 */
96#define WM8350_RTC_YHUNDREDS_MASK 0x3F00
97#define WM8350_RTC_YHUNDREDS_SHIFT 8
98#define WM8350_RTC_YUNITS_MASK 0x00FF
99#define WM8350_RTC_YUNITS_SHIFT 0
100
101/*
102 * R20 (0x14) - Alarm Seconds/Minutes
103 */
104#define WM8350_RTC_ALMMINS_MASK 0x7F00
105#define WM8350_RTC_ALMMINS_SHIFT 8
106#define WM8350_RTC_ALMSECS_MASK 0x007F
107#define WM8350_RTC_ALMSECS_SHIFT 0
108
109/* Bit values for R20 (0x14) */
110#define WM8350_RTC_ALMMINS_DONT_CARE -1
111#define WM8350_RTC_ALMSECS_DONT_CARE -1
112
113/*
114 * R21 (0x15) - Alarm Hours/Day
115 */
116#define WM8350_RTC_ALMDAY_MASK 0x0F00
117#define WM8350_RTC_ALMDAY_SHIFT 8
118#define WM8350_RTC_ALMHPM_MASK 0x0020
119#define WM8350_RTC_ALMHPM_SHIFT 5
120#define WM8350_RTC_ALMHRS_MASK 0x001F
121#define WM8350_RTC_ALMHRS_SHIFT 0
122
123/* Bit values for R21 (0x15) */
124#define WM8350_RTC_ALMDAY_DONT_CARE -1
125#define WM8350_RTC_ALMDAY_SUN 1
126#define WM8350_RTC_ALMDAY_MON 2
127#define WM8350_RTC_ALMDAY_TUE 3
128#define WM8350_RTC_ALMDAY_WED 4
129#define WM8350_RTC_ALMDAY_THU 5
130#define WM8350_RTC_ALMDAY_FRI 6
131#define WM8350_RTC_ALMDAY_SAT 7
132
133#define WM8350_RTC_ALMHPM_AM 0
134#define WM8350_RTC_ALMHPM_PM 1
135
136#define WM8350_RTC_ALMHRS_DONT_CARE -1
137
138/*
139 * R22 (0x16) - Alarm Date/Month
140 */
141#define WM8350_RTC_ALMMTH_MASK 0x1F00
142#define WM8350_RTC_ALMMTH_SHIFT 8
143#define WM8350_RTC_ALMDATE_MASK 0x003F
144#define WM8350_RTC_ALMDATE_SHIFT 0
145
146/* Bit values for R22 (0x16) */
147#define WM8350_RTC_ALMDATE_DONT_CARE -1
148
149#define WM8350_RTC_ALMMTH_DONT_CARE -1
150#define WM8350_RTC_ALMMTH_JAN 1
151#define WM8350_RTC_ALMMTH_FEB 2
152#define WM8350_RTC_ALMMTH_MAR 3
153#define WM8350_RTC_ALMMTH_APR 4
154#define WM8350_RTC_ALMMTH_MAY 5
155#define WM8350_RTC_ALMMTH_JUN 6
156#define WM8350_RTC_ALMMTH_JUL 7
157#define WM8350_RTC_ALMMTH_AUG 8
158#define WM8350_RTC_ALMMTH_SEP 9
159#define WM8350_RTC_ALMMTH_OCT 10
160#define WM8350_RTC_ALMMTH_NOV 11
161#define WM8350_RTC_ALMMTH_DEC 12
162#define WM8350_RTC_ALMMTH_JAN_BCD 0x01
163#define WM8350_RTC_ALMMTH_FEB_BCD 0x02
164#define WM8350_RTC_ALMMTH_MAR_BCD 0x03
165#define WM8350_RTC_ALMMTH_APR_BCD 0x04
166#define WM8350_RTC_ALMMTH_MAY_BCD 0x05
167#define WM8350_RTC_ALMMTH_JUN_BCD 0x06
168#define WM8350_RTC_ALMMTH_JUL_BCD 0x07
169#define WM8350_RTC_ALMMTH_AUG_BCD 0x08
170#define WM8350_RTC_ALMMTH_SEP_BCD 0x09
171#define WM8350_RTC_ALMMTH_OCT_BCD 0x10
172#define WM8350_RTC_ALMMTH_NOV_BCD 0x11
173#define WM8350_RTC_ALMMTH_DEC_BCD 0x12
174
175/*
176 * R23 (0x17) - RTC Time Control
177 */
178#define WM8350_RTC_BCD 0x8000
179#define WM8350_RTC_BCD_MASK 0x8000
180#define WM8350_RTC_BCD_SHIFT 15
181#define WM8350_RTC_12HR 0x4000
182#define WM8350_RTC_12HR_MASK 0x4000
183#define WM8350_RTC_12HR_SHIFT 14
184#define WM8350_RTC_DST 0x2000
185#define WM8350_RTC_DST_MASK 0x2000
186#define WM8350_RTC_DST_SHIFT 13
187#define WM8350_RTC_SET 0x0800
188#define WM8350_RTC_SET_MASK 0x0800
189#define WM8350_RTC_SET_SHIFT 11
190#define WM8350_RTC_STS 0x0400
191#define WM8350_RTC_STS_MASK 0x0400
192#define WM8350_RTC_STS_SHIFT 10
193#define WM8350_RTC_ALMSET 0x0200
194#define WM8350_RTC_ALMSET_MASK 0x0200
195#define WM8350_RTC_ALMSET_SHIFT 9
196#define WM8350_RTC_ALMSTS 0x0100
197#define WM8350_RTC_ALMSTS_MASK 0x0100
198#define WM8350_RTC_ALMSTS_SHIFT 8
199#define WM8350_RTC_PINT 0x0070
200#define WM8350_RTC_PINT_MASK 0x0070
201#define WM8350_RTC_PINT_SHIFT 4
202#define WM8350_RTC_DSW 0x000F
203#define WM8350_RTC_DSW_MASK 0x000F
204#define WM8350_RTC_DSW_SHIFT 0
205
206/* Bit values for R23 (0x17) */
207#define WM8350_RTC_BCD_BINARY 0
208#define WM8350_RTC_BCD_BCD 1
209
210#define WM8350_RTC_12HR_24HR 0
211#define WM8350_RTC_12HR_12HR 1
212
213#define WM8350_RTC_DST_DISABLED 0
214#define WM8350_RTC_DST_ENABLED 1
215
216#define WM8350_RTC_SET_RUN 0
217#define WM8350_RTC_SET_SET 1
218
219#define WM8350_RTC_STS_RUNNING 0
220#define WM8350_RTC_STS_STOPPED 1
221
222#define WM8350_RTC_ALMSET_RUN 0
223#define WM8350_RTC_ALMSET_SET 1
224
225#define WM8350_RTC_ALMSTS_RUNNING 0
226#define WM8350_RTC_ALMSTS_STOPPED 1
227
228#define WM8350_RTC_PINT_DISABLED 0
229#define WM8350_RTC_PINT_SECS 1
230#define WM8350_RTC_PINT_MINS 2
231#define WM8350_RTC_PINT_HRS 3
232#define WM8350_RTC_PINT_DAYS 4
233#define WM8350_RTC_PINT_MTHS 5
234
235#define WM8350_RTC_DSW_DISABLED 0
236#define WM8350_RTC_DSW_1HZ 1
237#define WM8350_RTC_DSW_2HZ 2
238#define WM8350_RTC_DSW_4HZ 3
239#define WM8350_RTC_DSW_8HZ 4
240#define WM8350_RTC_DSW_16HZ 5
241#define WM8350_RTC_DSW_32HZ 6
242#define WM8350_RTC_DSW_64HZ 7
243#define WM8350_RTC_DSW_128HZ 8
244#define WM8350_RTC_DSW_256HZ 9
245#define WM8350_RTC_DSW_512HZ 10
246#define WM8350_RTC_DSW_1024HZ 11
247
248/*
249 * R218 (0xDA) - RTC Tick Control
250 */
251#define WM8350_RTC_TICKSTS 0x4000
252#define WM8350_RTC_CLKSRC 0x2000
253#define WM8350_RTC_TRIM_MASK 0x03FF
254
255/*
256 * RTC Interrupts.
257 */
258#define WM8350_IRQ_RTC_PER 7
259#define WM8350_IRQ_RTC_SEC 8
260#define WM8350_IRQ_RTC_ALM 9
261
262struct wm8350_rtc {
263 struct platform_device *pdev;
264};
265
266#endif
diff --git a/include/linux/mfd/wm8350/supply.h b/include/linux/mfd/wm8350/supply.h
new file mode 100644
index 000000000000..1c8f3cde79b0
--- /dev/null
+++ b/include/linux/mfd/wm8350/supply.h
@@ -0,0 +1,111 @@
1/*
2 * supply.h -- Power Supply Driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __LINUX_MFD_WM8350_SUPPLY_H_
14#define __LINUX_MFD_WM8350_SUPPLY_H_
15
16#include <linux/platform_device.h>
17
18/*
19 * Charger registers
20 */
21#define WM8350_BATTERY_CHARGER_CONTROL_1 0xA8
22#define WM8350_BATTERY_CHARGER_CONTROL_2 0xA9
23#define WM8350_BATTERY_CHARGER_CONTROL_3 0xAA
24
25/*
26 * R168 (0xA8) - Battery Charger Control 1
27 */
28#define WM8350_CHG_ENA_R168 0x8000
29#define WM8350_CHG_THR 0x2000
30#define WM8350_CHG_EOC_SEL_MASK 0x1C00
31#define WM8350_CHG_TRICKLE_TEMP_CHOKE 0x0200
32#define WM8350_CHG_TRICKLE_USB_CHOKE 0x0100
33#define WM8350_CHG_RECOVER_T 0x0080
34#define WM8350_CHG_END_ACT 0x0040
35#define WM8350_CHG_FAST 0x0020
36#define WM8350_CHG_FAST_USB_THROTTLE 0x0010
37#define WM8350_CHG_NTC_MON 0x0008
38#define WM8350_CHG_BATT_HOT_MON 0x0004
39#define WM8350_CHG_BATT_COLD_MON 0x0002
40#define WM8350_CHG_CHIP_TEMP_MON 0x0001
41
42/*
43 * R169 (0xA9) - Battery Charger Control 2
44 */
45#define WM8350_CHG_ACTIVE 0x8000
46#define WM8350_CHG_PAUSE 0x4000
47#define WM8350_CHG_STS_MASK 0x3000
48#define WM8350_CHG_TIME_MASK 0x0F00
49#define WM8350_CHG_MASK_WALL_FB 0x0080
50#define WM8350_CHG_TRICKLE_SEL 0x0040
51#define WM8350_CHG_VSEL_MASK 0x0030
52#define WM8350_CHG_ISEL_MASK 0x000F
53#define WM8350_CHG_STS_OFF 0x0000
54#define WM8350_CHG_STS_TRICKLE 0x1000
55#define WM8350_CHG_STS_FAST 0x2000
56
57/*
58 * R170 (0xAA) - Battery Charger Control 3
59 */
60#define WM8350_CHG_THROTTLE_T_MASK 0x0060
61#define WM8350_CHG_SMART 0x0010
62#define WM8350_CHG_TIMER_ADJT_MASK 0x000F
63
64/*
65 * Charger Interrupts
66 */
67#define WM8350_IRQ_CHG_BAT_HOT 0
68#define WM8350_IRQ_CHG_BAT_COLD 1
69#define WM8350_IRQ_CHG_BAT_FAIL 2
70#define WM8350_IRQ_CHG_TO 3
71#define WM8350_IRQ_CHG_END 4
72#define WM8350_IRQ_CHG_START 5
73#define WM8350_IRQ_CHG_FAST_RDY 6
74#define WM8350_IRQ_CHG_VBATT_LT_3P9 10
75#define WM8350_IRQ_CHG_VBATT_LT_3P1 11
76#define WM8350_IRQ_CHG_VBATT_LT_2P85 12
77
78/*
79 * Charger Policy
80 */
81#define WM8350_CHG_TRICKLE_50mA (0 << 6)
82#define WM8350_CHG_TRICKLE_100mA (1 << 6)
83#define WM8350_CHG_4_05V (0 << 4)
84#define WM8350_CHG_4_10V (1 << 4)
85#define WM8350_CHG_4_15V (2 << 4)
86#define WM8350_CHG_4_20V (3 << 4)
87#define WM8350_CHG_FAST_LIMIT_mA(x) ((x / 50) & 0xf)
88#define WM8350_CHG_EOC_mA(x) (((x - 10) & 0x7) << 10)
89#define WM8350_CHG_TRICKLE_3_1V (0 << 13)
90#define WM8350_CHG_TRICKLE_3_9V (1 << 13)
91
92/*
93 * Supply Registers.
94 */
95#define WM8350_USB_VOLTAGE_READBACK 0x9C
96#define WM8350_LINE_VOLTAGE_READBACK 0x9D
97#define WM8350_BATT_VOLTAGE_READBACK 0x9E
98
99/*
100 * Supply Interrupts.
101 */
102#define WM8350_IRQ_USB_LIMIT 15
103#define WM8350_IRQ_EXT_USB_FB 36
104#define WM8350_IRQ_EXT_WALL_FB 37
105#define WM8350_IRQ_EXT_BAT_FB 38
106
107struct wm8350_power {
108 struct platform_device *pdev;
109};
110
111#endif
diff --git a/include/linux/mfd/wm8350/wdt.h b/include/linux/mfd/wm8350/wdt.h
new file mode 100644
index 000000000000..f6135b5e5ef4
--- /dev/null
+++ b/include/linux/mfd/wm8350/wdt.h
@@ -0,0 +1,28 @@
1/*
2 * wdt.h -- Watchdog Driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007, 2008 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef __LINUX_MFD_WM8350_WDT_H_
13#define __LINUX_MFD_WM8350_WDT_H_
14
15#include <linux/platform_device.h>
16
17#define WM8350_WDOG_HIB_MODE 0x0080
18#define WM8350_WDOG_DEBUG 0x0040
19#define WM8350_WDOG_MODE_MASK 0x0030
20#define WM8350_WDOG_TO_MASK 0x0007
21
22#define WM8350_IRQ_SYS_WDOG_TO 24
23
24struct wm8350_wdt {
25 struct platform_device *pdev;
26};
27
28#endif
diff --git a/include/linux/mfd/wm8400-audio.h b/include/linux/mfd/wm8400-audio.h
new file mode 100644
index 000000000000..b6640e018046
--- /dev/null
+++ b/include/linux/mfd/wm8400-audio.h
@@ -0,0 +1,1186 @@
1/*
2 * wm8400 private definitions for audio
3 *
4 * Copyright 2008 Wolfson Microelectronics plc
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef __LINUX_MFD_WM8400_AUDIO_H
22#define __LINUX_MFD_WM8400_AUDIO_H
23
24#include <linux/mfd/wm8400-audio.h>
25
26/*
27 * R2 (0x02) - Power Management (1)
28 */
29#define WM8400_CODEC_ENA 0x8000 /* CODEC_ENA */
30#define WM8400_CODEC_ENA_MASK 0x8000 /* CODEC_ENA */
31#define WM8400_CODEC_ENA_SHIFT 15 /* CODEC_ENA */
32#define WM8400_CODEC_ENA_WIDTH 1 /* CODEC_ENA */
33#define WM8400_SYSCLK_ENA 0x4000 /* SYSCLK_ENA */
34#define WM8400_SYSCLK_ENA_MASK 0x4000 /* SYSCLK_ENA */
35#define WM8400_SYSCLK_ENA_SHIFT 14 /* SYSCLK_ENA */
36#define WM8400_SYSCLK_ENA_WIDTH 1 /* SYSCLK_ENA */
37#define WM8400_SPK_MIX_ENA 0x2000 /* SPK_MIX_ENA */
38#define WM8400_SPK_MIX_ENA_MASK 0x2000 /* SPK_MIX_ENA */
39#define WM8400_SPK_MIX_ENA_SHIFT 13 /* SPK_MIX_ENA */
40#define WM8400_SPK_MIX_ENA_WIDTH 1 /* SPK_MIX_ENA */
41#define WM8400_SPK_ENA 0x1000 /* SPK_ENA */
42#define WM8400_SPK_ENA_MASK 0x1000 /* SPK_ENA */
43#define WM8400_SPK_ENA_SHIFT 12 /* SPK_ENA */
44#define WM8400_SPK_ENA_WIDTH 1 /* SPK_ENA */
45#define WM8400_OUT3_ENA 0x0800 /* OUT3_ENA */
46#define WM8400_OUT3_ENA_MASK 0x0800 /* OUT3_ENA */
47#define WM8400_OUT3_ENA_SHIFT 11 /* OUT3_ENA */
48#define WM8400_OUT3_ENA_WIDTH 1 /* OUT3_ENA */
49#define WM8400_OUT4_ENA 0x0400 /* OUT4_ENA */
50#define WM8400_OUT4_ENA_MASK 0x0400 /* OUT4_ENA */
51#define WM8400_OUT4_ENA_SHIFT 10 /* OUT4_ENA */
52#define WM8400_OUT4_ENA_WIDTH 1 /* OUT4_ENA */
53#define WM8400_LOUT_ENA 0x0200 /* LOUT_ENA */
54#define WM8400_LOUT_ENA_MASK 0x0200 /* LOUT_ENA */
55#define WM8400_LOUT_ENA_SHIFT 9 /* LOUT_ENA */
56#define WM8400_LOUT_ENA_WIDTH 1 /* LOUT_ENA */
57#define WM8400_ROUT_ENA 0x0100 /* ROUT_ENA */
58#define WM8400_ROUT_ENA_MASK 0x0100 /* ROUT_ENA */
59#define WM8400_ROUT_ENA_SHIFT 8 /* ROUT_ENA */
60#define WM8400_ROUT_ENA_WIDTH 1 /* ROUT_ENA */
61#define WM8400_MIC1BIAS_ENA 0x0010 /* MIC1BIAS_ENA */
62#define WM8400_MIC1BIAS_ENA_MASK 0x0010 /* MIC1BIAS_ENA */
63#define WM8400_MIC1BIAS_ENA_SHIFT 4 /* MIC1BIAS_ENA */
64#define WM8400_MIC1BIAS_ENA_WIDTH 1 /* MIC1BIAS_ENA */
65#define WM8400_VMID_MODE_MASK 0x0006 /* VMID_MODE - [2:1] */
66#define WM8400_VMID_MODE_SHIFT 1 /* VMID_MODE - [2:1] */
67#define WM8400_VMID_MODE_WIDTH 2 /* VMID_MODE - [2:1] */
68#define WM8400_VREF_ENA 0x0001 /* VREF_ENA */
69#define WM8400_VREF_ENA_MASK 0x0001 /* VREF_ENA */
70#define WM8400_VREF_ENA_SHIFT 0 /* VREF_ENA */
71#define WM8400_VREF_ENA_WIDTH 1 /* VREF_ENA */
72
73/*
74 * R3 (0x03) - Power Management (2)
75 */
76#define WM8400_FLL_ENA 0x8000 /* FLL_ENA */
77#define WM8400_FLL_ENA_MASK 0x8000 /* FLL_ENA */
78#define WM8400_FLL_ENA_SHIFT 15 /* FLL_ENA */
79#define WM8400_FLL_ENA_WIDTH 1 /* FLL_ENA */
80#define WM8400_TSHUT_ENA 0x4000 /* TSHUT_ENA */
81#define WM8400_TSHUT_ENA_MASK 0x4000 /* TSHUT_ENA */
82#define WM8400_TSHUT_ENA_SHIFT 14 /* TSHUT_ENA */
83#define WM8400_TSHUT_ENA_WIDTH 1 /* TSHUT_ENA */
84#define WM8400_TSHUT_OPDIS 0x2000 /* TSHUT_OPDIS */
85#define WM8400_TSHUT_OPDIS_MASK 0x2000 /* TSHUT_OPDIS */
86#define WM8400_TSHUT_OPDIS_SHIFT 13 /* TSHUT_OPDIS */
87#define WM8400_TSHUT_OPDIS_WIDTH 1 /* TSHUT_OPDIS */
88#define WM8400_OPCLK_ENA 0x0800 /* OPCLK_ENA */
89#define WM8400_OPCLK_ENA_MASK 0x0800 /* OPCLK_ENA */
90#define WM8400_OPCLK_ENA_SHIFT 11 /* OPCLK_ENA */
91#define WM8400_OPCLK_ENA_WIDTH 1 /* OPCLK_ENA */
92#define WM8400_AINL_ENA 0x0200 /* AINL_ENA */
93#define WM8400_AINL_ENA_MASK 0x0200 /* AINL_ENA */
94#define WM8400_AINL_ENA_SHIFT 9 /* AINL_ENA */
95#define WM8400_AINL_ENA_WIDTH 1 /* AINL_ENA */
96#define WM8400_AINR_ENA 0x0100 /* AINR_ENA */
97#define WM8400_AINR_ENA_MASK 0x0100 /* AINR_ENA */
98#define WM8400_AINR_ENA_SHIFT 8 /* AINR_ENA */
99#define WM8400_AINR_ENA_WIDTH 1 /* AINR_ENA */
100#define WM8400_LIN34_ENA 0x0080 /* LIN34_ENA */
101#define WM8400_LIN34_ENA_MASK 0x0080 /* LIN34_ENA */
102#define WM8400_LIN34_ENA_SHIFT 7 /* LIN34_ENA */
103#define WM8400_LIN34_ENA_WIDTH 1 /* LIN34_ENA */
104#define WM8400_LIN12_ENA 0x0040 /* LIN12_ENA */
105#define WM8400_LIN12_ENA_MASK 0x0040 /* LIN12_ENA */
106#define WM8400_LIN12_ENA_SHIFT 6 /* LIN12_ENA */
107#define WM8400_LIN12_ENA_WIDTH 1 /* LIN12_ENA */
108#define WM8400_RIN34_ENA 0x0020 /* RIN34_ENA */
109#define WM8400_RIN34_ENA_MASK 0x0020 /* RIN34_ENA */
110#define WM8400_RIN34_ENA_SHIFT 5 /* RIN34_ENA */
111#define WM8400_RIN34_ENA_WIDTH 1 /* RIN34_ENA */
112#define WM8400_RIN12_ENA 0x0010 /* RIN12_ENA */
113#define WM8400_RIN12_ENA_MASK 0x0010 /* RIN12_ENA */
114#define WM8400_RIN12_ENA_SHIFT 4 /* RIN12_ENA */
115#define WM8400_RIN12_ENA_WIDTH 1 /* RIN12_ENA */
116#define WM8400_ADCL_ENA 0x0002 /* ADCL_ENA */
117#define WM8400_ADCL_ENA_MASK 0x0002 /* ADCL_ENA */
118#define WM8400_ADCL_ENA_SHIFT 1 /* ADCL_ENA */
119#define WM8400_ADCL_ENA_WIDTH 1 /* ADCL_ENA */
120#define WM8400_ADCR_ENA 0x0001 /* ADCR_ENA */
121#define WM8400_ADCR_ENA_MASK 0x0001 /* ADCR_ENA */
122#define WM8400_ADCR_ENA_SHIFT 0 /* ADCR_ENA */
123#define WM8400_ADCR_ENA_WIDTH 1 /* ADCR_ENA */
124
125/*
126 * R4 (0x04) - Power Management (3)
127 */
128#define WM8400_LON_ENA 0x2000 /* LON_ENA */
129#define WM8400_LON_ENA_MASK 0x2000 /* LON_ENA */
130#define WM8400_LON_ENA_SHIFT 13 /* LON_ENA */
131#define WM8400_LON_ENA_WIDTH 1 /* LON_ENA */
132#define WM8400_LOP_ENA 0x1000 /* LOP_ENA */
133#define WM8400_LOP_ENA_MASK 0x1000 /* LOP_ENA */
134#define WM8400_LOP_ENA_SHIFT 12 /* LOP_ENA */
135#define WM8400_LOP_ENA_WIDTH 1 /* LOP_ENA */
136#define WM8400_RON_ENA 0x0800 /* RON_ENA */
137#define WM8400_RON_ENA_MASK 0x0800 /* RON_ENA */
138#define WM8400_RON_ENA_SHIFT 11 /* RON_ENA */
139#define WM8400_RON_ENA_WIDTH 1 /* RON_ENA */
140#define WM8400_ROP_ENA 0x0400 /* ROP_ENA */
141#define WM8400_ROP_ENA_MASK 0x0400 /* ROP_ENA */
142#define WM8400_ROP_ENA_SHIFT 10 /* ROP_ENA */
143#define WM8400_ROP_ENA_WIDTH 1 /* ROP_ENA */
144#define WM8400_LOPGA_ENA 0x0080 /* LOPGA_ENA */
145#define WM8400_LOPGA_ENA_MASK 0x0080 /* LOPGA_ENA */
146#define WM8400_LOPGA_ENA_SHIFT 7 /* LOPGA_ENA */
147#define WM8400_LOPGA_ENA_WIDTH 1 /* LOPGA_ENA */
148#define WM8400_ROPGA_ENA 0x0040 /* ROPGA_ENA */
149#define WM8400_ROPGA_ENA_MASK 0x0040 /* ROPGA_ENA */
150#define WM8400_ROPGA_ENA_SHIFT 6 /* ROPGA_ENA */
151#define WM8400_ROPGA_ENA_WIDTH 1 /* ROPGA_ENA */
152#define WM8400_LOMIX_ENA 0x0020 /* LOMIX_ENA */
153#define WM8400_LOMIX_ENA_MASK 0x0020 /* LOMIX_ENA */
154#define WM8400_LOMIX_ENA_SHIFT 5 /* LOMIX_ENA */
155#define WM8400_LOMIX_ENA_WIDTH 1 /* LOMIX_ENA */
156#define WM8400_ROMIX_ENA 0x0010 /* ROMIX_ENA */
157#define WM8400_ROMIX_ENA_MASK 0x0010 /* ROMIX_ENA */
158#define WM8400_ROMIX_ENA_SHIFT 4 /* ROMIX_ENA */
159#define WM8400_ROMIX_ENA_WIDTH 1 /* ROMIX_ENA */
160#define WM8400_DACL_ENA 0x0002 /* DACL_ENA */
161#define WM8400_DACL_ENA_MASK 0x0002 /* DACL_ENA */
162#define WM8400_DACL_ENA_SHIFT 1 /* DACL_ENA */
163#define WM8400_DACL_ENA_WIDTH 1 /* DACL_ENA */
164#define WM8400_DACR_ENA 0x0001 /* DACR_ENA */
165#define WM8400_DACR_ENA_MASK 0x0001 /* DACR_ENA */
166#define WM8400_DACR_ENA_SHIFT 0 /* DACR_ENA */
167#define WM8400_DACR_ENA_WIDTH 1 /* DACR_ENA */
168
169/*
170 * R5 (0x05) - Audio Interface (1)
171 */
172#define WM8400_AIFADCL_SRC 0x8000 /* AIFADCL_SRC */
173#define WM8400_AIFADCL_SRC_MASK 0x8000 /* AIFADCL_SRC */
174#define WM8400_AIFADCL_SRC_SHIFT 15 /* AIFADCL_SRC */
175#define WM8400_AIFADCL_SRC_WIDTH 1 /* AIFADCL_SRC */
176#define WM8400_AIFADCR_SRC 0x4000 /* AIFADCR_SRC */
177#define WM8400_AIFADCR_SRC_MASK 0x4000 /* AIFADCR_SRC */
178#define WM8400_AIFADCR_SRC_SHIFT 14 /* AIFADCR_SRC */
179#define WM8400_AIFADCR_SRC_WIDTH 1 /* AIFADCR_SRC */
180#define WM8400_AIFADC_TDM 0x2000 /* AIFADC_TDM */
181#define WM8400_AIFADC_TDM_MASK 0x2000 /* AIFADC_TDM */
182#define WM8400_AIFADC_TDM_SHIFT 13 /* AIFADC_TDM */
183#define WM8400_AIFADC_TDM_WIDTH 1 /* AIFADC_TDM */
184#define WM8400_AIFADC_TDM_CHAN 0x1000 /* AIFADC_TDM_CHAN */
185#define WM8400_AIFADC_TDM_CHAN_MASK 0x1000 /* AIFADC_TDM_CHAN */
186#define WM8400_AIFADC_TDM_CHAN_SHIFT 12 /* AIFADC_TDM_CHAN */
187#define WM8400_AIFADC_TDM_CHAN_WIDTH 1 /* AIFADC_TDM_CHAN */
188#define WM8400_AIF_BCLK_INV 0x0100 /* AIF_BCLK_INV */
189#define WM8400_AIF_BCLK_INV_MASK 0x0100 /* AIF_BCLK_INV */
190#define WM8400_AIF_BCLK_INV_SHIFT 8 /* AIF_BCLK_INV */
191#define WM8400_AIF_BCLK_INV_WIDTH 1 /* AIF_BCLK_INV */
192#define WM8400_AIF_LRCLK_INV 0x0080 /* AIF_LRCLK_INV */
193#define WM8400_AIF_LRCLK_INV_MASK 0x0080 /* AIF_LRCLK_INV */
194#define WM8400_AIF_LRCLK_INV_SHIFT 7 /* AIF_LRCLK_INV */
195#define WM8400_AIF_LRCLK_INV_WIDTH 1 /* AIF_LRCLK_INV */
196#define WM8400_AIF_WL_MASK 0x0060 /* AIF_WL - [6:5] */
197#define WM8400_AIF_WL_SHIFT 5 /* AIF_WL - [6:5] */
198#define WM8400_AIF_WL_WIDTH 2 /* AIF_WL - [6:5] */
199#define WM8400_AIF_WL_16BITS (0 << 5)
200#define WM8400_AIF_WL_20BITS (1 << 5)
201#define WM8400_AIF_WL_24BITS (2 << 5)
202#define WM8400_AIF_WL_32BITS (3 << 5)
203#define WM8400_AIF_FMT_MASK 0x0018 /* AIF_FMT - [4:3] */
204#define WM8400_AIF_FMT_SHIFT 3 /* AIF_FMT - [4:3] */
205#define WM8400_AIF_FMT_WIDTH 2 /* AIF_FMT - [4:3] */
206#define WM8400_AIF_FMT_RIGHTJ (0 << 3)
207#define WM8400_AIF_FMT_LEFTJ (1 << 3)
208#define WM8400_AIF_FMT_I2S (2 << 3)
209#define WM8400_AIF_FMT_DSP (3 << 3)
210
211/*
212 * R6 (0x06) - Audio Interface (2)
213 */
214#define WM8400_DACL_SRC 0x8000 /* DACL_SRC */
215#define WM8400_DACL_SRC_MASK 0x8000 /* DACL_SRC */
216#define WM8400_DACL_SRC_SHIFT 15 /* DACL_SRC */
217#define WM8400_DACL_SRC_WIDTH 1 /* DACL_SRC */
218#define WM8400_DACR_SRC 0x4000 /* DACR_SRC */
219#define WM8400_DACR_SRC_MASK 0x4000 /* DACR_SRC */
220#define WM8400_DACR_SRC_SHIFT 14 /* DACR_SRC */
221#define WM8400_DACR_SRC_WIDTH 1 /* DACR_SRC */
222#define WM8400_AIFDAC_TDM 0x2000 /* AIFDAC_TDM */
223#define WM8400_AIFDAC_TDM_MASK 0x2000 /* AIFDAC_TDM */
224#define WM8400_AIFDAC_TDM_SHIFT 13 /* AIFDAC_TDM */
225#define WM8400_AIFDAC_TDM_WIDTH 1 /* AIFDAC_TDM */
226#define WM8400_AIFDAC_TDM_CHAN 0x1000 /* AIFDAC_TDM_CHAN */
227#define WM8400_AIFDAC_TDM_CHAN_MASK 0x1000 /* AIFDAC_TDM_CHAN */
228#define WM8400_AIFDAC_TDM_CHAN_SHIFT 12 /* AIFDAC_TDM_CHAN */
229#define WM8400_AIFDAC_TDM_CHAN_WIDTH 1 /* AIFDAC_TDM_CHAN */
230#define WM8400_DAC_BOOST_MASK 0x0C00 /* DAC_BOOST - [11:10] */
231#define WM8400_DAC_BOOST_SHIFT 10 /* DAC_BOOST - [11:10] */
232#define WM8400_DAC_BOOST_WIDTH 2 /* DAC_BOOST - [11:10] */
233#define WM8400_DAC_COMP 0x0010 /* DAC_COMP */
234#define WM8400_DAC_COMP_MASK 0x0010 /* DAC_COMP */
235#define WM8400_DAC_COMP_SHIFT 4 /* DAC_COMP */
236#define WM8400_DAC_COMP_WIDTH 1 /* DAC_COMP */
237#define WM8400_DAC_COMPMODE 0x0008 /* DAC_COMPMODE */
238#define WM8400_DAC_COMPMODE_MASK 0x0008 /* DAC_COMPMODE */
239#define WM8400_DAC_COMPMODE_SHIFT 3 /* DAC_COMPMODE */
240#define WM8400_DAC_COMPMODE_WIDTH 1 /* DAC_COMPMODE */
241#define WM8400_ADC_COMP 0x0004 /* ADC_COMP */
242#define WM8400_ADC_COMP_MASK 0x0004 /* ADC_COMP */
243#define WM8400_ADC_COMP_SHIFT 2 /* ADC_COMP */
244#define WM8400_ADC_COMP_WIDTH 1 /* ADC_COMP */
245#define WM8400_ADC_COMPMODE 0x0002 /* ADC_COMPMODE */
246#define WM8400_ADC_COMPMODE_MASK 0x0002 /* ADC_COMPMODE */
247#define WM8400_ADC_COMPMODE_SHIFT 1 /* ADC_COMPMODE */
248#define WM8400_ADC_COMPMODE_WIDTH 1 /* ADC_COMPMODE */
249#define WM8400_LOOPBACK 0x0001 /* LOOPBACK */
250#define WM8400_LOOPBACK_MASK 0x0001 /* LOOPBACK */
251#define WM8400_LOOPBACK_SHIFT 0 /* LOOPBACK */
252#define WM8400_LOOPBACK_WIDTH 1 /* LOOPBACK */
253
254/*
255 * R7 (0x07) - Clocking (1)
256 */
257#define WM8400_TOCLK_RATE 0x8000 /* TOCLK_RATE */
258#define WM8400_TOCLK_RATE_MASK 0x8000 /* TOCLK_RATE */
259#define WM8400_TOCLK_RATE_SHIFT 15 /* TOCLK_RATE */
260#define WM8400_TOCLK_RATE_WIDTH 1 /* TOCLK_RATE */
261#define WM8400_TOCLK_ENA 0x4000 /* TOCLK_ENA */
262#define WM8400_TOCLK_ENA_MASK 0x4000 /* TOCLK_ENA */
263#define WM8400_TOCLK_ENA_SHIFT 14 /* TOCLK_ENA */
264#define WM8400_TOCLK_ENA_WIDTH 1 /* TOCLK_ENA */
265#define WM8400_OPCLKDIV_MASK 0x1E00 /* OPCLKDIV - [12:9] */
266#define WM8400_OPCLKDIV_SHIFT 9 /* OPCLKDIV - [12:9] */
267#define WM8400_OPCLKDIV_WIDTH 4 /* OPCLKDIV - [12:9] */
268#define WM8400_DCLKDIV_MASK 0x01C0 /* DCLKDIV - [8:6] */
269#define WM8400_DCLKDIV_SHIFT 6 /* DCLKDIV - [8:6] */
270#define WM8400_DCLKDIV_WIDTH 3 /* DCLKDIV - [8:6] */
271#define WM8400_BCLK_DIV_MASK 0x001E /* BCLK_DIV - [4:1] */
272#define WM8400_BCLK_DIV_SHIFT 1 /* BCLK_DIV - [4:1] */
273#define WM8400_BCLK_DIV_WIDTH 4 /* BCLK_DIV - [4:1] */
274
275/*
276 * R8 (0x08) - Clocking (2)
277 */
278#define WM8400_MCLK_SRC 0x8000 /* MCLK_SRC */
279#define WM8400_MCLK_SRC_MASK 0x8000 /* MCLK_SRC */
280#define WM8400_MCLK_SRC_SHIFT 15 /* MCLK_SRC */
281#define WM8400_MCLK_SRC_WIDTH 1 /* MCLK_SRC */
282#define WM8400_SYSCLK_SRC 0x4000 /* SYSCLK_SRC */
283#define WM8400_SYSCLK_SRC_MASK 0x4000 /* SYSCLK_SRC */
284#define WM8400_SYSCLK_SRC_SHIFT 14 /* SYSCLK_SRC */
285#define WM8400_SYSCLK_SRC_WIDTH 1 /* SYSCLK_SRC */
286#define WM8400_CLK_FORCE 0x2000 /* CLK_FORCE */
287#define WM8400_CLK_FORCE_MASK 0x2000 /* CLK_FORCE */
288#define WM8400_CLK_FORCE_SHIFT 13 /* CLK_FORCE */
289#define WM8400_CLK_FORCE_WIDTH 1 /* CLK_FORCE */
290#define WM8400_MCLK_DIV_MASK 0x1800 /* MCLK_DIV - [12:11] */
291#define WM8400_MCLK_DIV_SHIFT 11 /* MCLK_DIV - [12:11] */
292#define WM8400_MCLK_DIV_WIDTH 2 /* MCLK_DIV - [12:11] */
293#define WM8400_MCLK_INV 0x0400 /* MCLK_INV */
294#define WM8400_MCLK_INV_MASK 0x0400 /* MCLK_INV */
295#define WM8400_MCLK_INV_SHIFT 10 /* MCLK_INV */
296#define WM8400_MCLK_INV_WIDTH 1 /* MCLK_INV */
297#define WM8400_ADC_CLKDIV_MASK 0x00E0 /* ADC_CLKDIV - [7:5] */
298#define WM8400_ADC_CLKDIV_SHIFT 5 /* ADC_CLKDIV - [7:5] */
299#define WM8400_ADC_CLKDIV_WIDTH 3 /* ADC_CLKDIV - [7:5] */
300#define WM8400_DAC_CLKDIV_MASK 0x001C /* DAC_CLKDIV - [4:2] */
301#define WM8400_DAC_CLKDIV_SHIFT 2 /* DAC_CLKDIV - [4:2] */
302#define WM8400_DAC_CLKDIV_WIDTH 3 /* DAC_CLKDIV - [4:2] */
303
304/*
305 * R9 (0x09) - Audio Interface (3)
306 */
307#define WM8400_AIF_MSTR1 0x8000 /* AIF_MSTR1 */
308#define WM8400_AIF_MSTR1_MASK 0x8000 /* AIF_MSTR1 */
309#define WM8400_AIF_MSTR1_SHIFT 15 /* AIF_MSTR1 */
310#define WM8400_AIF_MSTR1_WIDTH 1 /* AIF_MSTR1 */
311#define WM8400_AIF_MSTR2 0x4000 /* AIF_MSTR2 */
312#define WM8400_AIF_MSTR2_MASK 0x4000 /* AIF_MSTR2 */
313#define WM8400_AIF_MSTR2_SHIFT 14 /* AIF_MSTR2 */
314#define WM8400_AIF_MSTR2_WIDTH 1 /* AIF_MSTR2 */
315#define WM8400_AIF_SEL 0x2000 /* AIF_SEL */
316#define WM8400_AIF_SEL_MASK 0x2000 /* AIF_SEL */
317#define WM8400_AIF_SEL_SHIFT 13 /* AIF_SEL */
318#define WM8400_AIF_SEL_WIDTH 1 /* AIF_SEL */
319#define WM8400_ADCLRC_DIR 0x0800 /* ADCLRC_DIR */
320#define WM8400_ADCLRC_DIR_MASK 0x0800 /* ADCLRC_DIR */
321#define WM8400_ADCLRC_DIR_SHIFT 11 /* ADCLRC_DIR */
322#define WM8400_ADCLRC_DIR_WIDTH 1 /* ADCLRC_DIR */
323#define WM8400_ADCLRC_RATE_MASK 0x07FF /* ADCLRC_RATE - [10:0] */
324#define WM8400_ADCLRC_RATE_SHIFT 0 /* ADCLRC_RATE - [10:0] */
325#define WM8400_ADCLRC_RATE_WIDTH 11 /* ADCLRC_RATE - [10:0] */
326
327/*
328 * R10 (0x0A) - Audio Interface (4)
329 */
330#define WM8400_ALRCGPIO1 0x8000 /* ALRCGPIO1 */
331#define WM8400_ALRCGPIO1_MASK 0x8000 /* ALRCGPIO1 */
332#define WM8400_ALRCGPIO1_SHIFT 15 /* ALRCGPIO1 */
333#define WM8400_ALRCGPIO1_WIDTH 1 /* ALRCGPIO1 */
334#define WM8400_ALRCBGPIO6 0x4000 /* ALRCBGPIO6 */
335#define WM8400_ALRCBGPIO6_MASK 0x4000 /* ALRCBGPIO6 */
336#define WM8400_ALRCBGPIO6_SHIFT 14 /* ALRCBGPIO6 */
337#define WM8400_ALRCBGPIO6_WIDTH 1 /* ALRCBGPIO6 */
338#define WM8400_AIF_TRIS 0x2000 /* AIF_TRIS */
339#define WM8400_AIF_TRIS_MASK 0x2000 /* AIF_TRIS */
340#define WM8400_AIF_TRIS_SHIFT 13 /* AIF_TRIS */
341#define WM8400_AIF_TRIS_WIDTH 1 /* AIF_TRIS */
342#define WM8400_DACLRC_DIR 0x0800 /* DACLRC_DIR */
343#define WM8400_DACLRC_DIR_MASK 0x0800 /* DACLRC_DIR */
344#define WM8400_DACLRC_DIR_SHIFT 11 /* DACLRC_DIR */
345#define WM8400_DACLRC_DIR_WIDTH 1 /* DACLRC_DIR */
346#define WM8400_DACLRC_RATE_MASK 0x07FF /* DACLRC_RATE - [10:0] */
347#define WM8400_DACLRC_RATE_SHIFT 0 /* DACLRC_RATE - [10:0] */
348#define WM8400_DACLRC_RATE_WIDTH 11 /* DACLRC_RATE - [10:0] */
349
350/*
351 * R11 (0x0B) - DAC CTRL
352 */
353#define WM8400_DAC_SDMCLK_RATE 0x2000 /* DAC_SDMCLK_RATE */
354#define WM8400_DAC_SDMCLK_RATE_MASK 0x2000 /* DAC_SDMCLK_RATE */
355#define WM8400_DAC_SDMCLK_RATE_SHIFT 13 /* DAC_SDMCLK_RATE */
356#define WM8400_DAC_SDMCLK_RATE_WIDTH 1 /* DAC_SDMCLK_RATE */
357#define WM8400_AIF_LRCLKRATE 0x0400 /* AIF_LRCLKRATE */
358#define WM8400_AIF_LRCLKRATE_MASK 0x0400 /* AIF_LRCLKRATE */
359#define WM8400_AIF_LRCLKRATE_SHIFT 10 /* AIF_LRCLKRATE */
360#define WM8400_AIF_LRCLKRATE_WIDTH 1 /* AIF_LRCLKRATE */
361#define WM8400_DAC_MONO 0x0200 /* DAC_MONO */
362#define WM8400_DAC_MONO_MASK 0x0200 /* DAC_MONO */
363#define WM8400_DAC_MONO_SHIFT 9 /* DAC_MONO */
364#define WM8400_DAC_MONO_WIDTH 1 /* DAC_MONO */
365#define WM8400_DAC_SB_FILT 0x0100 /* DAC_SB_FILT */
366#define WM8400_DAC_SB_FILT_MASK 0x0100 /* DAC_SB_FILT */
367#define WM8400_DAC_SB_FILT_SHIFT 8 /* DAC_SB_FILT */
368#define WM8400_DAC_SB_FILT_WIDTH 1 /* DAC_SB_FILT */
369#define WM8400_DAC_MUTERATE 0x0080 /* DAC_MUTERATE */
370#define WM8400_DAC_MUTERATE_MASK 0x0080 /* DAC_MUTERATE */
371#define WM8400_DAC_MUTERATE_SHIFT 7 /* DAC_MUTERATE */
372#define WM8400_DAC_MUTERATE_WIDTH 1 /* DAC_MUTERATE */
373#define WM8400_DAC_MUTEMODE 0x0040 /* DAC_MUTEMODE */
374#define WM8400_DAC_MUTEMODE_MASK 0x0040 /* DAC_MUTEMODE */
375#define WM8400_DAC_MUTEMODE_SHIFT 6 /* DAC_MUTEMODE */
376#define WM8400_DAC_MUTEMODE_WIDTH 1 /* DAC_MUTEMODE */
377#define WM8400_DEEMP_MASK 0x0030 /* DEEMP - [5:4] */
378#define WM8400_DEEMP_SHIFT 4 /* DEEMP - [5:4] */
379#define WM8400_DEEMP_WIDTH 2 /* DEEMP - [5:4] */
380#define WM8400_DAC_MUTE 0x0004 /* DAC_MUTE */
381#define WM8400_DAC_MUTE_MASK 0x0004 /* DAC_MUTE */
382#define WM8400_DAC_MUTE_SHIFT 2 /* DAC_MUTE */
383#define WM8400_DAC_MUTE_WIDTH 1 /* DAC_MUTE */
384#define WM8400_DACL_DATINV 0x0002 /* DACL_DATINV */
385#define WM8400_DACL_DATINV_MASK 0x0002 /* DACL_DATINV */
386#define WM8400_DACL_DATINV_SHIFT 1 /* DACL_DATINV */
387#define WM8400_DACL_DATINV_WIDTH 1 /* DACL_DATINV */
388#define WM8400_DACR_DATINV 0x0001 /* DACR_DATINV */
389#define WM8400_DACR_DATINV_MASK 0x0001 /* DACR_DATINV */
390#define WM8400_DACR_DATINV_SHIFT 0 /* DACR_DATINV */
391#define WM8400_DACR_DATINV_WIDTH 1 /* DACR_DATINV */
392
393/*
394 * R12 (0x0C) - Left DAC Digital Volume
395 */
396#define WM8400_DAC_VU 0x0100 /* DAC_VU */
397#define WM8400_DAC_VU_MASK 0x0100 /* DAC_VU */
398#define WM8400_DAC_VU_SHIFT 8 /* DAC_VU */
399#define WM8400_DAC_VU_WIDTH 1 /* DAC_VU */
400#define WM8400_DACL_VOL_MASK 0x00FF /* DACL_VOL - [7:0] */
401#define WM8400_DACL_VOL_SHIFT 0 /* DACL_VOL - [7:0] */
402#define WM8400_DACL_VOL_WIDTH 8 /* DACL_VOL - [7:0] */
403
404/*
405 * R13 (0x0D) - Right DAC Digital Volume
406 */
407#define WM8400_DAC_VU 0x0100 /* DAC_VU */
408#define WM8400_DAC_VU_MASK 0x0100 /* DAC_VU */
409#define WM8400_DAC_VU_SHIFT 8 /* DAC_VU */
410#define WM8400_DAC_VU_WIDTH 1 /* DAC_VU */
411#define WM8400_DACR_VOL_MASK 0x00FF /* DACR_VOL - [7:0] */
412#define WM8400_DACR_VOL_SHIFT 0 /* DACR_VOL - [7:0] */
413#define WM8400_DACR_VOL_WIDTH 8 /* DACR_VOL - [7:0] */
414
415/*
416 * R14 (0x0E) - Digital Side Tone
417 */
418#define WM8400_ADCL_DAC_SVOL_MASK 0x1E00 /* ADCL_DAC_SVOL - [12:9] */
419#define WM8400_ADCL_DAC_SVOL_SHIFT 9 /* ADCL_DAC_SVOL - [12:9] */
420#define WM8400_ADCL_DAC_SVOL_WIDTH 4 /* ADCL_DAC_SVOL - [12:9] */
421#define WM8400_ADCR_DAC_SVOL_MASK 0x01E0 /* ADCR_DAC_SVOL - [8:5] */
422#define WM8400_ADCR_DAC_SVOL_SHIFT 5 /* ADCR_DAC_SVOL - [8:5] */
423#define WM8400_ADCR_DAC_SVOL_WIDTH 4 /* ADCR_DAC_SVOL - [8:5] */
424#define WM8400_ADC_TO_DACL_MASK 0x000C /* ADC_TO_DACL - [3:2] */
425#define WM8400_ADC_TO_DACL_SHIFT 2 /* ADC_TO_DACL - [3:2] */
426#define WM8400_ADC_TO_DACL_WIDTH 2 /* ADC_TO_DACL - [3:2] */
427#define WM8400_ADC_TO_DACR_MASK 0x0003 /* ADC_TO_DACR - [1:0] */
428#define WM8400_ADC_TO_DACR_SHIFT 0 /* ADC_TO_DACR - [1:0] */
429#define WM8400_ADC_TO_DACR_WIDTH 2 /* ADC_TO_DACR - [1:0] */
430
431/*
432 * R15 (0x0F) - ADC CTRL
433 */
434#define WM8400_ADC_HPF_ENA 0x0100 /* ADC_HPF_ENA */
435#define WM8400_ADC_HPF_ENA_MASK 0x0100 /* ADC_HPF_ENA */
436#define WM8400_ADC_HPF_ENA_SHIFT 8 /* ADC_HPF_ENA */
437#define WM8400_ADC_HPF_ENA_WIDTH 1 /* ADC_HPF_ENA */
438#define WM8400_ADC_HPF_CUT_MASK 0x0060 /* ADC_HPF_CUT - [6:5] */
439#define WM8400_ADC_HPF_CUT_SHIFT 5 /* ADC_HPF_CUT - [6:5] */
440#define WM8400_ADC_HPF_CUT_WIDTH 2 /* ADC_HPF_CUT - [6:5] */
441#define WM8400_ADCL_DATINV 0x0002 /* ADCL_DATINV */
442#define WM8400_ADCL_DATINV_MASK 0x0002 /* ADCL_DATINV */
443#define WM8400_ADCL_DATINV_SHIFT 1 /* ADCL_DATINV */
444#define WM8400_ADCL_DATINV_WIDTH 1 /* ADCL_DATINV */
445#define WM8400_ADCR_DATINV 0x0001 /* ADCR_DATINV */
446#define WM8400_ADCR_DATINV_MASK 0x0001 /* ADCR_DATINV */
447#define WM8400_ADCR_DATINV_SHIFT 0 /* ADCR_DATINV */
448#define WM8400_ADCR_DATINV_WIDTH 1 /* ADCR_DATINV */
449
450/*
451 * R16 (0x10) - Left ADC Digital Volume
452 */
453#define WM8400_ADC_VU 0x0100 /* ADC_VU */
454#define WM8400_ADC_VU_MASK 0x0100 /* ADC_VU */
455#define WM8400_ADC_VU_SHIFT 8 /* ADC_VU */
456#define WM8400_ADC_VU_WIDTH 1 /* ADC_VU */
457#define WM8400_ADCL_VOL_MASK 0x00FF /* ADCL_VOL - [7:0] */
458#define WM8400_ADCL_VOL_SHIFT 0 /* ADCL_VOL - [7:0] */
459#define WM8400_ADCL_VOL_WIDTH 8 /* ADCL_VOL - [7:0] */
460
461/*
462 * R17 (0x11) - Right ADC Digital Volume
463 */
464#define WM8400_ADC_VU 0x0100 /* ADC_VU */
465#define WM8400_ADC_VU_MASK 0x0100 /* ADC_VU */
466#define WM8400_ADC_VU_SHIFT 8 /* ADC_VU */
467#define WM8400_ADC_VU_WIDTH 1 /* ADC_VU */
468#define WM8400_ADCR_VOL_MASK 0x00FF /* ADCR_VOL - [7:0] */
469#define WM8400_ADCR_VOL_SHIFT 0 /* ADCR_VOL - [7:0] */
470#define WM8400_ADCR_VOL_WIDTH 8 /* ADCR_VOL - [7:0] */
471
472/*
473 * R24 (0x18) - Left Line Input 1&2 Volume
474 */
475#define WM8400_IPVU 0x0100 /* IPVU */
476#define WM8400_IPVU_MASK 0x0100 /* IPVU */
477#define WM8400_IPVU_SHIFT 8 /* IPVU */
478#define WM8400_IPVU_WIDTH 1 /* IPVU */
479#define WM8400_LI12MUTE 0x0080 /* LI12MUTE */
480#define WM8400_LI12MUTE_MASK 0x0080 /* LI12MUTE */
481#define WM8400_LI12MUTE_SHIFT 7 /* LI12MUTE */
482#define WM8400_LI12MUTE_WIDTH 1 /* LI12MUTE */
483#define WM8400_LI12ZC 0x0040 /* LI12ZC */
484#define WM8400_LI12ZC_MASK 0x0040 /* LI12ZC */
485#define WM8400_LI12ZC_SHIFT 6 /* LI12ZC */
486#define WM8400_LI12ZC_WIDTH 1 /* LI12ZC */
487#define WM8400_LIN12VOL_MASK 0x001F /* LIN12VOL - [4:0] */
488#define WM8400_LIN12VOL_SHIFT 0 /* LIN12VOL - [4:0] */
489#define WM8400_LIN12VOL_WIDTH 5 /* LIN12VOL - [4:0] */
490
491/*
492 * R25 (0x19) - Left Line Input 3&4 Volume
493 */
494#define WM8400_IPVU 0x0100 /* IPVU */
495#define WM8400_IPVU_MASK 0x0100 /* IPVU */
496#define WM8400_IPVU_SHIFT 8 /* IPVU */
497#define WM8400_IPVU_WIDTH 1 /* IPVU */
498#define WM8400_LI34MUTE 0x0080 /* LI34MUTE */
499#define WM8400_LI34MUTE_MASK 0x0080 /* LI34MUTE */
500#define WM8400_LI34MUTE_SHIFT 7 /* LI34MUTE */
501#define WM8400_LI34MUTE_WIDTH 1 /* LI34MUTE */
502#define WM8400_LI34ZC 0x0040 /* LI34ZC */
503#define WM8400_LI34ZC_MASK 0x0040 /* LI34ZC */
504#define WM8400_LI34ZC_SHIFT 6 /* LI34ZC */
505#define WM8400_LI34ZC_WIDTH 1 /* LI34ZC */
506#define WM8400_LIN34VOL_MASK 0x001F /* LIN34VOL - [4:0] */
507#define WM8400_LIN34VOL_SHIFT 0 /* LIN34VOL - [4:0] */
508#define WM8400_LIN34VOL_WIDTH 5 /* LIN34VOL - [4:0] */
509
510/*
511 * R26 (0x1A) - Right Line Input 1&2 Volume
512 */
513#define WM8400_IPVU 0x0100 /* IPVU */
514#define WM8400_IPVU_MASK 0x0100 /* IPVU */
515#define WM8400_IPVU_SHIFT 8 /* IPVU */
516#define WM8400_IPVU_WIDTH 1 /* IPVU */
517#define WM8400_RI12MUTE 0x0080 /* RI12MUTE */
518#define WM8400_RI12MUTE_MASK 0x0080 /* RI12MUTE */
519#define WM8400_RI12MUTE_SHIFT 7 /* RI12MUTE */
520#define WM8400_RI12MUTE_WIDTH 1 /* RI12MUTE */
521#define WM8400_RI12ZC 0x0040 /* RI12ZC */
522#define WM8400_RI12ZC_MASK 0x0040 /* RI12ZC */
523#define WM8400_RI12ZC_SHIFT 6 /* RI12ZC */
524#define WM8400_RI12ZC_WIDTH 1 /* RI12ZC */
525#define WM8400_RIN12VOL_MASK 0x001F /* RIN12VOL - [4:0] */
526#define WM8400_RIN12VOL_SHIFT 0 /* RIN12VOL - [4:0] */
527#define WM8400_RIN12VOL_WIDTH 5 /* RIN12VOL - [4:0] */
528
529/*
530 * R27 (0x1B) - Right Line Input 3&4 Volume
531 */
532#define WM8400_IPVU 0x0100 /* IPVU */
533#define WM8400_IPVU_MASK 0x0100 /* IPVU */
534#define WM8400_IPVU_SHIFT 8 /* IPVU */
535#define WM8400_IPVU_WIDTH 1 /* IPVU */
536#define WM8400_RI34MUTE 0x0080 /* RI34MUTE */
537#define WM8400_RI34MUTE_MASK 0x0080 /* RI34MUTE */
538#define WM8400_RI34MUTE_SHIFT 7 /* RI34MUTE */
539#define WM8400_RI34MUTE_WIDTH 1 /* RI34MUTE */
540#define WM8400_RI34ZC 0x0040 /* RI34ZC */
541#define WM8400_RI34ZC_MASK 0x0040 /* RI34ZC */
542#define WM8400_RI34ZC_SHIFT 6 /* RI34ZC */
543#define WM8400_RI34ZC_WIDTH 1 /* RI34ZC */
544#define WM8400_RIN34VOL_MASK 0x001F /* RIN34VOL - [4:0] */
545#define WM8400_RIN34VOL_SHIFT 0 /* RIN34VOL - [4:0] */
546#define WM8400_RIN34VOL_WIDTH 5 /* RIN34VOL - [4:0] */
547
548/*
549 * R28 (0x1C) - Left Output Volume
550 */
551#define WM8400_OPVU 0x0100 /* OPVU */
552#define WM8400_OPVU_MASK 0x0100 /* OPVU */
553#define WM8400_OPVU_SHIFT 8 /* OPVU */
554#define WM8400_OPVU_WIDTH 1 /* OPVU */
555#define WM8400_LOZC 0x0080 /* LOZC */
556#define WM8400_LOZC_MASK 0x0080 /* LOZC */
557#define WM8400_LOZC_SHIFT 7 /* LOZC */
558#define WM8400_LOZC_WIDTH 1 /* LOZC */
559#define WM8400_LOUTVOL_MASK 0x007F /* LOUTVOL - [6:0] */
560#define WM8400_LOUTVOL_SHIFT 0 /* LOUTVOL - [6:0] */
561#define WM8400_LOUTVOL_WIDTH 7 /* LOUTVOL - [6:0] */
562
563/*
564 * R29 (0x1D) - Right Output Volume
565 */
566#define WM8400_OPVU 0x0100 /* OPVU */
567#define WM8400_OPVU_MASK 0x0100 /* OPVU */
568#define WM8400_OPVU_SHIFT 8 /* OPVU */
569#define WM8400_OPVU_WIDTH 1 /* OPVU */
570#define WM8400_ROZC 0x0080 /* ROZC */
571#define WM8400_ROZC_MASK 0x0080 /* ROZC */
572#define WM8400_ROZC_SHIFT 7 /* ROZC */
573#define WM8400_ROZC_WIDTH 1 /* ROZC */
574#define WM8400_ROUTVOL_MASK 0x007F /* ROUTVOL - [6:0] */
575#define WM8400_ROUTVOL_SHIFT 0 /* ROUTVOL - [6:0] */
576#define WM8400_ROUTVOL_WIDTH 7 /* ROUTVOL - [6:0] */
577
578/*
579 * R30 (0x1E) - Line Outputs Volume
580 */
581#define WM8400_LONMUTE 0x0040 /* LONMUTE */
582#define WM8400_LONMUTE_MASK 0x0040 /* LONMUTE */
583#define WM8400_LONMUTE_SHIFT 6 /* LONMUTE */
584#define WM8400_LONMUTE_WIDTH 1 /* LONMUTE */
585#define WM8400_LOPMUTE 0x0020 /* LOPMUTE */
586#define WM8400_LOPMUTE_MASK 0x0020 /* LOPMUTE */
587#define WM8400_LOPMUTE_SHIFT 5 /* LOPMUTE */
588#define WM8400_LOPMUTE_WIDTH 1 /* LOPMUTE */
589#define WM8400_LOATTN 0x0010 /* LOATTN */
590#define WM8400_LOATTN_MASK 0x0010 /* LOATTN */
591#define WM8400_LOATTN_SHIFT 4 /* LOATTN */
592#define WM8400_LOATTN_WIDTH 1 /* LOATTN */
593#define WM8400_RONMUTE 0x0004 /* RONMUTE */
594#define WM8400_RONMUTE_MASK 0x0004 /* RONMUTE */
595#define WM8400_RONMUTE_SHIFT 2 /* RONMUTE */
596#define WM8400_RONMUTE_WIDTH 1 /* RONMUTE */
597#define WM8400_ROPMUTE 0x0002 /* ROPMUTE */
598#define WM8400_ROPMUTE_MASK 0x0002 /* ROPMUTE */
599#define WM8400_ROPMUTE_SHIFT 1 /* ROPMUTE */
600#define WM8400_ROPMUTE_WIDTH 1 /* ROPMUTE */
601#define WM8400_ROATTN 0x0001 /* ROATTN */
602#define WM8400_ROATTN_MASK 0x0001 /* ROATTN */
603#define WM8400_ROATTN_SHIFT 0 /* ROATTN */
604#define WM8400_ROATTN_WIDTH 1 /* ROATTN */
605
606/*
607 * R31 (0x1F) - Out3/4 Volume
608 */
609#define WM8400_OUT3MUTE 0x0020 /* OUT3MUTE */
610#define WM8400_OUT3MUTE_MASK 0x0020 /* OUT3MUTE */
611#define WM8400_OUT3MUTE_SHIFT 5 /* OUT3MUTE */
612#define WM8400_OUT3MUTE_WIDTH 1 /* OUT3MUTE */
613#define WM8400_OUT3ATTN 0x0010 /* OUT3ATTN */
614#define WM8400_OUT3ATTN_MASK 0x0010 /* OUT3ATTN */
615#define WM8400_OUT3ATTN_SHIFT 4 /* OUT3ATTN */
616#define WM8400_OUT3ATTN_WIDTH 1 /* OUT3ATTN */
617#define WM8400_OUT4MUTE 0x0002 /* OUT4MUTE */
618#define WM8400_OUT4MUTE_MASK 0x0002 /* OUT4MUTE */
619#define WM8400_OUT4MUTE_SHIFT 1 /* OUT4MUTE */
620#define WM8400_OUT4MUTE_WIDTH 1 /* OUT4MUTE */
621#define WM8400_OUT4ATTN 0x0001 /* OUT4ATTN */
622#define WM8400_OUT4ATTN_MASK 0x0001 /* OUT4ATTN */
623#define WM8400_OUT4ATTN_SHIFT 0 /* OUT4ATTN */
624#define WM8400_OUT4ATTN_WIDTH 1 /* OUT4ATTN */
625
626/*
627 * R32 (0x20) - Left OPGA Volume
628 */
629#define WM8400_OPVU 0x0100 /* OPVU */
630#define WM8400_OPVU_MASK 0x0100 /* OPVU */
631#define WM8400_OPVU_SHIFT 8 /* OPVU */
632#define WM8400_OPVU_WIDTH 1 /* OPVU */
633#define WM8400_LOPGAZC 0x0080 /* LOPGAZC */
634#define WM8400_LOPGAZC_MASK 0x0080 /* LOPGAZC */
635#define WM8400_LOPGAZC_SHIFT 7 /* LOPGAZC */
636#define WM8400_LOPGAZC_WIDTH 1 /* LOPGAZC */
637#define WM8400_LOPGAVOL_MASK 0x007F /* LOPGAVOL - [6:0] */
638#define WM8400_LOPGAVOL_SHIFT 0 /* LOPGAVOL - [6:0] */
639#define WM8400_LOPGAVOL_WIDTH 7 /* LOPGAVOL - [6:0] */
640
641/*
642 * R33 (0x21) - Right OPGA Volume
643 */
644#define WM8400_OPVU 0x0100 /* OPVU */
645#define WM8400_OPVU_MASK 0x0100 /* OPVU */
646#define WM8400_OPVU_SHIFT 8 /* OPVU */
647#define WM8400_OPVU_WIDTH 1 /* OPVU */
648#define WM8400_ROPGAZC 0x0080 /* ROPGAZC */
649#define WM8400_ROPGAZC_MASK 0x0080 /* ROPGAZC */
650#define WM8400_ROPGAZC_SHIFT 7 /* ROPGAZC */
651#define WM8400_ROPGAZC_WIDTH 1 /* ROPGAZC */
652#define WM8400_ROPGAVOL_MASK 0x007F /* ROPGAVOL - [6:0] */
653#define WM8400_ROPGAVOL_SHIFT 0 /* ROPGAVOL - [6:0] */
654#define WM8400_ROPGAVOL_WIDTH 7 /* ROPGAVOL - [6:0] */
655
656/*
657 * R34 (0x22) - Speaker Volume
658 */
659#define WM8400_SPKATTN_MASK 0x0003 /* SPKATTN - [1:0] */
660#define WM8400_SPKATTN_SHIFT 0 /* SPKATTN - [1:0] */
661#define WM8400_SPKATTN_WIDTH 2 /* SPKATTN - [1:0] */
662
663/*
664 * R35 (0x23) - ClassD1
665 */
666#define WM8400_CDMODE 0x0100 /* CDMODE */
667#define WM8400_CDMODE_MASK 0x0100 /* CDMODE */
668#define WM8400_CDMODE_SHIFT 8 /* CDMODE */
669#define WM8400_CDMODE_WIDTH 1 /* CDMODE */
670#define WM8400_CLASSD_CLK_SEL 0x0080 /* CLASSD_CLK_SEL */
671#define WM8400_CLASSD_CLK_SEL_MASK 0x0080 /* CLASSD_CLK_SEL */
672#define WM8400_CLASSD_CLK_SEL_SHIFT 7 /* CLASSD_CLK_SEL */
673#define WM8400_CLASSD_CLK_SEL_WIDTH 1 /* CLASSD_CLK_SEL */
674#define WM8400_CD_SRCTRL 0x0040 /* CD_SRCTRL */
675#define WM8400_CD_SRCTRL_MASK 0x0040 /* CD_SRCTRL */
676#define WM8400_CD_SRCTRL_SHIFT 6 /* CD_SRCTRL */
677#define WM8400_CD_SRCTRL_WIDTH 1 /* CD_SRCTRL */
678#define WM8400_SPKNOPOP 0x0020 /* SPKNOPOP */
679#define WM8400_SPKNOPOP_MASK 0x0020 /* SPKNOPOP */
680#define WM8400_SPKNOPOP_SHIFT 5 /* SPKNOPOP */
681#define WM8400_SPKNOPOP_WIDTH 1 /* SPKNOPOP */
682#define WM8400_DBLERATE 0x0010 /* DBLERATE */
683#define WM8400_DBLERATE_MASK 0x0010 /* DBLERATE */
684#define WM8400_DBLERATE_SHIFT 4 /* DBLERATE */
685#define WM8400_DBLERATE_WIDTH 1 /* DBLERATE */
686#define WM8400_LOOPTEST 0x0008 /* LOOPTEST */
687#define WM8400_LOOPTEST_MASK 0x0008 /* LOOPTEST */
688#define WM8400_LOOPTEST_SHIFT 3 /* LOOPTEST */
689#define WM8400_LOOPTEST_WIDTH 1 /* LOOPTEST */
690#define WM8400_HALFABBIAS 0x0004 /* HALFABBIAS */
691#define WM8400_HALFABBIAS_MASK 0x0004 /* HALFABBIAS */
692#define WM8400_HALFABBIAS_SHIFT 2 /* HALFABBIAS */
693#define WM8400_HALFABBIAS_WIDTH 1 /* HALFABBIAS */
694#define WM8400_TRIDEL_MASK 0x0003 /* TRIDEL - [1:0] */
695#define WM8400_TRIDEL_SHIFT 0 /* TRIDEL - [1:0] */
696#define WM8400_TRIDEL_WIDTH 2 /* TRIDEL - [1:0] */
697
698/*
699 * R37 (0x25) - ClassD3
700 */
701#define WM8400_DCGAIN_MASK 0x0038 /* DCGAIN - [5:3] */
702#define WM8400_DCGAIN_SHIFT 3 /* DCGAIN - [5:3] */
703#define WM8400_DCGAIN_WIDTH 3 /* DCGAIN - [5:3] */
704#define WM8400_ACGAIN_MASK 0x0007 /* ACGAIN - [2:0] */
705#define WM8400_ACGAIN_SHIFT 0 /* ACGAIN - [2:0] */
706#define WM8400_ACGAIN_WIDTH 3 /* ACGAIN - [2:0] */
707
708/*
709 * R39 (0x27) - Input Mixer1
710 */
711#define WM8400_AINLMODE_MASK 0x000C /* AINLMODE - [3:2] */
712#define WM8400_AINLMODE_SHIFT 2 /* AINLMODE - [3:2] */
713#define WM8400_AINLMODE_WIDTH 2 /* AINLMODE - [3:2] */
714#define WM8400_AINRMODE_MASK 0x0003 /* AINRMODE - [1:0] */
715#define WM8400_AINRMODE_SHIFT 0 /* AINRMODE - [1:0] */
716#define WM8400_AINRMODE_WIDTH 2 /* AINRMODE - [1:0] */
717
718/*
719 * R40 (0x28) - Input Mixer2
720 */
721#define WM8400_LMP4 0x0080 /* LMP4 */
722#define WM8400_LMP4_MASK 0x0080 /* LMP4 */
723#define WM8400_LMP4_SHIFT 7 /* LMP4 */
724#define WM8400_LMP4_WIDTH 1 /* LMP4 */
725#define WM8400_LMN3 0x0040 /* LMN3 */
726#define WM8400_LMN3_MASK 0x0040 /* LMN3 */
727#define WM8400_LMN3_SHIFT 6 /* LMN3 */
728#define WM8400_LMN3_WIDTH 1 /* LMN3 */
729#define WM8400_LMP2 0x0020 /* LMP2 */
730#define WM8400_LMP2_MASK 0x0020 /* LMP2 */
731#define WM8400_LMP2_SHIFT 5 /* LMP2 */
732#define WM8400_LMP2_WIDTH 1 /* LMP2 */
733#define WM8400_LMN1 0x0010 /* LMN1 */
734#define WM8400_LMN1_MASK 0x0010 /* LMN1 */
735#define WM8400_LMN1_SHIFT 4 /* LMN1 */
736#define WM8400_LMN1_WIDTH 1 /* LMN1 */
737#define WM8400_RMP4 0x0008 /* RMP4 */
738#define WM8400_RMP4_MASK 0x0008 /* RMP4 */
739#define WM8400_RMP4_SHIFT 3 /* RMP4 */
740#define WM8400_RMP4_WIDTH 1 /* RMP4 */
741#define WM8400_RMN3 0x0004 /* RMN3 */
742#define WM8400_RMN3_MASK 0x0004 /* RMN3 */
743#define WM8400_RMN3_SHIFT 2 /* RMN3 */
744#define WM8400_RMN3_WIDTH 1 /* RMN3 */
745#define WM8400_RMP2 0x0002 /* RMP2 */
746#define WM8400_RMP2_MASK 0x0002 /* RMP2 */
747#define WM8400_RMP2_SHIFT 1 /* RMP2 */
748#define WM8400_RMP2_WIDTH 1 /* RMP2 */
749#define WM8400_RMN1 0x0001 /* RMN1 */
750#define WM8400_RMN1_MASK 0x0001 /* RMN1 */
751#define WM8400_RMN1_SHIFT 0 /* RMN1 */
752#define WM8400_RMN1_WIDTH 1 /* RMN1 */
753
754/*
755 * R41 (0x29) - Input Mixer3
756 */
757#define WM8400_L34MNB 0x0100 /* L34MNB */
758#define WM8400_L34MNB_MASK 0x0100 /* L34MNB */
759#define WM8400_L34MNB_SHIFT 8 /* L34MNB */
760#define WM8400_L34MNB_WIDTH 1 /* L34MNB */
761#define WM8400_L34MNBST 0x0080 /* L34MNBST */
762#define WM8400_L34MNBST_MASK 0x0080 /* L34MNBST */
763#define WM8400_L34MNBST_SHIFT 7 /* L34MNBST */
764#define WM8400_L34MNBST_WIDTH 1 /* L34MNBST */
765#define WM8400_L12MNB 0x0020 /* L12MNB */
766#define WM8400_L12MNB_MASK 0x0020 /* L12MNB */
767#define WM8400_L12MNB_SHIFT 5 /* L12MNB */
768#define WM8400_L12MNB_WIDTH 1 /* L12MNB */
769#define WM8400_L12MNBST 0x0010 /* L12MNBST */
770#define WM8400_L12MNBST_MASK 0x0010 /* L12MNBST */
771#define WM8400_L12MNBST_SHIFT 4 /* L12MNBST */
772#define WM8400_L12MNBST_WIDTH 1 /* L12MNBST */
773#define WM8400_LDBVOL_MASK 0x0007 /* LDBVOL - [2:0] */
774#define WM8400_LDBVOL_SHIFT 0 /* LDBVOL - [2:0] */
775#define WM8400_LDBVOL_WIDTH 3 /* LDBVOL - [2:0] */
776
777/*
778 * R42 (0x2A) - Input Mixer4
779 */
780#define WM8400_R34MNB 0x0100 /* R34MNB */
781#define WM8400_R34MNB_MASK 0x0100 /* R34MNB */
782#define WM8400_R34MNB_SHIFT 8 /* R34MNB */
783#define WM8400_R34MNB_WIDTH 1 /* R34MNB */
784#define WM8400_R34MNBST 0x0080 /* R34MNBST */
785#define WM8400_R34MNBST_MASK 0x0080 /* R34MNBST */
786#define WM8400_R34MNBST_SHIFT 7 /* R34MNBST */
787#define WM8400_R34MNBST_WIDTH 1 /* R34MNBST */
788#define WM8400_R12MNB 0x0020 /* R12MNB */
789#define WM8400_R12MNB_MASK 0x0020 /* R12MNB */
790#define WM8400_R12MNB_SHIFT 5 /* R12MNB */
791#define WM8400_R12MNB_WIDTH 1 /* R12MNB */
792#define WM8400_R12MNBST 0x0010 /* R12MNBST */
793#define WM8400_R12MNBST_MASK 0x0010 /* R12MNBST */
794#define WM8400_R12MNBST_SHIFT 4 /* R12MNBST */
795#define WM8400_R12MNBST_WIDTH 1 /* R12MNBST */
796#define WM8400_RDBVOL_MASK 0x0007 /* RDBVOL - [2:0] */
797#define WM8400_RDBVOL_SHIFT 0 /* RDBVOL - [2:0] */
798#define WM8400_RDBVOL_WIDTH 3 /* RDBVOL - [2:0] */
799
800/*
801 * R43 (0x2B) - Input Mixer5
802 */
803#define WM8400_LI2BVOL_MASK 0x01C0 /* LI2BVOL - [8:6] */
804#define WM8400_LI2BVOL_SHIFT 6 /* LI2BVOL - [8:6] */
805#define WM8400_LI2BVOL_WIDTH 3 /* LI2BVOL - [8:6] */
806#define WM8400_LR4BVOL_MASK 0x0038 /* LR4BVOL - [5:3] */
807#define WM8400_LR4BVOL_SHIFT 3 /* LR4BVOL - [5:3] */
808#define WM8400_LR4BVOL_WIDTH 3 /* LR4BVOL - [5:3] */
809#define WM8400_LL4BVOL_MASK 0x0007 /* LL4BVOL - [2:0] */
810#define WM8400_LL4BVOL_SHIFT 0 /* LL4BVOL - [2:0] */
811#define WM8400_LL4BVOL_WIDTH 3 /* LL4BVOL - [2:0] */
812
813/*
814 * R44 (0x2C) - Input Mixer6
815 */
816#define WM8400_RI2BVOL_MASK 0x01C0 /* RI2BVOL - [8:6] */
817#define WM8400_RI2BVOL_SHIFT 6 /* RI2BVOL - [8:6] */
818#define WM8400_RI2BVOL_WIDTH 3 /* RI2BVOL - [8:6] */
819#define WM8400_RL4BVOL_MASK 0x0038 /* RL4BVOL - [5:3] */
820#define WM8400_RL4BVOL_SHIFT 3 /* RL4BVOL - [5:3] */
821#define WM8400_RL4BVOL_WIDTH 3 /* RL4BVOL - [5:3] */
822#define WM8400_RR4BVOL_MASK 0x0007 /* RR4BVOL - [2:0] */
823#define WM8400_RR4BVOL_SHIFT 0 /* RR4BVOL - [2:0] */
824#define WM8400_RR4BVOL_WIDTH 3 /* RR4BVOL - [2:0] */
825
826/*
827 * R45 (0x2D) - Output Mixer1
828 */
829#define WM8400_LRBLO 0x0080 /* LRBLO */
830#define WM8400_LRBLO_MASK 0x0080 /* LRBLO */
831#define WM8400_LRBLO_SHIFT 7 /* LRBLO */
832#define WM8400_LRBLO_WIDTH 1 /* LRBLO */
833#define WM8400_LLBLO 0x0040 /* LLBLO */
834#define WM8400_LLBLO_MASK 0x0040 /* LLBLO */
835#define WM8400_LLBLO_SHIFT 6 /* LLBLO */
836#define WM8400_LLBLO_WIDTH 1 /* LLBLO */
837#define WM8400_LRI3LO 0x0020 /* LRI3LO */
838#define WM8400_LRI3LO_MASK 0x0020 /* LRI3LO */
839#define WM8400_LRI3LO_SHIFT 5 /* LRI3LO */
840#define WM8400_LRI3LO_WIDTH 1 /* LRI3LO */
841#define WM8400_LLI3LO 0x0010 /* LLI3LO */
842#define WM8400_LLI3LO_MASK 0x0010 /* LLI3LO */
843#define WM8400_LLI3LO_SHIFT 4 /* LLI3LO */
844#define WM8400_LLI3LO_WIDTH 1 /* LLI3LO */
845#define WM8400_LR12LO 0x0008 /* LR12LO */
846#define WM8400_LR12LO_MASK 0x0008 /* LR12LO */
847#define WM8400_LR12LO_SHIFT 3 /* LR12LO */
848#define WM8400_LR12LO_WIDTH 1 /* LR12LO */
849#define WM8400_LL12LO 0x0004 /* LL12LO */
850#define WM8400_LL12LO_MASK 0x0004 /* LL12LO */
851#define WM8400_LL12LO_SHIFT 2 /* LL12LO */
852#define WM8400_LL12LO_WIDTH 1 /* LL12LO */
853#define WM8400_LDLO 0x0001 /* LDLO */
854#define WM8400_LDLO_MASK 0x0001 /* LDLO */
855#define WM8400_LDLO_SHIFT 0 /* LDLO */
856#define WM8400_LDLO_WIDTH 1 /* LDLO */
857
858/*
859 * R46 (0x2E) - Output Mixer2
860 */
861#define WM8400_RLBRO 0x0080 /* RLBRO */
862#define WM8400_RLBRO_MASK 0x0080 /* RLBRO */
863#define WM8400_RLBRO_SHIFT 7 /* RLBRO */
864#define WM8400_RLBRO_WIDTH 1 /* RLBRO */
865#define WM8400_RRBRO 0x0040 /* RRBRO */
866#define WM8400_RRBRO_MASK 0x0040 /* RRBRO */
867#define WM8400_RRBRO_SHIFT 6 /* RRBRO */
868#define WM8400_RRBRO_WIDTH 1 /* RRBRO */
869#define WM8400_RLI3RO 0x0020 /* RLI3RO */
870#define WM8400_RLI3RO_MASK 0x0020 /* RLI3RO */
871#define WM8400_RLI3RO_SHIFT 5 /* RLI3RO */
872#define WM8400_RLI3RO_WIDTH 1 /* RLI3RO */
873#define WM8400_RRI3RO 0x0010 /* RRI3RO */
874#define WM8400_RRI3RO_MASK 0x0010 /* RRI3RO */
875#define WM8400_RRI3RO_SHIFT 4 /* RRI3RO */
876#define WM8400_RRI3RO_WIDTH 1 /* RRI3RO */
877#define WM8400_RL12RO 0x0008 /* RL12RO */
878#define WM8400_RL12RO_MASK 0x0008 /* RL12RO */
879#define WM8400_RL12RO_SHIFT 3 /* RL12RO */
880#define WM8400_RL12RO_WIDTH 1 /* RL12RO */
881#define WM8400_RR12RO 0x0004 /* RR12RO */
882#define WM8400_RR12RO_MASK 0x0004 /* RR12RO */
883#define WM8400_RR12RO_SHIFT 2 /* RR12RO */
884#define WM8400_RR12RO_WIDTH 1 /* RR12RO */
885#define WM8400_RDRO 0x0001 /* RDRO */
886#define WM8400_RDRO_MASK 0x0001 /* RDRO */
887#define WM8400_RDRO_SHIFT 0 /* RDRO */
888#define WM8400_RDRO_WIDTH 1 /* RDRO */
889
890/*
891 * R47 (0x2F) - Output Mixer3
892 */
893#define WM8400_LLI3LOVOL_MASK 0x01C0 /* LLI3LOVOL - [8:6] */
894#define WM8400_LLI3LOVOL_SHIFT 6 /* LLI3LOVOL - [8:6] */
895#define WM8400_LLI3LOVOL_WIDTH 3 /* LLI3LOVOL - [8:6] */
896#define WM8400_LR12LOVOL_MASK 0x0038 /* LR12LOVOL - [5:3] */
897#define WM8400_LR12LOVOL_SHIFT 3 /* LR12LOVOL - [5:3] */
898#define WM8400_LR12LOVOL_WIDTH 3 /* LR12LOVOL - [5:3] */
899#define WM8400_LL12LOVOL_MASK 0x0007 /* LL12LOVOL - [2:0] */
900#define WM8400_LL12LOVOL_SHIFT 0 /* LL12LOVOL - [2:0] */
901#define WM8400_LL12LOVOL_WIDTH 3 /* LL12LOVOL - [2:0] */
902
903/*
904 * R48 (0x30) - Output Mixer4
905 */
906#define WM8400_RRI3ROVOL_MASK 0x01C0 /* RRI3ROVOL - [8:6] */
907#define WM8400_RRI3ROVOL_SHIFT 6 /* RRI3ROVOL - [8:6] */
908#define WM8400_RRI3ROVOL_WIDTH 3 /* RRI3ROVOL - [8:6] */
909#define WM8400_RL12ROVOL_MASK 0x0038 /* RL12ROVOL - [5:3] */
910#define WM8400_RL12ROVOL_SHIFT 3 /* RL12ROVOL - [5:3] */
911#define WM8400_RL12ROVOL_WIDTH 3 /* RL12ROVOL - [5:3] */
912#define WM8400_RR12ROVOL_MASK 0x0007 /* RR12ROVOL - [2:0] */
913#define WM8400_RR12ROVOL_SHIFT 0 /* RR12ROVOL - [2:0] */
914#define WM8400_RR12ROVOL_WIDTH 3 /* RR12ROVOL - [2:0] */
915
916/*
917 * R49 (0x31) - Output Mixer5
918 */
919#define WM8400_LRI3LOVOL_MASK 0x01C0 /* LRI3LOVOL - [8:6] */
920#define WM8400_LRI3LOVOL_SHIFT 6 /* LRI3LOVOL - [8:6] */
921#define WM8400_LRI3LOVOL_WIDTH 3 /* LRI3LOVOL - [8:6] */
922#define WM8400_LRBLOVOL_MASK 0x0038 /* LRBLOVOL - [5:3] */
923#define WM8400_LRBLOVOL_SHIFT 3 /* LRBLOVOL - [5:3] */
924#define WM8400_LRBLOVOL_WIDTH 3 /* LRBLOVOL - [5:3] */
925#define WM8400_LLBLOVOL_MASK 0x0007 /* LLBLOVOL - [2:0] */
926#define WM8400_LLBLOVOL_SHIFT 0 /* LLBLOVOL - [2:0] */
927#define WM8400_LLBLOVOL_WIDTH 3 /* LLBLOVOL - [2:0] */
928
929/*
930 * R50 (0x32) - Output Mixer6
931 */
932#define WM8400_RLI3ROVOL_MASK 0x01C0 /* RLI3ROVOL - [8:6] */
933#define WM8400_RLI3ROVOL_SHIFT 6 /* RLI3ROVOL - [8:6] */
934#define WM8400_RLI3ROVOL_WIDTH 3 /* RLI3ROVOL - [8:6] */
935#define WM8400_RLBROVOL_MASK 0x0038 /* RLBROVOL - [5:3] */
936#define WM8400_RLBROVOL_SHIFT 3 /* RLBROVOL - [5:3] */
937#define WM8400_RLBROVOL_WIDTH 3 /* RLBROVOL - [5:3] */
938#define WM8400_RRBROVOL_MASK 0x0007 /* RRBROVOL - [2:0] */
939#define WM8400_RRBROVOL_SHIFT 0 /* RRBROVOL - [2:0] */
940#define WM8400_RRBROVOL_WIDTH 3 /* RRBROVOL - [2:0] */
941
942/*
943 * R51 (0x33) - Out3/4 Mixer
944 */
945#define WM8400_VSEL_MASK 0x0180 /* VSEL - [8:7] */
946#define WM8400_VSEL_SHIFT 7 /* VSEL - [8:7] */
947#define WM8400_VSEL_WIDTH 2 /* VSEL - [8:7] */
948#define WM8400_LI4O3 0x0020 /* LI4O3 */
949#define WM8400_LI4O3_MASK 0x0020 /* LI4O3 */
950#define WM8400_LI4O3_SHIFT 5 /* LI4O3 */
951#define WM8400_LI4O3_WIDTH 1 /* LI4O3 */
952#define WM8400_LPGAO3 0x0010 /* LPGAO3 */
953#define WM8400_LPGAO3_MASK 0x0010 /* LPGAO3 */
954#define WM8400_LPGAO3_SHIFT 4 /* LPGAO3 */
955#define WM8400_LPGAO3_WIDTH 1 /* LPGAO3 */
956#define WM8400_RI4O4 0x0002 /* RI4O4 */
957#define WM8400_RI4O4_MASK 0x0002 /* RI4O4 */
958#define WM8400_RI4O4_SHIFT 1 /* RI4O4 */
959#define WM8400_RI4O4_WIDTH 1 /* RI4O4 */
960#define WM8400_RPGAO4 0x0001 /* RPGAO4 */
961#define WM8400_RPGAO4_MASK 0x0001 /* RPGAO4 */
962#define WM8400_RPGAO4_SHIFT 0 /* RPGAO4 */
963#define WM8400_RPGAO4_WIDTH 1 /* RPGAO4 */
964
965/*
966 * R52 (0x34) - Line Mixer1
967 */
968#define WM8400_LLOPGALON 0x0040 /* LLOPGALON */
969#define WM8400_LLOPGALON_MASK 0x0040 /* LLOPGALON */
970#define WM8400_LLOPGALON_SHIFT 6 /* LLOPGALON */
971#define WM8400_LLOPGALON_WIDTH 1 /* LLOPGALON */
972#define WM8400_LROPGALON 0x0020 /* LROPGALON */
973#define WM8400_LROPGALON_MASK 0x0020 /* LROPGALON */
974#define WM8400_LROPGALON_SHIFT 5 /* LROPGALON */
975#define WM8400_LROPGALON_WIDTH 1 /* LROPGALON */
976#define WM8400_LOPLON 0x0010 /* LOPLON */
977#define WM8400_LOPLON_MASK 0x0010 /* LOPLON */
978#define WM8400_LOPLON_SHIFT 4 /* LOPLON */
979#define WM8400_LOPLON_WIDTH 1 /* LOPLON */
980#define WM8400_LR12LOP 0x0004 /* LR12LOP */
981#define WM8400_LR12LOP_MASK 0x0004 /* LR12LOP */
982#define WM8400_LR12LOP_SHIFT 2 /* LR12LOP */
983#define WM8400_LR12LOP_WIDTH 1 /* LR12LOP */
984#define WM8400_LL12LOP 0x0002 /* LL12LOP */
985#define WM8400_LL12LOP_MASK 0x0002 /* LL12LOP */
986#define WM8400_LL12LOP_SHIFT 1 /* LL12LOP */
987#define WM8400_LL12LOP_WIDTH 1 /* LL12LOP */
988#define WM8400_LLOPGALOP 0x0001 /* LLOPGALOP */
989#define WM8400_LLOPGALOP_MASK 0x0001 /* LLOPGALOP */
990#define WM8400_LLOPGALOP_SHIFT 0 /* LLOPGALOP */
991#define WM8400_LLOPGALOP_WIDTH 1 /* LLOPGALOP */
992
993/*
994 * R53 (0x35) - Line Mixer2
995 */
996#define WM8400_RROPGARON 0x0040 /* RROPGARON */
997#define WM8400_RROPGARON_MASK 0x0040 /* RROPGARON */
998#define WM8400_RROPGARON_SHIFT 6 /* RROPGARON */
999#define WM8400_RROPGARON_WIDTH 1 /* RROPGARON */
1000#define WM8400_RLOPGARON 0x0020 /* RLOPGARON */
1001#define WM8400_RLOPGARON_MASK 0x0020 /* RLOPGARON */
1002#define WM8400_RLOPGARON_SHIFT 5 /* RLOPGARON */
1003#define WM8400_RLOPGARON_WIDTH 1 /* RLOPGARON */
1004#define WM8400_ROPRON 0x0010 /* ROPRON */
1005#define WM8400_ROPRON_MASK 0x0010 /* ROPRON */
1006#define WM8400_ROPRON_SHIFT 4 /* ROPRON */
1007#define WM8400_ROPRON_WIDTH 1 /* ROPRON */
1008#define WM8400_RL12ROP 0x0004 /* RL12ROP */
1009#define WM8400_RL12ROP_MASK 0x0004 /* RL12ROP */
1010#define WM8400_RL12ROP_SHIFT 2 /* RL12ROP */
1011#define WM8400_RL12ROP_WIDTH 1 /* RL12ROP */
1012#define WM8400_RR12ROP 0x0002 /* RR12ROP */
1013#define WM8400_RR12ROP_MASK 0x0002 /* RR12ROP */
1014#define WM8400_RR12ROP_SHIFT 1 /* RR12ROP */
1015#define WM8400_RR12ROP_WIDTH 1 /* RR12ROP */
1016#define WM8400_RROPGAROP 0x0001 /* RROPGAROP */
1017#define WM8400_RROPGAROP_MASK 0x0001 /* RROPGAROP */
1018#define WM8400_RROPGAROP_SHIFT 0 /* RROPGAROP */
1019#define WM8400_RROPGAROP_WIDTH 1 /* RROPGAROP */
1020
1021/*
1022 * R54 (0x36) - Speaker Mixer
1023 */
1024#define WM8400_LB2SPK 0x0080 /* LB2SPK */
1025#define WM8400_LB2SPK_MASK 0x0080 /* LB2SPK */
1026#define WM8400_LB2SPK_SHIFT 7 /* LB2SPK */
1027#define WM8400_LB2SPK_WIDTH 1 /* LB2SPK */
1028#define WM8400_RB2SPK 0x0040 /* RB2SPK */
1029#define WM8400_RB2SPK_MASK 0x0040 /* RB2SPK */
1030#define WM8400_RB2SPK_SHIFT 6 /* RB2SPK */
1031#define WM8400_RB2SPK_WIDTH 1 /* RB2SPK */
1032#define WM8400_LI2SPK 0x0020 /* LI2SPK */
1033#define WM8400_LI2SPK_MASK 0x0020 /* LI2SPK */
1034#define WM8400_LI2SPK_SHIFT 5 /* LI2SPK */
1035#define WM8400_LI2SPK_WIDTH 1 /* LI2SPK */
1036#define WM8400_RI2SPK 0x0010 /* RI2SPK */
1037#define WM8400_RI2SPK_MASK 0x0010 /* RI2SPK */
1038#define WM8400_RI2SPK_SHIFT 4 /* RI2SPK */
1039#define WM8400_RI2SPK_WIDTH 1 /* RI2SPK */
1040#define WM8400_LOPGASPK 0x0008 /* LOPGASPK */
1041#define WM8400_LOPGASPK_MASK 0x0008 /* LOPGASPK */
1042#define WM8400_LOPGASPK_SHIFT 3 /* LOPGASPK */
1043#define WM8400_LOPGASPK_WIDTH 1 /* LOPGASPK */
1044#define WM8400_ROPGASPK 0x0004 /* ROPGASPK */
1045#define WM8400_ROPGASPK_MASK 0x0004 /* ROPGASPK */
1046#define WM8400_ROPGASPK_SHIFT 2 /* ROPGASPK */
1047#define WM8400_ROPGASPK_WIDTH 1 /* ROPGASPK */
1048#define WM8400_LDSPK 0x0002 /* LDSPK */
1049#define WM8400_LDSPK_MASK 0x0002 /* LDSPK */
1050#define WM8400_LDSPK_SHIFT 1 /* LDSPK */
1051#define WM8400_LDSPK_WIDTH 1 /* LDSPK */
1052#define WM8400_RDSPK 0x0001 /* RDSPK */
1053#define WM8400_RDSPK_MASK 0x0001 /* RDSPK */
1054#define WM8400_RDSPK_SHIFT 0 /* RDSPK */
1055#define WM8400_RDSPK_WIDTH 1 /* RDSPK */
1056
1057/*
1058 * R55 (0x37) - Additional Control
1059 */
1060#define WM8400_VROI 0x0001 /* VROI */
1061#define WM8400_VROI_MASK 0x0001 /* VROI */
1062#define WM8400_VROI_SHIFT 0 /* VROI */
1063#define WM8400_VROI_WIDTH 1 /* VROI */
1064
1065/*
1066 * R56 (0x38) - AntiPOP1
1067 */
1068#define WM8400_DIS_LLINE 0x0020 /* DIS_LLINE */
1069#define WM8400_DIS_LLINE_MASK 0x0020 /* DIS_LLINE */
1070#define WM8400_DIS_LLINE_SHIFT 5 /* DIS_LLINE */
1071#define WM8400_DIS_LLINE_WIDTH 1 /* DIS_LLINE */
1072#define WM8400_DIS_RLINE 0x0010 /* DIS_RLINE */
1073#define WM8400_DIS_RLINE_MASK 0x0010 /* DIS_RLINE */
1074#define WM8400_DIS_RLINE_SHIFT 4 /* DIS_RLINE */
1075#define WM8400_DIS_RLINE_WIDTH 1 /* DIS_RLINE */
1076#define WM8400_DIS_OUT3 0x0008 /* DIS_OUT3 */
1077#define WM8400_DIS_OUT3_MASK 0x0008 /* DIS_OUT3 */
1078#define WM8400_DIS_OUT3_SHIFT 3 /* DIS_OUT3 */
1079#define WM8400_DIS_OUT3_WIDTH 1 /* DIS_OUT3 */
1080#define WM8400_DIS_OUT4 0x0004 /* DIS_OUT4 */
1081#define WM8400_DIS_OUT4_MASK 0x0004 /* DIS_OUT4 */
1082#define WM8400_DIS_OUT4_SHIFT 2 /* DIS_OUT4 */
1083#define WM8400_DIS_OUT4_WIDTH 1 /* DIS_OUT4 */
1084#define WM8400_DIS_LOUT 0x0002 /* DIS_LOUT */
1085#define WM8400_DIS_LOUT_MASK 0x0002 /* DIS_LOUT */
1086#define WM8400_DIS_LOUT_SHIFT 1 /* DIS_LOUT */
1087#define WM8400_DIS_LOUT_WIDTH 1 /* DIS_LOUT */
1088#define WM8400_DIS_ROUT 0x0001 /* DIS_ROUT */
1089#define WM8400_DIS_ROUT_MASK 0x0001 /* DIS_ROUT */
1090#define WM8400_DIS_ROUT_SHIFT 0 /* DIS_ROUT */
1091#define WM8400_DIS_ROUT_WIDTH 1 /* DIS_ROUT */
1092
1093/*
1094 * R57 (0x39) - AntiPOP2
1095 */
1096#define WM8400_SOFTST 0x0040 /* SOFTST */
1097#define WM8400_SOFTST_MASK 0x0040 /* SOFTST */
1098#define WM8400_SOFTST_SHIFT 6 /* SOFTST */
1099#define WM8400_SOFTST_WIDTH 1 /* SOFTST */
1100#define WM8400_BUFIOEN 0x0008 /* BUFIOEN */
1101#define WM8400_BUFIOEN_MASK 0x0008 /* BUFIOEN */
1102#define WM8400_BUFIOEN_SHIFT 3 /* BUFIOEN */
1103#define WM8400_BUFIOEN_WIDTH 1 /* BUFIOEN */
1104#define WM8400_BUFDCOPEN 0x0004 /* BUFDCOPEN */
1105#define WM8400_BUFDCOPEN_MASK 0x0004 /* BUFDCOPEN */
1106#define WM8400_BUFDCOPEN_SHIFT 2 /* BUFDCOPEN */
1107#define WM8400_BUFDCOPEN_WIDTH 1 /* BUFDCOPEN */
1108#define WM8400_POBCTRL 0x0002 /* POBCTRL */
1109#define WM8400_POBCTRL_MASK 0x0002 /* POBCTRL */
1110#define WM8400_POBCTRL_SHIFT 1 /* POBCTRL */
1111#define WM8400_POBCTRL_WIDTH 1 /* POBCTRL */
1112#define WM8400_VMIDTOG 0x0001 /* VMIDTOG */
1113#define WM8400_VMIDTOG_MASK 0x0001 /* VMIDTOG */
1114#define WM8400_VMIDTOG_SHIFT 0 /* VMIDTOG */
1115#define WM8400_VMIDTOG_WIDTH 1 /* VMIDTOG */
1116
1117/*
1118 * R58 (0x3A) - MICBIAS
1119 */
1120#define WM8400_MCDSCTH_MASK 0x00C0 /* MCDSCTH - [7:6] */
1121#define WM8400_MCDSCTH_SHIFT 6 /* MCDSCTH - [7:6] */
1122#define WM8400_MCDSCTH_WIDTH 2 /* MCDSCTH - [7:6] */
1123#define WM8400_MCDTHR_MASK 0x0038 /* MCDTHR - [5:3] */
1124#define WM8400_MCDTHR_SHIFT 3 /* MCDTHR - [5:3] */
1125#define WM8400_MCDTHR_WIDTH 3 /* MCDTHR - [5:3] */
1126#define WM8400_MCD 0x0004 /* MCD */
1127#define WM8400_MCD_MASK 0x0004 /* MCD */
1128#define WM8400_MCD_SHIFT 2 /* MCD */
1129#define WM8400_MCD_WIDTH 1 /* MCD */
1130#define WM8400_MBSEL 0x0001 /* MBSEL */
1131#define WM8400_MBSEL_MASK 0x0001 /* MBSEL */
1132#define WM8400_MBSEL_SHIFT 0 /* MBSEL */
1133#define WM8400_MBSEL_WIDTH 1 /* MBSEL */
1134
1135/*
1136 * R60 (0x3C) - FLL Control 1
1137 */
1138#define WM8400_FLL_REF_FREQ 0x1000 /* FLL_REF_FREQ */
1139#define WM8400_FLL_REF_FREQ_MASK 0x1000 /* FLL_REF_FREQ */
1140#define WM8400_FLL_REF_FREQ_SHIFT 12 /* FLL_REF_FREQ */
1141#define WM8400_FLL_REF_FREQ_WIDTH 1 /* FLL_REF_FREQ */
1142#define WM8400_FLL_CLK_SRC_MASK 0x0C00 /* FLL_CLK_SRC - [11:10] */
1143#define WM8400_FLL_CLK_SRC_SHIFT 10 /* FLL_CLK_SRC - [11:10] */
1144#define WM8400_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [11:10] */
1145#define WM8400_FLL_FRAC 0x0200 /* FLL_FRAC */
1146#define WM8400_FLL_FRAC_MASK 0x0200 /* FLL_FRAC */
1147#define WM8400_FLL_FRAC_SHIFT 9 /* FLL_FRAC */
1148#define WM8400_FLL_FRAC_WIDTH 1 /* FLL_FRAC */
1149#define WM8400_FLL_OSC_ENA 0x0100 /* FLL_OSC_ENA */
1150#define WM8400_FLL_OSC_ENA_MASK 0x0100 /* FLL_OSC_ENA */
1151#define WM8400_FLL_OSC_ENA_SHIFT 8 /* FLL_OSC_ENA */
1152#define WM8400_FLL_OSC_ENA_WIDTH 1 /* FLL_OSC_ENA */
1153#define WM8400_FLL_CTRL_RATE_MASK 0x00E0 /* FLL_CTRL_RATE - [7:5] */
1154#define WM8400_FLL_CTRL_RATE_SHIFT 5 /* FLL_CTRL_RATE - [7:5] */
1155#define WM8400_FLL_CTRL_RATE_WIDTH 3 /* FLL_CTRL_RATE - [7:5] */
1156#define WM8400_FLL_FRATIO_MASK 0x001F /* FLL_FRATIO - [4:0] */
1157#define WM8400_FLL_FRATIO_SHIFT 0 /* FLL_FRATIO - [4:0] */
1158#define WM8400_FLL_FRATIO_WIDTH 5 /* FLL_FRATIO - [4:0] */
1159
1160/*
1161 * R61 (0x3D) - FLL Control 2
1162 */
1163#define WM8400_FLL_K_MASK 0xFFFF /* FLL_K - [15:0] */
1164#define WM8400_FLL_K_SHIFT 0 /* FLL_K - [15:0] */
1165#define WM8400_FLL_K_WIDTH 16 /* FLL_K - [15:0] */
1166
1167/*
1168 * R62 (0x3E) - FLL Control 3
1169 */
1170#define WM8400_FLL_N_MASK 0x03FF /* FLL_N - [9:0] */
1171#define WM8400_FLL_N_SHIFT 0 /* FLL_N - [9:0] */
1172#define WM8400_FLL_N_WIDTH 10 /* FLL_N - [9:0] */
1173
1174/*
1175 * R63 (0x3F) - FLL Control 4
1176 */
1177#define WM8400_FLL_TRK_GAIN_MASK 0x0078 /* FLL_TRK_GAIN - [6:3] */
1178#define WM8400_FLL_TRK_GAIN_SHIFT 3 /* FLL_TRK_GAIN - [6:3] */
1179#define WM8400_FLL_TRK_GAIN_WIDTH 4 /* FLL_TRK_GAIN - [6:3] */
1180#define WM8400_FLL_OUTDIV_MASK 0x0007 /* FLL_OUTDIV - [2:0] */
1181#define WM8400_FLL_OUTDIV_SHIFT 0 /* FLL_OUTDIV - [2:0] */
1182#define WM8400_FLL_OUTDIV_WIDTH 3 /* FLL_OUTDIV - [2:0] */
1183
1184void wm8400_reset_codec_reg_cache(struct wm8400 *wm8400);
1185
1186#endif
diff --git a/include/linux/mfd/wm8400-private.h b/include/linux/mfd/wm8400-private.h
new file mode 100644
index 000000000000..2aab4e93a5c9
--- /dev/null
+++ b/include/linux/mfd/wm8400-private.h
@@ -0,0 +1,936 @@
1/*
2 * wm8400 private definitions.
3 *
4 * Copyright 2008 Wolfson Microelectronics plc
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef __LINUX_MFD_WM8400_PRIV_H
22#define __LINUX_MFD_WM8400_PRIV_H
23
24#include <linux/mfd/wm8400.h>
25#include <linux/mutex.h>
26#include <linux/platform_device.h>
27
28#define WM8400_REGISTER_COUNT 0x55
29
30struct wm8400 {
31 struct device *dev;
32
33 int (*read_dev)(void *data, char reg, int count, u16 *dst);
34 int (*write_dev)(void *data, char reg, int count, const u16 *src);
35
36 struct mutex io_lock;
37 void *io_data;
38
39 u16 reg_cache[WM8400_REGISTER_COUNT];
40
41 struct platform_device regulators[6];
42};
43
44/*
45 * Register values.
46 */
47#define WM8400_RESET_ID 0x00
48#define WM8400_ID 0x01
49#define WM8400_POWER_MANAGEMENT_1 0x02
50#define WM8400_POWER_MANAGEMENT_2 0x03
51#define WM8400_POWER_MANAGEMENT_3 0x04
52#define WM8400_AUDIO_INTERFACE_1 0x05
53#define WM8400_AUDIO_INTERFACE_2 0x06
54#define WM8400_CLOCKING_1 0x07
55#define WM8400_CLOCKING_2 0x08
56#define WM8400_AUDIO_INTERFACE_3 0x09
57#define WM8400_AUDIO_INTERFACE_4 0x0A
58#define WM8400_DAC_CTRL 0x0B
59#define WM8400_LEFT_DAC_DIGITAL_VOLUME 0x0C
60#define WM8400_RIGHT_DAC_DIGITAL_VOLUME 0x0D
61#define WM8400_DIGITAL_SIDE_TONE 0x0E
62#define WM8400_ADC_CTRL 0x0F
63#define WM8400_LEFT_ADC_DIGITAL_VOLUME 0x10
64#define WM8400_RIGHT_ADC_DIGITAL_VOLUME 0x11
65#define WM8400_GPIO_CTRL_1 0x12
66#define WM8400_GPIO1_GPIO2 0x13
67#define WM8400_GPIO3_GPIO4 0x14
68#define WM8400_GPIO5_GPIO6 0x15
69#define WM8400_GPIOCTRL_2 0x16
70#define WM8400_GPIO_POL 0x17
71#define WM8400_LEFT_LINE_INPUT_1_2_VOLUME 0x18
72#define WM8400_LEFT_LINE_INPUT_3_4_VOLUME 0x19
73#define WM8400_RIGHT_LINE_INPUT_1_2_VOLUME 0x1A
74#define WM8400_RIGHT_LINE_INPUT_3_4_VOLUME 0x1B
75#define WM8400_LEFT_OUTPUT_VOLUME 0x1C
76#define WM8400_RIGHT_OUTPUT_VOLUME 0x1D
77#define WM8400_LINE_OUTPUTS_VOLUME 0x1E
78#define WM8400_OUT3_4_VOLUME 0x1F
79#define WM8400_LEFT_OPGA_VOLUME 0x20
80#define WM8400_RIGHT_OPGA_VOLUME 0x21
81#define WM8400_SPEAKER_VOLUME 0x22
82#define WM8400_CLASSD1 0x23
83#define WM8400_CLASSD3 0x25
84#define WM8400_INPUT_MIXER1 0x27
85#define WM8400_INPUT_MIXER2 0x28
86#define WM8400_INPUT_MIXER3 0x29
87#define WM8400_INPUT_MIXER4 0x2A
88#define WM8400_INPUT_MIXER5 0x2B
89#define WM8400_INPUT_MIXER6 0x2C
90#define WM8400_OUTPUT_MIXER1 0x2D
91#define WM8400_OUTPUT_MIXER2 0x2E
92#define WM8400_OUTPUT_MIXER3 0x2F
93#define WM8400_OUTPUT_MIXER4 0x30
94#define WM8400_OUTPUT_MIXER5 0x31
95#define WM8400_OUTPUT_MIXER6 0x32
96#define WM8400_OUT3_4_MIXER 0x33
97#define WM8400_LINE_MIXER1 0x34
98#define WM8400_LINE_MIXER2 0x35
99#define WM8400_SPEAKER_MIXER 0x36
100#define WM8400_ADDITIONAL_CONTROL 0x37
101#define WM8400_ANTIPOP1 0x38
102#define WM8400_ANTIPOP2 0x39
103#define WM8400_MICBIAS 0x3A
104#define WM8400_FLL_CONTROL_1 0x3C
105#define WM8400_FLL_CONTROL_2 0x3D
106#define WM8400_FLL_CONTROL_3 0x3E
107#define WM8400_FLL_CONTROL_4 0x3F
108#define WM8400_LDO1_CONTROL 0x41
109#define WM8400_LDO2_CONTROL 0x42
110#define WM8400_LDO3_CONTROL 0x43
111#define WM8400_LDO4_CONTROL 0x44
112#define WM8400_DCDC1_CONTROL_1 0x46
113#define WM8400_DCDC1_CONTROL_2 0x47
114#define WM8400_DCDC2_CONTROL_1 0x48
115#define WM8400_DCDC2_CONTROL_2 0x49
116#define WM8400_INTERFACE 0x4B
117#define WM8400_PM_GENERAL 0x4C
118#define WM8400_PM_SHUTDOWN_CONTROL 0x4E
119#define WM8400_INTERRUPT_STATUS_1 0x4F
120#define WM8400_INTERRUPT_STATUS_1_MASK 0x50
121#define WM8400_INTERRUPT_LEVELS 0x51
122#define WM8400_SHUTDOWN_REASON 0x52
123#define WM8400_LINE_CIRCUITS 0x54
124
125/*
126 * Field Definitions.
127 */
128
129/*
130 * R0 (0x00) - Reset/ID
131 */
132#define WM8400_SW_RESET_CHIP_ID_MASK 0xFFFF /* SW_RESET/CHIP_ID - [15:0] */
133#define WM8400_SW_RESET_CHIP_ID_SHIFT 0 /* SW_RESET/CHIP_ID - [15:0] */
134#define WM8400_SW_RESET_CHIP_ID_WIDTH 16 /* SW_RESET/CHIP_ID - [15:0] */
135
136/*
137 * R1 (0x01) - ID
138 */
139#define WM8400_CHIP_REV_MASK 0x7000 /* CHIP_REV - [14:12] */
140#define WM8400_CHIP_REV_SHIFT 12 /* CHIP_REV - [14:12] */
141#define WM8400_CHIP_REV_WIDTH 3 /* CHIP_REV - [14:12] */
142
143/*
144 * R18 (0x12) - GPIO CTRL 1
145 */
146#define WM8400_IRQ 0x1000 /* IRQ */
147#define WM8400_IRQ_MASK 0x1000 /* IRQ */
148#define WM8400_IRQ_SHIFT 12 /* IRQ */
149#define WM8400_IRQ_WIDTH 1 /* IRQ */
150#define WM8400_TEMPOK 0x0800 /* TEMPOK */
151#define WM8400_TEMPOK_MASK 0x0800 /* TEMPOK */
152#define WM8400_TEMPOK_SHIFT 11 /* TEMPOK */
153#define WM8400_TEMPOK_WIDTH 1 /* TEMPOK */
154#define WM8400_MIC1SHRT 0x0400 /* MIC1SHRT */
155#define WM8400_MIC1SHRT_MASK 0x0400 /* MIC1SHRT */
156#define WM8400_MIC1SHRT_SHIFT 10 /* MIC1SHRT */
157#define WM8400_MIC1SHRT_WIDTH 1 /* MIC1SHRT */
158#define WM8400_MIC1DET 0x0200 /* MIC1DET */
159#define WM8400_MIC1DET_MASK 0x0200 /* MIC1DET */
160#define WM8400_MIC1DET_SHIFT 9 /* MIC1DET */
161#define WM8400_MIC1DET_WIDTH 1 /* MIC1DET */
162#define WM8400_FLL_LCK 0x0100 /* FLL_LCK */
163#define WM8400_FLL_LCK_MASK 0x0100 /* FLL_LCK */
164#define WM8400_FLL_LCK_SHIFT 8 /* FLL_LCK */
165#define WM8400_FLL_LCK_WIDTH 1 /* FLL_LCK */
166#define WM8400_GPIO_STATUS_MASK 0x00FF /* GPIO_STATUS - [7:0] */
167#define WM8400_GPIO_STATUS_SHIFT 0 /* GPIO_STATUS - [7:0] */
168#define WM8400_GPIO_STATUS_WIDTH 8 /* GPIO_STATUS - [7:0] */
169
170/*
171 * R19 (0x13) - GPIO1 & GPIO2
172 */
173#define WM8400_GPIO2_DEB_ENA 0x8000 /* GPIO2_DEB_ENA */
174#define WM8400_GPIO2_DEB_ENA_MASK 0x8000 /* GPIO2_DEB_ENA */
175#define WM8400_GPIO2_DEB_ENA_SHIFT 15 /* GPIO2_DEB_ENA */
176#define WM8400_GPIO2_DEB_ENA_WIDTH 1 /* GPIO2_DEB_ENA */
177#define WM8400_GPIO2_IRQ_ENA 0x4000 /* GPIO2_IRQ_ENA */
178#define WM8400_GPIO2_IRQ_ENA_MASK 0x4000 /* GPIO2_IRQ_ENA */
179#define WM8400_GPIO2_IRQ_ENA_SHIFT 14 /* GPIO2_IRQ_ENA */
180#define WM8400_GPIO2_IRQ_ENA_WIDTH 1 /* GPIO2_IRQ_ENA */
181#define WM8400_GPIO2_PU 0x2000 /* GPIO2_PU */
182#define WM8400_GPIO2_PU_MASK 0x2000 /* GPIO2_PU */
183#define WM8400_GPIO2_PU_SHIFT 13 /* GPIO2_PU */
184#define WM8400_GPIO2_PU_WIDTH 1 /* GPIO2_PU */
185#define WM8400_GPIO2_PD 0x1000 /* GPIO2_PD */
186#define WM8400_GPIO2_PD_MASK 0x1000 /* GPIO2_PD */
187#define WM8400_GPIO2_PD_SHIFT 12 /* GPIO2_PD */
188#define WM8400_GPIO2_PD_WIDTH 1 /* GPIO2_PD */
189#define WM8400_GPIO2_SEL_MASK 0x0F00 /* GPIO2_SEL - [11:8] */
190#define WM8400_GPIO2_SEL_SHIFT 8 /* GPIO2_SEL - [11:8] */
191#define WM8400_GPIO2_SEL_WIDTH 4 /* GPIO2_SEL - [11:8] */
192#define WM8400_GPIO1_DEB_ENA 0x0080 /* GPIO1_DEB_ENA */
193#define WM8400_GPIO1_DEB_ENA_MASK 0x0080 /* GPIO1_DEB_ENA */
194#define WM8400_GPIO1_DEB_ENA_SHIFT 7 /* GPIO1_DEB_ENA */
195#define WM8400_GPIO1_DEB_ENA_WIDTH 1 /* GPIO1_DEB_ENA */
196#define WM8400_GPIO1_IRQ_ENA 0x0040 /* GPIO1_IRQ_ENA */
197#define WM8400_GPIO1_IRQ_ENA_MASK 0x0040 /* GPIO1_IRQ_ENA */
198#define WM8400_GPIO1_IRQ_ENA_SHIFT 6 /* GPIO1_IRQ_ENA */
199#define WM8400_GPIO1_IRQ_ENA_WIDTH 1 /* GPIO1_IRQ_ENA */
200#define WM8400_GPIO1_PU 0x0020 /* GPIO1_PU */
201#define WM8400_GPIO1_PU_MASK 0x0020 /* GPIO1_PU */
202#define WM8400_GPIO1_PU_SHIFT 5 /* GPIO1_PU */
203#define WM8400_GPIO1_PU_WIDTH 1 /* GPIO1_PU */
204#define WM8400_GPIO1_PD 0x0010 /* GPIO1_PD */
205#define WM8400_GPIO1_PD_MASK 0x0010 /* GPIO1_PD */
206#define WM8400_GPIO1_PD_SHIFT 4 /* GPIO1_PD */
207#define WM8400_GPIO1_PD_WIDTH 1 /* GPIO1_PD */
208#define WM8400_GPIO1_SEL_MASK 0x000F /* GPIO1_SEL - [3:0] */
209#define WM8400_GPIO1_SEL_SHIFT 0 /* GPIO1_SEL - [3:0] */
210#define WM8400_GPIO1_SEL_WIDTH 4 /* GPIO1_SEL - [3:0] */
211
212/*
213 * R20 (0x14) - GPIO3 & GPIO4
214 */
215#define WM8400_GPIO4_DEB_ENA 0x8000 /* GPIO4_DEB_ENA */
216#define WM8400_GPIO4_DEB_ENA_MASK 0x8000 /* GPIO4_DEB_ENA */
217#define WM8400_GPIO4_DEB_ENA_SHIFT 15 /* GPIO4_DEB_ENA */
218#define WM8400_GPIO4_DEB_ENA_WIDTH 1 /* GPIO4_DEB_ENA */
219#define WM8400_GPIO4_IRQ_ENA 0x4000 /* GPIO4_IRQ_ENA */
220#define WM8400_GPIO4_IRQ_ENA_MASK 0x4000 /* GPIO4_IRQ_ENA */
221#define WM8400_GPIO4_IRQ_ENA_SHIFT 14 /* GPIO4_IRQ_ENA */
222#define WM8400_GPIO4_IRQ_ENA_WIDTH 1 /* GPIO4_IRQ_ENA */
223#define WM8400_GPIO4_PU 0x2000 /* GPIO4_PU */
224#define WM8400_GPIO4_PU_MASK 0x2000 /* GPIO4_PU */
225#define WM8400_GPIO4_PU_SHIFT 13 /* GPIO4_PU */
226#define WM8400_GPIO4_PU_WIDTH 1 /* GPIO4_PU */
227#define WM8400_GPIO4_PD 0x1000 /* GPIO4_PD */
228#define WM8400_GPIO4_PD_MASK 0x1000 /* GPIO4_PD */
229#define WM8400_GPIO4_PD_SHIFT 12 /* GPIO4_PD */
230#define WM8400_GPIO4_PD_WIDTH 1 /* GPIO4_PD */
231#define WM8400_GPIO4_SEL_MASK 0x0F00 /* GPIO4_SEL - [11:8] */
232#define WM8400_GPIO4_SEL_SHIFT 8 /* GPIO4_SEL - [11:8] */
233#define WM8400_GPIO4_SEL_WIDTH 4 /* GPIO4_SEL - [11:8] */
234#define WM8400_GPIO3_DEB_ENA 0x0080 /* GPIO3_DEB_ENA */
235#define WM8400_GPIO3_DEB_ENA_MASK 0x0080 /* GPIO3_DEB_ENA */
236#define WM8400_GPIO3_DEB_ENA_SHIFT 7 /* GPIO3_DEB_ENA */
237#define WM8400_GPIO3_DEB_ENA_WIDTH 1 /* GPIO3_DEB_ENA */
238#define WM8400_GPIO3_IRQ_ENA 0x0040 /* GPIO3_IRQ_ENA */
239#define WM8400_GPIO3_IRQ_ENA_MASK 0x0040 /* GPIO3_IRQ_ENA */
240#define WM8400_GPIO3_IRQ_ENA_SHIFT 6 /* GPIO3_IRQ_ENA */
241#define WM8400_GPIO3_IRQ_ENA_WIDTH 1 /* GPIO3_IRQ_ENA */
242#define WM8400_GPIO3_PU 0x0020 /* GPIO3_PU */
243#define WM8400_GPIO3_PU_MASK 0x0020 /* GPIO3_PU */
244#define WM8400_GPIO3_PU_SHIFT 5 /* GPIO3_PU */
245#define WM8400_GPIO3_PU_WIDTH 1 /* GPIO3_PU */
246#define WM8400_GPIO3_PD 0x0010 /* GPIO3_PD */
247#define WM8400_GPIO3_PD_MASK 0x0010 /* GPIO3_PD */
248#define WM8400_GPIO3_PD_SHIFT 4 /* GPIO3_PD */
249#define WM8400_GPIO3_PD_WIDTH 1 /* GPIO3_PD */
250#define WM8400_GPIO3_SEL_MASK 0x000F /* GPIO3_SEL - [3:0] */
251#define WM8400_GPIO3_SEL_SHIFT 0 /* GPIO3_SEL - [3:0] */
252#define WM8400_GPIO3_SEL_WIDTH 4 /* GPIO3_SEL - [3:0] */
253
254/*
255 * R21 (0x15) - GPIO5 & GPIO6
256 */
257#define WM8400_GPIO6_DEB_ENA 0x8000 /* GPIO6_DEB_ENA */
258#define WM8400_GPIO6_DEB_ENA_MASK 0x8000 /* GPIO6_DEB_ENA */
259#define WM8400_GPIO6_DEB_ENA_SHIFT 15 /* GPIO6_DEB_ENA */
260#define WM8400_GPIO6_DEB_ENA_WIDTH 1 /* GPIO6_DEB_ENA */
261#define WM8400_GPIO6_IRQ_ENA 0x4000 /* GPIO6_IRQ_ENA */
262#define WM8400_GPIO6_IRQ_ENA_MASK 0x4000 /* GPIO6_IRQ_ENA */
263#define WM8400_GPIO6_IRQ_ENA_SHIFT 14 /* GPIO6_IRQ_ENA */
264#define WM8400_GPIO6_IRQ_ENA_WIDTH 1 /* GPIO6_IRQ_ENA */
265#define WM8400_GPIO6_PU 0x2000 /* GPIO6_PU */
266#define WM8400_GPIO6_PU_MASK 0x2000 /* GPIO6_PU */
267#define WM8400_GPIO6_PU_SHIFT 13 /* GPIO6_PU */
268#define WM8400_GPIO6_PU_WIDTH 1 /* GPIO6_PU */
269#define WM8400_GPIO6_PD 0x1000 /* GPIO6_PD */
270#define WM8400_GPIO6_PD_MASK 0x1000 /* GPIO6_PD */
271#define WM8400_GPIO6_PD_SHIFT 12 /* GPIO6_PD */
272#define WM8400_GPIO6_PD_WIDTH 1 /* GPIO6_PD */
273#define WM8400_GPIO6_SEL_MASK 0x0F00 /* GPIO6_SEL - [11:8] */
274#define WM8400_GPIO6_SEL_SHIFT 8 /* GPIO6_SEL - [11:8] */
275#define WM8400_GPIO6_SEL_WIDTH 4 /* GPIO6_SEL - [11:8] */
276#define WM8400_GPIO5_DEB_ENA 0x0080 /* GPIO5_DEB_ENA */
277#define WM8400_GPIO5_DEB_ENA_MASK 0x0080 /* GPIO5_DEB_ENA */
278#define WM8400_GPIO5_DEB_ENA_SHIFT 7 /* GPIO5_DEB_ENA */
279#define WM8400_GPIO5_DEB_ENA_WIDTH 1 /* GPIO5_DEB_ENA */
280#define WM8400_GPIO5_IRQ_ENA 0x0040 /* GPIO5_IRQ_ENA */
281#define WM8400_GPIO5_IRQ_ENA_MASK 0x0040 /* GPIO5_IRQ_ENA */
282#define WM8400_GPIO5_IRQ_ENA_SHIFT 6 /* GPIO5_IRQ_ENA */
283#define WM8400_GPIO5_IRQ_ENA_WIDTH 1 /* GPIO5_IRQ_ENA */
284#define WM8400_GPIO5_PU 0x0020 /* GPIO5_PU */
285#define WM8400_GPIO5_PU_MASK 0x0020 /* GPIO5_PU */
286#define WM8400_GPIO5_PU_SHIFT 5 /* GPIO5_PU */
287#define WM8400_GPIO5_PU_WIDTH 1 /* GPIO5_PU */
288#define WM8400_GPIO5_PD 0x0010 /* GPIO5_PD */
289#define WM8400_GPIO5_PD_MASK 0x0010 /* GPIO5_PD */
290#define WM8400_GPIO5_PD_SHIFT 4 /* GPIO5_PD */
291#define WM8400_GPIO5_PD_WIDTH 1 /* GPIO5_PD */
292#define WM8400_GPIO5_SEL_MASK 0x000F /* GPIO5_SEL - [3:0] */
293#define WM8400_GPIO5_SEL_SHIFT 0 /* GPIO5_SEL - [3:0] */
294#define WM8400_GPIO5_SEL_WIDTH 4 /* GPIO5_SEL - [3:0] */
295
296/*
297 * R22 (0x16) - GPIOCTRL 2
298 */
299#define WM8400_TEMPOK_IRQ_ENA 0x0800 /* TEMPOK_IRQ_ENA */
300#define WM8400_TEMPOK_IRQ_ENA_MASK 0x0800 /* TEMPOK_IRQ_ENA */
301#define WM8400_TEMPOK_IRQ_ENA_SHIFT 11 /* TEMPOK_IRQ_ENA */
302#define WM8400_TEMPOK_IRQ_ENA_WIDTH 1 /* TEMPOK_IRQ_ENA */
303#define WM8400_MIC1SHRT_IRQ_ENA 0x0400 /* MIC1SHRT_IRQ_ENA */
304#define WM8400_MIC1SHRT_IRQ_ENA_MASK 0x0400 /* MIC1SHRT_IRQ_ENA */
305#define WM8400_MIC1SHRT_IRQ_ENA_SHIFT 10 /* MIC1SHRT_IRQ_ENA */
306#define WM8400_MIC1SHRT_IRQ_ENA_WIDTH 1 /* MIC1SHRT_IRQ_ENA */
307#define WM8400_MIC1DET_IRQ_ENA 0x0200 /* MIC1DET_IRQ_ENA */
308#define WM8400_MIC1DET_IRQ_ENA_MASK 0x0200 /* MIC1DET_IRQ_ENA */
309#define WM8400_MIC1DET_IRQ_ENA_SHIFT 9 /* MIC1DET_IRQ_ENA */
310#define WM8400_MIC1DET_IRQ_ENA_WIDTH 1 /* MIC1DET_IRQ_ENA */
311#define WM8400_FLL_LCK_IRQ_ENA 0x0100 /* FLL_LCK_IRQ_ENA */
312#define WM8400_FLL_LCK_IRQ_ENA_MASK 0x0100 /* FLL_LCK_IRQ_ENA */
313#define WM8400_FLL_LCK_IRQ_ENA_SHIFT 8 /* FLL_LCK_IRQ_ENA */
314#define WM8400_FLL_LCK_IRQ_ENA_WIDTH 1 /* FLL_LCK_IRQ_ENA */
315#define WM8400_GPI8_DEB_ENA 0x0080 /* GPI8_DEB_ENA */
316#define WM8400_GPI8_DEB_ENA_MASK 0x0080 /* GPI8_DEB_ENA */
317#define WM8400_GPI8_DEB_ENA_SHIFT 7 /* GPI8_DEB_ENA */
318#define WM8400_GPI8_DEB_ENA_WIDTH 1 /* GPI8_DEB_ENA */
319#define WM8400_GPI8_IRQ_ENA 0x0040 /* GPI8_IRQ_ENA */
320#define WM8400_GPI8_IRQ_ENA_MASK 0x0040 /* GPI8_IRQ_ENA */
321#define WM8400_GPI8_IRQ_ENA_SHIFT 6 /* GPI8_IRQ_ENA */
322#define WM8400_GPI8_IRQ_ENA_WIDTH 1 /* GPI8_IRQ_ENA */
323#define WM8400_GPI8_ENA 0x0010 /* GPI8_ENA */
324#define WM8400_GPI8_ENA_MASK 0x0010 /* GPI8_ENA */
325#define WM8400_GPI8_ENA_SHIFT 4 /* GPI8_ENA */
326#define WM8400_GPI8_ENA_WIDTH 1 /* GPI8_ENA */
327#define WM8400_GPI7_DEB_ENA 0x0008 /* GPI7_DEB_ENA */
328#define WM8400_GPI7_DEB_ENA_MASK 0x0008 /* GPI7_DEB_ENA */
329#define WM8400_GPI7_DEB_ENA_SHIFT 3 /* GPI7_DEB_ENA */
330#define WM8400_GPI7_DEB_ENA_WIDTH 1 /* GPI7_DEB_ENA */
331#define WM8400_GPI7_IRQ_ENA 0x0004 /* GPI7_IRQ_ENA */
332#define WM8400_GPI7_IRQ_ENA_MASK 0x0004 /* GPI7_IRQ_ENA */
333#define WM8400_GPI7_IRQ_ENA_SHIFT 2 /* GPI7_IRQ_ENA */
334#define WM8400_GPI7_IRQ_ENA_WIDTH 1 /* GPI7_IRQ_ENA */
335#define WM8400_GPI7_ENA 0x0001 /* GPI7_ENA */
336#define WM8400_GPI7_ENA_MASK 0x0001 /* GPI7_ENA */
337#define WM8400_GPI7_ENA_SHIFT 0 /* GPI7_ENA */
338#define WM8400_GPI7_ENA_WIDTH 1 /* GPI7_ENA */
339
340/*
341 * R23 (0x17) - GPIO_POL
342 */
343#define WM8400_IRQ_INV 0x1000 /* IRQ_INV */
344#define WM8400_IRQ_INV_MASK 0x1000 /* IRQ_INV */
345#define WM8400_IRQ_INV_SHIFT 12 /* IRQ_INV */
346#define WM8400_IRQ_INV_WIDTH 1 /* IRQ_INV */
347#define WM8400_TEMPOK_POL 0x0800 /* TEMPOK_POL */
348#define WM8400_TEMPOK_POL_MASK 0x0800 /* TEMPOK_POL */
349#define WM8400_TEMPOK_POL_SHIFT 11 /* TEMPOK_POL */
350#define WM8400_TEMPOK_POL_WIDTH 1 /* TEMPOK_POL */
351#define WM8400_MIC1SHRT_POL 0x0400 /* MIC1SHRT_POL */
352#define WM8400_MIC1SHRT_POL_MASK 0x0400 /* MIC1SHRT_POL */
353#define WM8400_MIC1SHRT_POL_SHIFT 10 /* MIC1SHRT_POL */
354#define WM8400_MIC1SHRT_POL_WIDTH 1 /* MIC1SHRT_POL */
355#define WM8400_MIC1DET_POL 0x0200 /* MIC1DET_POL */
356#define WM8400_MIC1DET_POL_MASK 0x0200 /* MIC1DET_POL */
357#define WM8400_MIC1DET_POL_SHIFT 9 /* MIC1DET_POL */
358#define WM8400_MIC1DET_POL_WIDTH 1 /* MIC1DET_POL */
359#define WM8400_FLL_LCK_POL 0x0100 /* FLL_LCK_POL */
360#define WM8400_FLL_LCK_POL_MASK 0x0100 /* FLL_LCK_POL */
361#define WM8400_FLL_LCK_POL_SHIFT 8 /* FLL_LCK_POL */
362#define WM8400_FLL_LCK_POL_WIDTH 1 /* FLL_LCK_POL */
363#define WM8400_GPIO_POL_MASK 0x00FF /* GPIO_POL - [7:0] */
364#define WM8400_GPIO_POL_SHIFT 0 /* GPIO_POL - [7:0] */
365#define WM8400_GPIO_POL_WIDTH 8 /* GPIO_POL - [7:0] */
366
367/*
368 * R65 (0x41) - LDO 1 Control
369 */
370#define WM8400_LDO1_ENA 0x8000 /* LDO1_ENA */
371#define WM8400_LDO1_ENA_MASK 0x8000 /* LDO1_ENA */
372#define WM8400_LDO1_ENA_SHIFT 15 /* LDO1_ENA */
373#define WM8400_LDO1_ENA_WIDTH 1 /* LDO1_ENA */
374#define WM8400_LDO1_SWI 0x4000 /* LDO1_SWI */
375#define WM8400_LDO1_SWI_MASK 0x4000 /* LDO1_SWI */
376#define WM8400_LDO1_SWI_SHIFT 14 /* LDO1_SWI */
377#define WM8400_LDO1_SWI_WIDTH 1 /* LDO1_SWI */
378#define WM8400_LDO1_OPFLT 0x1000 /* LDO1_OPFLT */
379#define WM8400_LDO1_OPFLT_MASK 0x1000 /* LDO1_OPFLT */
380#define WM8400_LDO1_OPFLT_SHIFT 12 /* LDO1_OPFLT */
381#define WM8400_LDO1_OPFLT_WIDTH 1 /* LDO1_OPFLT */
382#define WM8400_LDO1_ERRACT 0x0800 /* LDO1_ERRACT */
383#define WM8400_LDO1_ERRACT_MASK 0x0800 /* LDO1_ERRACT */
384#define WM8400_LDO1_ERRACT_SHIFT 11 /* LDO1_ERRACT */
385#define WM8400_LDO1_ERRACT_WIDTH 1 /* LDO1_ERRACT */
386#define WM8400_LDO1_HIB_MODE 0x0400 /* LDO1_HIB_MODE */
387#define WM8400_LDO1_HIB_MODE_MASK 0x0400 /* LDO1_HIB_MODE */
388#define WM8400_LDO1_HIB_MODE_SHIFT 10 /* LDO1_HIB_MODE */
389#define WM8400_LDO1_HIB_MODE_WIDTH 1 /* LDO1_HIB_MODE */
390#define WM8400_LDO1_VIMG_MASK 0x03E0 /* LDO1_VIMG - [9:5] */
391#define WM8400_LDO1_VIMG_SHIFT 5 /* LDO1_VIMG - [9:5] */
392#define WM8400_LDO1_VIMG_WIDTH 5 /* LDO1_VIMG - [9:5] */
393#define WM8400_LDO1_VSEL_MASK 0x001F /* LDO1_VSEL - [4:0] */
394#define WM8400_LDO1_VSEL_SHIFT 0 /* LDO1_VSEL - [4:0] */
395#define WM8400_LDO1_VSEL_WIDTH 5 /* LDO1_VSEL - [4:0] */
396
397/*
398 * R66 (0x42) - LDO 2 Control
399 */
400#define WM8400_LDO2_ENA 0x8000 /* LDO2_ENA */
401#define WM8400_LDO2_ENA_MASK 0x8000 /* LDO2_ENA */
402#define WM8400_LDO2_ENA_SHIFT 15 /* LDO2_ENA */
403#define WM8400_LDO2_ENA_WIDTH 1 /* LDO2_ENA */
404#define WM8400_LDO2_SWI 0x4000 /* LDO2_SWI */
405#define WM8400_LDO2_SWI_MASK 0x4000 /* LDO2_SWI */
406#define WM8400_LDO2_SWI_SHIFT 14 /* LDO2_SWI */
407#define WM8400_LDO2_SWI_WIDTH 1 /* LDO2_SWI */
408#define WM8400_LDO2_OPFLT 0x1000 /* LDO2_OPFLT */
409#define WM8400_LDO2_OPFLT_MASK 0x1000 /* LDO2_OPFLT */
410#define WM8400_LDO2_OPFLT_SHIFT 12 /* LDO2_OPFLT */
411#define WM8400_LDO2_OPFLT_WIDTH 1 /* LDO2_OPFLT */
412#define WM8400_LDO2_ERRACT 0x0800 /* LDO2_ERRACT */
413#define WM8400_LDO2_ERRACT_MASK 0x0800 /* LDO2_ERRACT */
414#define WM8400_LDO2_ERRACT_SHIFT 11 /* LDO2_ERRACT */
415#define WM8400_LDO2_ERRACT_WIDTH 1 /* LDO2_ERRACT */
416#define WM8400_LDO2_HIB_MODE 0x0400 /* LDO2_HIB_MODE */
417#define WM8400_LDO2_HIB_MODE_MASK 0x0400 /* LDO2_HIB_MODE */
418#define WM8400_LDO2_HIB_MODE_SHIFT 10 /* LDO2_HIB_MODE */
419#define WM8400_LDO2_HIB_MODE_WIDTH 1 /* LDO2_HIB_MODE */
420#define WM8400_LDO2_VIMG_MASK 0x03E0 /* LDO2_VIMG - [9:5] */
421#define WM8400_LDO2_VIMG_SHIFT 5 /* LDO2_VIMG - [9:5] */
422#define WM8400_LDO2_VIMG_WIDTH 5 /* LDO2_VIMG - [9:5] */
423#define WM8400_LDO2_VSEL_MASK 0x001F /* LDO2_VSEL - [4:0] */
424#define WM8400_LDO2_VSEL_SHIFT 0 /* LDO2_VSEL - [4:0] */
425#define WM8400_LDO2_VSEL_WIDTH 5 /* LDO2_VSEL - [4:0] */
426
427/*
428 * R67 (0x43) - LDO 3 Control
429 */
430#define WM8400_LDO3_ENA 0x8000 /* LDO3_ENA */
431#define WM8400_LDO3_ENA_MASK 0x8000 /* LDO3_ENA */
432#define WM8400_LDO3_ENA_SHIFT 15 /* LDO3_ENA */
433#define WM8400_LDO3_ENA_WIDTH 1 /* LDO3_ENA */
434#define WM8400_LDO3_SWI 0x4000 /* LDO3_SWI */
435#define WM8400_LDO3_SWI_MASK 0x4000 /* LDO3_SWI */
436#define WM8400_LDO3_SWI_SHIFT 14 /* LDO3_SWI */
437#define WM8400_LDO3_SWI_WIDTH 1 /* LDO3_SWI */
438#define WM8400_LDO3_OPFLT 0x1000 /* LDO3_OPFLT */
439#define WM8400_LDO3_OPFLT_MASK 0x1000 /* LDO3_OPFLT */
440#define WM8400_LDO3_OPFLT_SHIFT 12 /* LDO3_OPFLT */
441#define WM8400_LDO3_OPFLT_WIDTH 1 /* LDO3_OPFLT */
442#define WM8400_LDO3_ERRACT 0x0800 /* LDO3_ERRACT */
443#define WM8400_LDO3_ERRACT_MASK 0x0800 /* LDO3_ERRACT */
444#define WM8400_LDO3_ERRACT_SHIFT 11 /* LDO3_ERRACT */
445#define WM8400_LDO3_ERRACT_WIDTH 1 /* LDO3_ERRACT */
446#define WM8400_LDO3_HIB_MODE 0x0400 /* LDO3_HIB_MODE */
447#define WM8400_LDO3_HIB_MODE_MASK 0x0400 /* LDO3_HIB_MODE */
448#define WM8400_LDO3_HIB_MODE_SHIFT 10 /* LDO3_HIB_MODE */
449#define WM8400_LDO3_HIB_MODE_WIDTH 1 /* LDO3_HIB_MODE */
450#define WM8400_LDO3_VIMG_MASK 0x03E0 /* LDO3_VIMG - [9:5] */
451#define WM8400_LDO3_VIMG_SHIFT 5 /* LDO3_VIMG - [9:5] */
452#define WM8400_LDO3_VIMG_WIDTH 5 /* LDO3_VIMG - [9:5] */
453#define WM8400_LDO3_VSEL_MASK 0x001F /* LDO3_VSEL - [4:0] */
454#define WM8400_LDO3_VSEL_SHIFT 0 /* LDO3_VSEL - [4:0] */
455#define WM8400_LDO3_VSEL_WIDTH 5 /* LDO3_VSEL - [4:0] */
456
457/*
458 * R68 (0x44) - LDO 4 Control
459 */
460#define WM8400_LDO4_ENA 0x8000 /* LDO4_ENA */
461#define WM8400_LDO4_ENA_MASK 0x8000 /* LDO4_ENA */
462#define WM8400_LDO4_ENA_SHIFT 15 /* LDO4_ENA */
463#define WM8400_LDO4_ENA_WIDTH 1 /* LDO4_ENA */
464#define WM8400_LDO4_SWI 0x4000 /* LDO4_SWI */
465#define WM8400_LDO4_SWI_MASK 0x4000 /* LDO4_SWI */
466#define WM8400_LDO4_SWI_SHIFT 14 /* LDO4_SWI */
467#define WM8400_LDO4_SWI_WIDTH 1 /* LDO4_SWI */
468#define WM8400_LDO4_OPFLT 0x1000 /* LDO4_OPFLT */
469#define WM8400_LDO4_OPFLT_MASK 0x1000 /* LDO4_OPFLT */
470#define WM8400_LDO4_OPFLT_SHIFT 12 /* LDO4_OPFLT */
471#define WM8400_LDO4_OPFLT_WIDTH 1 /* LDO4_OPFLT */
472#define WM8400_LDO4_ERRACT 0x0800 /* LDO4_ERRACT */
473#define WM8400_LDO4_ERRACT_MASK 0x0800 /* LDO4_ERRACT */
474#define WM8400_LDO4_ERRACT_SHIFT 11 /* LDO4_ERRACT */
475#define WM8400_LDO4_ERRACT_WIDTH 1 /* LDO4_ERRACT */
476#define WM8400_LDO4_HIB_MODE 0x0400 /* LDO4_HIB_MODE */
477#define WM8400_LDO4_HIB_MODE_MASK 0x0400 /* LDO4_HIB_MODE */
478#define WM8400_LDO4_HIB_MODE_SHIFT 10 /* LDO4_HIB_MODE */
479#define WM8400_LDO4_HIB_MODE_WIDTH 1 /* LDO4_HIB_MODE */
480#define WM8400_LDO4_VIMG_MASK 0x03E0 /* LDO4_VIMG - [9:5] */
481#define WM8400_LDO4_VIMG_SHIFT 5 /* LDO4_VIMG - [9:5] */
482#define WM8400_LDO4_VIMG_WIDTH 5 /* LDO4_VIMG - [9:5] */
483#define WM8400_LDO4_VSEL_MASK 0x001F /* LDO4_VSEL - [4:0] */
484#define WM8400_LDO4_VSEL_SHIFT 0 /* LDO4_VSEL - [4:0] */
485#define WM8400_LDO4_VSEL_WIDTH 5 /* LDO4_VSEL - [4:0] */
486
487/*
488 * R70 (0x46) - DCDC1 Control 1
489 */
490#define WM8400_DC1_ENA 0x8000 /* DC1_ENA */
491#define WM8400_DC1_ENA_MASK 0x8000 /* DC1_ENA */
492#define WM8400_DC1_ENA_SHIFT 15 /* DC1_ENA */
493#define WM8400_DC1_ENA_WIDTH 1 /* DC1_ENA */
494#define WM8400_DC1_ACTIVE 0x4000 /* DC1_ACTIVE */
495#define WM8400_DC1_ACTIVE_MASK 0x4000 /* DC1_ACTIVE */
496#define WM8400_DC1_ACTIVE_SHIFT 14 /* DC1_ACTIVE */
497#define WM8400_DC1_ACTIVE_WIDTH 1 /* DC1_ACTIVE */
498#define WM8400_DC1_SLEEP 0x2000 /* DC1_SLEEP */
499#define WM8400_DC1_SLEEP_MASK 0x2000 /* DC1_SLEEP */
500#define WM8400_DC1_SLEEP_SHIFT 13 /* DC1_SLEEP */
501#define WM8400_DC1_SLEEP_WIDTH 1 /* DC1_SLEEP */
502#define WM8400_DC1_OPFLT 0x1000 /* DC1_OPFLT */
503#define WM8400_DC1_OPFLT_MASK 0x1000 /* DC1_OPFLT */
504#define WM8400_DC1_OPFLT_SHIFT 12 /* DC1_OPFLT */
505#define WM8400_DC1_OPFLT_WIDTH 1 /* DC1_OPFLT */
506#define WM8400_DC1_ERRACT 0x0800 /* DC1_ERRACT */
507#define WM8400_DC1_ERRACT_MASK 0x0800 /* DC1_ERRACT */
508#define WM8400_DC1_ERRACT_SHIFT 11 /* DC1_ERRACT */
509#define WM8400_DC1_ERRACT_WIDTH 1 /* DC1_ERRACT */
510#define WM8400_DC1_HIB_MODE 0x0400 /* DC1_HIB_MODE */
511#define WM8400_DC1_HIB_MODE_MASK 0x0400 /* DC1_HIB_MODE */
512#define WM8400_DC1_HIB_MODE_SHIFT 10 /* DC1_HIB_MODE */
513#define WM8400_DC1_HIB_MODE_WIDTH 1 /* DC1_HIB_MODE */
514#define WM8400_DC1_SOFTST_MASK 0x0300 /* DC1_SOFTST - [9:8] */
515#define WM8400_DC1_SOFTST_SHIFT 8 /* DC1_SOFTST - [9:8] */
516#define WM8400_DC1_SOFTST_WIDTH 2 /* DC1_SOFTST - [9:8] */
517#define WM8400_DC1_OV_PROT 0x0080 /* DC1_OV_PROT */
518#define WM8400_DC1_OV_PROT_MASK 0x0080 /* DC1_OV_PROT */
519#define WM8400_DC1_OV_PROT_SHIFT 7 /* DC1_OV_PROT */
520#define WM8400_DC1_OV_PROT_WIDTH 1 /* DC1_OV_PROT */
521#define WM8400_DC1_VSEL_MASK 0x007F /* DC1_VSEL - [6:0] */
522#define WM8400_DC1_VSEL_SHIFT 0 /* DC1_VSEL - [6:0] */
523#define WM8400_DC1_VSEL_WIDTH 7 /* DC1_VSEL - [6:0] */
524
525/*
526 * R71 (0x47) - DCDC1 Control 2
527 */
528#define WM8400_DC1_FRC_PWM 0x2000 /* DC1_FRC_PWM */
529#define WM8400_DC1_FRC_PWM_MASK 0x2000 /* DC1_FRC_PWM */
530#define WM8400_DC1_FRC_PWM_SHIFT 13 /* DC1_FRC_PWM */
531#define WM8400_DC1_FRC_PWM_WIDTH 1 /* DC1_FRC_PWM */
532#define WM8400_DC1_STBY_LIM_MASK 0x0300 /* DC1_STBY_LIM - [9:8] */
533#define WM8400_DC1_STBY_LIM_SHIFT 8 /* DC1_STBY_LIM - [9:8] */
534#define WM8400_DC1_STBY_LIM_WIDTH 2 /* DC1_STBY_LIM - [9:8] */
535#define WM8400_DC1_ACT_LIM 0x0080 /* DC1_ACT_LIM */
536#define WM8400_DC1_ACT_LIM_MASK 0x0080 /* DC1_ACT_LIM */
537#define WM8400_DC1_ACT_LIM_SHIFT 7 /* DC1_ACT_LIM */
538#define WM8400_DC1_ACT_LIM_WIDTH 1 /* DC1_ACT_LIM */
539#define WM8400_DC1_VIMG_MASK 0x007F /* DC1_VIMG - [6:0] */
540#define WM8400_DC1_VIMG_SHIFT 0 /* DC1_VIMG - [6:0] */
541#define WM8400_DC1_VIMG_WIDTH 7 /* DC1_VIMG - [6:0] */
542
543/*
544 * R72 (0x48) - DCDC2 Control 1
545 */
546#define WM8400_DC2_ENA 0x8000 /* DC2_ENA */
547#define WM8400_DC2_ENA_MASK 0x8000 /* DC2_ENA */
548#define WM8400_DC2_ENA_SHIFT 15 /* DC2_ENA */
549#define WM8400_DC2_ENA_WIDTH 1 /* DC2_ENA */
550#define WM8400_DC2_ACTIVE 0x4000 /* DC2_ACTIVE */
551#define WM8400_DC2_ACTIVE_MASK 0x4000 /* DC2_ACTIVE */
552#define WM8400_DC2_ACTIVE_SHIFT 14 /* DC2_ACTIVE */
553#define WM8400_DC2_ACTIVE_WIDTH 1 /* DC2_ACTIVE */
554#define WM8400_DC2_SLEEP 0x2000 /* DC2_SLEEP */
555#define WM8400_DC2_SLEEP_MASK 0x2000 /* DC2_SLEEP */
556#define WM8400_DC2_SLEEP_SHIFT 13 /* DC2_SLEEP */
557#define WM8400_DC2_SLEEP_WIDTH 1 /* DC2_SLEEP */
558#define WM8400_DC2_OPFLT 0x1000 /* DC2_OPFLT */
559#define WM8400_DC2_OPFLT_MASK 0x1000 /* DC2_OPFLT */
560#define WM8400_DC2_OPFLT_SHIFT 12 /* DC2_OPFLT */
561#define WM8400_DC2_OPFLT_WIDTH 1 /* DC2_OPFLT */
562#define WM8400_DC2_ERRACT 0x0800 /* DC2_ERRACT */
563#define WM8400_DC2_ERRACT_MASK 0x0800 /* DC2_ERRACT */
564#define WM8400_DC2_ERRACT_SHIFT 11 /* DC2_ERRACT */
565#define WM8400_DC2_ERRACT_WIDTH 1 /* DC2_ERRACT */
566#define WM8400_DC2_HIB_MODE 0x0400 /* DC2_HIB_MODE */
567#define WM8400_DC2_HIB_MODE_MASK 0x0400 /* DC2_HIB_MODE */
568#define WM8400_DC2_HIB_MODE_SHIFT 10 /* DC2_HIB_MODE */
569#define WM8400_DC2_HIB_MODE_WIDTH 1 /* DC2_HIB_MODE */
570#define WM8400_DC2_SOFTST_MASK 0x0300 /* DC2_SOFTST - [9:8] */
571#define WM8400_DC2_SOFTST_SHIFT 8 /* DC2_SOFTST - [9:8] */
572#define WM8400_DC2_SOFTST_WIDTH 2 /* DC2_SOFTST - [9:8] */
573#define WM8400_DC2_OV_PROT 0x0080 /* DC2_OV_PROT */
574#define WM8400_DC2_OV_PROT_MASK 0x0080 /* DC2_OV_PROT */
575#define WM8400_DC2_OV_PROT_SHIFT 7 /* DC2_OV_PROT */
576#define WM8400_DC2_OV_PROT_WIDTH 1 /* DC2_OV_PROT */
577#define WM8400_DC2_VSEL_MASK 0x007F /* DC2_VSEL - [6:0] */
578#define WM8400_DC2_VSEL_SHIFT 0 /* DC2_VSEL - [6:0] */
579#define WM8400_DC2_VSEL_WIDTH 7 /* DC2_VSEL - [6:0] */
580
581/*
582 * R73 (0x49) - DCDC2 Control 2
583 */
584#define WM8400_DC2_FRC_PWM 0x2000 /* DC2_FRC_PWM */
585#define WM8400_DC2_FRC_PWM_MASK 0x2000 /* DC2_FRC_PWM */
586#define WM8400_DC2_FRC_PWM_SHIFT 13 /* DC2_FRC_PWM */
587#define WM8400_DC2_FRC_PWM_WIDTH 1 /* DC2_FRC_PWM */
588#define WM8400_DC2_STBY_LIM_MASK 0x0300 /* DC2_STBY_LIM - [9:8] */
589#define WM8400_DC2_STBY_LIM_SHIFT 8 /* DC2_STBY_LIM - [9:8] */
590#define WM8400_DC2_STBY_LIM_WIDTH 2 /* DC2_STBY_LIM - [9:8] */
591#define WM8400_DC2_ACT_LIM 0x0080 /* DC2_ACT_LIM */
592#define WM8400_DC2_ACT_LIM_MASK 0x0080 /* DC2_ACT_LIM */
593#define WM8400_DC2_ACT_LIM_SHIFT 7 /* DC2_ACT_LIM */
594#define WM8400_DC2_ACT_LIM_WIDTH 1 /* DC2_ACT_LIM */
595#define WM8400_DC2_VIMG_MASK 0x007F /* DC2_VIMG - [6:0] */
596#define WM8400_DC2_VIMG_SHIFT 0 /* DC2_VIMG - [6:0] */
597#define WM8400_DC2_VIMG_WIDTH 7 /* DC2_VIMG - [6:0] */
598
599/*
600 * R75 (0x4B) - Interface
601 */
602#define WM8400_AUTOINC 0x0008 /* AUTOINC */
603#define WM8400_AUTOINC_MASK 0x0008 /* AUTOINC */
604#define WM8400_AUTOINC_SHIFT 3 /* AUTOINC */
605#define WM8400_AUTOINC_WIDTH 1 /* AUTOINC */
606#define WM8400_ARA_ENA 0x0004 /* ARA_ENA */
607#define WM8400_ARA_ENA_MASK 0x0004 /* ARA_ENA */
608#define WM8400_ARA_ENA_SHIFT 2 /* ARA_ENA */
609#define WM8400_ARA_ENA_WIDTH 1 /* ARA_ENA */
610#define WM8400_SPI_CFG 0x0002 /* SPI_CFG */
611#define WM8400_SPI_CFG_MASK 0x0002 /* SPI_CFG */
612#define WM8400_SPI_CFG_SHIFT 1 /* SPI_CFG */
613#define WM8400_SPI_CFG_WIDTH 1 /* SPI_CFG */
614
615/*
616 * R76 (0x4C) - PM GENERAL
617 */
618#define WM8400_CODEC_SOFTST 0x8000 /* CODEC_SOFTST */
619#define WM8400_CODEC_SOFTST_MASK 0x8000 /* CODEC_SOFTST */
620#define WM8400_CODEC_SOFTST_SHIFT 15 /* CODEC_SOFTST */
621#define WM8400_CODEC_SOFTST_WIDTH 1 /* CODEC_SOFTST */
622#define WM8400_CODEC_SOFTSD 0x4000 /* CODEC_SOFTSD */
623#define WM8400_CODEC_SOFTSD_MASK 0x4000 /* CODEC_SOFTSD */
624#define WM8400_CODEC_SOFTSD_SHIFT 14 /* CODEC_SOFTSD */
625#define WM8400_CODEC_SOFTSD_WIDTH 1 /* CODEC_SOFTSD */
626#define WM8400_CHIP_SOFTSD 0x2000 /* CHIP_SOFTSD */
627#define WM8400_CHIP_SOFTSD_MASK 0x2000 /* CHIP_SOFTSD */
628#define WM8400_CHIP_SOFTSD_SHIFT 13 /* CHIP_SOFTSD */
629#define WM8400_CHIP_SOFTSD_WIDTH 1 /* CHIP_SOFTSD */
630#define WM8400_DSLEEP1_POL 0x0008 /* DSLEEP1_POL */
631#define WM8400_DSLEEP1_POL_MASK 0x0008 /* DSLEEP1_POL */
632#define WM8400_DSLEEP1_POL_SHIFT 3 /* DSLEEP1_POL */
633#define WM8400_DSLEEP1_POL_WIDTH 1 /* DSLEEP1_POL */
634#define WM8400_DSLEEP2_POL 0x0004 /* DSLEEP2_POL */
635#define WM8400_DSLEEP2_POL_MASK 0x0004 /* DSLEEP2_POL */
636#define WM8400_DSLEEP2_POL_SHIFT 2 /* DSLEEP2_POL */
637#define WM8400_DSLEEP2_POL_WIDTH 1 /* DSLEEP2_POL */
638#define WM8400_PWR_STATE_MASK 0x0003 /* PWR_STATE - [1:0] */
639#define WM8400_PWR_STATE_SHIFT 0 /* PWR_STATE - [1:0] */
640#define WM8400_PWR_STATE_WIDTH 2 /* PWR_STATE - [1:0] */
641
642/*
643 * R78 (0x4E) - PM Shutdown Control
644 */
645#define WM8400_CHIP_GT150_ERRACT 0x0200 /* CHIP_GT150_ERRACT */
646#define WM8400_CHIP_GT150_ERRACT_MASK 0x0200 /* CHIP_GT150_ERRACT */
647#define WM8400_CHIP_GT150_ERRACT_SHIFT 9 /* CHIP_GT150_ERRACT */
648#define WM8400_CHIP_GT150_ERRACT_WIDTH 1 /* CHIP_GT150_ERRACT */
649#define WM8400_CHIP_GT115_ERRACT 0x0100 /* CHIP_GT115_ERRACT */
650#define WM8400_CHIP_GT115_ERRACT_MASK 0x0100 /* CHIP_GT115_ERRACT */
651#define WM8400_CHIP_GT115_ERRACT_SHIFT 8 /* CHIP_GT115_ERRACT */
652#define WM8400_CHIP_GT115_ERRACT_WIDTH 1 /* CHIP_GT115_ERRACT */
653#define WM8400_LINE_CMP_ERRACT 0x0080 /* LINE_CMP_ERRACT */
654#define WM8400_LINE_CMP_ERRACT_MASK 0x0080 /* LINE_CMP_ERRACT */
655#define WM8400_LINE_CMP_ERRACT_SHIFT 7 /* LINE_CMP_ERRACT */
656#define WM8400_LINE_CMP_ERRACT_WIDTH 1 /* LINE_CMP_ERRACT */
657#define WM8400_UVLO_ERRACT 0x0040 /* UVLO_ERRACT */
658#define WM8400_UVLO_ERRACT_MASK 0x0040 /* UVLO_ERRACT */
659#define WM8400_UVLO_ERRACT_SHIFT 6 /* UVLO_ERRACT */
660#define WM8400_UVLO_ERRACT_WIDTH 1 /* UVLO_ERRACT */
661
662/*
663 * R79 (0x4F) - Interrupt Status 1
664 */
665#define WM8400_MICD_CINT 0x8000 /* MICD_CINT */
666#define WM8400_MICD_CINT_MASK 0x8000 /* MICD_CINT */
667#define WM8400_MICD_CINT_SHIFT 15 /* MICD_CINT */
668#define WM8400_MICD_CINT_WIDTH 1 /* MICD_CINT */
669#define WM8400_MICSCD_CINT 0x4000 /* MICSCD_CINT */
670#define WM8400_MICSCD_CINT_MASK 0x4000 /* MICSCD_CINT */
671#define WM8400_MICSCD_CINT_SHIFT 14 /* MICSCD_CINT */
672#define WM8400_MICSCD_CINT_WIDTH 1 /* MICSCD_CINT */
673#define WM8400_JDL_CINT 0x2000 /* JDL_CINT */
674#define WM8400_JDL_CINT_MASK 0x2000 /* JDL_CINT */
675#define WM8400_JDL_CINT_SHIFT 13 /* JDL_CINT */
676#define WM8400_JDL_CINT_WIDTH 1 /* JDL_CINT */
677#define WM8400_JDR_CINT 0x1000 /* JDR_CINT */
678#define WM8400_JDR_CINT_MASK 0x1000 /* JDR_CINT */
679#define WM8400_JDR_CINT_SHIFT 12 /* JDR_CINT */
680#define WM8400_JDR_CINT_WIDTH 1 /* JDR_CINT */
681#define WM8400_CODEC_SEQ_END_EINT 0x0800 /* CODEC_SEQ_END_EINT */
682#define WM8400_CODEC_SEQ_END_EINT_MASK 0x0800 /* CODEC_SEQ_END_EINT */
683#define WM8400_CODEC_SEQ_END_EINT_SHIFT 11 /* CODEC_SEQ_END_EINT */
684#define WM8400_CODEC_SEQ_END_EINT_WIDTH 1 /* CODEC_SEQ_END_EINT */
685#define WM8400_CDEL_TO_EINT 0x0400 /* CDEL_TO_EINT */
686#define WM8400_CDEL_TO_EINT_MASK 0x0400 /* CDEL_TO_EINT */
687#define WM8400_CDEL_TO_EINT_SHIFT 10 /* CDEL_TO_EINT */
688#define WM8400_CDEL_TO_EINT_WIDTH 1 /* CDEL_TO_EINT */
689#define WM8400_CHIP_GT150_EINT 0x0200 /* CHIP_GT150_EINT */
690#define WM8400_CHIP_GT150_EINT_MASK 0x0200 /* CHIP_GT150_EINT */
691#define WM8400_CHIP_GT150_EINT_SHIFT 9 /* CHIP_GT150_EINT */
692#define WM8400_CHIP_GT150_EINT_WIDTH 1 /* CHIP_GT150_EINT */
693#define WM8400_CHIP_GT115_EINT 0x0100 /* CHIP_GT115_EINT */
694#define WM8400_CHIP_GT115_EINT_MASK 0x0100 /* CHIP_GT115_EINT */
695#define WM8400_CHIP_GT115_EINT_SHIFT 8 /* CHIP_GT115_EINT */
696#define WM8400_CHIP_GT115_EINT_WIDTH 1 /* CHIP_GT115_EINT */
697#define WM8400_LINE_CMP_EINT 0x0080 /* LINE_CMP_EINT */
698#define WM8400_LINE_CMP_EINT_MASK 0x0080 /* LINE_CMP_EINT */
699#define WM8400_LINE_CMP_EINT_SHIFT 7 /* LINE_CMP_EINT */
700#define WM8400_LINE_CMP_EINT_WIDTH 1 /* LINE_CMP_EINT */
701#define WM8400_UVLO_EINT 0x0040 /* UVLO_EINT */
702#define WM8400_UVLO_EINT_MASK 0x0040 /* UVLO_EINT */
703#define WM8400_UVLO_EINT_SHIFT 6 /* UVLO_EINT */
704#define WM8400_UVLO_EINT_WIDTH 1 /* UVLO_EINT */
705#define WM8400_DC2_UV_EINT 0x0020 /* DC2_UV_EINT */
706#define WM8400_DC2_UV_EINT_MASK 0x0020 /* DC2_UV_EINT */
707#define WM8400_DC2_UV_EINT_SHIFT 5 /* DC2_UV_EINT */
708#define WM8400_DC2_UV_EINT_WIDTH 1 /* DC2_UV_EINT */
709#define WM8400_DC1_UV_EINT 0x0010 /* DC1_UV_EINT */
710#define WM8400_DC1_UV_EINT_MASK 0x0010 /* DC1_UV_EINT */
711#define WM8400_DC1_UV_EINT_SHIFT 4 /* DC1_UV_EINT */
712#define WM8400_DC1_UV_EINT_WIDTH 1 /* DC1_UV_EINT */
713#define WM8400_LDO4_UV_EINT 0x0008 /* LDO4_UV_EINT */
714#define WM8400_LDO4_UV_EINT_MASK 0x0008 /* LDO4_UV_EINT */
715#define WM8400_LDO4_UV_EINT_SHIFT 3 /* LDO4_UV_EINT */
716#define WM8400_LDO4_UV_EINT_WIDTH 1 /* LDO4_UV_EINT */
717#define WM8400_LDO3_UV_EINT 0x0004 /* LDO3_UV_EINT */
718#define WM8400_LDO3_UV_EINT_MASK 0x0004 /* LDO3_UV_EINT */
719#define WM8400_LDO3_UV_EINT_SHIFT 2 /* LDO3_UV_EINT */
720#define WM8400_LDO3_UV_EINT_WIDTH 1 /* LDO3_UV_EINT */
721#define WM8400_LDO2_UV_EINT 0x0002 /* LDO2_UV_EINT */
722#define WM8400_LDO2_UV_EINT_MASK 0x0002 /* LDO2_UV_EINT */
723#define WM8400_LDO2_UV_EINT_SHIFT 1 /* LDO2_UV_EINT */
724#define WM8400_LDO2_UV_EINT_WIDTH 1 /* LDO2_UV_EINT */
725#define WM8400_LDO1_UV_EINT 0x0001 /* LDO1_UV_EINT */
726#define WM8400_LDO1_UV_EINT_MASK 0x0001 /* LDO1_UV_EINT */
727#define WM8400_LDO1_UV_EINT_SHIFT 0 /* LDO1_UV_EINT */
728#define WM8400_LDO1_UV_EINT_WIDTH 1 /* LDO1_UV_EINT */
729
730/*
731 * R80 (0x50) - Interrupt Status 1 Mask
732 */
733#define WM8400_IM_MICD_CINT 0x8000 /* IM_MICD_CINT */
734#define WM8400_IM_MICD_CINT_MASK 0x8000 /* IM_MICD_CINT */
735#define WM8400_IM_MICD_CINT_SHIFT 15 /* IM_MICD_CINT */
736#define WM8400_IM_MICD_CINT_WIDTH 1 /* IM_MICD_CINT */
737#define WM8400_IM_MICSCD_CINT 0x4000 /* IM_MICSCD_CINT */
738#define WM8400_IM_MICSCD_CINT_MASK 0x4000 /* IM_MICSCD_CINT */
739#define WM8400_IM_MICSCD_CINT_SHIFT 14 /* IM_MICSCD_CINT */
740#define WM8400_IM_MICSCD_CINT_WIDTH 1 /* IM_MICSCD_CINT */
741#define WM8400_IM_JDL_CINT 0x2000 /* IM_JDL_CINT */
742#define WM8400_IM_JDL_CINT_MASK 0x2000 /* IM_JDL_CINT */
743#define WM8400_IM_JDL_CINT_SHIFT 13 /* IM_JDL_CINT */
744#define WM8400_IM_JDL_CINT_WIDTH 1 /* IM_JDL_CINT */
745#define WM8400_IM_JDR_CINT 0x1000 /* IM_JDR_CINT */
746#define WM8400_IM_JDR_CINT_MASK 0x1000 /* IM_JDR_CINT */
747#define WM8400_IM_JDR_CINT_SHIFT 12 /* IM_JDR_CINT */
748#define WM8400_IM_JDR_CINT_WIDTH 1 /* IM_JDR_CINT */
749#define WM8400_IM_CODEC_SEQ_END_EINT 0x0800 /* IM_CODEC_SEQ_END_EINT */
750#define WM8400_IM_CODEC_SEQ_END_EINT_MASK 0x0800 /* IM_CODEC_SEQ_END_EINT */
751#define WM8400_IM_CODEC_SEQ_END_EINT_SHIFT 11 /* IM_CODEC_SEQ_END_EINT */
752#define WM8400_IM_CODEC_SEQ_END_EINT_WIDTH 1 /* IM_CODEC_SEQ_END_EINT */
753#define WM8400_IM_CDEL_TO_EINT 0x0400 /* IM_CDEL_TO_EINT */
754#define WM8400_IM_CDEL_TO_EINT_MASK 0x0400 /* IM_CDEL_TO_EINT */
755#define WM8400_IM_CDEL_TO_EINT_SHIFT 10 /* IM_CDEL_TO_EINT */
756#define WM8400_IM_CDEL_TO_EINT_WIDTH 1 /* IM_CDEL_TO_EINT */
757#define WM8400_IM_CHIP_GT150_EINT 0x0200 /* IM_CHIP_GT150_EINT */
758#define WM8400_IM_CHIP_GT150_EINT_MASK 0x0200 /* IM_CHIP_GT150_EINT */
759#define WM8400_IM_CHIP_GT150_EINT_SHIFT 9 /* IM_CHIP_GT150_EINT */
760#define WM8400_IM_CHIP_GT150_EINT_WIDTH 1 /* IM_CHIP_GT150_EINT */
761#define WM8400_IM_CHIP_GT115_EINT 0x0100 /* IM_CHIP_GT115_EINT */
762#define WM8400_IM_CHIP_GT115_EINT_MASK 0x0100 /* IM_CHIP_GT115_EINT */
763#define WM8400_IM_CHIP_GT115_EINT_SHIFT 8 /* IM_CHIP_GT115_EINT */
764#define WM8400_IM_CHIP_GT115_EINT_WIDTH 1 /* IM_CHIP_GT115_EINT */
765#define WM8400_IM_LINE_CMP_EINT 0x0080 /* IM_LINE_CMP_EINT */
766#define WM8400_IM_LINE_CMP_EINT_MASK 0x0080 /* IM_LINE_CMP_EINT */
767#define WM8400_IM_LINE_CMP_EINT_SHIFT 7 /* IM_LINE_CMP_EINT */
768#define WM8400_IM_LINE_CMP_EINT_WIDTH 1 /* IM_LINE_CMP_EINT */
769#define WM8400_IM_UVLO_EINT 0x0040 /* IM_UVLO_EINT */
770#define WM8400_IM_UVLO_EINT_MASK 0x0040 /* IM_UVLO_EINT */
771#define WM8400_IM_UVLO_EINT_SHIFT 6 /* IM_UVLO_EINT */
772#define WM8400_IM_UVLO_EINT_WIDTH 1 /* IM_UVLO_EINT */
773#define WM8400_IM_DC2_UV_EINT 0x0020 /* IM_DC2_UV_EINT */
774#define WM8400_IM_DC2_UV_EINT_MASK 0x0020 /* IM_DC2_UV_EINT */
775#define WM8400_IM_DC2_UV_EINT_SHIFT 5 /* IM_DC2_UV_EINT */
776#define WM8400_IM_DC2_UV_EINT_WIDTH 1 /* IM_DC2_UV_EINT */
777#define WM8400_IM_DC1_UV_EINT 0x0010 /* IM_DC1_UV_EINT */
778#define WM8400_IM_DC1_UV_EINT_MASK 0x0010 /* IM_DC1_UV_EINT */
779#define WM8400_IM_DC1_UV_EINT_SHIFT 4 /* IM_DC1_UV_EINT */
780#define WM8400_IM_DC1_UV_EINT_WIDTH 1 /* IM_DC1_UV_EINT */
781#define WM8400_IM_LDO4_UV_EINT 0x0008 /* IM_LDO4_UV_EINT */
782#define WM8400_IM_LDO4_UV_EINT_MASK 0x0008 /* IM_LDO4_UV_EINT */
783#define WM8400_IM_LDO4_UV_EINT_SHIFT 3 /* IM_LDO4_UV_EINT */
784#define WM8400_IM_LDO4_UV_EINT_WIDTH 1 /* IM_LDO4_UV_EINT */
785#define WM8400_IM_LDO3_UV_EINT 0x0004 /* IM_LDO3_UV_EINT */
786#define WM8400_IM_LDO3_UV_EINT_MASK 0x0004 /* IM_LDO3_UV_EINT */
787#define WM8400_IM_LDO3_UV_EINT_SHIFT 2 /* IM_LDO3_UV_EINT */
788#define WM8400_IM_LDO3_UV_EINT_WIDTH 1 /* IM_LDO3_UV_EINT */
789#define WM8400_IM_LDO2_UV_EINT 0x0002 /* IM_LDO2_UV_EINT */
790#define WM8400_IM_LDO2_UV_EINT_MASK 0x0002 /* IM_LDO2_UV_EINT */
791#define WM8400_IM_LDO2_UV_EINT_SHIFT 1 /* IM_LDO2_UV_EINT */
792#define WM8400_IM_LDO2_UV_EINT_WIDTH 1 /* IM_LDO2_UV_EINT */
793#define WM8400_IM_LDO1_UV_EINT 0x0001 /* IM_LDO1_UV_EINT */
794#define WM8400_IM_LDO1_UV_EINT_MASK 0x0001 /* IM_LDO1_UV_EINT */
795#define WM8400_IM_LDO1_UV_EINT_SHIFT 0 /* IM_LDO1_UV_EINT */
796#define WM8400_IM_LDO1_UV_EINT_WIDTH 1 /* IM_LDO1_UV_EINT */
797
798/*
799 * R81 (0x51) - Interrupt Levels
800 */
801#define WM8400_MICD_LVL 0x8000 /* MICD_LVL */
802#define WM8400_MICD_LVL_MASK 0x8000 /* MICD_LVL */
803#define WM8400_MICD_LVL_SHIFT 15 /* MICD_LVL */
804#define WM8400_MICD_LVL_WIDTH 1 /* MICD_LVL */
805#define WM8400_MICSCD_LVL 0x4000 /* MICSCD_LVL */
806#define WM8400_MICSCD_LVL_MASK 0x4000 /* MICSCD_LVL */
807#define WM8400_MICSCD_LVL_SHIFT 14 /* MICSCD_LVL */
808#define WM8400_MICSCD_LVL_WIDTH 1 /* MICSCD_LVL */
809#define WM8400_JDL_LVL 0x2000 /* JDL_LVL */
810#define WM8400_JDL_LVL_MASK 0x2000 /* JDL_LVL */
811#define WM8400_JDL_LVL_SHIFT 13 /* JDL_LVL */
812#define WM8400_JDL_LVL_WIDTH 1 /* JDL_LVL */
813#define WM8400_JDR_LVL 0x1000 /* JDR_LVL */
814#define WM8400_JDR_LVL_MASK 0x1000 /* JDR_LVL */
815#define WM8400_JDR_LVL_SHIFT 12 /* JDR_LVL */
816#define WM8400_JDR_LVL_WIDTH 1 /* JDR_LVL */
817#define WM8400_CODEC_SEQ_END_LVL 0x0800 /* CODEC_SEQ_END_LVL */
818#define WM8400_CODEC_SEQ_END_LVL_MASK 0x0800 /* CODEC_SEQ_END_LVL */
819#define WM8400_CODEC_SEQ_END_LVL_SHIFT 11 /* CODEC_SEQ_END_LVL */
820#define WM8400_CODEC_SEQ_END_LVL_WIDTH 1 /* CODEC_SEQ_END_LVL */
821#define WM8400_CDEL_TO_LVL 0x0400 /* CDEL_TO_LVL */
822#define WM8400_CDEL_TO_LVL_MASK 0x0400 /* CDEL_TO_LVL */
823#define WM8400_CDEL_TO_LVL_SHIFT 10 /* CDEL_TO_LVL */
824#define WM8400_CDEL_TO_LVL_WIDTH 1 /* CDEL_TO_LVL */
825#define WM8400_CHIP_GT150_LVL 0x0200 /* CHIP_GT150_LVL */
826#define WM8400_CHIP_GT150_LVL_MASK 0x0200 /* CHIP_GT150_LVL */
827#define WM8400_CHIP_GT150_LVL_SHIFT 9 /* CHIP_GT150_LVL */
828#define WM8400_CHIP_GT150_LVL_WIDTH 1 /* CHIP_GT150_LVL */
829#define WM8400_CHIP_GT115_LVL 0x0100 /* CHIP_GT115_LVL */
830#define WM8400_CHIP_GT115_LVL_MASK 0x0100 /* CHIP_GT115_LVL */
831#define WM8400_CHIP_GT115_LVL_SHIFT 8 /* CHIP_GT115_LVL */
832#define WM8400_CHIP_GT115_LVL_WIDTH 1 /* CHIP_GT115_LVL */
833#define WM8400_LINE_CMP_LVL 0x0080 /* LINE_CMP_LVL */
834#define WM8400_LINE_CMP_LVL_MASK 0x0080 /* LINE_CMP_LVL */
835#define WM8400_LINE_CMP_LVL_SHIFT 7 /* LINE_CMP_LVL */
836#define WM8400_LINE_CMP_LVL_WIDTH 1 /* LINE_CMP_LVL */
837#define WM8400_UVLO_LVL 0x0040 /* UVLO_LVL */
838#define WM8400_UVLO_LVL_MASK 0x0040 /* UVLO_LVL */
839#define WM8400_UVLO_LVL_SHIFT 6 /* UVLO_LVL */
840#define WM8400_UVLO_LVL_WIDTH 1 /* UVLO_LVL */
841#define WM8400_DC2_UV_LVL 0x0020 /* DC2_UV_LVL */
842#define WM8400_DC2_UV_LVL_MASK 0x0020 /* DC2_UV_LVL */
843#define WM8400_DC2_UV_LVL_SHIFT 5 /* DC2_UV_LVL */
844#define WM8400_DC2_UV_LVL_WIDTH 1 /* DC2_UV_LVL */
845#define WM8400_DC1_UV_LVL 0x0010 /* DC1_UV_LVL */
846#define WM8400_DC1_UV_LVL_MASK 0x0010 /* DC1_UV_LVL */
847#define WM8400_DC1_UV_LVL_SHIFT 4 /* DC1_UV_LVL */
848#define WM8400_DC1_UV_LVL_WIDTH 1 /* DC1_UV_LVL */
849#define WM8400_LDO4_UV_LVL 0x0008 /* LDO4_UV_LVL */
850#define WM8400_LDO4_UV_LVL_MASK 0x0008 /* LDO4_UV_LVL */
851#define WM8400_LDO4_UV_LVL_SHIFT 3 /* LDO4_UV_LVL */
852#define WM8400_LDO4_UV_LVL_WIDTH 1 /* LDO4_UV_LVL */
853#define WM8400_LDO3_UV_LVL 0x0004 /* LDO3_UV_LVL */
854#define WM8400_LDO3_UV_LVL_MASK 0x0004 /* LDO3_UV_LVL */
855#define WM8400_LDO3_UV_LVL_SHIFT 2 /* LDO3_UV_LVL */
856#define WM8400_LDO3_UV_LVL_WIDTH 1 /* LDO3_UV_LVL */
857#define WM8400_LDO2_UV_LVL 0x0002 /* LDO2_UV_LVL */
858#define WM8400_LDO2_UV_LVL_MASK 0x0002 /* LDO2_UV_LVL */
859#define WM8400_LDO2_UV_LVL_SHIFT 1 /* LDO2_UV_LVL */
860#define WM8400_LDO2_UV_LVL_WIDTH 1 /* LDO2_UV_LVL */
861#define WM8400_LDO1_UV_LVL 0x0001 /* LDO1_UV_LVL */
862#define WM8400_LDO1_UV_LVL_MASK 0x0001 /* LDO1_UV_LVL */
863#define WM8400_LDO1_UV_LVL_SHIFT 0 /* LDO1_UV_LVL */
864#define WM8400_LDO1_UV_LVL_WIDTH 1 /* LDO1_UV_LVL */
865
866/*
867 * R82 (0x52) - Shutdown Reason
868 */
869#define WM8400_SDR_CHIP_SOFTSD 0x2000 /* SDR_CHIP_SOFTSD */
870#define WM8400_SDR_CHIP_SOFTSD_MASK 0x2000 /* SDR_CHIP_SOFTSD */
871#define WM8400_SDR_CHIP_SOFTSD_SHIFT 13 /* SDR_CHIP_SOFTSD */
872#define WM8400_SDR_CHIP_SOFTSD_WIDTH 1 /* SDR_CHIP_SOFTSD */
873#define WM8400_SDR_NPDN 0x0800 /* SDR_NPDN */
874#define WM8400_SDR_NPDN_MASK 0x0800 /* SDR_NPDN */
875#define WM8400_SDR_NPDN_SHIFT 11 /* SDR_NPDN */
876#define WM8400_SDR_NPDN_WIDTH 1 /* SDR_NPDN */
877#define WM8400_SDR_CHIP_GT150 0x0200 /* SDR_CHIP_GT150 */
878#define WM8400_SDR_CHIP_GT150_MASK 0x0200 /* SDR_CHIP_GT150 */
879#define WM8400_SDR_CHIP_GT150_SHIFT 9 /* SDR_CHIP_GT150 */
880#define WM8400_SDR_CHIP_GT150_WIDTH 1 /* SDR_CHIP_GT150 */
881#define WM8400_SDR_CHIP_GT115 0x0100 /* SDR_CHIP_GT115 */
882#define WM8400_SDR_CHIP_GT115_MASK 0x0100 /* SDR_CHIP_GT115 */
883#define WM8400_SDR_CHIP_GT115_SHIFT 8 /* SDR_CHIP_GT115 */
884#define WM8400_SDR_CHIP_GT115_WIDTH 1 /* SDR_CHIP_GT115 */
885#define WM8400_SDR_LINE_CMP 0x0080 /* SDR_LINE_CMP */
886#define WM8400_SDR_LINE_CMP_MASK 0x0080 /* SDR_LINE_CMP */
887#define WM8400_SDR_LINE_CMP_SHIFT 7 /* SDR_LINE_CMP */
888#define WM8400_SDR_LINE_CMP_WIDTH 1 /* SDR_LINE_CMP */
889#define WM8400_SDR_UVLO 0x0040 /* SDR_UVLO */
890#define WM8400_SDR_UVLO_MASK 0x0040 /* SDR_UVLO */
891#define WM8400_SDR_UVLO_SHIFT 6 /* SDR_UVLO */
892#define WM8400_SDR_UVLO_WIDTH 1 /* SDR_UVLO */
893#define WM8400_SDR_DC2_UV 0x0020 /* SDR_DC2_UV */
894#define WM8400_SDR_DC2_UV_MASK 0x0020 /* SDR_DC2_UV */
895#define WM8400_SDR_DC2_UV_SHIFT 5 /* SDR_DC2_UV */
896#define WM8400_SDR_DC2_UV_WIDTH 1 /* SDR_DC2_UV */
897#define WM8400_SDR_DC1_UV 0x0010 /* SDR_DC1_UV */
898#define WM8400_SDR_DC1_UV_MASK 0x0010 /* SDR_DC1_UV */
899#define WM8400_SDR_DC1_UV_SHIFT 4 /* SDR_DC1_UV */
900#define WM8400_SDR_DC1_UV_WIDTH 1 /* SDR_DC1_UV */
901#define WM8400_SDR_LDO4_UV 0x0008 /* SDR_LDO4_UV */
902#define WM8400_SDR_LDO4_UV_MASK 0x0008 /* SDR_LDO4_UV */
903#define WM8400_SDR_LDO4_UV_SHIFT 3 /* SDR_LDO4_UV */
904#define WM8400_SDR_LDO4_UV_WIDTH 1 /* SDR_LDO4_UV */
905#define WM8400_SDR_LDO3_UV 0x0004 /* SDR_LDO3_UV */
906#define WM8400_SDR_LDO3_UV_MASK 0x0004 /* SDR_LDO3_UV */
907#define WM8400_SDR_LDO3_UV_SHIFT 2 /* SDR_LDO3_UV */
908#define WM8400_SDR_LDO3_UV_WIDTH 1 /* SDR_LDO3_UV */
909#define WM8400_SDR_LDO2_UV 0x0002 /* SDR_LDO2_UV */
910#define WM8400_SDR_LDO2_UV_MASK 0x0002 /* SDR_LDO2_UV */
911#define WM8400_SDR_LDO2_UV_SHIFT 1 /* SDR_LDO2_UV */
912#define WM8400_SDR_LDO2_UV_WIDTH 1 /* SDR_LDO2_UV */
913#define WM8400_SDR_LDO1_UV 0x0001 /* SDR_LDO1_UV */
914#define WM8400_SDR_LDO1_UV_MASK 0x0001 /* SDR_LDO1_UV */
915#define WM8400_SDR_LDO1_UV_SHIFT 0 /* SDR_LDO1_UV */
916#define WM8400_SDR_LDO1_UV_WIDTH 1 /* SDR_LDO1_UV */
917
918/*
919 * R84 (0x54) - Line Circuits
920 */
921#define WM8400_BG_LINE_COMP 0x8000 /* BG_LINE_COMP */
922#define WM8400_BG_LINE_COMP_MASK 0x8000 /* BG_LINE_COMP */
923#define WM8400_BG_LINE_COMP_SHIFT 15 /* BG_LINE_COMP */
924#define WM8400_BG_LINE_COMP_WIDTH 1 /* BG_LINE_COMP */
925#define WM8400_LINE_CMP_VTHI_MASK 0x00F0 /* LINE_CMP_VTHI - [7:4] */
926#define WM8400_LINE_CMP_VTHI_SHIFT 4 /* LINE_CMP_VTHI - [7:4] */
927#define WM8400_LINE_CMP_VTHI_WIDTH 4 /* LINE_CMP_VTHI - [7:4] */
928#define WM8400_LINE_CMP_VTHD_MASK 0x000F /* LINE_CMP_VTHD - [3:0] */
929#define WM8400_LINE_CMP_VTHD_SHIFT 0 /* LINE_CMP_VTHD - [3:0] */
930#define WM8400_LINE_CMP_VTHD_WIDTH 4 /* LINE_CMP_VTHD - [3:0] */
931
932u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg);
933int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data);
934int wm8400_set_bits(struct wm8400 *wm8400, u8 reg, u16 mask, u16 val);
935
936#endif
diff --git a/include/linux/mfd/wm8400.h b/include/linux/mfd/wm8400.h
new file mode 100644
index 000000000000..b46b566ac1ac
--- /dev/null
+++ b/include/linux/mfd/wm8400.h
@@ -0,0 +1,40 @@
1/*
2 * wm8400 client interface
3 *
4 * Copyright 2008 Wolfson Microelectronics plc
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
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef __LINUX_MFD_WM8400_H
22#define __LINUX_MFD_WM8400_H
23
24#include <linux/regulator/machine.h>
25
26#define WM8400_LDO1 0
27#define WM8400_LDO2 1
28#define WM8400_LDO3 2
29#define WM8400_LDO4 3
30#define WM8400_DCDC1 4
31#define WM8400_DCDC2 5
32
33struct wm8400_platform_data {
34 int (*platform_init)(struct device *dev);
35};
36
37int wm8400_register_regulator(struct device *dev, int reg,
38 struct regulator_init_data *initdata);
39
40#endif
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 655ea0d1ee14..b2f944468313 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -141,6 +141,10 @@ enum {
141 MLX4_STAT_RATE_OFFSET = 5 141 MLX4_STAT_RATE_OFFSET = 5
142}; 142};
143 143
144enum {
145 MLX4_MTT_FLAG_PRESENT = 1
146};
147
144static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 148static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
145{ 149{
146 return (major << 32) | (minor << 16) | subminor; 150 return (major << 32) | (minor << 16) | subminor;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 72a15dc26bbf..c61ba10768ea 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -7,6 +7,7 @@
7 7
8#include <linux/gfp.h> 8#include <linux/gfp.h>
9#include <linux/list.h> 9#include <linux/list.h>
10#include <linux/mmdebug.h>
10#include <linux/mmzone.h> 11#include <linux/mmzone.h>
11#include <linux/rbtree.h> 12#include <linux/rbtree.h>
12#include <linux/prio_tree.h> 13#include <linux/prio_tree.h>
@@ -219,12 +220,6 @@ struct inode;
219 */ 220 */
220#include <linux/page-flags.h> 221#include <linux/page-flags.h>
221 222
222#ifdef CONFIG_DEBUG_VM
223#define VM_BUG_ON(cond) BUG_ON(cond)
224#else
225#define VM_BUG_ON(condition) do { } while(0)
226#endif
227
228/* 223/*
229 * Methods to modify the page usage count. 224 * Methods to modify the page usage count.
230 * 225 *
@@ -919,7 +914,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
919} 914}
920#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ 915#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
921 916
922#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 917#if USE_SPLIT_PTLOCKS
923/* 918/*
924 * We tuck a spinlock to guard each pagetable page into its struct page, 919 * We tuck a spinlock to guard each pagetable page into its struct page,
925 * at page->private, with BUILD_BUG_ON to make sure that this will not 920 * at page->private, with BUILD_BUG_ON to make sure that this will not
@@ -932,14 +927,14 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
932} while (0) 927} while (0)
933#define pte_lock_deinit(page) ((page)->mapping = NULL) 928#define pte_lock_deinit(page) ((page)->mapping = NULL)
934#define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));}) 929#define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));})
935#else 930#else /* !USE_SPLIT_PTLOCKS */
936/* 931/*
937 * We use mm->page_table_lock to guard all pagetable pages of the mm. 932 * We use mm->page_table_lock to guard all pagetable pages of the mm.
938 */ 933 */
939#define pte_lock_init(page) do {} while (0) 934#define pte_lock_init(page) do {} while (0)
940#define pte_lock_deinit(page) do {} while (0) 935#define pte_lock_deinit(page) do {} while (0)
941#define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) 936#define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;})
942#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 937#endif /* USE_SPLIT_PTLOCKS */
943 938
944static inline void pgtable_page_ctor(struct page *page) 939static inline void pgtable_page_ctor(struct page *page)
945{ 940{
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index bf334138c7c1..9d49fa36bbef 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -21,11 +21,13 @@
21 21
22struct address_space; 22struct address_space;
23 23
24#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 24#define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
25
26#if USE_SPLIT_PTLOCKS
25typedef atomic_long_t mm_counter_t; 27typedef atomic_long_t mm_counter_t;
26#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 28#else /* !USE_SPLIT_PTLOCKS */
27typedef unsigned long mm_counter_t; 29typedef unsigned long mm_counter_t;
28#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 30#endif /* !USE_SPLIT_PTLOCKS */
29 31
30/* 32/*
31 * Each physical page in the system has a struct page associated with 33 * Each physical page in the system has a struct page associated with
@@ -65,7 +67,7 @@ struct page {
65 * see PAGE_MAPPING_ANON below. 67 * see PAGE_MAPPING_ANON below.
66 */ 68 */
67 }; 69 };
68#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 70#if USE_SPLIT_PTLOCKS
69 spinlock_t ptl; 71 spinlock_t ptl;
70#endif 72#endif
71 struct kmem_cache *slab; /* SLUB: Pointer to slab */ 73 struct kmem_cache *slab; /* SLUB: Pointer to slab */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 9c288c909878..bde891f64591 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -65,7 +65,7 @@ struct mmc_host_ops {
65 * -ENOSYS when not supported (equal to NULL callback) 65 * -ENOSYS when not supported (equal to NULL callback)
66 * or a negative errno value when something bad happened 66 * or a negative errno value when something bad happened
67 * 67 *
68 * Return values for the get_ro callback should be: 68 * Return values for the get_cd callback should be:
69 * 0 for a absent card 69 * 0 for a absent card
70 * 1 for a present card 70 * 1 for a present card
71 * -ENOSYS when not supported (equal to NULL callback) 71 * -ENOSYS when not supported (equal to NULL callback)
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
new file mode 100644
index 000000000000..8a5509877192
--- /dev/null
+++ b/include/linux/mmdebug.h
@@ -0,0 +1,18 @@
1#ifndef LINUX_MM_DEBUG_H
2#define LINUX_MM_DEBUG_H 1
3
4#include <linux/autoconf.h>
5
6#ifdef CONFIG_DEBUG_VM
7#define VM_BUG_ON(cond) BUG_ON(cond)
8#else
9#define VM_BUG_ON(cond) do { } while (0)
10#endif
11
12#ifdef CONFIG_DEBUG_VIRTUAL
13#define VIRTUAL_BUG_ON(cond) BUG_ON(cond)
14#else
15#define VIRTUAL_BUG_ON(cond) do { } while (0)
16#endif
17
18#endif
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 443bc7cd8c62..428328a05fa1 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -751,8 +751,9 @@ static inline int zonelist_node_idx(struct zoneref *zoneref)
751 * 751 *
752 * This function returns the next zone at or below a given zone index that is 752 * This function returns the next zone at or below a given zone index that is
753 * within the allowed nodemask using a cursor as the starting point for the 753 * within the allowed nodemask using a cursor as the starting point for the
754 * search. The zoneref returned is a cursor that is used as the next starting 754 * search. The zoneref returned is a cursor that represents the current zone
755 * point for future calls to next_zones_zonelist(). 755 * being examined. It should be advanced by one before calling
756 * next_zones_zonelist again.
756 */ 757 */
757struct zoneref *next_zones_zonelist(struct zoneref *z, 758struct zoneref *next_zones_zonelist(struct zoneref *z,
758 enum zone_type highest_zoneidx, 759 enum zone_type highest_zoneidx,
@@ -768,9 +769,8 @@ struct zoneref *next_zones_zonelist(struct zoneref *z,
768 * 769 *
769 * This function returns the first zone at or below a given zone index that is 770 * This function returns the first zone at or below a given zone index that is
770 * within the allowed nodemask. The zoneref returned is a cursor that can be 771 * within the allowed nodemask. The zoneref returned is a cursor that can be
771 * used to iterate the zonelist with next_zones_zonelist. The cursor should 772 * used to iterate the zonelist with next_zones_zonelist by advancing it by
772 * not be used by the caller as it does not match the value of the zone 773 * one before calling.
773 * returned.
774 */ 774 */
775static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, 775static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
776 enum zone_type highest_zoneidx, 776 enum zone_type highest_zoneidx,
@@ -795,7 +795,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
795#define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ 795#define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \
796 for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ 796 for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \
797 zone; \ 797 zone; \
798 z = next_zones_zonelist(z, highidx, nodemask, &zone)) \ 798 z = next_zones_zonelist(++z, highidx, nodemask, &zone)) \
799 799
800/** 800/**
801 * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index 801 * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index c4db5827963d..eb71b45fdf5a 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -131,6 +131,16 @@ struct usb_device_id {
131#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 131#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
132#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 132#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
133 133
134#define HID_ANY_ID (~0)
135
136struct hid_device_id {
137 __u16 bus;
138 __u32 vendor;
139 __u32 product;
140 kernel_ulong_t driver_data
141 __attribute__((aligned(sizeof(kernel_ulong_t))));
142};
143
134/* s390 CCW devices */ 144/* s390 CCW devices */
135struct ccw_device_id { 145struct ccw_device_id {
136 __u16 match_flags; /* which fields to match against */ 146 __u16 match_flags; /* which fields to match against */
@@ -274,7 +284,7 @@ struct pcmcia_device_id {
274/* Input */ 284/* Input */
275#define INPUT_DEVICE_ID_EV_MAX 0x1f 285#define INPUT_DEVICE_ID_EV_MAX 0x1f
276#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 286#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71
277#define INPUT_DEVICE_ID_KEY_MAX 0x1ff 287#define INPUT_DEVICE_ID_KEY_MAX 0x2ff
278#define INPUT_DEVICE_ID_REL_MAX 0x0f 288#define INPUT_DEVICE_ID_REL_MAX 0x0f
279#define INPUT_DEVICE_ID_ABS_MAX 0x3f 289#define INPUT_DEVICE_ID_ABS_MAX 0x3f
280#define INPUT_DEVICE_ID_MSC_MAX 0x07 290#define INPUT_DEVICE_ID_MSC_MAX 0x07
@@ -388,5 +398,52 @@ struct i2c_device_id {
388 __attribute__((aligned(sizeof(kernel_ulong_t)))); 398 __attribute__((aligned(sizeof(kernel_ulong_t))));
389}; 399};
390 400
401/* dmi */
402enum dmi_field {
403 DMI_NONE,
404 DMI_BIOS_VENDOR,
405 DMI_BIOS_VERSION,
406 DMI_BIOS_DATE,
407 DMI_SYS_VENDOR,
408 DMI_PRODUCT_NAME,
409 DMI_PRODUCT_VERSION,
410 DMI_PRODUCT_SERIAL,
411 DMI_PRODUCT_UUID,
412 DMI_BOARD_VENDOR,
413 DMI_BOARD_NAME,
414 DMI_BOARD_VERSION,
415 DMI_BOARD_SERIAL,
416 DMI_BOARD_ASSET_TAG,
417 DMI_CHASSIS_VENDOR,
418 DMI_CHASSIS_TYPE,
419 DMI_CHASSIS_VERSION,
420 DMI_CHASSIS_SERIAL,
421 DMI_CHASSIS_ASSET_TAG,
422 DMI_STRING_MAX,
423};
424
425struct dmi_strmatch {
426 unsigned char slot;
427 char substr[79];
428};
429
430#ifndef __KERNEL__
431struct dmi_system_id {
432 kernel_ulong_t callback;
433 kernel_ulong_t ident;
434 struct dmi_strmatch matches[4];
435 kernel_ulong_t driver_data
436 __attribute__((aligned(sizeof(kernel_ulong_t))));
437};
438#else
439struct dmi_system_id {
440 int (*callback)(const struct dmi_system_id *);
441 const char *ident;
442 struct dmi_strmatch matches[4];
443 void *driver_data;
444};
445#endif
446
447#define DMI_MATCH(a, b) { a, b }
391 448
392#endif /* LINUX_MOD_DEVICETABLE_H */ 449#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index 68e09557c951..a41555cbe00a 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -345,7 +345,6 @@ struct module
345 /* Reference counts */ 345 /* Reference counts */
346 struct module_ref ref[NR_CPUS]; 346 struct module_ref ref[NR_CPUS];
347#endif 347#endif
348
349}; 348};
350#ifndef MODULE_ARCH_INIT 349#ifndef MODULE_ARCH_INIT
351#define MODULE_ARCH_INIT {} 350#define MODULE_ARCH_INIT {}
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 30a1d63b6fb5..cab2a85e2ee8 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -5,8 +5,6 @@
5 * 5 *
6 * Author: Marco van Wieringen <mvw@planets.elm.net> 6 * Author: Marco van Wieringen <mvw@planets.elm.net>
7 * 7 *
8 * Version: $Id: mount.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $
9 *
10 */ 8 */
11#ifndef _LINUX_MOUNT_H 9#ifndef _LINUX_MOUNT_H
12#define _LINUX_MOUNT_H 10#define _LINUX_MOUNT_H
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 07112ee9293a..8a455694d682 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -6,7 +6,6 @@
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7#include <linux/in.h> 7#include <linux/in.h>
8#endif 8#endif
9#include <linux/pim.h>
10 9
11/* 10/*
12 * Based on the MROUTING 3.5 defines primarily to keep 11 * Based on the MROUTING 3.5 defines primarily to keep
@@ -130,6 +129,7 @@ struct igmpmsg
130 */ 129 */
131 130
132#ifdef __KERNEL__ 131#ifdef __KERNEL__
132#include <linux/pim.h>
133#include <net/sock.h> 133#include <net/sock.h>
134 134
135#ifdef CONFIG_IP_MROUTE 135#ifdef CONFIG_IP_MROUTE
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index 5cf50473a10f..6f4c180179e2 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -115,6 +115,7 @@ struct sioc_mif_req6
115 115
116#ifdef __KERNEL__ 116#ifdef __KERNEL__
117 117
118#include <linux/pim.h>
118#include <linux/skbuff.h> /* for struct sk_buff_head */ 119#include <linux/skbuff.h> /* for struct sk_buff_head */
119 120
120#ifdef CONFIG_IPV6_MROUTE 121#ifdef CONFIG_IPV6_MROUTE
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index 310e61606415..8b4aa0523db7 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -41,6 +41,8 @@ struct mtd_blktrans_ops {
41 unsigned long block, char *buffer); 41 unsigned long block, char *buffer);
42 int (*writesect)(struct mtd_blktrans_dev *dev, 42 int (*writesect)(struct mtd_blktrans_dev *dev,
43 unsigned long block, char *buffer); 43 unsigned long block, char *buffer);
44 int (*discard)(struct mtd_blktrans_dev *dev,
45 unsigned long block, unsigned nr_blocks);
44 46
45 /* Block layer ioctls */ 47 /* Block layer ioctls */
46 int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); 48 int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo);
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 12078577aef6..cbbbe9bfecad 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -17,9 +17,14 @@
17 17
18struct mv643xx_eth_shared_platform_data { 18struct mv643xx_eth_shared_platform_data {
19 struct mbus_dram_target_info *dram; 19 struct mbus_dram_target_info *dram;
20 struct platform_device *shared_smi;
20 unsigned int t_clk; 21 unsigned int t_clk;
21}; 22};
22 23
24#define MV643XX_ETH_PHY_ADDR_DEFAULT 0
25#define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x))
26#define MV643XX_ETH_PHY_NONE 0xff
27
23struct mv643xx_eth_platform_data { 28struct mv643xx_eth_platform_data {
24 /* 29 /*
25 * Pointer back to our parent instance, and our port number. 30 * Pointer back to our parent instance, and our port number.
@@ -30,8 +35,6 @@ struct mv643xx_eth_platform_data {
30 /* 35 /*
31 * Whether a PHY is present, and if yes, at which address. 36 * Whether a PHY is present, and if yes, at which address.
32 */ 37 */
33 struct platform_device *shared_smi;
34 int force_phy_addr;
35 int phy_addr; 38 int phy_addr;
36 39
37 /* 40 /*
@@ -49,10 +52,10 @@ struct mv643xx_eth_platform_data {
49 int duplex; 52 int duplex;
50 53
51 /* 54 /*
52 * Which RX/TX queues to use. 55 * How many RX/TX queues to use.
53 */ 56 */
54 int rx_queue_mask; 57 int rx_queue_count;
55 int tx_queue_mask; 58 int tx_queue_count;
56 59
57 /* 60 /*
58 * Override default RX/TX queue sizes if nonzero. 61 * Override default RX/TX queue sizes if nonzero.
diff --git a/include/linux/net.h b/include/linux/net.h
index 4a9a30f2d68f..6dc14a240042 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -18,16 +18,9 @@
18#ifndef _LINUX_NET_H 18#ifndef _LINUX_NET_H
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/wait.h>
22#include <linux/socket.h> 21#include <linux/socket.h>
23#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */
24#include <asm/socket.h> 22#include <asm/socket.h>
25 23
26struct poll_table_struct;
27struct pipe_inode_info;
28struct inode;
29struct net;
30
31#define NPROTO AF_MAX 24#define NPROTO AF_MAX
32 25
33#define SYS_SOCKET 1 /* sys_socket(2) */ 26#define SYS_SOCKET 1 /* sys_socket(2) */
@@ -62,6 +55,13 @@ typedef enum {
62#ifdef __KERNEL__ 55#ifdef __KERNEL__
63#include <linux/stringify.h> 56#include <linux/stringify.h>
64#include <linux/random.h> 57#include <linux/random.h>
58#include <linux/wait.h>
59#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */
60
61struct poll_table_struct;
62struct pipe_inode_info;
63struct inode;
64struct net;
65 65
66#define SOCK_ASYNC_NOSPACE 0 66#define SOCK_ASYNC_NOSPACE 0
67#define SOCK_ASYNC_WAITDATA 1 67#define SOCK_ASYNC_WAITDATA 1
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 488c56e649b5..64875859d654 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -11,7 +11,7 @@
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Corey Minyard <wf-rch!minyard@relay.EU.net> 12 * Corey Minyard <wf-rch!minyard@relay.EU.net>
13 * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov> 13 * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov>
14 * Alan Cox, <Alan.Cox@linux.org> 14 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
15 * Bjorn Ekwall. <bj0rn@blox.se> 15 * Bjorn Ekwall. <bj0rn@blox.se>
16 * Pekka Riikonen <priikone@poseidon.pspt.fi> 16 * Pekka Riikonen <priikone@poseidon.pspt.fi>
17 * 17 *
@@ -42,6 +42,7 @@
42#include <linux/workqueue.h> 42#include <linux/workqueue.h>
43 43
44#include <net/net_namespace.h> 44#include <net/net_namespace.h>
45#include <net/dsa.h>
45 46
46struct vlan_group; 47struct vlan_group;
47struct ethtool_ops; 48struct ethtool_ops;
@@ -471,6 +472,8 @@ struct net_device
471 char name[IFNAMSIZ]; 472 char name[IFNAMSIZ];
472 /* device name hash chain */ 473 /* device name hash chain */
473 struct hlist_node name_hlist; 474 struct hlist_node name_hlist;
475 /* snmp alias */
476 char *ifalias;
474 477
475 /* 478 /*
476 * I/O specific fields 479 * I/O specific fields
@@ -605,6 +608,9 @@ struct net_device
605 608
606 /* Protocol specific pointers */ 609 /* Protocol specific pointers */
607 610
611#ifdef CONFIG_NET_DSA
612 void *dsa_ptr; /* dsa specific data */
613#endif
608 void *atalk_ptr; /* AppleTalk link */ 614 void *atalk_ptr; /* AppleTalk link */
609 void *ip_ptr; /* IPv4 specific data */ 615 void *ip_ptr; /* IPv4 specific data */
610 void *dn_ptr; /* DECnet specific data */ 616 void *dn_ptr; /* DECnet specific data */
@@ -796,6 +802,26 @@ void dev_net_set(struct net_device *dev, struct net *net)
796#endif 802#endif
797} 803}
798 804
805static inline bool netdev_uses_dsa_tags(struct net_device *dev)
806{
807#ifdef CONFIG_NET_DSA_TAG_DSA
808 if (dev->dsa_ptr != NULL)
809 return dsa_uses_dsa_tags(dev->dsa_ptr);
810#endif
811
812 return 0;
813}
814
815static inline bool netdev_uses_trailer_tags(struct net_device *dev)
816{
817#ifdef CONFIG_NET_DSA_TAG_TRAILER
818 if (dev->dsa_ptr != NULL)
819 return dsa_uses_trailer_tags(dev->dsa_ptr);
820#endif
821
822 return 0;
823}
824
799/** 825/**
800 * netdev_priv - access network device private data 826 * netdev_priv - access network device private data
801 * @dev: network device 827 * @dev: network device
@@ -1223,7 +1249,8 @@ extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1223extern int dev_ethtool(struct net *net, struct ifreq *); 1249extern int dev_ethtool(struct net *net, struct ifreq *);
1224extern unsigned dev_get_flags(const struct net_device *); 1250extern unsigned dev_get_flags(const struct net_device *);
1225extern int dev_change_flags(struct net_device *, unsigned); 1251extern int dev_change_flags(struct net_device *, unsigned);
1226extern int dev_change_name(struct net_device *, char *); 1252extern int dev_change_name(struct net_device *, const char *);
1253extern int dev_set_alias(struct net_device *, const char *, size_t);
1227extern int dev_change_net_namespace(struct net_device *, 1254extern int dev_change_net_namespace(struct net_device *,
1228 struct net *, const char *); 1255 struct net *, const char *);
1229extern int dev_set_mtu(struct net_device *, int); 1256extern int dev_set_mtu(struct net_device *, int);
@@ -1667,7 +1694,7 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
1667extern int netdev_class_create_file(struct class_attribute *class_attr); 1694extern int netdev_class_create_file(struct class_attribute *class_attr);
1668extern void netdev_class_remove_file(struct class_attribute *class_attr); 1695extern void netdev_class_remove_file(struct class_attribute *class_attr);
1669 1696
1670extern char *netdev_drivername(struct net_device *dev, char *buffer, int len); 1697extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len);
1671 1698
1672extern void linkwatch_run_queue(void); 1699extern void linkwatch_run_queue(void);
1673 1700
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0c5eb7ed8b3f..48cfe51bfddc 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -5,13 +5,11 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/skbuff.h> 6#include <linux/skbuff.h>
7#include <linux/net.h> 7#include <linux/net.h>
8#include <linux/netdevice.h>
9#include <linux/if.h> 8#include <linux/if.h>
10#include <linux/in.h> 9#include <linux/in.h>
11#include <linux/in6.h> 10#include <linux/in6.h>
12#include <linux/wait.h> 11#include <linux/wait.h>
13#include <linux/list.h> 12#include <linux/list.h>
14#include <net/net_namespace.h>
15#endif 13#endif
16#include <linux/types.h> 14#include <linux/types.h>
17#include <linux/compiler.h> 15#include <linux/compiler.h>
@@ -52,6 +50,16 @@ enum nf_inet_hooks {
52 NF_INET_NUMHOOKS 50 NF_INET_NUMHOOKS
53}; 51};
54 52
53enum {
54 NFPROTO_UNSPEC = 0,
55 NFPROTO_IPV4 = 2,
56 NFPROTO_ARP = 3,
57 NFPROTO_BRIDGE = 7,
58 NFPROTO_IPV6 = 10,
59 NFPROTO_DECNET = 12,
60 NFPROTO_NUMPROTO,
61};
62
55union nf_inet_addr { 63union nf_inet_addr {
56 __u32 all[4]; 64 __u32 all[4];
57 __be32 ip; 65 __be32 ip;
@@ -92,8 +100,8 @@ struct nf_hook_ops
92 /* User fills in from here down. */ 100 /* User fills in from here down. */
93 nf_hookfn *hook; 101 nf_hookfn *hook;
94 struct module *owner; 102 struct module *owner;
95 int pf; 103 u_int8_t pf;
96 int hooknum; 104 unsigned int hooknum;
97 /* Hooks are ordered in ascending priority. */ 105 /* Hooks are ordered in ascending priority. */
98 int priority; 106 int priority;
99}; 107};
@@ -102,7 +110,7 @@ struct nf_sockopt_ops
102{ 110{
103 struct list_head list; 111 struct list_head list;
104 112
105 int pf; 113 u_int8_t pf;
106 114
107 /* Non-inclusive ranges: use 0/0/NULL to never get called. */ 115 /* Non-inclusive ranges: use 0/0/NULL to never get called. */
108 int set_optmin; 116 int set_optmin;
@@ -138,9 +146,9 @@ extern struct ctl_path nf_net_netfilter_sysctl_path[];
138extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; 146extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[];
139#endif /* CONFIG_SYSCTL */ 147#endif /* CONFIG_SYSCTL */
140 148
141extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; 149extern struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
142 150
143int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, 151int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
144 struct net_device *indev, struct net_device *outdev, 152 struct net_device *indev, struct net_device *outdev,
145 int (*okfn)(struct sk_buff *), int thresh); 153 int (*okfn)(struct sk_buff *), int thresh);
146 154
@@ -151,7 +159,7 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
151 * okfn must be invoked by the caller in this case. Any other return 159 * okfn must be invoked by the caller in this case. Any other return
152 * value indicates the packet has been consumed by the hook. 160 * value indicates the packet has been consumed by the hook.
153 */ 161 */
154static inline int nf_hook_thresh(int pf, unsigned int hook, 162static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
155 struct sk_buff *skb, 163 struct sk_buff *skb,
156 struct net_device *indev, 164 struct net_device *indev,
157 struct net_device *outdev, 165 struct net_device *outdev,
@@ -167,7 +175,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
167 return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); 175 return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh);
168} 176}
169 177
170static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, 178static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
171 struct net_device *indev, struct net_device *outdev, 179 struct net_device *indev, struct net_device *outdev,
172 int (*okfn)(struct sk_buff *)) 180 int (*okfn)(struct sk_buff *))
173{ 181{
@@ -212,14 +220,14 @@ __ret;})
212 NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) 220 NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN)
213 221
214/* Call setsockopt() */ 222/* Call setsockopt() */
215int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, 223int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
216 int len); 224 int len);
217int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, 225int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
218 int *len); 226 int *len);
219 227
220int compat_nf_setsockopt(struct sock *sk, int pf, int optval, 228int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval,
221 char __user *opt, int len); 229 char __user *opt, int len);
222int compat_nf_getsockopt(struct sock *sk, int pf, int optval, 230int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval,
223 char __user *opt, int *len); 231 char __user *opt, int *len);
224 232
225/* Call this before modifying an existing packet: ensures it is 233/* Call this before modifying an existing packet: ensures it is
@@ -247,7 +255,7 @@ struct nf_afinfo {
247 int route_key_size; 255 int route_key_size;
248}; 256};
249 257
250extern const struct nf_afinfo *nf_afinfo[NPROTO]; 258extern const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO];
251static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) 259static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family)
252{ 260{
253 return rcu_dereference(nf_afinfo[family]); 261 return rcu_dereference(nf_afinfo[family]);
@@ -292,7 +300,7 @@ extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo);
292extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); 300extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *);
293 301
294static inline void 302static inline void
295nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) 303nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
296{ 304{
297#ifdef CONFIG_NF_NAT_NEEDED 305#ifdef CONFIG_NF_NAT_NEEDED
298 void (*decodefn)(struct sk_buff *, struct flowi *); 306 void (*decodefn)(struct sk_buff *, struct flowi *);
@@ -315,7 +323,7 @@ extern struct proc_dir_entry *proc_net_netfilter;
315#else /* !CONFIG_NETFILTER */ 323#else /* !CONFIG_NETFILTER */
316#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) 324#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
317#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) 325#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb)
318static inline int nf_hook_thresh(int pf, unsigned int hook, 326static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
319 struct sk_buff *skb, 327 struct sk_buff *skb,
320 struct net_device *indev, 328 struct net_device *indev,
321 struct net_device *outdev, 329 struct net_device *outdev,
@@ -324,7 +332,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
324{ 332{
325 return okfn(skb); 333 return okfn(skb);
326} 334}
327static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, 335static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
328 struct net_device *indev, struct net_device *outdev, 336 struct net_device *indev, struct net_device *outdev,
329 int (*okfn)(struct sk_buff *)) 337 int (*okfn)(struct sk_buff *))
330{ 338{
@@ -332,7 +340,9 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb,
332} 340}
333struct flowi; 341struct flowi;
334static inline void 342static inline void
335nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {} 343nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
344{
345}
336#endif /*CONFIG_NETFILTER*/ 346#endif /*CONFIG_NETFILTER*/
337 347
338#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 348#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
@@ -343,56 +353,5 @@ extern void (*nf_ct_destroy)(struct nf_conntrack *);
343static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 353static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
344#endif 354#endif
345 355
346static inline struct net *nf_pre_routing_net(const struct net_device *in,
347 const struct net_device *out)
348{
349#ifdef CONFIG_NET_NS
350 return in->nd_net;
351#else
352 return &init_net;
353#endif
354}
355
356static inline struct net *nf_local_in_net(const struct net_device *in,
357 const struct net_device *out)
358{
359#ifdef CONFIG_NET_NS
360 return in->nd_net;
361#else
362 return &init_net;
363#endif
364}
365
366static inline struct net *nf_forward_net(const struct net_device *in,
367 const struct net_device *out)
368{
369#ifdef CONFIG_NET_NS
370 BUG_ON(in->nd_net != out->nd_net);
371 return in->nd_net;
372#else
373 return &init_net;
374#endif
375}
376
377static inline struct net *nf_local_out_net(const struct net_device *in,
378 const struct net_device *out)
379{
380#ifdef CONFIG_NET_NS
381 return out->nd_net;
382#else
383 return &init_net;
384#endif
385}
386
387static inline struct net *nf_post_routing_net(const struct net_device *in,
388 const struct net_device *out)
389{
390#ifdef CONFIG_NET_NS
391 return out->nd_net;
392#else
393 return &init_net;
394#endif
395}
396
397#endif /*__KERNEL__*/ 356#endif /*__KERNEL__*/
398#endif /*__LINUX_NETFILTER_H*/ 357#endif /*__LINUX_NETFILTER_H*/
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 3aff513d12c8..5a8af875bce2 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -32,6 +32,7 @@ header-y += xt_owner.h
32header-y += xt_pkttype.h 32header-y += xt_pkttype.h
33header-y += xt_rateest.h 33header-y += xt_rateest.h
34header-y += xt_realm.h 34header-y += xt_realm.h
35header-y += xt_recent.h
35header-y += xt_sctp.h 36header-y += xt_sctp.h
36header-y += xt_state.h 37header-y += xt_state.h
37header-y += xt_statistic.h 38header-y += xt_statistic.h
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h
index 535e4219d2bb..2a10efda17fb 100644
--- a/include/linux/netfilter/nf_conntrack_proto_gre.h
+++ b/include/linux/netfilter/nf_conntrack_proto_gre.h
@@ -87,7 +87,7 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir,
87/* delete keymap entries */ 87/* delete keymap entries */
88void nf_ct_gre_keymap_destroy(struct nf_conn *ct); 88void nf_ct_gre_keymap_destroy(struct nf_conn *ct);
89 89
90extern void nf_ct_gre_keymap_flush(void); 90extern void nf_ct_gre_keymap_flush(struct net *net);
91extern void nf_nat_need_gre(void); 91extern void nf_nat_need_gre(void);
92 92
93#endif /* __KERNEL__ */ 93#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 0d8424f76899..7d8e0455ccac 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -78,6 +78,9 @@ extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group,
78 int echo); 78 int echo);
79extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); 79extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
80 80
81extern void nfnl_lock(void);
82extern void nfnl_unlock(void);
83
81#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ 84#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
82 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) 85 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
83 86
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 2326296b6f25..be41b609c88f 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -173,6 +173,98 @@ struct xt_counters_info
173 173
174#include <linux/netdevice.h> 174#include <linux/netdevice.h>
175 175
176/**
177 * struct xt_match_param - parameters for match extensions' match functions
178 *
179 * @in: input netdevice
180 * @out: output netdevice
181 * @match: struct xt_match through which this function was invoked
182 * @matchinfo: per-match data
183 * @fragoff: packet is a fragment, this is the data offset
184 * @thoff: position of transport header relative to skb->data
185 * @hotdrop: drop packet if we had inspection problems
186 * @family: Actual NFPROTO_* through which the function is invoked
187 * (helpful when match->family == NFPROTO_UNSPEC)
188 */
189struct xt_match_param {
190 const struct net_device *in, *out;
191 const struct xt_match *match;
192 const void *matchinfo;
193 int fragoff;
194 unsigned int thoff;
195 bool *hotdrop;
196 u_int8_t family;
197};
198
199/**
200 * struct xt_mtchk_param - parameters for match extensions'
201 * checkentry functions
202 *
203 * @table: table the rule is tried to be inserted into
204 * @entryinfo: the family-specific rule data
205 * (struct ipt_ip, ip6t_ip, ebt_entry)
206 * @match: struct xt_match through which this function was invoked
207 * @matchinfo: per-match data
208 * @hook_mask: via which hooks the new rule is reachable
209 */
210struct xt_mtchk_param {
211 const char *table;
212 const void *entryinfo;
213 const struct xt_match *match;
214 void *matchinfo;
215 unsigned int hook_mask;
216 u_int8_t family;
217};
218
219/* Match destructor parameters */
220struct xt_mtdtor_param {
221 const struct xt_match *match;
222 void *matchinfo;
223 u_int8_t family;
224};
225
226/**
227 * struct xt_target_param - parameters for target extensions' target functions
228 *
229 * @hooknum: hook through which this target was invoked
230 * @target: struct xt_target through which this function was invoked
231 * @targinfo: per-target data
232 *
233 * Other fields see above.
234 */
235struct xt_target_param {
236 const struct net_device *in, *out;
237 unsigned int hooknum;
238 const struct xt_target *target;
239 const void *targinfo;
240 u_int8_t family;
241};
242
243/**
244 * struct xt_tgchk_param - parameters for target extensions'
245 * checkentry functions
246 *
247 * @entryinfo: the family-specific rule data
248 * (struct ipt_entry, ip6t_entry, arpt_entry, ebt_entry)
249 *
250 * Other fields see above.
251 */
252struct xt_tgchk_param {
253 const char *table;
254 void *entryinfo;
255 const struct xt_target *target;
256 void *targinfo;
257 unsigned int hook_mask;
258 u_int8_t family;
259};
260
261/* Target destructor parameters */
262struct xt_tgdtor_param {
263 const struct xt_target *target;
264 void *targinfo;
265 u_int8_t family;
266};
267
176struct xt_match 268struct xt_match
177{ 269{
178 struct list_head list; 270 struct list_head list;
@@ -185,24 +277,13 @@ struct xt_match
185 non-linear skb, using skb_header_pointer and 277 non-linear skb, using skb_header_pointer and
186 skb_ip_make_writable. */ 278 skb_ip_make_writable. */
187 bool (*match)(const struct sk_buff *skb, 279 bool (*match)(const struct sk_buff *skb,
188 const struct net_device *in, 280 const struct xt_match_param *);
189 const struct net_device *out,
190 const struct xt_match *match,
191 const void *matchinfo,
192 int offset,
193 unsigned int protoff,
194 bool *hotdrop);
195 281
196 /* Called when user tries to insert an entry of this type. */ 282 /* Called when user tries to insert an entry of this type. */
197 /* Should return true or false. */ 283 bool (*checkentry)(const struct xt_mtchk_param *);
198 bool (*checkentry)(const char *tablename,
199 const void *ip,
200 const struct xt_match *match,
201 void *matchinfo,
202 unsigned int hook_mask);
203 284
204 /* Called when entry of this type deleted. */ 285 /* Called when entry of this type deleted. */
205 void (*destroy)(const struct xt_match *match, void *matchinfo); 286 void (*destroy)(const struct xt_mtdtor_param *);
206 287
207 /* Called when userspace align differs from kernel space one */ 288 /* Called when userspace align differs from kernel space one */
208 void (*compat_from_user)(void *dst, void *src); 289 void (*compat_from_user)(void *dst, void *src);
@@ -235,24 +316,16 @@ struct xt_target
235 must now handle non-linear skbs, using skb_copy_bits and 316 must now handle non-linear skbs, using skb_copy_bits and
236 skb_ip_make_writable. */ 317 skb_ip_make_writable. */
237 unsigned int (*target)(struct sk_buff *skb, 318 unsigned int (*target)(struct sk_buff *skb,
238 const struct net_device *in, 319 const struct xt_target_param *);
239 const struct net_device *out,
240 unsigned int hooknum,
241 const struct xt_target *target,
242 const void *targinfo);
243 320
244 /* Called when user tries to insert an entry of this type: 321 /* Called when user tries to insert an entry of this type:
245 hook_mask is a bitmask of hooks from which it can be 322 hook_mask is a bitmask of hooks from which it can be
246 called. */ 323 called. */
247 /* Should return true or false. */ 324 /* Should return true or false. */
248 bool (*checkentry)(const char *tablename, 325 bool (*checkentry)(const struct xt_tgchk_param *);
249 const void *entry,
250 const struct xt_target *target,
251 void *targinfo,
252 unsigned int hook_mask);
253 326
254 /* Called when entry of this type deleted. */ 327 /* Called when entry of this type deleted. */
255 void (*destroy)(const struct xt_target *target, void *targinfo); 328 void (*destroy)(const struct xt_tgdtor_param *);
256 329
257 /* Called when userspace align differs from kernel space one */ 330 /* Called when userspace align differs from kernel space one */
258 void (*compat_from_user)(void *dst, void *src); 331 void (*compat_from_user)(void *dst, void *src);
@@ -292,7 +365,7 @@ struct xt_table
292 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 365 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
293 struct module *me; 366 struct module *me;
294 367
295 int af; /* address/protocol family */ 368 u_int8_t af; /* address/protocol family */
296}; 369};
297 370
298#include <linux/netfilter_ipv4.h> 371#include <linux/netfilter_ipv4.h>
@@ -328,12 +401,10 @@ extern void xt_unregister_match(struct xt_match *target);
328extern int xt_register_matches(struct xt_match *match, unsigned int n); 401extern int xt_register_matches(struct xt_match *match, unsigned int n);
329extern void xt_unregister_matches(struct xt_match *match, unsigned int n); 402extern void xt_unregister_matches(struct xt_match *match, unsigned int n);
330 403
331extern int xt_check_match(const struct xt_match *match, unsigned short family, 404extern int xt_check_match(struct xt_mtchk_param *,
332 unsigned int size, const char *table, unsigned int hook, 405 unsigned int size, u_int8_t proto, bool inv_proto);
333 unsigned short proto, int inv_proto); 406extern int xt_check_target(struct xt_tgchk_param *,
334extern int xt_check_target(const struct xt_target *target, unsigned short family, 407 unsigned int size, u_int8_t proto, bool inv_proto);
335 unsigned int size, const char *table, unsigned int hook,
336 unsigned short proto, int inv_proto);
337 408
338extern struct xt_table *xt_register_table(struct net *net, 409extern struct xt_table *xt_register_table(struct net *net,
339 struct xt_table *table, 410 struct xt_table *table,
@@ -346,19 +417,19 @@ extern struct xt_table_info *xt_replace_table(struct xt_table *table,
346 struct xt_table_info *newinfo, 417 struct xt_table_info *newinfo,
347 int *error); 418 int *error);
348 419
349extern struct xt_match *xt_find_match(int af, const char *name, u8 revision); 420extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision);
350extern struct xt_target *xt_find_target(int af, const char *name, u8 revision); 421extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision);
351extern struct xt_target *xt_request_find_target(int af, const char *name, 422extern struct xt_target *xt_request_find_target(u8 af, const char *name,
352 u8 revision); 423 u8 revision);
353extern int xt_find_revision(int af, const char *name, u8 revision, int target, 424extern int xt_find_revision(u8 af, const char *name, u8 revision,
354 int *err); 425 int target, int *err);
355 426
356extern struct xt_table *xt_find_table_lock(struct net *net, int af, 427extern struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
357 const char *name); 428 const char *name);
358extern void xt_table_unlock(struct xt_table *t); 429extern void xt_table_unlock(struct xt_table *t);
359 430
360extern int xt_proto_init(struct net *net, int af); 431extern int xt_proto_init(struct net *net, u_int8_t af);
361extern void xt_proto_fini(struct net *net, int af); 432extern void xt_proto_fini(struct net *net, u_int8_t af);
362 433
363extern struct xt_table_info *xt_alloc_table_info(unsigned int size); 434extern struct xt_table_info *xt_alloc_table_info(unsigned int size);
364extern void xt_free_table_info(struct xt_table_info *info); 435extern void xt_free_table_info(struct xt_table_info *info);
@@ -423,12 +494,12 @@ struct compat_xt_counters_info
423#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ 494#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \
424 & ~(__alignof__(struct compat_xt_counters)-1)) 495 & ~(__alignof__(struct compat_xt_counters)-1))
425 496
426extern void xt_compat_lock(int af); 497extern void xt_compat_lock(u_int8_t af);
427extern void xt_compat_unlock(int af); 498extern void xt_compat_unlock(u_int8_t af);
428 499
429extern int xt_compat_add_offset(int af, unsigned int offset, short delta); 500extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta);
430extern void xt_compat_flush_offsets(int af); 501extern void xt_compat_flush_offsets(u_int8_t af);
431extern short xt_compat_calc_jump(int af, unsigned int offset); 502extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset);
432 503
433extern int xt_compat_match_offset(const struct xt_match *match); 504extern int xt_compat_match_offset(const struct xt_match *match);
434extern int xt_compat_match_from_user(struct xt_entry_match *m, 505extern int xt_compat_match_from_user(struct xt_entry_match *m,
diff --git a/include/linux/netfilter/xt_TPROXY.h b/include/linux/netfilter/xt_TPROXY.h
new file mode 100644
index 000000000000..152e8f97132b
--- /dev/null
+++ b/include/linux/netfilter/xt_TPROXY.h
@@ -0,0 +1,14 @@
1#ifndef _XT_TPROXY_H_target
2#define _XT_TPROXY_H_target
3
4/* TPROXY target is capable of marking the packet to perform
5 * redirection. We can get rid of that whenever we get support for
6 * mutliple targets in the same rule. */
7struct xt_tproxy_target_info {
8 u_int32_t mark_mask;
9 u_int32_t mark_value;
10 __be32 laddr;
11 __be16 lport;
12};
13
14#endif /* _XT_TPROXY_H_target */
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h
new file mode 100644
index 000000000000..5cfeb81c6794
--- /dev/null
+++ b/include/linux/netfilter/xt_recent.h
@@ -0,0 +1,26 @@
1#ifndef _LINUX_NETFILTER_XT_RECENT_H
2#define _LINUX_NETFILTER_XT_RECENT_H 1
3
4enum {
5 XT_RECENT_CHECK = 1 << 0,
6 XT_RECENT_SET = 1 << 1,
7 XT_RECENT_UPDATE = 1 << 2,
8 XT_RECENT_REMOVE = 1 << 3,
9 XT_RECENT_TTL = 1 << 4,
10
11 XT_RECENT_SOURCE = 0,
12 XT_RECENT_DEST = 1,
13
14 XT_RECENT_NAME_LEN = 200,
15};
16
17struct xt_recent_mtinfo {
18 u_int32_t seconds;
19 u_int32_t hit_count;
20 u_int8_t check_set;
21 u_int8_t invert;
22 char name[XT_RECENT_NAME_LEN];
23 u_int8_t side;
24};
25
26#endif /* _LINUX_NETFILTER_XT_RECENT_H */
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 892f5b7771c7..d45e29cd1cfb 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -31,6 +31,9 @@
31 * The 4 lsb are more than enough to store the verdict. */ 31 * The 4 lsb are more than enough to store the verdict. */
32#define EBT_VERDICT_BITS 0x0000000F 32#define EBT_VERDICT_BITS 0x0000000F
33 33
34struct xt_match;
35struct xt_target;
36
34struct ebt_counter 37struct ebt_counter
35{ 38{
36 uint64_t pcnt; 39 uint64_t pcnt;
@@ -121,7 +124,7 @@ struct ebt_entry_match
121{ 124{
122 union { 125 union {
123 char name[EBT_FUNCTION_MAXNAMELEN]; 126 char name[EBT_FUNCTION_MAXNAMELEN];
124 struct ebt_match *match; 127 struct xt_match *match;
125 } u; 128 } u;
126 /* size of data */ 129 /* size of data */
127 unsigned int match_size; 130 unsigned int match_size;
@@ -132,7 +135,7 @@ struct ebt_entry_watcher
132{ 135{
133 union { 136 union {
134 char name[EBT_FUNCTION_MAXNAMELEN]; 137 char name[EBT_FUNCTION_MAXNAMELEN];
135 struct ebt_watcher *watcher; 138 struct xt_target *watcher;
136 } u; 139 } u;
137 /* size of data */ 140 /* size of data */
138 unsigned int watcher_size; 141 unsigned int watcher_size;
@@ -143,7 +146,7 @@ struct ebt_entry_target
143{ 146{
144 union { 147 union {
145 char name[EBT_FUNCTION_MAXNAMELEN]; 148 char name[EBT_FUNCTION_MAXNAMELEN];
146 struct ebt_target *target; 149 struct xt_target *target;
147 } u; 150 } u;
148 /* size of data */ 151 /* size of data */
149 unsigned int target_size; 152 unsigned int target_size;
@@ -207,14 +210,17 @@ struct ebt_match
207{ 210{
208 struct list_head list; 211 struct list_head list;
209 const char name[EBT_FUNCTION_MAXNAMELEN]; 212 const char name[EBT_FUNCTION_MAXNAMELEN];
210 /* 0 == it matches */ 213 bool (*match)(const struct sk_buff *skb, const struct net_device *in,
211 int (*match)(const struct sk_buff *skb, const struct net_device *in, 214 const struct net_device *out, const struct xt_match *match,
212 const struct net_device *out, const void *matchdata, 215 const void *matchinfo, int offset, unsigned int protoff,
213 unsigned int datalen); 216 bool *hotdrop);
214 /* 0 == let it in */ 217 bool (*checkentry)(const char *table, const void *entry,
215 int (*check)(const char *tablename, unsigned int hookmask, 218 const struct xt_match *match, void *matchinfo,
216 const struct ebt_entry *e, void *matchdata, unsigned int datalen); 219 unsigned int hook_mask);
217 void (*destroy)(void *matchdata, unsigned int datalen); 220 void (*destroy)(const struct xt_match *match, void *matchinfo);
221 unsigned int matchsize;
222 u_int8_t revision;
223 u_int8_t family;
218 struct module *me; 224 struct module *me;
219}; 225};
220 226
@@ -222,13 +228,17 @@ struct ebt_watcher
222{ 228{
223 struct list_head list; 229 struct list_head list;
224 const char name[EBT_FUNCTION_MAXNAMELEN]; 230 const char name[EBT_FUNCTION_MAXNAMELEN];
225 void (*watcher)(const struct sk_buff *skb, unsigned int hooknr, 231 unsigned int (*target)(struct sk_buff *skb,
226 const struct net_device *in, const struct net_device *out, 232 const struct net_device *in, const struct net_device *out,
227 const void *watcherdata, unsigned int datalen); 233 unsigned int hook_num, const struct xt_target *target,
228 /* 0 == let it in */ 234 const void *targinfo);
229 int (*check)(const char *tablename, unsigned int hookmask, 235 bool (*checkentry)(const char *table, const void *entry,
230 const struct ebt_entry *e, void *watcherdata, unsigned int datalen); 236 const struct xt_target *target, void *targinfo,
231 void (*destroy)(void *watcherdata, unsigned int datalen); 237 unsigned int hook_mask);
238 void (*destroy)(const struct xt_target *target, void *targinfo);
239 unsigned int targetsize;
240 u_int8_t revision;
241 u_int8_t family;
232 struct module *me; 242 struct module *me;
233}; 243};
234 244
@@ -236,14 +246,18 @@ struct ebt_target
236{ 246{
237 struct list_head list; 247 struct list_head list;
238 const char name[EBT_FUNCTION_MAXNAMELEN]; 248 const char name[EBT_FUNCTION_MAXNAMELEN];
239 /* returns one of the standard verdicts */ 249 /* returns one of the standard EBT_* verdicts */
240 int (*target)(struct sk_buff *skb, unsigned int hooknr, 250 unsigned int (*target)(struct sk_buff *skb,
241 const struct net_device *in, const struct net_device *out, 251 const struct net_device *in, const struct net_device *out,
242 const void *targetdata, unsigned int datalen); 252 unsigned int hook_num, const struct xt_target *target,
243 /* 0 == let it in */ 253 const void *targinfo);
244 int (*check)(const char *tablename, unsigned int hookmask, 254 bool (*checkentry)(const char *table, const void *entry,
245 const struct ebt_entry *e, void *targetdata, unsigned int datalen); 255 const struct xt_target *target, void *targinfo,
246 void (*destroy)(void *targetdata, unsigned int datalen); 256 unsigned int hook_mask);
257 void (*destroy)(const struct xt_target *target, void *targinfo);
258 unsigned int targetsize;
259 u_int8_t revision;
260 u_int8_t family;
247 struct module *me; 261 struct module *me;
248}; 262};
249 263
@@ -288,12 +302,6 @@ struct ebt_table
288 ~(__alignof__(struct ebt_replace)-1)) 302 ~(__alignof__(struct ebt_replace)-1))
289extern int ebt_register_table(struct ebt_table *table); 303extern int ebt_register_table(struct ebt_table *table);
290extern void ebt_unregister_table(struct ebt_table *table); 304extern void ebt_unregister_table(struct ebt_table *table);
291extern int ebt_register_match(struct ebt_match *match);
292extern void ebt_unregister_match(struct ebt_match *match);
293extern int ebt_register_watcher(struct ebt_watcher *watcher);
294extern void ebt_unregister_watcher(struct ebt_watcher *watcher);
295extern int ebt_register_target(struct ebt_target *target);
296extern void ebt_unregister_target(struct ebt_target *target);
297extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, 305extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
298 const struct net_device *in, const struct net_device *out, 306 const struct net_device *in, const struct net_device *out,
299 struct ebt_table *table); 307 struct ebt_table *table);
@@ -302,9 +310,9 @@ extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
302#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg)) 310#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg))
303/* True if the hook mask denotes that the rule is in a base chain, 311/* True if the hook mask denotes that the rule is in a base chain,
304 * used in the check() functions */ 312 * used in the check() functions */
305#define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS)) 313#define BASE_CHAIN (par->hook_mask & (1 << NF_BR_NUMHOOKS))
306/* Clear the bit in the hook mask that tells if the rule is on a base chain */ 314/* Clear the bit in the hook mask that tells if the rule is on a base chain */
307#define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS)) 315#define CLEAR_BASE_CHAIN_BIT (par->hook_mask &= ~(1 << NF_BR_NUMHOOKS))
308/* True if the target is not a standard target */ 316/* True if the target is not a standard target */
309#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) 317#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
310 318
diff --git a/include/linux/netfilter_ipv4/ipt_recent.h b/include/linux/netfilter_ipv4/ipt_recent.h
index 6508a4592651..d636cca133c2 100644
--- a/include/linux/netfilter_ipv4/ipt_recent.h
+++ b/include/linux/netfilter_ipv4/ipt_recent.h
@@ -1,27 +1,21 @@
1#ifndef _IPT_RECENT_H 1#ifndef _IPT_RECENT_H
2#define _IPT_RECENT_H 2#define _IPT_RECENT_H
3 3
4#define RECENT_NAME "ipt_recent" 4#include <linux/netfilter/xt_recent.h>
5#define RECENT_VER "v0.3.1"
6 5
7#define IPT_RECENT_CHECK 1 6#define ipt_recent_info xt_recent_mtinfo
8#define IPT_RECENT_SET 2
9#define IPT_RECENT_UPDATE 4
10#define IPT_RECENT_REMOVE 8
11#define IPT_RECENT_TTL 16
12 7
13#define IPT_RECENT_SOURCE 0 8enum {
14#define IPT_RECENT_DEST 1 9 IPT_RECENT_CHECK = XT_RECENT_CHECK,
10 IPT_RECENT_SET = XT_RECENT_SET,
11 IPT_RECENT_UPDATE = XT_RECENT_UPDATE,
12 IPT_RECENT_REMOVE = XT_RECENT_REMOVE,
13 IPT_RECENT_TTL = XT_RECENT_TTL,
15 14
16#define IPT_RECENT_NAME_LEN 200 15 IPT_RECENT_SOURCE = XT_RECENT_SOURCE,
16 IPT_RECENT_DEST = XT_RECENT_DEST,
17 17
18struct ipt_recent_info { 18 IPT_RECENT_NAME_LEN = XT_RECENT_NAME_LEN,
19 u_int32_t seconds;
20 u_int32_t hit_count;
21 u_int8_t check_set;
22 u_int8_t invert;
23 char name[IPT_RECENT_NAME_LEN];
24 u_int8_t side;
25}; 19};
26 20
27#endif /*_IPT_RECENT_H*/ 21#endif /*_IPT_RECENT_H*/
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 78a5922a2f11..ac8d0233b05c 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -137,7 +137,7 @@ struct nfs_inode {
137 unsigned long attrtimeo_timestamp; 137 unsigned long attrtimeo_timestamp;
138 __u64 change_attr; /* v4 only */ 138 __u64 change_attr; /* v4 only */
139 139
140 unsigned long last_updated; 140 unsigned long attr_gencount;
141 /* "Generation counter" for the attribute cache. This is 141 /* "Generation counter" for the attribute cache. This is
142 * bumped whenever we update the metadata on the 142 * bumped whenever we update the metadata on the
143 * server. 143 * server.
@@ -200,11 +200,10 @@ struct nfs_inode {
200/* 200/*
201 * Bit offsets in flags field 201 * Bit offsets in flags field
202 */ 202 */
203#define NFS_INO_REVALIDATING (0) /* revalidating attrs */ 203#define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */
204#define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ 204#define NFS_INO_STALE (1) /* possible stale inode */
205#define NFS_INO_STALE (2) /* possible stale inode */ 205#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */
206#define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ 206#define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */
207#define NFS_INO_MOUNTPOINT (4) /* inode is remote mountpoint */
208 207
209static inline struct nfs_inode *NFS_I(const struct inode *inode) 208static inline struct nfs_inode *NFS_I(const struct inode *inode)
210{ 209{
@@ -345,15 +344,11 @@ extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ct
345extern void put_nfs_open_context(struct nfs_open_context *ctx); 344extern void put_nfs_open_context(struct nfs_open_context *ctx);
346extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); 345extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode);
347extern u64 nfs_compat_user_ino64(u64 fileid); 346extern u64 nfs_compat_user_ino64(u64 fileid);
347extern void nfs_fattr_init(struct nfs_fattr *fattr);
348 348
349/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 349/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
350extern __be32 root_nfs_parse_addr(char *name); /*__init*/ 350extern __be32 root_nfs_parse_addr(char *name); /*__init*/
351 351extern unsigned long nfs_inc_attr_generation_counter(void);
352static inline void nfs_fattr_init(struct nfs_fattr *fattr)
353{
354 fattr->valid = 0;
355 fattr->time_start = jiffies;
356}
357 352
358/* 353/*
359 * linux/fs/nfs/file.c 354 * linux/fs/nfs/file.c
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index c9beacd16c00..4e477ae58699 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -119,7 +119,6 @@ struct nfs_server {
119 void (*destroy)(struct nfs_server *); 119 void (*destroy)(struct nfs_server *);
120 120
121 atomic_t active; /* Keep trace of any activity to this server */ 121 atomic_t active; /* Keep trace of any activity to this server */
122 wait_queue_head_t active_wq; /* Wait for any activity to stop */
123 122
124 /* mountd-related mount options */ 123 /* mountd-related mount options */
125 struct sockaddr_storage mountd_address; 124 struct sockaddr_storage mountd_address;
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index df7c6b7a7ebb..6549a06ac16e 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -65,4 +65,8 @@ struct nfs_mount_data {
65#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */ 65#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
66#define NFS_MOUNT_FLAGMASK 0xFFFF 66#define NFS_MOUNT_FLAGMASK 0xFFFF
67 67
68/* The following are for internal use only */
69#define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000
70#define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000
71
68#endif 72#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 8c77c11224d1..c1c31acb8a2b 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -36,6 +36,7 @@ struct nfs_fattr {
36 __u32 nlink; 36 __u32 nlink;
37 __u32 uid; 37 __u32 uid;
38 __u32 gid; 38 __u32 gid;
39 dev_t rdev;
39 __u64 size; 40 __u64 size;
40 union { 41 union {
41 struct { 42 struct {
@@ -46,7 +47,6 @@ struct nfs_fattr {
46 __u64 used; 47 __u64 used;
47 } nfs3; 48 } nfs3;
48 } du; 49 } du;
49 dev_t rdev;
50 struct nfs_fsid fsid; 50 struct nfs_fsid fsid;
51 __u64 fileid; 51 __u64 fileid;
52 struct timespec atime; 52 struct timespec atime;
@@ -56,6 +56,7 @@ struct nfs_fattr {
56 __u64 change_attr; /* NFSv4 change attribute */ 56 __u64 change_attr; /* NFSv4 change attribute */
57 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ 57 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
58 unsigned long time_start; 58 unsigned long time_start;
59 unsigned long gencount;
59}; 60};
60 61
61#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ 62#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
@@ -672,16 +673,16 @@ struct nfs4_rename_res {
672 struct nfs_fattr * new_fattr; 673 struct nfs_fattr * new_fattr;
673}; 674};
674 675
675#define NFS4_SETCLIENTID_NAMELEN (56) 676#define NFS4_SETCLIENTID_NAMELEN (127)
676struct nfs4_setclientid { 677struct nfs4_setclientid {
677 const nfs4_verifier * sc_verifier; 678 const nfs4_verifier * sc_verifier;
678 unsigned int sc_name_len; 679 unsigned int sc_name_len;
679 char sc_name[NFS4_SETCLIENTID_NAMELEN]; 680 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
680 u32 sc_prog; 681 u32 sc_prog;
681 unsigned int sc_netid_len; 682 unsigned int sc_netid_len;
682 char sc_netid[RPCBIND_MAXNETIDLEN]; 683 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
683 unsigned int sc_uaddr_len; 684 unsigned int sc_uaddr_len;
684 char sc_uaddr[RPCBIND_MAXUADDRLEN]; 685 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
685 u32 sc_cb_ident; 686 u32 sc_cb_ident;
686}; 687};
687 688
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 108f47e5fd95..21269405ffe2 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -38,6 +38,7 @@
38#define NFSD_MAY_LOCK 32 38#define NFSD_MAY_LOCK 32
39#define NFSD_MAY_OWNER_OVERRIDE 64 39#define NFSD_MAY_OWNER_OVERRIDE 64
40#define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ 40#define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/
41#define NFSD_MAY_BYPASS_GSS_ON_ROOT 256
41 42
42#define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) 43#define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE)
43#define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) 44#define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC)
@@ -125,7 +126,7 @@ int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
125__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, 126__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *,
126 loff_t *, struct readdir_cd *, filldir_t); 127 loff_t *, struct readdir_cd *, filldir_t);
127__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, 128__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
128 struct kstatfs *); 129 struct kstatfs *, int access);
129 130
130int nfsd_notify_change(struct inode *, struct iattr *); 131int nfsd_notify_change(struct inode *, struct iattr *);
131__be32 nfsd_permission(struct svc_rqst *, struct svc_export *, 132__be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2be7c63bc0f2..9bad65400fba 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -89,6 +89,22 @@
89 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC 89 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
90 * or, if no MAC address given, all mesh paths, on the interface identified 90 * or, if no MAC address given, all mesh paths, on the interface identified
91 * by %NL80211_ATTR_IFINDEX. 91 * by %NL80211_ATTR_IFINDEX.
92 * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
93 * %NL80211_ATTR_IFINDEX.
94 *
95 * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
96 * after being queried by the kernel. CRDA replies by sending a regulatory
97 * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
98 * current alpha2 if it found a match. It also provides
99 * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
100 * regulatory rule is a nested set of attributes given by
101 * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
102 * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
103 * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
104 * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
105 * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
106 * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will
107 * store this as a valid request and then query userspace for it.
92 * 108 *
93 * @NL80211_CMD_MAX: highest used command number 109 * @NL80211_CMD_MAX: highest used command number
94 * @__NL80211_CMD_AFTER_LAST: internal use 110 * @__NL80211_CMD_AFTER_LAST: internal use
@@ -127,13 +143,23 @@ enum nl80211_commands {
127 NL80211_CMD_NEW_MPATH, 143 NL80211_CMD_NEW_MPATH,
128 NL80211_CMD_DEL_MPATH, 144 NL80211_CMD_DEL_MPATH,
129 145
130 /* add commands here */ 146 NL80211_CMD_SET_BSS,
147
148 NL80211_CMD_SET_REG,
149 NL80211_CMD_REQ_SET_REG,
150
151 /* add new commands above here */
131 152
132 /* used to define NL80211_CMD_MAX below */ 153 /* used to define NL80211_CMD_MAX below */
133 __NL80211_CMD_AFTER_LAST, 154 __NL80211_CMD_AFTER_LAST,
134 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 155 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
135}; 156};
136 157
158/*
159 * Allow user space programs to use #ifdef on new commands by defining them
160 * here
161 */
162#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
137 163
138/** 164/**
139 * enum nl80211_attrs - nl80211 netlink attributes 165 * enum nl80211_attrs - nl80211 netlink attributes
@@ -188,10 +214,34 @@ enum nl80211_commands {
188 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at 214 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
189 * &enum nl80211_mpath_info. 215 * &enum nl80211_mpath_info.
190 * 216 *
191 *
192 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of 217 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
193 * &enum nl80211_mntr_flags. 218 * &enum nl80211_mntr_flags.
194 * 219 *
220 * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
221 * current regulatory domain should be set to or is already set to.
222 * For example, 'CR', for Costa Rica. This attribute is used by the kernel
223 * to query the CRDA to retrieve one regulatory domain. This attribute can
224 * also be used by userspace to query the kernel for the currently set
225 * regulatory domain. We chose an alpha2 as that is also used by the
226 * IEEE-802.11d country information element to identify a country.
227 * Users can also simply ask the wireless core to set regulatory domain
228 * to a specific alpha2.
229 * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
230 * rules.
231 *
232 * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
233 * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
234 * (u8, 0 or 1)
235 * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
236 * (u8, 0 or 1)
237 *
238 * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
239 * association request when used with NL80211_CMD_NEW_STATION)
240 *
241 * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
242 * supported interface types, each a flag attribute with the number
243 * of the interface mode.
244 *
195 * @NL80211_ATTR_MAX: highest attribute number currently defined 245 * @NL80211_ATTR_MAX: highest attribute number currently defined
196 * @__NL80211_ATTR_AFTER_LAST: internal use 246 * @__NL80211_ATTR_AFTER_LAST: internal use
197 */ 247 */
@@ -235,16 +285,35 @@ enum nl80211_attrs {
235 NL80211_ATTR_MPATH_NEXT_HOP, 285 NL80211_ATTR_MPATH_NEXT_HOP,
236 NL80211_ATTR_MPATH_INFO, 286 NL80211_ATTR_MPATH_INFO,
237 287
288 NL80211_ATTR_BSS_CTS_PROT,
289 NL80211_ATTR_BSS_SHORT_PREAMBLE,
290 NL80211_ATTR_BSS_SHORT_SLOT_TIME,
291
292 NL80211_ATTR_HT_CAPABILITY,
293
294 NL80211_ATTR_SUPPORTED_IFTYPES,
295
296 NL80211_ATTR_REG_ALPHA2,
297 NL80211_ATTR_REG_RULES,
298
238 /* add attributes here, update the policy in nl80211.c */ 299 /* add attributes here, update the policy in nl80211.c */
239 300
240 __NL80211_ATTR_AFTER_LAST, 301 __NL80211_ATTR_AFTER_LAST,
241 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 302 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
242}; 303};
243 304
305/*
306 * Allow user space programs to use #ifdef on new attributes by defining them
307 * here
308 */
309#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
310
244#define NL80211_MAX_SUPP_RATES 32 311#define NL80211_MAX_SUPP_RATES 32
312#define NL80211_MAX_SUPP_REG_RULES 32
245#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 313#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
246#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 314#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
247#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 315#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
316#define NL80211_HT_CAPABILITY_LEN 26
248 317
249/** 318/**
250 * enum nl80211_iftype - (virtual) interface types 319 * enum nl80211_iftype - (virtual) interface types
@@ -436,6 +505,66 @@ enum nl80211_bitrate_attr {
436}; 505};
437 506
438/** 507/**
508 * enum nl80211_reg_rule_attr - regulatory rule attributes
509 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
510 * considerations for a given frequency range. These are the
511 * &enum nl80211_reg_rule_flags.
512 * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
513 * rule in KHz. This is not a center of frequency but an actual regulatory
514 * band edge.
515 * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
516 * in KHz. This is not a center a frequency but an actual regulatory
517 * band edge.
518 * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
519 * frequency range, in KHz.
520 * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
521 * for a given frequency range. The value is in mBi (100 * dBi).
522 * If you don't have one then don't send this.
523 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
524 * a given frequency range. The value is in mBm (100 * dBm).
525 */
526enum nl80211_reg_rule_attr {
527 __NL80211_REG_RULE_ATTR_INVALID,
528 NL80211_ATTR_REG_RULE_FLAGS,
529
530 NL80211_ATTR_FREQ_RANGE_START,
531 NL80211_ATTR_FREQ_RANGE_END,
532 NL80211_ATTR_FREQ_RANGE_MAX_BW,
533
534 NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
535 NL80211_ATTR_POWER_RULE_MAX_EIRP,
536
537 /* keep last */
538 __NL80211_REG_RULE_ATTR_AFTER_LAST,
539 NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
540};
541
542/**
543 * enum nl80211_reg_rule_flags - regulatory rule flags
544 *
545 * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
546 * @NL80211_RRF_NO_CCK: CCK modulation not allowed
547 * @NL80211_RRF_NO_INDOOR: indoor operation not allowed
548 * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
549 * @NL80211_RRF_DFS: DFS support is required to be used
550 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
551 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
552 * @NL80211_RRF_PASSIVE_SCAN: passive scan is required
553 * @NL80211_RRF_NO_IBSS: no IBSS is allowed
554 */
555enum nl80211_reg_rule_flags {
556 NL80211_RRF_NO_OFDM = 1<<0,
557 NL80211_RRF_NO_CCK = 1<<1,
558 NL80211_RRF_NO_INDOOR = 1<<2,
559 NL80211_RRF_NO_OUTDOOR = 1<<3,
560 NL80211_RRF_DFS = 1<<4,
561 NL80211_RRF_PTP_ONLY = 1<<5,
562 NL80211_RRF_PTMP_ONLY = 1<<6,
563 NL80211_RRF_PASSIVE_SCAN = 1<<7,
564 NL80211_RRF_NO_IBSS = 1<<8,
565};
566
567/**
439 * enum nl80211_mntr_flags - monitor configuration flags 568 * enum nl80211_mntr_flags - monitor configuration flags
440 * 569 *
441 * Monitor configuration flags. 570 * Monitor configuration flags.
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index da2698b0fdd1..b86fa2ffca0c 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -213,9 +213,16 @@ static inline int notifier_to_errno(int ret)
213#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ 213#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
214#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ 214#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
215#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, 215#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
216 * not handling interrupts, soon dead */ 216 * not handling interrupts, soon dead.
217 * Called on the dying cpu, interrupts
218 * are already disabled. Must not
219 * sleep, must not fail */
217#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug 220#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
218 * lock is dropped */ 221 * lock is dropped */
222#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
223 * Called on the new cpu, just before
224 * enabling interrupts. Must not sleep,
225 * must not fail */
219 226
220/* Used for CPU hotplug events occuring while tasks are frozen due to a suspend 227/* Used for CPU hotplug events occuring while tasks are frozen due to a suspend
221 * operation in progress 228 * operation in progress
@@ -229,6 +236,7 @@ static inline int notifier_to_errno(int ret)
229#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) 236#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
230#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 237#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
231#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) 238#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
239#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
232 240
233/* Hibernation and suspend events */ 241/* Hibernation and suspend events */
234#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ 242#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
diff --git a/include/linux/of.h b/include/linux/of.h
index 79886ade070f..e2488f5e7cb2 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -71,5 +71,8 @@ extern int of_n_size_cells(struct device_node *np);
71extern const struct of_device_id *of_match_node( 71extern const struct of_device_id *of_match_node(
72 const struct of_device_id *matches, const struct device_node *node); 72 const struct of_device_id *matches, const struct device_node *node);
73extern int of_modalias_node(struct device_node *node, char *modalias, int len); 73extern int of_modalias_node(struct device_node *node, char *modalias, int len);
74extern int of_parse_phandles_with_args(struct device_node *np,
75 const char *list_name, const char *cells_name, int index,
76 struct device_node **out_node, const void **out_args);
74 77
75#endif /* _LINUX_OF_H */ 78#endif /* _LINUX_OF_H */
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 041bb31100f4..bcb8f725427c 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -36,6 +36,8 @@
36#define XEN_ENTER_SWITCH_CODE 10 36#define XEN_ENTER_SWITCH_CODE 10
37#define SPU_PROFILING_CODE 11 37#define SPU_PROFILING_CODE 11
38#define SPU_CTX_SWITCH_CODE 12 38#define SPU_CTX_SWITCH_CODE 12
39#define IBS_FETCH_CODE 13
40#define IBS_OP_CODE 14
39 41
40struct super_block; 42struct super_block;
41struct dentry; 43struct dentry;
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 6a0d7cdb5774..e1f83c5065c5 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -1,5 +1,3 @@
1/* $Id: parport.h,v 1.1 1998/05/17 10:57:52 andrea Exp andrea $ */
2
3/* 1/*
4 * Any part of this program may be used in documents licensed under 2 * Any part of this program may be used in documents licensed under
5 * the GNU Free Documentation License, Version 1.1 or any later version 3 * the GNU Free Documentation License, Version 1.1 or any later version
diff --git a/include/linux/parser.h b/include/linux/parser.h
index 7dcd05075756..ea2281e726f6 100644
--- a/include/linux/parser.h
+++ b/include/linux/parser.h
@@ -25,7 +25,7 @@ typedef struct {
25 char *to; 25 char *to;
26} substring_t; 26} substring_t;
27 27
28int match_token(char *, match_table_t table, substring_t args[]); 28int match_token(char *, const match_table_t table, substring_t args[]);
29int match_int(substring_t *, int *result); 29int match_int(substring_t *, int *result);
30int match_octal(substring_t *, int *result); 30int match_octal(substring_t *, int *result);
31int match_hex(substring_t *, int *result); 31int match_hex(substring_t *, int *result);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c0e14008a3c2..98dc6243a706 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -534,7 +534,7 @@ extern void pci_sort_breadthfirst(void);
534#ifdef CONFIG_PCI_LEGACY 534#ifdef CONFIG_PCI_LEGACY
535struct pci_dev __deprecated *pci_find_device(unsigned int vendor, 535struct pci_dev __deprecated *pci_find_device(unsigned int vendor,
536 unsigned int device, 536 unsigned int device,
537 const struct pci_dev *from); 537 struct pci_dev *from);
538struct pci_dev __deprecated *pci_find_slot(unsigned int bus, 538struct pci_dev __deprecated *pci_find_slot(unsigned int bus,
539 unsigned int devfn); 539 unsigned int devfn);
540#endif /* CONFIG_PCI_LEGACY */ 540#endif /* CONFIG_PCI_LEGACY */
@@ -550,7 +550,7 @@ struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
550 struct pci_dev *from); 550 struct pci_dev *from);
551struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, 551struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
552 unsigned int ss_vendor, unsigned int ss_device, 552 unsigned int ss_vendor, unsigned int ss_device,
553 const struct pci_dev *from); 553 struct pci_dev *from);
554struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); 554struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
555struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); 555struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
556struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); 556struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
@@ -816,7 +816,7 @@ _PCI_NOP_ALL(write,)
816 816
817static inline struct pci_dev *pci_find_device(unsigned int vendor, 817static inline struct pci_dev *pci_find_device(unsigned int vendor,
818 unsigned int device, 818 unsigned int device,
819 const struct pci_dev *from) 819 struct pci_dev *from)
820{ 820{
821 return NULL; 821 return NULL;
822} 822}
@@ -838,7 +838,7 @@ static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
838 unsigned int device, 838 unsigned int device,
839 unsigned int ss_vendor, 839 unsigned int ss_vendor,
840 unsigned int ss_device, 840 unsigned int ss_device,
841 const struct pci_dev *from) 841 struct pci_dev *from)
842{ 842{
843 return NULL; 843 return NULL;
844} 844}
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f1624b396754..8edddc240e4f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -497,6 +497,16 @@
497#define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 497#define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101
498#define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 498#define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102
499#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 499#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103
500#define PCI_DEVICE_ID_AMD_10H_NB_HT 0x1200
501#define PCI_DEVICE_ID_AMD_10H_NB_MAP 0x1201
502#define PCI_DEVICE_ID_AMD_10H_NB_DRAM 0x1202
503#define PCI_DEVICE_ID_AMD_10H_NB_MISC 0x1203
504#define PCI_DEVICE_ID_AMD_10H_NB_LINK 0x1204
505#define PCI_DEVICE_ID_AMD_11H_NB_HT 0x1300
506#define PCI_DEVICE_ID_AMD_11H_NB_MAP 0x1301
507#define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302
508#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
509#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
500#define PCI_DEVICE_ID_AMD_LANCE 0x2000 510#define PCI_DEVICE_ID_AMD_LANCE 0x2000
501#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 511#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
502#define PCI_DEVICE_ID_AMD_SCSI 0x2020 512#define PCI_DEVICE_ID_AMD_SCSI 0x2020
@@ -577,6 +587,7 @@
577#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 587#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520
578#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 588#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521
579#define PCI_DEVICE_ID_MATROX_G400 0x0525 589#define PCI_DEVICE_ID_MATROX_G400 0x0525
590#define PCI_DEVICE_ID_MATROX_G200EV_PCI 0x0530
580#define PCI_DEVICE_ID_MATROX_G550 0x2527 591#define PCI_DEVICE_ID_MATROX_G550 0x2527
581#define PCI_DEVICE_ID_MATROX_VIA 0x4536 592#define PCI_DEVICE_ID_MATROX_VIA 0x4536
582 593
@@ -1411,6 +1422,8 @@
1411#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013 1422#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013
1412#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014 1423#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014
1413 1424
1425#define PCI_VENDOR_ID_CISCO 0x1137
1426
1414#define PCI_VENDOR_ID_ZIATECH 0x1138 1427#define PCI_VENDOR_ID_ZIATECH 0x1138
1415#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 1428#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
1416 1429
@@ -1521,7 +1534,9 @@
1521#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 1534#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430
1522#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 1535#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460
1523#define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 1536#define PCI_DEVICE_ID_MARVELL_MV64460 0x6480
1524#define PCI_DEVICE_ID_MARVELL_CAFE_SD 0x4101 1537#define PCI_DEVICE_ID_MARVELL_88ALP01_NAND 0x4100
1538#define PCI_DEVICE_ID_MARVELL_88ALP01_SD 0x4101
1539#define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102
1525 1540
1526#define PCI_VENDOR_ID_V3 0x11b0 1541#define PCI_VENDOR_ID_V3 0x11b0
1527#define PCI_DEVICE_ID_V3_V960 0x0001 1542#define PCI_DEVICE_ID_V3_V960 0x0001
@@ -2213,6 +2228,7 @@
2213 2228
2214#define PCI_VENDOR_ID_ATTANSIC 0x1969 2229#define PCI_VENDOR_ID_ATTANSIC 0x1969
2215#define PCI_DEVICE_ID_ATTANSIC_L1 0x1048 2230#define PCI_DEVICE_ID_ATTANSIC_L1 0x1048
2231#define PCI_DEVICE_ID_ATTANSIC_L2 0x2048
2216 2232
2217#define PCI_VENDOR_ID_JMICRON 0x197B 2233#define PCI_VENDOR_ID_JMICRON 0x197B
2218#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 2234#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
@@ -2244,6 +2260,16 @@
2244#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 2260#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007
2245#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 2261#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009
2246 2262
2263#define PCI_VENDOR_ID_NETXEN 0x4040
2264#define PCI_DEVICE_ID_NX2031_10GXSR 0x0001
2265#define PCI_DEVICE_ID_NX2031_10GCX4 0x0002
2266#define PCI_DEVICE_ID_NX2031_4GCU 0x0003
2267#define PCI_DEVICE_ID_NX2031_IMEZ 0x0004
2268#define PCI_DEVICE_ID_NX2031_HMEZ 0x0005
2269#define PCI_DEVICE_ID_NX2031_XG_MGMT 0x0024
2270#define PCI_DEVICE_ID_NX2031_XG_MGMT2 0x0025
2271#define PCI_DEVICE_ID_NX3031 0x0100
2272
2247#define PCI_VENDOR_ID_AKS 0x416c 2273#define PCI_VENDOR_ID_AKS 0x416c
2248#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 2274#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
2249 2275
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index fac3337547eb..9f2a3751873a 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -23,12 +23,19 @@
23 __attribute__((__section__(SHARED_ALIGNED_SECTION))) \ 23 __attribute__((__section__(SHARED_ALIGNED_SECTION))) \
24 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ 24 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \
25 ____cacheline_aligned_in_smp 25 ____cacheline_aligned_in_smp
26
27#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
28 __attribute__((__section__(".data.percpu.page_aligned"))) \
29 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
26#else 30#else
27#define DEFINE_PER_CPU(type, name) \ 31#define DEFINE_PER_CPU(type, name) \
28 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name 32 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
29 33
30#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ 34#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
31 DEFINE_PER_CPU(type, name) 35 DEFINE_PER_CPU(type, name)
36
37#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
38 DEFINE_PER_CPU(type, name)
32#endif 39#endif
33 40
34#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) 41#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 208388835357..9007ccdfc112 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -35,7 +35,7 @@ int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount);
35void percpu_counter_destroy(struct percpu_counter *fbc); 35void percpu_counter_destroy(struct percpu_counter *fbc);
36void percpu_counter_set(struct percpu_counter *fbc, s64 amount); 36void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
37void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); 37void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
38s64 __percpu_counter_sum(struct percpu_counter *fbc, int set); 38s64 __percpu_counter_sum(struct percpu_counter *fbc);
39 39
40static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) 40static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
41{ 41{
@@ -44,19 +44,13 @@ static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
44 44
45static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) 45static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
46{ 46{
47 s64 ret = __percpu_counter_sum(fbc, 0); 47 s64 ret = __percpu_counter_sum(fbc);
48 return ret < 0 ? 0 : ret; 48 return ret < 0 ? 0 : ret;
49} 49}
50 50
51static inline s64 percpu_counter_sum_and_set(struct percpu_counter *fbc)
52{
53 return __percpu_counter_sum(fbc, 1);
54}
55
56
57static inline s64 percpu_counter_sum(struct percpu_counter *fbc) 51static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
58{ 52{
59 return __percpu_counter_sum(fbc, 0); 53 return __percpu_counter_sum(fbc);
60} 54}
61 55
62static inline s64 percpu_counter_read(struct percpu_counter *fbc) 56static inline s64 percpu_counter_read(struct percpu_counter *fbc)
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 700725ddcaae..01b262959f2e 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -226,6 +226,15 @@ struct sadb_x_sec_ctx {
226} __attribute__((packed)); 226} __attribute__((packed));
227/* sizeof(struct sadb_sec_ctx) = 8 */ 227/* sizeof(struct sadb_sec_ctx) = 8 */
228 228
229/* Used by MIGRATE to pass addresses IKE will use to perform
230 * negotiation with the peer */
231struct sadb_x_kmaddress {
232 uint16_t sadb_x_kmaddress_len;
233 uint16_t sadb_x_kmaddress_exttype;
234 uint32_t sadb_x_kmaddress_reserved;
235} __attribute__((packed));
236/* sizeof(struct sadb_x_kmaddress) == 8 */
237
229/* Message types */ 238/* Message types */
230#define SADB_RESERVED 0 239#define SADB_RESERVED 0
231#define SADB_GETSPI 1 240#define SADB_GETSPI 1
@@ -346,7 +355,9 @@ struct sadb_x_sec_ctx {
346#define SADB_X_EXT_NAT_T_DPORT 22 355#define SADB_X_EXT_NAT_T_DPORT 22
347#define SADB_X_EXT_NAT_T_OA 23 356#define SADB_X_EXT_NAT_T_OA 23
348#define SADB_X_EXT_SEC_CTX 24 357#define SADB_X_EXT_SEC_CTX 24
349#define SADB_EXT_MAX 24 358/* Used with MIGRATE to pass @ to IKE for negotiation */
359#define SADB_X_EXT_KMADDRESS 25
360#define SADB_EXT_MAX 25
350 361
351/* Identity Extension values */ 362/* Identity Extension values */
352#define SADB_IDENTTYPE_RESERVED 0 363#define SADB_IDENTTYPE_RESERVED 0
diff --git a/include/linux/pfn.h b/include/linux/pfn.h
index bb01f8b92b56..7646637221f3 100644
--- a/include/linux/pfn.h
+++ b/include/linux/pfn.h
@@ -1,9 +1,13 @@
1#ifndef _LINUX_PFN_H_ 1#ifndef _LINUX_PFN_H_
2#define _LINUX_PFN_H_ 2#define _LINUX_PFN_H_
3 3
4#ifndef __ASSEMBLY__
5#include <linux/types.h>
6#endif
7
4#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) 8#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
5#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) 9#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
6#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) 10#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
7#define PFN_PHYS(x) ((x) << PAGE_SHIFT) 11#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
8 12
9#endif 13#endif
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
new file mode 100644
index 000000000000..c9609f9aedac
--- /dev/null
+++ b/include/linux/phonet.h
@@ -0,0 +1,170 @@
1/**
2 * file phonet.h
3 *
4 * Phonet sockets kernel interface
5 *
6 * Copyright (C) 2008 Nokia Corporation. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef LINUX_PHONET_H
24#define LINUX_PHONET_H
25
26/* Automatic protocol selection */
27#define PN_PROTO_TRANSPORT 0
28/* Phonet datagram socket */
29#define PN_PROTO_PHONET 1
30/* Phonet pipe */
31#define PN_PROTO_PIPE 2
32#define PHONET_NPROTO 3
33
34/* Socket options for SOL_PNPIPE level */
35#define PNPIPE_ENCAP 1
36#define PNPIPE_IFINDEX 2
37
38#define PNADDR_ANY 0
39#define PNPORT_RESOURCE_ROUTING 0
40
41/* Values for PNPIPE_ENCAP option */
42#define PNPIPE_ENCAP_NONE 0
43#define PNPIPE_ENCAP_IP 1
44
45/* ioctls */
46#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
47
48/* Phonet protocol header */
49struct phonethdr {
50 __u8 pn_rdev;
51 __u8 pn_sdev;
52 __u8 pn_res;
53 __be16 pn_length;
54 __u8 pn_robj;
55 __u8 pn_sobj;
56} __attribute__((packed));
57
58/* Common Phonet payload header */
59struct phonetmsg {
60 __u8 pn_trans_id; /* transaction ID */
61 __u8 pn_msg_id; /* message type */
62 union {
63 struct {
64 __u8 pn_submsg_id; /* message subtype */
65 __u8 pn_data[5];
66 } base;
67 struct {
68 __u16 pn_e_res_id; /* extended resource ID */
69 __u8 pn_e_submsg_id; /* message subtype */
70 __u8 pn_e_data[3];
71 } ext;
72 } pn_msg_u;
73};
74#define PN_COMMON_MESSAGE 0xF0
75#define PN_PREFIX 0xE0 /* resource for extended messages */
76#define pn_submsg_id pn_msg_u.base.pn_submsg_id
77#define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id
78#define pn_e_res_id pn_msg_u.ext.pn_e_res_id
79#define pn_data pn_msg_u.base.pn_data
80#define pn_e_data pn_msg_u.ext.pn_e_data
81
82/* data for unreachable errors */
83#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01
84#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14
85#define pn_orig_msg_id pn_data[0]
86#define pn_status pn_data[1]
87#define pn_e_orig_msg_id pn_e_data[0]
88#define pn_e_status pn_e_data[1]
89
90/* Phonet socket address structure */
91struct sockaddr_pn {
92 sa_family_t spn_family;
93 __u8 spn_obj;
94 __u8 spn_dev;
95 __u8 spn_resource;
96 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
97} __attribute__ ((packed));
98
99static inline __u16 pn_object(__u8 addr, __u16 port)
100{
101 return (addr << 8) | (port & 0x3ff);
102}
103
104static inline __u8 pn_obj(__u16 handle)
105{
106 return handle & 0xff;
107}
108
109static inline __u8 pn_dev(__u16 handle)
110{
111 return handle >> 8;
112}
113
114static inline __u16 pn_port(__u16 handle)
115{
116 return handle & 0x3ff;
117}
118
119static inline __u8 pn_addr(__u16 handle)
120{
121 return (handle >> 8) & 0xfc;
122}
123
124static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr)
125{
126 spn->spn_dev &= 0x03;
127 spn->spn_dev |= addr & 0xfc;
128}
129
130static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port)
131{
132 spn->spn_dev &= 0xfc;
133 spn->spn_dev |= (port >> 8) & 0x03;
134 spn->spn_obj = port & 0xff;
135}
136
137static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn,
138 __u16 handle)
139{
140 spn->spn_dev = pn_dev(handle);
141 spn->spn_obj = pn_obj(handle);
142}
143
144static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn,
145 __u8 resource)
146{
147 spn->spn_resource = resource;
148}
149
150static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn)
151{
152 return spn->spn_dev & 0xfc;
153}
154
155static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn)
156{
157 return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj;
158}
159
160static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn)
161{
162 return pn_object(spn->spn_dev, spn->spn_obj);
163}
164
165static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
166{
167 return spn->spn_resource;
168}
169
170#endif
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 7224c4099a28..77c4ed60b982 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -99,7 +99,14 @@ struct mii_bus {
99 */ 99 */
100 struct mutex mdio_lock; 100 struct mutex mdio_lock;
101 101
102 struct device *dev; 102 struct device *parent;
103 enum {
104 MDIOBUS_ALLOCATED = 1,
105 MDIOBUS_REGISTERED,
106 MDIOBUS_UNREGISTERED,
107 MDIOBUS_RELEASED,
108 } state;
109 struct device dev;
103 110
104 /* list of all PHYs on bus */ 111 /* list of all PHYs on bus */
105 struct phy_device *phy_map[PHY_MAX_ADDR]; 112 struct phy_device *phy_map[PHY_MAX_ADDR];
@@ -113,6 +120,16 @@ struct mii_bus {
113 */ 120 */
114 int *irq; 121 int *irq;
115}; 122};
123#define to_mii_bus(d) container_of(d, struct mii_bus, dev)
124
125struct mii_bus *mdiobus_alloc(void);
126int mdiobus_register(struct mii_bus *bus);
127void mdiobus_unregister(struct mii_bus *bus);
128void mdiobus_free(struct mii_bus *bus);
129struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
130int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum);
131int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val);
132
116 133
117#define PHY_INTERRUPT_DISABLED 0x0 134#define PHY_INTERRUPT_DISABLED 0x0
118#define PHY_INTERRUPT_ENABLED 0x80000000 135#define PHY_INTERRUPT_ENABLED 0x80000000
@@ -391,8 +408,35 @@ struct phy_fixup {
391 int (*run)(struct phy_device *phydev); 408 int (*run)(struct phy_device *phydev);
392}; 409};
393 410
394int phy_read(struct phy_device *phydev, u16 regnum); 411/**
395int phy_write(struct phy_device *phydev, u16 regnum, u16 val); 412 * phy_read - Convenience function for reading a given PHY register
413 * @phydev: the phy_device struct
414 * @regnum: register number to read
415 *
416 * NOTE: MUST NOT be called from interrupt context,
417 * because the bus read/write functions may wait for an interrupt
418 * to conclude the operation.
419 */
420static inline int phy_read(struct phy_device *phydev, u16 regnum)
421{
422 return mdiobus_read(phydev->bus, phydev->addr, regnum);
423}
424
425/**
426 * phy_write - Convenience function for writing a given PHY register
427 * @phydev: the phy_device struct
428 * @regnum: register number to write
429 * @val: value to write to @regnum
430 *
431 * NOTE: MUST NOT be called from interrupt context,
432 * because the bus read/write functions may wait for an interrupt
433 * to conclude the operation.
434 */
435static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
436{
437 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
438}
439
396int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); 440int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
397struct phy_device* get_phy_device(struct mii_bus *bus, int addr); 441struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
398int phy_clear_interrupt(struct phy_device *phydev); 442int phy_clear_interrupt(struct phy_device *phydev);
@@ -408,8 +452,6 @@ void phy_start(struct phy_device *phydev);
408void phy_stop(struct phy_device *phydev); 452void phy_stop(struct phy_device *phydev);
409int phy_start_aneg(struct phy_device *phydev); 453int phy_start_aneg(struct phy_device *phydev);
410 454
411int mdiobus_register(struct mii_bus *bus);
412void mdiobus_unregister(struct mii_bus *bus);
413void phy_sanitize_settings(struct phy_device *phydev); 455void phy_sanitize_settings(struct phy_device *phydev);
414int phy_stop_interrupts(struct phy_device *phydev); 456int phy_stop_interrupts(struct phy_device *phydev);
415int phy_enable_interrupts(struct phy_device *phydev); 457int phy_enable_interrupts(struct phy_device *phydev);
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 1af82c4e17d4..d82fe825d62f 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -84,12 +84,6 @@ static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk)
84 return tsk->nsproxy->pid_ns; 84 return tsk->nsproxy->pid_ns;
85} 85}
86 86
87static inline struct task_struct *task_child_reaper(struct task_struct *tsk)
88{
89 BUG_ON(tsk != current);
90 return tsk->nsproxy->pid_ns->child_reaper;
91}
92
93void pidhash_init(void); 87void pidhash_init(void);
94void pidmap_init(void); 88void pidmap_init(void);
95 89
diff --git a/include/linux/pim.h b/include/linux/pim.h
index 236ffd317394..1ba0661561a4 100644
--- a/include/linux/pim.h
+++ b/include/linux/pim.h
@@ -3,22 +3,6 @@
3 3
4#include <asm/byteorder.h> 4#include <asm/byteorder.h>
5 5
6#ifndef __KERNEL__
7struct pim {
8#if defined(__LITTLE_ENDIAN_BITFIELD)
9 __u8 pim_type:4, /* PIM message type */
10 pim_ver:4; /* PIM version */
11#elif defined(__BIG_ENDIAN_BITFIELD)
12 __u8 pim_ver:4; /* PIM version */
13 pim_type:4; /* PIM message type */
14#endif
15 __u8 pim_rsv; /* Reserved */
16 __be16 pim_cksum; /* Checksum */
17};
18
19#define PIM_MINLEN 8
20#endif
21
22/* Message types - V1 */ 6/* Message types - V1 */
23#define PIM_V1_VERSION __constant_htonl(0x10000000) 7#define PIM_V1_VERSION __constant_htonl(0x10000000)
24#define PIM_V1_REGISTER 1 8#define PIM_V1_REGISTER 1
@@ -27,7 +11,6 @@ struct pim {
27#define PIM_VERSION 2 11#define PIM_VERSION 2
28#define PIM_REGISTER 1 12#define PIM_REGISTER 1
29 13
30#if defined(__KERNEL__)
31#define PIM_NULL_REGISTER __constant_htonl(0x40000000) 14#define PIM_NULL_REGISTER __constant_htonl(0x40000000)
32 15
33/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ 16/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */
@@ -42,4 +25,3 @@ struct pimreghdr
42struct sk_buff; 25struct sk_buff;
43extern int pim_rcv_v1(struct sk_buff *); 26extern int pim_rcv_v1(struct sk_buff *);
44#endif 27#endif
45#endif
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index e5de421ac7b4..5d921fa91a5b 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -123,6 +123,13 @@ struct tc_prio_qopt
123 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 123 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
124}; 124};
125 125
126/* MULTIQ section */
127
128struct tc_multiq_qopt {
129 __u16 bands; /* Number of bands */
130 __u16 max_bands; /* Maximum number of queues */
131};
132
126/* TBF section */ 133/* TBF section */
127 134
128struct tc_tbf_qopt 135struct tc_tbf_qopt
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 95ac21ab3a09..4b8cc6a32479 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -37,6 +37,8 @@ extern int platform_add_devices(struct platform_device **, int);
37 37
38extern struct platform_device *platform_device_register_simple(const char *, int id, 38extern struct platform_device *platform_device_register_simple(const char *, int id,
39 struct resource *, unsigned int); 39 struct resource *, unsigned int);
40extern struct platform_device *platform_device_register_data(struct device *,
41 const char *, int, const void *, size_t);
40 42
41extern struct platform_device *platform_device_alloc(const char *name, int id); 43extern struct platform_device *platform_device_alloc(const char *name, int id);
42extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); 44extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 4dcce54b6d76..42de4003c4ee 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -419,7 +419,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
419 419
420#define suspend_report_result(fn, ret) \ 420#define suspend_report_result(fn, ret) \
421 do { \ 421 do { \
422 __suspend_report_result(__FUNCTION__, fn, ret); \ 422 __suspend_report_result(__func__, fn, ret); \
423 } while (0) 423 } while (0)
424 424
425#else /* !CONFIG_PM_SLEEP */ 425#else /* !CONFIG_PM_SLEEP */
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 1ce54b63085d..53b70fd1d9a5 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -21,7 +21,16 @@ struct pnp_dev;
21/* 21/*
22 * Resource Management 22 * Resource Management
23 */ 23 */
24struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); 24#ifdef CONFIG_PNP
25struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type,
26 unsigned int num);
27#else
28static inline struct resource *pnp_get_resource(struct pnp_dev *dev,
29 unsigned long type, unsigned int num)
30{
31 return NULL;
32}
33#endif
25 34
26static inline int pnp_resource_valid(struct resource *res) 35static inline int pnp_resource_valid(struct resource *res)
27{ 36{
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index a7dd38f30ade..a7c721355549 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -45,8 +45,6 @@ struct k_itimer {
45 int it_requeue_pending; /* waiting to requeue this timer */ 45 int it_requeue_pending; /* waiting to requeue this timer */
46#define REQUEUE_PENDING 1 46#define REQUEUE_PENDING 1
47 int it_sigev_notify; /* notify word of sigevent struct */ 47 int it_sigev_notify; /* notify word of sigevent struct */
48 int it_sigev_signo; /* signo word of sigevent struct */
49 sigval_t it_sigev_value; /* value word of sigevent struct */
50 struct task_struct *it_process; /* process to send signal to */ 48 struct task_struct *it_process; /* process to send signal to */
51 struct sigqueue *sigq; /* signal queue entry. */ 49 struct sigqueue *sigq; /* signal queue entry. */
52 union { 50 union {
@@ -115,4 +113,6 @@ void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
115 113
116long clock_nanosleep_restart(struct restart_block *restart_block); 114long clock_nanosleep_restart(struct restart_block *restart_block);
117 115
116void update_rlimit_cpu(unsigned long rlim_new);
117
118#endif 118#endif
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index fb61850d1cfc..27d534f4470d 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -139,7 +139,6 @@ extern int proc_readdir(struct file *, void *, filldir_t);
139extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); 139extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *);
140 140
141extern const struct file_operations proc_kcore_operations; 141extern const struct file_operations proc_kcore_operations;
142extern const struct file_operations ppc_htab_operations;
143 142
144extern int pid_ns_prepare_proc(struct pid_namespace *ns); 143extern int pid_ns_prepare_proc(struct pid_namespace *ns);
145extern void pid_ns_release_proc(struct pid_namespace *ns); 144extern void pid_ns_release_proc(struct pid_namespace *ns);
diff --git a/include/linux/profile.h b/include/linux/profile.h
index 7e7087239af5..570045053ce9 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -35,7 +35,9 @@ enum profile_type {
35extern int prof_on __read_mostly; 35extern int prof_on __read_mostly;
36 36
37/* init basic kernel profiler */ 37/* init basic kernel profiler */
38void __init profile_init(void); 38int profile_init(void);
39int profile_setup(char *str);
40int create_proc_profile(void);
39void profile_tick(int type); 41void profile_tick(int type);
40 42
41/* 43/*
@@ -84,9 +86,9 @@ struct pt_regs;
84 86
85#define prof_on 0 87#define prof_on 0
86 88
87static inline void profile_init(void) 89static inline int profile_init(void)
88{ 90{
89 return; 91 return 0;
90} 92}
91 93
92static inline void profile_tick(int type) 94static inline void profile_tick(int type)
diff --git a/include/linux/proportions.h b/include/linux/proportions.h
index 5afc1b23346d..cf793bbbd05e 100644
--- a/include/linux/proportions.h
+++ b/include/linux/proportions.h
@@ -104,8 +104,8 @@ struct prop_local_single {
104 * snapshot of the last seen global state 104 * snapshot of the last seen global state
105 * and a lock protecting this state 105 * and a lock protecting this state
106 */ 106 */
107 int shift;
108 unsigned long period; 107 unsigned long period;
108 int shift;
109 spinlock_t lock; /* protect the snapshot state */ 109 spinlock_t lock; /* protect the snapshot state */
110}; 110};
111 111
diff --git a/include/linux/quicklist.h b/include/linux/quicklist.h
index 39b66713a0bb..bd466439c588 100644
--- a/include/linux/quicklist.h
+++ b/include/linux/quicklist.h
@@ -80,6 +80,13 @@ void quicklist_trim(int nr, void (*dtor)(void *),
80 80
81unsigned long quicklist_total_size(void); 81unsigned long quicklist_total_size(void);
82 82
83#else
84
85static inline unsigned long quicklist_total_size(void)
86{
87 return 0;
88}
89
83#endif 90#endif
84 91
85#endif /* LINUX_QUICKLIST_H */ 92#endif /* LINUX_QUICKLIST_H */
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 376a05048bc5..40401b554484 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -28,8 +28,6 @@
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE. 30 * SUCH DAMAGE.
31 *
32 * Version: $Id: quota.h,v 2.0 1996/11/17 16:48:14 mvw Exp mvw $
33 */ 31 */
34 32
35#ifndef _LINUX_QUOTA_ 33#ifndef _LINUX_QUOTA_
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index ca6b9b5c8d52..a558a4c1d35a 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -3,9 +3,6 @@
3 * macros expand to the right source-code. 3 * macros expand to the right source-code.
4 * 4 *
5 * Author: Marco van Wieringen <mvw@planets.elm.net> 5 * Author: Marco van Wieringen <mvw@planets.elm.net>
6 *
7 * Version: $Id: quotaops.h,v 1.2 1998/01/15 16:22:26 ecd Exp $
8 *
9 */ 6 */
10#ifndef _LINUX_QUOTAOPS_ 7#ifndef _LINUX_QUOTAOPS_
11#define _LINUX_QUOTAOPS_ 8#define _LINUX_QUOTAOPS_
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h
index 7e375111d007..f38b9c586afb 100644
--- a/include/linux/raid/linear.h
+++ b/include/linux/raid/linear.h
@@ -5,8 +5,8 @@
5 5
6struct dev_info { 6struct dev_info {
7 mdk_rdev_t *rdev; 7 mdk_rdev_t *rdev;
8 sector_t size; 8 sector_t num_sectors;
9 sector_t offset; 9 sector_t start_sector;
10}; 10};
11 11
12typedef struct dev_info dev_info_t; 12typedef struct dev_info dev_info_t;
@@ -15,9 +15,11 @@ struct linear_private_data
15{ 15{
16 struct linear_private_data *prev; /* earlier version */ 16 struct linear_private_data *prev; /* earlier version */
17 dev_info_t **hash_table; 17 dev_info_t **hash_table;
18 sector_t hash_spacing; 18 sector_t spacing;
19 sector_t array_sectors; 19 sector_t array_sectors;
20 int preshift; /* shift before dividing by hash_spacing */ 20 int sector_shift; /* shift before dividing
21 * by spacing
22 */
21 dev_info_t disks[0]; 23 dev_info_t disks[0];
22}; 24};
23 25
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index dc0e3fcb9f28..82bea14cae1a 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -19,27 +19,7 @@
19#define _MD_H 19#define _MD_H
20 20
21#include <linux/blkdev.h> 21#include <linux/blkdev.h>
22#include <linux/major.h>
23#include <linux/ioctl.h>
24#include <linux/types.h>
25#include <linux/bitops.h>
26#include <linux/module.h>
27#include <linux/hdreg.h>
28#include <linux/proc_fs.h>
29#include <linux/seq_file.h> 22#include <linux/seq_file.h>
30#include <linux/smp_lock.h>
31#include <linux/delay.h>
32#include <net/checksum.h>
33#include <linux/random.h>
34#include <linux/kernel_stat.h>
35#include <asm/io.h>
36#include <linux/completion.h>
37#include <linux/mempool.h>
38#include <linux/list.h>
39#include <linux/reboot.h>
40#include <linux/vmalloc.h>
41#include <linux/blkpg.h>
42#include <linux/bio.h>
43 23
44/* 24/*
45 * 'md_p.h' holds the 'physical' layout of RAID devices 25 * 'md_p.h' holds the 'physical' layout of RAID devices
@@ -74,19 +54,17 @@
74 54
75extern int mdp_major; 55extern int mdp_major;
76 56
77extern int register_md_personality (struct mdk_personality *p); 57extern int register_md_personality(struct mdk_personality *p);
78extern int unregister_md_personality (struct mdk_personality *p); 58extern int unregister_md_personality(struct mdk_personality *p);
79extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev), 59extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev),
80 mddev_t *mddev, const char *name); 60 mddev_t *mddev, const char *name);
81extern void md_unregister_thread (mdk_thread_t *thread); 61extern void md_unregister_thread(mdk_thread_t *thread);
82extern void md_wakeup_thread(mdk_thread_t *thread); 62extern void md_wakeup_thread(mdk_thread_t *thread);
83extern void md_check_recovery(mddev_t *mddev); 63extern void md_check_recovery(mddev_t *mddev);
84extern void md_write_start(mddev_t *mddev, struct bio *bi); 64extern void md_write_start(mddev_t *mddev, struct bio *bi);
85extern void md_write_end(mddev_t *mddev); 65extern void md_write_end(mddev_t *mddev);
86extern void md_handle_safemode(mddev_t *mddev);
87extern void md_done_sync(mddev_t *mddev, int blocks, int ok); 66extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
88extern void md_error (mddev_t *mddev, mdk_rdev_t *rdev); 67extern void md_error(mddev_t *mddev, mdk_rdev_t *rdev);
89extern void md_unplug_mddev(mddev_t *mddev);
90 68
91extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, 69extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
92 sector_t sector, int size, struct page *page); 70 sector_t sector, int size, struct page *page);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index b160fb18e8d6..37aaf2b39863 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -6,6 +6,7 @@ extern int ramfs_get_sb(struct file_system_type *fs_type,
6 int flags, const char *dev_name, void *data, struct vfsmount *mnt); 6 int flags, const char *dev_name, void *data, struct vfsmount *mnt);
7 7
8#ifndef CONFIG_MMU 8#ifndef CONFIG_MMU
9extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
9extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, 10extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
10 unsigned long addr, 11 unsigned long addr,
11 unsigned long len, 12 unsigned long len,
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h
index 4ab843622727..5f89b62e6983 100644
--- a/include/linux/rcuclassic.h
+++ b/include/linux/rcuclassic.h
@@ -40,12 +40,21 @@
40#include <linux/cpumask.h> 40#include <linux/cpumask.h>
41#include <linux/seqlock.h> 41#include <linux/seqlock.h>
42 42
43#ifdef CONFIG_RCU_CPU_STALL_DETECTOR
44#define RCU_SECONDS_TILL_STALL_CHECK ( 3 * HZ) /* for rcp->jiffies_stall */
45#define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rcp->jiffies_stall */
46#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
43 47
44/* Global control variables for rcupdate callback mechanism. */ 48/* Global control variables for rcupdate callback mechanism. */
45struct rcu_ctrlblk { 49struct rcu_ctrlblk {
46 long cur; /* Current batch number. */ 50 long cur; /* Current batch number. */
47 long completed; /* Number of the last completed batch */ 51 long completed; /* Number of the last completed batch */
48 int next_pending; /* Is the next batch already waiting? */ 52 long pending; /* Number of the last pending batch */
53#ifdef CONFIG_RCU_CPU_STALL_DETECTOR
54 unsigned long gp_start; /* Time at which GP started in jiffies. */
55 unsigned long jiffies_stall;
56 /* Time at which to check for CPU stalls. */
57#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
49 58
50 int signaled; 59 int signaled;
51 60
@@ -66,11 +75,7 @@ static inline int rcu_batch_after(long a, long b)
66 return (a - b) > 0; 75 return (a - b) > 0;
67} 76}
68 77
69/* 78/* Per-CPU data for Read-Copy UPdate. */
70 * Per-CPU data for Read-Copy UPdate.
71 * nxtlist - new callbacks are added here
72 * curlist - current batch for which quiescent cycle started if any
73 */
74struct rcu_data { 79struct rcu_data {
75 /* 1) quiescent state handling : */ 80 /* 1) quiescent state handling : */
76 long quiescbatch; /* Batch # for grace period */ 81 long quiescbatch; /* Batch # for grace period */
@@ -78,12 +83,24 @@ struct rcu_data {
78 int qs_pending; /* core waits for quiesc state */ 83 int qs_pending; /* core waits for quiesc state */
79 84
80 /* 2) batch handling */ 85 /* 2) batch handling */
81 long batch; /* Batch # for current RCU batch */ 86 /*
87 * if nxtlist is not NULL, then:
88 * batch:
89 * The batch # for the last entry of nxtlist
90 * [*nxttail[1], NULL = *nxttail[2]):
91 * Entries that batch # <= batch
92 * [*nxttail[0], *nxttail[1]):
93 * Entries that batch # <= batch - 1
94 * [nxtlist, *nxttail[0]):
95 * Entries that batch # <= batch - 2
96 * The grace period for these entries has completed, and
97 * the other grace-period-completed entries may be moved
98 * here temporarily in rcu_process_callbacks().
99 */
100 long batch;
82 struct rcu_head *nxtlist; 101 struct rcu_head *nxtlist;
83 struct rcu_head **nxttail; 102 struct rcu_head **nxttail[3];
84 long qlen; /* # of queued callbacks */ 103 long qlen; /* # of queued callbacks */
85 struct rcu_head *curlist;
86 struct rcu_head **curtail;
87 struct rcu_head *donelist; 104 struct rcu_head *donelist;
88 struct rcu_head **donetail; 105 struct rcu_head **donetail;
89 long blimit; /* Upper limit on a processed batch */ 106 long blimit; /* Upper limit on a processed batch */
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index eb4443c7e05b..e649bd3f2c97 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -198,20 +198,6 @@ static inline void list_splice_init_rcu(struct list_head *list,
198 at->prev = last; 198 at->prev = last;
199} 199}
200 200
201/**
202 * list_for_each_rcu - iterate over an rcu-protected list
203 * @pos: the &struct list_head to use as a loop cursor.
204 * @head: the head for your list.
205 *
206 * This list-traversal primitive may safely run concurrently with
207 * the _rcu list-mutation primitives such as list_add_rcu()
208 * as long as the traversal is guarded by rcu_read_lock().
209 */
210#define list_for_each_rcu(pos, head) \
211 for (pos = rcu_dereference((head)->next); \
212 prefetch(pos->next), pos != (head); \
213 pos = rcu_dereference(pos->next))
214
215#define __list_for_each_rcu(pos, head) \ 201#define __list_for_each_rcu(pos, head) \
216 for (pos = rcu_dereference((head)->next); \ 202 for (pos = rcu_dereference((head)->next); \
217 pos != (head); \ 203 pos != (head); \
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index e8b4039cfb2f..86f1f5e43e33 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -133,6 +133,26 @@ struct rcu_head {
133#define rcu_read_unlock_bh() __rcu_read_unlock_bh() 133#define rcu_read_unlock_bh() __rcu_read_unlock_bh()
134 134
135/** 135/**
136 * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section
137 *
138 * Should be used with either
139 * - synchronize_sched()
140 * or
141 * - call_rcu_sched() and rcu_barrier_sched()
142 * on the write-side to insure proper synchronization.
143 */
144#define rcu_read_lock_sched() preempt_disable()
145
146/*
147 * rcu_read_unlock_sched - marks the end of a RCU-classic critical section
148 *
149 * See rcu_read_lock_sched for more information.
150 */
151#define rcu_read_unlock_sched() preempt_enable()
152
153
154
155/**
136 * rcu_dereference - fetch an RCU-protected pointer in an 156 * rcu_dereference - fetch an RCU-protected pointer in an
137 * RCU read-side critical section. This pointer may later 157 * RCU read-side critical section. This pointer may later
138 * be safely dereferenced. 158 * be safely dereferenced.
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index 0967f03b0705..3e05c09b54a2 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -57,7 +57,13 @@ static inline void rcu_qsctr_inc(int cpu)
57 rdssp->sched_qs++; 57 rdssp->sched_qs++;
58} 58}
59#define rcu_bh_qsctr_inc(cpu) 59#define rcu_bh_qsctr_inc(cpu)
60#define call_rcu_bh(head, rcu) call_rcu(head, rcu) 60
61/*
62 * Someone might want to pass call_rcu_bh as a function pointer.
63 * So this needs to just be a rename and not a macro function.
64 * (no parentheses)
65 */
66#define call_rcu_bh call_rcu
61 67
62/** 68/**
63 * call_rcu_sched - Queue RCU callback for invocation after sched grace period. 69 * call_rcu_sched - Queue RCU callback for invocation after sched grace period.
@@ -111,7 +117,6 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
111struct softirq_action; 117struct softirq_action;
112 118
113#ifdef CONFIG_NO_HZ 119#ifdef CONFIG_NO_HZ
114DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);
115 120
116static inline void rcu_enter_nohz(void) 121static inline void rcu_enter_nohz(void)
117{ 122{
@@ -126,8 +131,8 @@ static inline void rcu_exit_nohz(void)
126{ 131{
127 static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); 132 static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
128 133
129 smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
130 __get_cpu_var(rcu_dyntick_sched).dynticks++; 134 __get_cpu_var(rcu_dyntick_sched).dynticks++;
135 smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
131 WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1), 136 WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1),
132 &rs); 137 &rs);
133} 138}
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 1d712c7172a2..e37d80561985 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -18,8 +18,8 @@
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/regulator/consumer.h> 19#include <linux/regulator/consumer.h>
20 20
21struct regulator_constraints;
22struct regulator_dev; 21struct regulator_dev;
22struct regulator_init_data;
23 23
24/** 24/**
25 * struct regulator_ops - regulator operations. 25 * struct regulator_ops - regulator operations.
@@ -51,7 +51,7 @@ struct regulator_ops {
51 int output_uV, int load_uA); 51 int output_uV, int load_uA);
52 52
53 /* the operations below are for configuration of regulator state when 53 /* the operations below are for configuration of regulator state when
54 * it's parent PMIC enters a global STANBY/HIBERNATE state */ 54 * its parent PMIC enters a global STANDBY/HIBERNATE state */
55 55
56 /* set regulator suspend voltage */ 56 /* set regulator suspend voltage */
57 int (*set_suspend_voltage) (struct regulator_dev *, int uV); 57 int (*set_suspend_voltage) (struct regulator_dev *, int uV);
@@ -85,15 +85,17 @@ struct regulator_desc {
85 struct module *owner; 85 struct module *owner;
86}; 86};
87 87
88
89struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, 88struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
90 void *reg_data); 89 struct device *dev, void *driver_data);
91void regulator_unregister(struct regulator_dev *rdev); 90void regulator_unregister(struct regulator_dev *rdev);
92 91
93int regulator_notifier_call_chain(struct regulator_dev *rdev, 92int regulator_notifier_call_chain(struct regulator_dev *rdev,
94 unsigned long event, void *data); 93 unsigned long event, void *data);
95 94
96void *rdev_get_drvdata(struct regulator_dev *rdev); 95void *rdev_get_drvdata(struct regulator_dev *rdev);
96struct device *rdev_get_dev(struct regulator_dev *rdev);
97int rdev_get_id(struct regulator_dev *rdev); 97int rdev_get_id(struct regulator_dev *rdev);
98 98
99void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
100
99#endif 101#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 11e737dbfcf2..c6d69331a81e 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -89,15 +89,33 @@ struct regulation_constraints {
89 unsigned apply_uV:1; /* apply uV constraint iff min == max */ 89 unsigned apply_uV:1; /* apply uV constraint iff min == max */
90}; 90};
91 91
92int regulator_set_supply(const char *regulator, const char *regulator_supply); 92/**
93 * struct regulator_consumer_supply - supply -> device mapping
94 *
95 * This maps a supply name to a device.
96 */
97struct regulator_consumer_supply {
98 struct device *dev; /* consumer */
99 const char *supply; /* consumer supply - e.g. "vcc" */
100};
93 101
94const char *regulator_get_supply(const char *regulator); 102/**
103 * struct regulator_init_data - regulator platform initialisation data.
104 *
105 * Initialisation constraints, our supply and consumers supplies.
106 */
107struct regulator_init_data {
108 struct device *supply_regulator_dev; /* or NULL for LINE */
95 109
96int regulator_set_machine_constraints(const char *regulator, 110 struct regulation_constraints constraints;
97 struct regulation_constraints *constraints);
98 111
99int regulator_set_device_supply(const char *regulator, struct device *dev, 112 int num_consumer_supplies;
100 const char *supply); 113 struct regulator_consumer_supply *consumer_supplies;
114
115 /* optional regulator machine specific init */
116 int (*regulator_init)(void *driver_data);
117 void *driver_data; /* core does not touch this */
118};
101 119
102int regulator_suspend_prepare(suspend_state_t state); 120int regulator_suspend_prepare(suspend_state_t state);
103 121
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index e9963af16cda..bc5114d35e99 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -87,7 +87,7 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...);
87if( !( cond ) ) \ 87if( !( cond ) ) \
88 reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ 88 reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \
89 __FILE__ ":%i:%s: " format "\n", \ 89 __FILE__ ":%i:%s: " format "\n", \
90 in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __FUNCTION__ , ##args ) 90 in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __func__ , ##args )
91 91
92#define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) 92#define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args)
93 93
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index fdeadd9740dc..271c1c2c9f6f 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -166,7 +166,7 @@ static inline int res_counter_set_limit(struct res_counter *cnt,
166 int ret = -EBUSY; 166 int ret = -EBUSY;
167 167
168 spin_lock_irqsave(&cnt->lock, flags); 168 spin_lock_irqsave(&cnt->lock, flags);
169 if (cnt->usage < limit) { 169 if (cnt->usage <= limit) {
170 cnt->limit = limit; 170 cnt->limit = limit;
171 ret = 0; 171 ret = 0;
172 } 172 }
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 741d1a62cc3f..4cd64b0d9825 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -49,6 +49,7 @@ enum rfkill_state {
49 RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ 49 RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */
50 RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ 50 RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */
51 RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ 51 RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */
52 RFKILL_STATE_MAX, /* marker for last valid state */
52}; 53};
53 54
54/* 55/*
@@ -110,12 +111,14 @@ struct rfkill {
110}; 111};
111#define to_rfkill(d) container_of(d, struct rfkill, dev) 112#define to_rfkill(d) container_of(d, struct rfkill, dev)
112 113
113struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type); 114struct rfkill * __must_check rfkill_allocate(struct device *parent,
115 enum rfkill_type type);
114void rfkill_free(struct rfkill *rfkill); 116void rfkill_free(struct rfkill *rfkill);
115int rfkill_register(struct rfkill *rfkill); 117int __must_check rfkill_register(struct rfkill *rfkill);
116void rfkill_unregister(struct rfkill *rfkill); 118void rfkill_unregister(struct rfkill *rfkill);
117 119
118int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); 120int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state);
121int rfkill_set_default(enum rfkill_type type, enum rfkill_state state);
119 122
120/** 123/**
121 * rfkill_state_complement - return complementar state 124 * rfkill_state_complement - return complementar state
diff --git a/include/linux/rtc/m48t59.h b/include/linux/rtc/m48t59.h
index e8c7c21ceb1f..6fc961459b4a 100644
--- a/include/linux/rtc/m48t59.h
+++ b/include/linux/rtc/m48t59.h
@@ -18,40 +18,47 @@
18/* 18/*
19 * M48T59 Register Offset 19 * M48T59 Register Offset
20 */ 20 */
21#define M48T59_YEAR 0x1fff 21#define M48T59_YEAR 0xf
22#define M48T59_MONTH 0x1ffe 22#define M48T59_MONTH 0xe
23#define M48T59_MDAY 0x1ffd /* Day of Month */ 23#define M48T59_MDAY 0xd /* Day of Month */
24#define M48T59_WDAY 0x1ffc /* Day of Week */ 24#define M48T59_WDAY 0xc /* Day of Week */
25#define M48T59_WDAY_CB 0x20 /* Century Bit */ 25#define M48T59_WDAY_CB 0x20 /* Century Bit */
26#define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */ 26#define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */
27#define M48T59_HOUR 0x1ffb 27#define M48T59_HOUR 0xb
28#define M48T59_MIN 0x1ffa 28#define M48T59_MIN 0xa
29#define M48T59_SEC 0x1ff9 29#define M48T59_SEC 0x9
30#define M48T59_CNTL 0x1ff8 30#define M48T59_CNTL 0x8
31#define M48T59_CNTL_READ 0x40 31#define M48T59_CNTL_READ 0x40
32#define M48T59_CNTL_WRITE 0x80 32#define M48T59_CNTL_WRITE 0x80
33#define M48T59_WATCHDOG 0x1ff7 33#define M48T59_WATCHDOG 0x7
34#define M48T59_INTR 0x1ff6 34#define M48T59_INTR 0x6
35#define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */ 35#define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */
36#define M48T59_INTR_ABE 0x20 36#define M48T59_INTR_ABE 0x20
37#define M48T59_ALARM_DATE 0x1ff5 37#define M48T59_ALARM_DATE 0x5
38#define M48T59_ALARM_HOUR 0x1ff4 38#define M48T59_ALARM_HOUR 0x4
39#define M48T59_ALARM_MIN 0x1ff3 39#define M48T59_ALARM_MIN 0x3
40#define M48T59_ALARM_SEC 0x1ff2 40#define M48T59_ALARM_SEC 0x2
41#define M48T59_UNUSED 0x1ff1 41#define M48T59_UNUSED 0x1
42#define M48T59_FLAGS 0x1ff0 42#define M48T59_FLAGS 0x0
43#define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */ 43#define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */
44#define M48T59_FLAGS_AF 0x40 /* alarm */ 44#define M48T59_FLAGS_AF 0x40 /* alarm */
45#define M48T59_FLAGS_BF 0x10 /* low battery */ 45#define M48T59_FLAGS_BF 0x10 /* low battery */
46 46
47#define M48T59_NVRAM_SIZE 0x1ff0 47#define M48T59RTC_TYPE_M48T59 0 /* to keep compatibility */
48#define M48T59RTC_TYPE_M48T02 1
49#define M48T59RTC_TYPE_M48T08 2
48 50
49struct m48t59_plat_data { 51struct m48t59_plat_data {
50 /* The method to access M48T59 registers, 52 /* The method to access M48T59 registers */
51 * NOTE: The 'ofs' should be 0x00~0x1fff
52 */
53 void (*write_byte)(struct device *dev, u32 ofs, u8 val); 53 void (*write_byte)(struct device *dev, u32 ofs, u8 val);
54 unsigned char (*read_byte)(struct device *dev, u32 ofs); 54 unsigned char (*read_byte)(struct device *dev, u32 ofs);
55
56 int type; /* RTC model */
57
58 /* ioaddr mapped externally */
59 void __iomem *ioaddr;
60 /* offset to RTC registers, automatically set according to the type */
61 unsigned int offset;
55}; 62};
56 63
57#endif /* _LINUX_RTC_M48T59_H_ */ 64#endif /* _LINUX_RTC_M48T59_H_ */
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 382bb7951166..f19b00b7d530 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -54,7 +54,7 @@ struct hrtimer_sleeper;
54#ifdef CONFIG_DEBUG_RT_MUTEXES 54#ifdef CONFIG_DEBUG_RT_MUTEXES
55# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ 55# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \
56 , .name = #mutexname, .file = __FILE__, .line = __LINE__ 56 , .name = #mutexname, .file = __FILE__, .line = __LINE__
57# define rt_mutex_init(mutex) __rt_mutex_init(mutex, __FUNCTION__) 57# define rt_mutex_init(mutex) __rt_mutex_init(mutex, __func__)
58 extern void rt_mutex_debug_task_free(struct task_struct *tsk); 58 extern void rt_mutex_debug_task_free(struct task_struct *tsk);
59#else 59#else
60# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) 60# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname)
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index ca643b13b026..2b3d51c6ec9c 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -582,6 +582,10 @@ enum rtnetlink_groups {
582#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE 582#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
583 RTNLGRP_ND_USEROPT, 583 RTNLGRP_ND_USEROPT,
584#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT 584#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
585 RTNLGRP_PHONET_IFADDR,
586#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
587 RTNLGRP_PHONET_ROUTE,
588#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
585 __RTNLGRP_MAX 589 __RTNLGRP_MAX
586}; 590};
587#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 591#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index cfb0d87b99fc..81c68fef4431 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -352,7 +352,7 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
352extern void arch_unmap_area(struct mm_struct *, unsigned long); 352extern void arch_unmap_area(struct mm_struct *, unsigned long);
353extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); 353extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
354 354
355#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 355#if USE_SPLIT_PTLOCKS
356/* 356/*
357 * The mm counters are not protected by its page_table_lock, 357 * The mm counters are not protected by its page_table_lock,
358 * so must be incremented atomically. 358 * so must be incremented atomically.
@@ -363,7 +363,7 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
363#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) 363#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
364#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) 364#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
365 365
366#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 366#else /* !USE_SPLIT_PTLOCKS */
367/* 367/*
368 * The mm counters are protected by its page_table_lock, 368 * The mm counters are protected by its page_table_lock,
369 * so can be incremented directly. 369 * so can be incremented directly.
@@ -374,7 +374,7 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
374#define inc_mm_counter(mm, member) (mm)->_##member++ 374#define inc_mm_counter(mm, member) (mm)->_##member++
375#define dec_mm_counter(mm, member) (mm)->_##member-- 375#define dec_mm_counter(mm, member) (mm)->_##member--
376 376
377#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 377#endif /* !USE_SPLIT_PTLOCKS */
378 378
379#define get_mm_rss(mm) \ 379#define get_mm_rss(mm) \
380 (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss)) 380 (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
@@ -425,6 +425,39 @@ struct pacct_struct {
425 unsigned long ac_minflt, ac_majflt; 425 unsigned long ac_minflt, ac_majflt;
426}; 426};
427 427
428/**
429 * struct task_cputime - collected CPU time counts
430 * @utime: time spent in user mode, in &cputime_t units
431 * @stime: time spent in kernel mode, in &cputime_t units
432 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
433 *
434 * This structure groups together three kinds of CPU time that are
435 * tracked for threads and thread groups. Most things considering
436 * CPU time want to group these counts together and treat all three
437 * of them in parallel.
438 */
439struct task_cputime {
440 cputime_t utime;
441 cputime_t stime;
442 unsigned long long sum_exec_runtime;
443};
444/* Alternate field names when used to cache expirations. */
445#define prof_exp stime
446#define virt_exp utime
447#define sched_exp sum_exec_runtime
448
449/**
450 * struct thread_group_cputime - thread group interval timer counts
451 * @totals: thread group interval timers; substructure for
452 * uniprocessor kernel, per-cpu for SMP kernel.
453 *
454 * This structure contains the version of task_cputime, above, that is
455 * used for thread group CPU clock calculations.
456 */
457struct thread_group_cputime {
458 struct task_cputime *totals;
459};
460
428/* 461/*
429 * NOTE! "signal_struct" does not have it's own 462 * NOTE! "signal_struct" does not have it's own
430 * locking, because a shared signal_struct always 463 * locking, because a shared signal_struct always
@@ -451,8 +484,8 @@ struct signal_struct {
451 * - everyone except group_exit_task is stopped during signal delivery 484 * - everyone except group_exit_task is stopped during signal delivery
452 * of fatal signals, group_exit_task processes the signal. 485 * of fatal signals, group_exit_task processes the signal.
453 */ 486 */
454 struct task_struct *group_exit_task;
455 int notify_count; 487 int notify_count;
488 struct task_struct *group_exit_task;
456 489
457 /* thread group stop support, overloads group_exit_code too */ 490 /* thread group stop support, overloads group_exit_code too */
458 int group_stop_count; 491 int group_stop_count;
@@ -470,6 +503,17 @@ struct signal_struct {
470 cputime_t it_prof_expires, it_virt_expires; 503 cputime_t it_prof_expires, it_virt_expires;
471 cputime_t it_prof_incr, it_virt_incr; 504 cputime_t it_prof_incr, it_virt_incr;
472 505
506 /*
507 * Thread group totals for process CPU clocks.
508 * See thread_group_cputime(), et al, for details.
509 */
510 struct thread_group_cputime cputime;
511
512 /* Earliest-expiration cache. */
513 struct task_cputime cputime_expires;
514
515 struct list_head cpu_timers[3];
516
473 /* job control IDs */ 517 /* job control IDs */
474 518
475 /* 519 /*
@@ -500,7 +544,7 @@ struct signal_struct {
500 * Live threads maintain their own counters and add to these 544 * Live threads maintain their own counters and add to these
501 * in __exit_signal, except for the group leader. 545 * in __exit_signal, except for the group leader.
502 */ 546 */
503 cputime_t utime, stime, cutime, cstime; 547 cputime_t cutime, cstime;
504 cputime_t gtime; 548 cputime_t gtime;
505 cputime_t cgtime; 549 cputime_t cgtime;
506 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 550 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
@@ -509,14 +553,6 @@ struct signal_struct {
509 struct task_io_accounting ioac; 553 struct task_io_accounting ioac;
510 554
511 /* 555 /*
512 * Cumulative ns of scheduled CPU time for dead threads in the
513 * group, not including a zombie group leader. (This only differs
514 * from jiffies_to_ns(utime + stime) if sched_clock uses something
515 * other than jiffies.)
516 */
517 unsigned long long sum_sched_runtime;
518
519 /*
520 * We don't bother to synchronize most readers of this at all, 556 * We don't bother to synchronize most readers of this at all,
521 * because there is no reader checking a limit that actually needs 557 * because there is no reader checking a limit that actually needs
522 * to get both rlim_cur and rlim_max atomically, and either one 558 * to get both rlim_cur and rlim_max atomically, and either one
@@ -527,8 +563,6 @@ struct signal_struct {
527 */ 563 */
528 struct rlimit rlim[RLIM_NLIMITS]; 564 struct rlimit rlim[RLIM_NLIMITS];
529 565
530 struct list_head cpu_timers[3];
531
532 /* keep the process-shared keyrings here so that they do the right 566 /* keep the process-shared keyrings here so that they do the right
533 * thing in threads created with CLONE_THREAD */ 567 * thing in threads created with CLONE_THREAD */
534#ifdef CONFIG_KEYS 568#ifdef CONFIG_KEYS
@@ -824,6 +858,9 @@ struct sched_domain {
824 unsigned int ttwu_move_affine; 858 unsigned int ttwu_move_affine;
825 unsigned int ttwu_move_balance; 859 unsigned int ttwu_move_balance;
826#endif 860#endif
861#ifdef CONFIG_SCHED_DEBUG
862 char *name;
863#endif
827}; 864};
828 865
829extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, 866extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
@@ -897,7 +934,7 @@ struct sched_class {
897 void (*yield_task) (struct rq *rq); 934 void (*yield_task) (struct rq *rq);
898 int (*select_task_rq)(struct task_struct *p, int sync); 935 int (*select_task_rq)(struct task_struct *p, int sync);
899 936
900 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); 937 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync);
901 938
902 struct task_struct * (*pick_next_task) (struct rq *rq); 939 struct task_struct * (*pick_next_task) (struct rq *rq);
903 void (*put_prev_task) (struct rq *rq, struct task_struct *p); 940 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
@@ -1010,8 +1047,8 @@ struct sched_entity {
1010 1047
1011struct sched_rt_entity { 1048struct sched_rt_entity {
1012 struct list_head run_list; 1049 struct list_head run_list;
1013 unsigned int time_slice;
1014 unsigned long timeout; 1050 unsigned long timeout;
1051 unsigned int time_slice;
1015 int nr_cpus_allowed; 1052 int nr_cpus_allowed;
1016 1053
1017 struct sched_rt_entity *back; 1054 struct sched_rt_entity *back;
@@ -1134,8 +1171,7 @@ struct task_struct {
1134/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ 1171/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
1135 unsigned long min_flt, maj_flt; 1172 unsigned long min_flt, maj_flt;
1136 1173
1137 cputime_t it_prof_expires, it_virt_expires; 1174 struct task_cputime cputime_expires;
1138 unsigned long long it_sched_expires;
1139 struct list_head cpu_timers[3]; 1175 struct list_head cpu_timers[3];
1140 1176
1141/* process credentials */ 1177/* process credentials */
@@ -1475,6 +1511,10 @@ static inline void put_task_struct(struct task_struct *t)
1475 __put_task_struct(t); 1511 __put_task_struct(t);
1476} 1512}
1477 1513
1514extern cputime_t task_utime(struct task_struct *p);
1515extern cputime_t task_stime(struct task_struct *p);
1516extern cputime_t task_gtime(struct task_struct *p);
1517
1478/* 1518/*
1479 * Per process flags 1519 * Per process flags
1480 */ 1520 */
@@ -1581,6 +1621,7 @@ extern unsigned long long cpu_clock(int cpu);
1581 1621
1582extern unsigned long long 1622extern unsigned long long
1583task_sched_runtime(struct task_struct *task); 1623task_sched_runtime(struct task_struct *task);
1624extern unsigned long long thread_group_sched_runtime(struct task_struct *task);
1584 1625
1585/* sched_exec is called by processes performing an exec */ 1626/* sched_exec is called by processes performing an exec */
1586#ifdef CONFIG_SMP 1627#ifdef CONFIG_SMP
@@ -2078,6 +2119,30 @@ static inline int spin_needbreak(spinlock_t *lock)
2078} 2119}
2079 2120
2080/* 2121/*
2122 * Thread group CPU time accounting.
2123 */
2124
2125extern int thread_group_cputime_alloc(struct task_struct *);
2126extern void thread_group_cputime(struct task_struct *, struct task_cputime *);
2127
2128static inline void thread_group_cputime_init(struct signal_struct *sig)
2129{
2130 sig->cputime.totals = NULL;
2131}
2132
2133static inline int thread_group_cputime_clone_thread(struct task_struct *curr)
2134{
2135 if (curr->signal->cputime.totals)
2136 return 0;
2137 return thread_group_cputime_alloc(curr);
2138}
2139
2140static inline void thread_group_cputime_free(struct signal_struct *sig)
2141{
2142 free_percpu(sig->cputime.totals);
2143}
2144
2145/*
2081 * Reevaluate whether the task has signals pending delivery. 2146 * Reevaluate whether the task has signals pending delivery.
2082 * Wake the task if so. 2147 * Wake the task if so.
2083 * This is required every time the blocked sigset_t changes. 2148 * This is required every time the blocked sigset_t changes.
diff --git a/include/linux/security.h b/include/linux/security.h
index 80c4d002864c..f5c4a51eb42e 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1560,11 +1560,6 @@ struct security_operations {
1560extern int security_init(void); 1560extern int security_init(void);
1561extern int security_module_enable(struct security_operations *ops); 1561extern int security_module_enable(struct security_operations *ops);
1562extern int register_security(struct security_operations *ops); 1562extern int register_security(struct security_operations *ops);
1563extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
1564 struct dentry *parent, void *data,
1565 const struct file_operations *fops);
1566extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent);
1567extern void securityfs_remove(struct dentry *dentry);
1568 1563
1569/* Security operations */ 1564/* Security operations */
1570int security_ptrace_may_access(struct task_struct *child, unsigned int mode); 1565int security_ptrace_may_access(struct task_struct *child, unsigned int mode);
@@ -2424,25 +2419,6 @@ static inline int security_netlink_recv(struct sk_buff *skb, int cap)
2424 return cap_netlink_recv(skb, cap); 2419 return cap_netlink_recv(skb, cap);
2425} 2420}
2426 2421
2427static inline struct dentry *securityfs_create_dir(const char *name,
2428 struct dentry *parent)
2429{
2430 return ERR_PTR(-ENODEV);
2431}
2432
2433static inline struct dentry *securityfs_create_file(const char *name,
2434 mode_t mode,
2435 struct dentry *parent,
2436 void *data,
2437 const struct file_operations *fops)
2438{
2439 return ERR_PTR(-ENODEV);
2440}
2441
2442static inline void securityfs_remove(struct dentry *dentry)
2443{
2444}
2445
2446static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) 2422static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2447{ 2423{
2448 return -EOPNOTSUPP; 2424 return -EOPNOTSUPP;
@@ -2806,5 +2782,35 @@ static inline void security_audit_rule_free(void *lsmrule)
2806#endif /* CONFIG_SECURITY */ 2782#endif /* CONFIG_SECURITY */
2807#endif /* CONFIG_AUDIT */ 2783#endif /* CONFIG_AUDIT */
2808 2784
2785#ifdef CONFIG_SECURITYFS
2786
2787extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
2788 struct dentry *parent, void *data,
2789 const struct file_operations *fops);
2790extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent);
2791extern void securityfs_remove(struct dentry *dentry);
2792
2793#else /* CONFIG_SECURITYFS */
2794
2795static inline struct dentry *securityfs_create_dir(const char *name,
2796 struct dentry *parent)
2797{
2798 return ERR_PTR(-ENODEV);
2799}
2800
2801static inline struct dentry *securityfs_create_file(const char *name,
2802 mode_t mode,
2803 struct dentry *parent,
2804 void *data,
2805 const struct file_operations *fops)
2806{
2807 return ERR_PTR(-ENODEV);
2808}
2809
2810static inline void securityfs_remove(struct dentry *dentry)
2811{}
2812
2813#endif
2814
2809#endif /* ! __LINUX_SECURITY_H */ 2815#endif /* ! __LINUX_SECURITY_H */
2810 2816
diff --git a/include/linux/serial.h b/include/linux/serial.h
index deb714314fb1..1ea8d9265bf6 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -173,6 +173,22 @@ struct serial_icounter_struct {
173 int reserved[9]; 173 int reserved[9];
174}; 174};
175 175
176/*
177 * Serial interface for controlling RS485 settings on chips with suitable
178 * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
179 * platform. The set function returns the new state, with any unsupported bits
180 * reverted appropriately.
181 */
182
183struct serial_rs485 {
184 __u32 flags; /* RS485 feature flags */
185#define SER_RS485_ENABLED (1 << 0)
186#define SER_RS485_RTS_ON_SEND (1 << 1)
187#define SER_RS485_RTS_AFTER_SEND (1 << 2)
188 __u32 delay_rts_before_send; /* Milliseconds */
189 __u32 padding[6]; /* Memory is cheap, new structs
190 are a royal PITA .. */
191};
176 192
177#ifdef __KERNEL__ 193#ifdef __KERNEL__
178#include <linux/compiler.h> 194#include <linux/compiler.h>
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 3b2f6c04855e..e27f216361fc 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -241,7 +241,7 @@ typedef unsigned int __bitwise__ upf_t;
241 241
242struct uart_port { 242struct uart_port {
243 spinlock_t lock; /* port lock */ 243 spinlock_t lock; /* port lock */
244 unsigned int iobase; /* in/out[bwl] */ 244 unsigned long iobase; /* in/out[bwl] */
245 unsigned char __iomem *membase; /* read/write[bwl] */ 245 unsigned char __iomem *membase; /* read/write[bwl] */
246 unsigned int irq; /* irq number */ 246 unsigned int irq; /* irq number */
247 unsigned int uartclk; /* base uart clock */ 247 unsigned int uartclk; /* base uart clock */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 909923717830..2725f4e5a9bf 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -146,8 +146,14 @@ struct skb_shared_info {
146 unsigned short gso_segs; 146 unsigned short gso_segs;
147 unsigned short gso_type; 147 unsigned short gso_type;
148 __be32 ip6_frag_id; 148 __be32 ip6_frag_id;
149#ifdef CONFIG_HAS_DMA
150 unsigned int num_dma_maps;
151#endif
149 struct sk_buff *frag_list; 152 struct sk_buff *frag_list;
150 skb_frag_t frags[MAX_SKB_FRAGS]; 153 skb_frag_t frags[MAX_SKB_FRAGS];
154#ifdef CONFIG_HAS_DMA
155 dma_addr_t dma_maps[MAX_SKB_FRAGS + 1];
156#endif
151}; 157};
152 158
153/* We divide dataref into two halves. The higher 16 bits hold references 159/* We divide dataref into two halves. The higher 16 bits hold references
@@ -353,6 +359,14 @@ struct sk_buff {
353 359
354#include <asm/system.h> 360#include <asm/system.h>
355 361
362#ifdef CONFIG_HAS_DMA
363#include <linux/dma-mapping.h>
364extern int skb_dma_map(struct device *dev, struct sk_buff *skb,
365 enum dma_data_direction dir);
366extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
367 enum dma_data_direction dir);
368#endif
369
356extern void kfree_skb(struct sk_buff *skb); 370extern void kfree_skb(struct sk_buff *skb);
357extern void __kfree_skb(struct sk_buff *skb); 371extern void __kfree_skb(struct sk_buff *skb);
358extern struct sk_buff *__alloc_skb(unsigned int size, 372extern struct sk_buff *__alloc_skb(unsigned int size,
@@ -369,6 +383,8 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
369 return __alloc_skb(size, priority, 1, -1); 383 return __alloc_skb(size, priority, 1, -1);
370} 384}
371 385
386extern int skb_recycle_check(struct sk_buff *skb, int skb_size);
387
372extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); 388extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
373extern struct sk_buff *skb_clone(struct sk_buff *skb, 389extern struct sk_buff *skb_clone(struct sk_buff *skb,
374 gfp_t priority); 390 gfp_t priority);
@@ -459,6 +475,37 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
459} 475}
460 476
461/** 477/**
478 * skb_queue_is_last - check if skb is the last entry in the queue
479 * @list: queue head
480 * @skb: buffer
481 *
482 * Returns true if @skb is the last buffer on the list.
483 */
484static inline bool skb_queue_is_last(const struct sk_buff_head *list,
485 const struct sk_buff *skb)
486{
487 return (skb->next == (struct sk_buff *) list);
488}
489
490/**
491 * skb_queue_next - return the next packet in the queue
492 * @list: queue head
493 * @skb: current buffer
494 *
495 * Return the next packet in @list after @skb. It is only valid to
496 * call this if skb_queue_is_last() evaluates to false.
497 */
498static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
499 const struct sk_buff *skb)
500{
501 /* This BUG_ON may seem severe, but if we just return then we
502 * are going to dereference garbage.
503 */
504 BUG_ON(skb_queue_is_last(list, skb));
505 return skb->next;
506}
507
508/**
462 * skb_get - reference buffer 509 * skb_get - reference buffer
463 * @skb: buffer to reference 510 * @skb: buffer to reference
464 * 511 *
@@ -646,6 +693,22 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
646 return list_->qlen; 693 return list_->qlen;
647} 694}
648 695
696/**
697 * __skb_queue_head_init - initialize non-spinlock portions of sk_buff_head
698 * @list: queue to initialize
699 *
700 * This initializes only the list and queue length aspects of
701 * an sk_buff_head object. This allows to initialize the list
702 * aspects of an sk_buff_head without reinitializing things like
703 * the spinlock. It can also be used for on-stack sk_buff_head
704 * objects where the spinlock is known to not be used.
705 */
706static inline void __skb_queue_head_init(struct sk_buff_head *list)
707{
708 list->prev = list->next = (struct sk_buff *)list;
709 list->qlen = 0;
710}
711
649/* 712/*
650 * This function creates a split out lock class for each invocation; 713 * This function creates a split out lock class for each invocation;
651 * this is needed for now since a whole lot of users of the skb-queue 714 * this is needed for now since a whole lot of users of the skb-queue
@@ -657,8 +720,7 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
657static inline void skb_queue_head_init(struct sk_buff_head *list) 720static inline void skb_queue_head_init(struct sk_buff_head *list)
658{ 721{
659 spin_lock_init(&list->lock); 722 spin_lock_init(&list->lock);
660 list->prev = list->next = (struct sk_buff *)list; 723 __skb_queue_head_init(list);
661 list->qlen = 0;
662} 724}
663 725
664static inline void skb_queue_head_init_class(struct sk_buff_head *list, 726static inline void skb_queue_head_init_class(struct sk_buff_head *list,
@@ -685,6 +747,83 @@ static inline void __skb_insert(struct sk_buff *newsk,
685 list->qlen++; 747 list->qlen++;
686} 748}
687 749
750static inline void __skb_queue_splice(const struct sk_buff_head *list,
751 struct sk_buff *prev,
752 struct sk_buff *next)
753{
754 struct sk_buff *first = list->next;
755 struct sk_buff *last = list->prev;
756
757 first->prev = prev;
758 prev->next = first;
759
760 last->next = next;
761 next->prev = last;
762}
763
764/**
765 * skb_queue_splice - join two skb lists, this is designed for stacks
766 * @list: the new list to add
767 * @head: the place to add it in the first list
768 */
769static inline void skb_queue_splice(const struct sk_buff_head *list,
770 struct sk_buff_head *head)
771{
772 if (!skb_queue_empty(list)) {
773 __skb_queue_splice(list, (struct sk_buff *) head, head->next);
774 head->qlen += list->qlen;
775 }
776}
777
778/**
779 * skb_queue_splice - join two skb lists and reinitialise the emptied list
780 * @list: the new list to add
781 * @head: the place to add it in the first list
782 *
783 * The list at @list is reinitialised
784 */
785static inline void skb_queue_splice_init(struct sk_buff_head *list,
786 struct sk_buff_head *head)
787{
788 if (!skb_queue_empty(list)) {
789 __skb_queue_splice(list, (struct sk_buff *) head, head->next);
790 head->qlen += list->qlen;
791 __skb_queue_head_init(list);
792 }
793}
794
795/**
796 * skb_queue_splice_tail - join two skb lists, each list being a queue
797 * @list: the new list to add
798 * @head: the place to add it in the first list
799 */
800static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
801 struct sk_buff_head *head)
802{
803 if (!skb_queue_empty(list)) {
804 __skb_queue_splice(list, head->prev, (struct sk_buff *) head);
805 head->qlen += list->qlen;
806 }
807}
808
809/**
810 * skb_queue_splice_tail - join two skb lists and reinitialise the emptied list
811 * @list: the new list to add
812 * @head: the place to add it in the first list
813 *
814 * Each of the lists is a queue.
815 * The list at @list is reinitialised
816 */
817static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,
818 struct sk_buff_head *head)
819{
820 if (!skb_queue_empty(list)) {
821 __skb_queue_splice(list, head->prev, (struct sk_buff *) head);
822 head->qlen += list->qlen;
823 __skb_queue_head_init(list);
824 }
825}
826
688/** 827/**
689 * __skb_queue_after - queue a buffer at the list head 828 * __skb_queue_after - queue a buffer at the list head
690 * @list: list to use 829 * @list: list to use
@@ -829,6 +968,9 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i,
829 skb_shinfo(skb)->nr_frags = i + 1; 968 skb_shinfo(skb)->nr_frags = i + 1;
830} 969}
831 970
971extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
972 int off, int size);
973
832#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) 974#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
833#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) 975#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list)
834#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) 976#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
@@ -1243,6 +1385,26 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1243 return __netdev_alloc_skb(dev, length, GFP_ATOMIC); 1385 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1244} 1386}
1245 1387
1388extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask);
1389
1390/**
1391 * netdev_alloc_page - allocate a page for ps-rx on a specific device
1392 * @dev: network device to receive on
1393 *
1394 * Allocate a new page node local to the specified device.
1395 *
1396 * %NULL is returned if there is no free memory.
1397 */
1398static inline struct page *netdev_alloc_page(struct net_device *dev)
1399{
1400 return __netdev_alloc_page(dev, GFP_ATOMIC);
1401}
1402
1403static inline void netdev_free_page(struct net_device *dev, struct page *page)
1404{
1405 __free_page(page);
1406}
1407
1246/** 1408/**
1247 * skb_clone_writable - is the header of a clone writable 1409 * skb_clone_writable - is the header of a clone writable
1248 * @skb: buffer to check 1410 * @skb: buffer to check
@@ -1434,6 +1596,15 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1434 skb != (struct sk_buff *)(queue); \ 1596 skb != (struct sk_buff *)(queue); \
1435 skb = tmp, tmp = skb->next) 1597 skb = tmp, tmp = skb->next)
1436 1598
1599#define skb_queue_walk_from(queue, skb) \
1600 for (; prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \
1601 skb = skb->next)
1602
1603#define skb_queue_walk_from_safe(queue, skb, tmp) \
1604 for (tmp = skb->next; \
1605 skb != (struct sk_buff *)(queue); \
1606 skb = tmp, tmp = skb->next)
1607
1437#define skb_queue_reverse_walk(queue, skb) \ 1608#define skb_queue_reverse_walk(queue, skb) \
1438 for (skb = (queue)->prev; \ 1609 for (skb = (queue)->prev; \
1439 prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ 1610 prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \
diff --git a/include/linux/smb.h b/include/linux/smb.h
index caa43b2370cb..82fefddc5987 100644
--- a/include/linux/smb.h
+++ b/include/linux/smb.h
@@ -11,7 +11,9 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/magic.h> 13#include <linux/magic.h>
14#ifdef __KERNEL__
14#include <linux/time.h> 15#include <linux/time.h>
16#endif
15 17
16enum smb_protocol { 18enum smb_protocol {
17 SMB_PROTOCOL_NONE, 19 SMB_PROTOCOL_NONE,
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h
index 3827b922ba1f..bc21db598c06 100644
--- a/include/linux/smc91x.h
+++ b/include/linux/smc91x.h
@@ -16,8 +16,19 @@
16 16
17#define SMC91X_USE_DMA (1 << 6) 17#define SMC91X_USE_DMA (1 << 6)
18 18
19#define RPC_LED_100_10 (0x00) /* LED = 100Mbps OR's with 10Mbps link detect */
20#define RPC_LED_RES (0x01) /* LED = Reserved */
21#define RPC_LED_10 (0x02) /* LED = 10Mbps link detect */
22#define RPC_LED_FD (0x03) /* LED = Full Duplex Mode */
23#define RPC_LED_TX_RX (0x04) /* LED = TX or RX packet occurred */
24#define RPC_LED_100 (0x05) /* LED = 100Mbps link dectect */
25#define RPC_LED_TX (0x06) /* LED = TX packet occurred */
26#define RPC_LED_RX (0x07) /* LED = RX packet occurred */
27
19struct smc91x_platdata { 28struct smc91x_platdata {
20 unsigned long flags; 29 unsigned long flags;
30 unsigned char leda;
31 unsigned char ledb;
21}; 32};
22 33
23#endif /* __SMC91X_H__ */ 34#endif /* __SMC91X_H__ */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 66484d4a8459..2e4d58b26c06 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/errno.h> 9#include <linux/errno.h>
10#include <linux/types.h>
10#include <linux/list.h> 11#include <linux/list.h>
11#include <linux/cpumask.h> 12#include <linux/cpumask.h>
12 13
@@ -16,7 +17,8 @@ struct call_single_data {
16 struct list_head list; 17 struct list_head list;
17 void (*func) (void *info); 18 void (*func) (void *info);
18 void *info; 19 void *info;
19 unsigned int flags; 20 u16 flags;
21 u16 priv;
20}; 22};
21 23
22#ifdef CONFIG_SMP 24#ifdef CONFIG_SMP
diff --git a/include/linux/socket.h b/include/linux/socket.h
index dc5086fe7736..20fc4bbfca42 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -190,7 +190,8 @@ struct ucred {
190#define AF_IUCV 32 /* IUCV sockets */ 190#define AF_IUCV 32 /* IUCV sockets */
191#define AF_RXRPC 33 /* RxRPC sockets */ 191#define AF_RXRPC 33 /* RxRPC sockets */
192#define AF_ISDN 34 /* mISDN sockets */ 192#define AF_ISDN 34 /* mISDN sockets */
193#define AF_MAX 35 /* For now.. */ 193#define AF_PHONET 35 /* Phonet sockets */
194#define AF_MAX 36 /* For now.. */
194 195
195/* Protocol families, same as address families. */ 196/* Protocol families, same as address families. */
196#define PF_UNSPEC AF_UNSPEC 197#define PF_UNSPEC AF_UNSPEC
@@ -227,6 +228,7 @@ struct ucred {
227#define PF_IUCV AF_IUCV 228#define PF_IUCV AF_IUCV
228#define PF_RXRPC AF_RXRPC 229#define PF_RXRPC AF_RXRPC
229#define PF_ISDN AF_ISDN 230#define PF_ISDN AF_ISDN
231#define PF_PHONET AF_PHONET
230#define PF_MAX AF_MAX 232#define PF_MAX AF_MAX
231 233
232/* Maximum queue length specifiable by listen. */ 234/* Maximum queue length specifiable by listen. */
@@ -295,6 +297,7 @@ struct ucred {
295#define SOL_RXRPC 272 297#define SOL_RXRPC 272
296#define SOL_PPPOL2TP 273 298#define SOL_PPPOL2TP 273
297#define SOL_BLUETOOTH 274 299#define SOL_BLUETOOTH 274
300#define SOL_PNPIPE 275
298 301
299/* IPX options */ 302/* IPX options */
300#define IPX_TYPE 1 303#define IPX_TYPE 1
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index daf744017a31..05eab2f11e63 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -43,6 +43,9 @@ struct ads7846_platform_data {
43 u16 debounce_tol; /* tolerance used for filtering */ 43 u16 debounce_tol; /* tolerance used for filtering */
44 u16 debounce_rep; /* additional consecutive good readings 44 u16 debounce_rep; /* additional consecutive good readings
45 * required after the first two */ 45 * required after the first two */
46 int gpio_pendown; /* the GPIO used to decide the pendown
47 * state if get_pendown_state == NULL
48 */
46 int (*get_pendown_state)(void); 49 int (*get_pendown_state)(void);
47 int (*filter_init) (struct ads7846_platform_data *pdata, 50 int (*filter_init) (struct ads7846_platform_data *pdata,
48 void **filter_data); 51 void **filter_data);
diff --git a/include/linux/spi/corgi_lcd.h b/include/linux/spi/corgi_lcd.h
new file mode 100644
index 000000000000..6692b3418ccf
--- /dev/null
+++ b/include/linux/spi/corgi_lcd.h
@@ -0,0 +1,20 @@
1#ifndef __LINUX_SPI_CORGI_LCD_H
2#define __LINUX_SPI_CORGI_LCD_H
3
4#define CORGI_LCD_MODE_QVGA 1
5#define CORGI_LCD_MODE_VGA 2
6
7struct corgi_lcd_platform_data {
8 int init_mode;
9 int max_intensity;
10 int default_intensity;
11 int limit_mask;
12
13 int gpio_backlight_on; /* -1 if n/a */
14 int gpio_backlight_cont; /* -1 if n/a */
15
16 void (*notify)(int intensity);
17 void (*kick_battery)(void);
18};
19
20#endif /* __LINUX_SPI_CORGI_LCD_H */
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
index b4d9fa6f797c..decf6d8c77b7 100644
--- a/include/linux/spi/orion_spi.h
+++ b/include/linux/spi/orion_spi.h
@@ -11,6 +11,7 @@
11 11
12struct orion_spi_info { 12struct orion_spi_info {
13 u32 tclk; /* no <linux/clk.h> support yet */ 13 u32 tclk; /* no <linux/clk.h> support yet */
14 u32 enable_clock_fix;
14}; 15};
15 16
16 17
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index ebad0bac9801..99a0f991e850 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -245,8 +245,6 @@
245 245
246/* SPROM Revision 3 (inherits most data from rev 2) */ 246/* SPROM Revision 3 (inherits most data from rev 2) */
247#define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */ 247#define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */
248#define SSB_SPROM3_ET0MAC 0x1050 /* 6 bytes MAC address for Ethernet ?? */
249#define SSB_SPROM3_ET1MAC 0x1050 /* 6 bytes MAC address for 802.11a ?? */
250#define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ 248#define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */
251#define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ 249#define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */
252#define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ 250#define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */
@@ -267,8 +265,6 @@
267 265
268/* SPROM Revision 4 */ 266/* SPROM Revision 4 */
269#define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */ 267#define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */
270#define SSB_SPROM4_ET0MAC 0x1018 /* 6 bytes MAC address for Ethernet ?? */
271#define SSB_SPROM4_ET1MAC 0x1018 /* 6 bytes MAC address for 802.11a ?? */
272#define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */ 268#define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */
273#define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ 269#define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */
274#define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ 270#define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */
@@ -316,6 +312,21 @@
316#define SSB_SPROM4_PA1B1 0x1090 312#define SSB_SPROM4_PA1B1 0x1090
317#define SSB_SPROM4_PA1B2 0x1092 313#define SSB_SPROM4_PA1B2 0x1092
318 314
315/* SPROM Revision 5 (inherits most data from rev 4) */
316#define SSB_SPROM5_BFLLO 0x104A /* Boardflags (low 16 bits) */
317#define SSB_SPROM5_BFLHI 0x104C /* Board Flags Hi */
318#define SSB_SPROM5_IL0MAC 0x1052 /* 6 byte MAC address for a/b/g/n */
319#define SSB_SPROM5_CCODE 0x1044 /* Country Code (2 bytes) */
320#define SSB_SPROM5_GPIOA 0x1076 /* Gen. Purpose IO # 0 and 1 */
321#define SSB_SPROM5_GPIOA_P0 0x00FF /* Pin 0 */
322#define SSB_SPROM5_GPIOA_P1 0xFF00 /* Pin 1 */
323#define SSB_SPROM5_GPIOA_P1_SHIFT 8
324#define SSB_SPROM5_GPIOB 0x1078 /* Gen. Purpose IO # 2 and 3 */
325#define SSB_SPROM5_GPIOB_P2 0x00FF /* Pin 2 */
326#define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */
327#define SSB_SPROM5_GPIOB_P3_SHIFT 8
328
329
319/* Values for SSB_SPROM1_BINF_CCODE */ 330/* Values for SSB_SPROM1_BINF_CCODE */
320enum { 331enum {
321 SSB_SPROM1CCODE_WORLD = 0, 332 SSB_SPROM1CCODE_WORLD = 0,
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 5da9794b2d78..b106fd8e0d5c 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -1,6 +1,8 @@
1#ifndef __LINUX_STACKTRACE_H 1#ifndef __LINUX_STACKTRACE_H
2#define __LINUX_STACKTRACE_H 2#define __LINUX_STACKTRACE_H
3 3
4struct task_struct;
5
4#ifdef CONFIG_STACKTRACE 6#ifdef CONFIG_STACKTRACE
5struct stack_trace { 7struct stack_trace {
6 unsigned int nr_entries, max_entries; 8 unsigned int nr_entries, max_entries;
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index f1cb0ba6d715..faf1519b5adc 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -3,16 +3,13 @@
3/* "Bogolock": stop the entire machine, disable interrupts. This is a 3/* "Bogolock": stop the entire machine, disable interrupts. This is a
4 very heavy lock, which is equivalent to grabbing every spinlock 4 very heavy lock, which is equivalent to grabbing every spinlock
5 (and more). So the "read" side to such a lock is anything which 5 (and more). So the "read" side to such a lock is anything which
6 diables preeempt. */ 6 disables preeempt. */
7#include <linux/cpu.h> 7#include <linux/cpu.h>
8#include <linux/cpumask.h> 8#include <linux/cpumask.h>
9#include <asm/system.h> 9#include <asm/system.h>
10 10
11#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) 11#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
12 12
13/* Deprecated, but useful for transition. */
14#define ALL_CPUS ~0U
15
16/** 13/**
17 * stop_machine: freeze the machine on all CPUs and run this function 14 * stop_machine: freeze the machine on all CPUs and run this function
18 * @fn: the function to run 15 * @fn: the function to run
@@ -50,18 +47,4 @@ static inline int stop_machine(int (*fn)(void *), void *data,
50 return ret; 47 return ret;
51} 48}
52#endif /* CONFIG_SMP */ 49#endif /* CONFIG_SMP */
53
54static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data,
55 unsigned int cpu)
56{
57 /* If they don't care which cpu fn runs on, just pick one. */
58 if (cpu == NR_CPUS)
59 return stop_machine(fn, data, NULL);
60 else if (cpu == ~0U)
61 return stop_machine(fn, data, &cpu_possible_map);
62 else {
63 cpumask_t cpus = cpumask_of_cpu(cpu);
64 return stop_machine(fn, data, &cpus);
65 }
66}
67#endif /* _LINUX_STOP_MACHINE */ 50#endif /* _LINUX_STOP_MACHINE */
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
new file mode 100644
index 000000000000..a3eb2f65b656
--- /dev/null
+++ b/include/linux/string_helpers.h
@@ -0,0 +1,16 @@
1#ifndef _LINUX_STRING_HELPERS_H_
2#define _LINUX_STRING_HELPERS_H_
3
4#include <linux/types.h>
5
6/* Descriptions of the types of units to
7 * print in */
8enum string_size_units {
9 STRING_UNITS_10, /* use powers of 10^3 (standard SI) */
10 STRING_UNITS_2, /* use binary powers of 2^10 */
11};
12
13int string_get_size(u64 size, enum string_size_units units,
14 char *buf, int len);
15
16#endif
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index e5bfe01ee305..6f0ee1b84a4f 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -104,6 +104,7 @@ struct rpc_create_args {
104 const struct rpc_timeout *timeout; 104 const struct rpc_timeout *timeout;
105 char *servername; 105 char *servername;
106 struct rpc_program *program; 106 struct rpc_program *program;
107 u32 prognumber; /* overrides program->number */
107 u32 version; 108 u32 version;
108 rpc_authflavor_t authflavor; 109 rpc_authflavor_t authflavor;
109 unsigned long flags; 110 unsigned long flags;
@@ -124,10 +125,10 @@ struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
124void rpc_shutdown_client(struct rpc_clnt *); 125void rpc_shutdown_client(struct rpc_clnt *);
125void rpc_release_client(struct rpc_clnt *); 126void rpc_release_client(struct rpc_clnt *);
126 127
127int rpcb_register(u32, u32, int, unsigned short, int *); 128int rpcb_register(u32, u32, int, unsigned short);
128int rpcb_v4_register(const u32 program, const u32 version, 129int rpcb_v4_register(const u32 program, const u32 version,
129 const struct sockaddr *address, 130 const struct sockaddr *address,
130 const char *netid, int *result); 131 const char *netid);
131int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int); 132int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int);
132void rpcb_getport_async(struct rpc_task *); 133void rpcb_getport_async(struct rpc_task *);
133 134
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index dc69068d94c7..3afe7fb403b2 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -66,6 +66,7 @@ struct svc_serv {
66 struct list_head sv_tempsocks; /* all temporary sockets */ 66 struct list_head sv_tempsocks; /* all temporary sockets */
67 int sv_tmpcnt; /* count of temporary sockets */ 67 int sv_tmpcnt; /* count of temporary sockets */
68 struct timer_list sv_temptimer; /* timer for aging temporary sockets */ 68 struct timer_list sv_temptimer; /* timer for aging temporary sockets */
69 sa_family_t sv_family; /* listener's address family */
69 70
70 char * sv_name; /* service name */ 71 char * sv_name; /* service name */
71 72
@@ -265,17 +266,17 @@ struct svc_rqst {
265/* 266/*
266 * Rigorous type checking on sockaddr type conversions 267 * Rigorous type checking on sockaddr type conversions
267 */ 268 */
268static inline struct sockaddr_in *svc_addr_in(struct svc_rqst *rqst) 269static inline struct sockaddr_in *svc_addr_in(const struct svc_rqst *rqst)
269{ 270{
270 return (struct sockaddr_in *) &rqst->rq_addr; 271 return (struct sockaddr_in *) &rqst->rq_addr;
271} 272}
272 273
273static inline struct sockaddr_in6 *svc_addr_in6(struct svc_rqst *rqst) 274static inline struct sockaddr_in6 *svc_addr_in6(const struct svc_rqst *rqst)
274{ 275{
275 return (struct sockaddr_in6 *) &rqst->rq_addr; 276 return (struct sockaddr_in6 *) &rqst->rq_addr;
276} 277}
277 278
278static inline struct sockaddr *svc_addr(struct svc_rqst *rqst) 279static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst)
279{ 280{
280 return (struct sockaddr *) &rqst->rq_addr; 281 return (struct sockaddr *) &rqst->rq_addr;
281} 282}
@@ -381,18 +382,20 @@ struct svc_procedure {
381/* 382/*
382 * Function prototypes. 383 * Function prototypes.
383 */ 384 */
384struct svc_serv * svc_create(struct svc_program *, unsigned int, 385struct svc_serv *svc_create(struct svc_program *, unsigned int, sa_family_t,
385 void (*shutdown)(struct svc_serv*)); 386 void (*shutdown)(struct svc_serv *));
386struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, 387struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
387 struct svc_pool *pool); 388 struct svc_pool *pool);
388void svc_exit_thread(struct svc_rqst *); 389void svc_exit_thread(struct svc_rqst *);
389struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, 390struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
390 void (*shutdown)(struct svc_serv*), svc_thread_fn, 391 sa_family_t, void (*shutdown)(struct svc_serv *),
391 struct module *); 392 svc_thread_fn, struct module *);
392int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); 393int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
393void svc_destroy(struct svc_serv *); 394void svc_destroy(struct svc_serv *);
394int svc_process(struct svc_rqst *); 395int svc_process(struct svc_rqst *);
395int svc_register(struct svc_serv *, int, unsigned short); 396int svc_register(const struct svc_serv *, const unsigned short,
397 const unsigned short);
398
396void svc_wake_up(struct svc_serv *); 399void svc_wake_up(struct svc_serv *);
397void svc_reserve(struct svc_rqst *rqstp, int space); 400void svc_reserve(struct svc_rqst *rqstp, int space);
398struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); 401struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index ef2e3a20bf3b..c14fe86dac59 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -72,6 +72,7 @@ extern atomic_t rdma_stat_sq_prod;
72 */ 72 */
73struct svc_rdma_op_ctxt { 73struct svc_rdma_op_ctxt {
74 struct svc_rdma_op_ctxt *read_hdr; 74 struct svc_rdma_op_ctxt *read_hdr;
75 struct svc_rdma_fastreg_mr *frmr;
75 int hdr_count; 76 int hdr_count;
76 struct xdr_buf arg; 77 struct xdr_buf arg;
77 struct list_head dto_q; 78 struct list_head dto_q;
@@ -103,16 +104,30 @@ struct svc_rdma_chunk_sge {
103 int start; /* sge no for this chunk */ 104 int start; /* sge no for this chunk */
104 int count; /* sge count for this chunk */ 105 int count; /* sge count for this chunk */
105}; 106};
107struct svc_rdma_fastreg_mr {
108 struct ib_mr *mr;
109 void *kva;
110 struct ib_fast_reg_page_list *page_list;
111 int page_list_len;
112 unsigned long access_flags;
113 unsigned long map_len;
114 enum dma_data_direction direction;
115 struct list_head frmr_list;
116};
106struct svc_rdma_req_map { 117struct svc_rdma_req_map {
118 struct svc_rdma_fastreg_mr *frmr;
107 unsigned long count; 119 unsigned long count;
108 union { 120 union {
109 struct kvec sge[RPCSVC_MAXPAGES]; 121 struct kvec sge[RPCSVC_MAXPAGES];
110 struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES]; 122 struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES];
111 }; 123 };
112}; 124};
113 125#define RDMACTXT_F_FAST_UNREG 1
114#define RDMACTXT_F_LAST_CTXT 2 126#define RDMACTXT_F_LAST_CTXT 2
115 127
128#define SVCRDMA_DEVCAP_FAST_REG 1 /* fast mr registration */
129#define SVCRDMA_DEVCAP_READ_W_INV 2 /* read w/ invalidate */
130
116struct svcxprt_rdma { 131struct svcxprt_rdma {
117 struct svc_xprt sc_xprt; /* SVC transport structure */ 132 struct svc_xprt sc_xprt; /* SVC transport structure */
118 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ 133 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */
@@ -136,6 +151,11 @@ struct svcxprt_rdma {
136 struct ib_cq *sc_rq_cq; 151 struct ib_cq *sc_rq_cq;
137 struct ib_cq *sc_sq_cq; 152 struct ib_cq *sc_sq_cq;
138 struct ib_mr *sc_phys_mr; /* MR for server memory */ 153 struct ib_mr *sc_phys_mr; /* MR for server memory */
154 u32 sc_dev_caps; /* distilled device caps */
155 u32 sc_dma_lkey; /* local dma key */
156 unsigned int sc_frmr_pg_list_len;
157 struct list_head sc_frmr_q;
158 spinlock_t sc_frmr_q_lock;
139 159
140 spinlock_t sc_lock; /* transport lock */ 160 spinlock_t sc_lock; /* transport lock */
141 161
@@ -143,7 +163,6 @@ struct svcxprt_rdma {
143 unsigned long sc_flags; 163 unsigned long sc_flags;
144 struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ 164 struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */
145 struct list_head sc_read_complete_q; 165 struct list_head sc_read_complete_q;
146 spinlock_t sc_read_complete_lock;
147 struct work_struct sc_work; 166 struct work_struct sc_work;
148}; 167};
149/* sc_flags */ 168/* sc_flags */
@@ -193,8 +212,13 @@ extern int svc_rdma_post_recv(struct svcxprt_rdma *);
193extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); 212extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *);
194extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); 213extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *);
195extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); 214extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int);
215extern void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt);
196extern struct svc_rdma_req_map *svc_rdma_get_req_map(void); 216extern struct svc_rdma_req_map *svc_rdma_get_req_map(void);
197extern void svc_rdma_put_req_map(struct svc_rdma_req_map *); 217extern void svc_rdma_put_req_map(struct svc_rdma_req_map *);
218extern int svc_rdma_fastreg(struct svcxprt_rdma *, struct svc_rdma_fastreg_mr *);
219extern struct svc_rdma_fastreg_mr *svc_rdma_get_frmr(struct svcxprt_rdma *);
220extern void svc_rdma_put_frmr(struct svcxprt_rdma *,
221 struct svc_rdma_fastreg_mr *);
198extern void svc_sq_reap(struct svcxprt_rdma *); 222extern void svc_sq_reap(struct svcxprt_rdma *);
199extern void svc_rq_reap(struct svcxprt_rdma *); 223extern void svc_rq_reap(struct svcxprt_rdma *);
200extern struct svc_xprt_class svc_rdma_class; 224extern struct svc_xprt_class svc_rdma_class;
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 8cff696dedf5..483e10380aae 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -39,10 +39,7 @@ int svc_send(struct svc_rqst *);
39void svc_drop(struct svc_rqst *); 39void svc_drop(struct svc_rqst *);
40void svc_sock_update_bufs(struct svc_serv *serv); 40void svc_sock_update_bufs(struct svc_serv *serv);
41int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); 41int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose);
42int svc_addsock(struct svc_serv *serv, 42int svc_addsock(struct svc_serv *serv, int fd, char *name_return);
43 int fd,
44 char *name_return,
45 int *proto);
46void svc_init_xprt_sock(void); 43void svc_init_xprt_sock(void);
47void svc_cleanup_xprt_sock(void); 44void svc_cleanup_xprt_sock(void);
48 45
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h
index 4de56b1d372b..54a379c9e8eb 100644
--- a/include/linux/sunrpc/xprtrdma.h
+++ b/include/linux/sunrpc/xprtrdma.h
@@ -66,9 +66,6 @@
66 66
67#define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */ 67#define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */
68 68
69#define RDMA_RESOLVE_TIMEOUT (5*HZ) /* TBD 5 seconds */
70#define RDMA_CONNECT_RETRY_MAX (2) /* retries if no listener backlog */
71
72/* memory registration strategies */ 69/* memory registration strategies */
73#define RPCRDMA_PERSISTENT_REGISTRATION (1) 70#define RPCRDMA_PERSISTENT_REGISTRATION (1)
74 71
@@ -78,6 +75,7 @@ enum rpcrdma_memreg {
78 RPCRDMA_MEMWINDOWS, 75 RPCRDMA_MEMWINDOWS,
79 RPCRDMA_MEMWINDOWS_ASYNC, 76 RPCRDMA_MEMWINDOWS_ASYNC,
80 RPCRDMA_MTHCAFMR, 77 RPCRDMA_MTHCAFMR,
78 RPCRDMA_FRMR,
81 RPCRDMA_ALLPHYSICAL, 79 RPCRDMA_ALLPHYSICAL,
82 RPCRDMA_LAST 80 RPCRDMA_LAST
83}; 81};
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
new file mode 100644
index 000000000000..b18ec5533e8c
--- /dev/null
+++ b/include/linux/swiotlb.h
@@ -0,0 +1,83 @@
1#ifndef __LINUX_SWIOTLB_H
2#define __LINUX_SWIOTLB_H
3
4#include <linux/types.h>
5
6struct device;
7struct dma_attrs;
8struct scatterlist;
9
10extern void
11swiotlb_init(void);
12
13extern void
14*swiotlb_alloc_coherent(struct device *hwdev, size_t size,
15 dma_addr_t *dma_handle, gfp_t flags);
16
17extern void
18swiotlb_free_coherent(struct device *hwdev, size_t size,
19 void *vaddr, dma_addr_t dma_handle);
20
21extern dma_addr_t
22swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir);
23
24extern void
25swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr,
26 size_t size, int dir);
27
28extern dma_addr_t
29swiotlb_map_single_attrs(struct device *hwdev, void *ptr, size_t size,
30 int dir, struct dma_attrs *attrs);
31
32extern void
33swiotlb_unmap_single_attrs(struct device *hwdev, dma_addr_t dev_addr,
34 size_t size, int dir, struct dma_attrs *attrs);
35
36extern int
37swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
38 int direction);
39
40extern void
41swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
42 int direction);
43
44extern int
45swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
46 int dir, struct dma_attrs *attrs);
47
48extern void
49swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
50 int nelems, int dir, struct dma_attrs *attrs);
51
52extern void
53swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
54 size_t size, int dir);
55
56extern void
57swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
58 int nelems, int dir);
59
60extern void
61swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
62 size_t size, int dir);
63
64extern void
65swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
66 int nelems, int dir);
67
68extern void
69swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
70 unsigned long offset, size_t size, int dir);
71
72extern void
73swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr,
74 unsigned long offset, size_t size,
75 int dir);
76
77extern int
78swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
79
80extern int
81swiotlb_dma_supported(struct device *hwdev, u64 mask);
82
83#endif /* __LINUX_SWIOTLB_H */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index d0437f36921f..39d471d1163b 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -972,7 +972,7 @@ extern int sysctl_perm(struct ctl_table_root *root,
972 972
973typedef struct ctl_table ctl_table; 973typedef struct ctl_table ctl_table;
974 974
975typedef int ctl_handler (struct ctl_table *table, int __user *name, int nlen, 975typedef int ctl_handler (struct ctl_table *table,
976 void __user *oldval, size_t __user *oldlenp, 976 void __user *oldval, size_t __user *oldlenp,
977 void __user *newval, size_t newlen); 977 void __user *newval, size_t newlen);
978 978
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 37fa24152bd8..b330e289d71f 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -78,6 +78,8 @@ struct sysfs_ops {
78 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 78 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
79}; 79};
80 80
81struct sysfs_dirent;
82
81#ifdef CONFIG_SYSFS 83#ifdef CONFIG_SYSFS
82 84
83int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), 85int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
@@ -117,9 +119,14 @@ int sysfs_add_file_to_group(struct kobject *kobj,
117void sysfs_remove_file_from_group(struct kobject *kobj, 119void sysfs_remove_file_from_group(struct kobject *kobj,
118 const struct attribute *attr, const char *group); 120 const struct attribute *attr, const char *group);
119 121
120void sysfs_notify(struct kobject *kobj, char *dir, char *attr); 122void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
121 123void sysfs_notify_dirent(struct sysfs_dirent *sd);
122extern int __must_check sysfs_init(void); 124struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
125 const unsigned char *name);
126struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
127void sysfs_put(struct sysfs_dirent *sd);
128void sysfs_printk_last_file(void);
129int __must_check sysfs_init(void);
123 130
124#else /* CONFIG_SYSFS */ 131#else /* CONFIG_SYSFS */
125 132
@@ -222,7 +229,24 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj,
222{ 229{
223} 230}
224 231
225static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr) 232static inline void sysfs_notify(struct kobject *kobj, const char *dir,
233 const char *attr)
234{
235}
236static inline void sysfs_notify_dirent(struct sysfs_dirent *sd)
237{
238}
239static inline
240struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
241 const unsigned char *name)
242{
243 return NULL;
244}
245static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
246{
247 return NULL;
248}
249static inline void sysfs_put(struct sysfs_dirent *sd)
226{ 250{
227} 251}
228 252
@@ -231,6 +255,10 @@ static inline int __must_check sysfs_init(void)
231 return 0; 255 return 0;
232} 256}
233 257
258static inline void sysfs_printk_last_file(void)
259{
260}
261
234#endif /* CONFIG_SYSFS */ 262#endif /* CONFIG_SYSFS */
235 263
236#endif /* _SYSFS_H_ */ 264#endif /* _SYSFS_H_ */
diff --git a/include/linux/task_io_accounting.h b/include/linux/task_io_accounting.h
index 5e88afc9a2fb..bdf855c2856f 100644
--- a/include/linux/task_io_accounting.h
+++ b/include/linux/task_io_accounting.h
@@ -5,7 +5,7 @@
5 * Don't include this header file directly - it is designed to be dragged in via 5 * Don't include this header file directly - it is designed to be dragged in via
6 * sched.h. 6 * sched.h.
7 * 7 *
8 * Blame akpm@osdl.org for all this. 8 * Blame Andrew Morton for all this.
9 */ 9 */
10 10
11struct task_io_accounting { 11struct task_io_accounting {
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
index 6dac0d7365cc..76990937f4c9 100644
--- a/include/linux/tc_act/Kbuild
+++ b/include/linux/tc_act/Kbuild
@@ -3,3 +3,4 @@ header-y += tc_ipt.h
3header-y += tc_mirred.h 3header-y += tc_mirred.h
4header-y += tc_pedit.h 4header-y += tc_pedit.h
5header-y += tc_nat.h 5header-y += tc_nat.h
6header-y += tc_skbedit.h
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h
new file mode 100644
index 000000000000..a14e461a7af7
--- /dev/null
+++ b/include/linux/tc_act/tc_skbedit.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (c) 2008, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
18 */
19
20#ifndef __LINUX_TC_SKBEDIT_H
21#define __LINUX_TC_SKBEDIT_H
22
23#include <linux/pkt_cls.h>
24
25#define TCA_ACT_SKBEDIT 11
26
27#define SKBEDIT_F_PRIORITY 0x1
28#define SKBEDIT_F_QUEUE_MAPPING 0x2
29
30struct tc_skbedit {
31 tc_gen;
32};
33
34enum {
35 TCA_SKBEDIT_UNSPEC,
36 TCA_SKBEDIT_TM,
37 TCA_SKBEDIT_PARMS,
38 TCA_SKBEDIT_PRIORITY,
39 TCA_SKBEDIT_QUEUE_MAPPING,
40 __TCA_SKBEDIT_MAX
41};
42#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
43
44#endif
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 2e2557388e36..fe77e1499ab7 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -312,8 +312,11 @@ struct tcp_sock {
312 u32 retrans_out; /* Retransmitted packets out */ 312 u32 retrans_out; /* Retransmitted packets out */
313 313
314 u16 urg_data; /* Saved octet of OOB data and control flags */ 314 u16 urg_data; /* Saved octet of OOB data and control flags */
315 u8 urg_mode; /* In urgent mode */
316 u8 ecn_flags; /* ECN status bits. */ 315 u8 ecn_flags; /* ECN status bits. */
316 u8 reordering; /* Packet reordering metric. */
317 u32 snd_up; /* Urgent pointer */
318
319 u8 keepalive_probes; /* num of allowed keep alive probes */
317/* 320/*
318 * Options received (usually on last packet, some only on SYN packets). 321 * Options received (usually on last packet, some only on SYN packets).
319 */ 322 */
@@ -342,7 +345,6 @@ struct tcp_sock {
342 struct sk_buff* lost_skb_hint; 345 struct sk_buff* lost_skb_hint;
343 struct sk_buff *scoreboard_skb_hint; 346 struct sk_buff *scoreboard_skb_hint;
344 struct sk_buff *retransmit_skb_hint; 347 struct sk_buff *retransmit_skb_hint;
345 struct sk_buff *forward_skb_hint;
346 348
347 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 349 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
348 350
@@ -358,12 +360,10 @@ struct tcp_sock {
358 */ 360 */
359 361
360 int lost_cnt_hint; 362 int lost_cnt_hint;
361 int retransmit_cnt_hint; 363 u32 retransmit_high; /* L-bits may be on up to this seqno */
362 364
363 u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ 365 u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */
364 366
365 u8 reordering; /* Packet reordering metric. */
366 u8 keepalive_probes; /* num of allowed keep alive probes */
367 u32 prior_ssthresh; /* ssthresh saved at recovery start */ 367 u32 prior_ssthresh; /* ssthresh saved at recovery start */
368 u32 high_seq; /* snd_nxt at onset of congestion */ 368 u32 high_seq; /* snd_nxt at onset of congestion */
369 369
@@ -375,8 +375,6 @@ struct tcp_sock {
375 u32 total_retrans; /* Total retransmits for entire connection */ 375 u32 total_retrans; /* Total retransmits for entire connection */
376 376
377 u32 urg_seq; /* Seq of received urgent pointer */ 377 u32 urg_seq; /* Seq of received urgent pointer */
378 u32 snd_up; /* Urgent pointer */
379
380 unsigned int keepalive_time; /* time before keep alive takes place */ 378 unsigned int keepalive_time; /* time before keep alive takes place */
381 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 379 unsigned int keepalive_intvl; /* time interval between keep alive probes */
382 380
diff --git a/include/linux/telephony.h b/include/linux/telephony.h
index 0d0cf2a1e7bc..5b2b6261f193 100644
--- a/include/linux/telephony.h
+++ b/include/linux/telephony.h
@@ -28,10 +28,6 @@
28 * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION 28 * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
29 * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 29 * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
30 * 30 *
31 * Version: $Revision: 4.2 $
32 *
33 * $Id: telephony.h,v 4.2 2001/08/06 07:09:43 craigs Exp $
34 *
35 *****************************************************************************/ 31 *****************************************************************************/
36 32
37#ifndef TELEPHONY_H 33#ifndef TELEPHONY_H
diff --git a/include/linux/termios.h b/include/linux/termios.h
index 478662889f48..2acd0c1f8a2a 100644
--- a/include/linux/termios.h
+++ b/include/linux/termios.h
@@ -4,4 +4,19 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/termios.h> 5#include <asm/termios.h>
6 6
7#define NFF 5
8
9struct termiox
10{
11 __u16 x_hflag;
12 __u16 x_cflag;
13 __u16 x_rflag[NFF];
14 __u16 x_sflag;
15};
16
17#define RTSXOFF 0x0001 /* RTS flow control on input */
18#define CTSXON 0x0002 /* CTS flow control on output */
19#define DTRXOFF 0x0004 /* DTR flow control on input */
20#define DSRXON 0x0008 /* DCD flow control on output */
21
7#endif 22#endif
diff --git a/include/linux/tick.h b/include/linux/tick.h
index d3c02695dc5d..b6ec8189ac0c 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -74,10 +74,13 @@ extern struct tick_device *tick_get_device(int cpu);
74extern int tick_init_highres(void); 74extern int tick_init_highres(void);
75extern int tick_program_event(ktime_t expires, int force); 75extern int tick_program_event(ktime_t expires, int force);
76extern void tick_setup_sched_timer(void); 76extern void tick_setup_sched_timer(void);
77# endif
78
79# if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS
77extern void tick_cancel_sched_timer(int cpu); 80extern void tick_cancel_sched_timer(int cpu);
78# else 81# else
79static inline void tick_cancel_sched_timer(int cpu) { } 82static inline void tick_cancel_sched_timer(int cpu) { }
80# endif /* HIGHRES */ 83# endif
81 84
82# ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST 85# ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
83extern struct tick_device *tick_get_broadcast_device(void); 86extern struct tick_device *tick_get_broadcast_device(void);
@@ -93,9 +96,11 @@ extern cpumask_t *tick_get_broadcast_oneshot_mask(void);
93extern void tick_clock_notify(void); 96extern void tick_clock_notify(void);
94extern int tick_check_oneshot_change(int allow_nohz); 97extern int tick_check_oneshot_change(int allow_nohz);
95extern struct tick_sched *tick_get_tick_sched(int cpu); 98extern struct tick_sched *tick_get_tick_sched(int cpu);
99extern void tick_check_idle(int cpu);
96# else 100# else
97static inline void tick_clock_notify(void) { } 101static inline void tick_clock_notify(void) { }
98static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } 102static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
103static inline void tick_check_idle(int cpu) { }
99# endif 104# endif
100 105
101#else /* CONFIG_GENERIC_CLOCKEVENTS */ 106#else /* CONFIG_GENERIC_CLOCKEVENTS */
@@ -103,27 +108,24 @@ static inline void tick_init(void) { }
103static inline void tick_cancel_sched_timer(int cpu) { } 108static inline void tick_cancel_sched_timer(int cpu) { }
104static inline void tick_clock_notify(void) { } 109static inline void tick_clock_notify(void) { }
105static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } 110static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
111static inline void tick_check_idle(int cpu) { }
106#endif /* !CONFIG_GENERIC_CLOCKEVENTS */ 112#endif /* !CONFIG_GENERIC_CLOCKEVENTS */
107 113
108# ifdef CONFIG_NO_HZ 114# ifdef CONFIG_NO_HZ
109extern void tick_nohz_stop_sched_tick(int inidle); 115extern void tick_nohz_stop_sched_tick(int inidle);
110extern void tick_nohz_restart_sched_tick(void); 116extern void tick_nohz_restart_sched_tick(void);
111extern void tick_nohz_update_jiffies(void);
112extern ktime_t tick_nohz_get_sleep_length(void); 117extern ktime_t tick_nohz_get_sleep_length(void);
113extern void tick_nohz_stop_idle(int cpu);
114extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); 118extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time);
115# else 119# else
116static inline void tick_nohz_stop_sched_tick(int inidle) { } 120static inline void tick_nohz_stop_sched_tick(int inidle) { }
117static inline void tick_nohz_restart_sched_tick(void) { } 121static inline void tick_nohz_restart_sched_tick(void) { }
118static inline void tick_nohz_update_jiffies(void) { }
119static inline ktime_t tick_nohz_get_sleep_length(void) 122static inline ktime_t tick_nohz_get_sleep_length(void)
120{ 123{
121 ktime_t len = { .tv64 = NSEC_PER_SEC/HZ }; 124 ktime_t len = { .tv64 = NSEC_PER_SEC/HZ };
122 125
123 return len; 126 return len;
124} 127}
125static inline void tick_nohz_stop_idle(int cpu) { } 128static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
126static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return 0; }
127# endif /* !NO_HZ */ 129# endif /* !NO_HZ */
128 130
129#endif 131#endif
diff --git a/include/linux/time.h b/include/linux/time.h
index 205f974b9ebf..4f1c9db57707 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -29,6 +29,8 @@ struct timezone {
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
32extern struct timezone sys_tz;
33
32/* Parameters used to convert the timespec values: */ 34/* Parameters used to convert the timespec values: */
33#define MSEC_PER_SEC 1000L 35#define MSEC_PER_SEC 1000L
34#define USEC_PER_MSEC 1000L 36#define USEC_PER_MSEC 1000L
@@ -126,6 +128,9 @@ extern int timekeeping_valid_for_hres(void);
126extern void update_wall_time(void); 128extern void update_wall_time(void);
127extern void update_xtime_cache(u64 nsec); 129extern void update_xtime_cache(u64 nsec);
128 130
131struct tms;
132extern void do_sys_times(struct tms *);
133
129/** 134/**
130 * timespec_to_ns - Convert timespec to nanoseconds 135 * timespec_to_ns - Convert timespec to nanoseconds
131 * @ts: pointer to the timespec variable to be converted 136 * @ts: pointer to the timespec variable to be converted
diff --git a/include/linux/timex.h b/include/linux/timex.h
index fc6035d29d56..9007313b5b71 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -82,7 +82,7 @@
82 */ 82 */
83#define SHIFT_USEC 16 /* frequency offset scale (shift) */ 83#define SHIFT_USEC 16 /* frequency offset scale (shift) */
84#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) 84#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
85#define PPM_SCALE_INV_SHIFT 20 85#define PPM_SCALE_INV_SHIFT 19
86#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ 86#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
87 PPM_SCALE + 1) 87 PPM_SCALE + 1)
88 88
@@ -141,8 +141,15 @@ struct timex {
141#define ADJ_MICRO 0x1000 /* select microsecond resolution */ 141#define ADJ_MICRO 0x1000 /* select microsecond resolution */
142#define ADJ_NANO 0x2000 /* select nanosecond resolution */ 142#define ADJ_NANO 0x2000 /* select nanosecond resolution */
143#define ADJ_TICK 0x4000 /* tick value */ 143#define ADJ_TICK 0x4000 /* tick value */
144
145#ifdef __KERNEL__
146#define ADJ_ADJTIME 0x8000 /* switch between adjtime/adjtimex modes */
147#define ADJ_OFFSET_SINGLESHOT 0x0001 /* old-fashioned adjtime */
148#define ADJ_OFFSET_READONLY 0x2000 /* read-only adjtime */
149#else
144#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ 150#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
145#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ 151#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
152#endif
146 153
147/* xntp 3.4 compatibility names */ 154/* xntp 3.4 compatibility names */
148#define MOD_OFFSET ADJ_OFFSET 155#define MOD_OFFSET ADJ_OFFSET
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index b48d81969574..6186a789d6c7 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -272,7 +272,7 @@ static inline void tracehook_finish_clone(struct task_struct *child,
272 * tracehook_report_clone_complete(). This must prevent the child from 272 * tracehook_report_clone_complete(). This must prevent the child from
273 * self-reaping if tracehook_report_clone_complete() uses the @child 273 * self-reaping if tracehook_report_clone_complete() uses the @child
274 * pointer; otherwise it might have died and been released by the time 274 * pointer; otherwise it might have died and been released by the time
275 * tracehook_report_report_clone_complete() is called. 275 * tracehook_report_clone_complete() is called.
276 * 276 *
277 * Called with no locks held, but the child cannot run until this returns. 277 * Called with no locks held, but the child cannot run until this returns.
278 */ 278 */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 0cbec74ec086..3b8121d4e36f 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -23,7 +23,7 @@
23 */ 23 */
24#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ 24#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
25#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ 25#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
26#define NR_LDISCS 18 26#define NR_LDISCS 19
27 27
28/* line disciplines */ 28/* line disciplines */
29#define N_TTY 0 29#define N_TTY 0
@@ -45,6 +45,7 @@
45#define N_HCI 15 /* Bluetooth HCI UART */ 45#define N_HCI 15 /* Bluetooth HCI UART */
46#define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ 46#define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */
47#define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ 47#define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */
48#define N_PPS 18 /* Pulse per Second */
48 49
49/* 50/*
50 * This character is the same as _POSIX_VDISABLE: it cannot be used as 51 * This character is the same as _POSIX_VDISABLE: it cannot be used as
@@ -181,6 +182,7 @@ struct signal_struct;
181 182
182struct tty_port { 183struct tty_port {
183 struct tty_struct *tty; /* Back pointer */ 184 struct tty_struct *tty; /* Back pointer */
185 spinlock_t lock; /* Lock protecting tty field */
184 int blocked_open; /* Waiting to open */ 186 int blocked_open; /* Waiting to open */
185 int count; /* Usage count */ 187 int count; /* Usage count */
186 wait_queue_head_t open_wait; /* Open waiters */ 188 wait_queue_head_t open_wait; /* Open waiters */
@@ -208,6 +210,7 @@ struct tty_operations;
208 210
209struct tty_struct { 211struct tty_struct {
210 int magic; 212 int magic;
213 struct kref kref;
211 struct tty_driver *driver; 214 struct tty_driver *driver;
212 const struct tty_operations *ops; 215 const struct tty_operations *ops;
213 int index; 216 int index;
@@ -217,6 +220,7 @@ struct tty_struct {
217 spinlock_t ctrl_lock; 220 spinlock_t ctrl_lock;
218 /* Termios values are protected by the termios mutex */ 221 /* Termios values are protected by the termios mutex */
219 struct ktermios *termios, *termios_locked; 222 struct ktermios *termios, *termios_locked;
223 struct termiox *termiox; /* May be NULL for unsupported */
220 char name[64]; 224 char name[64];
221 struct pid *pgrp; /* Protected by ctrl lock */ 225 struct pid *pgrp; /* Protected by ctrl lock */
222 struct pid *session; 226 struct pid *session;
@@ -310,6 +314,25 @@ extern int kmsg_redirect;
310extern void console_init(void); 314extern void console_init(void);
311extern int vcs_init(void); 315extern int vcs_init(void);
312 316
317extern struct class *tty_class;
318
319/**
320 * tty_kref_get - get a tty reference
321 * @tty: tty device
322 *
323 * Return a new reference to a tty object. The caller must hold
324 * sufficient locks/counts to ensure that their existing reference cannot
325 * go away
326 */
327
328extern inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
329{
330 if (tty)
331 kref_get(&tty->kref);
332 return tty;
333}
334extern void tty_kref_put(struct tty_struct *tty);
335
313extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, 336extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
314 const char *routine); 337 const char *routine);
315extern char *tty_name(struct tty_struct *tty, char *buf); 338extern char *tty_name(struct tty_struct *tty, char *buf);
@@ -333,13 +356,15 @@ extern void tty_throttle(struct tty_struct *tty);
333extern void tty_unthrottle(struct tty_struct *tty); 356extern void tty_unthrottle(struct tty_struct *tty);
334extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, 357extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
335 struct winsize *ws); 358 struct winsize *ws);
336 359extern void tty_shutdown(struct tty_struct *tty);
360extern void tty_free_termios(struct tty_struct *tty);
337extern int is_current_pgrp_orphaned(void); 361extern int is_current_pgrp_orphaned(void);
338extern struct pid *tty_get_pgrp(struct tty_struct *tty); 362extern struct pid *tty_get_pgrp(struct tty_struct *tty);
339extern int is_ignored(int sig); 363extern int is_ignored(int sig);
340extern int tty_signal(int sig, struct tty_struct *tty); 364extern int tty_signal(int sig, struct tty_struct *tty);
341extern void tty_hangup(struct tty_struct *tty); 365extern void tty_hangup(struct tty_struct *tty);
342extern void tty_vhangup(struct tty_struct *tty); 366extern void tty_vhangup(struct tty_struct *tty);
367extern void tty_vhangup_self(void);
343extern void tty_unhangup(struct file *filp); 368extern void tty_unhangup(struct file *filp);
344extern int tty_hung_up_p(struct file *filp); 369extern int tty_hung_up_p(struct file *filp);
345extern void do_SAK(struct tty_struct *tty); 370extern void do_SAK(struct tty_struct *tty);
@@ -347,6 +372,9 @@ extern void __do_SAK(struct tty_struct *tty);
347extern void disassociate_ctty(int priv); 372extern void disassociate_ctty(int priv);
348extern void no_tty(void); 373extern void no_tty(void);
349extern void tty_flip_buffer_push(struct tty_struct *tty); 374extern void tty_flip_buffer_push(struct tty_struct *tty);
375extern void tty_buffer_free_all(struct tty_struct *tty);
376extern void tty_buffer_flush(struct tty_struct *tty);
377extern void tty_buffer_init(struct tty_struct *tty);
350extern speed_t tty_get_baud_rate(struct tty_struct *tty); 378extern speed_t tty_get_baud_rate(struct tty_struct *tty);
351extern speed_t tty_termios_baud_rate(struct ktermios *termios); 379extern speed_t tty_termios_baud_rate(struct ktermios *termios);
352extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); 380extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
@@ -372,6 +400,15 @@ extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg);
372extern dev_t tty_devnum(struct tty_struct *tty); 400extern dev_t tty_devnum(struct tty_struct *tty);
373extern void proc_clear_tty(struct task_struct *p); 401extern void proc_clear_tty(struct task_struct *p);
374extern struct tty_struct *get_current_tty(void); 402extern struct tty_struct *get_current_tty(void);
403extern void tty_default_fops(struct file_operations *fops);
404extern struct tty_struct *alloc_tty_struct(void);
405extern void free_tty_struct(struct tty_struct *tty);
406extern void initialize_tty_struct(struct tty_struct *tty,
407 struct tty_driver *driver, int idx);
408extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx,
409 int first_ok);
410extern void tty_release_dev(struct file *filp);
411extern int tty_init_termios(struct tty_struct *tty);
375 412
376extern struct mutex tty_mutex; 413extern struct mutex tty_mutex;
377 414
@@ -382,6 +419,8 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay);
382extern void tty_port_init(struct tty_port *port); 419extern void tty_port_init(struct tty_port *port);
383extern int tty_port_alloc_xmit_buf(struct tty_port *port); 420extern int tty_port_alloc_xmit_buf(struct tty_port *port);
384extern void tty_port_free_xmit_buf(struct tty_port *port); 421extern void tty_port_free_xmit_buf(struct tty_port *port);
422extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
423extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
385 424
386extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); 425extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
387extern int tty_unregister_ldisc(int disc); 426extern int tty_unregister_ldisc(int disc);
@@ -427,7 +466,7 @@ static inline void tty_audit_push_task(struct task_struct *tsk,
427#endif 466#endif
428 467
429/* tty_ioctl.c */ 468/* tty_ioctl.c */
430extern int n_tty_ioctl(struct tty_struct *tty, struct file *file, 469extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
431 unsigned int cmd, unsigned long arg); 470 unsigned int cmd, unsigned long arg);
432 471
433/* serial.c */ 472/* serial.c */
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 16d27944c321..78416b901589 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -7,6 +7,28 @@
7 * defined; unless noted otherwise, they are optional, and can be 7 * defined; unless noted otherwise, they are optional, and can be
8 * filled in with a null pointer. 8 * filled in with a null pointer.
9 * 9 *
10 * struct tty_struct * (*lookup)(struct tty_driver *self, int idx)
11 *
12 * Return the tty device corresponding to idx, NULL if there is not
13 * one currently in use and an ERR_PTR value on error. Called under
14 * tty_mutex (for now!)
15 *
16 * Optional method. Default behaviour is to use the ttys array
17 *
18 * int (*install)(struct tty_driver *self, struct tty_struct *tty)
19 *
20 * Install a new tty into the tty driver internal tables. Used in
21 * conjunction with lookup and remove methods.
22 *
23 * Optional method. Default behaviour is to use the ttys array
24 *
25 * void (*remove)(struct tty_driver *self, struct tty_struct *tty)
26 *
27 * Remove a closed tty from the tty driver internal tables. Used in
28 * conjunction with lookup and remove methods.
29 *
30 * Optional method. Default behaviour is to use the ttys array
31 *
10 * int (*open)(struct tty_struct * tty, struct file * filp); 32 * int (*open)(struct tty_struct * tty, struct file * filp);
11 * 33 *
12 * This routine is called when a particular tty device is opened. 34 * This routine is called when a particular tty device is opened.
@@ -21,6 +43,11 @@
21 * 43 *
22 * Required method. 44 * Required method.
23 * 45 *
46 * void (*shutdown)(struct tty_struct * tty);
47 *
48 * This routine is called when a particular tty device is closed for
49 * the last time freeing up the resources.
50 *
24 * int (*write)(struct tty_struct * tty, 51 * int (*write)(struct tty_struct * tty,
25 * const unsigned char *buf, int count); 52 * const unsigned char *buf, int count);
26 * 53 *
@@ -180,6 +207,14 @@
180 * not force errors here if they are not resizable objects (eg a serial 207 * not force errors here if they are not resizable objects (eg a serial
181 * line). See tty_do_resize() if you need to wrap the standard method 208 * line). See tty_do_resize() if you need to wrap the standard method
182 * in your own logic - the usual case. 209 * in your own logic - the usual case.
210 *
211 * void (*set_termiox)(struct tty_struct *tty, struct termiox *new);
212 *
213 * Called when the device receives a termiox based ioctl. Passes down
214 * the requested data from user space. This method will not be invoked
215 * unless the tty also has a valid tty->termiox pointer.
216 *
217 * Optional: Called under the termios lock
183 */ 218 */
184 219
185#include <linux/fs.h> 220#include <linux/fs.h>
@@ -190,8 +225,13 @@ struct tty_struct;
190struct tty_driver; 225struct tty_driver;
191 226
192struct tty_operations { 227struct tty_operations {
228 struct tty_struct * (*lookup)(struct tty_driver *driver,
229 struct inode *inode, int idx);
230 int (*install)(struct tty_driver *driver, struct tty_struct *tty);
231 void (*remove)(struct tty_driver *driver, struct tty_struct *tty);
193 int (*open)(struct tty_struct * tty, struct file * filp); 232 int (*open)(struct tty_struct * tty, struct file * filp);
194 void (*close)(struct tty_struct * tty, struct file * filp); 233 void (*close)(struct tty_struct * tty, struct file * filp);
234 void (*shutdown)(struct tty_struct *tty);
195 int (*write)(struct tty_struct * tty, 235 int (*write)(struct tty_struct * tty,
196 const unsigned char *buf, int count); 236 const unsigned char *buf, int count);
197 int (*put_char)(struct tty_struct *tty, unsigned char ch); 237 int (*put_char)(struct tty_struct *tty, unsigned char ch);
@@ -220,6 +260,7 @@ struct tty_operations {
220 unsigned int set, unsigned int clear); 260 unsigned int set, unsigned int clear);
221 int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, 261 int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty,
222 struct winsize *ws); 262 struct winsize *ws);
263 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
223#ifdef CONFIG_CONSOLE_POLL 264#ifdef CONFIG_CONSOLE_POLL
224 int (*poll_init)(struct tty_driver *driver, int line, char *options); 265 int (*poll_init)(struct tty_driver *driver, int line, char *options);
225 int (*poll_get_char)(struct tty_driver *driver, int line); 266 int (*poll_get_char)(struct tty_driver *driver, int line);
@@ -229,6 +270,7 @@ struct tty_operations {
229 270
230struct tty_driver { 271struct tty_driver {
231 int magic; /* magic number for this structure */ 272 int magic; /* magic number for this structure */
273 struct kref kref; /* Reference management */
232 struct cdev cdev; 274 struct cdev cdev;
233 struct module *owner; 275 struct module *owner;
234 const char *driver_name; 276 const char *driver_name;
@@ -242,7 +284,6 @@ struct tty_driver {
242 short subtype; /* subtype of tty driver */ 284 short subtype; /* subtype of tty driver */
243 struct ktermios init_termios; /* Initial termios */ 285 struct ktermios init_termios; /* Initial termios */
244 int flags; /* tty driver flags */ 286 int flags; /* tty driver flags */
245 int refcount; /* for loadable tty drivers */
246 struct proc_dir_entry *proc_entry; /* /proc fs entry */ 287 struct proc_dir_entry *proc_entry; /* /proc fs entry */
247 struct tty_driver *other; /* only used for the PTY driver */ 288 struct tty_driver *other; /* only used for the PTY driver */
248 289
@@ -264,12 +305,19 @@ struct tty_driver {
264 305
265extern struct list_head tty_drivers; 306extern struct list_head tty_drivers;
266 307
267struct tty_driver *alloc_tty_driver(int lines); 308extern struct tty_driver *alloc_tty_driver(int lines);
268void put_tty_driver(struct tty_driver *driver); 309extern void put_tty_driver(struct tty_driver *driver);
269void tty_set_operations(struct tty_driver *driver, 310extern void tty_set_operations(struct tty_driver *driver,
270 const struct tty_operations *op); 311 const struct tty_operations *op);
271extern struct tty_driver *tty_find_polling_driver(char *name, int *line); 312extern struct tty_driver *tty_find_polling_driver(char *name, int *line);
272 313
314extern void tty_driver_kref_put(struct tty_driver *driver);
315extern inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
316{
317 kref_get(&d->kref);
318 return d;
319}
320
273/* tty driver magic number */ 321/* tty driver magic number */
274#define TTY_DRIVER_MAGIC 0x5402 322#define TTY_DRIVER_MAGIC 0x5402
275 323
diff --git a/include/linux/types.h b/include/linux/types.h
index d4a9ce6e2760..f24f7beb47df 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -191,12 +191,14 @@ typedef __u32 __bitwise __wsum;
191#ifdef __KERNEL__ 191#ifdef __KERNEL__
192typedef unsigned __bitwise__ gfp_t; 192typedef unsigned __bitwise__ gfp_t;
193 193
194#ifdef CONFIG_RESOURCES_64BIT 194#ifdef CONFIG_PHYS_ADDR_T_64BIT
195typedef u64 resource_size_t; 195typedef u64 phys_addr_t;
196#else 196#else
197typedef u32 resource_size_t; 197typedef u32 phys_addr_t;
198#endif 198#endif
199 199
200typedef phys_addr_t resource_size_t;
201
200struct ustat { 202struct ustat {
201 __kernel_daddr_t f_tfree; 203 __kernel_daddr_t f_tfree;
202 __kernel_ino_t f_tinode; 204 __kernel_ino_t f_tinode;
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
new file mode 100644
index 000000000000..970473bf8d5a
--- /dev/null
+++ b/include/linux/ucb1400.h
@@ -0,0 +1,161 @@
1/*
2 * Register definitions and functions for:
3 * Philips UCB1400 driver
4 *
5 * Based on ucb1400_ts:
6 * Author: Nicolas Pitre
7 * Created: September 25, 2006
8 * Copyright: MontaVista Software, Inc.
9 *
10 * Spliting done by: Marek Vasut <marek.vasut@gmail.com>
11 * If something doesnt work and it worked before spliting, e-mail me,
12 * dont bother Nicolas please ;-)
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 version 2 as
16 * published by the Free Software Foundation.
17 *
18 * This code is heavily based on ucb1x00-*.c copyrighted by Russell King
19 * covering the UCB1100, UCB1200 and UCB1300.. Support for the UCB1400 has
20 * been made separate from ucb1x00-core/ucb1x00-ts on Russell's request.
21 */
22
23#ifndef _LINUX__UCB1400_H
24#define _LINUX__UCB1400_H
25
26#include <sound/ac97_codec.h>
27#include <linux/mutex.h>
28#include <linux/platform_device.h>
29
30/*
31 * UCB1400 AC-link registers
32 */
33
34#define UCB_IO_DATA 0x5a
35#define UCB_IO_DIR 0x5c
36#define UCB_IE_RIS 0x5e
37#define UCB_IE_FAL 0x60
38#define UCB_IE_STATUS 0x62
39#define UCB_IE_CLEAR 0x62
40#define UCB_IE_ADC (1 << 11)
41#define UCB_IE_TSPX (1 << 12)
42
43#define UCB_TS_CR 0x64
44#define UCB_TS_CR_TSMX_POW (1 << 0)
45#define UCB_TS_CR_TSPX_POW (1 << 1)
46#define UCB_TS_CR_TSMY_POW (1 << 2)
47#define UCB_TS_CR_TSPY_POW (1 << 3)
48#define UCB_TS_CR_TSMX_GND (1 << 4)
49#define UCB_TS_CR_TSPX_GND (1 << 5)
50#define UCB_TS_CR_TSMY_GND (1 << 6)
51#define UCB_TS_CR_TSPY_GND (1 << 7)
52#define UCB_TS_CR_MODE_INT (0 << 8)
53#define UCB_TS_CR_MODE_PRES (1 << 8)
54#define UCB_TS_CR_MODE_POS (2 << 8)
55#define UCB_TS_CR_BIAS_ENA (1 << 11)
56#define UCB_TS_CR_TSPX_LOW (1 << 12)
57#define UCB_TS_CR_TSMX_LOW (1 << 13)
58
59#define UCB_ADC_CR 0x66
60#define UCB_ADC_SYNC_ENA (1 << 0)
61#define UCB_ADC_VREFBYP_CON (1 << 1)
62#define UCB_ADC_INP_TSPX (0 << 2)
63#define UCB_ADC_INP_TSMX (1 << 2)
64#define UCB_ADC_INP_TSPY (2 << 2)
65#define UCB_ADC_INP_TSMY (3 << 2)
66#define UCB_ADC_INP_AD0 (4 << 2)
67#define UCB_ADC_INP_AD1 (5 << 2)
68#define UCB_ADC_INP_AD2 (6 << 2)
69#define UCB_ADC_INP_AD3 (7 << 2)
70#define UCB_ADC_EXT_REF (1 << 5)
71#define UCB_ADC_START (1 << 7)
72#define UCB_ADC_ENA (1 << 15)
73
74#define UCB_ADC_DATA 0x68
75#define UCB_ADC_DAT_VALID (1 << 15)
76#define UCB_ADC_DAT_MASK 0x3ff
77
78#define UCB_ID 0x7e
79#define UCB_ID_1400 0x4304
80
81struct ucb1400_ts {
82 struct input_dev *ts_idev;
83 struct task_struct *ts_task;
84 int id;
85 wait_queue_head_t ts_wait;
86 unsigned int ts_restart:1;
87 int irq;
88 unsigned int irq_pending; /* not bit field shared */
89 struct snd_ac97 *ac97;
90};
91
92struct ucb1400 {
93 struct platform_device *ucb1400_ts;
94};
95
96static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
97{
98 return ac97->bus->ops->read(ac97, reg);
99}
100
101static inline void ucb1400_reg_write(struct snd_ac97 *ac97, u16 reg, u16 val)
102{
103 ac97->bus->ops->write(ac97, reg, val);
104}
105
106static inline u16 ucb1400_gpio_get_value(struct snd_ac97 *ac97, u16 gpio)
107{
108 return ucb1400_reg_read(ac97, UCB_IO_DATA) & (1 << gpio);
109}
110
111static inline void ucb1400_gpio_set_value(struct snd_ac97 *ac97, u16 gpio,
112 u16 val)
113{
114 ucb1400_reg_write(ac97, UCB_IO_DATA, val ?
115 ucb1400_reg_read(ac97, UCB_IO_DATA) | (1 << gpio) :
116 ucb1400_reg_read(ac97, UCB_IO_DATA) & ~(1 << gpio));
117}
118
119static inline u16 ucb1400_gpio_get_direction(struct snd_ac97 *ac97, u16 gpio)
120{
121 return ucb1400_reg_read(ac97, UCB_IO_DIR) & (1 << gpio);
122}
123
124static inline void ucb1400_gpio_set_direction(struct snd_ac97 *ac97, u16 gpio,
125 u16 dir)
126{
127 ucb1400_reg_write(ac97, UCB_IO_DIR, dir ?
128 ucb1400_reg_read(ac97, UCB_IO_DIR) | (1 << gpio) :
129 ucb1400_reg_read(ac97, UCB_IO_DIR) & ~(1 << gpio));
130}
131
132static inline void ucb1400_adc_enable(struct snd_ac97 *ac97)
133{
134 ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA);
135}
136
137static unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
138 int adcsync)
139{
140 unsigned int val;
141
142 if (adcsync)
143 adc_channel |= UCB_ADC_SYNC_ENA;
144
145 ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel);
146 ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel |
147 UCB_ADC_START);
148
149 while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA))
150 & UCB_ADC_DAT_VALID))
151 schedule_timeout_uninterruptible(1);
152
153 return val & UCB_ADC_DAT_MASK;
154}
155
156static inline void ucb1400_adc_disable(struct snd_ac97 *ac97)
157{
158 ucb1400_reg_write(ac97, UCB_ADC_CR, 0);
159}
160
161#endif
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 0924cd9c30f6..8fa973bede5e 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -110,6 +110,8 @@ enum usb_interface_condition {
110 * @sysfs_files_created: sysfs attributes exist 110 * @sysfs_files_created: sysfs attributes exist
111 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup 111 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup
112 * capability during autosuspend. 112 * capability during autosuspend.
113 * @needs_altsetting0: flag set when a set-interface request for altsetting 0
114 * has been deferred.
113 * @needs_binding: flag set when the driver should be re-probed or unbound 115 * @needs_binding: flag set when the driver should be re-probed or unbound
114 * following a reset or suspend operation it doesn't support. 116 * following a reset or suspend operation it doesn't support.
115 * @dev: driver model's view of this device 117 * @dev: driver model's view of this device
@@ -162,6 +164,7 @@ struct usb_interface {
162 unsigned is_active:1; /* the interface is not suspended */ 164 unsigned is_active:1; /* the interface is not suspended */
163 unsigned sysfs_files_created:1; /* the sysfs attributes exist */ 165 unsigned sysfs_files_created:1; /* the sysfs attributes exist */
164 unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ 166 unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */
167 unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */
165 unsigned needs_binding:1; /* needs delayed unbind/rebind */ 168 unsigned needs_binding:1; /* needs delayed unbind/rebind */
166 169
167 struct device dev; /* interface specific device info */ 170 struct device dev; /* interface specific device info */
@@ -1132,6 +1135,7 @@ struct usb_anchor {
1132 struct list_head urb_list; 1135 struct list_head urb_list;
1133 wait_queue_head_t wait; 1136 wait_queue_head_t wait;
1134 spinlock_t lock; 1137 spinlock_t lock;
1138 unsigned int poisoned:1;
1135}; 1139};
1136 1140
1137static inline void init_usb_anchor(struct usb_anchor *anchor) 1141static inline void init_usb_anchor(struct usb_anchor *anchor)
@@ -1456,12 +1460,18 @@ extern struct urb *usb_get_urb(struct urb *urb);
1456extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); 1460extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags);
1457extern int usb_unlink_urb(struct urb *urb); 1461extern int usb_unlink_urb(struct urb *urb);
1458extern void usb_kill_urb(struct urb *urb); 1462extern void usb_kill_urb(struct urb *urb);
1463extern void usb_poison_urb(struct urb *urb);
1464extern void usb_unpoison_urb(struct urb *urb);
1459extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); 1465extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
1466extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
1460extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); 1467extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor);
1461extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); 1468extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor);
1462extern void usb_unanchor_urb(struct urb *urb); 1469extern void usb_unanchor_urb(struct urb *urb);
1463extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, 1470extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor,
1464 unsigned int timeout); 1471 unsigned int timeout);
1472extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor);
1473extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
1474extern int usb_anchor_empty(struct usb_anchor *anchor);
1465 1475
1466/** 1476/**
1467 * usb_urb_dir_in - check if an URB describes an IN transfer 1477 * usb_urb_dir_in - check if an URB describes an IN transfer
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index 42e84fc315e3..54c446309a2a 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -4,4 +4,5 @@ header-y += ch9.h
4header-y += gadgetfs.h 4header-y += gadgetfs.h
5header-y += midi.h 5header-y += midi.h
6header-y += g_printer.h 6header-y += g_printer.h
7 7header-y += tmc.h
8header-y += vstusb.h
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
index ca228bb94218..18a729343ffa 100644
--- a/include/linux/usb/cdc.h
+++ b/include/linux/usb/cdc.h
@@ -160,6 +160,15 @@ struct usb_cdc_mdlm_detail_desc {
160 __u8 bDetailData[0]; 160 __u8 bDetailData[0];
161} __attribute__ ((packed)); 161} __attribute__ ((packed));
162 162
163/* "OBEX Control Model Functional Descriptor" */
164struct usb_cdc_obex_desc {
165 __u8 bLength;
166 __u8 bDescriptorType;
167 __u8 bDescriptorSubType;
168
169 __le16 bcdVersion;
170} __attribute__ ((packed));
171
163/*-------------------------------------------------------------------------*/ 172/*-------------------------------------------------------------------------*/
164 173
165/* 174/*
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index c932390c6da0..935c380ffe47 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -130,6 +130,9 @@ struct usb_function {
130 130
131int usb_add_function(struct usb_configuration *, struct usb_function *); 131int usb_add_function(struct usb_configuration *, struct usb_function *);
132 132
133int usb_function_deactivate(struct usb_function *);
134int usb_function_activate(struct usb_function *);
135
133int usb_interface_id(struct usb_configuration *, struct usb_function *); 136int usb_interface_id(struct usb_configuration *, struct usb_function *);
134 137
135/** 138/**
@@ -316,9 +319,13 @@ struct usb_composite_dev {
316 struct usb_composite_driver *driver; 319 struct usb_composite_driver *driver;
317 u8 next_string_id; 320 u8 next_string_id;
318 321
319 spinlock_t lock; 322 /* the gadget driver won't enable the data pullup
323 * while the deactivation count is nonzero.
324 */
325 unsigned deactivations;
320 326
321 /* REVISIT use and existence of lock ... */ 327 /* protects at least deactivation count */
328 spinlock_t lock;
322}; 329};
323 330
324extern int usb_string_id(struct usb_composite_dev *c); 331extern int usb_string_id(struct usb_composite_dev *c);
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h
new file mode 100644
index 000000000000..5b88e36c9103
--- /dev/null
+++ b/include/linux/usb/ehci_def.h
@@ -0,0 +1,160 @@
1/*
2 * Copyright (c) 2001-2002 by David Brownell
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef __LINUX_USB_EHCI_DEF_H
20#define __LINUX_USB_EHCI_DEF_H
21
22/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
23
24/* Section 2.2 Host Controller Capability Registers */
25struct ehci_caps {
26 /* these fields are specified as 8 and 16 bit registers,
27 * but some hosts can't perform 8 or 16 bit PCI accesses.
28 */
29 u32 hc_capbase;
30#define HC_LENGTH(p) (((p)>>00)&0x00ff) /* bits 7:0 */
31#define HC_VERSION(p) (((p)>>16)&0xffff) /* bits 31:16 */
32 u32 hcs_params; /* HCSPARAMS - offset 0x4 */
33#define HCS_DEBUG_PORT(p) (((p)>>20)&0xf) /* bits 23:20, debug port? */
34#define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */
35#define HCS_N_CC(p) (((p)>>12)&0xf) /* bits 15:12, #companion HCs */
36#define HCS_N_PCC(p) (((p)>>8)&0xf) /* bits 11:8, ports per CC */
37#define HCS_PORTROUTED(p) ((p)&(1 << 7)) /* true: port routing */
38#define HCS_PPC(p) ((p)&(1 << 4)) /* true: port power control */
39#define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */
40
41 u32 hcc_params; /* HCCPARAMS - offset 0x8 */
42#define HCC_EXT_CAPS(p) (((p)>>8)&0xff) /* for pci extended caps */
43#define HCC_ISOC_CACHE(p) ((p)&(1 << 7)) /* true: can cache isoc frame */
44#define HCC_ISOC_THRES(p) (((p)>>4)&0x7) /* bits 6:4, uframes cached */
45#define HCC_CANPARK(p) ((p)&(1 << 2)) /* true: can park on async qh */
46#define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/
47#define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */
48 u8 portroute [8]; /* nibbles for routing - offset 0xC */
49} __attribute__ ((packed));
50
51
52/* Section 2.3 Host Controller Operational Registers */
53struct ehci_regs {
54
55 /* USBCMD: offset 0x00 */
56 u32 command;
57/* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */
58#define CMD_PARK (1<<11) /* enable "park" on async qh */
59#define CMD_PARK_CNT(c) (((c)>>8)&3) /* how many transfers to park for */
60#define CMD_LRESET (1<<7) /* partial reset (no ports, etc) */
61#define CMD_IAAD (1<<6) /* "doorbell" interrupt async advance */
62#define CMD_ASE (1<<5) /* async schedule enable */
63#define CMD_PSE (1<<4) /* periodic schedule enable */
64/* 3:2 is periodic frame list size */
65#define CMD_RESET (1<<1) /* reset HC not bus */
66#define CMD_RUN (1<<0) /* start/stop HC */
67
68 /* USBSTS: offset 0x04 */
69 u32 status;
70#define STS_ASS (1<<15) /* Async Schedule Status */
71#define STS_PSS (1<<14) /* Periodic Schedule Status */
72#define STS_RECL (1<<13) /* Reclamation */
73#define STS_HALT (1<<12) /* Not running (any reason) */
74/* some bits reserved */
75 /* these STS_* flags are also intr_enable bits (USBINTR) */
76#define STS_IAA (1<<5) /* Interrupted on async advance */
77#define STS_FATAL (1<<4) /* such as some PCI access errors */
78#define STS_FLR (1<<3) /* frame list rolled over */
79#define STS_PCD (1<<2) /* port change detect */
80#define STS_ERR (1<<1) /* "error" completion (overflow, ...) */
81#define STS_INT (1<<0) /* "normal" completion (short, ...) */
82
83 /* USBINTR: offset 0x08 */
84 u32 intr_enable;
85
86 /* FRINDEX: offset 0x0C */
87 u32 frame_index; /* current microframe number */
88 /* CTRLDSSEGMENT: offset 0x10 */
89 u32 segment; /* address bits 63:32 if needed */
90 /* PERIODICLISTBASE: offset 0x14 */
91 u32 frame_list; /* points to periodic list */
92 /* ASYNCLISTADDR: offset 0x18 */
93 u32 async_next; /* address of next async queue head */
94
95 u32 reserved [9];
96
97 /* CONFIGFLAG: offset 0x40 */
98 u32 configured_flag;
99#define FLAG_CF (1<<0) /* true: we'll support "high speed" */
100
101 /* PORTSC: offset 0x44 */
102 u32 port_status [0]; /* up to N_PORTS */
103/* 31:23 reserved */
104#define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */
105#define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */
106#define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */
107/* 19:16 for port testing */
108#define PORT_LED_OFF (0<<14)
109#define PORT_LED_AMBER (1<<14)
110#define PORT_LED_GREEN (2<<14)
111#define PORT_LED_MASK (3<<14)
112#define PORT_OWNER (1<<13) /* true: companion hc owns this port */
113#define PORT_POWER (1<<12) /* true: has power (see PPC) */
114#define PORT_USB11(x) (((x)&(3<<10)) == (1<<10)) /* USB 1.1 device */
115/* 11:10 for detecting lowspeed devices (reset vs release ownership) */
116/* 9 reserved */
117#define PORT_RESET (1<<8) /* reset port */
118#define PORT_SUSPEND (1<<7) /* suspend port */
119#define PORT_RESUME (1<<6) /* resume it */
120#define PORT_OCC (1<<5) /* over current change */
121#define PORT_OC (1<<4) /* over current active */
122#define PORT_PEC (1<<3) /* port enable change */
123#define PORT_PE (1<<2) /* port enable */
124#define PORT_CSC (1<<1) /* connect status change */
125#define PORT_CONNECT (1<<0) /* device connected */
126#define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC)
127} __attribute__ ((packed));
128
129#define USBMODE 0x68 /* USB Device mode */
130#define USBMODE_SDIS (1<<3) /* Stream disable */
131#define USBMODE_BE (1<<2) /* BE/LE endianness select */
132#define USBMODE_CM_HC (3<<0) /* host controller mode */
133#define USBMODE_CM_IDLE (0<<0) /* idle state */
134
135/* Appendix C, Debug port ... intended for use with special "debug devices"
136 * that can help if there's no serial console. (nonstandard enumeration.)
137 */
138struct ehci_dbg_port {
139 u32 control;
140#define DBGP_OWNER (1<<30)
141#define DBGP_ENABLED (1<<28)
142#define DBGP_DONE (1<<16)
143#define DBGP_INUSE (1<<10)
144#define DBGP_ERRCODE(x) (((x)>>7)&0x07)
145# define DBGP_ERR_BAD 1
146# define DBGP_ERR_SIGNAL 2
147#define DBGP_ERROR (1<<6)
148#define DBGP_GO (1<<5)
149#define DBGP_OUT (1<<4)
150#define DBGP_LEN(x) (((x)>>0)&0x0f)
151 u32 pids;
152#define DBGP_PID_GET(x) (((x)>>16)&0xff)
153#define DBGP_PID_SET(data, tok) (((data)<<8)|(tok))
154 u32 data03;
155 u32 data47;
156 u32 address;
157#define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep))
158} __attribute__ ((packed));
159
160#endif /* __LINUX_USB_EHCI_DEF_H */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 655341d0f534..0b8617a9176d 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -192,7 +192,7 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data)
192 * The driver.owner field should be set to the module owner of this driver. 192 * The driver.owner field should be set to the module owner of this driver.
193 * The driver.name field should be set to the name of this driver (remember 193 * The driver.name field should be set to the name of this driver (remember
194 * it will show up in sysfs, so it needs to be short and to the point. 194 * it will show up in sysfs, so it needs to be short and to the point.
195 * Useing the module name is a good idea.) 195 * Using the module name is a good idea.)
196 */ 196 */
197struct usb_serial_driver { 197struct usb_serial_driver {
198 const char *description; 198 const char *description;
diff --git a/include/linux/usb/tmc.h b/include/linux/usb/tmc.h
new file mode 100644
index 000000000000..c045ae12556c
--- /dev/null
+++ b/include/linux/usb/tmc.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
3 * Copyright (C) 2008 Novell, Inc.
4 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
5 *
6 * This file holds USB constants defined by the USB Device Class
7 * Definition for Test and Measurement devices published by the USB-IF.
8 *
9 * It also has the ioctl definitions for the usbtmc kernel driver that
10 * userspace needs to know about.
11 */
12
13#ifndef __LINUX_USB_TMC_H
14#define __LINUX_USB_TMC_H
15
16/* USB TMC status values */
17#define USBTMC_STATUS_SUCCESS 0x01
18#define USBTMC_STATUS_PENDING 0x02
19#define USBTMC_STATUS_FAILED 0x80
20#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS 0x81
21#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS 0x82
22#define USBTMC_STATUS_SPLIT_IN_PROGRESS 0x83
23
24/* USB TMC requests values */
25#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT 1
26#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS 2
27#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN 3
28#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS 4
29#define USBTMC_REQUEST_INITIATE_CLEAR 5
30#define USBTMC_REQUEST_CHECK_CLEAR_STATUS 6
31#define USBTMC_REQUEST_GET_CAPABILITIES 7
32#define USBTMC_REQUEST_INDICATOR_PULSE 64
33
34/* Request values for USBTMC driver's ioctl entry point */
35#define USBTMC_IOC_NR 91
36#define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1)
37#define USBTMC_IOCTL_CLEAR _IO(USBTMC_IOC_NR, 2)
38#define USBTMC_IOCTL_ABORT_BULK_OUT _IO(USBTMC_IOC_NR, 3)
39#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)
40#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)
41#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)
42
43#endif
diff --git a/include/linux/usb/vstusb.h b/include/linux/usb/vstusb.h
new file mode 100644
index 000000000000..1cfac67191ff
--- /dev/null
+++ b/include/linux/usb/vstusb.h
@@ -0,0 +1,71 @@
1/*****************************************************************************
2 * File: drivers/usb/misc/vstusb.h
3 *
4 * Purpose: Support for the bulk USB Vernier Spectrophotometers
5 *
6 * Author: EQware Engineering, Inc.
7 * Oregon City, OR, USA 97045
8 *
9 * Copyright: 2007, 2008
10 * Vernier Software & Technology
11 * Beaverton, OR, USA 97005
12 *
13 * Web: www.vernier.com
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 version 2 as
17 * published by the Free Software Foundation.
18 *
19 *****************************************************************************/
20/*****************************************************************************
21 *
22 * The vstusb module is a standard usb 'client' driver running on top of the
23 * standard usb host controller stack.
24 *
25 * In general, vstusb supports standard bulk usb pipes. It supports multiple
26 * devices and multiple pipes per device.
27 *
28 * The vstusb driver supports two interfaces:
29 * 1 - ioctl SEND_PIPE/RECV_PIPE - a general bulk write/read msg
30 * interface to any pipe with timeout support;
31 * 2 - standard read/write with ioctl config - offers standard read/write
32 * interface with ioctl configured pipes and timeouts.
33 *
34 * Both interfaces can be signal from other process and will abort its i/o
35 * operation.
36 *
37 * A timeout of 0 means NO timeout. The user can still terminate the read via
38 * signal.
39 *
40 * If using multiple threads with this driver, the user should ensure that
41 * any reads, writes, or ioctls are complete before closing the device.
42 * Changing read/write timeouts or pipes takes effect on next read/write.
43 *
44 *****************************************************************************/
45
46struct vstusb_args {
47 union {
48 /* this struct is used for IOCTL_VSTUSB_SEND_PIPE, *
49 * IOCTL_VSTUSB_RECV_PIPE, and read()/write() fops */
50 struct {
51 void __user *buffer;
52 size_t count;
53 unsigned int timeout_ms;
54 int pipe;
55 };
56
57 /* this one is used for IOCTL_VSTUSB_CONFIG_RW */
58 struct {
59 int rd_pipe;
60 int rd_timeout_ms;
61 int wr_pipe;
62 int wr_timeout_ms;
63 };
64 };
65};
66
67#define VST_IOC_MAGIC 'L'
68#define VST_IOC_FIRST 0x20
69#define IOCTL_VSTUSB_SEND_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST)
70#define IOCTL_VSTUSB_RECV_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 1)
71#define IOCTL_VSTUSB_CONFIG_RW _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 2)
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index e65a6bed4e3e..d4b03034ee73 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -334,6 +334,8 @@ struct v4l2_pix_format {
334#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ 334#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
335#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ 335#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
336#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ 336#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
337#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
338#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
337 339
338/* 340/*
339 * F O R M A T E N U M E R A T I O N 341 * F O R M A T E N U M E R A T I O N
@@ -908,6 +910,8 @@ enum v4l2_mpeg_audio_encoding {
908 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, 910 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
909 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, 911 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
910 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2, 912 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
913 V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
914 V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
911}; 915};
912#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) 916#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
913enum v4l2_mpeg_audio_l1_bitrate { 917enum v4l2_mpeg_audio_l1_bitrate {
@@ -986,12 +990,36 @@ enum v4l2_mpeg_audio_crc {
986 V4L2_MPEG_AUDIO_CRC_CRC16 = 1, 990 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
987}; 991};
988#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) 992#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
993#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
994#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
995enum v4l2_mpeg_audio_ac3_bitrate {
996 V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
997 V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
998 V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
999 V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
1000 V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
1001 V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
1002 V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
1003 V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
1004 V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
1005 V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
1006 V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
1007 V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
1008 V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
1009 V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
1010 V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
1011 V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
1012 V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
1013 V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
1014 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
1015};
989 1016
990/* MPEG video */ 1017/* MPEG video */
991#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) 1018#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
992enum v4l2_mpeg_video_encoding { 1019enum v4l2_mpeg_video_encoding {
993 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, 1020 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
994 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, 1021 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
1022 V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
995}; 1023};
996#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) 1024#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
997enum v4l2_mpeg_video_aspect { 1025enum v4l2_mpeg_video_aspect {
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 1cbd0a7db4e6..2f1113467f70 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -96,7 +96,7 @@ void change_console(struct vc_data *new_vc);
96void reset_vc(struct vc_data *vc); 96void reset_vc(struct vc_data *vc);
97extern int unbind_con_driver(const struct consw *csw, int first, int last, 97extern int unbind_con_driver(const struct consw *csw, int first, int last,
98 int deflt); 98 int deflt);
99int vty_init(void); 99int vty_init(const struct file_operations *console_fops);
100 100
101/* 101/*
102 * vc_screen.c shares this temporary buffer with the console write code so that 102 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0081147a9fe8..ef609f842fac 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -108,15 +108,6 @@ static inline int waitqueue_active(wait_queue_head_t *q)
108 return !list_empty(&q->task_list); 108 return !list_empty(&q->task_list);
109} 109}
110 110
111/*
112 * Used to distinguish between sync and async io wait context:
113 * sync i/o typically specifies a NULL wait queue entry or a wait
114 * queue entry bound to a task (current task) to wake up.
115 * aio specifies a wait queue entry with an async notification
116 * callback routine, not associated with any task.
117 */
118#define is_sync_wait(wait) (!(wait) || ((wait)->private))
119
120extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); 111extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
121extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); 112extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait);
122extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); 113extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h
new file mode 100644
index 000000000000..9681d1ab0e4f
--- /dev/null
+++ b/include/linux/wm97xx_batt.h
@@ -0,0 +1,26 @@
1#ifndef _LINUX_WM97XX_BAT_H
2#define _LINUX_WM97XX_BAT_H
3
4#include <linux/wm97xx.h>
5
6struct wm97xx_batt_info {
7 int batt_aux;
8 int temp_aux;
9 int charge_gpio;
10 int min_voltage;
11 int max_voltage;
12 int batt_div;
13 int batt_mult;
14 int temp_div;
15 int temp_mult;
16 int batt_tech;
17 char *batt_name;
18};
19
20#ifdef CONFIG_BATTERY_WM97XX
21void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data);
22#else
23static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {}
24#endif
25
26#endif
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 12b15c561a1f..e585657e9831 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -63,7 +63,15 @@ struct writeback_control {
63 unsigned for_writepages:1; /* This is a writepages() call */ 63 unsigned for_writepages:1; /* This is a writepages() call */
64 unsigned range_cyclic:1; /* range_start is cyclic */ 64 unsigned range_cyclic:1; /* range_start is cyclic */
65 unsigned more_io:1; /* more io to be dispatched */ 65 unsigned more_io:1; /* more io to be dispatched */
66 unsigned range_cont:1; 66 /*
67 * write_cache_pages() won't update wbc->nr_to_write and
68 * mapping->writeback_index if no_nrwrite_index_update
69 * is set. write_cache_pages() may write more than we
70 * requested and we want to make sure nr_to_write and
71 * writeback_index are updated in a consistent manner
72 * so we use a single control to update them
73 */
74 unsigned no_nrwrite_index_update:1;
67}; 75};
68 76
69/* 77/*
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index fb0c215a3051..4bc1e6b86cb2 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -279,6 +279,7 @@ enum xfrm_attr_type_t {
279 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ 279 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
280 XFRMA_MIGRATE, 280 XFRMA_MIGRATE,
281 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ 281 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
282 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
282 __XFRMA_MAX 283 __XFRMA_MAX
283 284
284#define XFRMA_MAX (__XFRMA_MAX - 1) 285#define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -415,6 +416,15 @@ struct xfrm_user_report {
415 struct xfrm_selector sel; 416 struct xfrm_selector sel;
416}; 417};
417 418
419/* Used by MIGRATE to pass addresses IKE should use to perform
420 * SA negotiation with the peer */
421struct xfrm_user_kmaddress {
422 xfrm_address_t local;
423 xfrm_address_t remote;
424 __u32 reserved;
425 __u16 family;
426};
427
418struct xfrm_user_migrate { 428struct xfrm_user_migrate {
419 xfrm_address_t old_daddr; 429 xfrm_address_t old_daddr;
420 xfrm_address_t old_saddr; 430 xfrm_address_t old_saddr;
diff --git a/include/math-emu/op-2.h b/include/math-emu/op-2.h
index e193fb08fd55..4f26ecc1411b 100644
--- a/include/math-emu/op-2.h
+++ b/include/math-emu/op-2.h
@@ -25,7 +25,7 @@
25#ifndef __MATH_EMU_OP_2_H__ 25#ifndef __MATH_EMU_OP_2_H__
26#define __MATH_EMU_OP_2_H__ 26#define __MATH_EMU_OP_2_H__
27 27
28#define _FP_FRAC_DECL_2(X) _FP_W_TYPE X##_f0, X##_f1 28#define _FP_FRAC_DECL_2(X) _FP_W_TYPE X##_f0 = 0, X##_f1 = 0
29#define _FP_FRAC_COPY_2(D,S) (D##_f0 = S##_f0, D##_f1 = S##_f1) 29#define _FP_FRAC_COPY_2(D,S) (D##_f0 = S##_f0, D##_f1 = S##_f1)
30#define _FP_FRAC_SET_2(X,I) __FP_FRAC_SET_2(X, I) 30#define _FP_FRAC_SET_2(X,I) __FP_FRAC_SET_2(X, I)
31#define _FP_FRAC_HIGH_2(X) (X##_f1) 31#define _FP_FRAC_HIGH_2(X) (X##_f1)
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index bb46e7645d53..cc1ec396f8d6 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -73,7 +73,7 @@ do { \
73 X##_c = FP_CLS_NAN; \ 73 X##_c = FP_CLS_NAN; \
74 /* Check for signaling NaN */ \ 74 /* Check for signaling NaN */ \
75 if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \ 75 if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \
76 FP_SET_EXCEPTION(FP_EX_INVALID); \ 76 FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_SNAN); \
77 } \ 77 } \
78 break; \ 78 break; \
79 } \ 79 } \
@@ -324,7 +324,7 @@ do { \
324 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ 324 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
325 R##_s = _FP_NANSIGN_##fs; \ 325 R##_s = _FP_NANSIGN_##fs; \
326 R##_c = FP_CLS_NAN; \ 326 R##_c = FP_CLS_NAN; \
327 FP_SET_EXCEPTION(FP_EX_INVALID); \ 327 FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ISI); \
328 break; \ 328 break; \
329 } \ 329 } \
330 /* FALLTHRU */ \ 330 /* FALLTHRU */ \
@@ -431,7 +431,7 @@ do { \
431 R##_s = _FP_NANSIGN_##fs; \ 431 R##_s = _FP_NANSIGN_##fs; \
432 R##_c = FP_CLS_NAN; \ 432 R##_c = FP_CLS_NAN; \
433 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ 433 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
434 FP_SET_EXCEPTION(FP_EX_INVALID); \ 434 FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IMZ);\
435 break; \ 435 break; \
436 \ 436 \
437 default: \ 437 default: \
@@ -490,11 +490,15 @@ do { \
490 break; \ 490 break; \
491 \ 491 \
492 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \ 492 case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \
493 R##_s = _FP_NANSIGN_##fs; \
494 R##_c = FP_CLS_NAN; \
495 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
496 FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\
493 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \ 497 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \
494 R##_s = _FP_NANSIGN_##fs; \ 498 R##_s = _FP_NANSIGN_##fs; \
495 R##_c = FP_CLS_NAN; \ 499 R##_c = FP_CLS_NAN; \
496 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ 500 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
497 FP_SET_EXCEPTION(FP_EX_INVALID); \ 501 FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_ZDZ);\
498 break; \ 502 break; \
499 \ 503 \
500 default: \ 504 default: \
diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h
index a6f873b45f98..3f284bc03180 100644
--- a/include/math-emu/soft-fp.h
+++ b/include/math-emu/soft-fp.h
@@ -51,6 +51,25 @@
51#ifndef FP_EX_INVALID 51#ifndef FP_EX_INVALID
52#define FP_EX_INVALID 0 52#define FP_EX_INVALID 0
53#endif 53#endif
54#ifndef FP_EX_INVALID_SNAN
55#define FP_EX_INVALID_SNAN 0
56#endif
57/* inf - inf */
58#ifndef FP_EX_INVALID_ISI
59#define FP_EX_INVALID_ISI 0
60#endif
61/* inf / inf */
62#ifndef FP_EX_INVALID_IDI
63#define FP_EX_INVALID_IDI 0
64#endif
65/* 0 / 0 */
66#ifndef FP_EX_INVALID_ZDZ
67#define FP_EX_INVALID_ZDZ 0
68#endif
69/* inf * 0 */
70#ifndef FP_EX_INVALID_IMZ
71#define FP_EX_INVALID_IMZ 0
72#endif
54#ifndef FP_EX_OVERFLOW 73#ifndef FP_EX_OVERFLOW
55#define FP_EX_OVERFLOW 0 74#define FP_EX_OVERFLOW 0
56#endif 75#endif
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index b8e8aa91905a..38f2d93c3957 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -25,6 +25,7 @@
25 25
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/workqueue.h> 27#include <linux/workqueue.h>
28#include <linux/interrupt.h>
28 29
29#define IR_TYPE_RC5 1 30#define IR_TYPE_RC5 1
30#define IR_TYPE_PD 2 /* Pulse distance encoded IR */ 31#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
@@ -85,6 +86,10 @@ struct card_ir {
85 u32 code; /* raw code under construction */ 86 u32 code; /* raw code under construction */
86 struct timeval base_time; /* time of last seen code */ 87 struct timeval base_time; /* time of last seen code */
87 int active; /* building raw code */ 88 int active; /* building raw code */
89
90 /* NEC decoding */
91 u32 nec_gpio;
92 struct tasklet_struct tlet;
88}; 93};
89 94
90void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 95void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
@@ -105,6 +110,7 @@ void ir_rc5_timer_keyup(unsigned long data);
105extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; 110extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE];
106extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE]; 111extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE];
107extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE]; 112extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE];
113extern IR_KEYTAB_TYPE ir_codes_avermedia_m135a[IR_KEYTAB_SIZE];
108extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE]; 114extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE];
109extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; 115extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE];
110extern IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE]; 116extern IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE];
@@ -139,6 +145,7 @@ extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE];
139extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; 145extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE];
140extern IR_KEYTAB_TYPE ir_codes_asus_pc39[IR_KEYTAB_SIZE]; 146extern IR_KEYTAB_TYPE ir_codes_asus_pc39[IR_KEYTAB_SIZE];
141extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE]; 147extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE];
148extern IR_KEYTAB_TYPE ir_codes_encore_enltv2[IR_KEYTAB_SIZE];
142extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE]; 149extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE];
143extern IR_KEYTAB_TYPE ir_codes_fusionhdtv_mce[IR_KEYTAB_SIZE]; 150extern IR_KEYTAB_TYPE ir_codes_fusionhdtv_mce[IR_KEYTAB_SIZE];
144extern IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE]; 151extern IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE];
@@ -147,7 +154,9 @@ extern IR_KEYTAB_TYPE ir_codes_pinnacle_pctv_hd[IR_KEYTAB_SIZE];
147extern IR_KEYTAB_TYPE ir_codes_genius_tvgo_a11mce[IR_KEYTAB_SIZE]; 154extern IR_KEYTAB_TYPE ir_codes_genius_tvgo_a11mce[IR_KEYTAB_SIZE];
148extern IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE]; 155extern IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE];
149extern IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE]; 156extern IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE];
150 157extern IR_KEYTAB_TYPE ir_codes_encore_enltv_fm53[IR_KEYTAB_SIZE];
158extern IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE];
159extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE];
151#endif 160#endif
152 161
153/* 162/*
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
index f677dfb9d373..bab212719591 100644
--- a/include/media/saa7115.h
+++ b/include/media/saa7115.h
@@ -1,5 +1,5 @@
1/* 1/*
2 saa7115.h - definition for saa7113/4/5 inputs and frequency flags 2 saa7115.h - definition for saa7111/3/4/5 inputs and frequency flags
3 3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) 4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
5 5
@@ -21,13 +21,13 @@
21#ifndef _SAA7115_H_ 21#ifndef _SAA7115_H_
22#define _SAA7115_H_ 22#define _SAA7115_H_
23 23
24/* SAA7113/4/5 HW inputs */ 24/* SAA7111/3/4/5 HW inputs */
25#define SAA7115_COMPOSITE0 0 25#define SAA7115_COMPOSITE0 0
26#define SAA7115_COMPOSITE1 1 26#define SAA7115_COMPOSITE1 1
27#define SAA7115_COMPOSITE2 2 27#define SAA7115_COMPOSITE2 2
28#define SAA7115_COMPOSITE3 3 28#define SAA7115_COMPOSITE3 3
29#define SAA7115_COMPOSITE4 4 /* not available for the saa7113 */ 29#define SAA7115_COMPOSITE4 4 /* not available for the saa7111/3 */
30#define SAA7115_COMPOSITE5 5 /* not available for the saa7113 */ 30#define SAA7115_COMPOSITE5 5 /* not available for the saa7111/3 */
31#define SAA7115_SVIDEO0 6 31#define SAA7115_SVIDEO0 6
32#define SAA7115_SVIDEO1 7 32#define SAA7115_SVIDEO1 7
33#define SAA7115_SVIDEO2 8 33#define SAA7115_SVIDEO2 8
@@ -42,8 +42,15 @@
42#define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */ 42#define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */
43#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */ 43#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */
44 44
45#define SAA7115_IPORT_ON 1 45#define SAA7115_IPORT_ON 1
46#define SAA7115_IPORT_OFF 0 46#define SAA7115_IPORT_OFF 0
47
48/* SAA7111 specific output flags */
49#define SAA7111_VBI_BYPASS 2
50#define SAA7111_FMT_YUV422 0x00
51#define SAA7111_FMT_RGB 0x40
52#define SAA7111_FMT_CCIR 0x80
53#define SAA7111_FMT_YUV411 0xc0
47 54
48#endif 55#endif
49 56
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index 2f68f4cd0037..c5a6e22a4b37 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -24,13 +24,13 @@
24 24
25extern unsigned int saa7146_debug; 25extern unsigned int saa7146_debug;
26 26
27//#define DEBUG_PROLOG printk("(0x%08x)(0x%08x) %s: %s(): ",(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,RPS_ADDR0))),(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,IER))),KBUILD_MODNAME,__FUNCTION__) 27//#define DEBUG_PROLOG printk("(0x%08x)(0x%08x) %s: %s(): ",(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,RPS_ADDR0))),(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,IER))),KBUILD_MODNAME,__func__)
28 28
29#ifndef DEBUG_VARIABLE 29#ifndef DEBUG_VARIABLE
30 #define DEBUG_VARIABLE saa7146_debug 30 #define DEBUG_VARIABLE saa7146_debug
31#endif 31#endif
32 32
33#define DEBUG_PROLOG printk("%s: %s(): ",KBUILD_MODNAME,__FUNCTION__) 33#define DEBUG_PROLOG printk("%s: %s(): ",KBUILD_MODNAME, __func__)
34#define INFO(x) { printk("%s: ",KBUILD_MODNAME); printk x; } 34#define INFO(x) { printk("%s: ",KBUILD_MODNAME); printk x; }
35 35
36#define ERR(x) { DEBUG_PROLOG; printk x; } 36#define ERR(x) { DEBUG_PROLOG; printk x; }
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h
index 234a4711d2ec..b5dbefea3740 100644
--- a/include/media/sh_mobile_ceu.h
+++ b/include/media/sh_mobile_ceu.h
@@ -5,8 +5,6 @@
5 5
6struct sh_mobile_ceu_info { 6struct sh_mobile_ceu_info {
7 unsigned long flags; /* SOCAM_... */ 7 unsigned long flags; /* SOCAM_... */
8 void (*enable_camera)(void);
9 void (*disable_camera)(void);
10}; 8};
11 9
12#endif /* __ASM_SH_MOBILE_CEU_H__ */ 10#endif /* __ASM_SH_MOBILE_CEU_H__ */
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index d548de326722..c5de7bb19fda 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -83,6 +83,9 @@ struct soc_camera_link {
83 int bus_id; 83 int bus_id;
84 /* GPIO number to switch between 8 and 10 bit modes */ 84 /* GPIO number to switch between 8 and 10 bit modes */
85 unsigned int gpio; 85 unsigned int gpio;
86 /* Optional callbacks to power on or off and reset the sensor */
87 int (*power)(struct device *, int);
88 int (*reset)(struct device *);
86}; 89};
87 90
88static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev) 91static inline struct soc_camera_device *to_soc_camera_dev(struct device *dev)
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 851f18220984..1d092b4678aa 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -1,3 +1,13 @@
1/*
2 * Generic Platform Camera Driver Header
3 *
4 * Copyright (C) 2008 Magnus Damm
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
1#ifndef __SOC_CAMERA_H__ 11#ifndef __SOC_CAMERA_H__
2#define __SOC_CAMERA_H__ 12#define __SOC_CAMERA_H__
3 13
@@ -9,6 +19,7 @@ struct soc_camera_platform_info {
9 unsigned long format_depth; 19 unsigned long format_depth;
10 struct v4l2_pix_format format; 20 struct v4l2_pix_format format;
11 unsigned long bus_param; 21 unsigned long bus_param;
22 void (*power)(int);
12 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 23 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
13}; 24};
14 25
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 77068fcc86bd..7d4e2db78076 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -122,6 +122,8 @@
122#define TUNER_TDA9887 74 /* This tuner should be used only internally */ 122#define TUNER_TDA9887 74 /* This tuner should be used only internally */
123#define TUNER_TEA5761 75 /* Only FM Radio Tuner */ 123#define TUNER_TEA5761 75 /* Only FM Radio Tuner */
124#define TUNER_XC5000 76 /* Xceive Silicon Tuner */ 124#define TUNER_XC5000 76 /* Xceive Silicon Tuner */
125#define TUNER_TCL_MF02GIP_5N 77 /* TCL MF02GIP_5N */
126#define TUNER_PHILIPS_FMD1216MEX_MK3 78
125 127
126/* tv card specific */ 128/* tv card specific */
127#define TDA9887_PRESENT (1<<0) 129#define TDA9887_PRESENT (1<<0)
@@ -178,7 +180,7 @@ struct tuner_setup {
178 unsigned int type; /* Tuner type */ 180 unsigned int type; /* Tuner type */
179 unsigned int mode_mask; /* Allowed tuner modes */ 181 unsigned int mode_mask; /* Allowed tuner modes */
180 unsigned int config; /* configuraion for more complex tuners */ 182 unsigned int config; /* configuraion for more complex tuners */
181 int (*tuner_callback) (void *dev, int command,int arg); 183 int (*tuner_callback) (void *dev, int component, int cmd, int arg);
182}; 184};
183 185
184#endif /* __KERNEL__ */ 186#endif /* __KERNEL__ */
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 41b509babf3f..d73a8e9028a5 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -72,6 +72,10 @@ enum {
72 /* module cs5345: just ident 5345 */ 72 /* module cs5345: just ident 5345 */
73 V4L2_IDENT_CS5345 = 5345, 73 V4L2_IDENT_CS5345 = 5345,
74 74
75 /* module saa6752hs: reserved range 6750-6759 */
76 V4L2_IDENT_SAA6752HS = 6752,
77 V4L2_IDENT_SAA6752HS_AC3 = 6753,
78
75 /* module wm8739: just ident 8739 */ 79 /* module wm8739: just ident 8739 */
76 V4L2_IDENT_WM8739 = 8739, 80 V4L2_IDENT_WM8739 = 8739,
77 81
@@ -161,6 +165,7 @@ enum {
161 /* Micron CMOS sensor chips: 45000-45099 */ 165 /* Micron CMOS sensor chips: 45000-45099 */
162 V4L2_IDENT_MT9M001C12ST = 45000, 166 V4L2_IDENT_MT9M001C12ST = 45000,
163 V4L2_IDENT_MT9M001C12STM = 45005, 167 V4L2_IDENT_MT9M001C12STM = 45005,
168 V4L2_IDENT_MT9M111 = 45007,
164 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ 169 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */
165 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ 170 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */
166}; 171};
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 07d3a9a575d1..2f8719abf5cb 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -76,11 +76,14 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
76 76
77int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, 77int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
78 const char **menu_items); 78 const char **menu_items);
79const char *v4l2_ctrl_get_name(u32 id);
79const char **v4l2_ctrl_get_menu(u32 id); 80const char **v4l2_ctrl_get_menu(u32 id);
80int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); 81int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def);
81int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl); 82int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl);
82int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, 83int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
83 struct v4l2_queryctrl *qctrl, const char **menu_items); 84 struct v4l2_queryctrl *qctrl, const char **menu_items);
85#define V4L2_CTRL_MENU_IDS_END (0xffffffff)
86int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids);
84u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); 87u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id);
85 88
86/* ------------------------------------------------------------------------- */ 89/* ------------------------------------------------------------------------- */
@@ -222,18 +225,22 @@ struct v4l2_crystal_freq {
222 An extra flags field allows device specific configuration regarding 225 An extra flags field allows device specific configuration regarding
223 clock frequency dividers, etc. If not used, then set flags to 0. 226 clock frequency dividers, etc. If not used, then set flags to 0.
224 If the frequency is not supported, then -EINVAL is returned. */ 227 If the frequency is not supported, then -EINVAL is returned. */
225#define VIDIOC_INT_S_CRYSTAL_FREQ _IOW ('d', 113, struct v4l2_crystal_freq) 228#define VIDIOC_INT_S_CRYSTAL_FREQ _IOW('d', 113, struct v4l2_crystal_freq)
226 229
227/* Initialize the sensor registors to some sort of reasonable 230/* Initialize the sensor registors to some sort of reasonable
228 default values. */ 231 default values. */
229#define VIDIOC_INT_INIT _IOW ('d', 114, u32) 232#define VIDIOC_INT_INIT _IOW('d', 114, u32)
230 233
231/* Set v4l2_std_id for video OUTPUT devices. This is ignored by 234/* Set v4l2_std_id for video OUTPUT devices. This is ignored by
232 video input devices. */ 235 video input devices. */
233#define VIDIOC_INT_S_STD_OUTPUT _IOW ('d', 115, v4l2_std_id) 236#define VIDIOC_INT_S_STD_OUTPUT _IOW('d', 115, v4l2_std_id)
234 237
235/* Get v4l2_std_id for video OUTPUT devices. This is ignored by 238/* Get v4l2_std_id for video OUTPUT devices. This is ignored by
236 video input devices. */ 239 video input devices. */
237#define VIDIOC_INT_G_STD_OUTPUT _IOW ('d', 116, v4l2_std_id) 240#define VIDIOC_INT_G_STD_OUTPUT _IOW('d', 116, v4l2_std_id)
241
242/* Set GPIO pins. Very simple right now, might need to be extended with
243 a v4l2_gpio struct if a direction is also needed. */
244#define VIDIOC_INT_S_GPIO _IOW('d', 117, u32)
238 245
239#endif /* V4L2_COMMON_H_ */ 246#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 2745e1afc722..a0a6b41c5e09 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -9,30 +9,20 @@
9#ifndef _V4L2_DEV_H 9#ifndef _V4L2_DEV_H
10#define _V4L2_DEV_H 10#define _V4L2_DEV_H
11 11
12#define OBSOLETE_DEVDATA 1 /* to be removed soon */
13
14#include <linux/poll.h> 12#include <linux/poll.h>
15#include <linux/fs.h> 13#include <linux/fs.h>
16#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/cdev.h>
17#include <linux/mutex.h> 16#include <linux/mutex.h>
18#include <linux/compiler.h> /* need __user */
19#include <linux/videodev2.h> 17#include <linux/videodev2.h>
20 18
21#define VIDEO_MAJOR 81 19#define VIDEO_MAJOR 81
22/* Minor device allocation */
23#define MINOR_VFL_TYPE_GRABBER_MIN 0
24#define MINOR_VFL_TYPE_GRABBER_MAX 63
25#define MINOR_VFL_TYPE_RADIO_MIN 64
26#define MINOR_VFL_TYPE_RADIO_MAX 127
27#define MINOR_VFL_TYPE_VTX_MIN 192
28#define MINOR_VFL_TYPE_VTX_MAX 223
29#define MINOR_VFL_TYPE_VBI_MIN 224
30#define MINOR_VFL_TYPE_VBI_MAX 255
31 20
32#define VFL_TYPE_GRABBER 0 21#define VFL_TYPE_GRABBER 0
33#define VFL_TYPE_VBI 1 22#define VFL_TYPE_VBI 1
34#define VFL_TYPE_RADIO 2 23#define VFL_TYPE_RADIO 2
35#define VFL_TYPE_VTX 3 24#define VFL_TYPE_VTX 3
25#define VFL_TYPE_MAX 4
36 26
37struct v4l2_ioctl_callbacks; 27struct v4l2_ioctl_callbacks;
38 28
@@ -49,12 +39,15 @@ struct video_device
49 39
50 /* sysfs */ 40 /* sysfs */
51 struct device dev; /* v4l device */ 41 struct device dev; /* v4l device */
42 struct cdev cdev; /* character device */
43 void (*cdev_release)(struct kobject *kobj);
52 struct device *parent; /* device parent */ 44 struct device *parent; /* device parent */
53 45
54 /* device info */ 46 /* device info */
55 char name[32]; 47 char name[32];
56 int vfl_type; 48 int vfl_type;
57 int minor; 49 int minor;
50 u16 num;
58 /* attribute to differentiate multiple indices on one physical device */ 51 /* attribute to differentiate multiple indices on one physical device */
59 int index; 52 int index;
60 53
@@ -69,50 +62,50 @@ struct video_device
69 62
70 /* ioctl callbacks */ 63 /* ioctl callbacks */
71 const struct v4l2_ioctl_ops *ioctl_ops; 64 const struct v4l2_ioctl_ops *ioctl_ops;
72
73#ifdef OBSOLETE_DEVDATA /* to be removed soon */
74 /* dev->driver_data will be used instead some day.
75 * Use the video_{get|set}_drvdata() helper functions,
76 * so the switch over will be transparent for you.
77 * Or use {pci|usb}_{get|set}_drvdata() directly. */
78 void *priv;
79#endif
80
81 /* for videodev.c internal usage -- please don't touch */
82 int users; /* video_exclusive_{open|close} ... */
83 struct mutex lock; /* ... helper function uses these */
84}; 65};
85 66
86/* Class-dev to video-device */ 67/* dev to video-device */
87#define to_video_device(cd) container_of(cd, struct video_device, dev) 68#define to_video_device(cd) container_of(cd, struct video_device, dev)
88 69
89/* Version 2 functions */ 70/* Register and unregister devices. Note that if video_register_device fails,
90extern int video_register_device(struct video_device *vfd, int type, int nr); 71 the release() callback of the video_device structure is *not* called, so
91int video_register_device_index(struct video_device *vfd, int type, int nr, 72 the caller is responsible for freeing any data. Usually that means that
92 int index); 73 you call video_device_release() on failure. */
93void video_unregister_device(struct video_device *); 74int __must_check video_register_device(struct video_device *vfd, int type, int nr);
75int __must_check video_register_device_index(struct video_device *vfd,
76 int type, int nr, int index);
77void video_unregister_device(struct video_device *vfd);
94 78
95/* helper functions to alloc / release struct video_device, the 79/* helper functions to alloc/release struct video_device, the
96 later can be used for video_device->release() */ 80 latter can also be used for video_device->release(). */
97struct video_device *video_device_alloc(void); 81struct video_device * __must_check video_device_alloc(void);
82
83/* this release function frees the vfd pointer */
98void video_device_release(struct video_device *vfd); 84void video_device_release(struct video_device *vfd);
99 85
100#ifdef OBSOLETE_DEVDATA /* to be removed soon */ 86/* this release function does nothing, use when the video_device is a
87 static global struct. Note that having a static video_device is
88 a dubious construction at best. */
89void video_device_release_empty(struct video_device *vfd);
90
101/* helper functions to access driver private data. */ 91/* helper functions to access driver private data. */
102static inline void *video_get_drvdata(struct video_device *dev) 92static inline void *video_get_drvdata(struct video_device *dev)
103{ 93{
104 return dev->priv; 94 return dev_get_drvdata(&dev->dev);
105} 95}
106 96
107static inline void video_set_drvdata(struct video_device *dev, void *data) 97static inline void video_set_drvdata(struct video_device *dev, void *data)
108{ 98{
109 dev->priv = data; 99 dev_set_drvdata(&dev->dev, data);
110} 100}
111 101
112/* Obsolete stuff - Still needed for radio devices and obsolete drivers */ 102struct video_device *video_devdata(struct file *file);
113extern struct video_device* video_devdata(struct file*); 103
114extern int video_exclusive_open(struct inode *inode, struct file *file); 104/* Combine video_get_drvdata and video_devdata as this is
115extern int video_exclusive_release(struct inode *inode, struct file *file); 105 used very often. */
116#endif 106static inline void *video_drvdata(struct file *file)
107{
108 return video_get_drvdata(video_devdata(file));
109}
117 110
118#endif /* _V4L2_DEV_H */ 111#endif /* _V4L2_DEV_H */
diff --git a/include/media/v4l2-i2c-drv-legacy.h b/include/media/v4l2-i2c-drv-legacy.h
index 975ffbf4e2c5..e65dd9d84e8b 100644
--- a/include/media/v4l2-i2c-drv-legacy.h
+++ b/include/media/v4l2-i2c-drv-legacy.h
@@ -21,6 +21,17 @@
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23 23
24/* NOTE: the full version of this header is in the v4l-dvb repository
25 * and allows v4l i2c drivers to be compiled on older kernels as well.
26 * The version of this header as it appears in the kernel is a stripped
27 * version (without all the backwards compatibility stuff) and so it
28 * looks a bit odd.
29 *
30 * If you look at the full version then you will understand the reason
31 * for introducing this header since you really don't want to have all
32 * the tricky backwards compatibility code in each and every i2c driver.
33 */
34
24struct v4l2_i2c_driver_data { 35struct v4l2_i2c_driver_data {
25 const char * const name; 36 const char * const name;
26 int driverid; 37 int driverid;
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
index 40ecef29801d..efdc8bf27f87 100644
--- a/include/media/v4l2-i2c-drv.h
+++ b/include/media/v4l2-i2c-drv.h
@@ -21,6 +21,17 @@
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23 23
24/* NOTE: the full version of this header is in the v4l-dvb repository
25 * and allows v4l i2c drivers to be compiled on older kernels as well.
26 * The version of this header as it appears in the kernel is a stripped
27 * version (without all the backwards compatibility stuff) and so it
28 * looks a bit odd.
29 *
30 * If you look at the full version then you will understand the reason
31 * for introducing this header since you really don't want to have all
32 * the tricky backwards compatibility code in each and every i2c driver.
33 */
34
24#ifndef __V4L2_I2C_DRV_H__ 35#ifndef __V4L2_I2C_DRV_H__
25#define __V4L2_I2C_DRV_H__ 36#define __V4L2_I2C_DRV_H__
26 37
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index dc6404618555..0bef03add796 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -39,11 +39,6 @@ struct v4l2_ioctl_ops {
39 struct v4l2_fmtdesc *f); 39 struct v4l2_fmtdesc *f);
40 int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh, 40 int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh,
41 struct v4l2_fmtdesc *f); 41 struct v4l2_fmtdesc *f);
42#if 1
43 /* deprecated, will be removed in 2.6.28 */
44 int (*vidioc_enum_fmt_vbi_cap) (struct file *file, void *fh,
45 struct v4l2_fmtdesc *f);
46#endif
47 int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh, 42 int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh,
48 struct v4l2_fmtdesc *f); 43 struct v4l2_fmtdesc *f);
49 44
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h
index b77748696329..80471c2b6343 100644
--- a/include/media/videobuf-dvb.h
+++ b/include/media/videobuf-dvb.h
@@ -16,7 +16,6 @@ struct videobuf_dvb {
16 int nfeeds; 16 int nfeeds;
17 17
18 /* videobuf_dvb_(un)register manges this */ 18 /* videobuf_dvb_(un)register manges this */
19 struct dvb_adapter adapter;
20 struct dvb_demux demux; 19 struct dvb_demux demux;
21 struct dmxdev dmxdev; 20 struct dmxdev dmxdev;
22 struct dmx_frontend fe_hw; 21 struct dmx_frontend fe_hw;
@@ -24,12 +23,34 @@ struct videobuf_dvb {
24 struct dvb_net net; 23 struct dvb_net net;
25}; 24};
26 25
27int videobuf_dvb_register(struct videobuf_dvb *dvb, 26struct videobuf_dvb_frontend {
27 struct list_head felist;
28 int id;
29 struct videobuf_dvb dvb;
30};
31
32struct videobuf_dvb_frontends {
33 struct list_head felist;
34 struct mutex lock;
35 struct dvb_adapter adapter;
36 int active_fe_id; /* Indicates which frontend in the felist is in use */
37 int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
38};
39
40int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
28 struct module *module, 41 struct module *module,
29 void *adapter_priv, 42 void *adapter_priv,
30 struct device *device, 43 struct device *device,
31 short *adapter_nr); 44 short *adapter_nr,
32void videobuf_dvb_unregister(struct videobuf_dvb *dvb); 45 int mfe_shared);
46
47void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);
48
49struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id);
50
51struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id);
52int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p);
53
33 54
34/* 55/*
35 * Local variables: 56 * Local variables:
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index b3d3e27c6299..fb163e2e0de6 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -61,7 +61,7 @@ extern unsigned int p9_debug_level;
61do { \ 61do { \
62 if ((p9_debug_level & level) == level) \ 62 if ((p9_debug_level & level) == level) \
63 printk(KERN_NOTICE "-- %s (%d): " \ 63 printk(KERN_NOTICE "-- %s (%d): " \
64 format , __FUNCTION__, task_pid_nr(current) , ## arg); \ 64 format , __func__, task_pid_nr(current) , ## arg); \
65} while (0) 65} while (0)
66 66
67#define PRINT_FCALL_ERROR(s, fcall) P9_DPRINTK(P9_DEBUG_ERROR, \ 67#define PRINT_FCALL_ERROR(s, fcall) P9_DPRINTK(P9_DEBUG_ERROR, \
@@ -76,7 +76,7 @@ do { \
76#define P9_EPRINTK(level, format, arg...) \ 76#define P9_EPRINTK(level, format, arg...) \
77do { \ 77do { \
78 printk(level "9p: %s (%d): " \ 78 printk(level "9p: %s (%d): " \
79 format , __FUNCTION__, task_pid_nr(current), ## arg); \ 79 format , __func__, task_pid_nr(current), ## arg); \
80} while (0) 80} while (0)
81 81
82/** 82/**
@@ -596,4 +596,5 @@ int p9_idpool_check(int id, struct p9_idpool *p);
596int p9_error_init(void); 596int p9_error_init(void);
597int p9_errstr2errno(char *, int); 597int p9_errstr2errno(char *, int);
598int p9_trans_fd_init(void); 598int p9_trans_fd_init(void);
599void p9_trans_fd_exit(void);
599#endif /* NET_9P_H */ 600#endif /* NET_9P_H */
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 0db3a4038dc0..3ca737120a90 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -26,6 +26,8 @@
26#ifndef NET_9P_TRANSPORT_H 26#ifndef NET_9P_TRANSPORT_H
27#define NET_9P_TRANSPORT_H 27#define NET_9P_TRANSPORT_H
28 28
29#include <linux/module.h>
30
29/** 31/**
30 * enum p9_trans_status - different states of underlying transports 32 * enum p9_trans_status - different states of underlying transports
31 * @Connected: transport is connected and healthy 33 * @Connected: transport is connected and healthy
@@ -91,9 +93,12 @@ struct p9_trans_module {
91 int maxsize; /* max message size of transport */ 93 int maxsize; /* max message size of transport */
92 int def; /* this transport should be default */ 94 int def; /* this transport should be default */
93 struct p9_trans * (*create)(const char *, char *, int, unsigned char); 95 struct p9_trans * (*create)(const char *, char *, int, unsigned char);
96 struct module *owner;
94}; 97};
95 98
96void v9fs_register_trans(struct p9_trans_module *m); 99void v9fs_register_trans(struct p9_trans_module *m);
97struct p9_trans_module *v9fs_match_trans(const substring_t *name); 100void v9fs_unregister_trans(struct p9_trans_module *m);
98struct p9_trans_module *v9fs_default_trans(void); 101struct p9_trans_module *v9fs_get_trans_by_name(const substring_t *name);
102struct p9_trans_module *v9fs_get_default_trans(void);
103void v9fs_put_trans(struct p9_trans_module *m);
99#endif /* NET_9P_TRANSPORT_H */ 104#endif /* NET_9P_TRANSPORT_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 6f8418bf4241..996d12df7594 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -54,8 +54,8 @@
54#define SOL_RFCOMM 18 54#define SOL_RFCOMM 18
55 55
56#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg) 56#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg)
57#define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg) 57#define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __func__ , ## arg)
58#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg) 58#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg)
59 59
60/* Connection and socket states */ 60/* Connection and socket states */
61enum { 61enum {
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index cbf751094688..46a43b721dd6 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -325,7 +325,8 @@ int hci_conn_del(struct hci_conn *conn);
325void hci_conn_hash_flush(struct hci_dev *hdev); 325void hci_conn_hash_flush(struct hci_dev *hdev);
326void hci_conn_check_pending(struct hci_dev *hdev); 326void hci_conn_check_pending(struct hci_dev *hdev);
327 327
328struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *src); 328struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 auth_type);
329int hci_conn_check_link_mode(struct hci_conn *conn);
329int hci_conn_auth(struct hci_conn *conn); 330int hci_conn_auth(struct hci_conn *conn);
330int hci_conn_encrypt(struct hci_conn *conn); 331int hci_conn_encrypt(struct hci_conn *conn);
331int hci_conn_change_link_key(struct hci_conn *conn); 332int hci_conn_change_link_key(struct hci_conn *conn);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e00750836ba5..0e85ec39b638 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -152,6 +152,7 @@ struct station_parameters {
152 u16 aid; 152 u16 aid;
153 u8 supported_rates_len; 153 u8 supported_rates_len;
154 u8 plink_action; 154 u8 plink_action;
155 struct ieee80211_ht_cap *ht_capa;
155}; 156};
156 157
157/** 158/**
@@ -268,6 +269,83 @@ struct mpath_info {
268 u8 flags; 269 u8 flags;
269}; 270};
270 271
272/**
273 * struct bss_parameters - BSS parameters
274 *
275 * Used to change BSS parameters (mainly for AP mode).
276 *
277 * @use_cts_prot: Whether to use CTS protection
278 * (0 = no, 1 = yes, -1 = do not change)
279 * @use_short_preamble: Whether the use of short preambles is allowed
280 * (0 = no, 1 = yes, -1 = do not change)
281 * @use_short_slot_time: Whether the use of short slot time is allowed
282 * (0 = no, 1 = yes, -1 = do not change)
283 */
284struct bss_parameters {
285 int use_cts_prot;
286 int use_short_preamble;
287 int use_short_slot_time;
288};
289
290/**
291 * enum reg_set_by - Indicates who is trying to set the regulatory domain
292 * @REGDOM_SET_BY_INIT: regulatory domain was set by initialization. We will be
293 * using a static world regulatory domain by default.
294 * @REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world regulatory domain.
295 * @REGDOM_SET_BY_USER: User asked the wireless core to set the
296 * regulatory domain.
297 * @REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the wireless core
298 * it thinks its knows the regulatory domain we should be in.
299 * @REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an 802.11 country
300 * information element with regulatory information it thinks we
301 * should consider.
302 */
303enum reg_set_by {
304 REGDOM_SET_BY_INIT,
305 REGDOM_SET_BY_CORE,
306 REGDOM_SET_BY_USER,
307 REGDOM_SET_BY_DRIVER,
308 REGDOM_SET_BY_COUNTRY_IE,
309};
310
311struct ieee80211_freq_range {
312 u32 start_freq_khz;
313 u32 end_freq_khz;
314 u32 max_bandwidth_khz;
315};
316
317struct ieee80211_power_rule {
318 u32 max_antenna_gain;
319 u32 max_eirp;
320};
321
322struct ieee80211_reg_rule {
323 struct ieee80211_freq_range freq_range;
324 struct ieee80211_power_rule power_rule;
325 u32 flags;
326};
327
328struct ieee80211_regdomain {
329 u32 n_reg_rules;
330 char alpha2[2];
331 struct ieee80211_reg_rule reg_rules[];
332};
333
334#define MHZ_TO_KHZ(freq) (freq * 1000)
335#define KHZ_TO_MHZ(freq) (freq / 1000)
336#define DBI_TO_MBI(gain) (gain * 100)
337#define MBI_TO_DBI(gain) (gain / 100)
338#define DBM_TO_MBM(gain) (gain * 100)
339#define MBM_TO_DBM(gain) (gain / 100)
340
341#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \
342 .freq_range.start_freq_khz = (start) * 1000, \
343 .freq_range.end_freq_khz = (end) * 1000, \
344 .freq_range.max_bandwidth_khz = (bw) * 1000, \
345 .power_rule.max_antenna_gain = (gain) * 100, \
346 .power_rule.max_eirp = (eirp) * 100, \
347 .flags = reg_flags, \
348 }
271 349
272/* from net/wireless.h */ 350/* from net/wireless.h */
273struct wiphy; 351struct wiphy;
@@ -285,11 +363,13 @@ struct wiphy;
285 * wireless extensions but this is subject to reevaluation as soon as this 363 * wireless extensions but this is subject to reevaluation as soon as this
286 * code is used more widely and we have a first user without wext. 364 * code is used more widely and we have a first user without wext.
287 * 365 *
288 * @add_virtual_intf: create a new virtual interface with the given name 366 * @add_virtual_intf: create a new virtual interface with the given name,
367 * must set the struct wireless_dev's iftype.
289 * 368 *
290 * @del_virtual_intf: remove the virtual interface determined by ifindex. 369 * @del_virtual_intf: remove the virtual interface determined by ifindex.
291 * 370 *
292 * @change_virtual_intf: change type of virtual interface 371 * @change_virtual_intf: change type/configuration of virtual interface,
372 * keep the struct wireless_dev's iftype updated.
293 * 373 *
294 * @add_key: add a key with the given parameters. @mac_addr will be %NULL 374 * @add_key: add a key with the given parameters. @mac_addr will be %NULL
295 * when adding a group key. 375 * when adding a group key.
@@ -318,6 +398,8 @@ struct wiphy;
318 * @change_station: Modify a given station. 398 * @change_station: Modify a given station.
319 * 399 *
320 * @set_mesh_cfg: set mesh parameters (by now, just mesh id) 400 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
401 *
402 * @change_bss: Modify parameters for a given BSS.
321 */ 403 */
322struct cfg80211_ops { 404struct cfg80211_ops {
323 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 405 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
@@ -370,6 +452,9 @@ struct cfg80211_ops {
370 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, 452 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
371 int idx, u8 *dst, u8 *next_hop, 453 int idx, u8 *dst, u8 *next_hop,
372 struct mpath_info *pinfo); 454 struct mpath_info *pinfo);
455
456 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
457 struct bss_parameters *params);
373}; 458};
374 459
375#endif /* __NET_CFG80211_H */ 460#endif /* __NET_CFG80211_H */
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index a6bb94530cfd..9909774eb998 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -40,11 +40,12 @@
40#include <linux/net.h> 40#include <linux/net.h>
41#include <linux/skbuff.h> 41#include <linux/skbuff.h>
42#include <net/netlabel.h> 42#include <net/netlabel.h>
43#include <asm/atomic.h>
43 44
44/* known doi values */ 45/* known doi values */
45#define CIPSO_V4_DOI_UNKNOWN 0x00000000 46#define CIPSO_V4_DOI_UNKNOWN 0x00000000
46 47
47/* tag types */ 48/* standard tag types */
48#define CIPSO_V4_TAG_INVALID 0 49#define CIPSO_V4_TAG_INVALID 0
49#define CIPSO_V4_TAG_RBITMAP 1 50#define CIPSO_V4_TAG_RBITMAP 1
50#define CIPSO_V4_TAG_ENUM 2 51#define CIPSO_V4_TAG_ENUM 2
@@ -52,10 +53,14 @@
52#define CIPSO_V4_TAG_PBITMAP 6 53#define CIPSO_V4_TAG_PBITMAP 6
53#define CIPSO_V4_TAG_FREEFORM 7 54#define CIPSO_V4_TAG_FREEFORM 7
54 55
56/* non-standard tag types (tags > 127) */
57#define CIPSO_V4_TAG_LOCAL 128
58
55/* doi mapping types */ 59/* doi mapping types */
56#define CIPSO_V4_MAP_UNKNOWN 0 60#define CIPSO_V4_MAP_UNKNOWN 0
57#define CIPSO_V4_MAP_STD 1 61#define CIPSO_V4_MAP_TRANS 1
58#define CIPSO_V4_MAP_PASS 2 62#define CIPSO_V4_MAP_PASS 2
63#define CIPSO_V4_MAP_LOCAL 3
59 64
60/* limits */ 65/* limits */
61#define CIPSO_V4_MAX_REM_LVLS 255 66#define CIPSO_V4_MAX_REM_LVLS 255
@@ -79,10 +84,9 @@ struct cipso_v4_doi {
79 } map; 84 } map;
80 u8 tags[CIPSO_V4_TAG_MAXCNT]; 85 u8 tags[CIPSO_V4_TAG_MAXCNT];
81 86
82 u32 valid; 87 atomic_t refcount;
83 struct list_head list; 88 struct list_head list;
84 struct rcu_head rcu; 89 struct rcu_head rcu;
85 struct list_head dom_list;
86}; 90};
87 91
88/* Standard CIPSO mapping table */ 92/* Standard CIPSO mapping table */
@@ -128,25 +132,26 @@ extern int cipso_v4_rbm_strictvalid;
128 132
129#ifdef CONFIG_NETLABEL 133#ifdef CONFIG_NETLABEL
130int cipso_v4_doi_add(struct cipso_v4_doi *doi_def); 134int cipso_v4_doi_add(struct cipso_v4_doi *doi_def);
131int cipso_v4_doi_remove(u32 doi, 135void cipso_v4_doi_free(struct cipso_v4_doi *doi_def);
132 struct netlbl_audit *audit_info, 136int cipso_v4_doi_remove(u32 doi, struct netlbl_audit *audit_info);
133 void (*callback) (struct rcu_head * head));
134struct cipso_v4_doi *cipso_v4_doi_getdef(u32 doi); 137struct cipso_v4_doi *cipso_v4_doi_getdef(u32 doi);
138void cipso_v4_doi_putdef(struct cipso_v4_doi *doi_def);
135int cipso_v4_doi_walk(u32 *skip_cnt, 139int cipso_v4_doi_walk(u32 *skip_cnt,
136 int (*callback) (struct cipso_v4_doi *doi_def, void *arg), 140 int (*callback) (struct cipso_v4_doi *doi_def, void *arg),
137 void *cb_arg); 141 void *cb_arg);
138int cipso_v4_doi_domhsh_add(struct cipso_v4_doi *doi_def, const char *domain);
139int cipso_v4_doi_domhsh_remove(struct cipso_v4_doi *doi_def,
140 const char *domain);
141#else 142#else
142static inline int cipso_v4_doi_add(struct cipso_v4_doi *doi_def) 143static inline int cipso_v4_doi_add(struct cipso_v4_doi *doi_def)
143{ 144{
144 return -ENOSYS; 145 return -ENOSYS;
145} 146}
146 147
148static inline void cipso_v4_doi_free(struct cipso_v4_doi *doi_def)
149{
150 return;
151}
152
147static inline int cipso_v4_doi_remove(u32 doi, 153static inline int cipso_v4_doi_remove(u32 doi,
148 struct netlbl_audit *audit_info, 154 struct netlbl_audit *audit_info)
149 void (*callback) (struct rcu_head * head))
150{ 155{
151 return 0; 156 return 0;
152} 157}
@@ -206,10 +211,15 @@ void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway);
206int cipso_v4_sock_setattr(struct sock *sk, 211int cipso_v4_sock_setattr(struct sock *sk,
207 const struct cipso_v4_doi *doi_def, 212 const struct cipso_v4_doi *doi_def,
208 const struct netlbl_lsm_secattr *secattr); 213 const struct netlbl_lsm_secattr *secattr);
214void cipso_v4_sock_delattr(struct sock *sk);
209int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr); 215int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr);
216int cipso_v4_skbuff_setattr(struct sk_buff *skb,
217 const struct cipso_v4_doi *doi_def,
218 const struct netlbl_lsm_secattr *secattr);
219int cipso_v4_skbuff_delattr(struct sk_buff *skb);
210int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 220int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
211 struct netlbl_lsm_secattr *secattr); 221 struct netlbl_lsm_secattr *secattr);
212int cipso_v4_validate(unsigned char **option); 222int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option);
213#else 223#else
214static inline void cipso_v4_error(struct sk_buff *skb, 224static inline void cipso_v4_error(struct sk_buff *skb,
215 int error, 225 int error,
@@ -225,19 +235,36 @@ static inline int cipso_v4_sock_setattr(struct sock *sk,
225 return -ENOSYS; 235 return -ENOSYS;
226} 236}
227 237
238static inline void cipso_v4_sock_delattr(struct sock *sk)
239{
240}
241
228static inline int cipso_v4_sock_getattr(struct sock *sk, 242static inline int cipso_v4_sock_getattr(struct sock *sk,
229 struct netlbl_lsm_secattr *secattr) 243 struct netlbl_lsm_secattr *secattr)
230{ 244{
231 return -ENOSYS; 245 return -ENOSYS;
232} 246}
233 247
248static inline int cipso_v4_skbuff_setattr(struct sk_buff *skb,
249 const struct cipso_v4_doi *doi_def,
250 const struct netlbl_lsm_secattr *secattr)
251{
252 return -ENOSYS;
253}
254
255static inline int cipso_v4_skbuff_delattr(struct sk_buff *skb)
256{
257 return -ENOSYS;
258}
259
234static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 260static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
235 struct netlbl_lsm_secattr *secattr) 261 struct netlbl_lsm_secattr *secattr)
236{ 262{
237 return -ENOSYS; 263 return -ENOSYS;
238} 264}
239 265
240static inline int cipso_v4_validate(unsigned char **option) 266static inline int cipso_v4_validate(const struct sk_buff *skb,
267 unsigned char **option)
241{ 268{
242 return -ENOSYS; 269 return -ENOSYS;
243} 270}
diff --git a/include/net/dsa.h b/include/net/dsa.h
new file mode 100644
index 000000000000..52e97bfca5a1
--- /dev/null
+++ b/include/net/dsa.h
@@ -0,0 +1,37 @@
1/*
2 * include/net/dsa.h - Driver for Distributed Switch Architecture switch chips
3 * Copyright (c) 2008 Marvell Semiconductor
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#ifndef __LINUX_NET_DSA_H
12#define __LINUX_NET_DSA_H
13
14#define DSA_MAX_PORTS 12
15
16struct dsa_platform_data {
17 /*
18 * Reference to a Linux network interface that connects
19 * to the switch chip.
20 */
21 struct device *netdev;
22
23 /*
24 * How to access the switch configuration registers, and
25 * the names of the switch ports (use "cpu" to designate
26 * the switch port that the cpu is connected to).
27 */
28 struct device *mii_bus;
29 int sw_addr;
30 char *port_names[DSA_MAX_PORTS];
31};
32
33extern bool dsa_uses_dsa_tags(void *dsa_ptr);
34extern bool dsa_uses_trailer_tags(void *dsa_ptr);
35
36
37#endif
diff --git a/include/net/flow.h b/include/net/flow.h
index 228b2477ceec..b45a5e4fcadd 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -47,6 +47,8 @@ struct flowi {
47#define fl4_scope nl_u.ip4_u.scope 47#define fl4_scope nl_u.ip4_u.scope
48 48
49 __u8 proto; 49 __u8 proto;
50 __u8 flags;
51#define FLOWI_FLAG_ANYSRC 0x01
50 union { 52 union {
51 struct { 53 struct {
52 __be16 sport; 54 __be16 sport;
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index b31399e1fd83..93a56de3594b 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -114,7 +114,7 @@ extern u32 ieee80211_debug_level;
114#define IEEE80211_DEBUG(level, fmt, args...) \ 114#define IEEE80211_DEBUG(level, fmt, args...) \
115do { if (ieee80211_debug_level & (level)) \ 115do { if (ieee80211_debug_level & (level)) \
116 printk(KERN_DEBUG "ieee80211: %c %s " fmt, \ 116 printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
117 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) 117 in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)
118static inline bool ieee80211_ratelimit_debug(u32 level) 118static inline bool ieee80211_ratelimit_debug(u32 level)
119{ 119{
120 return (ieee80211_debug_level & level) && net_ratelimit(); 120 return (ieee80211_debug_level & level) && net_ratelimit();
@@ -190,10 +190,6 @@ const char *escape_essid(const char *essid, u8 essid_len);
190#endif 190#endif
191#include <net/iw_handler.h> /* new driver API */ 191#include <net/iw_handler.h> /* new driver API */
192 192
193#ifndef ETH_P_PAE
194#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
195#endif /* ETH_P_PAE */
196
197#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ 193#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
198 194
199#ifndef ETH_P_80211_RAW 195#ifndef ETH_P_80211_RAW
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index e48989f04c24..f74665d7bea8 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -91,6 +91,21 @@ static inline struct sock *__inet6_lookup(struct net *net,
91 return inet6_lookup_listener(net, hashinfo, daddr, hnum, dif); 91 return inet6_lookup_listener(net, hashinfo, daddr, hnum, dif);
92} 92}
93 93
94static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo,
95 struct sk_buff *skb,
96 const __be16 sport,
97 const __be16 dport)
98{
99 struct sock *sk;
100
101 if (unlikely(sk = skb_steal_sock(skb)))
102 return sk;
103 else return __inet6_lookup(dev_net(skb->dst->dev), hashinfo,
104 &ipv6_hdr(skb)->saddr, sport,
105 &ipv6_hdr(skb)->daddr, ntohs(dport),
106 inet6_iif(skb));
107}
108
94extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, 109extern struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo,
95 const struct in6_addr *saddr, const __be16 sport, 110 const struct in6_addr *saddr, const __be16 sport,
96 const struct in6_addr *daddr, const __be16 dport, 111 const struct in6_addr *daddr, const __be16 dport,
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 2ff545a56fb5..03cffd9f64e3 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -51,12 +51,14 @@ struct inet_connection_sock_af_ops {
51 char __user *optval, int optlen); 51 char __user *optval, int optlen);
52 int (*getsockopt)(struct sock *sk, int level, int optname, 52 int (*getsockopt)(struct sock *sk, int level, int optname,
53 char __user *optval, int __user *optlen); 53 char __user *optval, int __user *optlen);
54#ifdef CONFIG_COMPAT
54 int (*compat_setsockopt)(struct sock *sk, 55 int (*compat_setsockopt)(struct sock *sk,
55 int level, int optname, 56 int level, int optname,
56 char __user *optval, int optlen); 57 char __user *optval, int optlen);
57 int (*compat_getsockopt)(struct sock *sk, 58 int (*compat_getsockopt)(struct sock *sk,
58 int level, int optname, 59 int level, int optname,
59 char __user *optval, int __user *optlen); 60 char __user *optval, int __user *optlen);
61#endif
60 void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); 62 void (*addr2sockaddr)(struct sock *sk, struct sockaddr *);
61 int (*bind_conflict)(const struct sock *sk, 63 int (*bind_conflict)(const struct sock *sk,
62 const struct inet_bind_bucket *tb); 64 const struct inet_bind_bucket *tb);
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index bb619d80f2e2..5cc182f9ecae 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -16,6 +16,7 @@
16 16
17 17
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/ip.h>
19#include <linux/ipv6.h> 20#include <linux/ipv6.h>
20#include <linux/list.h> 21#include <linux/list.h>
21#include <linux/slab.h> 22#include <linux/slab.h>
@@ -28,6 +29,7 @@
28#include <net/inet_connection_sock.h> 29#include <net/inet_connection_sock.h>
29#include <net/inet_sock.h> 30#include <net/inet_sock.h>
30#include <net/sock.h> 31#include <net/sock.h>
32#include <net/route.h>
31#include <net/tcp_states.h> 33#include <net/tcp_states.h>
32#include <net/netns/hash.h> 34#include <net/netns/hash.h>
33 35
@@ -371,6 +373,22 @@ static inline struct sock *inet_lookup(struct net *net,
371 return sk; 373 return sk;
372} 374}
373 375
376static inline struct sock *__inet_lookup_skb(struct inet_hashinfo *hashinfo,
377 struct sk_buff *skb,
378 const __be16 sport,
379 const __be16 dport)
380{
381 struct sock *sk;
382 const struct iphdr *iph = ip_hdr(skb);
383
384 if (unlikely(sk = skb_steal_sock(skb)))
385 return sk;
386 else
387 return __inet_lookup(dev_net(skb->dst->dev), hashinfo,
388 iph->saddr, sport,
389 iph->daddr, dport, inet_iif(skb));
390}
391
374extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, 392extern int __inet_hash_connect(struct inet_timewait_death_row *death_row,
375 struct sock *sk, u32 port_offset, 393 struct sock *sk, u32 port_offset,
376 int (*check_established)(struct inet_timewait_death_row *, 394 int (*check_established)(struct inet_timewait_death_row *,
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 643e26be058e..de0ecc71cf03 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -24,7 +24,6 @@
24#include <net/flow.h> 24#include <net/flow.h>
25#include <net/sock.h> 25#include <net/sock.h>
26#include <net/request_sock.h> 26#include <net/request_sock.h>
27#include <net/route.h>
28#include <net/netns/hash.h> 27#include <net/netns/hash.h>
29 28
30/** struct ip_options - IP Options 29/** struct ip_options - IP Options
@@ -62,8 +61,8 @@ struct inet_request_sock {
62 struct request_sock req; 61 struct request_sock req;
63#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 62#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
64 u16 inet6_rsk_offset; 63 u16 inet6_rsk_offset;
65 /* 2 bytes hole, try to pack */
66#endif 64#endif
65 __be16 loc_port;
67 __be32 loc_addr; 66 __be32 loc_addr;
68 __be32 rmt_addr; 67 __be32 rmt_addr;
69 __be16 rmt_port; 68 __be16 rmt_port;
@@ -73,7 +72,8 @@ struct inet_request_sock {
73 sack_ok : 1, 72 sack_ok : 1,
74 wscale_ok : 1, 73 wscale_ok : 1,
75 ecn_ok : 1, 74 ecn_ok : 1,
76 acked : 1; 75 acked : 1,
76 no_srccheck: 1;
77 struct ip_options *opt; 77 struct ip_options *opt;
78}; 78};
79 79
@@ -129,7 +129,8 @@ struct inet_sock {
129 is_icsk:1, 129 is_icsk:1,
130 freebind:1, 130 freebind:1,
131 hdrincl:1, 131 hdrincl:1,
132 mc_loop:1; 132 mc_loop:1,
133 transparent:1;
133 int mc_index; 134 int mc_index;
134 __be32 mc_addr; 135 __be32 mc_addr;
135 struct ip_mc_socklist *mc_list; 136 struct ip_mc_socklist *mc_list;
@@ -194,12 +195,6 @@ static inline int inet_sk_ehashfn(const struct sock *sk)
194 return inet_ehashfn(net, laddr, lport, faddr, fport); 195 return inet_ehashfn(net, laddr, lport, faddr, fport);
195} 196}
196 197
197
198static inline int inet_iif(const struct sk_buff *skb)
199{
200 return skb->rtable->rt_iif;
201}
202
203static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops) 198static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops)
204{ 199{
205 struct request_sock *req = reqsk_alloc(ops); 200 struct request_sock *req = reqsk_alloc(ops);
@@ -210,4 +205,9 @@ static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops
210 return req; 205 return req;
211} 206}
212 207
208static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
209{
210 return inet_sk(sk)->transparent ? FLOWI_FLAG_ANYSRC : 0;
211}
212
213#endif /* _INET_SOCK_H */ 213#endif /* _INET_SOCK_H */
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 95c660c9719b..80e4977631b8 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -128,7 +128,8 @@ struct inet_timewait_sock {
128 __be16 tw_dport; 128 __be16 tw_dport;
129 __u16 tw_num; 129 __u16 tw_num;
130 /* And these are ours. */ 130 /* And these are ours. */
131 __u8 tw_ipv6only:1; 131 __u8 tw_ipv6only:1,
132 tw_transparent:1;
132 /* 15 bits hole, try to pack */ 133 /* 15 bits hole, try to pack */
133 __u16 tw_ipv6_offset; 134 __u16 tw_ipv6_offset;
134 unsigned long tw_ttd; 135 unsigned long tw_ttd;
@@ -208,6 +209,9 @@ extern void inet_twsk_schedule(struct inet_timewait_sock *tw,
208extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, 209extern void inet_twsk_deschedule(struct inet_timewait_sock *tw,
209 struct inet_timewait_death_row *twdr); 210 struct inet_timewait_death_row *twdr);
210 211
212extern void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo,
213 struct inet_timewait_death_row *twdr, int family);
214
211static inline 215static inline
212struct net *twsk_net(const struct inet_timewait_sock *twsk) 216struct net *twsk_net(const struct inet_timewait_sock *twsk)
213{ 217{
diff --git a/include/net/ip.h b/include/net/ip.h
index 250e6ef025a4..bc026ecb513f 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -29,6 +29,7 @@
29 29
30#include <net/inet_sock.h> 30#include <net/inet_sock.h>
31#include <net/snmp.h> 31#include <net/snmp.h>
32#include <net/flow.h>
32 33
33struct sock; 34struct sock;
34 35
@@ -140,12 +141,20 @@ static inline void ip_tr_mc_map(__be32 addr, char *buf)
140 141
141struct ip_reply_arg { 142struct ip_reply_arg {
142 struct kvec iov[1]; 143 struct kvec iov[1];
144 int flags;
143 __wsum csum; 145 __wsum csum;
144 int csumoffset; /* u16 offset of csum in iov[0].iov_base */ 146 int csumoffset; /* u16 offset of csum in iov[0].iov_base */
145 /* -1 if not needed */ 147 /* -1 if not needed */
146 int bound_dev_if; 148 int bound_dev_if;
147}; 149};
148 150
151#define IP_REPLY_ARG_NOSRCCHECK 1
152
153static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
154{
155 return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0;
156}
157
149void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, 158void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
150 unsigned int len); 159 unsigned int len);
151 160
@@ -169,6 +178,10 @@ extern unsigned long snmp_fold_field(void *mib[], int offt);
169extern int snmp_mib_init(void *ptr[2], size_t mibsize); 178extern int snmp_mib_init(void *ptr[2], size_t mibsize);
170extern void snmp_mib_free(void *ptr[2]); 179extern void snmp_mib_free(void *ptr[2]);
171 180
181extern struct local_ports {
182 seqlock_t lock;
183 int range[2];
184} sysctl_local_ports;
172extern void inet_get_local_port_range(int *low, int *high); 185extern void inet_get_local_port_range(int *low, int *high);
173 186
174extern int sysctl_ip_default_ttl; 187extern int sysctl_ip_default_ttl;
@@ -383,7 +396,7 @@ extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
383int ipv4_doint_and_flush(ctl_table *ctl, int write, 396int ipv4_doint_and_flush(ctl_table *ctl, int write,
384 struct file* filp, void __user *buffer, 397 struct file* filp, void __user *buffer,
385 size_t *lenp, loff_t *ppos); 398 size_t *lenp, loff_t *ppos);
386int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, 399int ipv4_doint_and_flush_strategy(ctl_table *table,
387 void __user *oldval, size_t __user *oldlenp, 400 void __user *oldval, size_t __user *oldlenp,
388 void __user *newval, size_t newlen); 401 void __user *newval, size_t newlen);
389#ifdef CONFIG_PROC_FS 402#ifdef CONFIG_PROC_FS
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 7312c3dd309f..fe9fcf73c85e 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -21,11 +21,104 @@
21#include <linux/timer.h> 21#include <linux/timer.h>
22 22
23#include <net/checksum.h> 23#include <net/checksum.h>
24#include <linux/netfilter.h> /* for union nf_inet_addr */
25#include <linux/ip.h>
26#include <linux/ipv6.h> /* for struct ipv6hdr */
27#include <net/ipv6.h> /* for ipv6_addr_copy */
28
29struct ip_vs_iphdr {
30 int len;
31 __u8 protocol;
32 union nf_inet_addr saddr;
33 union nf_inet_addr daddr;
34};
35
36static inline void
37ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr)
38{
39#ifdef CONFIG_IP_VS_IPV6
40 if (af == AF_INET6) {
41 const struct ipv6hdr *iph = nh;
42 iphdr->len = sizeof(struct ipv6hdr);
43 iphdr->protocol = iph->nexthdr;
44 ipv6_addr_copy(&iphdr->saddr.in6, &iph->saddr);
45 ipv6_addr_copy(&iphdr->daddr.in6, &iph->daddr);
46 } else
47#endif
48 {
49 const struct iphdr *iph = nh;
50 iphdr->len = iph->ihl * 4;
51 iphdr->protocol = iph->protocol;
52 iphdr->saddr.ip = iph->saddr;
53 iphdr->daddr.ip = iph->daddr;
54 }
55}
56
57static inline void ip_vs_addr_copy(int af, union nf_inet_addr *dst,
58 const union nf_inet_addr *src)
59{
60#ifdef CONFIG_IP_VS_IPV6
61 if (af == AF_INET6)
62 ipv6_addr_copy(&dst->in6, &src->in6);
63 else
64#endif
65 dst->ip = src->ip;
66}
67
68static inline int ip_vs_addr_equal(int af, const union nf_inet_addr *a,
69 const union nf_inet_addr *b)
70{
71#ifdef CONFIG_IP_VS_IPV6
72 if (af == AF_INET6)
73 return ipv6_addr_equal(&a->in6, &b->in6);
74#endif
75 return a->ip == b->ip;
76}
24 77
25#ifdef CONFIG_IP_VS_DEBUG 78#ifdef CONFIG_IP_VS_DEBUG
26#include <linux/net.h> 79#include <linux/net.h>
27 80
28extern int ip_vs_get_debug_level(void); 81extern int ip_vs_get_debug_level(void);
82
83static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
84 const union nf_inet_addr *addr,
85 int *idx)
86{
87 int len;
88#ifdef CONFIG_IP_VS_IPV6
89 if (af == AF_INET6)
90 len = snprintf(&buf[*idx], buf_len - *idx, "[" NIP6_FMT "]",
91 NIP6(addr->in6)) + 1;
92 else
93#endif
94 len = snprintf(&buf[*idx], buf_len - *idx, NIPQUAD_FMT,
95 NIPQUAD(addr->ip)) + 1;
96
97 *idx += len;
98 BUG_ON(*idx > buf_len + 1);
99 return &buf[*idx - len];
100}
101
102#define IP_VS_DBG_BUF(level, msg...) \
103 do { \
104 char ip_vs_dbg_buf[160]; \
105 int ip_vs_dbg_idx = 0; \
106 if (level <= ip_vs_get_debug_level()) \
107 printk(KERN_DEBUG "IPVS: " msg); \
108 } while (0)
109#define IP_VS_ERR_BUF(msg...) \
110 do { \
111 char ip_vs_dbg_buf[160]; \
112 int ip_vs_dbg_idx = 0; \
113 printk(KERN_ERR "IPVS: " msg); \
114 } while (0)
115
116/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */
117#define IP_VS_DBG_ADDR(af, addr) \
118 ip_vs_dbg_addr(af, ip_vs_dbg_buf, \
119 sizeof(ip_vs_dbg_buf), addr, \
120 &ip_vs_dbg_idx)
121
29#define IP_VS_DBG(level, msg...) \ 122#define IP_VS_DBG(level, msg...) \
30 do { \ 123 do { \
31 if (level <= ip_vs_get_debug_level()) \ 124 if (level <= ip_vs_get_debug_level()) \
@@ -48,6 +141,8 @@ extern int ip_vs_get_debug_level(void);
48 pp->debug_packet(pp, skb, ofs, msg); \ 141 pp->debug_packet(pp, skb, ofs, msg); \
49 } while (0) 142 } while (0)
50#else /* NO DEBUGGING at ALL */ 143#else /* NO DEBUGGING at ALL */
144#define IP_VS_DBG_BUF(level, msg...) do {} while (0)
145#define IP_VS_ERR_BUF(msg...) do {} while (0)
51#define IP_VS_DBG(level, msg...) do {} while (0) 146#define IP_VS_DBG(level, msg...) do {} while (0)
52#define IP_VS_DBG_RL(msg...) do {} while (0) 147#define IP_VS_DBG_RL(msg...) do {} while (0)
53#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) do {} while (0) 148#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) do {} while (0)
@@ -70,13 +165,13 @@ extern int ip_vs_get_debug_level(void);
70 do { \ 165 do { \
71 if (level <= ip_vs_get_debug_level()) \ 166 if (level <= ip_vs_get_debug_level()) \
72 printk(KERN_DEBUG "Enter: %s, %s line %i\n", \ 167 printk(KERN_DEBUG "Enter: %s, %s line %i\n", \
73 __FUNCTION__, __FILE__, __LINE__); \ 168 __func__, __FILE__, __LINE__); \
74 } while (0) 169 } while (0)
75#define LeaveFunction(level) \ 170#define LeaveFunction(level) \
76 do { \ 171 do { \
77 if (level <= ip_vs_get_debug_level()) \ 172 if (level <= ip_vs_get_debug_level()) \
78 printk(KERN_DEBUG "Leave: %s, %s line %i\n", \ 173 printk(KERN_DEBUG "Leave: %s, %s line %i\n", \
79 __FUNCTION__, __FILE__, __LINE__); \ 174 __func__, __FILE__, __LINE__); \
80 } while (0) 175 } while (0)
81#else 176#else
82#define EnterFunction(level) do {} while (0) 177#define EnterFunction(level) do {} while (0)
@@ -160,27 +255,10 @@ struct ip_vs_estimator {
160 255
161struct ip_vs_stats 256struct ip_vs_stats
162{ 257{
163 __u32 conns; /* connections scheduled */ 258 struct ip_vs_stats_user ustats; /* statistics */
164 __u32 inpkts; /* incoming packets */ 259 struct ip_vs_estimator est; /* estimator */
165 __u32 outpkts; /* outgoing packets */
166 __u64 inbytes; /* incoming bytes */
167 __u64 outbytes; /* outgoing bytes */
168
169 __u32 cps; /* current connection rate */
170 __u32 inpps; /* current in packet rate */
171 __u32 outpps; /* current out packet rate */
172 __u32 inbps; /* current in byte rate */
173 __u32 outbps; /* current out byte rate */
174
175 /*
176 * Don't add anything before the lock, because we use memcpy() to copy
177 * the members before the lock to struct ip_vs_stats_user in
178 * ip_vs_ctl.c.
179 */
180 260
181 spinlock_t lock; /* spin lock */ 261 spinlock_t lock; /* spin lock */
182
183 struct ip_vs_estimator est; /* estimator */
184}; 262};
185 263
186struct dst_entry; 264struct dst_entry;
@@ -202,21 +280,23 @@ struct ip_vs_protocol {
202 280
203 void (*exit)(struct ip_vs_protocol *pp); 281 void (*exit)(struct ip_vs_protocol *pp);
204 282
205 int (*conn_schedule)(struct sk_buff *skb, 283 int (*conn_schedule)(int af, struct sk_buff *skb,
206 struct ip_vs_protocol *pp, 284 struct ip_vs_protocol *pp,
207 int *verdict, struct ip_vs_conn **cpp); 285 int *verdict, struct ip_vs_conn **cpp);
208 286
209 struct ip_vs_conn * 287 struct ip_vs_conn *
210 (*conn_in_get)(const struct sk_buff *skb, 288 (*conn_in_get)(int af,
289 const struct sk_buff *skb,
211 struct ip_vs_protocol *pp, 290 struct ip_vs_protocol *pp,
212 const struct iphdr *iph, 291 const struct ip_vs_iphdr *iph,
213 unsigned int proto_off, 292 unsigned int proto_off,
214 int inverse); 293 int inverse);
215 294
216 struct ip_vs_conn * 295 struct ip_vs_conn *
217 (*conn_out_get)(const struct sk_buff *skb, 296 (*conn_out_get)(int af,
297 const struct sk_buff *skb,
218 struct ip_vs_protocol *pp, 298 struct ip_vs_protocol *pp,
219 const struct iphdr *iph, 299 const struct ip_vs_iphdr *iph,
220 unsigned int proto_off, 300 unsigned int proto_off,
221 int inverse); 301 int inverse);
222 302
@@ -226,7 +306,8 @@ struct ip_vs_protocol {
226 int (*dnat_handler)(struct sk_buff *skb, 306 int (*dnat_handler)(struct sk_buff *skb,
227 struct ip_vs_protocol *pp, struct ip_vs_conn *cp); 307 struct ip_vs_protocol *pp, struct ip_vs_conn *cp);
228 308
229 int (*csum_check)(struct sk_buff *skb, struct ip_vs_protocol *pp); 309 int (*csum_check)(int af, struct sk_buff *skb,
310 struct ip_vs_protocol *pp);
230 311
231 const char *(*state_name)(int state); 312 const char *(*state_name)(int state);
232 313
@@ -259,9 +340,10 @@ struct ip_vs_conn {
259 struct list_head c_list; /* hashed list heads */ 340 struct list_head c_list; /* hashed list heads */
260 341
261 /* Protocol, addresses and port numbers */ 342 /* Protocol, addresses and port numbers */
262 __be32 caddr; /* client address */ 343 u16 af; /* address family */
263 __be32 vaddr; /* virtual address */ 344 union nf_inet_addr caddr; /* client address */
264 __be32 daddr; /* destination address */ 345 union nf_inet_addr vaddr; /* virtual address */
346 union nf_inet_addr daddr; /* destination address */
265 __be16 cport; 347 __be16 cport;
266 __be16 vport; 348 __be16 vport;
267 __be16 dport; 349 __be16 dport;
@@ -305,6 +387,45 @@ struct ip_vs_conn {
305 387
306 388
307/* 389/*
390 * Extended internal versions of struct ip_vs_service_user and
391 * ip_vs_dest_user for IPv6 support.
392 *
393 * We need these to conveniently pass around service and destination
394 * options, but unfortunately, we also need to keep the old definitions to
395 * maintain userspace backwards compatibility for the setsockopt interface.
396 */
397struct ip_vs_service_user_kern {
398 /* virtual service addresses */
399 u16 af;
400 u16 protocol;
401 union nf_inet_addr addr; /* virtual ip address */
402 u16 port;
403 u32 fwmark; /* firwall mark of service */
404
405 /* virtual service options */
406 char *sched_name;
407 unsigned flags; /* virtual service flags */
408 unsigned timeout; /* persistent timeout in sec */
409 u32 netmask; /* persistent netmask */
410};
411
412
413struct ip_vs_dest_user_kern {
414 /* destination server address */
415 union nf_inet_addr addr;
416 u16 port;
417
418 /* real server options */
419 unsigned conn_flags; /* connection flags */
420 int weight; /* destination weight */
421
422 /* thresholds for active connections */
423 u32 u_threshold; /* upper threshold */
424 u32 l_threshold; /* lower threshold */
425};
426
427
428/*
308 * The information about the virtual service offered to the net 429 * The information about the virtual service offered to the net
309 * and the forwarding entries 430 * and the forwarding entries
310 */ 431 */
@@ -314,8 +435,9 @@ struct ip_vs_service {
314 atomic_t refcnt; /* reference counter */ 435 atomic_t refcnt; /* reference counter */
315 atomic_t usecnt; /* use counter */ 436 atomic_t usecnt; /* use counter */
316 437
438 u16 af; /* address family */
317 __u16 protocol; /* which protocol (TCP/UDP) */ 439 __u16 protocol; /* which protocol (TCP/UDP) */
318 __be32 addr; /* IP address for virtual service */ 440 union nf_inet_addr addr; /* IP address for virtual service */
319 __be16 port; /* port number for the service */ 441 __be16 port; /* port number for the service */
320 __u32 fwmark; /* firewall mark of the service */ 442 __u32 fwmark; /* firewall mark of the service */
321 unsigned flags; /* service status flags */ 443 unsigned flags; /* service status flags */
@@ -342,7 +464,8 @@ struct ip_vs_dest {
342 struct list_head n_list; /* for the dests in the service */ 464 struct list_head n_list; /* for the dests in the service */
343 struct list_head d_list; /* for table with all the dests */ 465 struct list_head d_list; /* for table with all the dests */
344 466
345 __be32 addr; /* IP address of the server */ 467 u16 af; /* address family */
468 union nf_inet_addr addr; /* IP address of the server */
346 __be16 port; /* port number of the server */ 469 __be16 port; /* port number of the server */
347 volatile unsigned flags; /* dest status flags */ 470 volatile unsigned flags; /* dest status flags */
348 atomic_t conn_flags; /* flags to copy to conn */ 471 atomic_t conn_flags; /* flags to copy to conn */
@@ -366,7 +489,7 @@ struct ip_vs_dest {
366 /* for virtual service */ 489 /* for virtual service */
367 struct ip_vs_service *svc; /* service it belongs to */ 490 struct ip_vs_service *svc; /* service it belongs to */
368 __u16 protocol; /* which protocol (TCP/UDP) */ 491 __u16 protocol; /* which protocol (TCP/UDP) */
369 __be32 vaddr; /* virtual IP address */ 492 union nf_inet_addr vaddr; /* virtual IP address */
370 __be16 vport; /* virtual port number */ 493 __be16 vport; /* virtual port number */
371 __u32 vfwmark; /* firewall mark of service */ 494 __u32 vfwmark; /* firewall mark of service */
372}; 495};
@@ -380,6 +503,9 @@ struct ip_vs_scheduler {
380 char *name; /* scheduler name */ 503 char *name; /* scheduler name */
381 atomic_t refcnt; /* reference counter */ 504 atomic_t refcnt; /* reference counter */
382 struct module *module; /* THIS_MODULE/NULL */ 505 struct module *module; /* THIS_MODULE/NULL */
506#ifdef CONFIG_IP_VS_IPV6
507 int supports_ipv6; /* scheduler has IPv6 support */
508#endif
383 509
384 /* scheduler initializing service */ 510 /* scheduler initializing service */
385 int (*init_service)(struct ip_vs_service *svc); 511 int (*init_service)(struct ip_vs_service *svc);
@@ -479,16 +605,8 @@ extern void ip_vs_init_hash_table(struct list_head *table, int rows);
479#ifndef CONFIG_IP_VS_TAB_BITS 605#ifndef CONFIG_IP_VS_TAB_BITS
480#define CONFIG_IP_VS_TAB_BITS 12 606#define CONFIG_IP_VS_TAB_BITS 12
481#endif 607#endif
482/* make sure that IP_VS_CONN_TAB_BITS is located in [8, 20] */ 608
483#if CONFIG_IP_VS_TAB_BITS < 8
484#define IP_VS_CONN_TAB_BITS 8
485#endif
486#if CONFIG_IP_VS_TAB_BITS > 20
487#define IP_VS_CONN_TAB_BITS 20
488#endif
489#if 8 <= CONFIG_IP_VS_TAB_BITS && CONFIG_IP_VS_TAB_BITS <= 20
490#define IP_VS_CONN_TAB_BITS CONFIG_IP_VS_TAB_BITS 609#define IP_VS_CONN_TAB_BITS CONFIG_IP_VS_TAB_BITS
491#endif
492#define IP_VS_CONN_TAB_SIZE (1 << IP_VS_CONN_TAB_BITS) 610#define IP_VS_CONN_TAB_SIZE (1 << IP_VS_CONN_TAB_BITS)
493#define IP_VS_CONN_TAB_MASK (IP_VS_CONN_TAB_SIZE - 1) 611#define IP_VS_CONN_TAB_MASK (IP_VS_CONN_TAB_SIZE - 1)
494 612
@@ -500,11 +618,16 @@ enum {
500}; 618};
501 619
502extern struct ip_vs_conn *ip_vs_conn_in_get 620extern struct ip_vs_conn *ip_vs_conn_in_get
503(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port); 621(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
622 const union nf_inet_addr *d_addr, __be16 d_port);
623
504extern struct ip_vs_conn *ip_vs_ct_in_get 624extern struct ip_vs_conn *ip_vs_ct_in_get
505(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port); 625(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
626 const union nf_inet_addr *d_addr, __be16 d_port);
627
506extern struct ip_vs_conn *ip_vs_conn_out_get 628extern struct ip_vs_conn *ip_vs_conn_out_get
507(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port); 629(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
630 const union nf_inet_addr *d_addr, __be16 d_port);
508 631
509/* put back the conn without restarting its timer */ 632/* put back the conn without restarting its timer */
510static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) 633static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
@@ -515,8 +638,9 @@ extern void ip_vs_conn_put(struct ip_vs_conn *cp);
515extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); 638extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport);
516 639
517extern struct ip_vs_conn * 640extern struct ip_vs_conn *
518ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport, 641ip_vs_conn_new(int af, int proto, const union nf_inet_addr *caddr, __be16 cport,
519 __be32 daddr, __be16 dport, unsigned flags, 642 const union nf_inet_addr *vaddr, __be16 vport,
643 const union nf_inet_addr *daddr, __be16 dport, unsigned flags,
520 struct ip_vs_dest *dest); 644 struct ip_vs_dest *dest);
521extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); 645extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
522 646
@@ -532,24 +656,32 @@ static inline void ip_vs_control_del(struct ip_vs_conn *cp)
532{ 656{
533 struct ip_vs_conn *ctl_cp = cp->control; 657 struct ip_vs_conn *ctl_cp = cp->control;
534 if (!ctl_cp) { 658 if (!ctl_cp) {
535 IP_VS_ERR("request control DEL for uncontrolled: " 659 IP_VS_ERR_BUF("request control DEL for uncontrolled: "
536 "%d.%d.%d.%d:%d to %d.%d.%d.%d:%d\n", 660 "%s:%d to %s:%d\n",
537 NIPQUAD(cp->caddr),ntohs(cp->cport), 661 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
538 NIPQUAD(cp->vaddr),ntohs(cp->vport)); 662 ntohs(cp->cport),
663 IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
664 ntohs(cp->vport));
665
539 return; 666 return;
540 } 667 }
541 668
542 IP_VS_DBG(7, "DELeting control for: " 669 IP_VS_DBG_BUF(7, "DELeting control for: "
543 "cp.dst=%d.%d.%d.%d:%d ctl_cp.dst=%d.%d.%d.%d:%d\n", 670 "cp.dst=%s:%d ctl_cp.dst=%s:%d\n",
544 NIPQUAD(cp->caddr),ntohs(cp->cport), 671 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
545 NIPQUAD(ctl_cp->caddr),ntohs(ctl_cp->cport)); 672 ntohs(cp->cport),
673 IP_VS_DBG_ADDR(cp->af, &ctl_cp->caddr),
674 ntohs(ctl_cp->cport));
546 675
547 cp->control = NULL; 676 cp->control = NULL;
548 if (atomic_read(&ctl_cp->n_control) == 0) { 677 if (atomic_read(&ctl_cp->n_control) == 0) {
549 IP_VS_ERR("BUG control DEL with n=0 : " 678 IP_VS_ERR_BUF("BUG control DEL with n=0 : "
550 "%d.%d.%d.%d:%d to %d.%d.%d.%d:%d\n", 679 "%s:%d to %s:%d\n",
551 NIPQUAD(cp->caddr),ntohs(cp->cport), 680 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
552 NIPQUAD(cp->vaddr),ntohs(cp->vport)); 681 ntohs(cp->cport),
682 IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
683 ntohs(cp->vport));
684
553 return; 685 return;
554 } 686 }
555 atomic_dec(&ctl_cp->n_control); 687 atomic_dec(&ctl_cp->n_control);
@@ -559,17 +691,22 @@ static inline void
559ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp) 691ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp)
560{ 692{
561 if (cp->control) { 693 if (cp->control) {
562 IP_VS_ERR("request control ADD for already controlled: " 694 IP_VS_ERR_BUF("request control ADD for already controlled: "
563 "%d.%d.%d.%d:%d to %d.%d.%d.%d:%d\n", 695 "%s:%d to %s:%d\n",
564 NIPQUAD(cp->caddr),ntohs(cp->cport), 696 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
565 NIPQUAD(cp->vaddr),ntohs(cp->vport)); 697 ntohs(cp->cport),
698 IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
699 ntohs(cp->vport));
700
566 ip_vs_control_del(cp); 701 ip_vs_control_del(cp);
567 } 702 }
568 703
569 IP_VS_DBG(7, "ADDing control for: " 704 IP_VS_DBG_BUF(7, "ADDing control for: "
570 "cp.dst=%d.%d.%d.%d:%d ctl_cp.dst=%d.%d.%d.%d:%d\n", 705 "cp.dst=%s:%d ctl_cp.dst=%s:%d\n",
571 NIPQUAD(cp->caddr),ntohs(cp->cport), 706 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
572 NIPQUAD(ctl_cp->caddr),ntohs(ctl_cp->cport)); 707 ntohs(cp->cport),
708 IP_VS_DBG_ADDR(cp->af, &ctl_cp->caddr),
709 ntohs(ctl_cp->cport));
573 710
574 cp->control = ctl_cp; 711 cp->control = ctl_cp;
575 atomic_inc(&ctl_cp->n_control); 712 atomic_inc(&ctl_cp->n_control);
@@ -647,7 +784,8 @@ extern struct ip_vs_stats ip_vs_stats;
647extern const struct ctl_path net_vs_ctl_path[]; 784extern const struct ctl_path net_vs_ctl_path[];
648 785
649extern struct ip_vs_service * 786extern struct ip_vs_service *
650ip_vs_service_get(__u32 fwmark, __u16 protocol, __be32 vaddr, __be16 vport); 787ip_vs_service_get(int af, __u32 fwmark, __u16 protocol,
788 const union nf_inet_addr *vaddr, __be16 vport);
651 789
652static inline void ip_vs_service_put(struct ip_vs_service *svc) 790static inline void ip_vs_service_put(struct ip_vs_service *svc)
653{ 791{
@@ -655,14 +793,16 @@ static inline void ip_vs_service_put(struct ip_vs_service *svc)
655} 793}
656 794
657extern struct ip_vs_dest * 795extern struct ip_vs_dest *
658ip_vs_lookup_real_service(__u16 protocol, __be32 daddr, __be16 dport); 796ip_vs_lookup_real_service(int af, __u16 protocol,
797 const union nf_inet_addr *daddr, __be16 dport);
798
659extern int ip_vs_use_count_inc(void); 799extern int ip_vs_use_count_inc(void);
660extern void ip_vs_use_count_dec(void); 800extern void ip_vs_use_count_dec(void);
661extern int ip_vs_control_init(void); 801extern int ip_vs_control_init(void);
662extern void ip_vs_control_cleanup(void); 802extern void ip_vs_control_cleanup(void);
663extern struct ip_vs_dest * 803extern struct ip_vs_dest *
664ip_vs_find_dest(__be32 daddr, __be16 dport, 804ip_vs_find_dest(int af, const union nf_inet_addr *daddr, __be16 dport,
665 __be32 vaddr, __be16 vport, __u16 protocol); 805 const union nf_inet_addr *vaddr, __be16 vport, __u16 protocol);
666extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); 806extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp);
667 807
668 808
@@ -683,6 +823,8 @@ extern void ip_vs_sync_conn(struct ip_vs_conn *cp);
683/* 823/*
684 * IPVS rate estimator prototypes (from ip_vs_est.c) 824 * IPVS rate estimator prototypes (from ip_vs_est.c)
685 */ 825 */
826extern int ip_vs_estimator_init(void);
827extern void ip_vs_estimator_cleanup(void);
686extern void ip_vs_new_estimator(struct ip_vs_stats *stats); 828extern void ip_vs_new_estimator(struct ip_vs_stats *stats);
687extern void ip_vs_kill_estimator(struct ip_vs_stats *stats); 829extern void ip_vs_kill_estimator(struct ip_vs_stats *stats);
688extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); 830extern void ip_vs_zero_estimator(struct ip_vs_stats *stats);
@@ -704,6 +846,19 @@ extern int ip_vs_icmp_xmit
704(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, int offset); 846(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, int offset);
705extern void ip_vs_dst_reset(struct ip_vs_dest *dest); 847extern void ip_vs_dst_reset(struct ip_vs_dest *dest);
706 848
849#ifdef CONFIG_IP_VS_IPV6
850extern int ip_vs_bypass_xmit_v6
851(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
852extern int ip_vs_nat_xmit_v6
853(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
854extern int ip_vs_tunnel_xmit_v6
855(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
856extern int ip_vs_dr_xmit_v6
857(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
858extern int ip_vs_icmp_xmit_v6
859(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp,
860 int offset);
861#endif
707 862
708/* 863/*
709 * This is a simple mechanism to ignore packets when 864 * This is a simple mechanism to ignore packets when
@@ -748,7 +903,12 @@ static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
748} 903}
749 904
750extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, 905extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
751 struct ip_vs_conn *cp, int dir); 906 struct ip_vs_conn *cp, int dir);
907
908#ifdef CONFIG_IP_VS_IPV6
909extern void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp,
910 struct ip_vs_conn *cp, int dir);
911#endif
752 912
753extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); 913extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
754 914
@@ -759,6 +919,17 @@ static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum)
759 return csum_partial((char *) diff, sizeof(diff), oldsum); 919 return csum_partial((char *) diff, sizeof(diff), oldsum);
760} 920}
761 921
922#ifdef CONFIG_IP_VS_IPV6
923static inline __wsum ip_vs_check_diff16(const __be32 *old, const __be32 *new,
924 __wsum oldsum)
925{
926 __be32 diff[8] = { ~old[3], ~old[2], ~old[1], ~old[0],
927 new[3], new[2], new[1], new[0] };
928
929 return csum_partial((char *) diff, sizeof(diff), oldsum);
930}
931#endif
932
762static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum) 933static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
763{ 934{
764 __be16 diff[2] = { ~old, new }; 935 __be16 diff[2] = { ~old, new };
diff --git a/include/net/ipip.h b/include/net/ipip.h
index a85bda64b852..fdf9bd743705 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -37,7 +37,7 @@ struct ip_tunnel_prl_entry
37 37
38#define IPTUNNEL_XMIT() do { \ 38#define IPTUNNEL_XMIT() do { \
39 int err; \ 39 int err; \
40 int pkt_len = skb->len; \ 40 int pkt_len = skb->len - skb_transport_offset(skb); \
41 \ 41 \
42 skb->ip_summed = CHECKSUM_NONE; \ 42 skb->ip_summed = CHECKSUM_NONE; \
43 ip_select_ident(iph, &rt->u.dst, NULL); \ 43 ip_select_ident(iph, &rt->u.dst, NULL); \
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 113028fb8f66..6d5b58a1c743 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -110,43 +110,42 @@ struct frag_hdr {
110extern int sysctl_mld_max_msf; 110extern int sysctl_mld_max_msf;
111extern struct ctl_path net_ipv6_ctl_path[]; 111extern struct ctl_path net_ipv6_ctl_path[];
112 112
113#define _DEVINC(statname, modifier, idev, field) \ 113#define _DEVINC(net, statname, modifier, idev, field) \
114({ \ 114({ \
115 struct inet6_dev *_idev = (idev); \ 115 struct inet6_dev *_idev = (idev); \
116 if (likely(_idev != NULL)) \ 116 if (likely(_idev != NULL)) \
117 SNMP_INC_STATS##modifier((_idev)->stats.statname, (field)); \ 117 SNMP_INC_STATS##modifier((_idev)->stats.statname, (field)); \
118 SNMP_INC_STATS##modifier(statname##_statistics, (field)); \ 118 SNMP_INC_STATS##modifier((net)->mib.statname##_statistics, (field));\
119}) 119})
120 120
121#define _DEVADD(statname, modifier, idev, field, val) \ 121#define _DEVADD(net, statname, modifier, idev, field, val) \
122({ \ 122({ \
123 struct inet6_dev *_idev = (idev); \ 123 struct inet6_dev *_idev = (idev); \
124 if (likely(_idev != NULL)) \ 124 if (likely(_idev != NULL)) \
125 SNMP_ADD_STATS##modifier((_idev)->stats.statname, (field), (val)); \ 125 SNMP_ADD_STATS##modifier((_idev)->stats.statname, (field), (val)); \
126 SNMP_ADD_STATS##modifier(statname##_statistics, (field), (val));\ 126 SNMP_ADD_STATS##modifier((net)->mib.statname##_statistics, (field), (val));\
127}) 127})
128 128
129/* MIBs */ 129/* MIBs */
130DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
131 130
132#define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field) 131#define IP6_INC_STATS(net, idev,field) \
133#define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field) 132 _DEVINC(net, ipv6, , idev, field)
134#define IP6_ADD_STATS_BH(idev,field,val) _DEVADD(ipv6, _BH, idev, field, val) 133#define IP6_INC_STATS_BH(net, idev,field) \
135 134 _DEVINC(net, ipv6, _BH, idev, field)
136DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); 135#define IP6_ADD_STATS_BH(net, idev,field,val) \
137DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); 136 _DEVADD(net, ipv6, _BH, idev, field, val)
138 137
139#define ICMP6_INC_STATS(idev, field) _DEVINC(icmpv6, , idev, field) 138#define ICMP6_INC_STATS(net, idev, field) \
140#define ICMP6_INC_STATS_BH(idev, field) _DEVINC(icmpv6, _BH, idev, field) 139 _DEVINC(net, icmpv6, , idev, field)
141 140#define ICMP6_INC_STATS_BH(net, idev, field) \
142#define ICMP6MSGOUT_INC_STATS(idev, field) \ 141 _DEVINC(net, icmpv6, _BH, idev, field)
143 _DEVINC(icmpv6msg, , idev, field +256) 142
144#define ICMP6MSGOUT_INC_STATS_BH(idev, field) \ 143#define ICMP6MSGOUT_INC_STATS(net, idev, field) \
145 _DEVINC(icmpv6msg, _BH, idev, field +256) 144 _DEVINC(net, icmpv6msg, , idev, field +256)
146#define ICMP6MSGIN_INC_STATS(idev, field) \ 145#define ICMP6MSGOUT_INC_STATS_BH(net, idev, field) \
147 _DEVINC(icmpv6msg, , idev, field) 146 _DEVINC(net, icmpv6msg, _BH, idev, field +256)
148#define ICMP6MSGIN_INC_STATS_BH(idev, field) \ 147#define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \
149 _DEVINC(icmpv6msg, _BH, idev, field) 148 _DEVINC(net, icmpv6msg, _BH, idev, field)
150 149
151struct ip6_ra_chain 150struct ip6_ra_chain
152{ 151{
@@ -576,6 +575,8 @@ extern int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf);
576extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, 575extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
577 struct group_filter __user *optval, 576 struct group_filter __user *optval,
578 int __user *optlen); 577 int __user *optlen);
578extern unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr,
579 const struct in6_addr *daddr, u32 rnd);
579 580
580#ifdef CONFIG_PROC_FS 581#ifdef CONFIG_PROC_FS
581extern int ac6_proc_init(struct net *net); 582extern int ac6_proc_init(struct net *net);
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 08387553b57e..7e582061b230 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -72,7 +72,7 @@ do { if (irda_debug >= (n)) \
72#define IRDA_ASSERT(expr, func) \ 72#define IRDA_ASSERT(expr, func) \
73do { if(!(expr)) { \ 73do { if(!(expr)) { \
74 printk( "Assertion failed! %s:%s:%d %s\n", \ 74 printk( "Assertion failed! %s:%s:%d %s\n", \
75 __FILE__,__FUNCTION__,__LINE__,(#expr) ); \ 75 __FILE__,__func__,__LINE__,(#expr) ); \
76 func } } while (0) 76 func } } while (0)
77#define IRDA_ASSERT_LABEL(label) label 77#define IRDA_ASSERT_LABEL(label) label
78#else 78#else
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ff137fd7714f..d861197f83c7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -158,13 +158,17 @@ struct ieee80211_low_level_stats {
158 * also implies a change in the AID. 158 * also implies a change in the AID.
159 * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed 159 * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed
160 * @BSS_CHANGED_ERP_PREAMBLE: preamble changed 160 * @BSS_CHANGED_ERP_PREAMBLE: preamble changed
161 * @BSS_CHANGED_ERP_SLOT: slot timing changed
161 * @BSS_CHANGED_HT: 802.11n parameters changed 162 * @BSS_CHANGED_HT: 802.11n parameters changed
163 * @BSS_CHANGED_BASIC_RATES: Basic rateset changed
162 */ 164 */
163enum ieee80211_bss_change { 165enum ieee80211_bss_change {
164 BSS_CHANGED_ASSOC = 1<<0, 166 BSS_CHANGED_ASSOC = 1<<0,
165 BSS_CHANGED_ERP_CTS_PROT = 1<<1, 167 BSS_CHANGED_ERP_CTS_PROT = 1<<1,
166 BSS_CHANGED_ERP_PREAMBLE = 1<<2, 168 BSS_CHANGED_ERP_PREAMBLE = 1<<2,
169 BSS_CHANGED_ERP_SLOT = 1<<3,
167 BSS_CHANGED_HT = 1<<4, 170 BSS_CHANGED_HT = 1<<4,
171 BSS_CHANGED_BASIC_RATES = 1<<5,
168}; 172};
169 173
170/** 174/**
@@ -177,6 +181,7 @@ enum ieee80211_bss_change {
177 * @aid: association ID number, valid only when @assoc is true 181 * @aid: association ID number, valid only when @assoc is true
178 * @use_cts_prot: use CTS protection 182 * @use_cts_prot: use CTS protection
179 * @use_short_preamble: use 802.11b short preamble 183 * @use_short_preamble: use 802.11b short preamble
184 * @use_short_slot: use short slot time (only relevant for ERP)
180 * @dtim_period: num of beacons before the next DTIM, for PSM 185 * @dtim_period: num of beacons before the next DTIM, for PSM
181 * @timestamp: beacon timestamp 186 * @timestamp: beacon timestamp
182 * @beacon_int: beacon interval 187 * @beacon_int: beacon interval
@@ -184,6 +189,9 @@ enum ieee80211_bss_change {
184 * @assoc_ht: association in HT mode 189 * @assoc_ht: association in HT mode
185 * @ht_conf: ht capabilities 190 * @ht_conf: ht capabilities
186 * @ht_bss_conf: ht extended capabilities 191 * @ht_bss_conf: ht extended capabilities
192 * @basic_rates: bitmap of basic rates, each bit stands for an
193 * index into the rate table configured by the driver in
194 * the current band.
187 */ 195 */
188struct ieee80211_bss_conf { 196struct ieee80211_bss_conf {
189 /* association related data */ 197 /* association related data */
@@ -192,10 +200,12 @@ struct ieee80211_bss_conf {
192 /* erp related data */ 200 /* erp related data */
193 bool use_cts_prot; 201 bool use_cts_prot;
194 bool use_short_preamble; 202 bool use_short_preamble;
203 bool use_short_slot;
195 u8 dtim_period; 204 u8 dtim_period;
196 u16 beacon_int; 205 u16 beacon_int;
197 u16 assoc_capability; 206 u16 assoc_capability;
198 u64 timestamp; 207 u64 timestamp;
208 u64 basic_rates;
199 /* ht related data */ 209 /* ht related data */
200 bool assoc_ht; 210 bool assoc_ht;
201 struct ieee80211_ht_info *ht_conf; 211 struct ieee80211_ht_info *ht_conf;
@@ -282,6 +292,20 @@ enum mac80211_tx_control_flags {
282#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \ 292#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
283 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)) 293 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
284 294
295/* maximum number of alternate rate retry stages */
296#define IEEE80211_TX_MAX_ALTRATE 3
297
298/**
299 * struct ieee80211_tx_altrate - alternate rate selection/status
300 *
301 * @rate_idx: rate index to attempt to send with
302 * @limit: number of retries before fallback
303 */
304struct ieee80211_tx_altrate {
305 s8 rate_idx;
306 u8 limit;
307};
308
285/** 309/**
286 * struct ieee80211_tx_info - skb transmit information 310 * struct ieee80211_tx_info - skb transmit information
287 * 311 *
@@ -290,6 +314,9 @@ enum mac80211_tx_control_flags {
290 * (2) driver internal use (if applicable) 314 * (2) driver internal use (if applicable)
291 * (3) TX status information - driver tells mac80211 what happened 315 * (3) TX status information - driver tells mac80211 what happened
292 * 316 *
317 * The TX control's sta pointer is only valid during the ->tx call,
318 * it may be NULL.
319 *
293 * @flags: transmit info flags, defined above 320 * @flags: transmit info flags, defined above
294 * @band: TBD 321 * @band: TBD
295 * @tx_rate_idx: TBD 322 * @tx_rate_idx: TBD
@@ -317,18 +344,19 @@ struct ieee80211_tx_info {
317 344
318 union { 345 union {
319 struct { 346 struct {
347 /* NB: vif can be NULL for injected frames */
320 struct ieee80211_vif *vif; 348 struct ieee80211_vif *vif;
321 struct ieee80211_key_conf *hw_key; 349 struct ieee80211_key_conf *hw_key;
350 struct ieee80211_sta *sta;
322 unsigned long jiffies; 351 unsigned long jiffies;
323 u16 aid; 352 s8 rts_cts_rate_idx;
324 s8 rts_cts_rate_idx, alt_retry_rate_idx;
325 u8 retry_limit; 353 u8 retry_limit;
326 u8 icv_len; 354 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE];
327 u8 iv_len;
328 } control; 355 } control;
329 struct { 356 struct {
330 u64 ampdu_ack_map; 357 u64 ampdu_ack_map;
331 int ack_signal; 358 int ack_signal;
359 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE + 1];
332 u8 retry_count; 360 u8 retry_count;
333 bool excessive_retries; 361 bool excessive_retries;
334 u8 ampdu_ack_len; 362 u8 ampdu_ack_len;
@@ -363,6 +391,7 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
363 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field) 391 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field)
364 * is valid. This is useful in monitor mode and necessary for beacon frames 392 * is valid. This is useful in monitor mode and necessary for beacon frames
365 * to enable IBSS merging. 393 * to enable IBSS merging.
394 * @RX_FLAG_SHORTPRE: Short preamble was used for this frame
366 */ 395 */
367enum mac80211_rx_flags { 396enum mac80211_rx_flags {
368 RX_FLAG_MMIC_ERROR = 1<<0, 397 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -373,6 +402,7 @@ enum mac80211_rx_flags {
373 RX_FLAG_FAILED_FCS_CRC = 1<<5, 402 RX_FLAG_FAILED_FCS_CRC = 1<<5,
374 RX_FLAG_FAILED_PLCP_CRC = 1<<6, 403 RX_FLAG_FAILED_PLCP_CRC = 1<<6,
375 RX_FLAG_TSFT = 1<<7, 404 RX_FLAG_TSFT = 1<<7,
405 RX_FLAG_SHORTPRE = 1<<8
376}; 406};
377 407
378/** 408/**
@@ -418,6 +448,11 @@ struct ieee80211_rx_status {
418 * @IEEE80211_CONF_PS: Enable 802.11 power save mode 448 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
419 */ 449 */
420enum ieee80211_conf_flags { 450enum ieee80211_conf_flags {
451 /*
452 * TODO: IEEE80211_CONF_SHORT_SLOT_TIME will be removed once drivers
453 * have been converted to use bss_info_changed() for slot time
454 * configuration
455 */
421 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), 456 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0),
422 IEEE80211_CONF_RADIOTAP = (1<<1), 457 IEEE80211_CONF_RADIOTAP = (1<<1),
423 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), 458 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2),
@@ -461,33 +496,6 @@ struct ieee80211_conf {
461}; 496};
462 497
463/** 498/**
464 * enum ieee80211_if_types - types of 802.11 network interfaces
465 *
466 * @IEEE80211_IF_TYPE_INVALID: invalid interface type, not used
467 * by mac80211 itself
468 * @IEEE80211_IF_TYPE_AP: interface in AP mode.
469 * @IEEE80211_IF_TYPE_MGMT: special interface for communication with hostap
470 * daemon. Drivers should never see this type.
471 * @IEEE80211_IF_TYPE_STA: interface in STA (client) mode.
472 * @IEEE80211_IF_TYPE_IBSS: interface in IBSS (ad-hoc) mode.
473 * @IEEE80211_IF_TYPE_MNTR: interface in monitor (rfmon) mode.
474 * @IEEE80211_IF_TYPE_WDS: interface in WDS mode.
475 * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers
476 * will never see this type.
477 * @IEEE80211_IF_TYPE_MESH_POINT: 802.11s mesh point
478 */
479enum ieee80211_if_types {
480 IEEE80211_IF_TYPE_INVALID,
481 IEEE80211_IF_TYPE_AP,
482 IEEE80211_IF_TYPE_STA,
483 IEEE80211_IF_TYPE_IBSS,
484 IEEE80211_IF_TYPE_MESH_POINT,
485 IEEE80211_IF_TYPE_MNTR,
486 IEEE80211_IF_TYPE_WDS,
487 IEEE80211_IF_TYPE_VLAN,
488};
489
490/**
491 * struct ieee80211_vif - per-interface data 499 * struct ieee80211_vif - per-interface data
492 * 500 *
493 * Data in this structure is continually present for driver 501 * Data in this structure is continually present for driver
@@ -498,7 +506,7 @@ enum ieee80211_if_types {
498 * sizeof(void *). 506 * sizeof(void *).
499 */ 507 */
500struct ieee80211_vif { 508struct ieee80211_vif {
501 enum ieee80211_if_types type; 509 enum nl80211_iftype type;
502 /* must be last */ 510 /* must be last */
503 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 511 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
504}; 512};
@@ -506,7 +514,7 @@ struct ieee80211_vif {
506static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) 514static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
507{ 515{
508#ifdef CONFIG_MAC80211_MESH 516#ifdef CONFIG_MAC80211_MESH
509 return vif->type == IEEE80211_IF_TYPE_MESH_POINT; 517 return vif->type == NL80211_IFTYPE_MESH_POINT;
510#endif 518#endif
511 return false; 519 return false;
512} 520}
@@ -517,7 +525,7 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
517 * @vif: pointer to a driver-use per-interface structure. The pointer 525 * @vif: pointer to a driver-use per-interface structure. The pointer
518 * itself is also used for various functions including 526 * itself is also used for various functions including
519 * ieee80211_beacon_get() and ieee80211_get_buffered_bc(). 527 * ieee80211_beacon_get() and ieee80211_get_buffered_bc().
520 * @type: one of &enum ieee80211_if_types constants. Determines the type of 528 * @type: one of &enum nl80211_iftype constants. Determines the type of
521 * added/removed interface. 529 * added/removed interface.
522 * @mac_addr: pointer to MAC address of the interface. This pointer is valid 530 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
523 * until the interface is removed (i.e. it cannot be used after 531 * until the interface is removed (i.e. it cannot be used after
@@ -533,7 +541,7 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
533 * in pure monitor mode. 541 * in pure monitor mode.
534 */ 542 */
535struct ieee80211_if_init_conf { 543struct ieee80211_if_init_conf {
536 enum ieee80211_if_types type; 544 enum nl80211_iftype type;
537 struct ieee80211_vif *vif; 545 struct ieee80211_vif *vif;
538 void *mac_addr; 546 void *mac_addr;
539}; 547};
@@ -637,10 +645,13 @@ enum ieee80211_key_flags {
637 * - Temporal Encryption Key (128 bits) 645 * - Temporal Encryption Key (128 bits)
638 * - Temporal Authenticator Tx MIC Key (64 bits) 646 * - Temporal Authenticator Tx MIC Key (64 bits)
639 * - Temporal Authenticator Rx MIC Key (64 bits) 647 * - Temporal Authenticator Rx MIC Key (64 bits)
640 * 648 * @icv_len: FIXME
649 * @iv_len: FIXME
641 */ 650 */
642struct ieee80211_key_conf { 651struct ieee80211_key_conf {
643 enum ieee80211_key_alg alg; 652 enum ieee80211_key_alg alg;
653 u8 icv_len;
654 u8 iv_len;
644 u8 hw_key_idx; 655 u8 hw_key_idx;
645 u8 flags; 656 u8 flags;
646 s8 keyidx; 657 s8 keyidx;
@@ -662,6 +673,33 @@ enum set_key_cmd {
662}; 673};
663 674
664/** 675/**
676 * struct ieee80211_sta - station table entry
677 *
678 * A station table entry represents a station we are possibly
679 * communicating with. Since stations are RCU-managed in
680 * mac80211, any ieee80211_sta pointer you get access to must
681 * either be protected by rcu_read_lock() explicitly or implicitly,
682 * or you must take good care to not use such a pointer after a
683 * call to your sta_notify callback that removed it.
684 *
685 * @addr: MAC address
686 * @aid: AID we assigned to the station if we're an AP
687 * @supp_rates: Bitmap of supported rates (per band)
688 * @ht_info: HT capabilities of this STA
689 * @drv_priv: data area for driver use, will always be aligned to
690 * sizeof(void *), size is determined in hw information.
691 */
692struct ieee80211_sta {
693 u64 supp_rates[IEEE80211_NUM_BANDS];
694 u8 addr[ETH_ALEN];
695 u16 aid;
696 struct ieee80211_ht_info ht_info;
697
698 /* must be last */
699 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
700};
701
702/**
665 * enum sta_notify_cmd - sta notify command 703 * enum sta_notify_cmd - sta notify command
666 * 704 *
667 * Used with the sta_notify() callback in &struct ieee80211_ops, this 705 * Used with the sta_notify() callback in &struct ieee80211_ops, this
@@ -805,6 +843,11 @@ enum ieee80211_hw_flags {
805 * 843 *
806 * @vif_data_size: size (in bytes) of the drv_priv data area 844 * @vif_data_size: size (in bytes) of the drv_priv data area
807 * within &struct ieee80211_vif. 845 * within &struct ieee80211_vif.
846 * @sta_data_size: size (in bytes) of the drv_priv data area
847 * within &struct ieee80211_sta.
848 *
849 * @max_altrates: maximum number of alternate rate retry stages
850 * @max_altrate_tries: maximum number of tries for each stage
808 */ 851 */
809struct ieee80211_hw { 852struct ieee80211_hw {
810 struct ieee80211_conf conf; 853 struct ieee80211_conf conf;
@@ -816,12 +859,17 @@ struct ieee80211_hw {
816 unsigned int extra_tx_headroom; 859 unsigned int extra_tx_headroom;
817 int channel_change_time; 860 int channel_change_time;
818 int vif_data_size; 861 int vif_data_size;
862 int sta_data_size;
819 u16 queues; 863 u16 queues;
820 u16 ampdu_queues; 864 u16 ampdu_queues;
821 u16 max_listen_interval; 865 u16 max_listen_interval;
822 s8 max_signal; 866 s8 max_signal;
867 u8 max_altrates;
868 u8 max_altrate_tries;
823}; 869};
824 870
871struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy);
872
825/** 873/**
826 * SET_IEEE80211_DEV - set device for 802.11 hardware 874 * SET_IEEE80211_DEV - set device for 802.11 hardware
827 * 875 *
@@ -874,11 +922,11 @@ ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw,
874 922
875static inline struct ieee80211_rate * 923static inline struct ieee80211_rate *
876ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, 924ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
877 const struct ieee80211_tx_info *c) 925 const struct ieee80211_tx_info *c, int idx)
878{ 926{
879 if (c->control.alt_retry_rate_idx < 0) 927 if (c->control.retries[idx].rate_idx < 0)
880 return NULL; 928 return NULL;
881 return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx]; 929 return &hw->wiphy->bands[c->band]->bitrates[c->control.retries[idx].rate_idx];
882} 930}
883 931
884/** 932/**
@@ -1097,7 +1145,7 @@ enum ieee80211_ampdu_mlme_action {
1097 * This callback must be implemented and atomic. 1145 * This callback must be implemented and atomic.
1098 * 1146 *
1099 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 1147 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
1100 * must be set or cleared for a given AID. Must be atomic. 1148 * must be set or cleared for a given STA. Must be atomic.
1101 * 1149 *
1102 * @set_key: See the section "Hardware crypto acceleration" 1150 * @set_key: See the section "Hardware crypto acceleration"
1103 * This callback can sleep, and is only called between add_interface 1151 * This callback can sleep, and is only called between add_interface
@@ -1111,7 +1159,9 @@ enum ieee80211_ampdu_mlme_action {
1111 * @hw_scan: Ask the hardware to service the scan request, no need to start 1159 * @hw_scan: Ask the hardware to service the scan request, no need to start
1112 * the scan state machine in stack. The scan must honour the channel 1160 * the scan state machine in stack. The scan must honour the channel
1113 * configuration done by the regulatory agent in the wiphy's registered 1161 * configuration done by the regulatory agent in the wiphy's registered
1114 * bands. 1162 * bands. When the scan finishes, ieee80211_scan_completed() must be
1163 * called; note that it also must be called when the scan cannot finish
1164 * because the hardware is turned off! Anything else is a bug!
1115 * 1165 *
1116 * @get_stats: return low-level statistics 1166 * @get_stats: return low-level statistics
1117 * 1167 *
@@ -1131,7 +1181,7 @@ enum ieee80211_ampdu_mlme_action {
1131 * of assocaited station or AP. 1181 * of assocaited station or AP.
1132 * 1182 *
1133 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1183 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1134 * bursting) for a hardware TX queue. Must be atomic. 1184 * bursting) for a hardware TX queue.
1135 * 1185 *
1136 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1186 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1137 * to get number of currently queued packets (queue length), maximum queue 1187 * to get number of currently queued packets (queue length), maximum queue
@@ -1181,7 +1231,8 @@ struct ieee80211_ops {
1181 unsigned int changed_flags, 1231 unsigned int changed_flags,
1182 unsigned int *total_flags, 1232 unsigned int *total_flags,
1183 int mc_count, struct dev_addr_list *mc_list); 1233 int mc_count, struct dev_addr_list *mc_list);
1184 int (*set_tim)(struct ieee80211_hw *hw, int aid, int set); 1234 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
1235 bool set);
1185 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 1236 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1186 const u8 *local_address, const u8 *address, 1237 const u8 *local_address, const u8 *address,
1187 struct ieee80211_key_conf *key); 1238 struct ieee80211_key_conf *key);
@@ -1198,7 +1249,7 @@ struct ieee80211_ops {
1198 int (*set_retry_limit)(struct ieee80211_hw *hw, 1249 int (*set_retry_limit)(struct ieee80211_hw *hw,
1199 u32 short_retry, u32 long_retr); 1250 u32 short_retry, u32 long_retr);
1200 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1251 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1201 enum sta_notify_cmd, const u8 *addr); 1252 enum sta_notify_cmd, struct ieee80211_sta *sta);
1202 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1253 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1203 const struct ieee80211_tx_queue_params *params); 1254 const struct ieee80211_tx_queue_params *params);
1204 int (*get_tx_stats)(struct ieee80211_hw *hw, 1255 int (*get_tx_stats)(struct ieee80211_hw *hw,
@@ -1208,7 +1259,7 @@ struct ieee80211_ops {
1208 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1259 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1209 int (*ampdu_action)(struct ieee80211_hw *hw, 1260 int (*ampdu_action)(struct ieee80211_hw *hw,
1210 enum ieee80211_ampdu_mlme_action action, 1261 enum ieee80211_ampdu_mlme_action action,
1211 const u8 *addr, u16 tid, u16 *ssn); 1262 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1212}; 1263};
1213 1264
1214/** 1265/**
@@ -1557,16 +1608,6 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1557unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); 1608unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1558 1609
1559/** 1610/**
1560 * ieee80211_get_hdrlen - get header length from frame control
1561 *
1562 * This function returns the 802.11 header length in bytes (not including
1563 * encryption headers.)
1564 *
1565 * @fc: the frame control field (in CPU endianness)
1566 */
1567int ieee80211_get_hdrlen(u16 fc);
1568
1569/**
1570 * ieee80211_hdrlen - get header length in bytes from frame control 1611 * ieee80211_hdrlen - get header length in bytes from frame control
1571 * @fc: frame control field in little-endian format 1612 * @fc: frame control field in little-endian format
1572 */ 1613 */
@@ -1608,6 +1649,16 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue);
1608void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); 1649void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
1609 1650
1610/** 1651/**
1652 * ieee80211_queue_stopped - test status of the queue
1653 * @hw: pointer as obtained from ieee80211_alloc_hw().
1654 * @queue: queue number (counted from zero).
1655 *
1656 * Drivers should use this function instead of netif_stop_queue.
1657 */
1658
1659int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue);
1660
1661/**
1611 * ieee80211_stop_queues - stop all queues 1662 * ieee80211_stop_queues - stop all queues
1612 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1663 * @hw: pointer as obtained from ieee80211_alloc_hw().
1613 * 1664 *
@@ -1758,4 +1809,85 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1758 */ 1809 */
1759void ieee80211_notify_mac(struct ieee80211_hw *hw, 1810void ieee80211_notify_mac(struct ieee80211_hw *hw,
1760 enum ieee80211_notification_types notif_type); 1811 enum ieee80211_notification_types notif_type);
1812
1813/**
1814 * ieee80211_find_sta - find a station
1815 *
1816 * @hw: pointer as obtained from ieee80211_alloc_hw()
1817 * @addr: station's address
1818 *
1819 * This function must be called under RCU lock and the
1820 * resulting pointer is only valid under RCU lock as well.
1821 */
1822struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw,
1823 const u8 *addr);
1824
1825
1826/* Rate control API */
1827/**
1828 * struct rate_selection - rate information for/from rate control algorithms
1829 *
1830 * @rate_idx: selected transmission rate index
1831 * @nonerp_idx: Non-ERP rate to use instead if ERP cannot be used
1832 * @probe_idx: rate for probing (or -1)
1833 * @max_rate_idx: maximum rate index that can be used, this is
1834 * input to the algorithm and will be enforced
1835 */
1836struct rate_selection {
1837 s8 rate_idx, nonerp_idx, probe_idx, max_rate_idx;
1838};
1839
1840struct rate_control_ops {
1841 struct module *module;
1842 const char *name;
1843 void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir);
1844 void (*clear)(void *priv);
1845 void (*free)(void *priv);
1846
1847 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
1848 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband,
1849 struct ieee80211_sta *sta, void *priv_sta);
1850 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
1851 void *priv_sta);
1852
1853 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
1854 struct ieee80211_sta *sta, void *priv_sta,
1855 struct sk_buff *skb);
1856 void (*get_rate)(void *priv, struct ieee80211_supported_band *sband,
1857 struct ieee80211_sta *sta, void *priv_sta,
1858 struct sk_buff *skb,
1859 struct rate_selection *sel);
1860
1861 void (*add_sta_debugfs)(void *priv, void *priv_sta,
1862 struct dentry *dir);
1863 void (*remove_sta_debugfs)(void *priv, void *priv_sta);
1864};
1865
1866static inline int rate_supported(struct ieee80211_sta *sta,
1867 enum ieee80211_band band,
1868 int index)
1869{
1870 return (sta == NULL || sta->supp_rates[band] & BIT(index));
1871}
1872
1873static inline s8
1874rate_lowest_index(struct ieee80211_supported_band *sband,
1875 struct ieee80211_sta *sta)
1876{
1877 int i;
1878
1879 for (i = 0; i < sband->n_bitrates; i++)
1880 if (rate_supported(sta, sband->band, i))
1881 return i;
1882
1883 /* warn when we cannot find a rate. */
1884 WARN_ON(1);
1885
1886 return 0;
1887}
1888
1889
1890int ieee80211_rate_control_register(struct rate_control_ops *ops);
1891void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
1892
1761#endif /* MAC80211_H */ 1893#endif /* MAC80211_H */
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index a01b7c4dc763..11dd0137c6a5 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -129,9 +129,8 @@ extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
129 void __user *buffer, 129 void __user *buffer,
130 size_t *lenp, 130 size_t *lenp,
131 loff_t *ppos); 131 loff_t *ppos);
132int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name, 132int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl,
133 int nlen, void __user *oldval, 133 void __user *oldval, size_t __user *oldlenp,
134 size_t __user *oldlenp,
135 void __user *newval, size_t newlen); 134 void __user *newval, size_t newlen);
136#endif 135#endif
137 136
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index a8eb43cf0c7e..708009be88b6 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -16,6 +16,9 @@
16#include <net/netns/ipv6.h> 16#include <net/netns/ipv6.h>
17#include <net/netns/dccp.h> 17#include <net/netns/dccp.h>
18#include <net/netns/x_tables.h> 18#include <net/netns/x_tables.h>
19#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
20#include <net/netns/conntrack.h>
21#endif
19 22
20struct proc_dir_entry; 23struct proc_dir_entry;
21struct net_device; 24struct net_device;
@@ -67,6 +70,9 @@ struct net {
67#endif 70#endif
68#ifdef CONFIG_NETFILTER 71#ifdef CONFIG_NETFILTER
69 struct netns_xt xt; 72 struct netns_xt xt;
73#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
74 struct netns_ct ct;
75#endif
70#endif 76#endif
71 struct net_generic *gen; 77 struct net_generic *gen;
72}; 78};
diff --git a/include/net/netfilter/ipv4/nf_defrag_ipv4.h b/include/net/netfilter/ipv4/nf_defrag_ipv4.h
new file mode 100644
index 000000000000..6b00ea38546b
--- /dev/null
+++ b/include/net/netfilter/ipv4/nf_defrag_ipv4.h
@@ -0,0 +1,6 @@
1#ifndef _NF_DEFRAG_IPV4_H
2#define _NF_DEFRAG_IPV4_H
3
4extern void nf_defrag_ipv4_enable(void);
5
6#endif /* _NF_DEFRAG_IPV4_H */
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 0741ad592da0..b76a8685b5b5 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -123,7 +123,9 @@ struct nf_conn
123 123
124 /* Extensions */ 124 /* Extensions */
125 struct nf_ct_ext *ext; 125 struct nf_ct_ext *ext;
126 126#ifdef CONFIG_NET_NS
127 struct net *ct_net;
128#endif
127 struct rcu_head rcu; 129 struct rcu_head rcu;
128}; 130};
129 131
@@ -147,6 +149,17 @@ static inline u_int8_t nf_ct_protonum(const struct nf_conn *ct)
147/* get master conntrack via master expectation */ 149/* get master conntrack via master expectation */
148#define master_ct(conntr) (conntr->master) 150#define master_ct(conntr) (conntr->master)
149 151
152extern struct net init_net;
153
154static inline struct net *nf_ct_net(const struct nf_conn *ct)
155{
156#ifdef CONFIG_NET_NS
157 return ct->ct_net;
158#else
159 return &init_net;
160#endif
161}
162
150/* Alter reply tuple (maybe alter helper). */ 163/* Alter reply tuple (maybe alter helper). */
151extern void 164extern void
152nf_conntrack_alter_reply(struct nf_conn *ct, 165nf_conntrack_alter_reply(struct nf_conn *ct,
@@ -182,11 +195,11 @@ extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced,
182 unsigned int size); 195 unsigned int size);
183 196
184extern struct nf_conntrack_tuple_hash * 197extern struct nf_conntrack_tuple_hash *
185__nf_conntrack_find(const struct nf_conntrack_tuple *tuple); 198__nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple);
186 199
187extern void nf_conntrack_hash_insert(struct nf_conn *ct); 200extern void nf_conntrack_hash_insert(struct nf_conn *ct);
188 201
189extern void nf_conntrack_flush(void); 202extern void nf_conntrack_flush(struct net *net);
190 203
191extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, 204extern bool nf_ct_get_tuplepr(const struct sk_buff *skb,
192 unsigned int nhoff, u_int16_t l3num, 205 unsigned int nhoff, u_int16_t l3num,
@@ -248,10 +261,11 @@ extern struct nf_conn nf_conntrack_untracked;
248 261
249/* Iterate over all conntracks: if iter returns true, it's deleted. */ 262/* Iterate over all conntracks: if iter returns true, it's deleted. */
250extern void 263extern void
251nf_ct_iterate_cleanup(int (*iter)(struct nf_conn *i, void *data), void *data); 264nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data);
252extern void nf_conntrack_free(struct nf_conn *ct); 265extern void nf_conntrack_free(struct nf_conn *ct);
253extern struct nf_conn * 266extern struct nf_conn *
254nf_conntrack_alloc(const struct nf_conntrack_tuple *orig, 267nf_conntrack_alloc(struct net *net,
268 const struct nf_conntrack_tuple *orig,
255 const struct nf_conntrack_tuple *repl, 269 const struct nf_conntrack_tuple *repl,
256 gfp_t gfp); 270 gfp_t gfp);
257 271
@@ -273,16 +287,14 @@ static inline int nf_ct_is_untracked(const struct sk_buff *skb)
273 287
274extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); 288extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
275extern unsigned int nf_conntrack_htable_size; 289extern unsigned int nf_conntrack_htable_size;
276extern int nf_conntrack_checksum;
277extern atomic_t nf_conntrack_count;
278extern int nf_conntrack_max; 290extern int nf_conntrack_max;
279 291
280DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); 292#define NF_CT_STAT_INC(net, count) \
281#define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) 293 (per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++)
282#define NF_CT_STAT_INC_ATOMIC(count) \ 294#define NF_CT_STAT_INC_ATOMIC(net, count) \
283do { \ 295do { \
284 local_bh_disable(); \ 296 local_bh_disable(); \
285 __get_cpu_var(nf_conntrack_stat).count++; \ 297 per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++; \
286 local_bh_enable(); \ 298 local_bh_enable(); \
287} while (0) 299} while (0)
288 300
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h
index 5d5ae55d54c4..03e218f0be43 100644
--- a/include/net/netfilter/nf_conntrack_acct.h
+++ b/include/net/netfilter/nf_conntrack_acct.h
@@ -8,6 +8,7 @@
8 8
9#ifndef _NF_CONNTRACK_ACCT_H 9#ifndef _NF_CONNTRACK_ACCT_H
10#define _NF_CONNTRACK_ACCT_H 10#define _NF_CONNTRACK_ACCT_H
11#include <net/net_namespace.h>
11#include <linux/netfilter/nf_conntrack_common.h> 12#include <linux/netfilter/nf_conntrack_common.h>
12#include <linux/netfilter/nf_conntrack_tuple_common.h> 13#include <linux/netfilter/nf_conntrack_tuple_common.h>
13#include <net/netfilter/nf_conntrack.h> 14#include <net/netfilter/nf_conntrack.h>
@@ -18,8 +19,6 @@ struct nf_conn_counter {
18 u_int64_t bytes; 19 u_int64_t bytes;
19}; 20};
20 21
21extern int nf_ct_acct;
22
23static inline 22static inline
24struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct) 23struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct)
25{ 24{
@@ -29,9 +28,10 @@ struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct)
29static inline 28static inline
30struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) 29struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp)
31{ 30{
31 struct net *net = nf_ct_net(ct);
32 struct nf_conn_counter *acct; 32 struct nf_conn_counter *acct;
33 33
34 if (!nf_ct_acct) 34 if (!net->ct.sysctl_acct)
35 return NULL; 35 return NULL;
36 36
37 acct = nf_ct_ext_add(ct, NF_CT_EXT_ACCT, gfp); 37 acct = nf_ct_ext_add(ct, NF_CT_EXT_ACCT, gfp);
@@ -45,7 +45,7 @@ struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp)
45extern unsigned int 45extern unsigned int
46seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir); 46seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir);
47 47
48extern int nf_conntrack_acct_init(void); 48extern int nf_conntrack_acct_init(struct net *net);
49extern void nf_conntrack_acct_fini(void); 49extern void nf_conntrack_acct_fini(struct net *net);
50 50
51#endif /* _NF_CONNTRACK_ACCT_H */ 51#endif /* _NF_CONNTRACK_ACCT_H */
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index a81771210934..e78afe7f28e3 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -20,12 +20,13 @@
20/* This header is used to share core functionality between the 20/* This header is used to share core functionality between the
21 standalone connection tracking module, and the compatibility layer's use 21 standalone connection tracking module, and the compatibility layer's use
22 of connection tracking. */ 22 of connection tracking. */
23extern unsigned int nf_conntrack_in(int pf, 23extern unsigned int nf_conntrack_in(struct net *net,
24 u_int8_t pf,
24 unsigned int hooknum, 25 unsigned int hooknum,
25 struct sk_buff *skb); 26 struct sk_buff *skb);
26 27
27extern int nf_conntrack_init(void); 28extern int nf_conntrack_init(struct net *net);
28extern void nf_conntrack_cleanup(void); 29extern void nf_conntrack_cleanup(struct net *net);
29 30
30extern int nf_conntrack_proto_init(void); 31extern int nf_conntrack_proto_init(void);
31extern void nf_conntrack_proto_fini(void); 32extern void nf_conntrack_proto_fini(void);
@@ -48,7 +49,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
48 49
49/* Find a connection corresponding to a tuple. */ 50/* Find a connection corresponding to a tuple. */
50extern struct nf_conntrack_tuple_hash * 51extern struct nf_conntrack_tuple_hash *
51nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple); 52nf_conntrack_find_get(struct net *net, const struct nf_conntrack_tuple *tuple);
52 53
53extern int __nf_conntrack_confirm(struct sk_buff *skb); 54extern int __nf_conntrack_confirm(struct sk_buff *skb);
54 55
@@ -71,8 +72,6 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
71 const struct nf_conntrack_l3proto *l3proto, 72 const struct nf_conntrack_l3proto *l3proto,
72 const struct nf_conntrack_l4proto *proto); 73 const struct nf_conntrack_l4proto *proto);
73 74
74extern struct hlist_head *nf_conntrack_hash;
75extern spinlock_t nf_conntrack_lock ; 75extern spinlock_t nf_conntrack_lock ;
76extern struct hlist_head unconfirmed;
77 76
78#endif /* _NF_CONNTRACK_CORE_H */ 77#endif /* _NF_CONNTRACK_CORE_H */
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h
index f0b9078235c9..1285ff26a014 100644
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/notifier.h> 9#include <linux/notifier.h>
10#include <linux/interrupt.h> 10#include <linux/interrupt.h>
11#include <net/net_namespace.h>
11#include <net/netfilter/nf_conntrack_expect.h> 12#include <net/netfilter/nf_conntrack_expect.h>
12 13
13#ifdef CONFIG_NF_CONNTRACK_EVENTS 14#ifdef CONFIG_NF_CONNTRACK_EVENTS
@@ -15,9 +16,6 @@ struct nf_conntrack_ecache {
15 struct nf_conn *ct; 16 struct nf_conn *ct;
16 unsigned int events; 17 unsigned int events;
17}; 18};
18DECLARE_PER_CPU(struct nf_conntrack_ecache, nf_conntrack_ecache);
19
20#define CONNTRACK_ECACHE(x) (__get_cpu_var(nf_conntrack_ecache).x)
21 19
22extern struct atomic_notifier_head nf_conntrack_chain; 20extern struct atomic_notifier_head nf_conntrack_chain;
23extern int nf_conntrack_register_notifier(struct notifier_block *nb); 21extern int nf_conntrack_register_notifier(struct notifier_block *nb);
@@ -25,17 +23,16 @@ extern int nf_conntrack_unregister_notifier(struct notifier_block *nb);
25 23
26extern void nf_ct_deliver_cached_events(const struct nf_conn *ct); 24extern void nf_ct_deliver_cached_events(const struct nf_conn *ct);
27extern void __nf_ct_event_cache_init(struct nf_conn *ct); 25extern void __nf_ct_event_cache_init(struct nf_conn *ct);
28extern void nf_ct_event_cache_flush(void); 26extern void nf_ct_event_cache_flush(struct net *net);
29 27
30static inline void 28static inline void
31nf_conntrack_event_cache(enum ip_conntrack_events event, 29nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
32 const struct sk_buff *skb)
33{ 30{
34 struct nf_conn *ct = (struct nf_conn *)skb->nfct; 31 struct net *net = nf_ct_net(ct);
35 struct nf_conntrack_ecache *ecache; 32 struct nf_conntrack_ecache *ecache;
36 33
37 local_bh_disable(); 34 local_bh_disable();
38 ecache = &__get_cpu_var(nf_conntrack_ecache); 35 ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id());
39 if (ct != ecache->ct) 36 if (ct != ecache->ct)
40 __nf_ct_event_cache_init(ct); 37 __nf_ct_event_cache_init(ct);
41 ecache->events |= event; 38 ecache->events |= event;
@@ -60,16 +57,28 @@ nf_ct_expect_event(enum ip_conntrack_expect_events event,
60 atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp); 57 atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp);
61} 58}
62 59
60extern int nf_conntrack_ecache_init(struct net *net);
61extern void nf_conntrack_ecache_fini(struct net *net);
62
63#else /* CONFIG_NF_CONNTRACK_EVENTS */ 63#else /* CONFIG_NF_CONNTRACK_EVENTS */
64 64
65static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, 65static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
66 const struct sk_buff *skb) {} 66 struct nf_conn *ct) {}
67static inline void nf_conntrack_event(enum ip_conntrack_events event, 67static inline void nf_conntrack_event(enum ip_conntrack_events event,
68 struct nf_conn *ct) {} 68 struct nf_conn *ct) {}
69static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} 69static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
70static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, 70static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event,
71 struct nf_conntrack_expect *exp) {} 71 struct nf_conntrack_expect *exp) {}
72static inline void nf_ct_event_cache_flush(void) {} 72static inline void nf_ct_event_cache_flush(struct net *net) {}
73
74static inline int nf_conntrack_ecache_init(struct net *net)
75{
76 return 0;
77}
78
79static inline void nf_conntrack_ecache_fini(struct net *net)
80{
81}
73#endif /* CONFIG_NF_CONNTRACK_EVENTS */ 82#endif /* CONFIG_NF_CONNTRACK_EVENTS */
74 83
75#endif /*_NF_CONNTRACK_ECACHE_H*/ 84#endif /*_NF_CONNTRACK_ECACHE_H*/
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index dfdf4b459475..37a7fc1164b0 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -6,7 +6,6 @@
6#define _NF_CONNTRACK_EXPECT_H 6#define _NF_CONNTRACK_EXPECT_H
7#include <net/netfilter/nf_conntrack.h> 7#include <net/netfilter/nf_conntrack.h>
8 8
9extern struct hlist_head *nf_ct_expect_hash;
10extern unsigned int nf_ct_expect_hsize; 9extern unsigned int nf_ct_expect_hsize;
11extern unsigned int nf_ct_expect_max; 10extern unsigned int nf_ct_expect_max;
12 11
@@ -56,6 +55,15 @@ struct nf_conntrack_expect
56 struct rcu_head rcu; 55 struct rcu_head rcu;
57}; 56};
58 57
58static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp)
59{
60#ifdef CONFIG_NET_NS
61 return exp->master->ct_net; /* by definition */
62#else
63 return &init_net;
64#endif
65}
66
59struct nf_conntrack_expect_policy 67struct nf_conntrack_expect_policy
60{ 68{
61 unsigned int max_expected; 69 unsigned int max_expected;
@@ -67,17 +75,17 @@ struct nf_conntrack_expect_policy
67#define NF_CT_EXPECT_PERMANENT 0x1 75#define NF_CT_EXPECT_PERMANENT 0x1
68#define NF_CT_EXPECT_INACTIVE 0x2 76#define NF_CT_EXPECT_INACTIVE 0x2
69 77
70int nf_conntrack_expect_init(void); 78int nf_conntrack_expect_init(struct net *net);
71void nf_conntrack_expect_fini(void); 79void nf_conntrack_expect_fini(struct net *net);
72 80
73struct nf_conntrack_expect * 81struct nf_conntrack_expect *
74__nf_ct_expect_find(const struct nf_conntrack_tuple *tuple); 82__nf_ct_expect_find(struct net *net, const struct nf_conntrack_tuple *tuple);
75 83
76struct nf_conntrack_expect * 84struct nf_conntrack_expect *
77nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple); 85nf_ct_expect_find_get(struct net *net, const struct nf_conntrack_tuple *tuple);
78 86
79struct nf_conntrack_expect * 87struct nf_conntrack_expect *
80nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple); 88nf_ct_find_expectation(struct net *net, const struct nf_conntrack_tuple *tuple);
81 89
82void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); 90void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
83void nf_ct_remove_expectations(struct nf_conn *ct); 91void nf_ct_remove_expectations(struct nf_conn *ct);
@@ -86,7 +94,7 @@ void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
86/* Allocate space for an expectation: this is mandatory before calling 94/* Allocate space for an expectation: this is mandatory before calling
87 nf_ct_expect_related. You will have to call put afterwards. */ 95 nf_ct_expect_related. You will have to call put afterwards. */
88struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me); 96struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
89void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, int, 97void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, u_int8_t,
90 const union nf_inet_addr *, 98 const union nf_inet_addr *,
91 const union nf_inet_addr *, 99 const union nf_inet_addr *,
92 u_int8_t, const __be16 *, const __be16 *); 100 u_int8_t, const __be16 *, const __be16 *);
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index 723df9d1cc35..7f2f43c77284 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -39,7 +39,7 @@ struct nf_conntrack_l4proto
39 const struct sk_buff *skb, 39 const struct sk_buff *skb,
40 unsigned int dataoff, 40 unsigned int dataoff,
41 enum ip_conntrack_info ctinfo, 41 enum ip_conntrack_info ctinfo,
42 int pf, 42 u_int8_t pf,
43 unsigned int hooknum); 43 unsigned int hooknum);
44 44
45 /* Called when a new connection for this protocol found; 45 /* Called when a new connection for this protocol found;
@@ -50,9 +50,9 @@ struct nf_conntrack_l4proto
50 /* Called when a conntrack entry is destroyed */ 50 /* Called when a conntrack entry is destroyed */
51 void (*destroy)(struct nf_conn *ct); 51 void (*destroy)(struct nf_conn *ct);
52 52
53 int (*error)(struct sk_buff *skb, unsigned int dataoff, 53 int (*error)(struct net *net, struct sk_buff *skb, unsigned int dataoff,
54 enum ip_conntrack_info *ctinfo, 54 enum ip_conntrack_info *ctinfo,
55 int pf, unsigned int hooknum); 55 u_int8_t pf, unsigned int hooknum);
56 56
57 /* Print out the per-protocol part of the tuple. Return like seq_* */ 57 /* Print out the per-protocol part of the tuple. Return like seq_* */
58 int (*print_tuple)(struct seq_file *s, 58 int (*print_tuple)(struct seq_file *s,
@@ -117,20 +117,19 @@ extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],
117 struct nf_conntrack_tuple *t); 117 struct nf_conntrack_tuple *t);
118extern const struct nla_policy nf_ct_port_nla_policy[]; 118extern const struct nla_policy nf_ct_port_nla_policy[];
119 119
120/* Log invalid packets */
121extern unsigned int nf_ct_log_invalid;
122
123#ifdef CONFIG_SYSCTL 120#ifdef CONFIG_SYSCTL
124#ifdef DEBUG_INVALID_PACKETS 121#ifdef DEBUG_INVALID_PACKETS
125#define LOG_INVALID(proto) \ 122#define LOG_INVALID(net, proto) \
126 (nf_ct_log_invalid == (proto) || nf_ct_log_invalid == IPPROTO_RAW) 123 ((net)->ct.sysctl_log_invalid == (proto) || \
124 (net)->ct.sysctl_log_invalid == IPPROTO_RAW)
127#else 125#else
128#define LOG_INVALID(proto) \ 126#define LOG_INVALID(net, proto) \
129 ((nf_ct_log_invalid == (proto) || nf_ct_log_invalid == IPPROTO_RAW) \ 127 (((net)->ct.sysctl_log_invalid == (proto) || \
128 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) \
130 && net_ratelimit()) 129 && net_ratelimit())
131#endif 130#endif
132#else 131#else
133#define LOG_INVALID(proto) 0 132#define LOG_INVALID(net, proto) 0
134#endif /* CONFIG_SYSCTL */ 133#endif /* CONFIG_SYSCTL */
135 134
136#endif /*_NF_CONNTRACK_PROTOCOL_H*/ 135#endif /*_NF_CONNTRACK_PROTOCOL_H*/
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h
index 8c6b5ae45534..7182c06974f4 100644
--- a/include/net/netfilter/nf_log.h
+++ b/include/net/netfilter/nf_log.h
@@ -28,7 +28,7 @@ struct nf_loginfo {
28 } u; 28 } u;
29}; 29};
30 30
31typedef void nf_logfn(unsigned int pf, 31typedef void nf_logfn(u_int8_t pf,
32 unsigned int hooknum, 32 unsigned int hooknum,
33 const struct sk_buff *skb, 33 const struct sk_buff *skb,
34 const struct net_device *in, 34 const struct net_device *in,
@@ -43,12 +43,12 @@ struct nf_logger {
43}; 43};
44 44
45/* Function to register/unregister log function. */ 45/* Function to register/unregister log function. */
46int nf_log_register(int pf, const struct nf_logger *logger); 46int nf_log_register(u_int8_t pf, const struct nf_logger *logger);
47void nf_log_unregister(const struct nf_logger *logger); 47void nf_log_unregister(const struct nf_logger *logger);
48void nf_log_unregister_pf(int pf); 48void nf_log_unregister_pf(u_int8_t pf);
49 49
50/* Calls the registered backend logging function */ 50/* Calls the registered backend logging function */
51void nf_log_packet(int pf, 51void nf_log_packet(u_int8_t pf,
52 unsigned int hooknum, 52 unsigned int hooknum,
53 const struct sk_buff *skb, 53 const struct sk_buff *skb,
54 const struct net_device *in, 54 const struct net_device *in,
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h
index f29eeb9777e0..58684066388c 100644
--- a/include/net/netfilter/nf_nat_core.h
+++ b/include/net/netfilter/nf_nat_core.h
@@ -25,4 +25,12 @@ static inline int nf_nat_initialized(struct nf_conn *ct,
25 else 25 else
26 return test_bit(IPS_DST_NAT_DONE_BIT, &ct->status); 26 return test_bit(IPS_DST_NAT_DONE_BIT, &ct->status);
27} 27}
28
29struct nlattr;
30
31extern int
32(*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct,
33 enum nf_nat_manip_type manip,
34 struct nlattr *attr);
35
28#endif /* _NF_NAT_CORE_H */ 36#endif /* _NF_NAT_CORE_H */
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index d030044e9235..252fd1010b77 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -8,7 +8,7 @@ struct nf_queue_entry {
8 unsigned int id; 8 unsigned int id;
9 9
10 struct nf_hook_ops *elem; 10 struct nf_hook_ops *elem;
11 int pf; 11 u_int8_t pf;
12 unsigned int hook; 12 unsigned int hook;
13 struct net_device *indev; 13 struct net_device *indev;
14 struct net_device *outdev; 14 struct net_device *outdev;
@@ -24,9 +24,9 @@ struct nf_queue_handler {
24 char *name; 24 char *name;
25}; 25};
26 26
27extern int nf_register_queue_handler(int pf, 27extern int nf_register_queue_handler(u_int8_t pf,
28 const struct nf_queue_handler *qh); 28 const struct nf_queue_handler *qh);
29extern int nf_unregister_queue_handler(int pf, 29extern int nf_unregister_queue_handler(u_int8_t pf,
30 const struct nf_queue_handler *qh); 30 const struct nf_queue_handler *qh);
31extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh); 31extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh);
32extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); 32extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h
new file mode 100644
index 000000000000..208b46f4d6d2
--- /dev/null
+++ b/include/net/netfilter/nf_tproxy_core.h
@@ -0,0 +1,32 @@
1#ifndef _NF_TPROXY_CORE_H
2#define _NF_TPROXY_CORE_H
3
4#include <linux/types.h>
5#include <linux/in.h>
6#include <linux/skbuff.h>
7#include <net/sock.h>
8#include <net/inet_sock.h>
9#include <net/tcp.h>
10
11/* look up and get a reference to a matching socket */
12extern struct sock *
13nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
14 const __be32 saddr, const __be32 daddr,
15 const __be16 sport, const __be16 dport,
16 const struct net_device *in, bool listening);
17
18static inline void
19nf_tproxy_put_sock(struct sock *sk)
20{
21 /* TIME_WAIT inet sockets have to be handled differently */
22 if ((sk->sk_protocol == IPPROTO_TCP) && (sk->sk_state == TCP_TIME_WAIT))
23 inet_twsk_put(inet_twsk(sk));
24 else
25 sock_put(sk);
26}
27
28/* assign a socket to the skb -- consumes sk */
29int
30nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk);
31
32#endif
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index e4d2d6baa983..17c442a4514e 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11/* 11/*
12 * (c) Copyright Hewlett-Packard Development Company, L.P., 2006 12 * (c) Copyright Hewlett-Packard Development Company, L.P., 2006, 2008
13 * 13 *
14 * This program is free software; you can redistribute it and/or modify 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 15 * it under the terms of the GNU General Public License as published by
@@ -72,8 +72,10 @@ struct cipso_v4_doi;
72/* NetLabel NETLINK protocol version 72/* NetLabel NETLINK protocol version
73 * 1: initial version 73 * 1: initial version
74 * 2: added static labels for unlabeled connections 74 * 2: added static labels for unlabeled connections
75 * 3: network selectors added to the NetLabel/LSM domain mapping and the
76 * CIPSO_V4_MAP_LOCAL CIPSO mapping was added
75 */ 77 */
76#define NETLBL_PROTO_VERSION 2 78#define NETLBL_PROTO_VERSION 3
77 79
78/* NetLabel NETLINK types/families */ 80/* NetLabel NETLINK types/families */
79#define NETLBL_NLTYPE_NONE 0 81#define NETLBL_NLTYPE_NONE 0
@@ -87,6 +89,8 @@ struct cipso_v4_doi;
87#define NETLBL_NLTYPE_CIPSOV6_NAME "NLBL_CIPSOv6" 89#define NETLBL_NLTYPE_CIPSOV6_NAME "NLBL_CIPSOv6"
88#define NETLBL_NLTYPE_UNLABELED 5 90#define NETLBL_NLTYPE_UNLABELED 5
89#define NETLBL_NLTYPE_UNLABELED_NAME "NLBL_UNLBL" 91#define NETLBL_NLTYPE_UNLABELED_NAME "NLBL_UNLBL"
92#define NETLBL_NLTYPE_ADDRSELECT 6
93#define NETLBL_NLTYPE_ADDRSELECT_NAME "NLBL_ADRSEL"
90 94
91/* 95/*
92 * NetLabel - Kernel API for accessing the network packet label mappings. 96 * NetLabel - Kernel API for accessing the network packet label mappings.
@@ -200,7 +204,7 @@ struct netlbl_lsm_secattr {
200 u32 type; 204 u32 type;
201 char *domain; 205 char *domain;
202 struct netlbl_lsm_cache *cache; 206 struct netlbl_lsm_cache *cache;
203 union { 207 struct {
204 struct { 208 struct {
205 struct netlbl_lsm_secattr_catmap *cat; 209 struct netlbl_lsm_secattr_catmap *cat;
206 u32 lvl; 210 u32 lvl;
@@ -352,12 +356,9 @@ static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr)
352int netlbl_cfg_map_del(const char *domain, struct netlbl_audit *audit_info); 356int netlbl_cfg_map_del(const char *domain, struct netlbl_audit *audit_info);
353int netlbl_cfg_unlbl_add_map(const char *domain, 357int netlbl_cfg_unlbl_add_map(const char *domain,
354 struct netlbl_audit *audit_info); 358 struct netlbl_audit *audit_info);
355int netlbl_cfg_cipsov4_add(struct cipso_v4_doi *doi_def,
356 struct netlbl_audit *audit_info);
357int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def, 359int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def,
358 const char *domain, 360 const char *domain,
359 struct netlbl_audit *audit_info); 361 struct netlbl_audit *audit_info);
360int netlbl_cfg_cipsov4_del(u32 doi, struct netlbl_audit *audit_info);
361 362
362/* 363/*
363 * LSM security attribute operations 364 * LSM security attribute operations
@@ -380,12 +381,19 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap,
380int netlbl_enabled(void); 381int netlbl_enabled(void);
381int netlbl_sock_setattr(struct sock *sk, 382int netlbl_sock_setattr(struct sock *sk,
382 const struct netlbl_lsm_secattr *secattr); 383 const struct netlbl_lsm_secattr *secattr);
384void netlbl_sock_delattr(struct sock *sk);
383int netlbl_sock_getattr(struct sock *sk, 385int netlbl_sock_getattr(struct sock *sk,
384 struct netlbl_lsm_secattr *secattr); 386 struct netlbl_lsm_secattr *secattr);
387int netlbl_conn_setattr(struct sock *sk,
388 struct sockaddr *addr,
389 const struct netlbl_lsm_secattr *secattr);
390int netlbl_skbuff_setattr(struct sk_buff *skb,
391 u16 family,
392 const struct netlbl_lsm_secattr *secattr);
385int netlbl_skbuff_getattr(const struct sk_buff *skb, 393int netlbl_skbuff_getattr(const struct sk_buff *skb,
386 u16 family, 394 u16 family,
387 struct netlbl_lsm_secattr *secattr); 395 struct netlbl_lsm_secattr *secattr);
388void netlbl_skbuff_err(struct sk_buff *skb, int error); 396void netlbl_skbuff_err(struct sk_buff *skb, int error, int gateway);
389 397
390/* 398/*
391 * LSM label mapping cache operations 399 * LSM label mapping cache operations
@@ -404,22 +412,12 @@ static inline int netlbl_cfg_unlbl_add_map(const char *domain,
404{ 412{
405 return -ENOSYS; 413 return -ENOSYS;
406} 414}
407static inline int netlbl_cfg_cipsov4_add(struct cipso_v4_doi *doi_def,
408 struct netlbl_audit *audit_info)
409{
410 return -ENOSYS;
411}
412static inline int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def, 415static inline int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def,
413 const char *domain, 416 const char *domain,
414 struct netlbl_audit *audit_info) 417 struct netlbl_audit *audit_info)
415{ 418{
416 return -ENOSYS; 419 return -ENOSYS;
417} 420}
418static inline int netlbl_cfg_cipsov4_del(u32 doi,
419 struct netlbl_audit *audit_info)
420{
421 return -ENOSYS;
422}
423static inline int netlbl_secattr_catmap_walk( 421static inline int netlbl_secattr_catmap_walk(
424 struct netlbl_lsm_secattr_catmap *catmap, 422 struct netlbl_lsm_secattr_catmap *catmap,
425 u32 offset) 423 u32 offset)
@@ -456,18 +454,35 @@ static inline int netlbl_sock_setattr(struct sock *sk,
456{ 454{
457 return -ENOSYS; 455 return -ENOSYS;
458} 456}
457static inline void netlbl_sock_delattr(struct sock *sk)
458{
459}
459static inline int netlbl_sock_getattr(struct sock *sk, 460static inline int netlbl_sock_getattr(struct sock *sk,
460 struct netlbl_lsm_secattr *secattr) 461 struct netlbl_lsm_secattr *secattr)
461{ 462{
462 return -ENOSYS; 463 return -ENOSYS;
463} 464}
465static inline int netlbl_conn_setattr(struct sock *sk,
466 struct sockaddr *addr,
467 const struct netlbl_lsm_secattr *secattr)
468{
469 return -ENOSYS;
470}
471static inline int netlbl_skbuff_setattr(struct sk_buff *skb,
472 u16 family,
473 const struct netlbl_lsm_secattr *secattr)
474{
475 return -ENOSYS;
476}
464static inline int netlbl_skbuff_getattr(const struct sk_buff *skb, 477static inline int netlbl_skbuff_getattr(const struct sk_buff *skb,
465 u16 family, 478 u16 family,
466 struct netlbl_lsm_secattr *secattr) 479 struct netlbl_lsm_secattr *secattr)
467{ 480{
468 return -ENOSYS; 481 return -ENOSYS;
469} 482}
470static inline void netlbl_skbuff_err(struct sk_buff *skb, int error) 483static inline void netlbl_skbuff_err(struct sk_buff *skb,
484 int error,
485 int gateway)
471{ 486{
472 return; 487 return;
473} 488}
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 18024b8cecb8..3643bbb8e585 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -119,9 +119,6 @@
119 * Nested Attributes Construction: 119 * Nested Attributes Construction:
120 * nla_nest_start(skb, type) start a nested attribute 120 * nla_nest_start(skb, type) start a nested attribute
121 * nla_nest_end(skb, nla) finalize a nested attribute 121 * nla_nest_end(skb, nla) finalize a nested attribute
122 * nla_nest_compat_start(skb, type, start a nested compat attribute
123 * len, data)
124 * nla_nest_compat_end(skb, type) finalize a nested compat attribute
125 * nla_nest_cancel(skb, nla) cancel nested attribute construction 122 * nla_nest_cancel(skb, nla) cancel nested attribute construction
126 * 123 *
127 * Attribute Length Calculations: 124 * Attribute Length Calculations:
@@ -156,7 +153,6 @@
156 * nla_find_nested() find attribute in nested attributes 153 * nla_find_nested() find attribute in nested attributes
157 * nla_parse() parse and validate stream of attrs 154 * nla_parse() parse and validate stream of attrs
158 * nla_parse_nested() parse nested attribuets 155 * nla_parse_nested() parse nested attribuets
159 * nla_parse_nested_compat() parse nested compat attributes
160 * nla_for_each_attr() loop over all attributes 156 * nla_for_each_attr() loop over all attributes
161 * nla_for_each_nested() loop over the nested attributes 157 * nla_for_each_nested() loop over the nested attributes
162 *========================================================================= 158 *=========================================================================
@@ -702,7 +698,7 @@ static inline int nla_len(const struct nlattr *nla)
702 */ 698 */
703static inline int nla_ok(const struct nlattr *nla, int remaining) 699static inline int nla_ok(const struct nlattr *nla, int remaining)
704{ 700{
705 return remaining >= sizeof(*nla) && 701 return remaining >= (int) sizeof(*nla) &&
706 nla->nla_len >= sizeof(*nla) && 702 nla->nla_len >= sizeof(*nla) &&
707 nla->nla_len <= remaining; 703 nla->nla_len <= remaining;
708} 704}
@@ -752,39 +748,6 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
752} 748}
753 749
754/** 750/**
755 * nla_parse_nested_compat - parse nested compat attributes
756 * @tb: destination array with maxtype+1 elements
757 * @maxtype: maximum attribute type to be expected
758 * @nla: attribute containing the nested attributes
759 * @data: pointer to point to contained structure
760 * @len: length of contained structure
761 * @policy: validation policy
762 *
763 * Parse a nested compat attribute. The compat attribute contains a structure
764 * and optionally a set of nested attributes. On success the data pointer
765 * points to the nested data and tb contains the parsed attributes
766 * (see nla_parse).
767 */
768static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
769 struct nlattr *nla,
770 const struct nla_policy *policy,
771 int len)
772{
773 int nested_len = nla_len(nla) - NLA_ALIGN(len);
774
775 if (nested_len < 0)
776 return -EINVAL;
777 if (nested_len >= nla_attr_size(0))
778 return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
779 nested_len, policy);
780 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
781 return 0;
782}
783
784#define nla_parse_nested_compat(tb, maxtype, nla, policy, data, len) \
785({ data = nla_len(nla) >= len ? nla_data(nla) : NULL; \
786 __nla_parse_nested_compat(tb, maxtype, nla, policy, len); })
787/**
788 * nla_put_u8 - Add a u8 netlink attribute to a socket buffer 751 * nla_put_u8 - Add a u8 netlink attribute to a socket buffer
789 * @skb: socket buffer to add attribute to 752 * @skb: socket buffer to add attribute to
790 * @attrtype: attribute type 753 * @attrtype: attribute type
@@ -1031,51 +994,6 @@ static inline int nla_nest_end(struct sk_buff *skb, struct nlattr *start)
1031} 994}
1032 995
1033/** 996/**
1034 * nla_nest_compat_start - Start a new level of nested compat attributes
1035 * @skb: socket buffer to add attributes to
1036 * @attrtype: attribute type of container
1037 * @attrlen: length of structure
1038 * @data: pointer to structure
1039 *
1040 * Start a nested compat attribute that contains both a structure and
1041 * a set of nested attributes.
1042 *
1043 * Returns the container attribute
1044 */
1045static inline struct nlattr *nla_nest_compat_start(struct sk_buff *skb,
1046 int attrtype, int attrlen,
1047 const void *data)
1048{
1049 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb);
1050
1051 if (nla_put(skb, attrtype, attrlen, data) < 0)
1052 return NULL;
1053 if (nla_nest_start(skb, attrtype) == NULL) {
1054 nlmsg_trim(skb, start);
1055 return NULL;
1056 }
1057 return start;
1058}
1059
1060/**
1061 * nla_nest_compat_end - Finalize nesting of compat attributes
1062 * @skb: socket buffer the attributes are stored in
1063 * @start: container attribute
1064 *
1065 * Corrects the container attribute header to include the all
1066 * appeneded attributes.
1067 *
1068 * Returns the total data length of the skb.
1069 */
1070static inline int nla_nest_compat_end(struct sk_buff *skb, struct nlattr *start)
1071{
1072 struct nlattr *nest = (void *)start + NLMSG_ALIGN(start->nla_len);
1073
1074 start->nla_len = skb_tail_pointer(skb) - (unsigned char *)start;
1075 return nla_nest_end(skb, nest);
1076}
1077
1078/**
1079 * nla_nest_cancel - Cancel nesting of attributes 997 * nla_nest_cancel - Cancel nesting of attributes
1080 * @skb: socket buffer the message is stored in 998 * @skb: socket buffer the message is stored in
1081 * @start: container attribute 999 * @start: container attribute
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
new file mode 100644
index 000000000000..f4498a62881b
--- /dev/null
+++ b/include/net/netns/conntrack.h
@@ -0,0 +1,30 @@
1#ifndef __NETNS_CONNTRACK_H
2#define __NETNS_CONNTRACK_H
3
4#include <linux/list.h>
5#include <asm/atomic.h>
6
7struct ctl_table_header;
8struct nf_conntrack_ecache;
9
10struct netns_ct {
11 atomic_t count;
12 unsigned int expect_count;
13 struct hlist_head *hash;
14 struct hlist_head *expect_hash;
15 struct hlist_head unconfirmed;
16 struct ip_conntrack_stat *stat;
17#ifdef CONFIG_NF_CONNTRACK_EVENTS
18 struct nf_conntrack_ecache *ecache;
19#endif
20 int sysctl_acct;
21 int sysctl_checksum;
22 unsigned int sysctl_log_invalid; /* Log invalid packets */
23#ifdef CONFIG_SYSCTL
24 struct ctl_table_header *sysctl_header;
25 struct ctl_table_header *acct_sysctl_header;
26#endif
27 int hash_vmalloc;
28 int expect_vmalloc;
29};
30#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index a6ed83853dcc..ece1c926b5d1 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -38,6 +38,9 @@ struct netns_ipv4 {
38 struct xt_table *iptable_raw; 38 struct xt_table *iptable_raw;
39 struct xt_table *arptable_filter; 39 struct xt_table *arptable_filter;
40 struct xt_table *iptable_security; 40 struct xt_table *iptable_security;
41 struct xt_table *nat_table;
42 struct hlist_head *nat_bysource;
43 int nat_vmalloced;
41#endif 44#endif
42 45
43 int sysctl_icmp_echo_ignore_all; 46 int sysctl_icmp_echo_ignore_all;
diff --git a/include/net/netns/mib.h b/include/net/netns/mib.h
index 449147604642..10cb7c336de5 100644
--- a/include/net/netns/mib.h
+++ b/include/net/netns/mib.h
@@ -11,6 +11,15 @@ struct netns_mib {
11 DEFINE_SNMP_STAT(struct udp_mib, udplite_statistics); 11 DEFINE_SNMP_STAT(struct udp_mib, udplite_statistics);
12 DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics); 12 DEFINE_SNMP_STAT(struct icmp_mib, icmp_statistics);
13 DEFINE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics); 13 DEFINE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
14
15#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
16 struct proc_dir_entry *proc_net_devsnmp6;
17 DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6);
18 DEFINE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
19 DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
20 DEFINE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics);
21 DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);
22#endif
14}; 23};
15 24
16#endif 25#endif
diff --git a/include/net/phonet/gprs.h b/include/net/phonet/gprs.h
new file mode 100644
index 000000000000..928daf595beb
--- /dev/null
+++ b/include/net/phonet/gprs.h
@@ -0,0 +1,38 @@
1/*
2 * File: pep_gprs.h
3 *
4 * GPRS over Phonet pipe end point socket
5 *
6 * Copyright (C) 2008 Nokia Corporation.
7 *
8 * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * version 2 as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * 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., 51 Franklin St, Fifth Floor, Boston, MA
22 * 02110-1301 USA
23 */
24
25#ifndef NET_PHONET_GPRS_H
26#define NET_PHONET_GPRS_H
27
28struct sock;
29struct sk_buff;
30
31int pep_writeable(struct sock *sk);
32int pep_write(struct sock *sk, struct sk_buff *skb);
33struct sk_buff *pep_read(struct sock *sk);
34
35int gprs_attach(struct sock *sk);
36void gprs_detach(struct sock *sk);
37
38#endif
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
new file mode 100644
index 000000000000..fcd793030e4d
--- /dev/null
+++ b/include/net/phonet/pep.h
@@ -0,0 +1,160 @@
1/*
2 * File: pep.h
3 *
4 * Phonet Pipe End Point sockets definitions
5 *
6 * Copyright (C) 2008 Nokia Corporation.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef NET_PHONET_PEP_H
24#define NET_PHONET_PEP_H
25
26struct pep_sock {
27 struct pn_sock pn_sk;
28
29 /* XXX: union-ify listening vs connected stuff ? */
30 /* Listening socket stuff: */
31 struct hlist_head ackq;
32 struct hlist_head hlist;
33
34 /* Connected socket stuff: */
35 struct sock *listener;
36 struct sk_buff_head ctrlreq_queue;
37#define PNPIPE_CTRLREQ_MAX 10
38 int ifindex;
39 u16 peer_type; /* peer type/subtype */
40 u8 pipe_handle;
41
42 u8 rx_credits;
43 u8 tx_credits;
44 u8 rx_fc; /* RX flow control */
45 u8 tx_fc; /* TX flow control */
46 u8 init_enable; /* auto-enable at creation */
47};
48
49static inline struct pep_sock *pep_sk(struct sock *sk)
50{
51 return (struct pep_sock *)sk;
52}
53
54extern const struct proto_ops phonet_stream_ops;
55
56/* Pipe protocol definitions */
57struct pnpipehdr {
58 u8 utid; /* transaction ID */
59 u8 message_id;
60 u8 pipe_handle;
61 union {
62 u8 state_after_connect; /* connect request */
63 u8 state_after_reset; /* reset request */
64 u8 error_code; /* any response */
65 u8 pep_type; /* status indication */
66 u8 data[1];
67 };
68};
69#define other_pep_type data[1]
70
71static inline struct pnpipehdr *pnp_hdr(struct sk_buff *skb)
72{
73 return (struct pnpipehdr *)skb_transport_header(skb);
74}
75
76#define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4)
77
78enum {
79 PNS_PIPE_DATA = 0x20,
80
81 PNS_PEP_CONNECT_REQ = 0x40,
82 PNS_PEP_CONNECT_RESP,
83 PNS_PEP_DISCONNECT_REQ,
84 PNS_PEP_DISCONNECT_RESP,
85 PNS_PEP_RESET_REQ,
86 PNS_PEP_RESET_RESP,
87 PNS_PEP_ENABLE_REQ,
88 PNS_PEP_ENABLE_RESP,
89 PNS_PEP_CTRL_REQ,
90 PNS_PEP_CTRL_RESP,
91 PNS_PEP_DISABLE_REQ = 0x4C,
92 PNS_PEP_DISABLE_RESP,
93
94 PNS_PEP_STATUS_IND = 0x60,
95 PNS_PIPE_CREATED_IND,
96 PNS_PIPE_RESET_IND = 0x63,
97 PNS_PIPE_ENABLED_IND,
98 PNS_PIPE_REDIRECTED_IND,
99 PNS_PIPE_DISABLED_IND = 0x66,
100};
101
102#define PN_PIPE_INVALID_HANDLE 0xff
103#define PN_PEP_TYPE_COMMON 0x00
104
105/* Phonet pipe status indication */
106enum {
107 PN_PEP_IND_FLOW_CONTROL,
108 PN_PEP_IND_ID_MCFC_GRANT_CREDITS,
109};
110
111/* Phonet pipe error codes */
112enum {
113 PN_PIPE_NO_ERROR,
114 PN_PIPE_ERR_INVALID_PARAM,
115 PN_PIPE_ERR_INVALID_HANDLE,
116 PN_PIPE_ERR_INVALID_CTRL_ID,
117 PN_PIPE_ERR_NOT_ALLOWED,
118 PN_PIPE_ERR_PEP_IN_USE,
119 PN_PIPE_ERR_OVERLOAD,
120 PN_PIPE_ERR_DEV_DISCONNECTED,
121 PN_PIPE_ERR_TIMEOUT,
122 PN_PIPE_ERR_ALL_PIPES_IN_USE,
123 PN_PIPE_ERR_GENERAL,
124 PN_PIPE_ERR_NOT_SUPPORTED,
125};
126
127/* Phonet pipe states */
128enum {
129 PN_PIPE_DISABLE,
130 PN_PIPE_ENABLE,
131};
132
133/* Phonet pipe sub-block types */
134enum {
135 PN_PIPE_SB_CREATE_REQ_PEP_SUB_TYPE,
136 PN_PIPE_SB_CONNECT_REQ_PEP_SUB_TYPE,
137 PN_PIPE_SB_REDIRECT_REQ_PEP_SUB_TYPE,
138 PN_PIPE_SB_NEGOTIATED_FC,
139 PN_PIPE_SB_REQUIRED_FC_TX,
140 PN_PIPE_SB_PREFERRED_FC_RX,
141};
142
143/* Phonet pipe flow control models */
144enum {
145 PN_NO_FLOW_CONTROL,
146 PN_LEGACY_FLOW_CONTROL,
147 PN_ONE_CREDIT_FLOW_CONTROL,
148 PN_MULTI_CREDIT_FLOW_CONTROL,
149};
150
151#define pn_flow_safe(fc) ((fc) >> 1)
152
153/* Phonet pipe flow control states */
154enum {
155 PEP_IND_EMPTY,
156 PEP_IND_BUSY,
157 PEP_IND_READY,
158};
159
160#endif
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
new file mode 100644
index 000000000000..d4e72508e145
--- /dev/null
+++ b/include/net/phonet/phonet.h
@@ -0,0 +1,112 @@
1/*
2 * File: af_phonet.h
3 *
4 * Phonet sockets kernel definitions
5 *
6 * Copyright (C) 2008 Nokia Corporation.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef AF_PHONET_H
24#define AF_PHONET_H
25
26/*
27 * The lower layers may not require more space, ever. Make sure it's
28 * enough.
29 */
30#define MAX_PHONET_HEADER 8
31
32/*
33 * Every Phonet* socket has this structure first in its
34 * protocol-specific structure under name c.
35 */
36struct pn_sock {
37 struct sock sk;
38 u16 sobject;
39 u8 resource;
40};
41
42static inline struct pn_sock *pn_sk(struct sock *sk)
43{
44 return (struct pn_sock *)sk;
45}
46
47extern const struct proto_ops phonet_dgram_ops;
48
49struct sock *pn_find_sock_by_sa(const struct sockaddr_pn *sa);
50void phonet_get_local_port_range(int *min, int *max);
51void pn_sock_hash(struct sock *sk);
52void pn_sock_unhash(struct sock *sk);
53int pn_sock_get_port(struct sock *sk, unsigned short sport);
54
55int pn_skb_send(struct sock *sk, struct sk_buff *skb,
56 const struct sockaddr_pn *target);
57
58static inline struct phonethdr *pn_hdr(struct sk_buff *skb)
59{
60 return (struct phonethdr *)skb_network_header(skb);
61}
62
63static inline struct phonetmsg *pn_msg(struct sk_buff *skb)
64{
65 return (struct phonetmsg *)skb_transport_header(skb);
66}
67
68/*
69 * Get the other party's sockaddr from received skb. The skb begins
70 * with a Phonet header.
71 */
72static inline
73void pn_skb_get_src_sockaddr(struct sk_buff *skb, struct sockaddr_pn *sa)
74{
75 struct phonethdr *ph = pn_hdr(skb);
76 u16 obj = pn_object(ph->pn_sdev, ph->pn_sobj);
77
78 sa->spn_family = AF_PHONET;
79 pn_sockaddr_set_object(sa, obj);
80 pn_sockaddr_set_resource(sa, ph->pn_res);
81 memset(sa->spn_zero, 0, sizeof(sa->spn_zero));
82}
83
84static inline
85void pn_skb_get_dst_sockaddr(struct sk_buff *skb, struct sockaddr_pn *sa)
86{
87 struct phonethdr *ph = pn_hdr(skb);
88 u16 obj = pn_object(ph->pn_rdev, ph->pn_robj);
89
90 sa->spn_family = AF_PHONET;
91 pn_sockaddr_set_object(sa, obj);
92 pn_sockaddr_set_resource(sa, ph->pn_res);
93 memset(sa->spn_zero, 0, sizeof(sa->spn_zero));
94}
95
96/* Protocols in Phonet protocol family. */
97struct phonet_protocol {
98 const struct proto_ops *ops;
99 struct proto *prot;
100 int sock_type;
101};
102
103int phonet_proto_register(int protocol, struct phonet_protocol *pp);
104void phonet_proto_unregister(int protocol, struct phonet_protocol *pp);
105
106int phonet_sysctl_init(void);
107void phonet_sysctl_exit(void);
108void phonet_netlink_register(void);
109int isi_register(void);
110void isi_unregister(void);
111
112#endif
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
new file mode 100644
index 000000000000..bbd2a836e04c
--- /dev/null
+++ b/include/net/phonet/pn_dev.h
@@ -0,0 +1,50 @@
1/*
2 * File: pn_dev.h
3 *
4 * Phonet network device
5 *
6 * Copyright (C) 2008 Nokia Corporation.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef PN_DEV_H
24#define PN_DEV_H
25
26struct phonet_device_list {
27 struct list_head list;
28 spinlock_t lock;
29};
30
31extern struct phonet_device_list pndevs;
32
33struct phonet_device {
34 struct list_head list;
35 struct net_device *netdev;
36 DECLARE_BITMAP(addrs, 64);
37};
38
39void phonet_device_init(void);
40void phonet_device_exit(void);
41struct net_device *phonet_device_get(struct net *net);
42
43int phonet_address_add(struct net_device *dev, u8 addr);
44int phonet_address_del(struct net_device *dev, u8 addr);
45u8 phonet_address_get(struct net_device *dev, u8 addr);
46int phonet_address_lookup(u8 addr);
47
48#define PN_NO_ADDR 0xff
49
50#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 853fe83d9f37..4082f39f5079 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -78,6 +78,7 @@ extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
78 78
79extern int register_qdisc(struct Qdisc_ops *qops); 79extern int register_qdisc(struct Qdisc_ops *qops);
80extern int unregister_qdisc(struct Qdisc_ops *qops); 80extern int unregister_qdisc(struct Qdisc_ops *qops);
81extern void qdisc_list_del(struct Qdisc *q);
81extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 82extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
82extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 83extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
83extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, 84extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
@@ -89,10 +90,7 @@ extern void __qdisc_run(struct Qdisc *q);
89 90
90static inline void qdisc_run(struct Qdisc *q) 91static inline void qdisc_run(struct Qdisc *q)
91{ 92{
92 struct netdev_queue *txq = q->dev_queue; 93 if (!test_and_set_bit(__QDISC_STATE_RUNNING, &q->state))
93
94 if (!netif_tx_queue_stopped(txq) &&
95 !test_and_set_bit(__QDISC_STATE_RUNNING, &q->state))
96 __qdisc_run(q); 94 __qdisc_run(q);
97} 95}
98 96
diff --git a/include/net/route.h b/include/net/route.h
index 4f0d8c14736c..4e8cae0e5841 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -27,7 +27,7 @@
27#include <net/dst.h> 27#include <net/dst.h>
28#include <net/inetpeer.h> 28#include <net/inetpeer.h>
29#include <net/flow.h> 29#include <net/flow.h>
30#include <net/sock.h> 30#include <net/inet_sock.h>
31#include <linux/in_route.h> 31#include <linux/in_route.h>
32#include <linux/rtnetlink.h> 32#include <linux/rtnetlink.h>
33#include <linux/route.h> 33#include <linux/route.h>
@@ -161,6 +161,10 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
161 161
162 int err; 162 int err;
163 struct net *net = sock_net(sk); 163 struct net *net = sock_net(sk);
164
165 if (inet_sk(sk)->transparent)
166 fl.flags |= FLOWI_FLAG_ANYSRC;
167
164 if (!dst || !src) { 168 if (!dst || !src) {
165 err = __ip_route_output_key(net, rp, &fl); 169 err = __ip_route_output_key(net, rp, &fl);
166 if (err) 170 if (err)
@@ -204,4 +208,9 @@ static inline struct inet_peer *rt_get_peer(struct rtable *rt)
204 return rt->peer; 208 return rt->peer;
205} 209}
206 210
211static inline int inet_iif(const struct sk_buff *skb)
212{
213 return skb->rtable->rt_iif;
214}
215
207#endif /* _ROUTE_H */ 216#endif /* _ROUTE_H */
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 84d25f2e6188..3fe49d808957 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -53,6 +53,7 @@ struct Qdisc
53 atomic_t refcnt; 53 atomic_t refcnt;
54 unsigned long state; 54 unsigned long state;
55 struct sk_buff *gso_skb; 55 struct sk_buff *gso_skb;
56 struct sk_buff_head requeue;
56 struct sk_buff_head q; 57 struct sk_buff_head q;
57 struct netdev_queue *dev_queue; 58 struct netdev_queue *dev_queue;
58 struct Qdisc *next_sched; 59 struct Qdisc *next_sched;
@@ -193,6 +194,11 @@ static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc)
193 return qdisc->dev_queue->qdisc; 194 return qdisc->dev_queue->qdisc;
194} 195}
195 196
197static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc)
198{
199 return qdisc->dev_queue->qdisc_sleeping;
200}
201
196/* The qdisc root lock is a mechanism by which to top level 202/* The qdisc root lock is a mechanism by which to top level
197 * of a qdisc tree can be locked from any qdisc node in the 203 * of a qdisc tree can be locked from any qdisc node in the
198 * forest. This allows changing the configuration of some 204 * forest. This allows changing the configuration of some
@@ -212,6 +218,14 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
212 return qdisc_lock(root); 218 return qdisc_lock(root);
213} 219}
214 220
221static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc)
222{
223 struct Qdisc *root = qdisc_root_sleeping(qdisc);
224
225 ASSERT_RTNL();
226 return qdisc_lock(root);
227}
228
215static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) 229static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
216{ 230{
217 return qdisc->dev_queue->dev; 231 return qdisc->dev_queue->dev;
@@ -219,12 +233,12 @@ static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
219 233
220static inline void sch_tree_lock(struct Qdisc *q) 234static inline void sch_tree_lock(struct Qdisc *q)
221{ 235{
222 spin_lock_bh(qdisc_root_lock(q)); 236 spin_lock_bh(qdisc_root_sleeping_lock(q));
223} 237}
224 238
225static inline void sch_tree_unlock(struct Qdisc *q) 239static inline void sch_tree_unlock(struct Qdisc *q)
226{ 240{
227 spin_unlock_bh(qdisc_root_lock(q)); 241 spin_unlock_bh(qdisc_root_sleeping_lock(q));
228} 242}
229 243
230#define tcf_tree_lock(tp) sch_tree_lock((tp)->q) 244#define tcf_tree_lock(tp) sch_tree_lock((tp)->q)
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c32ddf0279c8..b05b0557211f 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -261,7 +261,9 @@ enum { SCTP_ARBITRARY_COOKIE_ECHO_LEN = 200 };
261 * must be less than 65535 (2^16 - 1), or we will have overflow 261 * must be less than 65535 (2^16 - 1), or we will have overflow
262 * problems creating SACK's. 262 * problems creating SACK's.
263 */ 263 */
264#define SCTP_TSN_MAP_SIZE 2048 264#define SCTP_TSN_MAP_INITIAL BITS_PER_LONG
265#define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL
266#define SCTP_TSN_MAP_SIZE 4096
265#define SCTP_TSN_MAX_GAP 65535 267#define SCTP_TSN_MAX_GAP 65535
266 268
267/* We will not record more than this many duplicate TSNs between two 269/* We will not record more than this many duplicate TSNs between two
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 17b932b8a55a..ed71b110edf7 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -303,7 +303,7 @@ extern int sctp_debug_flag;
303#define SCTP_ASSERT(expr, str, func) \ 303#define SCTP_ASSERT(expr, str, func) \
304 if (!(expr)) { \ 304 if (!(expr)) { \
305 SCTP_DEBUG_PRINTK("Assertion Failed: %s(%s) at %s:%s:%d\n", \ 305 SCTP_DEBUG_PRINTK("Assertion Failed: %s(%s) at %s:%s:%d\n", \
306 str, (#expr), __FILE__, __FUNCTION__, __LINE__); \ 306 str, (#expr), __FILE__, __func__, __LINE__); \
307 func; \ 307 func; \
308 } 308 }
309 309
@@ -406,10 +406,7 @@ struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id);
406 406
407/* A macro to walk a list of skbs. */ 407/* A macro to walk a list of skbs. */
408#define sctp_skb_for_each(pos, head, tmp) \ 408#define sctp_skb_for_each(pos, head, tmp) \
409for (pos = (head)->next;\ 409 skb_queue_walk_safe(head, pos, tmp)
410 tmp = (pos)->next, pos != ((struct sk_buff *)(head));\
411 pos = tmp)
412
413 410
414/* A helper to append an entire skb list (list) to another (head). */ 411/* A helper to append an entire skb list (list) to another (head). */
415static inline void sctp_skb_list_tail(struct sk_buff_head *list, 412static inline void sctp_skb_list_tail(struct sk_buff_head *list,
@@ -420,10 +417,7 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list,
420 sctp_spin_lock_irqsave(&head->lock, flags); 417 sctp_spin_lock_irqsave(&head->lock, flags);
421 sctp_spin_lock(&list->lock); 418 sctp_spin_lock(&list->lock);
422 419
423 list_splice((struct list_head *)list, (struct list_head *)head->prev); 420 skb_queue_splice_tail_init(list, head);
424
425 head->qlen += list->qlen;
426 list->qlen = 0;
427 421
428 sctp_spin_unlock(&list->lock); 422 sctp_spin_unlock(&list->lock);
429 sctp_spin_unlock_irqrestore(&head->lock, flags); 423 sctp_spin_unlock_irqrestore(&head->lock, flags);
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 24811732bdb2..029a54a02396 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -227,6 +227,9 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
227 const struct sctp_chunk *, 227 const struct sctp_chunk *,
228 const __u8 *, 228 const __u8 *,
229 const size_t ); 229 const size_t );
230struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *,
231 const struct sctp_chunk *,
232 struct sctp_paramhdr *);
230struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, 233struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *,
231 const struct sctp_transport *, 234 const struct sctp_transport *,
232 const void *payload, 235 const void *payload,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index ab1c472ea753..9661d7b765f0 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -731,20 +731,23 @@ struct sctp_chunk {
731 */ 731 */
732 struct sk_buff *auth_chunk; 732 struct sk_buff *auth_chunk;
733 733
734 __u8 rtt_in_progress; /* Is this chunk used for RTT calculation? */ 734#define SCTP_CAN_FRTX 0x0
735 __u8 resent; /* Has this chunk ever been retransmitted. */ 735#define SCTP_NEED_FRTX 0x1
736 __u8 has_tsn; /* Does this chunk have a TSN yet? */ 736#define SCTP_DONT_FRTX 0x2
737 __u8 has_ssn; /* Does this chunk have a SSN yet? */ 737 __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */
738 __u8 singleton; /* Was this the only chunk in the packet? */ 738 resent:1, /* Has this chunk ever been resent. */
739 __u8 end_of_packet; /* Was this the last chunk in the packet? */ 739 has_tsn:1, /* Does this chunk have a TSN yet? */
740 __u8 ecn_ce_done; /* Have we processed the ECN CE bit? */ 740 has_ssn:1, /* Does this chunk have a SSN yet? */
741 __u8 pdiscard; /* Discard the whole packet now? */ 741 singleton:1, /* Only chunk in the packet? */
742 __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ 742 end_of_packet:1, /* Last chunk in the packet? */
743 __s8 fast_retransmit; /* Is this chunk fast retransmitted? */ 743 ecn_ce_done:1, /* Have we processed the ECN CE bit? */
744 __u8 tsn_missing_report; /* Data chunk missing counter. */ 744 pdiscard:1, /* Discard the whole packet now? */
745 __u8 data_accepted; /* At least 1 chunk in this packet accepted */ 745 tsn_gap_acked:1, /* Is this chunk acked by a GAP ACK? */
746 __u8 auth; /* IN: was auth'ed | OUT: needs auth */ 746 data_accepted:1, /* At least 1 chunk accepted */
747 __u8 has_asconf; /* IN: have seen an asconf before */ 747 auth:1, /* IN: was auth'ed | OUT: needs auth */
748 has_asconf:1, /* IN: have seen an asconf before */
749 tsn_missing_report:2, /* Data chunk missing counter. */
750 fast_retransmit:2; /* Is this chunk fast retransmitted? */
748}; 751};
749 752
750void sctp_chunk_hold(struct sctp_chunk *); 753void sctp_chunk_hold(struct sctp_chunk *);
@@ -1225,7 +1228,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len,
1225 1228
1226sctp_scope_t sctp_scope(const union sctp_addr *); 1229sctp_scope_t sctp_scope(const union sctp_addr *);
1227int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); 1230int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope);
1228int sctp_is_any(const union sctp_addr *addr); 1231int sctp_is_any(struct sock *sk, const union sctp_addr *addr);
1229int sctp_addr_is_valid(const union sctp_addr *addr); 1232int sctp_addr_is_valid(const union sctp_addr *addr);
1230 1233
1231 1234
@@ -1542,7 +1545,6 @@ struct sctp_association {
1542 * in tsn_map--we get it by calling sctp_tsnmap_get_ctsn(). 1545 * in tsn_map--we get it by calling sctp_tsnmap_get_ctsn().
1543 */ 1546 */
1544 struct sctp_tsnmap tsn_map; 1547 struct sctp_tsnmap tsn_map;
1545 __u8 _map[sctp_tsnmap_storage_size(SCTP_TSN_MAP_SIZE)];
1546 1548
1547 /* Ack State : This flag indicates if the next received 1549 /* Ack State : This flag indicates if the next received
1548 * : packet is to be responded to with a 1550 * : packet is to be responded to with a
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 099211bf998d..4aabc5a96cf6 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -60,18 +60,7 @@ struct sctp_tsnmap {
60 * It points at one of the two buffers with which we will 60 * It points at one of the two buffers with which we will
61 * ping-pong between. 61 * ping-pong between.
62 */ 62 */
63 __u8 *tsn_map; 63 unsigned long *tsn_map;
64
65 /* This marks the tsn which overflows the tsn_map, when the
66 * cumulative ack point reaches this point we know we can switch
67 * maps (tsn_map and overflow_map swap).
68 */
69 __u32 overflow_tsn;
70
71 /* This is the overflow array for tsn_map.
72 * It points at one of the other ping-pong buffers.
73 */
74 __u8 *overflow_map;
75 64
76 /* This is the TSN at tsn_map[0]. */ 65 /* This is the TSN at tsn_map[0]. */
77 __u32 base_tsn; 66 __u32 base_tsn;
@@ -89,15 +78,15 @@ struct sctp_tsnmap {
89 */ 78 */
90 __u32 cumulative_tsn_ack_point; 79 __u32 cumulative_tsn_ack_point;
91 80
81 /* This is the highest TSN we've marked. */
82 __u32 max_tsn_seen;
83
92 /* This is the minimum number of TSNs we can track. This corresponds 84 /* This is the minimum number of TSNs we can track. This corresponds
93 * to the size of tsn_map. Note: the overflow_map allows us to 85 * to the size of tsn_map. Note: the overflow_map allows us to
94 * potentially track more than this quantity. 86 * potentially track more than this quantity.
95 */ 87 */
96 __u16 len; 88 __u16 len;
97 89
98 /* This is the highest TSN we've marked. */
99 __u32 max_tsn_seen;
100
101 /* Data chunks pending receipt. used by SCTP_STATUS sockopt */ 90 /* Data chunks pending receipt. used by SCTP_STATUS sockopt */
102 __u16 pending_data; 91 __u16 pending_data;
103 92
@@ -105,29 +94,19 @@ struct sctp_tsnmap {
105 * every SACK. Store up to SCTP_MAX_DUP_TSNS worth of 94 * every SACK. Store up to SCTP_MAX_DUP_TSNS worth of
106 * information. 95 * information.
107 */ 96 */
108 __be32 dup_tsns[SCTP_MAX_DUP_TSNS];
109 __u16 num_dup_tsns; 97 __u16 num_dup_tsns;
110 98 __be32 dup_tsns[SCTP_MAX_DUP_TSNS];
111 /* Record gap ack block information here. */
112 struct sctp_gap_ack_block gabs[SCTP_MAX_GABS];
113
114 int malloced;
115
116 __u8 raw_map[0];
117}; 99};
118 100
119struct sctp_tsnmap_iter { 101struct sctp_tsnmap_iter {
120 __u32 start; 102 __u32 start;
121}; 103};
122 104
123/* This macro assists in creation of external storage for variable length
124 * internal buffers. We double allocate so the overflow map works.
125 */
126#define sctp_tsnmap_storage_size(count) (sizeof(__u8) * (count) * 2)
127
128/* Initialize a block of memory as a tsnmap. */ 105/* Initialize a block of memory as a tsnmap. */
129struct sctp_tsnmap *sctp_tsnmap_init(struct sctp_tsnmap *, __u16 len, 106struct sctp_tsnmap *sctp_tsnmap_init(struct sctp_tsnmap *, __u16 len,
130 __u32 initial_tsn); 107 __u32 initial_tsn, gfp_t gfp);
108
109void sctp_tsnmap_free(struct sctp_tsnmap *map);
131 110
132/* Test the tracking state of this TSN. 111/* Test the tracking state of this TSN.
133 * Returns: 112 * Returns:
@@ -138,7 +117,7 @@ struct sctp_tsnmap *sctp_tsnmap_init(struct sctp_tsnmap *, __u16 len,
138int sctp_tsnmap_check(const struct sctp_tsnmap *, __u32 tsn); 117int sctp_tsnmap_check(const struct sctp_tsnmap *, __u32 tsn);
139 118
140/* Mark this TSN as seen. */ 119/* Mark this TSN as seen. */
141void sctp_tsnmap_mark(struct sctp_tsnmap *, __u32 tsn); 120int sctp_tsnmap_mark(struct sctp_tsnmap *, __u32 tsn);
142 121
143/* Mark this TSN and all lower as seen. */ 122/* Mark this TSN and all lower as seen. */
144void sctp_tsnmap_skip(struct sctp_tsnmap *map, __u32 tsn); 123void sctp_tsnmap_skip(struct sctp_tsnmap *map, __u32 tsn);
@@ -169,24 +148,16 @@ static inline __be32 *sctp_tsnmap_get_dups(struct sctp_tsnmap *map)
169} 148}
170 149
171/* How many gap ack blocks do we have recorded? */ 150/* How many gap ack blocks do we have recorded? */
172__u16 sctp_tsnmap_num_gabs(struct sctp_tsnmap *map); 151__u16 sctp_tsnmap_num_gabs(struct sctp_tsnmap *map,
152 struct sctp_gap_ack_block *gabs);
173 153
174/* Refresh the count on pending data. */ 154/* Refresh the count on pending data. */
175__u16 sctp_tsnmap_pending(struct sctp_tsnmap *map); 155__u16 sctp_tsnmap_pending(struct sctp_tsnmap *map);
176 156
177/* Return pointer to gap ack blocks as needed by SACK. */
178static inline struct sctp_gap_ack_block *sctp_tsnmap_get_gabs(struct sctp_tsnmap *map)
179{
180 return map->gabs;
181}
182
183/* Is there a gap in the TSN map? */ 157/* Is there a gap in the TSN map? */
184static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) 158static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map)
185{ 159{
186 int has_gap; 160 return (map->cumulative_tsn_ack_point != map->max_tsn_seen);
187
188 has_gap = (map->cumulative_tsn_ack_point != map->max_tsn_seen);
189 return has_gap;
190} 161}
191 162
192/* Mark a duplicate TSN. Note: limit the storage of duplicate TSN 163/* Mark a duplicate TSN. Note: limit the storage of duplicate TSN
diff --git a/include/net/sock.h b/include/net/sock.h
index 06c5259aff30..ada50c04d09f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -482,6 +482,11 @@ static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb)
482 skb->next = NULL; 482 skb->next = NULL;
483} 483}
484 484
485static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
486{
487 return sk->sk_backlog_rcv(sk, skb);
488}
489
485#define sk_wait_event(__sk, __timeo, __condition) \ 490#define sk_wait_event(__sk, __timeo, __condition) \
486 ({ int __rc; \ 491 ({ int __rc; \
487 release_sock(__sk); \ 492 release_sock(__sk); \
@@ -532,6 +537,7 @@ struct proto {
532 int (*getsockopt)(struct sock *sk, int level, 537 int (*getsockopt)(struct sock *sk, int level,
533 int optname, char __user *optval, 538 int optname, char __user *optval,
534 int __user *option); 539 int __user *option);
540#ifdef CONFIG_COMPAT
535 int (*compat_setsockopt)(struct sock *sk, 541 int (*compat_setsockopt)(struct sock *sk,
536 int level, 542 int level,
537 int optname, char __user *optval, 543 int optname, char __user *optval,
@@ -540,6 +546,7 @@ struct proto {
540 int level, 546 int level,
541 int optname, char __user *optval, 547 int optname, char __user *optval,
542 int __user *option); 548 int __user *option);
549#endif
543 int (*sendmsg)(struct kiocb *iocb, struct sock *sk, 550 int (*sendmsg)(struct kiocb *iocb, struct sock *sk,
544 struct msghdr *msg, size_t len); 551 struct msghdr *msg, size_t len);
545 int (*recvmsg)(struct kiocb *iocb, struct sock *sk, 552 int (*recvmsg)(struct kiocb *iocb, struct sock *sk,
@@ -1322,6 +1329,18 @@ static inline void sk_change_net(struct sock *sk, struct net *net)
1322 sock_net_set(sk, hold_net(net)); 1329 sock_net_set(sk, hold_net(net));
1323} 1330}
1324 1331
1332static inline struct sock *skb_steal_sock(struct sk_buff *skb)
1333{
1334 if (unlikely(skb->sk)) {
1335 struct sock *sk = skb->sk;
1336
1337 skb->destructor = NULL;
1338 skb->sk = NULL;
1339 return sk;
1340 }
1341 return NULL;
1342}
1343
1325extern void sock_enable_timestamp(struct sock *sk); 1344extern void sock_enable_timestamp(struct sock *sk);
1326extern int sock_get_timestamp(struct sock *, struct timeval __user *); 1345extern int sock_get_timestamp(struct sock *, struct timeval __user *);
1327extern int sock_get_timestampns(struct sock *, struct timespec __user *); 1346extern int sock_get_timestampns(struct sock *, struct timespec __user *);
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h
new file mode 100644
index 000000000000..6abb3ed3ebf7
--- /dev/null
+++ b/include/net/tc_act/tc_skbedit.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (c) 2008, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
18 */
19
20#ifndef __NET_TC_SKBEDIT_H
21#define __NET_TC_SKBEDIT_H
22
23#include <net/act_api.h>
24
25struct tcf_skbedit {
26 struct tcf_common common;
27 u32 flags;
28 u32 priority;
29 u16 queue_mapping;
30};
31#define to_skbedit(pc) \
32 container_of(pc, struct tcf_skbedit, common)
33
34#endif /* __NET_TC_SKBEDIT_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 8983386356a5..438014d57610 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -472,6 +472,8 @@ extern void tcp_send_delayed_ack(struct sock *sk);
472 472
473/* tcp_input.c */ 473/* tcp_input.c */
474extern void tcp_cwnd_application_limited(struct sock *sk); 474extern void tcp_cwnd_application_limited(struct sock *sk);
475extern void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp,
476 struct sk_buff *skb);
475 477
476/* tcp_timer.c */ 478/* tcp_timer.c */
477extern void tcp_init_xmit_timers(struct sock *); 479extern void tcp_init_xmit_timers(struct sock *);
@@ -894,7 +896,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
894 BUG_ON(sock_owned_by_user(sk)); 896 BUG_ON(sock_owned_by_user(sk));
895 897
896 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { 898 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
897 sk->sk_backlog_rcv(sk, skb1); 899 sk_backlog_rcv(sk, skb1);
898 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED); 900 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED);
899 } 901 }
900 902
@@ -974,6 +976,7 @@ static inline void tcp_openreq_init(struct request_sock *req,
974 ireq->acked = 0; 976 ireq->acked = 0;
975 ireq->ecn_ok = 0; 977 ireq->ecn_ok = 0;
976 ireq->rmt_port = tcp_hdr(skb)->source; 978 ireq->rmt_port = tcp_hdr(skb)->source;
979 ireq->loc_port = tcp_hdr(skb)->dest;
977} 980}
978 981
979extern void tcp_enter_memory_pressure(struct sock *sk); 982extern void tcp_enter_memory_pressure(struct sock *sk);
@@ -1039,13 +1042,12 @@ static inline void tcp_clear_retrans_hints_partial(struct tcp_sock *tp)
1039{ 1042{
1040 tp->lost_skb_hint = NULL; 1043 tp->lost_skb_hint = NULL;
1041 tp->scoreboard_skb_hint = NULL; 1044 tp->scoreboard_skb_hint = NULL;
1042 tp->retransmit_skb_hint = NULL;
1043 tp->forward_skb_hint = NULL;
1044} 1045}
1045 1046
1046static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp) 1047static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp)
1047{ 1048{
1048 tcp_clear_retrans_hints_partial(tp); 1049 tcp_clear_retrans_hints_partial(tp);
1050 tp->retransmit_skb_hint = NULL;
1049} 1051}
1050 1052
1051/* MD5 Signature */ 1053/* MD5 Signature */
@@ -1180,49 +1182,45 @@ static inline void tcp_write_queue_purge(struct sock *sk)
1180 1182
1181static inline struct sk_buff *tcp_write_queue_head(struct sock *sk) 1183static inline struct sk_buff *tcp_write_queue_head(struct sock *sk)
1182{ 1184{
1183 struct sk_buff *skb = sk->sk_write_queue.next; 1185 return skb_peek(&sk->sk_write_queue);
1184 if (skb == (struct sk_buff *) &sk->sk_write_queue)
1185 return NULL;
1186 return skb;
1187} 1186}
1188 1187
1189static inline struct sk_buff *tcp_write_queue_tail(struct sock *sk) 1188static inline struct sk_buff *tcp_write_queue_tail(struct sock *sk)
1190{ 1189{
1191 struct sk_buff *skb = sk->sk_write_queue.prev; 1190 return skb_peek_tail(&sk->sk_write_queue);
1192 if (skb == (struct sk_buff *) &sk->sk_write_queue)
1193 return NULL;
1194 return skb;
1195} 1191}
1196 1192
1197static inline struct sk_buff *tcp_write_queue_next(struct sock *sk, struct sk_buff *skb) 1193static inline struct sk_buff *tcp_write_queue_next(struct sock *sk, struct sk_buff *skb)
1198{ 1194{
1199 return skb->next; 1195 return skb_queue_next(&sk->sk_write_queue, skb);
1200} 1196}
1201 1197
1202#define tcp_for_write_queue(skb, sk) \ 1198#define tcp_for_write_queue(skb, sk) \
1203 for (skb = (sk)->sk_write_queue.next; \ 1199 skb_queue_walk(&(sk)->sk_write_queue, skb)
1204 (skb != (struct sk_buff *)&(sk)->sk_write_queue); \
1205 skb = skb->next)
1206 1200
1207#define tcp_for_write_queue_from(skb, sk) \ 1201#define tcp_for_write_queue_from(skb, sk) \
1208 for (; (skb != (struct sk_buff *)&(sk)->sk_write_queue);\ 1202 skb_queue_walk_from(&(sk)->sk_write_queue, skb)
1209 skb = skb->next)
1210 1203
1211#define tcp_for_write_queue_from_safe(skb, tmp, sk) \ 1204#define tcp_for_write_queue_from_safe(skb, tmp, sk) \
1212 for (tmp = skb->next; \ 1205 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
1213 (skb != (struct sk_buff *)&(sk)->sk_write_queue); \
1214 skb = tmp, tmp = skb->next)
1215 1206
1216static inline struct sk_buff *tcp_send_head(struct sock *sk) 1207static inline struct sk_buff *tcp_send_head(struct sock *sk)
1217{ 1208{
1218 return sk->sk_send_head; 1209 return sk->sk_send_head;
1219} 1210}
1220 1211
1212static inline bool tcp_skb_is_last(const struct sock *sk,
1213 const struct sk_buff *skb)
1214{
1215 return skb_queue_is_last(&sk->sk_write_queue, skb);
1216}
1217
1221static inline void tcp_advance_send_head(struct sock *sk, struct sk_buff *skb) 1218static inline void tcp_advance_send_head(struct sock *sk, struct sk_buff *skb)
1222{ 1219{
1223 sk->sk_send_head = skb->next; 1220 if (tcp_skb_is_last(sk, skb))
1224 if (sk->sk_send_head == (struct sk_buff *)&sk->sk_write_queue)
1225 sk->sk_send_head = NULL; 1221 sk->sk_send_head = NULL;
1222 else
1223 sk->sk_send_head = tcp_write_queue_next(sk, skb);
1226} 1224}
1227 1225
1228static inline void tcp_check_send_head(struct sock *sk, struct sk_buff *skb_unlinked) 1226static inline void tcp_check_send_head(struct sock *sk, struct sk_buff *skb_unlinked)
@@ -1267,12 +1265,12 @@ static inline void tcp_insert_write_queue_after(struct sk_buff *skb,
1267 __skb_queue_after(&sk->sk_write_queue, skb, buff); 1265 __skb_queue_after(&sk->sk_write_queue, skb, buff);
1268} 1266}
1269 1267
1270/* Insert skb between prev and next on the write queue of sk. */ 1268/* Insert new before skb on the write queue of sk. */
1271static inline void tcp_insert_write_queue_before(struct sk_buff *new, 1269static inline void tcp_insert_write_queue_before(struct sk_buff *new,
1272 struct sk_buff *skb, 1270 struct sk_buff *skb,
1273 struct sock *sk) 1271 struct sock *sk)
1274{ 1272{
1275 __skb_insert(new, skb->prev, skb, &sk->sk_write_queue); 1273 __skb_queue_before(&sk->sk_write_queue, skb, new);
1276 1274
1277 if (sk->sk_send_head == skb) 1275 if (sk->sk_send_head == skb)
1278 sk->sk_send_head = new; 1276 sk->sk_send_head = new;
@@ -1283,12 +1281,6 @@ static inline void tcp_unlink_write_queue(struct sk_buff *skb, struct sock *sk)
1283 __skb_unlink(skb, &sk->sk_write_queue); 1281 __skb_unlink(skb, &sk->sk_write_queue);
1284} 1282}
1285 1283
1286static inline int tcp_skb_is_last(const struct sock *sk,
1287 const struct sk_buff *skb)
1288{
1289 return skb->next == (struct sk_buff *)&sk->sk_write_queue;
1290}
1291
1292static inline int tcp_write_queue_empty(struct sock *sk) 1284static inline int tcp_write_queue_empty(struct sock *sk)
1293{ 1285{
1294 return skb_queue_empty(&sk->sk_write_queue); 1286 return skb_queue_empty(&sk->sk_write_queue);
diff --git a/include/net/udp.h b/include/net/udp.h
index addcdc67234c..1e205095ea68 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -148,10 +148,9 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
148 char __user *optval, int optlen, 148 char __user *optval, int optlen,
149 int (*push_pending_frames)(struct sock *)); 149 int (*push_pending_frames)(struct sock *));
150 150
151DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); 151extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
152 152 __be32 daddr, __be16 dport,
153/* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ 153 int dif);
154DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
155 154
156/* 155/*
157 * SNMP statistics for UDP and UDP-Lite 156 * SNMP statistics for UDP and UDP-Lite
@@ -163,12 +162,14 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
163 if (is_udplite) SNMP_INC_STATS_BH((net)->mib.udplite_statistics, field); \ 162 if (is_udplite) SNMP_INC_STATS_BH((net)->mib.udplite_statistics, field); \
164 else SNMP_INC_STATS_BH((net)->mib.udp_statistics, field); } while(0) 163 else SNMP_INC_STATS_BH((net)->mib.udp_statistics, field); } while(0)
165 164
166#define UDP6_INC_STATS_BH(net, field, is_udplite) do { (void)net; \ 165#define UDP6_INC_STATS_BH(net, field, is_udplite) do { \
167 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ 166 if (is_udplite) SNMP_INC_STATS_BH((net)->mib.udplite_stats_in6, field);\
168 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) 167 else SNMP_INC_STATS_BH((net)->mib.udp_stats_in6, field); \
169#define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \ 168} while(0)
170 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ 169#define UDP6_INC_STATS_USER(net, field, __lite) do { \
171 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) 170 if (__lite) SNMP_INC_STATS_USER((net)->mib.udplite_stats_in6, field); \
171 else SNMP_INC_STATS_USER((net)->mib.udp_stats_in6, field); \
172} while(0)
172 173
173#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 174#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
174#define UDPX_INC_STATS_BH(sk, field) \ 175#define UDPX_INC_STATS_BH(sk, field) \
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 9324f8dd183e..721efb363db7 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -60,6 +60,7 @@ enum ieee80211_channel_flags {
60 * with cfg80211. 60 * with cfg80211.
61 * 61 *
62 * @center_freq: center frequency in MHz 62 * @center_freq: center frequency in MHz
63 * @max_bandwidth: maximum allowed bandwidth for this channel, in MHz
63 * @hw_value: hardware-specific value for the channel 64 * @hw_value: hardware-specific value for the channel
64 * @flags: channel flags from &enum ieee80211_channel_flags. 65 * @flags: channel flags from &enum ieee80211_channel_flags.
65 * @orig_flags: channel flags at registration time, used by regulatory 66 * @orig_flags: channel flags at registration time, used by regulatory
@@ -73,6 +74,7 @@ enum ieee80211_channel_flags {
73struct ieee80211_channel { 74struct ieee80211_channel {
74 enum ieee80211_band band; 75 enum ieee80211_band band;
75 u16 center_freq; 76 u16 center_freq;
77 u8 max_bandwidth;
76 u16 hw_value; 78 u16 hw_value;
77 u32 flags; 79 u32 flags;
78 int max_antenna_gain; 80 int max_antenna_gain;
@@ -178,6 +180,7 @@ struct ieee80211_supported_band {
178 * struct wiphy - wireless hardware description 180 * struct wiphy - wireless hardware description
179 * @idx: the wiphy index assigned to this item 181 * @idx: the wiphy index assigned to this item
180 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 182 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
183 * @reg_notifier: the driver's regulatory notification callback
181 */ 184 */
182struct wiphy { 185struct wiphy {
183 /* assign these fields before you register the wiphy */ 186 /* assign these fields before you register the wiphy */
@@ -185,6 +188,9 @@ struct wiphy {
185 /* permanent MAC address */ 188 /* permanent MAC address */
186 u8 perm_addr[ETH_ALEN]; 189 u8 perm_addr[ETH_ALEN];
187 190
191 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
192 u16 interface_modes;
193
188 /* If multiple wiphys are registered and you're handed e.g. 194 /* If multiple wiphys are registered and you're handed e.g.
189 * a regular netdev with assigned ieee80211_ptr, you won't 195 * a regular netdev with assigned ieee80211_ptr, you won't
190 * know whether it points to a wiphy your driver has registered 196 * know whether it points to a wiphy your driver has registered
@@ -194,6 +200,9 @@ struct wiphy {
194 200
195 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 201 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
196 202
203 /* Lets us get back the wiphy on the callback */
204 int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby);
205
197 /* fields below are read-only, assigned by cfg80211 */ 206 /* fields below are read-only, assigned by cfg80211 */
198 207
199 /* the item in /sys/class/ieee80211/ points to this, 208 /* the item in /sys/class/ieee80211/ points to this,
@@ -214,9 +223,11 @@ struct wiphy {
214 * the netdev.) 223 * the netdev.)
215 * 224 *
216 * @wiphy: pointer to hardware description 225 * @wiphy: pointer to hardware description
226 * @iftype: interface type
217 */ 227 */
218struct wireless_dev { 228struct wireless_dev {
219 struct wiphy *wiphy; 229 struct wiphy *wiphy;
230 enum nl80211_iftype iftype;
220 231
221 /* private to the generic wireless code */ 232 /* private to the generic wireless code */
222 struct list_head list; 233 struct list_head list;
@@ -319,7 +330,6 @@ extern int ieee80211_frequency_to_channel(int freq);
319 */ 330 */
320extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, 331extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
321 int freq); 332 int freq);
322
323/** 333/**
324 * ieee80211_get_channel - get channel struct from wiphy for specified frequency 334 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
325 */ 335 */
@@ -328,4 +338,57 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
328{ 338{
329 return __ieee80211_get_channel(wiphy, freq); 339 return __ieee80211_get_channel(wiphy, freq);
330} 340}
341
342/**
343 * __regulatory_hint - hint to the wireless core a regulatory domain
344 * @wiphy: if a driver is providing the hint this is the driver's very
345 * own &struct wiphy
346 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
347 * should be in. If @rd is set this should be NULL
348 * @rd: a complete regulatory domain, if passed the caller need not worry
349 * about freeing it
350 *
351 * The Wireless subsystem can use this function to hint to the wireless core
352 * what it believes should be the current regulatory domain by
353 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
354 * domain should be in or by providing a completely build regulatory domain.
355 *
356 * Returns -EALREADY if *a regulatory domain* has already been set. Note that
357 * this could be by another driver. It is safe for drivers to continue if
358 * -EALREADY is returned, if drivers are not capable of world roaming they
359 * should not register more channels than they support. Right now we only
360 * support listening to the first driver hint. If the driver is capable
361 * of world roaming but wants to respect its own EEPROM mappings for
362 * specific regulatory domains it should register the @reg_notifier callback
363 * on the &struct wiphy. Returns 0 if the hint went through fine or through an
364 * intersection operation. Otherwise a standard error code is returned.
365 *
366 */
367extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
368 const char *alpha2, struct ieee80211_regdomain *rd);
369/**
370 * regulatory_hint - driver hint to the wireless core a regulatory domain
371 * @wiphy: the driver's very own &struct wiphy
372 * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain
373 * should be in. If @rd is set this should be NULL. Note that if you
374 * set this to NULL you should still set rd->alpha2 to some accepted
375 * alpha2.
376 * @rd: a complete regulatory domain provided by the driver. If passed
377 * the driver does not need to worry about freeing it.
378 *
379 * Wireless drivers can use this function to hint to the wireless core
380 * what it believes should be the current regulatory domain by
381 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
382 * domain should be in or by providing a completely build regulatory domain.
383 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried
384 * for a regulatory domain structure for the respective country. If
385 * a regulatory domain is build and passed you should set the alpha2
386 * if possible, otherwise set it to the special value of "99" which tells
387 * the wireless core it is unknown. If you pass a built regulatory domain
388 * and we return non zero you are in charge of kfree()'ing the structure.
389 *
390 * See __regulatory_hint() documentation for possible return values.
391 */
392extern int regulatory_hint(struct wiphy *wiphy,
393 const char *alpha2, struct ieee80211_regdomain *rd);
331#endif /* __NET_WIRELESS_H */ 394#endif /* __NET_WIRELESS_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 2933d7474a79..11c890ad8ebb 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -117,12 +117,23 @@ extern struct mutex xfrm_cfg_mutex;
117 metrics. Plus, it will be made via sk->sk_dst_cache. Solved. 117 metrics. Plus, it will be made via sk->sk_dst_cache. Solved.
118 */ 118 */
119 119
120struct xfrm_state_walk {
121 struct list_head all;
122 u8 state;
123 union {
124 u8 dying;
125 u8 proto;
126 };
127 u32 seq;
128};
129
120/* Full description of state of transformer. */ 130/* Full description of state of transformer. */
121struct xfrm_state 131struct xfrm_state
122{ 132{
123 /* Note: bydst is re-used during gc */ 133 union {
124 struct list_head all; 134 struct hlist_node gclist;
125 struct hlist_node bydst; 135 struct hlist_node bydst;
136 };
126 struct hlist_node bysrc; 137 struct hlist_node bysrc;
127 struct hlist_node byspi; 138 struct hlist_node byspi;
128 139
@@ -134,12 +145,8 @@ struct xfrm_state
134 145
135 u32 genid; 146 u32 genid;
136 147
137 /* Key manger bits */ 148 /* Key manager bits */
138 struct { 149 struct xfrm_state_walk km;
139 u8 state;
140 u8 dying;
141 u32 seq;
142 } km;
143 150
144 /* Parameters of this state. */ 151 /* Parameters of this state. */
145 struct { 152 struct {
@@ -447,10 +454,20 @@ struct xfrm_tmpl
447 454
448#define XFRM_MAX_DEPTH 6 455#define XFRM_MAX_DEPTH 6
449 456
457struct xfrm_policy_walk_entry {
458 struct list_head all;
459 u8 dead;
460};
461
462struct xfrm_policy_walk {
463 struct xfrm_policy_walk_entry walk;
464 u8 type;
465 u32 seq;
466};
467
450struct xfrm_policy 468struct xfrm_policy
451{ 469{
452 struct xfrm_policy *next; 470 struct xfrm_policy *next;
453 struct list_head bytype;
454 struct hlist_node bydst; 471 struct hlist_node bydst;
455 struct hlist_node byidx; 472 struct hlist_node byidx;
456 473
@@ -465,17 +482,23 @@ struct xfrm_policy
465 struct xfrm_lifetime_cfg lft; 482 struct xfrm_lifetime_cfg lft;
466 struct xfrm_lifetime_cur curlft; 483 struct xfrm_lifetime_cur curlft;
467 struct dst_entry *bundles; 484 struct dst_entry *bundles;
468 u16 family; 485 struct xfrm_policy_walk_entry walk;
469 u8 type; 486 u8 type;
470 u8 action; 487 u8 action;
471 u8 flags; 488 u8 flags;
472 u8 dead;
473 u8 xfrm_nr; 489 u8 xfrm_nr;
474 /* XXX 1 byte hole, try to pack */ 490 u16 family;
475 struct xfrm_sec_ctx *security; 491 struct xfrm_sec_ctx *security;
476 struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; 492 struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH];
477}; 493};
478 494
495struct xfrm_kmaddress {
496 xfrm_address_t local;
497 xfrm_address_t remote;
498 u32 reserved;
499 u16 family;
500};
501
479struct xfrm_migrate { 502struct xfrm_migrate {
480 xfrm_address_t old_daddr; 503 xfrm_address_t old_daddr;
481 xfrm_address_t old_saddr; 504 xfrm_address_t old_saddr;
@@ -515,7 +538,7 @@ struct xfrm_mgr
515 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 538 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
516 int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); 539 int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c);
517 int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); 540 int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr);
518 int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles); 541 int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles, struct xfrm_kmaddress *k);
519}; 542};
520 543
521extern int xfrm_register_km(struct xfrm_mgr *km); 544extern int xfrm_register_km(struct xfrm_mgr *km);
@@ -1243,18 +1266,6 @@ struct xfrm6_tunnel {
1243 int priority; 1266 int priority;
1244}; 1267};
1245 1268
1246struct xfrm_state_walk {
1247 struct xfrm_state *state;
1248 int count;
1249 u8 proto;
1250};
1251
1252struct xfrm_policy_walk {
1253 struct xfrm_policy *policy;
1254 int count;
1255 u8 type, cur_type;
1256};
1257
1258extern void xfrm_init(void); 1269extern void xfrm_init(void);
1259extern void xfrm4_init(void); 1270extern void xfrm4_init(void);
1260extern void xfrm_state_init(void); 1271extern void xfrm_state_init(void);
@@ -1279,23 +1290,10 @@ static inline void xfrm6_fini(void)
1279extern int xfrm_proc_init(void); 1290extern int xfrm_proc_init(void);
1280#endif 1291#endif
1281 1292
1282static inline void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto) 1293extern void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto);
1283{
1284 walk->proto = proto;
1285 walk->state = NULL;
1286 walk->count = 0;
1287}
1288
1289static inline void xfrm_state_walk_done(struct xfrm_state_walk *walk)
1290{
1291 if (walk->state != NULL) {
1292 xfrm_state_put(walk->state);
1293 walk->state = NULL;
1294 }
1295}
1296
1297extern int xfrm_state_walk(struct xfrm_state_walk *walk, 1294extern int xfrm_state_walk(struct xfrm_state_walk *walk,
1298 int (*func)(struct xfrm_state *, int, void*), void *); 1295 int (*func)(struct xfrm_state *, int, void*), void *);
1296extern void xfrm_state_walk_done(struct xfrm_state_walk *walk);
1299extern struct xfrm_state *xfrm_state_alloc(void); 1297extern struct xfrm_state *xfrm_state_alloc(void);
1300extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, 1298extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
1301 struct flowi *fl, struct xfrm_tmpl *tmpl, 1299 struct flowi *fl, struct xfrm_tmpl *tmpl,
@@ -1419,24 +1417,10 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
1419 1417
1420struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); 1418struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp);
1421 1419
1422static inline void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type) 1420extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type);
1423{
1424 walk->cur_type = XFRM_POLICY_TYPE_MAIN;
1425 walk->type = type;
1426 walk->policy = NULL;
1427 walk->count = 0;
1428}
1429
1430static inline void xfrm_policy_walk_done(struct xfrm_policy_walk *walk)
1431{
1432 if (walk->policy != NULL) {
1433 xfrm_pol_put(walk->policy);
1434 walk->policy = NULL;
1435 }
1436}
1437
1438extern int xfrm_policy_walk(struct xfrm_policy_walk *walk, 1421extern int xfrm_policy_walk(struct xfrm_policy_walk *walk,
1439 int (*func)(struct xfrm_policy *, int, int, void*), void *); 1422 int (*func)(struct xfrm_policy *, int, int, void*), void *);
1423extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk);
1440int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1424int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1441struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, 1425struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
1442 struct xfrm_selector *sel, 1426 struct xfrm_selector *sel,
@@ -1455,12 +1439,14 @@ extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst,
1455 1439
1456#ifdef CONFIG_XFRM_MIGRATE 1440#ifdef CONFIG_XFRM_MIGRATE
1457extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type, 1441extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1458 struct xfrm_migrate *m, int num_bundles); 1442 struct xfrm_migrate *m, int num_bundles,
1443 struct xfrm_kmaddress *k);
1459extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m); 1444extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m);
1460extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x, 1445extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,
1461 struct xfrm_migrate *m); 1446 struct xfrm_migrate *m);
1462extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type, 1447extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1463 struct xfrm_migrate *m, int num_bundles); 1448 struct xfrm_migrate *m, int num_bundles,
1449 struct xfrm_kmaddress *k);
1464#endif 1450#endif
1465 1451
1466extern wait_queue_head_t km_waitq; 1452extern wait_queue_head_t km_waitq;
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
index ad6e278ba7f2..b417985708f2 100644
--- a/include/pcmcia/ciscode.h
+++ b/include/pcmcia/ciscode.h
@@ -119,7 +119,7 @@
119 119
120#define MANFID_TOSHIBA 0x0098 120#define MANFID_TOSHIBA 0x0098
121 121
122#define MANFID_UNGERMANN 0x02c0 122#define MANFID_UNGERMANN 0x02c0
123 123
124#define MANFID_XIRCOM 0x0105 124#define MANFID_XIRCOM 0x0105
125 125
diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h
index e2e10c1e9a06..cfdd5af77dcc 100644
--- a/include/pcmcia/cistpl.h
+++ b/include/pcmcia/cistpl.h
@@ -573,44 +573,6 @@ typedef struct tuple_t {
573#define TUPLE_RETURN_LINK 0x01 573#define TUPLE_RETURN_LINK 0x01
574#define TUPLE_RETURN_COMMON 0x02 574#define TUPLE_RETURN_COMMON 0x02
575 575
576/* For ValidateCIS */
577typedef struct cisinfo_t {
578 u_int Chains;
579} cisinfo_t;
580
581#define CISTPL_MAX_CIS_SIZE 0x200 576#define CISTPL_MAX_CIS_SIZE 0x200
582 577
583/* For ReplaceCIS */
584typedef struct cisdump_t {
585 u_int Length;
586 cisdata_t Data[CISTPL_MAX_CIS_SIZE];
587} cisdump_t;
588
589
590int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis);
591
592/* don't use outside of PCMCIA core yet */
593int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int func, tuple_t *tuple);
594int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple);
595int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
596int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse);
597
598int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned int *count);
599
600/* ... but use these wrappers instead */
601#define pcmcia_get_first_tuple(p_dev, tuple) \
602 pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple)
603
604#define pcmcia_get_next_tuple(p_dev, tuple) \
605 pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple)
606
607#define pcmcia_get_tuple_data(p_dev, tuple) \
608 pccard_get_tuple_data(p_dev->socket, tuple)
609
610#define pcmcia_parse_tuple(p_dev, tuple, parse) \
611 pccard_parse_tuple(tuple, parse)
612
613#define pcmcia_validate_cis(p_dev, info) \
614 pccard_validate_cis(p_dev->socket, p_dev->func, info)
615
616#endif /* LINUX_CISTPL_H */ 578#endif /* LINUX_CISTPL_H */
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 45d84b275789..904468a191ef 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -28,72 +28,16 @@ typedef struct conf_reg_t {
28#define CS_WRITE 2 28#define CS_WRITE 2
29 29
30/* for AdjustResourceInfo */ 30/* for AdjustResourceInfo */
31typedef struct adjust_t {
32 u_int Action;
33 u_int Resource;
34 u_int Attributes;
35 union {
36 struct memory {
37 u_long Base;
38 u_long Size;
39 } memory;
40 struct io {
41 ioaddr_t BasePort;
42 ioaddr_t NumPorts;
43 u_int IOAddrLines;
44 } io;
45 struct irq {
46 u_int IRQ;
47 } irq;
48 } resource;
49} adjust_t;
50
51/* Action field */ 31/* Action field */
52#define REMOVE_MANAGED_RESOURCE 1 32#define REMOVE_MANAGED_RESOURCE 1
53#define ADD_MANAGED_RESOURCE 2 33#define ADD_MANAGED_RESOURCE 2
54#define GET_FIRST_MANAGED_RESOURCE 3 34
55#define GET_NEXT_MANAGED_RESOURCE 4
56/* Resource field */
57#define RES_MEMORY_RANGE 1
58#define RES_IO_RANGE 2
59#define RES_IRQ 3
60/* Attribute field */
61#define RES_IRQ_TYPE 0x03
62#define RES_IRQ_TYPE_EXCLUSIVE 0
63#define RES_IRQ_TYPE_TIME 1
64#define RES_IRQ_TYPE_DYNAMIC 2
65#define RES_IRQ_CSC 0x04
66#define RES_SHARED 0x08
67#define RES_RESERVED 0x10
68#define RES_ALLOCATED 0x20
69#define RES_REMOVED 0x40
70 35
71typedef struct event_callback_args_t { 36typedef struct event_callback_args_t {
72 struct pcmcia_device *client_handle; 37 struct pcmcia_device *client_handle;
73 void *client_data; 38 void *client_data;
74} event_callback_args_t; 39} event_callback_args_t;
75 40
76/* for GetConfigurationInfo */
77typedef struct config_info_t {
78 u_char Function;
79 u_int Attributes;
80 u_int Vcc, Vpp1, Vpp2;
81 u_int IntType;
82 u_int ConfigBase;
83 u_char Status, Pin, Copy, Option, ExtStatus;
84 u_int Present;
85 u_int CardValues;
86 u_int AssignedIRQ;
87 u_int IRQAttributes;
88 ioaddr_t BasePort1;
89 ioaddr_t NumPorts1;
90 u_int Attributes1;
91 ioaddr_t BasePort2;
92 ioaddr_t NumPorts2;
93 u_int Attributes2;
94 u_int IOAddrLines;
95} config_info_t;
96
97/* For CardValues field */ 41/* For CardValues field */
98#define CV_OPTION_VALUE 0x01 42#define CV_OPTION_VALUE 0x01
99#define CV_STATUS_VALUE 0x02 43#define CV_STATUS_VALUE 0x02
@@ -257,22 +201,6 @@ typedef struct win_req_t {
257#define WIN_BAR_MASK 0xe000 201#define WIN_BAR_MASK 0xe000
258#define WIN_BAR_SHIFT 13 202#define WIN_BAR_SHIFT 13
259 203
260/* Attributes for RegisterClient -- UNUSED -- */
261#define INFO_MASTER_CLIENT 0x01
262#define INFO_IO_CLIENT 0x02
263#define INFO_MTD_CLIENT 0x04
264#define INFO_MEM_CLIENT 0x08
265#define MAX_NUM_CLIENTS 3
266
267#define INFO_CARD_SHARE 0x10
268#define INFO_CARD_EXCL 0x20
269
270typedef struct cs_status_t {
271 u_char Function;
272 event_t CardState;
273 event_t SocketState;
274} cs_status_t;
275
276typedef struct error_info_t { 204typedef struct error_info_t {
277 int func; 205 int func;
278 int retcode; 206 int retcode;
@@ -308,95 +236,4 @@ typedef struct error_info_t {
308#define CS_EVENT_3VCARD 0x200000 236#define CS_EVENT_3VCARD 0x200000
309#define CS_EVENT_XVCARD 0x400000 237#define CS_EVENT_XVCARD 0x400000
310 238
311/* Return codes */
312#define CS_SUCCESS 0x00
313#define CS_BAD_ADAPTER 0x01
314#define CS_BAD_ATTRIBUTE 0x02
315#define CS_BAD_BASE 0x03
316#define CS_BAD_EDC 0x04
317#define CS_BAD_IRQ 0x06
318#define CS_BAD_OFFSET 0x07
319#define CS_BAD_PAGE 0x08
320#define CS_READ_FAILURE 0x09
321#define CS_BAD_SIZE 0x0a
322#define CS_BAD_SOCKET 0x0b
323#define CS_BAD_TYPE 0x0d
324#define CS_BAD_VCC 0x0e
325#define CS_BAD_VPP 0x0f
326#define CS_BAD_WINDOW 0x11
327#define CS_WRITE_FAILURE 0x12
328#define CS_NO_CARD 0x14
329#define CS_UNSUPPORTED_FUNCTION 0x15
330#define CS_UNSUPPORTED_MODE 0x16
331#define CS_BAD_SPEED 0x17
332#define CS_BUSY 0x18
333#define CS_GENERAL_FAILURE 0x19
334#define CS_WRITE_PROTECTED 0x1a
335#define CS_BAD_ARG_LENGTH 0x1b
336#define CS_BAD_ARGS 0x1c
337#define CS_CONFIGURATION_LOCKED 0x1d
338#define CS_IN_USE 0x1e
339#define CS_NO_MORE_ITEMS 0x1f
340#define CS_OUT_OF_RESOURCE 0x20
341#define CS_BAD_HANDLE 0x21
342
343#define CS_BAD_TUPLE 0x40
344
345#ifdef __KERNEL__
346
347/*
348 * The main Card Services entry point
349 */
350
351enum service {
352 AccessConfigurationRegister, AddSocketServices,
353 AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory,
354 DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo,
355 GetClientInfo, GetConfigurationInfo, GetEventMask,
356 GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple,
357 GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple,
358 GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage,
359 MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow,
360 OpenMemory, ParseTuple, ReadMemory, RegisterClient,
361 RegisterEraseQueue, RegisterMTD, RegisterTimer,
362 ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ,
363 ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices,
364 RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ,
365 RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry,
366 SetEventMask, SetRegion, ValidateCIS, VendorSpecific,
367 WriteMemory, BindDevice, BindMTD, ReportError,
368 SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS,
369 GetFirstWindow, GetNextWindow, GetMemPage
370};
371
372struct pcmcia_socket;
373
374int pcmcia_access_configuration_register(struct pcmcia_device *p_dev, conf_reg_t *reg);
375int pcmcia_get_configuration_info(struct pcmcia_device *p_dev, config_info_t *config);
376int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
377int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
378int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
379int pcmcia_release_window(window_handle_t win);
380int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
381int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
382int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
383int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh);
384int pcmcia_suspend_card(struct pcmcia_socket *skt);
385int pcmcia_resume_card(struct pcmcia_socket *skt);
386int pcmcia_eject_card(struct pcmcia_socket *skt);
387int pcmcia_insert_card(struct pcmcia_socket *skt);
388int pccard_reset_card(struct pcmcia_socket *skt);
389
390struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev);
391void pcmcia_disable_device(struct pcmcia_device *p_dev);
392
393struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt);
394void pcmcia_put_socket(struct pcmcia_socket *skt);
395
396/* compatibility functions */
397#define pcmcia_reset_card(p_dev, req) \
398 pccard_reset_card(p_dev->socket)
399
400#endif /* __KERNEL__ */
401
402#endif /* _LINUX_CS_H */ 239#endif /* _LINUX_CS_H */
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index f402a0f435b4..315965a37930 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -21,14 +21,6 @@
21#include <sys/types.h> 21#include <sys/types.h>
22#endif 22#endif
23 23
24#if defined(__arm__) || defined(__mips__) || defined(__avr32__) || \
25 defined(__bfin__)
26/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
27typedef u_int ioaddr_t;
28#else
29typedef u_short ioaddr_t;
30#endif
31
32typedef u_short socket_t; 24typedef u_short socket_t;
33typedef u_int event_t; 25typedef u_int event_t;
34typedef u_char cisdata_t; 26typedef u_char cisdata_t;
diff --git a/include/pcmcia/device_id.h b/include/pcmcia/device_id.h
index e04e0b0d9a25..c33ea08352b8 100644
--- a/include/pcmcia/device_id.h
+++ b/include/pcmcia/device_id.h
@@ -1,10 +1,19 @@
1/* 1/*
2 * Copyright (2003-2004) Dominik Brodowski <linux@brodo.de> 2 * device_id.h -- PCMCIA driver matching helpers
3 * David Woodhouse
4 * 3 *
5 * License: GPL v2 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * (C) 2003 - 2004 David Woodhouse
9 * (C) 2003 - 2004 Dominik Brodowski
6 */ 10 */
7 11
12#ifndef _LINUX_PCMCIA_DEVICE_ID_H
13#define _LINUX_PCMCIA_DEVICE_ID_H
14
15#ifdef __KERNEL__
16
8#define PCMCIA_DEVICE_MANF_CARD(manf, card) { \ 17#define PCMCIA_DEVICE_MANF_CARD(manf, card) { \
9 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \ 18 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
10 PCMCIA_DEV_ID_MATCH_CARD_ID, \ 19 PCMCIA_DEV_ID_MATCH_CARD_ID, \
@@ -256,3 +265,6 @@
256 265
257 266
258#define PCMCIA_DEVICE_NULL { .match_flags = 0, } 267#define PCMCIA_DEVICE_NULL { .match_flags = 0, }
268
269#endif /* __KERNEL__ */
270#endif /* _LINUX_PCMCIA_DEVICE_ID_H */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index b316027c853d..a2be80b9a095 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -10,7 +10,7 @@
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. 10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 * 11 *
12 * (C) 1999 David A. Hinds 12 * (C) 1999 David A. Hinds
13 * (C) 2003 - 2004 Dominik Brodowski 13 * (C) 2003 - 2008 Dominik Brodowski
14 */ 14 */
15 15
16#ifndef _LINUX_DS_H 16#ifndef _LINUX_DS_H
@@ -23,108 +23,21 @@
23#include <pcmcia/cs_types.h> 23#include <pcmcia/cs_types.h>
24#include <pcmcia/device_id.h> 24#include <pcmcia/device_id.h>
25 25
26typedef struct tuple_parse_t {
27 tuple_t tuple;
28 cisdata_t data[255];
29 cisparse_t parse;
30} tuple_parse_t;
31
32typedef struct win_info_t {
33 window_handle_t handle;
34 win_req_t window;
35 memreq_t map;
36} win_info_t;
37
38typedef struct bind_info_t {
39 dev_info_t dev_info;
40 u_char function;
41 struct pcmcia_device *instance;
42 char name[DEV_NAME_LEN];
43 u_short major, minor;
44 void *next;
45} bind_info_t;
46
47typedef struct mtd_info_t {
48 dev_info_t dev_info;
49 u_int Attributes;
50 u_int CardOffset;
51} mtd_info_t;
52
53typedef struct region_info_t {
54 u_int Attributes;
55 u_int CardOffset;
56 u_int RegionSize;
57 u_int AccessSpeed;
58 u_int BlockSize;
59 u_int PartMultiple;
60 u_char JedecMfr, JedecInfo;
61 memory_handle_t next;
62} region_info_t;
63#define REGION_TYPE 0x0001
64#define REGION_TYPE_CM 0x0000
65#define REGION_TYPE_AM 0x0001
66#define REGION_PREFETCH 0x0008
67#define REGION_CACHEABLE 0x0010
68#define REGION_BAR_MASK 0xe000
69#define REGION_BAR_SHIFT 13
70
71typedef union ds_ioctl_arg_t {
72 adjust_t adjust;
73 config_info_t config;
74 tuple_t tuple;
75 tuple_parse_t tuple_parse;
76 client_req_t client_req;
77 cs_status_t status;
78 conf_reg_t conf_reg;
79 cisinfo_t cisinfo;
80 region_info_t region;
81 bind_info_t bind_info;
82 mtd_info_t mtd_info;
83 win_info_t win_info;
84 cisdump_t cisdump;
85} ds_ioctl_arg_t;
86
87#define DS_ADJUST_RESOURCE_INFO _IOWR('d', 2, adjust_t)
88#define DS_GET_CONFIGURATION_INFO _IOWR('d', 3, config_info_t)
89#define DS_GET_FIRST_TUPLE _IOWR('d', 4, tuple_t)
90#define DS_GET_NEXT_TUPLE _IOWR('d', 5, tuple_t)
91#define DS_GET_TUPLE_DATA _IOWR('d', 6, tuple_parse_t)
92#define DS_PARSE_TUPLE _IOWR('d', 7, tuple_parse_t)
93#define DS_RESET_CARD _IO ('d', 8)
94#define DS_GET_STATUS _IOWR('d', 9, cs_status_t)
95#define DS_ACCESS_CONFIGURATION_REGISTER _IOWR('d', 10, conf_reg_t)
96#define DS_VALIDATE_CIS _IOR ('d', 11, cisinfo_t)
97#define DS_SUSPEND_CARD _IO ('d', 12)
98#define DS_RESUME_CARD _IO ('d', 13)
99#define DS_EJECT_CARD _IO ('d', 14)
100#define DS_INSERT_CARD _IO ('d', 15)
101#define DS_GET_FIRST_REGION _IOWR('d', 16, region_info_t)
102#define DS_GET_NEXT_REGION _IOWR('d', 17, region_info_t)
103#define DS_REPLACE_CIS _IOWR('d', 18, cisdump_t)
104#define DS_GET_FIRST_WINDOW _IOR ('d', 19, win_info_t)
105#define DS_GET_NEXT_WINDOW _IOWR('d', 20, win_info_t)
106#define DS_GET_MEM_PAGE _IOWR('d', 21, win_info_t)
107
108#define DS_BIND_REQUEST _IOWR('d', 60, bind_info_t)
109#define DS_GET_DEVICE_INFO _IOWR('d', 61, bind_info_t)
110#define DS_GET_NEXT_DEVICE _IOWR('d', 62, bind_info_t)
111#define DS_UNBIND_REQUEST _IOW ('d', 63, bind_info_t)
112#define DS_BIND_MTD _IOWR('d', 64, mtd_info_t)
113
114#ifdef __KERNEL__ 26#ifdef __KERNEL__
115#include <linux/device.h> 27#include <linux/device.h>
116#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
117 29
118typedef struct dev_node_t { 30/*
119 char dev_name[DEV_NAME_LEN]; 31 * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus
120 u_short major, minor; 32 * a.k.a. PCI drivers
121 struct dev_node_t *next; 33 */
122} dev_node_t;
123
124
125struct pcmcia_socket; 34struct pcmcia_socket;
35struct pcmcia_device;
126struct config_t; 36struct config_t;
127 37
38/* dynamic device IDs for PCMCIA device drivers. See
39 * Documentation/pcmcia/driver.txt for details.
40*/
128struct pcmcia_dynids { 41struct pcmcia_dynids {
129 spinlock_t lock; 42 spinlock_t lock;
130 struct list_head list; 43 struct list_head list;
@@ -147,6 +60,14 @@ struct pcmcia_driver {
147int pcmcia_register_driver(struct pcmcia_driver *driver); 60int pcmcia_register_driver(struct pcmcia_driver *driver);
148void pcmcia_unregister_driver(struct pcmcia_driver *driver); 61void pcmcia_unregister_driver(struct pcmcia_driver *driver);
149 62
63/* Some drivers use dev_node_t to store char or block device information.
64 * Don't use this in new drivers, though.
65 */
66typedef struct dev_node_t {
67 char dev_name[DEV_NAME_LEN];
68 u_short major, minor;
69 struct dev_node_t *next;
70} dev_node_t;
150 71
151struct pcmcia_device { 72struct pcmcia_device {
152 /* the socket and the device_no [for multifunction devices] 73 /* the socket and the device_no [for multifunction devices]
@@ -216,10 +137,304 @@ struct pcmcia_device {
216#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 137#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
217#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) 138#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
218 139
140/* deprecated -- don't use! */
219#define handle_to_dev(handle) (handle->dev) 141#define handle_to_dev(handle) (handle->dev)
220 142
221/* error reporting */ 143
222void cs_error(struct pcmcia_device *handle, int func, int ret); 144/* (deprecated) error reporting by PCMCIA devices. Use dev_printk()
145 * or dev_dbg() directly in the driver, without referring to pcmcia_error_func()
146 * and/or pcmcia_error_ret() for those functions will go away soon.
147 */
148enum service {
149 AccessConfigurationRegister, AddSocketServices,
150 AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory,
151 DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo,
152 GetClientInfo, GetConfigurationInfo, GetEventMask,
153 GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple,
154 GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple,
155 GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage,
156 MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow,
157 OpenMemory, ParseTuple, ReadMemory, RegisterClient,
158 RegisterEraseQueue, RegisterMTD, RegisterTimer,
159 ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ,
160 ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices,
161 RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ,
162 RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry,
163 SetEventMask, SetRegion, ValidateCIS, VendorSpecific,
164 WriteMemory, BindDevice, BindMTD, ReportError,
165 SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS,
166 GetFirstWindow, GetNextWindow, GetMemPage
167};
168const char *pcmcia_error_func(int func);
169const char *pcmcia_error_ret(int ret);
170
171#define cs_error(p_dev, func, ret) \
172 { \
173 dev_printk(KERN_NOTICE, &p_dev->dev, \
174 "%s : %s\n", \
175 pcmcia_error_func(func), \
176 pcmcia_error_ret(ret)); \
177 }
178
179/* CIS access.
180 * Use the pcmcia_* versions in PCMCIA drivers
181 */
182int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
183
184int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function,
185 tuple_t *tuple);
186#define pcmcia_get_first_tuple(p_dev, tuple) \
187 pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple)
188
189int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function,
190 tuple_t *tuple);
191#define pcmcia_get_next_tuple(p_dev, tuple) \
192 pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple)
193
194int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
195#define pcmcia_get_tuple_data(p_dev, tuple) \
196 pccard_get_tuple_data(p_dev->socket, tuple)
197
198
199/* loop CIS entries for valid configuration */
200int pcmcia_loop_config(struct pcmcia_device *p_dev,
201 int (*conf_check) (struct pcmcia_device *p_dev,
202 cistpl_cftable_entry_t *cf,
203 cistpl_cftable_entry_t *dflt,
204 unsigned int vcc,
205 void *priv_data),
206 void *priv_data);
207
208/* is the device still there? */
209struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *p_dev);
210
211/* low-level interface reset */
212int pcmcia_reset_card(struct pcmcia_socket *skt);
213
214/* CIS config */
215int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
216 conf_reg_t *reg);
217
218/* device configuration */
219int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
220int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
221int pcmcia_request_configuration(struct pcmcia_device *p_dev,
222 config_req_t *req);
223
224int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req,
225 window_handle_t *wh);
226int pcmcia_release_window(window_handle_t win);
227
228int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
229int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
230
231int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
232void pcmcia_disable_device(struct pcmcia_device *p_dev);
223 233
224#endif /* __KERNEL__ */ 234#endif /* __KERNEL__ */
235
236
237
238/* Below, there are only definitions which are used by
239 * - the PCMCIA ioctl
240 * - deprecated PCMCIA userspace tools only
241 *
242 * here be dragons ... here be dragons ... here be dragons ... here be drag
243 */
244
245#if defined(CONFIG_PCMCIA_IOCTL) || !defined(__KERNEL__)
246
247#if defined(__arm__) || defined(__mips__) || defined(__avr32__) || \
248 defined(__bfin__)
249/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
250typedef u_int ioaddr_t;
251#else
252typedef u_short ioaddr_t;
253#endif
254
255/* for AdjustResourceInfo */
256typedef struct adjust_t {
257 u_int Action;
258 u_int Resource;
259 u_int Attributes;
260 union {
261 struct memory {
262 u_long Base;
263 u_long Size;
264 } memory;
265 struct io {
266 ioaddr_t BasePort;
267 ioaddr_t NumPorts;
268 u_int IOAddrLines;
269 } io;
270 struct irq {
271 u_int IRQ;
272 } irq;
273 } resource;
274} adjust_t;
275
276/* Action field */
277#define REMOVE_MANAGED_RESOURCE 1
278#define ADD_MANAGED_RESOURCE 2
279#define GET_FIRST_MANAGED_RESOURCE 3
280#define GET_NEXT_MANAGED_RESOURCE 4
281/* Resource field */
282#define RES_MEMORY_RANGE 1
283#define RES_IO_RANGE 2
284#define RES_IRQ 3
285/* Attribute field */
286#define RES_IRQ_TYPE 0x03
287#define RES_IRQ_TYPE_EXCLUSIVE 0
288#define RES_IRQ_TYPE_TIME 1
289#define RES_IRQ_TYPE_DYNAMIC 2
290#define RES_IRQ_CSC 0x04
291#define RES_SHARED 0x08
292#define RES_RESERVED 0x10
293#define RES_ALLOCATED 0x20
294#define RES_REMOVED 0x40
295
296
297typedef struct tuple_parse_t {
298 tuple_t tuple;
299 cisdata_t data[255];
300 cisparse_t parse;
301} tuple_parse_t;
302
303typedef struct win_info_t {
304 window_handle_t handle;
305 win_req_t window;
306 memreq_t map;
307} win_info_t;
308
309typedef struct bind_info_t {
310 dev_info_t dev_info;
311 u_char function;
312 struct pcmcia_device *instance;
313 char name[DEV_NAME_LEN];
314 u_short major, minor;
315 void *next;
316} bind_info_t;
317
318typedef struct mtd_info_t {
319 dev_info_t dev_info;
320 u_int Attributes;
321 u_int CardOffset;
322} mtd_info_t;
323
324typedef struct region_info_t {
325 u_int Attributes;
326 u_int CardOffset;
327 u_int RegionSize;
328 u_int AccessSpeed;
329 u_int BlockSize;
330 u_int PartMultiple;
331 u_char JedecMfr, JedecInfo;
332 memory_handle_t next;
333} region_info_t;
334
335#define REGION_TYPE 0x0001
336#define REGION_TYPE_CM 0x0000
337#define REGION_TYPE_AM 0x0001
338#define REGION_PREFETCH 0x0008
339#define REGION_CACHEABLE 0x0010
340#define REGION_BAR_MASK 0xe000
341#define REGION_BAR_SHIFT 13
342
343/* For ReplaceCIS */
344typedef struct cisdump_t {
345 u_int Length;
346 cisdata_t Data[CISTPL_MAX_CIS_SIZE];
347} cisdump_t;
348
349/* for GetConfigurationInfo */
350typedef struct config_info_t {
351 u_char Function;
352 u_int Attributes;
353 u_int Vcc, Vpp1, Vpp2;
354 u_int IntType;
355 u_int ConfigBase;
356 u_char Status, Pin, Copy, Option, ExtStatus;
357 u_int Present;
358 u_int CardValues;
359 u_int AssignedIRQ;
360 u_int IRQAttributes;
361 ioaddr_t BasePort1;
362 ioaddr_t NumPorts1;
363 u_int Attributes1;
364 ioaddr_t BasePort2;
365 ioaddr_t NumPorts2;
366 u_int Attributes2;
367 u_int IOAddrLines;
368} config_info_t;
369
370/* For ValidateCIS */
371typedef struct cisinfo_t {
372 u_int Chains;
373} cisinfo_t;
374
375typedef struct cs_status_t {
376 u_char Function;
377 event_t CardState;
378 event_t SocketState;
379} cs_status_t;
380
381typedef union ds_ioctl_arg_t {
382 adjust_t adjust;
383 config_info_t config;
384 tuple_t tuple;
385 tuple_parse_t tuple_parse;
386 client_req_t client_req;
387 cs_status_t status;
388 conf_reg_t conf_reg;
389 cisinfo_t cisinfo;
390 region_info_t region;
391 bind_info_t bind_info;
392 mtd_info_t mtd_info;
393 win_info_t win_info;
394 cisdump_t cisdump;
395} ds_ioctl_arg_t;
396
397#define DS_ADJUST_RESOURCE_INFO _IOWR('d', 2, adjust_t)
398#define DS_GET_CONFIGURATION_INFO _IOWR('d', 3, config_info_t)
399#define DS_GET_FIRST_TUPLE _IOWR('d', 4, tuple_t)
400#define DS_GET_NEXT_TUPLE _IOWR('d', 5, tuple_t)
401#define DS_GET_TUPLE_DATA _IOWR('d', 6, tuple_parse_t)
402#define DS_PARSE_TUPLE _IOWR('d', 7, tuple_parse_t)
403#define DS_RESET_CARD _IO ('d', 8)
404#define DS_GET_STATUS _IOWR('d', 9, cs_status_t)
405#define DS_ACCESS_CONFIGURATION_REGISTER _IOWR('d', 10, conf_reg_t)
406#define DS_VALIDATE_CIS _IOR ('d', 11, cisinfo_t)
407#define DS_SUSPEND_CARD _IO ('d', 12)
408#define DS_RESUME_CARD _IO ('d', 13)
409#define DS_EJECT_CARD _IO ('d', 14)
410#define DS_INSERT_CARD _IO ('d', 15)
411#define DS_GET_FIRST_REGION _IOWR('d', 16, region_info_t)
412#define DS_GET_NEXT_REGION _IOWR('d', 17, region_info_t)
413#define DS_REPLACE_CIS _IOWR('d', 18, cisdump_t)
414#define DS_GET_FIRST_WINDOW _IOR ('d', 19, win_info_t)
415#define DS_GET_NEXT_WINDOW _IOWR('d', 20, win_info_t)
416#define DS_GET_MEM_PAGE _IOWR('d', 21, win_info_t)
417
418#define DS_BIND_REQUEST _IOWR('d', 60, bind_info_t)
419#define DS_GET_DEVICE_INFO _IOWR('d', 61, bind_info_t)
420#define DS_GET_NEXT_DEVICE _IOWR('d', 62, bind_info_t)
421#define DS_UNBIND_REQUEST _IOW ('d', 63, bind_info_t)
422#define DS_BIND_MTD _IOWR('d', 64, mtd_info_t)
423
424
425/* used in userspace only */
426#define CS_IN_USE 0x1e
427
428#define INFO_MASTER_CLIENT 0x01
429#define INFO_IO_CLIENT 0x02
430#define INFO_MTD_CLIENT 0x04
431#define INFO_MEM_CLIENT 0x08
432#define MAX_NUM_CLIENTS 3
433
434#define INFO_CARD_SHARE 0x10
435#define INFO_CARD_EXCL 0x20
436
437
438#endif /* !defined(__KERNEL__) || defined(CONFIG_PCMCIA_IOCTL) */
439
225#endif /* _LINUX_DS_H */ 440#endif /* _LINUX_DS_H */
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index ed919dd9bb5c..9b4ac9385f5d 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -53,10 +53,10 @@
53 53
54/* for GetSocket, SetSocket */ 54/* for GetSocket, SetSocket */
55typedef struct socket_state_t { 55typedef struct socket_state_t {
56 u_int flags; 56 u_int flags;
57 u_int csc_mask; 57 u_int csc_mask;
58 u_char Vcc, Vpp; 58 u_char Vcc, Vpp;
59 u_char io_irq; 59 u_char io_irq;
60} socket_state_t; 60} socket_state_t;
61 61
62extern socket_state_t dead_socket; 62extern socket_state_t dead_socket;
@@ -86,79 +86,22 @@ extern socket_state_t dead_socket;
86#define HOOK_POWER_PRE 0x01 86#define HOOK_POWER_PRE 0x01
87#define HOOK_POWER_POST 0x02 87#define HOOK_POWER_POST 0x02
88 88
89
90typedef struct pccard_io_map { 89typedef struct pccard_io_map {
91 u_char map; 90 u_char map;
92 u_char flags; 91 u_char flags;
93 u_short speed; 92 u_short speed;
94 u_int start, stop; 93 u_int start, stop;
95} pccard_io_map; 94} pccard_io_map;
96 95
97typedef struct pccard_mem_map { 96typedef struct pccard_mem_map {
98 u_char map; 97 u_char map;
99 u_char flags; 98 u_char flags;
100 u_short speed; 99 u_short speed;
101 u_long static_start; 100 u_long static_start;
102 u_int card_start; 101 u_int card_start;
103 struct resource *res; 102 struct resource *res;
104} pccard_mem_map; 103} pccard_mem_map;
105 104
106typedef struct cb_bridge_map {
107 u_char map;
108 u_char flags;
109 u_int start, stop;
110} cb_bridge_map;
111
112/*
113 * Socket operations.
114 */
115struct pcmcia_socket;
116
117struct pccard_operations {
118 int (*init)(struct pcmcia_socket *sock);
119 int (*suspend)(struct pcmcia_socket *sock);
120 int (*get_status)(struct pcmcia_socket *sock, u_int *value);
121 int (*set_socket)(struct pcmcia_socket *sock, socket_state_t *state);
122 int (*set_io_map)(struct pcmcia_socket *sock, struct pccard_io_map *io);
123 int (*set_mem_map)(struct pcmcia_socket *sock, struct pccard_mem_map *mem);
124};
125
126struct pccard_resource_ops {
127 int (*validate_mem) (struct pcmcia_socket *s);
128 int (*adjust_io_region) (struct resource *res,
129 unsigned long r_start,
130 unsigned long r_end,
131 struct pcmcia_socket *s);
132 struct resource* (*find_io) (unsigned long base, int num,
133 unsigned long align,
134 struct pcmcia_socket *s);
135 struct resource* (*find_mem) (unsigned long base, unsigned long num,
136 unsigned long align, int low,
137 struct pcmcia_socket *s);
138 int (*add_io) (struct pcmcia_socket *s,
139 unsigned int action,
140 unsigned long r_start,
141 unsigned long r_end);
142 int (*add_mem) (struct pcmcia_socket *s,
143 unsigned int action,
144 unsigned long r_start,
145 unsigned long r_end);
146 int (*init) (struct pcmcia_socket *s);
147 void (*exit) (struct pcmcia_socket *s);
148};
149/* SS_CAP_STATIC_MAP */
150extern struct pccard_resource_ops pccard_static_ops;
151/* !SS_CAP_STATIC_MAP */
152extern struct pccard_resource_ops pccard_nonstatic_ops;
153
154/* static mem, dynamic IO sockets */
155extern struct pccard_resource_ops pccard_iodyn_ops;
156
157/*
158 * Calls to set up low-level "Socket Services" drivers
159 */
160struct pcmcia_socket;
161
162typedef struct io_window_t { 105typedef struct io_window_t {
163 u_int InUse, Config; 106 u_int InUse, Config;
164 struct resource *res; 107 struct resource *res;
@@ -179,10 +122,25 @@ typedef struct window_t {
179/* Maximum number of memory windows per socket */ 122/* Maximum number of memory windows per socket */
180#define MAX_WIN 4 123#define MAX_WIN 4
181 124
125
126/*
127 * Socket operations.
128 */
129struct pcmcia_socket;
130struct pccard_resource_ops;
182struct config_t; 131struct config_t;
183struct pcmcia_callback; 132struct pcmcia_callback;
184struct user_info_t; 133struct user_info_t;
185 134
135struct pccard_operations {
136 int (*init)(struct pcmcia_socket *s);
137 int (*suspend)(struct pcmcia_socket *s);
138 int (*get_status)(struct pcmcia_socket *s, u_int *value);
139 int (*set_socket)(struct pcmcia_socket *s, socket_state_t *state);
140 int (*set_io_map)(struct pcmcia_socket *s, struct pccard_io_map *io);
141 int (*set_mem_map)(struct pcmcia_socket *s, struct pccard_mem_map *mem);
142};
143
186struct pcmcia_socket { 144struct pcmcia_socket {
187 struct module *owner; 145 struct module *owner;
188 spinlock_t lock; 146 spinlock_t lock;
@@ -199,8 +157,8 @@ struct pcmcia_socket {
199 io_window_t io[MAX_IO_WIN]; 157 io_window_t io[MAX_IO_WIN];
200 window_t win[MAX_WIN]; 158 window_t win[MAX_WIN];
201 struct list_head cis_cache; 159 struct list_head cis_cache;
202 u_int fake_cis_len; 160 size_t fake_cis_len;
203 char *fake_cis; 161 u8 *fake_cis;
204 162
205 struct list_head socket_list; 163 struct list_head socket_list;
206 struct completion socket_released; 164 struct completion socket_released;
@@ -218,12 +176,12 @@ struct pcmcia_socket {
218 struct pci_dev * cb_dev; 176 struct pci_dev * cb_dev;
219 177
220 178
221 /* socket setup is done so resources should be able to be allocated. Only 179 /* socket setup is done so resources should be able to be allocated.
222 * if set to 1, calls to find_{io,mem}_region are handled, and insertion 180 * Only if set to 1, calls to find_{io,mem}_region are handled, and
223 * events are actually managed by the PCMCIA layer.*/ 181 * insertio events are actually managed by the PCMCIA layer.*/
224 u8 resource_setup_done:1; 182 u8 resource_setup_done:1;
225 183
226 /* is set to one if resource setup is done using adjust_resource_info() */ 184 /* It's old if resource setup is done using adjust_resource_info() */
227 u8 resource_setup_old:1; 185 u8 resource_setup_old:1;
228 u8 resource_setup_new:1; 186 u8 resource_setup_new:1;
229 187
@@ -236,75 +194,101 @@ struct pcmcia_socket {
236 194
237 /* Zoom video behaviour is so chip specific its not worth adding 195 /* Zoom video behaviour is so chip specific its not worth adding
238 this to _ops */ 196 this to _ops */
239 void (*zoom_video)(struct pcmcia_socket *, int); 197 void (*zoom_video)(struct pcmcia_socket *,
198 int);
240 199
241 /* so is power hook */ 200 /* so is power hook */
242 int (*power_hook)(struct pcmcia_socket *sock, int operation); 201 int (*power_hook)(struct pcmcia_socket *sock, int operation);
243#ifdef CONFIG_CARDBUS 202
244 /* allows tuning the CB bridge before loading driver for the CB card */ 203 /* allows tuning the CB bridge before loading driver for the CB card */
204#ifdef CONFIG_CARDBUS
245 void (*tune_bridge)(struct pcmcia_socket *sock, struct pci_bus *bus); 205 void (*tune_bridge)(struct pcmcia_socket *sock, struct pci_bus *bus);
246#endif 206#endif
247 207
248 /* state thread */ 208 /* state thread */
249 struct mutex skt_mutex; /* protects socket h/w state */
250
251 struct task_struct *thread; 209 struct task_struct *thread;
252 struct completion thread_done; 210 struct completion thread_done;
253 spinlock_t thread_lock; /* protects thread_events */
254 unsigned int thread_events; 211 unsigned int thread_events;
212 /* protects socket h/w state */
213 struct mutex skt_mutex;
214 /* protects thread_events */
215 spinlock_t thread_lock;
255 216
256 /* pcmcia (16-bit) */ 217 /* pcmcia (16-bit) */
257 struct pcmcia_callback *callback; 218 struct pcmcia_callback *callback;
258 219
259#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE) 220#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
260 struct list_head devices_list; /* PCMCIA devices */ 221 /* The following elements refer to 16-bit PCMCIA devices inserted
261 u8 device_count; /* the number of devices, used 222 * into the socket */
262 * only internally and subject 223 struct list_head devices_list;
263 * to incorrectness and change */ 224
225 /* the number of devices, used only internally and subject to
226 * incorrectness and change */
227 u8 device_count;
264 228
229 /* 16-bit state: */
265 struct { 230 struct {
266 u8 present:1, /* PCMCIA card is present in socket */ 231 /* PCMCIA card is present in socket */
267 busy:1, /* "master" ioctl is used */ 232 u8 present:1;
268 dead:1, /* pcmcia module is being unloaded */ 233 /* "master" ioctl is used */
269 device_add_pending:1, /* a multifunction-device 234 u8 busy:1;
270 * add event is pending */ 235 /* pcmcia module is being unloaded */
271 mfc_pfc:1, /* the pending event adds a mfc (1) or pfc (0) */ 236 u8 dead:1;
272 reserved:3; 237 /* a multifunction-device add event is pending */
273 } pcmcia_state; 238 u8 device_add_pending:1;
274 239 /* the pending event adds a mfc (1) or pfc (0) */
275 struct work_struct device_add; /* for adding further pseudo-multifunction 240 u8 mfc_pfc:1;
276 * devices */ 241
242 u8 reserved:3;
243 } pcmcia_state;
244
245
246 /* for adding further pseudo-multifunction devices */
247 struct work_struct device_add;
277 248
278#ifdef CONFIG_PCMCIA_IOCTL 249#ifdef CONFIG_PCMCIA_IOCTL
279 struct user_info_t *user; 250 struct user_info_t *user;
280 wait_queue_head_t queue; 251 wait_queue_head_t queue;
281#endif 252#endif /* CONFIG_PCMCIA_IOCTL */
282#endif 253#endif /* CONFIG_PCMCIA */
283 254
284 /* cardbus (32-bit) */ 255 /* cardbus (32-bit) */
285#ifdef CONFIG_CARDBUS 256#ifdef CONFIG_CARDBUS
286 struct resource * cb_cis_res; 257 struct resource * cb_cis_res;
287 void __iomem *cb_cis_virt; 258 void __iomem *cb_cis_virt;
288#endif 259#endif /* CONFIG_CARDBUS */
289 260
290 /* socket device */ 261 /* socket device */
291 struct device dev; 262 struct device dev;
292 void *driver_data; /* data internal to the socket driver */ 263 /* data internal to the socket driver */
293 264 void *driver_data;
294}; 265};
295 266
296struct pcmcia_socket * pcmcia_get_socket_by_nr(unsigned int nr);
297 267
268/* socket drivers must define the resource operations type they use. There
269 * are three options:
270 * - pccard_static_ops iomem and ioport areas are assigned statically
271 * - pccard_iodyn_ops iomem areas is assigned statically, ioport
272 * areas dynamically
273 * - pccard_nonstatic_ops iomem and ioport areas are assigned dynamically.
274 * If this option is selected, use
275 * "select PCCARD_NONSTATIC" in Kconfig.
276 */
277extern struct pccard_resource_ops pccard_static_ops;
278extern struct pccard_resource_ops pccard_iodyn_ops;
279extern struct pccard_resource_ops pccard_nonstatic_ops;
298 280
281/* socket drivers are expected to use these callbacks in their .drv struct */
282extern int pcmcia_socket_dev_suspend(struct device *dev, pm_message_t state);
283extern int pcmcia_socket_dev_resume(struct device *dev);
284
285/* socket drivers use this callback in their IRQ handler */
286extern void pcmcia_parse_events(struct pcmcia_socket *socket,
287 unsigned int events);
299 288
300extern void pcmcia_parse_events(struct pcmcia_socket *socket, unsigned int events); 289/* to register and unregister a socket */
301extern int pcmcia_register_socket(struct pcmcia_socket *socket); 290extern int pcmcia_register_socket(struct pcmcia_socket *socket);
302extern void pcmcia_unregister_socket(struct pcmcia_socket *socket); 291extern void pcmcia_unregister_socket(struct pcmcia_socket *socket);
303 292
304extern struct class pcmcia_socket_class;
305
306/* socket drivers are expected to use these callbacks in their .drv struct */
307extern int pcmcia_socket_dev_suspend(struct device *dev, pm_message_t state);
308extern int pcmcia_socket_dev_resume(struct device *dev);
309 293
310#endif /* _LINUX_SS_H */ 294#endif /* _LINUX_SS_H */
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 16be12f1cbe8..0c9514de5df7 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -213,6 +213,8 @@ enum iscsi_err {
213 ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15, 213 ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15,
214 ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16, 214 ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16,
215 ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, 215 ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17,
216 ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18,
217 ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19,
216}; 218};
217 219
218/* 220/*
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 5e75bb7f311c..61e53f14f7e1 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -287,6 +287,11 @@ struct iscsi_session {
287 struct iscsi_pool cmdpool; /* PDU's pool */ 287 struct iscsi_pool cmdpool; /* PDU's pool */
288}; 288};
289 289
290enum {
291 ISCSI_HOST_SETUP,
292 ISCSI_HOST_REMOVED,
293};
294
290struct iscsi_host { 295struct iscsi_host {
291 char *initiatorname; 296 char *initiatorname;
292 /* hw address or netdev iscsi connection is bound to */ 297 /* hw address or netdev iscsi connection is bound to */
@@ -295,6 +300,12 @@ struct iscsi_host {
295 /* local address */ 300 /* local address */
296 int local_port; 301 int local_port;
297 char local_address[ISCSI_ADDRESS_BUF_LEN]; 302 char local_address[ISCSI_ADDRESS_BUF_LEN];
303
304 wait_queue_head_t session_removal_wq;
305 /* protects sessions and state */
306 spinlock_t lock;
307 int num_sessions;
308 int state;
298}; 309};
299 310
300/* 311/*
@@ -302,7 +313,7 @@ struct iscsi_host {
302 */ 313 */
303extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); 314extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth);
304extern int iscsi_eh_abort(struct scsi_cmnd *sc); 315extern int iscsi_eh_abort(struct scsi_cmnd *sc);
305extern int iscsi_eh_host_reset(struct scsi_cmnd *sc); 316extern int iscsi_eh_target_reset(struct scsi_cmnd *sc);
306extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); 317extern int iscsi_eh_device_reset(struct scsi_cmnd *sc);
307extern int iscsi_queuecommand(struct scsi_cmnd *sc, 318extern int iscsi_queuecommand(struct scsi_cmnd *sc,
308 void (*done)(struct scsi_cmnd *)); 319 void (*done)(struct scsi_cmnd *));
@@ -351,6 +362,8 @@ extern void iscsi_conn_stop(struct iscsi_cls_conn *, int);
351extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, 362extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *,
352 int); 363 int);
353extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); 364extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err);
365extern void iscsi_session_failure(struct iscsi_cls_session *cls_session,
366 enum iscsi_err err);
354extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, 367extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
355 enum iscsi_param param, char *buf); 368 enum iscsi_param param, char *buf);
356extern void iscsi_suspend_tx(struct iscsi_conn *conn); 369extern void iscsi_suspend_tx(struct iscsi_conn *conn);
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 5c40cc537d4c..a109165714d6 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -309,6 +309,20 @@ struct scsi_lun {
309}; 309};
310 310
311/* 311/*
312 * The Well Known LUNS (SAM-3) in our int representation of a LUN
313 */
314#define SCSI_W_LUN_BASE 0xc100
315#define SCSI_W_LUN_REPORT_LUNS (SCSI_W_LUN_BASE + 1)
316#define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2)
317#define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3)
318
319static inline int scsi_is_wlun(unsigned int lun)
320{
321 return (lun & 0xff00) == SCSI_W_LUN_BASE;
322}
323
324
325/*
312 * MESSAGE CODES 326 * MESSAGE CODES
313 */ 327 */
314 328
@@ -367,6 +381,11 @@ struct scsi_lun {
367#define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ 381#define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */
368#define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also 382#define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also
369 * without decrementing the retry count */ 383 * without decrementing the retry count */
384#define DID_TRANSPORT_DISRUPTED 0x0e /* Transport error disrupted execution
385 * and the driver blocked the port to
386 * recover the link. Transport class will
387 * retry or fail IO */
388#define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */
370#define DRIVER_OK 0x00 /* Driver status */ 389#define DRIVER_OK 0x00 /* Driver status */
371 390
372/* 391/*
@@ -412,6 +431,7 @@ struct scsi_lun {
412#define SCSI_MLQUEUE_HOST_BUSY 0x1055 431#define SCSI_MLQUEUE_HOST_BUSY 0x1055
413#define SCSI_MLQUEUE_DEVICE_BUSY 0x1056 432#define SCSI_MLQUEUE_DEVICE_BUSY 0x1056
414#define SCSI_MLQUEUE_EH_RETRY 0x1057 433#define SCSI_MLQUEUE_EH_RETRY 0x1057
434#define SCSI_MLQUEUE_TARGET_BUSY 0x1058
415 435
416/* 436/*
417 * Use these to separate status msg and our bytes 437 * Use these to separate status msg and our bytes
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index f9f6e793575c..855bf95963e7 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -75,7 +75,6 @@ struct scsi_cmnd {
75 75
76 int retries; 76 int retries;
77 int allowed; 77 int allowed;
78 int timeout_per_command;
79 78
80 unsigned char prot_op; 79 unsigned char prot_op;
81 unsigned char prot_type; 80 unsigned char prot_type;
@@ -86,7 +85,6 @@ struct scsi_cmnd {
86 /* These elements define the operation we are about to perform */ 85 /* These elements define the operation we are about to perform */
87 unsigned char *cmnd; 86 unsigned char *cmnd;
88 87
89 struct timer_list eh_timeout; /* Used to time out the command. */
90 88
91 /* These elements define the operation we ultimately want to perform */ 89 /* These elements define the operation we ultimately want to perform */
92 struct scsi_data_buffer sdb; 90 struct scsi_data_buffer sdb;
@@ -139,7 +137,6 @@ extern void scsi_put_command(struct scsi_cmnd *);
139extern void __scsi_put_command(struct Scsi_Host *, struct scsi_cmnd *, 137extern void __scsi_put_command(struct Scsi_Host *, struct scsi_cmnd *,
140 struct device *); 138 struct device *);
141extern void scsi_finish_command(struct scsi_cmnd *cmd); 139extern void scsi_finish_command(struct scsi_cmnd *cmd);
142extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
143 140
144extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count, 141extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
145 size_t *offset, size_t *len); 142 size_t *offset, size_t *len);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 80b2e93c2936..a37a8148a310 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -42,9 +42,11 @@ enum scsi_device_state {
42 * originate in the mid-layer) */ 42 * originate in the mid-layer) */
43 SDEV_OFFLINE, /* Device offlined (by error handling or 43 SDEV_OFFLINE, /* Device offlined (by error handling or
44 * user request */ 44 * user request */
45 SDEV_BLOCK, /* Device blocked by scsi lld. No scsi 45 SDEV_BLOCK, /* Device blocked by scsi lld. No
46 * commands from user or midlayer should be issued 46 * scsi commands from user or midlayer
47 * to the scsi lld. */ 47 * should be issued to the scsi
48 * lld. */
49 SDEV_CREATED_BLOCK, /* same as above but for created devices */
48}; 50};
49 51
50enum scsi_device_event { 52enum scsi_device_event {
@@ -236,6 +238,16 @@ struct scsi_target {
236 * for the device at a time. */ 238 * for the device at a time. */
237 unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ 239 unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */
238 /* means no lun present */ 240 /* means no lun present */
241 /* commands actually active on LLD. protected by host lock. */
242 unsigned int target_busy;
243 /*
244 * LLDs should set this in the slave_alloc host template callout.
245 * If set to zero then there is not limit.
246 */
247 unsigned int can_queue;
248 unsigned int target_blocked;
249 unsigned int max_target_blocked;
250#define SCSI_DEFAULT_TARGET_BLOCKED 3
239 251
240 char scsi_level; 252 char scsi_level;
241 struct execute_work ew; 253 struct execute_work ew;
@@ -384,10 +396,23 @@ static inline unsigned int sdev_id(struct scsi_device *sdev)
384#define scmd_id(scmd) sdev_id((scmd)->device) 396#define scmd_id(scmd) sdev_id((scmd)->device)
385#define scmd_channel(scmd) sdev_channel((scmd)->device) 397#define scmd_channel(scmd) sdev_channel((scmd)->device)
386 398
399/*
400 * checks for positions of the SCSI state machine
401 */
387static inline int scsi_device_online(struct scsi_device *sdev) 402static inline int scsi_device_online(struct scsi_device *sdev)
388{ 403{
389 return sdev->sdev_state != SDEV_OFFLINE; 404 return sdev->sdev_state != SDEV_OFFLINE;
390} 405}
406static inline int scsi_device_blocked(struct scsi_device *sdev)
407{
408 return sdev->sdev_state == SDEV_BLOCK ||
409 sdev->sdev_state == SDEV_CREATED_BLOCK;
410}
411static inline int scsi_device_created(struct scsi_device *sdev)
412{
413 return sdev->sdev_state == SDEV_CREATED ||
414 sdev->sdev_state == SDEV_CREATED_BLOCK;
415}
391 416
392/* accessor functions for the SCSI parameters */ 417/* accessor functions for the SCSI parameters */
393static inline int scsi_device_sync(struct scsi_device *sdev) 418static inline int scsi_device_sync(struct scsi_device *sdev)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 44a55d1bf530..d123ca84e732 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -43,13 +43,6 @@ struct blk_queue_tags;
43#define DISABLE_CLUSTERING 0 43#define DISABLE_CLUSTERING 0
44#define ENABLE_CLUSTERING 1 44#define ENABLE_CLUSTERING 1
45 45
46enum scsi_eh_timer_return {
47 EH_NOT_HANDLED,
48 EH_HANDLED,
49 EH_RESET_TIMER,
50};
51
52
53struct scsi_host_template { 46struct scsi_host_template {
54 struct module *module; 47 struct module *module;
55 const char *name; 48 const char *name;
@@ -347,7 +340,7 @@ struct scsi_host_template {
347 * 340 *
348 * Status: OPTIONAL 341 * Status: OPTIONAL
349 */ 342 */
350 enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); 343 enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *);
351 344
352 /* 345 /*
353 * Name of proc directory 346 * Name of proc directory
diff --git a/include/scsi/scsi_netlink.h b/include/scsi/scsi_netlink.h
index 8c1470cc8209..536752c40d41 100644
--- a/include/scsi/scsi_netlink.h
+++ b/include/scsi/scsi_netlink.h
@@ -22,6 +22,9 @@
22#ifndef SCSI_NETLINK_H 22#ifndef SCSI_NETLINK_H
23#define SCSI_NETLINK_H 23#define SCSI_NETLINK_H
24 24
25#include <linux/netlink.h>
26
27
25/* 28/*
26 * This file intended to be included by both kernel and user space 29 * This file intended to be included by both kernel and user space
27 */ 30 */
@@ -55,7 +58,41 @@ struct scsi_nl_hdr {
55#define SCSI_NL_TRANSPORT_FC 1 58#define SCSI_NL_TRANSPORT_FC 1
56#define SCSI_NL_MAX_TRANSPORTS 2 59#define SCSI_NL_MAX_TRANSPORTS 2
57 60
58/* scsi_nl_hdr->msgtype values are defined in each transport */ 61/* Transport-based scsi_nl_hdr->msgtype values are defined in each transport */
62
63/*
64 * GENERIC SCSI scsi_nl_hdr->msgtype Values
65 */
66 /* kernel -> user */
67#define SCSI_NL_SHOST_VENDOR 0x0001
68 /* user -> kernel */
69/* SCSI_NL_SHOST_VENDOR msgtype is kernel->user and user->kernel */
70
71
72/*
73 * Message Structures :
74 */
75
76/* macro to round up message lengths to 8byte boundary */
77#define SCSI_NL_MSGALIGN(len) (((len) + 7) & ~7)
78
79
80/*
81 * SCSI HOST Vendor Unique messages :
82 * SCSI_NL_SHOST_VENDOR
83 *
84 * Note: The Vendor Unique message payload will begin directly after
85 * this structure, with the length of the payload per vmsg_datalen.
86 *
87 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
88 * formatting requirements specified below
89 */
90struct scsi_nl_host_vendor_msg {
91 struct scsi_nl_hdr snlh; /* must be 1st element ! */
92 uint64_t vendor_id;
93 uint16_t host_no;
94 uint16_t vmsg_datalen;
95} __attribute__((aligned(sizeof(uint64_t))));
59 96
60 97
61/* 98/*
@@ -83,5 +120,28 @@ struct scsi_nl_hdr {
83 } 120 }
84 121
85 122
123#ifdef __KERNEL__
124
125#include <scsi/scsi_host.h>
126
127/* Exported Kernel Interfaces */
128int scsi_nl_add_transport(u8 tport,
129 int (*msg_handler)(struct sk_buff *),
130 void (*event_handler)(struct notifier_block *, unsigned long, void *));
131void scsi_nl_remove_transport(u8 tport);
132
133int scsi_nl_add_driver(u64 vendor_id, struct scsi_host_template *hostt,
134 int (*nlmsg_handler)(struct Scsi_Host *shost, void *payload,
135 u32 len, u32 pid),
136 void (*nlevt_handler)(struct notifier_block *nb,
137 unsigned long event, void *notify_ptr));
138void scsi_nl_remove_driver(u64 vendor_id);
139
140void scsi_nl_send_transport_msg(u32 pid, struct scsi_nl_hdr *hdr);
141int scsi_nl_send_vendor_msg(u32 pid, unsigned short host_no, u64 vendor_id,
142 char *data_buf, u32 data_len);
143
144#endif /* __KERNEL__ */
145
86#endif /* SCSI_NETLINK_H */ 146#endif /* SCSI_NETLINK_H */
87 147
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index 490bd13a634c..0de32cd4e8a7 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -21,6 +21,7 @@
21#define SCSI_TRANSPORT_H 21#define SCSI_TRANSPORT_H
22 22
23#include <linux/transport_class.h> 23#include <linux/transport_class.h>
24#include <linux/blkdev.h>
24#include <scsi/scsi_host.h> 25#include <scsi/scsi_host.h>
25#include <scsi/scsi_device.h> 26#include <scsi/scsi_device.h>
26 27
@@ -64,7 +65,7 @@ struct scsi_transport_template {
64 * begin counting again 65 * begin counting again
65 * EH_NOT_HANDLED Begin normal error recovery 66 * EH_NOT_HANDLED Begin normal error recovery
66 */ 67 */
67 enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); 68 enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *);
68 69
69 /* 70 /*
70 * Used as callback for the completion of i_t_nexus request 71 * Used as callback for the completion of i_t_nexus request
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 878373c32ef7..49d8913c4f86 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -167,6 +167,26 @@ enum fc_tgtid_binding_type {
167struct device_attribute dev_attr_vport_##_name = \ 167struct device_attribute dev_attr_vport_##_name = \
168 __ATTR(_name,_mode,_show,_store) 168 __ATTR(_name,_mode,_show,_store)
169 169
170/*
171 * fc_vport_identifiers: This set of data contains all elements
172 * to uniquely identify and instantiate a FC virtual port.
173 *
174 * Notes:
175 * symbolic_name: The driver is to append the symbolic_name string data
176 * to the symbolic_node_name data that it generates by default.
177 * the resulting combination should then be registered with the switch.
178 * It is expected that things like Xen may stuff a VM title into
179 * this field.
180 */
181#define FC_VPORT_SYMBOLIC_NAMELEN 64
182struct fc_vport_identifiers {
183 u64 node_name;
184 u64 port_name;
185 u32 roles;
186 bool disable;
187 enum fc_port_type vport_type; /* only FC_PORTTYPE_NPIV allowed */
188 char symbolic_name[FC_VPORT_SYMBOLIC_NAMELEN];
189};
170 190
171/* 191/*
172 * FC Virtual Port Attributes 192 * FC Virtual Port Attributes
@@ -197,7 +217,6 @@ struct device_attribute dev_attr_vport_##_name = \
197 * managed by the transport w/o driver interaction. 217 * managed by the transport w/o driver interaction.
198 */ 218 */
199 219
200#define FC_VPORT_SYMBOLIC_NAMELEN 64
201struct fc_vport { 220struct fc_vport {
202 /* Fixed Attributes */ 221 /* Fixed Attributes */
203 222
@@ -338,6 +357,7 @@ struct fc_rport { /* aka fc_starget_attrs */
338/* bit field values for struct fc_rport "flags" field: */ 357/* bit field values for struct fc_rport "flags" field: */
339#define FC_RPORT_DEVLOSS_PENDING 0x01 358#define FC_RPORT_DEVLOSS_PENDING 0x01
340#define FC_RPORT_SCAN_PENDING 0x02 359#define FC_RPORT_SCAN_PENDING 0x02
360#define FC_RPORT_FAST_FAIL_TIMEDOUT 0x03
341 361
342#define dev_to_rport(d) \ 362#define dev_to_rport(d) \
343 container_of(d, struct fc_rport, dev) 363 container_of(d, struct fc_rport, dev)
@@ -659,12 +679,15 @@ fc_remote_port_chkready(struct fc_rport *rport)
659 if (rport->roles & FC_PORT_ROLE_FCP_TARGET) 679 if (rport->roles & FC_PORT_ROLE_FCP_TARGET)
660 result = 0; 680 result = 0;
661 else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) 681 else if (rport->flags & FC_RPORT_DEVLOSS_PENDING)
662 result = DID_IMM_RETRY << 16; 682 result = DID_TRANSPORT_DISRUPTED << 16;
663 else 683 else
664 result = DID_NO_CONNECT << 16; 684 result = DID_NO_CONNECT << 16;
665 break; 685 break;
666 case FC_PORTSTATE_BLOCKED: 686 case FC_PORTSTATE_BLOCKED:
667 result = DID_IMM_RETRY << 16; 687 if (rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT)
688 result = DID_TRANSPORT_FAILFAST << 16;
689 else
690 result = DID_TRANSPORT_DISRUPTED << 16;
668 break; 691 break;
669 default: 692 default:
670 result = DID_NO_CONNECT << 16; 693 result = DID_NO_CONNECT << 16;
@@ -732,6 +755,8 @@ void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
732 * be sure to read the Vendor Type and ID formatting requirements 755 * be sure to read the Vendor Type and ID formatting requirements
733 * specified in scsi_netlink.h 756 * specified in scsi_netlink.h
734 */ 757 */
758struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel,
759 struct fc_vport_identifiers *);
735int fc_vport_terminate(struct fc_vport *vport); 760int fc_vport_terminate(struct fc_vport *vport);
736 761
737#endif /* SCSI_TRANSPORT_FC_H */ 762#endif /* SCSI_TRANSPORT_FC_H */
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 8b6c91df4c7a..c667cc396545 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -135,7 +135,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt);
135/* 135/*
136 * control plane upcalls 136 * control plane upcalls
137 */ 137 */
138extern void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error); 138extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn,
139 enum iscsi_err error);
139extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, 140extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
140 char *data, uint32_t data_size); 141 char *data, uint32_t data_size);
141 142
@@ -207,7 +208,7 @@ extern void iscsi_host_for_each_session(struct Scsi_Host *shost,
207struct iscsi_endpoint { 208struct iscsi_endpoint {
208 void *dd_data; /* LLD private data */ 209 void *dd_data; /* LLD private data */
209 struct device dev; 210 struct device dev;
210 unsigned int id; 211 uint64_t id;
211}; 212};
212 213
213/* 214/*
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h
deleted file mode 100644
index d9aebdf6db63..000000000000
--- a/include/sound/ad1848.h
+++ /dev/null
@@ -1,218 +0,0 @@
1#ifndef __SOUND_AD1848_H
2#define __SOUND_AD1848_H
3
4/*
5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Definitions for AD1847/AD1848/CS4248 chips
7 *
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#include "pcm.h"
26#include <linux/interrupt.h>
27
28/* IO ports */
29
30#define AD1848P( chip, x ) ( (chip) -> port + c_d_c_AD1848##x )
31
32#define c_d_c_AD1848REGSEL 0
33#define c_d_c_AD1848REG 1
34#define c_d_c_AD1848STATUS 2
35#define c_d_c_AD1848PIO 3
36
37/* codec registers */
38
39#define AD1848_LEFT_INPUT 0x00 /* left input control */
40#define AD1848_RIGHT_INPUT 0x01 /* right input control */
41#define AD1848_AUX1_LEFT_INPUT 0x02 /* left AUX1 input control */
42#define AD1848_AUX1_RIGHT_INPUT 0x03 /* right AUX1 input control */
43#define AD1848_AUX2_LEFT_INPUT 0x04 /* left AUX2 input control */
44#define AD1848_AUX2_RIGHT_INPUT 0x05 /* right AUX2 input control */
45#define AD1848_LEFT_OUTPUT 0x06 /* left output control register */
46#define AD1848_RIGHT_OUTPUT 0x07 /* right output control register */
47#define AD1848_DATA_FORMAT 0x08 /* clock and data format - playback/capture - bits 7-0 MCE */
48#define AD1848_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */
49#define AD1848_PIN_CTRL 0x0a /* pin control */
50#define AD1848_TEST_INIT 0x0b /* test and initialization */
51#define AD1848_MISC_INFO 0x0c /* miscellaneous information */
52#define AD1848_LOOPBACK 0x0d /* loopback control */
53#define AD1848_DATA_UPR_CNT 0x0e /* playback/capture upper base count */
54#define AD1848_DATA_LWR_CNT 0x0f /* playback/capture lower base count */
55
56/* definitions for codec register select port - CODECP( REGSEL ) */
57
58#define AD1848_INIT 0x80 /* CODEC is initializing */
59#define AD1848_MCE 0x40 /* mode change enable */
60#define AD1848_TRD 0x20 /* transfer request disable */
61
62/* definitions for codec status register - CODECP( STATUS ) */
63
64#define AD1848_GLOBALIRQ 0x01 /* IRQ is active */
65
66/* definitions for AD1848_LEFT_INPUT and AD1848_RIGHT_INPUT registers */
67
68#define AD1848_ENABLE_MIC_GAIN 0x20
69
70#define AD1848_MIXS_LINE1 0x00
71#define AD1848_MIXS_AUX1 0x40
72#define AD1848_MIXS_LINE2 0x80
73#define AD1848_MIXS_ALL 0xc0
74
75/* definitions for clock and data format register - AD1848_PLAYBK_FORMAT */
76
77#define AD1848_LINEAR_8 0x00 /* 8-bit unsigned data */
78#define AD1848_ALAW_8 0x60 /* 8-bit A-law companded */
79#define AD1848_ULAW_8 0x20 /* 8-bit U-law companded */
80#define AD1848_LINEAR_16 0x40 /* 16-bit twos complement data - little endian */
81#define AD1848_STEREO 0x10 /* stereo mode */
82/* bits 3-1 define frequency divisor */
83#define AD1848_XTAL1 0x00 /* 24.576 crystal */
84#define AD1848_XTAL2 0x01 /* 16.9344 crystal */
85
86/* definitions for interface control register - AD1848_IFACE_CTRL */
87
88#define AD1848_CAPTURE_PIO 0x80 /* capture PIO enable */
89#define AD1848_PLAYBACK_PIO 0x40 /* playback PIO enable */
90#define AD1848_CALIB_MODE 0x18 /* calibration mode bits */
91#define AD1848_AUTOCALIB 0x08 /* auto calibrate */
92#define AD1848_SINGLE_DMA 0x04 /* use single DMA channel */
93#define AD1848_CAPTURE_ENABLE 0x02 /* capture enable */
94#define AD1848_PLAYBACK_ENABLE 0x01 /* playback enable */
95
96/* definitions for pin control register - AD1848_PIN_CTRL */
97
98#define AD1848_IRQ_ENABLE 0x02 /* enable IRQ */
99#define AD1848_XCTL1 0x40 /* external control #1 */
100#define AD1848_XCTL0 0x80 /* external control #0 */
101
102/* definitions for test and init register - AD1848_TEST_INIT */
103
104#define AD1848_CALIB_IN_PROGRESS 0x20 /* auto calibrate in progress */
105#define AD1848_DMA_REQUEST 0x10 /* DMA request in progress */
106
107/* defines for codec.mode */
108
109#define AD1848_MODE_NONE 0x0000
110#define AD1848_MODE_PLAY 0x0001
111#define AD1848_MODE_CAPTURE 0x0002
112#define AD1848_MODE_TIMER 0x0004
113#define AD1848_MODE_OPEN (AD1848_MODE_PLAY|AD1848_MODE_CAPTURE|AD1848_MODE_TIMER)
114#define AD1848_MODE_RUNNING 0x0010
115
116/* defines for codec.hardware */
117
118#define AD1848_HW_DETECT 0x0000 /* let AD1848 driver detect chip */
119#define AD1848_HW_AD1847 0x0001 /* AD1847 chip */
120#define AD1848_HW_AD1848 0x0002 /* AD1848 chip */
121#define AD1848_HW_CS4248 0x0003 /* CS4248 chip */
122#define AD1848_HW_CMI8330 0x0004 /* CMI8330 chip */
123#define AD1848_HW_THINKPAD 0x0005 /* Thinkpad 360/750/755 */
124
125/* IBM Thinkpad specific stuff */
126#define AD1848_THINKPAD_CTL_PORT1 0x15e8
127#define AD1848_THINKPAD_CTL_PORT2 0x15e9
128#define AD1848_THINKPAD_CS4248_ENABLE_BIT 0x02
129
130struct snd_ad1848 {
131 unsigned long port; /* i/o port */
132 struct resource *res_port;
133 int irq; /* IRQ line */
134 int dma; /* data DMA */
135 unsigned short version; /* version of CODEC chip */
136 unsigned short mode; /* see to AD1848_MODE_XXXX */
137 unsigned short hardware; /* see to AD1848_HW_XXXX */
138 unsigned short single_dma:1; /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */
139
140 struct snd_pcm *pcm;
141 struct snd_pcm_substream *playback_substream;
142 struct snd_pcm_substream *capture_substream;
143 struct snd_card *card;
144
145 unsigned char image[32]; /* SGalaxy needs an access to extended registers */
146 int mce_bit;
147 int calibrate_mute;
148 int dma_size;
149 int thinkpad_flag; /* Thinkpad CS4248 needs some extra help */
150
151#ifdef CONFIG_PM
152 void (*suspend)(struct snd_ad1848 *chip);
153 void (*resume)(struct snd_ad1848 *chip);
154#endif
155
156 spinlock_t reg_lock;
157};
158
159/* exported functions */
160
161void snd_ad1848_out(struct snd_ad1848 *chip, unsigned char reg, unsigned char value);
162
163int snd_ad1848_create(struct snd_card *card,
164 unsigned long port,
165 int irq, int dma,
166 unsigned short hardware,
167 struct snd_ad1848 ** chip);
168
169int snd_ad1848_pcm(struct snd_ad1848 * chip, int device, struct snd_pcm **rpcm);
170const struct snd_pcm_ops *snd_ad1848_get_pcm_ops(int direction);
171int snd_ad1848_mixer(struct snd_ad1848 * chip);
172
173/* exported mixer stuffs */
174enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE };
175
176#define AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) \
177 ((reg) | ((shift) << 8) | ((mask) << 16) | ((invert) << 24))
178#define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \
179 ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22))
180
181/* for ease of use */
182struct ad1848_mix_elem {
183 const char *name;
184 int index;
185 int type;
186 unsigned long private_value;
187 const unsigned int *tlv;
188};
189
190#define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \
191{ .name = xname, \
192 .index = xindex, \
193 .type = AD1848_MIX_SINGLE, \
194 .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) }
195
196#define AD1848_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv) \
197{ .name = xname, \
198 .index = xindex, \
199 .type = AD1848_MIX_SINGLE, \
200 .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert), \
201 .tlv = xtlv }
202
203#define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \
204{ .name = xname, \
205 .index = xindex, \
206 .type = AD1848_MIX_DOUBLE, \
207 .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) }
208
209#define AD1848_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert, xtlv) \
210{ .name = xname, \
211 .index = xindex, \
212 .type = AD1848_MIX_DOUBLE, \
213 .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert), \
214 .tlv = xtlv }
215
216int snd_ad1848_add_ctl_elem(struct snd_ad1848 *chip, const struct ad1848_mix_elem *c);
217
218#endif /* __SOUND_AD1848_H */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 3eaf155b850d..2c4dc908a54a 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -93,9 +93,10 @@ enum {
93 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ 93 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
94 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */ 94 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
95 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */ 95 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
96 SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
96 97
97 /* Don't forget to change the following: */ 98 /* Don't forget to change the following: */
98 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_HDA 99 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
99}; 100};
100 101
101struct snd_hwdep_info { 102struct snd_hwdep_info {
@@ -296,29 +297,39 @@ struct snd_pcm_info {
296 unsigned char reserved[64]; /* reserved for future... */ 297 unsigned char reserved[64]; /* reserved for future... */
297}; 298};
298 299
299typedef int __bitwise snd_pcm_hw_param_t; 300typedef int snd_pcm_hw_param_t;
300#define SNDRV_PCM_HW_PARAM_ACCESS ((__force snd_pcm_hw_param_t) 0) /* Access type */ 301#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
301#define SNDRV_PCM_HW_PARAM_FORMAT ((__force snd_pcm_hw_param_t) 1) /* Format */ 302#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
302#define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */ 303#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
303#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS 304#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
304#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT 305#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
305 306
306#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */ 307#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
307#define SNDRV_PCM_HW_PARAM_FRAME_BITS ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */ 308#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
308#define SNDRV_PCM_HW_PARAM_CHANNELS ((__force snd_pcm_hw_param_t) 10) /* Channels */ 309#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
309#define SNDRV_PCM_HW_PARAM_RATE ((__force snd_pcm_hw_param_t) 11) /* Approx rate */ 310#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
310#define SNDRV_PCM_HW_PARAM_PERIOD_TIME ((__force snd_pcm_hw_param_t) 12) /* Approx distance between interrupts in us */ 311#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
311#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE ((__force snd_pcm_hw_param_t) 13) /* Approx frames between interrupts */ 312 * interrupts in us
312#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES ((__force snd_pcm_hw_param_t) 14) /* Approx bytes between interrupts */ 313 */
313#define SNDRV_PCM_HW_PARAM_PERIODS ((__force snd_pcm_hw_param_t) 15) /* Approx interrupts per buffer */ 314#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
314#define SNDRV_PCM_HW_PARAM_BUFFER_TIME ((__force snd_pcm_hw_param_t) 16) /* Approx duration of buffer in us */ 315 * interrupts
315#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE ((__force snd_pcm_hw_param_t) 17) /* Size of buffer in frames */ 316 */
316#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES ((__force snd_pcm_hw_param_t) 18) /* Size of buffer in bytes */ 317#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
317#define SNDRV_PCM_HW_PARAM_TICK_TIME ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */ 318 * interrupts
319 */
320#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
321 * buffer
322 */
323#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
324 * in us
325 */
326#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
327#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
328#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
318#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS 329#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
319#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME 330#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
320 331
321#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ 332#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
322 333
323struct snd_interval { 334struct snd_interval {
324 unsigned int min, max; 335 unsigned int min, max;
@@ -696,7 +707,7 @@ struct snd_timer_tread {
696 * * 707 * *
697 ****************************************************************************/ 708 ****************************************************************************/
698 709
699#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) 710#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
700 711
701struct snd_ctl_card_info { 712struct snd_ctl_card_info {
702 int card; /* card number */ 713 int card; /* card number */
@@ -707,8 +718,7 @@ struct snd_ctl_card_info {
707 unsigned char longname[80]; /* name + info text about soundcard */ 718 unsigned char longname[80]; /* name + info text about soundcard */
708 unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */ 719 unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
709 unsigned char mixername[80]; /* visual mixer identification */ 720 unsigned char mixername[80]; /* visual mixer identification */
710 unsigned char components[80]; /* card components / fine identification, delimited with one space (AC97 etc..) */ 721 unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
711 unsigned char reserved[48]; /* reserved for future */
712}; 722};
713 723
714typedef int __bitwise snd_ctl_elem_type_t; 724typedef int __bitwise snd_ctl_elem_type_t;
diff --git a/include/sound/asoundef.h b/include/sound/asoundef.h
index a6e0facf8a37..20ebf3298eba 100644
--- a/include/sound/asoundef.h
+++ b/include/sound/asoundef.h
@@ -60,35 +60,56 @@
60#define IEC958_AES1_PRO_USERBITS_UDEF (12<<4) /* user defined application */ 60#define IEC958_AES1_PRO_USERBITS_UDEF (12<<4) /* user defined application */
61#define IEC958_AES1_CON_CATEGORY 0x7f 61#define IEC958_AES1_CON_CATEGORY 0x7f
62#define IEC958_AES1_CON_GENERAL 0x00 62#define IEC958_AES1_CON_GENERAL 0x00
63#define IEC958_AES1_CON_EXPERIMENTAL 0x40
64#define IEC958_AES1_CON_SOLIDMEM_MASK 0x0f
65#define IEC958_AES1_CON_SOLIDMEM_ID 0x08
66#define IEC958_AES1_CON_BROADCAST1_MASK 0x07
67#define IEC958_AES1_CON_BROADCAST1_ID 0x04
68#define IEC958_AES1_CON_DIGDIGCONV_MASK 0x07
69#define IEC958_AES1_CON_DIGDIGCONV_ID 0x02
70#define IEC958_AES1_CON_ADC_COPYRIGHT_MASK 0x1f
71#define IEC958_AES1_CON_ADC_COPYRIGHT_ID 0x06
72#define IEC958_AES1_CON_ADC_MASK 0x1f
73#define IEC958_AES1_CON_ADC_ID 0x16
74#define IEC958_AES1_CON_BROADCAST2_MASK 0x0f
75#define IEC958_AES1_CON_BROADCAST2_ID 0x0e
76#define IEC958_AES1_CON_LASEROPT_MASK 0x07 63#define IEC958_AES1_CON_LASEROPT_MASK 0x07
77#define IEC958_AES1_CON_LASEROPT_ID 0x01 64#define IEC958_AES1_CON_LASEROPT_ID 0x01
78#define IEC958_AES1_CON_MUSICAL_MASK 0x07
79#define IEC958_AES1_CON_MUSICAL_ID 0x05
80#define IEC958_AES1_CON_MAGNETIC_MASK 0x07
81#define IEC958_AES1_CON_MAGNETIC_ID 0x03
82#define IEC958_AES1_CON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x00) 65#define IEC958_AES1_CON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x00)
83#define IEC958_AES1_CON_NON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x08) 66#define IEC958_AES1_CON_NON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x08)
67#define IEC958_AES1_CON_MINI_DISC (IEC958_AES1_CON_LASEROPT_ID|0x48)
68#define IEC958_AES1_CON_DVD (IEC958_AES1_CON_LASEROPT_ID|0x18)
69#define IEC958_AES1_CON_LASTEROPT_OTHER (IEC958_AES1_CON_LASEROPT_ID|0x78)
70#define IEC958_AES1_CON_DIGDIGCONV_MASK 0x07
71#define IEC958_AES1_CON_DIGDIGCONV_ID 0x02
84#define IEC958_AES1_CON_PCM_CODER (IEC958_AES1_CON_DIGDIGCONV_ID|0x00) 72#define IEC958_AES1_CON_PCM_CODER (IEC958_AES1_CON_DIGDIGCONV_ID|0x00)
85#define IEC958_AES1_CON_SAMPLER (IEC958_AES1_CON_DIGDIGCONV_ID|0x20)
86#define IEC958_AES1_CON_MIXER (IEC958_AES1_CON_DIGDIGCONV_ID|0x10) 73#define IEC958_AES1_CON_MIXER (IEC958_AES1_CON_DIGDIGCONV_ID|0x10)
87#define IEC958_AES1_CON_RATE_CONVERTER (IEC958_AES1_CON_DIGDIGCONV_ID|0x18) 74#define IEC958_AES1_CON_RATE_CONVERTER (IEC958_AES1_CON_DIGDIGCONV_ID|0x18)
88#define IEC958_AES1_CON_SYNTHESIZER (IEC958_AES1_CON_MUSICAL_ID|0x00) 75#define IEC958_AES1_CON_SAMPLER (IEC958_AES1_CON_DIGDIGCONV_ID|0x20)
89#define IEC958_AES1_CON_MICROPHONE (IEC958_AES1_CON_MUSICAL_ID|0x08) 76#define IEC958_AES1_CON_DSP (IEC958_AES1_CON_DIGDIGCONV_ID|0x28)
77#define IEC958_AES1_CON_DIGDIGCONV_OTHER (IEC958_AES1_CON_DIGDIGCONV_ID|0x78)
78#define IEC958_AES1_CON_MAGNETIC_MASK 0x07
79#define IEC958_AES1_CON_MAGNETIC_ID 0x03
90#define IEC958_AES1_CON_DAT (IEC958_AES1_CON_MAGNETIC_ID|0x00) 80#define IEC958_AES1_CON_DAT (IEC958_AES1_CON_MAGNETIC_ID|0x00)
91#define IEC958_AES1_CON_VCR (IEC958_AES1_CON_MAGNETIC_ID|0x08) 81#define IEC958_AES1_CON_VCR (IEC958_AES1_CON_MAGNETIC_ID|0x08)
82#define IEC958_AES1_CON_DCC (IEC958_AES1_CON_MAGNETIC_ID|0x40)
83#define IEC958_AES1_CON_MAGNETIC_DISC (IEC958_AES1_CON_MAGNETIC_ID|0x18)
84#define IEC958_AES1_CON_MAGNETIC_OTHER (IEC958_AES1_CON_MAGNETIC_ID|0x78)
85#define IEC958_AES1_CON_BROADCAST1_MASK 0x07
86#define IEC958_AES1_CON_BROADCAST1_ID 0x04
87#define IEC958_AES1_CON_DAB_JAPAN (IEC958_AES1_CON_BROADCAST1_ID|0x00)
88#define IEC958_AES1_CON_DAB_EUROPE (IEC958_AES1_CON_BROADCAST1_ID|0x08)
89#define IEC958_AES1_CON_DAB_USA (IEC958_AES1_CON_BROADCAST1_ID|0x60)
90#define IEC958_AES1_CON_SOFTWARE (IEC958_AES1_CON_BROADCAST1_ID|0x40)
91#define IEC958_AES1_CON_IEC62105 (IEC958_AES1_CON_BROADCAST1_ID|0x20)
92#define IEC958_AES1_CON_BROADCAST1_OTHER (IEC958_AES1_CON_BROADCAST1_ID|0x78)
93#define IEC958_AES1_CON_BROADCAST2_MASK 0x0f
94#define IEC958_AES1_CON_BROADCAST2_ID 0x0e
95#define IEC958_AES1_CON_MUSICAL_MASK 0x07
96#define IEC958_AES1_CON_MUSICAL_ID 0x05
97#define IEC958_AES1_CON_SYNTHESIZER (IEC958_AES1_CON_MUSICAL_ID|0x00)
98#define IEC958_AES1_CON_MICROPHONE (IEC958_AES1_CON_MUSICAL_ID|0x08)
99#define IEC958_AES1_CON_MUSICAL_OTHER (IEC958_AES1_CON_MUSICAL_ID|0x78)
100#define IEC958_AES1_CON_ADC_MASK 0x1f
101#define IEC958_AES1_CON_ADC_ID 0x06
102#define IEC958_AES1_CON_ADC (IEC958_AES1_CON_ADC_ID|0x00)
103#define IEC958_AES1_CON_ADC_OTHER (IEC958_AES1_CON_ADC_ID|0x60)
104#define IEC958_AES1_CON_ADC_COPYRIGHT_MASK 0x1f
105#define IEC958_AES1_CON_ADC_COPYRIGHT_ID 0x16
106#define IEC958_AES1_CON_ADC_COPYRIGHT (IEC958_AES1_CON_ADC_COPYRIGHT_ID|0x00)
107#define IEC958_AES1_CON_ADC_COPYRIGHT_OTHER (IEC958_AES1_CON_ADC_COPYRIGHT_ID|0x60)
108#define IEC958_AES1_CON_SOLIDMEM_MASK 0x0f
109#define IEC958_AES1_CON_SOLIDMEM_ID 0x08
110#define IEC958_AES1_CON_SOLIDMEM_DIGITAL_RECORDER_PLAYER (IEC958_AES1_CON_SOLIDMEM_ID|0x00)
111#define IEC958_AES1_CON_SOLIDMEM_OTHER (IEC958_AES1_CON_SOLIDMEM_ID|0x70)
112#define IEC958_AES1_CON_EXPERIMENTAL 0x40
92#define IEC958_AES1_CON_ORIGINAL (1<<7) /* this bits depends on the category code */ 113#define IEC958_AES1_CON_ORIGINAL (1<<7) /* this bits depends on the category code */
93#define IEC958_AES2_PRO_SBITS (7<<0) /* mask - sample bits */ 114#define IEC958_AES2_PRO_SBITS (7<<0) /* mask - sample bits */
94#define IEC958_AES2_PRO_SBITS_20 (2<<0) /* 20-bit - coordination */ 115#define IEC958_AES2_PRO_SBITS_20 (2<<0) /* 20-bit - coordination */
@@ -106,8 +127,16 @@
106#define IEC958_AES2_CON_CHANNEL_UNSPEC (0<<4) /* unspecified */ 127#define IEC958_AES2_CON_CHANNEL_UNSPEC (0<<4) /* unspecified */
107#define IEC958_AES3_CON_FS (15<<0) /* mask - sample frequency */ 128#define IEC958_AES3_CON_FS (15<<0) /* mask - sample frequency */
108#define IEC958_AES3_CON_FS_44100 (0<<0) /* 44.1kHz */ 129#define IEC958_AES3_CON_FS_44100 (0<<0) /* 44.1kHz */
130#define IEC958_AES3_CON_FS_NOTID (1<<0) /* non indicated */
109#define IEC958_AES3_CON_FS_48000 (2<<0) /* 48kHz */ 131#define IEC958_AES3_CON_FS_48000 (2<<0) /* 48kHz */
110#define IEC958_AES3_CON_FS_32000 (3<<0) /* 32kHz */ 132#define IEC958_AES3_CON_FS_32000 (3<<0) /* 32kHz */
133#define IEC958_AES3_CON_FS_22050 (4<<0) /* 22.05kHz */
134#define IEC958_AES3_CON_FS_24000 (6<<0) /* 24kHz */
135#define IEC958_AES3_CON_FS_88200 (8<<0) /* 88.2kHz */
136#define IEC958_AES3_CON_FS_768000 (9<<0) /* 768kHz */
137#define IEC958_AES3_CON_FS_96000 (10<<0) /* 96kHz */
138#define IEC958_AES3_CON_FS_176400 (12<<0) /* 176.4kHz */
139#define IEC958_AES3_CON_FS_192000 (14<<0) /* 192kHz */
111#define IEC958_AES3_CON_CLOCK (3<<4) /* mask - clock accuracy */ 140#define IEC958_AES3_CON_CLOCK (3<<4) /* mask - clock accuracy */
112#define IEC958_AES3_CON_CLOCK_1000PPM (0<<4) /* 1000 ppm */ 141#define IEC958_AES3_CON_CLOCK_1000PPM (0<<4) /* 1000 ppm */
113#define IEC958_AES3_CON_CLOCK_50PPM (1<<4) /* 50 ppm */ 142#define IEC958_AES3_CON_CLOCK_50PPM (1<<4) /* 50 ppm */
@@ -120,6 +149,26 @@
120#define IEC958_AES4_CON_WORDLEN_23_19 (4<<1) /* 23-bit or 19-bit */ 149#define IEC958_AES4_CON_WORDLEN_23_19 (4<<1) /* 23-bit or 19-bit */
121#define IEC958_AES4_CON_WORDLEN_24_20 (5<<1) /* 24-bit or 20-bit */ 150#define IEC958_AES4_CON_WORDLEN_24_20 (5<<1) /* 24-bit or 20-bit */
122#define IEC958_AES4_CON_WORDLEN_21_17 (6<<1) /* 21-bit or 17-bit */ 151#define IEC958_AES4_CON_WORDLEN_21_17 (6<<1) /* 21-bit or 17-bit */
152#define IEC958_AES4_CON_ORIGFS (15<<4) /* mask - original sample frequency */
153#define IEC958_AES4_CON_ORIGFS_NOTID (0<<4) /* not indicated */
154#define IEC958_AES4_CON_ORIGFS_192000 (1<<4) /* 192kHz */
155#define IEC958_AES4_CON_ORIGFS_12000 (2<<4) /* 12kHz */
156#define IEC958_AES4_CON_ORIGFS_176400 (3<<4) /* 176.4kHz */
157#define IEC958_AES4_CON_ORIGFS_96000 (5<<4) /* 96kHz */
158#define IEC958_AES4_CON_ORIGFS_8000 (6<<4) /* 8kHz */
159#define IEC958_AES4_CON_ORIGFS_88200 (7<<4) /* 88.2kHz */
160#define IEC958_AES4_CON_ORIGFS_16000 (8<<4) /* 16kHz */
161#define IEC958_AES4_CON_ORIGFS_24000 (9<<4) /* 24kHz */
162#define IEC958_AES4_CON_ORIGFS_11025 (10<<4) /* 11.025kHz */
163#define IEC958_AES4_CON_ORIGFS_22050 (11<<4) /* 22.05kHz */
164#define IEC958_AES4_CON_ORIGFS_32000 (12<<4) /* 32kHz */
165#define IEC958_AES4_CON_ORIGFS_48000 (13<<4) /* 48kHz */
166#define IEC958_AES4_CON_ORIGFS_44100 (15<<4) /* 44.1kHz */
167#define IEC958_AES5_CON_CGMSA (3<<0) /* mask - CGMS-A */
168#define IEC958_AES5_CON_CGMSA_COPYFREELY (0<<0) /* copying is permitted without restriction */
169#define IEC958_AES5_CON_CGMSA_COPYONCE (1<<0) /* one generation of copies may be made */
170#define IEC958_AES5_CON_CGMSA_COPYNOMORE (2<<0) /* condition not be used */
171#define IEC958_AES5_CON_CGMSA_COPYNEVER (3<<0) /* no copying is permitted */
123 172
124/***************************************************************************** 173/*****************************************************************************
125 * * 174 * *
diff --git a/include/sound/core.h b/include/sound/core.h
index 558b96284bd2..35424a971b7a 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -28,6 +28,7 @@
28#include <linux/rwsem.h> /* struct rw_semaphore */ 28#include <linux/rwsem.h> /* struct rw_semaphore */
29#include <linux/pm.h> /* pm_message_t */ 29#include <linux/pm.h> /* pm_message_t */
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/stringify.h>
31 32
32/* number of supported soundcards */ 33/* number of supported soundcards */
33#ifdef CONFIG_SND_DYNAMIC_MINORS 34#ifdef CONFIG_SND_DYNAMIC_MINORS
@@ -42,9 +43,6 @@
42#ifdef CONFIG_PCI 43#ifdef CONFIG_PCI
43struct pci_dev; 44struct pci_dev;
44#endif 45#endif
45#ifdef CONFIG_SBUS
46struct sbus_dev;
47#endif
48 46
49/* device allocation stuff */ 47/* device allocation stuff */
50 48
@@ -63,6 +61,7 @@ typedef int __bitwise snd_device_type_t;
63#define SNDRV_DEV_INFO ((__force snd_device_type_t) 0x1006) 61#define SNDRV_DEV_INFO ((__force snd_device_type_t) 0x1006)
64#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007) 62#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007)
65#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008) 63#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008)
64#define SNDRV_DEV_JACK ((__force snd_device_type_t) 0x1009)
66#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000) 65#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000)
67 66
68typedef int __bitwise snd_device_state_t; 67typedef int __bitwise snd_device_state_t;
@@ -114,7 +113,7 @@ struct snd_card {
114 char shortname[32]; /* short name of this soundcard */ 113 char shortname[32]; /* short name of this soundcard */
115 char longname[80]; /* name of this soundcard */ 114 char longname[80]; /* name of this soundcard */
116 char mixername[80]; /* mixer name */ 115 char mixername[80]; /* mixer name */
117 char components[80]; /* card components delimited with 116 char components[128]; /* card components delimited with
118 space */ 117 space */
119 struct module *module; /* top-level module */ 118 struct module *module; /* top-level module */
120 119
@@ -366,8 +365,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
366 365
367#ifdef CONFIG_SND_DEBUG 366#ifdef CONFIG_SND_DEBUG
368 367
369#define __ASTRING__(x) #x
370
371#ifdef CONFIG_SND_VERBOSE_PRINTK 368#ifdef CONFIG_SND_VERBOSE_PRINTK
372/** 369/**
373 * snd_printd - debug printk 370 * snd_printd - debug printk
@@ -382,33 +379,15 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
382#define snd_printd(fmt, args...) \ 379#define snd_printd(fmt, args...) \
383 printk(fmt ,##args) 380 printk(fmt ,##args)
384#endif 381#endif
385/** 382
386 * snd_assert - run-time assertion macro 383#define snd_BUG() WARN(1, "BUG?\n")
387 * @expr: expression 384#define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond))
388 *
389 * This macro checks the expression in run-time and invokes the commands
390 * given in the rest arguments if the assertion is failed.
391 * When CONFIG_SND_DEBUG is not set, the expression is executed but
392 * not checked.
393 */
394#define snd_assert(expr, args...) do { \
395 if (unlikely(!(expr))) { \
396 snd_printk(KERN_ERR "BUG? (%s)\n", __ASTRING__(expr)); \
397 dump_stack(); \
398 args; \
399 } \
400} while (0)
401
402#define snd_BUG() do { \
403 snd_printk(KERN_ERR "BUG?\n"); \
404 dump_stack(); \
405} while (0)
406 385
407#else /* !CONFIG_SND_DEBUG */ 386#else /* !CONFIG_SND_DEBUG */
408 387
409#define snd_printd(fmt, args...) /* nothing */ 388#define snd_printd(fmt, args...) /* nothing */
410#define snd_assert(expr, args...) (void)(expr)
411#define snd_BUG() /* nothing */ 389#define snd_BUG() /* nothing */
390#define snd_BUG_ON(cond) ({/*(void)(cond);*/ 0;}) /* always false */
412 391
413#endif /* CONFIG_SND_DEBUG */ 392#endif /* CONFIG_SND_DEBUG */
414 393
diff --git a/include/sound/cs4231.h b/include/sound/cs4231.h
deleted file mode 100644
index f0785f9f4ae4..000000000000
--- a/include/sound/cs4231.h
+++ /dev/null
@@ -1,175 +0,0 @@
1#ifndef __SOUND_CS4231_H
2#define __SOUND_CS4231_H
3
4/*
5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Definitions for CS4231 & InterWave chips & compatible chips
7 *
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#include "control.h"
26#include "pcm.h"
27#include "timer.h"
28
29#include "cs4231-regs.h"
30
31/* defines for codec.mode */
32
33#define CS4231_MODE_NONE 0x0000
34#define CS4231_MODE_PLAY 0x0001
35#define CS4231_MODE_RECORD 0x0002
36#define CS4231_MODE_TIMER 0x0004
37#define CS4231_MODE_OPEN (CS4231_MODE_PLAY|CS4231_MODE_RECORD|CS4231_MODE_TIMER)
38
39/* defines for codec.hardware */
40
41#define CS4231_HW_DETECT 0x0000 /* let CS4231 driver detect chip */
42#define CS4231_HW_DETECT3 0x0001 /* allow mode 3 */
43#define CS4231_HW_TYPE_MASK 0xff00 /* type mask */
44#define CS4231_HW_CS4231_MASK 0x0100 /* CS4231 serie */
45#define CS4231_HW_CS4231 0x0100 /* CS4231 chip */
46#define CS4231_HW_CS4231A 0x0101 /* CS4231A chip */
47#define CS4231_HW_AD1845 0x0102 /* AD1845 chip */
48#define CS4231_HW_CS4232_MASK 0x0200 /* CS4232 serie (has control ports) */
49#define CS4231_HW_CS4232 0x0200 /* CS4232 */
50#define CS4231_HW_CS4232A 0x0201 /* CS4232A */
51#define CS4231_HW_CS4236 0x0202 /* CS4236 */
52#define CS4231_HW_CS4236B_MASK 0x0400 /* CS4236B serie (has extended control regs) */
53#define CS4231_HW_CS4235 0x0400 /* CS4235 - Crystal Clear (tm) stereo enhancement */
54#define CS4231_HW_CS4236B 0x0401 /* CS4236B */
55#define CS4231_HW_CS4237B 0x0402 /* CS4237B - SRS 3D */
56#define CS4231_HW_CS4238B 0x0403 /* CS4238B - QSOUND 3D */
57#define CS4231_HW_CS4239 0x0404 /* CS4239 - Crystal Clear (tm) stereo enhancement */
58/* compatible, but clones */
59#define CS4231_HW_INTERWAVE 0x1000 /* InterWave chip */
60#define CS4231_HW_OPL3SA2 0x1101 /* OPL3-SA2 chip, similar to cs4231 */
61#define CS4231_HW_OPTI93X 0x1102 /* Opti 930/931/933 */
62
63/* defines for codec.hwshare */
64#define CS4231_HWSHARE_IRQ (1<<0)
65#define CS4231_HWSHARE_DMA1 (1<<1)
66#define CS4231_HWSHARE_DMA2 (1<<2)
67
68struct snd_cs4231 {
69 unsigned long port; /* base i/o port */
70 struct resource *res_port;
71 unsigned long cport; /* control base i/o port (CS4236) */
72 struct resource *res_cport;
73 int irq; /* IRQ line */
74 int dma1; /* playback DMA */
75 int dma2; /* record DMA */
76 unsigned short version; /* version of CODEC chip */
77 unsigned short mode; /* see to CS4231_MODE_XXXX */
78 unsigned short hardware; /* see to CS4231_HW_XXXX */
79 unsigned short hwshare; /* shared resources */
80 unsigned short single_dma:1, /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */
81 ebus_flag:1; /* SPARC: EBUS present */
82
83 struct snd_card *card;
84 struct snd_pcm *pcm;
85 struct snd_pcm_substream *playback_substream;
86 struct snd_pcm_substream *capture_substream;
87 struct snd_timer *timer;
88
89 unsigned char image[32]; /* registers image */
90 unsigned char eimage[32]; /* extended registers image */
91 unsigned char cimage[16]; /* control registers image */
92 int mce_bit;
93 int calibrate_mute;
94 int sw_3d_bit;
95 unsigned int p_dma_size;
96 unsigned int c_dma_size;
97
98 spinlock_t reg_lock;
99 struct mutex mce_mutex;
100 struct mutex open_mutex;
101
102 int (*rate_constraint) (struct snd_pcm_runtime *runtime);
103 void (*set_playback_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char pdfr);
104 void (*set_capture_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char cdfr);
105 void (*trigger) (struct snd_cs4231 *chip, unsigned int what, int start);
106#ifdef CONFIG_PM
107 void (*suspend) (struct snd_cs4231 *chip);
108 void (*resume) (struct snd_cs4231 *chip);
109#endif
110 void *dma_private_data;
111 int (*claim_dma) (struct snd_cs4231 *chip, void *dma_private_data, int dma);
112 int (*release_dma) (struct snd_cs4231 *chip, void *dma_private_data, int dma);
113};
114
115/* exported functions */
116
117void snd_cs4231_out(struct snd_cs4231 *chip, unsigned char reg, unsigned char val);
118unsigned char snd_cs4231_in(struct snd_cs4231 *chip, unsigned char reg);
119void snd_cs4236_ext_out(struct snd_cs4231 *chip, unsigned char reg, unsigned char val);
120unsigned char snd_cs4236_ext_in(struct snd_cs4231 *chip, unsigned char reg);
121void snd_cs4231_mce_up(struct snd_cs4231 *chip);
122void snd_cs4231_mce_down(struct snd_cs4231 *chip);
123
124void snd_cs4231_overrange(struct snd_cs4231 *chip);
125
126irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id);
127
128const char *snd_cs4231_chip_id(struct snd_cs4231 *chip);
129
130int snd_cs4231_create(struct snd_card *card,
131 unsigned long port,
132 unsigned long cport,
133 int irq, int dma1, int dma2,
134 unsigned short hardware,
135 unsigned short hwshare,
136 struct snd_cs4231 ** rchip);
137int snd_cs4231_pcm(struct snd_cs4231 * chip, int device, struct snd_pcm **rpcm);
138int snd_cs4231_timer(struct snd_cs4231 * chip, int device, struct snd_timer **rtimer);
139int snd_cs4231_mixer(struct snd_cs4231 * chip);
140
141int snd_cs4236_create(struct snd_card *card,
142 unsigned long port,
143 unsigned long cport,
144 int irq, int dma1, int dma2,
145 unsigned short hardware,
146 unsigned short hwshare,
147 struct snd_cs4231 ** rchip);
148int snd_cs4236_pcm(struct snd_cs4231 * chip, int device, struct snd_pcm **rpcm);
149int snd_cs4236_mixer(struct snd_cs4231 * chip);
150
151/*
152 * mixer library
153 */
154
155#define CS4231_SINGLE(xname, xindex, reg, shift, mask, invert) \
156{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
157 .info = snd_cs4231_info_single, \
158 .get = snd_cs4231_get_single, .put = snd_cs4231_put_single, \
159 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
160
161int snd_cs4231_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
162int snd_cs4231_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
163int snd_cs4231_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
164
165#define CS4231_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \
166{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
167 .info = snd_cs4231_info_double, \
168 .get = snd_cs4231_get_double, .put = snd_cs4231_put_double, \
169 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
170
171int snd_cs4231_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
172int snd_cs4231_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
173int snd_cs4231_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
174
175#endif /* __SOUND_CS4231_H */
diff --git a/include/sound/jack.h b/include/sound/jack.h
new file mode 100644
index 000000000000..b1b2b8b59adb
--- /dev/null
+++ b/include/sound/jack.h
@@ -0,0 +1,75 @@
1#ifndef __SOUND_JACK_H
2#define __SOUND_JACK_H
3
4/*
5 * Jack abstraction layer
6 *
7 * Copyright 2008 Wolfson Microelectronics plc
8 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26#include <sound/core.h>
27
28struct input_dev;
29
30/**
31 * Jack types which can be reported. These values are used as a
32 * bitmask.
33 */
34enum snd_jack_types {
35 SND_JACK_HEADPHONE = 0x0001,
36 SND_JACK_MICROPHONE = 0x0002,
37 SND_JACK_HEADSET = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE,
38};
39
40struct snd_jack {
41 struct input_dev *input_dev;
42 int registered;
43 int type;
44 const char *id;
45 char name[100];
46};
47
48#ifdef CONFIG_SND_JACK
49
50int snd_jack_new(struct snd_card *card, const char *id, int type,
51 struct snd_jack **jack);
52void snd_jack_set_parent(struct snd_jack *jack, struct device *parent);
53
54void snd_jack_report(struct snd_jack *jack, int status);
55
56#else
57
58static inline int snd_jack_new(struct snd_card *card, const char *id, int type,
59 struct snd_jack **jack)
60{
61 return 0;
62}
63
64static inline void snd_jack_set_parent(struct snd_jack *jack,
65 struct device *parent)
66{
67}
68
69static inline void snd_jack_report(struct snd_jack *jack, int status)
70{
71}
72
73#endif
74
75#endif
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h
index ae2921d9ddcc..7ccce94a5255 100644
--- a/include/sound/memalloc.h
+++ b/include/sound/memalloc.h
@@ -37,7 +37,6 @@ struct snd_dma_device {
37#ifndef snd_dma_pci_data 37#ifndef snd_dma_pci_data
38#define snd_dma_pci_data(pci) (&(pci)->dev) 38#define snd_dma_pci_data(pci) (&(pci)->dev)
39#define snd_dma_isa_data() NULL 39#define snd_dma_isa_data() NULL
40#define snd_dma_sbus_data(sbus) ((struct device *)(sbus))
41#define snd_dma_continuous_data(x) ((struct device *)(unsigned long)(x)) 40#define snd_dma_continuous_data(x) ((struct device *)(unsigned long)(x))
42#endif 41#endif
43 42
@@ -49,7 +48,6 @@ struct snd_dma_device {
49#define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ 48#define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */
50#define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ 49#define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */
51#define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ 50#define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */
52#define SNDRV_DMA_TYPE_SBUS 4 /* SBUS continuous */
53 51
54/* 52/*
55 * info for buffer allocation 53 * info for buffer allocation
@@ -65,6 +63,11 @@ struct snd_dma_buffer {
65/* 63/*
66 * Scatter-Gather generic device pages 64 * Scatter-Gather generic device pages
67 */ 65 */
66void *snd_malloc_sgbuf_pages(struct device *device,
67 size_t size, struct snd_dma_buffer *dmab,
68 size_t *res_size);
69int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab);
70
68struct snd_sg_page { 71struct snd_sg_page {
69 void *buf; 72 void *buf;
70 dma_addr_t addr; 73 dma_addr_t addr;
@@ -92,9 +95,18 @@ static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
92 */ 95 */
93static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t offset) 96static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t offset)
94{ 97{
95 return sgbuf->table[offset >> PAGE_SHIFT].addr + offset % PAGE_SIZE; 98 dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr;
99 addr &= PAGE_MASK;
100 return addr + offset % PAGE_SIZE;
96} 101}
97 102
103/*
104 * return the virtual address at the corresponding offset
105 */
106static inline void *snd_sgbuf_get_ptr(struct snd_sg_buf *sgbuf, size_t offset)
107{
108 return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE;
109}
98 110
99/* allocate/release a buffer */ 111/* allocate/release a buffer */
100int snd_dma_alloc_pages(int type, struct device *dev, size_t size, 112int snd_dma_alloc_pages(int type, struct device *dev, size_t size,
diff --git a/include/sound/minors.h b/include/sound/minors.h
index 46bcd2023ed8..a81798ab73ed 100644
--- a/include/sound/minors.h
+++ b/include/sound/minors.h
@@ -21,6 +21,8 @@
21 * 21 *
22 */ 22 */
23 23
24#define SNDRV_OS_MINORS 256
25
24#define SNDRV_MINOR_DEVICES 32 26#define SNDRV_MINOR_DEVICES 32
25#define SNDRV_MINOR_CARD(minor) ((minor) >> 5) 27#define SNDRV_MINOR_CARD(minor) ((minor) >> 5)
26#define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f) 28#define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f)
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 51d58ccda2d8..40c5a6fa6bcd 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -25,6 +25,7 @@
25 25
26#include <sound/asound.h> 26#include <sound/asound.h>
27#include <sound/memalloc.h> 27#include <sound/memalloc.h>
28#include <sound/minors.h>
28#include <linux/poll.h> 29#include <linux/poll.h>
29#include <linux/mm.h> 30#include <linux/mm.h>
30#include <linux/bitops.h> 31#include <linux/bitops.h>
@@ -84,7 +85,11 @@ struct snd_pcm_ops {
84 * 85 *
85 */ 86 */
86 87
87#define SNDRV_PCM_DEVICES 8 88#if defined(CONFIG_SND_DYNAMIC_MINORS)
89#define SNDRV_PCM_DEVICES (SNDRV_OS_MINORS-2)
90#else
91#define SNDRV_PCM_DEVICES 8
92#endif
88 93
89#define SNDRV_PCM_IOCTL1_FALSE ((void *)0) 94#define SNDRV_PCM_IOCTL1_FALSE ((void *)0)
90#define SNDRV_PCM_IOCTL1_TRUE ((void *)1) 95#define SNDRV_PCM_IOCTL1_TRUE ((void *)1)
@@ -416,7 +421,7 @@ struct snd_pcm_str {
416struct snd_pcm { 421struct snd_pcm {
417 struct snd_card *card; 422 struct snd_card *card;
418 struct list_head list; 423 struct list_head list;
419 unsigned int device; /* device number */ 424 int device; /* device number */
420 unsigned int info_flags; 425 unsigned int info_flags;
421 unsigned short dev_class; 426 unsigned short dev_class;
422 unsigned short dev_subclass; 427 unsigned short dev_subclass;
@@ -969,10 +974,30 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
969int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); 974int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
970int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 975int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
971 976
972#define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) 977/*
973#define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) 978 * SG-buffer handling
974#define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) 979 */
975struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset); 980#define snd_pcm_substream_sgbuf(substream) \
981 ((substream)->runtime->dma_buffer_p->private_data)
982
983static inline dma_addr_t
984snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
985{
986 struct snd_sg_buf *sg = snd_pcm_substream_sgbuf(substream);
987 return snd_sgbuf_get_addr(sg, ofs);
988}
989
990static inline void *
991snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs)
992{
993 struct snd_sg_buf *sg = snd_pcm_substream_sgbuf(substream);
994 return snd_sgbuf_get_ptr(sg, ofs);
995}
996
997struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream,
998 unsigned long offset);
999unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
1000 unsigned int ofs, unsigned int size);
976 1001
977/* handle mmap counter - PCM mmap callback should handle this counter properly */ 1002/* handle mmap counter - PCM mmap callback should handle this counter properly */
978static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) 1003static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
@@ -1010,4 +1035,6 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
1010 (IEC958_AES1_CON_PCM_CODER<<8)|\ 1035 (IEC958_AES1_CON_PCM_CODER<<8)|\
1011 (IEC958_AES3_CON_FS_48000<<24)) 1036 (IEC958_AES3_CON_FS_48000<<24))
1012 1037
1038#define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime)
1039
1013#endif /* __SOUND_PCM_H */ 1040#endif /* __SOUND_PCM_H */
diff --git a/include/sound/pxa2xx-lib.h b/include/sound/pxa2xx-lib.h
new file mode 100644
index 000000000000..2fd3d251d9a5
--- /dev/null
+++ b/include/sound/pxa2xx-lib.h
@@ -0,0 +1,45 @@
1#ifndef PXA2XX_LIB_H
2#define PXA2XX_LIB_H
3
4#include <linux/platform_device.h>
5#include <sound/ac97_codec.h>
6
7/* PCM */
8
9struct pxa2xx_pcm_dma_params {
10 char *name; /* stream identifier */
11 u32 dcmd; /* DMA descriptor dcmd field */
12 volatile u32 *drcmr; /* the DMA request channel to use */
13 u32 dev_addr; /* device physical address for DMA */
14};
15
16extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
17 struct snd_pcm_hw_params *params);
18extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream);
19extern int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
20extern snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream);
21extern int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
22extern void pxa2xx_pcm_dma_irq(int dma_ch, void *dev_id);
23extern int __pxa2xx_pcm_open(struct snd_pcm_substream *substream);
24extern int __pxa2xx_pcm_close(struct snd_pcm_substream *substream);
25extern int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
26 struct vm_area_struct *vma);
27extern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream);
28extern void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm);
29
30/* AC97 */
31
32extern unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
33extern void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
34
35extern bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97);
36extern bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97);
37extern void pxa2xx_ac97_finish_reset(struct snd_ac97 *ac97);
38
39extern int pxa2xx_ac97_hw_suspend(void);
40extern int pxa2xx_ac97_hw_resume(void);
41
42extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
43extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
44
45#endif
diff --git a/include/sound/sb.h b/include/sound/sb.h
index d0c9ed3546c8..85f93c5fe1e4 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -240,11 +240,15 @@ struct snd_sb {
240#define SB_DT019X_CAP_MAIN 0x07 240#define SB_DT019X_CAP_MAIN 0x07
241 241
242#define SB_ALS4000_MONO_IO_CTRL 0x4b 242#define SB_ALS4000_MONO_IO_CTRL 0x4b
243#define SB_ALS4000_OUT_MIXER_CTRL_2 0x4c
243#define SB_ALS4000_MIC_IN_GAIN 0x4d 244#define SB_ALS4000_MIC_IN_GAIN 0x4d
245#define SB_ALS4000_ANALOG_REFRNC_VOLT_CTRL 0x4e
244#define SB_ALS4000_FMDAC 0x4f 246#define SB_ALS4000_FMDAC 0x4f
245#define SB_ALS4000_3D_SND_FX 0x50 247#define SB_ALS4000_3D_SND_FX 0x50
246#define SB_ALS4000_3D_TIME_DELAY 0x51 248#define SB_ALS4000_3D_TIME_DELAY 0x51
247#define SB_ALS4000_3D_AUTO_MUTE 0x52 249#define SB_ALS4000_3D_AUTO_MUTE 0x52
250#define SB_ALS4000_ANALOG_BLOCK_CTRL 0x53
251#define SB_ALS4000_3D_DELAYLINE_PATTERN 0x54
248#define SB_ALS4000_QSOUND 0xdb 252#define SB_ALS4000_QSOUND 0xdb
249 253
250/* IRQ setting bitmap */ 254/* IRQ setting bitmap */
@@ -257,6 +261,7 @@ struct snd_sb {
257#define SB_IRQTYPE_8BIT 0x01 261#define SB_IRQTYPE_8BIT 0x01
258#define SB_IRQTYPE_16BIT 0x02 262#define SB_IRQTYPE_16BIT 0x02
259#define SB_IRQTYPE_MPUIN 0x04 263#define SB_IRQTYPE_MPUIN 0x04
264#define ALS4K_IRQTYPE_CR1E_DMA 0x20
260 265
261/* DMA setting bitmap */ 266/* DMA setting bitmap */
262#define SB_DMASETUP_DMA0 0x01 267#define SB_DMASETUP_DMA0 0x01
diff --git a/include/sound/snd_wavefront.h b/include/sound/snd_wavefront.h
index 9688d4be918e..fa149ca77e4b 100644
--- a/include/sound/snd_wavefront.h
+++ b/include/sound/snd_wavefront.h
@@ -1,7 +1,6 @@
1#ifndef __SOUND_SND_WAVEFRONT_H__ 1#ifndef __SOUND_SND_WAVEFRONT_H__
2#define __SOUND_SND_WAVEFRONT_H__ 2#define __SOUND_SND_WAVEFRONT_H__
3 3
4#include "cs4231.h"
5#include "mpu401.h" 4#include "mpu401.h"
6#include "hwdep.h" 5#include "hwdep.h"
7#include "rawmidi.h" 6#include "rawmidi.h"
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c1b26fcc0b5c..ca699a3017f3 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -240,6 +240,7 @@ int snd_soc_dapm_sys_add(struct device *dev);
240/* dapm audio pin control and status */ 240/* dapm audio pin control and status */
241int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, char *pin); 241int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, char *pin);
242int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, char *pin); 242int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, char *pin);
243int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, char *pin);
243int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, char *pin); 244int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, char *pin);
244int snd_soc_dapm_sync(struct snd_soc_codec *codec); 245int snd_soc_dapm_sync(struct snd_soc_codec *codec);
245 246
diff --git a/include/sound/soc-of-simple.h b/include/sound/soc-of-simple.h
new file mode 100644
index 000000000000..a064e1934a56
--- /dev/null
+++ b/include/sound/soc-of-simple.h
@@ -0,0 +1,25 @@
1/*
2 * OF helpers for ALSA SoC
3 *
4 * Copyright (C) 2008, Secret Lab Technologies Ltd.
5 */
6
7#ifndef _INCLUDE_SOC_OF_H_
8#define _INCLUDE_SOC_OF_H_
9
10#if defined(CONFIG_SND_SOC_OF_SIMPLE) || defined(CONFIG_SND_SOC_OF_SIMPLE_MODULE)
11
12#include <linux/of.h>
13#include <sound/soc.h>
14
15int of_snd_soc_register_codec(struct snd_soc_codec_device *codec_dev,
16 void *codec_data, struct snd_soc_dai *dai,
17 struct device_node *node);
18
19int of_snd_soc_register_platform(struct snd_soc_platform *platform,
20 struct device_node *node,
21 struct snd_soc_dai *cpu_dai);
22
23#endif
24
25#endif /* _INCLUDE_SOC_OF_H_ */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1890d87c5204..a1e0357a84d7 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -26,10 +26,12 @@
26/* 26/*
27 * Convenience kcontrol builders 27 * Convenience kcontrol builders
28 */ 28 */
29#define SOC_SINGLE_VALUE(reg, shift, max, invert) ((reg) | ((shift) << 8) |\ 29#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \
30 ((shift) << 12) | ((max) << 16) | ((invert) << 24)) 30 ((unsigned long)&(struct soc_mixer_control) \
31#define SOC_SINGLE_VALUE_EXT(reg, max, invert) ((reg) | ((max) << 16) |\ 31 {.reg = xreg, .shift = xshift, .max = xmax, .invert = xinvert})
32 ((invert) << 31)) 32#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \
33 ((unsigned long)&(struct soc_mixer_control) \
34 {.reg = xreg, .max = xmax, .invert = xinvert})
33#define SOC_SINGLE(xname, reg, shift, max, invert) \ 35#define SOC_SINGLE(xname, reg, shift, max, invert) \
34{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 36{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
35 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 37 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
@@ -43,64 +45,68 @@
43 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 45 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
44 .put = snd_soc_put_volsw, \ 46 .put = snd_soc_put_volsw, \
45 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 47 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
46#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ 48#define SOC_DOUBLE(xname, xreg, shift_left, shift_right, xmax, xinvert) \
47{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 49{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
48 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 50 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
49 .put = snd_soc_put_volsw, \ 51 .put = snd_soc_put_volsw, \
50 .private_value = (reg) | ((shift_left) << 8) | \ 52 .private_value = (unsigned long)&(struct soc_mixer_control) \
51 ((shift_right) << 12) | ((max) << 16) | ((invert) << 24) } 53 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \
52#define SOC_DOUBLE_R(xname, reg_left, reg_right, shift, max, invert) \ 54 .max = xmax, .invert = xinvert} }
55#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
53{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 56{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
54 .info = snd_soc_info_volsw_2r, \ 57 .info = snd_soc_info_volsw_2r, \
55 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ 58 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
56 .private_value = (reg_left) | ((shift) << 8) | \ 59 .private_value = (unsigned long)&(struct soc_mixer_control) \
57 ((max) << 12) | ((invert) << 20) | ((reg_right) << 24) } 60 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
58#define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ 61 .max = xmax, .invert = xinvert} }
62#define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \
59{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 63{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
60 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 64 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
61 SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 65 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
62 .tlv.p = (tlv_array), \ 66 .tlv.p = (tlv_array), \
63 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 67 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
64 .put = snd_soc_put_volsw, \ 68 .put = snd_soc_put_volsw, \
65 .private_value = (reg) | ((shift_left) << 8) | \ 69 .private_value = (unsigned long)&(struct soc_mixer_control) \
66 ((shift_right) << 12) | ((max) << 16) | ((invert) << 24) } 70 {.reg = xreg, .shift = shift_left, .rshift = shift_right,\
67#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, shift, max, invert, tlv_array) \ 71 .max = xmax, .invert = xinvert} }
72#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \
68{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 73{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
69 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 74 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
70 SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 75 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
71 .tlv.p = (tlv_array), \ 76 .tlv.p = (tlv_array), \
72 .info = snd_soc_info_volsw_2r, \ 77 .info = snd_soc_info_volsw_2r, \
73 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ 78 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
74 .private_value = (reg_left) | ((shift) << 8) | \ 79 .private_value = (unsigned long)&(struct soc_mixer_control) \
75 ((max) << 12) | ((invert) << 20) | ((reg_right) << 24) } 80 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
76#define SOC_DOUBLE_S8_TLV(xname, reg, min, max, tlv_array) \ 81 .max = xmax, .invert = xinvert} }
82#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
77{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 83{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
78 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 84 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
79 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 85 SNDRV_CTL_ELEM_ACCESS_READWRITE, \
80 .tlv.p = (tlv_array), \ 86 .tlv.p = (tlv_array), \
81 .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \ 87 .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \
82 .put = snd_soc_put_volsw_s8, \ 88 .put = snd_soc_put_volsw_s8, \
83 .private_value = (reg) | (((signed char)max) << 16) | \ 89 .private_value = (unsigned long)&(struct soc_mixer_control) \
84 (((signed char)min) << 24) } 90 {.reg = xreg, .min = xmin, .max = xmax} }
85#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \ 91#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \
86{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ 92{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
87 .mask = xmask, .texts = xtexts } 93 .max = xmax, .texts = xtexts }
88#define SOC_ENUM_SINGLE(xreg, xshift, xmask, xtexts) \ 94#define SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) \
89 SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xtexts) 95 SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts)
90#define SOC_ENUM_SINGLE_EXT(xmask, xtexts) \ 96#define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \
91{ .mask = xmask, .texts = xtexts } 97{ .max = xmax, .texts = xtexts }
92#define SOC_ENUM(xname, xenum) \ 98#define SOC_ENUM(xname, xenum) \
93{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ 99{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
94 .info = snd_soc_info_enum_double, \ 100 .info = snd_soc_info_enum_double, \
95 .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \ 101 .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \
96 .private_value = (unsigned long)&xenum } 102 .private_value = (unsigned long)&xenum }
97#define SOC_SINGLE_EXT(xname, xreg, xshift, xmask, xinvert,\ 103#define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\
98 xhandler_get, xhandler_put) \ 104 xhandler_get, xhandler_put) \
99{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 105{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
100 .info = snd_soc_info_volsw, \ 106 .info = snd_soc_info_volsw, \
101 .get = xhandler_get, .put = xhandler_put, \ 107 .get = xhandler_get, .put = xhandler_put, \
102 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmask, xinvert) } 108 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) }
103#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmask, xinvert,\ 109#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
104 xhandler_get, xhandler_put, tlv_array) \ 110 xhandler_get, xhandler_put, tlv_array) \
105{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 111{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
106 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 112 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
@@ -108,7 +114,7 @@
108 .tlv.p = (tlv_array), \ 114 .tlv.p = (tlv_array), \
109 .info = snd_soc_info_volsw, \ 115 .info = snd_soc_info_volsw, \
110 .get = xhandler_get, .put = xhandler_put, \ 116 .get = xhandler_get, .put = xhandler_put, \
111 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmask, xinvert) } 117 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) }
112#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ 118#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
113{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 119{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
114 .info = snd_soc_info_bool_ext, \ 120 .info = snd_soc_info_bool_ext, \
@@ -410,6 +416,8 @@ struct snd_soc_codec {
410 void *control_data; /* codec control (i2c/3wire) data */ 416 void *control_data; /* codec control (i2c/3wire) data */
411 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 417 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
412 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); 418 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
419 int (*display_register)(struct snd_soc_codec *, char *,
420 size_t, unsigned int);
413 hw_write_t hw_write; 421 hw_write_t hw_write;
414 hw_read_t hw_read; 422 hw_read_t hw_read;
415 void *reg_cache; 423 void *reg_cache;
@@ -516,13 +524,19 @@ struct snd_soc_pcm_runtime {
516 struct snd_soc_device *socdev; 524 struct snd_soc_device *socdev;
517}; 525};
518 526
527/* mixer control */
528struct soc_mixer_control {
529 int min, max;
530 unsigned int reg, rreg, shift, rshift, invert;
531};
532
519/* enumerated kcontrol */ 533/* enumerated kcontrol */
520struct soc_enum { 534struct soc_enum {
521 unsigned short reg; 535 unsigned short reg;
522 unsigned short reg2; 536 unsigned short reg2;
523 unsigned char shift_l; 537 unsigned char shift_l;
524 unsigned char shift_r; 538 unsigned char shift_r;
525 unsigned int mask; 539 unsigned int max;
526 const char **texts; 540 const char **texts;
527 void *dapm; 541 void *dapm;
528}; 542};
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index b62ce3e077f9..b6870cbaf2b3 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -43,6 +43,7 @@ struct snd_tea575x {
43 unsigned int freq_fixup; /* crystal onboard */ 43 unsigned int freq_fixup; /* crystal onboard */
44 unsigned int val; /* hw value */ 44 unsigned int val; /* hw value */
45 unsigned long freq; /* frequency */ 45 unsigned long freq; /* frequency */
46 unsigned long in_use; /* set if the device is in use */
46 struct snd_tea575x_ops *ops; 47 struct snd_tea575x_ops *ops;
47 void *private_data; 48 void *private_data;
48}; 49};
diff --git a/include/sound/version.h b/include/sound/version.h
index 6b78aff273a8..4aafeda88634 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h */ 1/* include/version.h */
2#define CONFIG_SND_VERSION "1.0.17" 2#define CONFIG_SND_VERSION "1.0.18rc3"
3#define CONFIG_SND_DATE "" 3#define CONFIG_SND_DATE ""
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h
index 4830651cc4cf..5456343ebe4c 100644
--- a/include/sound/vx_core.h
+++ b/include/sound/vx_core.h
@@ -235,37 +235,31 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev);
235 */ 235 */
236static inline int vx_test_and_ack(struct vx_core *chip) 236static inline int vx_test_and_ack(struct vx_core *chip)
237{ 237{
238 snd_assert(chip->ops->test_and_ack, return -ENXIO);
239 return chip->ops->test_and_ack(chip); 238 return chip->ops->test_and_ack(chip);
240} 239}
241 240
242static inline void vx_validate_irq(struct vx_core *chip, int enable) 241static inline void vx_validate_irq(struct vx_core *chip, int enable)
243{ 242{
244 snd_assert(chip->ops->validate_irq, return);
245 chip->ops->validate_irq(chip, enable); 243 chip->ops->validate_irq(chip, enable);
246} 244}
247 245
248static inline unsigned char snd_vx_inb(struct vx_core *chip, int reg) 246static inline unsigned char snd_vx_inb(struct vx_core *chip, int reg)
249{ 247{
250 snd_assert(chip->ops->in8, return 0);
251 return chip->ops->in8(chip, reg); 248 return chip->ops->in8(chip, reg);
252} 249}
253 250
254static inline unsigned int snd_vx_inl(struct vx_core *chip, int reg) 251static inline unsigned int snd_vx_inl(struct vx_core *chip, int reg)
255{ 252{
256 snd_assert(chip->ops->in32, return 0);
257 return chip->ops->in32(chip, reg); 253 return chip->ops->in32(chip, reg);
258} 254}
259 255
260static inline void snd_vx_outb(struct vx_core *chip, int reg, unsigned char val) 256static inline void snd_vx_outb(struct vx_core *chip, int reg, unsigned char val)
261{ 257{
262 snd_assert(chip->ops->out8, return);
263 chip->ops->out8(chip, reg, val); 258 chip->ops->out8(chip, reg, val);
264} 259}
265 260
266static inline void snd_vx_outl(struct vx_core *chip, int reg, unsigned int val) 261static inline void snd_vx_outl(struct vx_core *chip, int reg, unsigned int val)
267{ 262{
268 snd_assert(chip->ops->out32, return);
269 chip->ops->out32(chip, reg, val); 263 chip->ops->out32(chip, reg, val);
270} 264}
271 265
@@ -276,7 +270,6 @@ static inline void snd_vx_outl(struct vx_core *chip, int reg, unsigned int val)
276 270
277static inline void vx_reset_dsp(struct vx_core *chip) 271static inline void vx_reset_dsp(struct vx_core *chip)
278{ 272{
279 snd_assert(chip->ops->reset_dsp, return);
280 chip->ops->reset_dsp(chip); 273 chip->ops->reset_dsp(chip);
281} 274}
282 275
@@ -304,14 +297,12 @@ int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int t
304static inline void vx_pseudo_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, 297static inline void vx_pseudo_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
305 struct vx_pipe *pipe, int count) 298 struct vx_pipe *pipe, int count)
306{ 299{
307 snd_assert(chip->ops->dma_write, return);
308 chip->ops->dma_write(chip, runtime, pipe, count); 300 chip->ops->dma_write(chip, runtime, pipe, count);
309} 301}
310 302
311static inline void vx_pseudo_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, 303static inline void vx_pseudo_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
312 struct vx_pipe *pipe, int count) 304 struct vx_pipe *pipe, int count)
313{ 305{
314 snd_assert(chip->ops->dma_read, return);
315 chip->ops->dma_read(chip, runtime, pipe, count); 306 chip->ops->dma_read(chip, runtime, pipe, count);
316} 307}
317 308
diff --git a/include/sound/wss.h b/include/sound/wss.h
new file mode 100644
index 000000000000..fd01f22825cd
--- /dev/null
+++ b/include/sound/wss.h
@@ -0,0 +1,235 @@
1#ifndef __SOUND_WSS_H
2#define __SOUND_WSS_H
3
4/*
5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Definitions for CS4231 & InterWave chips & compatible chips
7 *
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#include "control.h"
26#include "pcm.h"
27#include "timer.h"
28
29#include "cs4231-regs.h"
30
31/* defines for codec.mode */
32
33#define WSS_MODE_NONE 0x0000
34#define WSS_MODE_PLAY 0x0001
35#define WSS_MODE_RECORD 0x0002
36#define WSS_MODE_TIMER 0x0004
37#define WSS_MODE_OPEN (WSS_MODE_PLAY|WSS_MODE_RECORD|WSS_MODE_TIMER)
38
39/* defines for codec.hardware */
40
41#define WSS_HW_DETECT 0x0000 /* let CS4231 driver detect chip */
42#define WSS_HW_DETECT3 0x0001 /* allow mode 3 */
43#define WSS_HW_TYPE_MASK 0xff00 /* type mask */
44#define WSS_HW_CS4231_MASK 0x0100 /* CS4231 serie */
45#define WSS_HW_CS4231 0x0100 /* CS4231 chip */
46#define WSS_HW_CS4231A 0x0101 /* CS4231A chip */
47#define WSS_HW_AD1845 0x0102 /* AD1845 chip */
48#define WSS_HW_CS4232_MASK 0x0200 /* CS4232 serie (has control ports) */
49#define WSS_HW_CS4232 0x0200 /* CS4232 */
50#define WSS_HW_CS4232A 0x0201 /* CS4232A */
51#define WSS_HW_CS4236 0x0202 /* CS4236 */
52#define WSS_HW_CS4236B_MASK 0x0400 /* CS4236B serie (has extended control regs) */
53#define WSS_HW_CS4235 0x0400 /* CS4235 - Crystal Clear (tm) stereo enhancement */
54#define WSS_HW_CS4236B 0x0401 /* CS4236B */
55#define WSS_HW_CS4237B 0x0402 /* CS4237B - SRS 3D */
56#define WSS_HW_CS4238B 0x0403 /* CS4238B - QSOUND 3D */
57#define WSS_HW_CS4239 0x0404 /* CS4239 - Crystal Clear (tm) stereo enhancement */
58#define WSS_HW_AD1848_MASK 0x0800 /* AD1848 serie (half duplex) */
59#define WSS_HW_AD1847 0x0801 /* AD1847 chip */
60#define WSS_HW_AD1848 0x0802 /* AD1848 chip */
61#define WSS_HW_CS4248 0x0803 /* CS4248 chip */
62#define WSS_HW_CMI8330 0x0804 /* CMI8330 chip */
63#define WSS_HW_THINKPAD 0x0805 /* Thinkpad 360/750/755 */
64/* compatible, but clones */
65#define WSS_HW_INTERWAVE 0x1000 /* InterWave chip */
66#define WSS_HW_OPL3SA2 0x1101 /* OPL3-SA2 chip, similar to cs4231 */
67#define WSS_HW_OPTI93X 0x1102 /* Opti 930/931/933 */
68
69/* defines for codec.hwshare */
70#define WSS_HWSHARE_IRQ (1<<0)
71#define WSS_HWSHARE_DMA1 (1<<1)
72#define WSS_HWSHARE_DMA2 (1<<2)
73
74/* IBM Thinkpad specific stuff */
75#define AD1848_THINKPAD_CTL_PORT1 0x15e8
76#define AD1848_THINKPAD_CTL_PORT2 0x15e9
77#define AD1848_THINKPAD_CS4248_ENABLE_BIT 0x02
78
79struct snd_wss {
80 unsigned long port; /* base i/o port */
81 struct resource *res_port;
82 unsigned long cport; /* control base i/o port (CS4236) */
83 struct resource *res_cport;
84 int irq; /* IRQ line */
85 int dma1; /* playback DMA */
86 int dma2; /* record DMA */
87 unsigned short version; /* version of CODEC chip */
88 unsigned short mode; /* see to WSS_MODE_XXXX */
89 unsigned short hardware; /* see to WSS_HW_XXXX */
90 unsigned short hwshare; /* shared resources */
91 unsigned short single_dma:1, /* forced single DMA mode (GUS 16-bit */
92 /* daughter board) or dma1 == dma2 */
93 ebus_flag:1, /* SPARC: EBUS present */
94 thinkpad_flag:1; /* Thinkpad CS4248 needs extra help */
95
96 struct snd_card *card;
97 struct snd_pcm *pcm;
98 struct snd_pcm_substream *playback_substream;
99 struct snd_pcm_substream *capture_substream;
100 struct snd_timer *timer;
101
102 unsigned char image[32]; /* registers image */
103 unsigned char eimage[32]; /* extended registers image */
104 unsigned char cimage[16]; /* control registers image */
105 int mce_bit;
106 int calibrate_mute;
107 int sw_3d_bit;
108 unsigned int p_dma_size;
109 unsigned int c_dma_size;
110
111 spinlock_t reg_lock;
112 struct mutex mce_mutex;
113 struct mutex open_mutex;
114
115 int (*rate_constraint) (struct snd_pcm_runtime *runtime);
116 void (*set_playback_format) (struct snd_wss *chip,
117 struct snd_pcm_hw_params *hw_params,
118 unsigned char pdfr);
119 void (*set_capture_format) (struct snd_wss *chip,
120 struct snd_pcm_hw_params *hw_params,
121 unsigned char cdfr);
122 void (*trigger) (struct snd_wss *chip, unsigned int what, int start);
123#ifdef CONFIG_PM
124 void (*suspend) (struct snd_wss *chip);
125 void (*resume) (struct snd_wss *chip);
126#endif
127 void *dma_private_data;
128 int (*claim_dma) (struct snd_wss *chip,
129 void *dma_private_data, int dma);
130 int (*release_dma) (struct snd_wss *chip,
131 void *dma_private_data, int dma);
132};
133
134/* exported functions */
135
136void snd_wss_out(struct snd_wss *chip, unsigned char reg, unsigned char val);
137unsigned char snd_wss_in(struct snd_wss *chip, unsigned char reg);
138void snd_cs4236_ext_out(struct snd_wss *chip,
139 unsigned char reg, unsigned char val);
140unsigned char snd_cs4236_ext_in(struct snd_wss *chip, unsigned char reg);
141void snd_wss_mce_up(struct snd_wss *chip);
142void snd_wss_mce_down(struct snd_wss *chip);
143
144void snd_wss_overrange(struct snd_wss *chip);
145
146irqreturn_t snd_wss_interrupt(int irq, void *dev_id);
147
148const char *snd_wss_chip_id(struct snd_wss *chip);
149
150int snd_wss_create(struct snd_card *card,
151 unsigned long port,
152 unsigned long cport,
153 int irq, int dma1, int dma2,
154 unsigned short hardware,
155 unsigned short hwshare,
156 struct snd_wss **rchip);
157int snd_wss_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm);
158int snd_wss_timer(struct snd_wss *chip, int device, struct snd_timer **rtimer);
159int snd_wss_mixer(struct snd_wss *chip);
160
161const struct snd_pcm_ops *snd_wss_get_pcm_ops(int direction);
162
163int snd_cs4236_create(struct snd_card *card,
164 unsigned long port,
165 unsigned long cport,
166 int irq, int dma1, int dma2,
167 unsigned short hardware,
168 unsigned short hwshare,
169 struct snd_wss **rchip);
170int snd_cs4236_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm);
171int snd_cs4236_mixer(struct snd_wss *chip);
172
173/*
174 * mixer library
175 */
176
177#define WSS_SINGLE(xname, xindex, reg, shift, mask, invert) \
178{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
179 .name = xname, \
180 .index = xindex, \
181 .info = snd_wss_info_single, \
182 .get = snd_wss_get_single, \
183 .put = snd_wss_put_single, \
184 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
185
186int snd_wss_info_single(struct snd_kcontrol *kcontrol,
187 struct snd_ctl_elem_info *uinfo);
188int snd_wss_get_single(struct snd_kcontrol *kcontrol,
189 struct snd_ctl_elem_value *ucontrol);
190int snd_wss_put_single(struct snd_kcontrol *kcontrol,
191 struct snd_ctl_elem_value *ucontrol);
192
193#define WSS_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \
194{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
195 .name = xname, \
196 .index = xindex, \
197 .info = snd_wss_info_double, \
198 .get = snd_wss_get_double, \
199 .put = snd_wss_put_double, \
200 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | \
201 (shift_right << 19) | (mask << 24) | (invert << 22) }
202
203#define WSS_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv) \
204{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
205 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
206 .name = xname, \
207 .index = xindex, \
208 .info = snd_wss_info_single, \
209 .get = snd_wss_get_single, \
210 .put = snd_wss_put_single, \
211 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24), \
212 .tlv = { .p = (xtlv) } }
213
214#define WSS_DOUBLE_TLV(xname, xindex, left_reg, right_reg, \
215 shift_left, shift_right, mask, invert, xtlv) \
216{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
217 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
218 .name = xname, \
219 .index = xindex, \
220 .info = snd_wss_info_double, \
221 .get = snd_wss_get_double, \
222 .put = snd_wss_put_double, \
223 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | \
224 (shift_right << 19) | (mask << 24) | (invert << 22), \
225 .tlv = { .p = (xtlv) } }
226
227
228int snd_wss_info_double(struct snd_kcontrol *kcontrol,
229 struct snd_ctl_elem_info *uinfo);
230int snd_wss_get_double(struct snd_kcontrol *kcontrol,
231 struct snd_ctl_elem_value *ucontrol);
232int snd_wss_put_double(struct snd_kcontrol *kcontrol,
233 struct snd_ctl_elem_value *ucontrol);
234
235#endif /* __SOUND_WSS_H */
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 920c4e9cb93d..6ad87f485992 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -30,6 +30,7 @@
30 */ 30 */
31#define ATMEL_LCDC_WIRING_BGR 0 31#define ATMEL_LCDC_WIRING_BGR 0
32#define ATMEL_LCDC_WIRING_RGB 1 32#define ATMEL_LCDC_WIRING_RGB 1
33#define ATMEL_LCDC_WIRING_RGB555 2
33 34
34 35
35 /* LCD Controller info data structure, stored in device platform_data */ 36 /* LCD Controller info data structure, stored in device platform_data */
diff --git a/include/video/cyblafb.h b/include/video/cyblafb.h
index 717440575380..d3c1d4e2c8e3 100644
--- a/include/video/cyblafb.h
+++ b/include/video/cyblafb.h
@@ -4,7 +4,7 @@
4#endif 4#endif
5 5
6#if CYBLAFB_DEBUG 6#if CYBLAFB_DEBUG
7#define debug(f,a...) printk("%s:" f, __FUNCTION__ , ## a); 7#define debug(f,a...) printk("%s:" f, __func__ , ## a);
8#else 8#else
9#define debug(f,a...) 9#define debug(f,a...)
10#endif 10#endif
diff --git a/include/video/metronomefb.h b/include/video/metronomefb.h
index dab04b4fad7f..9863f4b6d418 100644
--- a/include/video/metronomefb.h
+++ b/include/video/metronomefb.h
@@ -12,14 +12,6 @@
12#ifndef _LINUX_METRONOMEFB_H_ 12#ifndef _LINUX_METRONOMEFB_H_
13#define _LINUX_METRONOMEFB_H_ 13#define _LINUX_METRONOMEFB_H_
14 14
15/* address and control descriptors used by metronome controller */
16struct metromem_desc {
17 u32 mFDADR0;
18 u32 mFSADR0;
19 u32 mFIDR0;
20 u32 mLDCMD0;
21};
22
23/* command structure used by metronome controller */ 15/* command structure used by metronome controller */
24struct metromem_cmd { 16struct metromem_cmd {
25 u16 opcode; 17 u16 opcode;
@@ -29,34 +21,37 @@ struct metromem_cmd {
29 21
30/* struct used by metronome. board specific stuff comes from *board */ 22/* struct used by metronome. board specific stuff comes from *board */
31struct metronomefb_par { 23struct metronomefb_par {
32 unsigned char *metromem;
33 struct metromem_desc *metromem_desc;
34 struct metromem_cmd *metromem_cmd; 24 struct metromem_cmd *metromem_cmd;
35 unsigned char *metromem_wfm; 25 unsigned char *metromem_wfm;
36 unsigned char *metromem_img; 26 unsigned char *metromem_img;
37 u16 *metromem_img_csum; 27 u16 *metromem_img_csum;
38 u16 *csum_table; 28 u16 *csum_table;
39 int metromemsize;
40 dma_addr_t metromem_dma; 29 dma_addr_t metromem_dma;
41 dma_addr_t metromem_desc_dma;
42 struct fb_info *info; 30 struct fb_info *info;
43 struct metronome_board *board; 31 struct metronome_board *board;
44 wait_queue_head_t waitq; 32 wait_queue_head_t waitq;
45 u8 frame_count; 33 u8 frame_count;
34 int extra_size;
35 int dt;
46}; 36};
47 37
48/* board specific routines */ 38/* board specific routines and data */
49struct metronome_board { 39struct metronome_board {
50 struct module *owner; 40 struct module *owner; /* the platform device */
51 void (*free_irq)(struct fb_info *);
52 void (*init_gpio_regs)(struct metronomefb_par *);
53 void (*init_lcdc_regs)(struct metronomefb_par *);
54 void (*post_dma_setup)(struct metronomefb_par *);
55 void (*set_rst)(struct metronomefb_par *, int); 41 void (*set_rst)(struct metronomefb_par *, int);
56 void (*set_stdby)(struct metronomefb_par *, int); 42 void (*set_stdby)(struct metronomefb_par *, int);
43 void (*cleanup)(struct metronomefb_par *);
57 int (*met_wait_event)(struct metronomefb_par *); 44 int (*met_wait_event)(struct metronomefb_par *);
58 int (*met_wait_event_intr)(struct metronomefb_par *); 45 int (*met_wait_event_intr)(struct metronomefb_par *);
59 int (*setup_irq)(struct fb_info *); 46 int (*setup_irq)(struct fb_info *);
47 int (*setup_fb)(struct metronomefb_par *);
48 int (*setup_io)(struct metronomefb_par *);
49 int (*get_panel_type)(void);
50 unsigned char *metromem;
51 int fw;
52 int fh;
53 int wfm_size;
54 struct fb_info *host_fbinfo; /* the host LCD controller's fbi */
60}; 55};
61 56
62#endif 57#endif
diff --git a/include/video/neomagic.h b/include/video/neomagic.h
index 38910da0ae59..08b663782956 100644
--- a/include/video/neomagic.h
+++ b/include/video/neomagic.h
@@ -123,7 +123,6 @@ typedef volatile struct {
123 123
124struct neofb_par { 124struct neofb_par {
125 struct vgastate state; 125 struct vgastate state;
126 struct mutex open_lock;
127 unsigned int ref_count; 126 unsigned int ref_count;
128 127
129 unsigned char MiscOutReg; /* Misc */ 128 unsigned char MiscOutReg; /* Misc */
diff --git a/include/video/radeon.h b/include/video/radeon.h
index 099ffa5e5bee..d5dcaf154ba4 100644
--- a/include/video/radeon.h
+++ b/include/video/radeon.h
@@ -386,7 +386,7 @@
386#define SC_BOTTOM_RIGHT 0x16F0 386#define SC_BOTTOM_RIGHT 0x16F0
387#define SRC_SC_BOTTOM_RIGHT 0x16F4 387#define SRC_SC_BOTTOM_RIGHT 0x16F4
388#define RB2D_DSTCACHE_MODE 0x3428 388#define RB2D_DSTCACHE_MODE 0x3428
389#define RB2D_DSTCACHE_CTLSTAT 0x342C 389#define RB2D_DSTCACHE_CTLSTAT_broken 0x342C /* do not use */
390#define LVDS_GEN_CNTL 0x02d0 390#define LVDS_GEN_CNTL 0x02d0
391#define LVDS_PLL_CNTL 0x02d4 391#define LVDS_PLL_CNTL 0x02d4
392#define FP2_GEN_CNTL 0x0288 392#define FP2_GEN_CNTL 0x0288
@@ -525,6 +525,9 @@
525#define CRTC_DISPLAY_DIS (1 << 10) 525#define CRTC_DISPLAY_DIS (1 << 10)
526#define CRTC_CRT_ON (1 << 15) 526#define CRTC_CRT_ON (1 << 15)
527 527
528/* DSTCACHE_MODE bits constants */
529#define RB2D_DC_AUTOFLUSH_ENABLE (1 << 8)
530#define RB2D_DC_DC_DISABLE_IGNORE_PE (1 << 17)
528 531
529/* DSTCACHE_CTLSTAT bit constants */ 532/* DSTCACHE_CTLSTAT bit constants */
530#define RB2D_DC_FLUSH_2D (1 << 0) 533#define RB2D_DC_FLUSH_2D (1 << 0)
@@ -532,6 +535,9 @@
532#define RB2D_DC_FLUSH_ALL (RB2D_DC_FLUSH_2D | RB2D_DC_FREE_2D) 535#define RB2D_DC_FLUSH_ALL (RB2D_DC_FLUSH_2D | RB2D_DC_FREE_2D)
533#define RB2D_DC_BUSY (1 << 31) 536#define RB2D_DC_BUSY (1 << 31)
534 537
538/* DSTCACHE_MODE bits constants */
539#define RB2D_DC_AUTOFLUSH_ENABLE (1 << 8)
540#define RB2D_DC_DC_DISABLE_IGNORE_PE (1 << 17)
535 541
536/* CRTC_GEN_CNTL bit constants */ 542/* CRTC_GEN_CNTL bit constants */
537#define CRTC_DBL_SCAN_EN 0x00000001 543#define CRTC_DBL_SCAN_EN 0x00000001
@@ -863,15 +869,10 @@
863#define GMC_DST_16BPP_YVYU422 0x00000c00 869#define GMC_DST_16BPP_YVYU422 0x00000c00
864#define GMC_DST_32BPP_AYUV444 0x00000e00 870#define GMC_DST_32BPP_AYUV444 0x00000e00
865#define GMC_DST_16BPP_ARGB4444 0x00000f00 871#define GMC_DST_16BPP_ARGB4444 0x00000f00
866#define GMC_SRC_MONO 0x00000000
867#define GMC_SRC_MONO_LBKGD 0x00001000
868#define GMC_SRC_DSTCOLOR 0x00003000
869#define GMC_BYTE_ORDER_MSB_TO_LSB 0x00000000 872#define GMC_BYTE_ORDER_MSB_TO_LSB 0x00000000
870#define GMC_BYTE_ORDER_LSB_TO_MSB 0x00004000 873#define GMC_BYTE_ORDER_LSB_TO_MSB 0x00004000
871#define GMC_DP_CONVERSION_TEMP_9300 0x00008000 874#define GMC_DP_CONVERSION_TEMP_9300 0x00008000
872#define GMC_DP_CONVERSION_TEMP_6500 0x00000000 875#define GMC_DP_CONVERSION_TEMP_6500 0x00000000
873#define GMC_DP_SRC_RECT 0x02000000
874#define GMC_DP_SRC_HOST 0x03000000
875#define GMC_DP_SRC_HOST_BYTEALIGN 0x04000000 876#define GMC_DP_SRC_HOST_BYTEALIGN 0x04000000
876#define GMC_3D_FCN_EN_CLR 0x00000000 877#define GMC_3D_FCN_EN_CLR 0x00000000
877#define GMC_3D_FCN_EN_SET 0x08000000 878#define GMC_3D_FCN_EN_SET 0x08000000
@@ -882,6 +883,9 @@
882#define GMC_WRITE_MASK_LEAVE 0x00000000 883#define GMC_WRITE_MASK_LEAVE 0x00000000
883#define GMC_WRITE_MASK_SET 0x40000000 884#define GMC_WRITE_MASK_SET 0x40000000
884#define GMC_CLR_CMP_CNTL_DIS (1 << 28) 885#define GMC_CLR_CMP_CNTL_DIS (1 << 28)
886#define GMC_SRC_DATATYPE_MASK (3 << 12)
887#define GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12)
888#define GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12)
885#define GMC_SRC_DATATYPE_COLOR (3 << 12) 889#define GMC_SRC_DATATYPE_COLOR (3 << 12)
886#define ROP3_S 0x00cc0000 890#define ROP3_S 0x00cc0000
887#define ROP3_SRCCOPY 0x00cc0000 891#define ROP3_SRCCOPY 0x00cc0000
@@ -890,6 +894,7 @@
890#define DP_SRC_SOURCE_MASK (7 << 24) 894#define DP_SRC_SOURCE_MASK (7 << 24)
891#define GMC_BRUSH_NONE (15 << 4) 895#define GMC_BRUSH_NONE (15 << 4)
892#define DP_SRC_SOURCE_MEMORY (2 << 24) 896#define DP_SRC_SOURCE_MEMORY (2 << 24)
897#define DP_SRC_SOURCE_HOST_DATA (3 << 24)
893#define GMC_BRUSH_SOLIDCOLOR 0x000000d0 898#define GMC_BRUSH_SOLIDCOLOR 0x000000d0
894 899
895/* DP_MIX bit constants */ 900/* DP_MIX bit constants */
@@ -975,6 +980,12 @@
975#define DISP_PWR_MAN_TV_ENABLE_RST (1 << 25) 980#define DISP_PWR_MAN_TV_ENABLE_RST (1 << 25)
976#define DISP_PWR_MAN_AUTO_PWRUP_EN (1 << 26) 981#define DISP_PWR_MAN_AUTO_PWRUP_EN (1 << 26)
977 982
983/* RBBM_GUICNTL constants */
984#define RBBM_GUICNTL_HOST_DATA_SWAP_NONE (0 << 0)
985#define RBBM_GUICNTL_HOST_DATA_SWAP_16BIT (1 << 0)
986#define RBBM_GUICNTL_HOST_DATA_SWAP_32BIT (2 << 0)
987#define RBBM_GUICNTL_HOST_DATA_SWAP_HDW (3 << 0)
988
978/* masks */ 989/* masks */
979 990
980#define CONFIG_MEMSIZE_MASK 0x1f000000 991#define CONFIG_MEMSIZE_MASK 0x1f000000
diff --git a/include/video/s1d13xxxfb.h b/include/video/s1d13xxxfb.h
index c99d261df8f7..fe41b8407946 100644
--- a/include/video/s1d13xxxfb.h
+++ b/include/video/s1d13xxxfb.h
@@ -14,7 +14,8 @@
14#define S1D13XXXFB_H 14#define S1D13XXXFB_H
15 15
16#define S1D_PALETTE_SIZE 256 16#define S1D_PALETTE_SIZE 256
17#define S1D_CHIP_REV 7 /* expected chip revision number for s1d13806 */ 17#define S1D13506_CHIP_REV 4 /* expected chip revision number for s1d13506 */
18#define S1D13806_CHIP_REV 7 /* expected chip revision number for s1d13806 */
18#define S1D_FBID "S1D13806" 19#define S1D_FBID "S1D13806"
19#define S1D_DEVICENAME "s1d13806fb" 20#define S1D_DEVICENAME "s1d13806fb"
20 21
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
deleted file mode 100644
index fe43b0f3c86a..000000000000
--- a/include/xen/balloon.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/******************************************************************************
2 * balloon.h
3 *
4 * Xen balloon driver - enables returning/claiming memory to/from Xen.
5 *
6 * Copyright (c) 2003, B Dragovic
7 * Copyright (c) 2003-2004, M Williamson, K Fraser
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
33
34#ifndef __XEN_BALLOON_H__
35#define __XEN_BALLOON_H__
36
37#include <linux/spinlock.h>
38
39#if 0
40/*
41 * Inform the balloon driver that it should allow some slop for device-driver
42 * memory activities.
43 */
44void balloon_update_driver_allowance(long delta);
45
46/* Allocate/free a set of empty pages in low memory (i.e., no RAM mapped). */
47struct page **alloc_empty_pages_and_pagevec(int nr_pages);
48void free_empty_pages_and_pagevec(struct page **pagevec, int nr_pages);
49
50void balloon_release_driver_page(struct page *page);
51
52/*
53 * Prevent the balloon driver from changing the memory reservation during
54 * a driver critical region.
55 */
56extern spinlock_t balloon_lock;
57#define balloon_lock(__flags) spin_lock_irqsave(&balloon_lock, __flags)
58#define balloon_unlock(__flags) spin_unlock_irqrestore(&balloon_lock, __flags)
59#endif
60
61#endif /* __XEN_BALLOON_H__ */
diff --git a/include/xen/events.h b/include/xen/events.h
index 4680ff3fbc91..0d5f1adc0363 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -46,6 +46,8 @@ extern void xen_irq_resume(void);
46 46
47/* Clear an irq's pending state, in preparation for polling on it */ 47/* Clear an irq's pending state, in preparation for polling on it */
48void xen_clear_irq_pending(int irq); 48void xen_clear_irq_pending(int irq);
49void xen_set_irq_pending(int irq);
50bool xen_test_irq_pending(int irq);
49 51
50/* Poll waiting for an irq to become pending. In the usual case, the 52/* Poll waiting for an irq to become pending. In the usual case, the
51 irq will be disabled so it won't deliver an interrupt. */ 53 irq will be disabled so it won't deliver an interrupt. */